@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/cjs/assets/queue.gif.js +2 -1
  2. package/cjs/assets/runbox_logo.png.js +2 -1
  3. package/cjs/assets/terminated.png.js +2 -1
  4. package/cjs/components/material-runbox/MaterialRunbox.js +20 -24
  5. package/cjs/components/material-runbox/MaterialRunboxBody.js +4 -10
  6. package/cjs/components/material-runbox/MaterialRunboxContent.js +103 -132
  7. package/cjs/components/material-runbox/MaterialRunboxFooter.js +18 -27
  8. package/cjs/components/material-runbox/MaterialRunboxHeader.js +87 -103
  9. package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -31
  10. package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -242
  11. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -32
  12. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -125
  13. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -84
  14. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -40
  15. package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +15 -27
  16. package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +36 -52
  17. package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +8 -11
  18. package/cjs/components/material-runbox/hooks/useRunboxControl.js +38 -62
  19. package/cjs/components/material-runbox/runtime/Runtime.js +17 -25
  20. package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +29 -33
  21. package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +39 -40
  22. package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -72
  23. package/es/assets/queue.gif.js +2 -1
  24. package/es/assets/runbox_logo.png.js +2 -1
  25. package/es/assets/terminated.png.js +2 -1
  26. package/es/components/material-runbox/MaterialRunbox.js +20 -24
  27. package/es/components/material-runbox/MaterialRunboxBody.js +4 -6
  28. package/es/components/material-runbox/MaterialRunboxContent.js +103 -128
  29. package/es/components/material-runbox/MaterialRunboxFooter.js +18 -23
  30. package/es/components/material-runbox/MaterialRunboxHeader.js +88 -99
  31. package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
  32. package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -237
  33. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
  34. package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -121
  35. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -80
  36. package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -36
  37. package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +14 -22
  38. package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -47
  39. package/es/components/material-runbox/contexts/MaterialRunboxContext.js +7 -6
  40. package/es/components/material-runbox/hooks/useRunboxControl.js +38 -62
  41. package/es/components/material-runbox/runtime/Runtime.js +17 -21
  42. package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +30 -34
  43. package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -41
  44. package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -69
  45. package/package.json +11 -8
  46. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -386
  47. package/cjs/components/material-runbox/contexts/index.js +0 -17
  48. package/cjs/components/material-runbox/hooks/index.js +0 -7
  49. package/cjs/components/material-runbox/index.js +0 -7
  50. package/cjs/components/material-runbox/locales/index.js +0 -13
  51. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -377
  52. package/es/components/material-runbox/contexts/index.js +0 -3
  53. package/es/components/material-runbox/hooks/index.js +0 -1
  54. package/es/components/material-runbox/index.js +0 -1
  55. package/es/components/material-runbox/locales/index.js +0 -4
@@ -3,18 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _styled = require('@emotion/styled/base');
6
- var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
7
  var Runtime = require('./runtime/Runtime.js');
8
8
 
9
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
10
-
11
- var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
12
-
13
9
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
14
10
  //
15
11
  //
16
12
  //
