@australiangreens/ag-internal-components 0.0.47 → 0.0.51

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 (123) hide show
  1. package/README.md +7 -0
  2. package/dist/DevApp.d.ts +3 -0
  3. package/dist/DevApp.d.ts.map +1 -0
  4. package/dist/DevDemo/DevDemo.d.ts +3 -0
  5. package/dist/DevDemo/DevDemo.d.ts.map +1 -0
  6. package/dist/DevDemo/DomainCodeDemo.d.ts +3 -0
  7. package/dist/DevDemo/DomainCodeDemo.d.ts.map +1 -0
  8. package/dist/DevDemo/ExampleComponentDemo.d.ts +3 -0
  9. package/dist/DevDemo/ExampleComponentDemo.d.ts.map +1 -0
  10. package/dist/DevDemo/NavBarContent.d.ts +3 -0
  11. package/dist/DevDemo/NavBarContent.d.ts.map +1 -0
  12. package/dist/DevDemo/SaladBarDemo.d.ts +3 -0
  13. package/dist/DevDemo/SaladBarDemo.d.ts.map +1 -0
  14. package/dist/DevDemo/SomeRandomDemo.d.ts +3 -0
  15. package/dist/DevDemo/SomeRandomDemo.d.ts.map +1 -0
  16. package/dist/DevDemo/SpecialPageDemo.d.ts +3 -0
  17. package/dist/DevDemo/SpecialPageDemo.d.ts.map +1 -0
  18. package/dist/DevDemo/index.d.ts +2 -0
  19. package/dist/DevDemo/index.d.ts.map +1 -0
  20. package/dist/cjs/index.cjs +1 -1
  21. package/dist/cjs/index.cjs.map +1 -1
  22. package/dist/components/AgDialog/AgDialog.d.ts +24 -0
  23. package/dist/components/AgDialog/AgDialog.d.ts.map +1 -0
  24. package/dist/components/AgDialog/index.d.ts +2 -23
  25. package/dist/components/AgDialog/index.d.ts.map +1 -1
  26. package/dist/components/ExampleComponent/ExampleComponent.comp.test.d.ts +2 -0
  27. package/dist/components/ExampleComponent/ExampleComponent.comp.test.d.ts.map +1 -0
  28. package/dist/components/ExampleComponent/ExampleComponent.d.ts +7 -0
  29. package/dist/components/ExampleComponent/ExampleComponent.d.ts.map +1 -0
  30. package/dist/components/ExampleComponent/ExampleComponent.stories.d.ts +11 -0
  31. package/dist/components/ExampleComponent/ExampleComponent.stories.d.ts.map +1 -0
  32. package/dist/components/ExampleComponent/index.d.ts +2 -5
  33. package/dist/components/ExampleComponent/index.d.ts.map +1 -1
  34. package/dist/components/NavBar/NavBar.comp.test.d.ts +2 -0
  35. package/dist/components/NavBar/NavBar.comp.test.d.ts.map +1 -0
  36. package/dist/components/NavBar/NavBar.d.ts +22 -0
  37. package/dist/components/NavBar/NavBar.d.ts.map +1 -0
  38. package/dist/components/NavBar/NavBarContext.d.ts.map +1 -1
  39. package/dist/components/NavBar/NavBarDarkStyledList.d.ts.map +1 -1
  40. package/dist/components/NavBar/NavBarLightStyledList.d.ts.map +1 -1
  41. package/dist/components/NavBar/index.d.ts +2 -16
  42. package/dist/components/NavBar/index.d.ts.map +1 -1
  43. package/dist/components/NavBar/testWrappers.d.ts.map +1 -1
  44. package/dist/components/index.d.ts.map +1 -1
  45. package/dist/devMain.d.ts +1 -0
  46. package/dist/devMain.d.ts.map +1 -0
  47. package/dist/domainCode/DomainCodeDialog.comp.test.d.ts +2 -0
  48. package/dist/domainCode/DomainCodeDialog.comp.test.d.ts.map +1 -0
  49. package/dist/domainCode/DomainCodeDialog.d.ts.map +1 -1
  50. package/dist/domainCode/hooks.d.ts.map +1 -1
  51. package/dist/domainCode/index.d.ts.map +1 -1
  52. package/dist/errors/ContextError.d.ts.map +1 -1
  53. package/dist/errors/ContextError.unit.test.d.ts +2 -0
  54. package/dist/errors/ContextError.unit.test.d.ts.map +1 -0
  55. package/dist/errors/index.d.ts.map +1 -1
  56. package/dist/esm/index.js +655 -667
  57. package/dist/esm/index.js.map +1 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/layouts/AppLayout/AppLayout.comp.test.d.ts +2 -0
  60. package/dist/layouts/AppLayout/AppLayout.comp.test.d.ts.map +1 -0
  61. package/dist/layouts/AppLayout/AppLayout.d.ts +3 -1
  62. package/dist/layouts/AppLayout/AppLayout.d.ts.map +1 -1
  63. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts +1 -0
  64. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts.map +1 -1
  65. package/dist/layouts/AppLayout/NavBar/NavBar.comp.test.d.ts +2 -0
  66. package/dist/layouts/AppLayout/NavBar/NavBar.comp.test.d.ts.map +1 -0
  67. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts +4 -2
  68. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts.map +1 -1
  69. package/dist/layouts/AppLayout/NavBar/SettingsEtcPlaceholder.d.ts +2 -5
  70. package/dist/layouts/AppLayout/NavBar/SettingsEtcPlaceholder.d.ts.map +1 -1
  71. package/dist/layouts/AppLayout/NavBar/UserInfo.d.ts +9 -2
  72. package/dist/layouts/AppLayout/NavBar/UserInfo.d.ts.map +1 -1
  73. package/dist/layouts/AppLayout/NavBar/index.d.ts.map +1 -1
  74. package/dist/layouts/AppLayout/NavBar/types.d.ts.map +1 -1
  75. package/dist/layouts/AppLayout/PageContainer.d.ts.map +1 -1
  76. package/dist/layouts/AppLayout/TopBar.comp.test.d.ts +2 -0
  77. package/dist/layouts/AppLayout/TopBar.comp.test.d.ts.map +1 -0
  78. package/dist/layouts/AppLayout/TopBar.d.ts +1 -0
  79. package/dist/layouts/AppLayout/TopBar.d.ts.map +1 -1
  80. package/dist/layouts/AppLayout/defaults.d.ts.map +1 -1
  81. package/dist/layouts/AppLayout/index.d.ts.map +1 -1
  82. package/dist/layouts/AppLayout/stateAtoms.d.ts.map +1 -1
  83. package/dist/layouts/PageLayout/PageLayout.comp.test.d.ts +2 -0
  84. package/dist/layouts/PageLayout/PageLayout.comp.test.d.ts.map +1 -0
  85. package/dist/layouts/PageLayout/PageLayout.d.ts +60 -0
  86. package/dist/layouts/PageLayout/PageLayout.d.ts.map +1 -0
  87. package/dist/layouts/PageLayout/SidePanel.comp.test.d.ts +2 -0
  88. package/dist/layouts/PageLayout/SidePanel.comp.test.d.ts.map +1 -0
  89. package/dist/layouts/PageLayout/SidePanel.d.ts.map +1 -1
  90. package/dist/layouts/PageLayout/TopBar.comp.test.d.ts +2 -0
  91. package/dist/layouts/PageLayout/TopBar.comp.test.d.ts.map +1 -0
  92. package/dist/layouts/PageLayout/TopBar.d.ts +1 -0
  93. package/dist/layouts/PageLayout/TopBar.d.ts.map +1 -1
  94. package/dist/layouts/PageLayout/index.d.ts +2 -59
  95. package/dist/layouts/PageLayout/index.d.ts.map +1 -1
  96. package/dist/layouts/index.d.ts.map +1 -1
  97. package/dist/providers/Atom/AtomProvider.d.ts.map +1 -1
  98. package/dist/providers/Atom/index.d.ts.map +1 -1
  99. package/dist/providers/SaladBar/SaladBarContext.d.ts.map +1 -1
  100. package/dist/providers/SaladBar/defaults.d.ts.map +1 -1
  101. package/dist/providers/SaladBar/index.d.ts.map +1 -1
  102. package/dist/providers/SaladBar/testWrappers.d.ts.map +1 -1
  103. package/dist/providers/SaladBar/types.d.ts.map +1 -1
  104. package/dist/providers/SaladBar/useSaladBar.d.ts.map +1 -1
  105. package/dist/providers/index.d.ts.map +1 -1
  106. package/dist/testing/index.d.ts.map +1 -1
  107. package/dist/testing/wrappers.d.ts.map +1 -1
  108. package/dist/themes/fed21Theme.d.ts.map +1 -1
  109. package/dist/themes/index.d.ts.map +1 -1
  110. package/dist/themes/internalAgSystemsTheme.d.ts.map +1 -1
  111. package/dist/themes/types.d.ts.map +1 -1
  112. package/dist/utils/index.d.ts.map +1 -1
  113. package/dist/utils/simpleHashCode.d.ts.map +1 -1
  114. package/package.json +23 -22
  115. package/dist/.gitignore +0 -0
  116. package/dist/components/NavBar/Styling.d.ts +0 -15
  117. package/dist/components/NavBar/Styling.d.ts.map +0 -1
  118. package/dist/layouts/AppLayout/NavBar/Styling.d.ts +0 -18
  119. package/dist/layouts/AppLayout/NavBar/Styling.d.ts.map +0 -1
  120. package/dist/layouts/PageLayout/PageContainer.d.ts +0 -14
  121. package/dist/layouts/PageLayout/PageContainer.d.ts.map +0 -1
  122. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts +0 -19
  123. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts.map +0 -1
