@overmap-ai/core 1.0.56 → 1.0.57-export-overmap-reducer.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +4 -4
  3. package/dist/constants/ui.d.ts +1 -1
  4. package/dist/contexts/overmap.d.ts +2 -2
  5. package/dist/contexts/sdk/globals.d.ts +3 -3
  6. package/dist/contexts/sdk/sdk.d.ts +2 -2
  7. package/dist/enums/ui.d.ts +1 -1
  8. package/dist/forms/builder/constants.d.ts +1 -1
  9. package/dist/forms/builder/hooks.d.ts +1 -1
  10. package/dist/overmap-core.js +610 -942
  11. package/dist/overmap-core.js.map +1 -1
  12. package/dist/overmap-core.umd.cjs +611 -943
  13. package/dist/overmap-core.umd.cjs.map +1 -1
  14. package/dist/sdk/sdk.d.ts +11 -11
  15. package/dist/sdk/services/AgentService.d.ts +2 -21
  16. package/dist/sdk/services/AssetAttachmentService.d.ts +10 -0
  17. package/dist/sdk/services/AssetService.d.ts +11 -0
  18. package/dist/sdk/services/AssetStageCompletionService.d.ts +16 -0
  19. package/dist/sdk/services/AssetStageService.d.ts +11 -0
  20. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +10 -0
  21. package/dist/sdk/services/AssetTypeService.d.ts +9 -0
  22. package/dist/sdk/services/UserFormService.d.ts +2 -2
  23. package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
  24. package/dist/sdk/services/index.d.ts +6 -6
  25. package/dist/store/index.d.ts +0 -1
  26. package/dist/store/slices/agentsSlice.d.ts +3 -3
  27. package/dist/store/slices/assetSlice.d.ts +63 -0
  28. package/dist/store/slices/assetStageCompletionSlice.d.ts +15 -0
  29. package/dist/store/slices/assetStageSlice.d.ts +32 -0
  30. package/dist/store/slices/assetTypeSlice.d.ts +74 -0
  31. package/dist/store/slices/authSlice.d.ts +3 -3
  32. package/dist/store/slices/categorySlice.d.ts +9 -9
  33. package/dist/store/slices/documentSlice.d.ts +12 -13
  34. package/dist/store/slices/formRevisionSlice.d.ts +7 -7
  35. package/dist/store/slices/formSlice.d.ts +7 -7
  36. package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
  37. package/dist/store/slices/index.d.ts +4 -4
  38. package/dist/store/slices/issueSlice.d.ts +18 -18
  39. package/dist/store/slices/mapSlice.d.ts +4 -4
  40. package/dist/store/slices/organizationAccessSlice.d.ts +3 -3
  41. package/dist/store/slices/outboxSlice.d.ts +3 -3
  42. package/dist/store/slices/projectAccessSlice.d.ts +2 -2
  43. package/dist/store/slices/projectFileSlice.d.ts +7 -7
  44. package/dist/store/slices/projectSlice.d.ts +8 -8
  45. package/dist/store/slices/rehydratedSlice.d.ts +2 -2
  46. package/dist/store/slices/settingsSlice.d.ts +9 -9
  47. package/dist/store/slices/userSlice.d.ts +4 -4
  48. package/dist/store/slices/workspaceSlice.d.ts +6 -6
  49. package/dist/store/store.d.ts +12 -45
  50. package/dist/typings/models/access.d.ts +1 -0
  51. package/dist/typings/models/attachments.d.ts +6 -6
  52. package/dist/typings/models/components.d.ts +11 -7
  53. package/dist/typings/models/forms.d.ts +3 -3
  54. package/dist/typings/models/store.d.ts +2 -3
  55. package/dist/typings/store.d.ts +4 -4
  56. package/dist/utils/colors.d.ts +1 -1
  57. package/dist/utils/utils.d.ts +3 -3
  58. package/package.json +153 -153
  59. package/dist/sdk/services/ComponentAttachmentService.d.ts +0 -10
  60. package/dist/sdk/services/ComponentService.d.ts +0 -11
  61. package/dist/sdk/services/ComponentStageCompletionService.d.ts +0 -17
  62. package/dist/sdk/services/ComponentStageService.d.ts +0 -11
  63. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +0 -10
  64. package/dist/sdk/services/ComponentTypeService.d.ts +0 -9
  65. package/dist/store/hooks.d.ts +0 -4
  66. package/dist/store/slices/ComponentStageCompletionSlice.d.ts +0 -27
  67. package/dist/store/slices/componentSlice.d.ts +0 -73
  68. package/dist/store/slices/componentStageSlice.d.ts +0 -42
  69. package/dist/store/slices/componentTypeSlice.d.ts +0 -75
@@ -15,11 +15,11 @@ import { offline as offline$1 } from "@redux-offline/redux-offline";
15
15
  import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
16
16
  import localforage from "localforage";
17
17
  import createMigration from "redux-persist-migrate";
18
- import { createSlice, createSelector, combineReducers, configureStore, createNextState } from "@reduxjs/toolkit";
18
+ import { createSlice, createSelector, combineReducers, createNextState } from "@reduxjs/toolkit";
19
19
  import request from "superagent";
20
- import { shallowEqual as shallowEqual$1, useDispatch, useSelector } from "react-redux";
21
20
  import { v4 } from "uuid";
22
21
  import ColorCls from "color";
22
+ import { shallowEqual as shallowEqual$1, useSelector } from "react-redux";
23
23
  import jwtDecode from "jwt-decode";
24
24
  import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
25
25
  import { openDB } from "idb";
@@ -384,257 +384,6 @@ function downloadFile(file) {
384
384
  const blob = new Blob([file]);
385
385
  saveAs(blob, file.name);
386
386
  }
387
- const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
388
- function defaultSetTimout() {
389
- throw new Error("setTimeout has not been defined");
390
- }
391
- function defaultClearTimeout() {
392
- throw new Error("clearTimeout has not been defined");
393
- }
394
- var cachedSetTimeout = defaultSetTimout;
395
- var cachedClearTimeout = defaultClearTimeout;
396
- if (typeof global$1.setTimeout === "function") {
397
- cachedSetTimeout = setTimeout;
398
- }
399
- if (typeof global$1.clearTimeout === "function") {
400
- cachedClearTimeout = clearTimeout;
401
- }
402
- function runTimeout(fun) {
403
- if (cachedSetTimeout === setTimeout) {
404
- return setTimeout(fun, 0);
405
- }
406
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
407
- cachedSetTimeout = setTimeout;
408
- return setTimeout(fun, 0);
409
- }
410
- try {
411
- return cachedSetTimeout(fun, 0);
412
- } catch (e) {
413
- try {
414
- return cachedSetTimeout.call(null, fun, 0);
415
- } catch (e2) {
416
- return cachedSetTimeout.call(this, fun, 0);
417
- }
418
- }
419
- }
420
- function runClearTimeout(marker) {
421
- if (cachedClearTimeout === clearTimeout) {
422
- return clearTimeout(marker);
423
- }
424
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
425
- cachedClearTimeout = clearTimeout;
426
- return clearTimeout(marker);
427
- }
428
- try {
429
- return cachedClearTimeout(marker);
430
- } catch (e) {
431
- try {
432
- return cachedClearTimeout.call(null, marker);
433
- } catch (e2) {
434
- return cachedClearTimeout.call(this, marker);
435
- }
436
- }
437
- }
438
- var queue = [];
439
- var draining = false;
440
- var currentQueue;
441
- var queueIndex = -1;
442
- function cleanUpNextTick() {
443
- if (!draining || !currentQueue) {
444
- return;
445
- }
446
- draining = false;
447
- if (currentQueue.length) {
448
- queue = currentQueue.concat(queue);
449
- } else {
450
- queueIndex = -1;
451
- }
452
- if (queue.length) {
453
- drainQueue();
454
- }
455
- }
456
- function drainQueue() {
457
- if (draining) {
458
- return;
459
- }
460
- var timeout = runTimeout(cleanUpNextTick);
461
- draining = true;
462
- var len = queue.length;
463
- while (len) {
464
- currentQueue = queue;
465
- queue = [];
466
- while (++queueIndex < len) {
467
- if (currentQueue) {
468
- currentQueue[queueIndex].run();
469
- }
470
- }
471
- queueIndex = -1;
472
- len = queue.length;
473
- }
474
- currentQueue = null;
475
- draining = false;
476
- runClearTimeout(timeout);
477
- }
478
- function nextTick(fun) {
479
- var args = new Array(arguments.length - 1);
480
- if (arguments.length > 1) {
481
- for (var i = 1; i < arguments.length; i++) {
482
- args[i - 1] = arguments[i];
483
- }
484
- }
485
- queue.push(new Item(fun, args));
486
- if (queue.length === 1 && !draining) {
487
- runTimeout(drainQueue);
488
- }
489
- }
490
- function Item(fun, array) {
491
- this.fun = fun;
492
- this.array = array;
493
- }
494
- Item.prototype.run = function() {
495
- this.fun.apply(null, this.array);
496
- };
497
- var title$1 = "browser";
498
- var platform = "browser";
499
- var browser = true;
500
- var env = {};
501
- var argv = [];
502
- var version = "";
503
- var versions = {};
504
- var release = {};
505
- var config = {};
506
- function noop() {
507
- }
508
- var on = noop;
509
- var addListener = noop;
510
- var once = noop;
511
- var off = noop;
512
- var removeListener = noop;
513
- var removeAllListeners = noop;
514
- var emit = noop;
515
- function binding(name) {
516
- throw new Error("process.binding is not supported");
517
- }
518
- function cwd() {
519
- return "/";
520
- }
521
- function chdir(dir) {
522
- throw new Error("process.chdir is not supported");
523
- }
524
- function umask() {
525
- return 0;
526
- }
527
- var performance = global$1.performance || {};
528
- var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
529
- return (/* @__PURE__ */ new Date()).getTime();
530
- };
531
- function hrtime(previousTimestamp) {
532
- var clocktime = performanceNow.call(performance) * 1e-3;
533
- var seconds = Math.floor(clocktime);
534
- var nanoseconds = Math.floor(clocktime % 1 * 1e9);
535
- if (previousTimestamp) {
536
- seconds = seconds - previousTimestamp[0];
537
- nanoseconds = nanoseconds - previousTimestamp[1];
538
- if (nanoseconds < 0) {
539
- seconds--;
540
- nanoseconds += 1e9;
541
- }
542
- }
543
- return [seconds, nanoseconds];
544
- }
545
- var startTime = /* @__PURE__ */ new Date();
546
- function uptime() {
547
- var currentTime = /* @__PURE__ */ new Date();
548
- var dif = currentTime - startTime;
549
- return dif / 1e3;
550
- }
551
- var browser$1 = {
552
- nextTick,
553
- title: title$1,
554
- browser,
555
- env,
556
- argv,
557
- version,
558
- versions,
559
- on,
560
- addListener,
561
- once,
562
- off,
563
- removeListener,
564
- removeAllListeners,
565
- emit,
566
- binding,
567
- cwd,
568
- chdir,
569
- umask,
570
- hrtime,
571
- platform,
572
- release,
573
- config,
574
- uptime
575
- };
576
- function _typeof(o) {
577
- "@babel/helpers - typeof";
578
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
579
- return typeof o2;
580
- } : function(o2) {
581
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
582
- }, _typeof(o);
583
- }
584
- function _toPrimitive$1(input, hint) {
585
- if (_typeof(input) !== "object" || input === null)
586
- return input;
587
- var prim = input[Symbol.toPrimitive];
588
- if (prim !== void 0) {
589
- var res = prim.call(input, hint || "default");
590
- if (_typeof(res) !== "object")
591
- return res;
592
- throw new TypeError("@@toPrimitive must return a primitive value.");
593
- }
594
- return (hint === "string" ? String : Number)(input);
595
- }
596
- function _toPropertyKey$1(arg) {
597
- var key = _toPrimitive$1(arg, "string");
598
- return _typeof(key) === "symbol" ? key : String(key);
599
- }
600
- function _defineProperty$1(obj, key, value) {
601
- key = _toPropertyKey$1(key);
602
- if (key in obj) {
603
- Object.defineProperty(obj, key, {
604
- value,
605
- enumerable: true,
606
- configurable: true,
607
- writable: true
608
- });
609
- } else {
610
- obj[key] = value;
611
- }
612
- return obj;
613
- }
614
- function ownKeys$1(e, r) {
615
- var t = Object.keys(e);
616
- if (Object.getOwnPropertySymbols) {
617
- var o = Object.getOwnPropertySymbols(e);
618
- r && (o = o.filter(function(r2) {
619
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
620
- })), t.push.apply(t, o);
621
- }
622
- return t;
623
- }
624
- function _objectSpread2(e) {
625
- for (var r = 1; r < arguments.length; r++) {
626
- var t = null != arguments[r] ? arguments[r] : {};
627
- r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
628
- _defineProperty$1(e, r2, t[r2]);
629
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
630
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
631
- });
632
- }
633
- return e;
634
- }
635
- function formatProdErrorMessage(code) {
636
- 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. ";
637
- }
638
387
  var randomString = function randomString2() {
639
388
  return Math.random().toString(36).substring(7).split("").join(".");
640
389
  };
@@ -663,32 +412,6 @@ function compose() {
663
412
  };
664
413
  });
665
414
  }
666
- function applyMiddleware() {
667
- for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
668
- middlewares[_key] = arguments[_key];
669
- }
670
- return function(createStore) {
671
- return function() {
672
- var store = createStore.apply(void 0, arguments);
673
- var _dispatch = function dispatch() {
674
- throw new Error(browser$1.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
675
- };
676
- var middlewareAPI = {
677
- getState: store.getState,
678
- dispatch: function dispatch() {
679
- return _dispatch.apply(void 0, arguments);
680
- }
681
- };
682
- var chain = middlewares.map(function(middleware) {
683
- return middleware(middlewareAPI);
684
- });
685
- _dispatch = compose.apply(void 0, chain)(store.dispatch);
686
- return _objectSpread2(_objectSpread2({}, store), {}, {
687
- dispatch: _dispatch
688
- });
689
- };
690
- };
691
- }
692
415
  var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
693
416
  HttpMethod2["GET"] = "GET";
694
417
  HttpMethod2["POST"] = "POST";
@@ -1350,7 +1073,7 @@ const ColorsToString = {
1350
1073
  [mint.mint9]: "mint",
1351
1074
  [sky.sky9]: "sky"
1352
1075
  };
