import{T as _e,d as Le,c as je,b as Re,g as Ae,a as Ne,s as Oe,u as Ve}from"./useThemeProps-95e03d4e.js";import{j as E,r as a,Y as m,es as Ke,W as Se,et as H,f as ue,eu as G,ay as ze,a8 as Ue}from"./index-ca24af84.js";import{u as We,T as Be}from"./ThemeProvider-230a01f4.js";import{u as Fe,c as Ge}from"./useSlot-32c61900.js";const Y="mode",J="color-scheme",ge="data-color-scheme";function qe(o){const{defaultMode:e="light",defaultLightColorScheme:s="light",defaultDarkColorScheme:c="dark",modeStorageKey:x=Y,colorSchemeStorageKey:d=J,attribute:l=ge,colorSchemeNode:n="document.documentElement",nonce:h}=o||{};return E("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(function() {
try {
  var mode = localStorage.getItem('${x}') || '${e}';
  var colorScheme = '';
  if (mode === 'system') {
    // handle system mode
    var mql = window.matchMedia('(prefers-color-scheme: dark)');
    if (mql.matches) {
      colorScheme = localStorage.getItem('${d}-dark') || '${c}';
    } else {
      colorScheme = localStorage.getItem('${d}-light') || '${s}';
    }
  }
  if (mode === 'light') {
    colorScheme = localStorage.getItem('${d}-light') || '${s}';
  }
  if (mode === 'dark') {
    colorScheme = localStorage.getItem('${d}-dark') || '${c}';
  }
  if (colorScheme) {
    ${n}.setAttribute('${l}', colorScheme);
  }
} catch(e){}})();`}},"mui-color-scheme-init")}function fe(o){if(typeof window<"u"&&o==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function pe(o,e){if(o.mode==="light"||o.mode==="system"&&o.systemMode==="light")return e("light");if(o.mode==="dark"||o.mode==="system"&&o.systemMode==="dark")return e("dark")}function He(o){return pe(o,e=>{if(e==="light")return o.lightColorScheme;if(e==="dark")return o.darkColorScheme})}function q(o,e){if(typeof window>"u")return;let s;try{s=localStorage.getItem(o)||void 0,s||localStorage.setItem(o,e)}catch{}return s||e}function Ye(o){const{defaultMode:e="light",defaultLightColorScheme:s,defaultDarkColorScheme:c,supportedColorSchemes:x=[],modeStorageKey:d=Y,colorSchemeStorageKey:l=J,storageWindow:n=typeof window>"u"?void 0:window}=o,h=x.join(","),[S,p]=a.useState(()=>{const r=q(d,e),t=q(`${l}-light`,s),i=q(`${l}-dark`,c);return{mode:r,systemMode:fe(r),lightColorScheme:t,darkColorScheme:i}}),$=He(S),b=a.useCallback(r=>{p(t=>{if(r===t.mode)return t;const i=r??e;try{localStorage.setItem(d,i)}catch{}return m({},t,{mode:i,systemMode:fe(i)})})},[d,e]),y=a.useCallback(r=>{r?typeof r=="string"?r&&!h.includes(r)?console.error(`\`${r}\` does not exist in \`theme.colorSchemes\`.`):p(t=>{const i=m({},t);return pe(t,u=>{try{localStorage.setItem(`${l}-${u}`,r)}catch{}u==="light"&&(i.lightColorScheme=r),u==="dark"&&(i.darkColorScheme=r)}),i}):p(t=>{const i=m({},t),u=r.light===null?s:r.light,I=r.dark===null?c:r.dark;if(u)if(!h.includes(u))console.error(`\`${u}\` does not exist in \`theme.colorSchemes\`.`);else{i.lightColorScheme=u;try{localStorage.setItem(`${l}-light`,u)}catch{}}if(I)if(!h.includes(I))console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`);else{i.darkColorScheme=I;try{localStorage.setItem(`${l}-dark`,I)}catch{}}return i}):p(t=>{try{localStorage.setItem(`${l}-light`,s),localStorage.setItem(`${l}-dark`,c)}catch{}return m({},t,{lightColorScheme:s,darkColorScheme:c})})},[h,l,s,c]),w=a.useCallback(r=>{S.mode==="system"&&p(t=>{const i=r!=null&&r.matches?"dark":"light";return t.systemMode===i?t:m({},t,{systemMode:i})})},[S.mode]),T=a.useRef(w);return T.current=w,a.useEffect(()=>{const r=(...i)=>T.current(...i),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(r),r(t),()=>{t.removeListener(r)}},[]),a.useEffect(()=>{if(n){const r=t=>{const i=t.newValue;typeof t.key=="string"&&t.key.startsWith(l)&&(!i||h.match(i))&&(t.key.endsWith("light")&&y({light:i}),t.key.endsWith("dark")&&y({dark:i})),t.key===d&&(!i||["light","dark","system"].includes(i))&&b(i||e)};return n.addEventListener("storage",r),()=>{n.removeEventListener("storage",r)}}},[y,b,d,l,h,e,n]),m({},S,{colorScheme:$,setMode:b,setColorScheme:y})}const Je=["colorSchemes","components","generateCssVars","cssVarPrefix"],Qe="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Xe(o){const{themeId:e,theme:s={},attribute:c=ge,modeStorageKey:x=Y,colorSchemeStorageKey:d=J,defaultMode:l="light",defaultColorScheme:n,disableTransitionOnChange:h=!1,resolveTheme:S,excludeVariablesFromRoot:p}=o;(!s.colorSchemes||typeof n=="string"&&!s.colorSchemes[n]||typeof n=="object"&&!s.colorSchemes[n==null?void 0:n.light]||typeof n=="object"&&!s.colorSchemes[n==null?void 0:n.dark])&&console.error(`MUI: \`${n}\` does not exist in \`theme.colorSchemes\`.`);const $=a.createContext(void 0),b=()=>{const t=a.useContext($);if(!t)throw new Error(Ke(19));return t};function y(t){const{children:i,theme:u=s,modeStorageKey:I=x,colorSchemeStorageKey:A=d,attribute:P=c,defaultMode:L=l,defaultColorScheme:v=n,disableTransitionOnChange:Q=h,storageWindow:Ce=typeof window>"u"?void 0:window,documentNode:M=typeof document>"u"?void 0:document,colorSchemeNode:N=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:j=":root",disableNestedContext:ye=!1,disableStyleSheetGeneration:ke=!1}=t,O=a.useRef(!1),X=We(),V=a.useContext($),K=!!V&&!ye,Z=u[e],ee=Z||u,{colorSchemes:z={},components:De={},generateCssVars:oe=()=>({vars:{},css:{}}),cssVarPrefix:U}=ee,xe=Se(ee,Je),W=Object.keys(z),te=typeof v=="string"?v:v.light,re=typeof v=="string"?v:v.dark,{mode:Ie,setMode:ie,systemMode:ne,lightColorScheme:se,darkColorScheme:le,colorScheme:$e,setColorScheme:ce}=Ye({supportedColorSchemes:W,defaultLightColorScheme:te,defaultDarkColorScheme:re,modeStorageKey:I,colorSchemeStorageKey:A,defaultMode:L,storageWindow:Ce});let _=Ie,k=$e;K&&(_=V.mode,k=V.colorScheme);const be=(()=>_||(L==="system"?l:L))(),Me=(()=>k||(be==="dark"?re:te))(),{css:Ee,vars:ae}=oe(),g=m({},xe,{components:De,colorSchemes:z,cssVarPrefix:U,vars:ae,getColorSchemeSelector:f=>`[${P}="${f}"] &`}),B={},de={};Object.entries(z).forEach(([f,D])=>{const{css:R,vars:Te}=oe(f);g.vars=H(g.vars,Te),f===Me&&(Object.keys(D).forEach(C=>{D[C]&&typeof D[C]=="object"?g[C]=m({},g[C],D[C]):g[C]=D[C]}),g.palette&&(g.palette.colorScheme=f));const Pe=(()=>typeof v=="string"?v:L==="dark"?v.dark:v.light)();if(f===Pe){if(p){const C={};p(U).forEach(F=>{C[F]=R[F],delete R[F]}),B[`[${P}="${f}"]`]=C}B[`${j}, [${P}="${f}"]`]=R}else de[`${j===":root"?"":j}[${P}="${f}"]`]=R}),g.vars=H(g.vars,ae),a.useEffect(()=>{k&&N&&N.setAttribute(P,k)},[k,P,N]),a.useEffect(()=>{let f;if(Q&&O.current&&M){const D=M.createElement("style");D.appendChild(M.createTextNode(Qe)),M.head.appendChild(D),window.getComputedStyle(M.body),f=setTimeout(()=>{M.head.removeChild(D)},1)}return()=>{clearTimeout(f)}},[k,Q,M]),a.useEffect(()=>(O.current=!0,()=>{O.current=!1}),[]);const we=a.useMemo(()=>({allColorSchemes:W,colorScheme:k,darkColorScheme:le,lightColorScheme:se,mode:_,setColorScheme:ce,setMode:ie,systemMode:ne}),[W,k,le,se,_,ce,ie,ne]);let me=!0;(ke||K&&(X==null?void 0:X.cssVarPrefix)===U)&&(me=!1);const he=ue(a.Fragment,{children:[me&&ue(a.Fragment,{children:[E(G,{styles:{[j]:Ee}}),E(G,{styles:B}),E(G,{styles:de})]}),E(Be,{themeId:Z?e:void 0,theme:S?S(g):g,children:i})]});return K?he:E($.Provider,{value:we,children:he})}const w=typeof n=="string"?n:n.light,T=typeof n=="string"?n:n.dark;return{CssVarsProvider:y,useColorScheme:b,getInitColorSchemeScript:t=>qe(m({attribute:c,colorSchemeStorageKey:d,defaultMode:l,defaultLightColorScheme:w,defaultDarkColorScheme:T,modeStorageKey:x},t))}}const{CssVarsProvider:lo,useColorScheme:co,getInitColorSchemeScript:ao}=Xe({themeId:_e,theme:Le,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:o=>{const e=o.colorInversion;return o.colorInversion=H({soft:je(o),solid:Re(o)},typeof e=="function"?e(o):e,{clone:!1}),o}});function Ze(o){return Ae("MuiDivider",o)}Ne("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);const eo=["className","children","component","inset","orientation","role","slots","slotProps"],oo=o=>{const{orientation:e,inset:s}=o,c={root:["root",e,s&&`inset${ze(s)}`]};return Ue(c,Ze,{})},to=Oe("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(o,e)=>e.root})(({theme:o,ownerState:e})=>m({"--Divider-thickness":"1px","--Divider-lineColor":o.vars.palette.divider},e.inset==="none"&&{"--_Divider-inset":"0px"},e.inset==="context"&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:e.orientation==="vertical"?"initial":"var(--_Divider-inset)",marginBlock:e.orientation==="vertical"?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},e.children?m({"--Divider-gap":o.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:e.orientation==="vertical"?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},o.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:e.orientation==="vertical"?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:e.orientation==="vertical"?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:e.orientation==="vertical"?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:e.orientation==="vertical"?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)"})),ve=a.forwardRef(function(e,s){const c=Ve({props:e,name:"JoyDivider"}),{className:x,children:d,component:l=d!=null?"div":"hr",inset:n,orientation:h="horizontal",role:S=l!=="hr"?"separator":void 0,slots:p={},slotProps:$={}}=c,b=Se(c,eo),y=m({},c,{inset:n,role:S,orientation:h,component:l}),w=oo(y),T=m({},b,{component:l,slots:p,slotProps:$}),[r,t]=Fe("root",{ref:s,className:Ge(w.root,x),elementType:to,externalForwardedProps:T,ownerState:y,additionalProps:m({as:l,role:S},S==="separator"&&h==="vertical"&&{"aria-orientation":"vertical"})});return E(r,m({},t,{children:d}))});ve.muiName="Divider";const mo=ve;export{lo as C,mo as D};