package/README.md CHANGED
@@ -25,3 +25,10 @@ If an app needs to customise the theme further via `createTheme()`, either do a
25
25
  with](https://mui.com/material-ui/customization/theming/#createtheme-options-args-theme)
26
26
  with `internalAgSystemsTheme` or just ensure all required properties in the
27
27
  `AgCustomTheme` interface are provided.
28
+
29
+ ## Move to React 18
30
+
31
+ As over v0.0.50 we have moved from React 17 to React 18 (also Node 16 to Node
32
+ 18). This breaks the peer dependency compatibility with some of our older apps.
33
+ They will need be upgraded in the future to use newer versions, but for now can
34
+ only use v0.0.50 of this library.
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function DevApp(): JSX.Element;
3
+ //# sourceMappingURL=DevApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevApp.d.ts","sourceRoot":"","sources":["../src/DevApp.tsx"],"names":[],"mappings":";AAMA,MAAM,CAAC,OAAO,UAAU,MAAM,gBAQ7B"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function DevDemo(): JSX.Element;
3
+ //# sourceMappingURL=DevDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/DevDemo.tsx"],"names":[],"mappings":";AAYA,MAAM,CAAC,OAAO,UAAU,OAAO,gBAuB9B"}
@@ -0,0 +1,3 @@
1
+ declare const DomainCodeDemo: () => JSX.Element;
2
+ export default DomainCodeDemo;
3
+ //# sourceMappingURL=DomainCodeDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainCodeDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/DomainCodeDemo.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,mBAiBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function ExampleComponentDemo(): JSX.Element;
3
+ //# sourceMappingURL=ExampleComponentDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleComponentDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/ExampleComponentDemo.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,OAAO,UAAU,oBAAoB,gBAuI3C"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function NavBarContent(): JSX.Element;
3
+ //# sourceMappingURL=NavBarContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavBarContent.d.ts","sourceRoot":"","sources":["../../src/DevDemo/NavBarContent.tsx"],"names":[],"mappings":";AAeA,MAAM,CAAC,OAAO,UAAU,aAAa,gBA+EpC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function SaladBarDemo(): JSX.Element;
3
+ //# sourceMappingURL=SaladBarDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaladBarDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/SaladBarDemo.tsx"],"names":[],"mappings":";AAMA,MAAM,CAAC,OAAO,UAAU,YAAY,gBA0BnC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function SomeRandomDemo(): JSX.Element;
3
+ //# sourceMappingURL=SomeRandomDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SomeRandomDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/SomeRandomDemo.tsx"],"names":[],"mappings":";AAmBA,MAAM,CAAC,OAAO,UAAU,cAAc,gBA+JrC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export default function SpecialPageDemo(): JSX.Element;
3
+ //# sourceMappingURL=SpecialPageDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecialPageDemo.d.ts","sourceRoot":"","sources":["../../src/DevDemo/SpecialPageDemo.tsx"],"names":[],"mappings":";AA0DA,MAAM,CAAC,OAAO,UAAU,eAAe,gBAgKtC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './DevDemo';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DevDemo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var se=Object.defineProperty,le=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var jt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable;var st=(t,n,o)=>n in t?se(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(t,n)=>{for(var o in n||(n={}))jt.call(n,o)&&st(t,o,n[o]);if(V)for(var o of V(n))At.call(n,o)&&st(t,o,n[o]);return t},w=(t,n)=>le(t,de(n));var Bt=(t,n)=>{var o={};for(var i in t)jt.call(t,i)&&n.indexOf(i)<0&&(o[i]=t[i]);if(t!=null&&V)for(var i of V(t))n.indexOf(i)<0&&At.call(t,i)&&(o[i]=t[i]);return o};var St=(t,n,o)=>(st(t,typeof n!="symbol"?n+"":n,o),o);var X=(t,n,o)=>new Promise((i,s)=>{var d=l=>{try{x(o.next(l))}catch(c){s(c)}},u=l=>{try{x(o.throw(l))}catch(c){s(c)}},x=l=>l.done?i(l.value):Promise.resolve(l.value).then(d,u);x((o=o.apply(t,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),r=require("@mui/material"),ce=require("@mui/material/CssBaseline"),I=require("@mui/material/styles"),ue=require("@mui/material/Drawer"),pe=require("@australiangreens/ag-error"),K=require("souvlaki"),xe=require("@mui/material/List"),he=require("@mui/material/Button"),ge=require("@mui/material/Dialog"),fe=require("@mui/material/DialogActions"),me=require("@mui/material/DialogContent"),ve=require("@mui/material/DialogTitle"),D=require("@mui/icons-material"),f=require("jotai"),Ce=require("jotai/utils"),O=t=>t&&t.__esModule?t:{default:t},we=O(ce),_t=O(ue),Mt=O(xe),bt=O(he),je=O(ge),Ae=O(fe),Be=O(me),Se=O(ve);function be({text:t}){const[n,o]=p.useState(0);return e.jsxs(e.Fragment,{children:[e.jsx(r.Typography,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),e.jsx(r.Typography,{variant:"caption",display:"block",children:e.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),e.jsx(r.Button,{variant:"outlined",onClick:()=>o(i=>i+1),"aria-label":"Increment",children:"Hello I am a button"}),e.jsxs("p",{children:["This is some text: ",e.jsx("span",{children:t})]}),e.jsxs(r.Paper,{children:["This number will incremember when button pressed: ",n]})]})}const ct=330,ut=73,E="Navbar",P={root:`${E}-root`,menuButton:`${E}-menuButton`,hide:`${E}-hide`,content:`${E}-content`,userInfoHolder:`${E}-userInfoHolder`,settings:`${E}-settings`,pieChartIcon:`${E}-pieChartIcon`},Ie=I.styled("div",{name:"NavBar"})(({theme:t})=>({[`&.${P.root}`]:{display:"flex"},[`& .${P.menuButton}`]:{marginRight:36},[`& .${P.hide}`]:{display:"none"},[`& .${P.content}`]:{flexGrow:1,padding:t.spacing(3)},[`& .${P.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),Ht=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),Te=()=>a({width:ct},Ht()),De=()=>a({width:ut},Ht()),ye=I.styled(_t.default,{shouldForwardProp:t=>t!=="open"})(({theme:t,open:n})=>a(a({width:n?ct:ut,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:t.zIndex.drawer+100},n&&{"& .MuiDrawer-paper":Te()}),!n&&{"& .MuiDrawer-paper":De()}));class Z extends pe.AgError{}St(Z,"errorName","ContextError");const Rt=p.createContext(null),Oe={},Le={},Wt=({overrideState:t=Oe,overrideActions:n=Le,children:o})=>{const[{open:i},s]=p.useState({open:!0}),d=p.useCallback(l=>{s({open:l})},[]),u=p.useCallback(()=>{s(l=>w(a({},l),{open:!l.open}))},[]),x=a(a({open:i,setOpen:d,toggleOpen:u},t),n);return e.jsx(Rt.Provider,{value:x,children:o})},qt=()=>{const t=p.useContext(Rt);if(t===null)throw new Z("Error: Tried to useNavBar outside of a <NavBarProvider>");return t},zt=(t={})=>a({open:!0},t),ke=K.createHelper((t=zt(),n={})=>({children:o})=>e.jsx(Wt,{overrideState:t,overrideActions:n,children:o})),It=7,Ee=I.styled(Mt.default)(({theme:t})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${It}px`},"&.Mui-focusVisible":{backgroundColor:t.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:t.palette.primary.main,paddingLeft:`calc(${t.spacing(2)} - ${It}px)`},"&:hover":{backgroundColor:t.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:t.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.dark}}})),Tt=7,Ne=I.styled(Mt.default)(({theme:t})=>({backgroundColor:"#e8e8e8",color:"inherit","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"inherit",padding:`${Tt}px`},"&.Mui-focusVisible":{backgroundColor:t.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:t.palette.primary.main,paddingLeft:`calc(${t.spacing(2)} - ${Tt}px)`},"&:hover":{backgroundColor:t.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:t.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:t.palette.primary.dark}}}));function Pe({"data-testid":t,children:n}){const{open:o}=qt();return e.jsxs(Ie,{className:P.root,"data-testid":t,children:[e.jsx(we.default,{}),e.jsx(ye,{variant:"permanent",anchor:"left",transitionDuration:null,open:o,children:n})]})}const Ut=({isOpen:t,dialogTitle:n,children:o,maxWidth:i,primaryButton:s,secondaryButton:d,onClose:u})=>{var c,C;const[x,l]=p.useState(!1);return e.jsxs(je.default,{open:t,onClose:()=>{x||u()},fullWidth:!0,maxWidth:i!=null?i:"xs",children:[e.jsx(Se.default,{children:n}),e.jsx(Be.default,{sx:{"& > :last-child":{marginBottom:0}},children:o}),e.jsxs(Ae.default,{children:[e.jsx(bt.default,{onClick:(c=d==null?void 0:d.onClick)!=null?c:u,"data-testid":d==null?void 0:d.testId,disabled:(d==null?void 0:d.disabled)||x,color:d==null?void 0:d.buttonColor,children:(C=d==null?void 0:d.text)!=null?C:"Cancel"}),s&&e.jsx(bt.default,{onClick:()=>X(exports,null,function*(){var m;l(!0),yield(m=s.onClick)==null?void 0:m.call(s),l(!1)}),"data-testid":s.testId,disabled:s.disabled||x,color:s==null?void 0:s.buttonColor,children:s.text})]})]})},Fe=24,$e=64,N="TopBar",B={topStripe:`${N}-topStripe`,titleBar:`${N}-titleBar`,titleSlider:`${N}-titleSlider`,titleText:`${N}-titleText`,leftPanelButton:`${N}-leftPanelButton`,rightPanelButton:`${N}-leftPanelButton`},_e=r.styled("div",{shouldForwardProp:t=>!["leftPanel","rightPanel"].includes(t),name:N})(({theme:t,leftPanel:n,rightPanel:o})=>{var i,s;return{width:"100%",[`& .${B.topStripe}`]:{width:"100%",height:`${Fe}px`,backgroundColor:t.palette.primary.main},[`& .${B.titleBar}`]:{backgroundColor:t.palette.primary.light,height:`${$e}px`,padding:t.spacing(0,3),width:"100%"},[`& .${B.titleSlider}`]:a(a({height:"100%",display:"flex",alignItems:"center",color:"white",transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),[`& .${B.leftPanelButton}`]:{marginRight:t.spacing(2),flexGrow:0},[`& .${B.titleText}`]:{flexGrow:1},[`& .${B.rightPanelButton}`]:{flexGrow:0}},(n==null?void 0:n.open)&&{transition:t.transitions.create("margin",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.enteringScreen}),marginLeft:`${(i=n==null?void 0:n.width)!=null?i:0}px`}),(o==null?void 0:o.open)&&{transition:t.transitions.create("margin",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.enteringScreen}),marginRight:`${(s=o==null?void 0:o.width)!=null?s:0}px`})}});function Me({titleText:t="",leftPanel:n,rightPanel:o,"data-testid":i}){return e.jsxs(_e,{leftPanel:n,rightPanel:o,"data-testid":i,children:[e.jsx("div",{className:B.topStripe}),e.jsx("div",{className:B.titleBar,children:e.jsxs(r.Box,{className:B.titleSlider,children:[n!==void 0&&!n.open&&n.showOpenArrow&&e.jsxs(r.IconButton,{className:B.leftPanelButton,color:"inherit","aria-label":"Open left side panel",onClick:n==null?void 0:n.onOpen,edge:"start",size:"large",children:[" ",e.jsx(D.ArrowForward,{})]}),e.jsx(r.Typography,{className:B.titleText,variant:"h6",noWrap:!0,children:t}),o!==void 0&&!o.open&&o.showOpenArrow&&e.jsxs(r.IconButton,{className:B.rightPanelButton,color:"inherit","aria-label":"Open right side panel",onClick:o==null?void 0:o.onOpen,edge:"end",size:"large",children:[" ",e.jsx(D.ArrowBack,{})]})]})})]})}const Gt=400,He=r.styled(r.Drawer,{shouldForwardProp:t=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(t),name:"SidePanelDrawer"})(({width:t,debugOpacity:n=!1,anchor:o,navBarOpen:i,navBarWidthOpen:s,navBarWidthClosed:d})=>({width:t,"& .MuiDrawer-paper":a(a({position:"absolute",width:t,boxSizing:"border-box",border:"unset",boxShadow:"0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"},n&&{opacity:"50%"}),o==="left"&&a({marginLeft:`${d}px`},i&&{marginLeft:`${s}px`}))})),Re=r.styled(r.Box,{shouldForwardProp:t=>!["anchor"].includes(t)})(({theme:t,anchor:n})=>w(a({display:"flex",alignItems:"center",padding:t.spacing(2)},t.mixins.toolbar),{justifyContent:n==="left"?"space-between":"flex-start",backgroundColor:t.palette.primary.light,height:"88px","&,*":{color:"white"}," .MuiTypography-root":{fontSize:"22px"}," .MuiButtonBase-root":{marginRight:n==="right"?t.spacing(2):0}}));function Dt({children:t,anchor:n="left",open:o,onClose:i=()=>{},titleText:s="",width:d=Gt,showCloseArrow:u=!0,debugOpacity:x=!1,headerBoxProps:l={},onOpened:c,onClosed:C,"data-testid":m,navBarOpen:j=!1,navBarWidthOpen:v=0,navBarWidthClosed:T=0}){return e.jsxs(He,{SlideProps:{onEntered:()=>c==null?void 0:c(),onExited:()=>C==null?void 0:C()},variant:"persistent",anchor:n,open:o,width:d,debugOpacity:x,"data-testid":m,navBarOpen:j,navBarWidthOpen:v,navBarWidthClosed:T,children:[e.jsx(Re,w(a({anchor:n},l),{children:n==="left"?e.jsxs(e.Fragment,{children:[e.jsx(r.Typography,{variant:"h6",color:"inherit",component:"div",children:s}),u&&e.jsxs(r.IconButton,{onClick:i,size:"large","aria-label":"Close left side panel",children:[e.jsx(D.ArrowBack,{"data-testid":"arrowbackicon"})," "]})]}):e.jsxs(e.Fragment,{children:[u&&e.jsxs(r.IconButton,{onClick:i,size:"large","aria-label":"Close right side panel",children:[e.jsx(D.ArrowForward,{})," "]}),e.jsx(r.Typography,{variant:"h6",color:"inherit",component:"div",children:s})]})})),t]})}const We=r.styled("div",{shouldForwardProp:t=>!["leftPanel","rightPanel"].includes(t),name:"PanelAwareMargins"})(({theme:t,leftPanel:n,rightPanel:o})=>{var i,s;return a(a({transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},(n==null?void 0:n.open)&&{transition:t.transitions.create("margin",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.enteringScreen}),marginLeft:`${(i=n==null?void 0:n.width)!=null?i:0}px`}),(o==null?void 0:o.open)&&{transition:t.transitions.create("margin",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.enteringScreen}),marginRight:`${(s=o==null?void 0:o.width)!=null?s:0}px`})}),qe=r.styled(r.Container,{name:"PageContainer"})(({theme:t})=>({paddingTop:t.spacing(3),paddingBottom:t.spacing(3)})),lt=!1,dt=!1,Q={titleText:"",flavour:"push",width:Gt,arrowButtons:"both",startOpen:!1,open:void 0,onChangeOpen:void 0,content:e.jsx(e.Fragment,{}),onOpened:void 0,onClosed:void 0,dataTestId:void 0};function ze({children:t,titleText:n="",leftPanel:o,rightPanel:i,sidePanelsAreMutuallyExclusive:s=!0,debugOpacity:d=!1,pageContainerProps:u,pageContentDataTestId:x,topBarDataTestId:l,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m}){const[j,v]=p.useState(lt),[T,S]=p.useState(dt),[A,b]=p.useState(lt),[L,$]=p.useState(dt),_=o!==void 0,M=i!==void 0,{titleText:y,content:q,flavour:z,open:H,onChangeOpen:R,width:h,arrowButtons:g,startOpen:F,onOpened:Zt,onClosed:te,dataTestId:ee}=o?a(a({},Q),o):a({},Q),{titleText:ne,content:oe,flavour:mt,open:ot,onChangeOpen:vt,width:rt,arrowButtons:U,startOpen:G,onOpened:re,onClosed:ie,dataTestId:ae}=i?a(a({},Q),i):a({},Q);p.useEffect(()=>{F!==lt&&(v(F),b(F))},[F]),p.useEffect(()=>{G!==dt&&(S(G),$(G))},[G]);const it=H===void 0?j:H,at=ot===void 0?T:ot,Ct=k=>{H===void 0&&(v(k),s&&M&&(k?(S(!1),$(T)):S(L))),R&&R(k)},wt=k=>{ot===void 0&&(S(k),s&&_&&(k?(v(!1),b(j)):v(A))),vt&&vt(k)};return e.jsxs(r.Box,{children:[_&&e.jsx(Dt,{"data-testid":ee,anchor:"left",open:it,onClose:()=>Ct(!1),width:h,titleText:y,debugOpacity:d,showCloseArrow:g==="both"||g==="close",onOpened:Zt,onClosed:te,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m,children:q}),M&&e.jsx(Dt,{"data-testid":ae,anchor:"right",open:at,onClose:()=>wt(!1),width:rt,titleText:ne,debugOpacity:d,showCloseArrow:U==="both"||U==="close",onOpened:re,onClosed:ie,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m,children:oe}),e.jsx(Me,a(a({titleText:n,"data-testid":l},_&&z==="push"?{leftPanel:{open:it,width:h,onOpen:()=>Ct(!0),showOpenArrow:g==="both"||g==="open"}}:{}),M&&mt==="push"?{rightPanel:{open:at,width:rt,onOpen:()=>wt(!0),showOpenArrow:U==="both"||U==="open"}}:{})),e.jsx(We,w(a(a({},z==="push"?{leftPanel:{open:it,width:h}}:{}),mt==="push"?{rightPanel:{open:at,width:rt}}:{}),{children:e.jsx(qe,w(a({"data-testid":x},u),{children:t}))}))]})}const Y="Navbar",W={root:`${Y}-root`,menuButton:`${Y}-menuButton`,hide:`${Y}-hide`,content:`${Y}-content`},Ue=I.styled("div",{name:"NavBar"})(({theme:t})=>({[`&.${W.root}`]:{display:"flex"},[`& .${W.menuButton}`]:{marginRight:36},[`& .${W.hide}`]:{display:"none"},[`& .${W.content}`]:{flexGrow:1,padding:t.spacing(3)}})),Vt=(t,n)=>{var o,i;return{height:`calc(100vh - ${n}px)`,top:n,overflowX:"hidden",overflowY:"hidden",color:"inherit",backgroundColor:(i=(o=t==null?void 0:t.navBar)==null?void 0:o.backgroundColor)!=null?i:"white"}},yt=(t,n,o)=>a({width:n,transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})},Vt(t,o)),Ot=(t,n,o)=>a({width:n,transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden"},Vt(t,o)),Ge=I.styled(_t.default,{shouldForwardProp:t=>!["open","widthOpen","widthClosed","offsetTop"].includes(t)})(({theme:t,open:n,widthOpen:o,widthClosed:i,offsetTop:s})=>a(a({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",display:"flex",flexDirection:"column"},n&&w(a({},yt(t,o,s)),{"& .MuiDrawer-paper":yt(t,o,s)})),!n&&w(a({},Ot(t,i,s)),{"& .MuiDrawer-paper":Ot(t,i,s)})));function Ve({links:t}){return e.jsx("div",{children:"LinksMenu not implemented yet"})}function Lt(t){let n=0;for(let o=0,i=t.length;o<i;o++){const s=t.charCodeAt(o);n=(n<<5)-n+s,n|=0}return n}const J=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],kt=t=>t.split(/\s/).map(n=>n.substring(0,1).toUpperCase()).filter(n=>!!n).slice(0,2).join("").toUpperCase();function Xe({user:t,domainCode:n,open:o}){const i=f.useAtomValue(nt),s=f.useAtomValue(et);return e.jsx(r.Box,{sx:{paddingTop:3},children:e.jsx(r.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:o?e.jsxs(e.Fragment,{children:[e.jsx(r.Box,{sx:{width:`${s*.33}px`,aspectRatio:1,marginBottom:1},children:t!=null&&t.name?e.jsx(r.Avatar,{src:t==null?void 0:t.picture,sx:{width:"100%",height:"100%",bgcolor:J[Math.abs(Lt(t.name))%J.length]},children:kt(t.name)}):e.jsx(r.Avatar,{sx:{width:"100%",height:"100%"}})}),t!=null&&t.name?e.jsx(r.Typography,{children:t.name}):e.jsx(r.Skeleton,{animation:!1,width:"50%"}),n?e.jsx(r.Typography,{children:n.toUpperCase()}):e.jsx(r.Skeleton,{animation:!1,width:"25%"})]}):e.jsx(r.Box,{sx:{width:`${i*.5}px`,aspectRatio:1,marginBottom:1},children:t!=null&&t.name?e.jsx(r.Avatar,{src:t==null?void 0:t.picture,sx:{width:"100%",height:"100%",bgcolor:J[Math.abs(Lt(t.name))%J.length]},children:kt(t.name)}):e.jsx(r.Avatar,{sx:{width:"100%",height:"100%"}})})})})}function Qe({navBarOpen:t}){const[n,o]=p.useState(!1);return e.jsxs(r.List,{children:[e.jsxs(r.ListItemButton,{onClick:()=>o(i=>!i),children:[e.jsx(r.ListItemIcon,{children:e.jsx(D.Dashboard,{})}),e.jsx(r.ListItemText,{primary:"Switch to ..."}),n&&t?e.jsx(D.ExpandLess,{}):e.jsx(D.ExpandMore,{})]}),e.jsx(r.Collapse,{in:n&&t,timeout:"auto",unmountOnExit:!0,children:e.jsxs(r.List,{component:"div",disablePadding:!0,children:[e.jsx(r.ListItemButton,{sx:{pl:2},children:e.jsx(r.ListItemText,{primary:"1. Something",inset:!0})}),e.jsx(r.ListItemButton,{sx:{pl:2},children:e.jsx(r.ListItemText,{primary:"2. Something else",inset:!0})}),e.jsx(r.ListItemButton,{sx:{pl:2},children:e.jsx(r.ListItemText,{primary:"3. Puppies!",inset:!0})})]})}),e.jsxs(r.ListItemButton,{children:[e.jsx(r.ListItemIcon,{children:e.jsx(D.Settings,{})}),e.jsx(r.ListItemText,{primary:"Settings"})]}),e.jsxs(r.ListItemButton,{children:[e.jsx(r.ListItemIcon,{children:e.jsx(D.Logout,{})}),e.jsx(r.ListItemText,{primary:"Log out"})]})]})}function Ye({open:t,offsetTop:n=0,widthOpen:o,widthClosed:i,"data-testid":s,top:d,middle:u,user:x,domainCode:l}){return e.jsx(Ue,{className:W.root,"data-testid":s,children:e.jsxs(Ge,{variant:"permanent",anchor:"left",open:t,widthOpen:o,widthClosed:i,offsetTop:n,PaperProps:{component:"nav"},children:[d&&e.jsxs(r.Box,{sx:{flex:"0 0 auto"},children:[d,e.jsx(r.Divider,{variant:"middle"})]}),e.jsx(r.Box,{sx:{flex:"1 0 auto"},children:Array.isArray(u)?e.jsx(Ve,{links:u}):u}),e.jsxs(r.Box,{sx:{flex:"0 0 auto"},children:[e.jsx(r.Divider,{variant:"middle"}),e.jsx(Xe,{user:x,domainCode:l,open:t}),e.jsx(Qe,{navBarOpen:t})]})]})})}function Je({children:t,topBarHeight:n}){return e.jsx(r.Box,{sx:{overflow:"auto",height:`calc(100vh - ${n}px)`,scrollbarGutter:"stable",flexGrow:1},children:e.jsx(r.Container,{component:"main",id:"main-content",sx:{paddingTop:3,paddingBottom:3,flexGrow:1},children:t})})}const Ke=64,Ze=64,tn=256,tt=f.atom(!0),et=f.atom(tn),nt=f.atom(Ze),pt=f.atom(""),xt=f.atom(Ke),ht=f.atom(void 0),en="TopBar",nn={titleText:`${en}-titleText`};function on({titleText:t="",height:n,"data-testid":o}){const i=f.useSetAtom(tt),s=()=>i(d=>!d);return e.jsx("header",{"data-testid":o,children:e.jsxs(r.Paper,{square:!0,elevation:0,sx:{width:"100%",position:"sticky",color:"primary.contrastText",backgroundColor:"primary.main",display:"flex",alignItems:"center",gap:2,flexShrink:0,height:n},children:[e.jsx(r.IconButton,{size:"medium",color:"inherit",sx:{padding:1.5},onClick:s,children:e.jsx(D.ViewHeadline,{fontSize:"medium"})}),e.jsx(r.Typography,{className:nn.titleText,variant:"h6",children:t})]})})}function rn({children:t,initialTitleText:n,initialNavBarOpen:o,pageContainerProps:i,pageContentDataTestId:s,topBarDataTestId:d,navBarDataTestId:u,navBarMiddle:x,user:l,domainCode:c}){const[C,m]=f.useAtom(tt),[j]=f.useAtom(et),[v]=f.useAtom(nt),[T,S]=f.useAtom(pt),[A]=f.useAtom(xt),[b]=f.useAtom(ht);return p.useEffect(()=>{n!==void 0&&S(n)},[n,S]),p.useEffect(()=>{o!==void 0&&m(o)},[o,m]),e.jsxs(r.Box,{children:[e.jsx(r.CssBaseline,{}),e.jsx(on,{titleText:T,"data-testid":d,height:A}),e.jsxs(r.Box,{sx:{display:"flex"},children:[e.jsx(Ye,{open:C,top:b,middle:x,user:l,domainCode:c,widthOpen:j,widthClosed:v,offsetTop:A,"data-testid":u}),e.jsx(Je,w(a({"data-testid":s,topBarHeight:A},i),{children:t}))]})]})}const an={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},sn={shouldClose:(t,n)=>n!=="clickaway"},Et={message:"",severity:"info",variant:"standard",progressIndicator:void 0},Nt=100,Pt=2e3,ln=2e3,dn=(()=>{let t=0;return()=>(t+=1,t)})(),cn={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},un={},pn={},gt=p.createContext(null);function Xt(d){var u=d,{overrideState:t=un,overrideActions:n=pn,shouldClose:o=sn.shouldClose,children:i}=u,s=Bt(u,["overrideState","overrideActions","shouldClose","children"]);var R;const[{open:x},l]=p.useState({open:!1}),c=p.useRef([]),C=p.useRef(Date.now()),m=p.useRef(0),j=p.useCallback(h=>{l({open:h})},[]),v=p.useCallback((h={})=>{m.current+=1,c.current.length>=Nt&&Date.now()-C.current>=Pt&&(C.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${Nt}) hit ${m.current} times in last ${Pt}ms)`),m.current=0);const g=a(w(a({},Et),{key:dn()}),h);return c.current.push(g),c.current.length===1&&l({open:!0}),g.key},[]),T=(h="",g={})=>v(a({message:h,severity:"success"},g)),S=(h="",g={})=>v(a({message:h,severity:"info"},g)),A=(h="",g={})=>v(a({message:h,severity:"warning"},g)),b=(h="",g={})=>v(a({message:h,severity:"error"},g)),L=h=>{const g=c.current.findIndex(F=>F.key===h);if(g!==-1)return g===0?(l({open:!1}),c.current[0]):c.current.splice(g,1)},$=(h,g)=>{o(h,g)&&l({open:!1})},_=()=>{},M=()=>{c.current.shift(),c.current.length>0&&l({open:!0})},y=(R=c.current[0])!=null?R:a({},Et),q={};"autoHideDuration"in y&&(q.autoHideDuration=y.autoHideDuration);const z=a(a({},an),s),H=a(a({open:x,setOpen:j,enqueueNotification:v,enqueueSuccessNotification:T,enqueueInfoNotification:S,enqueueWarningNotification:A,enqueueErrorNotification:b,removeNotification:L},t),n);return e.jsxs(gt.Provider,{value:H,children:[i,e.jsx(r.Snackbar,w(a(a({},z),q),{open:x,onClose:$,TransitionProps:{onExited:M,onExit:_},sx:{zIndex:ln},children:e.jsxs("div",{children:[e.jsx(r.Alert,{onClose:h=>$(h,"closeAlert"),severity:y.severity,variant:"filled",icon:y.progressIndicator==="circular"?e.jsx(r.CircularProgress,{size:"1em"}):void 0,style:y.progressIndicator==="linear"?cn:void 0,children:y.message}),y.progressIndicator==="linear"&&e.jsx(r.LinearProgress,{color:"primary"})]})}))]})}function Qt(){const t=p.useContext(gt);if(t===null)throw new Z("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return t}const xn=K.createHelper((t={autoHideDuration:1},n={},o={})=>({children:i})=>e.jsx(Xt,w(a({},t),{overrideState:n,overrideActions:o,children:i}))),Yt=f.getDefaultStore(),hn=({children:t,store:n})=>e.jsx(f.Provider,{store:n!=null?n:Yt,children:t}),Jt="domainCode";var $t;const Ft=f.atom(JSON.parse(($t=localStorage.getItem(Jt))!=null?$t:'{"domainCode": ""}').domainCode),ft=f.atom(t=>t(Ft),(t,n,o)=>{n(Ft,o),localStorage.setItem(Jt,JSON.stringify({domainCode:o}))}),gn={act:"ACT",nsw:"NSW",nt:"NT",qld:"QLD",sa:"SA",tas:"TAS",vic:"VIC",wa:"WA",ag:"AG",fedmps:"Fedmps","":""},fn=t=>{var n;return t===null?"N/A":(n=gn[t])!=null?n:""},mn=({isLoading:t,isOpen:n,onClose:o,domainOptions:i,applicationName:s,handleLogout:d})=>{const[u,x]=f.useAtom(ft),[l,c]=p.useState(u),{enqueueSuccessNotification:C}=Qt(),m=i.length===0,j=!!u&&!i.includes(u)&&!i.includes(l),v=!u||m||j,T=()=>X(exports,null,function*(){l?(x(l),C(`Set domain to ${l}`),o()):x("")}),S=()=>X(exports,null,function*(){u&&!m&&!j?(c(u),o()):v&&d()});let A;return m?A="Unable to retrieve your active organisations. Try logging in again.":j&&(A="You no longer have any roles in your chosen organisation. Please choose another."),e.jsxs(Ut,{isOpen:n,dialogTitle:"Select an organisation",primaryButton:{text:"Confirm",onClick:T,disabled:!l||m||j,buttonColor:"primary"},secondaryButton:{text:v?"Logout":"Cancel",onClick:S},onClose:v?()=>{}:o,children:[e.jsxs(r.Typography,{marginBottom:2,children:["Select the default organisation that you want to use with the ",s,"."]}),e.jsx(r.Autocomplete,{loading:t,multiple:!1,disableClearable:!1,value:l!==""?l:null,onChange:(b,L)=>c(L!=null?L:""),getOptionLabel:fn,options:[...i],renderInput:b=>e.jsx(r.TextField,w(a({},b),{variant:"filled",label:"Select organisation",InputProps:w(a({},b.InputProps),{endAdornment:e.jsxs(e.Fragment,{children:[t?e.jsx(r.CircularProgress,{color:"inherit",size:20,sx:{marginTop:"-20px"}}):null,b.InputProps.endAdornment]})})}))}),A&&e.jsx(r.FormHelperText,{error:!0,children:A})]})},vn=I.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}}),Cn=I.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:t})=>({"&.Mui-selected":{backgroundColor:I.alpha(t.palette.secondary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:I.alpha(t.palette.secondary.main,t.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:I.alpha(t.palette.secondary.main,t.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}},navBar:{backgroundColor:"#E8E8E8"}}),wn={domainCode:ft,navBarOpen:tt,navBarWidthOpen:et,navBarWidthClosed:nt,titleText:pt,topBarHeight:xt,navBarTop:ht},jn=K.createHelper(()=>({children:t})=>e.jsx(f.Provider,{children:t})),Kt=({initialValues:t,children:n})=>(Ce.useHydrateAtoms(t),e.jsx(e.Fragment,{children:n})),An=K.createHelper(t=>({children:n})=>e.jsx(Kt,{initialValues:Object.entries(t).map(([o,i])=>[wn[o],i]),children:n}));exports.AgDialog=Ut;exports.AppLayout=rn;exports.AtomProvider=hn;exports.Context=gt;exports.ContextError=Z;exports.DomainCodeDialog=mn;exports.ExampleComponent=be;exports.HydrateAtoms=Kt;exports.NAVBAR_WIDTH_CLOSED=ut;exports.NAVBAR_WIDTH_OPENED=ct;exports.NavBar=Pe;exports.NavBarDarkStyledList=Ee;exports.NavBarLightStyledList=Ne;exports.NavBarProvider=Wt;exports.PageLayout=ze;exports.SaladBarProvider=Xt;exports.atomStore=Yt;exports.buildNavBarState=zt;exports.domainCodeAtom=ft;exports.fed21Theme=vn;exports.internalAgSystemsTheme=Cn;exports.navBarClasses=P;exports.navBarOpenAtom=tt;exports.navBarTopAtom=ht;exports.navBarWidthClosedAtom=nt;exports.navBarWidthOpenAtom=et;exports.titleTextAtom=pt;exports.topBarHeightAtom=xt;exports.useNavBar=qt;exports.useSaladBar=Qt;exports.withAtomProvider=jn;exports.withNavBarProvider=ke;exports.withOverrideDefaults=An;exports.withSaladBarProvider=xn;
1
+ "use strict";var st=Object.defineProperty,lt=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var re=(e,t,o)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))he.call(t,o)&&re(e,o,t[o]);if(X)for(var o of X(t))fe.call(t,o)&&re(e,o,t[o]);return e},w=(e,t)=>lt(e,dt(t));var me=(e,t)=>{var o={};for(var r in e)he.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&X)for(var r of X(e))t.indexOf(r)<0&&fe.call(e,r)&&(o[r]=e[r]);return o};var ve=(e,t,o)=>(re(e,typeof t!="symbol"?t+"":t,o),o);var Q=(e,t,o)=>new Promise((r,s)=>{var d=l=>{try{p(o.next(l))}catch(c){s(c)}},u=l=>{try{p(o.throw(l))}catch(c){s(c)}},p=l=>l.done?r(l.value):Promise.resolve(l.value).then(d,u);p((o=o.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),a=require("@mui/material"),ct=require("@mui/material/CssBaseline"),j=require("@mui/material/styles"),ut=require("@mui/material/Drawer"),Ee=require("errors"),Z=require("souvlaki"),pt=require("@mui/material/List"),gt=require("@mui/material/Button"),xt=require("@mui/material/Dialog"),ht=require("@mui/material/DialogActions"),ft=require("@mui/material/DialogContent"),mt=require("@mui/material/DialogTitle"),W=require("@mui/icons-material"),f=require("jotai"),Ce=require("utils"),vt=require("@australiangreens/ag-error"),Ct=require("providers"),At=require("components"),wt=require("jotai/utils"),Bt=require("domainCode"),$=require("layouts"),y=e=>e&&e.__esModule?e:{default:e},bt=y(ct),Ne=y(ut),Fe=y(pt),Ae=y(gt),St=y(xt),jt=y(ht),Tt=y(ft),Dt=y(mt);function Ot({text:e}){const[t,o]=g.useState(0);return n.jsxs(n.Fragment,{children:[n.jsx(a.Typography,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),n.jsx(a.Typography,{variant:"caption",display:"block",children:n.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),n.jsx(a.Button,{variant:"outlined",onClick:()=>o(r=>r+1),"aria-label":"Increment",children:"Hello I am a button"}),n.jsxs("p",{children:["This is some text: ",n.jsx("span",{children:e})]}),n.jsxs(a.Paper,{children:["This number will incremember when button pressed: ",t]})]})}const se=330,le=73,E="Navbar",F={root:`${E}-root`,menuButton:`${E}-menuButton`,hide:`${E}-hide`,content:`${E}-content`,userInfoHolder:`${E}-userInfoHolder`,settings:`${E}-settings`,pieChartIcon:`${E}-pieChartIcon`},It=j.styled("div",{name:"NavBar"})(({theme:e})=>({[`&.${F.root}`]:{display:"flex"},[`& .${F.menuButton}`]:{marginRight:36},[`& .${F.hide}`]:{display:"none"},[`& .${F.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${F.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),Pe=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),yt=()=>i({width:se},Pe()),kt=()=>i({width:le},Pe()),Et=j.styled(Ne.default,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>i(i({width:t?se:le,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":yt()}),!t&&{"& .MuiDrawer-paper":kt()})),$e=g.createContext(null),Nt={},Ft={},_e=({overrideState:e=Nt,overrideActions:t=Ft,children:o})=>{const[{open:r},s]=g.useState({open:!0}),d=g.useCallback(l=>{s({open:l})},[]),u=g.useCallback(()=>{s(l=>w(i({},l),{open:!l.open}))},[]),p=i(i({open:r,setOpen:d,toggleOpen:u},e),t);return n.jsx($e.Provider,{value:p,children:o})},Le=()=>{const e=g.useContext($e);if(e===null)throw new Ee.ContextError("Error: Tried to useNavBar outside of a <NavBarProvider>");return e},Me=(e={})=>i({open:!0},e),Pt=Z.createHelper((e=Me(),t={})=>({children:o})=>n.jsx(_e,{overrideState:e,overrideActions:t,children:o})),we=7,$t=j.styled(Fe.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${we}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${we}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}})),Be=7,_t=j.styled(Fe.default)(({theme:e})=>({backgroundColor:"#e8e8e8",color:"inherit","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"inherit",padding:`${Be}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${Be}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function Lt({"data-testid":e,children:t}){const{open:o}=Le();return n.jsxs(It,{className:F.root,"data-testid":e,children:[n.jsx(bt.default,{}),n.jsx(Et,{variant:"permanent",anchor:"left",transitionDuration:null,open:o,children:t})]})}const Mt=({isOpen:e,dialogTitle:t,children:o,maxWidth:r,primaryButton:s,secondaryButton:d,onClose:u})=>{var c,C;const[p,l]=g.useState(!1);return n.jsxs(St.default,{open:e,onClose:()=>{p||u()},fullWidth:!0,maxWidth:r!=null?r:"xs",children:[n.jsx(Dt.default,{children:t}),n.jsx(Tt.default,{sx:{"& > :last-child":{marginBottom:0}},children:o}),n.jsxs(jt.default,{children:[n.jsx(Ae.default,{onClick:(c=d==null?void 0:d.onClick)!=null?c:u,"data-testid":d==null?void 0:d.testId,disabled:(d==null?void 0:d.disabled)||p,color:d==null?void 0:d.buttonColor,children:(C=d==null?void 0:d.text)!=null?C:"Cancel"}),s&&n.jsx(Ae.default,{onClick:()=>Q(exports,null,function*(){var m;l(!0),yield(m=s.onClick)==null?void 0:m.call(s),l(!1)}),"data-testid":s.testId,disabled:s.disabled||p,color:s==null?void 0:s.buttonColor,children:s.text})]})]})},Ht=24,Rt=64,N="TopBar",b={topStripe:`${N}-topStripe`,titleBar:`${N}-titleBar`,titleSlider:`${N}-titleSlider`,titleText:`${N}-titleText`,leftPanelButton:`${N}-leftPanelButton`,rightPanelButton:`${N}-leftPanelButton`},qt=a.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:N})(({theme:e,leftPanel:t,rightPanel:o})=>{var r,s;return{width:"100%",[`& .${b.topStripe}`]:{width:"100%",height:`${Ht}px`,backgroundColor:e.palette.primary.main},[`& .${b.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${Rt}px`,padding:e.spacing(0,3),width:"100%"},[`& .${b.titleSlider}`]:i(i({height:"100%",display:"flex",alignItems:"center",color:"white",transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),[`& .${b.leftPanelButton}`]:{marginRight:e.spacing(2),flexGrow:0},[`& .${b.titleText}`]:{flexGrow:1},[`& .${b.rightPanelButton}`]:{flexGrow:0}},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(r=t==null?void 0:t.width)!=null?r:0}px`}),(o==null?void 0:o.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(s=o==null?void 0:o.width)!=null?s:0}px`})}});function Wt({titleText:e="",leftPanel:t,rightPanel:o,"data-testid":r}){return n.jsxs(qt,{leftPanel:t,rightPanel:o,"data-testid":r,children:[n.jsx("div",{className:b.topStripe}),n.jsx("div",{className:b.titleBar,children:n.jsxs(a.Box,{className:b.titleSlider,children:[t!==void 0&&!t.open&&t.showOpenArrow&&n.jsxs(a.IconButton,{className:b.leftPanelButton,color:"inherit","aria-label":"Open left side panel",onClick:t==null?void 0:t.onOpen,edge:"start",size:"large",children:[" ",n.jsx(W.ArrowForward,{})]}),n.jsx(a.Typography,{className:b.titleText,variant:"h6",noWrap:!0,children:e}),o!==void 0&&!o.open&&o.showOpenArrow&&n.jsxs(a.IconButton,{className:b.rightPanelButton,color:"inherit","aria-label":"Open right side panel",onClick:o==null?void 0:o.onOpen,edge:"end",size:"large",children:[" ",n.jsx(W.ArrowBack,{})]})]})})]})}const He=400,zt=a.styled(a.Drawer,{shouldForwardProp:e=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(e),name:"SidePanelDrawer"})(({width:e,debugOpacity:t=!1,anchor:o,navBarOpen:r,navBarWidthOpen:s,navBarWidthClosed:d})=>({width:e,"& .MuiDrawer-paper":i(i({position:"absolute",width:e,boxSizing:"border-box",border:"unset",boxShadow:"0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"},t&&{opacity:"50%"}),o==="left"&&i({marginLeft:`${d}px`},r&&{marginLeft:`${s}px`}))})),Ut=a.styled(a.Box,{shouldForwardProp:e=>!["anchor"].includes(e)})(({theme:e,anchor:t})=>w(i({display:"flex",alignItems:"center",padding:e.spacing(2)},e.mixins.toolbar),{justifyContent:t==="left"?"space-between":"flex-start",backgroundColor:e.palette.primary.light,height:"88px","&,*":{color:"white"}," .MuiTypography-root":{fontSize:"22px"}," .MuiButtonBase-root":{marginRight:t==="right"?e.spacing(2):0}}));function be({children:e,anchor:t="left",open:o,onClose:r=()=>{},titleText:s="",width:d=He,showCloseArrow:u=!0,debugOpacity:p=!1,headerBoxProps:l={},onOpened:c,onClosed:C,"data-testid":m,navBarOpen:A=!1,navBarWidthOpen:v=0,navBarWidthClosed:T=0}){return n.jsxs(zt,{SlideProps:{onEntered:()=>c==null?void 0:c(),onExited:()=>C==null?void 0:C()},variant:"persistent",anchor:t,open:o,width:d,debugOpacity:p,"data-testid":m,navBarOpen:A,navBarWidthOpen:v,navBarWidthClosed:T,children:[n.jsx(Ut,w(i({anchor:t},l),{children:t==="left"?n.jsxs(n.Fragment,{children:[n.jsx(a.Typography,{variant:"h6",color:"inherit",component:"div",children:s}),u&&n.jsxs(a.IconButton,{onClick:r,size:"large","aria-label":"Close left side panel",children:[n.jsx(W.ArrowBack,{"data-testid":"arrowbackicon"})," "]})]}):n.jsxs(n.Fragment,{children:[u&&n.jsxs(a.IconButton,{onClick:r,size:"large","aria-label":"Close right side panel",children:[n.jsx(W.ArrowForward,{})," "]}),n.jsx(a.Typography,{variant:"h6",color:"inherit",component:"div",children:s})]})})),e]})}const Gt=a.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:"PanelAwareMargins"})(({theme:e,leftPanel:t,rightPanel:o})=>{var r,s;return i(i({transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(r=t==null?void 0:t.width)!=null?r:0}px`}),(o==null?void 0:o.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(s=o==null?void 0:o.width)!=null?s:0}px`})}),Vt=a.styled(a.Container,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),ae=!1,ie=!1,Y={titleText:"",flavour:"push",width:He,arrowButtons:"both",startOpen:!1,open:void 0,onChangeOpen:void 0,content:n.jsx(n.Fragment,{}),onOpened:void 0,onClosed:void 0,dataTestId:void 0};function Xt({children:e,titleText:t="",leftPanel:o,rightPanel:r,sidePanelsAreMutuallyExclusive:s=!0,debugOpacity:d=!1,pageContainerProps:u,pageContentDataTestId:p,topBarDataTestId:l,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m}){const[A,v]=g.useState(ae),[T,D]=g.useState(ie),[S,B]=g.useState(ae),[O,_]=g.useState(ie),L=o!==void 0,M=r!==void 0,{titleText:I,content:z,flavour:U,open:H,onChangeOpen:R,width:x,arrowButtons:h,startOpen:P,onOpened:Ze,onClosed:et,dataTestId:tt}=o?i(i({},Y),o):i({},Y),{titleText:nt,content:ot,flavour:ue,open:ee,onChangeOpen:pe,width:te,arrowButtons:G,startOpen:V,onOpened:rt,onClosed:at,dataTestId:it}=r?i(i({},Y),r):i({},Y);g.useEffect(()=>{P!==ae&&(v(P),B(P))},[P]),g.useEffect(()=>{V!==ie&&(D(V),_(V))},[V]);const ne=H===void 0?A:H,oe=ee===void 0?T:ee,ge=k=>{H===void 0&&(v(k),s&&M&&(k?(D(!1),_(T)):D(O))),R&&R(k)},xe=k=>{ee===void 0&&(D(k),s&&L&&(k?(v(!1),B(A)):v(S))),pe&&pe(k)};return n.jsxs(a.Box,{children:[L&&n.jsx(be,{"data-testid":tt,anchor:"left",open:ne,onClose:()=>ge(!1),width:x,titleText:I,debugOpacity:d,showCloseArrow:h==="both"||h==="close",onOpened:Ze,onClosed:et,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m,children:z}),M&&n.jsx(be,{"data-testid":it,anchor:"right",open:oe,onClose:()=>xe(!1),width:te,titleText:nt,debugOpacity:d,showCloseArrow:G==="both"||G==="close",onOpened:rt,onClosed:at,navBarOpen:c,navBarWidthOpen:C,navBarWidthClosed:m,children:ot}),n.jsx(Wt,i(i({titleText:t,"data-testid":l},L&&U==="push"?{leftPanel:{open:ne,width:x,onOpen:()=>ge(!0),showOpenArrow:h==="both"||h==="open"}}:{}),M&&ue==="push"?{rightPanel:{open:oe,width:te,onOpen:()=>xe(!0),showOpenArrow:G==="both"||G==="open"}}:{})),n.jsx(Gt,w(i(i({},U==="push"?{leftPanel:{open:ne,width:x}}:{}),ue==="push"?{rightPanel:{open:oe,width:te}}:{}),{children:n.jsx(Vt,w(i({"data-testid":p},u),{children:e}))}))]})}const J="Navbar",q={root:`${J}-root`,menuButton:`${J}-menuButton`,hide:`${J}-hide`,content:`${J}-content`},Qt=j.styled("div",{name:"NavBar"})(({theme:e})=>({[`&.${q.root}`]:{display:"flex"},[`& .${q.menuButton}`]:{marginRight:36},[`& .${q.hide}`]:{display:"none"},[`& .${q.content}`]:{flexGrow:1,padding:e.spacing(3)}})),Re=(e,t)=>{var o,r;return{height:`calc(100vh - ${t}px)`,top:t,overflowX:"hidden",overflowY:"hidden",color:"inherit",backgroundColor:(r=(o=e==null?void 0:e.navBar)==null?void 0:o.backgroundColor)!=null?r:"white"}},Se=(e,t,o)=>i({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},Re(e,o)),je=(e,t,o)=>i({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden"},Re(e,o)),Yt=j.styled(Ne.default,{shouldForwardProp:e=>!["open","widthOpen","widthClosed","offsetTop"].includes(e)})(({theme:e,open:t,widthOpen:o,widthClosed:r,offsetTop:s})=>i(i({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",display:"flex",flexDirection:"column"},t&&w(i({},Se(e,o,s)),{"& .MuiDrawer-paper":Se(e,o,s)})),!t&&w(i({},je(e,r,s)),{"& .MuiDrawer-paper":je(e,r,s)})));function Jt({links:e}){return n.jsx("div",{children:"LinksMenu not implemented yet"})}const K=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],Te=e=>e.split(/\s/).map(t=>t.substring(0,1).toUpperCase()).filter(t=>!!t).slice(0,2).join("").toUpperCase();function Kt({user:e,domainCode:t,open:o,navBarWidthClosed:r,navBarWidthOpen:s}){return n.jsx(a.Box,{sx:{paddingTop:3},children:n.jsx(a.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:o?n.jsxs(n.Fragment,{children:[n.jsx(a.Box,{sx:{width:`${s*.33}px`,aspectRatio:1,marginBottom:1},children:e!=null&&e.name?n.jsx(a.Avatar,{src:e==null?void 0:e.picture,sx:{width:"100%",height:"100%",bgcolor:K[Math.abs(Ce.simpleHashCode(e.name))%K.length]},children:Te(e.name)}):n.jsx(a.Avatar,{sx:{width:"100%",height:"100%"}})}),e!=null&&e.name?n.jsx(a.Typography,{children:e.name}):n.jsx(a.Skeleton,{animation:!1,width:"50%"}),t?n.jsx(a.Typography,{children:t.toUpperCase()}):n.jsx(a.Skeleton,{animation:!1,width:"25%"})]}):n.jsx(a.Box,{sx:{width:`${r*.5}px`,aspectRatio:1,marginBottom:1},children:e!=null&&e.name?n.jsx(a.Avatar,{src:e==null?void 0:e.picture,sx:{width:"100%",height:"100%",bgcolor:K[Math.abs(Ce.simpleHashCode(e.name))%K.length]},children:Te(e.name)}):n.jsx(a.Avatar,{sx:{width:"100%",height:"100%"}})})})})}function Zt({open:e,offsetTop:t=0,widthOpen:o,widthClosed:r,"data-testid":s,top:d,middle:u,bottom:p,user:l,domainCode:c}){return n.jsx(Qt,{className:q.root,"data-testid":s,children:n.jsxs(Yt,{variant:"permanent",anchor:"left",open:e,widthOpen:o,widthClosed:r,offsetTop:t,PaperProps:{component:"nav"},children:[d&&n.jsxs(a.Box,{sx:{flex:"0 0 auto"},children:[d,n.jsx(a.Divider,{variant:"middle"})]}),n.jsx(a.Box,{sx:{flex:"1 0 auto"},children:Array.isArray(u)?n.jsx(Jt,{links:u}):u}),n.jsxs(a.Box,{sx:{flex:"0 0 auto"},children:[n.jsx(a.Divider,{variant:"middle"}),n.jsx(Kt,{user:l,domainCode:c,open:e,navBarWidthClosed:r,navBarWidthOpen:o}),p&&n.jsx(n.Fragment,{children:p})]})]})})}function en({children:e,topBarHeight:t}){return n.jsx(a.Box,{sx:{overflow:"auto",height:`calc(100vh - ${t}px)`,scrollbarGutter:"stable",flexGrow:1},children:n.jsx(a.Container,{component:"main",id:"main-content",sx:{paddingTop:3,paddingBottom:3,flexGrow:1},children:e})})}const tn=64,nn=64,on=256,de=f.atom(!0),qe=f.atom(on),We=f.atom(nn),ze=f.atom(""),Ue=f.atom(tn),Ge=f.atom(void 0),rn="TopBar",an={titleText:`${rn}-titleText`};function sn({titleText:e="",height:t,"data-testid":o}){const r=f.useSetAtom(de),s=()=>r(d=>!d);return n.jsx("header",{"data-testid":o,children:n.jsxs(a.Paper,{square:!0,elevation:0,sx:{width:"100%",position:"sticky",color:"primary.contrastText",backgroundColor:"primary.main",display:"flex",alignItems:"center",gap:2,flexShrink:0,height:t},children:[n.jsx(a.IconButton,{size:"medium",color:"inherit",sx:{padding:1.5},onClick:s,children:n.jsx(W.ViewHeadline,{fontSize:"medium"})}),n.jsx(a.Typography,{className:an.titleText,variant:"h6",children:e})]})})}function ln({children:e,initialTitleText:t,initialNavBarOpen:o,pageContainerProps:r,pageContentDataTestId:s,topBarDataTestId:d,navBarDataTestId:u,navBarMiddle:p,navBarBottom:l,user:c,domainCode:C}){const[m,A]=f.useAtom(de),[v]=f.useAtom(qe),[T]=f.useAtom(We),[D,S]=f.useAtom(ze),[B]=f.useAtom(Ue),[O]=f.useAtom(Ge);return g.useEffect(()=>{t!==void 0&&S(t)},[t,S]),g.useEffect(()=>{o!==void 0&&A(o)},[o,A]),n.jsxs(a.Box,{children:[n.jsx(a.CssBaseline,{}),n.jsx(sn,{titleText:D,"data-testid":d,height:B}),n.jsxs(a.Box,{sx:{display:"flex"},children:[n.jsx(Zt,{open:m,top:O,middle:p,bottom:l,user:c,domainCode:C,widthOpen:v,widthClosed:T,offsetTop:B,"data-testid":u}),n.jsx(en,w(i({"data-testid":s,topBarHeight:B},r),{children:e}))]})]})}const dn={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},cn={shouldClose:(e,t)=>t!=="clickaway"},De={message:"",severity:"info",variant:"standard",progressIndicator:void 0},Oe=100,Ie=2e3,un=2e3,pn=(()=>{let e=0;return()=>(e+=1,e)})(),gn={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},xn={},hn={},ce=g.createContext(null);function Ve(d){var u=d,{overrideState:e=xn,overrideActions:t=hn,shouldClose:o=cn.shouldClose,children:r}=u,s=me(u,["overrideState","overrideActions","shouldClose","children"]);var R;const[{open:p},l]=g.useState({open:!1}),c=g.useRef([]),C=g.useRef(Date.now()),m=g.useRef(0),A=g.useCallback(x=>{l({open:x})},[]),v=g.useCallback((x={})=>{m.current+=1,c.current.length>=Oe&&Date.now()-C.current>=Ie&&(C.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${Oe}) hit ${m.current} times in last ${Ie}ms)`),m.current=0);const h=i(w(i({},De),{key:pn()}),x);return c.current.push(h),c.current.length===1&&l({open:!0}),h.key},[]),T=(x="",h={})=>v(i({message:x,severity:"success"},h)),D=(x="",h={})=>v(i({message:x,severity:"info"},h)),S=(x="",h={})=>v(i({message:x,severity:"warning"},h)),B=(x="",h={})=>v(i({message:x,severity:"error"},h)),O=x=>{const h=c.current.findIndex(P=>P.key===x);if(h!==-1)return h===0?(l({open:!1}),c.current[0]):c.current.splice(h,1)},_=(x,h)=>{o(x,h)&&l({open:!1})},L=()=>{},M=()=>{c.current.shift(),c.current.length>0&&l({open:!0})},I=(R=c.current[0])!=null?R:i({},De),z={};"autoHideDuration"in I&&(z.autoHideDuration=I.autoHideDuration);const U=i(i({},dn),s),H=i(i({open:p,setOpen:A,enqueueNotification:v,enqueueSuccessNotification:T,enqueueInfoNotification:D,enqueueWarningNotification:S,enqueueErrorNotification:B,removeNotification:O},e),t);return n.jsxs(ce.Provider,{value:H,children:[r,n.jsx(a.Snackbar,w(i(i({},U),z),{open:p,onClose:_,TransitionProps:{onExited:M,onExit:L},sx:{zIndex:un},children:n.jsxs("div",{children:[n.jsx(a.Alert,{onClose:x=>_(x,"closeAlert"),severity:I.severity,variant:"filled",icon:I.progressIndicator==="circular"?n.jsx(a.CircularProgress,{size:"1em"}):void 0,style:I.progressIndicator==="linear"?gn:void 0,children:I.message}),I.progressIndicator==="linear"&&n.jsx(a.LinearProgress,{color:"primary"})]})}))]})}function fn(){const e=g.useContext(ce);if(e===null)throw new Ee.ContextError("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return e}const mn=Z.createHelper((e={autoHideDuration:1},t={},o={})=>({children:r})=>n.jsx(Ve,w(i({},e),{overrideState:t,overrideActions:o,children:r}))),Xe=f.getDefaultStore(),vn=({children:e,store:t})=>n.jsx(f.Provider,{store:t!=null?t:Xe,children:e});class Qe extends vt.AgError{}ve(Qe,"errorName","ContextError");const Ye="domainCode";var ke;const ye=f.atom(JSON.parse((ke=localStorage.getItem(Ye))!=null?ke:'{"domainCode": ""}').domainCode),Je=f.atom(e=>e(ye),(e,t,o)=>{t(ye,o),localStorage.setItem(Ye,JSON.stringify({domainCode:o}))}),Cn={act:"ACT",nsw:"NSW",nt:"NT",qld:"QLD",sa:"SA",tas:"TAS",vic:"VIC",wa:"WA",ag:"AG",fedmps:"Fedmps","":""},An=e=>{var t;return e===null?"N/A":(t=Cn[e])!=null?t:""},wn=({isLoading:e,isOpen:t,onClose:o,domainOptions:r,applicationName:s,handleLogout:d})=>{const[u,p]=f.useAtom(Je),[l,c]=g.useState(u),{enqueueSuccessNotification:C}=Ct.useSaladBar(),m=r.length===0,A=!!u&&!r.includes(u)&&!r.includes(l),v=!u||m||A,T=()=>Q(exports,null,function*(){l?(p(l),C(`Set domain to ${l}`),o()):p("")}),D=()=>Q(exports,null,function*(){u&&!m&&!A?(c(u),o()):v&&d()});let S;return m?S="Unable to retrieve your active organisations. Try logging in again.":A&&(S="You no longer have any roles in your chosen organisation. Please choose another."),n.jsxs(At.AgDialog,{isOpen:t,dialogTitle:"Select an organisation",primaryButton:{text:"Confirm",onClick:T,disabled:!l||m||A,buttonColor:"primary"},secondaryButton:{text:v?"Logout":"Cancel",onClick:D},onClose:v?()=>{}:o,children:[n.jsxs(a.Typography,{marginBottom:2,children:["Select the default organisation that you want to use with the ",s,"."]}),n.jsx(a.Autocomplete,{loading:e,multiple:!1,disableClearable:!1,value:l!==""?l:null,onChange:(B,O)=>c(O!=null?O:""),getOptionLabel:An,options:[...r],renderInput:B=>n.jsx(a.TextField,w(i({},B),{variant:"filled",label:"Select organisation",InputProps:w(i({},B.InputProps),{endAdornment:n.jsxs(n.Fragment,{children:[e?n.jsx(a.CircularProgress,{color:"inherit",size:20,sx:{marginTop:"-20px"}}):null,B.InputProps.endAdornment]})})}))}),S&&n.jsx(a.FormHelperText,{error:!0,children:S})]})},Bn=j.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}}),bn=j.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:j.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:j.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:j.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}},navBar:{backgroundColor:"#E8E8E8"}}),Sn={domainCode:Bt.domainCodeAtom,navBarOpen:$.navBarOpenAtom,navBarWidthOpen:$.navBarWidthOpenAtom,navBarWidthClosed:$.navBarWidthClosedAtom,titleText:$.titleTextAtom,topBarHeight:$.topBarHeightAtom,navBarTop:$.navBarTopAtom},jn=Z.createHelper(()=>({children:e})=>n.jsx(f.Provider,{children:e})),Ke=({initialValues:e,children:t})=>(wt.useHydrateAtoms(e),n.jsx(n.Fragment,{children:t})),Tn=Z.createHelper(e=>({children:t})=>n.jsx(Ke,{initialValues:Object.entries(e).map(([o,r])=>[Sn[o],r]),children:t}));exports.AgDialog=Mt;exports.AppLayout=ln;exports.AtomProvider=vn;exports.Context=ce;exports.ContextError=Qe;exports.DomainCodeDialog=wn;exports.ExampleComponent=Ot;exports.HydrateAtoms=Ke;exports.NAVBAR_WIDTH_CLOSED=le;exports.NAVBAR_WIDTH_OPENED=se;exports.NavBar=Lt;exports.NavBarDarkStyledList=$t;exports.NavBarLightStyledList=_t;exports.NavBarProvider=_e;exports.PageLayout=Xt;exports.SaladBarProvider=Ve;exports.atomStore=Xe;exports.buildNavBarState=Me;exports.domainCodeAtom=Je;exports.fed21Theme=Bn;exports.internalAgSystemsTheme=bn;exports.navBarClasses=F;exports.navBarOpenAtom=de;exports.navBarTopAtom=Ge;exports.navBarWidthClosedAtom=We;exports.navBarWidthOpenAtom=qe;exports.titleTextAtom=ze;exports.topBarHeightAtom=Ue;exports.useNavBar=Le;exports.useSaladBar=fn;exports.withAtomProvider=jn;exports.withNavBarProvider=Pt;exports.withOverrideDefaults=Tn;exports.withSaladBarProvider=mn;
2
2
  //# sourceMappingURL=index.cjs.map