@kartverket/backstage-plugin-risk-scorecard 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/PluginRoot.esm.js +21 -0
  2. package/dist/PluginRoot.esm.js.map +1 -0
  3. package/dist/components/common/EditButton.esm.js +16 -0
  4. package/dist/components/common/EditButton.esm.js.map +1 -0
  5. package/dist/components/common/Icons.esm.js +27 -0
  6. package/dist/components/common/Icons.esm.js.map +1 -0
  7. package/dist/components/common/Input.esm.js +44 -0
  8. package/dist/components/common/Input.esm.js.map +1 -0
  9. package/dist/components/common/Select.esm.js +85 -0
  10. package/dist/components/common/Select.esm.js.map +1 -0
  11. package/dist/components/common/Spinner.esm.js +29 -0
  12. package/dist/components/common/Spinner.esm.js.map +1 -0
  13. package/dist/components/common/mixins.esm.js +9 -0
  14. package/dist/components/common/mixins.esm.js.map +1 -0
  15. package/dist/components/common/typography.esm.js +59 -0
  16. package/dist/components/common/typography.esm.js.map +1 -0
  17. package/dist/components/riScDialog/MatrixDialog.esm.js +53 -0
  18. package/dist/components/riScDialog/MatrixDialog.esm.js.map +1 -0
  19. package/dist/components/riScDialog/RiScDialog.esm.js +70 -0
  20. package/dist/components/riScDialog/RiScDialog.esm.js.map +1 -0
  21. package/dist/components/riScInfo/RiScInfo.esm.js +43 -0
  22. package/dist/components/riScInfo/RiScInfo.esm.js.map +1 -0
  23. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js +126 -0
  24. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js.map +1 -0
  25. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js +121 -0
  26. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js.map +1 -0
  27. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js +233 -0
  28. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js.map +1 -0
  29. package/dist/components/riScPlugin/RiScPlugin.esm.js +106 -0
  30. package/dist/components/riScPlugin/RiScPlugin.esm.js.map +1 -0
  31. package/dist/components/riskMatrix/AggregatedCost.esm.js +29 -0
  32. package/dist/components/riskMatrix/AggregatedCost.esm.js.map +1 -0
  33. package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js +19 -0
  34. package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js.map +1 -0
  35. package/dist/components/riskMatrix/RiskMatrix.esm.js +67 -0
  36. package/dist/components/riskMatrix/RiskMatrix.esm.js.map +1 -0
  37. package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js +86 -0
  38. package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js.map +1 -0
  39. package/dist/components/riskMatrix/Tabs.esm.js +40 -0
  40. package/dist/components/riskMatrix/Tabs.esm.js.map +1 -0
  41. package/dist/components/riskMatrix/aggregatedCostStyle.esm.js +16 -0
  42. package/dist/components/riskMatrix/aggregatedCostStyle.esm.js.map +1 -0
  43. package/dist/components/riskMatrix/estimatedRiskInfoDialogStyle.esm.js +17 -0
  44. package/dist/components/riskMatrix/estimatedRiskInfoDialogStyle.esm.js.map +1 -0
  45. package/dist/components/riskMatrix/riskMatrixStyle.esm.js +73 -0
  46. package/dist/components/riskMatrix/riskMatrixStyle.esm.js.map +1 -0
  47. package/dist/components/riskMatrix/tabsStyle.esm.js +15 -0
  48. package/dist/components/riskMatrix/tabsStyle.esm.js.map +1 -0
  49. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +208 -0
  50. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -0
  51. package/dist/components/scenarioDrawer/components/ActionBox.esm.js +156 -0
  52. package/dist/components/scenarioDrawer/components/ActionBox.esm.js.map +1 -0
  53. package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js +109 -0
  54. package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js.map +1 -0
  55. package/dist/components/scenarioDrawer/components/ActionsSection.esm.js +61 -0
  56. package/dist/components/scenarioDrawer/components/ActionsSection.esm.js.map +1 -0
  57. package/dist/components/scenarioDrawer/components/DeleteActionConfirmation.esm.js +27 -0
  58. package/dist/components/scenarioDrawer/components/DeleteActionConfirmation.esm.js.map +1 -0
  59. package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js +33 -0
  60. package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js.map +1 -0
  61. package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js +88 -0
  62. package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js.map +1 -0
  63. package/dist/components/scenarioDrawer/components/RiskSection.esm.js +56 -0
  64. package/dist/components/scenarioDrawer/components/RiskSection.esm.js.map +1 -0
  65. package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js +72 -0
  66. package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js.map +1 -0
  67. package/dist/components/scenarioDrawer/components/ScopeSection.esm.js +33 -0
  68. package/dist/components/scenarioDrawer/components/ScopeSection.esm.js.map +1 -0
  69. package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js +33 -0
  70. package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js.map +1 -0
  71. package/dist/components/scenarioTable/ScenarioTable.esm.js +167 -0
  72. package/dist/components/scenarioTable/ScenarioTable.esm.js.map +1 -0
  73. package/dist/components/scenarioTable/ScenarioTableRow.esm.js +112 -0
  74. package/dist/components/scenarioTable/ScenarioTableRow.esm.js.map +1 -0
  75. package/dist/components/scenarioTable/ScenarioTableStyles.esm.js +80 -0
  76. package/dist/components/scenarioTable/ScenarioTableStyles.esm.js.map +1 -0
  77. package/dist/components/scenarioWizard/ScenarioWizard.esm.js +169 -0
  78. package/dist/components/scenarioWizard/ScenarioWizard.esm.js.map +1 -0
  79. package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js +20 -0
  80. package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js.map +1 -0
  81. package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js +107 -0
  82. package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js.map +1 -0
  83. package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js +69 -0
  84. package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js.map +1 -0
  85. package/dist/components/scenarioWizard/components/RiskRadioButton.esm.js +22 -0
  86. package/dist/components/scenarioWizard/components/RiskRadioButton.esm.js.map +1 -0
  87. package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +115 -0
  88. package/dist/components/scenarioWizard/steps/ActionsStep.esm.js.map +1 -0
  89. package/dist/components/scenarioWizard/steps/RiskStep.esm.js +18 -0
  90. package/dist/components/scenarioWizard/steps/RiskStep.esm.js.map +1 -0
  91. package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js +74 -0
  92. package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js.map +1 -0
  93. package/dist/components/scenarioWizard/wizardStyles.esm.js +35 -0
  94. package/dist/components/scenarioWizard/wizardStyles.esm.js.map +1 -0
  95. package/dist/contexts/RiScContext.esm.js +296 -0
  96. package/dist/contexts/RiScContext.esm.js.map +1 -0
  97. package/dist/contexts/ScenarioContext.esm.js +219 -0
  98. package/dist/contexts/ScenarioContext.esm.js.map +1 -0
  99. package/dist/index.d.ts +14 -0
  100. package/dist/index.esm.js +3 -0
  101. package/dist/index.esm.js.map +1 -0
  102. package/dist/plugin.esm.js +21 -0
  103. package/dist/plugin.esm.js.map +1 -0
  104. package/dist/risc_schema_en_v4_0.json.esm.js +287 -0
  105. package/dist/risc_schema_en_v4_0.json.esm.js.map +1 -0
  106. package/dist/routes.esm.js +18 -0
  107. package/dist/routes.esm.js.map +1 -0
  108. package/dist/utils/DTOs.esm.js +73 -0
  109. package/dist/utils/DTOs.esm.js.map +1 -0
  110. package/dist/utils/constants.esm.js +19 -0
  111. package/dist/utils/constants.esm.js.map +1 -0
  112. package/dist/utils/hooks.esm.js +151 -0
  113. package/dist/utils/hooks.esm.js.map +1 -0
  114. package/dist/utils/style.esm.js +62 -0
  115. package/dist/utils/style.esm.js.map +1 -0
  116. package/dist/utils/translations.esm.js +553 -0
  117. package/dist/utils/translations.esm.js.map +1 -0
  118. package/dist/utils/types.esm.js +34 -0
  119. package/dist/utils/types.esm.js.map +1 -0
  120. package/dist/utils/utilityfunctions.esm.js +131 -0
  121. package/dist/utils/utilityfunctions.esm.js.map +1 -0
  122. package/package.json +3 -2
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Routes, Route } from 'react-router-dom';
3
+ import { CacheProvider } from '@emotion/react';
4
+ import createCache from '@emotion/cache';
5
+ import { RiScPlugin } from './components/riScPlugin/RiScPlugin.esm.js';
6
+ import { ScenarioProvider } from './contexts/ScenarioContext.esm.js';
7
+ import { riScRouteRef, scenarioRouteRef } from './routes.esm.js';
8
+ import { RiScProvider } from './contexts/RiScContext.esm.js';
9
+
10
+ const emotionInsertionPoint = document.createElement("meta");
11
+ emotionInsertionPoint.setAttribute("name", "emotion-insertion-point");
12
+ document.querySelector("head")?.appendChild(emotionInsertionPoint);
13
+ const cache = createCache({
14
+ key: "css",
15
+ insertionPoint: emotionInsertionPoint
16
+ });
17
+ const ProvidedPlugin = () => /* @__PURE__ */ React.createElement(CacheProvider, { value: cache }, /* @__PURE__ */ React.createElement(RiScProvider, null, /* @__PURE__ */ React.createElement(ScenarioProvider, null, /* @__PURE__ */ React.createElement(RiScPlugin, null))));
18
+ const PluginRoot = () => /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(ProvidedPlugin, null) }), /* @__PURE__ */ React.createElement(Route, { path: riScRouteRef.path, element: /* @__PURE__ */ React.createElement(ProvidedPlugin, null) }), /* @__PURE__ */ React.createElement(Route, { path: scenarioRouteRef.path, element: /* @__PURE__ */ React.createElement(ProvidedPlugin, null) }));
19
+
20
+ export { PluginRoot };
21
+ //# sourceMappingURL=PluginRoot.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginRoot.esm.js","sources":["../src/PluginRoot.tsx"],"sourcesContent":["import React from 'react';\nimport { Route, Routes } from 'react-router-dom';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport { RiScPlugin } from './components/riScPlugin/RiScPlugin';\nimport { ScenarioProvider } from './contexts/ScenarioContext';\nimport { riScRouteRef, scenarioRouteRef } from './routes';\nimport { RiScProvider } from './contexts/RiScContext';\n\nconst emotionInsertionPoint = document.createElement('meta');\nemotionInsertionPoint.setAttribute('name', 'emotion-insertion-point');\ndocument.querySelector('head')?.appendChild(emotionInsertionPoint);\n\nconst cache = createCache({\n key: 'css',\n insertionPoint: emotionInsertionPoint,\n});\n\nconst ProvidedPlugin = () => (\n <CacheProvider value={cache}>\n <RiScProvider>\n <ScenarioProvider>\n <RiScPlugin />\n </ScenarioProvider>\n </RiScProvider>\n </CacheProvider>\n);\n\nexport const PluginRoot = () => (\n <Routes>\n <Route path=\"/\" element={<ProvidedPlugin />} />\n <Route path={riScRouteRef.path} element={<ProvidedPlugin />} />\n <Route path={scenarioRouteRef.path} element={<ProvidedPlugin />} />\n </Routes>\n);\n"],"names":[],"mappings":";;;;;;;;;AASA,MAAM,qBAAA,GAAwB,QAAS,CAAA,aAAA,CAAc,MAAM,CAAA,CAAA;AAC3D,qBAAsB,CAAA,YAAA,CAAa,QAAQ,yBAAyB,CAAA,CAAA;AACpE,QAAA,CAAS,aAAc,CAAA,MAAM,CAAG,EAAA,WAAA,CAAY,qBAAqB,CAAA,CAAA;AAEjE,MAAM,QAAQ,WAAY,CAAA;AAAA,EACxB,GAAK,EAAA,KAAA;AAAA,EACL,cAAgB,EAAA,qBAAA;AAClB,CAAC,CAAA,CAAA;AAED,MAAM,cAAiB,GAAA,sBACpB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,OAAO,KACpB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,YACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,IAAA,CACd,CACF,CACF,CAAA,CAAA;AAGK,MAAM,UAAa,GAAA,sBACvB,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,sCACE,KAAM,EAAA,EAAA,IAAA,EAAK,GAAI,EAAA,OAAA,kBAAU,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAe,CAAI,EAAA,CAAA,sCAC5C,KAAM,EAAA,EAAA,IAAA,EAAM,YAAa,CAAA,IAAA,EAAM,OAAS,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAAA,IAAA,CAAA,EAAI,mBAC5D,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,IAAM,EAAA,gBAAA,CAAiB,IAAM,EAAA,OAAA,kBAAU,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAe,GAAI,CACnE;;;;"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { makeStyles, IconButton } from '@material-ui/core';
3
+ import EditIcon from '@mui/icons-material/Edit';
4
+
5
+ const useEditButtonStyle = makeStyles((theme) => ({
6
+ icon: {
7
+ color: theme.palette.type === "dark" ? "#fff" : "rgba(0, 0, 0, 0.54)"
8
+ }
9
+ }));
10
+ const EditButton = (props) => {
11
+ const { icon } = useEditButtonStyle();
12
+ return /* @__PURE__ */ React.createElement(IconButton, { size: "small", ...props }, /* @__PURE__ */ React.createElement(EditIcon, { className: icon, "aria-label": "Edit" }));
13
+ };
14
+
15
+ export { EditButton as default };
16
+ //# sourceMappingURL=EditButton.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditButton.esm.js","sources":["../../../src/components/common/EditButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconButton,\n IconButtonProps,\n Theme,\n makeStyles,\n} from '@material-ui/core';\nimport EditIcon from '@mui/icons-material/Edit';\n\nconst useEditButtonStyle = makeStyles((theme: Theme) => ({\n icon: {\n color: theme.palette.type === 'dark' ? '#fff' : 'rgba(0, 0, 0, 0.54)',\n },\n}));\n\nconst EditButton = (props: IconButtonProps) => {\n const { icon } = useEditButtonStyle();\n\n return (\n <IconButton size=\"small\" {...props}>\n <EditIcon className={icon} aria-label=\"Edit\" />\n </IconButton>\n );\n};\n\nexport default EditButton;\n"],"names":[],"mappings":";;;;AASA,MAAM,kBAAA,GAAqB,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EACvD,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,MAAS,GAAA,qBAAA;AAAA,GAClD;AACF,CAAE,CAAA,CAAA,CAAA;AAEI,MAAA,UAAA,GAAa,CAAC,KAA2B,KAAA;AAC7C,EAAM,MAAA,EAAE,IAAK,EAAA,GAAI,kBAAmB,EAAA,CAAA;AAEpC,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,IAAK,EAAA,OAAA,EAAS,GAAG,KAAA,EAAA,kBAC1B,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,SAAW,EAAA,IAAA,EAAM,YAAW,EAAA,MAAA,EAAO,CAC/C,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import SvgIcon from '@mui/material/SvgIcon';
3
+
4
+ const PullRequestSvg = () => /* @__PURE__ */ React.createElement(
5
+ SvgIcon,
6
+ {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "0 0 16 16",
9
+ sx: {
10
+ width: "24px",
11
+ height: "16px",
12
+ fill: "none",
13
+ transform: "translateY(2px)",
14
+ color: (theme) => theme.palette.mode === "dark" ? "white" : "rgba(0, 0, 0, 0.87)"
15
+ }
16
+ },
17
+ /* @__PURE__ */ React.createElement(
18
+ "path",
19
+ {
20
+ d: "M9.55625 0.065625C9.825 0.184375 10 0.453125 10 0.75V2.25H10.5C12.5719 2.25 14.25 3.92812 14.25 6V11.1156C15.2656 11.4344 16 12.3813 16 13.5C16 14.8813 14.8813 16 13.5 16C12.1187 16 11 14.8813 11 13.5C11 12.3813 11.7344 11.4344 12.75 11.1156V6C12.75 4.75625 11.7437 3.75 10.5 3.75H10V5.25C10 5.54688 9.825 5.81562 9.55625 5.93437C9.2875 6.05312 8.96875 6.00625 8.75 5.80625L6.25 3.55625C6.09062 3.4125 6.00313 3.2125 6.00313 3C6.00313 2.7875 6.09375 2.58437 6.25 2.44375L8.75 0.19375C8.96875 -0.00312501 9.2875 -0.053125 9.55625 0.065625ZM3.5 2.5C3.5 2.23478 3.39464 1.98043 3.20711 1.79289C3.01957 1.60536 2.76522 1.5 2.5 1.5C2.23478 1.5 1.98043 1.60536 1.79289 1.79289C1.60536 1.98043 1.5 2.23478 1.5 2.5C1.5 2.76522 1.60536 3.01957 1.79289 3.20711C1.98043 3.39464 2.23478 3.5 2.5 3.5C2.76522 3.5 3.01957 3.39464 3.20711 3.20711C3.39464 3.01957 3.5 2.76522 3.5 2.5ZM3.25 4.88438V11.1156C4.26562 11.4344 5 12.3813 5 13.5C5 14.8813 3.88125 16 2.5 16C1.11875 16 0 14.8813 0 13.5C0 12.3813 0.734375 11.4344 1.75 11.1156V4.88438C0.734375 4.56563 0 3.61875 0 2.5C0 1.11875 1.11875 0 2.5 0C3.88125 0 5 1.11875 5 2.5C5 3.61875 4.26562 4.56563 3.25 4.88438ZM3.5 13.5C3.5 13.2348 3.39464 12.9804 3.20711 12.7929C3.01957 12.6054 2.76522 12.5 2.5 12.5C2.23478 12.5 1.98043 12.6054 1.79289 12.7929C1.60536 12.9804 1.5 13.2348 1.5 13.5C1.5 13.7652 1.60536 14.0196 1.79289 14.2071C1.98043 14.3946 2.23478 14.5 2.5 14.5C2.76522 14.5 3.01957 14.3946 3.20711 14.2071C3.39464 14.0196 3.5 13.7652 3.5 13.5ZM13.5 14.5C13.7652 14.5 14.0196 14.3946 14.2071 14.2071C14.3946 14.0196 14.5 13.7652 14.5 13.5C14.5 13.2348 14.3946 12.9804 14.2071 12.7929C14.0196 12.6054 13.7652 12.5 13.5 12.5C13.2348 12.5 12.9804 12.6054 12.7929 12.7929C12.6054 12.9804 12.5 13.2348 12.5 13.5C12.5 13.7652 12.6054 14.0196 12.7929 14.2071C12.9804 14.3946 13.2348 14.5 13.5 14.5Z",
21
+ fill: "currentColor"
22
+ }
23
+ )
24
+ );
25
+
26
+ export { PullRequestSvg };
27
+ //# sourceMappingURL=Icons.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icons.esm.js","sources":["../../../src/components/common/Icons.tsx"],"sourcesContent":["import React from 'react';\nimport SvgIcon from '@mui/material/SvgIcon';\n\nexport const PullRequestSvg = () => (\n <SvgIcon\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n sx={{\n width: '24px',\n height: '16px',\n fill: 'none',\n transform: 'translateY(2px)',\n color: theme =>\n theme.palette.mode === 'dark' ? 'white' : 'rgba(0, 0, 0, 0.87)',\n }}\n >\n <path\n d=\"M9.55625 0.065625C9.825 0.184375 10 0.453125 10 0.75V2.25H10.5C12.5719 2.25 14.25 3.92812 14.25 6V11.1156C15.2656 11.4344 16 12.3813 16 13.5C16 14.8813 14.8813 16 13.5 16C12.1187 16 11 14.8813 11 13.5C11 12.3813 11.7344 11.4344 12.75 11.1156V6C12.75 4.75625 11.7437 3.75 10.5 3.75H10V5.25C10 5.54688 9.825 5.81562 9.55625 5.93437C9.2875 6.05312 8.96875 6.00625 8.75 5.80625L6.25 3.55625C6.09062 3.4125 6.00313 3.2125 6.00313 3C6.00313 2.7875 6.09375 2.58437 6.25 2.44375L8.75 0.19375C8.96875 -0.00312501 9.2875 -0.053125 9.55625 0.065625ZM3.5 2.5C3.5 2.23478 3.39464 1.98043 3.20711 1.79289C3.01957 1.60536 2.76522 1.5 2.5 1.5C2.23478 1.5 1.98043 1.60536 1.79289 1.79289C1.60536 1.98043 1.5 2.23478 1.5 2.5C1.5 2.76522 1.60536 3.01957 1.79289 3.20711C1.98043 3.39464 2.23478 3.5 2.5 3.5C2.76522 3.5 3.01957 3.39464 3.20711 3.20711C3.39464 3.01957 3.5 2.76522 3.5 2.5ZM3.25 4.88438V11.1156C4.26562 11.4344 5 12.3813 5 13.5C5 14.8813 3.88125 16 2.5 16C1.11875 16 0 14.8813 0 13.5C0 12.3813 0.734375 11.4344 1.75 11.1156V4.88438C0.734375 4.56563 0 3.61875 0 2.5C0 1.11875 1.11875 0 2.5 0C3.88125 0 5 1.11875 5 2.5C5 3.61875 4.26562 4.56563 3.25 4.88438ZM3.5 13.5C3.5 13.2348 3.39464 12.9804 3.20711 12.7929C3.01957 12.6054 2.76522 12.5 2.5 12.5C2.23478 12.5 1.98043 12.6054 1.79289 12.7929C1.60536 12.9804 1.5 13.2348 1.5 13.5C1.5 13.7652 1.60536 14.0196 1.79289 14.2071C1.98043 14.3946 2.23478 14.5 2.5 14.5C2.76522 14.5 3.01957 14.3946 3.20711 14.2071C3.39464 14.0196 3.5 13.7652 3.5 13.5ZM13.5 14.5C13.7652 14.5 14.0196 14.3946 14.2071 14.2071C14.3946 14.0196 14.5 13.7652 14.5 13.5C14.5 13.2348 14.3946 12.9804 14.2071 12.7929C14.0196 12.6054 13.7652 12.5 13.5 12.5C13.2348 12.5 12.9804 12.6054 12.7929 12.7929C12.6054 12.9804 12.5 13.2348 12.5 13.5C12.5 13.7652 12.6054 14.0196 12.7929 14.2071C12.9804 14.3946 13.2348 14.5 13.5 14.5Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n);\n"],"names":[],"mappings":";;;AAGO,MAAM,iBAAiB,sBAC5B,KAAA,CAAA,aAAA;AAAA,EAAC,OAAA;AAAA,EAAA;AAAA,IACC,KAAM,EAAA,4BAAA;AAAA,IACN,OAAQ,EAAA,WAAA;AAAA,IACR,EAAI,EAAA;AAAA,MACF,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,MAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,SAAW,EAAA,iBAAA;AAAA,MACX,OAAO,CACL,KAAA,KAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,OAAU,GAAA,qBAAA;AAAA,KAC9C;AAAA,GAAA;AAAA,kBAEA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,CAAE,EAAA,6yDAAA;AAAA,MACF,IAAK,EAAA,cAAA;AAAA,KAAA;AAAA,GACP;AACF;;;;"}
@@ -0,0 +1,44 @@
1
+ import FormControl from '@mui/material/FormControl';
2
+ import FormHelperText from '@mui/material/FormHelperText';
3
+ import FormLabel from '@mui/material/FormLabel';
4
+ import TextField from '@mui/material/TextField';
5
+ import React, { forwardRef } from 'react';
6
+ import { formLabel, formHelperText } from './typography.esm.js';
7
+
8
+ const Input = forwardRef(
9
+ ({ label, sublabel, error, helperText, required, ...props }, ref) => {
10
+ return /* @__PURE__ */ React.createElement(
11
+ FormControl,
12
+ {
13
+ sx: { width: "100%", gap: "4px" },
14
+ error,
15
+ required
16
+ },
17
+ label && /* @__PURE__ */ React.createElement(FormLabel, { required, sx: formLabel }, label),
18
+ sublabel && /* @__PURE__ */ React.createElement(FormHelperText, { sx: formHelperText }, sublabel),
19
+ /* @__PURE__ */ React.createElement(
20
+ TextField,
21
+ {
22
+ id: "filled-multiline-static",
23
+ error,
24
+ multiline: true,
25
+ fullWidth: true,
26
+ variant: "outlined",
27
+ inputRef: ref,
28
+ InputProps: {
29
+ sx: (theme) => ({
30
+ "&.Mui-disabled": {
31
+ color: theme.palette.mode === "dark" ? "#FFFFFF80" : "#757575"
32
+ }
33
+ })
34
+ },
35
+ ...props
36
+ }
37
+ ),
38
+ helperText && /* @__PURE__ */ React.createElement(FormHelperText, null, helperText)
39
+ );
40
+ }
41
+ );
42
+
43
+ export { Input };
44
+ //# sourceMappingURL=Input.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.esm.js","sources":["../../../src/components/common/Input.tsx"],"sourcesContent":["import FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport React, { forwardRef } from 'react';\nimport { formHelperText, formLabel } from './typography';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n};\n\nexport const Input = forwardRef<HTMLInputElement, Props>(\n ({ label, sublabel, error, helperText, required, ...props }, ref) => {\n return (\n <FormControl\n sx={{ width: '100%', gap: '4px' }}\n error={error}\n required={required}\n >\n {label && (\n <FormLabel required={required} sx={formLabel}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <TextField\n id=\"filled-multiline-static\"\n error={error}\n multiline\n fullWidth\n variant=\"outlined\"\n inputRef={ref}\n InputProps={{\n sx: theme => ({\n '&.Mui-disabled': {\n color: theme.palette.mode === 'dark' ? '#FFFFFF80' : '#757575',\n },\n }),\n }}\n {...props}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;AAWO,MAAM,KAAQ,GAAA,UAAA;AAAA,EACnB,CAAC,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,YAAY,QAAU,EAAA,GAAG,KAAM,EAAA,EAAG,GAAQ,KAAA;AACnE,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA,EAAE,KAAO,EAAA,MAAA,EAAQ,KAAK,KAAM,EAAA;AAAA,QAChC,KAAA;AAAA,QACA,QAAA;AAAA,OAAA;AAAA,MAEC,yBACE,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,QAAoB,EAAA,EAAA,EAAI,aAChC,KACH,CAAA;AAAA,MAED,QACC,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAAA,EAAA,EAAA,EAAI,kBAAiB,QAAS,CAAA;AAAA,sBAEhD,KAAA,CAAA,aAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,EAAG,EAAA,yBAAA;AAAA,UACH,KAAA;AAAA,UACA,SAAS,EAAA,IAAA;AAAA,UACT,SAAS,EAAA,IAAA;AAAA,UACT,OAAQ,EAAA,UAAA;AAAA,UACR,QAAU,EAAA,GAAA;AAAA,UACV,UAAY,EAAA;AAAA,YACV,IAAI,CAAU,KAAA,MAAA;AAAA,cACZ,gBAAkB,EAAA;AAAA,gBAChB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,WAAc,GAAA,SAAA;AAAA,eACvD;AAAA,aACF,CAAA;AAAA,WACF;AAAA,UACC,GAAG,KAAA;AAAA,SAAA;AAAA,OACN;AAAA,MACC,UAAA,oBAAe,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAA,EAAgB,UAAW,CAAA;AAAA,KAC7C,CAAA;AAAA,GAEJ;AACF;;;;"}
@@ -0,0 +1,85 @@
1
+ import React from 'react';
2
+ import { useController } from 'react-hook-form';
3
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
4
+ import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
5
+ import Box from '@mui/material/Box';
6
+ import Chip from '@mui/material/Chip';
7
+ import FormControl from '@mui/material/FormControl';
8
+ import FormHelperText from '@mui/material/FormHelperText';
9
+ import FormLabel from '@mui/material/FormLabel';
10
+ import MUISelect from '@mui/material/Select';
11
+ import Checkbox from '@mui/material/Checkbox';
12
+ import MenuItem from '@mui/material/MenuItem';
13
+ import ListItemText from '@mui/material/ListItemText';
14
+ import { formLabel, formHelperText } from './typography.esm.js';
15
+
16
+ const Select = ({
17
+ label,
18
+ sublabel,
19
+ error,
20
+ helperText,
21
+ required,
22
+ control,
23
+ name,
24
+ multiple,
25
+ labelTranslationKey,
26
+ options,
27
+ ...props
28
+ }) => {
29
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
30
+ const { field } = useController({
31
+ name,
32
+ control,
33
+ rules: { required }
34
+ });
35
+ const renderValue = (values) => multiple ? /* @__PURE__ */ React.createElement(
36
+ Box,
37
+ {
38
+ sx: {
39
+ display: "flex",
40
+ flexWrap: "wrap",
41
+ marginBottom: 0,
42
+ paddingBottom: 0
43
+ }
44
+ },
45
+ values.map((value) => /* @__PURE__ */ React.createElement(
46
+ Chip,
47
+ {
48
+ key: value,
49
+ label: (
50
+ /* @ts-ignore Because ts can't typecheck strings against our keys */
51
+ labelTranslationKey ? t(`${labelTranslationKey}.${value}`) : value
52
+ )
53
+ }
54
+ ))
55
+ ) : options.find((option) => option.value === values)?.renderedValue;
56
+ const handleChecked = (fieldValue, optionValue) => {
57
+ if (Array.isArray(fieldValue)) return fieldValue.includes(optionValue);
58
+ return fieldValue === optionValue;
59
+ };
60
+ return /* @__PURE__ */ React.createElement(FormControl, { sx: { width: "100%", gap: "4px" } }, label && /* @__PURE__ */ React.createElement(FormLabel, { sx: formLabel, required }, label), sublabel && /* @__PURE__ */ React.createElement(FormHelperText, { sx: formHelperText }, sublabel), /* @__PURE__ */ React.createElement(
61
+ MUISelect,
62
+ {
63
+ MenuProps: {
64
+ disablePortal: true
65
+ },
66
+ variant: "outlined",
67
+ renderValue,
68
+ multiple,
69
+ SelectDisplayProps: multiple ? {
70
+ style: {
71
+ paddingBottom: 8,
72
+ paddingTop: 16,
73
+ minHeight: 40
74
+ }
75
+ } : {},
76
+ inputRef: field.ref,
77
+ ...field,
78
+ ...props
79
+ },
80
+ options.map((option) => /* @__PURE__ */ React.createElement(MenuItem, { key: option.value, value: option.value }, multiple && /* @__PURE__ */ React.createElement(Checkbox, { checked: handleChecked(field.value, option.value) }), /* @__PURE__ */ React.createElement(ListItemText, { primary: option.renderedValue })))
81
+ ), error && /* @__PURE__ */ React.createElement(FormHelperText, { error: true }, helperText));
82
+ };
83
+
84
+ export { Select };
85
+ //# sourceMappingURL=Select.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.esm.js","sources":["../../../src/components/common/Select.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Control,\n FieldValues,\n Path,\n PathValue,\n useController,\n} from 'react-hook-form';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport MUISelect, { SelectProps } from '@mui/material/Select';\nimport Checkbox from '@mui/material/Checkbox';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport { formHelperText, formLabel } from './typography';\n\ntype Props<T extends FieldValues> = SelectProps & {\n sublabel?: string;\n helperText?: string;\n control?: Control<T, any>;\n name: Path<T>;\n labelTranslationKey?: string;\n options: { value: string | number; renderedValue: string | number }[];\n};\n\nexport const Select = <T extends FieldValues>({\n label,\n sublabel,\n error,\n helperText,\n required,\n control,\n name,\n multiple,\n labelTranslationKey,\n options,\n ...props\n}: Props<T>) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const { field } = useController({\n name,\n control,\n rules: { required },\n });\n\n // values er strengt tatt unknown, men da må vi bruke mye ts-ignore for å komme i mål\n const renderValue = (values: any) =>\n multiple ? (\n <Box\n sx={{\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: 0,\n paddingBottom: 0,\n }}\n >\n {values.map((value: string) => (\n <Chip\n key={value}\n label={\n /* @ts-ignore Because ts can't typecheck strings against our keys */\n labelTranslationKey ? t(`${labelTranslationKey}.${value}`) : value\n }\n />\n ))}\n </Box>\n ) : (\n options.find(option => option.value === values)?.renderedValue\n );\n\n const handleChecked = (\n fieldValue: PathValue<T, (string | undefined) & Path<T>>,\n optionValue: Props<T>['options'][0]['value'],\n ) => {\n if (Array.isArray(fieldValue)) return fieldValue.includes(optionValue);\n return fieldValue === optionValue;\n };\n\n return (\n <FormControl sx={{ width: '100%', gap: '4px' }}>\n {label && (\n <FormLabel sx={formLabel} required={required}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n\n <MUISelect\n MenuProps={{\n disablePortal: true,\n }}\n variant=\"outlined\"\n renderValue={renderValue}\n multiple={multiple}\n SelectDisplayProps={\n multiple\n ? {\n style: {\n paddingBottom: 8,\n paddingTop: 16,\n minHeight: 40,\n },\n }\n : {}\n }\n inputRef={field.ref}\n {...field}\n {...props}\n >\n {options.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {multiple && (\n <Checkbox checked={handleChecked(field.value, option.value)} />\n )}\n <ListItemText primary={option.renderedValue} />\n </MenuItem>\n ))}\n </MUISelect>\n {error && <FormHelperText error>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import Box from '@mui/material/Box';
3
+ import CircularProgress from '@mui/material/CircularProgress';
4
+
5
+ const Spinner = ({ size }) => /* @__PURE__ */ React.createElement(
6
+ Box,
7
+ {
8
+ sx: {
9
+ display: "flex",
10
+ minWidth: "100wh",
11
+ height: "100vh",
12
+ justifyContent: "center",
13
+ alignItems: "flex-start"
14
+ }
15
+ },
16
+ /* @__PURE__ */ React.createElement(
17
+ CircularProgress,
18
+ {
19
+ size,
20
+ sx: {
21
+ display: "flex",
22
+ marginTop: "200px"
23
+ }
24
+ }
25
+ )
26
+ );
27
+
28
+ export { Spinner };
29
+ //# sourceMappingURL=Spinner.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.esm.js","sources":["../../../src/components/common/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport Box from '@mui/material/Box';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nexport const Spinner = ({ size }: { size?: string | number }) => (\n <Box\n sx={{\n display: 'flex',\n minWidth: '100wh',\n height: '100vh',\n justifyContent: 'center',\n alignItems: 'flex-start',\n }}\n >\n <CircularProgress\n size={size}\n sx={{\n display: 'flex',\n marginTop: '200px',\n }}\n />\n </Box>\n);\n"],"names":[],"mappings":";;;;AAIO,MAAM,OAAU,GAAA,CAAC,EAAE,IAAA,EACxB,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,GAAA;AAAA,EAAA;AAAA,IACC,EAAI,EAAA;AAAA,MACF,OAAS,EAAA,MAAA;AAAA,MACT,QAAU,EAAA,OAAA;AAAA,MACV,MAAQ,EAAA,OAAA;AAAA,MACR,cAAgB,EAAA,QAAA;AAAA,MAChB,UAAY,EAAA,YAAA;AAAA,KACd;AAAA,GAAA;AAAA,kBAEA,KAAA,CAAA,aAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,SAAW,EAAA,OAAA;AAAA,OACb;AAAA,KAAA;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,9 @@
1
+ const dialogActions = {
2
+ gap: 1,
3
+ paddingTop: 0,
4
+ paddingX: 3,
5
+ paddingBottom: 2
6
+ };
7
+
8
+ export { dialogActions };
9
+ //# sourceMappingURL=mixins.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixins.esm.js","sources":["../../../src/components/common/mixins.ts"],"sourcesContent":["import { SxProps, Theme } from '@mui/material/styles';\n\nexport const dialogActions: SxProps<Theme> = {\n gap: 1,\n paddingTop: 0,\n paddingX: 3,\n paddingBottom: 2,\n};\n"],"names":[],"mappings":"AAEO,MAAM,aAAgC,GAAA;AAAA,EAC3C,GAAK,EAAA,CAAA;AAAA,EACL,UAAY,EAAA,CAAA;AAAA,EACZ,QAAU,EAAA,CAAA;AAAA,EACV,aAAe,EAAA,CAAA;AACjB;;;;"}
@@ -0,0 +1,59 @@
1
+ const heading1 = {
2
+ fontSize: "2rem",
3
+ fontWeight: 700
4
+ };
5
+ const heading2 = {
6
+ fontSize: "1.75rem",
7
+ fontWeight: 500
8
+ };
9
+ const heading3 = {
10
+ fontSize: "1.25rem",
11
+ fontWeight: 500
12
+ };
13
+ const body1 = {
14
+ fontSize: "1rem",
15
+ fontWeight: 500
16
+ };
17
+ const body2 = {
18
+ fontSize: "1rem",
19
+ fontWeight: 400,
20
+ whiteSpace: "pre-line"
21
+ };
22
+ const label = {
23
+ fontSize: "0.875rem",
24
+ fontWeight: 700,
25
+ textTransform: "uppercase",
26
+ paddingBottom: "0.4rem"
27
+ };
28
+ const label2 = {
29
+ fontSize: "0.875rem",
30
+ fontWeight: 700,
31
+ textTransform: "uppercase"
32
+ };
33
+ const formLabel = {
34
+ fontSize: "0.875rem",
35
+ fontWeight: 700,
36
+ textTransform: "uppercase",
37
+ color: "inherit"
38
+ };
39
+ const formHelperText = {
40
+ fontSize: "0.875rem",
41
+ fontWeight: 400,
42
+ color: "inherit",
43
+ margin: 0
44
+ };
45
+ const emptyState = {
46
+ fontSize: "1rem",
47
+ fontStyle: "italic"
48
+ };
49
+ const subtitle1 = {
50
+ fontSize: "1rem",
51
+ fontWeight: 700
52
+ };
53
+ const subtitle2 = {
54
+ fontSize: "1rem",
55
+ fontWeight: 400
56
+ };
57
+
58
+ export { body1, body2, emptyState, formHelperText, formLabel, heading1, heading2, heading3, label, label2, subtitle1, subtitle2 };
59
+ //# sourceMappingURL=typography.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.esm.js","sources":["../../../src/components/common/typography.ts"],"sourcesContent":["import { SxProps, Theme } from '@mui/material/styles';\n\nexport const heading1: SxProps<Theme> = {\n fontSize: '2rem',\n fontWeight: 700,\n};\n\nexport const heading2: SxProps<Theme> = {\n fontSize: '1.75rem',\n fontWeight: 500,\n};\n\nexport const heading3: SxProps<Theme> = {\n fontSize: '1.25rem',\n fontWeight: 500,\n};\n\nexport const body1: SxProps<Theme> = {\n fontSize: '1rem',\n fontWeight: 500,\n};\n\nexport const body2: SxProps<Theme> = {\n fontSize: '1rem',\n fontWeight: 400,\n whiteSpace: 'pre-line',\n};\n\nexport const label: SxProps<Theme> = {\n fontSize: '0.875rem',\n fontWeight: 700,\n textTransform: 'uppercase',\n paddingBottom: '0.4rem',\n};\n\nexport const label2: SxProps<Theme> = {\n fontSize: '0.875rem',\n fontWeight: 700,\n textTransform: 'uppercase',\n};\n\nexport const formLabel: SxProps<Theme> = {\n fontSize: '0.875rem',\n fontWeight: 700,\n textTransform: 'uppercase',\n color: 'inherit',\n};\n\nexport const formHelperText: SxProps<Theme> = {\n fontSize: '0.875rem',\n fontWeight: 400,\n color: 'inherit',\n margin: 0,\n};\n\nexport const emptyState: SxProps<Theme> = {\n fontSize: '1rem',\n fontStyle: 'italic',\n};\n\nexport const subtitle1: SxProps<Theme> = {\n fontSize: '1rem',\n fontWeight: 700,\n};\n\nexport const subtitle2: SxProps<Theme> = {\n fontSize: '1rem',\n fontWeight: 400,\n};\n\nexport const headerSubtitle: SxProps<Theme> = {\n fontSize: '1rem',\n fontWeight: 500,\n paddingBottom: '1rem',\n marginTop: '-0.2rem',\n};\n"],"names":[],"mappings":"AAEO,MAAM,QAA2B,GAAA;AAAA,EACtC,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd,EAAA;AAEO,MAAM,QAA2B,GAAA;AAAA,EACtC,QAAU,EAAA,SAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd,EAAA;AAEO,MAAM,QAA2B,GAAA;AAAA,EACtC,QAAU,EAAA,SAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd,EAAA;AAEO,MAAM,KAAwB,GAAA;AAAA,EACnC,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd,EAAA;AAEO,MAAM,KAAwB,GAAA;AAAA,EACnC,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,UAAY,EAAA,UAAA;AACd,EAAA;AAEO,MAAM,KAAwB,GAAA;AAAA,EACnC,QAAU,EAAA,UAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,aAAe,EAAA,WAAA;AAAA,EACf,aAAe,EAAA,QAAA;AACjB,EAAA;AAEO,MAAM,MAAyB,GAAA;AAAA,EACpC,QAAU,EAAA,UAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,aAAe,EAAA,WAAA;AACjB,EAAA;AAEO,MAAM,SAA4B,GAAA;AAAA,EACvC,QAAU,EAAA,UAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,aAAe,EAAA,WAAA;AAAA,EACf,KAAO,EAAA,SAAA;AACT,EAAA;AAEO,MAAM,cAAiC,GAAA;AAAA,EAC5C,QAAU,EAAA,UAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,KAAO,EAAA,SAAA;AAAA,EACP,MAAQ,EAAA,CAAA;AACV,EAAA;AAEO,MAAM,UAA6B,GAAA;AAAA,EACxC,QAAU,EAAA,MAAA;AAAA,EACV,SAAW,EAAA,QAAA;AACb,EAAA;AAEO,MAAM,SAA4B,GAAA;AAAA,EACvC,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd,EAAA;AAEO,MAAM,SAA4B,GAAA;AAAA,EACvC,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AACd;;;;"}
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable.esm.js';
3
+ import CloseIcon from '@mui/icons-material/Close';
4
+ import { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable.esm.js';
5
+ import { heading3 } from '../common/typography.esm.js';
6
+ import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
7
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
8
+ import Box from '@mui/material/Box';
9
+ import Dialog from '@mui/material/Dialog';
10
+ import DialogTitle from '@mui/material/DialogTitle';
11
+ import IconButton from '@mui/material/IconButton';
12
+ import DialogContent from '@mui/material/DialogContent';
13
+ import Typography from '@mui/material/Typography';
14
+ import DialogActions from '@mui/material/DialogActions';
15
+ import Button from '@mui/material/Button';
16
+
17
+ const MatrixDialog = ({
18
+ open,
19
+ close
20
+ }) => {
21
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
22
+ return /* @__PURE__ */ React.createElement(Dialog, { maxWidth: "lg", open, onClose: close }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("scenarioDrawer.riskMatrixModal.title")), /* @__PURE__ */ React.createElement(
23
+ IconButton,
24
+ {
25
+ "aria-label": "close",
26
+ onClick: close,
27
+ sx: {
28
+ position: "absolute",
29
+ right: 8,
30
+ top: 8,
31
+ color: (theme) => theme.palette.grey[500]
32
+ }
33
+ },
34
+ /* @__PURE__ */ React.createElement(CloseIcon, null)
35
+ ), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(
36
+ Typography,
37
+ {
38
+ sx: {
39
+ paddingBottom: "32px"
40
+ }
41
+ },
42
+ t("scenarioStepper.initialRiskStep.subtitle")
43
+ ), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, { sx: { ...heading3, paddingBottom: "4px" } }, t("dictionary.probability"))), /* @__PURE__ */ React.createElement(ProbabilityTableInfoWithHeaders, null), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(
44
+ Typography,
45
+ {
46
+ sx: { ...heading3, paddingTop: "16px", paddingBottom: "4px" }
47
+ },
48
+ t("dictionary.consequence")
49
+ )), /* @__PURE__ */ React.createElement(ConsequenceTableInfoWithHeaders, null)), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: close }, t("dictionary.close"))));
50
+ };
51
+
52
+ export { MatrixDialog };
53
+ //# sourceMappingURL=MatrixDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MatrixDialog.esm.js","sources":["../../../src/components/riScDialog/MatrixDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable';\nimport { heading3 } from '../common/typography';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Box from '@mui/material/Box';\nimport Dialog from '@mui/material/Dialog';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport IconButton from '@mui/material/IconButton';\nimport DialogContent from '@mui/material/DialogContent';\nimport Typography from '@mui/material/Typography';\nimport DialogActions from '@mui/material/DialogActions';\nimport Button from '@mui/material/Button';\n\nexport const MatrixDialog = ({\n open,\n close,\n}: {\n open: boolean;\n close: () => void;\n}) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n return (\n <Dialog maxWidth=\"lg\" open={open} onClose={close}>\n <DialogTitle>{t('scenarioDrawer.riskMatrixModal.title')}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={close}\n sx={{\n position: 'absolute',\n right: 8,\n top: 8,\n color: theme => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n <DialogContent>\n <Typography\n sx={{\n paddingBottom: '32px',\n }}\n >\n {t('scenarioStepper.initialRiskStep.subtitle')}\n </Typography>\n <Box>\n <Typography sx={{ ...heading3, paddingBottom: '4px' }}>\n {t('dictionary.probability')}\n </Typography>\n </Box>\n <ProbabilityTableInfoWithHeaders />\n <Box>\n <Typography\n sx={{ ...heading3, paddingTop: '16px', paddingBottom: '4px' }}\n >\n {t('dictionary.consequence')}\n </Typography>\n </Box>\n <ConsequenceTableInfoWithHeaders />\n </DialogContent>\n <DialogActions>\n <Button onClick={close}>{t('dictionary.close')}</Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgBO,MAAM,eAAe,CAAC;AAAA,EAC3B,IAAA;AAAA,EACA,KAAA;AACF,CAGM,KAAA;AACJ,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,QAAS,EAAA,IAAA,EAAK,IAAY,EAAA,OAAA,EAAS,KACzC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAa,EAAA,IAAA,EAAA,CAAA,CAAE,sCAAsC,CAAE,CACxD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,OAAA;AAAA,MACX,OAAS,EAAA,KAAA;AAAA,MACT,EAAI,EAAA;AAAA,QACF,QAAU,EAAA,UAAA;AAAA,QACV,KAAO,EAAA,CAAA;AAAA,QACP,GAAK,EAAA,CAAA;AAAA,QACL,KAAO,EAAA,CAAA,KAAA,KAAS,KAAM,CAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAAA,OACxC;AAAA,KAAA;AAAA,wCAEC,SAAU,EAAA,IAAA,CAAA;AAAA,GACb,sCACC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,aAAe,EAAA,MAAA;AAAA,OACjB;AAAA,KAAA;AAAA,IAEC,EAAE,0CAA0C,CAAA;AAAA,GAC/C,sCACC,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,EAAI,EAAA,EAAE,GAAG,QAAU,EAAA,aAAA,EAAe,OAC3C,EAAA,EAAA,CAAA,CAAE,wBAAwB,CAC7B,CACF,mBACC,KAAA,CAAA,aAAA,CAAA,+BAAA,EAAA,IAAgC,CACjC,kBAAA,KAAA,CAAA,aAAA,CAAC,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAI,EAAE,GAAG,UAAU,UAAY,EAAA,MAAA,EAAQ,eAAe,KAAM,EAAA;AAAA,KAAA;AAAA,IAE3D,EAAE,wBAAwB,CAAA;AAAA,GAE/B,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,+BAAgC,EAAA,IAAA,CACnC,mBACC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,SAAS,KAAQ,EAAA,EAAA,CAAA,CAAE,kBAAkB,CAAE,CACjD,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,70 @@
1
+ import React from 'react';
2
+ import { emptyRiSc } from '../../utils/utilityfunctions.esm.js';
3
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
4
+ import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
5
+ import { useRiScs } from '../../contexts/RiScContext.esm.js';
6
+ import { useForm } from 'react-hook-form';
7
+ import { Input } from '../common/Input.esm.js';
8
+ import Button from '@mui/material/Button';
9
+ import Dialog from '@mui/material/Dialog';
10
+ import DialogContent from '@mui/material/DialogContent';
11
+ import DialogTitle from '@mui/material/DialogTitle';
12
+ import DialogActions from '@mui/material/DialogActions';
13
+ import { dialogActions } from '../common/mixins.esm.js';
14
+
15
+ var RiScDialogStates = /* @__PURE__ */ ((RiScDialogStates2) => {
16
+ RiScDialogStates2[RiScDialogStates2["Closed"] = 0] = "Closed";
17
+ RiScDialogStates2[RiScDialogStates2["Edit"] = 1] = "Edit";
18
+ RiScDialogStates2[RiScDialogStates2["Create"] = 2] = "Create";
19
+ return RiScDialogStates2;
20
+ })(RiScDialogStates || {});
21
+ const RiScDialog = ({ onClose, dialogState }) => {
22
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
23
+ const { selectedRiSc, createNewRiSc, updateRiSc } = useRiScs();
24
+ const {
25
+ register,
26
+ handleSubmit,
27
+ formState: { isDirty, errors }
28
+ } = useForm({
29
+ defaultValues: dialogState === 1 /* Edit */ ? selectedRiSc.content : emptyRiSc(),
30
+ mode: "onBlur"
31
+ });
32
+ const titleTranslation = dialogState === 2 /* Create */ ? t("rosDialog.titleNew") : t("rosDialog.titleEdit");
33
+ const onSubmit = handleSubmit((data) => {
34
+ if (dialogState === 2 /* Create */) {
35
+ createNewRiSc(data);
36
+ } else {
37
+ updateRiSc(data);
38
+ }
39
+ onClose();
40
+ });
41
+ return /* @__PURE__ */ React.createElement(Dialog, { open: dialogState !== 0 /* Closed */, onClose }, /* @__PURE__ */ React.createElement(DialogTitle, null, titleTranslation), /* @__PURE__ */ React.createElement(
42
+ DialogContent,
43
+ {
44
+ sx: { display: "flex", flexDirection: "column", gap: "16px" }
45
+ },
46
+ /* @__PURE__ */ React.createElement(
47
+ Input,
48
+ {
49
+ required: true,
50
+ ...register("title", { required: true }),
51
+ error: errors.title !== void 0,
52
+ label: t("dictionary.title")
53
+ }
54
+ ),
55
+ /* @__PURE__ */ React.createElement(
56
+ Input,
57
+ {
58
+ required: true,
59
+ ...register("scope", { required: true }),
60
+ label: t("dictionary.scope"),
61
+ sublabel: t("rosDialog.scopeDescription"),
62
+ error: errors.scope !== void 0,
63
+ minRows: 4
64
+ }
65
+ )
66
+ ), /* @__PURE__ */ React.createElement(DialogActions, { sx: dialogActions }, /* @__PURE__ */ React.createElement(Button, { variant: "contained", onClick: onSubmit, disabled: !isDirty }, t("dictionary.save")), /* @__PURE__ */ React.createElement(Button, { variant: "outlined", onClick: onClose }, t("dictionary.cancel"))));
67
+ };
68
+
69
+ export { RiScDialog, RiScDialogStates };
70
+ //# sourceMappingURL=RiScDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiScDialog.esm.js","sources":["../../../src/components/riScDialog/RiScDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { RiSc } from '../../utils/types';\nimport { emptyRiSc } from '../../utils/utilityfunctions';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useRiScs } from '../../contexts/RiScContext';\nimport { useForm } from 'react-hook-form';\nimport { Input } from '../common/Input';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogActions from '@mui/material/DialogActions';\nimport { dialogActions } from '../common/mixins';\n\nexport enum RiScDialogStates {\n Closed,\n Edit,\n Create,\n}\n\ninterface RiScDialogProps {\n onClose: () => void;\n dialogState: RiScDialogStates;\n}\n\nexport const RiScDialog = ({ onClose, dialogState }: RiScDialogProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const { selectedRiSc, createNewRiSc, updateRiSc } = useRiScs();\n\n const {\n register,\n handleSubmit,\n formState: { isDirty, errors },\n } = useForm<RiSc>({\n defaultValues:\n dialogState === RiScDialogStates.Edit\n ? selectedRiSc!.content\n : emptyRiSc(),\n mode: 'onBlur',\n });\n\n const titleTranslation =\n dialogState === RiScDialogStates.Create\n ? t('rosDialog.titleNew')\n : t('rosDialog.titleEdit');\n\n const onSubmit = handleSubmit((data: RiSc) => {\n if (dialogState === RiScDialogStates.Create) {\n createNewRiSc(data);\n } else {\n updateRiSc(data);\n }\n onClose();\n });\n\n return (\n <Dialog open={dialogState !== RiScDialogStates.Closed} onClose={onClose}>\n <DialogTitle>{titleTranslation}</DialogTitle>\n\n <DialogContent\n sx={{ display: 'flex', flexDirection: 'column', gap: '16px' }}\n >\n <Input\n required\n {...register('title', { required: true })}\n error={errors.title !== undefined}\n label={t('dictionary.title')}\n />\n <Input\n required\n {...register('scope', { required: true })}\n label={t('dictionary.scope')}\n sublabel={t('rosDialog.scopeDescription')}\n error={errors.scope !== undefined}\n minRows={4}\n />\n </DialogContent>\n\n <DialogActions sx={dialogActions}>\n <Button variant=\"contained\" onClick={onSubmit} disabled={!isDirty}>\n {t('dictionary.save')}\n </Button>\n <Button variant=\"outlined\" onClick={onClose}>\n {t('dictionary.cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":["RiScDialogStates"],"mappings":"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"}
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { Grid, Box, Typography } from '@material-ui/core';
3
+ import { RiScStatusComponent } from './riScStatus/RiScStatusComponent.esm.js';
4
+ import { InfoCard } from '@backstage/core-components';
5
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
+ import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
7
+ import { useFontStyles } from '../../utils/style.esm.js';
8
+ import EditButton from '../common/EditButton.esm.js';
9
+ import { useRiScs } from '../../contexts/RiScContext.esm.js';
10
+
11
+ const RiScInfo = ({ riSc, edit }) => {
12
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
13
+ const { label, body2 } = useFontStyles();
14
+ const { approveRiSc } = useRiScs();
15
+ return /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(
16
+ Grid,
17
+ {
18
+ item: true,
19
+ xs: 12,
20
+ sm: 6,
21
+ md: 6,
22
+ style: {
23
+ display: "flex",
24
+ flexDirection: "column"
25
+ }
26
+ },
27
+ /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
28
+ Box,
29
+ {
30
+ style: {
31
+ display: "flex",
32
+ alignItems: "center",
33
+ justifyContent: "space-between"
34
+ }
35
+ },
36
+ /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, riSc.content.title),
37
+ /* @__PURE__ */ React.createElement(EditButton, { onClick: edit })
38
+ ), /* @__PURE__ */ React.createElement(Typography, { className: label }, t("dictionary.scope")), /* @__PURE__ */ React.createElement(Typography, { className: body2 }, riSc.content.scope))
39
+ ), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, sm: 6, md: 6 }, /* @__PURE__ */ React.createElement(RiScStatusComponent, { selectedRiSc: riSc, publishRiScFn: approveRiSc })));
40
+ };
41
+
42
+ export { RiScInfo };
43
+ //# sourceMappingURL=RiScInfo.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiScInfo.esm.js","sources":["../../../src/components/riScInfo/RiScInfo.tsx"],"sourcesContent":["import React from 'react';\nimport { RiScWithMetadata } from '../../utils/types';\nimport { Box, Grid, Typography } from '@material-ui/core';\nimport { RiScStatusComponent } from './riScStatus/RiScStatusComponent';\nimport { InfoCard } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useFontStyles } from '../../utils/style';\nimport EditButton from '../common/EditButton';\nimport { useRiScs } from '../../contexts/RiScContext';\n\ninterface RiScInfoProps {\n riSc: RiScWithMetadata;\n edit: () => void;\n}\n\nexport const RiScInfo = ({ riSc, edit }: RiScInfoProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const { label, body2 } = useFontStyles();\n\n const { approveRiSc } = useRiScs();\n\n return (\n <Grid container>\n <Grid\n item\n xs={12}\n sm={6}\n md={6}\n style={{\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <InfoCard>\n <Box\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n <Typography variant=\"h5\">{riSc.content.title}</Typography>\n <EditButton onClick={edit} />\n </Box>\n <Typography className={label}>{t('dictionary.scope')}</Typography>\n <Typography className={body2}>{riSc.content.scope}</Typography>\n </InfoCard>\n </Grid>\n <Grid item xs={12} sm={6} md={6}>\n <RiScStatusComponent selectedRiSc={riSc} publishRiScFn={approveRiSc} />\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAgBO,MAAM,QAAW,GAAA,CAAC,EAAE,IAAA,EAAM,MAA0B,KAAA;AACzD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AACxD,EAAA,MAAM,EAAE,KAAA,EAAO,KAAM,EAAA,GAAI,aAAc,EAAA,CAAA;AAEvC,EAAM,MAAA,EAAE,WAAY,EAAA,GAAI,QAAS,EAAA,CAAA;AAEjC,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,IAAI,EAAA,IAAA;AAAA,MACJ,EAAI,EAAA,EAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,MACJ,EAAI,EAAA,CAAA;AAAA,MACJ,KAAO,EAAA;AAAA,QACL,OAAS,EAAA,MAAA;AAAA,QACT,aAAe,EAAA,QAAA;AAAA,OACjB;AAAA,KAAA;AAAA,wCAEC,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA;AAAA,UACL,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA,QAAA;AAAA,UACZ,cAAgB,EAAA,eAAA;AAAA,SAClB;AAAA,OAAA;AAAA,0CAEC,UAAW,EAAA,EAAA,OAAA,EAAQ,IAAM,EAAA,EAAA,IAAA,CAAK,QAAQ,KAAM,CAAA;AAAA,sBAC7C,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAS,IAAM,EAAA,CAAA;AAAA,uBAE5B,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,KAAA,EAAA,EAAQ,EAAE,kBAAkB,CAAE,CACrD,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,SAAW,EAAA,KAAA,EAAA,EAAQ,IAAK,CAAA,OAAA,CAAQ,KAAM,CACpD,CAAA;AAAA,qBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IAAI,EAAI,EAAA,CAAA,EAAG,EAAI,EAAA,CAAA,EAAA,sCAC3B,mBAAoB,EAAA,EAAA,YAAA,EAAc,MAAM,aAAe,EAAA,WAAA,EAAa,CACvE,CACF,CAAA,CAAA;AAEJ;;;;"}