@cuemath/leap 2.9.6-as3 → 2.9.6-as5

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 (26) hide show
  1. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +44 -43
  2. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
  3. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +31 -30
  4. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
  5. package/dist/features/chapters-v2/chapter-details/chapter-details.js +82 -55
  6. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  7. package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +6 -7
  8. package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
  9. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +1 -1
  10. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  11. package/dist/features/homework/hw-card-list/hw-card-list.js +23 -24
  12. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  13. package/dist/features/journey/hooks/use-chapter-journey.js +194 -0
  14. package/dist/features/journey/hooks/use-chapter-journey.js.map +1 -0
  15. package/dist/features/journey/journey-id/journey-id-student.js +2 -3
  16. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  17. package/dist/features/journey/journey-id/journey-id-teacher.js +5 -0
  18. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -0
  19. package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
  20. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  21. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +92 -97
  22. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  23. package/dist/index.d.ts +29 -4
  24. package/dist/index.js +140 -137
  25. package/dist/index.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { jsxs as b, jsx as g } from "react/jsx-runtime";
2
- import { memo as B } from "react";
3
- import I from "styled-components";
4
- import w from "../../../ui/layout/flex-view.js";
1
+ import { jsxs as b, jsx as n } from "react/jsx-runtime";
2
+ import { memo as I } from "react";
3
+ import w from "styled-components";
4
+ import E from "../../../ui/layout/flex-view.js";
5
5
  import S from "./block-section-view.js";
6
- const E = I(w)`
6
+ const G = w(E)`
7
7
  min-height: calc(
8
8
  100vh - 168px - 56px + 64px
9
9
  ); // 168 chapter banner, 56 header height , 64 bottom padding
