@cuemath/leap 2.8.35-beta.0 → 2.8.36-beta-0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/features/communication/pub-sub/constants.js +2 -1
  2. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  3. package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
  4. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +63 -54
  5. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
  6. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +130 -117
  7. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  8. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js +71 -77
  9. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js.map +1 -1
  10. package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js +5 -4
  11. package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js.map +1 -1
  12. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js +8 -9
  13. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js.map +1 -1
  14. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js +10 -10
  15. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js.map +1 -1
  16. package/dist/features/milestone/milestone-resources/resources-assign/constant.js +6 -0
  17. package/dist/features/milestone/milestone-resources/resources-assign/constant.js.map +1 -0
  18. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js +27 -17
  19. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js.map +1 -1
  20. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js +13 -11
  21. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js.map +1 -1
  22. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js +40 -50
  23. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js.map +1 -1
  24. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js +13 -12
  25. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js.map +1 -1
  26. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +186 -143
  27. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
  28. package/dist/features/milestone/milestone-resources/resources-assign/utils.js +8 -4
  29. package/dist/features/milestone/milestone-resources/resources-assign/utils.js.map +1 -1
  30. package/dist/features/ui/theme/tab.js +2 -2
  31. package/dist/features/ui/theme/tab.js.map +1 -1
  32. package/dist/index.d.ts +10 -2
  33. package/package.json +1 -1
@@ -1,88 +1,78 @@
1
- import { jsxs as d, jsx as r, Fragment as A } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as r, Fragment as A } from "react/jsx-runtime";
2
2
  import E from "../../../../../node_modules/lodash.debounce/index.js";
3
- import { memo as I, useRef as _, useMemo as x, useEffect as b } from "react";
4
- import y from "../../../../../assets/line-icons/icons/sheet.js";
3
+ import { memo as _, useRef as y, useMemo as b, useEffect as x } from "react";
4
+ import C from "../../../../../assets/line-icons/icons/sheet.js";
5
5
  import N from "../../../../ui/layout/flex-view.js";
