@overmap-ai/core 1.0.53-team-links.1 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/overmap-core.js +1360 -1742
  2. package/dist/overmap-core.js.map +1 -1
  3. package/dist/overmap-core.umd.cjs +1363 -1745
  4. package/dist/overmap-core.umd.cjs.map +1 -1
  5. package/dist/sdk/sdk.d.ts +6 -7
  6. package/dist/sdk/services/AgentService.d.ts +1 -1
  7. package/dist/sdk/services/BaseAttachmentService.d.ts +31 -0
  8. package/dist/sdk/services/ComponentAttachmentService.d.ts +10 -0
  9. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +10 -0
  10. package/dist/sdk/services/DocumentAttachmentService.d.ts +10 -0
  11. package/dist/sdk/services/IssueAttachmentService.d.ts +10 -0
  12. package/dist/sdk/services/IssueService.d.ts +1 -1
  13. package/dist/sdk/services/ProjectAttachmentService.d.ts +10 -0
  14. package/dist/sdk/services/index.d.ts +5 -2
  15. package/dist/store/slices/categorySlice.d.ts +0 -3
  16. package/dist/store/slices/componentSlice.d.ts +15 -7
  17. package/dist/store/slices/componentTypeSlice.d.ts +16 -8
  18. package/dist/store/slices/documentSlice.d.ts +10 -5
  19. package/dist/store/slices/formRevisionSlice.d.ts +30 -33
  20. package/dist/store/slices/index.d.ts +0 -3
  21. package/dist/store/slices/issueSlice.d.ts +33 -24
  22. package/dist/store/slices/projectFileSlice.d.ts +0 -3
  23. package/dist/store/slices/projectSlice.d.ts +12 -3
  24. package/dist/store/slices/utils.d.ts +3 -2
  25. package/dist/store/slices/workspaceSlice.d.ts +0 -3
  26. package/dist/store/store.d.ts +1 -10
  27. package/dist/typings/models/attachments.d.ts +7 -0
  28. package/dist/typings/models/base.d.ts +0 -5
  29. package/dist/typings/models/projects.d.ts +4 -5
  30. package/dist/typings/models/teams.d.ts +0 -15
  31. package/package.json +1 -1
  32. package/dist/sdk/services/AttachmentService.d.ts +0 -46
  33. package/dist/sdk/services/DocumentTeamLinkService.d.ts +0 -8
  34. package/dist/sdk/services/IssueTypeTeamLinkService.d.ts +0 -8
  35. package/dist/sdk/services/UserFormTeamLinkService.d.ts +0 -8
  36. package/dist/store/slices/documentTeamLinkSlice.d.ts +0 -20
  37. package/dist/store/slices/issueTypeTeamLinkSlice.d.ts +0 -20
  38. package/dist/store/slices/userFormTeamLinkSlice.d.ts +0 -20
@@ -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$u = {
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$u,
679
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
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;
@@ -1420,7 +1420,7 @@ var __publicField = (obj, key, value) => {
1420
1420
  return getLocalDateString(date);
1421
1421
  return relative.format(days, "days");
1422
1422
  });