@@ -11,70 +11,71 @@ const E = I(w)`
11
11
  &:last-child {
12
12
  padding-bottom: 64px;
13
13
  }
14
- `, O = B((_) => {
14
+ `, O = I((_) => {
15
15
  const {
16
- blocks: n,
16
+ blocks: i,
17
17
  imageHue: e,
18
- userType: i,
18
+ userType: c,
19
+ coreBlocksRef: u,
19
20
  onNodeAttempt: s,
20
- onNodeAttemptLocationChange: c,
21
- onNodeMarkAsDone: p,
22
- onNodeReattempt: r,
23
- onNodeReview: l,
24
- onNodeView: d,
25
- onBlockSkipUnskip: m
21
+ onNodeAttemptLocationChange: r,
22
+ onNodeMarkAsDone: l,
23
+ onNodeReattempt: d,
24
+ onNodeReview: p,
25
+ onNodeView: m,
26
+ onBlockSkipUnskip: a
26
27
  } = _;
27
- let a = 0;
28
- const k = n.filter(
28
+ let k = 0;
29
+ const h = i.filter(
29
30
  (o) => o.section_code === "GOALS" || o.section_code === "READINESS"
30
- ), h = n.filter(
31
+ ), f = i.filter(
31
32
  (o) => o.section_code !== "GOALS" && o.section_code !== "READINESS"
32
33
  );
33
34
  return /* @__PURE__ */ b(
34
- E,
35
+ G,
35
36
  {
36
37
  $width: "100%",
37
- $background: h.length ? "WHITE_1" : `${e}_1`,
38
+ $background: f.length ? "WHITE_1" : `${e}_1`,
38
39
  children: [
39
- k.map((o, t) => {
40
- const { block_type: u, block_id: x, is_skipped: A } = o;
41
- let f = 0;
42
- const N = t === k.length - 1;
43
- return u === "GOAL" && (A || (a += 1), f = a), /* @__PURE__ */ g(
40
+ /* @__PURE__ */ n("div", { ref: u, children: h.map((o, t) => {
41
+ const { block_type: x, block_id: A, is_skipped: B } = o;
42
+ let g = 0;
43
+ const N = t === h.length - 1;
44
+ return x === "GOAL" && (B || (k += 1), g = k), /* @__PURE__ */ n(
44
45
  S,
45
46
  {
46
47
  blockData: o,
47
- userType: i,
48
+ userType: c,
48
49
  isLastBlock: N,
49
- lessonIdx: f,
50
+ lessonIdx: g,
50
51
  imageHue: e,
51
52
  isGoalBlock: !0,
52
53
  onNodeAttempt: s,
53
- onNodeAttemptLocationChange: c,
54
- onNodeMarkAsDone: p,
55
- onNodeReattempt: r,
56
- onNodeReview: l,
57
- onNodeView: d,
58
- onBlockSkipUnskip: m
54
+ onNodeAttemptLocationChange: r,
55
+ onNodeMarkAsDone: l,
56
+ onNodeReattempt: d,
57
+ onNodeReview: p,
58
+ onNodeView: m,
59
+ onBlockSkipUnskip: a
59
60
  },
60
- x
61
+ A
61
62
  );
62
- }),
63
- h.map((o) => {
63
+ }) }),
64
+ f.map((o) => {
64
65
  const { block_id: t } = o;
65
- return /* @__PURE__ */ g(
66
+ return /* @__PURE__ */ n(
66
67
  S,
67
68
  {
68
69
  blockData: o,
69
- userType: i,
70
+ userType: c,
70
71
  imageHue: e,
71
72
  onNodeAttempt: s,
72
- onNodeAttemptLocationChange: c,
73
- onNodeMarkAsDone: p,
74
- onNodeReattempt: r,
75
- onNodeReview: l,
76
- onNodeView: d,
77
- onBlockSkipUnskip: m
73
+ onNodeAttemptLocationChange: r,
74
+ onNodeMarkAsDone: l,
75
+ onNodeReattempt: d,
76
+ onNodeReview: p,
77
+ onNodeView: m,
78
+ onBlockSkipUnskip: a
78
79
  },
79
80
  t
80
81
  );
@@ -1 +1 @@
1
- {"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport BlockSectionView from './block-section-view';\n\nconst ChapterDetailsWrapper = styled(FlexView)`\n min-height: calc(\n 100vh - 168px - 56px + 64px\n ); // 168 chapter banner, 56 header height , 64 bottom padding\n\n &:last-child {\n padding-bottom: 64px;\n }\n`;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n } = props;\n\n let lessonCount = 0;\n\n const goalBlocks = blocks.filter(\n block => block.section_code === 'GOALS' || block.section_code === 'READINESS',\n );\n\n const nonGoalBlocks = blocks.filter(\n block => block.section_code !== 'GOALS' && block.section_code !== 'READINESS',\n );\n\n return (\n <ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `${imageHue}_1` : 'WHITE_1'}\n >\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, is_skipped: isSkipped } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === 'GOAL') {\n if (!isSkipped) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId } = blockData;\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n </ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["ChapterDetailsWrapper","styled","FlexView","BlockSections","memo","props","blocks","imageHue","userType","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","lessonCount","goalBlocks","block","nonGoalBlocks","jsxs","blockData","idx","blockType","blockId","isSkipped","lessonIdx","isLastBlock","jsx","BlockSectionView"],"mappings":";;;;;AASA,MAAMA,IAAwBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUvCC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,EACE,IAAAV;AAEJ,MAAIW,IAAc;AAElB,QAAMC,IAAaX,EAAO;AAAA,IACxB,CAASY,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA,GAG9DC,IAAgBb,EAAO;AAAA,IAC3B,CAASY,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA;AAIlE,SAAA,gBAAAE;AAAA,IAACpB;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,aAAcmB,EAAc,SAA2B,YAAlB,GAAGZ,CAAQ;AAAA,MAE/C,UAAA;AAAA,QAAWU,EAAA,IAAI,CAACI,GAAWC,MAAQ;AAClC,gBAAM,EAAE,YAAYC,GAAW,UAAUC,GAAS,YAAYC,EAAc,IAAAJ;AAC5E,cAAIK,IAAY;AAEV,gBAAAC,IAAcL,MAAQL,EAAW,SAAS;AAEhD,iBAAIM,MAAc,WACXE,MACYT,KAAA,IAGLU,IAAAV,IAIZ,gBAAAY;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,WAAAR;AAAA,cACA,UAAAb;AAAA,cACA,aAAAmB;AAAA,cAEA,WAAAD;AAAA,cACA,UAAAnB;AAAA,cACA,aAAW;AAAA,cACX,eAAAE;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKS;AAAA,UAAA;AAAA,QAWP,CAEH;AAAA,QAEAL,EAAc,IAAI,CAAaE,MAAA;AACxB,gBAAA,EAAE,UAAUG,EAAY,IAAAH;AAG5B,iBAAA,gBAAAO;AAAA,YAACC;AAAA,YAAA;AAAA,cAEC,WAAAR;AAAA,cACA,UAAAb;AAAA,cACA,UAAAD;AAAA,cACA,eAAAE;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKS;AAAA,UAAA;AAAA,QAWP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport BlockSectionView from './block-section-view';\n\nconst ChapterDetailsWrapper = styled(FlexView)`\n min-height: calc(\n 100vh - 168px - 56px + 64px\n ); // 168 chapter banner, 56 header height , 64 bottom padding\n\n &:last-child {\n padding-bottom: 64px;\n }\n`;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n coreBlocksRef,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n } = props;\n\n let lessonCount = 0;\n\n const goalBlocks = blocks.filter(\n block => block.section_code === 'GOALS' || block.section_code === 'READINESS',\n );\n\n const nonGoalBlocks = blocks.filter(\n block => block.section_code !== 'GOALS' && block.section_code !== 'READINESS',\n );\n\n return (\n <ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `${imageHue}_1` : 'WHITE_1'}\n >\n <div ref={coreBlocksRef}>\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, is_skipped: isSkipped } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === 'GOAL') {\n if (!isSkipped) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n </div>\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId } = blockData;\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n </ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["ChapterDetailsWrapper","styled","FlexView","BlockSections","memo","props","blocks","imageHue","userType","coreBlocksRef","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","lessonCount","goalBlocks","block","nonGoalBlocks","jsxs","jsx","blockData","idx","blockType","blockId","isSkipped","lessonIdx","isLastBlock","BlockSectionView"],"mappings":";;;;;AASA,MAAMA,IAAwBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUvCC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,EACE,IAAAX;AAEJ,MAAIY,IAAc;AAElB,QAAMC,IAAaZ,EAAO;AAAA,IACxB,CAASa,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA,GAG9DC,IAAgBd,EAAO;AAAA,IAC3B,CAASa,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA;AAIlE,SAAA,gBAAAE;AAAA,IAACrB;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,aAAcoB,EAAc,SAA2B,YAAlB,GAAGb,CAAQ;AAAA,MAEhD,UAAA;AAAA,QAAA,gBAAAe,EAAC,SAAI,KAAKb,GACP,YAAW,IAAI,CAACc,GAAWC,MAAQ;AAClC,gBAAM,EAAE,YAAYC,GAAW,UAAUC,GAAS,YAAYC,EAAc,IAAAJ;AAC5E,cAAIK,IAAY;AAEV,gBAAAC,IAAcL,MAAQN,EAAW,SAAS;AAEhD,iBAAIO,MAAc,WACXE,MACYV,KAAA,IAGLW,IAAAX,IAIZ,gBAAAK;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,WAAAP;AAAA,cACA,UAAAf;AAAA,cACA,aAAAqB;AAAA,cAEA,WAAAD;AAAA,cACA,UAAArB;AAAA,cACA,aAAW;AAAA,cACX,eAAAG;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKU;AAAA,UAAA;AAAA,QAaV,CAAA,GACH;AAAA,QAECN,EAAc,IAAI,CAAaG,MAAA;AACxB,gBAAA,EAAE,UAAUG,EAAY,IAAAH;AAG5B,iBAAA,gBAAAD;AAAA,YAACQ;AAAA,YAAA;AAAA,cAEC,WAAAP;AAAA,cACA,UAAAf;AAAA,cACA,UAAAD;AAAA,cACA,eAAAG;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKU;AAAA,UAAA;AAAA,QAWP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,45 +1,46 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { memo as B, useMemo as d } from "react";
3
- import { ILLUSTRATIONS as D } from "../../../../assets/illustrations/illustrations.js";
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { memo as D, useMemo as d } from "react";
3
+ import { ILLUSTRATIONS as b } from "../../../../assets/illustrations/illustrations.js";
4
4
  import g from "../../../../assets/line-icons/icons/check2.js";
5
5
  import V from "../../../ui/image/image.js";
6
6
  import n from "../../../ui/layout/flex-view.js";
7
7
  import i from "../../../ui/text/text.js";
8
8
  import C from "../../comps/tag/tag.js";
9
9
  import { getChapterCompletionPercentage as W } from "../../utils/index.js";
10
- import { BannerContainer as b, BannerImageWrapper as M, BannerImage as O, ChapterProgressSVG as X, ChapterProgressSVGCircle as $, StyledImportantIcon as f, StyledCheckIcon as j, BannerTitleWrapper as H } from "./chapter-banner-styled.js";
11
- const a = 52, l = 54, c = 54, ee = B((I) => {
12
- const { progressStats: o, imageHue: S, title: x, imageUrl: u } = I, r = d(() => W(o), [o]), { iconTopVal: R, iconLeftVal: E } = d(() => {
13
- const h = (-(r === 100 ? 60 : r) * 3.6 - 180) * Math.PI / 180, P = c + a * Math.sin(h), A = l + a * Math.cos(h);
10
+ import { BannerContainer as M, BannerImageWrapper as O, BannerImage as X, ChapterProgressSVG as j, ChapterProgressSVGCircle as $, StyledImportantIcon as f, StyledCheckIcon as H, BannerTitleWrapper as N } from "./chapter-banner-styled.js";
11
+ const a = 52, l = 54, c = 54, re = D((I) => {
12
+ const { progressStats: o, imageHue: S, title: x, imageUrl: R, bannerRef: u } = I, t = d(() => W(o), [o]), { iconTopVal: E, iconLeftVal: w } = d(() => {
13
+ const h = (-(t === 100 ? 60 : t) * 3.6 - 180) * Math.PI / 180, A = c + a * Math.sin(h), B = l + a * Math.cos(h);
14
14
  return {
15
- iconLeftVal: P,
16
- iconTopVal: A
15
+ iconLeftVal: A,
16
+ iconTopVal: B
17
17
  };
18
- }, [r]);
18
+ }, [t]);
19
19
  if (!o) return null;
20
- const { mandatory: w, optional: T, classwork: _ } = o, { completed: k = 0, total: s = 0 } = w || {}, { completed: y = 0, total: p = 0 } = T || {}, { completed: G = 0, total: m = 0 } = _ || {}, L = m > 0 && G === m;
20
+ const { mandatory: T, optional: _, classwork: k } = o, { completed: y = 0, total: s = 0 } = T || {}, { completed: G = 0, total: p = 0 } = _ || {}, { completed: L = 0, total: m = 0 } = k || {}, P = m > 0 && L === m;
21
21
  return /* @__PURE__ */ e(
22
- b,
22
+ M,
23
23
  {
24
24
  $flexDirection: "row",
25
25
  $justifyContent: "center",
26
26
  $alignItems: "center",
27
27
  $widthX: 50,
28
28
  $background: `${S}_4`,
29
- children: /* @__PURE__ */ t(n, { $height: 168, $position: "relative", children: [
29
+ ref: u,
30
+ children: /* @__PURE__ */ r(n, { $height: 168, $position: "relative", children: [
30
31
  /* @__PURE__ */ e(
31
32
  V,
32
33
  {
33
34
  width: "100%",
34
35
  height: "168px",
35
- src: D.CHAPTER_HEADER_BG,
36
+ src: b.CHAPTER_HEADER_BG,
36
37
  alt: "Chapter header background",
37
38
  withLoader: !0
38
39
  }
39
40
  ),
40
- /* @__PURE__ */ t(M, { children: [
41
- /* @__PURE__ */ e(O, { src: u, alt: "Chapter image" }),
42
- /* @__PURE__ */ t(X, { width: "108px", height: "108px", children: [
41
+ /* @__PURE__ */ r(O, { children: [
42
+ /* @__PURE__ */ e(X, { src: R, alt: "Chapter image" }),
43
+ /* @__PURE__ */ r(j, { width: "108px", height: "108px", children: [
43
44
  /* @__PURE__ */ e(
44
45
  $,
45
46
  {
@@ -54,34 +55,34 @@ const a = 52, l = 54, c = 54, ee = B((I) => {
54
55
  {
55
56
  $progressCircle: !0,
56
57
  $progressBackground: "BLACK",
57
- $progress: 3.3 * r,
58
+ $progress: 3.3 * t,
58
59
  r: a,
59
60
  cx: l,
60
61
  cy: c
61
62
  }
62
63
  )
63
64
  ] }),
64
- r > 0 && /* @__PURE__ */ e(f, { $progress: !0, $top: R, $left: E }),
65
- r === 100 && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(C, { Icon: g }) })
65
+ t > 0 && /* @__PURE__ */ e(f, { $progress: !0, $top: E, $left: w }),
66
+ t === 100 && /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(C, { Icon: g }) })
66
67
  ] }),
67
- /* @__PURE__ */ t(H, { $flexGap: 4, children: [
68
+ /* @__PURE__ */ r(N, { $flexGap: 4, children: [
68
69
  /* @__PURE__ */ e(i, { $renderAs: "ah4-bold", children: x }),
69
- /* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 2.75, children: [
70
- !!s && /* @__PURE__ */ t(n, { $position: "relative", $flexDirection: "row", children: [
70
+ /* @__PURE__ */ r(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 2.75, children: [
71
+ !!s && /* @__PURE__ */ r(n, { $position: "relative", $flexDirection: "row", children: [
71
72
  /* @__PURE__ */ e(f, {}),
72
- /* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGap: 8, children: [
73
- /* @__PURE__ */ t(i, { $renderAs: "ab2", children: [
73
+ /* @__PURE__ */ r(n, { $flexDirection: "row", $alignItems: "center", $flexGap: 8, children: [
74
+ /* @__PURE__ */ r(i, { $renderAs: "ab2", children: [
74
75
  "Core - ",
75
- k,
76
+ y,
76
77
  "/",
77
78
  s
78
79
  ] }),
79
- L && /* @__PURE__ */ e(C, { Icon: g, label: "CW" })
80
+ P && /* @__PURE__ */ e(C, { Icon: g, label: "CW" })
80
81
  ] })
81
82
  ] }),
82
- p > 0 && /* @__PURE__ */ t(i, { $renderAs: "ab2", children: [
83
+ p > 0 && /* @__PURE__ */ r(i, { $renderAs: "ab2", children: [
83
84
  "Supplementary - ",
84
- y,
85
+ G,
85
86
  "/",
86
87
  p
87
88
  ] })
@@ -92,6 +93,6 @@ const a = 52, l = 54, c = 54, ee = B((I) => {
92
93
  );
93
94
  });
94
95
  export {
95
- ee as default
96
+ re as default
96
97
  };
97
98
  //# sourceMappingURL=chapter-banner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional, classwork: classWork } = progressStats;\n const { completed: completedMandatorySheets = 0, total: totalMandatorySheets = 0 } =\n mandatory || {};\n const { completed: completedOptionalSheets = 0, total: totalOptionalSheets = 0 } = optional || {};\n const { completed: completedClassWorkSheets = 0, total: totalClassWorkSheets = 0 } =\n classWork || {};\n const showClassWorkTag =\n totalClassWorkSheets > 0 && completedClassWorkSheets === totalClassWorkSheets;\n\n return (\n <Styled.BannerContainer\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $widthX={50}\n $background={`${imageHue}_4`}\n >\n <FlexView $height={168} $position=\"relative\">\n <Image\n width=\"100%\"\n height=\"168px\"\n src={ILLUSTRATIONS.CHAPTER_HEADER_BG}\n alt=\"Chapter header background\"\n withLoader\n />\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n <Styled.ChapterProgressSVG width=\"108px\" height=\"108px\">\n <Styled.ChapterProgressSVGCircle\n $progress={0}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground={'BLACK'}\n $progress={3.3 * completionPercentage}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n </Styled.ChapterProgressSVG>\n\n {completionPercentage > 0 && (\n <Styled.StyledImportantIcon $progress $top={iconTopVal} $left={iconLeftVal} />\n )}\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIcon>\n <Tag Icon={Check2Icon} />\n </Styled.StyledCheckIcon>\n )}\n </Styled.BannerImageWrapper>\n <Styled.BannerTitleWrapper $flexGap={4}>\n <Text $renderAs=\"ah4-bold\">{title}</Text>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={2.75}>\n {!!totalMandatorySheets && (\n <FlexView $position=\"relative\" $flexDirection=\"row\">\n <Styled.StyledImportantIcon />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={8}>\n <Text $renderAs=\"ab2\">\n Core - {completedMandatorySheets}/{totalMandatorySheets}\n </Text>\n {showClassWorkTag && <Tag Icon={Check2Icon} label=\"CW\" />}\n </FlexView>\n </FlexView>\n )}\n {totalOptionalSheets > 0 && (\n <Text $renderAs=\"ab2\">\n Supplementary - {completedOptionalSheets}/{totalOptionalSheets}\n </Text>\n )}\n </FlexView>\n </Styled.BannerTitleWrapper>\n </FlexView>\n </Styled.BannerContainer>\n );\n});\n\nexport default ChapterBanner;\n"],"names":["PROGRESS_CIRCLE_RADIUS","PROGRESS_CIRCLE_CENTER_X","PROGRESS_CIRCLE_CENTER_Y","ChapterBanner","memo","props","progressStats","imageHue","title","imageUrl","completionPercentage","useMemo","getChapterCompletionPercentage","iconTopVal","iconLeftVal","angleInRadian","positionX","positionY","mandatory","optional","classWork","completedMandatorySheets","totalMandatorySheets","completedOptionalSheets","totalOptionalSheets","completedClassWorkSheets","totalClassWorkSheets","showClassWorkTag","jsx","Styled.BannerContainer","jsxs","FlexView","Image","ILLUSTRATIONS","Styled.BannerImageWrapper","Styled.BannerImage","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.StyledImportantIcon","Styled.StyledCheckIcon","Tag","Check2Icon","Styled.BannerTitleWrapper","Text"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAyB,IACzBC,IAA2B,IAC3BC,IAA2B,IAK3BC,KAAyCC,EAAK,CAASC,MAAA;AAC3D,QAAM,EAAE,eAAAC,GAAe,UAAAC,GAAU,OAAAC,GAAO,UAAAC,MAAaJ,GAE/CK,IAAuBC,EAAQ,MAC5BC,EAA+BN,CAAa,GAClD,CAACA,CAAa,CAAC,GAEZ,EAAE,YAAAO,GAAY,aAAAC,EAAY,IAAIH,EAAQ,MAAM;AAKhD,UAAMI,KAAkB,EAFFL,MAAyB,MAAM,KAAKA,KAEjB,MAAM,OAAO,KAAK,KAAM,KAC3DM,IAAYd,IAA2BF,IAAyB,KAAK,IAAIe,CAAa,GACtFE,IAAYhB,IAA2BD,IAAyB,KAAK,IAAIe,CAAa;AAErF,WAAA;AAAA,MACL,aAAaC;AAAA,MACb,YAAYC;AAAA,IAAA;AAAA,EACd,GACC,CAACP,CAAoB,CAAC;AAErB,MAAA,CAACJ,EAAsB,QAAA;AAE3B,QAAM,EAAE,WAAAY,GAAW,UAAAC,GAAU,WAAWC,MAAcd,GAChD,EAAE,WA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,EAAa,CAAA;AAAA,UAG7EJ,MAAyB,OACxB,gBAAAkB,EAACW,GAAA,EACC,UAAC,gBAAAX,EAAAY,GAAA,EAAI,MAAMC,EAAA,CAAY,EACzB,CAAA;AAAA,QAAA,GAEJ;AAAA,QACC,gBAAAX,EAAAY,GAAA,EAA0B,UAAU,GACnC,UAAA;AAAA,UAAC,gBAAAd,EAAAe,GAAA,EAAK,WAAU,YAAY,UAAMnC,GAAA;AAAA,4BACjCuB,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,WAAW,MAC5D,UAAA;AAAA,YAAA,CAAC,CAACT,KACD,gBAAAQ,EAACC,KAAS,WAAU,YAAW,gBAAe,OAC5C,UAAA;AAAA,cAAC,gBAAAH,EAAAU,GAAA,EAA2B;AAAA,gCAC3BP,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,UAAU,GAC5D,UAAA;AAAA,gBAAC,gBAAAD,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,kBAAA;AAAA,kBACZtB;AAAA,kBAAyB;AAAA,kBAAEC;AAAA,gBAAA,GACrC;AAAA,gBACCK,KAAqB,gBAAAC,EAAAY,GAAA,EAAI,MAAMC,GAAY,OAAM,MAAK;AAAA,cAAA,GACzD;AAAA,YAAA,GACF;AAAA,YAEDjB,IAAsB,KACpB,gBAAAM,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,cAAA;AAAA,cACHpB;AAAA,cAAwB;AAAA,cAAEC;AAAA,YAAA,GAC7C;AAAA,UAAA,GAEJ;AAAA,QAAA,GACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl, bannerRef } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional, classwork: classWork } = progressStats;\n const { completed: completedMandatorySheets = 0, total: totalMandatorySheets = 0 } =\n mandatory || {};\n const { completed: completedOptionalSheets = 0, total: totalOptionalSheets = 0 } = optional || {};\n const { completed: completedClassWorkSheets = 0, total: totalClassWorkSheets = 0 } =\n classWork || {};\n const showClassWorkTag =\n totalClassWorkSheets > 0 && completedClassWorkSheets === totalClassWorkSheets;\n\n return (\n <Styled.BannerContainer\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $widthX={50}\n $background={`${imageHue}_4`}\n ref={bannerRef}\n >\n <FlexView $height={168} $position=\"relative\">\n <Image\n width=\"100%\"\n height=\"168px\"\n src={ILLUSTRATIONS.CHAPTER_HEADER_BG}\n alt=\"Chapter header background\"\n withLoader\n />\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n <Styled.ChapterProgressSVG width=\"108px\" height=\"108px\">\n <Styled.ChapterProgressSVGCircle\n $progress={0}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground={'BLACK'}\n $progress={3.3 * completionPercentage}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n </Styled.ChapterProgressSVG>\n\n {completionPercentage > 0 && (\n <Styled.StyledImportantIcon $progress $top={iconTopVal} $left={iconLeftVal} />\n )}\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIcon>\n <Tag Icon={Check2Icon} />\n </Styled.StyledCheckIcon>\n )}\n </Styled.BannerImageWrapper>\n <Styled.BannerTitleWrapper $flexGap={4}>\n <Text $renderAs=\"ah4-bold\">{title}</Text>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={2.75}>\n {!!totalMandatorySheets && (\n <FlexView $position=\"relative\" $flexDirection=\"row\">\n <Styled.StyledImportantIcon />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={8}>\n <Text $renderAs=\"ab2\">\n Core - {completedMandatorySheets}/{totalMandatorySheets}\n </Text>\n {showClassWorkTag && <Tag Icon={Check2Icon} label=\"CW\" />}\n </FlexView>\n </FlexView>\n )}\n {totalOptionalSheets > 0 && (\n <Text $renderAs=\"ab2\">\n Supplementary - {completedOptionalSheets}/{totalOptionalSheets}\n </Text>\n )}\n </FlexView>\n </Styled.BannerTitleWrapper>\n </FlexView>\n </Styled.BannerContainer>\n );\n});\n\nexport default ChapterBanner;\n"],"names":["PROGRESS_CIRCLE_RADIUS","PROGRESS_CIRCLE_CENTER_X","PROGRESS_CIRCLE_CENTER_Y","ChapterBanner","memo","props","progressStats","imageHue","title","imageUrl","bannerRef","completionPercentage","useMemo","getChapterCompletionPercentage","iconTopVal","iconLeftVal","angleInRadian","positionX","positionY","mandatory","optional","classWork","completedMandatorySheets","totalMandatorySheets","completedOptionalSheets","totalOptionalSheets","completedClassWorkSheets","totalClassWorkSheets","showClassWorkTag","jsx","Styled.BannerContainer","jsxs","FlexView","Image","ILLUSTRATIONS","Styled.BannerImageWrapper","Styled.BannerImage","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.StyledImportantIcon","Styled.StyledCheckIcon","Tag","Check2Icon","Styled.BannerTitleWrapper","Text"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAyB,IACzBC,IAA2B,IAC3BC,IAA2B,IAK3BC,KAAyCC,EAAK,CAASC,MAAA;AAC3D,QAAM,EAAE,eAAAC,GAAe,UAAAC,GAAU,OAAAC,GAAO,UAAAC,GAAU,WAAAC,EAAc,IAAAL,GAE1DM,IAAuBC,EAAQ,MAC5BC,EAA+BP,CAAa,GAClD,CAACA,CAAa,CAAC,GAEZ,EAAE,YAAAQ,GAAY,aAAAC,EAAY,IAAIH,EAAQ,MAAM;AAKhD,UAAMI,KAAkB,EAFFL,MAAyB,MAAM,KAAKA,KAEjB,MAAM,OAAO,KAAK,KAAM,KAC3DM,IAAYf,IAA2BF,IAAyB,KAAK,IAAIgB,CAAa,GACtFE,IAAYjB,IAA2BD,IAAyB,KAAK,IAAIgB,CAAa;AAErF,WAAA;AAAA,MACL,aAAaC;AAAA,MACb,YAAYC;AAAA,IAAA;AAAA,EACd,GACC,CAACP,CAAoB,CAAC;AAErB,MAAA,CAACL,EAA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AAAA,UAAA,GACF;AAAA,UAECS,IAAuB,KACtB,gBAAAkB,EAACU,GAAA,EAA2B,WAAS,IAAC,MAAMzB,GAAY,OAAOC,EAAa,CAAA;AAAA,UAG7EJ,MAAyB,OACxB,gBAAAkB,EAACW,GAAA,EACC,UAAC,gBAAAX,EAAAY,GAAA,EAAI,MAAMC,EAAA,CAAY,EACzB,CAAA;AAAA,QAAA,GAEJ;AAAA,QACC,gBAAAX,EAAAY,GAAA,EAA0B,UAAU,GACnC,UAAA;AAAA,UAAC,gBAAAd,EAAAe,GAAA,EAAK,WAAU,YAAY,UAAMpC,GAAA;AAAA,4BACjCwB,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,WAAW,MAC5D,UAAA;AAAA,YAAA,CAAC,CAACT,KACD,gBAAAQ,EAACC,KAAS,WAAU,YAAW,gBAAe,OAC5C,UAAA;AAAA,cAAC,gBAAAH,EAAAU,GAAA,EAA2B;AAAA,gCAC3BP,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,UAAU,GAC5D,UAAA;AAAA,gBAAC,gBAAAD,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,kBAAA;AAAA,kBACZtB;AAAA,kBAAyB;AAAA,kBAAEC;AAAA,gBAAA,GACrC;AAAA,gBACCK,KAAqB,gBAAAC,EAAAY,GAAA,EAAI,MAAMC,GAAY,OAAM,MAAK;AAAA,cAAA,GACzD;AAAA,YAAA,GACF;AAAA,YAEDjB,IAAsB,KACpB,gBAAAM,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,cAAA;AAAA,cACHpB;AAAA,cAAwB;AAAA,cAAEC;AAAA,YAAA,GAC7C;AAAA,UAAA,GAEJ;AAAA,QAAA,GACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,46 +1,70 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { memo as B, useCallback as x, useEffect as l } from "react";
3
- import { ILLUSTRATIONS as y } from "../../../assets/illustrations/illustrations.js";
4
- import I from "../../../assets/line-icons/icons/back2.js";
5
- import w from "../../ui/buttons/button/button.js";
6
- import L from "../../ui/buttons/icon-button/icon-button.js";
7
- import N from "../../ui/layout/flex-view.js";
8
- import S from "../../ui/loader/app-loader/app-loader.js";
9
- import _ from "../../ui/text/text.js";
10
- import { useGetChapterDetails as b } from "../api/chapter.js";
11
- import D from "./block-sections/block-sections.js";
12
- import E from "./chapter-banner/chapter-banner.js";
13
- import { ContentWrapper as T, BackButtonContainer as v, BackButtonWrapper as R, LoaderWrapper as j } from "./chapter-details-styled.js";
14
- const P = B((c) => {
1
+ import { jsxs as f, jsx as t } from "react/jsx-runtime";
2
+ import { memo as N, useCallback as v, useEffect as s } from "react";
3
+ import { ILLUSTRATIONS as D } from "../../../assets/illustrations/illustrations.js";
4
+ import E from "../../../assets/line-icons/icons/back2.js";
5
+ import { useJourney as P } from "../../journey/use-journey/use-journey.js";
6
+ import T from "../../ui/buttons/button/button.js";
7
+ import j from "../../ui/buttons/icon-button/icon-button.js";
8
+ import J from "../../ui/layout/flex-view.js";
9
+ import H from "../../ui/loader/app-loader/app-loader.js";
10
+ import O from "../../ui/text/text.js";
11
+ import { useGetChapterDetails as U } from "../api/chapter.js";
12
+ import W from "./block-sections/block-sections.js";
13
+ import X from "./chapter-banner/chapter-banner.js";
14
+ import { ContentWrapper as z, BackButtonContainer as F, BackButtonWrapper as G, LoaderWrapper as V } from "./chapter-details-styled.js";
15
+ const q = N((g) => {
15
16
  const {
16
- userChapterId: i,
17
+ userChapterId: c,
17
18
  studentId: n,
18
19
  userType: a,
19
- onBlockSkipUnskip: h,
20
- onNodeAttempt: d,
21
- onNodeAttemptLocationChange: g,
22
- onNodeMarkAsDone: f,
23
- onNodeReattempt: u,
24
- onNodeReview: C,
25
- onNodeView: k,
26
- onExit: $
27
- } = c, {
28
- get: s,
20
+ onBlockSkipUnskip: u,
21
+ onNodeAttempt: C,
22
+ onNodeAttemptLocationChange: k,
23
+ onNodeMarkAsDone: y,
24
+ onNodeReattempt: A,
25
+ onNodeReview: B,
26
+ onNodeView: $,
27
+ onExit: x,
28
+ startChapterPageJourney: i,
29
+ chapterPageRef: I,
30
+ bannerRef: S,
31
+ coreBlocksRef: w,
32
+ canStartJourney: m
33
+ } = g, {
34
+ get: p,
29
35
  data: e,
30
36
  isProcessing: r,
31
- isProcessingFailed: A,
32
- isStale: m
33
- } = b(), o = x(() => {
34
- s(i, void 0, { studentId: n });
35
- }, [s, i, n]);
36
- return l(() => {
37
+ isProcessingFailed: R,
38
+ isStale: l
39
+ } = U(), o = v(() => {
40
+ p(c, void 0, { studentId: n });
41
+ }, [p, c, n]);
42
+ s(() => {
37
43
  o();
38
- }, [o]), l(() => {
39
- !r && m && o();
40
- }, [o, r, m]), A ? /* @__PURE__ */ p(N, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
41
- /* @__PURE__ */ t(_, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
44
+ }, [o]);
45
+ const { isJourneyActive: h } = P();
46
+ return s(() => {
47
+ if (e) {
48
+ const { progress_stat: _ } = e, { classwork: b } = _ || {}, { completed: d, total: L } = b || {};
49
+ m && d !== 0 && L === d && !h && i && i({
50
+ chapterDetails: e,
51
+ studentId: n,
52
+ userType: a
53
+ });
54
+ }
55
+ }, [
56
+ e,
57
+ i,
58
+ h,
59
+ n,
60
+ a,
61
+ m
62
+ ]), s(() => {
63
+ !r && l && o();
64
+ }, [o, r, l]), R ? /* @__PURE__ */ f(J, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
65
+ /* @__PURE__ */ t(O, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
42
66
  /* @__PURE__ */ t(
43
- w,
67
+ T,
44
68
  {
45
69
  widthX: 14,
46
70
  size: "small",
@@ -50,54 +74,57 @@ const P = B((c) => {
50
74
  onClick: o
51
75
  }
52
76
  )
53
- ] }) : !e && r ? /* @__PURE__ */ t(S, { height: "80vh" }) : /* @__PURE__ */ p(
54
- T,
77
+ ] }) : !e && r ? /* @__PURE__ */ t(H, { height: "80vh" }) : /* @__PURE__ */ f(
78
+ z,
55
79
  {
80
+ ref: I,
56
81
  $widthX: 50,
57
82
  $disablePointerEvents: r,
58
83
  $justifyContent: "center",
59
84
  $alignItems: "center",
60
85
  children: [
61
- a === "TEACHER" && /* @__PURE__ */ t(v, { $height: "100%", children: /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
62
- L,
86
+ a === "TEACHER" && /* @__PURE__ */ t(F, { $height: "100%", children: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
87
+ j,
63
88
  {
64
- Icon: I,
89
+ Icon: E,
65
90
  renderAs: "secondary-gray",
66
91
  analyticsLabel: "chapter_page_exit",
67
92
  size: "xsmall",
68
- onClick: $
93
+ onClick: x
69
94
  }
70
95
  ) }) }),
71
- r && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t("img", { src: y.LOADER_1, alt: "loader" }) }),
96
+ r && /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("img", { src: D.LOADER_1, alt: "loader" }) }),
72
97
  e && /* @__PURE__ */ t(
73
- E,
98
+ X,
74
99
  {
75
100
  title: e.name,
76
101
  imageHue: e.image_hue,
77
102
  imageUrl: e.image_url,
78
- progressStats: e == null ? void 0 : e.progress_stat
103
+ progressStats: e == null ? void 0 : e.progress_stat,
104
+ bannerRef: S
79
105
  }
80
106
  ),
81
107
  e && /* @__PURE__ */ t(
82
- D,
108
+ W,
83
109
  {
84
110
  imageHue: e.image_hue,
85
111
  userType: a,
86
112
  blocks: e.blocks,
87
- onBlockSkipUnskip: h,
88
- onNodeAttempt: d,
89
- onNodeAttemptLocationChange: g,
90
- onNodeMarkAsDone: f,
91
- onNodeReattempt: u,
92
- onNodeReview: C,
93
- onNodeView: k
113
+ onBlockSkipUnskip: u,
114
+ onNodeAttempt: C,
115
+ onNodeAttemptLocationChange: k,
116
+ onNodeMarkAsDone: y,
117
+ onNodeReattempt: A,
118
+ onNodeReview: B,
119
+ onNodeView: $,
120
+ coreBlocksRef: w
94
121
  }
95
122
  )
96
123
  ]
97
124
  }
98
125
  );
99
- }), Q = P;
126
+ }), me = q;
100
127
  export {
101
- Q as default
128
+ me as default
102
129
  };
103
130
  //# sourceMappingURL=chapter-details.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAX,GAEE;AAAA,IACJ,KAAKY;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBX,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACU,GAAmBX,GAAeC,CAAS,CAAC;AAYhD,SAVAkB,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC,GAExBE,EAAU,MAAM;AACV,IAAA,CAACN,KAAgBE,KACCE;EAErB,GAAA,CAACA,GAAqBJ,GAAcE,CAAO,CAAC,GAE3CD,IAEA,gBAAAM,EAACC,KAAS,WAAW,KAAK,SAAQ,SAAQ,iBAAgB,UAAS,aAAY,UAC7E,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAU,MAAK,UAAmD,uDAAA;AAAA,IACxE,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,MAAK;AAAA,QACL,OAAM;AAAA,QACN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.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (chapterDetails) {\n const { progress_stat: progressStat } = chapterDetails;\n const { classwork } = progressStat || {};\n const { completed, total } = classwork || {};\n\n if (\n canStartJourney &&\n completed !== 0 &&\n total === completed &&\n !isJourneyActive &&\n startChapterPageJourney\n ) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n studentId,\n userType,\n });\n }\n }\n }, [\n chapterDetails,\n startChapterPageJourney,\n isJourneyActive,\n studentId,\n userType,\n canStartJourney,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","isJourneyActive","useJourney","progressStat","classwork","completed","total","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,IAAAhB,GAEE;AAAA,IACJ,KAAKiB;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBhB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACe,GAAmBhB,GAAeC,CAAS,CAAC;AAEhD,EAAAuB,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,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,QAClC,UAAA,gBAAAL,EAACM,GAAA,EACC,UAAA,gBAAAN;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAAS/B;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAGDQ,KACC,gBAAAe,EAACS,GAAA,EACC,UAAA,gBAAAT,EAAC,OAAI,EAAA,KAAKU,EAAc,UAAU,KAAI,SAAA,CAAS,EACjD,CAAA;AAAA,QAGD1B,KACC,gBAAAgB;AAAA,UAACW;AAAA,UAAA;AAAA,YACC,OAAO3B,EAAe;AAAA,YACtB,UAAUA,EAAe;AAAA,YACzB,UAAUA,EAAe;AAAA,YACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,YAC/B,WAAAJ;AAAA,UAAA;AAAA,QACF;AAAA,QAGDI,KACC,gBAAAgB;AAAA,UAACY;AAAA,UAAA;AAAA,YACC,UAAU5B,EAAe;AAAA,YACzB,UAAAf;AAAA,YACA,QAAQe,EAAe;AAAA,YACvB,mBAAAd;AAAA,YACA,eAAAC;AAAA,YACA,6BAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,YACA,eAAAK;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDgC,KAAejD;"}
@@ -12,7 +12,6 @@ const f = t(e)(({
12
12
  const { BLACK_1: p, BLACK: a, BLACK_T_15: i } = r.colors;
13
13
  return `
14
14
  cursor: ${n ? "not-allowed" : "pointer"};
15
- ${n ? "pointer-events: none;" : "pointer-events: auto;"};
16
15
  position: relative;
17
16
  border-image: linear-gradient(to right, ${i} 0%, ${i} 100%);
18
17
  ${o && `outline: 1px solid ${i};`};
@@ -82,10 +81,10 @@ const f = t(e)(({
82
81
  }
83
82
  `), $ = t(e)`
84
83
  border-radius: 50%;
85
- `, v = t(e)(() => `
84
+ `, w = t(e)(() => `
86
85
  position: relative;
87
86
  padding: 12px 8px 12px 12px;
88
- `), w = t(e)(({ $top: o, $right: r }) => `
87
+ `), I = t(e)(({ $top: o, $right: r }) => `
89
88
  position: absolute;
90
89
  top: ${o ?? 0}px;
91
90
  right: ${r ?? 0}px;
@@ -95,7 +94,7 @@ t(c)(({}) => `
95
94
  width: 28px;
96
95
  height: 28px;
97
96
  `);
98
- const I = t(e)(({ theme: o }) => {
97
+ const v = t(e)(({ theme: o }) => {
99
98
  const { BLACK_1: r, WHITE_1: n } = o.colors;
100
99
  return `
101
100
  position: absolute;
@@ -140,14 +139,14 @@ const I = t(e)(({ theme: o }) => {
140
139
  `);
141
140
  export {
142
141
  $ as IconWrapper,
143
- I as InProgressIconWrapper,
142
+ v as InProgressIconWrapper,
144
143
  f as NodeCardContainer,
145
- v as NodeCardContentWrapper,
144
+ w as NodeCardContentWrapper,
146
145
  k as NodeCardInfoWrapper,
147
146
  y as NodeCardTitle,
148
147
  C as NodeKebabMenuWrapper,
149
148
  W as NodeMenuOptionsWrapper,
150
- w as SheetTagWrapper,
149
+ I as SheetTagWrapper,
151
150
  g as StyledImportantIcon
152
151
  };
153
152
  //# sourceMappingURL=node-card-styled.js.map