1353
- const ComponentStageColors = {
1076
+ const AssetStageColors = {
1354
1077
  indigo: indigo.indigo9,
1355
1078
  red: red.red9,
1356
1079
  violet: violet.violet9,
@@ -1372,7 +1095,7 @@ const generateBadgeColors = (rawColor) => {
1372
1095
  return { backgroundColor, textColor };
1373
1096
  };
1374
1097
  function getStageColor(index2) {
1375
- return Object.values(ComponentStageColors)[index2 % Object.keys(ComponentStageColors).length];
1098
+ return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
1376
1099
  }
1377
1100
  const getLocalDateString = memoize((date) => {
1378
1101
  if (!date)
@@ -1592,122 +1315,115 @@ function removeAttachments(state, action) {
1592
1315
  }
1593
1316
  }
1594
1317
  const initialState$q = {
1595
- componentTypes: {},
1596
- hiddenComponentTypeIds: {},
1318
+ assetTypes: {},
1319
+ hiddenAssetTypeIds: {},
1597
1320
  attachments: {}
1598
1321
  };
1599
- const componentTypeSlice = createSlice({
1600
- name: "componentTypes",
1322
+ const assetTypeSlice = createSlice({
1323
+ name: "assetTypes",
1601
1324
  initialState: initialState$q,
1602
1325
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1603
1326
  reducers: {
1604
- addComponentType: (state, action) => {
1605
- state.componentTypes[action.payload.offline_id] = action.payload;
1327
+ addAssetType: (state, action) => {
1328
+ state.assetTypes[action.payload.offline_id] = action.payload;
1606
1329
  },
1607
- setComponentTypes: (state, action) => {
1608
- state.componentTypes = toOfflineIdRecord(action.payload);
1330
+ setAssetTypes: (state, action) => {
1331
+ state.assetTypes = toOfflineIdRecord(action.payload);
1609
1332
  },
1610
- toggleComponentTypeVisibility: (state, action) => {
1611
- state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1333
+ toggleAssetTypeVisibility: (state, action) => {
1334
+ state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
1612
1335
  },
1613
- deleteComponentType: (state, action) => {
1614
- delete state.componentTypes[action.payload];
1336
+ deleteAssetType: (state, action) => {
1337
+ delete state.assetTypes[action.payload];
1615
1338
  },
1616
1339
  // Attachments
1617
- setComponentTypeAttachment: setAttachment,
1618
- setComponentTypeAttachments: setAttachments,
1619
- addComponentTypeAttachment: addAttachment,
1620
- addComponentTypeAttachments: addAttachments,
1621
- updateComponentTypeAttachment: updateAttachment,
1622
- updateComponentTypeAttachments: updateAttachments,
1623
- removeComponentTypeAttachment: removeAttachment,
1624
- removeComponentTypeAttachments: removeAttachments
1340
+ setAssetTypeAttachment: setAttachment,
1341
+ setAssetTypeAttachments: setAttachments,
1342
+ addAssetTypeAttachment: addAttachment,
1343
+ addAssetTypeAttachments: addAttachments,
1344
+ updateAssetTypeAttachment: updateAttachment,
1345
+ updateAssetTypeAttachments: updateAttachments,
1346
+ removeAssetTypeAttachment: removeAttachment,
1347
+ removeAssetTypeAttachments: removeAttachments
1625
1348
  }
1626
1349
  });
1627
1350
  const {
1628
- addComponentType,
1629
- setComponentTypes,
1630
- toggleComponentTypeVisibility,
1631
- deleteComponentType,
1351
+ addAssetType,
1352
+ setAssetTypes,
1353
+ toggleAssetTypeVisibility,
1354
+ deleteAssetType,
1632
1355
  // Attachmet
1633
- setComponentTypeAttachment,
1634
- setComponentTypeAttachments,
1635
- addComponentTypeAttachment,
1636
- addComponentTypeAttachments,
1637
- updateComponentTypeAttachment,
1638
- updateComponentTypeAttachments,
1639
- removeComponentTypeAttachment,
1640
- removeComponentTypeAttachments
1641
- } = componentTypeSlice.actions;
1642
- const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1643
- const selectComponentTypes = createSelector(
1644
- [selectComponentTypesMapping],
1356
+ setAssetTypeAttachment,
1357
+ setAssetTypeAttachments,
1358
+ addAssetTypeAttachment,
1359
+ addAssetTypeAttachments,
1360
+ updateAssetTypeAttachment,
1361
+ updateAssetTypeAttachments,
1362
+ removeAssetTypeAttachment,
1363
+ removeAssetTypeAttachments
1364
+ } = assetTypeSlice.actions;
1365
+ const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
1366
+ const selectAssetTypes = createSelector(
1367
+ [selectAssetTypesMapping],
1645
1368
  (mapping) => Object.values(mapping)
1646
1369
  );
1647
- const selectComponentType = restructureCreateSelectorWithArgs(
1648
- createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
1370
+ const selectAssetType = restructureCreateSelectorWithArgs(
1371
+ createSelector(
1372
+ [selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
1373
+ (mapping, assetTypeId) => mapping[assetTypeId]
1374
+ )
1649
1375
  );
1650
- const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1376
+ const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1651
1377
  createSelector(
1652
- [
1653
- selectComponentTypesMapping,
1654
- (_state, args) => args
1655
- ],
1378
+ [selectAssetTypesMapping, (_state, args) => args],
1656
1379
  (mapping, args) => {
1657
1380
  var _a2;
1658
1381
  const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
1659
1382
  return Object.values(mapping).filter(
1660
- (componentType) => {
1383
+ (assetType) => {
1661
1384
  var _a3;
1662
- return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
1385
+ return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
1663
1386
  }
1664
1387
  ).length;
1665
1388
  }
1666
1389
  )
1667
1390
  );
1668
- const selectComponentTypesByName = restructureCreateSelectorWithArgs(
1669
- createSelector(
1670
- [selectComponentTypesMapping, (_state, name) => name],
1671
- (mapping, name) => {
1672
- name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1673
- return Object.values(mapping).filter(
1674
- (componentType) => {
1675
- var _a2;
1676
- return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1677
- }
1678
- );
1679
- }
1680
- )
1391
+ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
1392
+ createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
1393
+ name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1394
+ return Object.values(mapping).filter((assetType) => {
1395
+ var _a2;
1396
+ return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1397
+ });
1398
+ })
1681
1399
  );
1682
- const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
1683
- const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
1684
- const selectAllComponentTypeAttachments = createSelector(
1685
- [selectComponentTypeAttachmentMapping],
1400
+ const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
1401
+ const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
1402
+ const selectAssetTypeAttachments = createSelector(
1403
+ [selectAssetTypeAttachmentMapping],
1686
1404
  (mapping) => Object.values(mapping)
1687
1405
  );
1688
- const selectComponentTypeAttachment = (attachmentId) => (state) => {
1689
- return state.componentTypeReducer.attachments[attachmentId];
1406
+ const selectAssetTypeAttachment = (attachmentId) => (state) => {
1407
+ return state.assetTypeReducer.attachments[attachmentId];
1690
1408
  };
1691
- const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
1409
+ const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
1692
1410
  createSelector(
1693
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1694
- (attachments, componentTypeId) => {
1695
- return attachments.filter(({ component_type }) => componentTypeId === component_type);
1411
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1412
+ (attachments, assetTypeId) => {
1413
+ return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
1696
1414
  }
1697
1415
  )
1698
1416
  );
1699
- const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
1417
+ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
1700
1418
  createSelector(
1701
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
1702
- (attachments, componentTypeId) => {
1703
- const attachmentsOfComponent = attachments.filter(
1704
- ({ component_type }) => component_type === componentTypeId
1705
- );
1706
- const fileAttachments = attachmentsOfComponent.filter(
1419
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1420
+ (attachments, assetTypeId) => {
1421
+ const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
1422
+ const fileAttachments = attachmentsOfAssetType.filter(
1707
1423
  // this null check here is necessary, there are cases where file_type is null or undefined
1708
1424
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1709
1425
  );
1710
- const imageAttachments = attachmentsOfComponent.filter(
1426
+ const imageAttachments = attachmentsOfAssetType.filter(
1711
1427
  // this null check here is necessary, there are cases where file_type is null or undefined
1712
1428
  ({ file_type }) => file_type && file_type.startsWith("image/")
1713
1429
  );
@@ -1715,173 +1431,157 @@ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs
1715
1431
  }
1716
1432
  )
1717
1433
  );
1718
- const componentTypeReducer = componentTypeSlice.reducer;
1434
+ const assetTypeReducer = assetTypeSlice.reducer;
1719
1435
  const initialState$p = {
1720
- components: {},
1436
+ assets: {},
1721
1437
  attachments: {}
1722
1438
  };
1723
- const componentSlice = createSlice({
1724
- name: "components",
1439
+ const assetSlice = createSlice({
1440
+ name: "assets",
1725
1441
  initialState: initialState$p,
1726
1442
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1727
1443
  reducers: {
1728
- addComponent: (state, action) => {
1729
- state.components[action.payload.offline_id] = action.payload;
1730
- prevComponents = null;
1444
+ addAsset: (state, action) => {
1445
+ state.assets[action.payload.offline_id] = action.payload;
1446
+ prevAssets = null;
1731
1447
  },
1732
- addComponentsInBatches: (state, action) => {
1733
- Object.assign(state.components, toOfflineIdRecord(action.payload));
1734
- prevComponents = null;
1448
+ addAssetsInBatches: (state, action) => {
1449
+ Object.assign(state.assets, toOfflineIdRecord(action.payload));
1450
+ prevAssets = null;
1735
1451
  },
1736
- setComponents: (state, action) => {
1737
- state.components = toOfflineIdRecord(action.payload);
1738
- prevComponents = null;
1452
+ setAssets: (state, action) => {
1453
+ state.assets = toOfflineIdRecord(action.payload);
1454
+ prevAssets = null;
1739
1455
  },
1740
- updateComponent: (state, action) => {
1741
- if (action.payload.offline_id in state.components) {
1742
- state.components[action.payload.offline_id] = action.payload;
1456
+ updateAsset: (state, action) => {
1457
+ if (action.payload.offline_id in state.assets) {
1458
+ state.assets[action.payload.offline_id] = action.payload;
1743
1459
  } else {
1744
- throw new Error(`Tried to update component with ID that doesn't exist: ${action.payload.offline_id}`);
1460
+ throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
1745
1461
  }
1746
- prevComponents = null;
1462
+ prevAssets = null;
1747
1463
  },
1748
- removeComponent: (state, action) => {
1749
- if (action.payload in state.components) {
1750
- delete state.components[action.payload];
1464
+ removeAsset: (state, action) => {
1465
+ if (action.payload in state.assets) {
1466
+ delete state.assets[action.payload];
1751
1467
  } else {
1752
- throw new Error(`Failed to remove component because ID doesn't exist: ${action.payload}`);
1468
+ throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
1753
1469
  }
1754
- prevComponents = null;
1470
+ prevAssets = null;
1755
1471
  },
1756
- removeAllComponentsOfType: (state, action) => {
1472
+ removeAllAssetsOfType: (state, action) => {
1757
1473
  var _a2;
1758
- for (const componentId in state.components) {
1759
- if (((_a2 = state.components[componentId]) == null ? void 0 : _a2.component_type) === action.payload) {
1760
- delete state.components[componentId];
1474
+ for (const componentId in state.assets) {
1475
+ if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
1476
+ delete state.assets[componentId];
1761
1477
  }
1762
1478
  }
1763
- prevComponents = null;
1479
+ prevAssets = null;
1764
1480
  },
1765
1481
  // Attachments
1766
- setComponentAttachment: setAttachment,
1767
- setComponentAttachments: setAttachments,
1768
- addComponentAttachment: addAttachment,
1769
- addComponentAttachments: addAttachments,
1770
- updateComponentAttachment: updateAttachment,
1771
- updateComponentAttachments: updateAttachments,
1772
- removeComponentAttachment: removeAttachment,
1773
- removeComponentAttachments: removeAttachments
1482
+ setAssetAttachment: setAttachment,
1483
+ setAssetAttachments: setAttachments,
1484
+ addAssetAttachment: addAttachment,
1485
+ addAssetAttachments: addAttachments,
1486
+ updateAssetAttachment: updateAttachment,
1487
+ updateAssetAttachments: updateAttachments,
1488
+ removeAssetAttachment: removeAttachment,
1489
+ removeAssetAttachments: removeAttachments
1774
1490
  }
1775
1491
  });
1776
1492
  const {
1777
- addComponent,
1778
- updateComponent,
1779
- removeComponent,
1780
- addComponentsInBatches,
1781
- setComponents,
1782
- removeAllComponentsOfType,
1493
+ addAsset,
1494
+ updateAsset,
1495
+ removeAsset,
1496
+ addAssetsInBatches,
1497
+ setAssets,
1498
+ removeAllAssetsOfType,
1783
1499
  // Attachments
1784
- setComponentAttachment,
1785
- setComponentAttachments,
1786
- addComponentAttachment,
1787
- addComponentAttachments,
1788
- updateComponentAttachment,
1789
- updateComponentAttachments,
1790
- removeComponentAttachment,
1791
- removeComponentAttachments
1792
- } = componentSlice.actions;
1793
- let prevComponents = null;
1794
- const selectComponents = (state) => {
1795
- if (!prevComponents) {
1796
- prevComponents = Object.values(state.componentReducer.components);
1797
- }
1798
- return prevComponents;
1500
+ setAssetAttachment,
1501
+ setAssetAttachments,
1502
+ addAssetAttachment,
1503
+ addAssetAttachments,
1504
+ updateAssetAttachment,
1505
+ updateAssetAttachments,
1506
+ removeAssetAttachment,
1507
+ removeAssetAttachments
1508
+ } = assetSlice.actions;
1509
+ let prevAssets = null;
1510
+ const selectAssets = (state) => {
1511
+ if (!prevAssets) {
1512
+ prevAssets = Object.values(state.assetReducer.assets);
1513
+ }
1514
+ return prevAssets;
1799
1515
  };
1800
- const selectComponentsMapping = (state) => state.componentReducer.components;
1801
- const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
1802
- createSelector(
1803
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1804
- (components, componentTypeId) => {
1805
- if (!componentTypeId)
1806
- return [];
1807
- return components.filter((component) => component.component_type === componentTypeId);
1808
- }
1809
- )
1516
+ const selectAssetsMapping = (state) => state.assetReducer.assets;
1517
+ const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
1518
+ createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
1519
+ return components.filter((asset) => asset.asset_type === assetTypeId);
1520
+ })
1810
1521
  );
1811
- const selectComponent = (componentId) => (state) => {
1812
- return state.componentReducer.components[componentId];
1813
- };
1814
- const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
1815
- return state.componentTypeReducer.componentTypes[componentTypeId];
1522
+ const selectAsset = (assetId) => (state) => {
1523
+ return state.assetReducer.assets[assetId];
1816
1524
  };
1817
- const selectComponentTypeFromComponents = createSelector(
1818
- [selectComponents, selectComponentTypesMapping],
1819
- (components, componentTypeMapping) => {
1525
+ const selectAssetToAssetTypeMapping = createSelector(
1526
+ [selectAssets, selectAssetTypesMapping],
1527
+ (assets, assetTypeMapping) => {
1820
1528
  const ret = {};
1821
- for (const component of components) {
1822
- const componentType = componentTypeMapping[component.component_type];
1823
- if (!componentType) {
1529
+ for (const asset of assets) {
1530
+ const assetType = assetTypeMapping[asset.asset_type];
1531
+ if (!assetType) {
1824
1532
  console.error(
1825
- `Component type with ID ${component.component_type} not found.
1826
- Expected all referenced component types to be populated.
1533
+ `Asset type with ID ${asset.asset_type} not found.
1534
+ Expected all referenced asset types to be populated.
1827
1535
  Returning empty object to avoid fatal errors.`
1828
1536
  );
1829
1537
  return {};
1830
1538
  }
1831
- ret[component.offline_id] = componentType;
1539
+ ret[asset.offline_id] = assetType;
1832
1540
  }
1833
1541
  return ret;
1834
1542
  }
1835
1543
  );
1836
- const selectComponentsByType = restructureCreateSelectorWithArgs(
1837
- createSelector(
1838
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1839
- (components, componentTypeId) => {
1840
- return components.filter((component) => component.component_type === componentTypeId);
1841
- }
1842
- )
1843
- );
1844
- const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1544
+ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
1845
1545
  var _a2;
1846
- if (!componentTypeId)
1546
+ if (!assetTypeId)
1847
1547
  return 0;
1848
- return (_a2 = selectComponentsByType(componentTypeId)(state)) == null ? void 0 : _a2.length;
1548
+ return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
1849
1549
  };
1850
- const selectComponentTypesFromIds = (componentTypeIds) => (state) => {
1851
- return componentTypeIds.reduce((acc, componentTypeId) => {
1852
- const componentType = state.componentTypeReducer.componentTypes[componentTypeId];
1853
- if (componentType) {
1854
- acc.push(componentType);
1550
+ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
1551
+ return assetTypeIds.reduce((acc, assetTypeId) => {
1552
+ const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
1553
+ if (assetType) {
1554
+ acc.push(assetType);
1855
1555
  }
1856
1556
  return acc;
1857
1557
  }, []);
1858
1558
  };
1859
- const selectComponentAttachmentMapping = (state) => state.componentReducer.attachments;
1860
- const selectAllComponentAttachments = createSelector(
1861
- [selectComponentAttachmentMapping],
1559
+ const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
1560
+ const selectAssetAttachments = createSelector(
1561
+ [selectAssetAttachmentMapping],
1862
1562
  (mapping) => Object.values(mapping)
1863
1563
  );
1864
- const selectComponentAttachment = (attachmentId) => (state) => {
1865
- return state.componentReducer.attachments[attachmentId];
1564
+ const selectAssetAttachment = (attachmentId) => (state) => {
1565
+ return state.assetReducer.attachments[attachmentId];
1866
1566
  };
1867
- const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
1567
+ const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
1868
1568
  createSelector(
1869
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1870
- (attachments, componentId) => {
1871
- return attachments.filter(({ component }) => componentId === component);
1569
+ [selectAssetAttachments, (_state, assetId) => assetId],
1570
+ (attachments, assetId) => {
1571
+ return attachments.filter(({ asset }) => assetId === asset);
1872
1572
  }
1873
1573
  )
1874
1574
  );
1875
- const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1575
+ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
1876
1576
  createSelector(
1877
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1878
- (attachments, componentId) => {
1879
- const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
1880
- const fileAttachments = attachmentsOfComponent.filter(
1577
+ [selectAssetAttachments, (_state, assetId) => assetId],
1578
+ (attachments, assetId) => {
1579
+ const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
1580
+ const fileAttachments = attachmentsOfAsset.filter(
1881
1581
  // this null check here is necessary, there are cases where file_type is null or undefined
1882
1582
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1883
1583
  );
1884
- const imageAttachments = attachmentsOfComponent.filter(
1584
+ const imageAttachments = attachmentsOfAsset.filter(
1885
1585
  // this null check here is necessary, there are cases where file_type is null or undefined
1886
1586
  ({ file_type }) => file_type && file_type.startsWith("image/")
1887
1587
  );
@@ -1889,69 +1589,67 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1889
1589
  }
1890
1590
  )
1891
1591
  );
1892
- const componentReducer = componentSlice.reducer;
1592
+ const assetReducer = assetSlice.reducer;
1893
1593
  const initialState$o = {
1894
- completionsByComponentId: {}
1594
+ completionsByAssetId: {}
1895
1595
  };
1896
- const componentStageCompletionSlice = createSlice({
1897
- name: "componentStageCompletions",
1596
+ const assetStageCompletionSlice = createSlice({
1597
+ name: "assetStageCompletions",
1898
1598
  initialState: initialState$o,
1899
1599
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1900
1600
  reducers: {
1901
1601
  addStageCompletion: (state, action) => {
1902
- let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
1602
+ let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
1903
1603
  if (!stageToCompletionDateMapping) {
1904
1604
  stageToCompletionDateMapping = {};
1905
- state.completionsByComponentId[action.payload.component] = stageToCompletionDateMapping;
1605
+ state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
1906
1606
  }
1907
1607
  stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
1908
1608
  },
1909
1609
  addStageCompletions: (state, action) => {
1910
- for (const [componentId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1610
+ for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1911
1611
  if (Object.keys(stageIdToCompletionDateMapping).length === 0)
1912
- throw new Error(
1913
- `Encountered empty stageIdToCompletionDateMapping argument for component ${componentId}`
1914
- );
1915
- let thisComponentCompletions = state.completionsByComponentId[componentId];
1916
- if (thisComponentCompletions === void 0) {
1917
- thisComponentCompletions = {};
1612
+ throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
1613
+ let thisAssetCompletions = state.completionsByAssetId[assetId];
1614
+ if (thisAssetCompletions === void 0) {
1615
+ thisAssetCompletions = {};
1918
1616
  }
1919
1617
  for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
1920
- thisComponentCompletions[stageId] = completionDate;
1618
+ thisAssetCompletions[stageId] = completionDate;
1921
1619
  }
1922
- state.completionsByComponentId[componentId] = thisComponentCompletions;
1620
+ state.completionsByAssetId[assetId] = thisAssetCompletions;
1923
1621
  }
1924
1622
  },
1925
1623
  removeStageCompletions: (state, action) => {
1926
1624
  for (const completion of action.payload) {
1927
- const thisComponentCompletions = state.completionsByComponentId[completion.component];
1928
- if (!thisComponentCompletions || !(completion.stage in thisComponentCompletions)) {
1625
+ const thisAssetCompletions = state.completionsByAssetId[completion.asset];
1626
+ if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
1929
1627
  console.warn(
1930
1628
  "Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
1931
1629
  );
1932
1630
  continue;
1933
1631
  }
1934
- delete thisComponentCompletions[completion.stage];
1632
+ delete thisAssetCompletions[completion.stage];
1935
1633
  }
1936
1634
  },
1937
1635
  setStageCompletions: (state, action) => {
1938
- state.completionsByComponentId = action.payload;
1636
+ state.completionsByAssetId = action.payload;
1939
1637
  }
1940
1638
  }
1941
1639
  });
1942
- const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = componentStageCompletionSlice.actions;
1640
+ const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
1943
1641
  const selectCompletedStages = (state) => {
1944
- return state.componentStageCompletionReducer.completionsByComponentId;
1642
+ return state.assetStageCompletionReducer.completionsByAssetId;
1945
1643
  };
1946
- const selectCompletedStageIdsForComponent = (component) => (state) => {
1947
- return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1644
+ const selectCompletedStageIdsForAsset = (asset) => (state) => {
1645
+ return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
1948
1646
  };
1949
- const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1647
+ const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
1950
1648
  const initialState$n = {
1951
1649
  stages: {}
1952
1650
  };
1953
- const componentStageSlice = createSlice({
1954
- name: "componentStages",
1651
+ const assetStageSlice = createSlice({
1652
+ name: "assetStages",
1955
1653
  initialState: initialState$n,
1956
1654
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1957
1655
  reducers: {
@@ -1986,7 +1684,7 @@ const componentStageSlice = createSlice({
1986
1684
  }
1987
1685
  }
1988
1686
  });
1989
- const selectStageMapping = (state) => state.componentStageReducer.stages;
1687
+ const selectStageMapping = (state) => state.assetStageReducer.stages;
1990
1688
  const selectStage = restructureCreateSelectorWithArgs(
1991
1689
  createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
1992
1690
  return stageMapping[stageId];
@@ -1998,48 +1696,39 @@ const selectStages = createSelector(
1998
1696
  return Object.values(stageMapping);
1999
1697
  }
2000
1698
  );
2001
- const selectStagesFromComponentTypeIds = restructureCreateSelectorWithArgs(
2002
- createSelector(
2003
- [selectStages, (_state, componentTypeIds) => componentTypeIds],
2004
- (stages, componentTypeIds) => {
2005
- const componentTypeIdsSet = new Set(componentTypeIds);
2006
- const ret = {};
2007
- for (const stage of stages) {
2008
- if (componentTypeIdsSet.has(stage.component_type)) {
2009
- if (!ret[stage.component_type]) {
2010
- ret[stage.component_type] = [];
2011
- }
2012
- ret[stage.component_type].push(stage);
1699
+ const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
1700
+ createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
1701
+ const assetTypeIdsSet = new Set(assetTypeIds);
1702
+ const ret = {};
1703
+ for (const stage of stages) {
1704
+ if (assetTypeIdsSet.has(stage.asset_type)) {
1705
+ if (!ret[stage.asset_type]) {
1706
+ ret[stage.asset_type] = [];
2013
1707
  }
1708
+ ret[stage.asset_type].push(stage);
2014
1709
  }
2015
- for (const key in ret) {
2016
- ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
2017
- }
2018
- return ret;
2019
1710
  }
2020
- )
1711
+ for (const key in ret) {
1712
+ ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
1713
+ }
1714
+ return ret;
1715
+ })
2021
1716
  );
2022
- const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
2023
- createSelector(
2024
- [selectStageMapping, (_state, componentTypeId) => componentTypeId],
2025
- (stagesMapping, componentTypeId) => {
2026
- const componentTypeStagesMapping = {};
2027
- for (const [stageId, stage] of Object.entries(stagesMapping)) {
2028
- if (stage.component_type === componentTypeId) {
2029
- componentTypeStagesMapping[stageId] = stage;
2030
- }
1717
+ const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
1718
+ createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
1719
+ const assetTypeStagesMapping = {};
1720
+ for (const [stageId, stage] of Object.entries(stagesMapping)) {
1721
+ if (stage.asset_type === assetTypeId) {
1722
+ assetTypeStagesMapping[stageId] = stage;
2031
1723
  }
2032
- return componentTypeStagesMapping;
2033
1724
  }
2034
- )
1725
+ return assetTypeStagesMapping;
1726
+ })
2035
1727
  );
2036
- const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
2037
- createSelector(
2038
- [selectStages, (_state, componentTypeId) => componentTypeId],
2039
- (stages, componentTypeId) => {
2040
- return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
2041
- }
2042
- )
1728
+ const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
1729
+ createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
1730
+ return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
1731
+ })
2043
1732
  );
2044
1733
  const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
2045
1734
  createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
@@ -2061,8 +1750,8 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
2061
1750
  return ret;
2062
1751
  })
2063
1752
  );
2064
- const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
2065
- const componentStageReducer = componentStageSlice.reducer;
1753
+ const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
1754
+ const assetStageReducer = assetStageSlice.reducer;
2066
1755
  const initialState$m = {
2067
1756
  workspaces: {},
2068
1757
  activeWorkspaceId: null
@@ -2430,9 +2119,12 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
2430
2119
  );
2431
2120
  const selectIssueUpdateMapping = (state) => state.issueReducer.updates;
2432
2121
  const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
2433
- createSelector([selectIssueUpdateMapping, (_state, issueId) => issueId], (updates, issueId) => {
2434
- return Object.values(updates).filter((update) => update.issue === issueId);
2435
- })
2122
+ createSelector(
2123
+ [selectIssueUpdateMapping, (_state, issueId) => issueId],
2124
+ (updates, issueId) => {
2125
+ return Object.values(updates).filter((update) => update.issue === issueId);
2126
+ }
2127
+ )
2436
2128
  );
2437
2129
  const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
2438
2130
  createSelector(
@@ -2721,8 +2413,8 @@ var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
2721
2413
  })(OrganizationAccessLevel || {});
2722
2414
  var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
2723
2415
  AttachmentModel2["Issue"] = "issue";
2724
- AttachmentModel2["Component"] = "component";
2725
- AttachmentModel2["ComponentType"] = "component_type";
2416
+ AttachmentModel2["Asset"] = "asset";
2417
+ AttachmentModel2["AssetType"] = "asset_type";
2726
2418
  AttachmentModel2["Project"] = "project";
2727
2419
  AttachmentModel2["Document"] = "document";
2728
2420
  return AttachmentModel2;
@@ -3535,6 +3227,7 @@ const initialState$8 = {
3535
3227
  placementMode: false,
3536
3228
  enableClustering: false,
3537
3229
  svgLayout: false,
3230
+ // TODO: this is no longer used
3538
3231
  expandedSections: {
3539
3232
  Issues: true,
3540
3233
  "Map Layers": false,
@@ -3739,33 +3432,36 @@ const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
3739
3432
  })
3740
3433
  );
3741
3434
  const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
3742
- createSelector([selectFormRevisions, (_state, formId2) => formId2], (revisions, formId2) => {
3743
- return revisions.filter((revision) => {
3744
- return revision.form === formId2;
3745
- });
3746
- })
3435
+ createSelector(
3436
+ [selectFormRevisions, (_state, formId2) => formId2],
3437
+ (revisions, formId2) => {
3438
+ return revisions.filter((revision) => {
3439
+ return revision.form === formId2;
3440
+ });
3441
+ }
3442
+ )
3747
3443
  );
3748
- const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
3444
+ const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
3749
3445
  createSelector(
3750
3446
  [
3751
3447
  (state) => state.formReducer.forms,
3752
3448
  selectFormRevisionMapping,
3753
- (_state, componentTypeIds) => componentTypeIds
3449
+ (_state, assetTypeIds) => assetTypeIds
3754
3450
  ],
3755
- (userForms, revisions, componentTypeIds) => {
3756
- const componentTypeIdsSet = new Set(componentTypeIds);
3757
- const formsOfComponentTypes = {};
3451
+ (userForms, revisions, assetTypeIds) => {
3452
+ const assetTypeIdsSet = new Set(assetTypeIds);
3453
+ const formsOfAssetTypes = {};
3758
3454
  const ret = {};
3759
3455
  for (const form of Object.values(userForms)) {
3760
- if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
3761
- formsOfComponentTypes[form.offline_id] = form;
3456
+ if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
3457
+ formsOfAssetTypes[form.offline_id] = form;
3762
3458
  }
3763
3459
  }
3764
3460
  for (const revision of Object.values(revisions)) {
3765
- const form = formsOfComponentTypes[revision.form];
3766
- if (!form || !form.component_type || ret[form.component_type] && formRevisionSortFn(ret[form.component_type], revision) > 0)
3461
+ const form = formsOfAssetTypes[revision.form];
3462
+ if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
3767
3463
  continue;
3768
- ret[form.component_type] = revision;
3464
+ ret[form.asset_type] = revision;
3769
3465
  }
3770
3466
  return ret;
3771
3467
  }
@@ -3882,11 +3578,11 @@ const selectForm = (formId2) => (state) => {
3882
3578
  const selectFormMapping = (state) => {
3883
3579
  return state.formReducer.forms;
3884
3580
  };
3885
- const selectFormOfComponentType = restructureCreateSelectorWithArgs(
3581
+ const selectFormOfAssetType = restructureCreateSelectorWithArgs(
3886
3582
  createSelector(
3887
- [selectFormMapping, (_state, componentTypeId) => componentTypeId],
3888
- (userForms, componentTypeId) => {
3889
- return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
3583
+ [selectFormMapping, (_state, assetTypeId) => assetTypeId],
3584
+ (userForms, assetTypeId) => {
3585
+ return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
3890
3586
  }
3891
3587
  )
3892
3588
  );
@@ -3902,7 +3598,7 @@ const selectFormsCount = createSelector([selectFormMapping], (userForms) => {
3902
3598
  return Object.keys(userForms).length;
3903
3599
  });
3904
3600
  const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) => {
3905
- return Object.values(userForms).filter((form) => !form.component_type).length;
3601
+ return Object.values(userForms).filter((form) => !form.asset_type).length;
3906
3602
  });
3907
3603
  const formReducer = formSlice.reducer;
3908
3604
  const initialState$5 = {
@@ -4110,31 +3806,31 @@ const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
4110
3806
  }
4111
3807
  )
4112
3808
  );
4113
- const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
3809
+ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
4114
3810
  createSelector(
4115
- [selectFormSubmissions, (_state, componentId) => componentId],
4116
- (submissions, componentId) => {
3811
+ [selectFormSubmissions, (_state, assetId) => assetId],
3812
+ (submissions, assetId) => {
4117
3813
  return submissions.filter((submission) => {
4118
- return submission.component === componentId;
3814
+ return submission.asset === assetId;
4119
3815
  });
4120
3816
  }
4121
3817
  )
4122
3818
  );
4123
- const selectFormSubmissionsByComponents = createSelector(
4124
- [selectFormSubmissionsMapping, selectComponentsMapping],
4125
- (submissions, components) => {
3819
+ const selectFormSubmissionsByAssets = createSelector(
3820
+ [selectFormSubmissionsMapping, selectAssetsMapping],
3821
+ (submissions, assets) => {
4126
3822
  var _a2;
4127
- const componentSubmissionMapping = {};
4128
- for (const componentId in components) {
4129
- componentSubmissionMapping[componentId] = [];
3823
+ const assetSubmissionMapping = {};
3824
+ for (const assetId in assets) {
3825
+ assetSubmissionMapping[assetId] = [];
4130
3826
  }
4131
3827
  for (const submissionId in submissions) {
4132
3828
  const submission = submissions[submissionId];
4133
- if (submission.component) {
4134
- (_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
3829
+ if (submission.asset) {
3830
+ (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
4135
3831
  }
4136
3832
  }
4137
- return componentSubmissionMapping;
3833
+ return assetSubmissionMapping;
4138
3834
  }
4139
3835
  );
4140
3836
  const selectFormSubmissionAttachmentsMapping = (state) => {
@@ -4533,7 +4229,7 @@ const versioningSlice = createSlice({
4533
4229
  reducers: {}
4534
4230
  });
4535
4231
  const versioningReducer = versioningSlice.reducer;
4536
- const fullComponentMarkerSize = 45;
4232
+ const fullAssetMarkerSize = 45;
4537
4233
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
4538
4234
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
4539
4235
  const OUTBOX_RETRY_DELAY = 5e3;
@@ -4551,10 +4247,10 @@ const overmapReducers = {
4551
4247
  fileReducer,
4552
4248
  authReducer,
4553
4249
  categoryReducer,
4554
- componentReducer,
4555
- componentStageCompletionReducer,
4556
- componentStageReducer,
4557
- componentTypeReducer,
4250
+ assetReducer,
4251
+ assetStageCompletionReducer,
4252
+ assetStageReducer,
4253
+ assetTypeReducer,
4558
4254
  issueReducer,
4559
4255
  issueTypeReducer,
4560
4256
  mapReducer,
@@ -4628,7 +4324,7 @@ function handleWorkspaceRemoval(draft, action) {
4628
4324
  form.index_workspace = mainWorkspace.offline_id;
4629
4325
  }
4630
4326
  }
4631
- const rootReducer = (state, action) => {
4327
+ const overmapRootReducer = (state, action) => {
4632
4328
  if (action.type === "auth/setLoggedIn" && !action.payload) {
4633
4329
  return overmapReducer(void 0, action);
4634
4330
  }
@@ -4716,17 +4412,6 @@ const customConfig = {
4716
4412
  };
4717
4413
  const migration = createMigration(manifest, VERSION_REDUCER_KEY);
4718
4414
  const overmapEnhancer = compose(offline$1(customConfig), migration);
4719
- const defaultStore = configureStore({
4720
- reducer: rootReducer,
4721
- enhancers: [compose(applyMiddleware(), overmapEnhancer)],
4722
- middleware: (getDefaultMiddleware) => {
4723
- return getDefaultMiddleware({
4724
- // TODO: Enable periodically to find problems
4725
- serializableCheck: false,
4726
- immutableCheck: false
4727
- });
4728
- }
4729
- });
4730
4415
  function extractResponseFromError(error2) {
4731
4416
  function isResponse(response) {
4732
4417
  const knownKeys = ["ok", "redirect", "clientError", "serverError", "error"];
@@ -5030,8 +4715,6 @@ function retry(_action, _retries) {
5030
4715
  getClientStore().dispatch(_setLatestRetryTime((/* @__PURE__ */ new Date()).getTime()));
5031
4716
  return OUTBOX_RETRY_DELAY;
5032
4717
  }
5033
- const useAppDispatch = () => useDispatch();
5034
- const useAppSelector = useSelector;
5035
4718
  const EXPIRING_SOON_THRESHOLD = 1800;
5036
4719
  function parseTokens(response) {
5037
4720
  if (!response.access)
@@ -5396,110 +5079,108 @@ class CategoryService extends BaseApiService {
5396
5079
  store.dispatch(setCategories(result));
5397
5080
  }
5398
5081
  }
5399
- class ComponentService extends BaseApiService {
5082
+ class AssetService extends BaseApiService {
5400
5083
  // Basic CRUD functions
5401
- add(component, workspaceId) {
5402
- const offlineComponent = offline(component);
5403
- this.client.store.dispatch(addComponent(offlineComponent));
5084
+ add(asset, workspaceId) {
5085
+ const offlineAsset = offline(asset);
5086
+ this.client.store.dispatch(addAsset(offlineAsset));
5404
5087
  const promise = this.client.enqueueRequest({
5405
- description: "Create Component",
5088
+ description: "Create asset",
5406
5089
  method: HttpMethod.POST,
5407
- url: `/components/types/${offlineComponent.component_type}/add-components/`,
5090
+ url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
5408
5091
  queryParams: {
5409
5092
  workspace_id: workspaceId.toString()
5410
5093
  },
5411
- payload: { components: [offlineComponent] },
5094
+ payload: { assets: [offlineAsset] },
5412
5095
  blockers: [],
5413
- blocks: [offlineComponent.offline_id]
5096
+ blocks: [offlineAsset.offline_id]
5414
5097
  });
5415
- return [offlineComponent, promise];
5098
+ return [offlineAsset, promise];
5416
5099
  }
5417
- update(component, workspaceId) {
5418
- this.client.store.dispatch(updateComponent(component));
5100
+ update(asset, workspaceId) {
5101
+ this.client.store.dispatch(updateAsset(asset));
5419
5102
  const promise = this.client.enqueueRequest({
5420
- description: "Edit component",
5103
+ description: "Edit asset",
5421
5104
  method: HttpMethod.PATCH,
5422
- url: `/components/${component.offline_id}/`,
5105
+ url: `/assets/${asset.offline_id}/`,
5423
5106
  queryParams: {
5424
5107
  workspace_id: workspaceId.toString()
5425
5108
  },
5426
- payload: component,
5427
- blockers: [component.offline_id],
5428
- blocks: [component.offline_id]
5109
+ payload: asset,
5110
+ blockers: [asset.offline_id],
5111
+ blocks: [asset.offline_id]
5429
5112
  });
5430
- return [component, promise];
5113
+ return [asset, promise];
5431
5114
  }
5432
- async remove(id) {
5115
+ async remove(assetId) {
5433
5116
  const { store } = this.client;
5434
- const backupComponent = selectComponent(id)(store.getState());
5435
- if (!backupComponent)
5436
- throw new Error(`No component with id ${id} found in the store`);
5437
- const attachmentsOfComponent = selectAttachmentsOfComponent(id)(store.getState());
5438
- store.dispatch(removeComponent(id));
5439
- if (attachmentsOfComponent.length > 0) {
5440
- const attachmentsOfComponentIds = attachmentsOfComponent.map(({ offline_id }) => offline_id);
5441
- store.dispatch(removeComponentAttachments(attachmentsOfComponentIds));
5117
+ const assetToBeDeleted = selectAsset(assetId)(store.getState());
5118
+ if (!assetToBeDeleted)
5119
+ throw new Error(`No asset with id ${assetId} found in the store`);
5120
+ const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
5121
+ store.dispatch(removeAsset(assetId));
5122
+ if (attachmentsOfAssets.length > 0) {
5123
+ const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
5124
+ store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
5442
5125
  }
5443
5126
  return this.client.enqueueRequest({
5444
- description: "Delete issue",
5127
+ description: "Delete asset",
5445
5128
  method: HttpMethod.DELETE,
5446
- url: `/components/${id}/`,
5447
- blockers: [id],
5129
+ url: `/assets/${assetId}/`,
5130
+ blockers: [assetId],
5448
5131
  blocks: []
5449
5132
  }).catch((err) => {
5450
- store.dispatch(addComponent(backupComponent));
5451
- store.dispatch(addComponentAttachments(attachmentsOfComponent));
5133
+ store.dispatch(addAsset(assetToBeDeleted));
5134
+ store.dispatch(addAssetAttachments(attachmentsOfAssets));
5452
5135
  throw err;
5453
5136
  });
5454
5137
  }
5455
- async deleteAllByComponentType(componentTypeId) {
5456
- const clientStore2 = this.client.store;
5457
- const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
5458
- const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
5459
- const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
5138
+ async deleteAllAssetsOfAssetType(assetTypeId) {
5460
5139
  const { store } = this.client;
5461
5140
  const state = store.getState();
5462
- const componentsOfThisType = selectComponentsByType(componentTypeId)(state);
5463
- store.dispatch(removeAllComponentsOfType(componentTypeId));
5141
+ const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
5142
+ const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
5143
+ const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
5144
+ store.dispatch(removeAllAssetsOfType(assetTypeId));
5464
5145
  return this.client.enqueueRequest({
5465
- description: "Batch delete components by component type",
5146
+ description: "Delete all assets of asset type",
5466
5147
  method: HttpMethod.DELETE,
5467
- url: `/components/types/${componentTypeId}/delete-all-of-type/`,
5148
+ url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
5468
5149
  blockers: affectedOfflineIds,
5469
5150
  blocks: affectedOfflineIds
5470
5151
  }).catch((err) => {
5471
- if (componentsOfThisType) {
5472
- store.dispatch(addComponentsInBatches(componentsOfThisType));
5152
+ if (allAssetsOfAssetType) {
5153
+ store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
5473
5154
  }
5474
5155
  throw err;
5475
5156
  });
5476
5157
  }
5477
- async addBatch(componentsToCreate, workspaceId, componentTypeId) {
5478
- const fullComponents = componentsToCreate.map((component) => {
5479
- return { ...offline(component), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5158
+ async addBatch(assetsToCreate, workspaceId, assetTypeId) {
5159
+ const fullAssets = assetsToCreate.map((asset) => {
5160
+ return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5480
5161
  });
5481
5162
  const { store } = this.client;
5482
- store.dispatch(addComponentsInBatches(fullComponents));
5163
+ store.dispatch(addAssetsInBatches(fullAssets));
5483
5164
  const promise = this.client.enqueueRequest({
5484
- description: "Batch create components",
5165
+ description: "Batch create assets",
5485
5166
  method: HttpMethod.POST,
5486
- url: `/components/types/${componentTypeId}/add-components/`,
5167
+ url: `/assets/types/${assetTypeId}/add-assets/`,
5487
5168
  queryParams: {
5488
5169
  workspace_id: workspaceId.toString()
5489
5170
  },
5490
5171
  payload: {
5491
- components: fullComponents
5172
+ assets: fullAssets
5492
5173
  },
5493
- blockers: [componentTypeId],
5494
- blocks: fullComponents.map((c) => c.offline_id)
5174
+ blockers: [assetTypeId],
5175
+ blocks: fullAssets.map((c) => c.offline_id)
5495
5176
  });
5496
5177
  void promise.then((result) => {
5497
- for (const component of Object.values(result)) {
5498
- store.dispatch(updateComponent(component));
5178
+ for (const assets of Object.values(result)) {
5179
+ store.dispatch(updateAsset(assets));
5499
5180
  }
5500
5181
  }).catch((e) => {
5501
- for (const component of fullComponents) {
5502
- store.dispatch(removeComponent(component.offline_id));
5182
+ for (const asset of fullAssets) {
5183
+ store.dispatch(removeAsset(asset.offline_id));
5503
5184
  }
5504
5185
  throw e;
5505
5186
  });
@@ -5508,128 +5189,124 @@ class ComponentService extends BaseApiService {
5508
5189
  async refreshStore() {
5509
5190
  const { store } = this.client;
5510
5191
  const result = await this.client.enqueueRequest({
5511
- description: "Get components",
5192
+ description: "Get assets",
5512
5193
  method: HttpMethod.GET,
5513
- url: `/projects/${store.getState().projectReducer.activeProjectId}/components/`,
5194
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
5514
5195
  blockers: [],
5515
5196
  blocks: []
5516
5197
  });
5517
- store.dispatch(setComponents(result));
5198
+ store.dispatch(setAssets(result));
5518
5199
  }
5519
5200
  }
5520
- class ComponentStageCompletionService extends BaseApiService {
5521
- add(componentId, stageId) {
5201
+ class AssetStageCompletionService extends BaseApiService {
5202
+ add(assetId, stageId) {
5522
5203
  var _a2;
5523
5204
  const { store } = this.client;
5524
- const componentType = (_a2 = store.getState().componentReducer.components[componentId]) == null ? void 0 : _a2.component_type;
5525
- if (!componentType) {
5526
- throw new Error(`Component ${componentId} not found`);
5205
+ const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
5206
+ if (!assetTypeId) {
5207
+ throw new Error(`Asset with offline_id ${assetId} not found`);
5527
5208
  }
5528
- const offlineCompletion = offline({
5529
- component: componentId,
5209
+ const offlineStageCompletion = offline({
5210
+ asset: assetId,
5530
5211
  stage: stageId
5531
5212
  });
5532
- store.dispatch(addStageCompletion(offlineCompletion));
5213
+ store.dispatch(addStageCompletion(offlineStageCompletion));
5533
5214
  const promise = this.client.enqueueRequest({
5534
- description: "Mark stage as completed",
5215
+ description: "Complete stage",
5535
5216
  method: HttpMethod.POST,
5536
- url: `/components/types/${componentType}/complete-stages/`,
5217
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5537
5218
  // TODO: Add submitted_at to model
5538
- payload: { completions: [{ ...offlineCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5539
- blockers: [componentId, stageId],
5540
- blocks: [offlineCompletion.offline_id]
5219
+ payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5220
+ blockers: [assetId, stageId],
5221
+ blocks: [offlineStageCompletion.offline_id]
5541
5222
  });
5542
- return [offlineCompletion, promise];
5223
+ return [offlineStageCompletion, promise];
5543
5224
  }
5544
5225
  async refreshStore() {
5545
5226
  const { store } = this.client;
5546
5227
  const result = await this.client.enqueueRequest({
5547
- description: "Get completed stages",
5228
+ description: "Get stage completions",
5548
5229
  method: HttpMethod.GET,
5549
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stage-completions/`,
5230
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
5550
5231
  blockers: [],
5551
5232
  blocks: []
5552
5233
  });
5553
5234
  store.dispatch(addStageCompletions(result));
5554
5235
  }
5555
5236
  /**
5556
- * Creates a collection of ComponentStageCompletions, marking the referenced stages as completed for the referenced
5557
- * components. It's REQUIRED that all components referenced all have the SAME component type.
5558
- * @param componentTypeId The ID of the component type for which we are completing stages (we can only complete
5559
- * stages for one component type at a time)
5237
+ * Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
5238
+ * assets. It's REQUIRED that all assets referenced all have the SAME asset type.
5239
+ * @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
5240
+ * stages for one asset type at a time)
5560
5241
  * @param stageCompletions
5561
5242
  */
5562
- async bulkAdd(componentTypeId, stageCompletions) {
5563
- const offlineStagesCompletions = stageCompletions.map((completion) => {
5243
+ async bulkAdd(assetTypeId, stageCompletions) {
5244
+ const offlineStageCompletions = stageCompletions.map((completion) => {
5564
5245
  return offline(completion);
5565
5246
  });
5566
5247
  const asMapping = {};
5567
5248
  for (const completion of stageCompletions) {
5568
- const stageToCompletionDateMapping = asMapping[completion.component] || {};
5249
+ const stageToCompletionDateMapping = asMapping[completion.asset] || {};
5569
5250
  stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
5570
- asMapping[completion.component] = stageToCompletionDateMapping;
5251
+ asMapping[completion.asset] = stageToCompletionDateMapping;
5571
5252
  }
5572
5253
  this.client.store.dispatch(addStageCompletions(asMapping));
5573
5254
  await this.client.enqueueRequest({
5574
- description: "Mark multiple stage as completed",
5255
+ description: "Bulk complete stages",
5575
5256
  method: HttpMethod.POST,
5576
- url: `/components/types/${componentTypeId}/complete-stages/`,
5257
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5577
5258
  payload: {
5578
- completions: offlineStagesCompletions
5259
+ completions: offlineStageCompletions
5579
5260
  },
5580
- blockers: [
5581
- componentTypeId,
5582
- ...stageCompletions.map((c) => c.component),
5583
- ...stageCompletions.map((c) => c.stage)
5584
- ],
5585
- blocks: offlineStagesCompletions.map((c) => c.offline_id)
5261
+ blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
5262
+ blocks: offlineStageCompletions.map((c) => c.offline_id)
5586
5263
  });
5587
5264
  }
5588
- bulkDelete(stageId, componentIds) {
5589
- const completionsToRemove = componentIds.map((componentId) => {
5265
+ bulkDelete(stageId, assetIds) {
5266
+ const stageCompletionsToRemove = assetIds.map((assetId) => {
5590
5267
  return {
5591
- component: componentId,
5268
+ asset: assetId,
5592
5269
  stage: stageId
5593
5270
  };
5594
5271
  });
5595
- this.client.store.dispatch(removeStageCompletions(completionsToRemove));
5272
+ this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
5596
5273
  return this.client.enqueueRequest({
5597
- description: `Undo stage for ${componentIds.length} component(s)`,
5274
+ description: `Undo stage for ${assetIds.length} assets(s)`,
5598
5275
  // TODO: Rename to setCompletedStages
5599
5276
  method: HttpMethod.DELETE,
5600
- url: `/components/stages/${stageId}/undo-stages/`,
5277
+ url: `/assets/stages/${stageId}/undo-stages/`,
5601
5278
  payload: {
5602
- components: componentIds
5279
+ assets: assetIds
5603
5280
  },
5604
- blockers: [stageId, ...componentIds],
5281
+ blockers: [stageId, ...assetIds],
5605
5282
  blocks: []
5606
5283
  });
5607
5284
  }
5608
5285
  }
5609
- class ComponentStageService extends BaseApiService {
5610
- async bulkCreateStages(stagesToSubmit, componentTypeId, workspaceId) {
5286
+ class AssetStageService extends BaseApiService {
5287
+ async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
5611
5288
  const payload = stagesToSubmit.map((stage) => {
5612
5289
  return offline(stage);
5613
5290
  });
5614
5291
  const fullStages = payload.map((stage) => {
5615
- return { ...stage, component_type: componentTypeId };
5292
+ return { ...stage, asset_type: assetTypeId };
5616
5293
  });
5617
5294
  this.client.store.dispatch(addStages(fullStages));
5618
5295
  return this.client.enqueueRequest({
5619
- description: "Add component stages",
5296
+ description: "Add asset stages",
5620
5297
  method: HttpMethod.POST,
5621
- url: `/components/types/${componentTypeId}/add-stages/`,
5298
+ url: `/assets/types/${assetTypeId}/add-stages/`,
5622
5299
  payload: {
5623
5300
  stages: payload
5624
5301
  },
5625
5302
  queryParams: {
5626
5303
  workspace_id: workspaceId.toString()
5627
5304
  },
5628
- blockers: [componentTypeId, workspaceId],
5305
+ blockers: [assetTypeId, workspaceId],
5629
5306
  blocks: payload.map(({ offline_id }) => offline_id)
5630
5307
  });
5631
5308
  }
5632
- async bulkUpdateStages(stagesToUpdate, componentTypeId) {
5309
+ async bulkUpdateStages(stagesToUpdate, assetTypeId) {
5633
5310
  const store = this.client.store;
5634
5311
  const state = store.getState();
5635
5312
  const prevStages = selectStagesFromStageIds(
@@ -5640,13 +5317,13 @@ class ComponentStageService extends BaseApiService {
5640
5317
  }
5641
5318
  store.dispatch(updateStages(stagesToUpdate));
5642
5319
  return this.client.enqueueRequest({
5643
- description: "Edit component stages",
5320
+ description: "Edit asset stages",
5644
5321
  method: HttpMethod.PATCH,
5645
- url: `/components/types/${componentTypeId}/bulk-update-stages/`,
5322
+ url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
5646
5323
  payload: {
5647
5324
  stages: stagesToUpdate
5648
5325
  },
5649
- blockers: [componentTypeId],
5326
+ blockers: [assetTypeId],
5650
5327
  blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
5651
5328
  }).catch((e) => {
5652
5329
  store.dispatch(updateStages(prevStages));
@@ -5656,9 +5333,9 @@ class ComponentStageService extends BaseApiService {
5656
5333
  async bulkDelete(idsToDelete) {
5657
5334
  this.client.store.dispatch(removeStages(idsToDelete));
5658
5335
  return this.client.enqueueRequest({
5659
- description: "Delete component stages",
5336
+ description: "Delete asset stages",
5660
5337
  method: HttpMethod.DELETE,
5661
- url: "/components/stages/bulk-delete/",
5338
+ url: "/assets/stages/bulk-delete/",
5662
5339
  payload: {
5663
5340
  stage_ids: idsToDelete
5664
5341
  },
@@ -5666,15 +5343,15 @@ class ComponentStageService extends BaseApiService {
5666
5343
  blocks: []
5667
5344
  });
5668
5345
  }
5669
- async update(componentStage) {
5670
- this.client.store.dispatch(addStages([componentStage]));
5346
+ async update(assetStage) {
5347
+ this.client.store.dispatch(addStages([assetStage]));
5671
5348
  return this.client.enqueueRequest({
5672
- description: "Update component stage",
5349
+ description: "Update asset stage",
5673
5350
  method: HttpMethod.PATCH,
5674
- url: `/components/stages/${componentStage.offline_id}/`,
5675
- payload: componentStage,
5676
- blockers: [componentStage.offline_id],
5677
- blocks: [componentStage.offline_id]
5351
+ url: `/assets/stages/${assetStage.offline_id}/`,
5352
+ payload: assetStage,
5353
+ blockers: [assetStage.offline_id],
5354
+ blocks: [assetStage.offline_id]
5678
5355
  });
5679
5356
  }
5680
5357
  async linkForm(stageId, formId2) {
@@ -5682,9 +5359,9 @@ class ComponentStageService extends BaseApiService {
5682
5359
  store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
5683
5360
  try {
5684
5361
  await this.client.enqueueRequest({
5685
- description: "Link component stage to form",
5362
+ description: "Link asset stage to form",
5686
5363
  method: HttpMethod.POST,
5687
- url: `/components/stages/${stageId}/associate-with-form/`,
5364
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5688
5365
  payload: { user_form: formId2 },
5689
5366
  blockers: [stageId, formId2],
5690
5367
  blocks: [stageId]
@@ -5699,9 +5376,9 @@ class ComponentStageService extends BaseApiService {
5699
5376
  store.dispatch(unlinkStageToForm({ stageId }));
5700
5377
  try {
5701
5378
  await this.client.enqueueRequest({
5702
- description: "Unlink component stage from form",
5379
+ description: "Unlink asset stage from form",
5703
5380
  method: HttpMethod.DELETE,
5704
- url: `/components/stages/${stageId}/associate-with-form/`,
5381
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5705
5382
  blockers: [stageId, formId2],
5706
5383
  blocks: [stageId]
5707
5384
  });
@@ -5713,9 +5390,9 @@ class ComponentStageService extends BaseApiService {
5713
5390
  async refreshStore() {
5714
5391
  const { store } = this.client;
5715
5392
  const result = await this.client.enqueueRequest({
5716
- description: "Get component stages",
5393
+ description: "Get asset stages",
5717
5394
  method: HttpMethod.GET,
5718
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stages/`,
5395
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
5719
5396
  blockers: [],
5720
5397
  blocks: []
5721
5398
  });
@@ -5729,20 +5406,20 @@ const AttachmentModelMeta = {
5729
5406
  deleteUrlPrefix: "/issues",
5730
5407
  fetchUrlPostfix: "/issue-attachments"
5731
5408
  },
5732
- [AttachmentModel.Component]: {
5733
- name: "component",
5734
- attachUrlPrefix: "/components",
5735
- deleteUrlPrefix: "/components",
5736
- fetchUrlPostfix: "/component-attachments"
5409
+ [AttachmentModel.Asset]: {
5410
+ name: "asset",
5411
+ attachUrlPrefix: "/assets",
5412
+ deleteUrlPrefix: "/assets",
5413
+ fetchUrlPostfix: "/asset-attachments"
5737
5414
  },
5738
- [AttachmentModel.ComponentType]: {
5739
- name: "component type",
5740
- attachUrlPrefix: "/components/types",
5741
- deleteUrlPrefix: "/components/types",
5742
- fetchUrlPostfix: "/component-type-attachments"
5415
+ [AttachmentModel.AssetType]: {
5416
+ name: "asset type",
5417
+ attachUrlPrefix: "/assets/types",
5418
+ deleteUrlPrefix: "/assets/types",
5419
+ fetchUrlPostfix: "/asset-type-attachments"
5743
5420
  },
5744
5421
  [AttachmentModel.Project]: {
5745
- name: "component project",
5422
+ name: "project",
5746
5423
  attachUrlPrefix: "/projects",
5747
5424
  deleteUrlPrefix: "/projects",
5748
5425
  fetchUrlPostfix: "/attachments"
@@ -5758,8 +5435,8 @@ class BaseAttachmentService extends BaseApiService {
5758
5435
  getNumberOfAttachmentsWithSha1(sha1) {
5759
5436
  const {
5760
5437
  issueReducer: issueReducer2,
5761
- componentReducer: componentReducer2,
5762
- componentTypeReducer: componentTypeReducer2,
5438
+ assetReducer: assetReducer2,
5439
+ assetTypeReducer: assetTypeReducer2,
5763
5440
  documentsReducer: documentsReducer2,
5764
5441
  projectReducer: projectReducer2,
5765
5442
  formSubmissionReducer: formSubmissionReducer2,
@@ -5767,8 +5444,8 @@ class BaseAttachmentService extends BaseApiService {
5767
5444
  } = this.client.store.getState();
5768
5445
  const objectsWithSha1 = [].concat(
5769
5446
  Object.values(issueReducer2.attachments),
5770
- Object.values(componentReducer2.attachments),
5771
- Object.values(componentTypeReducer2.attachments),
5447
+ Object.values(assetReducer2.attachments),
5448
+ Object.values(assetTypeReducer2.attachments),
5772
5449
  Object.values(documentsReducer2.attachments),
5773
5450
  Object.values(projectReducer2.attachments),
5774
5451
  Object.values(formRevisionReducer2.attachments),
@@ -5890,10 +5567,10 @@ class BaseAttachmentService extends BaseApiService {
5890
5567
  return promise;
5891
5568
  }
5892
5569
  }
5893
- class ComponentAttachmentService extends BaseAttachmentService {
5570
+ class AssetAttachmentService extends BaseAttachmentService {
5894
5571
  constructor() {
5895
5572
  super(...arguments);
5896
- __publicField(this, "attachmentModel", AttachmentModel.Component);
5573
+ __publicField(this, "attachmentModel", AttachmentModel.Asset);
5897
5574
  }
5898
5575
  buildOfflineAttachment(data) {
5899
5576
  return offline({
@@ -5904,115 +5581,108 @@ class ComponentAttachmentService extends BaseAttachmentService {
5904
5581
  file_type: data.file.type,
5905
5582
  submitted_at: data.submittedAt,
5906
5583
  description: data.description,
5907
- component: data.modelId
5584
+ asset: data.modelId
5908
5585
  });
5909
5586
  }
5910
- async attachFilesToComponent(files, componentId) {
5911
- return this.attachFiles(
5912
- files,
5913
- componentId,
5914
- this.buildOfflineAttachment.bind(this),
5915
- {
5916
- addAttachments: addComponentAttachments,
5917
- updateAttachments: updateComponentAttachments,
5918
- removeAttachments: removeComponentAttachments
5919
- }
5920
- );
5587
+ async attachFilesToAsset(files, assetId) {
5588
+ return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
5589
+ addAttachments: addAssetAttachments,
5590
+ updateAttachments: updateAssetAttachments,
5591
+ removeAttachments: removeAssetAttachments
5592
+ });
5921
5593
  }
5922
- deleteComponentAttachment(attachmentId) {
5594
+ deleteAssetAttachment(attachmentId) {
5923
5595
  return this.deleteAttachment(
5924
5596
  attachmentId,
5925
5597
  {
5926
- setAttachment: setComponentAttachment,
5927
- removeAttachment: removeComponentAttachment
5598
+ setAttachment: setAssetAttachment,
5599
+ removeAttachment: removeAssetAttachment
5928
5600
  },
5929
5601
  {
5930
- selectAttachment: selectComponentAttachment
5602
+ selectAttachment: selectAssetAttachment
5931
5603
  }
5932
5604
  );
5933
5605
  }
5934
5606
  async refreshStore() {
5935
5607
  return this.getAttachments({
5936
- setAttachments: setComponentAttachments
5608
+ setAttachments: setAssetAttachments
5937
5609
  });
5938
5610
  }
5939
5611
  }
5940
- class ComponentTypeService extends BaseApiService {
5941
- add(componentType) {
5942
- const offlineComponentType = offline(componentType);
5612
+ class AssetTypeService extends BaseApiService {
5613
+ add(assetType) {
5614
+ const offlineAssetType = offline(assetType);
5943
5615
  const { store } = this.client;
5944
5616
  const activeProjectId = store.getState().projectReducer.activeProjectId;
5945
- store.dispatch(addComponentType(offlineComponentType));
5617
+ store.dispatch(addAssetType(offlineAssetType));
5946
5618
  const promise = this.client.enqueueRequest({
5947
- description: "Create ComponentType",
5619
+ description: "Create asset type",
5948
5620
  method: HttpMethod.POST,
5949
- url: `/projects/${activeProjectId}/component-types/`,
5950
- payload: { ...offlineComponentType },
5621
+ url: `/projects/${activeProjectId}/asset-types/`,
5622
+ payload: { ...offlineAssetType },
5951
5623
  blockers: [],
5952
- blocks: [offlineComponentType.offline_id]
5624
+ blocks: [offlineAssetType.offline_id]
5953
5625
  });
5954
- return [offlineComponentType, promise];
5626
+ return [offlineAssetType, promise];
5955
5627
  }
5956
- update(componentType) {
5957
- this.client.store.dispatch(addComponentType(componentType));
5628
+ update(assetType) {
5629
+ this.client.store.dispatch(addAssetType(assetType));
5958
5630
  return this.client.enqueueRequest({
5959
- description: "Update ComponentType",
5631
+ description: "Update asset type",
5960
5632
  method: HttpMethod.PATCH,
5961
- url: `/components/types/${componentType.offline_id}/`,
5962
- payload: componentType,
5963
- blockers: [componentType.offline_id],
5964
- blocks: [componentType.offline_id]
5633
+ url: `/assets/types/${assetType.offline_id}/`,
5634
+ payload: assetType,
5635
+ blockers: [assetType.offline_id],
5636
+ blocks: [assetType.offline_id]
5965
5637
  });
5966
5638
  }
5967
- async delete(componentTypeId) {
5639
+ async delete(assetTypeId) {
5968
5640
  const { store } = this.client;
5969
5641
  const state = store.getState();
5970
- const componentType = selectComponentType(componentTypeId)(state);
5971
- if (!componentType) {
5972
- throw new Error("Expected componentType to exist");
5973
- }
5974
- const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
5975
- const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
5976
- store.dispatch(deleteComponentType(componentTypeId));
5977
- if (stagesOfComponentType.length > 0) {
5978
- const stagesOfComponentTypeIds = stagesOfComponentType.map(
5979
- (componentTypeStage) => componentTypeStage.offline_id
5980
- );
5981
- store.dispatch(removeStages(stagesOfComponentTypeIds));
5642
+ const assetType = selectAssetType(assetTypeId)(state);
5643
+ if (!assetType) {
5644
+ throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
5982
5645
  }
5983
- if (attachmentsOfComponentType.length > 0) {
5984
- const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
5985
- store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
5646
+ const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
5647
+ const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
5648
+ store.dispatch(deleteAssetType(assetTypeId));
5649
+ if (stagesOfAssetType.length > 0) {
5650
+ const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
5651
+ store.dispatch(removeStages(stagesOfAssetTypeIds));
5652
+ }
5653
+ if (attachmentsOfAssetType.length > 0) {
5654
+ const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
5655
+ store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
5986
5656
  }
5987
5657
  return this.client.enqueueRequest({
5988
- description: "Delete ComponentType",
5658
+ description: "Delete asset type",
5989
5659
  method: HttpMethod.DELETE,
5990
- url: `/components/types/${componentTypeId}/`,
5991
- blockers: [componentTypeId],
5660
+ url: `/assets/types/${assetTypeId}/`,
5661
+ blockers: [assetTypeId],
5992
5662
  blocks: []
5993
5663
  }).catch((e) => {
5994
- store.dispatch(addComponentType(componentType));
5995
- store.dispatch(addStages(stagesOfComponentType));
5996
- store.dispatch(addComponentTypeAttachments(attachmentsOfComponentType));
5664
+ store.dispatch(addAssetType(assetType));
5665
+ store.dispatch(addStages(stagesOfAssetType));
5666
+ store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
5997
5667
  throw e;
5998
5668
  });
5999
5669
  }
6000
5670
  async refreshStore() {
6001
5671
  const { store } = this.client;
6002
5672
  const result = await this.client.enqueueRequest({
6003
- description: "Get component types",
5673
+ description: "Get asset types",
6004
5674
  method: HttpMethod.GET,
6005
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-types/`,
5675
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
6006
5676
  blockers: [],
6007
5677
  blocks: []
6008
5678
  });
6009
- store.dispatch(setComponentTypes(result));
5679
+ store.dispatch(setAssetTypes(result));
6010
5680
  }
6011
5681
  }
6012
- class ComponentTypeAttachmentService extends BaseAttachmentService {
5682
+ class AssetTypeAttachmentService extends BaseAttachmentService {
6013
5683
  constructor() {
6014
5684
  super(...arguments);
6015
- __publicField(this, "attachmentModel", AttachmentModel.ComponentType);
5685
+ __publicField(this, "attachmentModel", AttachmentModel.AssetType);
6016
5686
  }
6017
5687
  buildOfflineAttachment(data) {
6018
5688
  return offline({
@@ -6023,36 +5693,36 @@ class ComponentTypeAttachmentService extends BaseAttachmentService {
6023
5693
  file_type: data.file.type,
6024
5694
  submitted_at: data.submittedAt,
6025
5695
  description: data.description,
6026
- component_type: data.modelId
5696
+ asset_type: data.modelId
6027
5697
  });
6028
5698
  }
6029
- async attachFilesToComponentType(files, componentTypeId) {
5699
+ async attachFilesToAssetType(files, assetTypeId) {
6030
5700
  return this.attachFiles(
6031
5701
  files,
6032
- componentTypeId,
5702
+ assetTypeId,
6033
5703
  this.buildOfflineAttachment.bind(this),
6034
5704
  {
6035
- addAttachments: addComponentTypeAttachments,
6036
- updateAttachments: updateComponentTypeAttachments,
6037
- removeAttachments: removeComponentTypeAttachments
5705
+ addAttachments: addAssetTypeAttachments,
5706
+ updateAttachments: updateAssetTypeAttachments,
5707
+ removeAttachments: removeAssetTypeAttachments
6038
5708
  }
6039
5709
  );
6040
5710
  }
6041
- deleteComponentTypeAttachment(attachmentId) {
5711
+ deleteAssetTypeAttachment(attachmentId) {
6042
5712
  return this.deleteAttachment(
6043
5713
  attachmentId,
6044
5714
  {
6045
- setAttachment: setComponentTypeAttachment,
6046
- removeAttachment: removeComponentTypeAttachment
5715
+ setAttachment: setAssetTypeAttachment,
5716
+ removeAttachment: removeAssetTypeAttachment
6047
5717
  },
6048
5718
  {
6049
- selectAttachment: selectComponentTypeAttachment
5719
+ selectAttachment: selectAssetTypeAttachment
6050
5720
  }
6051
5721
  );
6052
5722
  }
6053
5723
  async refreshStore() {
6054
5724
  return this.getAttachments({
6055
- setAttachments: setComponentTypeAttachments
5725
+ setAttachments: setAssetTypeAttachments
6056
5726
  });
6057
5727
  }
6058
5728
  }
@@ -6550,8 +6220,8 @@ class MainService extends BaseApiService {
6550
6220
  });
6551
6221
  }
6552
6222
  // TODO:
6553
- // Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
6554
- // overwrite, use setComponents. Otherwise, use bulkAddComponents.
6223
+ // Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
6224
+ // overwrite, use setAssets. Otherwise, use bulkAddAssets.
6555
6225
  // TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
6556
6226
  // literally immediately.
6557
6227
  async _processInitialData(data, overwrite) {
@@ -6656,10 +6326,10 @@ class MainService extends BaseApiService {
6656
6326
  } finally {
6657
6327
  store.dispatch(setIsFetchingInitialData(false));
6658
6328
  }
6659
- void this.client.componentTypes.refreshStore();
6660
- void this.client.componentStages.refreshStore();
6661
- void this.client.components.refreshStore();
6662
- void this.client.componentStageCompletions.refreshStore();
6329
+ void this.client.assetTypes.refreshStore();
6330
+ void this.client.assetStages.refreshStore();
6331
+ void this.client.assets.refreshStore();
6332
+ void this.client.assetStageCompletions.refreshStore();
6663
6333
  void this.client.categories.refreshStore();
6664
6334
  void this.client.issueTypes.refreshStore();
6665
6335
  void this.client.issues.refreshStore();
@@ -6674,8 +6344,8 @@ class MainService extends BaseApiService {
6674
6344
  void this.client.issueUpdates.refreshStore();
6675
6345
  void this.client.projectAccesses.refreshStore();
6676
6346
  void this.client.projectAttachments.refreshStore();
6677
- void this.client.componentTypeAttachments.refreshStore();
6678
- void this.client.componentAttachments.refreshStore();
6347
+ void this.client.assetTypeAttachments.refreshStore();
6348
+ void this.client.assetAttachments.refreshStore();
6679
6349
  }
6680
6350
  void this.client.teams.refreshStore();
6681
6351
  }
@@ -7071,7 +6741,7 @@ class UserFormService extends BaseApiService {
7071
6741
  });
7072
6742
  });
7073
6743
  }
7074
- async add(state, initialRevision, url, ownerUser, ownerOrganization, componentTypeId, issueTypeId) {
6744
+ async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
7075
6745
  if (!!ownerUser === !!ownerOrganization) {
7076
6746
  throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
7077
6747
  }
@@ -7090,7 +6760,7 @@ class UserFormService extends BaseApiService {
7090
6760
  favorite: true,
7091
6761
  submitted_at: submittedAt,
7092
6762
  created_by: currentUser.id,
7093
- ...componentTypeId && { component_type: componentTypeId },
6763
+ ...assetTypeId && { asset_type: assetTypeId },
7094
6764
  ...issueTypeId && { issue_type: issueTypeId },
7095
6765
  ...ownerAttrs
7096
6766
  };
@@ -7114,11 +6784,11 @@ class UserFormService extends BaseApiService {
7114
6784
  } : void 0,
7115
6785
  payload: {
7116
6786
  ...offlineFormPayload,
7117
- ...componentTypeId && { component_type: componentTypeId },
6787
+ ...assetTypeId && { asset_type: assetTypeId },
7118
6788
  ...issueTypeId && { issue_type: issueTypeId },
7119
6789
  initial_revision: payloadWithoutImage
7120
6790
  },
7121
- blockers: componentTypeId ? [componentTypeId] : issueTypeId ? [issueTypeId] : [],
6791
+ blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
7122
6792
  blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
7123
6793
  });
7124
6794
  const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
@@ -7142,7 +6812,7 @@ class UserFormService extends BaseApiService {
7142
6812
  `/forms/in-organization/${activeOrganizationId}/`,
7143
6813
  void 0,
7144
6814
  activeOrganizationId,
7145
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
6815
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7146
6816
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7147
6817
  );
7148
6818
  }
@@ -7155,7 +6825,7 @@ class UserFormService extends BaseApiService {
7155
6825
  "/forms/my-forms/",
7156
6826
  currentUser.id,
7157
6827
  void 0,
7158
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
6828
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7159
6829
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7160
6830
  );
7161
6831
  }
@@ -7323,8 +6993,8 @@ class UserFormSubmissionService extends BaseApiService {
7323
6993
  url: `/forms/submission/${submission.offline_id}/attachments/`,
7324
6994
  payload: submissionAttachmentPayload,
7325
6995
  blockers: [
7326
- submission.component,
7327
- submission.component_stage,
6996
+ submission.asset,
6997
+ submission.asset_stage,
7328
6998
  submission.issue,
7329
6999
  submission.form_revision
7330
7000
  ].filter((x) => x !== void 0),
@@ -7360,7 +7030,7 @@ class UserFormSubmissionService extends BaseApiService {
7360
7030
  method: HttpMethod.POST,
7361
7031
  url: `/forms/revisions/${payload.form_revision}/respond/`,
7362
7032
  payload: { ...offlineSubmission, project: activeProjectId },
7363
- blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
7033
+ blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
7364
7034
  (x) => x !== void 0
7365
7035
  ),
7366
7036
  blocks: [payload.offline_id]
@@ -7378,10 +7048,10 @@ class UserFormSubmissionService extends BaseApiService {
7378
7048
  const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
7379
7049
  return [offlineSubmission, settledPromise];
7380
7050
  }
7381
- // Note currently the bulkAdd method is specific to form submissions for components
7051
+ // Note currently the bulkAdd method is specific to form submissions for assets
7382
7052
  // TODO: adapt the support bulk adding to any model type
7383
7053
  async bulkAdd(args) {
7384
- const { formRevision, values: argsValues, componentOfflineIds } = args;
7054
+ const { formRevision, values: argsValues, assetOfflineIds } = args;
7385
7055
  const { store } = this.client;
7386
7056
  const offlineSubmissions = [];
7387
7057
  const offlineAttachments = [];
@@ -7391,16 +7061,16 @@ class UserFormSubmissionService extends BaseApiService {
7391
7061
  const { values, files } = separateFilesFromValues(argsValues);
7392
7062
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7393
7063
  const createdBy = store.getState().userReducer.currentUser.id;
7394
- for (const component_id of componentOfflineIds) {
7064
+ for (const assetId of assetOfflineIds) {
7395
7065
  const submission = offline({
7396
7066
  form_revision: formRevision,
7397
7067
  values,
7398
7068
  created_by: createdBy,
7399
7069
  submitted_at: submittedAt,
7400
- component: component_id
7070
+ asset: assetId
7401
7071
  });
7402
7072
  submissionOfflineIds.push(submission.offline_id);
7403
- submissionsPayload.push({ offline_id: submission.offline_id, component_id });
7073
+ submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
7404
7074
  offlineSubmissions.push(submission);
7405
7075
  for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
7406
7076
  for (const file of fileArray) {
@@ -7447,7 +7117,7 @@ class UserFormSubmissionService extends BaseApiService {
7447
7117
  attachments: attachmentsPayload,
7448
7118
  files: Object.values(filesRecord)
7449
7119
  },
7450
- blockers: componentOfflineIds,
7120
+ blockers: assetOfflineIds,
7451
7121
  blocks: submissionOfflineIds
7452
7122
  });
7453
7123
  promise.then(({ submissions, attachments, presigned_urls }) => {
@@ -7490,7 +7160,7 @@ class UserFormSubmissionService extends BaseApiService {
7490
7160
  method: HttpMethod.PATCH,
7491
7161
  url: `/forms/submissions/${submission.offline_id}/`,
7492
7162
  payload: offlineSubmission,
7493
- blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
7163
+ blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
7494
7164
  (x) => x !== void 0
7495
7165
  ),
7496
7166
  blocks: [offlineSubmission.offline_id]
@@ -8337,13 +8007,16 @@ class AgentService extends BaseApiService {
8337
8007
  queryParams: { conversation_id: conversationId }
8338
8008
  }).then((response) => {
8339
8009
  const conversation = store.getState().agentsReducer.conversations[conversationId];
8340
- if (!conversation) {
8010
+ if (!(conversation == null ? void 0 : conversation.offline_id)) {
8341
8011
  throw new Error("Conversation not found");
8342
8012
  }
8013
+ if (!Array.isArray(response)) {
8014
+ response = [response];
8015
+ }
8343
8016
  store.dispatch(
8344
8017
  updateConversation({
8345
- offline_id: conversationId,
8346
- tiptap_content: [...conversation.tiptap_content || [], response.response]
8018
+ ...conversation,
8019
+ tiptap_content: [...conversation.tiptap_content || [], ...response]
8347
8020
  })
8348
8021
  );
8349
8022
  });
@@ -8576,12 +8249,12 @@ class OvermapSDK {
8576
8249
  __publicField(this, "issueAttachments", new IssueAttachmentService(this));
8577
8250
  __publicField(this, "workspaces", new WorkspaceService(this));
8578
8251
  __publicField(this, "main", new MainService(this));
8579
- __publicField(this, "components", new ComponentService(this));
8580
- __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
8581
- __publicField(this, "componentTypes", new ComponentTypeService(this));
8582
- __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
8583
- __publicField(this, "componentStages", new ComponentStageService(this));
8584
- __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
8252
+ __publicField(this, "assets", new AssetService(this));
8253
+ __publicField(this, "assetAttachments", new AssetAttachmentService(this));
8254
+ __publicField(this, "assetTypes", new AssetTypeService(this));
8255
+ __publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
8256
+ __publicField(this, "assetStages", new AssetStageService(this));
8257
+ __publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
8585
8258
  __publicField(this, "userForms", new UserFormService(this));
8586
8259
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
8587
8260
  __publicField(this, "projects", new ProjectService(this));
@@ -14403,7 +14076,7 @@ const FileViewerContext = createContext(() => {
14403
14076
  const useFileViewer = () => useContext(FileViewerContext);
14404
14077
  const FileViewerProvider = memo((props) => {
14405
14078
  const { children } = props;
14406
- const [config2, setConfig] = useState(null);
14079
+ const [config, setConfig] = useState(null);
14407
14080
  const [fileType, setFileType] = useState(null);
14408
14081
  const closeFileViewer = useCallback(() => {
14409
14082
  setConfig(null);
@@ -14416,16 +14089,16 @@ const FileViewerProvider = memo((props) => {
14416
14089
  [closeFileViewer]
14417
14090
  );
14418
14091
  const handleClose = useCallback(() => {
14419
- if (!config2)
14092
+ if (!config)
14420
14093
  return;
14421
- if (config2.onClose)
14422
- config2.onClose();
14094
+ if (config.onClose)
14095
+ config.onClose();
14423
14096
  closeFileViewer();
14424
- }, [closeFileViewer, config2]);
14097
+ }, [closeFileViewer, config]);
14425
14098
  useEffect(() => {
14426
- if (!config2)
14099
+ if (!config)
14427
14100
  return;
14428
- const { file } = config2;
14101
+ const { file } = config;
14429
14102
  if (SUPPORTED_SPREADSHEET_FILE_EXTENSIONS.includes(file.type)) {
14430
14103
  setFileType("spreadsheet");
14431
14104
  return;
@@ -14438,14 +14111,14 @@ const FileViewerProvider = memo((props) => {
14438
14111
  setFileType("image");
14439
14112
  return;
14440
14113
  }
14441
- }, [config2]);
14114
+ }, [config]);
14442
14115
  const value = useMemo(() => openFileViewer, [openFileViewer]);
14443
14116
  return /* @__PURE__ */ jsxs(FileViewerContext.Provider, { value, children: [
14444
14117
  children,
14445
- config2 && /* @__PURE__ */ jsxs(Fragment, { children: [
14446
- fileType === "spreadsheet" && /* @__PURE__ */ jsx(SpreadsheetViewer, { file: config2.file, onDelete: config2.onDelete, onClose: handleClose }),
14447
- fileType === "pdf" && /* @__PURE__ */ jsx(PDFViewer, { file: config2.file, onDelete: config2.onDelete, onClose: handleClose }),
14448
- fileType === "image" && /* @__PURE__ */ jsx(ImageViewer, { file: config2.file, onDelete: config2.onDelete, onClose: handleClose })
14118
+ config && /* @__PURE__ */ jsxs(Fragment, { children: [
14119
+ fileType === "spreadsheet" && /* @__PURE__ */ jsx(SpreadsheetViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
14120
+ fileType === "pdf" && /* @__PURE__ */ jsx(PDFViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
14121
+ fileType === "image" && /* @__PURE__ */ jsx(ImageViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose })
14449
14122
  ] })
14450
14123
  ] });
14451
14124
  });
@@ -15144,7 +14817,7 @@ const initialFormValues = (fields, values) => {
15144
14817
  };
15145
14818
  const useAttachImagesToFormRevisionFields = (revision) => {
15146
14819
  const { sdk } = useSDK();
15147
- const attachments = useAppSelector(selectAttachmentsOfFormRevision((revision == null ? void 0 : revision.offline_id) ?? ""));
14820
+ const attachments = useSelector(selectAttachmentsOfFormRevision((revision == null ? void 0 : revision.offline_id) ?? ""));
15148
14821
  return useMemo(() => {
15149
14822
  if (!revision || !attachments)
15150
14823
  return revision;
@@ -15226,7 +14899,7 @@ const FormRenderer = memo(
15226
14899
  const FormSubmissionViewer = memo(
15227
14900
  forwardRef((props, ref) => {
15228
14901
  const { submission, showFormDescription = false, showFormTitle = true } = props;
15229
- const revision = useAppSelector(selectFormRevision(submission.form_revision));
14902
+ const revision = useSelector(selectFormRevision(submission.form_revision));
15230
14903
  const { sdk } = useSDK();
15231
14904
  if (!revision) {
15232
14905
  throw new Error(
@@ -15291,11 +14964,11 @@ const FormBrowser = memo(
15291
14964
  }
15292
14965
  return ret;
15293
14966
  }, [filter, maxResults, ownerFilter]);
15294
- const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
15295
- const userFormMapping = useAppSelector(selectFormMapping);
15296
- const attachableUserForms = userForms.filter((form) => !form.component_type && !form.issue_type);
14967
+ const userForms = useSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
14968
+ const userFormMapping = useSelector(selectFormMapping);
14969
+ const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
15297
14970
  const attachableUserFormMapping = Object.values(userFormMapping).filter(
15298
- (form) => !form.component_type
14971
+ (form) => !form.asset_type
15299
14972
  );
15300
14973
  const handleToggleFavorite = useCallback(
15301
14974
  (form) => {
@@ -15325,7 +14998,7 @@ const FormBrowser = memo(
15325
14998
  const handleChange = useCallback((e) => {
15326
14999
  setFilter(e.currentTarget.value);
15327
15000
  }, []);
15328
- const numberOfForms = useAppSelector(selectGeneralFormCount) || 0;
15001
+ const numberOfForms = useSelector(selectGeneralFormCount) || 0;
15329
15002
  const numberOfHiddenForms = numberOfForms - attachableUserForms.length;
15330
15003
  const overflowMessage = attachableUserForms.length == maxResults && numberOfHiddenForms > 0 ? `Only the first ${maxResults} results are shown (${numberOfHiddenForms} hidden)` : numberOfHiddenForms > 0 && `${numberOfHiddenForms} hidden forms`;
15331
15004
  return /* @__PURE__ */ jsxs(Flex$1, { ref, direction: "column", gap: "2", children: [
@@ -15360,9 +15033,9 @@ const FormBrowser = memo(
15360
15033
  const FormBrowserEntry = (props) => {
15361
15034
  var _a2;
15362
15035
  const { form, onSelectForm, isFavoriteEditable, handleToggleFavorite } = props;
15363
- const ownerOrganization = (_a2 = useAppSelector(selectOrganization(form.owner_organization || -1))) == null ? void 0 : _a2.name;
15364
- const ownerUser = useAppSelector(selectUser(form.owner_user || -1));
15365
- const currentUserId = useAppSelector(selectCurrentUser).id;
15036
+ const ownerOrganization = (_a2 = useSelector(selectOrganization(form.owner_organization || -1))) == null ? void 0 : _a2.name;
15037
+ const ownerUser = useSelector(selectUser(form.owner_user || -1));
15038
+ const currentUserId = useSelector(selectCurrentUser).id;
15366
15039
  const ownedByCurrentUser = !!ownerUser && ownerUser.id === currentUserId;
15367
15040
  const owner = ownerOrganization ?? (ownedByCurrentUser ? "You" : ownerUser == null ? void 0 : ownerUser.username) ?? "Unknown";
15368
15041
  const handleFavoriteClick = useCallback(
@@ -15417,15 +15090,15 @@ const styles$2 = {
15417
15090
  const FormSubmissionBrowserEntry = memo((props) => {
15418
15091
  var _a2;
15419
15092
  const { submission, onSubmissionClick, compact, labelType, rowDecorator } = props;
15420
- const currentUser = useAppSelector(selectCurrentUser);
15421
- const createdBy = useAppSelector(selectUser("created_by" in submission ? submission.created_by : currentUser.id));
15093
+ const currentUser = useSelector(selectCurrentUser);
15094
+ const createdBy = useSelector(selectUser("created_by" in submission ? submission.created_by : currentUser.id));
15422
15095
  const dateToUse = submission.submitted_at;
15423
15096
  const formattedDateTime = getLocalDateString(dateToUse);
15424
- const revision = useAppSelector(selectFormRevision(submission.form_revision));
15097
+ const revision = useSelector(selectFormRevision(submission.form_revision));
15425
15098
  if (!revision) {
15426
15099
  throw new Error(`Could not find revision ${submission.form_revision} for submission ${submission.offline_id}.`);
15427
15100
  }
15428
- const latestRevisionNumber = (_a2 = useAppSelector(selectLatestFormRevisionOfForm(revision.form))) == null ? void 0 : _a2.revision;
15101
+ const latestRevisionNumber = (_a2 = useSelector(selectLatestFormRevisionOfForm(revision.form))) == null ? void 0 : _a2.revision;
15429
15102
  const creatorProfileSrc = useFileSrc({
15430
15103
  file: (createdBy == null ? void 0 : createdBy.profile.file) ?? null,
15431
15104
  fileSha1: (createdBy == null ? void 0 : createdBy.profile.file_sha1) ?? null
@@ -15469,7 +15142,7 @@ const FormSubmissionBrowser = memo((props) => {
15469
15142
  if (!!formId2 === !!propSubmissions) {
15470
15143
  throw new Error("Either formId or submissions must be provided, but not both.");
15471
15144
  }
15472
- const submissions = useAppSelector(propSubmissions ? () => propSubmissions : selectFormSubmissionsOfForm(formId2));
15145
+ const submissions = useSelector(propSubmissions ? () => propSubmissions : selectFormSubmissionsOfForm(formId2));
15473
15146
  const sortedSubmissions = useMemo(
15474
15147
  () => submissions == null ? void 0 : submissions.sort((a, b) => {
15475
15148
  return a.submitted_at.localeCompare(b.submitted_at);
@@ -15727,7 +15400,7 @@ const styles = {
15727
15400
  const formId = "form-builder";
15728
15401
  const fieldsToChoose = [
15729
15402
  ["string", "text"],
15730
- ["select", "multi-select", "upload"],
15403
+ ["select", "multi-select", "upload", "qr"],
15731
15404
  ["boolean", "date", "number", "multi-string"]
15732
15405
  ];
15733
15406
  const CompleteFieldTypeToClsMapping = {
@@ -16700,6 +16373,13 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
16700
16373
  export {
16701
16374
  APIError,
16702
16375
  AgentService,
16376
+ AssetAttachmentService,
16377
+ AssetService,
16378
+ AssetStageColors,
16379
+ AssetStageCompletionService,
16380
+ AssetStageService,
16381
+ AssetTypeAttachmentService,
16382
+ AssetTypeService,
16703
16383
  AttachmentModel,
16704
16384
  AuthService,
16705
16385
  BaseApiService,
@@ -16711,13 +16391,6 @@ export {
16711
16391
  ColorPicker,
16712
16392
  Colors,
16713
16393
  ColorsToString,
16714
- ComponentAttachmentService,
16715
- ComponentService,
16716
- ComponentStageColors,
16717
- ComponentStageCompletionService,
16718
- ComponentStageService,
16719
- ComponentTypeAttachmentService,
16720
- ComponentTypeService,
16721
16394
  DEFAULT_ISSUE_PRIORITY,
16722
16395
  DEFAULT_ISSUE_STATUS,
16723
16396
  DateField,
@@ -16809,14 +16482,14 @@ export {
16809
16482
  acceptProjectInvite,
16810
16483
  addActiveProjectFormSubmissionsCount,
16811
16484
  addActiveProjectIssuesCount,
16485
+ addAsset,
16486
+ addAssetAttachment,
16487
+ addAssetAttachments,
16488
+ addAssetType,
16489
+ addAssetTypeAttachment,
16490
+ addAssetTypeAttachments,
16491
+ addAssetsInBatches,
16812
16492
  addCategory,
16813
- addComponent,
16814
- addComponentAttachment,
16815
- addComponentAttachments,
16816
- addComponentType,
16817
- addComponentTypeAttachment,
16818
- addComponentTypeAttachments,
16819
- addComponentsInBatches,
16820
16493
  addConversation,
16821
16494
  addDocumentAttachment,
16822
16495
  addDocumentAttachments,
@@ -16861,6 +16534,14 @@ export {
16861
16534
  agentsReducer,
16862
16535
  agentsSlice,
16863
16536
  areArraysEqual,
16537
+ assetReducer,
16538
+ assetSlice,
16539
+ assetStageCompletionReducer,
16540
+ assetStageCompletionSlice,
16541
+ assetStageReducer,
16542
+ assetStageSlice,
16543
+ assetTypeReducer,
16544
+ assetTypeSlice,
16864
16545
  authReducer,
16865
16546
  authSlice,
16866
16547
  blobToBase64,
@@ -16870,14 +16551,6 @@ export {
16870
16551
  classNames$1 as classNames,
16871
16552
  cleanRecentIssues,
16872
16553
  clearTokens,
16873
- componentReducer,
16874
- componentSlice,
16875
- componentStageCompletionReducer,
16876
- componentStageCompletionSlice,
16877
- componentStageReducer,
16878
- componentStageSlice,
16879
- componentTypeReducer,
16880
- componentTypeSlice,
16881
16554
  constructUploadedFilePayloads,
16882
16555
  coordinatesAreEqual,
16883
16556
  coordinatesToLiteral,
@@ -16887,8 +16560,7 @@ export {
16887
16560
  createOfflineAction,
16888
16561
  createPointMarker,
16889
16562
  defaultBadgeColor,
16890
- defaultStore,
16891
- deleteComponentType,
16563
+ deleteAssetType,
16892
16564
  deleteForm,
16893
16565
  deleteFormRevision,
16894
16566
  deleteFormRevisionAttachment,
@@ -16937,7 +16609,7 @@ export {
16937
16609
  formSubmissionReducer,
16938
16610
  formSubmissionSlice,
16939
16611
  index as forms,
16940
- fullComponentMarkerSize,
16612
+ fullAssetMarkerSize,
16941
16613
  generateBadgeColors,
16942
16614
  genericMemo,
16943
16615
  getFileIdentifier,
@@ -16987,6 +16659,7 @@ export {
16987
16659
  overmapEnhancer,
16988
16660
  overmapReducer,
16989
16661
  overmapReducers,
16662
+ overmapRootReducer,
16990
16663
  patchCategory,
16991
16664
  performRequest,
16992
16665
  primaryColor,
@@ -16998,15 +16671,15 @@ export {
16998
16671
  projectSlice,
16999
16672
  rehydratedReducer,
17000
16673
  rehydratedSlice,
17001
- removeAllComponentsOfType,
16674
+ removeAllAssetsOfType,
16675
+ removeAsset,
16676
+ removeAssetAttachment,
16677
+ removeAssetAttachments,
16678
+ removeAssetTypeAttachment,
16679
+ removeAssetTypeAttachments,
17002
16680
  removeAttachmentsOfIssue,
17003
16681
  removeCategory,
17004
16682
  removeColor,
17005
- removeComponent,
17006
- removeComponentAttachment,
17007
- removeComponentAttachments,
17008
- removeComponentTypeAttachment,
17009
- removeComponentTypeAttachments,
17010
16683
  removeDocumentAttachment,
17011
16684
  removeDocumentAttachments,
17012
16685
  removeDocuments,
@@ -17038,7 +16711,6 @@ export {
17038
16711
  resetRecentIssues,
17039
16712
  resetStore,
17040
16713
  restructureCreateSelectorWithArgs,
17041
- rootReducer,
17042
16714
  saveActiveProjectFileBounds,
17043
16715
  searchIssues,
17044
16716
  selectAccessToken,
@@ -17057,16 +16729,31 @@ export {
17057
16729
  selectActiveWorkspace,
17058
16730
  selectActiveWorkspaceId,
17059
16731
  selectAllAttachments,
17060
- selectAllComponentAttachments,
17061
- selectAllComponentTypeAttachments,
17062
16732
  selectAllDocumentAttachments,
17063
16733
  selectAllProjectAttachments,
17064
16734
  selectAncestorIdsOfDocument,
17065
16735
  selectAppearance,
17066
- selectAttachmentsOfComponent,
17067
- selectAttachmentsOfComponentByType,
17068
- selectAttachmentsOfComponentType,
17069
- selectAttachmentsOfComponentTypeByType,
16736
+ selectAsset,
16737
+ selectAssetAttachment,
16738
+ selectAssetAttachmentMapping,
16739
+ selectAssetAttachments,
16740
+ selectAssetToAssetTypeMapping,
16741
+ selectAssetType,
16742
+ selectAssetTypeAttachment,
16743
+ selectAssetTypeAttachmentMapping,
16744
+ selectAssetTypeAttachments,
16745
+ selectAssetTypeStagesMapping,
16746
+ selectAssetTypes,
16747
+ selectAssetTypesByName,
16748
+ selectAssetTypesFromIds,
16749
+ selectAssetTypesMapping,
16750
+ selectAssets,
16751
+ selectAssetsMapping,
16752
+ selectAssetsOfAssetType,
16753
+ selectAttachmentsOfAsset,
16754
+ selectAttachmentsOfAssetByType,
16755
+ selectAttachmentsOfAssetType,
16756
+ selectAttachmentsOfAssetTypeByType,
17070
16757
  selectAttachmentsOfDocument,
17071
16758
  selectAttachmentsOfDocumentByType,
17072
16759
  selectAttachmentsOfFormRevision,
@@ -17083,25 +16770,8 @@ export {
17083
16770
  selectCenterMapToProject,
17084
16771
  selectCommentMapping,
17085
16772
  selectCommentsOfIssue,
17086
- selectCompletedStageIdsForComponent,
16773
+ selectCompletedStageIdsForAsset,
17087
16774
  selectCompletedStages,
17088
- selectComponent,
17089
- selectComponentAttachment,
17090
- selectComponentAttachmentMapping,
17091
- selectComponentType,
17092
- selectComponentTypeAttachment,
17093
- selectComponentTypeAttachmentMapping,
17094
- selectComponentTypeFromComponent,
17095
- selectComponentTypeFromComponents,
17096
- selectComponentTypeStagesMapping,
17097
- selectComponentTypes,
17098
- selectComponentTypesByName,
17099
- selectComponentTypesFromIds,
17100
- selectComponentTypesMapping,
17101
- selectComponents,
17102
- selectComponentsByType,
17103
- selectComponentsFromComponentType,
17104
- selectComponentsMapping,
17105
16775
  selectConversation,
17106
16776
  selectConversationMapping,
17107
16777
  selectConversations,
@@ -17126,7 +16796,7 @@ export {
17126
16796
  selectFilteredForms,
17127
16797
  selectForm,
17128
16798
  selectFormMapping,
17129
- selectFormOfComponentType,
16799
+ selectFormOfAssetType,
17130
16800
  selectFormOfIssueType,
17131
16801
  selectFormRevision,
17132
16802
  selectFormRevisionMapping,
@@ -17135,16 +16805,16 @@ export {
17135
16805
  selectFormSubmission,
17136
16806
  selectFormSubmissionAttachmentsMapping,
17137
16807
  selectFormSubmissions,
17138
- selectFormSubmissionsByComponents,
16808
+ selectFormSubmissionsByAssets,
17139
16809
  selectFormSubmissionsByFormRevisions,
17140
16810
  selectFormSubmissionsMapping,
17141
- selectFormSubmissionsOfComponent,
16811
+ selectFormSubmissionsOfAsset,
17142
16812
  selectFormSubmissionsOfForm,
17143
16813
  selectFormSubmissionsOfIssue,
17144
16814
  selectFormsCount,
17145
16815
  selectGeneralFormCount,
16816
+ selectHiddenAssetTypeIds,
17146
16817
  selectHiddenCategoryCount,
17147
- selectHiddenComponentTypeIds,
17148
16818
  selectIsFetchingInitialData,
17149
16819
  selectIsImportingProjectFile,
17150
16820
  selectIsLoading,
@@ -17166,7 +16836,7 @@ export {
17166
16836
  selectIssuesOfIssueTypeCount,
17167
16837
  selectLatestFormRevisionByForm,
17168
16838
  selectLatestFormRevisionOfForm,
17169
- selectLatestFormRevisionsOfComponentTypes,
16839
+ selectLatestFormRevisionsOfAssetTypes,
17170
16840
  selectLatestRetryTime,
17171
16841
  selectLicense,
17172
16842
  selectLicenseForProject,
@@ -17174,8 +16844,8 @@ export {
17174
16844
  selectLicensesForProjectsMapping,
17175
16845
  selectMainWorkspace,
17176
16846
  selectMapStyle,
17177
- selectNumberOfComponentTypesMatchingCaseInsensitiveName,
17178
- selectNumberOfComponentsOfComponentType,
16847
+ selectNumberOfAssetTypesMatchingCaseInsensitiveName,
16848
+ selectNumberOfAssetsOfAssetType,
17179
16849
  selectOrganization,
17180
16850
  selectOrganizationAccess,
17181
16851
  selectOrganizationAccessForUser,
@@ -17216,9 +16886,9 @@ export {
17216
16886
  selectStageFormIdsFromStageIds,
17217
16887
  selectStageMapping,
17218
16888
  selectStages,
17219
- selectStagesFromComponentType,
17220
- selectStagesFromComponentTypeIds,
16889
+ selectStagesFromAssetTypeIds,
17221
16890
  selectStagesFromStageIds,
16891
+ selectStagesOfAssetType,
17222
16892
  selectTeam,
17223
16893
  selectTeams,
17224
16894
  selectTeamsMapping,
@@ -17240,14 +16910,14 @@ export {
17240
16910
  setActiveProjectId,
17241
16911
  setActiveWorkspaceId,
17242
16912
  setAppearance,
16913
+ setAssetAttachment,
16914
+ setAssetAttachments,
16915
+ setAssetTypeAttachment,
16916
+ setAssetTypeAttachments,
16917
+ setAssetTypes,
16918
+ setAssets,
17243
16919
  setCategories,
17244
16920
  setCenterMapToProject,
17245
- setComponentAttachment,
17246
- setComponentAttachments,
17247
- setComponentTypeAttachment,
17248
- setComponentTypeAttachments,
17249
- setComponentTypes,
17250
- setComponents,
17251
16921
  setConversation,
17252
16922
  setConversations,
17253
16923
  setCreateProjectType,
@@ -17310,18 +16980,18 @@ export {
17310
16980
  teamSlice,
17311
16981
  toFileNameSafeString,
17312
16982
  toOfflineIdRecord,
17313
- toggleComponentTypeVisibility,
16983
+ toggleAssetTypeVisibility,
17314
16984
  truncate,
17315
16985
  unfavoriteForm,
17316
16986
  unhideAllCategories,
17317
16987
  unhideCategory,
17318
16988
  unlinkStageToForm,
17319
16989
  updateActiveOrganization,
17320
- updateComponent,
17321
- updateComponentAttachment,
17322
- updateComponentAttachments,
17323
- updateComponentTypeAttachment,
17324
- updateComponentTypeAttachments,
16990
+ updateAsset,
16991
+ updateAssetAttachment,
16992
+ updateAssetAttachments,
16993
+ updateAssetTypeAttachment,
16994
+ updateAssetTypeAttachments,
17325
16995
  updateConversation,
17326
16996
  updateDocumentAttachment,
17327
16997
  updateDocumentAttachments,
@@ -17341,8 +17011,6 @@ export {
17341
17011
  updateProjectAttachments,
17342
17012
  updateStages,
17343
17013
  updateTeam,
17344
- useAppDispatch,
17345
- useAppSelector,
17346
17014
  useFieldInput,
17347
17015
  useFieldInputs,
17348
17016
  useFileSrc,