@overmap-ai/core 1.0.53-add-agent-conversations.6 → 1.0.53-attachment-creation-flows.1

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 (35) hide show
  1. package/README.md +4 -4
  2. package/dist/overmap-core.js +1163 -1120
  3. package/dist/overmap-core.js.map +1 -1
  4. package/dist/overmap-core.umd.cjs +1129 -1086
  5. package/dist/overmap-core.umd.cjs.map +1 -1
  6. package/dist/sdk/sdk.d.ts +6 -2
  7. package/dist/sdk/services/AgentService.d.ts +30 -2
  8. package/dist/sdk/services/BaseAttachmentService.d.ts +31 -0
  9. package/dist/sdk/services/ComponentAttachmentService.d.ts +10 -0
  10. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +10 -0
  11. package/dist/sdk/services/DocumentAttachmentService.d.ts +10 -0
  12. package/dist/sdk/services/IssueAttachmentService.d.ts +10 -0
  13. package/dist/sdk/services/IssueService.d.ts +1 -1
  14. package/dist/sdk/services/ProjectAttachmentService.d.ts +10 -0
  15. package/dist/sdk/services/index.d.ts +5 -1
  16. package/dist/store/slices/categorySlice.d.ts +0 -1
  17. package/dist/store/slices/componentSlice.d.ts +15 -7
  18. package/dist/store/slices/componentTypeSlice.d.ts +16 -8
  19. package/dist/store/slices/documentSlice.d.ts +10 -3
  20. package/dist/store/slices/formRevisionSlice.d.ts +0 -1
  21. package/dist/store/slices/index.d.ts +0 -1
  22. package/dist/store/slices/issueSlice.d.ts +33 -22
  23. package/dist/store/slices/projectFileSlice.d.ts +0 -1
  24. package/dist/store/slices/projectSlice.d.ts +12 -3
  25. package/dist/store/slices/utils.d.ts +3 -2
  26. package/dist/store/slices/workspaceSlice.d.ts +0 -1
  27. package/dist/store/store.d.ts +1 -4
  28. package/dist/typings/models/attachments.d.ts +7 -0
  29. package/dist/typings/models/index.d.ts +0 -1
  30. package/dist/typings/models/projects.d.ts +4 -5
  31. package/dist/utils/utils.d.ts +0 -1
  32. package/package.json +153 -153
  33. package/dist/sdk/services/AttachmentService.d.ts +0 -46
  34. package/dist/store/slices/agentsSlice.d.ts +0 -15
  35. package/dist/typings/models/agents.d.ts +0 -44
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  (function(global2, factory) {
8
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-dom"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "file-saver", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "lodash.get", "linkify-react", "@hello-pangea/dnd", "qr-scanner", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-dom", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.saveAs, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.get, global2.Linkify, global2.dnd, global2.QrScannerAPI, global2.xlsx, global2.reactPdf, null, null, global2.ReactDOM, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
9
- })(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, ReactDOM, reactSketchCanvas, set, cloneDeep) {
8
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("react-dom"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "file-saver", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "react-dom", "lodash.get", "linkify-react", "@hello-pangea/dnd", "qr-scanner", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.saveAs, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.ReactDOM, global2.get, global2.Linkify, global2.dnd, global2.QrScannerAPI, global2.xlsx, global2.reactPdf, null, null, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
9
+ })(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, ReactDOM, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, reactSketchCanvas, set, cloneDeep) {
10
10
  var _a;
11
11
  "use strict";
12
12
  function _interopNamespaceDefault(e) {
@@ -668,15 +668,15 @@ var __publicField = (obj, key, value) => {
668
668
  };
669
669
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
670
670
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
671
- const initialState$s = {
671
+ const initialState$r = {
672
672
  accessToken: "",
673
673
  refreshToken: "",
674
674
  isLoggedIn: false
675
675
  };
676
676
  const authSlice = toolkit.createSlice({
677
677
  name: "auth",
678
- initialState: initialState$s,
679
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
678
+ initialState: initialState$r,
679
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
680
680
  reducers: {
681
681
  setTokens: (state, action) => {
682
682
  state.accessToken = action.payload.accessToken;
@@ -954,7 +954,6 @@ var __publicField = (obj, key, value) => {
954
954
  return subString.slice(0, subString.lastIndexOf(" ")) + "…";
955
955
  }
956
956
  const restructureCreateSelectorWithArgs = (selector) => (args) => (state) => selector(state, args);
957
- const createSelectorWithArgs = restructureCreateSelectorWithArgs;
958
957
  function onlyUniqueOfflineIds(value, index2, self2) {
959
958
  return self2.findIndex((v) => v.offline_id === value.offline_id) === index2;
960
959
  }
@@ -1421,7 +1420,7 @@ var __publicField = (obj, key, value) => {
1421
1420
  return getLocalDateString(date);
1422
1421
  return relative.format(days, "days");
1423
1422
  });
1424
- const initialState$r = {
1423
+ const initialState$q = {
1425
1424
  categories: {},
1426
1425
  usedCategoryColors: [],
1427
1426
  categoryVisibility: {
@@ -1431,8 +1430,8 @@ var __publicField = (obj, key, value) => {
1431
1430
  };
1432
1431
  const categorySlice = toolkit.createSlice({
1433
1432
  name: "categories",
1434
- initialState: initialState$r,
1435
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
1433
+ initialState: initialState$q,
1434
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1436
1435
  reducers: {
1437
1436
  setCategories: (state, action) => {
1438
1437
  if (!Array.isArray(action.payload))
@@ -1568,6 +1567,9 @@ var __publicField = (obj, key, value) => {
1568
1567
  return Object.values(state.issueReducer.issues).filter((issue) => issue.category === categoryId).length;
1569
1568
  };
1570
1569
  const categoryReducer = categorySlice.reducer;
1570
+ function setAttachment(state, action) {
1571
+ state.attachments[action.payload.offline_id] = action.payload;
1572
+ }
1571
1573
  function setAttachments(state, action) {
1572
1574
  state.attachments = {};
1573
1575
  for (const attachment of action.payload) {
@@ -1592,6 +1594,15 @@ var __publicField = (obj, key, value) => {
1592
1594
  throw new Error(`Attachment ${action.payload.offline_id} does not exist.`);
1593
1595
  }
1594
1596
  }
1597
+ function updateAttachments(state, action) {
1598
+ for (const attachment of action.payload) {
1599
+ if (attachment.offline_id in state.attachments) {
1600
+ state.attachments[attachment.offline_id] = attachment;
1601
+ } else {
1602
+ throw new Error(`Attachment ${attachment.offline_id} does not exist.`);
1603
+ }
1604
+ }
1605
+ }
1595
1606
  function removeAttachment(state, action) {
1596
1607
  if (action.payload in state.attachments) {
1597
1608
  delete state.attachments[action.payload];
@@ -1604,14 +1615,14 @@ var __publicField = (obj, key, value) => {
1604
1615
  delete state.attachments[attachmentId];
1605
1616
  }
1606
1617
  }
1607
- const initialState$q = {
1618
+ const initialState$p = {
1608
1619
  components: {},
1609
1620
  attachments: {}
1610
1621
  };
1611
1622
  const componentSlice = toolkit.createSlice({
1612
1623
  name: "components",
1613
- initialState: initialState$q,
1614
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1624
+ initialState: initialState$p,
1625
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1615
1626
  reducers: {
1616
1627
  addComponent: (state, action) => {
1617
1628
  state.components[action.payload.offline_id] = action.payload;
@@ -1625,12 +1636,6 @@ var __publicField = (obj, key, value) => {
1625
1636
  state.components = toOfflineIdRecord(action.payload);
1626
1637
  prevComponents = null;
1627
1638
  },
1628
- setComponentAttachments: setAttachments,
1629
- addComponentAttachment: addAttachment,
1630
- addComponentAttachments: addAttachments,
1631
- updateComponentAttachment: updateAttachment,
1632
- removeComponentAttachment: removeAttachment,
1633
- removeComponentAttachments: removeAttachments,
1634
1639
  updateComponent: (state, action) => {
1635
1640
  if (action.payload.offline_id in state.components) {
1636
1641
  state.components[action.payload.offline_id] = action.payload;
@@ -1655,9 +1660,35 @@ var __publicField = (obj, key, value) => {
1655
1660
  }
1656
1661
  }
1657
1662
  prevComponents = null;
1658
- }
1663
+ },
1664
+ // Attachments
1665
+ setComponentAttachment: setAttachment,
1666
+ setComponentAttachments: setAttachments,
1667
+ addComponentAttachment: addAttachment,
1668
+ addComponentAttachments: addAttachments,
1669
+ updateComponentAttachment: updateAttachment,
1670
+ updateComponentAttachments: updateAttachments,
1671
+ removeComponentAttachment: removeAttachment,
1672
+ removeComponentAttachments: removeAttachments
1659
1673
  }
1660
1674
  });
1675
+ const {
1676
+ addComponent,
1677
+ updateComponent,
1678
+ removeComponent,
1679
+ addComponentsInBatches,
1680
+ setComponents,
1681
+ removeAllComponentsOfType,
1682
+ // Attachments
1683
+ setComponentAttachment,
1684
+ setComponentAttachments,
1685
+ addComponentAttachment,
1686
+ addComponentAttachments,
1687
+ updateComponentAttachment,
1688
+ updateComponentAttachments,
1689
+ removeComponentAttachment,
1690
+ removeComponentAttachments
1691
+ } = componentSlice.actions;
1661
1692
  let prevComponents = null;
1662
1693
  const selectComponents = (state) => {
1663
1694
  if (!prevComponents) {
@@ -1752,28 +1783,14 @@ var __publicField = (obj, key, value) => {
1752
1783
  }
1753
1784
  )
1754
1785
  );
1755
- const {
1756
- addComponent,
1757
- updateComponent,
1758
- removeComponent,
1759
- addComponentsInBatches,
1760
- setComponents,
1761
- setComponentAttachments,
1762
- addComponentAttachment,
1763
- addComponentAttachments,
1764
- updateComponentAttachment,
1765
- removeComponentAttachment,
1766
- removeComponentAttachments,
1767
- removeAllComponentsOfType
1768
- } = componentSlice.actions;
1769
1786
  const componentReducer = componentSlice.reducer;
1770
- const initialState$p = {
1787
+ const initialState$o = {
1771
1788
  completionsByComponentId: {}
1772
1789
  };
1773
1790
  const componentStageCompletionSlice = toolkit.createSlice({
1774
1791
  name: "componentStageCompletions",
1775
- initialState: initialState$p,
1776
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1792
+ initialState: initialState$o,
1793
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1777
1794
  reducers: {
1778
1795
  addStageCompletion: (state, action) => {
1779
1796
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1824,13 +1841,13 @@ var __publicField = (obj, key, value) => {
1824
1841
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1825
1842
  };
1826
1843
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1827
- const initialState$o = {
1844
+ const initialState$n = {
1828
1845
  stages: {}
1829
1846
  };
1830
1847
  const componentStageSlice = toolkit.createSlice({
1831
1848
  name: "componentStages",
1832
- initialState: initialState$o,
1833
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1849
+ initialState: initialState$n,
1850
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1834
1851
  reducers: {
1835
1852
  addStages: (state, action) => {
1836
1853
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1940,15 +1957,15 @@ var __publicField = (obj, key, value) => {
1940
1957
  );
1941
1958
  const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1942
1959
  const componentStageReducer = componentStageSlice.reducer;
1943
- const initialState$n = {
1960
+ const initialState$m = {
1944
1961
  componentTypes: {},
1945
1962
  hiddenComponentTypeIds: {},
1946
1963
  attachments: {}
1947
1964
  };
1948
1965
  const componentTypeSlice = toolkit.createSlice({
1949
1966
  name: "componentTypes",
1950
- initialState: initialState$n,
1951
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1967
+ initialState: initialState$m,
1968
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1952
1969
  reducers: {
1953
1970
  addComponentType: (state, action) => {
1954
1971
  state.componentTypes[action.payload.offline_id] = action.payload;
@@ -1956,20 +1973,38 @@ var __publicField = (obj, key, value) => {
1956
1973
  setComponentTypes: (state, action) => {
1957
1974
  state.componentTypes = toOfflineIdRecord(action.payload);
1958
1975
  },
1959
- setComponentTypeAttachments: setAttachments,
1960
- addComponentTypeAttachment: addAttachment,
1961
- addComponentTypeAttachments: addAttachments,
1962
- updateComponentTypeAttachment: updateAttachment,
1963
- removeComponentTypeAttachment: removeAttachment,
1964
- removeComponentTypeAttachments: removeAttachments,
1965
1976
  toggleComponentTypeVisibility: (state, action) => {
1966
1977
  state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1967
1978
  },
1968
1979
  deleteComponentType: (state, action) => {
1969
1980
  delete state.componentTypes[action.payload];
1970
- }
1981
+ },
1982
+ // Attachments
1983
+ setComponentTypeAttachment: setAttachment,
1984
+ setComponentTypeAttachments: setAttachments,
1985
+ addComponentTypeAttachment: addAttachment,
1986
+ addComponentTypeAttachments: addAttachments,
1987
+ updateComponentTypeAttachment: updateAttachment,
1988
+ updateComponentTypeAttachments: updateAttachments,
1989
+ removeComponentTypeAttachment: removeAttachment,
1990
+ removeComponentTypeAttachments: removeAttachments
1971
1991
  }
1972
1992
  });
1993
+ const {
1994
+ addComponentType,
1995
+ setComponentTypes,
1996
+ toggleComponentTypeVisibility,
1997
+ deleteComponentType,
1998
+ // Attachmet
1999
+ setComponentTypeAttachment,
2000
+ setComponentTypeAttachments,
2001
+ addComponentTypeAttachment,
2002
+ addComponentTypeAttachments,
2003
+ updateComponentTypeAttachment,
2004
+ updateComponentTypeAttachments,
2005
+ removeComponentTypeAttachment,
2006
+ removeComponentTypeAttachments
2007
+ } = componentTypeSlice.actions;
1973
2008
  const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1974
2009
  const selectComponentTypes = toolkit.createSelector(
1975
2010
  [selectComponentTypesMapping],
@@ -2046,26 +2081,14 @@ var __publicField = (obj, key, value) => {
2046
2081
  }
2047
2082
  )
2048
2083
  );
2049
- const {
2050
- addComponentType,
2051
- setComponentTypes,
2052
- setComponentTypeAttachments,
2053
- addComponentTypeAttachment,
2054
- addComponentTypeAttachments,
2055
- updateComponentTypeAttachment,
2056
- removeComponentTypeAttachment,
2057
- removeComponentTypeAttachments,
2058
- toggleComponentTypeVisibility,
2059
- deleteComponentType
2060
- } = componentTypeSlice.actions;
2061
2084
  const componentTypeReducer = componentTypeSlice.reducer;
2062
- const initialState$m = {
2085
+ const initialState$l = {
2063
2086
  workspaces: {},
2064
2087
  activeWorkspaceId: null
2065
2088
  };
2066
2089
  const workspaceSlice = toolkit.createSlice({
2067
2090
  name: "workspace",
2068
- initialState: initialState$m,
2091
+ initialState: initialState$l,
2069
2092
  // The `reducers` field lets us define reducers and generate associated actions
2070
2093
  reducers: {
2071
2094
  setWorkspaces: (state, action) => {
@@ -2122,7 +2145,7 @@ var __publicField = (obj, key, value) => {
2122
2145
  );
2123
2146
  const workspaceReducer = workspaceSlice.reducer;
2124
2147
  const maxRecentIssues = 10;
2125
- const initialState$l = {
2148
+ const initialState$k = {
2126
2149
  issues: {},
2127
2150
  attachments: {},
2128
2151
  comments: {},
@@ -2134,9 +2157,9 @@ var __publicField = (obj, key, value) => {
2134
2157
  };
2135
2158
  const issueSlice = toolkit.createSlice({
2136
2159
  name: "issues",
2137
- initialState: initialState$l,
2160
+ initialState: initialState$k,
2138
2161
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2139
- Object.assign(state, initialState$l);
2162
+ Object.assign(state, initialState$k);
2140
2163
  }),
2141
2164
  reducers: {
2142
2165
  setIssues: (state, action) => {
@@ -2147,7 +2170,6 @@ var __publicField = (obj, key, value) => {
2147
2170
  state.issues[issue.offline_id] = issue;
2148
2171
  });
2149
2172
  },
2150
- setIssueAttachments: setAttachments,
2151
2173
  setIssueUpdates: (state, action) => {
2152
2174
  if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
2153
2175
  throw new Error("Tried to use setIssues reducer with duplicate ID's");
@@ -2177,8 +2199,6 @@ var __publicField = (obj, key, value) => {
2177
2199
  state.issues[issue.offline_id] = issue;
2178
2200
  }
2179
2201
  },
2180
- addIssueAttachment: addAttachment,
2181
- addIssueAttachments: addAttachments,
2182
2202
  addIssueUpdate: (state, action) => {
2183
2203
  if (action.payload.offline_id in state.updates) {
2184
2204
  throw new Error(`Tried to add duplicate issue update with offline_id: ${action.payload.offline_id}`);
@@ -2200,7 +2220,6 @@ var __publicField = (obj, key, value) => {
2200
2220
  throw new Error(`Tried to update issue with ID that doesn't exist: ${action.payload.offline_id}`);
2201
2221
  }
2202
2222
  },
2203
- updateIssueAttachment: updateAttachment,
2204
2223
  removeIssue: (state, action) => {
2205
2224
  if (action.payload in state.issues) {
2206
2225
  delete state.issues[action.payload];
@@ -2213,7 +2232,6 @@ var __publicField = (obj, key, value) => {
2213
2232
  delete state.issues[issueId];
2214
2233
  }
2215
2234
  },
2216
- removeIssueAttachment: removeAttachment,
2217
2235
  removeIssueUpdate: (state, action) => {
2218
2236
  if (action.payload in state.updates) {
2219
2237
  delete state.updates[action.payload];
@@ -2310,12 +2328,19 @@ var __publicField = (obj, key, value) => {
2310
2328
  if (indexToRemove !== -1) {
2311
2329
  state.recentIssueIds.splice(indexToRemove, 1);
2312
2330
  }
2313
- }
2331
+ },
2332
+ // Attachments
2333
+ setIssueAttachment: setAttachment,
2334
+ setIssueAttachments: setAttachments,
2335
+ addIssueAttachment: addAttachment,
2336
+ addIssueAttachments: addAttachments,
2337
+ updateIssueAttachment: updateAttachment,
2338
+ updateIssueAttachments: updateAttachments,
2339
+ removeIssueAttachment: removeAttachment,
2340
+ removeIssueAttachments: removeAttachments
2314
2341
  }
2315
2342
  });
2316
2343
  const {
2317
- addIssueAttachment,
2318
- addIssueAttachments,
2319
2344
  addIssue,
2320
2345
  addIssues,
2321
2346
  addIssueUpdate,
@@ -2323,7 +2348,6 @@ var __publicField = (obj, key, value) => {
2323
2348
  addOrReplaceIssueComment,
2324
2349
  addToRecentIssues,
2325
2350
  cleanRecentIssues,
2326
- removeIssueAttachment,
2327
2351
  removeAttachmentsOfIssue,
2328
2352
  removeIssue,
2329
2353
  removeIssues,
@@ -2332,13 +2356,20 @@ var __publicField = (obj, key, value) => {
2332
2356
  removeRecentIssue,
2333
2357
  resetRecentIssues,
2334
2358
  setActiveIssueId,
2335
- setIssueAttachments,
2336
2359
  setIssueUpdates,
2337
2360
  setIssues,
2338
2361
  setVisibleStatuses,
2339
2362
  setVisibleUserIds,
2340
- updateIssueAttachment,
2341
2363
  updateIssue,
2364
+ // Attachments
2365
+ setIssueAttachment,
2366
+ setIssueAttachments,
2367
+ addIssueAttachment,
2368
+ addIssueAttachments,
2369
+ updateIssueAttachment,
2370
+ updateIssueAttachments,
2371
+ removeIssueAttachment,
2372
+ removeIssueAttachments,
2342
2373
  // Commments
2343
2374
  addIssueComment,
2344
2375
  addIssueComments,
@@ -2561,14 +2592,14 @@ var __publicField = (obj, key, value) => {
2561
2592
  }
2562
2593
  );
2563
2594
  const issueReducer = issueSlice.reducer;
2564
- const initialState$k = {
2595
+ const initialState$j = {
2565
2596
  issueTypes: {}
2566
2597
  };
2567
2598
  const issueTypeSlice = toolkit.createSlice({
2568
2599
  name: "issueTypes",
2569
- initialState: initialState$k,
2600
+ initialState: initialState$j,
2570
2601
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2571
- Object.assign(state, initialState$k);
2602
+ Object.assign(state, initialState$j);
2572
2603
  }),
2573
2604
  reducers: {
2574
2605
  setIssueTypes: (state, action) => {
@@ -2635,15 +2666,15 @@ var __publicField = (obj, key, value) => {
2635
2666
  return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
2636
2667
  };
2637
2668
  const issueTypeReducer = issueTypeSlice.reducer;
2638
- const initialState$j = {
2669
+ const initialState$i = {
2639
2670
  s3Urls: {}
2640
2671
  };
2641
2672
  const msPerHour = 1e3 * 60 * 60;
2642
2673
  const msPerWeek = msPerHour * 24 * 7;
2643
2674
  const fileSlice = toolkit.createSlice({
2644
2675
  name: "file",
2645
- initialState: initialState$j,
2646
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
2676
+ initialState: initialState$i,
2677
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2647
2678
  reducers: {
2648
2679
  setUploadUrl: (state, action) => {
2649
2680
  const { url, fields, sha1 } = action.payload;
@@ -2670,7 +2701,7 @@ var __publicField = (obj, key, value) => {
2670
2701
  return url;
2671
2702
  };
2672
2703
  const fileReducer = fileSlice.reducer;
2673
- const initialState$i = {
2704
+ const initialState$h = {
2674
2705
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2675
2706
  mapStyle: MapStyle.SATELLITE,
2676
2707
  showTooltips: false,
@@ -2678,8 +2709,8 @@ var __publicField = (obj, key, value) => {
2678
2709
  };
2679
2710
  const mapSlice = toolkit.createSlice({
2680
2711
  name: "map",
2681
- initialState: initialState$i,
2682
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2712
+ initialState: initialState$h,
2713
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2683
2714
  reducers: {
2684
2715
  setMapStyle: (state, action) => {
2685
2716
  state.mapStyle = action.payload;
@@ -2707,6 +2738,14 @@ var __publicField = (obj, key, value) => {
2707
2738
  OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
2708
2739
  return OrganizationAccessLevel2;
2709
2740
  })(OrganizationAccessLevel || {});
2741
+ var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
2742
+ AttachmentModel2["Issue"] = "issue";
2743
+ AttachmentModel2["Component"] = "component";
2744
+ AttachmentModel2["ComponentType"] = "component_type";
2745
+ AttachmentModel2["Project"] = "project";
2746
+ AttachmentModel2["Document"] = "document";
2747
+ return AttachmentModel2;
2748
+ })(AttachmentModel || {});
2710
2749
  var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
2711
2750
  IssueUpdateChange2["STATUS"] = "status";
2712
2751
  IssueUpdateChange2["PRIORITY"] = "priority";
@@ -2748,7 +2787,7 @@ var __publicField = (obj, key, value) => {
2748
2787
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
2749
2788
  return LicenseStatus2;
2750
2789
  })(LicenseStatus || {});
2751
- const initialState$h = {
2790
+ const initialState$g = {
2752
2791
  users: {},
2753
2792
  currentUser: {
2754
2793
  id: 0,
@@ -2759,8 +2798,8 @@ var __publicField = (obj, key, value) => {
2759
2798
  };
2760
2799
  const userSlice = toolkit.createSlice({
2761
2800
  name: "users",
2762
- initialState: initialState$h,
2763
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2801
+ initialState: initialState$g,
2802
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2764
2803
  reducers: {
2765
2804
  setUsers: (state, action) => {
2766
2805
  const usersMapping = {};
@@ -2822,13 +2861,13 @@ var __publicField = (obj, key, value) => {
2822
2861
  const selectUsersAsMapping = (state) => state.userReducer.users;
2823
2862
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2824
2863
  const userReducer = userSlice.reducer;
2825
- const initialState$g = {
2864
+ const initialState$f = {
2826
2865
  organizationAccesses: {}
2827
2866
  };
2828
2867
  const organizationAccessSlice = toolkit.createSlice({
2829
2868
  name: "organizationAccess",
2830
- initialState: initialState$g,
2831
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2869
+ initialState: initialState$f,
2870
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2832
2871
  reducers: {
2833
2872
  setOrganizationAccesses: (state, action) => {
2834
2873
  if (!Array.isArray(action.payload))
@@ -2891,13 +2930,13 @@ var __publicField = (obj, key, value) => {
2891
2930
  return organizationAccesses;
2892
2931
  };
2893
2932
  const organizationAccessReducer = organizationAccessSlice.reducer;
2894
- const initialState$f = {
2933
+ const initialState$e = {
2895
2934
  licenses: {}
2896
2935
  };
2897
2936
  const licenseSlice = toolkit.createSlice({
2898
2937
  name: "license",
2899
- initialState: initialState$f,
2900
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2938
+ initialState: initialState$e,
2939
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2901
2940
  reducers: {
2902
2941
  setLicenses: (state, action) => {
2903
2942
  if (!Array.isArray(action.payload))
@@ -2942,13 +2981,13 @@ var __publicField = (obj, key, value) => {
2942
2981
  (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2943
2982
  );
2944
2983
  const licenseReducer = licenseSlice.reducer;
2945
- const initialState$e = {
2984
+ const initialState$d = {
2946
2985
  projectAccesses: {}
2947
2986
  };
2948
2987
  const projectAccessSlice = toolkit.createSlice({
2949
2988
  name: "projectAccess",
2950
- initialState: initialState$e,
2951
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2989
+ initialState: initialState$d,
2990
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2952
2991
  reducers: {
2953
2992
  setProjectAccesses: (state, action) => {
2954
2993
  if (!Array.isArray(action.payload))
@@ -3016,7 +3055,7 @@ var __publicField = (obj, key, value) => {
3016
3055
  return projectAccesses;
3017
3056
  };
3018
3057
  const projectAccessReducer = projectAccessSlice.reducer;
3019
- const initialState$d = {
3058
+ const initialState$c = {
3020
3059
  projects: {},
3021
3060
  activeProjectId: null,
3022
3061
  recentProjectIds: [],
@@ -3026,7 +3065,7 @@ var __publicField = (obj, key, value) => {
3026
3065
  };
3027
3066
  const projectSlice = toolkit.createSlice({
3028
3067
  name: "projects",
3029
- initialState: initialState$d,
3068
+ initialState: initialState$c,
3030
3069
  reducers: {
3031
3070
  setProjects: (state, action) => {
3032
3071
  const projectsMap = {};
@@ -3094,11 +3133,13 @@ var __publicField = (obj, key, value) => {
3094
3133
  throw new Error("Update form submissions count: no active project");
3095
3134
  }
3096
3135
  },
3097
- // Attachment related
3136
+ // Attachments
3137
+ setProjectAttachment: setAttachment,
3098
3138
  setProjectAttachments: setAttachments,
3099
3139
  addProjectAttachment: addAttachment,
3100
3140
  addProjectAttachments: addAttachments,
3101
3141
  updateProjectAttachment: updateAttachment,
3142
+ updateProjectAttachments: updateAttachments,
3102
3143
  removeProjectAttachment: removeAttachment,
3103
3144
  removeProjectAttachments: removeAttachments
3104
3145
  }
@@ -3113,11 +3154,13 @@ var __publicField = (obj, key, value) => {
3113
3154
  acceptProjectInvite,
3114
3155
  addActiveProjectIssuesCount,
3115
3156
  addActiveProjectFormSubmissionsCount,
3116
- // Attachment related
3157
+ // Attachments
3158
+ setProjectAttachment,
3117
3159
  setProjectAttachments,
3118
3160
  addProjectAttachment,
3119
3161
  addProjectAttachments,
3120
3162
  updateProjectAttachment,
3163
+ updateProjectAttachments,
3121
3164
  removeProjectAttachment,
3122
3165
  removeProjectAttachments
3123
3166
  } = projectSlice.actions;
@@ -3188,6 +3231,9 @@ var __publicField = (obj, key, value) => {
3188
3231
  [selectProjectAttachmentMapping],
3189
3232
  (mapping) => Object.values(mapping)
3190
3233
  );
3234
+ const selectProjectAttachment = (attachmentId) => (state) => {
3235
+ return state.projectReducer.attachments[attachmentId];
3236
+ };
3191
3237
  const selectAttachmentsOfProject = restructureCreateSelectorWithArgs(
3192
3238
  toolkit.createSelector(
3193
3239
  [selectAllProjectAttachments, (_state, projectId) => projectId],
@@ -3213,14 +3259,14 @@ var __publicField = (obj, key, value) => {
3213
3259
  }
3214
3260
  )
3215
3261
  );
3216
- const initialState$c = {
3262
+ const initialState$b = {
3217
3263
  organizations: {},
3218
3264
  activeOrganizationId: null
3219
3265
  };
3220
3266
  const organizationSlice = toolkit.createSlice({
3221
3267
  name: "organizations",
3222
- initialState: initialState$c,
3223
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
3268
+ initialState: initialState$b,
3269
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3224
3270
  reducers: {
3225
3271
  setOrganizations: (state, action) => {
3226
3272
  for (const org of action.payload) {
@@ -3339,14 +3385,14 @@ var __publicField = (obj, key, value) => {
3339
3385
  }
3340
3386
  };
3341
3387
  };
3342
- const initialState$b = {
3388
+ const initialState$a = {
3343
3389
  deletedRequests: [],
3344
3390
  latestRetryTime: 0
3345
3391
  };
3346
3392
  const outboxSlice = toolkit.createSlice({
3347
3393
  name: "outbox",
3348
- initialState: initialState$b,
3349
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3394
+ initialState: initialState$a,
3395
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3350
3396
  reducers: {
3351
3397
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
3352
3398
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -3378,7 +3424,7 @@ var __publicField = (obj, key, value) => {
3378
3424
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
3379
3425
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
3380
3426
  const outboxReducer = outboxSlice.reducer;
3381
- const initialState$a = {
3427
+ const initialState$9 = {
3382
3428
  projectFiles: {},
3383
3429
  activeProjectFileId: null,
3384
3430
  isImportingProjectFile: false,
@@ -3386,8 +3432,8 @@ var __publicField = (obj, key, value) => {
3386
3432
  };
3387
3433
  const projectFileSlice = toolkit.createSlice({
3388
3434
  name: "projectFiles",
3389
- initialState: initialState$a,
3390
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3435
+ initialState: initialState$9,
3436
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3391
3437
  reducers: {
3392
3438
  addOrReplaceProjectFiles: (state, action) => {
3393
3439
  for (let fileObj of action.payload) {
@@ -3488,12 +3534,12 @@ var __publicField = (obj, key, value) => {
3488
3534
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
3489
3535
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
3490
3536
  const projectFileReducer = projectFileSlice.reducer;
3491
- const initialState$9 = {
3537
+ const initialState$8 = {
3492
3538
  isRehydrated: false
3493
3539
  };
3494
3540
  const rehydratedSlice = toolkit.createSlice({
3495
3541
  name: "rehydrated",
3496
- initialState: initialState$9,
3542
+ initialState: initialState$8,
3497
3543
  // The `reducers` field lets us define reducers and generate associated actions
3498
3544
  reducers: {
3499
3545
  setRehydrated: (state, action) => {
@@ -3503,7 +3549,7 @@ var __publicField = (obj, key, value) => {
3503
3549
  });
3504
3550
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
3505
3551
  const rehydratedReducer = rehydratedSlice.reducer;
3506
- const initialState$8 = {
3552
+ const initialState$7 = {
3507
3553
  useIssueTemplate: false,
3508
3554
  placementMode: false,
3509
3555
  enableClustering: false,
@@ -3520,8 +3566,8 @@ var __publicField = (obj, key, value) => {
3520
3566
  };
3521
3567
  const settingSlice = toolkit.createSlice({
3522
3568
  name: "settings",
3523
- initialState: initialState$8,
3524
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3569
+ initialState: initialState$7,
3570
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3525
3571
  reducers: {
3526
3572
  setEnableDuplicateIssues: (state, action) => {
3527
3573
  state.useIssueTemplate = action.payload;
@@ -3580,14 +3626,14 @@ var __publicField = (obj, key, value) => {
3580
3626
  return revisionA < revisionB ? -1 : 1;
3581
3627
  }
3582
3628
  };
3583
- const initialState$7 = {
3629
+ const initialState$6 = {
3584
3630
  formRevisions: {},
3585
3631
  attachments: {}
3586
3632
  };
3587
3633
  const formRevisionsSlice = toolkit.createSlice({
3588
3634
  name: "formRevisions",
3589
- initialState: initialState$7,
3590
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3635
+ initialState: initialState$6,
3636
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3591
3637
  reducers: {
3592
3638
  // revision related actions
3593
3639
  setFormRevision: (state, action) => {
@@ -3767,13 +3813,13 @@ var __publicField = (obj, key, value) => {
3767
3813
  )
3768
3814
  );
3769
3815
  const formRevisionReducer = formRevisionsSlice.reducer;
3770
- const initialState$6 = {
3816
+ const initialState$5 = {
3771
3817
  forms: {}
3772
3818
  };
3773
3819
  const formSlice = toolkit.createSlice({
3774
3820
  name: "forms",
3775
- initialState: initialState$6,
3776
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3821
+ initialState: initialState$5,
3822
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3777
3823
  reducers: {
3778
3824
  setForms: (state, action) => {
3779
3825
  state.forms = {};
@@ -3878,14 +3924,14 @@ var __publicField = (obj, key, value) => {
3878
3924
  return Object.values(userForms).filter((form) => !form.component_type).length;
3879
3925
  });
3880
3926
  const formReducer = formSlice.reducer;
3881
- const initialState$5 = {
3927
+ const initialState$4 = {
3882
3928
  formSubmissions: {},
3883
3929
  attachments: {}
3884
3930
  };
3885
3931
  const formSubmissionSlice = toolkit.createSlice({
3886
3932
  name: "formSubmissions",
3887
- initialState: initialState$5,
3888
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3933
+ initialState: initialState$4,
3934
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3889
3935
  reducers: {
3890
3936
  setFormSubmission: (state, action) => {
3891
3937
  state.formSubmissions[action.payload.offline_id] = action.payload;
@@ -4122,12 +4168,12 @@ var __publicField = (obj, key, value) => {
4122
4168
  )
4123
4169
  );
4124
4170
  const formSubmissionReducer = formSubmissionSlice.reducer;
4125
- const initialState$4 = {
4171
+ const initialState$3 = {
4126
4172
  emailDomains: {}
4127
4173
  };
4128
4174
  const emailDomainsSlice = toolkit.createSlice({
4129
4175
  name: "emailDomains",
4130
- initialState: initialState$4,
4176
+ initialState: initialState$3,
4131
4177
  reducers: {
4132
4178
  setEmailDomains: (state, action) => {
4133
4179
  const emailDomains = {};
@@ -4154,15 +4200,15 @@ var __publicField = (obj, key, value) => {
4154
4200
  (ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
4155
4201
  );
4156
4202
  const emailDomainsReducer = emailDomainsSlice.reducer;
4157
- const initialState$3 = {
4203
+ const initialState$2 = {
4158
4204
  documents: {},
4159
4205
  attachments: {}
4160
4206
  };
4161
4207
  const documentSlice = toolkit.createSlice({
4162
4208
  name: "documents",
4163
- initialState: initialState$3,
4209
+ initialState: initialState$2,
4164
4210
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
4165
- Object.assign(state, initialState$3);
4211
+ Object.assign(state, initialState$2);
4166
4212
  }),
4167
4213
  reducers: {
4168
4214
  setDocuments: (state, action) => {
@@ -4303,10 +4349,13 @@ var __publicField = (obj, key, value) => {
4303
4349
  delete state.documents[documentId];
4304
4350
  }
4305
4351
  },
4352
+ // Attachments
4353
+ setDocumentAttachment: setAttachment,
4306
4354
  setDocumentAttachments: setAttachments,
4307
4355
  addDocumentAttachment: addAttachment,
4308
4356
  addDocumentAttachments: addAttachments,
4309
4357
  updateDocumentAttachment: updateAttachment,
4358
+ updateDocumentAttachments: updateAttachments,
4310
4359
  removeDocumentAttachment: removeAttachment,
4311
4360
  removeDocumentAttachments: removeAttachments
4312
4361
  }
@@ -4317,10 +4366,13 @@ var __publicField = (obj, key, value) => {
4317
4366
  updateDocuments,
4318
4367
  moveDocument,
4319
4368
  removeDocuments,
4369
+ // Attachments
4370
+ setDocumentAttachment,
4320
4371
  setDocumentAttachments,
4321
4372
  addDocumentAttachment,
4322
4373
  addDocumentAttachments,
4323
4374
  updateDocumentAttachment,
4375
+ updateDocumentAttachments,
4324
4376
  removeDocumentAttachment,
4325
4377
  removeDocumentAttachments
4326
4378
  } = documentSlice.actions;
@@ -4387,13 +4439,13 @@ var __publicField = (obj, key, value) => {
4387
4439
  )
4388
4440
  );
4389
4441
  const documentsReducer = documentSlice.reducer;
4390
- const initialState$2 = {
4442
+ const initialState$1 = {
4391
4443
  teams: {}
4392
4444
  };
4393
4445
  const teamSlice = toolkit.createSlice({
4394
4446
  name: "teams",
4395
- initialState: initialState$2,
4396
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
4447
+ initialState: initialState$1,
4448
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4397
4449
  reducers: {
4398
4450
  setTeam: (state, action) => {
4399
4451
  state.teams[action.payload.offline_id] = action.payload;
@@ -4443,49 +4495,8 @@ var __publicField = (obj, key, value) => {
4443
4495
  })
4444
4496
  );
4445
4497
  const teamReducer = teamSlice.reducer;
4446
- const initialState$1 = {
4447
- conversations: {}
4448
- };
4449
- const agentsSlice = toolkit.createSlice({
4450
- name: "agents",
4451
- initialState: initialState$1,
4452
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4453
- reducers: {
4454
- setConversations: (state, action) => {
4455
- state.conversations = {};
4456
- for (const conversation of action.payload) {
4457
- state.conversations[conversation.offline_id] = conversation;
4458
- }
4459
- },
4460
- addConversation: (state, action) => {
4461
- if (action.payload.offline_id in state.conversations) {
4462
- throw new Error("Conversation already exists in history");
4463
- }
4464
- state.conversations[action.payload.offline_id] = action.payload;
4465
- },
4466
- setConversation: (state, action) => {
4467
- if (!(action.payload.offline_id in state.conversations)) {
4468
- throw new Error("Conversation does not exist in history");
4469
- }
4470
- state.conversations[action.payload.offline_id] = action.payload;
4471
- }
4472
- }
4473
- });
4474
- const { setConversations, addConversation, setConversation } = agentsSlice.actions;
4475
- const selectConversationMapping = (state) => state.agentsReducer.conversations;
4476
- const selectConversations = toolkit.createSelector(
4477
- [selectConversationMapping],
4478
- (conversationMapping) => Object.values(conversationMapping)
4479
- );
4480
- const selectConversation = restructureCreateSelectorWithArgs(
4481
- toolkit.createSelector(
4482
- [selectConversationMapping, (_state, conversationId) => conversationId],
4483
- (conversationMapping, conversationId) => conversationMapping[conversationId]
4484
- )
4485
- );
4486
- const agentsReducer = agentsSlice.reducer;
4487
- const initialState = {
4488
- version: 0
4498
+ const initialState = {
4499
+ version: 0
4489
4500
  };
4490
4501
  const versioningSlice = toolkit.createSlice({
4491
4502
  name: "versioning",
@@ -4534,8 +4545,7 @@ var __publicField = (obj, key, value) => {
4534
4545
  emailDomainsReducer,
4535
4546
  licenseReducer,
4536
4547
  documentsReducer,
4537
- teamReducer,
4538
- agentsReducer
4548
+ teamReducer
4539
4549
  };
4540
4550
  const overmapReducer = toolkit.combineReducers(overmapReducers);
4541
4551
  const resetStore = "RESET";
@@ -5052,553 +5062,6 @@ var __publicField = (obj, key, value) => {
5052
5062
  return promise;
5053
5063
  }
5054
5064
  }
5055
- class AttachmentService extends BaseApiService {
5056
- fetchAll(projectId) {
5057
- const promise = this.enqueueRequest({
5058
- description: "Fetch attachments",
5059
- method: HttpMethod.GET,
5060
- url: `/attachments/${projectId}/`,
5061
- blocks: [],
5062
- blockers: []
5063
- });
5064
- const state = this.client.store.getState();
5065
- const allAttachments = {
5066
- issue_attachments: Object.values(state.issueReducer.attachments),
5067
- component_attachments: Object.values(state.componentReducer.attachments),
5068
- component_type_attachments: Object.values(state.componentTypeReducer.attachments),
5069
- project_attachments: Object.values(state.projectReducer.attachments),
5070
- document_attachments: Object.values(state.documentsReducer.attachments)
5071
- };
5072
- return [allAttachments, promise];
5073
- }
5074
- // Attachments aren't models, so we use the OptimisticGenericResult type instead
5075
- async addIssueAttachment(attachmentPayload) {
5076
- const { issue, file_sha1, offline_id } = attachmentPayload;
5077
- if (!attachmentPayload.file.objectURL) {
5078
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5079
- }
5080
- const offlineAttachment = {
5081
- ...attachmentPayload,
5082
- file: attachmentPayload.file.objectURL,
5083
- file_name: attachmentPayload.file.name,
5084
- file_type: attachmentPayload.file.type,
5085
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5086
- created_by: this.client.store.getState().userReducer.currentUser.id
5087
- };
5088
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5089
- this.client.store.dispatch(addIssueAttachment(offlineAttachment));
5090
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5091
- const promise = this.enqueueRequest({
5092
- description: "Create attachment",
5093
- method: HttpMethod.POST,
5094
- url: `/issues/${issue}/attach/`,
5095
- blocks: [offline_id, issue],
5096
- blockers: [file_sha1],
5097
- payload: {
5098
- ...offlineAttachment,
5099
- ...fileProps
5100
- }
5101
- });
5102
- promise.catch((error2) => {
5103
- this.client.store.dispatch(removeIssueAttachment(offlineAttachment.offline_id));
5104
- throw error2;
5105
- });
5106
- return [offlineAttachment, promise];
5107
- }
5108
- async addComponentAttachment(attachmentPayload) {
5109
- const { component, file_sha1, offline_id } = attachmentPayload;
5110
- if (!attachmentPayload.file.objectURL) {
5111
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5112
- }
5113
- const offlineAttachment = {
5114
- ...attachmentPayload,
5115
- file: attachmentPayload.file.objectURL,
5116
- file_name: attachmentPayload.file.name,
5117
- file_type: attachmentPayload.file.type,
5118
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5119
- created_by: this.client.store.getState().userReducer.currentUser.id
5120
- };
5121
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5122
- this.client.store.dispatch(addComponentAttachment(offlineAttachment));
5123
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5124
- const promise = this.enqueueRequest({
5125
- description: "Create attachment",
5126
- method: HttpMethod.POST,
5127
- url: `/components/${component}/attach/`,
5128
- blocks: [offline_id, component],
5129
- blockers: [file_sha1],
5130
- payload: {
5131
- ...offlineAttachment,
5132
- ...fileProps
5133
- }
5134
- });
5135
- promise.catch((error2) => {
5136
- this.client.store.dispatch(removeComponentAttachment(offlineAttachment.offline_id));
5137
- throw error2;
5138
- });
5139
- return [offlineAttachment, promise];
5140
- }
5141
- async addComponentTypeAttachment(attachmentPayload) {
5142
- const { component_type, file_sha1, offline_id } = attachmentPayload;
5143
- if (!attachmentPayload.file.objectURL) {
5144
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5145
- }
5146
- const offlineAttachment = {
5147
- ...attachmentPayload,
5148
- file: attachmentPayload.file.objectURL,
5149
- file_name: attachmentPayload.file.name,
5150
- file_type: attachmentPayload.file.type,
5151
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5152
- created_by: this.client.store.getState().userReducer.currentUser.id
5153
- };
5154
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5155
- this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
5156
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5157
- const promise = this.enqueueRequest({
5158
- description: "Create attachment",
5159
- method: HttpMethod.POST,
5160
- url: `/components/types/${component_type}/attach/`,
5161
- blocks: [offline_id, component_type],
5162
- blockers: [file_sha1],
5163
- payload: {
5164
- ...offlineAttachment,
5165
- ...fileProps
5166
- }
5167
- });
5168
- promise.catch((error2) => {
5169
- this.client.store.dispatch(removeComponentTypeAttachment(offlineAttachment.offline_id));
5170
- throw error2;
5171
- });
5172
- return [offlineAttachment, promise];
5173
- }
5174
- async addDocumentAttachment(attachmentPayload) {
5175
- const { description: description2, document: document2, file_sha1, offline_id } = attachmentPayload;
5176
- if (!attachmentPayload.file.objectURL) {
5177
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5178
- }
5179
- const offlineAttachment = {
5180
- ...attachmentPayload,
5181
- file: attachmentPayload.file.objectURL,
5182
- file_name: attachmentPayload.file.name,
5183
- file_type: attachmentPayload.file.type,
5184
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5185
- created_by: this.client.store.getState().userReducer.currentUser.id
5186
- };
5187
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5188
- this.client.store.dispatch(addDocumentAttachment(offlineAttachment));
5189
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5190
- const promise = this.enqueueRequest({
5191
- description: "Create attachment",
5192
- method: HttpMethod.POST,
5193
- url: `/documents/${document2}/attach/`,
5194
- blocks: [offline_id, document2],
5195
- blockers: [file_sha1],
5196
- payload: {
5197
- offline_id,
5198
- document: document2,
5199
- description: description2 ?? "",
5200
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5201
- ...fileProps
5202
- }
5203
- });
5204
- promise.catch((error2) => {
5205
- this.client.store.dispatch(removeDocumentAttachment(offlineAttachment.offline_id));
5206
- throw error2;
5207
- });
5208
- return [offlineAttachment, promise];
5209
- }
5210
- /** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
5211
- * attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
5212
- * OptimisticModelResult. */
5213
- attachFilesToIssue(filesToSubmit, issueId) {
5214
- return filesToSubmit.map((file) => {
5215
- if (!(file instanceof File)) {
5216
- throw new Error("Expected a File instance.");
5217
- }
5218
- const photoAttachmentPromise = async (file2) => {
5219
- const hash = await hashFile(file2);
5220
- const attachment = offline({
5221
- file: file2,
5222
- file_name: file2.name,
5223
- file_type: file2.type,
5224
- issue: issueId,
5225
- file_sha1: hash,
5226
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5227
- created_by: this.client.store.getState().userReducer.currentUser.id
5228
- });
5229
- return this.addIssueAttachment(attachment);
5230
- };
5231
- return photoAttachmentPromise(file);
5232
- });
5233
- }
5234
- attachFilesToComponent(filesToSubmit, componentId) {
5235
- return filesToSubmit.map((file) => {
5236
- if (!(file instanceof File)) {
5237
- throw new Error("Expected a File instance.");
5238
- }
5239
- const photoAttachmentPromise = async (file2) => {
5240
- const hash = await hashFile(file2);
5241
- const attachment = offline({
5242
- file: file2,
5243
- file_name: file2.name,
5244
- file_type: file2.type,
5245
- component: componentId,
5246
- file_sha1: hash,
5247
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5248
- created_by: this.client.store.getState().userReducer.currentUser.id
5249
- });
5250
- return this.addComponentAttachment(attachment);
5251
- };
5252
- return photoAttachmentPromise(file);
5253
- });
5254
- }
5255
- attachFilesToComponentType(filesToSubmit, componentTypeId) {
5256
- return filesToSubmit.map((file) => {
5257
- if (!(file instanceof File)) {
5258
- throw new Error("Expected a File instance.");
5259
- }
5260
- const photoAttachmentPromise = async (file2) => {
5261
- const hash = await hashFile(file2);
5262
- const attachment = offline({
5263
- file: file2,
5264
- file_name: file2.name,
5265
- file_type: file2.type,
5266
- component_type: componentTypeId,
5267
- file_sha1: hash,
5268
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5269
- created_by: this.client.store.getState().userReducer.currentUser.id
5270
- });
5271
- return this.addComponentTypeAttachment(attachment);
5272
- };
5273
- return photoAttachmentPromise(file);
5274
- });
5275
- }
5276
- attachFilesToDocument(filesToSubmit, documentId) {
5277
- return filesToSubmit.map((file) => {
5278
- if (!(file instanceof File)) {
5279
- throw new Error("Expected a File instance.");
5280
- }
5281
- const photoAttachmentPromise = async (file2) => {
5282
- const hash = await hashFile(file2);
5283
- const attachment = offline({
5284
- file: file2,
5285
- file_name: file2.name,
5286
- file_type: file2.type,
5287
- document: documentId,
5288
- file_sha1: hash,
5289
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5290
- created_by: this.client.store.getState().userReducer.currentUser.id
5291
- });
5292
- return this.addDocumentAttachment(attachment);
5293
- };
5294
- return photoAttachmentPromise(file);
5295
- });
5296
- }
5297
- async replaceIssueAttachmentFile(attachmentId, newFile) {
5298
- const { store } = this.client;
5299
- const attachment = store.getState().issueReducer.attachments[attachmentId];
5300
- if (!attachment)
5301
- throw new Error(`Attachment ${attachmentId} not found`);
5302
- let oldFile = void 0;
5303
- const newSha1 = await hashFile(newFile);
5304
- const performRequest2 = async () => {
5305
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5306
- if (!oldFile) {
5307
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5308
- }
5309
- if (!newFile.objectURL) {
5310
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5311
- }
5312
- store.dispatch(
5313
- updateIssueAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
5314
- );
5315
- await this.client.files.addCache(newFile, newSha1);
5316
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5317
- store.dispatch(updateIssueAttachment(attachment));
5318
- throw e;
5319
- });
5320
- const promise2 = this.enqueueRequest({
5321
- description: "Edit attachment",
5322
- method: HttpMethod.PATCH,
5323
- url: `/attachments/issues/${attachment.offline_id}/`,
5324
- isResponseBlob: false,
5325
- payload: fileProps,
5326
- blockers: [attachmentId, newSha1],
5327
- blocks: [attachmentId, newSha1]
5328
- });
5329
- try {
5330
- const result = await promise2;
5331
- void this.client.files.removeCache(attachment.file_sha1);
5332
- return result;
5333
- } catch (e) {
5334
- if (oldFile) {
5335
- store.dispatch(
5336
- updateIssueAttachment({
5337
- ...attachment,
5338
- file_sha1: attachment.file_sha1,
5339
- file: URL.createObjectURL(oldFile)
5340
- })
5341
- );
5342
- }
5343
- throw e;
5344
- }
5345
- };
5346
- const offlineAttachment = {
5347
- ...attachment,
5348
- file_sha1: newSha1,
5349
- file: URL.createObjectURL(newFile)
5350
- };
5351
- const promise = performRequest2();
5352
- return [offlineAttachment, promise];
5353
- }
5354
- async replaceComponentAttachmentFile(attachmentId, newFile) {
5355
- const { store } = this.client;
5356
- const attachment = store.getState().componentReducer.attachments[attachmentId];
5357
- if (!attachment)
5358
- throw new Error(`Attachment ${attachmentId} not found`);
5359
- let oldFile = void 0;
5360
- const newSha1 = await hashFile(newFile);
5361
- const performRequest2 = async () => {
5362
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5363
- if (!oldFile) {
5364
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5365
- }
5366
- if (!newFile.objectURL) {
5367
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5368
- }
5369
- store.dispatch(
5370
- updateComponentAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
5371
- );
5372
- await this.client.files.addCache(newFile, newSha1);
5373
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5374
- store.dispatch(updateComponentAttachment(attachment));
5375
- throw e;
5376
- });
5377
- const promise2 = this.enqueueRequest({
5378
- description: "Edit attachment",
5379
- method: HttpMethod.PATCH,
5380
- url: `/attachments/components/${attachment.offline_id}/`,
5381
- isResponseBlob: false,
5382
- payload: fileProps,
5383
- blockers: [attachmentId, newSha1],
5384
- blocks: [attachmentId, newSha1]
5385
- });
5386
- try {
5387
- const result = await promise2;
5388
- void this.client.files.removeCache(attachment.file_sha1);
5389
- return result;
5390
- } catch (e) {
5391
- if (oldFile) {
5392
- store.dispatch(
5393
- updateComponentAttachment({
5394
- ...attachment,
5395
- file_sha1: attachment.file_sha1,
5396
- file: URL.createObjectURL(oldFile)
5397
- })
5398
- );
5399
- }
5400
- throw e;
5401
- }
5402
- };
5403
- const offlineAttachment = {
5404
- ...attachment,
5405
- file_sha1: newSha1,
5406
- file: URL.createObjectURL(newFile)
5407
- };
5408
- const promise = performRequest2();
5409
- return [offlineAttachment, promise];
5410
- }
5411
- async replaceComponentTypeAttachmentFile(attachmentId, newFile) {
5412
- const { store } = this.client;
5413
- const attachment = store.getState().componentTypeReducer.attachments[attachmentId];
5414
- if (!attachment)
5415
- throw new Error(`Attachment ${attachmentId} not found`);
5416
- let oldFile = void 0;
5417
- const newSha1 = await hashFile(newFile);
5418
- const performRequest2 = async () => {
5419
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5420
- if (!oldFile) {
5421
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5422
- }
5423
- if (!newFile.objectURL) {
5424
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5425
- }
5426
- store.dispatch(
5427
- updateComponentTypeAttachment({
5428
- ...attachment,
5429
- file_sha1: newSha1,
5430
- file: URL.createObjectURL(newFile)
5431
- })
5432
- );
5433
- await this.client.files.addCache(newFile, newSha1);
5434
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5435
- store.dispatch(updateComponentTypeAttachment(attachment));
5436
- throw e;
5437
- });
5438
- const promise2 = this.enqueueRequest({
5439
- description: "Edit attachment",
5440
- method: HttpMethod.PATCH,
5441
- url: `/attachments/component_types/${attachment.offline_id}/`,
5442
- isResponseBlob: false,
5443
- payload: fileProps,
5444
- blockers: [attachmentId, newSha1],
5445
- blocks: [attachmentId, newSha1]
5446
- });
5447
- try {
5448
- const result = await promise2;
5449
- void this.client.files.removeCache(attachment.file_sha1);
5450
- return result;
5451
- } catch (e) {
5452
- if (oldFile) {
5453
- store.dispatch(
5454
- updateComponentTypeAttachment({
5455
- ...attachment,
5456
- file_sha1: attachment.file_sha1,
5457
- file: URL.createObjectURL(oldFile)
5458
- })
5459
- );
5460
- }
5461
- throw e;
5462
- }
5463
- };
5464
- const offlineAttachment = {
5465
- ...attachment,
5466
- file_sha1: newSha1,
5467
- file: URL.createObjectURL(newFile)
5468
- };
5469
- const promise = performRequest2();
5470
- return [offlineAttachment, promise];
5471
- }
5472
- async replaceDocumentAttachmentFile(attachmentId, newFile) {
5473
- const { store } = this.client;
5474
- const attachment = store.getState().documentsReducer.attachments[attachmentId];
5475
- if (!attachment)
5476
- throw new Error(`Attachment ${attachmentId} not found`);
5477
- let oldFile = void 0;
5478
- const newSha1 = await hashFile(newFile);
5479
- const performRequest2 = async () => {
5480
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5481
- if (!oldFile) {
5482
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5483
- }
5484
- if (!newFile.objectURL) {
5485
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5486
- }
5487
- store.dispatch(
5488
- updateDocumentAttachment({
5489
- ...attachment,
5490
- file_sha1: newSha1,
5491
- file: URL.createObjectURL(newFile)
5492
- })
5493
- );
5494
- await this.client.files.addCache(newFile, newSha1);
5495
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5496
- store.dispatch(updateDocumentAttachment(attachment));
5497
- throw e;
5498
- });
5499
- const promise2 = this.enqueueRequest({
5500
- description: "Edit attachment",
5501
- method: HttpMethod.PATCH,
5502
- url: `/attachments/documents/${attachment.offline_id}/`,
5503
- isResponseBlob: false,
5504
- payload: fileProps,
5505
- blockers: [attachmentId, newSha1],
5506
- blocks: [attachmentId, newSha1]
5507
- });
5508
- try {
5509
- const result = await promise2;
5510
- void this.client.files.removeCache(attachment.file_sha1);
5511
- return result;
5512
- } catch (e) {
5513
- if (oldFile) {
5514
- store.dispatch(
5515
- updateDocumentAttachment({
5516
- ...attachment,
5517
- file_sha1: attachment.file_sha1,
5518
- file: URL.createObjectURL(oldFile)
5519
- })
5520
- );
5521
- }
5522
- throw e;
5523
- }
5524
- };
5525
- const offlineAttachment = {
5526
- ...attachment,
5527
- file_sha1: newSha1,
5528
- file: URL.createObjectURL(newFile)
5529
- };
5530
- const promise = performRequest2();
5531
- return [offlineAttachment, promise];
5532
- }
5533
- /**
5534
- * Deletes an attachment and associated data in the cloud, in the Redux store and the cache.
5535
- * @param issueAttachmentId
5536
- */
5537
- deleteIssueAttachment(issueAttachmentId) {
5538
- const { store } = this.client;
5539
- const attachment = selectIssueAttachmentMapping(store.getState())[issueAttachmentId];
5540
- if (!attachment) {
5541
- throw new Error(`Attachment ${issueAttachmentId} not found`);
5542
- }
5543
- store.dispatch(removeIssueAttachment(issueAttachmentId));
5544
- void this.client.files.removeCache(attachment.file_sha1);
5545
- return this.enqueueRequest({
5546
- description: "Delete attachment",
5547
- method: HttpMethod.DELETE,
5548
- url: `/attachments/issues/${issueAttachmentId}/`,
5549
- blockers: [issueAttachmentId],
5550
- blocks: [issueAttachmentId]
5551
- });
5552
- }
5553
- deleteComponentAttachment(componentAttachmentId) {
5554
- const { store } = this.client;
5555
- const attachment = selectComponentAttachmentMapping(store.getState())[componentAttachmentId];
5556
- if (!attachment) {
5557
- throw new Error(`Attachment ${componentAttachmentId} not found`);
5558
- }
5559
- store.dispatch(removeComponentAttachment(componentAttachmentId));
5560
- void this.client.files.removeCache(attachment.file_sha1);
5561
- return this.enqueueRequest({
5562
- description: "Delete attachment",
5563
- method: HttpMethod.DELETE,
5564
- url: `/attachments/components/${componentAttachmentId}/`,
5565
- blockers: [componentAttachmentId],
5566
- blocks: [componentAttachmentId]
5567
- });
5568
- }
5569
- deleteComponentTypeAttachment(componentTypeAttachmentId) {
5570
- const { store } = this.client;
5571
- const attachment = selectComponentTypeAttachmentMapping(store.getState())[componentTypeAttachmentId];
5572
- if (!attachment) {
5573
- throw new Error(`Attachment ${componentTypeAttachmentId} not found`);
5574
- }
5575
- store.dispatch(removeComponentTypeAttachment(componentTypeAttachmentId));
5576
- void this.client.files.removeCache(attachment.file_sha1);
5577
- return this.enqueueRequest({
5578
- description: "Delete attachment",
5579
- method: HttpMethod.DELETE,
5580
- url: `/attachments/component_types/${componentTypeAttachmentId}/`,
5581
- blockers: [componentTypeAttachmentId],
5582
- blocks: [componentTypeAttachmentId]
5583
- });
5584
- }
5585
- deleteDocumentAttachment(documentAttachmentId) {
5586
- const { store } = this.client;
5587
- const attachment = store.getState().documentsReducer.attachments[documentAttachmentId];
5588
- if (!attachment) {
5589
- throw new Error(`Attachment ${documentAttachmentId} not found`);
5590
- }
5591
- store.dispatch(removeDocumentAttachment(documentAttachmentId));
5592
- void this.client.files.removeCache(attachment.file_sha1);
5593
- return this.enqueueRequest({
5594
- description: "Delete document attachment",
5595
- method: HttpMethod.DELETE,
5596
- url: `/attachments/documents/${documentAttachmentId}/`,
5597
- blockers: [documentAttachmentId],
5598
- blocks: [documentAttachmentId]
5599
- });
5600
- }
5601
- }
5602
5065
  const EXPIRING_SOON_THRESHOLD = 1800;
5603
5066
  function parseTokens(response) {
5604
5067
  if (!response.access)
@@ -6290,6 +5753,221 @@ var __publicField = (obj, key, value) => {
6290
5753
  store.dispatch(addStages(result));
6291
5754
  }
6292
5755
  }
5756
+ const AttachmentModelMeta = {
5757
+ [AttachmentModel.Issue]: {
5758
+ name: "issue",
5759
+ attachUrlPrefix: "/issues",
5760
+ deleteUrlPrefix: "/issues",
5761
+ fetchUrlPostfix: "/issue-attachments"
5762
+ },
5763
+ [AttachmentModel.Component]: {
5764
+ name: "component",
5765
+ attachUrlPrefix: "/components",
5766
+ deleteUrlPrefix: "/components",
5767
+ fetchUrlPostfix: "/component-attachments"
5768
+ },
5769
+ [AttachmentModel.ComponentType]: {
5770
+ name: "component type",
5771
+ attachUrlPrefix: "/components/types",
5772
+ deleteUrlPrefix: "/components/types",
5773
+ fetchUrlPostfix: "/component-type-attachments"
5774
+ },
5775
+ [AttachmentModel.Project]: {
5776
+ name: "component project",
5777
+ attachUrlPrefix: "/projects",
5778
+ deleteUrlPrefix: "/projects",
5779
+ fetchUrlPostfix: "/attachments"
5780
+ },
5781
+ [AttachmentModel.Document]: {
5782
+ name: "document",
5783
+ attachUrlPrefix: "/documents",
5784
+ deleteUrlPrefix: "/documents",
5785
+ fetchUrlPostfix: "/document-attachments"
5786
+ }
5787
+ };
5788
+ class BaseAttachmentService extends BaseApiService {
5789
+ getNumberOfAttachmentsWithSha1(sha1) {
5790
+ const {
5791
+ issueReducer: issueReducer2,
5792
+ componentReducer: componentReducer2,
5793
+ componentTypeReducer: componentTypeReducer2,
5794
+ documentsReducer: documentsReducer2,
5795
+ projectReducer: projectReducer2,
5796
+ formSubmissionReducer: formSubmissionReducer2,
5797
+ formRevisionReducer: formRevisionReducer2
5798
+ } = this.client.store.getState();
5799
+ const objectsWithSha1 = [].concat(
5800
+ Object.values(issueReducer2.attachments),
5801
+ Object.values(componentReducer2.attachments),
5802
+ Object.values(componentTypeReducer2.attachments),
5803
+ Object.values(documentsReducer2.attachments),
5804
+ Object.values(projectReducer2.attachments),
5805
+ Object.values(formRevisionReducer2.attachments),
5806
+ Object.values(formSubmissionReducer2.attachments)
5807
+ );
5808
+ return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
5809
+ }
5810
+ processPresignedUrls(presignedUrls) {
5811
+ for (const [sha1, presignedUrl] of Object.entries(presignedUrls)) {
5812
+ void this.enqueueRequest({
5813
+ url: presignedUrl.url,
5814
+ description: "Upload file to S3",
5815
+ method: HttpMethod.POST,
5816
+ isExternalUrl: true,
5817
+ isAuthNeeded: false,
5818
+ attachmentHash: sha1,
5819
+ // TODO: can we use the sha1 as the blocker?
5820
+ blockers: [`s3-${presignedUrl.fields.key}`],
5821
+ blocks: [sha1],
5822
+ s3url: presignedUrl
5823
+ });
5824
+ }
5825
+ }
5826
+ // Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
5827
+ // so for some attachment model services, this method will have to be overridden.
5828
+ async getAttachments(actions) {
5829
+ const { store } = this.client;
5830
+ const activeProjectId = store.getState().projectReducer.activeProjectId;
5831
+ const meta = AttachmentModelMeta[this.attachmentModel];
5832
+ const result = await this.enqueueRequest({
5833
+ description: `Get ${meta.name} attachments`,
5834
+ method: HttpMethod.GET,
5835
+ url: `/projects/${activeProjectId}${meta.fetchUrlPostfix}/`,
5836
+ blocks: [],
5837
+ blockers: []
5838
+ });
5839
+ store.dispatch(actions.setAttachments(result));
5840
+ }
5841
+ async attachFiles(files, modelId, buildOfflineAttachment, actions) {
5842
+ const { store } = this.client;
5843
+ const currentUser = store.getState().userReducer.currentUser;
5844
+ const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
5845
+ const offlineAttachments = [];
5846
+ const attachmentPayloads = [];
5847
+ const filePayloads = {};
5848
+ for (const file of files) {
5849
+ const sha1 = await hashFile(file);
5850
+ if (!(sha1 in filePayloads)) {
5851
+ filePayloads[sha1] = {
5852
+ sha1,
5853
+ file_type: file.type,
5854
+ extension: file.name.split(".").pop(),
5855
+ size: file.size
5856
+ };
5857
+ await this.client.files.addCache(file, sha1);
5858
+ }
5859
+ const offlineAttachment = buildOfflineAttachment({
5860
+ file,
5861
+ sha1,
5862
+ submittedAt,
5863
+ createdBy: currentUser.id,
5864
+ description: "",
5865
+ modelId
5866
+ });
5867
+ offlineAttachments.push(offlineAttachment);
5868
+ attachmentPayloads.push({
5869
+ offline_id: offlineAttachment.offline_id,
5870
+ name: offlineAttachment.file_name,
5871
+ sha1: offlineAttachment.file_sha1,
5872
+ description: offlineAttachment.description
5873
+ });
5874
+ }
5875
+ store.dispatch(actions.addAttachments(offlineAttachments));
5876
+ const meta = AttachmentModelMeta[this.attachmentModel];
5877
+ const promise = this.enqueueRequest({
5878
+ description: `Attach files to ${meta.name}`,
5879
+ method: HttpMethod.POST,
5880
+ url: `${meta.attachUrlPrefix}/${modelId}/attach/`,
5881
+ payload: {
5882
+ submitted_at: submittedAt,
5883
+ attachments: attachmentPayloads,
5884
+ files: Object.values(filePayloads)
5885
+ },
5886
+ blocks: offlineAttachments.map((attachment) => attachment.offline_id),
5887
+ blockers: offlineAttachments.map((attachment) => attachment.file_sha1)
5888
+ });
5889
+ promise.then(({ attachments, presigned_urls }) => {
5890
+ store.dispatch(actions.updateAttachments(attachments));
5891
+ this.processPresignedUrls(presigned_urls);
5892
+ }).catch(() => {
5893
+ store.dispatch(actions.removeAttachments(offlineAttachments.map((attachment) => attachment.offline_id)));
5894
+ });
5895
+ return [offlineAttachments, promise.then(({ attachments }) => attachments)];
5896
+ }
5897
+ async deleteAttachment(attachmendId, actions, selectors) {
5898
+ const { store } = this.client;
5899
+ const attachment = selectors.selectAttachment(attachmendId)(store.getState());
5900
+ if (!attachment) {
5901
+ throw new Error(
5902
+ `Attempting to delete attachment with offline_id ${attachmendId} that does not exist in the store`
5903
+ );
5904
+ }
5905
+ store.dispatch(actions.removeAttachment(attachment.offline_id));
5906
+ const meta = AttachmentModelMeta[this.attachmentModel];
5907
+ const promise = this.enqueueRequest({
5908
+ description: "Delete attachment",
5909
+ method: HttpMethod.DELETE,
5910
+ url: `${meta.deleteUrlPrefix}/attachments/${attachmendId}/`,
5911
+ blockers: [attachmendId],
5912
+ blocks: []
5913
+ });
5914
+ promise.then(() => {
5915
+ if (this.getNumberOfAttachmentsWithSha1(attachment.file_sha1) === 0) {
5916
+ void this.client.files.removeCache(attachment.file_sha1);
5917
+ }
5918
+ }).catch(() => {
5919
+ store.dispatch(actions.setAttachment(attachment));
5920
+ });
5921
+ return promise;
5922
+ }
5923
+ }
5924
+ class ComponentAttachmentService extends BaseAttachmentService {
5925
+ constructor() {
5926
+ super(...arguments);
5927
+ __publicField(this, "attachmentModel", AttachmentModel.Component);
5928
+ }
5929
+ buildOfflineAttachment(data) {
5930
+ return offline({
5931
+ file: URL.createObjectURL(data.file),
5932
+ file_sha1: data.sha1,
5933
+ created_by: data.createdBy,
5934
+ file_name: data.file.name,
5935
+ file_type: data.file.type,
5936
+ submitted_at: data.submittedAt,
5937
+ description: data.description,
5938
+ component: data.modelId
5939
+ });
5940
+ }
5941
+ async attachFilesToComponent(files, componentId) {
5942
+ return this.attachFiles(
5943
+ files,
5944
+ componentId,
5945
+ this.buildOfflineAttachment.bind(this),
5946
+ {
5947
+ addAttachments: addComponentAttachments,
5948
+ updateAttachments: updateComponentAttachments,
5949
+ removeAttachments: removeComponentAttachments
5950
+ }
5951
+ );
5952
+ }
5953
+ deleteComponentAttachment(attachmentId) {
5954
+ return this.deleteAttachment(
5955
+ attachmentId,
5956
+ {
5957
+ setAttachment: setComponentAttachment,
5958
+ removeAttachment: removeComponentAttachment
5959
+ },
5960
+ {
5961
+ selectAttachment: selectComponentAttachment
5962
+ }
5963
+ );
5964
+ }
5965
+ async refreshStore() {
5966
+ return this.getAttachments({
5967
+ setAttachments: setComponentAttachments
5968
+ });
5969
+ }
5970
+ }
6293
5971
  class ComponentTypeService extends BaseApiService {
6294
5972
  add(componentType) {
6295
5973
  const offlineComponentType = offline(componentType);
@@ -6362,9 +6040,56 @@ var __publicField = (obj, key, value) => {
6362
6040
  store.dispatch(setComponentTypes(result));
6363
6041
  }
6364
6042
  }
6365
- class IssueCommentService extends BaseApiService {
6366
- // Omit author and submitted_at since these will always be set internally
6367
- add(comment) {
6043
+ class ComponentTypeAttachmentService extends BaseAttachmentService {
6044
+ constructor() {
6045
+ super(...arguments);
6046
+ __publicField(this, "attachmentModel", AttachmentModel.ComponentType);
6047
+ }
6048
+ buildOfflineAttachment(data) {
6049
+ return offline({
6050
+ file: URL.createObjectURL(data.file),
6051
+ file_sha1: data.sha1,
6052
+ created_by: data.createdBy,
6053
+ file_name: data.file.name,
6054
+ file_type: data.file.type,
6055
+ submitted_at: data.submittedAt,
6056
+ description: data.description,
6057
+ component_type: data.modelId
6058
+ });
6059
+ }
6060
+ async attachFilesToComponentType(files, componentTypeId) {
6061
+ return this.attachFiles(
6062
+ files,
6063
+ componentTypeId,
6064
+ this.buildOfflineAttachment.bind(this),
6065
+ {
6066
+ addAttachments: addComponentTypeAttachments,
6067
+ updateAttachments: updateComponentTypeAttachments,
6068
+ removeAttachments: removeComponentTypeAttachments
6069
+ }
6070
+ );
6071
+ }
6072
+ deleteComponentTypeAttachment(attachmentId) {
6073
+ return this.deleteAttachment(
6074
+ attachmentId,
6075
+ {
6076
+ setAttachment: setComponentTypeAttachment,
6077
+ removeAttachment: removeComponentTypeAttachment
6078
+ },
6079
+ {
6080
+ selectAttachment: selectComponentTypeAttachment
6081
+ }
6082
+ );
6083
+ }
6084
+ async refreshStore() {
6085
+ return this.getAttachments({
6086
+ setAttachments: setComponentTypeAttachments
6087
+ });
6088
+ }
6089
+ }
6090
+ class IssueCommentService extends BaseApiService {
6091
+ // Omit author and submitted_at since these will always be set internally
6092
+ add(comment) {
6368
6093
  const { store } = this.client;
6369
6094
  const offlineComment = offline({
6370
6095
  ...comment,
@@ -6458,11 +6183,53 @@ var __publicField = (obj, key, value) => {
6458
6183
  store.dispatch(setIssueUpdates(filteredResult));
6459
6184
  }
6460
6185
  }
6186
+ class IssueAttachmentService extends BaseAttachmentService {
6187
+ constructor() {
6188
+ super(...arguments);
6189
+ __publicField(this, "attachmentModel", AttachmentModel.Issue);
6190
+ }
6191
+ buildOfflineAttachment(data) {
6192
+ return offline({
6193
+ file: URL.createObjectURL(data.file),
6194
+ file_sha1: data.sha1,
6195
+ created_by: data.createdBy,
6196
+ file_name: data.file.name,
6197
+ file_type: data.file.type,
6198
+ submitted_at: data.submittedAt,
6199
+ description: data.description,
6200
+ issue: data.modelId
6201
+ });
6202
+ }
6203
+ async attachFilesToIssue(files, issueId) {
6204
+ return this.attachFiles(files, issueId, this.buildOfflineAttachment.bind(this), {
6205
+ addAttachments: addIssueAttachments,
6206
+ updateAttachments: updateIssueAttachments,
6207
+ removeAttachments: removeIssueAttachments
6208
+ });
6209
+ }
6210
+ deleteIssueAttachment(attachmentId) {
6211
+ return this.deleteAttachment(
6212
+ attachmentId,
6213
+ {
6214
+ setAttachment: setIssueAttachment,
6215
+ removeAttachment: removeIssueAttachment
6216
+ },
6217
+ {
6218
+ selectAttachment: selectIssueAttachment
6219
+ }
6220
+ );
6221
+ }
6222
+ async refreshStore() {
6223
+ return this.getAttachments({
6224
+ setAttachments: setIssueAttachments
6225
+ });
6226
+ }
6227
+ }
6461
6228
  class IssueService extends BaseApiService {
6462
6229
  // Basic CRUD functions
6463
6230
  // TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
6464
6231
  // have to repeat it for all optimistic model results (all optimistic results are created).
6465
- add(issue, issue_type = null) {
6232
+ add(issue, issueType = null) {
6466
6233
  const { store } = this.client;
6467
6234
  const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
6468
6235
  const state = store.getState();
@@ -6489,7 +6256,7 @@ var __publicField = (obj, key, value) => {
6489
6256
  url: "/issues/",
6490
6257
  queryParams: {
6491
6258
  workspace_id: workspaceId,
6492
- ...issue_type ? { issue_type } : {}
6259
+ ...issueType ? { issue_type: issueType } : {}
6493
6260
  },
6494
6261
  payload: issuePayload,
6495
6262
  blockers: [
@@ -6626,7 +6393,7 @@ var __publicField = (obj, key, value) => {
6626
6393
  this.client.store.dispatch(updateIssue(issueToBeUpdated));
6627
6394
  this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
6628
6395
  });
6629
- const fullIssue = this.client.store.getState().issueReducer.issues[issue.offline_id];
6396
+ const fullIssue = state.issueReducer.issues[issue.offline_id];
6630
6397
  return [fullIssue, promise];
6631
6398
  }
6632
6399
  async remove(id) {
@@ -6677,14 +6444,15 @@ var __publicField = (obj, key, value) => {
6677
6444
  class IssueTypeService extends BaseApiService {
6678
6445
  add(payload) {
6679
6446
  const { store } = this.client;
6680
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
6447
+ const state = store.getState();
6448
+ const activeOrganizationId = state.organizationReducer.activeOrganizationId;
6681
6449
  if (!activeOrganizationId) {
6682
6450
  throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
6683
6451
  }
6684
6452
  const offlineIssueType = offline({
6685
6453
  ...payload,
6686
6454
  submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
6687
- created_by: store.getState().userReducer.currentUser.id,
6455
+ created_by: state.userReducer.currentUser.id,
6688
6456
  organization: activeOrganizationId
6689
6457
  });
6690
6458
  store.dispatch(addIssueType(offlineIssueType));
@@ -6737,11 +6505,12 @@ var __publicField = (obj, key, value) => {
6737
6505
  }
6738
6506
  delete(issueTypeId) {
6739
6507
  const { store } = this.client;
6740
- const issueTypeToDelete = store.getState().issueTypeReducer.issueTypes[issueTypeId];
6508
+ const state = store.getState();
6509
+ const issueTypeToDelete = state.issueTypeReducer.issueTypes[issueTypeId];
6741
6510
  if (!issueTypeToDelete) {
6742
6511
  throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
6743
6512
  }
6744
- const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(store.getState()) ?? [];
6513
+ const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state) ?? [];
6745
6514
  store.dispatch(removeIssueType(issueTypeId));
6746
6515
  store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
6747
6516
  const promise = this.enqueueRequest({
@@ -6902,6 +6671,7 @@ var __publicField = (obj, key, value) => {
6902
6671
  const usersResult = await usersResultPromise;
6903
6672
  await projectAccessRefreshPromise;
6904
6673
  store.dispatch(addUsers(usersResult));
6674
+ void this.client.projectAttachments.refreshStore();
6905
6675
  }
6906
6676
  let currentWorkspaceId;
6907
6677
  const oldWorkspaceId = this.client.store.getState().workspaceReducer.activeWorkspaceId;
@@ -6914,35 +6684,29 @@ var __publicField = (obj, key, value) => {
6914
6684
  store.dispatch(setActiveWorkspaceId(currentWorkspaceId));
6915
6685
  void this.client.categories.refreshStore().then(() => {
6916
6686
  void this.client.issues.refreshStore().then(() => {
6687
+ void this.client.issueAttachments.refreshStore().then();
6917
6688
  void this.client.issueComments.refreshStore().then();
6689
+ void this.client.issueUpdates.refreshStore().then();
6918
6690
  });
6919
6691
  });
6920
6692
  void this.client.projectFiles.refreshStore().then();
6921
6693
  void this.client.componentTypes.refreshStore().then(() => {
6922
- void this.client.componentStages.refreshStore().then(() => {
6923
- void this.client.components.refreshStore(overwrite).then();
6694
+ void this.client.componentTypeAttachments.refreshStore().then(() => {
6695
+ void this.client.componentStages.refreshStore().then(() => {
6696
+ void this.client.components.refreshStore(overwrite).then(() => {
6697
+ void this.client.componentAttachments.refreshStore().then();
6698
+ });
6699
+ });
6700
+ void this.client.componentStageCompletions.refreshStore().then();
6924
6701
  });
6925
- void this.client.componentStageCompletions.refreshStore().then();
6926
6702
  });
6927
6703
  void this.client.userForms.refreshStore().then(() => {
6928
6704
  void this.client.userFormSubmissions.refreshStore().then();
6929
6705
  });
6930
6706
  }
6931
6707
  if (currentProjectId) {
6932
- const [_offlineAttachments, promise] = this.client.attachments.fetchAll(currentProjectId);
6933
- void promise.then((result) => {
6934
- const {
6935
- issue_attachments,
6936
- component_type_attachments,
6937
- component_attachments,
6938
- project_attachments,
6939
- document_attachments
6940
- } = result;
6941
- store.dispatch(setIssueAttachments(issue_attachments));
6942
- store.dispatch(setComponentAttachments(component_attachments));
6943
- store.dispatch(setComponentTypeAttachments(component_type_attachments));
6944
- store.dispatch(setProjectAttachments(project_attachments));
6945
- store.dispatch(setDocumentAttachments(document_attachments));
6708
+ void this.client.documents.refreshStore().then(() => {
6709
+ void this.client.documentAttachments.refreshStore().then();
6946
6710
  });
6947
6711
  void this.client.documents.refreshStore();
6948
6712
  void this.client.issueUpdates.refreshStore();
@@ -7045,6 +6809,7 @@ var __publicField = (obj, key, value) => {
7045
6809
  });
7046
6810
  return promise;
7047
6811
  }
6812
+ // TODO: This needs to be seperated into a update and create method
7048
6813
  saveActive() {
7049
6814
  const { store } = this.client;
7050
6815
  const state = store.getState();
@@ -7110,6 +6875,48 @@ var __publicField = (obj, key, value) => {
7110
6875
  });
7111
6876
  }
7112
6877
  }
6878
+ class ProjectAttachmentService extends BaseAttachmentService {
6879
+ constructor() {
6880
+ super(...arguments);
6881
+ __publicField(this, "attachmentModel", AttachmentModel.Project);
6882
+ }
6883
+ buildOfflineAttachment(data) {
6884
+ return offline({
6885
+ file: URL.createObjectURL(data.file),
6886
+ file_sha1: data.sha1,
6887
+ created_by: data.createdBy,
6888
+ file_name: data.file.name,
6889
+ file_type: data.file.type,
6890
+ submitted_at: data.submittedAt,
6891
+ description: data.description,
6892
+ project: data.modelId
6893
+ });
6894
+ }
6895
+ async attachFilesToProject(files, projectId) {
6896
+ return this.attachFiles(files, projectId, this.buildOfflineAttachment.bind(this), {
6897
+ addAttachments: addProjectAttachments,
6898
+ updateAttachments: updateProjectAttachments,
6899
+ removeAttachments: removeProjectAttachments
6900
+ });
6901
+ }
6902
+ deleteProjectAttachment(attachmentId) {
6903
+ return this.deleteAttachment(
6904
+ attachmentId,
6905
+ {
6906
+ setAttachment: setProjectAttachment,
6907
+ removeAttachment: removeProjectAttachment
6908
+ },
6909
+ {
6910
+ selectAttachment: selectProjectAttachment
6911
+ }
6912
+ );
6913
+ }
6914
+ async refreshStore() {
6915
+ return this.getAttachments({
6916
+ setAttachments: setProjectAttachments
6917
+ });
6918
+ }
6919
+ }
7113
6920
  class ProjectService extends BaseApiService {
7114
6921
  /**
7115
6922
  * Creates a new project. Due to the nature of project creation,
@@ -8501,6 +8308,48 @@ var __publicField = (obj, key, value) => {
8501
8308
  store.dispatch(addDocuments(await organizationDocumentsPromise));
8502
8309
  }
8503
8310
  }
8311
+ class DocumentAttachmentService extends BaseAttachmentService {
8312
+ constructor() {
8313
+ super(...arguments);
8314
+ __publicField(this, "attachmentModel", AttachmentModel.Document);
8315
+ }
8316
+ buildOfflineAttachment(data) {
8317
+ return offline({
8318
+ file: URL.createObjectURL(data.file),
8319
+ file_sha1: data.sha1,
8320
+ created_by: data.createdBy,
8321
+ file_name: data.file.name,
8322
+ file_type: data.file.type,
8323
+ submitted_at: data.submittedAt,
8324
+ description: data.description,
8325
+ document: data.modelId
8326
+ });
8327
+ }
8328
+ async attachFilesToDocument(files, documentId) {
8329
+ return this.attachFiles(files, documentId, this.buildOfflineAttachment.bind(this), {
8330
+ addAttachments: addDocumentAttachments,
8331
+ updateAttachments: updateDocumentAttachments,
8332
+ removeAttachments: removeDocumentAttachments
8333
+ });
8334
+ }
8335
+ deleteDocumentAttachment(attachmentId) {
8336
+ return this.deleteAttachment(
8337
+ attachmentId,
8338
+ {
8339
+ setAttachment: setDocumentAttachment,
8340
+ removeAttachment: removeDocumentAttachment
8341
+ },
8342
+ {
8343
+ selectAttachment: selectDocumentAttachment
8344
+ }
8345
+ );
8346
+ }
8347
+ async refreshStore() {
8348
+ return this.getAttachments({
8349
+ setAttachments: setDocumentAttachments
8350
+ });
8351
+ }
8352
+ }
8504
8353
  class AgentService extends BaseApiService {
8505
8354
  /**
8506
8355
  * Prompt the agent with a message.
@@ -8532,18 +8381,6 @@ var __publicField = (obj, key, value) => {
8532
8381
  blocks: ["rate"]
8533
8382
  });
8534
8383
  }
8535
- async refreshStore() {
8536
- const { store } = this.client;
8537
- const activeProject = store.getState().projectReducer.activeProjectId;
8538
- const result = await this.enqueueRequest({
8539
- description: "Get agent conversation history",
8540
- method: HttpMethod.GET,
8541
- url: `/projects/${activeProject}/agent-conversations/`,
8542
- blockers: ["agent-conversations"],
8543
- blocks: ["agent-conversations"]
8544
- });
8545
- store.dispatch(setConversations(result));
8546
- }
8547
8384
  }
8548
8385
  class TeamService extends BaseApiService {
8549
8386
  add(teamPayload) {
@@ -8687,7 +8524,6 @@ var __publicField = (obj, key, value) => {
8687
8524
  __publicField(this, "store");
8688
8525
  __publicField(this, "agent", new AgentService(this));
8689
8526
  __publicField(this, "files", new FileService(this));
8690
- __publicField(this, "attachments", new AttachmentService(this));
8691
8527
  __publicField(this, "auth", new AuthService(this));
8692
8528
  __publicField(this, "categories", new CategoryService(this));
8693
8529
  __publicField(this, "projectAccesses", new ProjectAccessService(this));
@@ -8697,21 +8533,26 @@ var __publicField = (obj, key, value) => {
8697
8533
  __publicField(this, "issueTypes", new IssueTypeService(this));
8698
8534
  __publicField(this, "issueComments", new IssueCommentService(this));
8699
8535
  __publicField(this, "issueUpdates", new IssueUpdateService(this));
8536
+ __publicField(this, "issueAttachments", new IssueAttachmentService(this));
8700
8537
  __publicField(this, "workspaces", new WorkspaceService(this));
8701
8538
  __publicField(this, "main", new MainService(this));
8702
8539
  __publicField(this, "components", new ComponentService(this));
8540
+ __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
8703
8541
  __publicField(this, "componentTypes", new ComponentTypeService(this));
8542
+ __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
8704
8543
  __publicField(this, "componentStages", new ComponentStageService(this));
8705
8544
  __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
8706
8545
  __publicField(this, "userForms", new UserFormService(this));
8707
8546
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
8708
8547
  __publicField(this, "projects", new ProjectService(this));
8709
8548
  __publicField(this, "projectFiles", new ProjectFileService(this));
8549
+ __publicField(this, "projectAttachments", new ProjectAttachmentService(this));
8710
8550
  __publicField(this, "emailVerification", new EmailVerificationService(this));
8711
8551
  __publicField(this, "emailDomains", new EmailDomainsService(this));
8712
8552
  __publicField(this, "licenses", new LicenseService(this));
8713
8553
  __publicField(this, "documents", new DocumentService(this));
8714
8554
  __publicField(this, "teams", new TeamService(this));
8555
+ __publicField(this, "documentAttachments", new DocumentAttachmentService(this));
8715
8556
  this.API_URL = apiUrl;
8716
8557
  this.store = store;
8717
8558
  }
@@ -9039,260 +8880,6 @@ var __publicField = (obj, key, value) => {
9039
8880
  { ...rest, "aria-labelledby": labelId }
9040
8881
  ];
9041
8882
  };
9042
- const truthyValues = [true, "true"];
9043
- const BooleanInput = React.memo((props) => {
9044
- const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
9045
- let [{ helpText, label }] = useFormikInput(props);
9046
- helpText = showInputOnly ? null : helpText;
9047
- label = showInputOnly ? "" : label;
9048
- const color = blocks.useSeverityColor(severity);
9049
- const value = truthyValues.includes(fieldProps.value);
9050
- return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
9051
- InputWithLabel,
9052
- {
9053
- size,
9054
- severity,
9055
- inputId,
9056
- labelId,
9057
- label,
9058
- image: showInputOnly ? void 0 : field.image,
9059
- flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
9060
- children: /* @__PURE__ */ jsxRuntime.jsx(
9061
- blocks.Checkbox,
9062
- {
9063
- ...rest,
9064
- ...fieldProps,
9065
- id: inputId,
9066
- color,
9067
- value: value.toString(),
9068
- checked: value,
9069
- onCheckedChange: fieldProps.onChange,
9070
- onChange: void 0,
9071
- onBlur: void 0
9072
- }
9073
- )
9074
- }
9075
- ) });
9076
- });
9077
- BooleanInput.displayName = "BooleanInput";
9078
- var DefaultContext = {
9079
- color: void 0,
9080
- size: void 0,
9081
- className: void 0,
9082
- style: void 0,
9083
- attr: void 0
9084
- };
9085
- var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
9086
- var _excluded = ["attr", "size", "title"];
9087
- function _objectWithoutProperties(source, excluded) {
9088
- if (source == null)
9089
- return {};
9090
- var target = _objectWithoutPropertiesLoose(source, excluded);
9091
- var key, i;
9092
- if (Object.getOwnPropertySymbols) {
9093
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
9094
- for (i = 0; i < sourceSymbolKeys.length; i++) {
9095
- key = sourceSymbolKeys[i];
9096
- if (excluded.indexOf(key) >= 0)
9097
- continue;
9098
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
9099
- continue;
9100
- target[key] = source[key];
9101
- }
9102
- }
9103
- return target;
9104
- }
9105
- function _objectWithoutPropertiesLoose(source, excluded) {
9106
- if (source == null)
9107
- return {};
9108
- var target = {};
9109
- for (var key in source) {
9110
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9111
- if (excluded.indexOf(key) >= 0)
9112
- continue;
9113
- target[key] = source[key];
9114
- }
9115
- }
9116
- return target;
9117
- }
9118
- function _extends$1() {
9119
- _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
9120
- for (var i = 1; i < arguments.length; i++) {
9121
- var source = arguments[i];
9122
- for (var key in source) {
9123
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9124
- target[key] = source[key];
9125
- }
9126
- }
9127
- }
9128
- return target;
9129
- };
9130
- return _extends$1.apply(this, arguments);
9131
- }
9132
- function ownKeys(e, r) {
9133
- var t = Object.keys(e);
9134
- if (Object.getOwnPropertySymbols) {
9135
- var o = Object.getOwnPropertySymbols(e);
9136
- r && (o = o.filter(function(r2) {
9137
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
9138
- })), t.push.apply(t, o);
9139
- }
9140
- return t;
9141
- }
9142
- function _objectSpread(e) {
9143
- for (var r = 1; r < arguments.length; r++) {
9144
- var t = null != arguments[r] ? arguments[r] : {};
9145
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
9146
- _defineProperty(e, r2, t[r2]);
9147
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
9148
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
9149
- });
9150
- }
9151
- return e;
9152
- }
9153
- function _defineProperty(obj, key, value) {
9154
- key = _toPropertyKey(key);
9155
- if (key in obj) {
9156
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
9157
- } else {
9158
- obj[key] = value;
9159
- }
9160
- return obj;
9161
- }
9162
- function _toPropertyKey(t) {
9163
- var i = _toPrimitive(t, "string");
9164
- return "symbol" == typeof i ? i : i + "";
9165
- }
9166
- function _toPrimitive(t, r) {
9167
- if ("object" != typeof t || !t)
9168
- return t;
9169
- var e = t[Symbol.toPrimitive];
9170
- if (void 0 !== e) {
9171
- var i = e.call(t, r || "default");
9172
- if ("object" != typeof i)
9173
- return i;
9174
- throw new TypeError("@@toPrimitive must return a primitive value.");
9175
- }
9176
- return ("string" === r ? String : Number)(t);
9177
- }
9178
- function Tree2Element(tree) {
9179
- return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
9180
- key: i
9181
- }, node.attr), Tree2Element(node.child)));
9182
- }
9183
- function GenIcon(data) {
9184
- return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends$1({
9185
- attr: _objectSpread({}, data.attr)
9186
- }, props), Tree2Element(data.child));
9187
- }
9188
- function IconBase(props) {
9189
- var elem = (conf) => {
9190
- var {
9191
- attr,
9192
- size,
9193
- title: title2
9194
- } = props, svgProps = _objectWithoutProperties(props, _excluded);
9195
- var computedSize = size || conf.size || "1em";
9196
- var className;
9197
- if (conf.className)
9198
- className = conf.className;
9199
- if (props.className)
9200
- className = (className ? className + " " : "") + props.className;
9201
- return /* @__PURE__ */ React.createElement("svg", _extends$1({
9202
- stroke: "currentColor",
9203
- fill: "currentColor",
9204
- strokeWidth: "0"
9205
- }, conf.attr, attr, svgProps, {
9206
- className,
9207
- style: _objectSpread(_objectSpread({
9208
- color: props.color || conf.color
9209
- }, conf.style), props.style),
9210
- height: computedSize,
9211
- width: computedSize,
9212
- xmlns: "http://www.w3.org/2000/svg"
9213
- }), title2 && /* @__PURE__ */ React.createElement("title", null, title2), props.children);
9214
- };
9215
- return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
9216
- }
9217
- function RiArrowDownLine(props) {
9218
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
9219
- }
9220
- function RiArrowUpLine(props) {
9221
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
9222
- }
9223
- function RiCalendarLine(props) {
9224
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
9225
- }
9226
- function RiQrCodeLine(props) {
9227
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
9228
- }
9229
- function RiFileCopyLine(props) {
9230
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
9231
- }
9232
- function RiAlignJustify(props) {
9233
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
9234
- }
9235
- function RiHashtag(props) {
9236
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
9237
- }
9238
- function RiInputField(props) {
9239
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
9240
- }
9241
- function RiListCheck(props) {
9242
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
9243
- }
9244
- function RiImageLine(props) {
9245
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
9246
- }
9247
- function RiCheckboxCircleLine(props) {
9248
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
9249
- }
9250
- function RiCheckboxLine(props) {
9251
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
9252
- }
9253
- function RiDeleteBin2Line(props) {
9254
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
9255
- }
9256
- function RiMenuFoldLine(props) {
9257
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
9258
- }
9259
- function RiUpload2Line(props) {
9260
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
9261
- }
9262
- const emptyBooleanField = {
9263
- ...emptyBaseField,
9264
- type: "boolean"
9265
- };
9266
- const _BooleanField = class _BooleanField extends BaseField {
9267
- constructor(options) {
9268
- super({ ...options, type: "boolean" });
9269
- __publicField(this, "onlyValidateAfterTouched", false);
9270
- }
9271
- // if a BooleanField is required, `false` is considered blank
9272
- isBlank(value) {
9273
- return this.required && !value;
9274
- }
9275
- getValueFromChangeEvent(event) {
9276
- if (typeof event === "boolean")
9277
- return event;
9278
- return event.target.checked;
9279
- }
9280
- serialize() {
9281
- return super._serialize();
9282
- }
9283
- static deserialize(data) {
9284
- if (data.type !== "boolean")
9285
- throw new Error("Type mismatch.");
9286
- return new _BooleanField(data);
9287
- }
9288
- getInput(props) {
9289
- return /* @__PURE__ */ jsxRuntime.jsx(BooleanInput, { ...props, field: this });
9290
- }
9291
- };
9292
- __publicField(_BooleanField, "fieldTypeName", "Checkbox");
9293
- __publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
9294
- __publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
9295
- let BooleanField = _BooleanField;
9296
8883
  function getDefaultExportFromCjs(x) {
9297
8884
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
9298
8885
  }
@@ -9345,8 +8932,8 @@ var __publicField = (obj, key, value) => {
9345
8932
  })(classnames);
9346
8933
  var classnamesExports = classnames.exports;
9347
8934
  const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
9348
- function _extends() {
9349
- _extends = Object.assign ? Object.assign.bind() : function(target) {
8935
+ function _extends$1() {
8936
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
9350
8937
  for (var i = 1; i < arguments.length; i++) {
9351
8938
  var source = arguments[i];
9352
8939
  for (var key in source) {
@@ -9357,7 +8944,7 @@ var __publicField = (obj, key, value) => {
9357
8944
  }
9358
8945
  return target;
9359
8946
  };
9360
- return _extends.apply(this, arguments);
8947
+ return _extends$1.apply(this, arguments);
9361
8948
  }
9362
8949
  function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9363
8950
  return function handleEvent(event) {
@@ -9488,11 +9075,11 @@ var __publicField = (obj, key, value) => {
9488
9075
  } else
9489
9076
  return child;
9490
9077
  });
9491
- return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9078
+ return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9492
9079
  ref: forwardedRef
9493
9080
  }), /* @__PURE__ */ React.isValidElement(newElement) ? /* @__PURE__ */ React.cloneElement(newElement, void 0, newChildren) : null);
9494
9081
  }
9495
- return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9082
+ return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9496
9083
  ref: forwardedRef
9497
9084
  }), children);
9498
9085
  });
@@ -9570,7 +9157,7 @@ var __publicField = (obj, key, value) => {
9570
9157
  React.useEffect(() => {
9571
9158
  window[Symbol.for("radix-ui")] = true;
9572
9159
  }, []);
9573
- return /* @__PURE__ */ React.createElement(Comp, _extends({}, primitiveProps, {
9160
+ return /* @__PURE__ */ React.createElement(Comp, _extends$1({}, primitiveProps, {
9574
9161
  ref: forwardedRef
9575
9162
  }));
9576
9163
  });
@@ -10129,9 +9716,9 @@ var __publicField = (obj, key, value) => {
10129
9716
  return React__namespace.createElement("div", { ...insetProps, ref: forwardedRef, className: classNames("rt-Inset", className, withBreakpoints(side, "rt-r-side"), withBreakpoints(clip, "rt-r-clip"), withBreakpoints(p, "rt-r-p"), withBreakpoints(px, "rt-r-px"), withBreakpoints(py, "rt-r-py"), withBreakpoints(pt, "rt-r-pt"), withBreakpoints(pr, "rt-r-pr"), withBreakpoints(pb, "rt-r-pb"), withBreakpoints(pl, "rt-r-pl"), withMarginProps(marginProps)) });
10130
9717
  });
10131
9718
  Inset.displayName = "Inset";
10132
- const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9719
+ const sizes$9 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
10133
9720
  const headingPropDefs = {
10134
- size: { type: "enum", values: sizes$8, default: "6", responsive: true },
9721
+ size: { type: "enum", values: sizes$9, default: "6", responsive: true },
10135
9722
  weight: { ...weightProp, default: "bold" },
10136
9723
  align: alignProp,
10137
9724
  trim: trimProp,
@@ -10144,9 +9731,9 @@ var __publicField = (obj, key, value) => {
10144
9731
  return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...headingProps, ref: forwardedRef, className: classNames("rt-Heading", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
10145
9732
  });
10146
9733
  Heading.displayName = "Heading";
10147
- const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9734
+ const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
10148
9735
  const textPropDefs = {
10149
- size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9736
+ size: { type: "enum", values: sizes$8, default: void 0, responsive: true },
10150
9737
  weight: weightProp,
10151
9738
  align: alignProp,
10152
9739
  trim: trimProp,
@@ -10159,11 +9746,11 @@ var __publicField = (obj, key, value) => {
10159
9746
  return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...textProps, ref: forwardedRef, className: classNames("rt-Text", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
10160
9747
  });
10161
9748
  Text.displayName = "Text";
10162
- const sizes$6 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
10163
- const variants$4 = ["solid", "soft", "outline", "ghost"];
9749
+ const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9750
+ const variants$5 = ["solid", "soft", "outline", "ghost"];
10164
9751
  const codePropDefs = {
10165
- size: { type: "enum", values: sizes$6, default: void 0, responsive: true },
10166
- variant: { type: "enum", values: variants$4, default: "soft" },
9752
+ size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9753
+ variant: { type: "enum", values: variants$5, default: "soft" },
10167
9754
  weight: weightProp,
10168
9755
  color: colorProp,
10169
9756
  highContrast: highContrastProp
@@ -10193,6 +9780,202 @@ var __publicField = (obj, key, value) => {
10193
9780
  value
10194
9781
  ]);
10195
9782
  }
9783
+ const $e698a72e93240346$var$CHECKBOX_NAME = "Checkbox";
9784
+ const [$e698a72e93240346$var$createCheckboxContext, $e698a72e93240346$export$b566c4ff5488ea01] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($e698a72e93240346$var$CHECKBOX_NAME);
9785
+ const [$e698a72e93240346$var$CheckboxProvider, $e698a72e93240346$var$useCheckboxContext] = $e698a72e93240346$var$createCheckboxContext($e698a72e93240346$var$CHECKBOX_NAME);
9786
+ const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
9787
+ const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
9788
+ const [button, setButton] = React.useState(null);
9789
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
9790
+ forwardedRef,
9791
+ (node) => setButton(node)
9792
+ );
9793
+ const hasConsumerStoppedPropagationRef = React.useRef(false);
9794
+ const isFormControl = button ? Boolean(button.closest("form")) : true;
9795
+ const [checked = false, setChecked] = $71cd76cc60e0454e$export$6f32135080cb4c3({
9796
+ prop: checkedProp,
9797
+ defaultProp: defaultChecked,
9798
+ onChange: onCheckedChange
9799
+ });
9800
+ const initialCheckedStateRef = React.useRef(checked);
9801
+ React.useEffect(() => {
9802
+ const form = button === null || button === void 0 ? void 0 : button.form;
9803
+ if (form) {
9804
+ const reset = () => setChecked(initialCheckedStateRef.current);
9805
+ form.addEventListener("reset", reset);
9806
+ return () => form.removeEventListener("reset", reset);
9807
+ }
9808
+ }, [
9809
+ button,
9810
+ setChecked
9811
+ ]);
9812
+ return /* @__PURE__ */ React.createElement($e698a72e93240346$var$CheckboxProvider, {
9813
+ scope: __scopeCheckbox,
9814
+ state: checked,
9815
+ disabled
9816
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
9817
+ type: "button",
9818
+ role: "checkbox",
9819
+ "aria-checked": $e698a72e93240346$var$isIndeterminate(checked) ? "mixed" : checked,
9820
+ "aria-required": required,
9821
+ "data-state": $e698a72e93240346$var$getState(checked),
9822
+ "data-disabled": disabled ? "" : void 0,
9823
+ disabled,
9824
+ value
9825
+ }, checkboxProps, {
9826
+ ref: composedRefs,
9827
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
9828
+ if (event.key === "Enter")
9829
+ event.preventDefault();
9830
+ }),
9831
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event) => {
9832
+ setChecked(
9833
+ (prevChecked) => $e698a72e93240346$var$isIndeterminate(prevChecked) ? true : !prevChecked
9834
+ );
9835
+ if (isFormControl) {
9836
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
9837
+ if (!hasConsumerStoppedPropagationRef.current)
9838
+ event.stopPropagation();
9839
+ }
9840
+ })
9841
+ })), isFormControl && /* @__PURE__ */ React.createElement($e698a72e93240346$var$BubbleInput, {
9842
+ control: button,
9843
+ bubbles: !hasConsumerStoppedPropagationRef.current,
9844
+ name,
9845
+ value,
9846
+ checked,
9847
+ required,
9848
+ disabled,
9849
+ style: {
9850
+ transform: "translateX(-100%)"
9851
+ }
9852
+ }));
9853
+ });
9854
+ const $e698a72e93240346$var$INDICATOR_NAME = "CheckboxIndicator";
9855
+ const $e698a72e93240346$export$59aad738f51d1c05 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
9856
+ const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
9857
+ const context = $e698a72e93240346$var$useCheckboxContext($e698a72e93240346$var$INDICATOR_NAME, __scopeCheckbox);
9858
+ return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
9859
+ present: forceMount || $e698a72e93240346$var$isIndeterminate(context.state) || context.state === true
9860
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
9861
+ "data-state": $e698a72e93240346$var$getState(context.state),
9862
+ "data-disabled": context.disabled ? "" : void 0
9863
+ }, indicatorProps, {
9864
+ ref: forwardedRef,
9865
+ style: {
9866
+ pointerEvents: "none",
9867
+ ...props.style
9868
+ }
9869
+ })));
9870
+ });
9871
+ const $e698a72e93240346$var$BubbleInput = (props) => {
9872
+ const { control, checked, bubbles = true, ...inputProps } = props;
9873
+ const ref = React.useRef(null);
9874
+ const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
9875
+ const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control);
9876
+ React.useEffect(() => {
9877
+ const input = ref.current;
9878
+ const inputProto = window.HTMLInputElement.prototype;
9879
+ const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
9880
+ const setChecked = descriptor.set;
9881
+ if (prevChecked !== checked && setChecked) {
9882
+ const event = new Event("click", {
9883
+ bubbles
9884
+ });
9885
+ input.indeterminate = $e698a72e93240346$var$isIndeterminate(checked);
9886
+ setChecked.call(input, $e698a72e93240346$var$isIndeterminate(checked) ? false : checked);
9887
+ input.dispatchEvent(event);
9888
+ }
9889
+ }, [
9890
+ prevChecked,
9891
+ checked,
9892
+ bubbles
9893
+ ]);
9894
+ return /* @__PURE__ */ React.createElement("input", _extends$1({
9895
+ type: "checkbox",
9896
+ "aria-hidden": true,
9897
+ defaultChecked: $e698a72e93240346$var$isIndeterminate(checked) ? false : checked
9898
+ }, inputProps, {
9899
+ tabIndex: -1,
9900
+ ref,
9901
+ style: {
9902
+ ...props.style,
9903
+ ...controlSize,
9904
+ position: "absolute",
9905
+ pointerEvents: "none",
9906
+ opacity: 0,
9907
+ margin: 0
9908
+ }
9909
+ }));
9910
+ };
9911
+ function $e698a72e93240346$var$isIndeterminate(checked) {
9912
+ return checked === "indeterminate";
9913
+ }
9914
+ function $e698a72e93240346$var$getState(checked) {
9915
+ return $e698a72e93240346$var$isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
9916
+ }
9917
+ const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
9918
+ const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
9919
+ const sizes$6 = ["1", "2", "3"];
9920
+ const variants$4 = ["classic", "surface", "soft"];
9921
+ const checkboxPropDefs = {
9922
+ size: { type: "enum", values: sizes$6, default: "2", responsive: true },
9923
+ variant: { type: "enum", values: variants$4, default: "surface" },
9924
+ color: colorProp,
9925
+ highContrast: highContrastProp
9926
+ };
9927
+ const ThickCheckIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9928
+ return React__namespace.createElement(
9929
+ "svg",
9930
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9931
+ React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z" })
9932
+ );
9933
+ });
9934
+ ThickCheckIcon.displayName = "ThickCheckIcon";
9935
+ const ChevronDownIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9936
+ return React__namespace.createElement(
9937
+ "svg",
9938
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9939
+ React__namespace.createElement("path", { d: "M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z" })
9940
+ );
9941
+ });
9942
+ ChevronDownIcon.displayName = "ChevronDownIcon";
9943
+ const ThickChevronRightIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9944
+ return React__namespace.createElement(
9945
+ "svg",
9946
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9947
+ React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z" })
9948
+ );
9949
+ });
9950
+ ThickChevronRightIcon.displayName = "ThickChevronRightIcon";
9951
+ const InfoCircledIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9952
+ return React__namespace.createElement(
9953
+ "svg",
9954
+ { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9955
+ React__namespace.createElement("path", { d: "M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z", fill: color, fillRule: "evenodd", clipRule: "evenodd" })
9956
+ );
9957
+ });
9958
+ InfoCircledIcon.displayName = "InfoCircledIcon";
9959
+ const Checkbox = React__namespace.forwardRef((props, forwardedRef) => {
9960
+ const { rest: marginRest, ...marginProps } = extractMarginProps(props);
9961
+ const { className, style, size = checkboxPropDefs.size.default, variant = checkboxPropDefs.variant.default, color = checkboxPropDefs.color.default, highContrast = checkboxPropDefs.highContrast.default, ...checkboxProps } = marginRest;
9962
+ return React__namespace.createElement(
9963
+ "span",
9964
+ { className: classNames("rt-CheckboxRoot", className, withBreakpoints(size, "rt-r-size"), withMarginProps(marginProps)), style },
9965
+ React__namespace.createElement(
9966
+ $e698a72e93240346$export$be92b6f5f03c0fe9,
9967
+ { "data-accent-color": color, ...checkboxProps, ref: forwardedRef, className: classNames("rt-reset", "rt-CheckboxButton", `rt-variant-${variant}`, {
9968
+ "rt-high-contrast": highContrast
9969
+ }) },
9970
+ React__namespace.createElement(
9971
+ $e698a72e93240346$export$adb584737d712b70,
9972
+ { className: "rt-CheckboxIndicator" },
9973
+ React__namespace.createElement(ThickCheckIcon, { className: "rt-CheckboxIndicatorIcon" })
9974
+ )
9975
+ )
9976
+ );
9977
+ });
9978
+ Checkbox.displayName = "Checkbox";
10196
9979
  function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
10197
9980
  const PROVIDER_NAME = name + "CollectionProvider";
10198
9981
  const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
@@ -10284,7 +10067,7 @@ var __publicField = (obj, key, value) => {
10284
10067
  scope: props.__scopeRovingFocusGroup
10285
10068
  }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
10286
10069
  scope: props.__scopeRovingFocusGroup
10287
- }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
10070
+ }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends$1({}, props, {
10288
10071
  ref: forwardedRef
10289
10072
  }))));
10290
10073
  });
@@ -10340,7 +10123,7 @@ var __publicField = (obj, key, value) => {
10340
10123
  ),
10341
10124
  []
10342
10125
  )
10343
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10126
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10344
10127
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
10345
10128
  "data-orientation": orientation
10346
10129
  }, groupProps, {
@@ -10410,7 +10193,7 @@ var __publicField = (obj, key, value) => {
10410
10193
  id,
10411
10194
  focusable,
10412
10195
  active
10413
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
10196
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
10414
10197
  tabIndex: isCurrentTabStop ? 0 : -1,
10415
10198
  "data-orientation": context.orientation
10416
10199
  }, itemProps, {
@@ -10550,7 +10333,7 @@ var __publicField = (obj, key, value) => {
10550
10333
  onScrollbarYEnabledChange: setScrollbarYEnabled,
10551
10334
  onCornerWidthChange: setCornerWidth,
10552
10335
  onCornerHeightChange: setCornerHeight
10553
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10336
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10554
10337
  dir: direction
10555
10338
  }, scrollAreaProps, {
10556
10339
  ref: composedRefs,
@@ -10573,7 +10356,7 @@ var __publicField = (obj, key, value) => {
10573
10356
  dangerouslySetInnerHTML: {
10574
10357
  __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
10575
10358
  }
10576
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10359
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10577
10360
  "data-radix-scroll-area-viewport": ""
10578
10361
  }, viewportProps, {
10579
10362
  ref: composedRefs,
@@ -10617,16 +10400,16 @@ var __publicField = (obj, key, value) => {
10617
10400
  onScrollbarXEnabledChange,
10618
10401
  onScrollbarYEnabledChange
10619
10402
  ]);
10620
- return context.type === "hover" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends({}, scrollbarProps, {
10403
+ return context.type === "hover" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends$1({}, scrollbarProps, {
10621
10404
  ref: forwardedRef,
10622
10405
  forceMount
10623
- })) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends({}, scrollbarProps, {
10406
+ })) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends$1({}, scrollbarProps, {
10624
10407
  ref: forwardedRef,
10625
10408
  forceMount
10626
- })) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({}, scrollbarProps, {
10409
+ })) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({}, scrollbarProps, {
10627
10410
  ref: forwardedRef,
10628
10411
  forceMount
10629
- })) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({}, scrollbarProps, {
10412
+ })) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({}, scrollbarProps, {
10630
10413
  ref: forwardedRef
10631
10414
  })) : null;
10632
10415
  });
@@ -10662,7 +10445,7 @@ var __publicField = (obj, key, value) => {
10662
10445
  ]);
10663
10446
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10664
10447
  present: forceMount || visible
10665
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({
10448
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({
10666
10449
  "data-state": visible ? "visible" : "hidden"
10667
10450
  }, scrollbarProps, {
10668
10451
  ref: forwardedRef
@@ -10732,7 +10515,7 @@ var __publicField = (obj, key, value) => {
10732
10515
  ]);
10733
10516
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10734
10517
  present: forceMount || state !== "hidden"
10735
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10518
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
10736
10519
  "data-state": state === "hidden" ? "hidden" : "visible"
10737
10520
  }, scrollbarProps, {
10738
10521
  ref: forwardedRef,
@@ -10762,7 +10545,7 @@ var __publicField = (obj, key, value) => {
10762
10545
  $57acba87d6e25586$var$useResizeObserver(context.content, handleResize);
10763
10546
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10764
10547
  present: forceMount || visible
10765
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10548
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
10766
10549
  "data-state": visible ? "visible" : "hidden"
10767
10550
  }, scrollbarProps, {
10768
10551
  ref: forwardedRef
@@ -10796,7 +10579,7 @@ var __publicField = (obj, key, value) => {
10796
10579
  return $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes2, dir);
10797
10580
  }
10798
10581
  if (orientation === "horizontal")
10799
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends({}, commonProps, {
10582
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends$1({}, commonProps, {
10800
10583
  ref: forwardedRef,
10801
10584
  onThumbPositionChange: () => {
10802
10585
  if (context.viewport && thumbRef.current) {
@@ -10815,7 +10598,7 @@ var __publicField = (obj, key, value) => {
10815
10598
  }
10816
10599
  }));
10817
10600
  if (orientation === "vertical")
10818
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends({}, commonProps, {
10601
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends$1({}, commonProps, {
10819
10602
  ref: forwardedRef,
10820
10603
  onThumbPositionChange: () => {
10821
10604
  if (context.viewport && thumbRef.current) {
@@ -10847,7 +10630,7 @@ var __publicField = (obj, key, value) => {
10847
10630
  }, [
10848
10631
  ref
10849
10632
  ]);
10850
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10633
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
10851
10634
  "data-orientation": "horizontal"
10852
10635
  }, scrollbarProps, {
10853
10636
  ref: composeRefs,
@@ -10895,7 +10678,7 @@ var __publicField = (obj, key, value) => {
10895
10678
  }, [
10896
10679
  ref
10897
10680
  ]);
10898
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10681
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
10899
10682
  "data-orientation": "vertical"
10900
10683
  }, scrollbarProps, {
10901
10684
  ref: composeRefs,
@@ -10991,7 +10774,7 @@ var __publicField = (obj, key, value) => {
10991
10774
  onThumbPointerUp: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerUp),
10992
10775
  onThumbPositionChange: handleThumbPositionChange,
10993
10776
  onThumbPointerDown: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerDown)
10994
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, scrollbarProps, {
10777
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, scrollbarProps, {
10995
10778
  ref: composeRefs,
10996
10779
  style: {
10997
10780
  position: "absolute",
@@ -11028,7 +10811,7 @@ var __publicField = (obj, key, value) => {
11028
10811
  const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, props.__scopeScrollArea);
11029
10812
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
11030
10813
  present: forceMount || scrollbarContext.hasThumb
11031
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends({
10814
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends$1({
11032
10815
  ref: forwardedRef
11033
10816
  }, thumbProps)));
11034
10817
  });
@@ -11068,7 +10851,7 @@ var __publicField = (obj, key, value) => {
11068
10851
  debounceScrollEnd,
11069
10852
  onThumbPositionChange
11070
10853
  ]);
11071
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10854
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
11072
10855
  "data-state": scrollbarContext.hasThumb ? "visible" : "hidden"
11073
10856
  }, thumbProps, {
11074
10857
  ref: composedRef,
@@ -11095,7 +10878,7 @@ var __publicField = (obj, key, value) => {
11095
10878
  const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, props.__scopeScrollArea);
11096
10879
  const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
11097
10880
  const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
11098
- return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends({}, props, {
10881
+ return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends$1({}, props, {
11099
10882
  ref: forwardedRef
11100
10883
  })) : null;
11101
10884
  });
@@ -11117,7 +10900,7 @@ var __publicField = (obj, key, value) => {
11117
10900
  context.onCornerWidthChange(width);
11118
10901
  setWidth(width);
11119
10902
  });
11120
- return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, cornerProps, {
10903
+ return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, cornerProps, {
11121
10904
  ref: forwardedRef,
11122
10905
  style: {
11123
10906
  width: width1,
@@ -11378,7 +11161,7 @@ var __publicField = (obj, key, value) => {
11378
11161
  scope: props.__scopeSlider
11379
11162
  }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.Slot, {
11380
11163
  scope: props.__scopeSlider
11381
- }, /* @__PURE__ */ React.createElement(SliderOrientation, _extends({
11164
+ }, /* @__PURE__ */ React.createElement(SliderOrientation, _extends$1({
11382
11165
  "aria-disabled": disabled,
11383
11166
  "data-disabled": disabled ? "" : void 0
11384
11167
  }, sliderProps, {
@@ -11460,7 +11243,7 @@ var __publicField = (obj, key, value) => {
11460
11243
  endEdge: isSlidingFromLeft ? "right" : "left",
11461
11244
  direction: isSlidingFromLeft ? 1 : -1,
11462
11245
  size: "width"
11463
- }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11246
+ }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11464
11247
  dir: direction,
11465
11248
  "data-orientation": "horizontal"
11466
11249
  }, sliderProps, {
@@ -11520,7 +11303,7 @@ var __publicField = (obj, key, value) => {
11520
11303
  endEdge: isSlidingFromBottom ? "top" : "bottom",
11521
11304
  size: "height",
11522
11305
  direction: isSlidingFromBottom ? 1 : -1
11523
- }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11306
+ }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11524
11307
  "data-orientation": "vertical"
11525
11308
  }, sliderProps, {
11526
11309
  ref,
@@ -11553,7 +11336,7 @@ var __publicField = (obj, key, value) => {
11553
11336
  const $faa2e61a3361514f$var$SliderImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
11554
11337
  const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
11555
11338
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
11556
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
11339
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, sliderProps, {
11557
11340
  ref: forwardedRef,
11558
11341
  onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
11559
11342
  if (event.key === "Home") {
@@ -11594,7 +11377,7 @@ var __publicField = (obj, key, value) => {
11594
11377
  const $faa2e61a3361514f$export$105594979f116971 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
11595
11378
  const { __scopeSlider, ...trackProps } = props;
11596
11379
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
11597
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11380
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11598
11381
  "data-disabled": context.disabled ? "" : void 0,
11599
11382
  "data-orientation": context.orientation
11600
11383
  }, trackProps, {
@@ -11614,7 +11397,7 @@ var __publicField = (obj, key, value) => {
11614
11397
  );
11615
11398
  const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
11616
11399
  const offsetEnd = 100 - Math.max(...percentages);
11617
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11400
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11618
11401
  "data-orientation": context.orientation,
11619
11402
  "data-disabled": context.disabled ? "" : void 0
11620
11403
  }, rangeProps, {
@@ -11643,7 +11426,7 @@ var __publicField = (obj, key, value) => {
11643
11426
  thumb
11644
11427
  ]
11645
11428
  );
11646
- return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
11429
+ return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends$1({}, props, {
11647
11430
  ref: composedRefs,
11648
11431
  index: index2
11649
11432
  }));
@@ -11682,7 +11465,7 @@ var __publicField = (obj, key, value) => {
11682
11465
  }
11683
11466
  }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
11684
11467
  scope: props.__scopeSlider
11685
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11468
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11686
11469
  role: "slider",
11687
11470
  "aria-label": props["aria-label"] || label,
11688
11471
  "aria-valuemin": context.min,
@@ -11722,7 +11505,7 @@ var __publicField = (obj, key, value) => {
11722
11505
  prevValue,
11723
11506
  value
11724
11507
  ]);
11725
- return /* @__PURE__ */ React.createElement("input", _extends({
11508
+ return /* @__PURE__ */ React.createElement("input", _extends$1({
11726
11509
  style: {
11727
11510
  display: "none"
11728
11511
  }
@@ -11941,7 +11724,7 @@ var __publicField = (obj, key, value) => {
11941
11724
  scope: __scopeAvatar,
11942
11725
  imageLoadingStatus,
11943
11726
  onImageLoadingStatusChange: setImageLoadingStatus
11944
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, avatarProps, {
11727
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, avatarProps, {
11945
11728
  ref: forwardedRef
11946
11729
  })));
11947
11730
  });
@@ -11962,7 +11745,7 @@ var __publicField = (obj, key, value) => {
11962
11745
  imageLoadingStatus,
11963
11746
  handleLoadingStatusChange
11964
11747
  ]);
11965
- return imageLoadingStatus === "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends({}, imageProps, {
11748
+ return imageLoadingStatus === "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends$1({}, imageProps, {
11966
11749
  ref: forwardedRef,
11967
11750
  src
11968
11751
  })) : null;
@@ -11983,7 +11766,7 @@ var __publicField = (obj, key, value) => {
11983
11766
  }, [
11984
11767
  delayMs
11985
11768
  ]);
11986
- return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, fallbackProps, {
11769
+ return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, fallbackProps, {
11987
11770
  ref: forwardedRef
11988
11771
  })) : null;
11989
11772
  });
@@ -12087,7 +11870,7 @@ var __publicField = (obj, key, value) => {
12087
11870
  orientation,
12088
11871
  dir: direction,
12089
11872
  activationMode
12090
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11873
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12091
11874
  dir: direction,
12092
11875
  "data-orientation": orientation
12093
11876
  }, tabsProps, {
@@ -12099,13 +11882,13 @@ var __publicField = (obj, key, value) => {
12099
11882
  const { __scopeTabs, loop = true, ...listProps } = props;
12100
11883
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
12101
11884
  const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
12102
- return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
11885
+ return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends$1({
12103
11886
  asChild: true
12104
11887
  }, rovingFocusGroupScope, {
12105
11888
  orientation: context.orientation,
12106
11889
  dir: context.dir,
12107
11890
  loop
12108
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11891
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12109
11892
  role: "tablist",
12110
11893
  "aria-orientation": context.orientation
12111
11894
  }, listProps, {
@@ -12120,12 +11903,12 @@ var __publicField = (obj, key, value) => {
12120
11903
  const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
12121
11904
  const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
12122
11905
  const isSelected = value === context.value;
12123
- return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
11906
+ return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends$1({
12124
11907
  asChild: true
12125
11908
  }, rovingFocusGroupScope, {
12126
11909
  focusable: !disabled,
12127
11910
  active: isSelected
12128
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
11911
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
12129
11912
  type: "button",
12130
11913
  role: "tab",
12131
11914
  "aria-selected": isSelected,
@@ -12175,7 +11958,7 @@ var __publicField = (obj, key, value) => {
12175
11958
  {
12176
11959
  present: forceMount || isSelected
12177
11960
  },
12178
- ({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11961
+ ({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12179
11962
  "data-state": isSelected ? "active" : "inactive",
12180
11963
  "data-orientation": context.orientation,
12181
11964
  role: "tabpanel",
@@ -12235,6 +12018,260 @@ var __publicField = (obj, key, value) => {
12235
12018
  Trigger: TabsTrigger,
12236
12019
  Content: TabsContent
12237
12020
  });
12021
+ const truthyValues = [true, "true"];
12022
+ const BooleanInput = React.memo((props) => {
12023
+ const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12024
+ let [{ helpText, label }] = useFormikInput(props);
12025
+ helpText = showInputOnly ? null : helpText;
12026
+ label = showInputOnly ? "" : label;
12027
+ const color = blocks.useSeverityColor(severity);
12028
+ const value = truthyValues.includes(fieldProps.value);
12029
+ return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
12030
+ InputWithLabel,
12031
+ {
12032
+ size,
12033
+ severity,
12034
+ inputId,
12035
+ labelId,
12036
+ label,
12037
+ image: showInputOnly ? void 0 : field.image,
12038
+ flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
12039
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12040
+ Checkbox,
12041
+ {
12042
+ ...rest,
12043
+ ...fieldProps,
12044
+ id: inputId,
12045
+ color,
12046
+ value: value.toString(),
12047
+ checked: value,
12048
+ onCheckedChange: fieldProps.onChange,
12049
+ onChange: void 0,
12050
+ onBlur: void 0
12051
+ }
12052
+ )
12053
+ }
12054
+ ) });
12055
+ });
12056
+ BooleanInput.displayName = "BooleanInput";
12057
+ var DefaultContext = {
12058
+ color: void 0,
12059
+ size: void 0,
12060
+ className: void 0,
12061
+ style: void 0,
12062
+ attr: void 0
12063
+ };
12064
+ var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
12065
+ var _excluded = ["attr", "size", "title"];
12066
+ function _objectWithoutProperties(source, excluded) {
12067
+ if (source == null)
12068
+ return {};
12069
+ var target = _objectWithoutPropertiesLoose(source, excluded);
12070
+ var key, i;
12071
+ if (Object.getOwnPropertySymbols) {
12072
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
12073
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
12074
+ key = sourceSymbolKeys[i];
12075
+ if (excluded.indexOf(key) >= 0)
12076
+ continue;
12077
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
12078
+ continue;
12079
+ target[key] = source[key];
12080
+ }
12081
+ }
12082
+ return target;
12083
+ }
12084
+ function _objectWithoutPropertiesLoose(source, excluded) {
12085
+ if (source == null)
12086
+ return {};
12087
+ var target = {};
12088
+ for (var key in source) {
12089
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12090
+ if (excluded.indexOf(key) >= 0)
12091
+ continue;
12092
+ target[key] = source[key];
12093
+ }
12094
+ }
12095
+ return target;
12096
+ }
12097
+ function _extends() {
12098
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
12099
+ for (var i = 1; i < arguments.length; i++) {
12100
+ var source = arguments[i];
12101
+ for (var key in source) {
12102
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12103
+ target[key] = source[key];
12104
+ }
12105
+ }
12106
+ }
12107
+ return target;
12108
+ };
12109
+ return _extends.apply(this, arguments);
12110
+ }
12111
+ function ownKeys(e, r) {
12112
+ var t = Object.keys(e);
12113
+ if (Object.getOwnPropertySymbols) {
12114
+ var o = Object.getOwnPropertySymbols(e);
12115
+ r && (o = o.filter(function(r2) {
12116
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
12117
+ })), t.push.apply(t, o);
12118
+ }
12119
+ return t;
12120
+ }
12121
+ function _objectSpread(e) {
12122
+ for (var r = 1; r < arguments.length; r++) {
12123
+ var t = null != arguments[r] ? arguments[r] : {};
12124
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
12125
+ _defineProperty(e, r2, t[r2]);
12126
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
12127
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
12128
+ });
12129
+ }
12130
+ return e;
12131
+ }
12132
+ function _defineProperty(obj, key, value) {
12133
+ key = _toPropertyKey(key);
12134
+ if (key in obj) {
12135
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
12136
+ } else {
12137
+ obj[key] = value;
12138
+ }
12139
+ return obj;
12140
+ }
12141
+ function _toPropertyKey(t) {
12142
+ var i = _toPrimitive(t, "string");
12143
+ return "symbol" == typeof i ? i : i + "";
12144
+ }
12145
+ function _toPrimitive(t, r) {
12146
+ if ("object" != typeof t || !t)
12147
+ return t;
12148
+ var e = t[Symbol.toPrimitive];
12149
+ if (void 0 !== e) {
12150
+ var i = e.call(t, r || "default");
12151
+ if ("object" != typeof i)
12152
+ return i;
12153
+ throw new TypeError("@@toPrimitive must return a primitive value.");
12154
+ }
12155
+ return ("string" === r ? String : Number)(t);
12156
+ }
12157
+ function Tree2Element(tree) {
12158
+ return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
12159
+ key: i
12160
+ }, node.attr), Tree2Element(node.child)));
12161
+ }
12162
+ function GenIcon(data) {
12163
+ return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends({
12164
+ attr: _objectSpread({}, data.attr)
12165
+ }, props), Tree2Element(data.child));
12166
+ }
12167
+ function IconBase(props) {
12168
+ var elem = (conf) => {
12169
+ var {
12170
+ attr,
12171
+ size,
12172
+ title: title2
12173
+ } = props, svgProps = _objectWithoutProperties(props, _excluded);
12174
+ var computedSize = size || conf.size || "1em";
12175
+ var className;
12176
+ if (conf.className)
12177
+ className = conf.className;
12178
+ if (props.className)
12179
+ className = (className ? className + " " : "") + props.className;
12180
+ return /* @__PURE__ */ React.createElement("svg", _extends({
12181
+ stroke: "currentColor",
12182
+ fill: "currentColor",
12183
+ strokeWidth: "0"
12184
+ }, conf.attr, attr, svgProps, {
12185
+ className,
12186
+ style: _objectSpread(_objectSpread({
12187
+ color: props.color || conf.color
12188
+ }, conf.style), props.style),
12189
+ height: computedSize,
12190
+ width: computedSize,
12191
+ xmlns: "http://www.w3.org/2000/svg"
12192
+ }), title2 && /* @__PURE__ */ React.createElement("title", null, title2), props.children);
12193
+ };
12194
+ return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
12195
+ }
12196
+ function RiArrowDownLine(props) {
12197
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
12198
+ }
12199
+ function RiArrowUpLine(props) {
12200
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
12201
+ }
12202
+ function RiCalendarLine(props) {
12203
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
12204
+ }
12205
+ function RiQrCodeLine(props) {
12206
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
12207
+ }
12208
+ function RiFileCopyLine(props) {
12209
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
12210
+ }
12211
+ function RiAlignJustify(props) {
12212
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
12213
+ }
12214
+ function RiHashtag(props) {
12215
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
12216
+ }
12217
+ function RiInputField(props) {
12218
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
12219
+ }
12220
+ function RiListCheck(props) {
12221
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
12222
+ }
12223
+ function RiImageLine(props) {
12224
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
12225
+ }
12226
+ function RiCheckboxCircleLine(props) {
12227
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
12228
+ }
12229
+ function RiCheckboxLine(props) {
12230
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
12231
+ }
12232
+ function RiDeleteBin2Line(props) {
12233
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
12234
+ }
12235
+ function RiMenuFoldLine(props) {
12236
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
12237
+ }
12238
+ function RiUpload2Line(props) {
12239
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
12240
+ }
12241
+ const emptyBooleanField = {
12242
+ ...emptyBaseField,
12243
+ type: "boolean"
12244
+ };
12245
+ const _BooleanField = class _BooleanField extends BaseField {
12246
+ constructor(options) {
12247
+ super({ ...options, type: "boolean" });
12248
+ __publicField(this, "onlyValidateAfterTouched", false);
12249
+ }
12250
+ // if a BooleanField is required, `false` is considered blank
12251
+ isBlank(value) {
12252
+ return this.required && !value;
12253
+ }
12254
+ getValueFromChangeEvent(event) {
12255
+ if (typeof event === "boolean")
12256
+ return event;
12257
+ return event.target.checked;
12258
+ }
12259
+ serialize() {
12260
+ return super._serialize();
12261
+ }
12262
+ static deserialize(data) {
12263
+ if (data.type !== "boolean")
12264
+ throw new Error("Type mismatch.");
12265
+ return new _BooleanField(data);
12266
+ }
12267
+ getInput(props) {
12268
+ return /* @__PURE__ */ jsxRuntime.jsx(BooleanInput, { ...props, field: this });
12269
+ }
12270
+ };
12271
+ __publicField(_BooleanField, "fieldTypeName", "Checkbox");
12272
+ __publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
12273
+ __publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
12274
+ let BooleanField = _BooleanField;
12238
12275
  const NumberInput = React.memo((props) => {
12239
12276
  const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12240
12277
  let [{ helpText, label }] = useFormikInput(props);
@@ -13340,7 +13377,7 @@ var __publicField = (obj, key, value) => {
13340
13377
  ] }),
13341
13378
  value && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "jade", size: "1", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
13342
13379
  ] }),
13343
- value && /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
13380
+ !!value && /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
13344
13381
  /* @__PURE__ */ jsxRuntime.jsx(Code, { color: "gray", highContrast: true, children: value }),
13345
13382
  /* @__PURE__ */ jsxRuntime.jsx(
13346
13383
  blocks.IconButton,
@@ -13380,9 +13417,7 @@ var __publicField = (obj, key, value) => {
13380
13417
  }
13381
13418
  );
13382
13419
  setIsScannerLoading(true);
13383
- qrScanner.start().then(() => {
13384
- setIsScannerLoading(false);
13385
- }).catch(() => {
13420
+ void qrScanner.start().finally(() => {
13386
13421
  setIsScannerLoading(false);
13387
13422
  });
13388
13423
  }, [onQrScan]);
@@ -16543,7 +16578,7 @@ var __publicField = (obj, key, value) => {
16543
16578
  }, Symbol.toStringTag, { value: "Module" }));
16544
16579
  exports2.APIError = APIError;
16545
16580
  exports2.AgentService = AgentService;
16546
- exports2.AttachmentService = AttachmentService;
16581
+ exports2.AttachmentModel = AttachmentModel;
16547
16582
  exports2.AuthService = AuthService;
16548
16583
  exports2.BaseApiService = BaseApiService;
16549
16584
  exports2.BaseField = BaseField;
@@ -16554,15 +16589,18 @@ var __publicField = (obj, key, value) => {
16554
16589
  exports2.ColorPicker = ColorPicker;
16555
16590
  exports2.Colors = Colors;
16556
16591
  exports2.ColorsToString = ColorsToString;
16592
+ exports2.ComponentAttachmentService = ComponentAttachmentService;
16557
16593
  exports2.ComponentService = ComponentService;
16558
16594
  exports2.ComponentStageColors = ComponentStageColors;
16559
16595
  exports2.ComponentStageCompletionService = ComponentStageCompletionService;
16560
16596
  exports2.ComponentStageService = ComponentStageService;
16597
+ exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
16561
16598
  exports2.ComponentTypeService = ComponentTypeService;
16562
16599
  exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
16563
16600
  exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
16564
16601
  exports2.DateField = DateField;
16565
16602
  exports2.DateInput = DateInput;
16603
+ exports2.DocumentAttachmentService = DocumentAttachmentService;
16566
16604
  exports2.DocumentService = DocumentService;
16567
16605
  exports2.EmailDomainsService = EmailDomainsService;
16568
16606
  exports2.EmailVerificationService = EmailVerificationService;
@@ -16586,6 +16624,7 @@ var __publicField = (obj, key, value) => {
16586
16624
  exports2.InputWithHelpText = InputWithHelpText;
16587
16625
  exports2.InputWithLabel = InputWithLabel;
16588
16626
  exports2.InputWithLabelAndHelpText = InputWithLabelAndHelpText;
16627
+ exports2.IssueAttachmentService = IssueAttachmentService;
16589
16628
  exports2.IssueCommentService = IssueCommentService;
16590
16629
  exports2.IssuePriority = IssuePriority;
16591
16630
  exports2.IssueService = IssueService;
@@ -16618,6 +16657,7 @@ var __publicField = (obj, key, value) => {
16618
16657
  exports2.PatchFormProvider = PatchFormProvider;
16619
16658
  exports2.ProjectAccessLevel = ProjectAccessLevel;
16620
16659
  exports2.ProjectAccessService = ProjectAccessService;
16660
+ exports2.ProjectAttachmentService = ProjectAttachmentService;
16621
16661
  exports2.ProjectFileService = ProjectFileService;
16622
16662
  exports2.ProjectService = ProjectService;
16623
16663
  exports2.ProjectType = ProjectType;
@@ -16655,7 +16695,6 @@ var __publicField = (obj, key, value) => {
16655
16695
  exports2.addComponentTypeAttachment = addComponentTypeAttachment;
16656
16696
  exports2.addComponentTypeAttachments = addComponentTypeAttachments;
16657
16697
  exports2.addComponentsInBatches = addComponentsInBatches;
16658
- exports2.addConversation = addConversation;
16659
16698
  exports2.addDocumentAttachment = addDocumentAttachment;
16660
16699
  exports2.addDocumentAttachments = addDocumentAttachments;
16661
16700
  exports2.addDocuments = addDocuments;
@@ -16696,8 +16735,6 @@ var __publicField = (obj, key, value) => {
16696
16735
  exports2.addToRecentIssues = addToRecentIssues;
16697
16736
  exports2.addUsers = addUsers;
16698
16737
  exports2.addWorkspace = addWorkspace;
16699
- exports2.agentsReducer = agentsReducer;
16700
- exports2.agentsSlice = agentsSlice;
16701
16738
  exports2.areArraysEqual = areArraysEqual;
16702
16739
  exports2.authReducer = authReducer;
16703
16740
  exports2.authSlice = authSlice;
@@ -16724,7 +16761,6 @@ var __publicField = (obj, key, value) => {
16724
16761
  exports2.coordinatesToUrlText = coordinatesToUrlText;
16725
16762
  exports2.createOfflineAction = createOfflineAction;
16726
16763
  exports2.createPointMarker = createPointMarker;
16727
- exports2.createSelectorWithArgs = createSelectorWithArgs;
16728
16764
  exports2.defaultBadgeColor = defaultBadgeColor;
16729
16765
  exports2.defaultStore = defaultStore;
16730
16766
  exports2.deleteComponentType = deleteComponentType;
@@ -16852,6 +16888,7 @@ var __publicField = (obj, key, value) => {
16852
16888
  exports2.removeFavouriteProjectId = removeFavouriteProjectId;
16853
16889
  exports2.removeIssue = removeIssue;
16854
16890
  exports2.removeIssueAttachment = removeIssueAttachment;
16891
+ exports2.removeIssueAttachments = removeIssueAttachments;
16855
16892
  exports2.removeIssueComment = removeIssueComment;
16856
16893
  exports2.removeIssueComments = removeIssueComments;
16857
16894
  exports2.removeIssueType = removeIssueType;
@@ -16939,9 +16976,6 @@ var __publicField = (obj, key, value) => {
16939
16976
  exports2.selectComponentsByType = selectComponentsByType;
16940
16977
  exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
16941
16978
  exports2.selectComponentsMapping = selectComponentsMapping;
16942
- exports2.selectConversation = selectConversation;
16943
- exports2.selectConversationMapping = selectConversationMapping;
16944
- exports2.selectConversations = selectConversations;
16945
16979
  exports2.selectCreateProjectType = selectCreateProjectType;
16946
16980
  exports2.selectCurrentUser = selectCurrentUser;
16947
16981
  exports2.selectDeletedRequests = selectDeletedRequests;
@@ -17029,6 +17063,7 @@ var __publicField = (obj, key, value) => {
17029
17063
  exports2.selectProjectAccessForUser = selectProjectAccessForUser;
17030
17064
  exports2.selectProjectAccessUserMapping = selectProjectAccessUserMapping;
17031
17065
  exports2.selectProjectAccesses = selectProjectAccesses;
17066
+ exports2.selectProjectAttachment = selectProjectAttachment;
17032
17067
  exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
17033
17068
  exports2.selectProjectFileVisibility = selectProjectFileVisibility;
17034
17069
  exports2.selectProjectFiles = selectProjectFiles;
@@ -17078,14 +17113,15 @@ var __publicField = (obj, key, value) => {
17078
17113
  exports2.setAppearance = setAppearance;
17079
17114
  exports2.setCategories = setCategories;
17080
17115
  exports2.setCenterMapToProject = setCenterMapToProject;
17116
+ exports2.setComponentAttachment = setComponentAttachment;
17081
17117
  exports2.setComponentAttachments = setComponentAttachments;
17118
+ exports2.setComponentTypeAttachment = setComponentTypeAttachment;
17082
17119
  exports2.setComponentTypeAttachments = setComponentTypeAttachments;
17083
17120
  exports2.setComponentTypes = setComponentTypes;
17084
17121
  exports2.setComponents = setComponents;
17085
- exports2.setConversation = setConversation;
17086
- exports2.setConversations = setConversations;
17087
17122
  exports2.setCreateProjectType = setCreateProjectType;
17088
17123
  exports2.setCurrentUser = setCurrentUser;
17124
+ exports2.setDocumentAttachment = setDocumentAttachment;
17089
17125
  exports2.setDocumentAttachments = setDocumentAttachments;
17090
17126
  exports2.setDocuments = setDocuments;
17091
17127
  exports2.setEmailDomains = setEmailDomains;
@@ -17102,6 +17138,7 @@ var __publicField = (obj, key, value) => {
17102
17138
  exports2.setIsFetchingInitialData = setIsFetchingInitialData;
17103
17139
  exports2.setIsImportingProjectFile = setIsImportingProjectFile;
17104
17140
  exports2.setIsLoading = setIsLoading;
17141
+ exports2.setIssueAttachment = setIssueAttachment;
17105
17142
  exports2.setIssueAttachments = setIssueAttachments;
17106
17143
  exports2.setIssueComment = setIssueComment;
17107
17144
  exports2.setIssueComments = setIssueComments;
@@ -17116,6 +17153,7 @@ var __publicField = (obj, key, value) => {
17116
17153
  exports2.setOrganizations = setOrganizations;
17117
17154
  exports2.setProfilePicture = setProfilePicture;
17118
17155
  exports2.setProjectAccesses = setProjectAccesses;
17156
+ exports2.setProjectAttachment = setProjectAttachment;
17119
17157
  exports2.setProjectAttachments = setProjectAttachments;
17120
17158
  exports2.setProjectFileVisible = setProjectFileVisible;
17121
17159
  exports2.setProjects = setProjects;
@@ -17150,20 +17188,25 @@ var __publicField = (obj, key, value) => {
17150
17188
  exports2.updateActiveOrganization = updateActiveOrganization;
17151
17189
  exports2.updateComponent = updateComponent;
17152
17190
  exports2.updateComponentAttachment = updateComponentAttachment;
17191
+ exports2.updateComponentAttachments = updateComponentAttachments;
17153
17192
  exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
17193
+ exports2.updateComponentTypeAttachments = updateComponentTypeAttachments;
17154
17194
  exports2.updateDocumentAttachment = updateDocumentAttachment;
17195
+ exports2.updateDocumentAttachments = updateDocumentAttachments;
17155
17196
  exports2.updateDocuments = updateDocuments;
17156
17197
  exports2.updateFormSubmission = updateFormSubmission;
17157
17198
  exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
17158
17199
  exports2.updateFormSubmissions = updateFormSubmissions;
17159
17200
  exports2.updateIssue = updateIssue;
17160
17201
  exports2.updateIssueAttachment = updateIssueAttachment;
17202
+ exports2.updateIssueAttachments = updateIssueAttachments;
17161
17203
  exports2.updateIssueType = updateIssueType;
17162
17204
  exports2.updateLicense = updateLicense;
17163
17205
  exports2.updateOrCreateProject = updateOrCreateProject;
17164
17206
  exports2.updateOrganizationAccess = updateOrganizationAccess;
17165
17207
  exports2.updateProjectAccess = updateProjectAccess;
17166
17208
  exports2.updateProjectAttachment = updateProjectAttachment;
17209
+ exports2.updateProjectAttachments = updateProjectAttachments;
17167
17210
  exports2.updateStages = updateStages;
17168
17211
  exports2.updateTeam = updateTeam;
17169
17212
  exports2.useAppDispatch = useAppDispatch;