@alextheman/components 6.18.0 → 6.19.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.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c,1);let l=require(`@mui/material/Card`);l=s(l,1);let u=require(`@mui/material/CardContent`);u=s(u,1);let d=require(`@mui/material/CardHeader`);d=s(d,1);let f=require(`@mui/material/Chip`);f=s(f,1);let p=require(`@mui/material/Divider`);p=s(p,1);let m=require(`@mui/material/Stack`);m=s(m,1);let h=require(`@mui/material/Typography`);h=s(h,1);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_,1);let ee=require(`@mui/material/Collapse`);ee=s(ee,1);let v=require(`react`),y=require(`react-icons/md`),b=require(`@mui/material/Link`);b=s(b,1);let x=require(`@mui/material/Button`);x=s(x,1);let S=require(`@mui/material/styles`),C=require(`@mui/material/IconButton`);C=s(C,1);let w=require(`@mui/material/List`);w=s(w,1);let T=require(`@mui/material/ListItem`);T=s(T,1);let E=require(`@mui/material/ListItemText`);E=s(E,1);let D=require(`@mui/material/Tooltip`);D=s(D,1);let te=require(`@mui/material/Switch`);te=s(te,1);let O=require(`@alextheman/utility/v6`),k=require(`@mui/material/CssBaseline`);k=s(k,1);let A=require(`@mui/material/CircularProgress`);A=s(A,1);let j=require(`@mui/material/Alert`);j=s(j,1);let M=require(`@alextheman/utility`),N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/BottomNavigation`);P=s(P,1);let F=require(`@mui/material/BottomNavigationAction`);F=s(F,1);let I=require(`@mui/material/Paper`);I=s(I,1);let L=require(`react-router-dom`),ne=require(`common-tags`),R=require(`react-live`),re=require(`@mui/material/Skeleton`);re=s(re,1);let ie=require(`@mui/material/TableCell`);ie=s(ie,1);let z=require(`@mui/material/TableRow`);z=s(z,1);let B=require(`@mui/material/Menu`);B=s(B,1);let V=require(`@mui/material/AppBar`);V=s(V,1);let H=require(`@mui/material/Drawer`);H=s(H,1);let U=require(`@mui/material/ListItemButton`);U=s(U,1);let W=require(`@mui/material/ListItemIcon`);W=s(W,1);let G=require(`@mui/material/Toolbar`);G=s(G,1);let K=require(`@mui/material/MenuItem`);K=s(K,1);let q=require(`@mui/material/Popover`);q=s(q,1);let ae=require(`react-hook-form`);function oe({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function se(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function ce(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(oe,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(se,{}),(0,g.jsx)(oe,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function le({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(y.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(y.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,v.useState)(!!e);return(0,v.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(ee.default,{in:f,...s,children:r})]})}function ue({href:e,children:t,ref:n,...r}){return(0,g.jsx)(b.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const de={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},fe=(0,S.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),pe=(0,S.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function me({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,g.jsxs)(x.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(y.MdCloudUpload,{}),children:[t,(0,g.jsx)(fe,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(pe,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function he({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(me,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(w.default,{children:e.map(e=>(0,g.jsx)(T.default,{secondaryAction:(0,g.jsx)(C.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(y.MdDelete,{})}),children:(0,g.jsx)(E.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const ge=(0,S.styled)(te.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function _e({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(ge,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}const ve=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function J({strict:e=!0}={}){let t=(0,v.useContext)(ve);if(e&&!t)throw new O.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function ye({children:e,mode:t=`dark`}){let[n,r]=(0,v.useState)(t),i=(0,v.useMemo)(()=>(0,S.createTheme)({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return(0,g.jsx)(ve.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(k.default,{}),e]})})}const be=(0,v.createContext)(void 0);function Y({strict:e=!0}={}){let t=(0,v.useContext)(be);if(e&&!t)throw new O.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function xe({children:e,loadingComponent:t=(0,g.jsx)(A.default,{}),...n}){return(0,g.jsx)(be.Provider,{value:{loadingComponent:t,...n},children:e})}function X({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=Y(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Se({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=(0,g.jsx)(h.default,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:s,data:c,dataParser:l,loadingComponent:u,error:d}=Y(),f=i??l,p=t??u;if(s)return(0,g.jsx)(g.Fragment,{children:p});if(d||c==null)return null;if(!Array.isArray(c)){if(o)throw new O.DataError({data:c,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(c.length===0)return(0,g.jsx)(g.Fragment,{children:a});let m;return m=f?f(c):r?c.map(r):c,(0,g.jsx)(g.Fragment,{children:m.map((t,r)=>(0,g.jsx)(v.Fragment,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function Ce({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=Y(),o=t??a,s=(0,v.useRef)(!1),c=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof c==`function`?c(r):c?(0,g.jsx)(g.Fragment,{children:c}):(0,g.jsx)(j.default,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function we({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=Y();return r||a?null:i==null?n?(0,g.jsx)(g.Fragment,{children:n}):i===void 0&&e?(0,g.jsx)(g.Fragment,{children:e}):i===null&&t?(0,g.jsx)(g.Fragment,{children:t}):(0,g.jsx)(j.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function Z({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Ce,{logError:t,children:e}),(0,g.jsx)(we,{...n})]})}var Q=xe;const Te=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ee({strict:e=!0}={}){let t=(0,v.useContext)(Te);if(e&&!t)throw new O.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function De({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,v.useState)(window.innerWidth),[a,o]=(0,v.useState)(window.innerHeight);(0,v.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,v.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(Te.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Oe=(0,v.createContext)(void 0);function ke({strict:e=!0}={}){let t=(0,v.useContext)(Oe);if(e&&!t)throw new O.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Ae({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,M.wait)(.2),s(``)}return(0,g.jsxs)(Oe.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(j.default,{onClose:d,severity:c,children:o})}),e]})}function je(){let{mode:e,toggleMode:t}=J(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(_e,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Me({children:e,navItems:t}){let[n,r]=(0,v.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(I.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(P.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(F.default,{...e,component:L.Link},e.value))})})]})}function Ne({title:e,subtitle:t,action:n,children:r,tabs:i,disablePadding:a}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[typeof e==`string`?(0,g.jsx)(h.default,{variant:`h6`,children:e}):e,t?typeof t==`string`?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):t:null]}),action:n}),i,(0,g.jsx)(p.default,{}),a?r:(0,g.jsx)(u.default,{children:r})]})}function Pe({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(A.default,{}),...s}){let c=(0,g.jsx)(Z,{logError:a,errorComponent:t});return i?c=(0,g.jsx)(Z,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(c=(0,g.jsx)(Z,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),(0,g.jsxs)(Q,{loadingComponent:o,...s,children:[c,(0,g.jsx)(X,{children:e})]})}function Fe({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,...u}){let d=(0,g.jsx)(Z,{logError:i,errorComponent:a});return r?d=(0,g.jsx)(Z,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(d=(0,g.jsx)(Z,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a})),(0,g.jsxs)(Q,{loadingComponent:e,isLoading:s,error:c,data:l,children:[d,(0,g.jsx)(Se,{...u,children:o})]})}function Ie({code:e,previewStyles:t,...n}){let{mode:r}=J(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(R.LiveProvider,{...n,code:(0,ne.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(R.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(R.LivePreview,{}),(0,g.jsx)(R.LiveError,{})]})]})})}function Le({columns:e}){return(0,g.jsx)(z.default,{children:(0,M.fillArray)(e=>(0,g.jsx)(ie.default,{children:(0,g.jsx)(re.default,{})},e),e)})}const Re=je;function ze({children:e,button:t=x.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(y.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(y.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,v.useState)(null),d=(0,v.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===x.default&&(f.endIcon=d?i:a),(0,v.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(B.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const Be=(0,v.createContext)(void 0);function Ve({strict:e=!0}={}){let t=(0,v.useContext)(Be);if(e&&!t)throw new O.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function He({strict:e=!0}={}){return Ve({strict:e})}function Ue({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=He();return(0,g.jsx)(B.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function We({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Ve();return(0,g.jsx)(K.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const $=Ve,Ge=Ue,Ke=We;var qe=Ge;function Je({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(K.default,{component:ue,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ye({to:e,component:t=L.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Xe({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(K.default,{component:Ye,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ze({icon:e=y.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,v.useState)(null),s=!!a,l=(0,v.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(q.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function Qe({children:e,...t}){return(0,g.jsx)(U.default,{component:Ye,...t,children:e})}const $e=Pe,et=X,tt=Z,nt=Q;function rt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function it(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const at=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),ot=(0,S.styled)(V.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),st=(0,S.styled)(H.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...rt(e),"& .MuiDrawer-paper":rt(e)}},{props:({open:e})=>!e,style:{...it(e),"& .MuiDrawer-paper":it(e)}}]}));function ct({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,L.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(k.default,{}),(0,g.jsx)(ot,{position:`fixed`,open:a,children:(0,g.jsxs)(G.default,{children:[(0,g.jsx)(C.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(y.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(st,{variant:`permanent`,open:a,children:[(0,g.jsx)(at,{children:(0,g.jsx)(C.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(y.MdChevronRight,{}):(0,g.jsx)(y.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(v.Fragment,{children:[(0,g.jsxs)(w.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,M.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(U.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:L.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(W.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,M.truncate)(e.label,4)})}),(0,g.jsx)(E.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(at,{}),n]})]})}function lt({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
2
- `).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}function ut({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,ae.useFormContext)();return(0,g.jsx)(x.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}function dt(e){let[t,n]=(0,v.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,v.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,v.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,v.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=ce,exports.CollapsableItem=le,exports.DarkModeToggle=Re,exports.DropdownMenu=ze,exports.DropdownMenu2=qe,exports.DropdownMenuExternalLink=Je,exports.DropdownMenuInternalLink=Xe,exports.DropdownMenuItem=Ke,exports.ExternalLink=ue,exports.FileInput=me,exports.FileInputList=he,exports.FileType=de,exports.IconWithPopover=Ze,exports.InternalLink=Ye,exports.ListItemInternalLink=Qe,exports.Loader=$e,exports.LoaderData=et,exports.LoaderError=tt,exports.LoaderProvider=nt,exports.ModeProvider=ye,exports.ModeToggle=je,exports.NavigationBottom=Me,exports.NavigationDrawer=ct,exports.Page=Ne,exports.PopoverText=lt,exports.QueryBoundary=Pe,exports.QueryBoundaryData=X,exports.QueryBoundaryDataMap=Se,exports.QueryBoundaryError=Ce,exports.QueryBoundaryFallback=Z,exports.QueryBoundaryMap=Fe,exports.QueryBoundaryNullable=we,exports.QueryBoundaryProvider=Q,exports.ReactPlayground=Ie,exports.ScreenSizeProvider=De,exports.SkeletonRow=Le,exports.SnackbarProvider=Ae,exports.SubmitButton=ut,exports.SwitchWithIcons=_e,exports.useDropdownMenu=$,exports.useHash=dt,exports.useMode=J,exports.useScreenSize=Ee,exports.useSnackbar=ke;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c,1);let l=require(`@mui/material/Card`);l=s(l,1);let u=require(`@mui/material/CardContent`);u=s(u,1);let d=require(`@mui/material/CardHeader`);d=s(d,1);let f=require(`@mui/material/Chip`);f=s(f,1);let p=require(`@mui/material/Divider`);p=s(p,1);let m=require(`@mui/material/Stack`);m=s(m,1);let h=require(`@mui/material/Typography`);h=s(h,1);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_,1);let ee=require(`@mui/material/Collapse`);ee=s(ee,1);let v=require(`react`),y=require(`react-icons/md`),b=require(`@mui/material/Link`);b=s(b,1);let x=require(`@mui/material/Button`);x=s(x,1);let S=require(`@mui/material/styles`),C=require(`@mui/material/IconButton`);C=s(C,1);let w=require(`@mui/material/List`);w=s(w,1);let T=require(`@mui/material/ListItem`);T=s(T,1);let E=require(`@mui/material/ListItemText`);E=s(E,1);let D=require(`@mui/material/Tooltip`);D=s(D,1);let te=require(`@mui/material/Switch`);te=s(te,1);let O=require(`@alextheman/utility/v6`),k=require(`@mui/material/CssBaseline`);k=s(k,1);let A=require(`@mui/material/CircularProgress`);A=s(A,1);let j=require(`@mui/material/Alert`);j=s(j,1);let M=require(`@alextheman/utility`),N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/BottomNavigation`);P=s(P,1);let F=require(`@mui/material/BottomNavigationAction`);F=s(F,1);let ne=require(`@mui/material/Paper`);ne=s(ne,1);let I=require(`react-router-dom`),re=require(`common-tags`),L=require(`react-live`),ie=require(`@mui/material/Skeleton`);ie=s(ie,1);let ae=require(`@mui/material/TableCell`);ae=s(ae,1);let R=require(`@mui/material/TableRow`);R=s(R,1);let z=require(`@mui/material/Menu`);z=s(z,1);let B=require(`@mui/material/AppBar`);B=s(B,1);let V=require(`@mui/material/Drawer`);V=s(V,1);let H=require(`@mui/material/ListItemButton`);H=s(H,1);let U=require(`@mui/material/ListItemIcon`);U=s(U,1);let W=require(`@mui/material/Toolbar`);W=s(W,1);let G=require(`@mui/material/MenuItem`);G=s(G,1);let K=require(`@mui/material/Popover`);K=s(K,1);let oe=require(`react-hook-form`);function se({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function ce(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function le(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(se,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(ce,{}),(0,g.jsx)(se,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function ue({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(y.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(y.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,v.useState)(!!e);return(0,v.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(ee.default,{in:f,...s,children:r})]})}function de({href:e,children:t,ref:n,...r}){return(0,g.jsx)(b.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const fe={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},pe=(0,S.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),me=(0,S.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function he({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,g.jsxs)(x.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(y.MdCloudUpload,{}),children:[t,(0,g.jsx)(pe,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(me,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function ge({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(he,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(w.default,{children:e.map(e=>(0,g.jsx)(T.default,{secondaryAction:(0,g.jsx)(C.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(y.MdDelete,{})}),children:(0,g.jsx)(E.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const _e=(0,S.styled)(te.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ve({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(_e,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}const ye=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function q({strict:e=!0}={}){let t=(0,v.useContext)(ye);if(e&&!t)throw new O.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function be({children:e,mode:t=`dark`}){let[n,r]=(0,v.useState)(t),i=(0,v.useMemo)(()=>(0,S.createTheme)({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return(0,g.jsx)(ye.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(k.default,{}),e]})})}const xe=(0,v.createContext)(void 0);function J({strict:e=!0}={}){let t=(0,v.useContext)(xe);if(e&&!t)throw new O.DataError({strict:e,context:t},`QUERY_BOUNDARY_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function Se({children:e,loadingComponent:t=(0,g.jsx)(A.default,{}),...n}){return(0,g.jsx)(xe.Provider,{value:{loadingComponent:t,...n},children:e})}function Y({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=J(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function X({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=(0,g.jsx)(h.default,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:s,data:c,dataParser:l,loadingComponent:u,error:d}=J(),f=i??l,p=t??u;if(s)return(0,g.jsx)(g.Fragment,{children:p});if(d||c==null)return null;if(!Array.isArray(c)){if(o)throw new O.DataError({data:c,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(c.length===0)return(0,g.jsx)(g.Fragment,{children:a});let m;return m=f?f(c):r?c.map(r):c,(0,g.jsx)(g.Fragment,{children:m.map((t,r)=>(0,g.jsx)(v.Fragment,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function Ce({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=J(),o=t??a,s=(0,v.useRef)(!1),c=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof c==`function`?c(r):c?(0,g.jsx)(g.Fragment,{children:c}):(0,g.jsx)(j.default,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function we({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=J();return r||a?null:i==null?n?(0,g.jsx)(g.Fragment,{children:n}):i===void 0&&e?(0,g.jsx)(g.Fragment,{children:e}):i===null&&t?(0,g.jsx)(g.Fragment,{children:t}):(0,g.jsx)(j.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function Z({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Ce,{logError:t,children:e}),(0,g.jsx)(we,{...n})]})}var Q=Se;const Te=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ee({strict:e=!0}={}){let t=(0,v.useContext)(Te);if(e&&!t)throw new O.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function De({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,v.useState)(window.innerWidth),[a,o]=(0,v.useState)(window.innerHeight);(0,v.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,v.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(Te.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Oe=(0,v.createContext)(void 0);function ke({strict:e=!0}={}){let t=(0,v.useContext)(Oe);if(e&&!t)throw new O.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Ae({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,M.wait)(.2),s(``)}return(0,g.jsxs)(Oe.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(j.default,{onClose:d,severity:c,children:o})}),e]})}function je(){let{mode:e,toggleMode:t}=q(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ve,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Me({children:e,navItems:t}){let[n,r]=(0,v.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(ne.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(P.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(F.default,{...e,component:I.Link},e.value))})})]})}function Ne({title:e,subtitle:t,action:n,children:r,tabs:i,disablePadding:a}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[typeof e==`string`?(0,g.jsx)(h.default,{variant:`h6`,children:e}):e,t?typeof t==`string`?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):t:null]}),action:n}),i,(0,g.jsx)(p.default,{}),a?r:(0,g.jsx)(u.default,{children:r})]})}function Pe({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,...u}){let d=(0,g.jsx)(Z,{logError:i,errorComponent:a});return r?d=(0,g.jsx)(Z,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(d=(0,g.jsx)(Z,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a})),(0,g.jsxs)(Q,{loadingComponent:e,isLoading:s,error:c,data:l,children:[d,(0,g.jsx)(X,{...u,children:o})]})}function Fe({query:e}){return{Context:({children:t,...n})=>(0,g.jsx)(Q,{isLoading:e.isLoading,error:e.error,data:e.data??e.dataCollection,...n,children:t}),Error:Ce,Data:Y,DataMap:X,Fallback:Z,Nullable:we}}function Ie(e){let[t,n]=(0,v.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,v.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,v.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,v.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}function Le({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(A.default,{}),isLoading:s,error:c,data:l,...u}){let d=Fe({query:{isLoading:s,error:c,data:l}}),f=(0,g.jsx)(d.Fallback,{logError:a,errorComponent:t});return i?f=(0,g.jsx)(d.Fallback,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(f=(0,g.jsx)(d.Fallback,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),(0,g.jsxs)(d.Context,{loadingComponent:o,...u,children:[f,(0,g.jsx)(d.Data,{children:e})]})}function Re({code:e,previewStyles:t,...n}){let{mode:r}=q(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(L.LiveProvider,{...n,code:(0,re.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(L.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(L.LivePreview,{}),(0,g.jsx)(L.LiveError,{})]})]})})}function ze({columns:e}){return(0,g.jsx)(R.default,{children:(0,M.fillArray)(e=>(0,g.jsx)(ae.default,{children:(0,g.jsx)(ie.default,{})},e),e)})}const Be=je;function Ve({children:e,button:t=x.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(y.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(y.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,v.useState)(null),d=(0,v.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===x.default&&(f.endIcon=d?i:a),(0,v.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(z.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const He=(0,v.createContext)(void 0);function $({strict:e=!0}={}){let t=(0,v.useContext)(He);if(e&&!t)throw new O.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function Ue({strict:e=!0}={}){return $({strict:e})}function We({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=Ue();return(0,g.jsx)(z.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Ge({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(G.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Ke=$,qe=We,Je=Ge;var Ye=qe;function Xe({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ke();return(0,g.jsx)(G.default,{component:de,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ze({to:e,component:t=I.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Qe({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ke();return(0,g.jsx)(G.default,{component:Ze,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $e({icon:e=y.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,v.useState)(null),s=!!a,l=(0,v.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(K.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function et({children:e,...t}){return(0,g.jsx)(H.default,{component:Ze,...t,children:e})}const tt=Le,nt=Y,rt=Z,it=Q;function at(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function ot(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const st=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),ct=(0,S.styled)(B.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),lt=(0,S.styled)(V.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...at(e),"& .MuiDrawer-paper":at(e)}},{props:({open:e})=>!e,style:{...ot(e),"& .MuiDrawer-paper":ot(e)}}]}));function ut({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,I.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(k.default,{}),(0,g.jsx)(ct,{position:`fixed`,open:a,children:(0,g.jsxs)(W.default,{children:[(0,g.jsx)(C.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(y.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(lt,{variant:`permanent`,open:a,children:[(0,g.jsx)(st,{children:(0,g.jsx)(C.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(y.MdChevronRight,{}):(0,g.jsx)(y.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(v.Fragment,{children:[(0,g.jsxs)(w.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,M.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(H.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:I.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(U.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,M.truncate)(e.label,4)})}),(0,g.jsx)(E.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(st,{}),n]})]})}function dt({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
2
+ `).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}const ft=Le;function pt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,oe.useFormContext)();return(0,g.jsx)(x.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}exports.Artwork=le,exports.CollapsableItem=ue,exports.DarkModeToggle=Be,exports.DropdownMenu=Ve,exports.DropdownMenu2=Ye,exports.DropdownMenuExternalLink=Xe,exports.DropdownMenuInternalLink=Qe,exports.DropdownMenuItem=Je,exports.ExternalLink=de,exports.FileInput=he,exports.FileInputList=ge,exports.FileType=fe,exports.IconWithPopover=$e,exports.InternalLink=Ze,exports.ListItemInternalLink=et,exports.Loader=tt,exports.LoaderData=nt,exports.LoaderError=rt,exports.LoaderProvider=it,exports.ModeProvider=be,exports.ModeToggle=je,exports.NavigationBottom=Me,exports.NavigationDrawer=ut,exports.Page=Ne,exports.PopoverText=dt,exports.QueryBoundary=ft,exports.QueryBoundaryData=Y,exports.QueryBoundaryDataMap=X,exports.QueryBoundaryError=Ce,exports.QueryBoundaryFallback=Z,exports.QueryBoundaryMap=Pe,exports.QueryBoundaryNullable=we,exports.QueryBoundaryProvider=Q,exports.QueryBoundaryWrapper=Le,exports.ReactPlayground=Re,exports.ScreenSizeProvider=De,exports.SkeletonRow=ze,exports.SnackbarProvider=Ae,exports.SubmitButton=pt,exports.SwitchWithIcons=ve,exports.createQueryBoundary=Fe,exports.useDropdownMenu=Ke,exports.useHash=Ie,exports.useMode=q,exports.useScreenSize=Ee,exports.useSnackbar=ke;
3
3
  //# sourceMappingURL=index.cjs.map