@alextheman/components 6.25.1 → 6.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,6 @@
7
7
  [![CI](https://github.com/alextheman231/components/actions/workflows/ci.yml/badge.svg)](https://github.com/alextheman231/components/actions/workflows/ci.yml)
8
8
  [![Publish to NPM Registry and GitHub Releases/Pages](https://github.com/alextheman231/components/actions/workflows/publish.yml/badge.svg)](https://github.com/alextheman231/components/actions/workflows/publish.yml)
9
9
 
10
-
11
10
  This is a React component library used across my projects. It is built with React and Material UI, and integrates with tools such as react-router-dom (soon to be replaced with Wouter) and react-hook-form (soon to be replaced with TanStack Form).
12
11
 
13
12
  ## Installation
@@ -42,6 +41,6 @@ function MyComponent() {
42
41
 
43
42
  ## Documentation
44
43
 
45
- The hosted documentation site uses Storybook to provide interactive demos and general documentation of the features of the package. It can be found [here](https://alextheman231.github.io/components/).
44
+ The hosted documentation site uses Storybook to provide interactive demos and general documentation of the features of the package. See [the hosted Storybook site](https://alextheman231.github.io/components/).
46
45
 
47
- See the GitHub repository [here](https://github.com/alextheman231/components).
46
+ See [the GitHub repository](https://github.com/alextheman231/components).
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 v=require(`@mui/material/Collapse`);v=s(v,1);let y=require(`react`),b=require(`react-icons/md`),x=require(`@mui/material/Link`);x=s(x,1);let S=require(`@mui/material/Button`);S=s(S,1);let C=require(`@mui/material/styles`),w=require(`@mui/material/IconButton`);w=s(w,1);let T=require(`@mui/material/List`);T=s(T,1);let E=require(`@mui/material/ListItem`);E=s(E,1);let D=require(`@mui/material/ListItemText`);D=s(D,1);let O=require(`@mui/material/Tooltip`);O=s(O,1);let k=require(`@mui/material/Switch`);k=s(k,1);let A=require(`@alextheman/utility/v6`),j=require(`@mui/material/CssBaseline`);j=s(j,1);let M=require(`@alextheman/utility`),N=require(`@mui/material/Alert`);N=s(N,1);let ee=require(`@mui/material/Snackbar`);ee=s(ee,1);let P=require(`@mui/material/CircularProgress`);P=s(P,1);let te=require(`common-tags`),F=require(`react-live`),I=require(`@mui/material/Skeleton`);I=s(I,1);let L=require(`@mui/material/TableCell`);L=s(L,1);let R=require(`@mui/material/TableRow`);R=s(R,1);let z=require(`@mui/material/Menu`);z=s(z,1);let ne=require(`@mui/material/BottomNavigation`);ne=s(ne,1);let re=require(`@mui/material/BottomNavigationAction`);re=s(re,1);let ie=require(`@mui/material/Paper`);ie=s(ie,1);let ae=require(`@mui/material/AppBar`);ae=s(ae,1);let B=require(`@mui/material/Drawer`);B=s(B,1);let V=require(`@mui/material/ListItemButton`);V=s(V,1);let H=require(`@mui/material/ListItemIcon`);H=s(H,1);let U=require(`@mui/material/Toolbar`);U=s(U,1);let W=require(`@mui/material/MenuItem`);W=s(W,1);let G=require(`react-router-dom`),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)(b.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(b.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,y.useState)(!!e);return(0,y.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)(v.default,{in:f,...s,children:r})]})}function de({href:e,children:t,ref:n,...r}){return(0,g.jsx)(x.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,C.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,C.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,y.useState)(!1),c=(0,y.useId)(),l=(0,g.jsxs)(S.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)(b.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)(T.default,{children:e.map(e=>(0,g.jsx)(E.default,{secondaryAction:(0,g.jsx)(w.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(b.MdDelete,{})}),children:(0,g.jsx)(D.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const _e=(0,C.styled)(k.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,y.createContext)(void 0);function be({strict:e=!0}={}){let t=(0,y.useContext)(ye);if(e&&!t)throw new A.DataError({strict:e,context:t},`AUDIO_PROVIDER_NOT_FOUND`,`Could not find the AudioProvider context. Please double-check that it is present.`);return t}function xe({tracks:e,children:t}){let[n,r]=(0,y.useState)(e[0]);return(0,g.jsx)(ye.Provider,{value:{tracks:e,currentTrack:n,setCurrentTrack:r},children:t})}function Se(){let{currentTrack:e}=be();return(0,g.jsx)(`audio`,{src:e.src,controls:!0,children:(0,g.jsx)(`track`,{kind:`captions`})})}const Ce=(0,y.createContext)({toggleMode:()=>{},mode:`dark`});function q({strict:e=!0}={}){let t=(0,y.useContext)(Ce);if(e&&!t)throw new A.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 we({children:e,mode:t=`dark`}){let[n,r]=(0,y.useState)(t),i=(0,y.useMemo)(()=>(0,C.createTheme)({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return(0,g.jsx)(Ce.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(C.ThemeProvider,{theme:i,children:[(0,g.jsx)(j.default,{}),e]})})}const Te=(0,y.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ee({strict:e=!0}={}){let t=(0,y.useContext)(Te);if(e&&!t)throw new A.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,y.useState)(window.innerWidth),[a,o]=(0,y.useState)(window.innerHeight);(0,y.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,y.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,y.createContext)(void 0);function ke({strict:e=!0}={}){let t=(0,y.useContext)(Oe);if(e&&!t)throw new A.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,y.useState)(!1),[i,a]=(0,y.useState)(t),[o,s]=(0,y.useState)(``),[c,l]=(0,y.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)(ee.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(N.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)(O.default,{title:r,children:(0,g.jsx)(ve,{uncheckedIcon:b.MdOutlineLightMode,checkedIcon:b.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Me({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})]})}const Ne=(0,y.createContext)(void 0);function J({strict:e=!0}={}){let t=(0,y.useContext)(Ne);if(e&&!t)throw new A.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 Y({children:e,loadingComponent:t=(0,g.jsx)(P.default,{}),...n}){return(0,g.jsx)(Ne.Provider,{value:{loadingComponent:t,...n},children:e})}function X({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=J(),o=t??a,s=(0,y.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)(N.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 Z({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)(N.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function Q({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(X,{logError:t,children:e}),(0,g.jsx)(Z,{...n})]})}function Pe({query:e}){return{Context:({children:t})=>(0,g.jsx)(Y,{isLoading:e.isLoading,error:e.error,data:e.data,children:t}),Error:X,Fallback:Q,Nullable:Z}}function Fe({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 A.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)(y.Fragment,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function Ie({query:e}){return{...Pe({query:e}),DataMap:Fe}}function Le({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,dataParser:u,itemParser:d,itemKey:f}){let p=Ie({query:{isLoading:s,error:c,data:l}}),m=(0,g.jsx)(p.Fallback,{logError:i,errorComponent:a});r?m=(0,g.jsx)(p.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(m=(0,g.jsx)(p.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,children:o});return u?h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,dataParser:u,children:o}):d&&(h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,itemParser:d,children:o})),(0,g.jsxs)(p.Context,{children:[m,h]})}function $({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=J(),c=t??a;return s?null:r?(0,g.jsx)(g.Fragment,{children:n??o}):i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Re({query:e}){return{...Pe({query:e}),Data:$}}function ze({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(P.default,{}),isLoading:s,error:c,data:l,dataParser:u}){let d=Re({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,{children:[f,(0,g.jsx)(d.Data,{loadingComponent:o,dataParser:u,children:e})]})}function Be({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)(F.LiveProvider,{...n,code:(0,te.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)(F.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)(F.LivePreview,{}),(0,g.jsx)(F.LiveError,{})]})]})})}function Ve({columns:e}){return(0,g.jsx)(R.default,{children:(0,M.fillArray)(e=>(0,g.jsx)(L.default,{children:(0,g.jsx)(I.default,{})},e),e)})}const He=je;function Ue({children:e,button:t=S.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(b.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(b.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,y.useState)(null),d=(0,y.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===S.default&&(f.endIcon=d?i:a),(0,y.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 We=(0,y.createContext)(void 0);function Ge({strict:e=!0}={}){let t=(0,y.useContext)(We);if(e&&!t)throw new A.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 Ke({strict:e=!0}={}){return Ge({strict:e})}function qe({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=Ke();return(0,g.jsx)(z.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Je({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(W.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Ye=Ge,Xe=qe,Ze=Je;var Qe=Xe;function $e({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ye();return(0,g.jsx)(W.default,{component:de,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function et({to:e,component:t=G.Link,children:n,ref:r,...i}){return(0,g.jsx)(x.default,{component:t,to:e,ref:r,...i,children:n})}function tt({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ye();return(0,g.jsx)(W.default,{component:et,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function nt({icon:e=b.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,y.useState)(null),s=!!a,l=(0,y.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 rt({children:e,...t}){return(0,g.jsx)(V.default,{component:et,...t,children:e})}const it=ze;function at({query:e}){return{Context:({children:t})=>(0,g.jsx)(Y,{isLoading:e.isLoading,error:e.error,data:`data`in e?e.data:e.dataCollection,children:t}),Error:X,Data:$,DataMap:Fe,Fallback:Q,Nullable:Z}}const ot=$,st=Q,ct=Y;function lt({children:e,navItems:t}){let[n,r]=(0,y.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(ie.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(ne.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(re.default,{...e,component:G.Link},e.value))})})]})}function ut(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function dt(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 ft=(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),pt=(0,C.styled)(ae.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})}}]})),mt=(0,C.styled)(B.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...ut(e),"& .MuiDrawer-paper":ut(e)}},{props:({open:e})=>!e,style:{...dt(e),"& .MuiDrawer-paper":dt(e)}}]}));function ht({title:e,navItems:t,children:n,headerElements:r}){let i=(0,C.useTheme)(),[a,o]=(0,y.useState)(!0),s=(0,G.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(j.default,{}),(0,g.jsx)(pt,{position:`fixed`,open:a,children:(0,g.jsxs)(U.default,{children:[(0,g.jsx)(w.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(b.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(mt,{variant:`permanent`,open:a,children:[(0,g.jsx)(ft,{children:(0,g.jsx)(w.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(b.MdChevronRight,{}):(0,g.jsx)(b.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(y.Fragment,{children:[(0,g.jsxs)(T.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)(E.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(V.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:G.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(H.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)(D.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)(ft,{}),n]})]})}function gt({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 _t=ze;function vt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,oe.useFormContext)();return(0,g.jsx)(S.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}function yt(e,t=500){let[n,r]=(0,y.useState)(e);return(0,y.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function bt(e){let[t,n]=(0,y.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,y.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,y.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,y.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=le,exports.AudioControls=Se,exports.AudioProvider=xe,exports.CollapsableItem=ue,exports.DarkModeToggle=He,exports.DropdownMenu=Ue,exports.DropdownMenu2=Qe,exports.DropdownMenuExternalLink=$e,exports.DropdownMenuInternalLink=tt,exports.DropdownMenuItem=Ze,exports.ExternalLink=de,exports.FileInput=he,exports.FileInputList=ge,exports.FileType=fe,exports.IconWithPopover=nt,exports.InternalLink=et,exports.ListItemInternalLink=rt,exports.Loader=it,exports.LoaderData=ot,exports.LoaderError=st,exports.LoaderProvider=ct,exports.ModeProvider=we,exports.ModeToggle=je,exports.NavigationBottom=lt,exports.NavigationDrawer=ht,exports.Page=Me,exports.PopoverText=gt,exports.QueryBoundary=_t,exports.QueryBoundaryData=$,exports.QueryBoundaryDataMap=Fe,exports.QueryBoundaryError=X,exports.QueryBoundaryFallback=Q,exports.QueryBoundaryMap=Le,exports.QueryBoundaryNullable=Z,exports.QueryBoundaryProvider=Y,exports.QueryBoundaryWrapper=ze,exports.ReactPlayground=Be,exports.ScreenSizeProvider=De,exports.SkeletonRow=Ve,exports.SnackbarProvider=Ae,exports.SubmitButton=vt,exports.SwitchWithIcons=ve,exports.createBaseQueryBoundary=Pe,exports.createItemQueryBoundary=Re,exports.createListQueryBoundary=Ie,exports.createQueryBoundary=at,exports.useAudioContext=be,exports.useDebounce=yt,exports.useDropdownMenu=Ye,exports.useHash=bt,exports.useMode=q,exports.useQueryBoundary=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 O=require("@mui/material/Switch");O=s(O,1);let k=require("@alextheman/utility/v6"),A=require("@mui/material/CssBaseline");A=s(A,1);let j=require("@alextheman/utility"),M=require("@mui/material/Alert");M=s(M,1);let N=require("@mui/material/Snackbar");N=s(N,1);let P=require("@mui/material/CircularProgress");P=s(P,1);let te=require("common-tags"),F=require("react-live"),I=require("@mui/material/Skeleton");I=s(I,1);let L=require("@mui/material/TableCell");L=s(L,1);let R=require("@mui/material/TableRow");R=s(R,1);let z=require("@mui/material/Menu");z=s(z,1);let ne=require("@mui/material/BottomNavigation");ne=s(ne,1);let re=require("@mui/material/BottomNavigationAction");re=s(re,1);let ie=require("@mui/material/Paper");ie=s(ie,1);let ae=require("@mui/material/AppBar");ae=s(ae,1);let oe=require("@mui/material/Drawer");oe=s(oe,1);let B=require("@mui/material/ListItemButton");B=s(B,1);let V=require("@mui/material/ListItemIcon");V=s(V,1);let H=require("@mui/material/Toolbar");H=s(H,1);let U=require("@mui/material/MenuItem");U=s(U,1);let W=require("react-router-dom"),G=require("@mui/material/Popover");G=s(G,1);let se=require("react-hook-form");function ce({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 le(){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 ue(){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)(ce,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(le,{}),(0,g.jsx)(ce,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function de({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,t,n]),(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 fe({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 pe={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`},me=(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}),he=(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 ge({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)(me,{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)(he,{$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 _e({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)(ge,{...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 ve=(0,S.styled)(O.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ye({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)(ve,{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 be=(0,v.createContext)(void 0);function xe({strict:e=!0}={}){let t=(0,v.use)(be);if(e&&!t)throw new k.DataError({strict:e,context:t},`AUDIO_PROVIDER_NOT_FOUND`,`Could not find the AudioProvider context. Please double-check that it is present.`);return t}function Se({tracks:e,children:t}){let[n,r]=(0,v.useState)(e[0]);return(0,g.jsx)(be,{value:{tracks:e,currentTrack:n,setCurrentTrack:r},children:t})}function Ce(){let{currentTrack:e}=xe();return(0,g.jsx)(`audio`,{src:e.src,controls:!0,children:(0,g.jsx)(`track`,{kind:`captions`})})}const we=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function K({strict:e=!0}={}){let t=(0,v.use)(we);if(e&&!t)throw new k.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 Te({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)(we,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(A.default,{}),e]})})}const Ee=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function De({strict:e=!0}={}){let t=(0,v.use)(Ee);if(e&&!t)throw new k.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}let Oe={windowWidth:window.innerWidth,windowHeight:window.innerHeight};function ke(){return Oe}function Ae(e){function t(){Oe={windowWidth:window.innerWidth,windowHeight:window.innerHeight},e()}return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)}}function je({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let{windowWidth:r,windowHeight:i}=(0,v.useSyncExternalStore)(Ae,ke);return(0,g.jsx)(Ee,{value:{isLargeScreen:(0,v.useMemo)(()=>r>t&&i>n,[r,i,t,n]),windowWidth:r,windowHeight:i},children:e})}const Me=(0,v.createContext)(void 0);function Ne({strict:e=!0}={}){let t=(0,v.use)(Me);if(e&&!t)throw new k.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 Pe({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,j.wait)(.2),s(``)}return(0,g.jsxs)(Me,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(M.default,{onClose:d,severity:c,children:o})}),e]})}function Fe(){let{mode:e,toggleMode:t}=K(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ye,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Ie({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})]})}const Le=(0,v.createContext)(void 0);function q({strict:e=!0}={}){let t=(0,v.use)(Le);if(e&&!t)throw new k.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 J({children:e,loadingComponent:t=(0,g.jsx)(P.default,{}),...n}){return(0,g.jsx)(Le,{value:{loadingComponent:t,...n},children:e})}function Y({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=q(),o=t??a,s=(0,v.useRef)(!1),c=e??i;return r?(o&&!s.current&&(n==null?console.error(r):console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),s.current=!0),typeof c==`function`?c(r):c===void 0?(0,g.jsx)(M.default,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured.`}):(0,g.jsx)(g.Fragment,{children:c})):null}function X({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=q();if(r||a)return null;if(i==null){if(n!==void 0)return(0,g.jsx)(g.Fragment,{children:n});if(i===void 0)return e===void 0?(0,g.jsx)(h.default,{children:`No data available.`}):(0,g.jsx)(g.Fragment,{children:e});if(i===null)return t===void 0?(0,g.jsx)(h.default,{children:`No data found.`}):(0,g.jsx)(g.Fragment,{children:t})}return null}function Z({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Y,{logError:t,children:e}),(0,g.jsx)(X,{...n})]})}function Re({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:e.data,children:t}),Error:Y,Fallback:Z,Nullable:X}}function ze({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}=q(),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 k.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 Be({query:e}){return{...Re({query:e}),DataMap:ze}}function Ve({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,dataParser:u,itemParser:d,itemKey:f}){let p=Be({query:{isLoading:s,error:c,data:l}}),m=(0,g.jsx)(p.Fallback,{logError:i,errorComponent:a});r?m=(0,g.jsx)(p.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(m=(0,g.jsx)(p.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,children:o});return u?h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,dataParser:u,children:o}):d&&(h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,itemParser:d,children:o})),(0,g.jsxs)(p.Context,{children:[m,h]})}function Q({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=q(),c=t??a;return s?null:r?(0,g.jsx)(g.Fragment,{children:n??o}):i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function He({query:e}){return{...Re({query:e}),Data:Q}}function $({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(P.default,{}),isLoading:s,error:c,data:l,dataParser:u}){let d=He({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,{children:[f,(0,g.jsx)(d.Data,{loadingComponent:o,dataParser:u,children:e})]})}function Ue({code:e,previewStyles:t,...n}){let{mode:r}=K(),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)(F.LiveProvider,{...n,code:(0,te.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)(F.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)(F.LivePreview,{}),(0,g.jsx)(F.LiveError,{})]})]})})}function We({columns:e}){return(0,g.jsx)(R.default,{children:(0,j.fillArray)(e=>(0,g.jsx)(L.default,{children:(0,g.jsx)(I.default,{})},e),e)})}const Ge=Fe;function Ke({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 qe=(0,v.createContext)(void 0);function Je({strict:e=!0}={}){let t=(0,v.use)(qe);if(e&&!t)throw new k.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 Ye({strict:e=!0}={}){return Je({strict:e})}function Xe({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=Ye();return(0,g.jsx)(z.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Ze({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Je();return(0,g.jsx)(U.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Qe=Je,$e=Xe,et=Ze;var tt=$e;function nt({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Qe();return(0,g.jsx)(U.default,{component:fe,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function rt({to:e,component:t=W.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function it({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Qe();return(0,g.jsx)(U.default,{component:rt,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function at({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)(G.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 ot({children:e,...t}){return(0,g.jsx)(B.default,{component:rt,...t,children:e})}const st=$;function ct({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:`data`in e?e.data:e.dataCollection,children:t}),Error:Y,Data:Q,DataMap:ze,Fallback:Z,Nullable:X}}const lt=Q,ut=Z,dt=J;function ft({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)(ie.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(ne.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(re.default,{...e,component:W.Link},e.value))})})]})}function pt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function mt(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 ht=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),gt=(0,S.styled)(ae.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})}}]})),_t=(0,S.styled)(oe.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...pt(e),"& .MuiDrawer-paper":pt(e)}},{props:({open:e})=>!e,style:{...mt(e),"& .MuiDrawer-paper":mt(e)}}]}));function vt({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,W.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(A.default,{}),(0,g.jsx)(gt,{position:`fixed`,open:a,children:(0,g.jsxs)(H.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)(_t,{variant:`permanent`,open:a,children:[(0,g.jsx)(ht,{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,j.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(B.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:W.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(V.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,j.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)(ht,{}),n]})]})}function yt({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 bt=$;function xt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,se.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 St(e,t=500){let[n,r]=(0,v.useState)(e);return(0,v.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Ct(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=ue,exports.AudioControls=Ce,exports.AudioProvider=Se,exports.CollapsableItem=de,exports.DarkModeToggle=Ge,exports.DropdownMenu=Ke,exports.DropdownMenu2=tt,exports.DropdownMenuExternalLink=nt,exports.DropdownMenuInternalLink=it,exports.DropdownMenuItem=et,exports.ExternalLink=fe,exports.FileInput=ge,exports.FileInputList=_e,exports.FileType=pe,exports.IconWithPopover=at,exports.InternalLink=rt,exports.ListItemInternalLink=ot,exports.Loader=st,exports.LoaderData=lt,exports.LoaderError=ut,exports.LoaderProvider=dt,exports.ModeProvider=Te,exports.ModeToggle=Fe,exports.NavigationBottom=ft,exports.NavigationDrawer=vt,exports.Page=Ie,exports.PopoverText=yt,exports.QueryBoundary=bt,exports.QueryBoundaryData=Q,exports.QueryBoundaryDataMap=ze,exports.QueryBoundaryError=Y,exports.QueryBoundaryFallback=Z,exports.QueryBoundaryMap=Ve,exports.QueryBoundaryNullable=X,exports.QueryBoundaryProvider=J,exports.QueryBoundaryWrapper=$,exports.ReactPlayground=Ue,exports.ScreenSizeProvider=je,exports.SkeletonRow=We,exports.SnackbarProvider=Pe,exports.SubmitButton=xt,exports.SwitchWithIcons=ye,exports.createBaseQueryBoundary=Re,exports.createItemQueryBoundary=He,exports.createListQueryBoundary=Be,exports.createQueryBoundary=ct,exports.useAudioContext=xe,exports.useDebounce=St,exports.useDropdownMenu=Qe,exports.useHash=Ct,exports.useMode=K,exports.useQueryBoundary=q,exports.useScreenSize=De,exports.useSnackbar=Ne;
3
3
  //# sourceMappingURL=index.cjs.map