@coorpacademy/components 11.32.11 → 11.32.12-alpha.3

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 (112) hide show
  1. package/es/atom/button-link/style.css +1 -0
  2. package/es/atom/select/index.d.ts.map +1 -1
  3. package/es/atom/select/index.js +2 -1
  4. package/es/atom/select/index.js.map +1 -1
  5. package/es/atom/select/style.css +28 -0
  6. package/es/molecule/cm-popin/types.d.ts +1 -0
  7. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  8. package/es/molecule/dashboard/cards-list/index.d.ts +2 -1
  9. package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  10. package/es/molecule/dashboard/cards-list/index.js +8 -3
  11. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  12. package/es/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
  13. package/es/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
  14. package/es/molecule/dashboard/cards-list/prop-types.js.map +1 -1
  15. package/es/molecule/dashboard/cards-list/style.css +4 -0
  16. package/es/organism/cards-grid/index.d.ts +1 -0
  17. package/es/organism/cards-grid/index.js +6 -1
  18. package/es/organism/cards-grid/index.js.map +1 -1
  19. package/es/organism/cards-grid/style.css +0 -1
  20. package/es/template/app-player/loading/index.d.ts +1 -0
  21. package/es/template/app-player/player/index.d.ts +2 -0
  22. package/es/template/app-player/player/slides/index.d.ts +1 -0
  23. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  24. package/es/template/app-player/popin-correction/index.d.ts +1 -0
  25. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  26. package/es/template/app-player/popin-end/index.d.ts +3 -1
  27. package/es/template/app-player/popin-end/summary.d.ts +2 -1
  28. package/es/template/app-review/index.d.ts +1 -0
  29. package/es/template/app-review/index.d.ts.map +1 -1
  30. package/es/template/app-review/player/prop-types.d.ts +1 -0
  31. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  32. package/es/template/app-review/prop-types.d.ts +1 -0
  33. package/es/template/app-review/prop-types.d.ts.map +1 -1
  34. package/es/template/back-office/brand-update/index.d.ts +1 -0
  35. package/es/template/common/authors/index.d.ts +1 -0
  36. package/es/template/common/authors/index.d.ts.map +1 -1
  37. package/es/template/common/dashboard/index.d.ts +2 -0
  38. package/es/template/common/search-page/index.d.ts +4 -1
  39. package/es/template/external-course/index.d.ts +1 -0
  40. package/es/template/skill-detail/all-courses.css +128 -0
  41. package/es/template/skill-detail/all-courses.d.ts +77 -0
  42. package/es/template/skill-detail/all-courses.d.ts.map +1 -0
  43. package/es/template/skill-detail/all-courses.js +179 -0
  44. package/es/template/skill-detail/all-courses.js.map +1 -0
  45. package/es/template/skill-detail/continue-learning.css +21 -0
  46. package/es/template/skill-detail/continue-learning.d.ts +37 -0
  47. package/es/template/skill-detail/continue-learning.d.ts.map +1 -0
  48. package/es/template/skill-detail/continue-learning.js +43 -0
  49. package/es/template/skill-detail/continue-learning.js.map +1 -0
  50. package/es/template/skill-detail/index.d.ts +95 -0
  51. package/es/template/skill-detail/index.d.ts.map +1 -0
  52. package/es/template/skill-detail/index.js +219 -0
  53. package/es/template/skill-detail/index.js.map +1 -0
  54. package/es/template/skill-detail/style.css +174 -0
  55. package/es/template/teams-dashboard/index.d.ts +2 -1
  56. package/lib/atom/button-link/style.css +1 -0
  57. package/lib/atom/select/index.d.ts.map +1 -1
  58. package/lib/atom/select/index.js +2 -1
  59. package/lib/atom/select/index.js.map +1 -1
  60. package/lib/atom/select/style.css +28 -0
  61. package/lib/molecule/cm-popin/types.d.ts +1 -0
  62. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  63. package/lib/molecule/dashboard/cards-list/index.d.ts +2 -1
  64. package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  65. package/lib/molecule/dashboard/cards-list/index.js +8 -4
  66. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  67. package/lib/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
  68. package/lib/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
  69. package/lib/molecule/dashboard/cards-list/prop-types.js.map +1 -1
  70. package/lib/molecule/dashboard/cards-list/style.css +4 -0
  71. package/lib/organism/cards-grid/index.d.ts +1 -0
  72. package/lib/organism/cards-grid/index.js +6 -1
  73. package/lib/organism/cards-grid/index.js.map +1 -1
  74. package/lib/organism/cards-grid/style.css +0 -1
  75. package/lib/template/app-player/loading/index.d.ts +1 -0
  76. package/lib/template/app-player/player/index.d.ts +2 -0
  77. package/lib/template/app-player/player/slides/index.d.ts +1 -0
  78. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  79. package/lib/template/app-player/popin-correction/index.d.ts +1 -0
  80. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  81. package/lib/template/app-player/popin-end/index.d.ts +3 -1
  82. package/lib/template/app-player/popin-end/summary.d.ts +2 -1
  83. package/lib/template/app-review/index.d.ts +1 -0
  84. package/lib/template/app-review/index.d.ts.map +1 -1
  85. package/lib/template/app-review/player/prop-types.d.ts +1 -0
  86. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  87. package/lib/template/app-review/prop-types.d.ts +1 -0
  88. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  89. package/lib/template/back-office/brand-update/index.d.ts +1 -0
  90. package/lib/template/common/authors/index.d.ts +1 -0
  91. package/lib/template/common/authors/index.d.ts.map +1 -1
  92. package/lib/template/common/dashboard/index.d.ts +2 -0
  93. package/lib/template/common/search-page/index.d.ts +4 -1
  94. package/lib/template/external-course/index.d.ts +1 -0
  95. package/lib/template/skill-detail/all-courses.css +128 -0
  96. package/lib/template/skill-detail/all-courses.d.ts +77 -0
  97. package/lib/template/skill-detail/all-courses.d.ts.map +1 -0
  98. package/lib/template/skill-detail/all-courses.js +198 -0
  99. package/lib/template/skill-detail/all-courses.js.map +1 -0
  100. package/lib/template/skill-detail/continue-learning.css +21 -0
  101. package/lib/template/skill-detail/continue-learning.d.ts +37 -0
  102. package/lib/template/skill-detail/continue-learning.d.ts.map +1 -0
  103. package/lib/template/skill-detail/continue-learning.js +56 -0
  104. package/lib/template/skill-detail/continue-learning.js.map +1 -0
  105. package/lib/template/skill-detail/index.d.ts +95 -0
  106. package/lib/template/skill-detail/index.d.ts.map +1 -0
  107. package/lib/template/skill-detail/index.js +241 -0
  108. package/lib/template/skill-detail/index.js.map +1 -0
  109. package/lib/template/skill-detail/style.css +174 -0
  110. package/lib/template/teams-dashboard/index.d.ts +2 -1
  111. package/locales/en/global.json +7 -0
  112. package/package.json +2 -2