17
- var StyledRunboxBody = /*#__PURE__*/_styled__default.default("div", {
13
+ const StyledRunboxBody = /*#__PURE__*/_styled("div", {
18
14
  target: "e9bwldp0"
19
15
  })("production" === "production" ? {
20
16
  name: "277wu0",
@@ -27,10 +23,8 @@ var StyledRunboxBody = /*#__PURE__*/_styled__default.default("div", {
27
23
  //
28
24
  //
29
25
  //
30
- var MaterialRunboxBody = function MaterialRunboxBody(props) {
31
- return jsxRuntime.jsx(StyledRunboxBody, {
32
- children: jsxRuntime.jsx(Runtime.default, Object.assign({}, props))
33
- });
26
+ const MaterialRunboxBody = props => {
27
+ return React.createElement(StyledRunboxBody, null, React.createElement(Runtime.default, Object.assign({}, props)));
34
28
  };
35
29
 
36
30
  exports.default = MaterialRunboxBody;
@@ -2,9 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var _styled = require('@emotion/styled/base');
7
- var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
8
7
  var blocks = require('@elice/blocks');
9
8
  var intl = require('@elice/intl');
10
9
  var runboxClient = require('@elice/runbox-client');
@@ -18,19 +17,15 @@ var MaterialRunboxBody = require('./MaterialRunboxBody.js');
18
17
  var MaterialRunboxFooter = require('./MaterialRunboxFooter.js');
19
18
  var MaterialRunboxHeader = require('./MaterialRunboxHeader.js');
20
19
 
21
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
22
-
23
- var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
24
-
25
20
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
26
21
  //
27
22
  //
28
23
  //
29
- var DEFAULT_DATA = [null, null, null];
24
+ const DEFAULT_DATA = [null, null, null];
30
25
  //
31
26
  //
32
27
  //
33
- var StyledRunboxContainer = /*#__PURE__*/_styled__default.default("div", {
28
+ const StyledRunboxContainer = /*#__PURE__*/_styled("div", {
34
29
  target: "eeh98mq0"
35
30
  })("production" === "production" ? {
36
31
  name: "t5t5sq",
@@ -43,146 +38,122 @@ var StyledRunboxContainer = /*#__PURE__*/_styled__default.default("div", {
43
38
  //
44
39
  //
45
40
  //
46
- var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
47
- var runboxId = _ref.runboxId,
48
- courseId = _ref.courseId;
49
- var intl$1 = intl.useRawEliceIntl();
50
- var _useMaterialRunboxCon = MaterialRunboxContext.useMaterialRunboxContext(),
51
- showMessenger = _useMaterialRunboxCon.showMessenger;
52
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
41
+ const MaterialRunboxContent = ({
42
+ runboxId,
43
+ courseId
44
+ }) => {
45
+ const intl$1 = intl.useRawEliceIntl();
46
+ const {
47
+ showMessenger
48
+ } = MaterialRunboxContext.useMaterialRunboxContext();
49
+ const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
53
50
  //
54
51
  //
55
52
  //
56
- var _useQuery = reactQuery.useQuery({
57
- enabled: Boolean(runboxId),
58
- queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdGet', 'eliceMaterialRunboxRuntimeTemplateApi.runtimeTemplateRuntimeTemplateIdGet', runboxId, courseId],
59
- queryFn: function queryFn(_ref2) {
60
- var signal = _ref2.signal;
61
- return materialRunboxApi.runbox.runboxRunboxIdGet({
62
- runboxId: runboxId,
63
- eliceCourseId: courseId
64
- }, {
65
- signal: signal
66
- }).then(function (runbox) {
67
- return Promise.all([
68
- // runbox
69
- runbox,
70
- // runtime
71
- materialRunboxApi.runtime.runtimeGet({
72
- filterImageId: runbox.imageId,
73
- filterRuntimeTemplateId: runbox.runtimeTemplateId,
74
- skip: 0,
75
- count: 1,
76
- eliceCourseId: courseId
77
- }, {
78
- signal: signal
79
- }).then(function (runtimes) {
80
- var _a;
81
- return (_a = runtimes[0]) !== null && _a !== void 0 ? _a : null;
82
- }),
83
- // runtimeTemplate
84
- materialRunboxApi.runtimeTemplate.runtimeTemplateRuntimeTemplateIdGet({
85
- runtimeTemplateId: runbox.runtimeTemplateId,
86
- eliceCourseId: courseId
87
- }, {
88
- signal: signal
89
- })]);
90
- });
91
- },
92
- cacheTime: 0,
93
- keepPreviousData: true,
94
- refetchOnWindowFocus: false
53
+ const {
54
+ data: [runbox, runtime, runtimeTemplate] = DEFAULT_DATA,
55
+ isInitialLoading,
56
+ isError,
57
+ refetch
58
+ } = reactQuery.useQuery({
59
+ enabled: Boolean(runboxId),
60
+ queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdGet', 'eliceMaterialRunboxRuntimeTemplateApi.runtimeTemplateRuntimeTemplateIdGet', runboxId, courseId],
61
+ queryFn: ({
62
+ signal
63
+ }) => materialRunboxApi.runbox.runboxRunboxIdGet({
64
+ runboxId: runboxId,
65
+ eliceCourseId: courseId
66
+ }, {
67
+ signal
68
+ }).then(runbox => Promise.all([
69
+ // runbox
70
+ runbox,
71
+ // runtime
72
+ materialRunboxApi.runtime.runtimeGet({
73
+ filterImageId: runbox.imageId,
74
+ filterRuntimeTemplateId: runbox.runtimeTemplateId,
75
+ skip: 0,
76
+ count: 1,
77
+ eliceCourseId: courseId
78
+ }, {
79
+ signal
80
+ }).then(runtimes => {
81
+ var _a;
82
+ return (_a = runtimes[0]) !== null && _a !== void 0 ? _a : null;
95
83
  }),
96
- _useQuery$data = _useQuery.data,
97
- _useQuery$data2 = _useQuery$data === void 0 ? DEFAULT_DATA : _useQuery$data,
98
- _useQuery$data3 = _rollupPluginBabelHelpers.slicedToArray(_useQuery$data2, 3),
99
- runbox = _useQuery$data3[0],
100
- runtime = _useQuery$data3[1],
101
- runtimeTemplate = _useQuery$data3[2],
102
- isInitialLoading = _useQuery.isInitialLoading,
103
- isError = _useQuery.isError,
104
- refetch = _useQuery.refetch;
84
+ // runtimeTemplate
85
+ materialRunboxApi.runtimeTemplate.runtimeTemplateRuntimeTemplateIdGet({
86
+ runtimeTemplateId: runbox.runtimeTemplateId,
87
+ eliceCourseId: courseId
88
+ }, {
89
+ signal
90
+ })])),
91
+ cacheTime: 0,
92
+ keepPreviousData: true,
93
+ refetchOnWindowFocus: false
94
+ });
105
95
  //
106
96
  //
107
97
  //
108
98
  if (isInitialLoading) {
109
- return jsxRuntime.jsx(StyledRunboxContainer, {
110
- children: jsxRuntime.jsx(blocks.Spinner, {})
111
- });
99
+ return React.createElement(StyledRunboxContainer, null, React.createElement(blocks.Spinner, null));
112
100
  }
113
101
  if (isError) {
114
- return jsxRuntime.jsx(StyledRunboxContainer, {
115
- children: jsxRuntime.jsxs(material.Stack, {
116
- gap: "1.5rem",
117
- children: [jsxRuntime.jsx(material.Typography, {
118
- variant: "h6",
119
- children: intl$1.formatMessage({
120
- id: 'runbox.runtime.message.startError'
121
- })
122
- }), jsxRuntime.jsxs(material.Stack, {
123
- gap: "0.5rem",
124
- children: [jsxRuntime.jsx(material.Button, {
125
- startIcon: jsxRuntime.jsx(iconsMaterial.Refresh, {}),
126
- onClick: function onClick() {
127
- return refetch();
128
- },
129
- children: intl$1.formatMessage({
130
- id: 'runbox.common.retry'
131
- })
132
- }), typeof showMessenger === 'function' ? jsxRuntime.jsx(material.Button, {
133
- variant: "outlined",
134
- onClick: function onClick() {
135
- return showMessenger();
136
- },
137
- children: intl$1.formatMessage({
138
- id: 'runbox.common.support'
139
- })
140
- }) : null]
141
- })]
142
- })
143
- });
102
+ return React.createElement(StyledRunboxContainer, null, React.createElement(material.Stack, {
103
+ gap: "1.5rem"
104
+ }, React.createElement(material.Typography, {
105
+ variant: "h6"
106
+ }, intl$1.formatMessage({
107
+ id: 'runbox.runtime.message.startError'
108
+ })), React.createElement(material.Stack, {
109
+ gap: "0.5rem"
110
+ }, React.createElement(material.Button, {
111
+ startIcon: React.createElement(iconsMaterial.Refresh, null),
112
+ onClick: () => refetch()
113
+ }, intl$1.formatMessage({
114
+ id: 'runbox.common.retry'
115
+ })), typeof showMessenger === 'function' ? React.createElement(material.Button, {
116
+ variant: "outlined",
117
+ onClick: () => showMessenger()
118
+ }, intl$1.formatMessage({
119
+ id: 'runbox.common.support'
120
+ })) : null)));
144
121
  }
145
122
  if (!runbox || !runtimeTemplate) {
146
123
  return null;
147
124
  }
148
- var props = {
149
- runbox: runbox,
150
- runtime: runtime,
151
- runtimeTemplate: runtimeTemplate,
152
- courseId: courseId,
153
- refetch: refetch
125
+ const props = {
126
+ runbox,
127
+ runtime,
128
+ runtimeTemplate,
129
+ courseId,
130
+ refetch
154
131
  };
155
- return jsxRuntime.jsx(MaterialRunboxCommandContext.default, {
132
+ return React.createElement(MaterialRunboxCommandContext.default, {
156
133
  runtime: runtime,
157
- courseId: courseId,
158
- children: jsxRuntime.jsx(runboxClient.EliceRunboxProvider, {
159
- runboxId: runbox.id,
160
- runboxApiHeartbeat: function runboxApiHeartbeat(_ref3) {
161
- var id = _ref3.id,
162
- signal = _ref3.signal;
163
- return materialRunboxApi.runbox.runboxRunboxIdHeartbeatPost({
164
- runboxId: id,
165
- eliceCourseId: courseId
166
- }, {
167
- signal: signal
168
- });
169
- },
170
- runboxApiQuota: function runboxApiQuota(_ref4) {
171
- var id = _ref4.id,
172
- signal = _ref4.signal;
173
- return materialRunboxApi.runbox.runboxRunboxIdQuotaGet({
174
- runboxId: id,
175
- eliceCourseId: courseId
176
- }, {
177
- signal: signal
178
- });
179
- },
180
- onRunboxRefetchRequest: refetch,
181
- children: jsxRuntime.jsxs(StyledRunboxContainer, {
182
- children: [jsxRuntime.jsx(MaterialRunboxHeader.default, Object.assign({}, props)), jsxRuntime.jsx(MaterialRunboxBody.default, Object.assign({}, props)), jsxRuntime.jsx(MaterialRunboxFooter.default, Object.assign({}, props))]
183
- })
184
- })
185
- });
134
+ courseId: courseId
135
+ }, React.createElement(runboxClient.EliceRunboxProvider, {
136
+ runboxId: runbox.id,
137
+ runboxApiHeartbeat: ({
138
+ id,
139
+ signal
140
+ }) => materialRunboxApi.runbox.runboxRunboxIdHeartbeatPost({
141
+ runboxId: id,
142
+ eliceCourseId: courseId
143
+ }, {
144
+ signal
145
+ }),
146
+ runboxApiQuota: ({
147
+ id,
148
+ signal
149
+ }) => materialRunboxApi.runbox.runboxRunboxIdQuotaGet({
150
+ runboxId: id,
151
+ eliceCourseId: courseId
152
+ }, {
153
+ signal
154
+ }),
155
+ onRunboxRefetchRequest: refetch
156
+ }, React.createElement(StyledRunboxContainer, null, React.createElement(MaterialRunboxHeader.default, Object.assign({}, props)), React.createElement(MaterialRunboxBody.default, Object.assign({}, props)), React.createElement(MaterialRunboxFooter.default, Object.assign({}, props)))));
186
157
  };
187
158
 
188
159
  exports.default = MaterialRunboxContent;
@@ -3,59 +3,50 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _styled = require('@emotion/styled/base');
6
- var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
7
  var runboxClient = require('@elice/runbox-client');
8
8
  var material = require('@mui/material');
9
9
 
10
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
-
12
- var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
13
-
14
10
  //
15
11
  //
16
12
  //
17
- var StyledFooter = /*#__PURE__*/_styled__default.default("div", {
13
+ const StyledFooter = /*#__PURE__*/_styled("div", {
18
14
  target: "e9lbhtr0"
19
- })("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ", function (_ref) {
20
- var theme = _ref.theme;
21
- return theme.palette.divider;
22
- }, ";");
15
+ })("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ", ({
16
+ theme
17
+ }) => theme.palette.divider, ";");
23
18
  //
24
19
  //
25
20
  //
26
- var MaterialRunboxFooter = function MaterialRunboxFooter(_ref2) {
27
- var runtimeTemplate = _ref2.runtimeTemplate;
21
+ const MaterialRunboxFooter = ({
22
+ runtimeTemplate
23
+ }) => {
28
24
  /**
29
25
  * Resource stats
30
26
  */
31
- var renderFooterResourceStats = function renderFooterResourceStats() {
27
+ const renderFooterResourceStats = () => {
32
28
  var _a, _b;
33
- return jsxRuntime.jsx(material.Box, {
34
- children: jsxRuntime.jsx(runboxClient.EliceRunboxResourceStat, {
35
- gpu: ((_b = (_a = runtimeTemplate.gpus) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
36
- })
37
- });
29
+ return React.createElement(material.Box, null, React.createElement(runboxClient.EliceRunboxResourceStat, {
30
+ gpu: ((_b = (_a = runtimeTemplate.gpus) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
31
+ }));
38
32
  };
39
33
  /**
40
34
  * Status
41
35
  */
42
- var renderFooterStatus = function renderFooterStatus() {
43
- return jsxRuntime.jsxs(material.Stack, {
36
+ const renderFooterStatus = () => {
37
+ return React.createElement(material.Stack, {
44
38
  direction: "row",
45
39
  gap: "0.5rem",
46
- divider: jsxRuntime.jsx(material.Divider, {
40
+ divider: React.createElement(material.Divider, {
47
41
  orientation: "vertical",
48
42
  flexItem: true
49
- }),
50
- children: [jsxRuntime.jsx(runboxClient.EliceRunboxRemainingTimer, {}), jsxRuntime.jsx(runboxClient.EliceRunboxNetworkStat, {}), jsxRuntime.jsx(runboxClient.EliceRunboxRunningStatus, {})]
51
- });
43
+ })
44
+ }, React.createElement(runboxClient.EliceRunboxRemainingTimer, null), React.createElement(runboxClient.EliceRunboxNetworkStat, null), React.createElement(runboxClient.EliceRunboxRunningStatus, null));
52
45
  };
53
46
  //
54
47
  //
55
48
  //
56
- return jsxRuntime.jsxs(StyledFooter, {
57
- children: [renderFooterResourceStats(), renderFooterStatus()]
58
- });
49
+ return React.createElement(StyledFooter, null, renderFooterResourceStats(), renderFooterStatus());
59
50
  };
60
51
 
61
52
  exports.default = MaterialRunboxFooter;
@@ -2,9 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var _styled = require('@emotion/styled/base');
7
- var jsxRuntime = require('react/jsx-runtime');
8
6
  var React = require('react');
9
7
  var intl = require('@elice/intl');
10
8
  var muiElements = require('@elice/mui-elements');
@@ -21,83 +19,75 @@ require('./contexts/MaterialRunboxCommandContext.js');
21
19
  var MaterialRunboxContext = require('./contexts/MaterialRunboxContext.js');
22
20
  var runbox_logo = require('../../assets/runbox_logo.png.js');
23
21
 
24
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
25
-
26
- var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
27
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
28
-
29
- var StyledHeader = /*#__PURE__*/_styled__default.default("div", {
22
+ const StyledHeader = /*#__PURE__*/_styled("div", {
30
23
  target: "e110d0bp0"
31
- })("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", function (_ref) {
32
- var theme = _ref.theme;
33
- return theme.palette.divider;
34
- }, ";overflow:hidden;");
24
+ })("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", ({
25
+ theme
26
+ }) => theme.palette.divider, ";overflow:hidden;");
35
27
  //
36
28
  //
37
29
  //
38
- var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
39
- var runbox = _ref2.runbox,
40
- runtime = _ref2.runtime,
41
- runtimeTemplate = _ref2.runtimeTemplate,
42
- courseId = _ref2.courseId,
43
- refetch = _ref2.refetch;
44
- var intl$1 = intl.useRawEliceIntl();
45
- var _useMaterialRunboxCon = MaterialRunboxContext.useMaterialRunboxContext(),
46
- enableAutoShutdownToggle = _useMaterialRunboxCon.enableAutoShutdownToggle;
47
- var _React$useState = React__default.default.useState(null),
48
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
49
- menuAnchorEl = _React$useState2[0],
50
- setMenuAnchorEl = _React$useState2[1];
51
- var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
52
- status = _useEliceRunboxRunnin.status;
53
- var isRunboxRunning = status === 'running';
30
+ const MaterialRunboxHeader = ({
31
+ runbox,
32
+ runtime,
33
+ runtimeTemplate,
34
+ courseId,
35
+ refetch
36
+ }) => {
37
+ const intl$1 = intl.useRawEliceIntl();
38
+ const {
39
+ enableAutoShutdownToggle
40
+ } = MaterialRunboxContext.useMaterialRunboxContext();
41
+ const [menuAnchorEl, setMenuAnchorEl] = React.useState(null);
42
+ const {
43
+ status
44
+ } = runboxClient.useEliceRunboxRunning();
45
+ const isRunboxRunning = status === 'running';
54
46
  /**
55
47
  *
56
48
  */
57
- var handleMenuClose = function handleMenuClose() {
49
+ const handleMenuClose = () => {
58
50
  setMenuAnchorEl(null);
59
51
  };
60
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
61
- var _useQuery = reactQuery.useQuery({
62
- queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
63
- courseId: courseId,
64
- runtime: runtime
65
- }],
66
- queryFn: function queryFn(_ref3) {
67
- var signal = _ref3.signal;
68
- return materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
69
- eliceCourseId: courseId,
70
- runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
71
- }, {
72
- signal: signal
73
- });
74
- },
75
- refetchInterval: function refetchInterval(data) {
76
- return !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000;
77
- },
78
- enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
79
- retry: false
52
+ const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
53
+ const {
54
+ data: leaderboardSubmitInfo,
55
+ isLoading: isLeaderboardSubmitInfoLoading
56
+ } = reactQuery.useQuery({
57
+ queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
58
+ courseId,
59
+ runtime
60
+ }],
61
+ queryFn: ({
62
+ signal
63
+ }) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
64
+ eliceCourseId: courseId,
65
+ runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
66
+ }, {
67
+ signal
80
68
  }),
81
- leaderboardSubmitInfo = _useQuery.data,
82
- isLeaderboardSubmitInfoLoading = _useQuery.isLoading;
69
+ refetchInterval: data => !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000,
70
+ enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
71
+ retry: false
72
+ });
83
73
  /**
84
74
  *
85
75
  */
86
- var renderHeaderSubmitInfo = function renderHeaderSubmitInfo() {
87
- var remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
88
- var totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
89
- var isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
90
- var isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === types.enums.LeaderboardEntryType.Individual;
76
+ const renderHeaderSubmitInfo = () => {
77
+ const remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
78
+ const totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
79
+ const isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
80
+ const isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === types.enums.LeaderboardEntryType.Individual;
91
81
  if (isLeaderboardSubmitInfoLoading || remainSubmitCount === null) {
92
82
  return null;
93
83
  }
94
- return jsxRuntime.jsx(muiElements.Tag, {
84
+ return React.createElement(muiElements.Tag, {
95
85
  label: intl$1.formatMessage({
96
86
  id: 'runbox.header.submitInfo'
97
87
  }, {
98
88
  remainCount: remainSubmitCount,
99
89
  totalCount: totalSubmitCount,
100
- isDailyLimitEnabled: isDailyLimitEnabled,
90
+ isDailyLimitEnabled,
101
91
  isIndividual: isIndividualTypeLeaderboard
102
92
  }),
103
93
  variant: "muted",
@@ -107,11 +97,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
107
97
  /**
108
98
  *
109
99
  */
110
- var renderHeaderActionAutoShutdown = function renderHeaderActionAutoShutdown() {
100
+ const renderHeaderActionAutoShutdown = () => {
111
101
  if (!enableAutoShutdownToggle) {
112
102
  return null;
113
103
  }
114
- return jsxRuntime.jsx(MaterialRunboxActionAutoShutdown.default, {
104
+ return React.createElement(MaterialRunboxActionAutoShutdown.default, {
115
105
  runtime: runtime,
116
106
  runtimeTemplate: runtimeTemplate,
117
107
  courseId: courseId,
@@ -121,11 +111,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
121
111
  /**
122
112
  *
123
113
  */
124
- var renderHeaderActionGrade = function renderHeaderActionGrade() {
114
+ const renderHeaderActionGrade = () => {
125
115
  if (!runbox.submission.enabled) {
126
116
  return null;
127
117
  }
128
- return jsxRuntime.jsx(MaterialRunboxActionGrade.default, {
118
+ return React.createElement(MaterialRunboxActionGrade.default, {
129
119
  runtime: runtime,
130
120
  courseId: courseId
131
121
  });
@@ -133,51 +123,45 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
133
123
  /**
134
124
  *
135
125
  */
136
- var renderOptionMenu = function renderOptionMenu() {
137
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
138
- children: [jsxRuntime.jsx(material.IconButton, {
139
- disabled: !isRunboxRunning,
140
- onClick: function onClick(e) {
141
- if (Boolean(menuAnchorEl)) {
142
- setMenuAnchorEl(null);
143
- } else {
144
- setMenuAnchorEl(e.currentTarget);
145
- }
146
- },
147
- children: jsxRuntime.jsx(muiElements.EliceIcon, {
148
- icon: proSolidSvgIcons.faEllipsisVertical
149
- })
150
- }), jsxRuntime.jsx(MaterialRunboxActionMenu.default, {
151
- runbox: runbox,
152
- runtime: runtime,
153
- courseId: courseId,
154
- menuAnchorEl: menuAnchorEl,
155
- refetch: refetch,
156
- handleMenuClose: handleMenuClose
157
- })]
158
- });
126
+ const renderOptionMenu = () => {
127
+ return React.createElement(React.Fragment, null, React.createElement(material.IconButton, {
128
+ disabled: !isRunboxRunning,
129
+ onClick: e => {
130
+ if (Boolean(menuAnchorEl)) {
131
+ setMenuAnchorEl(null);
132
+ } else {
133
+ setMenuAnchorEl(e.currentTarget);
134
+ }
135
+ }
136
+ }, React.createElement(muiElements.EliceIcon, {
137
+ icon: proSolidSvgIcons.faEllipsisVertical
138
+ })), React.createElement(MaterialRunboxActionMenu.default, {
139
+ runbox: runbox,
140
+ runtime: runtime,
141
+ courseId: courseId,
142
+ menuAnchorEl: menuAnchorEl,
143
+ refetch: refetch,
144
+ handleMenuClose: handleMenuClose
145
+ }));
159
146
  };
160
147
  //
161
148
  //
162
149
  //
163
- return jsxRuntime.jsxs(StyledHeader, {
164
- children: [jsxRuntime.jsx(material.Box, {
165
- component: "img",
166
- src: runbox_logo.default,
167
- alt: "elice runbox",
168
- sx: {
169
- width: 'auto',
170
- height: '100%',
171
- imageRendering: 'auto',
172
- padding: '0.465rem 0'
173
- }
174
- }), jsxRuntime.jsxs(material.Stack, {
175
- direction: "row",
176
- alignItems: "center",
177
- gap: "0.5rem",
178
- children: [renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()]
179
- })]
180
- });
150
+ return React.createElement(StyledHeader, null, React.createElement(material.Box, {
151
+ component: "img",
152
+ src: runbox_logo.default,
153
+ alt: "elice runbox",
154
+ sx: {
155
+ width: 'auto',
156
+ height: '100%',
157
+ imageRendering: 'auto',
158
+ padding: '0.465rem 0'
159
+ }
160
+ }), React.createElement(material.Stack, {
161
+ direction: "row",
162
+ alignItems: "center",
163
+ gap: "0.5rem"
164
+ }, renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()));
181
165
  };
182
166
 
183
167
  exports.default = MaterialRunboxHeader;