@harpercollins/harpercollins-design-system 1.15.1 → 1.16.0

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.
@@ -723,7 +723,7 @@ const XS={prefix:"far",iconName:"user",icon:[448,512,[128100,62144],"f007","M304
723
723
  `;mI('/* http://meyerweb.com/eric/tools/css/reset/\n v2.0 | 20110126\n License: none (public domain)\n*/\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n}\n/* HTML5 display-role reset for older browsers */\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\nsection {\n display: block;\n}\nbody {\n line-height: 1;\n}\nol,\nul {\n list-style: none;\n}\nblockquote,\nq {\n quotes: none;\n}\nblockquote:before,\nblockquote:after,\nq:before,\nq:after {\n content: "";\n content: none;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n');function _I(t){return e.jsx(Qf,{sx:{"--Input-minHeight":"2.6rem","--joy-fontSize-xl4":"2rem"},...t})}mI(':root {\n --color--black: #000000;\n --color--grey-dark: #262626;\n --color--grey: #5c5c5c;\n --color--grey-light: #a8aab7;\n --color--grey-lighter: #f5f5f5;\n --color--grey-lightest: #f3f6fa;\n --color--grey-borders: #d7d7d7;\n --color--grey-line: #e0e0e0;\n --color--grey-hover: #f9f9f9;\n --color--white: #fff;\n\n --color--teal: #007d7e;\n --color--teal-light: #00b0b1;\n --color--teal-tint: #f2fcfc;\n\n --color--red: #d9303e;\n --color--red-dark: #c02330;\n --color--red-light: #f7dbdd;\n --color--red-tint: #ffdddf;\n\n --color--amber: #e9b04d;\n --color--amber-tint: #faecd5;\n --color--orange: #f5a623;\n --color--orange-dark: #eb6f00;\n --color--orange-light: #f2c06f;\n\n --color--green: #29c889;\n --color--green-dark: #1c874c;\n --color--green-light: #afe7d0;\n --color--indigo: #2e1f5e;\n --color--lemon: #ffe60b;\n --color--focus-outline: #fcc726;\n\n --color--danger: var(--color--red);\n --color--danger-light: var(--color--red-light);\n --color--warning: var(--color--orange);\n --color--warning-light: var(--color--orange-light);\n --color--success: var(--color--green);\n\n --color--dark-blue: #192a3c;\n --color--blue-light: #d6e3fa;\n\n --color--debug: #663399;\n --color--debug-light: #663399db;\n --color--debug-very-light: #6633991a;\n\n /* Fonts */\n --font-family--sans-serif: system-ui, -apple-system, BlinkMacSystemFont,\n "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;\n\n --font-family--monospace: source-code-pro, Menlo, Monaco, Consolas,\n "Courier New", monospace;\n\n /* Spacing */\n --spacing--xxxsmall: 0.1rem;\n --spacing--xxsmall: 0.2rem;\n --spacing--xsmall: 0.3rem;\n --spacing--small: 0.5rem;\n --spacing--medium: 1rem;\n --spacing--large: 2rem;\n --spacing--xlarge: 4rem;\n\n /* Font sizes */\n --font-size--xxsmall: 0.6rem;\n --font-size--xsmall: 0.75rem;\n --font-size--small: 0.875rem;\n --font-size--medium: 1rem;\n --font-size--large: 1.25rem;\n --font-size--xlarge: 1.5rem;\n --font-size--xxlarge: 2rem;\n --font-size--xxxlarge: 3rem;\n\n /* Line heights */\n --line-height--small: 1.2rem;\n --line-height--medium: 1.4rem;\n --line-height--large: 1.4rem;\n\n /* Font weights */\n --font-weight--thin: 200;\n --font-weight--light: 300;\n --font-weight--regular: 400;\n --font-weight--medium: 500;\n --font-weight--bold: 700;\n\n /* Border radius */\n --border-radius--small: 0.25rem;\n --border-radius--medium: 0.5rem;\n --border-radius--large: 1rem;\n --border-radius--xlarge: 2rem;\n\n /* Box shadows */\n --box-shadow--medium: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);\n\n /* Breakpoints */\n --breakpoint--small: 480px;\n --breakpoint--medium: 768px;\n --breakpoint--large: 1024px;\n --breakpoint--xlarge: 1200px;\n --breakpoint--xxlarge: 1440px;\n --breakpoint--xxxlarge: 1920px;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n* {\n margin: 0;\n}\n\na {\n color: var(--color--primary);\n text-decoration: none;\n\n &:hover,\n &:focus {\n text-decoration: underline;\n }\n}\n\nbody,\nbutton {\n font-family: var(--font-family--sans-serif);\n font-weight: var(--font-weight--regular);\n font-style: normal;\n}\n\nbody {\n background-color: var(--color--grey-lightest);\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n color: var(--color--grey-dark);\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}\n\nb {\n font-weight: var(--font-weight--bold);\n}\n\n*:focus-visible {\n outline: 3px solid var(--color--focus-outline);\n}\n\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\ntextarea {\n border: 1px solid var(--color--grey-borders);\n border-radius: var(--border-radius--small);\n background-color: var(--color--grey-lighter);\n padding: var(--spacing--medium);\n}\n\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n overflow-wrap: break-word;\n}\n\np {\n font-size: var(--font-size--medium);\n margin-bottom: var(--spacing--medium);\n}\n\nul {\n list-style-type: disc;\n}\n\nol {\n list-style-type: decimal;\n}\n\n#root,\n#__next {\n isolation: isolate;\n}\n\nsmall {\n font-size: 80%;\n color: var(--color--grey);\n}\n');const TI=Yy.footer`
724
724
  flex-shrink: 0;
725
725
  padding: 2rem;
726
- `;function PI({copyright:t,children:n}){return e.jsx(TI,{children:e.jsxs(Vf,{children:[n,e.jsx(_I,{sx:{fontSize:"xs",my:.5,textAlign:"center"},children:t||"Copyright © 2025 HarperCollins Publishers Ltd. All rights\n reserved. HarperCollins Publishers Ltd, Registered in Scotland, Company\n No. 27389 Registered Address: Westerhill Road, Bishopbriggs, Glasgow\n G64 2QT"})]})})}const II=Yy.div`
726
+ `;function PI({copyright:t,children:n}){return e.jsx(TI,{children:e.jsxs(Vf,{children:[n,e.jsx(_I,{sx:{fontSize:"xs",my:.5,textAlign:"center"},children:t||"Copyright © 2025 HarperCollins Publishers Ltd. All rights\n reserved. HarperCollins Publishers Ltd, Registered in Scotland, Company\n No. 27389 Registered Address: 1 Robroyston Gate, Robroyston, Glasgow, G33 1JN"})]})})}const II=Yy.div`
727
727
  display: flex;
728
728
  flex-direction: column;
729
729
  position: absolute;
@@ -1254,5 +1254,5 @@ function WE(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=
1254
1254
  }
1255
1255
  }
1256
1256
  `}
1257
- `;function uR({message:t}){const n="success"===t.level?e.jsx(qS,{icon:Qy}):e.jsx(qS,{icon:lx});return"html"in t?e.jsxs(dR,{level:t.level,noFade:t.noFade,role:"alert","aria-live":"error"===t.level?"assertive":"polite",children:[n,e.jsx("span",{dangerouslySetInnerHTML:{__html:t.html}})]}):e.jsxs(dR,{level:t.level,noFade:t.noFade,role:"alert","aria-live":"error"===t.level?"assertive":"polite",children:[n,t.text]})}const pR="-",fR={style:"currency",currency:"GBP",minimumFractionDigits:0,maximumFractionDigits:0};exports.Accordion=function(t){return e.jsx(rv,{sx:{},...t})},exports.AccordionDetails=function(t){return e.jsx(zd,{...t})},exports.AccordionGroup=function(t){return e.jsx(Ud,{...t})},exports.AccordionLegacy=function({title:n,children:r,open:o=!1}){const[a,i]=t.useState(o),s=t.useRef(null);return t.useEffect((()=>{a&&s.current?s.current.style.maxHeight=`${s.current.scrollHeight}px`:s.current&&(s.current.style.maxHeight="0px")}),[a]),e.jsxs(GS,{children:[e.jsx(KS,{children:e.jsx(dx,{as:"h3",children:e.jsxs(JS,{type:"button","aria-expanded":a,onClick:()=>i(!a),"aria-controls":"accordion-content",role:"button",isOpen:a,children:[n,e.jsx("span",{children:e.jsx(qS,{icon:Xy})})]})})}),e.jsx(US,{ref:s,"aria-labelledby":"accordion-button",isOpen:a,role:"region",children:r})]})},exports.AccordionSummary=function(t){return e.jsx(vu,{...t})},exports.Alert=function(t){return e.jsx(Pu,{...t})},exports.AppBar=function({apps:n,currentApp:r,leftSide:a,rightSide:i,myAccountMenu:l,workspaces:c,workspacesMenu:d,currentWorkspace:u,helpButton:p,mobileMenuPrimary:f,mobileMenuSecondary:m,user:h,logoUrl:g}){const[v,b]=t.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),y=(e,t)=>{b(v?.map((n=>n.id===e?{...n,isOpen:t}:n)))},x=e=>v.find((t=>t.id===e))?.isOpen,w=f?e.jsxs(e.Fragment,{children:[e.jsx(EC,{onClick:()=>y("primary",!0),children:e.jsx(qS,{icon:Uy,size:"md"})}),e.jsx(gC,{open:x("primary"),onClose:()=>{y("primary",!1)},side:"left",disableGutters:!0,size:"lg",showCloseButton:!0,children:e.jsx(Vf,{role:"presentation",onClick:()=>y("primary",!1),onKeyDown:()=>y("primary",!1),children:f})})]}):null,k=Array.isArray(c)&&c.length>0?e.jsx("div",{style:c.length<=1?{pointerEvents:"none"}:void 0,children:e.jsxs(eC,{children:[e.jsx(_C,{size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:u}),e.jsxs(bC,{placement:"bottom-start",children:[e.jsx(vC,{sticky:!0,children:"Workspaces"}),d]})]})}):null,S=e.jsxs(OC,{children:[i,k,p?e.jsx(eC,{children:e.jsx(_C,{size:"sm",href:p.href,component:p.as,"aria-label":p.text,startDecorator:e.jsx(qS,{icon:QS,size:"sm"}),children:p.text||"Help"})}):null,l?e.jsxs(eC,{children:[e.jsx(_C,{size:"sm",startDecorator:e.jsx(qS,{icon:XS,size:"sm"}),children:h?.displayName?h.displayName:"My Account"}),l]}):null]}),C=e.jsxs(Vf,{sx:{display:{xs:"flex",md:"none"}},children:[e.jsx(EC,{onClick:()=>y("secondary",!0),color:"neutral",children:e.jsx(qS,{icon:ex,size:"md"})}),e.jsx(gC,{open:x("secondary"),onClose:()=>{y("secondary",!1)},side:"right",disableGutters:!0,size:"lg",showCloseButton:!0,children:e.jsx(Vf,{role:"presentation",onClick:()=>y("secondary",!1),onKeyDown:()=>y("secondary",!1),children:m})})]}),O=(()=>{const e=qn(Ra);return"production"!==process.env.NODE_ENV&&o.useDebugValue(e),e[s]||e})(),{logoFillColour:D}=O.palette.appbar;return e.jsxs(SC,{children:[e.jsxs(Vf,{sx:{display:"flex",alignItems:"center",gap:"1rem"},children:[e.jsx(Vf,{sx:{display:{xs:"flex",md:"none"}},children:w}),e.jsxs(CC,{href:g||"/",children:[e.jsx(Vf,{sx:{display:{xs:"none",md:"flex"}},children:e.jsx(xC,{fillColour:D})}),e.jsx(Vf,{sx:{display:{xs:"flex",md:"none"}},children:e.jsx(kC,{fillColour:D})})]}),e.jsx(IC,{apps:n,currentApp:r})]}),e.jsxs(Vf,{sx:{display:"flex"},children:[e.jsx(TC,{children:a}),e.jsx(Vf,{sx:{display:{xs:"none",md:"flex"}},children:S}),m&&C]})]})},exports.Autocomplete=function({id:n,options:r,onChange:o,name:a,...i}){const[s,l]=t.useState(i.defaultValue),[c,d]=t.useState(i.defaultValue?.value);return e.jsxs(e.Fragment,{children:[e.jsx(kf,{...i,sx:{"--Input-minHeight":"2.6rem"},id:n,options:r,onChange:(e,t,n)=>{l(t),d(t?t?.value:""),o&&o(e,t,n)},getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,value:s,renderOption:i.renderOption,name:""}),e.jsx(Mp,{name:a,value:c,type:"hidden",sx:{display:"none"}})]})},exports.AutocompleteSelectMultiple=function({defaultValue:n,id:r,name:o,inline:a,onChange:i,SelectedOption:s,helpText:l,...c}){const[d,u]=t.useState((()=>(n||[]).map((e=>{const t=c.options.find((t=>String(t.value)===String(e)));return t?{label:t.label,value:t.value}:null})).filter((e=>null!==e))));return e.jsxs(e.Fragment,{children:[e.jsx(kf,{...c,sx:{"--Input-minHeight":"2.6rem"},multiple:!0,value:d,onChange:(e,t,n)=>{u(t),i&&i(e,t,n)},renderTags:(n,r)=>a?n.map(((n,o)=>t.createElement(pp,{component:"div",...r({index:o}),key:n.label,endDecorator:e.jsx(qS,{size:"sm",icon:ax})},n.label))):null,isOptionEqualToValue:(e,t)=>e.value===t.value,name:""}),l&&e.jsx("small",{children:l}),Array.isArray(d)&&d.map((t=>e.jsx(Mp,{name:o,value:t.value,type:"hidden",sx:{display:"none"}},t.value))),!a&&e.jsx(RC,{children:Array.isArray(d)&&d.length>0?d.map((t=>e.jsxs(Dd,{children:[s?e.jsx(s,{option:t}):t.label,e.jsx(NC,{type:"button",onClick:()=>{u(d.filter((e=>e.value!==t.value)))},children:e.jsx(qS,{icon:rx})})]},t.value))):null})]})},exports.Avatar=function(t){return e.jsx(Mf,{...t})},exports.Badge=function(t){return e.jsx(Lf,{...t})},exports.Box=Vf,exports.Breadcrumb=$C,exports.Button=QC,exports.Card=function(t){return e.jsx(fm,{...t})},exports.CardActions=km,exports.CardContent=_m,exports.CardCover=Em,exports.CardOverflow=zm,exports.Checkbox=function(t){return e.jsx(Km,{...t})},exports.Chip=ZC,exports.ChipIcon=function({icon:t={status:"not_found",label:"Not found",colour:"neutral",icon:void 0,size:"md",spin:!1},chip:n={size:"md"}}){return e.jsx(tO,{title:t?.tooltip,children:e.jsx(ZC,{sx:{"--_Chip-radius":"2rem",gap:"0.5rem",padding:"0.3rem 0.5rem 0.3rem 0.3rem"},size:n.size,color:t.colour,startDecorator:e.jsx(nO,{children:e.jsx(qS,{colour:t.colour,icon:t.icon,spin:t?.spin,size:t.size})}),children:t.label})})},exports.Container=function(t){return e.jsx(Um,{...t})},exports.DatePicker=gI,exports.DateTimeInput=function({id:n="",name:r,defaultValue:o,onChangeValue:a=()=>{},showNowButton:i}){const[s,l]=t.useState(o?(e=>{const t=new Date(e);return{day:String(t.getDate()).padStart(2,"0"),month:String(t.getMonth()+1).padStart(2,"0"),year:String(t.getFullYear()),hours:String(t.getHours()).padStart(2,"0"),minutes:String(t.getMinutes()).padStart(2,"0")}})(o):{day:"",month:"",year:"",hours:"",minutes:""}),c=(e,t)=>n=>{const{value:r}=n.target;(""===r||/^\d+$/.test(r)&&parseInt(r,10)<=t)&&l((t=>{const n={...t,[e]:r},o=yI(n);return a&&a(o),n}))},d=(new Date).getFullYear(),u=yI(s);return e.jsxs(xI,{id:n,children:[e.jsx("input",{type:"hidden",name:r,value:u}),e.jsxs(wI,{className:"day",children:[e.jsx(kI,{htmlFor:`${n}-day`,children:"Day"}),e.jsx(bI,{type:"number",id:`${n}-day`,placeholder:"DD",value:s.day,onChange:c("day",31)})]}),e.jsxs(wI,{className:"month",children:[e.jsx(kI,{htmlFor:`${n}-month`,children:"Month"}),e.jsx(bI,{type:"number",id:`${n}-month`,placeholder:"MM",value:s.month,onChange:c("month",12)})]}),e.jsxs(wI,{className:"year",children:[e.jsx(kI,{htmlFor:`${n}-year`,children:"Year"}),e.jsx(bI,{type:"number",id:`${n}-year`,placeholder:"YYYY",value:s.year,onChange:c("year",d)})]}),e.jsxs(wI,{className:"hours",children:[e.jsx(kI,{htmlFor:`${n}-hours`,children:"Hours"}),e.jsx(bI,{type:"number",id:`${n}-hours`,placeholder:"HH",value:s.hours,onChange:c("hours",23)})]}),e.jsxs(wI,{className:"minutes",children:[e.jsx(kI,{htmlFor:`${n}-minutes`,children:"Minutes"}),e.jsx(bI,{type:"number",id:`${n}-minutes`,placeholder:"MM",value:s.minutes,onChange:c("minutes",59)})]}),i?e.jsxs(QC,{onClick:()=>{const e=(()=>{const e=new Date;return{day:String(e.getDate()).padStart(2,"0"),month:String(e.getMonth()+1).padStart(2,"0"),year:String(e.getFullYear()),hours:String(e.getHours()).padStart(2,"0"),minutes:String(e.getMinutes()).padStart(2,"0")}})();l(e),a&&a(yI(e))},type:"button",kind:"secondary",children:[e.jsx(qS,{icon:ZS}),"Now"]}):null]})},exports.Divider=function(t){return e.jsx(th,{...t})},exports.Drawer=gC,exports.Dropdown=eC,exports.FormControl=function(t){return e.jsx(kh,{...t})},exports.FormLabel=function(t){return e.jsx(_h,{...t})},exports.FullPageErrorFallback=function(){return e.jsx(CI,{children:e.jsx(OI,{children:e.jsxs(DI,{children:[e.jsx(qS,{icon:lx,size:"xl",colour:"danger"}),e.jsx(dx,{as:"h1",children:"Something went wrong"}),e.jsx("p",{children:"There was a problem with that request. Please try again, if the problem persists, please contact support."}),e.jsx(QC,{type:"link",href:"/",children:"Back to homepage"})]})})})},exports.Grid=function(t){return e.jsx(Th,{...t})},exports.Heading=dx,exports.Icon=qS,exports.IconButton=np,exports.Input=bI,exports.Layout=function({children:t,header:n,theme:r="light_internal"}){return e.jsx(CI,{theme:r,children:e.jsxs(II,{children:[n,e.jsx(EI,{children:t}),e.jsx(PI,{})]})})},exports.List=RC,exports.ListDivider=Rh,exports.ListItem=Dd,exports.ListItemButton=ou,exports.ListItemContent=jh,exports.ListItemDecorator=Lh,exports.ListSubheader=Ap,exports.LoadingSpinner=function(t){return e.jsxs(FC,{children:[e.jsx(AC,{...t}),e.jsx(LC,{children:"Loading"})]})},exports.Logo=xC,exports.LogoMini=kC,exports.Menu=bC,exports.MenuButton=Xh,exports.MenuHeading=vC,exports.MenuItem=RI,exports.ProgressBar=function({ariaLabel:t,percentage:n}){return e.jsx(MI,{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,children:e.jsx(zI,{style:{width:`${n}%`}})})},exports.ProgressCircle=function({size:n="medium",value:r,kind:o="default",trafficLightRanges:a={red:{min:0,max:20,text:""},redLow:{min:20,max:40,text:""},orange:{min:40,max:60,text:""},green:{min:60,max:80,text:""},greenHigh:{min:80,max:100,text:""}}}){const i={mini:"0.8rem",tiny:"1rem",small:"1.2rem",medium:"1.6rem",large:"2rem"}[n],s={mini:50,tiny:75,small:100,medium:150,large:200}[n],l=r?(({kind:e,percentage:t,trafficLightRanges:n})=>{const r="var(--color--primary)",o="var(--color--danger)",a="var(--color--green-dark)",i="var(--color--red)",s="var(--color--orange-dark)",l="var(--color--green-dark)";return(()=>{if("traffic-light"===e){const e=Object.entries(n).find((([,e])=>t>=e.min&&t<=e.max))?.[0];return"red"===e||"redLow"===e?i:"orange"===e?s:"green"===e||"greenHigh"===e?l:"#d7d7d7"}return"danger"===e?o:"success"===e?a:"default"===e?r:"#d7d7d7"})()})({kind:o,percentage:Math.round(r),trafficLightRanges:a}):void 0,c=s/7,[d,u]=t.useState(0);t.useEffect((()=>{u(r)}),[r]);const p=(s-c)/2,f=p*Math.PI*2,m=d?d*f/100:0,h=`0 0 ${s} ${s}`;return e.jsxs("svg",{width:s,height:s,viewBox:h,children:[e.jsx("circle",{fill:"white",stroke:"#d7d7d7",cx:s/2,cy:s/2,r:p,strokeWidth:`${c}px`}),e.jsx("circle",{fill:"none",stroke:l,cx:s/2,cy:s/2,r:p,strokeWidth:`${c}px`,transform:`rotate(-90 ${s/2} ${s/2})`,strokeDasharray:`${m}, ${f-m}`,strokeLinecap:"round",style:{transition:"all 0.5s"}}),e.jsx("text",{fill:"black",fontSize:i,fontWeight:"bold",x:"50%",y:"50%",dy:"6%",textAnchor:"middle",children:null!=r&&(g=r,g>=0&&g<=100)?`${r}%`:"-"})]});var g},exports.RadioButton=function(t){return e.jsx(pg,{...t})},exports.RadioGroup=gg,exports.ReadMore=function({children:n,maxLines:r=3}){const[o,a]=t.useState(!1),i=t.useRef(null),[s,l]=t.useState(!1),c=()=>{const{offsetHeight:e,scrollHeight:t}=i.current||{};l(!!(e&&t&&e<t))};return t.useLayoutEffect((()=>(window.addEventListener("resize",c),()=>window.removeEventListener("resize",c))),[i]),t.useEffect((()=>{c()}),[]),e.jsxs(jI,{children:[e.jsx($I,{$maxLines:o?void 0:r,ref:i,children:n}),r&&s&&e.jsx(AI,{type:"button",kind:"basic",onClick:()=>a(!o),children:o?"Read less":"Read more"})]})},exports.RelativeTime=function({time:n}){const[r,o]=t.useState((()=>new Date)),a=t.useMemo((()=>new Date(n)),[n]);t.useEffect((()=>{o(new Date)}),[n]),t.useEffect((()=>{if(Math.abs(a.getTime()/1e3-r.getTime()/1e3)<86400){const e=setTimeout((()=>{o(new Date)}),1e4);return()=>{clearTimeout(e)}}return()=>{}}),[r,a]);const i=t.useMemo((()=>{const e=Math.abs(a.getTime()/1e3-r.getTime()/1e3),t=a>r;if(e<60&&!t)return"just now";if(e>604800)return`${a.getDate()} ${FI[a.getMonth()]} ${a.getFullYear()}`;let n;return n=e<120?"a minute":e<2700?`${Math.ceil(e/60).toString()} minutes`:e<5400?"an hour":e<86400?`${Math.ceil(e/3600).toString()} hours`:e<172800?"one day":`${Math.ceil(e/86400).toString()} days`,t?`in ${n}`:`${n} ago`}),[a,r]);return e.jsx("time",{dateTime:a.toISOString(),title:a.toLocaleString(),children:i})},exports.Slider=function(t){return e.jsx(Pg,{sx:{},...t})},exports.StatusIcon=function({status:t="uploaded",size:n="md"}){const r=t.charAt(0).toUpperCase()+t.slice(1),o={uploaded:e.jsx(BI,{size:n}),running:e.jsx(HI,{size:n}),processed:e.jsx(VI,{size:n}),reviewed:e.jsx(LI,{size:n}),warning:e.jsx(WI,{size:n}),failed:e.jsx(YI,{size:n})};return e.jsx(tO,{title:r,children:e.jsx(qI,{status:t,"aria-label":r,children:o[t]})})},exports.Switch=function(t){return e.jsx(GI,{sx:{},...t})},exports.Table=function({id:n,data:r,columns:a,pageCount:i,totalCount:s,next:l,previous:c,page:d,pageable:u,pageSize:p,maxHeight:f=!1}){const[m,h]=t.useState((()=>[...r])),[g,v]=t.useState([]),[b,y]=t.useState({pageIndex:0,pageSize:p||10}),[x,w]=YE(`table.${n}.columnSizing`,{}),k=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=o.useState((()=>({current:HE(t)}))),[r,a]=o.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({columns:a,data:m,getCoreRowModel:e=>XI((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let l=0;l<t.length;l++){const c=rE(e,e._getRowId(t[l],l,a),t[l],l,o,0,null==a?void 0:a.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),QI(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>XI((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],s=i[o.id],l=s.sortUndefined,c=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(l){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===l)return n?-1:1;if("last"===l)return n?1:-1;d=n&&r?0:n?l:-l}}if(0===d&&(d=s.sortingFn(e,t,o.id)),0!==d)return c&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}}),QI(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex()))),onSortingChange:v,pageCount:i,state:{pagination:t.useMemo((()=>({pageIndex:b.pageIndex,pageSize:b.pageSize})),[b.pageIndex,b.pageSize]),sorting:g,columnSizing:x},onPaginationChange:y,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onChange",defaultColumn:{size:200,minSize:50,maxSize:500},onColumnSizingChange:w});return t.useEffect((()=>{void 0!==d&&k.setPageIndex(Number(d-1))}),[d,k]),t.useEffect((()=>{h(r)}),[r]),e.jsxs(e.Fragment,{children:[e.jsx(qE,{$maxHeight:f,children:e.jsxs(GE,{children:[k.getHeaderGroups().map((t=>e.jsx("thead",{children:e.jsx("tr",{children:t.headers.map((t=>e.jsxs("th",{colSpan:t.colSpan,style:{width:t.getSize()},children:[t.isPlaceholder?null:e.jsxs("button",{type:"button",className:t.column.getCanSort()?"cursor-pointer select-none":"",onClick:t.column.getToggleSortingHandler(),onKeyDown:t.column.getToggleSortingHandler(),title:t.column.getCanSort()?"asc"===t.column.getNextSortingOrder()?"Sort ascending":"desc"===t.column.getNextSortingOrder()?"Sort descending":"Clear sort":void 0,children:[{asc:e.jsx(qS,{icon:nx,size:"sm"}),desc:e.jsx(qS,{icon:tx,size:"sm"})}[t.column.getIsSorted()]??(t.column.getCanSort()&&e.jsx(qS,{icon:nx,size:"sm",className:"fade"})),WE(t.column.columnDef.header,t.getContext())]}),t.column.getCanResize()&&e.jsx("button",{type:"button","aria-label":"Resize column",onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:"resizer "+(t.column.getIsResizing()?"isResizing":"")})]},t.id)))})},t.id))),e.jsx("tbody",{children:k.getRowModel().rows.length>0?k.getRowModel().rows.map((t=>e.jsx("tr",{children:t.getVisibleCells().map((t=>e.jsx("td",{style:{width:t.column.getSize()},children:WE(t.column.columnDef.cell,t.getContext())},t.id)))},t.id))):e.jsx("tr",{children:e.jsx("td",{colSpan:a.length,style:{textAlign:"center"},children:"No data"})})})]})}),e.jsxs(KE,{children:[void 0!==s?e.jsxs("div",{children:["Total: ",s]}):null,u?e.jsxs(UE,{children:[e.jsx(QC,{type:"link",href:k.getCanPreviousPage()?window.location.href:"",disabled:!k.getCanPreviousPage(),children:"<<"}),e.jsx(QC,{type:"link",href:k.getCanPreviousPage()&&c?c:"",disabled:!k.getCanPreviousPage(),children:"<"}),e.jsx(QC,{type:"link",href:k.getCanNextPage()&&l?l:"",disabled:!k.getCanNextPage(),children:">"}),e.jsx(QC,{href:k.getCanNextPage()?`${window.location.href}?page=${String(i)}`:"",type:"link",disabled:!k.getCanNextPage(),children:">>"}),e.jsxs(JE,{children:[e.jsx("span",{children:"Page"}),e.jsxs("strong",{children:[k.getState().pagination.pageIndex+1," of"," ",k.getPageCount()]})]})]}):null]})]})},exports.Tabs=function({tabsConfig:n=[],defaultId:r}){const o=new URLSearchParams(window.location.search).get("tab")||r,a=n.findIndex((e=>e.id===o)),[i,s]=t.useState(a>=0?a:0),l=t.useRef(null),c=t.useRef({}),[d,u]=t.useState(!1),[p,f]=t.useState({right:!1,left:!0}),m=e=>{if(!l.current)return;const t=c.current[e];t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})},h=e=>{const t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.replaceState({},"",t.toString())},g=e=>{const t=n[e].id,r=c.current[t];r&&r.focus(),m(t),h(t)},v=e=>{const t=n.length,r={ArrowRight:()=>g((i+1)%t),ArrowLeft:()=>g((i-1+t)%t),Home:()=>g(0),End:()=>g(t-1)}[e.key];r&&(e.preventDefault(),r())},b=(e,t)=>{if(!e)return;let n=0;const r=setInterval((()=>{e.scrollLeft+=t,n+=Math.abs(t),n>=100&&clearInterval(r)}),20);f({left:e.scrollLeft<=0,right:e.scrollLeft+e.offsetWidth>=e.scrollWidth})};return t.useEffect((()=>{l.current&&u(l.current.offsetWidth<l.current.scrollWidth)}),[]),t.useEffect((()=>{m(n[i].id),h(n[i].id)}),[n,i]),t.useLayoutEffect((()=>{const e=()=>{if(!l.current)return;const{offsetWidth:e,scrollWidth:t}=l.current;u(e<t)};return window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e)}}),[]),e.jsxs(XE,{children:[e.jsxs(QE,{role:"tablist","aria-orientation":"horizontal",children:[d&&e.jsxs(tR,{onClick:()=>l.current&&b(l.current,-30),className:"left-arrow","aria-label":"Left arrow",disabled:p.left,children:[e.jsx(qS,{icon:ix,size:"lg"})," "]}),e.jsx(ZE,{ref:l,children:n.length>0?n.map((t=>e.jsx(eR,{type:"button",onClick:()=>(e=>{const t=n.findIndex((t=>t.id===e));m(e),s(t),h(e)})(t.id),role:"tab",ref:e=>{c.current[t.id]=e},"aria-controls":`panel-${t.id}`,"aria-selected":n[i].id===t.id,id:`tab-${t.id}`,onKeyDown:v,onFocus:()=>s(n.findIndex((e=>e.id===t.id))),tabIndex:n[i].id===t.id?0:-1,children:t.label},`tab-${t.id}`))):e.jsx("div",{children:"No tab content to display"})}),d&&e.jsx(tR,{onClick:()=>l.current&&b(l.current,30),className:"right-arrow","aria-label":"Right arrow",disabled:p.right,children:e.jsx(qS,{icon:sx,size:"lg"})})]}),e.jsx(nR,{children:n.map((t=>e.jsxs(rR,{role:"tabpanel","aria-labelledby":`tab-${t.id}`,id:`panel-${t.id}`,$show:n[i].id===t.id,tabIndex:0,children:[t.label?e.jsx(dx,{as:"h2",children:t.label}):null,t.content]},`tabpanel-${t.id}`)))})]})},exports.TextBlock=function({label:t,content:n,size:r,inline:o=!1}){return e.jsxs(sR,{$inline:o,children:[t?e.jsx(aR,{$size:r,children:t}):null,n?e.jsx(iR,{$size:r,children:n}):null]})},exports.TextField=function(){throw new Error(["MUI: `TextField` component has been removed in favor of Input composition.","","To migrate, run `npx @mui/codemod@latest v5.0.0/joy-text-field-to-input <path>`.","For the codemod detail, visit https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#joy-text-field-to-input\n\nTo learn more why it has been removed, visit the RFC https://github.com/mui/material-ui/issues/34176"].join("\n"))},exports.Textarea=function(t){return e.jsx(qg,{sx:{"--Textarea-minHeight":"2.6rem"},...t})},exports.ThemeProvider=CI,exports.ToastMessages=function({messages:t}){return e.jsx(lR,{children:e.jsx(cR,{style:{top:`-${55*t.length}px`},children:t.map((t=>e.jsx(uR,{message:t},String(t))))})})},exports.Tooltip=tO,exports.Typography=_I,exports.formatCurrency=(e,t="en-GB",n=fR)=>{let r=e;if(""===r||null==r)return pR;"string"==typeof e&&(r=Number(e));return new Intl.NumberFormat(t,{...fR,...n}).format(r)},exports.formatDate=(e,t="dd MMM yyyy")=>{if(""===e||null==e)return pR;const n=F_(e);return aO(n)?oD(n,t):pR},exports.formatNumber=e=>""===e||null==e?pR:e.toLocaleString(),exports.formatText=e=>""===e||null==e?pR:e,exports.useFetch=(e,n,r)=>{const[o,a]=t.useState(null),[i,s]=t.useState(!1),[l,c]=t.useState(null),d=t.useRef(null);return t.useEffect((()=>{if(!e)return()=>{};let t=!0;s(!0);return d.current&&clearTimeout(d.current),d.current=setTimeout((()=>{(async()=>{try{const r=await fetch(e,n);if(!r.ok)throw new Error(`Error: ${r.statusText}`);const o=await r.json();t&&(a(o),s(!1))}catch(e){t&&(c(e),s(!1))}})()}),r||0),()=>{t=!1,d.current&&clearTimeout(d.current)}}),[e,n,r]),{data:o,loading:i,error:l}},exports.useLocalStorage=YE,exports.useToggle=function(e){const[n,r]=t.useState(e);return{value:n,toggle:t.useCallback((()=>r((e=>!e))),[]),setTrue:t.useCallback((()=>r(!0)),[]),setFalse:t.useCallback((()=>r(!1)),[])}};
1257
+ `;function uR({message:t}){const n="success"===t.level?e.jsx(qS,{icon:Qy}):e.jsx(qS,{icon:lx});return"html"in t?e.jsxs(dR,{level:t.level,noFade:t.noFade,role:"alert","aria-live":"error"===t.level?"assertive":"polite",children:[n,e.jsx("span",{dangerouslySetInnerHTML:{__html:t.html}})]}):e.jsxs(dR,{level:t.level,noFade:t.noFade,role:"alert","aria-live":"error"===t.level?"assertive":"polite",children:[n,t.text]})}const pR="-",fR={style:"currency",currency:"GBP",minimumFractionDigits:0,maximumFractionDigits:0};exports.Accordion=function(t){return e.jsx(rv,{sx:{},...t})},exports.AccordionDetails=function(t){return e.jsx(zd,{...t})},exports.AccordionGroup=function(t){return e.jsx(Ud,{...t})},exports.AccordionLegacy=function({title:n,children:r,open:o=!1}){const[a,i]=t.useState(o),s=t.useRef(null);return t.useEffect((()=>{a&&s.current?s.current.style.maxHeight=`${s.current.scrollHeight}px`:s.current&&(s.current.style.maxHeight="0px")}),[a]),e.jsxs(GS,{children:[e.jsx(KS,{children:e.jsx(dx,{as:"h3",children:e.jsxs(JS,{type:"button","aria-expanded":a,onClick:()=>i(!a),"aria-controls":"accordion-content",role:"button",isOpen:a,children:[n,e.jsx("span",{children:e.jsx(qS,{icon:Xy})})]})})}),e.jsx(US,{ref:s,"aria-labelledby":"accordion-button",isOpen:a,role:"region",children:r})]})},exports.AccordionSummary=function(t){return e.jsx(vu,{...t})},exports.Alert=function(t){return e.jsx(Pu,{...t})},exports.AppBar=function({apps:n,currentApp:r,leftSide:a,rightSide:i,myAccountMenu:l,workspaces:c,workspacesMenu:d,currentWorkspace:u,helpButton:p,mobileMenuPrimary:f,mobileMenuSecondary:m,user:h,logoUrl:g}){const[v,b]=t.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),y=(e,t)=>{b(v?.map((n=>n.id===e?{...n,isOpen:t}:n)))},x=e=>v.find((t=>t.id===e))?.isOpen,w=f?e.jsxs(e.Fragment,{children:[e.jsx(EC,{onClick:()=>y("primary",!0),children:e.jsx(qS,{icon:Uy,size:"md"})}),e.jsx(gC,{open:x("primary"),onClose:()=>{y("primary",!1)},side:"left",disableGutters:!0,size:"lg",showCloseButton:!0,children:e.jsx(Vf,{role:"presentation",onClick:()=>y("primary",!1),onKeyDown:()=>y("primary",!1),children:f})})]}):null,k=Array.isArray(c)&&c.length>0?e.jsx("div",{style:c.length<=1?{pointerEvents:"none"}:void 0,children:e.jsxs(eC,{children:[e.jsx(_C,{size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:u}),e.jsxs(bC,{placement:"bottom-start",children:[e.jsx(vC,{sticky:!0,children:"Workspaces"}),d]})]})}):null,S=e.jsxs(OC,{children:[i,k,p?e.jsx(eC,{children:e.jsx(_C,{size:"sm",href:p.href,component:p.as,"aria-label":p.text,startDecorator:e.jsx(qS,{icon:QS,size:"sm"}),children:p.text||"Help"})}):null,h&&l?e.jsxs(eC,{children:[e.jsx(_C,{size:"sm",startDecorator:e.jsx(qS,{icon:XS,size:"sm"}),children:h?.displayName?h.displayName:"My Account"}),l]}):null]}),C=e.jsxs(Vf,{sx:{display:{xs:"flex",md:"none"}},children:[e.jsx(EC,{onClick:()=>y("secondary",!0),color:"neutral",children:e.jsx(qS,{icon:ex,size:"md"})}),e.jsx(gC,{open:x("secondary"),onClose:()=>{y("secondary",!1)},side:"right",disableGutters:!0,size:"lg",showCloseButton:!0,children:e.jsx(Vf,{role:"presentation",onClick:()=>y("secondary",!1),onKeyDown:()=>y("secondary",!1),children:m})})]}),O=(()=>{const e=qn(Ra);return"production"!==process.env.NODE_ENV&&o.useDebugValue(e),e[s]||e})(),{logoFillColour:D}=O.palette.appbar;return e.jsxs(SC,{children:[e.jsxs(Vf,{sx:{display:"flex",alignItems:"center",gap:"1rem"},children:[e.jsx(Vf,{sx:{display:{xs:"flex",md:"none"}},children:w}),e.jsxs(CC,{href:g||"/",children:[e.jsx(Vf,{sx:{display:{xs:"none",md:"flex"}},children:e.jsx(xC,{fillColour:D})}),e.jsx(Vf,{sx:{display:{xs:"flex",md:"none"}},children:e.jsx(kC,{fillColour:D})})]}),e.jsx(IC,{apps:n,currentApp:r})]}),e.jsxs(Vf,{sx:{display:"flex"},children:[e.jsx(TC,{children:a}),e.jsx(Vf,{sx:{display:{xs:"none",md:"flex"}},children:S}),m&&C]})]})},exports.Autocomplete=function({id:n,options:r,onChange:o,name:a,...i}){const[s,l]=t.useState(i.defaultValue),[c,d]=t.useState(i.defaultValue?.value);return e.jsxs(e.Fragment,{children:[e.jsx(kf,{...i,sx:{"--Input-minHeight":"2.6rem"},id:n,options:r,onChange:(e,t,n)=>{l(t),d(t?t?.value:""),o&&o(e,t,n)},getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,value:s,renderOption:i.renderOption,name:""}),e.jsx(Mp,{name:a,value:c,type:"hidden",sx:{display:"none"}})]})},exports.AutocompleteSelectMultiple=function({defaultValue:n,id:r,name:o,inline:a,onChange:i,SelectedOption:s,helpText:l,...c}){const[d,u]=t.useState((()=>(n||[]).map((e=>{const t=c.options.find((t=>String(t.value)===String(e)));return t?{label:t.label,value:t.value}:null})).filter((e=>null!==e))));return e.jsxs(e.Fragment,{children:[e.jsx(kf,{...c,sx:{"--Input-minHeight":"2.6rem"},multiple:!0,value:d,onChange:(e,t,n)=>{u(t),i&&i(e,t,n)},renderTags:(n,r)=>a?n.map(((n,o)=>t.createElement(pp,{component:"div",...r({index:o}),key:n.label,endDecorator:e.jsx(qS,{size:"sm",icon:ax})},n.label))):null,isOptionEqualToValue:(e,t)=>e.value===t.value,name:""}),l&&e.jsx("small",{children:l}),Array.isArray(d)&&d.map((t=>e.jsx(Mp,{name:o,value:t.value,type:"hidden",sx:{display:"none"}},t.value))),!a&&e.jsx(RC,{children:Array.isArray(d)&&d.length>0?d.map((t=>e.jsxs(Dd,{children:[s?e.jsx(s,{option:t}):t.label,e.jsx(NC,{type:"button",onClick:()=>{u(d.filter((e=>e.value!==t.value)))},children:e.jsx(qS,{icon:rx})})]},t.value))):null})]})},exports.Avatar=function(t){return e.jsx(Mf,{...t})},exports.Badge=function(t){return e.jsx(Lf,{...t})},exports.Box=Vf,exports.Breadcrumb=$C,exports.Button=QC,exports.Card=function(t){return e.jsx(fm,{...t})},exports.CardActions=km,exports.CardContent=_m,exports.CardCover=Em,exports.CardOverflow=zm,exports.Checkbox=function(t){return e.jsx(Km,{...t})},exports.Chip=ZC,exports.ChipIcon=function({icon:t={status:"not_found",label:"Not found",colour:"neutral",icon:void 0,size:"md",spin:!1},chip:n={size:"md"}}){return e.jsx(tO,{title:t?.tooltip,children:e.jsx(ZC,{sx:{"--_Chip-radius":"2rem",gap:"0.5rem",padding:"0.3rem 0.5rem 0.3rem 0.3rem"},size:n.size,color:t.colour,startDecorator:e.jsx(nO,{children:e.jsx(qS,{colour:t.colour,icon:t.icon,spin:t?.spin,size:t.size})}),children:t.label})})},exports.Container=function(t){return e.jsx(Um,{...t})},exports.DatePicker=gI,exports.DateTimeInput=function({id:n="",name:r,defaultValue:o,onChangeValue:a=()=>{},showNowButton:i}){const[s,l]=t.useState(o?(e=>{const t=new Date(e);return{day:String(t.getDate()).padStart(2,"0"),month:String(t.getMonth()+1).padStart(2,"0"),year:String(t.getFullYear()),hours:String(t.getHours()).padStart(2,"0"),minutes:String(t.getMinutes()).padStart(2,"0")}})(o):{day:"",month:"",year:"",hours:"",minutes:""}),c=(e,t)=>n=>{const{value:r}=n.target;(""===r||/^\d+$/.test(r)&&parseInt(r,10)<=t)&&l((t=>{const n={...t,[e]:r},o=yI(n);return a&&a(o),n}))},d=(new Date).getFullYear(),u=yI(s);return e.jsxs(xI,{id:n,children:[e.jsx("input",{type:"hidden",name:r,value:u}),e.jsxs(wI,{className:"day",children:[e.jsx(kI,{htmlFor:`${n}-day`,children:"Day"}),e.jsx(bI,{type:"number",id:`${n}-day`,placeholder:"DD",value:s.day,onChange:c("day",31)})]}),e.jsxs(wI,{className:"month",children:[e.jsx(kI,{htmlFor:`${n}-month`,children:"Month"}),e.jsx(bI,{type:"number",id:`${n}-month`,placeholder:"MM",value:s.month,onChange:c("month",12)})]}),e.jsxs(wI,{className:"year",children:[e.jsx(kI,{htmlFor:`${n}-year`,children:"Year"}),e.jsx(bI,{type:"number",id:`${n}-year`,placeholder:"YYYY",value:s.year,onChange:c("year",d)})]}),e.jsxs(wI,{className:"hours",children:[e.jsx(kI,{htmlFor:`${n}-hours`,children:"Hours"}),e.jsx(bI,{type:"number",id:`${n}-hours`,placeholder:"HH",value:s.hours,onChange:c("hours",23)})]}),e.jsxs(wI,{className:"minutes",children:[e.jsx(kI,{htmlFor:`${n}-minutes`,children:"Minutes"}),e.jsx(bI,{type:"number",id:`${n}-minutes`,placeholder:"MM",value:s.minutes,onChange:c("minutes",59)})]}),i?e.jsxs(QC,{onClick:()=>{const e=(()=>{const e=new Date;return{day:String(e.getDate()).padStart(2,"0"),month:String(e.getMonth()+1).padStart(2,"0"),year:String(e.getFullYear()),hours:String(e.getHours()).padStart(2,"0"),minutes:String(e.getMinutes()).padStart(2,"0")}})();l(e),a&&a(yI(e))},type:"button",kind:"secondary",children:[e.jsx(qS,{icon:ZS}),"Now"]}):null]})},exports.Divider=function(t){return e.jsx(th,{...t})},exports.Drawer=gC,exports.Dropdown=eC,exports.FormControl=function(t){return e.jsx(kh,{...t})},exports.FormLabel=function(t){return e.jsx(_h,{...t})},exports.FullPageErrorFallback=function(){return e.jsx(CI,{children:e.jsx(OI,{children:e.jsxs(DI,{children:[e.jsx(qS,{icon:lx,size:"xl",colour:"danger"}),e.jsx(dx,{as:"h1",children:"Something went wrong"}),e.jsx("p",{children:"There was a problem with that request. Please try again, if the problem persists, please contact support."}),e.jsx(QC,{type:"link",href:"/",children:"Back to homepage"})]})})})},exports.Grid=function(t){return e.jsx(Th,{...t})},exports.Heading=dx,exports.Icon=qS,exports.IconButton=np,exports.Input=bI,exports.Layout=function({children:t,header:n,theme:r="light_internal"}){return e.jsx(CI,{theme:r,children:e.jsxs(II,{children:[n,e.jsx(EI,{children:t}),e.jsx(PI,{})]})})},exports.List=RC,exports.ListDivider=Rh,exports.ListItem=Dd,exports.ListItemButton=ou,exports.ListItemContent=jh,exports.ListItemDecorator=Lh,exports.ListSubheader=Ap,exports.LoadingSpinner=function(t){return e.jsxs(FC,{children:[e.jsx(AC,{...t}),e.jsx(LC,{children:"Loading"})]})},exports.Logo=xC,exports.LogoMini=kC,exports.Menu=bC,exports.MenuButton=Xh,exports.MenuHeading=vC,exports.MenuItem=RI,exports.ProgressBar=function({ariaLabel:t,percentage:n}){return e.jsx(MI,{role:"progressbar","aria-label":t,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,children:e.jsx(zI,{style:{width:`${n}%`}})})},exports.ProgressCircle=function({size:n="medium",value:r,kind:o="default",trafficLightRanges:a={red:{min:0,max:20,text:""},redLow:{min:20,max:40,text:""},orange:{min:40,max:60,text:""},green:{min:60,max:80,text:""},greenHigh:{min:80,max:100,text:""}}}){const i={mini:"0.8rem",tiny:"1rem",small:"1.2rem",medium:"1.6rem",large:"2rem"}[n],s={mini:50,tiny:75,small:100,medium:150,large:200}[n],l=r?(({kind:e,percentage:t,trafficLightRanges:n})=>{const r="var(--color--primary)",o="var(--color--danger)",a="var(--color--green-dark)",i="var(--color--red)",s="var(--color--orange-dark)",l="var(--color--green-dark)";return(()=>{if("traffic-light"===e){const e=Object.entries(n).find((([,e])=>t>=e.min&&t<=e.max))?.[0];return"red"===e||"redLow"===e?i:"orange"===e?s:"green"===e||"greenHigh"===e?l:"#d7d7d7"}return"danger"===e?o:"success"===e?a:"default"===e?r:"#d7d7d7"})()})({kind:o,percentage:Math.round(r),trafficLightRanges:a}):void 0,c=s/7,[d,u]=t.useState(0);t.useEffect((()=>{u(r)}),[r]);const p=(s-c)/2,f=p*Math.PI*2,m=d?d*f/100:0,h=`0 0 ${s} ${s}`;return e.jsxs("svg",{width:s,height:s,viewBox:h,children:[e.jsx("circle",{fill:"white",stroke:"#d7d7d7",cx:s/2,cy:s/2,r:p,strokeWidth:`${c}px`}),e.jsx("circle",{fill:"none",stroke:l,cx:s/2,cy:s/2,r:p,strokeWidth:`${c}px`,transform:`rotate(-90 ${s/2} ${s/2})`,strokeDasharray:`${m}, ${f-m}`,strokeLinecap:"round",style:{transition:"all 0.5s"}}),e.jsx("text",{fill:"black",fontSize:i,fontWeight:"bold",x:"50%",y:"50%",dy:"6%",textAnchor:"middle",children:null!=r&&(g=r,g>=0&&g<=100)?`${r}%`:"-"})]});var g},exports.RadioButton=function(t){return e.jsx(pg,{...t})},exports.RadioGroup=gg,exports.ReadMore=function({children:n,maxLines:r=3}){const[o,a]=t.useState(!1),i=t.useRef(null),[s,l]=t.useState(!1),c=()=>{const{offsetHeight:e,scrollHeight:t}=i.current||{};l(!!(e&&t&&e<t))};return t.useLayoutEffect((()=>(window.addEventListener("resize",c),()=>window.removeEventListener("resize",c))),[i]),t.useEffect((()=>{c()}),[]),e.jsxs(jI,{children:[e.jsx($I,{$maxLines:o?void 0:r,ref:i,children:n}),r&&s&&e.jsx(AI,{type:"button",kind:"basic",onClick:()=>a(!o),children:o?"Read less":"Read more"})]})},exports.RelativeTime=function({time:n}){const[r,o]=t.useState((()=>new Date)),a=t.useMemo((()=>new Date(n)),[n]);t.useEffect((()=>{o(new Date)}),[n]),t.useEffect((()=>{if(Math.abs(a.getTime()/1e3-r.getTime()/1e3)<86400){const e=setTimeout((()=>{o(new Date)}),1e4);return()=>{clearTimeout(e)}}return()=>{}}),[r,a]);const i=t.useMemo((()=>{const e=Math.abs(a.getTime()/1e3-r.getTime()/1e3),t=a>r;if(e<60&&!t)return"just now";if(e>604800)return`${a.getDate()} ${FI[a.getMonth()]} ${a.getFullYear()}`;let n;return n=e<120?"a minute":e<2700?`${Math.ceil(e/60).toString()} minutes`:e<5400?"an hour":e<86400?`${Math.ceil(e/3600).toString()} hours`:e<172800?"one day":`${Math.ceil(e/86400).toString()} days`,t?`in ${n}`:`${n} ago`}),[a,r]);return e.jsx("time",{dateTime:a.toISOString(),title:a.toLocaleString(),children:i})},exports.Slider=function(t){return e.jsx(Pg,{sx:{},...t})},exports.StatusIcon=function({status:t="uploaded",size:n="md"}){const r=t.charAt(0).toUpperCase()+t.slice(1),o={uploaded:e.jsx(BI,{size:n}),running:e.jsx(HI,{size:n}),processed:e.jsx(VI,{size:n}),reviewed:e.jsx(LI,{size:n}),warning:e.jsx(WI,{size:n}),failed:e.jsx(YI,{size:n})};return e.jsx(tO,{title:r,children:e.jsx(qI,{status:t,"aria-label":r,children:o[t]})})},exports.Switch=function(t){return e.jsx(GI,{sx:{},...t})},exports.Table=function({id:n,data:r,columns:a,pageCount:i,totalCount:s,next:l,previous:c,page:d,pageable:u,pageSize:p,maxHeight:f=!1}){const[m,h]=t.useState((()=>[...r])),[g,v]=t.useState([]),[b,y]=t.useState({pageIndex:0,pageSize:p||10}),[x,w]=YE(`table.${n}.columnSizing`,{}),k=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=o.useState((()=>({current:HE(t)}))),[r,a]=o.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({columns:a,data:m,getCoreRowModel:e=>XI((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let l=0;l<t.length;l++){const c=rE(e,e._getRowId(t[l],l,a),t[l],l,o,0,null==a?void 0:a.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),QI(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>XI((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],s=i[o.id],l=s.sortUndefined,c=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(l){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===l)return n?-1:1;if("last"===l)return n?1:-1;d=n&&r?0:n?l:-l}}if(0===d&&(d=s.sortingFn(e,t,o.id)),0!==d)return c&&(d*=-1),s.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}}),QI(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex()))),onSortingChange:v,pageCount:i,state:{pagination:t.useMemo((()=>({pageIndex:b.pageIndex,pageSize:b.pageSize})),[b.pageIndex,b.pageSize]),sorting:g,columnSizing:x},onPaginationChange:y,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onChange",defaultColumn:{size:200,minSize:50,maxSize:500},onColumnSizingChange:w});return t.useEffect((()=>{void 0!==d&&k.setPageIndex(Number(d-1))}),[d,k]),t.useEffect((()=>{h(r)}),[r]),e.jsxs(e.Fragment,{children:[e.jsx(qE,{$maxHeight:f,children:e.jsxs(GE,{children:[k.getHeaderGroups().map((t=>e.jsx("thead",{children:e.jsx("tr",{children:t.headers.map((t=>e.jsxs("th",{colSpan:t.colSpan,style:{width:t.getSize()},children:[t.isPlaceholder?null:e.jsxs("button",{type:"button",className:t.column.getCanSort()?"cursor-pointer select-none":"",onClick:t.column.getToggleSortingHandler(),onKeyDown:t.column.getToggleSortingHandler(),title:t.column.getCanSort()?"asc"===t.column.getNextSortingOrder()?"Sort ascending":"desc"===t.column.getNextSortingOrder()?"Sort descending":"Clear sort":void 0,children:[{asc:e.jsx(qS,{icon:nx,size:"sm"}),desc:e.jsx(qS,{icon:tx,size:"sm"})}[t.column.getIsSorted()]??(t.column.getCanSort()&&e.jsx(qS,{icon:nx,size:"sm",className:"fade"})),WE(t.column.columnDef.header,t.getContext())]}),t.column.getCanResize()&&e.jsx("button",{type:"button","aria-label":"Resize column",onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:"resizer "+(t.column.getIsResizing()?"isResizing":"")})]},t.id)))})},t.id))),e.jsx("tbody",{children:k.getRowModel().rows.length>0?k.getRowModel().rows.map((t=>e.jsx("tr",{children:t.getVisibleCells().map((t=>e.jsx("td",{style:{width:t.column.getSize()},children:WE(t.column.columnDef.cell,t.getContext())},t.id)))},t.id))):e.jsx("tr",{children:e.jsx("td",{colSpan:a.length,style:{textAlign:"center"},children:"No data"})})})]})}),e.jsxs(KE,{children:[void 0!==s?e.jsxs("div",{children:["Total: ",s]}):null,u?e.jsxs(UE,{children:[e.jsx(QC,{type:"link",href:k.getCanPreviousPage()?window.location.href:"",disabled:!k.getCanPreviousPage(),children:"<<"}),e.jsx(QC,{type:"link",href:k.getCanPreviousPage()&&c?c:"",disabled:!k.getCanPreviousPage(),children:"<"}),e.jsx(QC,{type:"link",href:k.getCanNextPage()&&l?l:"",disabled:!k.getCanNextPage(),children:">"}),e.jsx(QC,{href:k.getCanNextPage()?`${window.location.href}?page=${String(i)}`:"",type:"link",disabled:!k.getCanNextPage(),children:">>"}),e.jsxs(JE,{children:[e.jsx("span",{children:"Page"}),e.jsxs("strong",{children:[k.getState().pagination.pageIndex+1," of"," ",k.getPageCount()]})]})]}):null]})]})},exports.Tabs=function({tabsConfig:n=[],defaultId:r}){const o=new URLSearchParams(window.location.search).get("tab")||r,a=n.findIndex((e=>e.id===o)),[i,s]=t.useState(a>=0?a:0),l=t.useRef(null),c=t.useRef({}),[d,u]=t.useState(!1),[p,f]=t.useState({right:!1,left:!0}),m=e=>{if(!l.current)return;const t=c.current[e];t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})},h=e=>{const t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.replaceState({},"",t.toString())},g=e=>{const t=n[e].id,r=c.current[t];r&&r.focus(),m(t),h(t)},v=e=>{const t=n.length,r={ArrowRight:()=>g((i+1)%t),ArrowLeft:()=>g((i-1+t)%t),Home:()=>g(0),End:()=>g(t-1)}[e.key];r&&(e.preventDefault(),r())},b=(e,t)=>{if(!e)return;let n=0;const r=setInterval((()=>{e.scrollLeft+=t,n+=Math.abs(t),n>=100&&clearInterval(r)}),20);f({left:e.scrollLeft<=0,right:e.scrollLeft+e.offsetWidth>=e.scrollWidth})};return t.useEffect((()=>{l.current&&u(l.current.offsetWidth<l.current.scrollWidth)}),[]),t.useEffect((()=>{m(n[i].id),h(n[i].id)}),[n,i]),t.useLayoutEffect((()=>{const e=()=>{if(!l.current)return;const{offsetWidth:e,scrollWidth:t}=l.current;u(e<t)};return window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e)}}),[]),e.jsxs(XE,{children:[e.jsxs(QE,{role:"tablist","aria-orientation":"horizontal",children:[d&&e.jsxs(tR,{onClick:()=>l.current&&b(l.current,-30),className:"left-arrow","aria-label":"Left arrow",disabled:p.left,children:[e.jsx(qS,{icon:ix,size:"lg"})," "]}),e.jsx(ZE,{ref:l,children:n.length>0?n.map((t=>e.jsx(eR,{type:"button",onClick:()=>(e=>{const t=n.findIndex((t=>t.id===e));m(e),s(t),h(e)})(t.id),role:"tab",ref:e=>{c.current[t.id]=e},"aria-controls":`panel-${t.id}`,"aria-selected":n[i].id===t.id,id:`tab-${t.id}`,onKeyDown:v,onFocus:()=>s(n.findIndex((e=>e.id===t.id))),tabIndex:n[i].id===t.id?0:-1,children:t.label},`tab-${t.id}`))):e.jsx("div",{children:"No tab content to display"})}),d&&e.jsx(tR,{onClick:()=>l.current&&b(l.current,30),className:"right-arrow","aria-label":"Right arrow",disabled:p.right,children:e.jsx(qS,{icon:sx,size:"lg"})})]}),e.jsx(nR,{children:n.map((t=>{const r=n[i].id===t.id;return e.jsx(rR,{role:"tabpanel","aria-labelledby":`tab-${t.id}`,id:`panel-${t.id}`,$show:r,tabIndex:0,children:r&&e.jsxs(e.Fragment,{children:[t.label?e.jsx(dx,{as:"h2",children:t.label}):null,t.content]})},`tabpanel-${t.id}`)}))})]})},exports.TextBlock=function({label:t,content:n,size:r,inline:o=!1}){return e.jsxs(sR,{$inline:o,children:[t?e.jsx(aR,{$size:r,children:t}):null,n?e.jsx(iR,{$size:r,children:n}):null]})},exports.TextField=function(){throw new Error(["MUI: `TextField` component has been removed in favor of Input composition.","","To migrate, run `npx @mui/codemod@latest v5.0.0/joy-text-field-to-input <path>`.","For the codemod detail, visit https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#joy-text-field-to-input\n\nTo learn more why it has been removed, visit the RFC https://github.com/mui/material-ui/issues/34176"].join("\n"))},exports.Textarea=function(t){return e.jsx(qg,{sx:{"--Textarea-minHeight":"2.6rem"},...t})},exports.ThemeProvider=CI,exports.ToastMessages=function({messages:t}){return e.jsx(lR,{children:e.jsx(cR,{style:{top:`-${55*t.length}px`},children:t.map((t=>e.jsx(uR,{message:t},String(t))))})})},exports.Tooltip=tO,exports.Typography=_I,exports.formatCurrency=(e,t="en-GB",n=fR)=>{let r=e;if(""===r||null==r)return pR;"string"==typeof e&&(r=Number(e));return new Intl.NumberFormat(t,{...fR,...n}).format(r)},exports.formatDate=(e,t="dd MMM yyyy")=>{if(""===e||null==e)return pR;const n=F_(e);return aO(n)?oD(n,t):pR},exports.formatNumber=e=>""===e||null==e?pR:e.toLocaleString(),exports.formatText=e=>""===e||null==e?pR:e,exports.useFetch=(e,n,r)=>{const[o,a]=t.useState(null),[i,s]=t.useState(!1),[l,c]=t.useState(null),d=t.useRef(null);return t.useEffect((()=>{if(!e)return()=>{};let t=!0;s(!0);return d.current&&clearTimeout(d.current),d.current=setTimeout((()=>{(async()=>{try{const r=await fetch(e,n);if(!r.ok)throw new Error(`Error: ${r.statusText}`);const o=await r.json();t&&(a(o),s(!1))}catch(e){t&&(c(e),s(!1))}})()}),r||0),()=>{t=!1,d.current&&clearTimeout(d.current)}}),[e,n,r]),{data:o,loading:i,error:l}},exports.useLocalStorage=YE,exports.useToggle=function(e){const[n,r]=t.useState(e);return{value:n,toggle:t.useCallback((()=>r((e=>!e))),[]),setTrue:t.useCallback((()=>r(!0)),[]),setFalse:t.useCallback((()=>r(!1)),[])}};
1258
1258
  //# sourceMappingURL=index.cjs.map