6
- import C from "../../../../ui/text/text.js";
7
- import X from "../comps/resource-item/resource-item.js";
8
- import { RESOURCE_ASSIGN_ANALYTICS_EVENTS as L } from "../resource-assign-analytics-events.js";
9
- import P from "./no-resource-screen.js";
10
- import { ResourceItemWrapper as T, ButtonWrapper as j, StyledButton as v } from "./resource-items-styled.js";
11
- const k = I((a) => {
6
+ import X from "../../../../ui/text/text.js";
7
+ import j from "../comps/resource-item/resource-item.js";
8
+ import { RESOURCE_ASSIGN_ANALYTICS_EVENTS as w } from "../resource-assign-analytics-events.js";
9
+ import L from "./no-resource-screen.js";
10
+ import { ResourceItemWrapper as a, ButtonWrapper as P, StyledButton as T } from "./resource-items-styled.js";
11
+ const k = _((u) => {
12
12
  const {
13
13
  pageNumber: t,
14
14
  totalPages: i,
15
15
  resourceItems: l,
16
16
  selectedResource: o,
17
- assigningInProgress: u,
17
+ assigningInProgress: f,
18
18
  isFilterAdded: p,
19
- onResourceAdditionOrDeletion: f,
20
- onResourceAssign: g,
21
- onViewResource: h,
22
- onPageNumberUpdate: m
23
- } = a, c = _(null), $ = x(
19
+ onResourceAdditionOrDeletion: g,
20
+ onResourceAssign: h,
21
+ onViewResource: $,
22
+ onPageNumberUpdate: d
23
+ } = u, c = y(null), R = b(
24
24
  () => ({
25
25
  node_ids: o.map(({ node_id: e }) => e)
26
26
  }),
27
27
  [o]
28
28
  );
29
- return b(() => {
29
+ return x(() => {
30
30
  const e = c.current;
31
31
  if (e) {
32
32
  const n = E(() => {
33
33
  const s = e ? e.scrollTop / (e.scrollHeight - e.clientHeight) : 0;
34
- t && i && s > 0.85 && t < i && m(t + 1);
34
+ t && i && s > 0.85 && t < i && d(t + 1);
35
35
  }, 300);
36
36
  return e.addEventListener("scroll", n), () => {
37
37
  e.removeEventListener("scroll", n);
38
38
  };
39
39
  }
40
- }, [c, t, i, m]), l.length === 0 ? p ? /* @__PURE__ */ d(N, { $height: "100%", $alignItems: "center", $justifyContent: "center", children: [
41
- /* @__PURE__ */ r(y, { opacity: 0.38 }),
42
- /* @__PURE__ */ r(C, { $renderAs: "ub1-bold", $color: "BLACK_T_38", children: "No sheets match the selected filters" })
43
- ] }) : /* @__PURE__ */ r(P, {}) : /* @__PURE__ */ d(A, { children: [
44
- /* @__PURE__ */ r(
45
- T,
46
- {
47
- $gapX: 1.5,
48
- $gutterX: 1.5,
49
- $flexGapX: 1.125,
50
- $height: "calc(100vh - 64px - 72px)",
51
- ref: c,
52
- children: l.map((e) => {
53
- const { id: n, node_id: s } = e, R = o.some((S) => S.node_id === s);
54
- return /* @__PURE__ */ r(
55
- X,
56
- {
57
- resource: e,
58
- onResourceAdditionOrDeletion: f,
59
- onViewResource: h,
60
- selected: R
61
- },
62
- `${n}_${s}`
63
- );
64
- })
65
- }
66
- ),
40
+ }, [c, t, i, d]), l.length === 0 ? p ? /* @__PURE__ */ m(N, { $height: "100%", $alignItems: "center", $justifyContent: "center", children: [
41
+ /* @__PURE__ */ r(C, { opacity: 0.38 }),
42
+ /* @__PURE__ */ r(X, { $renderAs: "ub1-bold", $color: "BLACK_T_38", children: "No sheets match the selected filters" })
43
+ ] }) : /* @__PURE__ */ r(a, { $alignItems: "center", $justifyContent: "center", $overflowHidden: !0, children: /* @__PURE__ */ r(L, {}) }) : /* @__PURE__ */ m(A, { children: [
44
+ /* @__PURE__ */ r(a, { $gapX: 1.5, $gutterX: 1.5, $flexGapX: 1.125, ref: c, children: l.map((e) => {
45
+ const { id: n, node_id: s } = e, I = o.some((S) => S.node_id === s);
46
+ return /* @__PURE__ */ r(
47
+ j,
48
+ {
49
+ resource: e,
50
+ onResourceAdditionOrDeletion: g,
51
+ onViewResource: $,
52
+ selected: I
53
+ },
54
+ `${n}_${s}`
55
+ );
56
+ }) }),
67
57
  o.length > 0 && /* @__PURE__ */ r(
68
- j,
58
+ P,
69
59
  {
70
60
  $flexDirection: "row",
71
61
  $justifyContent: "flex-end",
72
62
  $gapX: 1,
73
63
  $gutterX: 1,
74
64
  children: /* @__PURE__ */ r(
75
- v,
65
+ T,
76
66
  {
77
67
  renderAs: "primary",
78
68
  label: "Assign",
79
69
  shape: "square",
80
70
  size: "small",
81
71
  widthX: 8.5,
82
- analyticsLabel: L.RESOURCE_ASSIGNED,
83
- analyticsProps: $,
84
- onClick: g,
85
- busy: u
72
+ analyticsLabel: w.RESOURCE_ASSIGNED,
73
+ analyticsProps: R,
74
+ onClick: h,
75
+ busy: f
86
76
  }
87
77
  )
88
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resource-items.js","sources":["../../../../../../src/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.tsx"],"sourcesContent":["import type { IResourceItems } from './resource-items-types';\nimport type { FC } from 'react';\n\nimport debounce from 'lodash.debounce';\nimport { memo, useEffect, useMemo, useRef } from 'react';\n\nimport SheetIcon from '../../../../../assets/line-icons/icons/sheet';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ResourceItem from '../comps/resource-item/resource-item';\nimport { RESOURCE_ASSIGN_ANALYTICS_EVENTS } from '../resource-assign-analytics-events';\nimport NoResourceScreen from './no-resource-screen';\nimport * as Styled from './resource-items-styled';\n\nconst ResourceItems: FC<IResourceItems> = memo(props => {\n const {\n pageNumber,\n totalPages,\n resourceItems,\n selectedResource,\n assigningInProgress,\n isFilterAdded,\n onResourceAdditionOrDeletion,\n onResourceAssign,\n onViewResource,\n onPageNumberUpdate,\n } = props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const analyticsProps = useMemo(\n () => ({\n node_ids: selectedResource.map(({ node_id: nodeId }) => nodeId),\n }),\n [selectedResource],\n );\n\n useEffect(() => {\n const scrollElement = containerRef.current;\n\n if (scrollElement) {\n const handleScroll = debounce(() => {\n const scrollPercentage = scrollElement\n ? scrollElement.scrollTop / (scrollElement.scrollHeight - scrollElement.clientHeight)\n : 0;\n\n if (pageNumber && totalPages)\n if (scrollPercentage > 0.85 && pageNumber < totalPages) {\n onPageNumberUpdate(pageNumber + 1);\n }\n }, 300);\n\n scrollElement.addEventListener('scroll', handleScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', handleScroll);\n };\n }\n }, [containerRef, pageNumber, totalPages, onPageNumberUpdate]);\n\n if (resourceItems.length === 0) {\n return isFilterAdded ? (\n <FlexView $height=\"100%\" $alignItems=\"center\" $justifyContent=\"center\">\n <SheetIcon opacity={0.38} />\n <Text $renderAs=\"ub1-bold\" $color=\"BLACK_T_38\">\n No sheets match the selected filters\n </Text>\n </FlexView>\n ) : (\n <NoResourceScreen />\n );\n }\n\n return (\n <>\n <Styled.ResourceItemWrapper\n $gapX={1.5}\n $gutterX={1.5}\n $flexGapX={1.125}\n $height=\"calc(100vh - 64px - 72px)\"\n ref={containerRef}\n >\n {resourceItems.map(item => {\n const { id, node_id: nodeId } = item;\n const selected = selectedResource.some(resource => resource.node_id === nodeId);\n\n return (\n <ResourceItem\n key={`${id}_${nodeId}`}\n resource={item}\n onResourceAdditionOrDeletion={onResourceAdditionOrDeletion}\n onViewResource={onViewResource}\n selected={selected}\n />\n );\n })}\n </Styled.ResourceItemWrapper>\n\n {selectedResource.length > 0 && (\n <Styled.ButtonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.StyledButton\n renderAs=\"primary\"\n label=\"Assign\"\n shape=\"square\"\n size=\"small\"\n widthX={8.5}\n analyticsLabel={RESOURCE_ASSIGN_ANALYTICS_EVENTS.RESOURCE_ASSIGNED}\n analyticsProps={analyticsProps}\n onClick={onResourceAssign}\n busy={assigningInProgress}\n />\n </Styled.ButtonWrapper>\n )}\n </>\n );\n});\n\nexport default ResourceItems;\n"],"names":["ResourceItems","memo","props","pageNumber","totalPages","resourceItems","selectedResource","assigningInProgress","isFilterAdded","onResourceAdditionOrDeletion","onResourceAssign","onViewResource","onPageNumberUpdate","containerRef","useRef","analyticsProps","useMemo","nodeId","useEffect","scrollElement","handleScroll","debounce","scrollPercentage","FlexView","jsx","SheetIcon","Text","NoResourceScreen","jsxs","Fragment","Styled.ResourceItemWrapper","item","id","selected","resource","ResourceItem","Styled.ButtonWrapper","Styled.StyledButton","RESOURCE_ASSIGN_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAcM,MAAAA,IAAoCC,EAAK,CAASC,MAAA;AAChD,QAAA;AAAA,IACJ,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,8BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAV,GAEEW,IAAeC,EAAuB,IAAI,GAC1CC,IAAiBC;AAAA,IACrB,OAAO;AAAA,MACL,UAAUV,EAAiB,IAAI,CAAC,EAAE,SAASW,QAAaA,CAAM;AAAA,IAAA;AAAA,IAEhE,CAACX,CAAgB;AAAA,EAAA;AA0Bf,SAvBJY,EAAU,MAAM;AACd,UAAMC,IAAgBN,EAAa;AAEnC,QAAIM,GAAe;AACX,YAAAC,IAAeC,EAAS,MAAM;AAClC,cAAMC,IAAmBH,IACrBA,EAAc,aAAaA,EAAc,eAAeA,EAAc,gBACtE;AAEJ,QAAIhB,KAAcC,KACZkB,IAAmB,QAAQnB,IAAaC,KAC1CQ,EAAmBT,IAAa,CAAC;AAAA,SAEpC,GAAG;AAEQ,aAAAgB,EAAA,iBAAiB,UAAUC,CAAY,GAE9C,MAAM;AACG,QAAAD,EAAA,oBAAoB,UAAUC,CAAY;AAAA,MAAA;AAAA,IAE5D;AAAA,KACC,CAACP,GAAcV,GAAYC,GAAYQ,CAAkB,CAAC,GAEzDP,EAAc,WAAW,IACpBG,sBACJe,GAAS,EAAA,SAAQ,QAAO,aAAY,UAAS,iBAAgB,UAC5D,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,sBACzBC,GAAK,EAAA,WAAU,YAAW,QAAO,cAAa,UAE/C,wCAAA;AAAA,EACF,EAAA,CAAA,sBAECC,GAAiB,CAAA,CAAA,IAMlB,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAL;AAAA,MAACM;AAAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,SAAQ;AAAA,QACR,KAAKjB;AAAA,QAEJ,UAAAR,EAAc,IAAI,CAAQ0B,MAAA;AACzB,gBAAM,EAAE,IAAAC,GAAI,SAASf,EAAA,IAAWc,GAC1BE,IAAW3B,EAAiB,KAAK,CAAY4B,MAAAA,EAAS,YAAYjB,CAAM;AAG5E,iBAAA,gBAAAO;AAAA,YAACW;AAAA,YAAA;AAAA,cAEC,UAAUJ;AAAA,cACV,8BAAAtB;AAAA,cACA,gBAAAE;AAAA,cACA,UAAAsB;AAAA,YAAA;AAAA,YAJK,GAAGD,CAAE,IAAIf,CAAM;AAAA,UAAA;AAAA,QAKtB,CAEH;AAAA,MAAA;AAAA,IACH;AAAA,IAECX,EAAiB,SAAS,KACzB,gBAAAkB;AAAA,MAACY;AAAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,QAEV,UAAA,gBAAAZ;AAAA,UAACa;AAAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAK;AAAA,YACL,QAAQ;AAAA,YACR,gBAAgBC,EAAiC;AAAA,YACjD,gBAAAvB;AAAA,YACA,SAASL;AAAA,YACT,MAAMH;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"resource-items.js","sources":["../../../../../../src/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.tsx"],"sourcesContent":["import type { IResourceItems } from './resource-items-types';\nimport type { FC } from 'react';\n\nimport debounce from 'lodash.debounce';\nimport { memo, useEffect, useMemo, useRef } from 'react';\n\nimport SheetIcon from '../../../../../assets/line-icons/icons/sheet';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ResourceItem from '../comps/resource-item/resource-item';\nimport { RESOURCE_ASSIGN_ANALYTICS_EVENTS } from '../resource-assign-analytics-events';\nimport NoResourceScreen from './no-resource-screen';\nimport * as Styled from './resource-items-styled';\n\nconst ResourceItems: FC<IResourceItems> = memo(props => {\n const {\n pageNumber,\n totalPages,\n resourceItems,\n selectedResource,\n assigningInProgress,\n isFilterAdded,\n onResourceAdditionOrDeletion,\n onResourceAssign,\n onViewResource,\n onPageNumberUpdate,\n } = props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const analyticsProps = useMemo(\n () => ({\n node_ids: selectedResource.map(({ node_id: nodeId }) => nodeId),\n }),\n [selectedResource],\n );\n\n useEffect(() => {\n const scrollElement = containerRef.current;\n\n if (scrollElement) {\n const handleScroll = debounce(() => {\n const scrollPercentage = scrollElement\n ? scrollElement.scrollTop / (scrollElement.scrollHeight - scrollElement.clientHeight)\n : 0;\n\n if (pageNumber && totalPages)\n if (scrollPercentage > 0.85 && pageNumber < totalPages) {\n onPageNumberUpdate(pageNumber + 1);\n }\n }, 300);\n\n scrollElement.addEventListener('scroll', handleScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', handleScroll);\n };\n }\n }, [containerRef, pageNumber, totalPages, onPageNumberUpdate]);\n\n if (resourceItems.length === 0) {\n return isFilterAdded ? (\n <FlexView $height=\"100%\" $alignItems=\"center\" $justifyContent=\"center\">\n <SheetIcon opacity={0.38} />\n <Text $renderAs=\"ub1-bold\" $color=\"BLACK_T_38\">\n No sheets match the selected filters\n </Text>\n </FlexView>\n ) : (\n <Styled.ResourceItemWrapper $alignItems=\"center\" $justifyContent=\"center\" $overflowHidden>\n <NoResourceScreen />\n </Styled.ResourceItemWrapper>\n );\n }\n\n return (\n <>\n <Styled.ResourceItemWrapper $gapX={1.5} $gutterX={1.5} $flexGapX={1.125} ref={containerRef}>\n {resourceItems.map(item => {\n const { id, node_id: nodeId } = item;\n const selected = selectedResource.some(resource => resource.node_id === nodeId);\n\n return (\n <ResourceItem\n key={`${id}_${nodeId}`}\n resource={item}\n onResourceAdditionOrDeletion={onResourceAdditionOrDeletion}\n onViewResource={onViewResource}\n selected={selected}\n />\n );\n })}\n </Styled.ResourceItemWrapper>\n\n {selectedResource.length > 0 && (\n <Styled.ButtonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.StyledButton\n renderAs=\"primary\"\n label=\"Assign\"\n shape=\"square\"\n size=\"small\"\n widthX={8.5}\n analyticsLabel={RESOURCE_ASSIGN_ANALYTICS_EVENTS.RESOURCE_ASSIGNED}\n analyticsProps={analyticsProps}\n onClick={onResourceAssign}\n busy={assigningInProgress}\n />\n </Styled.ButtonWrapper>\n )}\n </>\n );\n});\n\nexport default ResourceItems;\n"],"names":["ResourceItems","memo","props","pageNumber","totalPages","resourceItems","selectedResource","assigningInProgress","isFilterAdded","onResourceAdditionOrDeletion","onResourceAssign","onViewResource","onPageNumberUpdate","containerRef","useRef","analyticsProps","useMemo","nodeId","useEffect","scrollElement","handleScroll","debounce","scrollPercentage","FlexView","jsx","SheetIcon","Text","Styled.ResourceItemWrapper","NoResourceScreen","jsxs","Fragment","item","id","selected","resource","ResourceItem","Styled.ButtonWrapper","Styled.StyledButton","RESOURCE_ASSIGN_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAcM,MAAAA,IAAoCC,EAAK,CAASC,MAAA;AAChD,QAAA;AAAA,IACJ,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,8BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAV,GAEEW,IAAeC,EAAuB,IAAI,GAC1CC,IAAiBC;AAAA,IACrB,OAAO;AAAA,MACL,UAAUV,EAAiB,IAAI,CAAC,EAAE,SAASW,QAAaA,CAAM;AAAA,IAAA;AAAA,IAEhE,CAACX,CAAgB;AAAA,EAAA;AA0Bf,SAvBJY,EAAU,MAAM;AACd,UAAMC,IAAgBN,EAAa;AAEnC,QAAIM,GAAe;AACX,YAAAC,IAAeC,EAAS,MAAM;AAClC,cAAMC,IAAmBH,IACrBA,EAAc,aAAaA,EAAc,eAAeA,EAAc,gBACtE;AAEJ,QAAIhB,KAAcC,KACZkB,IAAmB,QAAQnB,IAAaC,KAC1CQ,EAAmBT,IAAa,CAAC;AAAA,SAEpC,GAAG;AAEQ,aAAAgB,EAAA,iBAAiB,UAAUC,CAAY,GAE9C,MAAM;AACG,QAAAD,EAAA,oBAAoB,UAAUC,CAAY;AAAA,MAAA;AAAA,IAE5D;AAAA,KACC,CAACP,GAAcV,GAAYC,GAAYQ,CAAkB,CAAC,GAEzDP,EAAc,WAAW,IACpBG,sBACJe,GAAS,EAAA,SAAQ,QAAO,aAAY,UAAS,iBAAgB,UAC5D,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,sBACzBC,GAAK,EAAA,WAAU,YAAW,QAAO,cAAa,UAE/C,wCAAA;AAAA,EAAA,EACF,CAAA,IAEA,gBAAAF,EAACG,GAAA,EAA2B,aAAY,UAAS,iBAAgB,UAAS,iBAAe,IACvF,UAAA,gBAAAH,EAACI,KAAiB,EACpB,CAAA,IAMA,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAN,EAACG,GAAA,EAA2B,OAAO,KAAK,UAAU,KAAK,WAAW,OAAO,KAAKd,GAC3E,UAAAR,EAAc,IAAI,CAAQ0B,MAAA;AACzB,YAAM,EAAE,IAAAC,GAAI,SAASf,EAAA,IAAWc,GAC1BE,IAAW3B,EAAiB,KAAK,CAAY4B,MAAAA,EAAS,YAAYjB,CAAM;AAG5E,aAAA,gBAAAO;AAAA,QAACW;AAAA,QAAA;AAAA,UAEC,UAAUJ;AAAA,UACV,8BAAAtB;AAAA,UACA,gBAAAE;AAAA,UACA,UAAAsB;AAAA,QAAA;AAAA,QAJK,GAAGD,CAAE,IAAIf,CAAM;AAAA,MAAA;AAAA,IAOzB,CAAA,GACH;AAAA,IAECX,EAAiB,SAAS,KACzB,gBAAAkB;AAAA,MAACY;AAAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,QAEV,UAAA,gBAAAZ;AAAA,UAACa;AAAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAK;AAAA,YACL,QAAQ;AAAA,YACR,gBAAgBC,EAAiC;AAAA,YACjD,gBAAAvB;AAAA,YACA,SAASL;AAAA,YACT,MAAMH;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,7 +1,7 @@
1
- import t from "styled-components";
2
- import r from "../../../ui/layout/flex-view.js";
1
+ import r from "styled-components";
2
+ import t from "../../../ui/layout/flex-view.js";
3
3
  import i from "../../../ui/text/text.js";
4
- const a = t(r)(({ theme: o, $noBorder: e }) => {
4
+ const a = r(t)(({ theme: o, $noBorder: e }) => {
5
5
  const { WHITE_5: s } = o.colors;
6
6
  return `
7
7
  ${!e && `border-bottom: 1px solid ${s}`};
@@ -10,13 +10,14 @@ const a = t(r)(({ theme: o, $noBorder: e }) => {
10
10
  width: calc(100% - 48px);
11
11
  }
12
12
  `;
13
- }), c = t.div(({ theme: o }) => `
13
+ }), c = r.div(({ theme: o }) => `
14
14
  position: absolute;
15
15
  left: 0;
16
16
  right: 0;
17
17
  top: 0;
18
18
  bottom: 0;
19
- background: ${o.colors.BLACK_T_15};
19
+ background: ${o.colors.WHITE_T_15};
20
+ backdrop-filter: blur(8px);
20
21
  z-index: 2;
21
22
 
22
23
  & * {
@@ -32,31 +33,31 @@ const a = t(r)(({ theme: o, $noBorder: e }) => {
32
33
  height: ${o.layout.gutter * 5}px;
33
34
  filter: brightness(0);
34
35
  }
35
- `), d = t(i)`
36
+ `), d = r(i)`
36
37
  position: absolute;
37
38
  top: 72%;
38
39
  left: 50%;
39
40
  transform: translate(-50%, -50%);
40
- `, u = t(r)(({ theme: o }) => `
41
+ `, u = r(t)(({ theme: o }) => `
41
42
  overflow-y: auto;
42
43
  border-right: 1px solid ${o.colors.WHITE_5};
43
- `), b = t(r)`
44
+ `), b = r(t)`
44
45
  overflow-y: auto;
45
- `, m = t(r)(({ theme: o, $selected: e }) => `
46
+ `, x = r(t)(({ theme: o, $selected: e }) => `
46
47
  border-bottom-width: 1px;
47
48
  border-bottom-style: solid;
48
49
  border-bottom-color: ${e ? o.colors.BLACK : o.colors.WHITE_5};
49
50
  cursor: pointer;
50
- `), x = t(r)(() => `
51
+ `), f = r(t)(() => `
51
52
  min-width: 20px;
52
53
  `);
53
54
  export {
54
55
  b as FilterListWrapper,
55
- m as FilterTabWrapper,
56
+ x as FilterTabWrapper,
56
57
  a as HeaderWrapper,
57
58
  c as LoaderWrapper,
58
59
  d as NoResourceText,
59
- x as ResourceCountWrapper,
60
+ f as ResourceCountWrapper,
60
61
  u as SearchContainer
61
62
  };
62
63
  //# sourceMappingURL=resources-assign-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resources-assign-styled.js","sources":["../../../../../src/features/milestone/milestone-resources/resources-assign/resources-assign-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface IHeaderWrapper {\n $noBorder?: boolean;\n}\n\nconst HeaderWrapper = styled(FlexView)<IHeaderWrapper>(({ theme, $noBorder }) => {\n const { WHITE_5 } = theme.colors;\n\n return `\n ${!$noBorder && `border-bottom: 1px solid ${WHITE_5}`};\n\n & > div {\n width: calc(100% - 48px);\n }\n `;\n});\n\nconst LoaderWrapper = styled.div(({ theme }) => {\n return `\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: ${theme.colors.BLACK_T_15};\n z-index: 2;\n\n & * {\n pointer-events: none;\n }\n\n & img {\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${theme.layout.gutter * 5}px;\n height: ${theme.layout.gutter * 5}px;\n filter: brightness(0);\n }\n `;\n});\n\nconst NoResourceText = styled(Text)`\n position: absolute;\n top: 72%;\n left: 50%;\n transform: translate(-50%, -50%);\n`;\n\nconst SearchContainer = styled(FlexView)(({ theme }) => {\n return `\n overflow-y: auto;\n border-right: 1px solid ${theme.colors.WHITE_5};\n `;\n});\n\nconst FilterListWrapper = styled(FlexView)`\n overflow-y: auto;\n`;\n\ninterface IFilterTabWrapper {\n $selected: boolean;\n}\n\nconst FilterTabWrapper = styled(FlexView)<IFilterTabWrapper>(({ theme, $selected }) => {\n return `\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: ${$selected ? theme.colors.BLACK : theme.colors.WHITE_5};\n cursor: pointer;\n `;\n});\n\nconst ResourceCountWrapper = styled(FlexView)(() => {\n return `\n min-width: 20px;\n `;\n});\n\nexport {\n FilterListWrapper,\n FilterTabWrapper,\n HeaderWrapper,\n LoaderWrapper,\n NoResourceText,\n ResourceCountWrapper,\n SearchContainer,\n};\n"],"names":["HeaderWrapper","styled","FlexView","theme","$noBorder","WHITE_5","LoaderWrapper","NoResourceText","Text","SearchContainer","FilterListWrapper","FilterTabWrapper","$selected","ResourceCountWrapper"],"mappings":";;;AASM,MAAAA,IAAgBC,EAAOC,CAAQ,EAAkB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACzE,QAAA,EAAE,SAAAC,EAAQ,IAAIF,EAAM;AAEnB,SAAA;AAAA,MACH,CAACC,KAAa,4BAA4BC,CAAO,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAMzD,CAAC,GAEKC,IAAgBL,EAAO,IAAI,CAAC,EAAE,OAAAE,QAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMWA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAY1BA,EAAM,OAAO,SAAS,CAAC;AAAA,kBACtBA,EAAM,OAAO,SAAS,CAAC;AAAA;AAAA;AAAA,KAIxC,GAEKI,IAAiBN,EAAOO,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BC,IAAkBR,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QACnC;AAAA;AAAA,8BAEqBA,EAAM,OAAO,OAAO;AAAA,GAEjD,GAEKO,IAAoBT,EAAOC,CAAQ;AAAA;AAAA,GAQnCS,IAAmBV,EAAOC,CAAQ,EAAqB,CAAC,EAAE,OAAAC,GAAO,WAAAS,QAC9D;AAAA;AAAA;AAAA,2BAGkBA,IAAYT,EAAM,OAAO,QAAQA,EAAM,OAAO,OAAO;AAAA;AAAA,GAG/E,GAEKU,IAAuBZ,EAAOC,CAAQ,EAAE,MACrC;AAAA;AAAA,GAGR;"}
1
+ {"version":3,"file":"resources-assign-styled.js","sources":["../../../../../src/features/milestone/milestone-resources/resources-assign/resources-assign-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface IHeaderWrapper {\n $noBorder?: boolean;\n}\n\nconst HeaderWrapper = styled(FlexView)<IHeaderWrapper>(({ theme, $noBorder }) => {\n const { WHITE_5 } = theme.colors;\n\n return `\n ${!$noBorder && `border-bottom: 1px solid ${WHITE_5}`};\n\n & > div {\n width: calc(100% - 48px);\n }\n `;\n});\n\nconst LoaderWrapper = styled.div(({ theme }) => {\n return `\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: ${theme.colors.WHITE_T_15};\n backdrop-filter: blur(8px);\n z-index: 2;\n\n & * {\n pointer-events: none;\n }\n\n & img {\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${theme.layout.gutter * 5}px;\n height: ${theme.layout.gutter * 5}px;\n filter: brightness(0);\n }\n `;\n});\n\nconst NoResourceText = styled(Text)`\n position: absolute;\n top: 72%;\n left: 50%;\n transform: translate(-50%, -50%);\n`;\n\nconst SearchContainer = styled(FlexView)(({ theme }) => {\n return `\n overflow-y: auto;\n border-right: 1px solid ${theme.colors.WHITE_5};\n `;\n});\n\nconst FilterListWrapper = styled(FlexView)`\n overflow-y: auto;\n`;\n\ninterface IFilterTabWrapper {\n $selected: boolean;\n}\n\nconst FilterTabWrapper = styled(FlexView)<IFilterTabWrapper>(({ theme, $selected }) => {\n return `\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: ${$selected ? theme.colors.BLACK : theme.colors.WHITE_5};\n cursor: pointer;\n `;\n});\n\nconst ResourceCountWrapper = styled(FlexView)(() => {\n return `\n min-width: 20px;\n `;\n});\n\nexport {\n FilterListWrapper,\n FilterTabWrapper,\n HeaderWrapper,\n LoaderWrapper,\n NoResourceText,\n ResourceCountWrapper,\n SearchContainer,\n};\n"],"names":["HeaderWrapper","styled","FlexView","theme","$noBorder","WHITE_5","LoaderWrapper","NoResourceText","Text","SearchContainer","FilterListWrapper","FilterTabWrapper","$selected","ResourceCountWrapper"],"mappings":";;;AASM,MAAAA,IAAgBC,EAAOC,CAAQ,EAAkB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACzE,QAAA,EAAE,SAAAC,EAAQ,IAAIF,EAAM;AAEnB,SAAA;AAAA,MACH,CAACC,KAAa,4BAA4BC,CAAO,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAMzD,CAAC,GAEKC,IAAgBL,EAAO,IAAI,CAAC,EAAE,OAAAE,QAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMWA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAa1BA,EAAM,OAAO,SAAS,CAAC;AAAA,kBACtBA,EAAM,OAAO,SAAS,CAAC;AAAA;AAAA;AAAA,KAIxC,GAEKI,IAAiBN,EAAOO,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BC,IAAkBR,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QACnC;AAAA;AAAA,8BAEqBA,EAAM,OAAO,OAAO;AAAA,GAEjD,GAEKO,IAAoBT,EAAOC,CAAQ;AAAA;AAAA,GAQnCS,IAAmBV,EAAOC,CAAQ,EAAqB,CAAC,EAAE,OAAAC,GAAO,WAAAS,QAC9D;AAAA;AAAA;AAAA,2BAGkBA,IAAYT,EAAM,OAAO,QAAQA,EAAM,OAAO,OAAO;AAAA;AAAA,GAG/E,GAEKU,IAAuBZ,EAAOC,CAAQ,EAAE,MACrC;AAAA;AAAA,GAGR;"}
@@ -1,189 +1,232 @@
1
- import { jsx as r, jsxs as _ } from "react/jsx-runtime";
2
- import { memo as Z, useState as a, useCallback as l, useEffect as b } from "react";
3
- import { ILLUSTRATIONS as ee } from "../../../../assets/illustrations/illustrations.js";
4
- import re from "../../../../assets/line-icons/icons/back2.js";
5
- import se from "../../../ui/buttons/button/button.js";
6
- import { useUIContext as oe } from "../../../ui/context/context.js";
7
- import te from "../../../ui/inputs/searchable-input/searchable-input.js";
8
- import g from "../../../ui/layout/flex-view.js";
9
- import ne from "../../../ui/text/text.js";
10
- import ie from "./added-resource-and-filters.js";
11
- import { useGetSearchResource as ce } from "./api/get-resource.js";
12
- import { usePostMilestoneResource as ae } from "./api/goal-resource-assign.js";
13
- import { usePostLPARResource as le } from "./api/lpar-resource-assign.js";
14
- import { RESOURCE_ASSIGN_ANALYTICS_EVENTS as de } from "./resource-assign-analytics-events.js";
15
- import me from "./resource-items/resource-items.js";
16
- import { LoaderWrapper as ue, SearchContainer as pe, HeaderWrapper as ge } from "./resources-assign-styled.js";
17
- import { checkIfFiltersAreAdded as w } from "./utils.js";
18
- const he = Z((L) => {
1
+ import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
+ import { h as ie } from "../../../../node_modules/humanize-plus/dist/humanize.js";
3
+ import { memo as ce, useState as o, useRef as le, useCallback as g, useEffect as z, useMemo as M } from "react";
4
+ import ue from "../../../../assets/line-icons/icons/back2.js";
5
+ import de from "../../../ui/buttons/button/button.js";
6
+ import { useUIContext as he } from "../../../ui/context/context.js";
7
+ import me from "../../../ui/inputs/searchable-input/searchable-input.js";
8
+ import f from "../../../ui/layout/flex-view.js";
9
+ import pe from "../../../ui/loader/app-loader/app-loader.js";
10
+ import ge from "../../../ui/text/text.js";
11
+ import fe from "./added-resource-and-filters.js";
12
+ import { getResourceSearchAPI as Re } from "./api/get-resource.js";
13
+ import { usePostMilestoneResource as Ae } from "./api/goal-resource-assign.js";
14
+ import { usePostLPARResource as _e } from "./api/lpar-resource-assign.js";
15
+ import { RESOURCE_ASSIGN_ANALYTICS_EVENTS as Se } from "./resource-assign-analytics-events.js";
16
+ import Ie from "./resource-items/resource-items.js";
17
+ import { SearchContainer as Ce, HeaderWrapper as Ee, LoaderWrapper as Pe } from "./resources-assign-styled.js";
18
+ import { checkIfFiltersAreAdded as N, getCanShowDefaultLoadingScreen as $e } from "./utils.js";
19
+ const ye = ce((G) => {
19
20
  const {
20
- studentId: h,
21
- stream: U,
22
- onResourceAssign: S,
23
- onError: I,
24
- onExitResourceAssign: k,
25
- onViewResource: E,
26
- userMilestoneId: d,
27
- programId: m
28
- } = L, { onEvent: C } = oe(), [u, D] = a(1), [p, N] = a(""), [t, P] = a({
29
- stream: U,
30
- page: u,
21
+ studentId: l,
22
+ stream: w,
23
+ onResourceAssign: x,
24
+ onError: R,
25
+ onExitResourceAssign: H,
26
+ onViewResource: v,
27
+ userMilestoneId: u,
28
+ programId: d
29
+ } = G, { onEvent: D } = he(), [h, F] = o(1), [A, L] = o(""), [Q, O] = o(""), [i, S] = o({
30
+ stream: w,
31
+ page: h,
31
32
  per_page: 50,
32
- user_id: h,
33
- user_milestone_id: d,
34
- program_id: m
35
- }), [f, F] = a([]), [n, y] = a([]), $ = l(
33
+ user_id: l,
34
+ user_milestone_id: u,
35
+ program_id: d
36
+ }), [I, W] = o([]), [a, T] = o([]), [m, X] = o(), [C, E] = o(!1), [q, P] = o(!1), [$, B] = o({
37
+ boards: [],
38
+ grades: [],
39
+ node_types: []
40
+ }), c = le(null), k = g(
36
41
  (e) => {
37
- e ? I(e) : S();
42
+ if (e)
43
+ R(e);
44
+ else {
45
+ const r = `${ie.pluralize(a.length, "Resource")} ${a.length > 1 ? "have" : "has"} been assigned`;
46
+ x(r);
47
+ }
38
48
  },
39
- [I, S]
40
- ), {
41
- get: R,
42
- data: i,
43
- isProcessing: V,
44
- isProcessingFailed: j
45
- } = ce(), { post: x, isProcessing: v } = ae({
46
- onComplete: $
47
- }), { post: O, isProcessing: G } = le({
48
- onComplete: $
49
- }), H = (e) => {
50
- P((s) => ({ ...s, ...e }));
51
- }, T = l(
52
- (e, s) => {
49
+ [R, x, a]
50
+ ), { post: U, isProcessing: Y } = Ae({
51
+ onComplete: k
52
+ }), { post: V, isProcessing: J } = _e({
53
+ onComplete: k
54
+ }), K = (e) => {
55
+ S((r) => ({ ...r, ...e }));
56
+ }, j = g(
57
+ (e, r) => {
53
58
  if (e === "select") {
54
- const o = f.find((c) => c.node_id === s);
55
- o && y((c) => [...c, o]);
59
+ const s = I.find((n) => n.node_id === r);
60
+ s && T((n) => [...n, s]);
56
61
  } else
57
- y(
58
- (o) => o.filter((c) => c.node_id !== s)
62
+ T(
63
+ (s) => s.filter((n) => n.node_id !== r)
59
64
  );
60
65
  },
61
- [f]
62
- ), Q = (e) => {
63
- R("ep-dummy-id", {
64
- ...t,
65
- page: e
66
- }), D(e);
67
- }, W = (e) => {
68
- N(e);
69
- }, X = l(
66
+ [I]
67
+ ), Z = (e) => {
68
+ L(e);
69
+ }, ee = g(
70
70
  (e) => {
71
- C(de.RESOURCE_SEARCH_INPUT_VALUE, {
72
- search_term: p
73
- }), P((s) => ({
74
- ...s,
75
- search_term: e ? "" : p
71
+ D(Se.RESOURCE_SEARCH_INPUT_VALUE, {
72
+ search_term: A
73
+ }), S((r) => ({
74
+ ...r,
75
+ search_term: e ? "" : A
76
76
  }));
77
77
  },
78
- [p, C]
79
- ), A = l(() => {
80
- (w(t) || t.stream) && R("ep-dummy-id", t);
81
- }, [t, R]), z = l(() => {
82
- d ? x(
78
+ [A, D]
79
+ ), y = g(
80
+ async (e) => {
81
+ if (e || F(1), E(!0), N(i) || i.stream) {
82
+ c.current && c.current.abort();
83
+ const r = new AbortController();
84
+ c.current = r, await Re({
85
+ id: l,
86
+ query: e ? { ...i, page: e } : i,
87
+ meta: null,
88
+ abortSignal: c.current.signal
89
+ }).then((s) => {
90
+ if (s) {
91
+ const { __CODE__: n, __ERROR__: b, isProcessingFailed: ae } = s;
92
+ if (n >= 400 && n < 500)
93
+ R((b == null ? void 0 : b.message) ?? "Error while fetching the resource");
94
+ else if (n === 500)
95
+ P(ae), O("Internal server error, Please try again");
96
+ else {
97
+ const { data: p } = s || {};
98
+ p && (B({
99
+ boards: p.filters.boards,
100
+ grades: p.filters.grades,
101
+ node_types: p.filters.node_types
102
+ }), X(p), E(!1));
103
+ }
104
+ }
105
+ }).catch(() => {
106
+ E(!1), P(!0);
107
+ });
108
+ }
109
+ },
110
+ [l, i, c, R]
111
+ ), re = (e) => {
112
+ y(e), F(e);
113
+ }, se = () => {
114
+ P(!1), O(""), L(""), S({
115
+ stream: w,
116
+ page: h,
117
+ per_page: 50,
118
+ user_id: l,
119
+ user_milestone_id: u,
120
+ program_id: d
121
+ });
122
+ }, te = g(() => {
123
+ u ? U(
83
124
  {
84
- node_ids: n.map((e) => e.node_id)
125
+ node_ids: a.map((e) => e.node_id)
85
126
  },
86
- { userMilestoneId: d }
87
- ) : m && O(
127
+ { userMilestoneId: u }
128
+ ) : d && V(
88
129
  {
89
- nodes: n.map(({ node_id: e }) => ({
130
+ nodes: a.map(({ node_id: e }) => ({
90
131
  id: e,
91
132
  attempt_location: "ANY"
92
133
  })),
93
- program_id: m
134
+ program_id: d
94
135
  },
95
- { studentId: h }
136
+ { studentId: l }
96
137
  );
97
138
  }, [
98
- x,
139
+ U,
140
+ u,
141
+ a,
142
+ V,
99
143
  d,
100
- n,
101
- O,
102
- m,
103
- h
144
+ l
104
145
  ]);
105
- if (b(() => {
106
- A();
107
- }, [A]), b(() => {
108
- i && F((e) => {
109
- const s = u !== 1 ? [...e, ...i.results] : i.results;
110
- return Array.from(new Map(s.map((o) => [o.id, o])).values());
146
+ z(() => (y(), () => {
147
+ c.current && c.current.abort();
148
+ }), [y]), z(() => {
149
+ m && W((e) => {
150
+ const r = h !== 1 ? [...e, ...m.results] : m.results;
151
+ return Array.from(new Map(r.map((s) => [s.id, s])).values());
111
152
  });
112
- }, [i, u]), j)
113
- return /* @__PURE__ */ r(g, { $height: "100%", $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ _(g, { $flexGapX: 1.5, $alignItems: "center", $justifyContent: "center", children: [
114
- /* @__PURE__ */ r(ne, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
115
- /* @__PURE__ */ r(
116
- se,
117
- {
118
- widthX: 14,
119
- size: "small",
120
- shape: "square",
121
- renderAs: "primary",
122
- label: "Try again",
123
- analyticsLabel: "resource_get_api_failed",
124
- onClick: A
125
- }
126
- )
127
- ] }) });
128
- const { filters: B, total_pages: M = 0 } = i || {}, { boards: Y = [], grades: q = [], node_types: J = [] } = B || {}, K = w(t);
129
- return /* @__PURE__ */ _(g, { $flexDirection: "row", $height: "100vh", children: [
130
- V && /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r("img", { src: ee.LOADER_1, alt: "resource_loading" }) }),
131
- /* @__PURE__ */ _(pe, { $width: "60%", children: [
132
- /* @__PURE__ */ r(
133
- ge,
153
+ }, [m, h]);
154
+ const { total_pages: oe = 0 } = m || {}, ne = M(() => N(i), [i]);
155
+ return M(
156
+ () => $e(C, $),
157
+ [C, $]
158
+ ) ? /* @__PURE__ */ t(pe, { height: "100vh" }) : q ? /* @__PURE__ */ t(f, { $height: "100vh", $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ _(f, { $flexGapX: 1.5, $alignItems: "center", $justifyContent: "center", children: [
159
+ /* @__PURE__ */ t(ge, { $renderAs: "h6", children: Q || "Oops! Something went wrong. Please try again later." }),
160
+ /* @__PURE__ */ t(
161
+ de,
162
+ {
163
+ widthX: 14,
164
+ size: "small",
165
+ shape: "square",
166
+ renderAs: "primary",
167
+ label: "Try again",
168
+ analyticsLabel: "resource_get_api_failed",
169
+ onClick: se
170
+ }
171
+ )
172
+ ] }) }) : /* @__PURE__ */ _(f, { $flexDirection: "row", $height: "100vh", children: [
173
+ /* @__PURE__ */ _(Ce, { $width: "60%", children: [
174
+ /* @__PURE__ */ t(
175
+ Ee,
134
176
  {
135
177
  $heightX: 4,
136
178
  $background: "WHITE_3",
137
179
  $alignItems: "center",
138
180
  $justifyContent: "center",
139
- children: /* @__PURE__ */ r(
140
- te,
181
+ children: /* @__PURE__ */ t(
182
+ me,
141
183
  {
142
- value: p,
143
- onSearchTextChange: W,
184
+ value: A,
185
+ onSearchTextChange: Z,
144
186
  renderAs: "primary",
145
187
  width: "99%",
146
188
  size: "regular",
147
189
  label: "Type topic name...",
148
- onEnter: X,
190
+ onEnter: ee,
149
191
  searchOnClear: !0,
150
- onPrefixElementClick: k,
151
- prefixElement: /* @__PURE__ */ r(re, {})
192
+ onPrefixElementClick: H,
193
+ prefixElement: /* @__PURE__ */ t(ue, {})
152
194
  }
153
195
  )
154
196
  }
155
197
  ),
156
- /* @__PURE__ */ r(
157
- me,
158
- {
159
- resourceItems: f,
160
- selectedResource: n,
161
- pageNumber: u,
162
- totalPages: M,
163
- assigningInProgress: v || G,
164
- isFilterAdded: K,
165
- onResourceAdditionOrDeletion: T,
166
- onResourceAssign: z,
167
- onViewResource: E,
168
- onPageNumberUpdate: Q
169
- }
170
- )
198
+ /* @__PURE__ */ _(f, { $height: "calc(100vh - 64px)", $position: "relative", children: [
199
+ C && /* @__PURE__ */ t(Pe, {}),
200
+ /* @__PURE__ */ t(
201
+ Ie,
202
+ {
203
+ resourceItems: I,
204
+ selectedResource: a,
205
+ pageNumber: h,
206
+ totalPages: oe,
207
+ assigningInProgress: Y || J,
208
+ isFilterAdded: ne,
209
+ onResourceAdditionOrDeletion: j,
210
+ onResourceAssign: te,
211
+ onViewResource: v,
212
+ onPageNumberUpdate: re
213
+ }
214
+ )
215
+ ] })
171
216
  ] }),
172
- /* @__PURE__ */ r(g, { $width: "40%", children: /* @__PURE__ */ r(
173
- ie,
217
+ /* @__PURE__ */ t(f, { $width: "40%", children: /* @__PURE__ */ t(
218
+ fe,
174
219
  {
175
- boards: Y,
176
- grades: q,
177
- nodeTypes: J,
178
- selectedResources: n,
179
- onResourceDeSelection: T,
180
- onFilterUpdate: H,
181
- onViewResource: E
220
+ resourceFilters: $,
221
+ selectedResources: a,
222
+ onResourceDeSelection: j,
223
+ onFilterUpdate: K,
224
+ onViewResource: v
182
225
  }
183
226
  ) })
184
227
  ] });
185
- }), Ue = he;
228
+ }), We = ye;
186
229
  export {
187
- Ue as default
230
+ We as default
188
231
  };
189
232
  //# sourceMappingURL=resources-assign.js.map