1423
- const initialState$t = {
1423
+ const initialState$q = {
1424
1424
  categories: {},
1425
1425
  usedCategoryColors: [],
1426
1426
  categoryVisibility: {
@@ -1430,8 +1430,8 @@ var __publicField = (obj, key, value) => {
1430
1430
  };
1431
1431
  const categorySlice = toolkit.createSlice({
1432
1432
  name: "categories",
1433
- initialState: initialState$t,
1434
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
1433
+ initialState: initialState$q,
1434
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1435
1435
  reducers: {
1436
1436
  setCategories: (state, action) => {
1437
1437
  if (!Array.isArray(action.payload))
@@ -1567,6 +1567,9 @@ var __publicField = (obj, key, value) => {
1567
1567
  return Object.values(state.issueReducer.issues).filter((issue) => issue.category === categoryId).length;
1568
1568
  };
1569
1569
  const categoryReducer = categorySlice.reducer;
1570
+ function setAttachment(state, action) {
1571
+ state.attachments[action.payload.offline_id] = action.payload;
1572
+ }
1570
1573
  function setAttachments(state, action) {
1571
1574
  state.attachments = {};
1572
1575
  for (const attachment of action.payload) {
@@ -1591,6 +1594,15 @@ var __publicField = (obj, key, value) => {
1591
1594
  throw new Error(`Attachment ${action.payload.offline_id} does not exist.`);
1592
1595
  }
1593
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
+ }
1594
1606
  function removeAttachment(state, action) {
1595
1607
  if (action.payload in state.attachments) {
1596
1608
  delete state.attachments[action.payload];
@@ -1603,14 +1615,14 @@ var __publicField = (obj, key, value) => {
1603
1615
  delete state.attachments[attachmentId];
1604
1616
  }
1605
1617
  }
1606
- const initialState$s = {
1618
+ const initialState$p = {
1607
1619
  components: {},
1608
1620
  attachments: {}
1609
1621
  };
1610
1622
  const componentSlice = toolkit.createSlice({
1611
1623
  name: "components",
1612
- initialState: initialState$s,
1613
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
1624
+ initialState: initialState$p,
1625
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1614
1626
  reducers: {
1615
1627
  addComponent: (state, action) => {
1616
1628
  state.components[action.payload.offline_id] = action.payload;
@@ -1624,12 +1636,6 @@ var __publicField = (obj, key, value) => {
1624
1636
  state.components = toOfflineIdRecord(action.payload);
1625
1637
  prevComponents = null;
1626
1638
  },
1627
- setComponentAttachments: setAttachments,
1628
- addComponentAttachment: addAttachment,
1629
- addComponentAttachments: addAttachments,
1630
- updateComponentAttachment: updateAttachment,
1631
- removeComponentAttachment: removeAttachment,
1632
- removeComponentAttachments: removeAttachments,
1633
1639
  updateComponent: (state, action) => {
1634
1640
  if (action.payload.offline_id in state.components) {
1635
1641
  state.components[action.payload.offline_id] = action.payload;
@@ -1654,9 +1660,35 @@ var __publicField = (obj, key, value) => {
1654
1660
  }
1655
1661
  }
1656
1662
  prevComponents = null;
1657
- }
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
1658
1673
  }
1659
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;
1660
1692
  let prevComponents = null;
1661
1693
  const selectComponents = (state) => {
1662
1694
  if (!prevComponents) {
@@ -1751,28 +1783,14 @@ var __publicField = (obj, key, value) => {
1751
1783
  }
1752
1784
  )
1753
1785
  );
1754
- const {
1755
- addComponent,
1756
- updateComponent,
1757
- removeComponent,
1758
- addComponentsInBatches,
1759
- setComponents,
1760
- setComponentAttachments,
1761
- addComponentAttachment,
1762
- addComponentAttachments,
1763
- updateComponentAttachment,
1764
- removeComponentAttachment,
1765
- removeComponentAttachments,
1766
- removeAllComponentsOfType
1767
- } = componentSlice.actions;
1768
1786
  const componentReducer = componentSlice.reducer;
1769
- const initialState$r = {
1787
+ const initialState$o = {
1770
1788
  completionsByComponentId: {}
1771
1789
  };
1772
1790
  const componentStageCompletionSlice = toolkit.createSlice({
1773
1791
  name: "componentStageCompletions",
1774
- initialState: initialState$r,
1775
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
1792
+ initialState: initialState$o,
1793
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1776
1794
  reducers: {
1777
1795
  addStageCompletion: (state, action) => {
1778
1796
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1823,13 +1841,13 @@ var __publicField = (obj, key, value) => {
1823
1841
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1824
1842
  };
1825
1843
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1826
- const initialState$q = {
1844
+ const initialState$n = {
1827
1845
  stages: {}
1828
1846
  };
1829
1847
  const componentStageSlice = toolkit.createSlice({
1830
1848
  name: "componentStages",
1831
- initialState: initialState$q,
1832
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1849
+ initialState: initialState$n,
1850
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1833
1851
  reducers: {
1834
1852
  addStages: (state, action) => {
1835
1853
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1939,15 +1957,15 @@ var __publicField = (obj, key, value) => {
1939
1957
  );
1940
1958
  const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1941
1959
  const componentStageReducer = componentStageSlice.reducer;
1942
- const initialState$p = {
1960
+ const initialState$m = {
1943
1961
  componentTypes: {},
1944
1962
  hiddenComponentTypeIds: {},
1945
1963
  attachments: {}
1946
1964
  };
1947
1965
  const componentTypeSlice = toolkit.createSlice({
1948
1966
  name: "componentTypes",
1949
- initialState: initialState$p,
1950
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1967
+ initialState: initialState$m,
1968
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1951
1969
  reducers: {
1952
1970
  addComponentType: (state, action) => {
1953
1971
  state.componentTypes[action.payload.offline_id] = action.payload;
@@ -1955,20 +1973,38 @@ var __publicField = (obj, key, value) => {
1955
1973
  setComponentTypes: (state, action) => {
1956
1974
  state.componentTypes = toOfflineIdRecord(action.payload);
1957
1975
  },
1958
- setComponentTypeAttachments: setAttachments,
1959
- addComponentTypeAttachment: addAttachment,
1960
- addComponentTypeAttachments: addAttachments,
1961
- updateComponentTypeAttachment: updateAttachment,
1962
- removeComponentTypeAttachment: removeAttachment,
1963
- removeComponentTypeAttachments: removeAttachments,
1964
1976
  toggleComponentTypeVisibility: (state, action) => {
1965
1977
  state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1966
1978
  },
1967
1979
  deleteComponentType: (state, action) => {
1968
1980
  delete state.componentTypes[action.payload];
1969
- }
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
1970
1991
  }
1971
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;
1972
2008
  const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
1973
2009
  const selectComponentTypes = toolkit.createSelector(
1974
2010
  [selectComponentTypesMapping],
@@ -2045,26 +2081,14 @@ var __publicField = (obj, key, value) => {
2045
2081
  }
2046
2082
  )
2047
2083
  );
2048
- const {
2049
- addComponentType,
2050
- setComponentTypes,
2051
- setComponentTypeAttachments,
2052
- addComponentTypeAttachment,
2053
- addComponentTypeAttachments,
2054
- updateComponentTypeAttachment,
2055
- removeComponentTypeAttachment,
2056
- removeComponentTypeAttachments,
2057
- toggleComponentTypeVisibility,
2058
- deleteComponentType
2059
- } = componentTypeSlice.actions;
2060
2084
  const componentTypeReducer = componentTypeSlice.reducer;
2061
- const initialState$o = {
2085
+ const initialState$l = {
2062
2086
  workspaces: {},
2063
2087
  activeWorkspaceId: null
2064
2088
  };
2065
2089
  const workspaceSlice = toolkit.createSlice({
2066
2090
  name: "workspace",
2067
- initialState: initialState$o,
2091
+ initialState: initialState$l,
2068
2092
  // The `reducers` field lets us define reducers and generate associated actions
2069
2093
  reducers: {
2070
2094
  setWorkspaces: (state, action) => {
@@ -2121,7 +2145,7 @@ var __publicField = (obj, key, value) => {
2121
2145
  );
2122
2146
  const workspaceReducer = workspaceSlice.reducer;
2123
2147
  const maxRecentIssues = 10;
2124
- const initialState$n = {
2148
+ const initialState$k = {
2125
2149
  issues: {},
2126
2150
  attachments: {},
2127
2151
  comments: {},
@@ -2133,9 +2157,9 @@ var __publicField = (obj, key, value) => {
2133
2157
  };
2134
2158
  const issueSlice = toolkit.createSlice({
2135
2159
  name: "issues",
2136
- initialState: initialState$n,
2160
+ initialState: initialState$k,
2137
2161
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2138
- Object.assign(state, initialState$n);
2162
+ Object.assign(state, initialState$k);
2139
2163
  }),
2140
2164
  reducers: {
2141
2165
  setIssues: (state, action) => {
@@ -2146,7 +2170,6 @@ var __publicField = (obj, key, value) => {
2146
2170
  state.issues[issue.offline_id] = issue;
2147
2171
  });
2148
2172
  },
2149
- setIssueAttachments: setAttachments,
2150
2173
  setIssueUpdates: (state, action) => {
2151
2174
  if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
2152
2175
  throw new Error("Tried to use setIssues reducer with duplicate ID's");
@@ -2176,8 +2199,6 @@ var __publicField = (obj, key, value) => {
2176
2199
  state.issues[issue.offline_id] = issue;
2177
2200
  }
2178
2201
  },
2179
- addIssueAttachment: addAttachment,
2180
- addIssueAttachments: addAttachments,
2181
2202
  addIssueUpdate: (state, action) => {
2182
2203
  if (action.payload.offline_id in state.updates) {
2183
2204
  throw new Error(`Tried to add duplicate issue update with offline_id: ${action.payload.offline_id}`);
@@ -2199,7 +2220,6 @@ var __publicField = (obj, key, value) => {
2199
2220
  throw new Error(`Tried to update issue with ID that doesn't exist: ${action.payload.offline_id}`);
2200
2221
  }
2201
2222
  },
2202
- updateIssueAttachment: updateAttachment,
2203
2223
  removeIssue: (state, action) => {
2204
2224
  if (action.payload in state.issues) {
2205
2225
  delete state.issues[action.payload];
@@ -2212,7 +2232,6 @@ var __publicField = (obj, key, value) => {
2212
2232
  delete state.issues[issueId];
2213
2233
  }
2214
2234
  },
2215
- removeIssueAttachment: removeAttachment,
2216
2235
  removeIssueUpdate: (state, action) => {
2217
2236
  if (action.payload in state.updates) {
2218
2237
  delete state.updates[action.payload];
@@ -2309,12 +2328,19 @@ var __publicField = (obj, key, value) => {
2309
2328
  if (indexToRemove !== -1) {
2310
2329
  state.recentIssueIds.splice(indexToRemove, 1);
2311
2330
  }
2312
- }
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
2313
2341
  }
2314
2342
  });
2315
2343
  const {
2316
- addIssueAttachment,
2317
- addIssueAttachments,
2318
2344
  addIssue,
2319
2345
  addIssues,
2320
2346
  addIssueUpdate,
@@ -2322,7 +2348,6 @@ var __publicField = (obj, key, value) => {
2322
2348
  addOrReplaceIssueComment,
2323
2349
  addToRecentIssues,
2324
2350
  cleanRecentIssues,
2325
- removeIssueAttachment,
2326
2351
  removeAttachmentsOfIssue,
2327
2352
  removeIssue,
2328
2353
  removeIssues,
@@ -2331,13 +2356,20 @@ var __publicField = (obj, key, value) => {
2331
2356
  removeRecentIssue,
2332
2357
  resetRecentIssues,
2333
2358
  setActiveIssueId,
2334
- setIssueAttachments,
2335
2359
  setIssueUpdates,
2336
2360
  setIssues,
2337
2361
  setVisibleStatuses,
2338
2362
  setVisibleUserIds,
2339
- updateIssueAttachment,
2340
2363
  updateIssue,
2364
+ // Attachments
2365
+ setIssueAttachment,
2366
+ setIssueAttachments,
2367
+ addIssueAttachment,
2368
+ addIssueAttachments,
2369
+ updateIssueAttachment,
2370
+ updateIssueAttachments,
2371
+ removeIssueAttachment,
2372
+ removeIssueAttachments,
2341
2373
  // Commments
2342
2374
  addIssueComment,
2343
2375
  addIssueComments,
@@ -2560,14 +2592,14 @@ var __publicField = (obj, key, value) => {
2560
2592
  }
2561
2593
  );
2562
2594
  const issueReducer = issueSlice.reducer;
2563
- const initialState$m = {
2595
+ const initialState$j = {
2564
2596
  issueTypes: {}
2565
2597
  };
2566
2598
  const issueTypeSlice = toolkit.createSlice({
2567
2599
  name: "issueTypes",
2568
- initialState: initialState$m,
2600
+ initialState: initialState$j,
2569
2601
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2570
- Object.assign(state, initialState$m);
2602
+ Object.assign(state, initialState$j);
2571
2603
  }),
2572
2604
  reducers: {
2573
2605
  setIssueTypes: (state, action) => {
@@ -2634,15 +2666,15 @@ var __publicField = (obj, key, value) => {
2634
2666
  return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
2635
2667
  };
2636
2668
  const issueTypeReducer = issueTypeSlice.reducer;
2637
- const initialState$l = {
2669
+ const initialState$i = {
2638
2670
  s3Urls: {}
2639
2671
  };
2640
2672
  const msPerHour = 1e3 * 60 * 60;
2641
2673
  const msPerWeek = msPerHour * 24 * 7;
2642
2674
  const fileSlice = toolkit.createSlice({
2643
2675
  name: "file",
2644
- initialState: initialState$l,
2645
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
2676
+ initialState: initialState$i,
2677
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2646
2678
  reducers: {
2647
2679
  setUploadUrl: (state, action) => {
2648
2680
  const { url, fields, sha1 } = action.payload;
@@ -2669,7 +2701,7 @@ var __publicField = (obj, key, value) => {
2669
2701
  return url;
2670
2702
  };
2671
2703
  const fileReducer = fileSlice.reducer;
2672
- const initialState$k = {
2704
+ const initialState$h = {
2673
2705
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2674
2706
  mapStyle: MapStyle.SATELLITE,
2675
2707
  showTooltips: false,
@@ -2677,8 +2709,8 @@ var __publicField = (obj, key, value) => {
2677
2709
  };
2678
2710
  const mapSlice = toolkit.createSlice({
2679
2711
  name: "map",
2680
- initialState: initialState$k,
2681
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
2712
+ initialState: initialState$h,
2713
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2682
2714
  reducers: {
2683
2715
  setMapStyle: (state, action) => {
2684
2716
  state.mapStyle = action.payload;
@@ -2706,6 +2738,14 @@ var __publicField = (obj, key, value) => {
2706
2738
  OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
2707
2739
  return OrganizationAccessLevel2;
2708
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 || {});
2709
2749
  var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
2710
2750
  IssueUpdateChange2["STATUS"] = "status";
2711
2751
  IssueUpdateChange2["PRIORITY"] = "priority";
@@ -2747,7 +2787,7 @@ var __publicField = (obj, key, value) => {
2747
2787
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
2748
2788
  return LicenseStatus2;
2749
2789
  })(LicenseStatus || {});
2750
- const initialState$j = {
2790
+ const initialState$g = {
2751
2791
  users: {},
2752
2792
  currentUser: {
2753
2793
  id: 0,
@@ -2758,8 +2798,8 @@ var __publicField = (obj, key, value) => {
2758
2798
  };
2759
2799
  const userSlice = toolkit.createSlice({
2760
2800
  name: "users",
2761
- initialState: initialState$j,
2762
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
2801
+ initialState: initialState$g,
2802
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2763
2803
  reducers: {
2764
2804
  setUsers: (state, action) => {
2765
2805
  const usersMapping = {};
@@ -2821,13 +2861,13 @@ var __publicField = (obj, key, value) => {
2821
2861
  const selectUsersAsMapping = (state) => state.userReducer.users;
2822
2862
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2823
2863
  const userReducer = userSlice.reducer;
2824
- const initialState$i = {
2864
+ const initialState$f = {
2825
2865
  organizationAccesses: {}
2826
2866
  };
2827
2867
  const organizationAccessSlice = toolkit.createSlice({
2828
2868
  name: "organizationAccess",
2829
- initialState: initialState$i,
2830
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2869
+ initialState: initialState$f,
2870
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2831
2871
  reducers: {
2832
2872
  setOrganizationAccesses: (state, action) => {
2833
2873
  if (!Array.isArray(action.payload))
@@ -2890,13 +2930,13 @@ var __publicField = (obj, key, value) => {
2890
2930
  return organizationAccesses;
2891
2931
  };
2892
2932
  const organizationAccessReducer = organizationAccessSlice.reducer;
2893
- const initialState$h = {
2933
+ const initialState$e = {
2894
2934
  licenses: {}
2895
2935
  };
2896
2936
  const licenseSlice = toolkit.createSlice({
2897
2937
  name: "license",
2898
- initialState: initialState$h,
2899
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2938
+ initialState: initialState$e,
2939
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2900
2940
  reducers: {
2901
2941
  setLicenses: (state, action) => {
2902
2942
  if (!Array.isArray(action.payload))
@@ -2941,13 +2981,13 @@ var __publicField = (obj, key, value) => {
2941
2981
  (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2942
2982
  );
2943
2983
  const licenseReducer = licenseSlice.reducer;
2944
- const initialState$g = {
2984
+ const initialState$d = {
2945
2985
  projectAccesses: {}
2946
2986
  };
2947
2987
  const projectAccessSlice = toolkit.createSlice({
2948
2988
  name: "projectAccess",
2949
- initialState: initialState$g,
2950
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2989
+ initialState: initialState$d,
2990
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2951
2991
  reducers: {
2952
2992
  setProjectAccesses: (state, action) => {
2953
2993
  if (!Array.isArray(action.payload))
@@ -3015,7 +3055,7 @@ var __publicField = (obj, key, value) => {
3015
3055
  return projectAccesses;
3016
3056
  };
3017
3057
  const projectAccessReducer = projectAccessSlice.reducer;
3018
- const initialState$f = {
3058
+ const initialState$c = {
3019
3059
  projects: {},
3020
3060
  activeProjectId: null,
3021
3061
  recentProjectIds: [],
@@ -3025,7 +3065,7 @@ var __publicField = (obj, key, value) => {
3025
3065
  };
3026
3066
  const projectSlice = toolkit.createSlice({
3027
3067
  name: "projects",
3028
- initialState: initialState$f,
3068
+ initialState: initialState$c,
3029
3069
  reducers: {
3030
3070
  setProjects: (state, action) => {
3031
3071
  const projectsMap = {};
@@ -3093,11 +3133,13 @@ var __publicField = (obj, key, value) => {
3093
3133
  throw new Error("Update form submissions count: no active project");
3094
3134
  }
3095
3135
  },
3096
- // Attachment related
3136
+ // Attachments
3137
+ setProjectAttachment: setAttachment,
3097
3138
  setProjectAttachments: setAttachments,
3098
3139
  addProjectAttachment: addAttachment,
3099
3140
  addProjectAttachments: addAttachments,
3100
3141
  updateProjectAttachment: updateAttachment,
3142
+ updateProjectAttachments: updateAttachments,
3101
3143
  removeProjectAttachment: removeAttachment,
3102
3144
  removeProjectAttachments: removeAttachments
3103
3145
  }
@@ -3112,11 +3154,13 @@ var __publicField = (obj, key, value) => {
3112
3154
  acceptProjectInvite,
3113
3155
  addActiveProjectIssuesCount,
3114
3156
  addActiveProjectFormSubmissionsCount,
3115
- // Attachment related
3157
+ // Attachments
3158
+ setProjectAttachment,
3116
3159
  setProjectAttachments,
3117
3160
  addProjectAttachment,
3118
3161
  addProjectAttachments,
3119
3162
  updateProjectAttachment,
3163
+ updateProjectAttachments,
3120
3164
  removeProjectAttachment,
3121
3165
  removeProjectAttachments
3122
3166
  } = projectSlice.actions;
@@ -3187,6 +3231,9 @@ var __publicField = (obj, key, value) => {
3187
3231
  [selectProjectAttachmentMapping],
3188
3232
  (mapping) => Object.values(mapping)
3189
3233
  );
3234
+ const selectProjectAttachment = (attachmentId) => (state) => {
3235
+ return state.projectReducer.attachments[attachmentId];
3236
+ };
3190
3237
  const selectAttachmentsOfProject = restructureCreateSelectorWithArgs(
3191
3238
  toolkit.createSelector(
3192
3239
  [selectAllProjectAttachments, (_state, projectId) => projectId],
@@ -3212,14 +3259,14 @@ var __publicField = (obj, key, value) => {
3212
3259
  }
3213
3260
  )
3214
3261
  );
3215
- const initialState$e = {
3262
+ const initialState$b = {
3216
3263
  organizations: {},
3217
3264
  activeOrganizationId: null
3218
3265
  };
3219
3266
  const organizationSlice = toolkit.createSlice({
3220
3267
  name: "organizations",
3221
- initialState: initialState$e,
3222
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
3268
+ initialState: initialState$b,
3269
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3223
3270
  reducers: {
3224
3271
  setOrganizations: (state, action) => {
3225
3272
  for (const org of action.payload) {
@@ -3338,14 +3385,14 @@ var __publicField = (obj, key, value) => {
3338
3385
  }
3339
3386
  };
3340
3387
  };
3341
- const initialState$d = {
3388
+ const initialState$a = {
3342
3389
  deletedRequests: [],
3343
3390
  latestRetryTime: 0
3344
3391
  };
3345
3392
  const outboxSlice = toolkit.createSlice({
3346
3393
  name: "outbox",
3347
- initialState: initialState$d,
3348
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
3394
+ initialState: initialState$a,
3395
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3349
3396
  reducers: {
3350
3397
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
3351
3398
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -3377,7 +3424,7 @@ var __publicField = (obj, key, value) => {
3377
3424
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
3378
3425
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
3379
3426
  const outboxReducer = outboxSlice.reducer;
3380
- const initialState$c = {
3427
+ const initialState$9 = {
3381
3428
  projectFiles: {},
3382
3429
  activeProjectFileId: null,
3383
3430
  isImportingProjectFile: false,
@@ -3385,8 +3432,8 @@ var __publicField = (obj, key, value) => {
3385
3432
  };
3386
3433
  const projectFileSlice = toolkit.createSlice({
3387
3434
  name: "projectFiles",
3388
- initialState: initialState$c,
3389
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
3435
+ initialState: initialState$9,
3436
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3390
3437
  reducers: {
3391
3438
  addOrReplaceProjectFiles: (state, action) => {
3392
3439
  for (let fileObj of action.payload) {
@@ -3487,12 +3534,12 @@ var __publicField = (obj, key, value) => {
3487
3534
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
3488
3535
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
3489
3536
  const projectFileReducer = projectFileSlice.reducer;
3490
- const initialState$b = {
3537
+ const initialState$8 = {
3491
3538
  isRehydrated: false
3492
3539
  };
3493
3540
  const rehydratedSlice = toolkit.createSlice({
3494
3541
  name: "rehydrated",
3495
- initialState: initialState$b,
3542
+ initialState: initialState$8,
3496
3543
  // The `reducers` field lets us define reducers and generate associated actions
3497
3544
  reducers: {
3498
3545
  setRehydrated: (state, action) => {
@@ -3502,7 +3549,7 @@ var __publicField = (obj, key, value) => {
3502
3549
  });
3503
3550
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
3504
3551
  const rehydratedReducer = rehydratedSlice.reducer;
3505
- const initialState$a = {
3552
+ const initialState$7 = {
3506
3553
  useIssueTemplate: false,
3507
3554
  placementMode: false,
3508
3555
  enableClustering: false,
@@ -3519,8 +3566,8 @@ var __publicField = (obj, key, value) => {
3519
3566
  };
3520
3567
  const settingSlice = toolkit.createSlice({
3521
3568
  name: "settings",
3522
- initialState: initialState$a,
3523
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3569
+ initialState: initialState$7,
3570
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3524
3571
  reducers: {
3525
3572
  setEnableDuplicateIssues: (state, action) => {
3526
3573
  state.useIssueTemplate = action.payload;
@@ -3579,14 +3626,14 @@ var __publicField = (obj, key, value) => {
3579
3626
  return revisionA < revisionB ? -1 : 1;
3580
3627
  }
3581
3628
  };
3582
- const initialState$9 = {
3629
+ const initialState$6 = {
3583
3630
  formRevisions: {},
3584
3631
  attachments: {}
3585
3632
  };
3586
3633
  const formRevisionsSlice = toolkit.createSlice({
3587
3634
  name: "formRevisions",
3588
- initialState: initialState$9,
3589
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3635
+ initialState: initialState$6,
3636
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3590
3637
  reducers: {
3591
3638
  // revision related actions
3592
3639
  setFormRevision: (state, action) => {
@@ -3766,13 +3813,13 @@ var __publicField = (obj, key, value) => {
3766
3813
  )
3767
3814
  );
3768
3815
  const formRevisionReducer = formRevisionsSlice.reducer;
3769
- const initialState$8 = {
3816
+ const initialState$5 = {
3770
3817
  forms: {}
3771
3818
  };
3772
3819
  const formSlice = toolkit.createSlice({
3773
3820
  name: "forms",
3774
- initialState: initialState$8,
3775
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3821
+ initialState: initialState$5,
3822
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3776
3823
  reducers: {
3777
3824
  setForms: (state, action) => {
3778
3825
  state.forms = {};
@@ -3877,14 +3924,14 @@ var __publicField = (obj, key, value) => {
3877
3924
  return Object.values(userForms).filter((form) => !form.component_type).length;
3878
3925
  });
3879
3926
  const formReducer = formSlice.reducer;
3880
- const initialState$7 = {
3927
+ const initialState$4 = {
3881
3928
  formSubmissions: {},
3882
3929
  attachments: {}
3883
3930
  };
3884
3931
  const formSubmissionSlice = toolkit.createSlice({
3885
3932
  name: "formSubmissions",
3886
- initialState: initialState$7,
3887
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3933
+ initialState: initialState$4,
3934
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3888
3935
  reducers: {
3889
3936
  setFormSubmission: (state, action) => {
3890
3937
  state.formSubmissions[action.payload.offline_id] = action.payload;
@@ -4121,12 +4168,12 @@ var __publicField = (obj, key, value) => {
4121
4168
  )
4122
4169
  );
4123
4170
  const formSubmissionReducer = formSubmissionSlice.reducer;
4124
- const initialState$6 = {
4171
+ const initialState$3 = {
4125
4172
  emailDomains: {}
4126
4173
  };
4127
4174
  const emailDomainsSlice = toolkit.createSlice({
4128
4175
  name: "emailDomains",
4129
- initialState: initialState$6,
4176
+ initialState: initialState$3,
4130
4177
  reducers: {
4131
4178
  setEmailDomains: (state, action) => {
4132
4179
  const emailDomains = {};
@@ -4153,15 +4200,15 @@ var __publicField = (obj, key, value) => {
4153
4200
  (ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
4154
4201
  );
4155
4202
  const emailDomainsReducer = emailDomainsSlice.reducer;
4156
- const initialState$5 = {
4203
+ const initialState$2 = {
4157
4204
  documents: {},
4158
4205
  attachments: {}
4159
4206
  };
4160
4207
  const documentSlice = toolkit.createSlice({
4161
4208
  name: "documents",
4162
- initialState: initialState$5,
4209
+ initialState: initialState$2,
4163
4210
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
4164
- Object.assign(state, initialState$5);
4211
+ Object.assign(state, initialState$2);
4165
4212
  }),
4166
4213
  reducers: {
4167
4214
  setDocuments: (state, action) => {
@@ -4302,10 +4349,13 @@ var __publicField = (obj, key, value) => {
4302
4349
  delete state.documents[documentId];
4303
4350
  }
4304
4351
  },
4352
+ // Attachments
4353
+ setDocumentAttachment: setAttachment,
4305
4354
  setDocumentAttachments: setAttachments,
4306
4355
  addDocumentAttachment: addAttachment,
4307
4356
  addDocumentAttachments: addAttachments,
4308
4357
  updateDocumentAttachment: updateAttachment,
4358
+ updateDocumentAttachments: updateAttachments,
4309
4359
  removeDocumentAttachment: removeAttachment,
4310
4360
  removeDocumentAttachments: removeAttachments
4311
4361
  }
@@ -4316,10 +4366,13 @@ var __publicField = (obj, key, value) => {
4316
4366
  updateDocuments,
4317
4367
  moveDocument,
4318
4368
  removeDocuments,
4369
+ // Attachments
4370
+ setDocumentAttachment,
4319
4371
  setDocumentAttachments,
4320
4372
  addDocumentAttachment,
4321
4373
  addDocumentAttachments,
4322
4374
  updateDocumentAttachment,
4375
+ updateDocumentAttachments,
4323
4376
  removeDocumentAttachment,
4324
4377
  removeDocumentAttachments
4325
4378
  } = documentSlice.actions;
@@ -4386,13 +4439,13 @@ var __publicField = (obj, key, value) => {
4386
4439
  )
4387
4440
  );
4388
4441
  const documentsReducer = documentSlice.reducer;
4389
- const initialState$4 = {
4442
+ const initialState$1 = {
4390
4443
  teams: {}
4391
4444
  };
4392
4445
  const teamSlice = toolkit.createSlice({
4393
4446
  name: "teams",
4394
- initialState: initialState$4,
4395
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
4447
+ initialState: initialState$1,
4448
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4396
4449
  reducers: {
4397
4450
  setTeam: (state, action) => {
4398
4451
  state.teams[action.payload.offline_id] = action.payload;
@@ -4442,267 +4495,13 @@ var __publicField = (obj, key, value) => {
4442
4495
  })
4443
4496
  );
4444
4497
  const teamReducer = teamSlice.reducer;
4445
- const initialState$3 = {
4446
- documentTeamLinks: {}
4498
+ const initialState = {
4499
+ version: 0
4447
4500
  };
4448
- const documentTeamLinkSlice = toolkit.createSlice({
4449
- name: "documentTeamLink",
4450
- initialState: initialState$3,
4451
- extraReducers: (builder) => builder.addCase("RESET", (state) => {
4452
- Object.assign(state, initialState$3);
4453
- }),
4454
- reducers: {
4455
- setDocumentTeamLink: (state, action) => {
4456
- state.documentTeamLinks[action.payload.offline_id] = action.payload;
4457
- },
4458
- setDocumentTeamLinks: (state, action) => {
4459
- for (const documentTeamLink of action.payload) {
4460
- state.documentTeamLinks[documentTeamLink.offline_id] = documentTeamLink;
4461
- }
4462
- },
4463
- addDocumentTeamLink: (state, action) => {
4464
- if (action.payload.offline_id in state.documentTeamLinks) {
4465
- throw new Error(`DocumentTeamLink with offline_id ${action.payload.offline_id} already exists`);
4466
- }
4467
- state.documentTeamLinks[action.payload.offline_id] = action.payload;
4468
- },
4469
- deleteDocumentTeamLink: (state, action) => {
4470
- if (!(action.payload in state.documentTeamLinks)) {
4471
- throw new Error(`DocumentTeamLink with offline_id ${action.payload} does not exist`);
4472
- }
4473
- delete state.documentTeamLinks[action.payload];
4474
- },
4475
- deleteDocumentTeamLinks: (state, action) => {
4476
- for (const offlineId of action.payload) {
4477
- if (!(offlineId in state.documentTeamLinks)) {
4478
- throw new Error(`DocumentTeamLink with offline_id ${offlineId} does not exist`);
4479
- }
4480
- }
4481
- for (const offlineId of action.payload) {
4482
- delete state.documentTeamLinks[offlineId];
4483
- }
4484
- }
4485
- }
4486
- });
4487
- const {
4488
- setDocumentTeamLink,
4489
- setDocumentTeamLinks,
4490
- addDocumentTeamLink,
4491
- deleteDocumentTeamLink,
4492
- deleteDocumentTeamLinks
4493
- } = documentTeamLinkSlice.actions;
4494
- const selectDocumentTeamLinksMapping = (state) => state.documentTeamLinkReducer.documentTeamLinks;
4495
- const selectDocumentTeamLinks = (state) => Object.values(state.documentTeamLinkReducer.documentTeamLinks);
4496
- const selectDocumentTeamLinksOfDocument = restructureCreateSelectorWithArgs(
4497
- toolkit.createSelector(
4498
- [selectDocumentTeamLinks, (_, documentId) => documentId],
4499
- (documentTeamLinks, documentId) => {
4500
- return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.document === documentId);
4501
- }
4502
- )
4503
- );
4504
- const selectDocumentTeamLinksOfTeam = restructureCreateSelectorWithArgs(
4505
- toolkit.createSelector([selectDocumentTeamLinks, (_, teamId) => teamId], (documentTeamLinks, teamId) => {
4506
- return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.team === teamId);
4507
- })
4508
- );
4509
- const selectDocumentsLinkedToTeam = restructureCreateSelectorWithArgs(
4510
- toolkit.createSelector(
4511
- [
4512
- selectDocumentTeamLinks,
4513
- (state) => state.documentsReducer.documents,
4514
- (_, teamId) => teamId
4515
- ],
4516
- (documentTeamLinks, documents, teamId) => {
4517
- return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.team === teamId).map((documentTeamLink) => documents[documentTeamLink.document]).filter((document2) => !!document2);
4518
- }
4519
- )
4520
- );
4521
- const selectTeamsLinkedToDocument = restructureCreateSelectorWithArgs(
4522
- toolkit.createSelector(
4523
- [selectDocumentTeamLinks, (state) => state.teamReducer.teams, (_, documentId) => documentId],
4524
- (documentTeamLinks, teams, documentId) => {
4525
- return documentTeamLinks.filter((documentTeamLink) => documentTeamLink.document === documentId).map((documentTeamLink) => teams[documentTeamLink.team]).filter((team) => !!team);
4526
- }
4527
- )
4528
- );
4529
- const documentTeamLinkReducer = documentTeamLinkSlice.reducer;
4530
- const initialState$2 = {
4531
- issueTypeTeamLinks: {}
4532
- };
4533
- const issueTypeTeamLinkSlice = toolkit.createSlice({
4534
- name: "issueTypeTeamLink",
4535
- initialState: initialState$2,
4536
- extraReducers: (builder) => builder.addCase("RESET", (state) => {
4537
- Object.assign(state, initialState$2);
4538
- }),
4539
- reducers: {
4540
- setIssueTypeTeamLink: (state, action) => {
4541
- state.issueTypeTeamLinks[action.payload.offline_id] = action.payload;
4542
- },
4543
- setIssueTypeTeamLinks: (state, action) => {
4544
- state.issueTypeTeamLinks = {};
4545
- for (const issueTypeTeamLink of action.payload) {
4546
- state.issueTypeTeamLinks[issueTypeTeamLink.offline_id] = issueTypeTeamLink;
4547
- }
4548
- },
4549
- addIssueTypeTeamLink: (state, action) => {
4550
- if (action.payload.offline_id in state.issueTypeTeamLinks) {
4551
- throw new Error(`IssueTypeTeamLink with offline_id ${action.payload.offline_id} already exists`);
4552
- }
4553
- state.issueTypeTeamLinks[action.payload.offline_id] = action.payload;
4554
- },
4555
- deleteIssueTypeTeamLink: (state, action) => {
4556
- if (!(action.payload in state.issueTypeTeamLinks)) {
4557
- throw new Error(`IssueTypeTeamLink with offline_id ${action.payload} does not exist`);
4558
- }
4559
- delete state.issueTypeTeamLinks[action.payload];
4560
- },
4561
- deleteIssueTypeTeamLinks: (state, action) => {
4562
- for (const offlineId of action.payload) {
4563
- if (!(offlineId in state.issueTypeTeamLinks)) {
4564
- throw new Error(`IssueTypeTeamLink with offline_id ${offlineId} does not exist`);
4565
- }
4566
- }
4567
- for (const offlineId of action.payload) {
4568
- delete state.issueTypeTeamLinks[offlineId];
4569
- }
4570
- }
4571
- }
4572
- });
4573
- const {
4574
- setIssueTypeTeamLink,
4575
- setIssueTypeTeamLinks,
4576
- addIssueTypeTeamLink,
4577
- deleteIssueTypeTeamLink,
4578
- deleteIssueTypeTeamLinks
4579
- } = issueTypeTeamLinkSlice.actions;
4580
- const selectIssueTypeTeamLinkMapping = (state) => state.issueTypeTeamLinkReducer.issueTypeTeamLinks;
4581
- const selectIssueTypeTeamLinks = (state) => Object.values(state.issueTypeTeamLinkReducer.issueTypeTeamLinks);
4582
- const selectIssueTypeTeamLinksOfIssueType = restructureCreateSelectorWithArgs(
4583
- toolkit.createSelector(
4584
- [selectIssueTypeTeamLinks, (_, issueTypeId) => issueTypeId],
4585
- (issueTypeTeamLinks, issueTypeId) => {
4586
- return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.issue_type === issueTypeId);
4587
- }
4588
- )
4589
- );
4590
- const selectIssueTypeTeamLinksOfTeam = restructureCreateSelectorWithArgs(
4591
- toolkit.createSelector([selectIssueTypeTeamLinks, (_, teamId) => teamId], (issueTypeTeamLinks, teamId) => {
4592
- return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.team === teamId);
4593
- })
4594
- );
4595
- const selectIssueTypesLinkedToTeam = restructureCreateSelectorWithArgs(
4596
- toolkit.createSelector(
4597
- [
4598
- selectIssueTypeTeamLinks,
4599
- (state) => state.issueTypeReducer.issueTypes,
4600
- (_, teamId) => teamId
4601
- ],
4602
- (issueTypeTeamLinks, issueTypes, teamId) => {
4603
- return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.team === teamId).map((issueTypeTeamLink) => issueTypes[issueTypeTeamLink.issue_type]).filter((issueType) => !!issueType);
4604
- }
4605
- )
4606
- );
4607
- const selectTeamsLinkedToIssueType = restructureCreateSelectorWithArgs(
4608
- toolkit.createSelector(
4609
- [
4610
- selectIssueTypeTeamLinks,
4611
- (state) => state.teamReducer.teams,
4612
- (_, issueTypeId) => issueTypeId
4613
- ],
4614
- (issueTypeTeamLinks, teams, issueTypeId) => {
4615
- return issueTypeTeamLinks.filter((issueTypeTeamLink) => issueTypeTeamLink.issue_type === issueTypeId).map((issueTypeTeamLink) => teams[issueTypeTeamLink.team]).filter((team) => !!team);
4616
- }
4617
- )
4618
- );
4619
- const issueTypeTeamLinkReducer = issueTypeTeamLinkSlice.reducer;
4620
- const initialState$1 = {
4621
- userFormTeamLinks: {}
4622
- };
4623
- const userFormTeamLinkSlice = toolkit.createSlice({
4624
- name: "userFormTeamLink",
4625
- initialState: initialState$1,
4626
- extraReducers: (builder) => builder.addCase("RESET", (state) => {
4627
- Object.assign(state, initialState$1);
4628
- }),
4629
- reducers: {
4630
- setUserFormTeamLink: (state, action) => {
4631
- state.userFormTeamLinks[action.payload.offline_id] = action.payload;
4632
- },
4633
- setUserFormTeamLinks: (state, action) => {
4634
- state.userFormTeamLinks = {};
4635
- for (const userFormTeamLink of action.payload) {
4636
- state.userFormTeamLinks[userFormTeamLink.offline_id] = userFormTeamLink;
4637
- }
4638
- },
4639
- addUserFormTeamLink: (state, action) => {
4640
- if (action.payload.offline_id in state.userFormTeamLinks) {
4641
- throw new Error(`UserFormTeamLink with offline_id ${action.payload.offline_id} already exists`);
4642
- }
4643
- state.userFormTeamLinks[action.payload.offline_id] = action.payload;
4644
- },
4645
- deleteUserFormTeamLink: (state, action) => {
4646
- if (!(action.payload in state.userFormTeamLinks)) {
4647
- throw new Error(`UserFormTeamLink with offline_id ${action.payload} does not exist`);
4648
- }
4649
- delete state.userFormTeamLinks[action.payload];
4650
- },
4651
- deleteUserFormTeamLinks: (state, action) => {
4652
- for (const offlineId of action.payload) {
4653
- if (!(offlineId in state.userFormTeamLinks)) {
4654
- throw new Error(`UserFormTeamLink with offline_id ${offlineId} does not exist`);
4655
- }
4656
- }
4657
- for (const offlineId of action.payload) {
4658
- delete state.userFormTeamLinks[offlineId];
4659
- }
4660
- }
4661
- }
4662
- });
4663
- const {
4664
- setUserFormTeamLink,
4665
- setUserFormTeamLinks,
4666
- addUserFormTeamLink,
4667
- deleteUserFormTeamLink,
4668
- deleteUserFormTeamLinks
4669
- } = userFormTeamLinkSlice.actions;
4670
- const selectUserFormTeamLinkMapping = (state) => state.userFormTeamLinkReducer.userFormTeamLinks;
4671
- const selectUserFormTeamLinks = (state) => Object.values(state.userFormTeamLinkReducer.userFormTeamLinks);
4672
- const selectUserFormLinksOfTeam = restructureCreateSelectorWithArgs(
4673
- toolkit.createSelector([selectUserFormTeamLinks, (_, teamId) => teamId], (userFormTeamLinks, teamId) => {
4674
- return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.team === teamId);
4675
- })
4676
- );
4677
- const selectUserFormLinksOfForm = restructureCreateSelectorWithArgs(
4678
- toolkit.createSelector([selectUserFormTeamLinks, (_, formId2) => formId2], (userFormTeamLinks, formId2) => {
4679
- return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.form === formId2);
4680
- })
4681
- );
4682
- const selectUserFormsLinkedToTeam = restructureCreateSelectorWithArgs(
4683
- toolkit.createSelector(
4684
- [selectUserFormTeamLinks, (state) => state.formReducer.forms, (_, teamId) => teamId],
4685
- (userFormTeamLinks, userForms, teamId) => {
4686
- return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.team === teamId).map((userFormTeamLink) => userForms[userFormTeamLink.form]).filter((form) => !!form);
4687
- }
4688
- )
4689
- );
4690
- const selectTeamsLinkedToUserForm = restructureCreateSelectorWithArgs(
4691
- toolkit.createSelector(
4692
- [selectUserFormTeamLinks, (state) => state.teamReducer.teams, (_, formId2) => formId2],
4693
- (userFormTeamLinks, teams, formId2) => {
4694
- return userFormTeamLinks.filter((userFormTeamLink) => userFormTeamLink.form === formId2).map((userFormTeamLink) => teams[userFormTeamLink.team]).filter((team) => !!team);
4695
- }
4696
- )
4697
- );
4698
- const userFormTeamLinkReducer = userFormTeamLinkSlice.reducer;
4699
- const initialState = {
4700
- version: 0
4701
- };
4702
- const versioningSlice = toolkit.createSlice({
4703
- name: "versioning",
4704
- initialState,
4705
- reducers: {}
4501
+ const versioningSlice = toolkit.createSlice({
4502
+ name: "versioning",
4503
+ initialState,
4504
+ reducers: {}
4706
4505
  });
4707
4506
  const versioningReducer = versioningSlice.reducer;
4708
4507
  const fullComponentMarkerSize = 45;
@@ -4746,10 +4545,7 @@ var __publicField = (obj, key, value) => {
4746
4545
  emailDomainsReducer,
4747
4546
  licenseReducer,
4748
4547
  documentsReducer,
4749
- teamReducer,
4750
- documentTeamLinkReducer,
4751
- issueTypeTeamLinkReducer,
4752
- userFormTeamLinkReducer
4548
+ teamReducer
4753
4549
  };
4754
4550
  const overmapReducer = toolkit.combineReducers(overmapReducers);
4755
4551
  const resetStore = "RESET";
@@ -5266,642 +5062,95 @@ var __publicField = (obj, key, value) => {
5266
5062
  return promise;
5267
5063
  }
5268
5064
  }
5269
- class AttachmentService extends BaseApiService {
5270
- fetchAll(projectId) {
5271
- const promise = this.enqueueRequest({
5272
- description: "Fetch attachments",
5273
- method: HttpMethod.GET,
5274
- url: `/attachments/${projectId}/`,
5275
- blocks: [],
5276
- blockers: []
5277
- });
5278
- const state = this.client.store.getState();
5279
- const allAttachments = {
5280
- issue_attachments: Object.values(state.issueReducer.attachments),
5281
- component_attachments: Object.values(state.componentReducer.attachments),
5282
- component_type_attachments: Object.values(state.componentTypeReducer.attachments),
5283
- project_attachments: Object.values(state.projectReducer.attachments),
5284
- document_attachments: Object.values(state.documentsReducer.attachments)
5285
- };
5286
- return [allAttachments, promise];
5287
- }
5288
- // Attachments aren't models, so we use the OptimisticGenericResult type instead
5289
- async addIssueAttachment(attachmentPayload) {
5290
- const { issue, file_sha1, offline_id } = attachmentPayload;
5291
- if (!attachmentPayload.file.objectURL) {
5292
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5293
- }
5294
- const offlineAttachment = {
5295
- ...attachmentPayload,
5296
- file: attachmentPayload.file.objectURL,
5297
- file_name: attachmentPayload.file.name,
5298
- file_type: attachmentPayload.file.type,
5299
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5300
- created_by: this.client.store.getState().userReducer.currentUser.id
5301
- };
5302
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5303
- this.client.store.dispatch(addIssueAttachment(offlineAttachment));
5304
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5305
- const promise = this.enqueueRequest({
5306
- description: "Create attachment",
5307
- method: HttpMethod.POST,
5308
- url: `/issues/${issue}/attach/`,
5309
- blocks: [offline_id, issue],
5310
- blockers: [file_sha1],
5311
- payload: {
5312
- ...offlineAttachment,
5313
- ...fileProps
5314
- }
5315
- });
5316
- promise.catch((error2) => {
5317
- this.client.store.dispatch(removeIssueAttachment(offlineAttachment.offline_id));
5318
- throw error2;
5319
- });
5320
- return [offlineAttachment, promise];
5321
- }
5322
- async addComponentAttachment(attachmentPayload) {
5323
- const { component, file_sha1, offline_id } = attachmentPayload;
5324
- if (!attachmentPayload.file.objectURL) {
5325
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5326
- }
5327
- const offlineAttachment = {
5328
- ...attachmentPayload,
5329
- file: attachmentPayload.file.objectURL,
5330
- file_name: attachmentPayload.file.name,
5331
- file_type: attachmentPayload.file.type,
5332
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5333
- created_by: this.client.store.getState().userReducer.currentUser.id
5334
- };
5335
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5336
- this.client.store.dispatch(addComponentAttachment(offlineAttachment));
5337
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5338
- const promise = this.enqueueRequest({
5339
- description: "Create attachment",
5340
- method: HttpMethod.POST,
5341
- url: `/components/${component}/attach/`,
5342
- blocks: [offline_id, component],
5343
- blockers: [file_sha1],
5344
- payload: {
5345
- ...offlineAttachment,
5346
- ...fileProps
5347
- }
5348
- });
5349
- promise.catch((error2) => {
5350
- this.client.store.dispatch(removeComponentAttachment(offlineAttachment.offline_id));
5351
- throw error2;
5352
- });
5353
- return [offlineAttachment, promise];
5354
- }
5355
- async addComponentTypeAttachment(attachmentPayload) {
5356
- const { component_type, file_sha1, offline_id } = attachmentPayload;
5357
- if (!attachmentPayload.file.objectURL) {
5358
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5359
- }
5360
- const offlineAttachment = {
5361
- ...attachmentPayload,
5362
- file: attachmentPayload.file.objectURL,
5363
- file_name: attachmentPayload.file.name,
5364
- file_type: attachmentPayload.file.type,
5365
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5366
- created_by: this.client.store.getState().userReducer.currentUser.id
5367
- };
5368
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5369
- this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
5370
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5371
- const promise = this.enqueueRequest({
5372
- description: "Create attachment",
5373
- method: HttpMethod.POST,
5374
- url: `/components/types/${component_type}/attach/`,
5375
- blocks: [offline_id, component_type],
5376
- blockers: [file_sha1],
5377
- payload: {
5378
- ...offlineAttachment,
5379
- ...fileProps
5380
- }
5381
- });
5382
- promise.catch((error2) => {
5383
- this.client.store.dispatch(removeComponentTypeAttachment(offlineAttachment.offline_id));
5384
- throw error2;
5385
- });
5386
- return [offlineAttachment, promise];
5387
- }
5388
- async addDocumentAttachment(attachmentPayload) {
5389
- const { description: description2, document: document2, file_sha1, offline_id } = attachmentPayload;
5390
- if (!attachmentPayload.file.objectURL) {
5391
- throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
5392
- }
5393
- const offlineAttachment = {
5394
- ...attachmentPayload,
5395
- file: attachmentPayload.file.objectURL,
5396
- file_name: attachmentPayload.file.name,
5397
- file_type: attachmentPayload.file.type,
5398
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5399
- created_by: this.client.store.getState().userReducer.currentUser.id
5400
- };
5401
- await this.client.files.addCache(attachmentPayload.file, file_sha1);
5402
- this.client.store.dispatch(addDocumentAttachment(offlineAttachment));
5403
- const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
5404
- const promise = this.enqueueRequest({
5405
- description: "Create attachment",
5406
- method: HttpMethod.POST,
5407
- url: `/documents/${document2}/attach/`,
5408
- blocks: [offline_id, document2],
5409
- blockers: [file_sha1],
5410
- payload: {
5411
- offline_id,
5412
- document: document2,
5413
- description: description2 ?? "",
5414
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5415
- ...fileProps
5416
- }
5417
- });
5418
- promise.catch((error2) => {
5419
- this.client.store.dispatch(removeDocumentAttachment(offlineAttachment.offline_id));
5420
- throw error2;
5421
- });
5422
- return [offlineAttachment, promise];
5423
- }
5424
- /** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
5425
- * attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
5426
- * OptimisticModelResult. */
5427
- attachFilesToIssue(filesToSubmit, issueId) {
5428
- return filesToSubmit.map((file) => {
5429
- if (!(file instanceof File)) {
5430
- throw new Error("Expected a File instance.");
5431
- }
5432
- const photoAttachmentPromise = async (file2) => {
5433
- const hash = await hashFile(file2);
5434
- const attachment = offline({
5435
- file: file2,
5436
- file_name: file2.name,
5437
- file_type: file2.type,
5438
- issue: issueId,
5439
- file_sha1: hash,
5440
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5441
- created_by: this.client.store.getState().userReducer.currentUser.id
5442
- });
5443
- return this.addIssueAttachment(attachment);
5444
- };
5445
- return photoAttachmentPromise(file);
5446
- });
5447
- }
5448
- attachFilesToComponent(filesToSubmit, componentId) {
5449
- return filesToSubmit.map((file) => {
5450
- if (!(file instanceof File)) {
5451
- throw new Error("Expected a File instance.");
5452
- }
5453
- const photoAttachmentPromise = async (file2) => {
5454
- const hash = await hashFile(file2);
5455
- const attachment = offline({
5456
- file: file2,
5457
- file_name: file2.name,
5458
- file_type: file2.type,
5459
- component: componentId,
5460
- file_sha1: hash,
5461
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5462
- created_by: this.client.store.getState().userReducer.currentUser.id
5463
- });
5464
- return this.addComponentAttachment(attachment);
5465
- };
5466
- return photoAttachmentPromise(file);
5467
- });
5468
- }
5469
- attachFilesToComponentType(filesToSubmit, componentTypeId) {
5470
- return filesToSubmit.map((file) => {
5471
- if (!(file instanceof File)) {
5472
- throw new Error("Expected a File instance.");
5473
- }
5474
- const photoAttachmentPromise = async (file2) => {
5475
- const hash = await hashFile(file2);
5476
- const attachment = offline({
5477
- file: file2,
5478
- file_name: file2.name,
5479
- file_type: file2.type,
5480
- component_type: componentTypeId,
5481
- file_sha1: hash,
5482
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5483
- created_by: this.client.store.getState().userReducer.currentUser.id
5484
- });
5485
- return this.addComponentTypeAttachment(attachment);
5486
- };
5487
- return photoAttachmentPromise(file);
5488
- });
5489
- }
5490
- attachFilesToDocument(filesToSubmit, documentId) {
5491
- return filesToSubmit.map((file) => {
5492
- if (!(file instanceof File)) {
5493
- throw new Error("Expected a File instance.");
5494
- }
5495
- const photoAttachmentPromise = async (file2) => {
5496
- const hash = await hashFile(file2);
5497
- const attachment = offline({
5498
- file: file2,
5499
- file_name: file2.name,
5500
- file_type: file2.type,
5501
- document: documentId,
5502
- file_sha1: hash,
5503
- submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5504
- created_by: this.client.store.getState().userReducer.currentUser.id
5505
- });
5506
- return this.addDocumentAttachment(attachment);
5507
- };
5508
- return photoAttachmentPromise(file);
5509
- });
5510
- }
5511
- async replaceIssueAttachmentFile(attachmentId, newFile) {
5512
- const { store } = this.client;
5513
- const attachment = store.getState().issueReducer.attachments[attachmentId];
5514
- if (!attachment)
5515
- throw new Error(`Attachment ${attachmentId} not found`);
5516
- let oldFile = void 0;
5517
- const newSha1 = await hashFile(newFile);
5518
- const performRequest2 = async () => {
5519
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5520
- if (!oldFile) {
5521
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5522
- }
5523
- if (!newFile.objectURL) {
5524
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5525
- }
5526
- store.dispatch(
5527
- updateIssueAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
5528
- );
5529
- await this.client.files.addCache(newFile, newSha1);
5530
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5531
- store.dispatch(updateIssueAttachment(attachment));
5065
+ const EXPIRING_SOON_THRESHOLD = 1800;
5066
+ function parseTokens(response) {
5067
+ if (!response.access)
5068
+ throw new Error("Missing access token");
5069
+ if (!response.refresh)
5070
+ throw new Error("Missing refresh token");
5071
+ return { accessToken: response.access, refreshToken: response.refresh };
5072
+ }
5073
+ class AuthService extends BaseApiService {
5074
+ constructor() {
5075
+ super(...arguments);
5076
+ __publicField(this, "_getAccessToken", () => this.client.store.getState().authReducer.accessToken);
5077
+ __publicField(this, "_getRefreshToken", () => this.client.store.getState().authReducer.refreshToken);
5078
+ // _getTokenPair and _getRenewedTokens don't need to use enqueueRequest from the BaseApiService because
5079
+ // they are very simple. However, if we need robust error handling or want these operations to queue in the Outbox,
5080
+ // we will use enqueueRequest.
5081
+ /**
5082
+ * Takes credentials and gets a token pair
5083
+ * @async
5084
+ * @param credentials The username and password for obtaining a token pair
5085
+ * @param logoutOnFailure Whether to log out if the request fails
5086
+ * @returns An array containing two elements: 1) a Promise for the access and refresh tokens, and 2) the UUID of the
5087
+ * request, so the request can be cancelled if necessary.
5088
+ */
5089
+ __publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
5090
+ const uuid$1 = uuid.v4();
5091
+ const responsePromise = this.enqueueRequest({
5092
+ uuid: uuid$1,
5093
+ description: "Get token pair",
5094
+ method: HttpMethod.POST,
5095
+ url: "/api/token/",
5096
+ payload: credentials,
5097
+ isAuthNeeded: false,
5098
+ checkAuth: false,
5099
+ blockers: [],
5100
+ blocks: []
5101
+ }).then(parseTokens).catch((e) => {
5102
+ if (logoutOnFailure) {
5103
+ void this.logout().then();
5104
+ }
5532
5105
  throw e;
5533
5106
  });
5534
- const promise2 = this.enqueueRequest({
5535
- description: "Edit attachment",
5536
- method: HttpMethod.PATCH,
5537
- url: `/attachments/issues/${attachment.offline_id}/`,
5538
- isResponseBlob: false,
5539
- payload: fileProps,
5540
- blockers: [attachmentId, newSha1],
5541
- blocks: [attachmentId, newSha1]
5107
+ return [responsePromise, uuid$1];
5108
+ });
5109
+ /**
5110
+ * Takes refresh token and gets a new token pair
5111
+ * @async
5112
+ * @param {string} refreshToken The refresh token used to get new tokens
5113
+ * @returns {Promise<TokenPair>} The new access and refresh tokens
5114
+ */
5115
+ __publicField(this, "_getRenewedTokens", async (refreshToken) => {
5116
+ const promise = this.enqueueRequest({
5117
+ description: "Get renewed tokens",
5118
+ method: HttpMethod.POST,
5119
+ url: "/api/token/refresh/",
5120
+ payload: { refresh: refreshToken },
5121
+ isAuthNeeded: false,
5122
+ blockers: [],
5123
+ blocks: [],
5124
+ // Don't wait for an auth check since this is a refresh token request.
5125
+ checkAuth: false,
5126
+ // Don't wait for other requests to finish, or we might end up in a deadlock.
5127
+ immediate: true
5128
+ }).catch((e) => {
5129
+ console.error("Could not renew tokens; logging out due to error:", e);
5130
+ void this.logout();
5131
+ return void 0;
5542
5132
  });
5133
+ let response = void 0;
5543
5134
  try {
5544
- const result = await promise2;
5545
- void this.client.files.removeCache(attachment.file_sha1);
5546
- return result;
5135
+ response = await promise;
5547
5136
  } catch (e) {
5548
- if (oldFile) {
5549
- store.dispatch(
5550
- updateIssueAttachment({
5551
- ...attachment,
5552
- file_sha1: attachment.file_sha1,
5553
- file: URL.createObjectURL(oldFile)
5554
- })
5555
- );
5556
- }
5557
- throw e;
5137
+ await this.logout();
5558
5138
  }
5559
- };
5560
- const offlineAttachment = {
5561
- ...attachment,
5562
- file_sha1: newSha1,
5563
- file: URL.createObjectURL(newFile)
5564
- };
5565
- const promise = performRequest2();
5566
- return [offlineAttachment, promise];
5139
+ if (!response)
5140
+ return void 0;
5141
+ if (!response.access)
5142
+ throw new Error("Missing access token");
5143
+ if (!response.refresh)
5144
+ throw new Error("Missing refresh token");
5145
+ return { accessToken: response.access, refreshToken: response.refresh };
5146
+ });
5567
5147
  }
5568
- async replaceComponentAttachmentFile(attachmentId, newFile) {
5569
- const { store } = this.client;
5570
- const attachment = store.getState().componentReducer.attachments[attachmentId];
5571
- if (!attachment)
5572
- throw new Error(`Attachment ${attachmentId} not found`);
5573
- let oldFile = void 0;
5574
- const newSha1 = await hashFile(newFile);
5575
- const performRequest2 = async () => {
5576
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5577
- if (!oldFile) {
5578
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5579
- }
5580
- if (!newFile.objectURL) {
5581
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5582
- }
5583
- store.dispatch(
5584
- updateComponentAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
5585
- );
5586
- await this.client.files.addCache(newFile, newSha1);
5587
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5588
- store.dispatch(updateComponentAttachment(attachment));
5589
- throw e;
5590
- });
5591
- const promise2 = this.enqueueRequest({
5592
- description: "Edit attachment",
5593
- method: HttpMethod.PATCH,
5594
- url: `/attachments/components/${attachment.offline_id}/`,
5595
- isResponseBlob: false,
5596
- payload: fileProps,
5597
- blockers: [attachmentId, newSha1],
5598
- blocks: [attachmentId, newSha1]
5599
- });
5600
- try {
5601
- const result = await promise2;
5602
- void this.client.files.removeCache(attachment.file_sha1);
5603
- return result;
5604
- } catch (e) {
5605
- if (oldFile) {
5606
- store.dispatch(
5607
- updateComponentAttachment({
5608
- ...attachment,
5609
- file_sha1: attachment.file_sha1,
5610
- file: URL.createObjectURL(oldFile)
5611
- })
5612
- );
5613
- }
5614
- throw e;
5615
- }
5616
- };
5617
- const offlineAttachment = {
5618
- ...attachment,
5619
- file_sha1: newSha1,
5620
- file: URL.createObjectURL(newFile)
5621
- };
5622
- const promise = performRequest2();
5623
- return [offlineAttachment, promise];
5624
- }
5625
- async replaceComponentTypeAttachmentFile(attachmentId, newFile) {
5626
- const { store } = this.client;
5627
- const attachment = store.getState().componentTypeReducer.attachments[attachmentId];
5628
- if (!attachment)
5629
- throw new Error(`Attachment ${attachmentId} not found`);
5630
- let oldFile = void 0;
5631
- const newSha1 = await hashFile(newFile);
5632
- const performRequest2 = async () => {
5633
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5634
- if (!oldFile) {
5635
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5636
- }
5637
- if (!newFile.objectURL) {
5638
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5639
- }
5640
- store.dispatch(
5641
- updateComponentTypeAttachment({
5642
- ...attachment,
5643
- file_sha1: newSha1,
5644
- file: URL.createObjectURL(newFile)
5645
- })
5646
- );
5647
- await this.client.files.addCache(newFile, newSha1);
5648
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5649
- store.dispatch(updateComponentTypeAttachment(attachment));
5650
- throw e;
5651
- });
5652
- const promise2 = this.enqueueRequest({
5653
- description: "Edit attachment",
5654
- method: HttpMethod.PATCH,
5655
- url: `/attachments/component_types/${attachment.offline_id}/`,
5656
- isResponseBlob: false,
5657
- payload: fileProps,
5658
- blockers: [attachmentId, newSha1],
5659
- blocks: [attachmentId, newSha1]
5660
- });
5661
- try {
5662
- const result = await promise2;
5663
- void this.client.files.removeCache(attachment.file_sha1);
5664
- return result;
5665
- } catch (e) {
5666
- if (oldFile) {
5667
- store.dispatch(
5668
- updateComponentTypeAttachment({
5669
- ...attachment,
5670
- file_sha1: attachment.file_sha1,
5671
- file: URL.createObjectURL(oldFile)
5672
- })
5673
- );
5674
- }
5675
- throw e;
5676
- }
5677
- };
5678
- const offlineAttachment = {
5679
- ...attachment,
5680
- file_sha1: newSha1,
5681
- file: URL.createObjectURL(newFile)
5682
- };
5683
- const promise = performRequest2();
5684
- return [offlineAttachment, promise];
5685
- }
5686
- async replaceDocumentAttachmentFile(attachmentId, newFile) {
5687
- const { store } = this.client;
5688
- const attachment = store.getState().documentsReducer.attachments[attachmentId];
5689
- if (!attachment)
5690
- throw new Error(`Attachment ${attachmentId} not found`);
5691
- let oldFile = void 0;
5692
- const newSha1 = await hashFile(newFile);
5693
- const performRequest2 = async () => {
5694
- oldFile = await this.client.files.fetchCache(attachment.file_sha1);
5695
- if (!oldFile) {
5696
- console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
5697
- }
5698
- if (!newFile.objectURL) {
5699
- throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
5700
- }
5701
- store.dispatch(
5702
- updateDocumentAttachment({
5703
- ...attachment,
5704
- file_sha1: newSha1,
5705
- file: URL.createObjectURL(newFile)
5706
- })
5707
- );
5708
- await this.client.files.addCache(newFile, newSha1);
5709
- const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
5710
- store.dispatch(updateDocumentAttachment(attachment));
5711
- throw e;
5712
- });
5713
- const promise2 = this.enqueueRequest({
5714
- description: "Edit attachment",
5715
- method: HttpMethod.PATCH,
5716
- url: `/attachments/documents/${attachment.offline_id}/`,
5717
- isResponseBlob: false,
5718
- payload: fileProps,
5719
- blockers: [attachmentId, newSha1],
5720
- blocks: [attachmentId, newSha1]
5721
- });
5722
- try {
5723
- const result = await promise2;
5724
- void this.client.files.removeCache(attachment.file_sha1);
5725
- return result;
5726
- } catch (e) {
5727
- if (oldFile) {
5728
- store.dispatch(
5729
- updateDocumentAttachment({
5730
- ...attachment,
5731
- file_sha1: attachment.file_sha1,
5732
- file: URL.createObjectURL(oldFile)
5733
- })
5734
- );
5735
- }
5736
- throw e;
5737
- }
5738
- };
5739
- const offlineAttachment = {
5740
- ...attachment,
5741
- file_sha1: newSha1,
5742
- file: URL.createObjectURL(newFile)
5743
- };
5744
- const promise = performRequest2();
5745
- return [offlineAttachment, promise];
5746
- }
5747
- /**
5748
- * Deletes an attachment and associated data in the cloud, in the Redux store and the cache.
5749
- * @param issueAttachmentId
5750
- */
5751
- deleteIssueAttachment(issueAttachmentId) {
5752
- const { store } = this.client;
5753
- const attachment = selectIssueAttachmentMapping(store.getState())[issueAttachmentId];
5754
- if (!attachment) {
5755
- throw new Error(`Attachment ${issueAttachmentId} not found`);
5756
- }
5757
- store.dispatch(removeIssueAttachment(issueAttachmentId));
5758
- void this.client.files.removeCache(attachment.file_sha1);
5759
- return this.enqueueRequest({
5760
- description: "Delete attachment",
5761
- method: HttpMethod.DELETE,
5762
- url: `/attachments/issues/${issueAttachmentId}/`,
5763
- blockers: [issueAttachmentId],
5764
- blocks: [issueAttachmentId]
5765
- });
5766
- }
5767
- deleteComponentAttachment(componentAttachmentId) {
5768
- const { store } = this.client;
5769
- const attachment = selectComponentAttachmentMapping(store.getState())[componentAttachmentId];
5770
- if (!attachment) {
5771
- throw new Error(`Attachment ${componentAttachmentId} not found`);
5772
- }
5773
- store.dispatch(removeComponentAttachment(componentAttachmentId));
5774
- void this.client.files.removeCache(attachment.file_sha1);
5775
- return this.enqueueRequest({
5776
- description: "Delete attachment",
5777
- method: HttpMethod.DELETE,
5778
- url: `/attachments/components/${componentAttachmentId}/`,
5779
- blockers: [componentAttachmentId],
5780
- blocks: [componentAttachmentId]
5781
- });
5782
- }
5783
- deleteComponentTypeAttachment(componentTypeAttachmentId) {
5784
- const { store } = this.client;
5785
- const attachment = selectComponentTypeAttachmentMapping(store.getState())[componentTypeAttachmentId];
5786
- if (!attachment) {
5787
- throw new Error(`Attachment ${componentTypeAttachmentId} not found`);
5788
- }
5789
- store.dispatch(removeComponentTypeAttachment(componentTypeAttachmentId));
5790
- void this.client.files.removeCache(attachment.file_sha1);
5791
- return this.enqueueRequest({
5792
- description: "Delete attachment",
5793
- method: HttpMethod.DELETE,
5794
- url: `/attachments/component_types/${componentTypeAttachmentId}/`,
5795
- blockers: [componentTypeAttachmentId],
5796
- blocks: [componentTypeAttachmentId]
5797
- });
5798
- }
5799
- deleteDocumentAttachment(documentAttachmentId) {
5800
- const { store } = this.client;
5801
- const attachment = store.getState().documentsReducer.attachments[documentAttachmentId];
5802
- if (!attachment) {
5803
- throw new Error(`Attachment ${documentAttachmentId} not found`);
5804
- }
5805
- store.dispatch(removeDocumentAttachment(documentAttachmentId));
5806
- void this.client.files.removeCache(attachment.file_sha1);
5807
- return this.enqueueRequest({
5808
- description: "Delete document attachment",
5809
- method: HttpMethod.DELETE,
5810
- url: `/attachments/documents/${documentAttachmentId}/`,
5811
- blockers: [documentAttachmentId],
5812
- blocks: [documentAttachmentId]
5813
- });
5814
- }
5815
- }
5816
- const EXPIRING_SOON_THRESHOLD = 1800;
5817
- function parseTokens(response) {
5818
- if (!response.access)
5819
- throw new Error("Missing access token");
5820
- if (!response.refresh)
5821
- throw new Error("Missing refresh token");
5822
- return { accessToken: response.access, refreshToken: response.refresh };
5823
- }
5824
- class AuthService extends BaseApiService {
5825
- constructor() {
5826
- super(...arguments);
5827
- __publicField(this, "_getAccessToken", () => this.client.store.getState().authReducer.accessToken);
5828
- __publicField(this, "_getRefreshToken", () => this.client.store.getState().authReducer.refreshToken);
5829
- // _getTokenPair and _getRenewedTokens don't need to use enqueueRequest from the BaseApiService because
5830
- // they are very simple. However, if we need robust error handling or want these operations to queue in the Outbox,
5831
- // we will use enqueueRequest.
5832
- /**
5833
- * Takes credentials and gets a token pair
5834
- * @async
5835
- * @param credentials The username and password for obtaining a token pair
5836
- * @param logoutOnFailure Whether to log out if the request fails
5837
- * @returns An array containing two elements: 1) a Promise for the access and refresh tokens, and 2) the UUID of the
5838
- * request, so the request can be cancelled if necessary.
5839
- */
5840
- __publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
5841
- const uuid$1 = uuid.v4();
5842
- const responsePromise = this.enqueueRequest({
5843
- uuid: uuid$1,
5844
- description: "Get token pair",
5845
- method: HttpMethod.POST,
5846
- url: "/api/token/",
5847
- payload: credentials,
5848
- isAuthNeeded: false,
5849
- checkAuth: false,
5850
- blockers: [],
5851
- blocks: []
5852
- }).then(parseTokens).catch((e) => {
5853
- if (logoutOnFailure) {
5854
- void this.logout().then();
5855
- }
5856
- throw e;
5857
- });
5858
- return [responsePromise, uuid$1];
5859
- });
5860
- /**
5861
- * Takes refresh token and gets a new token pair
5862
- * @async
5863
- * @param {string} refreshToken The refresh token used to get new tokens
5864
- * @returns {Promise<TokenPair>} The new access and refresh tokens
5865
- */
5866
- __publicField(this, "_getRenewedTokens", async (refreshToken) => {
5867
- const promise = this.enqueueRequest({
5868
- description: "Get renewed tokens",
5869
- method: HttpMethod.POST,
5870
- url: "/api/token/refresh/",
5871
- payload: { refresh: refreshToken },
5872
- isAuthNeeded: false,
5873
- blockers: [],
5874
- blocks: [],
5875
- // Don't wait for an auth check since this is a refresh token request.
5876
- checkAuth: false,
5877
- // Don't wait for other requests to finish, or we might end up in a deadlock.
5878
- immediate: true
5879
- }).catch((e) => {
5880
- console.error("Could not renew tokens; logging out due to error:", e);
5881
- void this.logout();
5882
- return void 0;
5883
- });
5884
- let response = void 0;
5885
- try {
5886
- response = await promise;
5887
- } catch (e) {
5888
- await this.logout();
5889
- }
5890
- if (!response)
5891
- return void 0;
5892
- if (!response.access)
5893
- throw new Error("Missing access token");
5894
- if (!response.refresh)
5895
- throw new Error("Missing refresh token");
5896
- return { accessToken: response.access, refreshToken: response.refresh };
5897
- });
5898
- }
5899
- /**
5900
- * Attempts to log into Hemora using given credentials
5901
- * @param {string} username
5902
- * @param {string} password
5903
- */
5904
- async login(username, password) {
5148
+ /**
5149
+ * Attempts to log into Hemora using given credentials
5150
+ * @param {string} username
5151
+ * @param {string} password
5152
+ */
5153
+ async login(username, password) {
5905
5154
  const { store } = this.client;
5906
5155
  const [promise, uuid$1] = this._getTokenPair({ username, password }, false);
5907
5156
  const initialDataUuid = uuid.v4();
@@ -6504,6 +5753,221 @@ var __publicField = (obj, key, value) => {
6504
5753
  store.dispatch(addStages(result));
6505
5754
  }
6506
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
+ }
6507
5971
  class ComponentTypeService extends BaseApiService {
6508
5972
  add(componentType) {
6509
5973
  const offlineComponentType = offline(componentType);
@@ -6576,9 +6040,56 @@ var __publicField = (obj, key, value) => {
6576
6040
  store.dispatch(setComponentTypes(result));
6577
6041
  }
6578
6042
  }
6579
- class IssueCommentService extends BaseApiService {
6580
- // Omit author and submitted_at since these will always be set internally
6581
- 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) {
6582
6093
  const { store } = this.client;
6583
6094
  const offlineComment = offline({
6584
6095
  ...comment,
@@ -6672,11 +6183,53 @@ var __publicField = (obj, key, value) => {
6672
6183
  store.dispatch(setIssueUpdates(filteredResult));
6673
6184
  }
6674
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
+ }
6675
6228
  class IssueService extends BaseApiService {
6676
6229
  // Basic CRUD functions
6677
6230
  // TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
6678
6231
  // have to repeat it for all optimistic model results (all optimistic results are created).
6679
- add(issue, issue_type = null) {
6232
+ add(issue, issueType = null) {
6680
6233
  const { store } = this.client;
6681
6234
  const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
6682
6235
  const state = store.getState();
@@ -6703,7 +6256,7 @@ var __publicField = (obj, key, value) => {
6703
6256
  url: "/issues/",
6704
6257
  queryParams: {
6705
6258
  workspace_id: workspaceId,
6706
- ...issue_type ? { issue_type } : {}
6259
+ ...issueType ? { issue_type: issueType } : {}
6707
6260
  },
6708
6261
  payload: issuePayload,
6709
6262
  blockers: [
@@ -6840,7 +6393,7 @@ var __publicField = (obj, key, value) => {
6840
6393
  this.client.store.dispatch(updateIssue(issueToBeUpdated));
6841
6394
  this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
6842
6395
  });
6843
- const fullIssue = this.client.store.getState().issueReducer.issues[issue.offline_id];
6396
+ const fullIssue = state.issueReducer.issues[issue.offline_id];
6844
6397
  return [fullIssue, promise];
6845
6398
  }
6846
6399
  async remove(id) {
@@ -6891,14 +6444,15 @@ var __publicField = (obj, key, value) => {
6891
6444
  class IssueTypeService extends BaseApiService {
6892
6445
  add(payload) {
6893
6446
  const { store } = this.client;
6894
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
6447
+ const state = store.getState();
6448
+ const activeOrganizationId = state.organizationReducer.activeOrganizationId;
6895
6449
  if (!activeOrganizationId) {
6896
6450
  throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
6897
6451
  }
6898
6452
  const offlineIssueType = offline({
6899
6453
  ...payload,
6900
6454
  submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
6901
- created_by: store.getState().userReducer.currentUser.id,
6455
+ created_by: state.userReducer.currentUser.id,
6902
6456
  organization: activeOrganizationId
6903
6457
  });
6904
6458
  store.dispatch(addIssueType(offlineIssueType));
@@ -6951,25 +6505,23 @@ var __publicField = (obj, key, value) => {
6951
6505
  }
6952
6506
  delete(issueTypeId) {
6953
6507
  const { store } = this.client;
6954
- const issueTypeToDelete = store.getState().issueTypeReducer.issueTypes[issueTypeId];
6508
+ const state = store.getState();
6509
+ const issueTypeToDelete = state.issueTypeReducer.issueTypes[issueTypeId];
6955
6510
  if (!issueTypeToDelete) {
6956
6511
  throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
6957
6512
  }
6958
- const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(store.getState()) ?? [];
6959
- const issueTypeTeamLinks = selectIssueTypeTeamLinksOfIssueType(issueTypeId)(store.getState()) ?? [];
6513
+ const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state) ?? [];
6960
6514
  store.dispatch(removeIssueType(issueTypeId));
6961
6515
  store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
6962
- store.dispatch(deleteIssueTypeTeamLinks(issueTypeTeamLinks.map((link) => link.offline_id)));
6963
6516
  const promise = this.enqueueRequest({
6964
6517
  method: HttpMethod.DELETE,
6965
6518
  url: `/issues/types/${issueTypeId}/`,
6966
6519
  blockers: [issueTypeId],
6967
- blocks: [issueTypeId]
6520
+ blocks: []
6968
6521
  });
6969
6522
  promise.catch(() => {
6970
6523
  store.dispatch(setIssueType(issueTypeToDelete));
6971
6524
  store.dispatch(addIssues(issuesOfIssueType));
6972
- store.dispatch(setIssueTypeTeamLinks(issueTypeTeamLinks));
6973
6525
  });
6974
6526
  return promise;
6975
6527
  }
@@ -7119,6 +6671,7 @@ var __publicField = (obj, key, value) => {
7119
6671
  const usersResult = await usersResultPromise;
7120
6672
  await projectAccessRefreshPromise;
7121
6673
  store.dispatch(addUsers(usersResult));
6674
+ void this.client.projectAttachments.refreshStore();
7122
6675
  }
7123
6676
  let currentWorkspaceId;
7124
6677
  const oldWorkspaceId = this.client.store.getState().workspaceReducer.activeWorkspaceId;
@@ -7131,44 +6684,33 @@ var __publicField = (obj, key, value) => {
7131
6684
  store.dispatch(setActiveWorkspaceId(currentWorkspaceId));
7132
6685
  void this.client.categories.refreshStore().then(() => {
7133
6686
  void this.client.issues.refreshStore().then(() => {
6687
+ void this.client.issueAttachments.refreshStore().then();
7134
6688
  void this.client.issueComments.refreshStore().then();
6689
+ void this.client.issueUpdates.refreshStore().then();
7135
6690
  });
7136
6691
  });
7137
6692
  void this.client.projectFiles.refreshStore().then();
7138
6693
  void this.client.componentTypes.refreshStore().then(() => {
7139
- void this.client.componentStages.refreshStore().then(() => {
7140
- 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();
7141
6701
  });
7142
- void this.client.componentStageCompletions.refreshStore().then();
7143
6702
  });
7144
6703
  void this.client.userForms.refreshStore().then(() => {
7145
6704
  void this.client.userFormSubmissions.refreshStore().then();
7146
- void this.client.userFormTeamLinks.refreshStore().then();
7147
6705
  });
7148
6706
  }
7149
6707
  if (currentProjectId) {
7150
- const [_offlineAttachments, promise] = this.client.attachments.fetchAll(currentProjectId);
7151
- void promise.then((result) => {
7152
- const {
7153
- issue_attachments,
7154
- component_type_attachments,
7155
- component_attachments,
7156
- project_attachments,
7157
- document_attachments
7158
- } = result;
7159
- store.dispatch(setIssueAttachments(issue_attachments));
7160
- store.dispatch(setComponentAttachments(component_attachments));
7161
- store.dispatch(setComponentTypeAttachments(component_type_attachments));
7162
- store.dispatch(setProjectAttachments(project_attachments));
7163
- store.dispatch(setDocumentAttachments(document_attachments));
7164
- });
7165
6708
  void this.client.documents.refreshStore().then(() => {
7166
- void this.client.documentTeamLinks.refreshStore().then();
6709
+ void this.client.documentAttachments.refreshStore().then();
7167
6710
  });
6711
+ void this.client.documents.refreshStore();
7168
6712
  void this.client.issueUpdates.refreshStore();
7169
- void this.client.issueTypes.refreshStore().then(() => {
7170
- void this.client.issueTypeTeamLinks.refreshStore().then();
7171
- });
6713
+ void this.client.issueTypes.refreshStore();
7172
6714
  }
7173
6715
  store.dispatch(setIsFetchingInitialData(false));
7174
6716
  if (overwrite) {
@@ -7267,6 +6809,7 @@ var __publicField = (obj, key, value) => {
7267
6809
  });
7268
6810
  return promise;
7269
6811
  }
6812
+ // TODO: This needs to be seperated into a update and create method
7270
6813
  saveActive() {
7271
6814
  const { store } = this.client;
7272
6815
  const state = store.getState();
@@ -7332,6 +6875,48 @@ var __publicField = (obj, key, value) => {
7332
6875
  });
7333
6876
  }
7334
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
+ }
7335
6920
  class ProjectService extends BaseApiService {
7336
6921
  /**
7337
6922
  * Creates a new project. Due to the nature of project creation,
@@ -7549,7 +7134,7 @@ var __publicField = (obj, key, value) => {
7549
7134
  const currentUser = state.userReducer.currentUser;
7550
7135
  const activeWorkspaceId = state.workspaceReducer.activeWorkspaceId;
7551
7136
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7552
- const offlineFormPayload = offline({});
7137
+ const offlineFormPayload = offline({ ...ownerAttrs });
7553
7138
  const offlineRevisionPayload = offline({ ...initialRevision, submitted_at: submittedAt });
7554
7139
  const retForm = {
7555
7140
  ...offlineFormPayload,
@@ -7713,8 +7298,6 @@ var __publicField = (obj, key, value) => {
7713
7298
  if (userFormRevisions && userFormRevisions.length > 0) {
7714
7299
  store.dispatch(deleteFormRevisions(userFormRevisions.map(({ offline_id }) => offline_id)));
7715
7300
  }
7716
- const userFormTeamLinks = selectUserFormLinksOfForm(formId2)(state) ?? [];
7717
- store.dispatch(deleteUserFormTeamLinks(userFormTeamLinks.map((link) => link.offline_id)));
7718
7301
  store.dispatch(deleteForm(formId2));
7719
7302
  try {
7720
7303
  return await this.enqueueRequest({
@@ -7732,7 +7315,6 @@ var __publicField = (obj, key, value) => {
7732
7315
  if (userFormSubmissions && userFormSubmissions.length > 0) {
7733
7316
  store.dispatch(addFormSubmissions(userFormSubmissions));
7734
7317
  }
7735
- store.dispatch(setUserFormTeamLinks(userFormTeamLinks));
7736
7318
  throw e;
7737
7319
  }
7738
7320
  }
@@ -8677,8 +8259,7 @@ var __publicField = (obj, key, value) => {
8677
8259
  }
8678
8260
  delete(documentId) {
8679
8261
  const { store } = this.client;
8680
- const state = store.getState();
8681
- const documentsMapping = selectDocumentsMapping(state);
8262
+ const documentsMapping = selectDocumentsMapping(store.getState());
8682
8263
  const documentToBeDeleted = documentsMapping[documentId];
8683
8264
  if (!documentToBeDeleted) {
8684
8265
  throw new Error(
@@ -8686,9 +8267,7 @@ var __publicField = (obj, key, value) => {
8686
8267
  );
8687
8268
  }
8688
8269
  const parentDocument = documentToBeDeleted.parent_document ? documentsMapping[documentToBeDeleted.parent_document] : void 0;
8689
- const documentTeamLinks = selectDocumentTeamLinksOfDocument(documentId)(state) ?? [];
8690
8270
  store.dispatch(removeDocuments([documentId]));
8691
- store.dispatch(deleteDocumentTeamLinks(documentTeamLinks.map((link) => link.offline_id)));
8692
8271
  const promise = this.enqueueRequest({
8693
8272
  description: "Delete Document",
8694
8273
  method: HttpMethod.DELETE,
@@ -8703,7 +8282,6 @@ var __publicField = (obj, key, value) => {
8703
8282
  if (parentDocument) {
8704
8283
  store.dispatch(updateDocuments([parentDocument]));
8705
8284
  }
8706
- store.dispatch(setDocumentTeamLinks(documentTeamLinks));
8707
8285
  });
8708
8286
  return promise;
8709
8287
  }
@@ -8730,6 +8308,48 @@ var __publicField = (obj, key, value) => {
8730
8308
  store.dispatch(addDocuments(await organizationDocumentsPromise));
8731
8309
  }
8732
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
+ }
8733
8353
  class AgentService extends BaseApiService {
8734
8354
  /**
8735
8355
  * Prompt the agent with a message.
@@ -8825,13 +8445,7 @@ var __publicField = (obj, key, value) => {
8825
8445
  if (!team) {
8826
8446
  throw new Error(`Expected team with id ${teamId} to exist`);
8827
8447
  }
8828
- const documentTeamLinks = selectDocumentTeamLinksOfTeam(team.offline_id)(state) ?? [];
8829
- const issueTypeTeamLinks = selectIssueTypeTeamLinksOfTeam(team.offline_id)(state) ?? [];
8830
- const userFormTeamLinks = selectUserFormLinksOfTeam(team.offline_id)(state) ?? [];
8831
8448
  store.dispatch(deleteTeam(teamId));
8832
- store.dispatch(deleteDocumentTeamLinks(documentTeamLinks.map((link) => link.offline_id)));
8833
- store.dispatch(deleteIssueTypeTeamLinks(issueTypeTeamLinks.map((link) => link.offline_id)));
8834
- store.dispatch(deleteUserFormTeamLinks(userFormTeamLinks.map((link) => link.offline_id)));
8835
8449
  try {
8836
8450
  return await this.enqueueRequest({
8837
8451
  description: "Delete team",
@@ -8842,9 +8456,6 @@ var __publicField = (obj, key, value) => {
8842
8456
  });
8843
8457
  } catch (e) {
8844
8458
  store.dispatch(setTeam(team));
8845
- store.dispatch(setDocumentTeamLinks(documentTeamLinks));
8846
- store.dispatch(setIssueTypeTeamLinks(issueTypeTeamLinks));
8847
- store.dispatch(setUserFormTeamLinks(userFormTeamLinks));
8848
8459
  throw e;
8849
8460
  }
8850
8461
  }
@@ -8907,178 +8518,12 @@ var __publicField = (obj, key, value) => {
8907
8518
  store.dispatch(setTeams(result));
8908
8519
  }
8909
8520
  }
8910
- class DocumentTeamLinkService extends BaseApiService {
8911
- add(payload) {
8912
- const { store } = this.client;
8913
- const offlineDocumentTeamLink = offline({
8914
- ...payload,
8915
- submitted_at: (/* @__PURE__ */ new Date()).toISOString()
8916
- });
8917
- store.dispatch(addDocumentTeamLink(offlineDocumentTeamLink));
8918
- const promise = this.enqueueRequest({
8919
- method: HttpMethod.POST,
8920
- url: `/organizations/teams/${payload.team}/link-document/`,
8921
- payload: offlineDocumentTeamLink,
8922
- blockers: [payload.team, payload.document],
8923
- blocks: [offlineDocumentTeamLink.offline_id]
8924
- });
8925
- promise.then((createdDocumentLink) => {
8926
- store.dispatch(setDocumentTeamLink(createdDocumentLink));
8927
- }).catch(() => {
8928
- store.dispatch(deleteDocumentTeamLink(offlineDocumentTeamLink.offline_id));
8929
- });
8930
- return [offlineDocumentTeamLink, promise];
8931
- }
8932
- delete(documentTeamLinkId) {
8933
- const { store } = this.client;
8934
- const documentTeamLink = store.getState().documentTeamLinkReducer.documentTeamLinks[documentTeamLinkId];
8935
- if (!documentTeamLink) {
8936
- throw new Error(`No document team link found for ${documentTeamLinkId}`);
8937
- }
8938
- store.dispatch(deleteDocumentTeamLink(documentTeamLinkId));
8939
- const promise = this.enqueueRequest({
8940
- method: HttpMethod.DELETE,
8941
- url: `/organizations/teams/document-links/${documentTeamLinkId}/`,
8942
- blockers: [documentTeamLinkId],
8943
- blocks: [documentTeamLinkId]
8944
- });
8945
- promise.catch(() => {
8946
- store.dispatch(setDocumentTeamLink(documentTeamLink));
8947
- });
8948
- return promise;
8949
- }
8950
- async refreshStore() {
8951
- const { store } = this.client;
8952
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
8953
- if (!activeOrganizationId) {
8954
- throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
8955
- }
8956
- const result = await this.enqueueRequest({
8957
- method: HttpMethod.GET,
8958
- url: `/organizations/${activeOrganizationId}/teams/document-links/`,
8959
- blockers: [],
8960
- blocks: []
8961
- });
8962
- store.dispatch(setDocumentTeamLinks(result));
8963
- }
8964
- }
8965
- class IssueTypeTeamLinkService extends BaseApiService {
8966
- add(payload) {
8967
- const { store } = this.client;
8968
- const offlineIssueTypeTeamLink = offline({
8969
- ...payload,
8970
- submitted_at: (/* @__PURE__ */ new Date()).toISOString()
8971
- });
8972
- store.dispatch(addIssueTypeTeamLink(offlineIssueTypeTeamLink));
8973
- const promise = this.enqueueRequest({
8974
- method: HttpMethod.POST,
8975
- url: `/organizations/teams/${payload.team}/link-issue-type/`,
8976
- payload: offlineIssueTypeTeamLink,
8977
- blockers: [payload.team, payload.issue_type],
8978
- blocks: [offlineIssueTypeTeamLink.offline_id]
8979
- });
8980
- promise.then((createdIssueTypeLink) => {
8981
- store.dispatch(setIssueTypeTeamLink(createdIssueTypeLink));
8982
- }).catch(() => {
8983
- store.dispatch(deleteIssueTypeTeamLink(offlineIssueTypeTeamLink.offline_id));
8984
- });
8985
- return [offlineIssueTypeTeamLink, promise];
8986
- }
8987
- delete(issueTypeTeamLinkId) {
8988
- const { store } = this.client;
8989
- const issueTypeTeamLink = store.getState().issueTypeTeamLinkReducer.issueTypeTeamLinks[issueTypeTeamLinkId];
8990
- if (!issueTypeTeamLink) {
8991
- throw new Error(`No issue type team link found for ${issueTypeTeamLinkId}`);
8992
- }
8993
- store.dispatch(deleteIssueTypeTeamLink(issueTypeTeamLinkId));
8994
- const promise = this.enqueueRequest({
8995
- method: HttpMethod.DELETE,
8996
- url: `/organizations/teams/issue-type-links/${issueTypeTeamLinkId}/`,
8997
- blockers: [issueTypeTeamLink.offline_id],
8998
- blocks: [issueTypeTeamLink.offline_id]
8999
- });
9000
- promise.catch(() => {
9001
- store.dispatch(setIssueTypeTeamLink(issueTypeTeamLink));
9002
- });
9003
- return promise;
9004
- }
9005
- async refreshStore() {
9006
- const { store } = this.client;
9007
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
9008
- if (!activeOrganizationId) {
9009
- throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
9010
- }
9011
- const result = await this.enqueueRequest({
9012
- method: HttpMethod.GET,
9013
- url: `/organizations/${activeOrganizationId}/teams/issue-type-links/`,
9014
- blockers: [],
9015
- blocks: []
9016
- });
9017
- store.dispatch(setIssueTypeTeamLinks(result));
9018
- }
9019
- }
9020
- class UserFormTeamLinkService extends BaseApiService {
9021
- add(payload) {
9022
- const { store } = this.client;
9023
- const offlineUserFormTeamLink = offline({
9024
- ...payload,
9025
- submitted_at: (/* @__PURE__ */ new Date()).toISOString()
9026
- });
9027
- store.dispatch(addUserFormTeamLink(offlineUserFormTeamLink));
9028
- const promise = this.enqueueRequest({
9029
- method: HttpMethod.POST,
9030
- url: `/organizations/teams/${payload.team}/link-form/`,
9031
- payload: offlineUserFormTeamLink,
9032
- blockers: [payload.team, payload.form],
9033
- blocks: [offlineUserFormTeamLink.offline_id]
9034
- });
9035
- promise.then((createdUserFormLink) => {
9036
- store.dispatch(setUserFormTeamLink(createdUserFormLink));
9037
- }).catch(() => {
9038
- store.dispatch(deleteUserFormTeamLink(offlineUserFormTeamLink.offline_id));
9039
- });
9040
- return [offlineUserFormTeamLink, promise];
9041
- }
9042
- delete(userFormTeamLinkId) {
9043
- const { store } = this.client;
9044
- const userFormTeamLink = store.getState().userFormTeamLinkReducer.userFormTeamLinks[userFormTeamLinkId];
9045
- if (!userFormTeamLink) {
9046
- throw new Error(`No user form team link found for ${userFormTeamLinkId}`);
9047
- }
9048
- store.dispatch(deleteUserFormTeamLink(userFormTeamLinkId));
9049
- const promise = this.enqueueRequest({
9050
- method: HttpMethod.DELETE,
9051
- url: `/organizations/teams/form-links/${userFormTeamLinkId}/`,
9052
- blockers: [userFormTeamLink.offline_id],
9053
- blocks: [userFormTeamLink.offline_id]
9054
- });
9055
- promise.catch(() => {
9056
- store.dispatch(setUserFormTeamLink(userFormTeamLink));
9057
- });
9058
- return promise;
9059
- }
9060
- async refreshStore() {
9061
- const { store } = this.client;
9062
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
9063
- if (!activeOrganizationId) {
9064
- throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
9065
- }
9066
- const result = await this.enqueueRequest({
9067
- method: HttpMethod.GET,
9068
- url: `/organizations/${activeOrganizationId}/teams/form-links/`,
9069
- blockers: [],
9070
- blocks: []
9071
- });
9072
- store.dispatch(setUserFormTeamLinks(result));
9073
- }
9074
- }
9075
8521
  class OvermapSDK {
9076
8522
  constructor(apiUrl, store) {
9077
8523
  __publicField(this, "API_URL");
9078
8524
  __publicField(this, "store");
9079
8525
  __publicField(this, "agent", new AgentService(this));
9080
8526
  __publicField(this, "files", new FileService(this));
9081
- __publicField(this, "attachments", new AttachmentService(this));
9082
8527
  __publicField(this, "auth", new AuthService(this));
9083
8528
  __publicField(this, "categories", new CategoryService(this));
9084
8529
  __publicField(this, "projectAccesses", new ProjectAccessService(this));
@@ -9088,24 +8533,26 @@ var __publicField = (obj, key, value) => {
9088
8533
  __publicField(this, "issueTypes", new IssueTypeService(this));
9089
8534
  __publicField(this, "issueComments", new IssueCommentService(this));
9090
8535
  __publicField(this, "issueUpdates", new IssueUpdateService(this));
8536
+ __publicField(this, "issueAttachments", new IssueAttachmentService(this));
9091
8537
  __publicField(this, "workspaces", new WorkspaceService(this));
9092
8538
  __publicField(this, "main", new MainService(this));
9093
8539
  __publicField(this, "components", new ComponentService(this));
8540
+ __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
9094
8541
  __publicField(this, "componentTypes", new ComponentTypeService(this));
8542
+ __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
9095
8543
  __publicField(this, "componentStages", new ComponentStageService(this));
9096
8544
  __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
9097
8545
  __publicField(this, "userForms", new UserFormService(this));
9098
8546
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
9099
8547
  __publicField(this, "projects", new ProjectService(this));
9100
8548
  __publicField(this, "projectFiles", new ProjectFileService(this));
8549
+ __publicField(this, "projectAttachments", new ProjectAttachmentService(this));
9101
8550
  __publicField(this, "emailVerification", new EmailVerificationService(this));
9102
8551
  __publicField(this, "emailDomains", new EmailDomainsService(this));
9103
8552
  __publicField(this, "licenses", new LicenseService(this));
9104
8553
  __publicField(this, "documents", new DocumentService(this));
9105
8554
  __publicField(this, "teams", new TeamService(this));
9106
- __publicField(this, "documentTeamLinks", new DocumentTeamLinkService(this));
9107
- __publicField(this, "issueTypeTeamLinks", new IssueTypeTeamLinkService(this));
9108
- __publicField(this, "userFormTeamLinks", new UserFormTeamLinkService(this));
8555
+ __publicField(this, "documentAttachments", new DocumentAttachmentService(this));
9109
8556
  this.API_URL = apiUrl;
9110
8557
  this.store = store;
9111
8558
  }
@@ -9287,406 +8734,152 @@ var __publicField = (obj, key, value) => {
9287
8734
  saveAs(blob, name);
9288
8735
  },
9289
8736
  [name, file]
9290
- );
9291
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9292
- /* @__PURE__ */ jsxRuntime.jsx(
9293
- "button",
9294
- {
9295
- className: styles$c.FullScreenImageContainer,
9296
- type: "button",
9297
- onClick: () => {
9298
- setShowPreview(false);
9299
- },
9300
- children: /* @__PURE__ */ jsxRuntime.jsx(
9301
- "img",
9302
- {
9303
- className: styles$c.FullScreenImage,
9304
- src: url,
9305
- alt: name,
9306
- onClick: (e) => {
9307
- e.stopPropagation();
9308
- }
9309
- }
9310
- )
9311
- }
9312
- ),
9313
- /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.TopBarContainer, align: "center", children: [
9314
- /* @__PURE__ */ jsxRuntime.jsx(
9315
- blocks.IconButton,
9316
- {
9317
- className: styles$c.longIconButton,
9318
- variant: "soft",
9319
- "aria-label": "Exit preview",
9320
- onClick: () => {
9321
- setShowPreview(false);
9322
- },
9323
- children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiArrowLeftLine" })
9324
- }
9325
- ),
9326
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.fileName, children: name }),
9327
- /* @__PURE__ */ jsxRuntime.jsx(
9328
- blocks.IconButton,
9329
- {
9330
- className: styles$c.longIconButton,
9331
- variant: "soft",
9332
- "aria-label": `Download ${name}`,
9333
- onClick: handleDownload,
9334
- children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiDownload2Line" })
9335
- }
9336
- )
9337
- ] })
9338
- ] });
9339
- });
9340
- FullScreenImagePreview.displayName = "FullScreenImagePreview";
9341
- const InputWithLabel = (props) => {
9342
- const { label, children, size, severity, inputId, labelId, image, flexProps } = props;
9343
- const [resolvedImage, setResolvedImage] = React.useState(void 0);
9344
- const [showImagePreview, setShowImagePreview] = React.useState(false);
9345
- React.useEffect(() => {
9346
- if (image instanceof Promise) {
9347
- image.then(setResolvedImage).catch(console.error);
9348
- } else {
9349
- setResolvedImage(image);
9350
- }
9351
- }, [image]);
9352
- const resolvedImageURL = resolvedImage ? URL.createObjectURL(resolvedImage) : void 0;
9353
- return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", children: [
9354
- resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9355
- /* @__PURE__ */ jsxRuntime.jsx(
9356
- "img",
9357
- {
9358
- className: styles$c.previewImage,
9359
- src: resolvedImageURL,
9360
- alt: resolvedImage.name,
9361
- onClick: () => {
9362
- setShowImagePreview(true);
9363
- }
9364
- }
9365
- ),
9366
- showImagePreview && /* @__PURE__ */ jsxRuntime.jsx(
9367
- FullScreenImagePreview,
9368
- {
9369
- file: resolvedImage,
9370
- url: resolvedImageURL,
9371
- name: resolvedImage.name,
9372
- setShowPreview: setShowImagePreview
9373
- }
9374
- )
9375
- ] }),
9376
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", gap: "1", asChild: true, ...flexProps, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, children: [
9377
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size, severity, id: labelId, children: label }),
9378
- children
9379
- ] }) })
9380
- ] });
9381
- };
9382
- const InputWithHelpText = (props) => {
9383
- const { helpText, children, severity } = props;
9384
- return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
9385
- children,
9386
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$c.description, children: helpText }) })
9387
- ] });
9388
- };
9389
- const InputWithLabelAndHelpText = (props) => {
9390
- const { children, ...restProps } = props;
9391
- return /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { ...restProps, children });
9392
- };
9393
- const useFormikInput = (props) => {
9394
- const { id, field, formId: formId2, size, showInputOnly, ...rest } = props;
9395
- const [fieldProps, meta, helpers] = formik.useField(field.getId());
9396
- const { touched } = meta;
9397
- const helpText = meta.error ?? field.description;
9398
- const severity = meta.error ? "danger" : void 0;
9399
- const inputId = id ?? `${formId2}-${field.getId()}-input`;
9400
- const labelId = `${inputId}-label`;
9401
- const label = field.required ? `${field.label} *` : field.label;
9402
- const fieldPropsWithValidation = React.useMemo(() => {
9403
- const handleChange = (e) => {
9404
- const value = field.getValueFromChangeEvent(e);
9405
- void helpers.setValue(value, false).then();
9406
- if (touched || !field.onlyValidateAfterTouched) {
9407
- helpers.setError(field.getError(value));
9408
- }
9409
- };
9410
- const handleBlur = (e) => {
9411
- void helpers.setTouched(true, false).then();
9412
- helpers.setError(field.getError(field.getValueFromChangeEvent(e)));
9413
- };
9414
- return {
9415
- ...fieldProps,
9416
- onChange: handleChange,
9417
- onBlur: handleBlur
9418
- };
9419
- }, [field, fieldProps, helpers, touched]);
9420
- return [
9421
- {
9422
- helpText,
9423
- size,
9424
- severity,
9425
- inputId,
9426
- labelId,
9427
- label,
9428
- showInputOnly,
9429
- fieldProps: fieldPropsWithValidation,
9430
- helpers,
9431
- field
9432
- },
9433
- { ...rest, "aria-labelledby": labelId }
9434
- ];
9435
- };
9436
- const truthyValues = [true, "true"];
9437
- const BooleanInput = React.memo((props) => {
9438
- const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
9439
- let [{ helpText, label }] = useFormikInput(props);
9440
- helpText = showInputOnly ? null : helpText;
9441
- label = showInputOnly ? "" : label;
9442
- const color = blocks.useSeverityColor(severity);
9443
- const value = truthyValues.includes(fieldProps.value);
9444
- return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
9445
- InputWithLabel,
9446
- {
9447
- size,
9448
- severity,
9449
- inputId,
9450
- labelId,
9451
- label,
9452
- image: showInputOnly ? void 0 : field.image,
9453
- flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
9454
- children: /* @__PURE__ */ jsxRuntime.jsx(
9455
- blocks.Checkbox,
9456
- {
9457
- ...rest,
9458
- ...fieldProps,
9459
- id: inputId,
9460
- color,
9461
- value: value.toString(),
9462
- checked: value,
9463
- onCheckedChange: fieldProps.onChange,
9464
- onChange: void 0,
9465
- onBlur: void 0
9466
- }
9467
- )
9468
- }
9469
- ) });
9470
- });
9471
- BooleanInput.displayName = "BooleanInput";
9472
- var DefaultContext = {
9473
- color: void 0,
9474
- size: void 0,
9475
- className: void 0,
9476
- style: void 0,
9477
- attr: void 0
9478
- };
9479
- var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
9480
- var _excluded = ["attr", "size", "title"];
9481
- function _objectWithoutProperties(source, excluded) {
9482
- if (source == null)
9483
- return {};
9484
- var target = _objectWithoutPropertiesLoose(source, excluded);
9485
- var key, i;
9486
- if (Object.getOwnPropertySymbols) {
9487
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
9488
- for (i = 0; i < sourceSymbolKeys.length; i++) {
9489
- key = sourceSymbolKeys[i];
9490
- if (excluded.indexOf(key) >= 0)
9491
- continue;
9492
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
9493
- continue;
9494
- target[key] = source[key];
9495
- }
9496
- }
9497
- return target;
9498
- }
9499
- function _objectWithoutPropertiesLoose(source, excluded) {
9500
- if (source == null)
9501
- return {};
9502
- var target = {};
9503
- for (var key in source) {
9504
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9505
- if (excluded.indexOf(key) >= 0)
9506
- continue;
9507
- target[key] = source[key];
9508
- }
9509
- }
9510
- return target;
9511
- }
9512
- function _extends$1() {
9513
- _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
9514
- for (var i = 1; i < arguments.length; i++) {
9515
- var source = arguments[i];
9516
- for (var key in source) {
9517
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9518
- target[key] = source[key];
9519
- }
9520
- }
9521
- }
9522
- return target;
9523
- };
9524
- return _extends$1.apply(this, arguments);
9525
- }
9526
- function ownKeys(e, r) {
9527
- var t = Object.keys(e);
9528
- if (Object.getOwnPropertySymbols) {
9529
- var o = Object.getOwnPropertySymbols(e);
9530
- r && (o = o.filter(function(r2) {
9531
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
9532
- })), t.push.apply(t, o);
9533
- }
9534
- return t;
9535
- }
9536
- function _objectSpread(e) {
9537
- for (var r = 1; r < arguments.length; r++) {
9538
- var t = null != arguments[r] ? arguments[r] : {};
9539
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
9540
- _defineProperty(e, r2, t[r2]);
9541
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
9542
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
9543
- });
9544
- }
9545
- return e;
9546
- }
9547
- function _defineProperty(obj, key, value) {
9548
- key = _toPropertyKey(key);
9549
- if (key in obj) {
9550
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
9551
- } else {
9552
- obj[key] = value;
9553
- }
9554
- return obj;
9555
- }
9556
- function _toPropertyKey(t) {
9557
- var i = _toPrimitive(t, "string");
9558
- return "symbol" == typeof i ? i : i + "";
9559
- }
9560
- function _toPrimitive(t, r) {
9561
- if ("object" != typeof t || !t)
9562
- return t;
9563
- var e = t[Symbol.toPrimitive];
9564
- if (void 0 !== e) {
9565
- var i = e.call(t, r || "default");
9566
- if ("object" != typeof i)
9567
- return i;
9568
- throw new TypeError("@@toPrimitive must return a primitive value.");
9569
- }
9570
- return ("string" === r ? String : Number)(t);
9571
- }
9572
- function Tree2Element(tree) {
9573
- return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
9574
- key: i
9575
- }, node.attr), Tree2Element(node.child)));
9576
- }
9577
- function GenIcon(data) {
9578
- return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends$1({
9579
- attr: _objectSpread({}, data.attr)
9580
- }, props), Tree2Element(data.child));
9581
- }
9582
- function IconBase(props) {
9583
- var elem = (conf) => {
9584
- var {
9585
- attr,
9586
- size,
9587
- title: title2
9588
- } = props, svgProps = _objectWithoutProperties(props, _excluded);
9589
- var computedSize = size || conf.size || "1em";
9590
- var className;
9591
- if (conf.className)
9592
- className = conf.className;
9593
- if (props.className)
9594
- className = (className ? className + " " : "") + props.className;
9595
- return /* @__PURE__ */ React.createElement("svg", _extends$1({
9596
- stroke: "currentColor",
9597
- fill: "currentColor",
9598
- strokeWidth: "0"
9599
- }, conf.attr, attr, svgProps, {
9600
- className,
9601
- style: _objectSpread(_objectSpread({
9602
- color: props.color || conf.color
9603
- }, conf.style), props.style),
9604
- height: computedSize,
9605
- width: computedSize,
9606
- xmlns: "http://www.w3.org/2000/svg"
9607
- }), title2 && /* @__PURE__ */ React.createElement("title", null, title2), props.children);
9608
- };
9609
- return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
9610
- }
9611
- function RiArrowDownLine(props) {
9612
- 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);
9613
- }
9614
- function RiArrowUpLine(props) {
9615
- 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);
9616
- }
9617
- function RiCalendarLine(props) {
9618
- 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);
9619
- }
9620
- function RiQrCodeLine(props) {
9621
- 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);
9622
- }
9623
- function RiFileCopyLine(props) {
9624
- 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);
9625
- }
9626
- function RiAlignJustify(props) {
9627
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
9628
- }
9629
- function RiHashtag(props) {
9630
- 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);
9631
- }
9632
- function RiInputField(props) {
9633
- 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);
9634
- }
9635
- function RiListCheck(props) {
9636
- 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);
9637
- }
9638
- function RiImageLine(props) {
9639
- 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);
9640
- }
9641
- function RiCheckboxCircleLine(props) {
9642
- 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);
9643
- }
9644
- function RiCheckboxLine(props) {
9645
- 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);
9646
- }
9647
- function RiDeleteBin2Line(props) {
9648
- 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);
9649
- }
9650
- function RiMenuFoldLine(props) {
9651
- 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);
9652
- }
9653
- function RiUpload2Line(props) {
9654
- 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);
9655
- }
9656
- const emptyBooleanField = {
9657
- ...emptyBaseField,
9658
- type: "boolean"
8737
+ );
8738
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8739
+ /* @__PURE__ */ jsxRuntime.jsx(
8740
+ "button",
8741
+ {
8742
+ className: styles$c.FullScreenImageContainer,
8743
+ type: "button",
8744
+ onClick: () => {
8745
+ setShowPreview(false);
8746
+ },
8747
+ children: /* @__PURE__ */ jsxRuntime.jsx(
8748
+ "img",
8749
+ {
8750
+ className: styles$c.FullScreenImage,
8751
+ src: url,
8752
+ alt: name,
8753
+ onClick: (e) => {
8754
+ e.stopPropagation();
8755
+ }
8756
+ }
8757
+ )
8758
+ }
8759
+ ),
8760
+ /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.TopBarContainer, align: "center", children: [
8761
+ /* @__PURE__ */ jsxRuntime.jsx(
8762
+ blocks.IconButton,
8763
+ {
8764
+ className: styles$c.longIconButton,
8765
+ variant: "soft",
8766
+ "aria-label": "Exit preview",
8767
+ onClick: () => {
8768
+ setShowPreview(false);
8769
+ },
8770
+ children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiArrowLeftLine" })
8771
+ }
8772
+ ),
8773
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.fileName, children: name }),
8774
+ /* @__PURE__ */ jsxRuntime.jsx(
8775
+ blocks.IconButton,
8776
+ {
8777
+ className: styles$c.longIconButton,
8778
+ variant: "soft",
8779
+ "aria-label": `Download ${name}`,
8780
+ onClick: handleDownload,
8781
+ children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiDownload2Line" })
8782
+ }
8783
+ )
8784
+ ] })
8785
+ ] });
8786
+ });
8787
+ FullScreenImagePreview.displayName = "FullScreenImagePreview";
8788
+ const InputWithLabel = (props) => {
8789
+ const { label, children, size, severity, inputId, labelId, image, flexProps } = props;
8790
+ const [resolvedImage, setResolvedImage] = React.useState(void 0);
8791
+ const [showImagePreview, setShowImagePreview] = React.useState(false);
8792
+ React.useEffect(() => {
8793
+ if (image instanceof Promise) {
8794
+ image.then(setResolvedImage).catch(console.error);
8795
+ } else {
8796
+ setResolvedImage(image);
8797
+ }
8798
+ }, [image]);
8799
+ const resolvedImageURL = resolvedImage ? URL.createObjectURL(resolvedImage) : void 0;
8800
+ return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", children: [
8801
+ resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8802
+ /* @__PURE__ */ jsxRuntime.jsx(
8803
+ "img",
8804
+ {
8805
+ className: styles$c.previewImage,
8806
+ src: resolvedImageURL,
8807
+ alt: resolvedImage.name,
8808
+ onClick: () => {
8809
+ setShowImagePreview(true);
8810
+ }
8811
+ }
8812
+ ),
8813
+ showImagePreview && /* @__PURE__ */ jsxRuntime.jsx(
8814
+ FullScreenImagePreview,
8815
+ {
8816
+ file: resolvedImage,
8817
+ url: resolvedImageURL,
8818
+ name: resolvedImage.name,
8819
+ setShowPreview: setShowImagePreview
8820
+ }
8821
+ )
8822
+ ] }),
8823
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", gap: "1", asChild: true, ...flexProps, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, children: [
8824
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size, severity, id: labelId, children: label }),
8825
+ children
8826
+ ] }) })
8827
+ ] });
9659
8828
  };
9660
- const _BooleanField = class _BooleanField extends BaseField {
9661
- constructor(options) {
9662
- super({ ...options, type: "boolean" });
9663
- __publicField(this, "onlyValidateAfterTouched", false);
9664
- }
9665
- // if a BooleanField is required, `false` is considered blank
9666
- isBlank(value) {
9667
- return this.required && !value;
9668
- }
9669
- getValueFromChangeEvent(event) {
9670
- if (typeof event === "boolean")
9671
- return event;
9672
- return event.target.checked;
9673
- }
9674
- serialize() {
9675
- return super._serialize();
9676
- }
9677
- static deserialize(data) {
9678
- if (data.type !== "boolean")
9679
- throw new Error("Type mismatch.");
9680
- return new _BooleanField(data);
9681
- }
9682
- getInput(props) {
9683
- return /* @__PURE__ */ jsxRuntime.jsx(BooleanInput, { ...props, field: this });
9684
- }
8829
+ const InputWithHelpText = (props) => {
8830
+ const { helpText, children, severity } = props;
8831
+ return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
8832
+ children,
8833
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$c.description, children: helpText }) })
8834
+ ] });
8835
+ };
8836
+ const InputWithLabelAndHelpText = (props) => {
8837
+ const { children, ...restProps } = props;
8838
+ return /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { ...restProps, children });
8839
+ };
8840
+ const useFormikInput = (props) => {
8841
+ const { id, field, formId: formId2, size, showInputOnly, ...rest } = props;
8842
+ const [fieldProps, meta, helpers] = formik.useField(field.getId());
8843
+ const { touched } = meta;
8844
+ const helpText = meta.error ?? field.description;
8845
+ const severity = meta.error ? "danger" : void 0;
8846
+ const inputId = id ?? `${formId2}-${field.getId()}-input`;
8847
+ const labelId = `${inputId}-label`;
8848
+ const label = field.required ? `${field.label} *` : field.label;
8849
+ const fieldPropsWithValidation = React.useMemo(() => {
8850
+ const handleChange = (e) => {
8851
+ const value = field.getValueFromChangeEvent(e);
8852
+ void helpers.setValue(value, false).then();
8853
+ if (touched || !field.onlyValidateAfterTouched) {
8854
+ helpers.setError(field.getError(value));
8855
+ }
8856
+ };
8857
+ const handleBlur = (e) => {
8858
+ void helpers.setTouched(true, false).then();
8859
+ helpers.setError(field.getError(field.getValueFromChangeEvent(e)));
8860
+ };
8861
+ return {
8862
+ ...fieldProps,
8863
+ onChange: handleChange,
8864
+ onBlur: handleBlur
8865
+ };
8866
+ }, [field, fieldProps, helpers, touched]);
8867
+ return [
8868
+ {
8869
+ helpText,
8870
+ size,
8871
+ severity,
8872
+ inputId,
8873
+ labelId,
8874
+ label,
8875
+ showInputOnly,
8876
+ fieldProps: fieldPropsWithValidation,
8877
+ helpers,
8878
+ field
8879
+ },
8880
+ { ...rest, "aria-labelledby": labelId }
8881
+ ];
9685
8882
  };
9686
- __publicField(_BooleanField, "fieldTypeName", "Checkbox");
9687
- __publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
9688
- __publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
9689
- let BooleanField = _BooleanField;
9690
8883
  function getDefaultExportFromCjs(x) {
9691
8884
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
9692
8885
  }
@@ -9739,8 +8932,8 @@ var __publicField = (obj, key, value) => {
9739
8932
  })(classnames);
9740
8933
  var classnamesExports = classnames.exports;
9741
8934
  const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
9742
- function _extends() {
9743
- _extends = Object.assign ? Object.assign.bind() : function(target) {
8935
+ function _extends$1() {
8936
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
9744
8937
  for (var i = 1; i < arguments.length; i++) {
9745
8938
  var source = arguments[i];
9746
8939
  for (var key in source) {
@@ -9751,7 +8944,7 @@ var __publicField = (obj, key, value) => {
9751
8944
  }
9752
8945
  return target;
9753
8946
  };
9754
- return _extends.apply(this, arguments);
8947
+ return _extends$1.apply(this, arguments);
9755
8948
  }
9756
8949
  function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9757
8950
  return function handleEvent(event) {
@@ -9882,11 +9075,11 @@ var __publicField = (obj, key, value) => {
9882
9075
  } else
9883
9076
  return child;
9884
9077
  });
9885
- return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9078
+ return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9886
9079
  ref: forwardedRef
9887
9080
  }), /* @__PURE__ */ React.isValidElement(newElement) ? /* @__PURE__ */ React.cloneElement(newElement, void 0, newChildren) : null);
9888
9081
  }
9889
- return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9082
+ return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9890
9083
  ref: forwardedRef
9891
9084
  }), children);
9892
9085
  });
@@ -9964,7 +9157,7 @@ var __publicField = (obj, key, value) => {
9964
9157
  React.useEffect(() => {
9965
9158
  window[Symbol.for("radix-ui")] = true;
9966
9159
  }, []);
9967
- return /* @__PURE__ */ React.createElement(Comp, _extends({}, primitiveProps, {
9160
+ return /* @__PURE__ */ React.createElement(Comp, _extends$1({}, primitiveProps, {
9968
9161
  ref: forwardedRef
9969
9162
  }));
9970
9163
  });
@@ -10523,9 +9716,9 @@ var __publicField = (obj, key, value) => {
10523
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)) });
10524
9717
  });
10525
9718
  Inset.displayName = "Inset";
10526
- 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"];
10527
9720
  const headingPropDefs = {
10528
- size: { type: "enum", values: sizes$8, default: "6", responsive: true },
9721
+ size: { type: "enum", values: sizes$9, default: "6", responsive: true },
10529
9722
  weight: { ...weightProp, default: "bold" },
10530
9723
  align: alignProp,
10531
9724
  trim: trimProp,
@@ -10538,9 +9731,9 @@ var __publicField = (obj, key, value) => {
10538
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));
10539
9732
  });
10540
9733
  Heading.displayName = "Heading";
10541
- 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"];
10542
9735
  const textPropDefs = {
10543
- size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9736
+ size: { type: "enum", values: sizes$8, default: void 0, responsive: true },
10544
9737
  weight: weightProp,
10545
9738
  align: alignProp,
10546
9739
  trim: trimProp,
@@ -10553,11 +9746,11 @@ var __publicField = (obj, key, value) => {
10553
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));
10554
9747
  });
10555
9748
  Text.displayName = "Text";
10556
- const sizes$6 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
10557
- 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"];
10558
9751
  const codePropDefs = {
10559
- size: { type: "enum", values: sizes$6, default: void 0, responsive: true },
10560
- 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" },
10561
9754
  weight: weightProp,
10562
9755
  color: colorProp,
10563
9756
  highContrast: highContrastProp
@@ -10587,6 +9780,202 @@ var __publicField = (obj, key, value) => {
10587
9780
  value
10588
9781
  ]);
10589
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";
10590
9979
  function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
10591
9980
  const PROVIDER_NAME = name + "CollectionProvider";
10592
9981
  const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
@@ -10678,7 +10067,7 @@ var __publicField = (obj, key, value) => {
10678
10067
  scope: props.__scopeRovingFocusGroup
10679
10068
  }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
10680
10069
  scope: props.__scopeRovingFocusGroup
10681
- }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
10070
+ }, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends$1({}, props, {
10682
10071
  ref: forwardedRef
10683
10072
  }))));
10684
10073
  });
@@ -10734,7 +10123,7 @@ var __publicField = (obj, key, value) => {
10734
10123
  ),
10735
10124
  []
10736
10125
  )
10737
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10126
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10738
10127
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
10739
10128
  "data-orientation": orientation
10740
10129
  }, groupProps, {
@@ -10804,7 +10193,7 @@ var __publicField = (obj, key, value) => {
10804
10193
  id,
10805
10194
  focusable,
10806
10195
  active
10807
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
10196
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
10808
10197
  tabIndex: isCurrentTabStop ? 0 : -1,
10809
10198
  "data-orientation": context.orientation
10810
10199
  }, itemProps, {
@@ -10944,7 +10333,7 @@ var __publicField = (obj, key, value) => {
10944
10333
  onScrollbarYEnabledChange: setScrollbarYEnabled,
10945
10334
  onCornerWidthChange: setCornerWidth,
10946
10335
  onCornerHeightChange: setCornerHeight
10947
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10336
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10948
10337
  dir: direction
10949
10338
  }, scrollAreaProps, {
10950
10339
  ref: composedRefs,
@@ -10967,7 +10356,7 @@ var __publicField = (obj, key, value) => {
10967
10356
  dangerouslySetInnerHTML: {
10968
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}`
10969
10358
  }
10970
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10359
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10971
10360
  "data-radix-scroll-area-viewport": ""
10972
10361
  }, viewportProps, {
10973
10362
  ref: composedRefs,
@@ -11011,16 +10400,16 @@ var __publicField = (obj, key, value) => {
11011
10400
  onScrollbarXEnabledChange,
11012
10401
  onScrollbarYEnabledChange
11013
10402
  ]);
11014
- 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, {
11015
10404
  ref: forwardedRef,
11016
10405
  forceMount
11017
- })) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends({}, scrollbarProps, {
10406
+ })) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends$1({}, scrollbarProps, {
11018
10407
  ref: forwardedRef,
11019
10408
  forceMount
11020
- })) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({}, scrollbarProps, {
10409
+ })) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({}, scrollbarProps, {
11021
10410
  ref: forwardedRef,
11022
10411
  forceMount
11023
- })) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({}, scrollbarProps, {
10412
+ })) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({}, scrollbarProps, {
11024
10413
  ref: forwardedRef
11025
10414
  })) : null;
11026
10415
  });
@@ -11056,7 +10445,7 @@ var __publicField = (obj, key, value) => {
11056
10445
  ]);
11057
10446
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
11058
10447
  present: forceMount || visible
11059
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({
10448
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({
11060
10449
  "data-state": visible ? "visible" : "hidden"
11061
10450
  }, scrollbarProps, {
11062
10451
  ref: forwardedRef
@@ -11126,7 +10515,7 @@ var __publicField = (obj, key, value) => {
11126
10515
  ]);
11127
10516
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
11128
10517
  present: forceMount || state !== "hidden"
11129
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10518
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
11130
10519
  "data-state": state === "hidden" ? "hidden" : "visible"
11131
10520
  }, scrollbarProps, {
11132
10521
  ref: forwardedRef,
@@ -11156,7 +10545,7 @@ var __publicField = (obj, key, value) => {
11156
10545
  $57acba87d6e25586$var$useResizeObserver(context.content, handleResize);
11157
10546
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
11158
10547
  present: forceMount || visible
11159
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10548
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
11160
10549
  "data-state": visible ? "visible" : "hidden"
11161
10550
  }, scrollbarProps, {
11162
10551
  ref: forwardedRef
@@ -11190,7 +10579,7 @@ var __publicField = (obj, key, value) => {
11190
10579
  return $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes2, dir);
11191
10580
  }
11192
10581
  if (orientation === "horizontal")
11193
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends({}, commonProps, {
10582
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends$1({}, commonProps, {
11194
10583
  ref: forwardedRef,
11195
10584
  onThumbPositionChange: () => {
11196
10585
  if (context.viewport && thumbRef.current) {
@@ -11209,7 +10598,7 @@ var __publicField = (obj, key, value) => {
11209
10598
  }
11210
10599
  }));
11211
10600
  if (orientation === "vertical")
11212
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends({}, commonProps, {
10601
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends$1({}, commonProps, {
11213
10602
  ref: forwardedRef,
11214
10603
  onThumbPositionChange: () => {
11215
10604
  if (context.viewport && thumbRef.current) {
@@ -11241,7 +10630,7 @@ var __publicField = (obj, key, value) => {
11241
10630
  }, [
11242
10631
  ref
11243
10632
  ]);
11244
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10633
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
11245
10634
  "data-orientation": "horizontal"
11246
10635
  }, scrollbarProps, {
11247
10636
  ref: composeRefs,
@@ -11289,7 +10678,7 @@ var __publicField = (obj, key, value) => {
11289
10678
  }, [
11290
10679
  ref
11291
10680
  ]);
11292
- return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10681
+ return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
11293
10682
  "data-orientation": "vertical"
11294
10683
  }, scrollbarProps, {
11295
10684
  ref: composeRefs,
@@ -11385,7 +10774,7 @@ var __publicField = (obj, key, value) => {
11385
10774
  onThumbPointerUp: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerUp),
11386
10775
  onThumbPositionChange: handleThumbPositionChange,
11387
10776
  onThumbPointerDown: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerDown)
11388
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, scrollbarProps, {
10777
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, scrollbarProps, {
11389
10778
  ref: composeRefs,
11390
10779
  style: {
11391
10780
  position: "absolute",
@@ -11422,7 +10811,7 @@ var __publicField = (obj, key, value) => {
11422
10811
  const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, props.__scopeScrollArea);
11423
10812
  return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
11424
10813
  present: forceMount || scrollbarContext.hasThumb
11425
- }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends({
10814
+ }, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends$1({
11426
10815
  ref: forwardedRef
11427
10816
  }, thumbProps)));
11428
10817
  });
@@ -11462,7 +10851,7 @@ var __publicField = (obj, key, value) => {
11462
10851
  debounceScrollEnd,
11463
10852
  onThumbPositionChange
11464
10853
  ]);
11465
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10854
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
11466
10855
  "data-state": scrollbarContext.hasThumb ? "visible" : "hidden"
11467
10856
  }, thumbProps, {
11468
10857
  ref: composedRef,
@@ -11489,7 +10878,7 @@ var __publicField = (obj, key, value) => {
11489
10878
  const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, props.__scopeScrollArea);
11490
10879
  const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
11491
10880
  const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
11492
- return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends({}, props, {
10881
+ return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends$1({}, props, {
11493
10882
  ref: forwardedRef
11494
10883
  })) : null;
11495
10884
  });
@@ -11511,7 +10900,7 @@ var __publicField = (obj, key, value) => {
11511
10900
  context.onCornerWidthChange(width);
11512
10901
  setWidth(width);
11513
10902
  });
11514
- return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, cornerProps, {
10903
+ return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, cornerProps, {
11515
10904
  ref: forwardedRef,
11516
10905
  style: {
11517
10906
  width: width1,
@@ -11772,7 +11161,7 @@ var __publicField = (obj, key, value) => {
11772
11161
  scope: props.__scopeSlider
11773
11162
  }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.Slot, {
11774
11163
  scope: props.__scopeSlider
11775
- }, /* @__PURE__ */ React.createElement(SliderOrientation, _extends({
11164
+ }, /* @__PURE__ */ React.createElement(SliderOrientation, _extends$1({
11776
11165
  "aria-disabled": disabled,
11777
11166
  "data-disabled": disabled ? "" : void 0
11778
11167
  }, sliderProps, {
@@ -11854,7 +11243,7 @@ var __publicField = (obj, key, value) => {
11854
11243
  endEdge: isSlidingFromLeft ? "right" : "left",
11855
11244
  direction: isSlidingFromLeft ? 1 : -1,
11856
11245
  size: "width"
11857
- }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11246
+ }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11858
11247
  dir: direction,
11859
11248
  "data-orientation": "horizontal"
11860
11249
  }, sliderProps, {
@@ -11914,7 +11303,7 @@ var __publicField = (obj, key, value) => {
11914
11303
  endEdge: isSlidingFromBottom ? "top" : "bottom",
11915
11304
  size: "height",
11916
11305
  direction: isSlidingFromBottom ? 1 : -1
11917
- }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11306
+ }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11918
11307
  "data-orientation": "vertical"
11919
11308
  }, sliderProps, {
11920
11309
  ref,
@@ -11947,7 +11336,7 @@ var __publicField = (obj, key, value) => {
11947
11336
  const $faa2e61a3361514f$var$SliderImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
11948
11337
  const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
11949
11338
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
11950
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
11339
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, sliderProps, {
11951
11340
  ref: forwardedRef,
11952
11341
  onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
11953
11342
  if (event.key === "Home") {
@@ -11988,7 +11377,7 @@ var __publicField = (obj, key, value) => {
11988
11377
  const $faa2e61a3361514f$export$105594979f116971 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
11989
11378
  const { __scopeSlider, ...trackProps } = props;
11990
11379
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
11991
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11380
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11992
11381
  "data-disabled": context.disabled ? "" : void 0,
11993
11382
  "data-orientation": context.orientation
11994
11383
  }, trackProps, {
@@ -12008,7 +11397,7 @@ var __publicField = (obj, key, value) => {
12008
11397
  );
12009
11398
  const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
12010
11399
  const offsetEnd = 100 - Math.max(...percentages);
12011
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11400
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
12012
11401
  "data-orientation": context.orientation,
12013
11402
  "data-disabled": context.disabled ? "" : void 0
12014
11403
  }, rangeProps, {
@@ -12037,7 +11426,7 @@ var __publicField = (obj, key, value) => {
12037
11426
  thumb
12038
11427
  ]
12039
11428
  );
12040
- return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
11429
+ return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends$1({}, props, {
12041
11430
  ref: composedRefs,
12042
11431
  index: index2
12043
11432
  }));
@@ -12076,7 +11465,7 @@ var __publicField = (obj, key, value) => {
12076
11465
  }
12077
11466
  }, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
12078
11467
  scope: props.__scopeSlider
12079
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11468
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
12080
11469
  role: "slider",
12081
11470
  "aria-label": props["aria-label"] || label,
12082
11471
  "aria-valuemin": context.min,
@@ -12116,7 +11505,7 @@ var __publicField = (obj, key, value) => {
12116
11505
  prevValue,
12117
11506
  value
12118
11507
  ]);
12119
- return /* @__PURE__ */ React.createElement("input", _extends({
11508
+ return /* @__PURE__ */ React.createElement("input", _extends$1({
12120
11509
  style: {
12121
11510
  display: "none"
12122
11511
  }
@@ -12335,7 +11724,7 @@ var __publicField = (obj, key, value) => {
12335
11724
  scope: __scopeAvatar,
12336
11725
  imageLoadingStatus,
12337
11726
  onImageLoadingStatusChange: setImageLoadingStatus
12338
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, avatarProps, {
11727
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, avatarProps, {
12339
11728
  ref: forwardedRef
12340
11729
  })));
12341
11730
  });
@@ -12356,7 +11745,7 @@ var __publicField = (obj, key, value) => {
12356
11745
  imageLoadingStatus,
12357
11746
  handleLoadingStatusChange
12358
11747
  ]);
12359
- 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, {
12360
11749
  ref: forwardedRef,
12361
11750
  src
12362
11751
  })) : null;
@@ -12377,7 +11766,7 @@ var __publicField = (obj, key, value) => {
12377
11766
  }, [
12378
11767
  delayMs
12379
11768
  ]);
12380
- 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, {
12381
11770
  ref: forwardedRef
12382
11771
  })) : null;
12383
11772
  });
@@ -12481,7 +11870,7 @@ var __publicField = (obj, key, value) => {
12481
11870
  orientation,
12482
11871
  dir: direction,
12483
11872
  activationMode
12484
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11873
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12485
11874
  dir: direction,
12486
11875
  "data-orientation": orientation
12487
11876
  }, tabsProps, {
@@ -12493,13 +11882,13 @@ var __publicField = (obj, key, value) => {
12493
11882
  const { __scopeTabs, loop = true, ...listProps } = props;
12494
11883
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
12495
11884
  const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
12496
- return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
11885
+ return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends$1({
12497
11886
  asChild: true
12498
11887
  }, rovingFocusGroupScope, {
12499
11888
  orientation: context.orientation,
12500
11889
  dir: context.dir,
12501
11890
  loop
12502
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11891
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12503
11892
  role: "tablist",
12504
11893
  "aria-orientation": context.orientation
12505
11894
  }, listProps, {
@@ -12514,12 +11903,12 @@ var __publicField = (obj, key, value) => {
12514
11903
  const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
12515
11904
  const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
12516
11905
  const isSelected = value === context.value;
12517
- return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
11906
+ return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends$1({
12518
11907
  asChild: true
12519
11908
  }, rovingFocusGroupScope, {
12520
11909
  focusable: !disabled,
12521
11910
  active: isSelected
12522
- }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
11911
+ }), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
12523
11912
  type: "button",
12524
11913
  role: "tab",
12525
11914
  "aria-selected": isSelected,
@@ -12569,7 +11958,7 @@ var __publicField = (obj, key, value) => {
12569
11958
  {
12570
11959
  present: forceMount || isSelected
12571
11960
  },
12572
- ({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11961
+ ({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12573
11962
  "data-state": isSelected ? "active" : "inactive",
12574
11963
  "data-orientation": context.orientation,
12575
11964
  role: "tabpanel",
@@ -12629,6 +12018,260 @@ var __publicField = (obj, key, value) => {
12629
12018
  Trigger: TabsTrigger,
12630
12019
  Content: TabsContent
12631
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;
12632
12275
  const NumberInput = React.memo((props) => {
12633
12276
  const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12634
12277
  let [{ helpText, label }] = useFormikInput(props);
@@ -13734,7 +13377,7 @@ var __publicField = (obj, key, value) => {
13734
13377
  ] }),
13735
13378
  value && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "jade", size: "1", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
13736
13379
  ] }),
13737
- 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: [
13738
13381
  /* @__PURE__ */ jsxRuntime.jsx(Code, { color: "gray", highContrast: true, children: value }),
13739
13382
  /* @__PURE__ */ jsxRuntime.jsx(
13740
13383
  blocks.IconButton,
@@ -13774,9 +13417,7 @@ var __publicField = (obj, key, value) => {
13774
13417
  }
13775
13418
  );
13776
13419
  setIsScannerLoading(true);
13777
- qrScanner.start().then(() => {
13778
- setIsScannerLoading(false);
13779
- }).catch(() => {
13420
+ void qrScanner.start().finally(() => {
13780
13421
  setIsScannerLoading(false);
13781
13422
  });
13782
13423
  }, [onQrScan]);
@@ -16937,7 +16578,7 @@ var __publicField = (obj, key, value) => {
16937
16578
  }, Symbol.toStringTag, { value: "Module" }));
16938
16579
  exports2.APIError = APIError;
16939
16580
  exports2.AgentService = AgentService;
16940
- exports2.AttachmentService = AttachmentService;
16581
+ exports2.AttachmentModel = AttachmentModel;
16941
16582
  exports2.AuthService = AuthService;
16942
16583
  exports2.BaseApiService = BaseApiService;
16943
16584
  exports2.BaseField = BaseField;
@@ -16948,17 +16589,19 @@ var __publicField = (obj, key, value) => {
16948
16589
  exports2.ColorPicker = ColorPicker;
16949
16590
  exports2.Colors = Colors;
16950
16591
  exports2.ColorsToString = ColorsToString;
16592
+ exports2.ComponentAttachmentService = ComponentAttachmentService;
16951
16593
  exports2.ComponentService = ComponentService;
16952
16594
  exports2.ComponentStageColors = ComponentStageColors;
16953
16595
  exports2.ComponentStageCompletionService = ComponentStageCompletionService;
16954
16596
  exports2.ComponentStageService = ComponentStageService;
16597
+ exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
16955
16598
  exports2.ComponentTypeService = ComponentTypeService;
16956
16599
  exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
16957
16600
  exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
16958
16601
  exports2.DateField = DateField;
16959
16602
  exports2.DateInput = DateInput;
16603
+ exports2.DocumentAttachmentService = DocumentAttachmentService;
16960
16604
  exports2.DocumentService = DocumentService;
16961
- exports2.DocumentTeamLinkService = DocumentTeamLinkService;
16962
16605
  exports2.EmailDomainsService = EmailDomainsService;
16963
16606
  exports2.EmailVerificationService = EmailVerificationService;
16964
16607
  exports2.FieldSection = FieldSection;
@@ -16981,6 +16624,7 @@ var __publicField = (obj, key, value) => {
16981
16624
  exports2.InputWithHelpText = InputWithHelpText;
16982
16625
  exports2.InputWithLabel = InputWithLabel;
16983
16626
  exports2.InputWithLabelAndHelpText = InputWithLabelAndHelpText;
16627
+ exports2.IssueAttachmentService = IssueAttachmentService;
16984
16628
  exports2.IssueCommentService = IssueCommentService;
16985
16629
  exports2.IssuePriority = IssuePriority;
16986
16630
  exports2.IssueService = IssueService;
@@ -17013,6 +16657,7 @@ var __publicField = (obj, key, value) => {
17013
16657
  exports2.PatchFormProvider = PatchFormProvider;
17014
16658
  exports2.ProjectAccessLevel = ProjectAccessLevel;
17015
16659
  exports2.ProjectAccessService = ProjectAccessService;
16660
+ exports2.ProjectAttachmentService = ProjectAttachmentService;
17016
16661
  exports2.ProjectFileService = ProjectFileService;
17017
16662
  exports2.ProjectService = ProjectService;
17018
16663
  exports2.ProjectType = ProjectType;
@@ -17052,7 +16697,6 @@ var __publicField = (obj, key, value) => {
17052
16697
  exports2.addComponentsInBatches = addComponentsInBatches;
17053
16698
  exports2.addDocumentAttachment = addDocumentAttachment;
17054
16699
  exports2.addDocumentAttachments = addDocumentAttachments;
17055
- exports2.addDocumentTeamLink = addDocumentTeamLink;
17056
16700
  exports2.addDocuments = addDocuments;
17057
16701
  exports2.addEmailDomain = addEmailDomain;
17058
16702
  exports2.addFavouriteProjectId = addFavouriteProjectId;
@@ -17072,7 +16716,6 @@ var __publicField = (obj, key, value) => {
17072
16716
  exports2.addIssueComment = addIssueComment;
17073
16717
  exports2.addIssueComments = addIssueComments;
17074
16718
  exports2.addIssueType = addIssueType;
17075
- exports2.addIssueTypeTeamLink = addIssueTypeTeamLink;
17076
16719
  exports2.addIssueUpdate = addIssueUpdate;
17077
16720
  exports2.addIssueUpdates = addIssueUpdates;
17078
16721
  exports2.addIssues = addIssues;
@@ -17090,7 +16733,6 @@ var __publicField = (obj, key, value) => {
17090
16733
  exports2.addStages = addStages;
17091
16734
  exports2.addTeam = addTeam;
17092
16735
  exports2.addToRecentIssues = addToRecentIssues;
17093
- exports2.addUserFormTeamLink = addUserFormTeamLink;
17094
16736
  exports2.addUsers = addUsers;
17095
16737
  exports2.addWorkspace = addWorkspace;
17096
16738
  exports2.areArraysEqual = areArraysEqual;
@@ -17122,8 +16764,6 @@ var __publicField = (obj, key, value) => {
17122
16764
  exports2.defaultBadgeColor = defaultBadgeColor;
17123
16765
  exports2.defaultStore = defaultStore;
17124
16766
  exports2.deleteComponentType = deleteComponentType;
17125
- exports2.deleteDocumentTeamLink = deleteDocumentTeamLink;
17126
- exports2.deleteDocumentTeamLinks = deleteDocumentTeamLinks;
17127
16767
  exports2.deleteForm = deleteForm;
17128
16768
  exports2.deleteFormRevision = deleteFormRevision;
17129
16769
  exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
@@ -17133,19 +16773,13 @@ var __publicField = (obj, key, value) => {
17133
16773
  exports2.deleteFormSubmissionAttachment = deleteFormSubmissionAttachment;
17134
16774
  exports2.deleteFormSubmissionAttachments = deleteFormSubmissionAttachments;
17135
16775
  exports2.deleteFormSubmissions = deleteFormSubmissions;
17136
- exports2.deleteIssueTypeTeamLink = deleteIssueTypeTeamLink;
17137
- exports2.deleteIssueTypeTeamLinks = deleteIssueTypeTeamLinks;
17138
16776
  exports2.deleteProject = deleteProject;
17139
16777
  exports2.deleteTeam = deleteTeam;
17140
- exports2.deleteUserFormTeamLink = deleteUserFormTeamLink;
17141
- exports2.deleteUserFormTeamLinks = deleteUserFormTeamLinks;
17142
16778
  exports2.dequeue = dequeue;
17143
16779
  exports2.deserialize = deserialize;
17144
16780
  exports2.deserializeField = deserializeField;
17145
16781
  exports2.discard = discard;
17146
16782
  exports2.documentSlice = documentSlice;
17147
- exports2.documentTeamLinkReducer = documentTeamLinkReducer;
17148
- exports2.documentTeamLinkSlice = documentTeamLinkSlice;
17149
16783
  exports2.documentsReducer = documentsReducer;
17150
16784
  exports2.downloadFile = downloadFile;
17151
16785
  exports2.downloadInMemoryFile = downloadInMemoryFile;
@@ -17198,8 +16832,6 @@ var __publicField = (obj, key, value) => {
17198
16832
  exports2.issueToSearchResult = issueToSearchResult;
17199
16833
  exports2.issueTypeReducer = issueTypeReducer;
17200
16834
  exports2.issueTypeSlice = issueTypeSlice;
17201
- exports2.issueTypeTeamLinkReducer = issueTypeTeamLinkReducer;
17202
- exports2.issueTypeTeamLinkSlice = issueTypeTeamLinkSlice;
17203
16835
  exports2.licenseReducer = licenseReducer;
17204
16836
  exports2.licenseSlice = licenseSlice;
17205
16837
  exports2.linkStageToForm = linkStageToForm;
@@ -17256,6 +16888,7 @@ var __publicField = (obj, key, value) => {
17256
16888
  exports2.removeFavouriteProjectId = removeFavouriteProjectId;
17257
16889
  exports2.removeIssue = removeIssue;
17258
16890
  exports2.removeIssueAttachment = removeIssueAttachment;
16891
+ exports2.removeIssueAttachments = removeIssueAttachments;
17259
16892
  exports2.removeIssueComment = removeIssueComment;
17260
16893
  exports2.removeIssueComments = removeIssueComments;
17261
16894
  exports2.removeIssueType = removeIssueType;
@@ -17349,12 +16982,7 @@ var __publicField = (obj, key, value) => {
17349
16982
  exports2.selectDocument = selectDocument;
17350
16983
  exports2.selectDocumentAttachment = selectDocumentAttachment;
17351
16984
  exports2.selectDocumentAttachmentMapping = selectDocumentAttachmentMapping;
17352
- exports2.selectDocumentTeamLinks = selectDocumentTeamLinks;
17353
- exports2.selectDocumentTeamLinksMapping = selectDocumentTeamLinksMapping;
17354
- exports2.selectDocumentTeamLinksOfDocument = selectDocumentTeamLinksOfDocument;
17355
- exports2.selectDocumentTeamLinksOfTeam = selectDocumentTeamLinksOfTeam;
17356
16985
  exports2.selectDocuments = selectDocuments;
17357
- exports2.selectDocumentsLinkedToTeam = selectDocumentsLinkedToTeam;
17358
16986
  exports2.selectDocumentsMapping = selectDocumentsMapping;
17359
16987
  exports2.selectEmailDomainsAsMapping = selectEmailDomainsAsMapping;
17360
16988
  exports2.selectEnableClustering = selectEnableClustering;
@@ -17400,12 +17028,7 @@ var __publicField = (obj, key, value) => {
17400
17028
  exports2.selectIssueMapping = selectIssueMapping;
17401
17029
  exports2.selectIssueType = selectIssueType;
17402
17030
  exports2.selectIssueTypeMapping = selectIssueTypeMapping;
17403
- exports2.selectIssueTypeTeamLinkMapping = selectIssueTypeTeamLinkMapping;
17404
- exports2.selectIssueTypeTeamLinks = selectIssueTypeTeamLinks;
17405
- exports2.selectIssueTypeTeamLinksOfIssueType = selectIssueTypeTeamLinksOfIssueType;
17406
- exports2.selectIssueTypeTeamLinksOfTeam = selectIssueTypeTeamLinksOfTeam;
17407
17031
  exports2.selectIssueTypes = selectIssueTypes;
17408
- exports2.selectIssueTypesLinkedToTeam = selectIssueTypesLinkedToTeam;
17409
17032
  exports2.selectIssueTypesOfOrganization = selectIssueTypesOfOrganization;
17410
17033
  exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
17411
17034
  exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
@@ -17440,6 +17063,7 @@ var __publicField = (obj, key, value) => {
17440
17063
  exports2.selectProjectAccessForUser = selectProjectAccessForUser;
17441
17064
  exports2.selectProjectAccessUserMapping = selectProjectAccessUserMapping;
17442
17065
  exports2.selectProjectAccesses = selectProjectAccesses;
17066
+ exports2.selectProjectAttachment = selectProjectAttachment;
17443
17067
  exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
17444
17068
  exports2.selectProjectFileVisibility = selectProjectFileVisibility;
17445
17069
  exports2.selectProjectFiles = selectProjectFiles;
@@ -17468,21 +17092,13 @@ var __publicField = (obj, key, value) => {
17468
17092
  exports2.selectStagesFromStageIds = selectStagesFromStageIds;
17469
17093
  exports2.selectTeam = selectTeam;
17470
17094
  exports2.selectTeams = selectTeams;
17471
- exports2.selectTeamsLinkedToDocument = selectTeamsLinkedToDocument;
17472
- exports2.selectTeamsLinkedToIssueType = selectTeamsLinkedToIssueType;
17473
- exports2.selectTeamsLinkedToUserForm = selectTeamsLinkedToUserForm;
17474
17095
  exports2.selectTeamsMapping = selectTeamsMapping;
17475
17096
  exports2.selectTeamsOfOrganization = selectTeamsOfOrganization;
17476
17097
  exports2.selectTeamsOfUser = selectTeamsOfUser;
17477
17098
  exports2.selectUploadUrl = selectUploadUrl;
17478
17099
  exports2.selectUsedColors = selectUsedColors;
17479
17100
  exports2.selectUser = selectUser;
17480
- exports2.selectUserFormLinksOfForm = selectUserFormLinksOfForm;
17481
- exports2.selectUserFormLinksOfTeam = selectUserFormLinksOfTeam;
17482
17101
  exports2.selectUserFormRevisionAttachmentsMapping = selectUserFormRevisionAttachmentsMapping;
17483
- exports2.selectUserFormTeamLinkMapping = selectUserFormTeamLinkMapping;
17484
- exports2.selectUserFormTeamLinks = selectUserFormTeamLinks;
17485
- exports2.selectUserFormsLinkedToTeam = selectUserFormsLinkedToTeam;
17486
17102
  exports2.selectUsersAsMapping = selectUsersAsMapping;
17487
17103
  exports2.selectVisibleStatuses = selectVisibleStatuses;
17488
17104
  exports2.selectVisibleUserIds = selectVisibleUserIds;
@@ -17497,15 +17113,16 @@ var __publicField = (obj, key, value) => {
17497
17113
  exports2.setAppearance = setAppearance;
17498
17114
  exports2.setCategories = setCategories;
17499
17115
  exports2.setCenterMapToProject = setCenterMapToProject;
17116
+ exports2.setComponentAttachment = setComponentAttachment;
17500
17117
  exports2.setComponentAttachments = setComponentAttachments;
17118
+ exports2.setComponentTypeAttachment = setComponentTypeAttachment;
17501
17119
  exports2.setComponentTypeAttachments = setComponentTypeAttachments;
17502
17120
  exports2.setComponentTypes = setComponentTypes;
17503
17121
  exports2.setComponents = setComponents;
17504
17122
  exports2.setCreateProjectType = setCreateProjectType;
17505
17123
  exports2.setCurrentUser = setCurrentUser;
17124
+ exports2.setDocumentAttachment = setDocumentAttachment;
17506
17125
  exports2.setDocumentAttachments = setDocumentAttachments;
17507
- exports2.setDocumentTeamLink = setDocumentTeamLink;
17508
- exports2.setDocumentTeamLinks = setDocumentTeamLinks;
17509
17126
  exports2.setDocuments = setDocuments;
17510
17127
  exports2.setEmailDomains = setEmailDomains;
17511
17128
  exports2.setEnableClustering = setEnableClustering;
@@ -17521,12 +17138,11 @@ var __publicField = (obj, key, value) => {
17521
17138
  exports2.setIsFetchingInitialData = setIsFetchingInitialData;
17522
17139
  exports2.setIsImportingProjectFile = setIsImportingProjectFile;
17523
17140
  exports2.setIsLoading = setIsLoading;
17141
+ exports2.setIssueAttachment = setIssueAttachment;
17524
17142
  exports2.setIssueAttachments = setIssueAttachments;
17525
17143
  exports2.setIssueComment = setIssueComment;
17526
17144
  exports2.setIssueComments = setIssueComments;
17527
17145
  exports2.setIssueType = setIssueType;
17528
- exports2.setIssueTypeTeamLink = setIssueTypeTeamLink;
17529
- exports2.setIssueTypeTeamLinks = setIssueTypeTeamLinks;
17530
17146
  exports2.setIssueTypes = setIssueTypes;
17531
17147
  exports2.setIssueUpdates = setIssueUpdates;
17532
17148
  exports2.setIssues = setIssues;
@@ -17537,6 +17153,7 @@ var __publicField = (obj, key, value) => {
17537
17153
  exports2.setOrganizations = setOrganizations;
17538
17154
  exports2.setProfilePicture = setProfilePicture;
17539
17155
  exports2.setProjectAccesses = setProjectAccesses;
17156
+ exports2.setProjectAttachment = setProjectAttachment;
17540
17157
  exports2.setProjectAttachments = setProjectAttachments;
17541
17158
  exports2.setProjectFileVisible = setProjectFileVisible;
17542
17159
  exports2.setProjects = setProjects;
@@ -17548,8 +17165,6 @@ var __publicField = (obj, key, value) => {
17548
17165
  exports2.setTokens = setTokens;
17549
17166
  exports2.setTourStep = setTourStep;
17550
17167
  exports2.setUploadUrl = setUploadUrl;
17551
- exports2.setUserFormTeamLink = setUserFormTeamLink;
17552
- exports2.setUserFormTeamLinks = setUserFormTeamLinks;
17553
17168
  exports2.setUsers = setUsers;
17554
17169
  exports2.setVisibleStatuses = setVisibleStatuses;
17555
17170
  exports2.setVisibleUserIds = setVisibleUserIds;
@@ -17573,20 +17188,25 @@ var __publicField = (obj, key, value) => {
17573
17188
  exports2.updateActiveOrganization = updateActiveOrganization;
17574
17189
  exports2.updateComponent = updateComponent;
17575
17190
  exports2.updateComponentAttachment = updateComponentAttachment;
17191
+ exports2.updateComponentAttachments = updateComponentAttachments;
17576
17192
  exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
17193
+ exports2.updateComponentTypeAttachments = updateComponentTypeAttachments;
17577
17194
  exports2.updateDocumentAttachment = updateDocumentAttachment;
17195
+ exports2.updateDocumentAttachments = updateDocumentAttachments;
17578
17196
  exports2.updateDocuments = updateDocuments;
17579
17197
  exports2.updateFormSubmission = updateFormSubmission;
17580
17198
  exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
17581
17199
  exports2.updateFormSubmissions = updateFormSubmissions;
17582
17200
  exports2.updateIssue = updateIssue;
17583
17201
  exports2.updateIssueAttachment = updateIssueAttachment;
17202
+ exports2.updateIssueAttachments = updateIssueAttachments;
17584
17203
  exports2.updateIssueType = updateIssueType;
17585
17204
  exports2.updateLicense = updateLicense;
17586
17205
  exports2.updateOrCreateProject = updateOrCreateProject;
17587
17206
  exports2.updateOrganizationAccess = updateOrganizationAccess;
17588
17207
  exports2.updateProjectAccess = updateProjectAccess;
17589
17208
  exports2.updateProjectAttachment = updateProjectAttachment;
17209
+ exports2.updateProjectAttachments = updateProjectAttachments;
17590
17210
  exports2.updateStages = updateStages;
17591
17211
  exports2.updateTeam = updateTeam;
17592
17212
  exports2.useAppDispatch = useAppDispatch;
@@ -17598,8 +17218,6 @@ var __publicField = (obj, key, value) => {
17598
17218
  exports2.useFormikInput = useFormikInput;
17599
17219
  exports2.useMemoCompare = useMemoCompare;
17600
17220
  exports2.useSDK = useSDK;
17601
- exports2.userFormTeamLinkReducer = userFormTeamLinkReducer;
17602
- exports2.userFormTeamLinkSlice = userFormTeamLinkSlice;
17603
17221
  exports2.userReducer = userReducer;
17604
17222
  exports2.userSlice = userSlice;
17605
17223
  exports2.valueIsFile = valueIsFile;