@pie-element/passage 7.4.2-beta.4 → 7.4.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.
- package/CHANGELOG.md +54 -31
- package/configure/CHANGELOG.md +43 -28
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +3 -47
- package/controller/package.json +1 -1
- package/lib/stimulus-tabs.js +36 -12
- package/lib/stimulus-tabs.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +6 -2
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,78 +3,101 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [7.4.
|
|
6
|
+
## [7.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.2...@pie-element/passage@7.4.3) (2026-09-17)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-element/passage
|
|
9
9
|
|
|
10
|
-
## [7.4.2
|
|
10
|
+
## [7.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.1...@pie-element/passage@7.4.2) (2026-09-04)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### Bug Fixes
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- bump libs PIE-978, PIE-980 ([96489ba](https://github.com/pie-framework/pie-elements/commit/96489ba3c220604f21c3ce4500d79f4389266e9e))
|
|
15
|
+
|
|
16
|
+
## [7.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.0...@pie-element/passage@7.4.1) (2026-08-26)
|
|
15
17
|
|
|
16
18
|
**Note:** Version bump only for package @pie-element/passage
|
|
17
19
|
|
|
18
|
-
# [7.4.0
|
|
20
|
+
# [7.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.5...@pie-element/passage@7.4.0) (2026-08-21)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
### Bug Fixes
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
- move [@pie-lib](https://github.com/pie-lib) deps back to latest, off next prereleases PIE-927 ([a53e012](https://github.com/pie-framework/pie-elements/commit/a53e0127eb4ac95ece54e1e2bd669ae4974f4251))
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
### Features
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
## [7.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.4...@pie-element/passage@7.3.5) (2026-08-19)
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
### Bug Fixes
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
35
|
+
- **passage:** let the stimulus tabs follow the theme PIE-818 ([5c499e1](https://github.com/pie-framework/pie-elements/commit/5c499e1e38e1e9e8948e0d23532f63bd316204f8)), closes [#D9](https://github.com/pie-framework/pie-elements/issues/D9)
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
## [7.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.2...@pie-element/passage@7.3.4) (2026-08-13)
|
|
35
38
|
|
|
36
39
|
**Note:** Version bump only for package @pie-element/passage
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.1...@pie-element/passage@7.3.3) (2026-08-11)
|
|
39
42
|
|
|
40
43
|
**Note:** Version bump only for package @pie-element/passage
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.1...@pie-element/passage@7.3.2) (2026-07-31)
|
|
43
46
|
|
|
44
47
|
**Note:** Version bump only for package @pie-element/passage
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
## [7.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.3.0...@pie-element/passage@7.3.1) (2026-07-08)
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
54
|
+
- **stimulus-tabs:** update background colors to use CSS variables for theming support PIE-746 ([5db9d79](https://github.com/pie-framework/pie-elements/commit/5db9d79be4ee14c698342047a70292154d078d80))
|
|
49
55
|
|
|
50
|
-
# [7.3.0
|
|
56
|
+
# [7.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.2...@pie-element/passage@7.3.0) (2026-07-02)
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
### Bug Fixes
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
61
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
55
62
|
|
|
56
|
-
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
- **passage:** implement zoom compensation and dynamic tab width in StimulusTabs component PIE-728 ([8612da7](https://github.com/pie-framework/pie-elements/commit/8612da7d15a431511d053288ad616d545c96fc1d))
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
## [7.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.1...@pie-element/passage@7.2.2) (2026-06-22)
|
|
59
68
|
|
|
60
69
|
### Bug Fixes
|
|
61
70
|
|
|
62
|
-
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
63
|
-
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
64
|
-
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
65
71
|
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
66
|
-
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
67
|
-
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
68
72
|
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
69
|
-
|
|
73
|
+
|
|
74
|
+
## [7.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.2.0...@pie-element/passage@7.2.1) (2026-06-17)
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
79
|
+
|
|
80
|
+
# [7.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.2...@pie-element/passage@7.2.0) (2026-06-12)
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
70
85
|
- **passage:** set background colors for tab to white. Update colors to use pie-lib constants PIE-621 ([44d7f82](https://github.com/pie-framework/pie-elements/commit/44d7f82e229ed4a10d4aed6dbb49196cf1df0c43))
|
|
71
|
-
- **stimulus-tabs:** update background colors to use CSS variables for theming support PIE-746 ([5db9d79](https://github.com/pie-framework/pie-elements/commit/5db9d79be4ee14c698342047a70292154d078d80))
|
|
72
|
-
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
73
86
|
|
|
74
87
|
### Features
|
|
75
88
|
|
|
76
89
|
- **passage:** apply sticky tabs based on viewport PIE-622 ([5ab712d](https://github.com/pie-framework/pie-elements/commit/5ab712d230b290c138ef17f235e4f82e8147b436))
|
|
77
|
-
|
|
90
|
+
|
|
91
|
+
## [7.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.1...@pie-element/passage@7.1.2) (2026-06-04)
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
96
|
+
- **passage:** change active focus style PIE-598 ([155dc22](https://github.com/pie-framework/pie-elements/commit/155dc2218e6c07d55f5c7e8d556fc05689a0da52))
|
|
97
|
+
|
|
98
|
+
## [7.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.0...@pie-element/passage@7.1.1) (2026-05-21)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @pie-element/passage
|
|
78
101
|
|
|
79
102
|
# [7.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.1.0-next.1...@pie-element/passage@7.1.0) (2026-05-21)
|
|
80
103
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,70 +3,85 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [5.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.2...@pie-element/passage-configure@5.2.3) (2026-09-17)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-element/passage-configure
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## [5.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.1...@pie-element/passage-configure@5.2.2) (2026-09-04)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- bump libs PIE-978, PIE-980 ([96489ba](https://github.com/pie-framework/pie-elements/commit/96489ba3c220604f21c3ce4500d79f4389266e9e))
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
## [5.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.2.0...@pie-element/passage-configure@5.2.1) (2026-08-26)
|
|
15
17
|
|
|
16
18
|
**Note:** Version bump only for package @pie-element/passage-configure
|
|
17
19
|
|
|
18
|
-
# [5.
|
|
20
|
+
# [5.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.11...@pie-element/passage-configure@5.2.0) (2026-08-21)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
### Features
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
- bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
## [5.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.10...@pie-element/passage-configure@5.1.11) (2026-08-19)
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
### Bug Fixes
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
- bump libs and shared modules PIE-681, PIE-708 ([08af8b5](https://github.com/pie-framework/pie-elements/commit/08af8b5802aecc8ee5454a1b6d60277d7ec94204))
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
## [5.1.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.8...@pie-element/passage-configure@5.1.10) (2026-08-13)
|
|
31
33
|
|
|
32
34
|
**Note:** Version bump only for package @pie-element/passage-configure
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
## [5.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.7...@pie-element/passage-configure@5.1.9) (2026-08-11)
|
|
35
37
|
|
|
36
38
|
**Note:** Version bump only for package @pie-element/passage-configure
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
## [5.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.7...@pie-element/passage-configure@5.1.8) (2026-07-31)
|
|
39
41
|
|
|
40
42
|
**Note:** Version bump only for package @pie-element/passage-configure
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
## [5.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.6...@pie-element/passage-configure@5.1.7) (2026-07-08)
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
### Bug Fixes
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
## [5.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.5...@pie-element/passage-configure@5.1.6) (2026-07-02)
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
### Bug Fixes
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
- bump shared modules and libs PIE-695, PIE-697, PIE-699, PIE-680, PIE-714, PIE-665, PIE-656 ([4b76ae7](https://github.com/pie-framework/pie-elements/commit/4b76ae75d1c5ea6d55f7c6fb53f299dfcbda2b1f))
|
|
55
|
+
- sync libs versions ([48b5be9](https://github.com/pie-framework/pie-elements/commit/48b5be9559eb5b5235ca05f51c5f0161032a7041))
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
## [5.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.4...@pie-element/passage-configure@5.1.5) (2026-06-22)
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
### Bug Fixes
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
62
|
+
- handle webcomponent lifecycle on every element that misses it PIE-703 ([9d5923f](https://github.com/pie-framework/pie-elements/commit/9d5923f973f0471e1e8f69ad4309cfc63d980d93))
|
|
63
|
+
|
|
64
|
+
## [5.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.3...@pie-element/passage-configure@5.1.4) (2026-06-17)
|
|
59
65
|
|
|
60
66
|
### Bug Fixes
|
|
61
67
|
|
|
62
|
-
- bump libs & shared modules PIE-706, PIE-702, PIE-679, PIE-698 ([5b1a8c4](https://github.com/pie-framework/pie-elements/commit/5b1a8c4c3eba2126fc43d78fd0187e7cd11d5424))
|
|
63
|
-
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
64
68
|
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
|
|
70
|
+
## [5.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.2...@pie-element/passage-configure@5.1.3) (2026-06-12)
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
73
|
+
|
|
67
74
|
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
|
|
76
|
+
## [5.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.1...@pie-element/passage-configure@5.1.2) (2026-06-04)
|
|
77
|
+
|
|
78
|
+
### Bug Fixes
|
|
79
|
+
|
|
80
|
+
- bump shared modules and libs PIE-600, PIE-602 ([ce99f6a](https://github.com/pie-framework/pie-elements/commit/ce99f6af50cb855b666a6df9340f9f5445fde4c4))
|
|
81
|
+
|
|
82
|
+
## [5.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.0...@pie-element/passage-configure@5.1.1) (2026-05-21)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @pie-element/passage-configure
|
|
70
85
|
|
|
71
86
|
# [5.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.1.0-next.1...@pie-element/passage-configure@5.1.0) (2026-05-21)
|
|
72
87
|
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.2.3",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@mui/icons-material": "^7.3.4",
|
|
14
14
|
"@mui/material": "^7.3.4",
|
|
15
15
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
16
|
-
"@pie-lib/config-ui": "13.
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "2.
|
|
16
|
+
"@pie-lib/config-ui": "13.0.20",
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "2.1.18",
|
|
18
18
|
"lodash-es": "^4.17.23",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"react": "18.3.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,59 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [4.0.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.3...@pie-element/passage-controller@4.0.5) (2026-08-13)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-element/passage-controller
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## [4.0.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.3...@pie-element/passage-controller@4.0.4) (2026-08-11)
|
|
11
11
|
|
|
12
12
|
**Note:** Version bump only for package @pie-element/passage-controller
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
17
|
-
|
|
18
|
-
# [4.3.0-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.6...@pie-element/passage-controller@4.3.0-beta.7) (2026-08-20)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
21
|
-
|
|
22
|
-
# [4.3.0-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.5...@pie-element/passage-controller@4.3.0-beta.6) (2026-08-14)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
25
|
-
|
|
26
|
-
# [4.3.0-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.4...@pie-element/passage-controller@4.3.0-beta.5) (2026-08-11)
|
|
27
|
-
|
|
28
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
29
|
-
|
|
30
|
-
# [4.3.0-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.3...@pie-element/passage-controller@4.3.0-beta.4) (2026-08-11)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
33
|
-
|
|
34
|
-
# [4.3.0-beta.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.2...@pie-element/passage-controller@4.3.0-beta.3) (2026-08-11)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
37
|
-
|
|
38
|
-
# [4.3.0-beta.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.1...@pie-element/passage-controller@4.3.0-beta.2) (2026-08-11)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
41
|
-
|
|
42
|
-
# [4.3.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.0...@pie-element/passage-controller@4.3.0-beta.1) (2026-08-07)
|
|
43
|
-
|
|
44
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
45
|
-
|
|
46
|
-
# [4.3.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.2.0-beta.0...@pie-element/passage-controller@4.3.0-beta.0) (2026-08-07)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
49
|
-
|
|
50
|
-
# [4.2.0-beta.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.2.0-beta.0...@pie-element/passage-controller@4.2.0-beta.1) (2026-08-07)
|
|
51
|
-
|
|
52
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
53
|
-
|
|
54
|
-
# [4.2.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.1.0-beta.0...@pie-element/passage-controller@4.2.0-beta.0) (2026-08-07)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @pie-element/passage-controller
|
|
57
|
-
|
|
58
|
-
# [4.1.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2...@pie-element/passage-controller@4.1.0-beta.0) (2026-08-07)
|
|
14
|
+
## [4.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2...@pie-element/passage-controller@4.0.3) (2026-05-21)
|
|
59
15
|
|
|
60
16
|
**Note:** Version bump only for package @pie-element/passage-controller
|
|
61
17
|
|
package/controller/package.json
CHANGED
package/lib/stimulus-tabs.js
CHANGED
|
@@ -83,14 +83,26 @@ const PassageAuthor = (0, _styles.styled)('div')({
|
|
|
83
83
|
const TabStyled = (0, _styles.styled)(_Tab.default)(({
|
|
84
84
|
theme
|
|
85
85
|
}) => ({
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/*
|
|
87
|
+
* The tab carries the colour of the panel it opens, which is what makes it read as a
|
|
88
|
+
* tab rather than a button, and it has to be the themed panel colour: MUI's palette
|
|
89
|
+
* does not follow `--pie-*`, so `common.white` here left the tab white on every color
|
|
90
|
+
* scheme while the passage body beneath it went dark. The comment this replaces gated
|
|
91
|
+
* the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism
|
|
92
|
+
* pie-theme superseded, and blocked since 2023.
|
|
93
|
+
*/
|
|
94
|
+
background: _renderUi.color.background(),
|
|
88
95
|
fontSize: 'inherit',
|
|
89
96
|
fontFamily: 'Roboto, sans-serif',
|
|
90
|
-
color:
|
|
91
|
-
// remove when PD-2801 is DONE
|
|
97
|
+
color: _renderUi.color.text(),
|
|
92
98
|
borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,
|
|
93
|
-
|
|
99
|
+
/*
|
|
100
|
+
* `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The
|
|
101
|
+
* literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the
|
|
102
|
+
* tab outline -- the only thing separating an unselected tab from the strip -- was
|
|
103
|
+
* invisible there.
|
|
104
|
+
*/
|
|
105
|
+
border: `1px solid ${_renderUi.color.borderGray()}`,
|
|
94
106
|
borderBottomWidth: 0,
|
|
95
107
|
minHeight: '56px',
|
|
96
108
|
padding: '8px 10px',
|
|
@@ -110,7 +122,7 @@ const TabStyled = (0, _styles.styled)(_Tab.default)(({
|
|
|
110
122
|
opacity: 0.7
|
|
111
123
|
},
|
|
112
124
|
'&.Mui-selected': {
|
|
113
|
-
color:
|
|
125
|
+
color: _renderUi.color.text(),
|
|
114
126
|
'.passage-label': {
|
|
115
127
|
opacity: 1
|
|
116
128
|
},
|
|
@@ -127,13 +139,17 @@ const TabStyled = (0, _styles.styled)(_Tab.default)(({
|
|
|
127
139
|
opacity: 0.7
|
|
128
140
|
}
|
|
129
141
|
}));
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* The selection indicator, one per tab. Unselected it has to disappear into the tab, so it
|
|
145
|
+
* paints the tab's own background rather than a fixed white; selected it becomes
|
|
146
|
+
* `--pie-tertiary`, which every scheme sets.
|
|
147
|
+
*/
|
|
148
|
+
const Underline = (0, _styles.styled)('div')(() => ({
|
|
133
149
|
height: '2px',
|
|
134
150
|
width: '100%',
|
|
135
151
|
marginTop: '6px',
|
|
136
|
-
background:
|
|
152
|
+
background: _renderUi.color.background()
|
|
137
153
|
}));
|
|
138
154
|
class StimulusTabs extends _react.default.Component {
|
|
139
155
|
constructor(...args) {
|
|
@@ -373,8 +389,16 @@ class StimulusTabs extends _react.default.Component {
|
|
|
373
389
|
// so the reclaimed space flows to the passage content below.
|
|
374
390
|
zoom: zoomCompensation,
|
|
375
391
|
'& .MuiTabs-list': {
|
|
376
|
-
|
|
377
|
-
|
|
392
|
+
/*
|
|
393
|
+
* The strip behind the tabs. A host that has opted into
|
|
394
|
+
* `--pie-passage-header-background` keeps its own colour on every
|
|
395
|
+
* scheme -- Knowledge Checks' pale green-blue is deliberate and is not
|
|
396
|
+
* a scheme's business to override. With no host colour the fallback has
|
|
397
|
+
* to be a theme token rather than a white literal, or the strip stays
|
|
398
|
+
* white over a dark passage body.
|
|
399
|
+
*/
|
|
400
|
+
backgroundColor: `var(--pie-passage-header-background, ${_renderUi.color.backgroundDark()})`,
|
|
401
|
+
borderBottom: `1px solid ${_renderUi.color.borderGray()}`
|
|
378
402
|
},
|
|
379
403
|
'& .MuiTabs-indicator': {
|
|
380
404
|
backgroundColor: _renderUi.color.white(),
|
package/lib/stimulus-tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stimulus-tabs.js","names":["_react","_interopRequireDefault","require","_propTypes","_Tabs","_Tab","_styles","_renderUi","STICKY_TABS_BREAKPOINT","MAX_TABS_ZOOM","MIN_ZOOM_COMPENSATION","NUMERIC_LABEL_MIN_WIDTH_PER_TAB","computeZoomCompensation","window","ratio","outerWidth","innerWidth","zoom","Number","isFinite","Math","max","min","PassagesContainer","styled","flexGrow","backgroundColor","color","background","text","borderCollapse","padding","textAlign","Passage","theme","spacing","borderLeft","margin","PassageTitle","fontSize","PassageSubtitle","PassageAuthor","TabStyled","Tab","palette","common","white","fontFamily","black","borderRadius","border","borderBottomWidth","minHeight","display","alignItems","justifyContent","textTransform","WebkitLineClamp","WebkitBoxOrient","overflow","textOverflow","whiteSpace","opacity","tertiary","tertiaryLight","Underline","height","width","marginTop","StimulusTabs","React","Component","constructor","args","_defineProperty2","default","activeTab","zoomCompensation","containerWidth","createRef","setState","node","containerRef","current","clientWidth","state","event","setTimeout","tabChangeEvent","CustomEvent","detail","tab","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","stopPropagation","handleChange","document","getElementById","focus","div","createElement","innerHTML","replace","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","componentDidMount","addEventListener","updateZoomCompensation","ResizeObserver","resizeObserver","updateContainerWidth","observe","componentWillUnmount","removeEventListener","disconnect","renderInstructions","teacherInstructions","disabledTabs","teacherInstructionsDiv","PreviewPrompt","tagName","className","defaultClassName","prompt","Collapsible","labels","hidden","visible","renderTab","baseHeadingLevel","clampedLevel","undefined","TitleTag","textLevel","role","title","Purpose","purpose","dangerouslySetInnerHTML","__html","parsedText","subtitle","author","transformDataHeadings","render","model","extraCSSRules","selectedTab","find","tabMaxWidth","useNumericLabels","UiLayout","ref","map","Fragment","sx","position","top","zIndex","borderBottom","marginBottom","value","onChange","index","maxWidth","label","tabIndex","onKeyDown","handleKeyDown","propTypes","PropTypes","arrayOf","shape","number","isRequired","string","bool","object","_default","exports"],"sources":["../src/stimulus-tabs.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible, color, PreviewPrompt, Purpose, UiLayout, transformDataHeadings } from '@pie-lib/render-ui';\n\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled = styled(Tab)(({ theme }) => ({\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: theme.palette.common.black, // remove when PD-2801 is DONE\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n border: '1px solid #D9DADA',\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: theme.palette.common.black,\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\nconst Underline = styled('div')(({ theme }) => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage key={tab.id} id={`tabpanel-${tab.id}`} role=\"tabpanel\" aria-labelledby={`button-${tab.id}`}>\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n backgroundColor: 'var(--pie-passage-header-background, #ffffff)',\n borderBottom: '1px solid #D9DADA',\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAA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C,CAAC,CAACD,UACL,CAAC,CAACA,UAAU;EACZzD,YAAY,EAAEqD,kBAAS,CAACM,IAAI;EAC5B/B,KAAK,EAAEyB,kBAAS,CAACO,MAAM;EACvBhD,gBAAgB,EAAEyC,kBAAS,CAACG;AAC9B,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAtH,OAAA,GAEaN,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"stimulus-tabs.js","names":["_react","_interopRequireDefault","require","_propTypes","_Tabs","_Tab","_styles","_renderUi","STICKY_TABS_BREAKPOINT","MAX_TABS_ZOOM","MIN_ZOOM_COMPENSATION","NUMERIC_LABEL_MIN_WIDTH_PER_TAB","computeZoomCompensation","window","ratio","outerWidth","innerWidth","zoom","Number","isFinite","Math","max","min","PassagesContainer","styled","flexGrow","backgroundColor","color","background","text","borderCollapse","padding","textAlign","Passage","theme","spacing","borderLeft","margin","PassageTitle","fontSize","PassageSubtitle","PassageAuthor","TabStyled","Tab","fontFamily","borderRadius","border","borderGray","borderBottomWidth","minHeight","display","alignItems","justifyContent","textTransform","WebkitLineClamp","WebkitBoxOrient","overflow","textOverflow","whiteSpace","opacity","tertiary","tertiaryLight","Underline","height","width","marginTop","StimulusTabs","React","Component","constructor","args","_defineProperty2","default","activeTab","zoomCompensation","containerWidth","createRef","setState","node","containerRef","current","clientWidth","state","event","setTimeout","tabChangeEvent","CustomEvent","detail","tab","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","stopPropagation","handleChange","document","getElementById","focus","div","createElement","innerHTML","replace","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","componentDidMount","addEventListener","updateZoomCompensation","ResizeObserver","resizeObserver","updateContainerWidth","observe","componentWillUnmount","removeEventListener","disconnect","renderInstructions","teacherInstructions","disabledTabs","teacherInstructionsDiv","PreviewPrompt","tagName","className","defaultClassName","prompt","Collapsible","labels","hidden","visible","renderTab","baseHeadingLevel","clampedLevel","undefined","TitleTag","textLevel","role","title","Purpose","purpose","dangerouslySetInnerHTML","__html","parsedText","subtitle","author","transformDataHeadings","render","model","extraCSSRules","selectedTab","find","tabMaxWidth","useNumericLabels","UiLayout","ref","map","Fragment","sx","position","top","zIndex","backgroundDark","borderBottom","white","marginBottom","value","onChange","index","maxWidth","label","tabIndex","onKeyDown","handleKeyDown","propTypes","PropTypes","arrayOf","shape","number","isRequired","string","bool","object","_default","exports"],"sources":["../src/stimulus-tabs.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { styled } from '@mui/material/styles';\nimport { Collapsible, color, PreviewPrompt, Purpose, UiLayout, transformDataHeadings } from '@pie-lib/render-ui';\n\n// Must match the breakpoint Quiz Engine passes to the PIE section player for\n// switching from the side-by-side passage/question layout to the tabbed layout.\n// Below (and at) this width the passage tabs scroll with the passage content\n// instead of being locked to the top of the panel, so that they do not lock up\n// space needed for the passage text (WCAG 1.4.10 Reflow, 400% zoom / 320px).\nconst STICKY_TABS_BREAKPOINT = 840;\n\n/**\n * Zoom compensation for the passage selection tabs.\n *\n * The tabs scale naturally with browser zoom up to 200%. Beyond 200%,\n * we shrink their CSS size proportionally so their physical on-screen size\n * freezes at the 200% appearance, leaving more room for passage content\n * in high-zoom / small-window situations.\n * The factor is min(1, 2 / zoom): exactly 1 at zoom <= 200% (component\n * behavior unchanged), shrinking proportionally above that. A lower clamp\n * of 0.4 guards against inflated ratios (docked devtools, browser side\n * panels, window chrome) ever making the tabs unusably small.\n */\nconst MAX_TABS_ZOOM = 2;\nconst MIN_ZOOM_COMPENSATION = 0.4;\n\n// Per-tab horizontal-space floor in CSS pixels. When the passage container is\n// narrow enough that each tab would have at most this much room\n// (containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB), tab labels\n// fall back to \"Passage 1\", \"Passage 2\", ... so navigation stays usable instead\n// of being dominated by aggressively truncated titles.\nconst NUMERIC_LABEL_MIN_WIDTH_PER_TAB = 170;\n\nconst computeZoomCompensation = () => {\n if (typeof window === 'undefined') return 1;\n const ratio = window.outerWidth / window.innerWidth;\n const zoom = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n return Math.max(MIN_ZOOM_COMPENSATION, Math.min(1, MAX_TABS_ZOOM / zoom));\n};\n\nconst PassagesContainer = styled('div')({\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n});\n\nconst Passage = styled('div')(({ theme }) => ({\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing(2),\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n}));\n\nconst PassageTitle = styled('div')({\n fontSize: '1.75rem',\n});\n\nconst PassageSubtitle = styled('div')({\n fontSize: '1.5rem',\n});\n\nconst PassageAuthor = styled('div')({\n fontSize: '1.25rem',\n});\n\nconst TabStyled = styled(Tab)(({ theme }) => ({\n /*\n * The tab carries the colour of the panel it opens, which is what makes it read as a\n * tab rather than a button, and it has to be the themed panel colour: MUI's palette\n * does not follow `--pie-*`, so `common.white` here left the tab white on every color\n * scheme while the passage body beneath it went dark. The comment this replaces gated\n * the change on PD-2801, which is about OT's `color-contrast` class -- the mechanism\n * pie-theme superseded, and blocked since 2023.\n */\n background: color.background(),\n fontSize: 'inherit',\n fontFamily: 'Roboto, sans-serif',\n color: color.text(),\n borderRadius: `${theme.spacing(2)} ${theme.spacing(2)} 0 0`,\n /*\n * `--pie-border-gray` is stepped to the 3:1 non-text minimum in every scheme. The\n * literal it replaces measured about 1.2:1 against the dark schemes' surfaces, so the\n * tab outline -- the only thing separating an unselected tab from the strip -- was\n * invisible there.\n */\n border: `1px solid ${color.borderGray()}`,\n borderBottomWidth: 0,\n minHeight: '56px',\n padding: '8px 10px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: `0 ${theme.spacing(1)}`,\n textTransform: 'none',\n\n '.passage-label': {\n display: '-webkit-box',\n WebkitLineClamp: 2,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'normal',\n margin: 'auto 0',\n opacity: 0.7,\n },\n\n '&.Mui-selected': {\n color: color.text(),\n '.passage-label': {\n opacity: 1,\n },\n '.passage-label-underline': {\n backgroundColor: color.tertiary(),\n },\n },\n\n '&:hover': {\n '.passage-label-underline': {\n backgroundColor: color.tertiaryLight(),\n },\n },\n\n '& .MuiTouchRipple-root': {\n opacity: 0.7,\n },\n}));\n\n/*\n * The selection indicator, one per tab. Unselected it has to disappear into the tab, so it\n * paints the tab's own background rather than a fixed white; selected it becomes\n * `--pie-tertiary`, which every scheme sets.\n */\nconst Underline = styled('div')(() => ({\n height: '2px',\n width: '100%',\n marginTop: '6px',\n background: color.background(),\n}));\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n zoomCompensation: computeZoomCompensation(),\n containerWidth: 0,\n };\n\n containerRef = React.createRef();\n\n componentDidMount() {\n if (typeof window === 'undefined') return;\n window.addEventListener('resize', this.updateZoomCompensation);\n\n if (this.containerRef.current && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(this.updateContainerWidth);\n this.resizeObserver.observe(this.containerRef.current);\n }\n\n this.updateContainerWidth();\n }\n\n componentWillUnmount() {\n if (typeof window === 'undefined') return;\n window.removeEventListener('resize', this.updateZoomCompensation);\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n updateZoomCompensation = () => {\n this.setState({ zoomCompensation: computeZoomCompensation() });\n };\n\n updateContainerWidth = () => {\n const node = this.containerRef.current;\n if (!node) return;\n const width = node.clientWidth;\n if (width !== this.state.containerWidth) {\n this.setState({ containerWidth: width });\n }\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n event.stopPropagation();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!teacherInstructions) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { baseHeadingLevel } = this.props;\n const clampedLevel = baseHeadingLevel ? Math.min(6, Math.max(1, baseHeadingLevel)) : undefined;\n const TitleTag = baseHeadingLevel ? `h${clampedLevel}` : 'h2'; // default to h2 if no base level is provided - this was the previous behavior\n const textLevel = baseHeadingLevel ? Math.min(6, Math.max(1, clampedLevel + 1)) : undefined; // promote text headings one level above title\n\n return (\n <Passage key={tab.id} id={`tabpanel-${tab.id}`} role=\"tabpanel\" aria-labelledby={`button-${tab.id}`}>\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {tab.title && (\n <Purpose purpose=\"passage-title\">\n <TitleTag>\n <PassageTitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }} />\n </TitleTag>\n </Purpose>\n )}\n\n {tab.subtitle && (\n <Purpose purpose=\"passage-subtitle\">\n <PassageSubtitle dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }} />\n </Purpose>\n )}\n\n {tab.author && (\n <Purpose purpose=\"passage-author\">\n <PassageAuthor className=\"author\" dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }} />\n </Purpose>\n )}\n\n {tab.text && (\n <Purpose purpose=\"passage-text\">\n <div key={tab.id} className=\"text\" dangerouslySetInnerHTML={{ __html: baseHeadingLevel ? transformDataHeadings(tab.text, textLevel) : tab.text }} />\n </Purpose>\n )}\n </Passage>\n );\n }\n\n render() {\n const { model, tabs, disabledTabs } = this.props;\n const { activeTab, zoomCompensation, containerWidth } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const { extraCSSRules } = model || {};\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n // cap each tab at 1/n of the passage container width so a single long\n // title can't push other tabs off-screen. Existing two-line wrap + ellipsis\n // on .passage-label still trims anything that doesn't fit.\n const tabMaxWidth = containerWidth > 0 ? containerWidth / tabs.length : null;\n // When per-tab horizontal space drops to NUMERIC_LABEL_MIN_WIDTH_PER_TAB or\n // less, titles become unreadably truncated; swap to \"Passage N\" so users\n // can still navigate. Container width is read once layout has settled\n // (>0), so initial render uses real labels.\n const useNumericLabels =\n containerWidth > 0 && containerWidth <= tabs.length * NUMERIC_LABEL_MIN_WIDTH_PER_TAB;\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n <PassagesContainer className=\"passages\" ref={this.containerRef}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n sx={{\n // Below the breakpoint (e.g. WCAG 400% zoom, ~320px viewport)\n // the tabs are in normal flow and scroll with the passage text,\n // so they don't lock up space needed to display the passage.\n position: 'static',\n // Above the breakpoint there is adequate screen space, so the\n // tabs stay locked to the top of the panel while the passage\n // text scrolls beneath them.\n [`@media (min-width: ${STICKY_TABS_BREAKPOINT + 1}px)`]: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n },\n background: 'var(--pie-passage-header-background, rgba(255,255,255,0))',\n color: color.text(),\n fontFamily: 'Roboto, sans-serif',\n // Freeze the tabs' physical size at their 200%-zoom appearance\n // when browser zoom exceeds 200%. The factor is 1 at zoom <= 200%,\n // so behavior below that threshold is unchanged. Using `zoom`\n // (rather than transform: scale) shrinks the layout box itself,\n // so the reclaimed space flows to the passage content below.\n zoom: zoomCompensation,\n '& .MuiTabs-list': {\n /*\n * The strip behind the tabs. A host that has opted into\n * `--pie-passage-header-background` keeps its own colour on every\n * scheme -- Knowledge Checks' pale green-blue is deliberate and is not\n * a scheme's business to override. With no host colour the fallback has\n * to be a theme token rather than a white literal, or the strip stays\n * white over a dark passage body.\n */\n backgroundColor: `var(--pie-passage-header-background, ${color.backgroundDark()})`,\n borderBottom: `1px solid ${color.borderGray()}`,\n },\n '& .MuiTabs-indicator': {\n backgroundColor: color.white(),\n marginBottom: '-1px',\n },\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab, index) => (\n <TabStyled\n key={tab.id}\n id={`button-${tab.id}`}\n sx={tabMaxWidth ? { maxWidth: `${tabMaxWidth}px` } : undefined}\n label={\n <>\n <Purpose purpose=\"passage-label\">\n {useNumericLabels ? (\n <span className=\"passage-label\">{`Passage ${index + 1}`}</span>\n ) : (\n <span\n className=\"passage-label\"\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }}\n />\n )}\n </Purpose>\n <Underline className=\"passage-label-underline\" />\n </>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </PassagesContainer>\n </UiLayout>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n model: PropTypes.object,\n baseHeadingLevel: PropTypes.number,\n};\n\nexport default StimulusTabs;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA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AS,CAACK,MAAM;IACxB/J,IAAI,EAAE0J,kBAAS,CAACK,MAAM,CAACD,UAAU;IACjC5D,mBAAmB,EAAEwD,kBAAS,CAACK;EACjC,CAAC,CAAC,CAACD,UACL,CAAC,CAACA,UAAU;EACZ3D,YAAY,EAAEuD,kBAAS,CAACM,IAAI;EAC5BjC,KAAK,EAAE2B,kBAAS,CAACO,MAAM;EACvBlD,gBAAgB,EAAE2C,kBAAS,CAACG;AAC9B,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAxH,OAAA,GAEaN,YAAY","ignoreList":[]}
|
package/module/configure.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_prop_types as e,_dll_mui__material_styles as t,_dll_react as a,_dll_mui__material as n,_dll_mui__icons_material as i,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@^4.0.4/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@^7.1.1/module/index.js";var r={};Object.defineProperty(r,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var u=r.ModelUpdatedEvent=d;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var g=r.DeleteImageEvent=c;class p extends CustomEvent{constructor(e){super(p.TYPE,{bubbles:!0,detail:e}),this.handler=e}}p.TYPE="insert.image";var h=r.InsertImageEvent=p;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var b=r.DeleteSoundEvent=m;class _ extends CustomEvent{constructor(e){super(_.TYPE,{bubbles:!0,detail:e}),this.handler=e}}_.TYPE="insert.sound";var C=r.InsertSoundEvent=_;const E=a,f=e,{styled:x}=t,{Button:S}=n,{Dialog:I}=n,{DialogTitle:v}=n,{DialogContent:P}=n,{DialogContentText:y}=n,{DialogActions:T}=n,{RemoveCircle:R}=i,{AddCircle:q}=i,D=x(({label:e,type:t="add",onClick:a})=>{const n="add"===t?q:R;return E.createElement(S,{color:"primary",size:"small",onClick:a},E.createElement(n,{fontSize:"small",color:"primary",style:{marginRight:4}}),e)})({textDecoration:"underline","&:hover":{textDecoration:"underline",backgroundColor:"transparent"},display:"flex",alignItems:"center"}),k=({content:e,cancel:t,title:a,ok:n,open:i,onOk:s,onCancel:l})=>E.createElement(I,{open:i},E.createElement(v,null,a),E.createElement(P,null,E.createElement(y,null,e)),E.createElement(T,null,s&&E.createElement(S,{onClick:s,color:"primary"},n),l&&E.createElement(S,{onClick:l,color:"primary"},t)));k.propTypes={content:f.string.isRequired,title:f.string.isRequired,cancel:f.string.isRequired,ok:f.string.isRequired,open:f.bool.isRequired,onCancel:f.func.isRequired,onOk:f.func.isRequired};const A=a,M=e,{styled:w}=t,{InputContainer:j}=l,O=o,{ALL_PLUGINS:Y}=o;function L(e){let t,a=e[0],n=1;for(;n<e.length;){const i=e[n],s=e[n+1];if(n+=2,("optionalAccess"===i||"optionalCall"===i)&&null==a)return;"access"===i||"optionalAccess"===i?(t=a,a=s(a)):"call"!==i&&"optionalCall"!==i||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}const H=w(j)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),W=w("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class z extends A.Component{static __initStatic(){this.propTypes={onModelChanged:M.func.isRequired,model:M.object.isRequired,configuration:M.object.isRequired,imageSupport:M.object.isRequired,passageIndex:M.number.isRequired,uploadSoundSupport:M.object.isRequired}}static __initStatic2(){this.defaultProps={passageIndex:0}}constructor(e){super(e),z.prototype.__init.call(this)}__init(){this.handleChange=(e,t)=>{const{model:a,onModelChanged:n,passageIndex:i}=this.props;if(!a.passages||i<0||i>=a.passages.length)return;const s=[...a.passages];s[i]={...s[i],[e]:t},n({...a,passages:s})}}render(){const{model:e,configuration:t,imageSupport:a,passageIndex:n,uploadSoundSupport:i}=this.props,{maxImageWidth:s={},maxImageHeight:l={},mathMlOptions:o={},baseInputConfiguration:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={}}=t||{},{errors:h={},passages:m=[],teacherInstructionsEnabled:b,titleEnabled:_,subtitleEnabled:C,authorEnabled:E,textEnabled:f}=e||{},{passages:x}=h||{},{teacherInstructions:S,title:I,subtitle:v,author:P,text:y}=x&&x[n]||{},T=s&&s.prompt,R=l&&l.prompt,q=e=>({...r,...e}),D=(Y||[]).filter(e=>!["math","table","bulleted-list","numbered-list"].includes(e));return A.createElement(A.Fragment,null,b&&A.createElement(H,{label:d.label},A.createElement(O,{activePlugins:Y,markup:m[n].teacherInstructions||"",onChange:e=>this.handleChange("teacherInstructions",e),nonEmpty:!1,error:S,maxImageWidth:s&&s.teacherInstructions||T,maxImageHeight:l&&l.teacherInstructions||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([d,"optionalAccess",e=>e.inputConfiguration]))}),S&&A.createElement(W,null,S)),_&&A.createElement(H,{label:u.label},A.createElement(O,{activePlugins:D,markup:m[n].title||"",onChange:e=>this.handleChange("title",e),nonEmpty:!1,error:I,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([u,"optionalAccess",e=>e.inputConfiguration]))}),I&&A.createElement(W,null,I)),C&&A.createElement(H,{label:c.label},A.createElement(O,{activePlugins:D,markup:m[n].subtitle||"",onChange:e=>this.handleChange("subtitle",e),nonEmpty:!1,error:v,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([c,"optionalAccess",e=>e.inputConfiguration]))}),v&&A.createElement(W,null,v)),E&&A.createElement(H,{label:p.label},A.createElement(O,{activePlugins:D,markup:m[n].author||"",onChange:e=>this.handleChange("author",e),nonEmpty:!1,error:P,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([p,"optionalAccess",e=>e.inputConfiguration]))}),P&&A.createElement(W,null,P)),f&&A.createElement(H,{label:g.label},A.createElement(O,{activePlugins:Y,markup:m[n].text||"",onChange:e=>this.handleChange("text",e),imageSupport:a,uploadSoundSupport:i,nonEmpty:!1,error:y,maxImageWidth:s&&s.text||T,maxImageHeight:l&&l.text||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([g,"optionalAccess",e=>e.inputConfiguration]))}),y&&A.createElement(W,null,y)))}}z.__initStatic(),z.__initStatic2();const B=a,$=e,{styled:F}=t,{Typography:U}=n,{settings:G}=l,{layout:N}=l,{Panel:J,toggle:K,dropdown:Q}=G,V=F(U)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2)}));class X extends B.Component{static __initStatic(){this.propTypes={onModelChanged:$.func.isRequired,onConfigurationChanged:$.func,model:$.object.isRequired,configuration:$.object.isRequired,imageSupport:$.object.isRequired,uploadSoundSupport:$.object.isRequired,classes:$.object.isRequired}}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),X.prototype.__init4.call(this),this.state={showConfirmationDialog:!1,indexToRemove:-1}}__init(){this.getInnerText=e=>(e||"").replaceAll(/<[^>]*>/g,"")}__init2(){this.onDelete=(e,t,a)=>{let n=e.passages;n.splice(t,1),a({...e,passages:n}),this.setState({showConfirmationDialog:!1,indexToRemove:-1})}}__init3(){this.removeAdditionalPassage=e=>{const{model:t={},onModelChanged:a}=this.props,{passages:n=[]}=t,{teacherInstructions:i="",title:s="",subtitle:l="",author:o="",text:r=""}=n[e];this.getInnerText(i).trim()||this.getInnerText(s).trim()||this.getInnerText(l).trim()||this.getInnerText(o).trim()||this.getInnerText(r).trim()?this.setState({showConfirmationDialog:!0,indexToRemove:e}):this.onDelete(t,e,a)}}__init4(){this.addAdditionalPassage=()=>{const{model:e,onModelChanged:t}=this.props,a=[...e.passages,{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}];t({...e,passages:a})}}render(){const{model:e,configuration:t,imageSupport:a,onConfigurationChanged:n,onModelChanged:i,uploadSoundSupport:s}=this.props,{settingsPanelDisabled:l,language:o={},languageChoices:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={},additionalPassage:h={}}=t||{},{extraCSSRules:m,passages:b}=e||{},_={titleEnabled:u&&u.settings&&K(u.label),subtitleEnabled:c&&c.settings&&K(c.label),authorEnabled:p&&p.settings&&K(p.label),textEnabled:g&&g.settings&&K(g.label),"additionalPassage.enabled":h&&h.settings&&K(h.label,!0)},C={teacherInstructionsEnabled:d&&d.settings&&K(d.label),"language.enabled":o&&o.settings&&K(o.label,!0),language:o&&o.settings&&o.enabled&&Q(r.label,r.options)},E=`${h.label} will be deleted`,{indexToRemove:f,showConfirmationDialog:x}=this.state;return B.createElement(N.ConfigLayout,{extraCSSRules:m,hideSettings:l,settings:B.createElement(J,{model:e,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:e=>n(e),groups:{Settings:_,Properties:C}})},b.map((n,l)=>B.createElement(B.Fragment,{key:l},l>0&&B.createElement(V,{variant:"h5"},h.label),B.createElement(z,{imageSupport:a,uploadSoundSupport:s,model:e,configuration:t,passageIndex:l,onModelChanged:i}),l>0&&h.enabled&&B.createElement(D,{type:"remove",label:`Remove ${h.label}`,onClick:()=>this.removeAdditionalPassage(l)}),0===l&&h.enabled&&b.length<2&&B.createElement(D,{label:`Add ${h.label}`,onClick:this.addAdditionalPassage}))),B.createElement(k,{open:x,title:"Warning",content:E,cancel:"Cancel",ok:"Ok",onCancel:()=>this.setState({showConfirmationDialog:!1}),onOk:()=>this.onDelete(e,f,i)}))}}X.__initStatic();var Z={authorEnabled:!0,passages:[{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}],subtitleEnabled:!0,teacherInstructionsEnabled:!0,textEnabled:!0,titleEnabled:!0},ee={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},settingsPanelDisabled:!1,title:{settings:!0,label:"Title",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!0},subtitle:{settings:!0,label:"Subtitle",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!1},author:{settings:!0,label:"Author",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0}},required:!1},text:{settings:!0,label:"Text",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!1},blockquote:{disabled:!1},textAlign:{disabled:!1}},required:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,text:300},maxImageHeight:{teacherInstructions:300,text:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},additionalPassage:{settings:!0,label:"Additional Passage",enabled:!1}};const te=a,{createRoot:ae}=s;class ne extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Z,...e})}constructor(){super(),this._root=null,this._model=ne.createDefaultModel(),this._configuration=ee}set model(e){this._model=ne.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new u(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=te.createElement(X,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=ae(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}ne.__initStatic();export{ne as default};
|
|
1
|
+
import{_dll_prop_types as e,_dll_mui__material_styles as t,_dll_react as n,_dll_mui__material as a,_dll_mui__icons_material as i,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@5.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@8.0.0/module/index.js";var r={};Object.defineProperty(r,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var u=r.ModelUpdatedEvent=d;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var g=r.DeleteImageEvent=c;class p extends CustomEvent{constructor(e){super(p.TYPE,{bubbles:!0,detail:e}),this.handler=e}}p.TYPE="insert.image";var h=r.InsertImageEvent=p;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var b=r.DeleteSoundEvent=m;class _ extends CustomEvent{constructor(e){super(_.TYPE,{bubbles:!0,detail:e}),this.handler=e}}_.TYPE="insert.sound";var C=r.InsertSoundEvent=_;const E=n,f=e,{styled:x}=t,{Button:S}=a,{Dialog:I}=a,{DialogTitle:v}=a,{DialogContent:P}=a,{DialogContentText:y}=a,{DialogActions:T}=a,{RemoveCircle:R}=i,{AddCircle:q}=i,D=x(({label:e,type:t="add",onClick:n})=>{const a="add"===t?q:R;return E.createElement(S,{color:"primary",size:"small",onClick:n},E.createElement(a,{fontSize:"small",color:"primary",style:{marginRight:4}}),e)})({textDecoration:"underline","&:hover":{textDecoration:"underline",backgroundColor:"transparent"},display:"flex",alignItems:"center"}),k=({content:e,cancel:t,title:n,ok:a,open:i,onOk:s,onCancel:l})=>E.createElement(I,{open:i},E.createElement(v,null,n),E.createElement(P,null,E.createElement(y,null,e)),E.createElement(T,null,s&&E.createElement(S,{onClick:s,color:"primary"},a),l&&E.createElement(S,{onClick:l,color:"primary"},t)));k.propTypes={content:f.string.isRequired,title:f.string.isRequired,cancel:f.string.isRequired,ok:f.string.isRequired,open:f.bool.isRequired,onCancel:f.func.isRequired,onOk:f.func.isRequired};const A=n,M=e,{styled:w}=t,{InputContainer:j}=l,O=o,{ALL_PLUGINS:Y}=o;function L(e){let t,n=e[0],a=1;for(;a<e.length;){const i=e[a],s=e[a+1];if(a+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}const H=w(j)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),W=w("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class z extends A.Component{static __initStatic(){this.propTypes={onModelChanged:M.func.isRequired,model:M.object.isRequired,configuration:M.object.isRequired,imageSupport:M.object.isRequired,passageIndex:M.number.isRequired,uploadSoundSupport:M.object.isRequired}}static __initStatic2(){this.defaultProps={passageIndex:0}}constructor(e){super(e),z.prototype.__init.call(this)}__init(){this.handleChange=(e,t)=>{const{model:n,onModelChanged:a,passageIndex:i}=this.props;if(!n.passages||i<0||i>=n.passages.length)return;const s=[...n.passages];s[i]={...s[i],[e]:t},a({...n,passages:s})}}render(){const{model:e,configuration:t,imageSupport:n,passageIndex:a,uploadSoundSupport:i}=this.props,{maxImageWidth:s={},maxImageHeight:l={},mathMlOptions:o={},baseInputConfiguration:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={}}=t||{},{errors:h={},passages:m=[],teacherInstructionsEnabled:b,titleEnabled:_,subtitleEnabled:C,authorEnabled:E,textEnabled:f}=e||{},{passages:x}=h||{},{teacherInstructions:S,title:I,subtitle:v,author:P,text:y}=x&&x[a]||{},T=s&&s.prompt,R=l&&l.prompt,q=e=>({...r,...e}),D=(Y||[]).filter(e=>!["math","table","bulleted-list","numbered-list"].includes(e));return A.createElement(A.Fragment,null,b&&A.createElement(H,{label:d.label},A.createElement(O,{activePlugins:Y,markup:m[a].teacherInstructions||"",onChange:e=>this.handleChange("teacherInstructions",e),nonEmpty:!1,error:S,maxImageWidth:s&&s.teacherInstructions||T,maxImageHeight:l&&l.teacherInstructions||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([d,"optionalAccess",e=>e.inputConfiguration]))}),S&&A.createElement(W,null,S)),_&&A.createElement(H,{label:u.label},A.createElement(O,{activePlugins:D,markup:m[a].title||"",onChange:e=>this.handleChange("title",e),nonEmpty:!1,error:I,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([u,"optionalAccess",e=>e.inputConfiguration]))}),I&&A.createElement(W,null,I)),C&&A.createElement(H,{label:c.label},A.createElement(O,{activePlugins:D,markup:m[a].subtitle||"",onChange:e=>this.handleChange("subtitle",e),nonEmpty:!1,error:v,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([c,"optionalAccess",e=>e.inputConfiguration]))}),v&&A.createElement(W,null,v)),E&&A.createElement(H,{label:p.label},A.createElement(O,{activePlugins:D,markup:m[a].author||"",onChange:e=>this.handleChange("author",e),nonEmpty:!1,error:P,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([p,"optionalAccess",e=>e.inputConfiguration]))}),P&&A.createElement(W,null,P)),f&&A.createElement(H,{label:g.label},A.createElement(O,{activePlugins:Y,markup:m[a].text||"",onChange:e=>this.handleChange("text",e),imageSupport:n,uploadSoundSupport:i,nonEmpty:!1,error:y,maxImageWidth:s&&s.text||T,maxImageHeight:l&&l.text||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([g,"optionalAccess",e=>e.inputConfiguration]))}),y&&A.createElement(W,null,y)))}}z.__initStatic(),z.__initStatic2();const B=n,$=e,{styled:F}=t,{Typography:U}=a,{settings:G}=l,{layout:N}=l,{Panel:J,toggle:K,dropdown:Q}=G,V=F(U)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2)}));class X extends B.Component{static __initStatic(){this.propTypes={onModelChanged:$.func.isRequired,onConfigurationChanged:$.func,model:$.object.isRequired,configuration:$.object.isRequired,imageSupport:$.object.isRequired,uploadSoundSupport:$.object.isRequired,classes:$.object.isRequired}}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),X.prototype.__init4.call(this),this.state={showConfirmationDialog:!1,indexToRemove:-1}}__init(){this.getInnerText=e=>(e||"").replaceAll(/<[^>]*>/g,"")}__init2(){this.onDelete=(e,t,n)=>{let a=e.passages;a.splice(t,1),n({...e,passages:a}),this.setState({showConfirmationDialog:!1,indexToRemove:-1})}}__init3(){this.removeAdditionalPassage=e=>{const{model:t={},onModelChanged:n}=this.props,{passages:a=[]}=t,{teacherInstructions:i="",title:s="",subtitle:l="",author:o="",text:r=""}=a[e];this.getInnerText(i).trim()||this.getInnerText(s).trim()||this.getInnerText(l).trim()||this.getInnerText(o).trim()||this.getInnerText(r).trim()?this.setState({showConfirmationDialog:!0,indexToRemove:e}):this.onDelete(t,e,n)}}__init4(){this.addAdditionalPassage=()=>{const{model:e,onModelChanged:t}=this.props,n=[...e.passages,{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}];t({...e,passages:n})}}render(){const{model:e,configuration:t,imageSupport:n,onConfigurationChanged:a,onModelChanged:i,uploadSoundSupport:s}=this.props,{settingsPanelDisabled:l,language:o={},languageChoices:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={},additionalPassage:h={}}=t||{},{extraCSSRules:m,passages:b}=e||{},_={titleEnabled:u&&u.settings&&K(u.label),subtitleEnabled:c&&c.settings&&K(c.label),authorEnabled:p&&p.settings&&K(p.label),textEnabled:g&&g.settings&&K(g.label),"additionalPassage.enabled":h&&h.settings&&K(h.label,!0)},C={teacherInstructionsEnabled:d&&d.settings&&K(d.label),"language.enabled":o&&o.settings&&K(o.label,!0),language:o&&o.settings&&o.enabled&&Q(r.label,r.options)},E=`${h.label} will be deleted`,{indexToRemove:f,showConfirmationDialog:x}=this.state;return B.createElement(N.ConfigLayout,{extraCSSRules:m,hideSettings:l,settings:B.createElement(J,{model:e,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:e=>a(e),groups:{Settings:_,Properties:C}})},b.map((a,l)=>B.createElement(B.Fragment,{key:l},l>0&&B.createElement(V,{variant:"h5"},h.label),B.createElement(z,{imageSupport:n,uploadSoundSupport:s,model:e,configuration:t,passageIndex:l,onModelChanged:i}),l>0&&h.enabled&&B.createElement(D,{type:"remove",label:`Remove ${h.label}`,onClick:()=>this.removeAdditionalPassage(l)}),0===l&&h.enabled&&b.length<2&&B.createElement(D,{label:`Add ${h.label}`,onClick:this.addAdditionalPassage}))),B.createElement(k,{open:x,title:"Warning",content:E,cancel:"Cancel",ok:"Ok",onCancel:()=>this.setState({showConfirmationDialog:!1}),onOk:()=>this.onDelete(e,f,i)}))}}X.__initStatic();var Z={authorEnabled:!0,passages:[{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}],subtitleEnabled:!0,teacherInstructionsEnabled:!0,textEnabled:!0,titleEnabled:!0},ee={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},settingsPanelDisabled:!1,title:{settings:!0,label:"Title",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!0},subtitle:{settings:!0,label:"Subtitle",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!1},author:{settings:!0,label:"Author",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0}},required:!1},text:{settings:!0,label:"Text",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!1},blockquote:{disabled:!1},textAlign:{disabled:!1}},required:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,text:300},maxImageHeight:{teacherInstructions:300,text:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},additionalPassage:{settings:!0,label:"Additional Passage",enabled:!1}};const te=n,{createRoot:ne}=s;class ae extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Z,...e})}constructor(){super(),this._root=null,this._model=ae.createDefaultModel(),this._configuration=ee}set model(e){this._model=ae.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new u(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=te.createElement(X,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=ne(this)),this._root.render(e)}}disconnectedCallback(){this._root&&(this._root.unmount(),this._root=null)}}ae.__initStatic();export{ae as default};
|
package/module/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^5.0.4/module/index.js";import{_dll_react as t,_dll_prop_types as s,_dll_mui__material as i,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as n,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});class l extends CustomEvent{constructor(e,t,s){super(l.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:s}}),this.component=e,this.complete=t}}l.TYPE="model-set";var c=o.ModelSetEvent=l;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}d.TYPE="session-changed",o.SessionChangedEvent=d;const h=t,u=s,{Tabs:b}=i,{Tab:m}=i,{styled:p}=r,{Collapsible:_}=n,{color:g}=n,{PreviewPrompt:v}=n,{Purpose:y}=n,{UiLayout:f}=n,{transformDataHeadings:E}=n;const x=p("div")({flexGrow:1,backgroundColor:g.background(),color:g.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),T=p("div")(({theme:e})=>({backgroundColor:g.background(),color:g.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),M=p("div")({fontSize:"1.75rem"}),O=p("div")({fontSize:"1.5rem"}),C=p("div")({fontSize:"1.25rem"}),k=p(m)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class L extends h.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:s}=e,{tabs:i}=this.props;let r=-1;const n=i.findIndex(e=>e.id===t);switch(s){case"ArrowRight":r=(n+1)%i.length;break;case"ArrowLeft":r=(n-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=n}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const s=t.querySelector("audio");if(s){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",s.getAttribute("src")),s.removeAttribute("src"),s.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const s=h.createElement(v,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?s:h.createElement(_,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},s)}renderTab(e,t){const{baseHeadingLevel:s}=this.props,i=s?Math.min(6,Math.max(1,s)):void 0,r=s?`h${i}`:"h2",n=s?Math.min(6,Math.max(1,i+1)):void 0;return h.createElement(T,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&h.createElement(y,{purpose:"passage-title"},h.createElement(r,null,h.createElement(M,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&h.createElement(y,{purpose:"passage-subtitle"},h.createElement(O,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&h.createElement(y,{purpose:"passage-author"},h.createElement(C,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&h.createElement(y,{purpose:"passage-text"},h.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:s?E(e.text,n):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:s}=this.props,{activeTab:i}=this.state;if(!function(e){let t,s=e[0],i=1;for(;i<e.length;){const r=e[i],n=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==s)return;"access"===r||"optionalAccess"===r?(t=s,s=n(s)):"call"!==r&&"optionalCall"!==r||(s=n((...e)=>s.call(t,...e)),t=void 0)}return s}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:r}=e||{},n=(t||[]).find(e=>e.id===i);return h.createElement(f,{extraCSSRules:r},h.createElement(x,{className:"passages"},s||1===t.length?t.map(e=>this.renderTab(e,s)):h.createElement(h.Fragment,null,h.createElement(b,{sx:{position:"sticky",top:0,background:g.background(),color:g.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:i,onChange:this.handleChange},t.map(e=>h.createElement(k,{key:e.id,id:`button-${e.id}`,label:h.createElement(y,{purpose:"passage-label"},h.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),n?this.renderTab(n,s):null)))}}L.propTypes={tabs:u.arrayOf(u.shape({id:u.number.isRequired,label:u.string.isRequired,title:u.string.isRequired,subtitle:u.string,author:u.string,text:u.string.isRequired,teacherInstructions:u.string}).isRequired).isRequired,disabledTabs:u.bool,model:u.object,baseHeadingLevel:u.number};const{renderMath:A}=e,P=t,{createRoot:R}=a;function S(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(s=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=s?s:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var s,i}class w extends HTMLElement{constructor(){super(),w.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),A(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new c(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),s=P.createElement(L,{tabs:t,model:this._model,baseHeadingLevel:S(this)});this._root||(this._root=R(this)),this._root.render(s),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&this._root.unmount()}}export{w as default};
|
|
1
|
+
import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as i,_dll_react_dom as r,_dll_mui__material_colors as s,_dll_mui__material as o,_dll_debug as a,_dll_mui__material_collapse as l,_dll_react_dom_client as c}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var d={};Object.defineProperty(d,"__esModule",{value:!0});class p extends CustomEvent{constructor(e,t,n){super(p.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}p.TYPE="model-set";var h=d.ModelSetEvent=p;class u extends CustomEvent{constructor(e,t){super(u.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}u.TYPE="session-changed",d.SessionChangedEvent=u;const m=n,f=t,g=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",E=({size:e,children:t})=>{const n={height:e=g(e),width:e,display:"inline-block",position:"relative"};return m.createElement("div",{style:n},t)};E.propTypes={size:f.number,children:f.oneOfType([f.arrayOf(f.node),f.node]).isRequired};const b=n,y=t,v=({size:e,children:t,sx:n})=>b.createElement(E,{size:e},b.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));v.propTypes={size:y.oneOfType([y.string,y.number]),children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired,sx:y.object},y.string.isRequired;const x=({fill:e})=>b.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});x.propTypes={fill:y.string.isRequired};const C=({fill:e})=>b.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});C.propTypes={fill:y.string.isRequired};const _=({fill:e})=>b.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});_.propTypes={fill:y.string.isRequired};const R=({fill:e})=>b.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});R.propTypes={fill:y.string.isRequired};const k=t,O=n;var T=(e,t)=>{class n extends O.Component{static __initStatic(){this.propTypes={iconSet:k.oneOf(["emoji","check"]),shape:k.oneOf(["round","square"]),category:k.oneOf(["feedback",void 0]),open:k.bool,size:k.oneOfType([k.number,k.string]),fg:k.string,bg:k.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:s,size:o,fg:a,bg:l}=this.props,c="check"===n?O.createElement(e,{fill:a}):O.createElement(t,{fill:a}),d="check"===n?O.createElement(e,{fill:l}):O.createElement(t,{fill:l});return s?O.createElement(v,{size:o},d):O.createElement(v,{size:o},"feedback"===r?"round"===i?O.createElement(C,{fill:l}):O.createElement(x,{fill:l}):"round"===i?O.createElement(_,{fill:l}):O.createElement(R,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const S=t,A=n,M=({fill:e})=>A.createElement("g",{transform:"translate(1, 0)"},A.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),A.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),A.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));M.propTypes={fill:S.string.isRequired};const N=({fill:e,x:t=0,y:n=0})=>A.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});N.propTypes={fill:S.string.isRequired,x:S.number,y:S.number};const D=T(N,M);D.propTypes={iconSet:S.oneOf(["emoji","check"]),shape:S.oneOf(["round","square"]),category:S.oneOf(["feedback",void 0]),open:S.bool,fg:S.string,bg:S.string,size:S.oneOfType([S.string,S.number])},D.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const w=t,{styled:L}=i;w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,L("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),w.bool,w.string;const F=t,B=n,I=({fill:e})=>B.createElement("g",{transform:"translate(0.5, 0.5)"},B.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),B.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));I.propTypes={fill:F.string.isRequired};const z=({fill:e})=>B.createElement("g",{transform:"translate(1,0)"},B.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));z.propTypes={fill:F.string.isRequired};const P=T(I,z);P.propTypes={iconSet:F.oneOf(["emoji","check"]),shape:F.oneOf(["round","square"]),category:F.oneOf(["feedback",void 0]),open:F.bool,fg:F.string,bg:F.string,size:F.oneOfType([F.string,F.number])},P.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const q=t,j=n,H=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return j.createElement("g",null,j.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),j.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),j.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},W=({children:e,size:t})=>j.createElement(E,{size:t},j.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));W.propTypes={children:q.oneOfType([q.arrayOf(q.node),q.node]).isRequired,size:q.number};const $=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),Y=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class U extends j.Component{constructor(e){super(e)}render(){return!0===this.props.open?j.createElement(W,null,j.createElement($,null),j.createElement(H,null)):j.createElement(W,null,j.createElement(Y,null),j.createElement(H,null))}}U.propTypes={open:q.bool},U.defaultProps={open:!1};const G=t,K=n,J=({fill:e})=>K.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});J.propTypes={fill:G.string};class V extends K.Component{static __initStatic(){this.propTypes={classes:G.object.isRequired,size:G.number}}render(){const{size:e}=this.props;return!0===this.props.open?K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},K.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(J,{fill:"#1A9CFF"}))):K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(J,{fill:"1A9CFF"})))}}V.__initStatic(),V.propTypes={open:G.bool},V.defaultProps={open:!1};const X=t,Z=n,Q=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),Z.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Q.propTypes={fill:X.string.isRequired};const ee=({fill:e})=>Z.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});ee.propTypes={fill:X.string.isRequired};const te=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));te.propTypes={fill:X.string.isRequired};class ne extends Z.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),feedback:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),square:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),open:{check:Z.createElement(v,null,Z.createElement(Q,{fill:n})),emoji:Z.createElement(v,null,Z.createElement(te,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}ne.propTypes={iconSet:X.oneOf(["emoji","check",void 0]),shape:X.oneOf(["square",void 0]),category:X.oneOf(["feedback",void 0]),open:X.bool,fg:X.string,bg:X.string},ne.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const ie=t,re=n,se=({fill:e})=>re.createElement("g",{transform:"translate(0, 0)"},re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));se.propTypes={fill:ie.string.isRequired};const oe=({fill:e})=>re.createElement("g",{transform:"translate(2, 0)"},re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));oe.propTypes={fill:ie.string.isRequired};const ae=T(se,oe);ae.propTypes={iconSet:ie.oneOf(["emoji","check"]),shape:ie.oneOf(["round","square"]),category:ie.oneOf(["feedback",void 0]),open:ie.bool,fg:ie.string,bg:ie.string,size:ie.oneOfType([ie.string,ie.number])},ae.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const le=t,ce=n,de=({fill:e})=>ce.createElement("g",null,ce.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ce.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));de.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ce.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});pe.propTypes={fill:le.string.isRequired};const he=({fill:e="#FFFFFF"})=>ce.createElement("g",null,ce.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),ce.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));he.propTypes={fill:le.string};const ue=({children:e,size:t})=>{const n=g(t),i={height:n,width:n,display:"inline-block",position:"relative"};return ce.createElement("div",{style:i},ce.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};ue.propTypes={children:le.oneOfType([le.arrayOf(le.node),le.node]).isRequired,size:le.oneOfType([le.string,le.number])};class me extends ce.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,s=ce.createElement(de,{fill:n}),o={check:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),open:{check:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:"#FFFFFF"})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:r}))}};return!0===t?o.open[e]:o[e]}}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fe.apply(null,arguments)}function ge(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Ee(e,t){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ee(e,t)}function be(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ee(e,t)}function ye(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}me.propTypes={iconSet:le.oneOf(["emoji","check"]),open:le.bool,fg:le.string,bg:le.string,border:le.string,size:le.oneOfType([le.string,le.number])},me.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var ve=!1;var xe=n.createContext(null),Ce=function(e){return e.scrollTop};const _e=n,Re=r;var ke="unmounted",Oe="exited",Te="entering",Se="entered",Ae="exiting",Me=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,s=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=Oe,i.appearStatus=Te):r=Se:r=t.unmountOnExit||t.mountOnEnter?ke:Oe,i.state={status:r},i.nextCallback=null,i}be(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:Oe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Te&&n!==Se&&(t=Te):n!==Te&&n!==Se||(t=Ae)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Te){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this);n&&Ce(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Oe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Re.findDOMNode(this),i],s=r[0],o=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||ve?this.safeSetState({status:Se},function(){t.props.onEntered(s)}):(this.props.onEnter(s,o),this.safeSetState({status:Te},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:Se},function(){t.props.onEntered(s,o)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Re.findDOMNode(this);t&&!ve?(this.props.onExit(i),this.safeSetState({status:Ae},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Oe},function(){e.props.onExited(i)})})})):this.safeSetState({status:Oe},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=ge(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _e.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,i):_e.cloneElement(_e.Children.only(n),i))},t}(_e.Component);function Ne(){}Me.contextType=xe,Me.propTypes={},Me.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ne,onEntering:Ne,onEntered:Ne,onExit:Ne,onExiting:Ne,onExited:Ne},Me.UNMOUNTED=ke,Me.EXITED=Oe,Me.ENTERING=Te,Me.ENTERED=Se,Me.EXITING=Ae;var De=Me;const we=n;var Le=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},Fe=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=ye(n.className,i):n.setAttribute("class",ye(n.className&&n.className.baseVal||"",i)));var n,i})},Be=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1];t.removeClasses(r,"exit"),t.addClass(r,s?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}be(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&Ce(e),i&&(this.appliedClasses[t][n]=i,Le(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,s=n.done;this.appliedClasses[t]={},i&&Fe(e,i),r&&Fe(e,r),s&&Fe(e,s)},n.render=function(){var e=this.props;e.classNames;var t=ge(e,["classNames"]);return we.createElement(De,fe({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(we.Component);Be.defaultProps={classNames:""},Be.propTypes={};var Ie=Be;const{Children:ze}=n,{cloneElement:Pe}=n,{isValidElement:qe}=n;function je(e,t){var n=Object.create(null);return e&&ze.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&qe(e)?t(e):e}(e)}),n}function He(e,t,n){return null!=n[t]?n[t]:e.props[t]}function We(e,t,n){var i=je(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),s=[];for(var o in e)o in t?s.length&&(r[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<s.length;i++)a[s[i]]=n(s[i]);return a}(t,i);return Object.keys(r).forEach(function(s){var o=r[s];if(qe(o)){var a=s in t,l=s in i,c=t[s],d=qe(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&qe(c)&&(r[s]=Pe(o,{onExited:n.bind(null,o),in:c.props.in,exit:He(o,"exit",e),enter:He(o,"enter",e)})):r[s]=Pe(o,{in:!1}):r[s]=Pe(o,{onExited:n.bind(null,o),in:!0,exit:He(o,"exit",e),enter:He(o,"enter",e)})}}),r}const $e=n;var Ye=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Ue=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}be(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,s=t.handleExited;return{children:t.firstRender?(n=e,i=s,je(n.children,function(e){return Pe(e,{onExited:i.bind(null,e),in:!0,appear:He(e,"appear",n),enter:He(e,"enter",n),exit:He(e,"exit",n)})})):We(e,r,s),firstRender:!1}},n.handleExited=function(e,t){var n=je(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=fe({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=ge(e,["component","childFactory"]),r=this.state.contextValue,s=Ye(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?$e.createElement(xe.Provider,{value:r},s):$e.createElement(xe.Provider,{value:r},$e.createElement(t,i,s))},t}($e.Component);Ue.propTypes={},Ue.defaultProps={component:"div",childFactory:function(e){return e}};var Ge=Ue;const{green:Ke}=s,{indigo:Je}=s,{orange:Ve}=s,{pink:Xe}=s,{red:Ze}=s,Qe={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:Ke[500],CORRECT_SECONDARY:Ke[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:Ve[500],INCORRECT_SECONDARY:Ze[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:Ze[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:Je[500],PRIMARY_LIGHT:Je[200],PRIMARY_DARK:Je[800],SECONDARY:Xe.A400,SECONDARY_LIGHT:Xe[200],SECONDARY_DARK:Xe[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Qe);const et=(tt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${tt}-${t}, ${e})`,t)});var tt;const nt=()=>et("text",Qe.TEXT),it=()=>et("background",Qe.BACKGROUND),rt=()=>et("border-gray",Qe.BORDER_GRAY),st=()=>et("table-stripe","background-dark",Qe.TABLE_STRIPE),ot=n,at=t,{styled:lt}=i,ct=lt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),dt=lt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${et("disabled",Qe.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${et("correct",Qe.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${et("incorrect",Qe.INCORRECT)})`}}),pt=lt("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class ht extends ot.Component{constructor(...e){super(...e),ht.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:at.string,feedback:at.string}}__init(){this.nodeRef=ot.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?ot.createElement(Ie,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},ot.createElement(pt,{ref:this.nodeRef},ot.createElement(ct,null,ot.createElement(dt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return ot.createElement("div",null,ot.createElement(Ge,null,this.renderFeedback()))}}ht.__initStatic();const ut=n,mt=t,{Popover:ft}=o,{styled:gt}=i,Et=a("pie-libs:render-ui:response-indicators"),bt=gt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),yt=gt(ft)({cursor:"pointer"}),vt=gt("div")({padding:"0",borderRadius:"4px"}),xt=(e,t)=>{class n extends ut.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Et("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return ut.createElement(bt,{hasFeedback:!!n},ut.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},ut.createElement(e,null)),n&&ut.createElement(yt,{PaperComponent:vt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},ut.createElement(ht,{feedback:n,correctness:t})))}}return n.propTypes={feedback:mt.string},n};xt(D,"correct"),xt(P,"incorrect"),xt(ae,"partially-correct"),xt(ne,"nothing-submitted");const Ct=n,{styled:_t}=i,Rt=l,kt=t,{renderMath:Ot}=e,Tt=_t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),St=_t(Rt)(({theme:e})=>({paddingTop:e.spacing(2)}));class At extends Ct.Component{constructor(...e){super(...e),At.prototype.__init.call(this),At.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:kt.string,children:kt.object,labels:kt.shape({visible:kt.string,hidden:kt.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ot(this.root)}componentDidUpdate(){Ot(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Ct.createElement("div",{className:n,ref:e=>this.root=e},Ct.createElement("div",{onClick:this.toggleExpanded},Ct.createElement(Tt,null,i)),Ct.createElement(St,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}At.__initStatic(),At.__initStatic2();const{Button:Mt}=o,{styled:Nt}=i;Nt("div")({display:"flex",flexDirection:"column"}),Nt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Nt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Nt(Mt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Dt=n,{createTheme:wt}=i,{styled:Lt}=i,{StyledEngineProvider:Ft}=i,{ThemeProvider:Bt}=i,It=t;const zt=wt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),Pt=Lt("div")({"& table, th, td":{fontSize:"inherit"}});class qt extends Dt.Component{static __initStatic(){this.propTypes={className:It.string,children:It.array,extraCSSRules:It.shape({names:It.arrayOf(It.string),rules:It.string}),fontSizeFactor:It.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),s=null!=e&&"number"==typeof e?e:1;return 1!==s?{fontSize:r*s+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...s}=i,o=this.computeStyle(n);return Dt.createElement(Ft,{injectFirst:!0},Dt.createElement(Bt,{theme:zt},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Dt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Dt.createElement(Pt,{className:`${t} extraCSSRules`,...s,...o&&{style:o}},e)))}}qt.__initStatic(),qt.__initStatic2();const jt=n,{styled:Ht}=i,Wt=t,$t=Ht(qt)({display:"flex",flexDirection:"column",position:"relative"});class Yt extends jt.Component{static __initStatic(){this.propTypes={ariaLabel:Wt.string,children:Wt.oneOfType([Wt.arrayOf(Wt.node),Wt.node]).isRequired,role:Wt.string,extraCSSRules:Wt.shape({names:Wt.arrayOf(Wt.string),rules:Wt.string}),fontSizeFactor:Wt.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:s}=this.props,o=t?{"aria-label":t,role:n}:{};return jt.createElement($t,{...o,extraCSSRules:i,fontSizeFactor:r,classes:s},e)}}Yt.__initStatic();const Ut=n,Gt=t;class Kt extends Ut.Component{static __initStatic(){this.propTypes={tag:Gt.string,className:Gt.string,html:Gt.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return Ut.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Kt.__initStatic(),Kt.__initStatic2();const{InputLabel:Jt}=o,{FormControl:Vt}=o,Xt=t,{styled:Zt}=i;Zt(Vt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Zt(Jt)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Xt.oneOfType([Xt.string,Xt.object]).isRequired,Xt.string,Xt.oneOfType([Xt.arrayOf(Xt.node),Xt.node]).isRequired;const Qt=n,{Component:en}=n,{styled:tn}=i,nn=t,{renderMath:rn}=e,sn=tn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:et("table-grid","text",Qe.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:st()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:st()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:nt()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${nt()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),on=/\\embed\{newLine\}\[\]/g;class an extends en{constructor(...e){super(...e),an.prototype.__init.call(this),an.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:nn.string,tagName:nn.string,className:nn.string,onClick:nn.func,defaultClassName:nn.string,autoplayAudioEnabled:nn.bool,customAudioButton:{playImage:nn.string,pauseImage:nn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=Qt.createRef()}__init2(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",s)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},s=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",o),i.addEventListener("pause",a),i.addEventListener("ended",s),this._handlePlayClick=r,this._handleAudioPlay=o,this._handleAudioPause=a,this._handleAudioEnded=s}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=this.promptRef.current;e&&"function"==typeof rn&&rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,s=`${n||""} ${r||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return Qt.createElement(sn,{as:t||"div",ref:this.promptRef,onClick:i,className:s,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(on,"\\newline ")}})}}an.__initStatic(),an.__initStatic2();const ln=t;ln.node,ln.bool;const cn=t,dn=n,pn=e=>dn.createElement(dn.Fragment,null,dn.Children.map(e.children,t=>dn.cloneElement(t,{"data-pie-purpose":e.purpose})));function hn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const s=Math.min(6,Math.max(1,t+r-1)),o=n.createElement(`h${s}`);o.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}pn.propTypes={children:cn.node,purpose:cn.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const un=n,mn=t,{Tabs:fn}=o,{Tab:gn}=o,{styled:En}=i;const bn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},yn=En("div")({flexGrow:1,backgroundColor:it(),color:nt(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),vn=En("div")(({theme:e})=>({backgroundColor:it(),color:nt(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),xn=En("div")({fontSize:"1.75rem"}),Cn=En("div")({fontSize:"1.5rem"}),_n=En("div")({fontSize:"1.25rem"}),Rn=En(gn)(({theme:e})=>({background:it(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:nt(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:nt(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:et("tertiary",Qe.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:et("tertiary-light",Qe.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),kn=En("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:it()}));class On extends un.Component{constructor(...e){super(...e),On.prototype.__init.call(this),On.prototype.__init2.call(this),On.prototype.__init3.call(this),On.prototype.__init4.call(this),On.prototype.__init5.call(this),On.prototype.__init6.call(this),On.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:bn(),containerWidth:0}}__init2(){this.containerRef=un.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:bn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const s=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(s+1)%i.length;break;case"ArrowLeft":r=(s-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=s}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=un.createElement(an,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:un.createElement(At,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",s=n?Math.min(6,Math.max(1,i+1)):void 0;return un.createElement(vn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&un.createElement(pn,{purpose:"passage-title"},un.createElement(r,null,un.createElement(xn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&un.createElement(pn,{purpose:"passage-subtitle"},un.createElement(Cn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&un.createElement(pn,{purpose:"passage-author"},un.createElement(_n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&un.createElement(pn,{purpose:"passage-text"},un.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?hn(e.text,s):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:s}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:o}=e||{},a=(t||[]).find(e=>e.id===i),l=s>0?s/t.length:null,c=s>0&&s<=170*t.length;return un.createElement(qt,{extraCSSRules:o},un.createElement(yn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):un.createElement(un.Fragment,null,un.createElement(fn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:nt(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${et("background-dark",Qe.BACKGROUND_DARK)})`,borderBottom:`1px solid ${rt()}`},"& .MuiTabs-indicator":{backgroundColor:et("white",Qe.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>un.createElement(Rn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:un.createElement(un.Fragment,null,un.createElement(pn,{purpose:"passage-label"},c?un.createElement("span",{className:"passage-label"},`Passage ${t+1}`):un.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),un.createElement(kn,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}On.propTypes={tabs:mn.arrayOf(mn.shape({id:mn.number.isRequired,label:mn.string.isRequired,title:mn.string.isRequired,subtitle:mn.string,author:mn.string,text:mn.string.isRequired,teacherInstructions:mn.string}).isRequired).isRequired,disabledTabs:mn.bool,model:mn.object,baseHeadingLevel:mn.number};const{renderMath:Tn}=e,Sn=n,{createRoot:An}=c;function Mn(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(n=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=n?n:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var n,i}class Nn extends HTMLElement{constructor(){super(),Nn.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),Tn(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new h(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),n=Sn.createElement(On,{tabs:t,model:this._model,baseHeadingLevel:Mn(this)});this._root||(this._root=An(this)),this._root.render(n),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&(this._root.unmount(),this._root=null)}}export{Nn as default};
|
package/module/index.html
CHANGED
package/module/manifest.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.3",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "6.0.0"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "@pie-lib/math-rendering-module",
|
|
11
|
+
"version": "6.0.0"
|
|
8
12
|
}
|
|
9
13
|
]
|
|
10
14
|
}
|
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as a,_dll_debug as i,_dll_react_dom_client as o}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=c.Symbol,d=Object.prototype,p=d.hasOwnProperty,b=d.toString,h=u?u.toStringTag:void 0;var m=Object.prototype.toString;var f=u?u.toStringTag:void 0;function g(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":f&&f in Object(e)?function(e){var t=p.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch(e){}var a=b.call(e);return r&&(t?e[h]=n:delete e[h]),a}(e):function(e){return m.call(e)}(e)}var v=/\s/;var y=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t}(e)+1).replace(y,""):e}function x(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var E=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,k=/^0o[0-7]+$/i,S=parseInt;function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==g(e)}(e))return NaN;if(x(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=x(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||k.test(e)?S(e.slice(2),n?2:8):E.test(e)?NaN:+e}var I=function(){return c.Date.now()},M=Math.max,w=Math.min;function j(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function h(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=I();if(h(e))return f(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?w(n,i-(e-c)):n}(e))}function f(e){return s=void 0,p&&r?b(e):(r=a=void 0,o)}function g(){var e=I(),n=h(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?b(e):o}(l);if(d)return clearTimeout(s),s=setTimeout(m,t),b(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=C(t)||0,x(n)&&(u=!!n.leading,i=(d="maxWait"in n)?M(C(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:f(I())},g}const H=e,L=t,{Tabs:R}=n,{Tab:A}=n,{styled:N}=r,{Collapsible:O}=a,{color:$}=a,{PreviewPrompt:q}=a,{Purpose:D}=a,{UiLayout:P}=a,{transformDataHeadings:z}=a;const F=N("div")({flexGrow:1,backgroundColor:$.background(),color:$.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),J=N("div")(({theme:e})=>({backgroundColor:$.background(),color:$.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),K=N("div")({fontSize:"1.75rem"}),U=N("div")({fontSize:"1.5rem"}),W=N("div")({fontSize:"1.25rem"}),B=N(A)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class G extends H.Component{constructor(...e){super(...e),G.prototype.__init.call(this),G.prototype.__init2.call(this),G.prototype.__init3.call(this),G.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:r}=this.props;let a=-1;const i=r.findIndex(e=>e.id===t);switch(n){case"ArrowRight":a=(i+1)%r.length;break;case"ArrowLeft":a=(i-1+r.length)%r.length;break;case"Home":a=0;break;case"End":a=r.length-1;break;case"Enter":case" ":a=i}-1!==a&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,r[a].id),document.getElementById(`button-${r[a].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=H.createElement(q,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:H.createElement(O,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,r=n?Math.min(6,Math.max(1,n)):void 0,a=n?`h${r}`:"h2",i=n?Math.min(6,Math.max(1,r+1)):void 0;return H.createElement(J,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&H.createElement(D,{purpose:"passage-title"},H.createElement(a,null,H.createElement(K,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&H.createElement(D,{purpose:"passage-subtitle"},H.createElement(U,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&H.createElement(D,{purpose:"passage-author"},H.createElement(W,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&H.createElement(D,{purpose:"passage-text"},H.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?z(e.text,i):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:r}=this.state;if(!function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],i=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=i(n)):"call"!==a&&"optionalCall"!==a||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:a}=e||{},i=(t||[]).find(e=>e.id===r);return H.createElement(P,{extraCSSRules:a},H.createElement(F,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):H.createElement(H.Fragment,null,H.createElement(R,{sx:{position:"sticky",top:0,background:$.background(),color:$.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:r,onChange:this.handleChange},t.map(e=>H.createElement(B,{key:e.id,id:`button-${e.id}`,label:H.createElement(D,{purpose:"passage-label"},H.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:r===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":r===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),i?this.renderTab(i,n):null)))}}G.propTypes={tabs:L.arrayOf(L.shape({id:L.number.isRequired,label:L.string.isRequired,title:L.string.isRequired,subtitle:L.string,author:L.string,text:L.string.isRequired,teacherInstructions:L.string}).isRequired).isRequired,disabledTabs:L.bool,model:L.object,baseHeadingLevel:L.number};const Q=e,{createRoot:V}=o,X=i("pie-element:passage:print"),Y=(e,t)=>(e=>null!=e)(e)?e:t;class Z extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=j(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,r=Y(e.teacherInstructionsEnabled,!0),a=Y(e.titleEnabled,!0),i=Y(e.authorEnabled,!1),o=Y(e.subtitleEnabled,!0),s=Y(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Y(e.teacherInstructionsEnabled,r)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Y(e.titleEnabled,a)&&e.title||"",author:Y(e.authorEnabled,i)&&e.author||"",subtitle:Y(e.subtitleEnabled,o)&&e.subtitle||"",text:Y(e.textEnabled,s)&&e.text||""}))})(this._model,this._options),t=Q.createElement(G,{disabledTabs:!0,tabs:e});this._root||(this._root=V(this)),this._root.render(t)}}else X("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Z as default};
|
|
1
|
+
import{_dll_prop_types as e,_dll_react as t,_dll_mui__material_styles as n,_dll_react_dom as i,_dll_mui__material_colors as r,_dll_mui__material as o,_dll_debug as s,_dll_mui__material_collapse as a,_dll_react_dom_client as l}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";var d="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,u=d||p||Function("return this")(),h=u.Symbol,m=Object.prototype,f=m.hasOwnProperty,g=m.toString,E=h?h.toStringTag:void 0;var b=Object.prototype.toString;var y=h?h.toStringTag:void 0;function v(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=f.call(e,E),n=e[E];try{e[E]=void 0;var i=!0}catch(e){}var r=g.call(e);return i&&(t?e[E]=n:delete e[E]),r}(e):function(e){return b.call(e)}(e)}var x=/\s/;var C=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&x.test(e.charAt(t)););return t}(e)+1).replace(C,""):e}function R(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var k=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,S=/^0o[0-7]+$/i,O=parseInt;function A(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==v(e)}(e))return NaN;if(R(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=R(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||S.test(e)?O(e.slice(2),n?2:8):k.test(e)?NaN:+e}var N=function(){return u.Date.now()},M=Math.max,D=Math.min;function w(e,t,n){var i,r,o,s,a,l,c=0,d=!1,p=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function f(){var e=N();if(m(e))return g(e);a=setTimeout(f,function(e){var n=t-(e-l);return p?D(n,o-(e-c)):n}(e))}function g(e){return a=void 0,u&&i?h(e):(i=r=void 0,s)}function E(){var e=N(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?h(e):s}(l);if(p)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=A(t)||0,R(n)&&(d=!!n.leading,o=(p="maxWait"in n)?M(A(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),E.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},E.flush=function(){return void 0===a?s:g(N())},E}const I=t,B=e,F=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",L=({size:e,children:t})=>{const n={height:e=F(e),width:e,display:"inline-block",position:"relative"};return I.createElement("div",{style:n},t)};L.propTypes={size:B.number,children:B.oneOfType([B.arrayOf(B.node),B.node]).isRequired};const z=t,P=e,j=({size:e,children:t,sx:n})=>z.createElement(L,{size:e},z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));j.propTypes={size:P.oneOfType([P.string,P.number]),children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,sx:P.object},P.string.isRequired;const q=({fill:e})=>z.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});q.propTypes={fill:P.string.isRequired};const H=({fill:e})=>z.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});H.propTypes={fill:P.string.isRequired};const $=({fill:e})=>z.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});$.propTypes={fill:P.string.isRequired};const W=({fill:e})=>z.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});W.propTypes={fill:P.string.isRequired};const U=e,Y=t;var G=(e,t)=>{class n extends Y.Component{static __initStatic(){this.propTypes={iconSet:U.oneOf(["emoji","check"]),shape:U.oneOf(["round","square"]),category:U.oneOf(["feedback",void 0]),open:U.bool,size:U.oneOfType([U.number,U.string]),fg:U.string,bg:U.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:o,size:s,fg:a,bg:l}=this.props,c="check"===n?Y.createElement(e,{fill:a}):Y.createElement(t,{fill:a}),d="check"===n?Y.createElement(e,{fill:l}):Y.createElement(t,{fill:l});return o?Y.createElement(j,{size:s},d):Y.createElement(j,{size:s},"feedback"===r?"round"===i?Y.createElement(H,{fill:l}):Y.createElement(q,{fill:l}):"round"===i?Y.createElement($,{fill:l}):Y.createElement(W,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const K=e,J=t,V=({fill:e})=>J.createElement("g",{transform:"translate(1, 0)"},J.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),J.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),J.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));V.propTypes={fill:K.string.isRequired};const X=({fill:e,x:t=0,y:n=0})=>J.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});X.propTypes={fill:K.string.isRequired,x:K.number,y:K.number};const Z=G(X,V);Z.propTypes={iconSet:K.oneOf(["emoji","check"]),shape:K.oneOf(["round","square"]),category:K.oneOf(["feedback",void 0]),open:K.bool,fg:K.string,bg:K.string,size:K.oneOfType([K.string,K.number])},Z.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const Q=e,{styled:ee}=n;Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,ee("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),Q.bool,Q.string;const te=e,ne=t,ie=({fill:e})=>ne.createElement("g",{transform:"translate(0.5, 0.5)"},ne.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),ne.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));ie.propTypes={fill:te.string.isRequired};const re=({fill:e})=>ne.createElement("g",{transform:"translate(1,0)"},ne.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));re.propTypes={fill:te.string.isRequired};const oe=G(ie,re);oe.propTypes={iconSet:te.oneOf(["emoji","check"]),shape:te.oneOf(["round","square"]),category:te.oneOf(["feedback",void 0]),open:te.bool,fg:te.string,bg:te.string,size:te.oneOfType([te.string,te.number])},oe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const se=e,ae=t,le=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return ae.createElement("g",null,ae.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),ae.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),ae.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},ce=({children:e,size:t})=>ae.createElement(L,{size:t},ae.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));ce.propTypes={children:se.oneOfType([se.arrayOf(se.node),se.node]).isRequired,size:se.number};const de=()=>ae.createElement("g",null,ae.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ae.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),pe=()=>ae.createElement("g",null,ae.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ae.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ae.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),ae.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class ue extends ae.Component{constructor(e){super(e)}render(){return!0===this.props.open?ae.createElement(ce,null,ae.createElement(de,null),ae.createElement(le,null)):ae.createElement(ce,null,ae.createElement(pe,null),ae.createElement(le,null))}}ue.propTypes={open:se.bool},ue.defaultProps={open:!1};const he=e,me=t,fe=({fill:e})=>me.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});fe.propTypes={fill:he.string};class ge extends me.Component{static __initStatic(){this.propTypes={classes:he.object.isRequired,size:he.number}}render(){const{size:e}=this.props;return!0===this.props.open?me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},me.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),me.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),me.createElement(fe,{fill:"#1A9CFF"}))):me.createElement(L,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},me.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),me.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),me.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",me.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),me.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),me.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),me.createElement(fe,{fill:"1A9CFF"})))}}ge.__initStatic(),ge.propTypes={open:he.bool},ge.defaultProps={open:!1};const Ee=e,be=t,ye=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),be.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));ye.propTypes={fill:Ee.string.isRequired};const ve=({fill:e})=>be.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});ve.propTypes={fill:Ee.string.isRequired};const xe=({fill:e})=>be.createElement("g",null,be.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),be.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),be.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));xe.propTypes={fill:Ee.string.isRequired};class Ce extends be.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),feedback:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),square:{check:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(ye,{fill:t})),emoji:be.createElement(j,null,be.createElement(ve,{fill:n}),be.createElement(xe,{fill:t})),open:{check:be.createElement(j,null,be.createElement(ye,{fill:n})),emoji:be.createElement(j,null,be.createElement(xe,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Ce.propTypes={iconSet:Ee.oneOf(["emoji","check",void 0]),shape:Ee.oneOf(["square",void 0]),category:Ee.oneOf(["feedback",void 0]),open:Ee.bool,fg:Ee.string,bg:Ee.string},Ce.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const _e=e,Re=t,ke=({fill:e})=>Re.createElement("g",{transform:"translate(0, 0)"},Re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));ke.propTypes={fill:_e.string.isRequired};const Te=({fill:e})=>Re.createElement("g",{transform:"translate(2, 0)"},Re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Re.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));Te.propTypes={fill:_e.string.isRequired};const Se=G(ke,Te);Se.propTypes={iconSet:_e.oneOf(["emoji","check"]),shape:_e.oneOf(["round","square"]),category:_e.oneOf(["feedback",void 0]),open:_e.bool,fg:_e.string,bg:_e.string,size:_e.oneOfType([_e.string,_e.number])},Se.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Oe=e,Ae=t,Ne=({fill:e})=>Ae.createElement("g",null,Ae.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),Ae.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));Ne.propTypes={fill:Oe.string.isRequired};const Me=({fill:e})=>Ae.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});Me.propTypes={fill:Oe.string.isRequired};const De=({fill:e="#FFFFFF"})=>Ae.createElement("g",null,Ae.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),Ae.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));De.propTypes={fill:Oe.string};const we=({children:e,size:t})=>{const n=F(t),i={height:n,width:n,display:"inline-block",position:"relative"};return Ae.createElement("div",{style:i},Ae.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};we.propTypes={children:Oe.oneOfType([Oe.arrayOf(Oe.node),Oe.node]).isRequired,size:Oe.oneOfType([Oe.string,Oe.number])};class Ie extends Ae.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,o=Ae.createElement(Ne,{fill:n}),s={check:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement(De,null),o,Ae.createElement(Me,{fill:r})),open:{check:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:"#FFFFFF"})),emoji:Ae.createElement(we,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:i}),Ae.createElement(Me,{fill:r}))}};return!0===t?s.open[e]:s[e]}}function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Be.apply(null,arguments)}function Fe(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Le(e,t){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Le(e,t)}function ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Le(e,t)}function Pe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}Ie.propTypes={iconSet:Oe.oneOf(["emoji","check"]),open:Oe.bool,fg:Oe.string,bg:Oe.string,border:Oe.string,size:Oe.oneOfType([Oe.string,Oe.number])},Ie.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var je=!1;var qe=t.createContext(null),He=function(e){return e.scrollTop};const $e=t,We=i;var Ue="unmounted",Ye="exited",Ge="entering",Ke="entered",Je="exiting",Ve=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=Ye,i.appearStatus=Ge):r=Ke:r=t.unmountOnExit||t.mountOnEnter?Ue:Ye,i.state={status:r},i.nextCallback=null,i}ze(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ue?{status:Ye}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Ge&&n!==Ke&&(t=Ge):n!==Ge&&n!==Ke||(t=Je)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:We.findDOMNode(this);n&&He(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ye&&this.setState({status:Ue})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[We.findDOMNode(this),i],o=r[0],s=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||je?this.safeSetState({status:Ke},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Ge},function(){t.props.onEntering(o,s),t.onTransitionEnd(l,function(){t.safeSetState({status:Ke},function(){t.props.onEntered(o,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:We.findDOMNode(this);t&&!je?(this.props.onExit(i),this.safeSetState({status:Je},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ye},function(){e.props.onExited(i)})})})):this.safeSetState({status:Ye},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:We.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=r[0],s=r[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Ue)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=Fe(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return $e.createElement(qe.Provider,{value:null},"function"==typeof n?n(e,i):$e.cloneElement($e.Children.only(n),i))},t}($e.Component);function Xe(){}Ve.contextType=qe,Ve.propTypes={},Ve.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xe,onEntering:Xe,onEntered:Xe,onExit:Xe,onExiting:Xe,onExited:Xe},Ve.UNMOUNTED=Ue,Ve.EXITED=Ye,Ve.ENTERING=Ge,Ve.ENTERED=Ke,Ve.EXITING=Je;var Ze=Ve;const Qe=t;var et=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},tt=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=Pe(n.className,i):n.setAttribute("class",Pe(n.className&&n.className.baseVal||"",i)));var n,i})},nt=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.addClass(r,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}ze(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&He(e),i&&(this.appliedClasses[t][n]=i,et(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&tt(e,i),r&&tt(e,r),o&&tt(e,o)},n.render=function(){var e=this.props;e.classNames;var t=Fe(e,["classNames"]);return Qe.createElement(Ze,Be({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Qe.Component);nt.defaultProps={classNames:""},nt.propTypes={};var it=nt;const{Children:rt}=t,{cloneElement:ot}=t,{isValidElement:st}=t;function at(e,t){var n=Object.create(null);return e&&rt.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&st(e)?t(e):e}(e)}),n}function lt(e,t,n){return null!=n[t]?n[t]:e.props[t]}function ct(e,t,n){var i=at(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<o.length;i++)a[o[i]]=n(o[i]);return a}(t,i);return Object.keys(r).forEach(function(o){var s=r[o];if(st(s)){var a=o in t,l=o in i,c=t[o],d=st(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&st(c)&&(r[o]=ot(s,{onExited:n.bind(null,s),in:c.props.in,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})):r[o]=ot(s,{in:!1}):r[o]=ot(s,{onExited:n.bind(null,s),in:!0,exit:lt(s,"exit",e),enter:lt(s,"enter",e)})}}),r}const dt=t;var pt=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ut=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}ze(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,i=o,at(n.children,function(e){return ot(e,{onExited:i.bind(null,e),in:!0,appear:lt(e,"appear",n),enter:lt(e,"enter",n),exit:lt(e,"exit",n)})})):ct(e,r,o),firstRender:!1}},n.handleExited=function(e,t){var n=at(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Be({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=Fe(e,["component","childFactory"]),r=this.state.contextValue,o=pt(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?dt.createElement(qe.Provider,{value:r},o):dt.createElement(qe.Provider,{value:r},dt.createElement(t,i,o))},t}(dt.Component);ut.propTypes={},ut.defaultProps={component:"div",childFactory:function(e){return e}};var ht=ut;const{green:mt}=r,{indigo:ft}=r,{orange:gt}=r,{pink:Et}=r,{red:bt}=r,yt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:mt[500],CORRECT_SECONDARY:mt[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:gt[500],INCORRECT_SECONDARY:bt[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:bt[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:ft[500],PRIMARY_LIGHT:ft[200],PRIMARY_DARK:ft[800],SECONDARY:Et.A400,SECONDARY_LIGHT:Et[200],SECONDARY_DARK:Et[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(yt);const vt=(xt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${xt}-${t}, ${e})`,t)});var xt;const Ct=()=>vt("text",yt.TEXT),_t=()=>vt("background",yt.BACKGROUND),Rt=()=>vt("border-gray",yt.BORDER_GRAY),kt=()=>vt("table-stripe","background-dark",yt.TABLE_STRIPE),Tt=t,St=e,{styled:Ot}=n,At=Ot("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Nt=Ot("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${vt("disabled",yt.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${vt("correct",yt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${vt("incorrect",yt.INCORRECT)})`}}),Mt=Ot("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class Dt extends Tt.Component{constructor(...e){super(...e),Dt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:St.string,feedback:St.string}}__init(){this.nodeRef=Tt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?Tt.createElement(it,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},Tt.createElement(Mt,{ref:this.nodeRef},Tt.createElement(At,null,Tt.createElement(Nt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return Tt.createElement("div",null,Tt.createElement(ht,null,this.renderFeedback()))}}Dt.__initStatic();const wt=t,It=e,{Popover:Bt}=o,{styled:Ft}=n,Lt=s("pie-libs:render-ui:response-indicators"),zt=Ft("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),Pt=Ft(Bt)({cursor:"pointer"}),jt=Ft("div")({padding:"0",borderRadius:"4px"}),qt=(e,t)=>{class n extends wt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Lt("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return wt.createElement(zt,{hasFeedback:!!n},wt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},wt.createElement(e,null)),n&&wt.createElement(Pt,{PaperComponent:jt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},wt.createElement(Dt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:It.string},n};qt(Z,"correct"),qt(oe,"incorrect"),qt(Se,"partially-correct"),qt(Ce,"nothing-submitted");const Ht=t,{styled:$t}=n,Wt=a,Ut=e,{renderMath:Yt}=c,Gt=$t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Kt=$t(Wt)(({theme:e})=>({paddingTop:e.spacing(2)}));class Jt extends Ht.Component{constructor(...e){super(...e),Jt.prototype.__init.call(this),Jt.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:Ut.string,children:Ut.object,labels:Ut.shape({visible:Ut.string,hidden:Ut.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Yt(this.root)}componentDidUpdate(){Yt(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Ht.createElement("div",{className:n,ref:e=>this.root=e},Ht.createElement("div",{onClick:this.toggleExpanded},Ht.createElement(Gt,null,i)),Ht.createElement(Kt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Jt.__initStatic(),Jt.__initStatic2();const{Button:Vt}=o,{styled:Xt}=n;Xt("div")({display:"flex",flexDirection:"column"}),Xt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Xt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Xt(Vt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Zt=t,{createTheme:Qt}=n,{styled:en}=n,{StyledEngineProvider:tn}=n,{ThemeProvider:nn}=n,rn=e;const on=Qt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),sn=en("div")({"& table, th, td":{fontSize:"inherit"}});class an extends Zt.Component{static __initStatic(){this.propTypes={className:rn.string,children:rn.array,extraCSSRules:rn.shape({names:rn.arrayOf(rn.string),rules:rn.string}),fontSizeFactor:rn.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),o=null!=e&&"number"==typeof e?e:1;return 1!==o?{fontSize:r*o+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...o}=i,s=this.computeStyle(n);return Zt.createElement(tn,{injectFirst:!0},Zt.createElement(nn,{theme:on},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],o=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=o(n)):"call"!==r&&"optionalCall"!==r||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Zt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Zt.createElement(sn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}an.__initStatic(),an.__initStatic2();const ln=t,{styled:cn}=n,dn=e,pn=cn(an)({display:"flex",flexDirection:"column",position:"relative"});class un extends ln.Component{static __initStatic(){this.propTypes={ariaLabel:dn.string,children:dn.oneOfType([dn.arrayOf(dn.node),dn.node]).isRequired,role:dn.string,extraCSSRules:dn.shape({names:dn.arrayOf(dn.string),rules:dn.string}),fontSizeFactor:dn.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:o}=this.props,s=t?{"aria-label":t,role:n}:{};return ln.createElement(pn,{...s,extraCSSRules:i,fontSizeFactor:r,classes:o},e)}}un.__initStatic();const hn=t,mn=e;class fn extends hn.Component{static __initStatic(){this.propTypes={tag:mn.string,className:mn.string,html:mn.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return hn.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}fn.__initStatic(),fn.__initStatic2();const{InputLabel:gn}=o,{FormControl:En}=o,bn=e,{styled:yn}=n;yn(En)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),yn(gn)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),bn.oneOfType([bn.string,bn.object]).isRequired,bn.string,bn.oneOfType([bn.arrayOf(bn.node),bn.node]).isRequired;const vn=t,{Component:xn}=t,{styled:Cn}=n,_n=e,{renderMath:Rn}=c,kn=Cn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:vt("table-grid","text",yt.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:kt()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:kt()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Ct()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Ct()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),Tn=/\\embed\{newLine\}\[\]/g;class Sn extends xn{constructor(...e){super(...e),Sn.prototype.__init.call(this),Sn.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:_n.string,tagName:_n.string,className:_n.string,onClick:_n.func,defaultClassName:_n.string,autoplayAudioEnabled:_n.bool,customAudioButton:{playImage:_n.string,pauseImage:_n.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=vn.createRef()}__init2(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",o)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",s),i.addEventListener("pause",a),i.addEventListener("ended",o),this._handlePlayClick=r,this._handleAudioPlay=s,this._handleAudioPause=a,this._handleAudioEnded=o}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=this.promptRef.current;e&&"function"==typeof Rn&&Rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,o=`${n||""} ${r||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return vn.createElement(kn,{as:t||"div",ref:this.promptRef,onClick:i,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(Tn,"\\newline ")}})}}Sn.__initStatic(),Sn.__initStatic2();const On=e;On.node,On.bool;const An=e,Nn=t,Mn=e=>Nn.createElement(Nn.Fragment,null,Nn.Children.map(e.children,t=>Nn.cloneElement(t,{"data-pie-purpose":e.purpose})));function Dn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const o=Math.min(6,Math.max(1,t+r-1)),s=n.createElement(`h${o}`);s.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&s.setAttribute(e.name,e.value)}),s.innerHTML=e.innerHTML,e.replaceWith(s)}),n.body.innerHTML}Mn.propTypes={children:An.node,purpose:An.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const wn=t,In=e,{Tabs:Bn}=o,{Tab:Fn}=o,{styled:Ln}=n;const zn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},Pn=Ln("div")({flexGrow:1,backgroundColor:_t(),color:Ct(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),jn=Ln("div")(({theme:e})=>({backgroundColor:_t(),color:Ct(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),qn=Ln("div")({fontSize:"1.75rem"}),Hn=Ln("div")({fontSize:"1.5rem"}),$n=Ln("div")({fontSize:"1.25rem"}),Wn=Ln(Fn)(({theme:e})=>({background:_t(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:Ct(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${Rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:Ct(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:vt("tertiary",yt.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:vt("tertiary-light",yt.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),Un=Ln("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:_t()}));class Yn extends wn.Component{constructor(...e){super(...e),Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),Yn.prototype.__init3.call(this),Yn.prototype.__init4.call(this),Yn.prototype.__init5.call(this),Yn.prototype.__init6.call(this),Yn.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:zn(),containerWidth:0}}__init2(){this.containerRef=wn.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:zn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const o=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(o+1)%i.length;break;case"ArrowLeft":r=(o-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=o}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=wn.createElement(Sn,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:wn.createElement(Jt,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",o=n?Math.min(6,Math.max(1,i+1)):void 0;return wn.createElement(jn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&wn.createElement(Mn,{purpose:"passage-title"},wn.createElement(r,null,wn.createElement(qn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&wn.createElement(Mn,{purpose:"passage-subtitle"},wn.createElement(Hn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&wn.createElement(Mn,{purpose:"passage-author"},wn.createElement($n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&wn.createElement(Mn,{purpose:"passage-text"},wn.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?Dn(e.text,o):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:o}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],o=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=o(n)):"call"!==r&&"optionalCall"!==r||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:s}=e||{},a=(t||[]).find(e=>e.id===i),l=o>0?o/t.length:null,c=o>0&&o<=170*t.length;return wn.createElement(an,{extraCSSRules:s},wn.createElement(Pn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):wn.createElement(wn.Fragment,null,wn.createElement(Bn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:Ct(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${vt("background-dark",yt.BACKGROUND_DARK)})`,borderBottom:`1px solid ${Rt()}`},"& .MuiTabs-indicator":{backgroundColor:vt("white",yt.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>wn.createElement(Wn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:wn.createElement(wn.Fragment,null,wn.createElement(Mn,{purpose:"passage-label"},c?wn.createElement("span",{className:"passage-label"},`Passage ${t+1}`):wn.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),wn.createElement(Un,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}Yn.propTypes={tabs:In.arrayOf(In.shape({id:In.number.isRequired,label:In.string.isRequired,title:In.string.isRequired,subtitle:In.string,author:In.string,text:In.string.isRequired,teacherInstructions:In.string}).isRequired).isRequired,disabledTabs:In.bool,model:In.object,baseHeadingLevel:In.number};const Gn=t,{createRoot:Kn}=l,Jn=s("pie-element:passage:print"),Vn=(e,t)=>(e=>null!=e)(e)?e:t;class Xn extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=w(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,i=Vn(e.teacherInstructionsEnabled,!0),r=Vn(e.titleEnabled,!0),o=Vn(e.authorEnabled,!1),s=Vn(e.subtitleEnabled,!0),a=Vn(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Vn(e.teacherInstructionsEnabled,i)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Vn(e.titleEnabled,r)&&e.title||"",author:Vn(e.authorEnabled,o)&&e.author||"",subtitle:Vn(e.subtitleEnabled,s)&&e.subtitle||"",text:Vn(e.textEnabled,a)&&e.text||""}))})(this._model,this._options),t=Gn.createElement(Yn,{disabledTabs:!0,tabs:e});this._root||(this._root=Kn(this)),this._root.render(t)}}else Jn("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Xn as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "7.4.
|
|
4
|
+
"version": "7.4.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
16
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
17
17
|
"@pie-lib/math-rendering": "5.1.0",
|
|
18
|
-
"@pie-lib/render-ui": "
|
|
18
|
+
"@pie-lib/render-ui": "7.0.2",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"react": "18.3.1",
|
|
21
21
|
"react-dom": "18.3.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "bd790474fe017b02ae4eaa21d4d18959fa1a0bb3",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"postpublish": "../../scripts/postpublish"
|
|
26
26
|
},
|