@@ -3,6 +3,7 @@ declare class Authors extends React.Component<any, any, any> {
3
3
  static propTypes: {
4
4
  cards: PropTypes.Requireable<PropTypes.InferProps<{
5
5
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
6
+ justifyContent: PropTypes.Requireable<string>;
6
7
  loading: PropTypes.Requireable<boolean>;
7
8
  }>>;
8
9
  cardsTitle: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/authors/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;MAgBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,sCAMC;IAJC;;MAEC;IAIH,4BAIC;IAED,sBA+EC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/authors/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;MAgBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,sCAMC;IAJC;;MAEC;IAIH,4BAIC;IAED,sBA+EC;CACF"}
@@ -76,6 +76,7 @@ declare namespace Dashboard {
76
76
  type: PropTypes.Requireable<string>;
77
77
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
78
78
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
79
+ justifyContent: PropTypes.Requireable<string>;
79
80
  loading: PropTypes.Requireable<boolean>;
80
81
  }> | PropTypes.InferProps<{
81
82
  'aria-label': PropTypes.Requireable<string>;
@@ -348,6 +349,7 @@ declare namespace Dashboard {
348
349
  type: PropTypes.Requireable<string>;
349
350
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
350
351
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
352
+ justifyContent: PropTypes.Requireable<string>;
351
353
  loading: PropTypes.Requireable<boolean>;
352
354
  }> | PropTypes.InferProps<{
353
355
  'aria-label': PropTypes.Requireable<string>;
@@ -79,6 +79,7 @@ declare namespace SearchPage {
79
79
  }>>;
80
80
  const cards: PropTypes.Requireable<PropTypes.InferProps<{
81
81
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
82
+ justifyContent: PropTypes.Requireable<string>;
82
83
  loading: PropTypes.Requireable<boolean>;
83
84
  }>>;
84
85
  const clearFilters: PropTypes.Requireable<PropTypes.InferProps<{
@@ -111,7 +112,7 @@ declare namespace SearchPage {
111
112
  const recommendations: PropTypes.Requireable<PropTypes.InferProps<{
112
113
  contentType: PropTypes.Requireable<string>;
113
114
  dataName: PropTypes.Requireable<string>;
114
- title: PropTypes.Requireable<string>;
115
+ title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
115
116
  showMore: PropTypes.Requireable<string>;
116
117
  cards: PropTypes.Requireable<(PropTypes.InferProps<{
117
118
  badge: PropTypes.Requireable<string>;
@@ -165,6 +166,7 @@ declare namespace SearchPage {
165
166
  adaptive: PropTypes.Requireable<string>;
166
167
  }>>;
167
168
  }> | null | undefined)[]>;
169
+ customStyle: PropTypes.Requireable<object>;
168
170
  onScroll: PropTypes.Requireable<(...args: any[]) => any>;
169
171
  onShowMore: PropTypes.Requireable<(...args: any[]) => any>;
170
172
  'arrows-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
@@ -248,6 +250,7 @@ declare namespace SearchPage {
248
250
  type: PropTypes.Requireable<string>;
249
251
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
250
252
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
253
+ justifyContent: PropTypes.Requireable<string>;
251
254
  loading: PropTypes.Requireable<boolean>;
252
255
  }> | PropTypes.InferProps<{
253
256
  'aria-label': PropTypes.Requireable<string>;
@@ -93,6 +93,7 @@ declare namespace ExternalCourse {
93
93
  type: PropTypes.Requireable<string>;
94
94
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
95
95
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
96
+ justifyContent: PropTypes.Requireable<string>;
96
97
  loading: PropTypes.Requireable<boolean>;
97
98
  }> | PropTypes.InferProps<{
98
99
  'aria-label': PropTypes.Requireable<string>;
@@ -0,0 +1,128 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value breakpoints: "../../variables/breakpoints.css";
3
+ @value tablet from breakpoints;
4
+ @value mobile from breakpoints;
5
+ @value xtraLightGrey from colors;
6
+ @value cm_grey_100 from colors;
7
+ @value cm_grey_200 from colors;
8
+ @value cm_grey_400 from colors;
9
+
10
+ .continueLearningWrapper {
11
+ margin-top: 40px;
12
+ margin-bottom: 16px;
13
+ }
14
+
15
+ .continueLearningTitle {
16
+ font-size: 16px;
17
+ font-weight: 600;
18
+ line-height: 22px;
19
+ }
20
+
21
+ .continueLearningNumber {
22
+ border-radius: 50%;
23
+ background-color: #EAEAEB;
24
+ color: #515161;
25
+ padding: 2px 4px;
26
+ margin-left: 8px;
27
+ font-size: 10px;
28
+ font-weight: 600;
29
+ line-height: 12px;
30
+ }
31
+
32
+ .searchAndSortSection {
33
+ display: flex;
34
+ margin-bottom: 16px;
35
+ justify-content: space-between;
36
+ }
37
+
38
+ .searchWrapper {
39
+ border-radius: 12px;
40
+ width: 300px;
41
+ background-color: cm_grey_100;
42
+ }
43
+
44
+ .sortSection {
45
+ display: flex;
46
+ gap: 32px;
47
+ align-items: center;
48
+ }
49
+
50
+ .sortWrapper {
51
+ display: flex;
52
+ align-items: center;
53
+ gap: 12px;
54
+ }
55
+
56
+ .filterWrapper {
57
+ display: flex;
58
+ gap: 12px;
59
+ margin-bottom: 32px;
60
+ }
61
+
62
+ .filterButtonWrapper {
63
+ display: flex;
64
+ align-items: center;
65
+ }
66
+
67
+ .divider {
68
+ height: 24px;
69
+ width: 1px;
70
+ background-color: cm_grey_200;
71
+ margin-left: 12px;
72
+ }
73
+
74
+ .emptySearchResultContainer {
75
+ display: flex;
76
+ flex-direction: column;
77
+ align-items: center;
78
+ }
79
+
80
+ .emptySearchResultTitle {
81
+ font-size: 20px;
82
+ font-weight: 700;
83
+ line-height: 28px;
84
+ margin-bottom: 8px;
85
+ }
86
+
87
+ .emptySearchResultDescription {
88
+ font-size: 16px;
89
+ font-weight: 500;
90
+ line-height: 22px;
91
+ margin-bottom: 16px;
92
+ }
93
+
94
+ .emptySearchResultClearSearch {
95
+ color: #0061FF;
96
+ font-size: 14px;
97
+ font-style: normal;
98
+ font-weight: 600;
99
+ line-height: 20px;
100
+ cursor: pointer;
101
+ }
102
+
103
+ .emptySearchResultClearSearch:hover {
104
+ text-decoration: underline;
105
+ }
106
+
107
+ @media (max-width: 799px) {
108
+ .searchAndSortSection {
109
+ flex-direction: column;
110
+ }
111
+
112
+ .sortSection {
113
+ margin-top: 16px;
114
+ }
115
+ }
116
+
117
+ @media mobile {
118
+ .sortSection {
119
+ flex-direction: column;
120
+ gap: 16px;
121
+ align-items: flex-start;
122
+ margin-top: 16px;
123
+ }
124
+
125
+ .filterWrapper {
126
+ overflow-x: scroll;
127
+ }
128
+ }
@@ -0,0 +1,77 @@
1
+ export default AllCourses;
2
+ declare function AllCourses(props: any, context: any): JSX.Element;
3
+ declare namespace AllCourses {
4
+ namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
26
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
+ }
28
+ namespace propTypes {
29
+ const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
30
+ list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
+ justifyContent: PropTypes.Requireable<string>;
32
+ loading: PropTypes.Requireable<boolean>;
33
+ }>>;
34
+ const filters: PropTypes.Requireable<PropTypes.InferProps<{
35
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
36
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
37
+ name: PropTypes.Validator<string>;
38
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
39
+ selected: PropTypes.Requireable<boolean>;
40
+ validOption: PropTypes.Requireable<boolean>;
41
+ }> | null | undefined)[]>;
42
+ }>>;
43
+ const sorting: PropTypes.Requireable<PropTypes.InferProps<{
44
+ title: PropTypes.Requireable<string>;
45
+ name: PropTypes.Requireable<string>;
46
+ className: PropTypes.Requireable<string>;
47
+ borderClassName: PropTypes.Requireable<string>;
48
+ disabled: PropTypes.Requireable<boolean>;
49
+ multiple: PropTypes.Requireable<boolean>;
50
+ description: PropTypes.Requireable<string>;
51
+ required: PropTypes.Requireable<boolean>;
52
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
53
+ theme: PropTypes.Requireable<string>;
54
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
55
+ name: PropTypes.Validator<string>;
56
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
57
+ selected: PropTypes.Requireable<boolean>;
58
+ validOption: PropTypes.Requireable<boolean>;
59
+ }> | null | undefined)[]>;
60
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
61
+ label: PropTypes.Validator<string>;
62
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
63
+ name: PropTypes.Validator<string>;
64
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
65
+ selected: PropTypes.Requireable<boolean>;
66
+ validOption: PropTypes.Requireable<boolean>;
67
+ }> | null | undefined)[]>;
68
+ }> | null | undefined)[]>;
69
+ modified: PropTypes.Requireable<boolean>;
70
+ error: PropTypes.Requireable<boolean>;
71
+ 'aria-label': PropTypes.Requireable<string>;
72
+ 'aria-labelledby': PropTypes.Requireable<string>;
73
+ }>>;
74
+ }
75
+ }
76
+ import PropTypes from "prop-types";
77
+ //# sourceMappingURL=all-courses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AA2CA,mEAiHC"}
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _get2 = _interopRequireDefault(require("lodash/fp/get"));
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
13
+
14
+ var _select = _interopRequireWildcard(require("../../atom/select"));
15
+
16
+ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
17
+
18
+ var _searchForm = _interopRequireDefault(require("../../molecule/search-form"));
19
+
20
+ var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
21
+
22
+ var _searchValueIncluded = _interopRequireDefault(require("../../util/search-value-included"));
23
+
24
+ var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
25
+
26
+ var _allCourses = _interopRequireDefault(require("./all-courses.css"));
27
+
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+
30
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
+
34
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
35
+
36
+ const FilterButton = (props, context) => {
37
+ const {
38
+ selected,
39
+ filter,
40
+ onClick
41
+ } = props;
42
+ const {
43
+ skin
44
+ } = context;
45
+ const primarySkinColor = (0, _get2.default)('common.primary', skin);
46
+ const buttonProps = {
47
+ customStyle: {
48
+ backgroundColor: selected ? primarySkinColor : '#E1E1E3',
49
+ color: selected ? '#FFFFFF' : '#515161',
50
+ transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
51
+ width: 'fit-content'
52
+ },
53
+ label: filter,
54
+ onClick,
55
+ 'data-name': 'filter-type-course-button'
56
+ };
57
+ return /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonProps);
58
+ };
59
+
60
+ FilterButton.contextTypes = {
61
+ skin: _provider.default.childContextTypes.skin,
62
+ translate: _provider.default.childContextTypes.translate
63
+ };
64
+ FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
65
+ selected: _propTypes.default.bool,
66
+ filter: _propTypes.default.string,
67
+ onClick: _propTypes.default.func
68
+ } : {};
69
+
70
+ const AllCourses = (props, context) => {
71
+ const {
72
+ skillIncludedCourses,
73
+ filters,
74
+ sorting
75
+ } = props;
76
+ const {
77
+ options,
78
+ onChange
79
+ } = filters;
80
+ const {
81
+ list
82
+ } = skillIncludedCourses;
83
+ const {
84
+ translate
85
+ } = context;
86
+ const [showCompleted, setShowCompleted] = (0, _react.useState)(true);
87
+ const [searchValue, setSearchValue] = (0, _react.useState)('');
88
+ const [searchResults, setSearchResults] = (0, _react.useState)(list.sort((a, b) => {
89
+ const progressA = a.progress ?? 0;
90
+ const progressB = b.progress ?? 0;
91
+ return progressB - progressA;
92
+ }));
93
+ const sortView = sorting !== undefined ? /*#__PURE__*/_react.default.createElement("div", {
94
+ "data-name": "choice"
95
+ }, /*#__PURE__*/_react.default.createElement(_select.default, _extends({}, sorting, {
96
+ "aria-label": "All courses sort"
97
+ }))) : null;
98
+ const handleSearch = (0, _react.useCallback)(value => {
99
+ setSearchValue(value);
100
+ setSearchResults(list.filter(skill => (0, _searchValueIncluded.default)(skill.title, value)));
101
+ }, [list, setSearchValue, setSearchResults]);
102
+ const handleSearchReset = (0, _react.useCallback)(() => {
103
+ setSearchValue('');
104
+ setSearchResults(list);
105
+ }, [list, setSearchValue, setSearchResults]);
106
+ const handleShowCompletedToggle = (0, _react.useCallback)(() => {
107
+ const tempShowCompleted = !showCompleted;
108
+ setShowCompleted(tempShowCompleted);
109
+
110
+ if (tempShowCompleted) {
111
+ setSearchResults(list);
112
+ handleSearchReset();
113
+ } else {
114
+ setSearchResults(searchResults.filter(skill => skill.progress === 0));
115
+ }
116
+ }, [searchResults, showCompleted, setShowCompleted]);
117
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
118
+ className: _allCourses.default.continueLearningWrapper
119
+ }, /*#__PURE__*/_react.default.createElement("span", {
120
+ className: _allCourses.default.continueLearningTitle
121
+ }, translate('all_courses')), /*#__PURE__*/_react.default.createElement("span", {
122
+ className: _allCourses.default.continueLearningNumber
123
+ }, skillIncludedCourses.list.length)), /*#__PURE__*/_react.default.createElement("div", {
124
+ className: _allCourses.default.searchAndSortSection
125
+ }, /*#__PURE__*/_react.default.createElement("div", {
126
+ className: _allCourses.default.searchWrapper
127
+ }, /*#__PURE__*/_react.default.createElement(_searchForm.default, {
128
+ search: {
129
+ placeholder: translate('search_place_holder'),
130
+ value: searchValue,
131
+ onChange: handleSearch
132
+ },
133
+ onReset: handleSearchReset
134
+ })), /*#__PURE__*/_react.default.createElement("div", {
135
+ className: _allCourses.default.sortSection
136
+ }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
137
+ type: "switch",
138
+ title: translate('show_completed'),
139
+ value: showCompleted,
140
+ onChange: handleShowCompletedToggle
141
+ }), /*#__PURE__*/_react.default.createElement("div", {
142
+ className: _allCourses.default.sortWrapper
143
+ }, translate('sort_by'), sortView))), /*#__PURE__*/_react.default.createElement("div", {
144
+ className: _allCourses.default.filterWrapper
145
+ }, options.length > 2 && searchResults.length > 0 ? options.map((filter, index) => {
146
+ const {
147
+ name,
148
+ value,
149
+ selected
150
+ } = filter;
151
+
152
+ function handleChange() {
153
+ onChange(value);
154
+ handleSearchReset();
155
+ }
156
+
157
+ return /*#__PURE__*/_react.default.createElement("div", {
158
+ key: index,
159
+ className: _allCourses.default.filterButtonWrapper
160
+ }, /*#__PURE__*/_react.default.createElement(FilterButton, {
161
+ selected: selected,
162
+ filter: name,
163
+ onClick: handleChange
164
+ }), value === 'ALL' ? /*#__PURE__*/_react.default.createElement("div", {
165
+ className: _allCourses.default.divider
166
+ }) : null);
167
+ }) : null), /*#__PURE__*/_react.default.createElement("div", null, searchResults.length > 0 ? /*#__PURE__*/_react.default.createElement(_cardsGrid.default, {
168
+ list: searchResults,
169
+ justifyContent: "left"
170
+ }) : /*#__PURE__*/_react.default.createElement("div", {
171
+ className: _allCourses.default.emptySearchResultContainer
172
+ }, /*#__PURE__*/_react.default.createElement("div", {
173
+ className: _allCourses.default.emptySearchResultTitle
174
+ }, translate('empty_search_result_title', {
175
+ searchValue
176
+ })), /*#__PURE__*/_react.default.createElement("div", {
177
+ className: _allCourses.default.emptySearchResultDescription
178
+ }, translate('empty_search_result_description')), /*#__PURE__*/_react.default.createElement("div", {
179
+ className: _allCourses.default.emptySearchResultClearSearch,
180
+ onClick: handleSearchReset
181
+ }, translate('empty_search_result_clear_search')))));
182
+ };
183
+
184
+ AllCourses.contextTypes = {
185
+ skin: _provider.default.childContextTypes.skin,
186
+ translate: _provider.default.childContextTypes.translate
187
+ };
188
+ AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
189
+ skillIncludedCourses: _propTypes.default.shape(_cardsGrid.default.propTypes),
190
+ filters: _propTypes.default.shape({
191
+ onChange: _propTypes.default.func,
192
+ options: _propTypes.default.arrayOf(_propTypes.default.shape(_select.SelectOptionPropTypes))
193
+ }),
194
+ sorting: _propTypes.default.shape(_select.default.propTypes)
195
+ } : {};
196
+ var _default = AllCourses;
197
+ exports.default = _default;
198
+ //# sourceMappingURL=all-courses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-courses.js","names":["FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","Provider","childContextTypes","translate","propTypes","PropTypes","bool","string","func","AllCourses","skillIncludedCourses","filters","sorting","options","onChange","list","showCompleted","setShowCompleted","useState","searchValue","setSearchValue","searchResults","setSearchResults","sort","a","b","progressA","progress","progressB","sortView","undefined","handleSearch","useCallback","value","skill","searchValueIncluded","title","handleSearchReset","handleShowCompletedToggle","tempShowCompleted","style","continueLearningWrapper","continueLearningTitle","continueLearningNumber","length","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","map","index","name","handleChange","filterButtonWrapper","divider","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","CardsGrid","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {skillIncludedCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list} = skillIncludedCourses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n list.sort((a, b) => {\n const progressA = a.progress ?? 0;\n const progressB = b.progress ?? 0;\n return progressB - progressA;\n })\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const tempShowCompleted = !showCompleted;\n setShowCompleted(tempShowCompleted);\n if (tempShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [searchResults, showCompleted, setShowCompleted]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{skillIncludedCourses.list.length}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n type=\"switch\"\n title={translate('show_completed')}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid list={searchResults} justifyContent=\"left\" />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,MAAX;IAAmBC;EAAnB,IAA8BJ,KAApC;EACA,MAAM;IAACK;EAAD,IAASJ,OAAf;EACA,MAAMK,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBD,IAAtB,CAAzB;EAEA,MAAME,WAAW,GAAG;IAClBC,WAAW,EAAE;MACXC,eAAe,EAAEP,QAAQ,GAAGI,gBAAH,GAAsB,SADpC;MAEXI,KAAK,EAAER,QAAQ,GAAG,SAAH,GAAe,SAFnB;MAGXS,UAAU,EAAE,6DAHD;MAIXC,KAAK,EAAE;IAJI,CADK;IAOlBC,KAAK,EAAEV,MAPW;IAQlBC,OARkB;IASlB,aAAa;EATK,CAApB;EAYA,oBAAO,6BAAC,mBAAD,EAAgBG,WAAhB,CAAP;AACD,CAlBD;;AAoBAR,YAAY,CAACe,YAAb,GAA4B;EAC1BT,IAAI,EAAEU,iBAAA,CAASC,iBAAT,CAA2BX,IADP;EAE1BY,SAAS,EAAEF,iBAAA,CAASC,iBAAT,CAA2B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B,mBAAA,CAAMkB;EAAtB,GACGvD,SAAS,CAAC,2BAAD,EAA8B;IAACgB;EAAD,CAA9B,CADZ,CADF,eAIE;IAAK,SAAS,EAAEqB,mBAAA,CAAMmB;EAAtB,GACGxD,SAAS,CAAC,iCAAD,CADZ,CAJF,eAOE;IAAK,SAAS,EAAEqC,mBAAA,CAAMoB,4BAAtB;IAAoD,OAAO,EAAEvB;EAA7D,GACGlC,SAAS,CAAC,kCAAD,CADZ,CAPF,CAJJ,CA/CF,CADF;AAmED,CAjHD;;AAmHAM,UAAU,CAACT,YAAX,GAA0B;EACxBT,IAAI,EAAEU,iBAAA,CAASC,iBAAT,CAA2BX,IADT;EAExBY,SAAS,EAAEF,iBAAA,CAASC,iBAAT,CAA2BC;AAFd,CAA1B;AAKAM,UAAU,CAACL,SAAX,2CAAuB;EACrBM,oBAAoB,EAAEL,kBAAA,CAAUwD,KAAV,CAAgBC,kBAAA,CAAU1D,SAA1B,CADD;EAErBO,OAAO,EAAEN,kBAAA,CAAUwD,KAAV,CAAgB;IACvB/C,QAAQ,EAAET,kBAAA,CAAUG,IADG;IAEvBK,OAAO,EAAER,kBAAA,CAAU0D,OAAV,CAAkB1D,kBAAA,CAAUwD,KAAV,CAAgBG,6BAAhB,CAAlB;EAFc,CAAhB,CAFY;EAMrBpD,OAAO,EAAEP,kBAAA,CAAUwD,KAAV,CAAgBI,eAAA,CAAO7D,SAAvB;AANY,CAAvB;eASeK,U"}
@@ -0,0 +1,21 @@
1
+ .continueLearningWrapper {
2
+ margin-top: 40px;
3
+ margin-bottom: 16px;
4
+ }
5
+
6
+ .continueLearningTitle {
7
+ font-size: 16px;
8
+ font-weight: 600;
9
+ line-height: 22px;
10
+ }
11
+
12
+ .continueLearningNumber {
13
+ border-radius: 50%;
14
+ background-color: #EAEAEB;
15
+ color: #515161;
16
+ padding: 2px 4px;
17
+ margin-left: 8px;
18
+ font-size: 10px;
19
+ font-weight: 600;
20
+ line-height: 12px;
21
+ }
@@ -0,0 +1,37 @@
1
+ export default ContinueLearning;
2
+ declare function ContinueLearning(props: any, context: any): JSX.Element | null;
3
+ declare namespace ContinueLearning {
4
+ namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
26
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
+ }
28
+ namespace propTypes {
29
+ const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
30
+ list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
+ justifyContent: PropTypes.Requireable<string>;
32
+ loading: PropTypes.Requireable<boolean>;
33
+ }>>;
34
+ }
35
+ }
36
+ import PropTypes from "prop-types";
37
+ //# sourceMappingURL=continue-learning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAOA,gFAkBC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
11
+
12
+ var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
13
+
14
+ var _cardsList = _interopRequireDefault(require("../../molecule/dashboard/cards-list"));
15
+
16
+ var _continueLearning = _interopRequireDefault(require("./continue-learning.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const ContinueLearning = (props, context) => {
21
+ const {
22
+ ongoingCourses
23
+ } = props;
24
+ const {
25
+ translate
26
+ } = context;
27
+
28
+ if (ongoingCourses.list.length === 0) {
29
+ return null;
30
+ }
31
+
32
+ const Title = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
33
+ className: _continueLearning.default.continueLearningTitle
34
+ }, translate('continue_learning')), /*#__PURE__*/_react.default.createElement("span", {
35
+ className: _continueLearning.default.continueLearningNumber
36
+ }, ongoingCourses.list.length));
37
+
38
+ return /*#__PURE__*/_react.default.createElement(_cardsList.default, {
39
+ cards: ongoingCourses.list,
40
+ title: /*#__PURE__*/_react.default.createElement(Title, null),
41
+ customStyle: {
42
+ padding: '16px 0px 8px'
43
+ }
44
+ });
45
+ };
46
+
47
+ ContinueLearning.contextTypes = {
48
+ skin: _provider.default.childContextTypes.skin,
49
+ translate: _provider.default.childContextTypes.translate
50
+ };
51
+ ContinueLearning.propTypes = process.env.NODE_ENV !== "production" ? {
52
+ ongoingCourses: _propTypes.default.shape(_cardsGrid.default.propTypes)
53
+ } : {};
54
+ var _default = ContinueLearning;
55
+ exports.default = _default;
56
+ //# sourceMappingURL=continue-learning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue-learning.js","names":["ContinueLearning","props","context","ongoingCourses","translate","list","length","Title","style","continueLearningTitle","continueLearningNumber","padding","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","shape","CardsGrid"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n const Title = () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n );\n\n return (\n <CardsList cards={ongoingCourses.list} title={<Title />} customStyle={{padding: '16px 0px 8px'}}/>\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IAACC;EAAD,IAAmBF,KAAzB;EACA,MAAM;IAACG;EAAD,IAAcF,OAApB;;EAEA,IAAIC,cAAc,CAACE,IAAf,CAAoBC,MAApB,KAA+B,CAAnC,EAAsC;IACpC,OAAO,IAAP;EACD;;EAED,MAAMC,KAAK,GAAG,mBACZ,yEACE;IAAM,SAAS,EAAEC,yBAAA,CAAMC;EAAvB,GAA+CL,SAAS,CAAC,mBAAD,CAAxD,CADF,eAEE;IAAM,SAAS,EAAEI,yBAAA,CAAME;EAAvB,GAAgDP,cAAc,CAACE,IAAf,CAAoBC,MAApE,CAFF,CADF;;EAOA,oBACE,6BAAC,kBAAD;IAAW,KAAK,EAAEH,cAAc,CAACE,IAAjC;IAAuC,KAAK,eAAE,6BAAC,KAAD,OAA9C;IAAyD,WAAW,EAAE;MAACM,OAAO,EAAE;IAAV;EAAtE,EADF;AAGD,CAlBD;;AAoBAX,gBAAgB,CAACY,YAAjB,GAAgC;EAC9BC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF,IADH;EAE9BT,SAAS,EAAEU,iBAAA,CAASC,iBAAT,CAA2BX;AAFR,CAAhC;AAKAJ,gBAAgB,CAACgB,SAAjB,2CAA6B;EAC3Bb,cAAc,EAAEc,kBAAA,CAAUC,KAAV,CAAgBC,kBAAA,CAAUH,SAA1B;AADW,CAA7B;eAIehB,gB"}