omnieye-theme-studio 1.3.3 → 1.3.4

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.esm.js CHANGED
@@ -4052,7 +4052,7 @@ const Wr = (e) => (r) => {
4052
4052
  tableRowDivW: 1,
4053
4053
  tableColDivW: 1,
4054
4054
  tableStripe: !1,
4055
- tableHeaderStyle: "tinted",
4055
+ tableHeaderStyle: "accent",
4056
4056
  tableCellAlignH: "left",
4057
4057
  tableCellAlignV: "middle",
4058
4058
  notifPosition: "bottom-right",
package/dist/index.js CHANGED
@@ -71,4 +71,4 @@ theme.transitions = createTransitions(theme.transitions || {});
71
71
 
72
72
  export default theme;`}function Sn(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Bs=e=>{if(!Number.isNaN(+e))return+e;const r=e.match(/\d*\.?\d+/g);if(!r)return 0;let t=0;for(let o=0;o<r.length;o+=1)t+=+r[o];return t};function Rs(e){Object.assign(e,{alpha(r,t){const o=this||e;return o.colorSpace?`oklch(from ${r} l c h / ${typeof t=="string"?`calc(${t})`:t})`:o.vars?`rgba(${r.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof t=="string"?`calc(${t})`:t})`:Jn(r,Bs(t))},lighten(r,t){const o=this||e;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${r}, #fff ${Sn(t)})`:er(r,t)},darken(r,t){const o=this||e;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${r}, #000 ${Sn(t)})`:Zt(r,t)}})}function Sr(e={},...r){const{breakpoints:t,mixins:o={},spacing:i,palette:a={},transitions:s={},typography:l={},shape:d,colorSpace:g,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://v7.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":rt(20));const x=Er({...a,colorSpace:g}),m=Ln(e);let h=ke(m,{mixins:hs(m.breakpoints,o),palette:x,shadows:vs.slice(),typography:xs(x,l),transitions:js(s),zIndex:{...ks}});if(h=ke(h,f),h=r.reduce((y,u)=>ke(y,u),h),process.env.NODE_ENV!=="production"){const y=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],u=(b,v)=>{let k;for(k in b){const B=b[k];if(y.includes(k)&&Object.keys(B).length>0){if(process.env.NODE_ENV!=="production"){const S=Br("",k);console.error([`MUI: The \`${v}\` component increases the CSS specificity of the \`${k}\` internal state.`,"You can not override it like this: ",JSON.stringify(b,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:B}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
73
73
  `))}b[k]={}}}};Object.keys(h.components).forEach(b=>{const v=h.components[b].styleOverrides;v&&b.startsWith("Mui")&&u(v,b)})}return h.unstable_sxConfig={...Xt,...f==null?void 0:f.unstable_sxConfig},h.unstable_sx=function(u){return ut({sx:u,theme:this})},h.toRuntimeSource=Qn,Rs(h),h}function Es(e){let r;return e<1?r=5.11916*e**2:r=4.5*Math.log(e+1)+2,Math.round(r*10)/1e3}const Hs=[...Array(25)].map((e,r)=>{if(r===0)return"none";const t=Es(r);return`linear-gradient(rgba(255 255 255 / ${t}), rgba(255 255 255 / ${t}))`});function Zn(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function eo(e){return e==="dark"?Hs:[]}function Ps(e){const{palette:r={mode:"light"},opacity:t,overlays:o,colorSpace:i,...a}=e,s=Er({...r,colorSpace:i});return{palette:s,opacity:{...Zn(s.mode),...t},overlays:o||eo(s.mode),...a}}function $s(e){var r;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((r=e[1])!=null&&r.match(/(mode|contrastThreshold|tonalOffset)/))}const As=e=>[...[...Array(25)].map((r,t)=>`--${e?`${e}-`:""}overlays-${t}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Is=e=>(r,t)=>{const o=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if(i==="class"&&(a=".%s"),i==="data"&&(a="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===r){if(r==="dark"){const s={};return As(e.cssVarPrefix).forEach(l=>{s[l]=t[l],delete t[l]}),a==="media"?{[o]:t,"@media (prefers-color-scheme: dark)":{[o]:s}}:a?{[a.replace("%s",r)]:s,[`${o}, ${a.replace("%s",r)}`]:t}:{[o]:{...t,...s}}}if(a&&a!=="media")return`${o}, ${a.replace("%s",String(r))}`}else if(r){if(a==="media")return{[`@media (prefers-color-scheme: ${String(r)})`]:{[o]:t}};if(a)return a.replace("%s",String(r))}return o};function Ds(e,r){r.forEach(t=>{e[t]||(e[t]={})})}function T(e,r,t){!e[r]&&t&&(e[r]=t)}function bt(e){return typeof e!="string"||!e.startsWith("hsl")?e:Yn(e)}function $e(e,r){`${r}Channel`in e||(e[`${r}Channel`]=yt(bt(e[r]),`MUI: Can't create \`palette.${r}Channel\` because \`palette.${r}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
74
- To suppress this warning, you need to explicitly provide the \`palette.${r}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function Fs(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const He=e=>{try{return e()}catch{}},Os=(e="mui")=>es(e);function fr(e,r,t,o,i){if(!t)return;t=t===!0?{}:t;const a=i==="dark"?"dark":"light";if(!o){r[i]=Ps({...t,palette:{mode:a,...t==null?void 0:t.palette},colorSpace:e});return}const{palette:s,...l}=Sr({...o,palette:{mode:a,...t==null?void 0:t.palette},colorSpace:e});return r[i]={...t,palette:s,opacity:{...Zn(a),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||eo(a)},l}function Ms(e={},...r){const{colorSchemes:t={light:!0},defaultColorScheme:o,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:s=!1,shouldSkipGeneratingVar:l=$s,colorSchemeSelector:d=t.light&&t.dark?"media":void 0,rootSelector:g=":root",...f}=e,x=Object.keys(t)[0],m=o||(t.light&&x!=="light"?"light":x),h=Os(a),{[m]:y,light:u,dark:b,...v}=t,k={...v};let B=y;if((m==="dark"&&!("dark"in t)||m==="light"&&!("light"in t))&&(B=!0),!B)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${m}\` option is either missing or invalid.`:rt(21,m));let S;s&&(S="oklch");const j=fr(S,k,B,f,m);u&&!k.light&&fr(S,k,u,void 0,"light"),b&&!k.dark&&fr(S,k,b,void 0,"dark");let R={defaultColorScheme:m,...j,cssVarPrefix:a,colorSchemeSelector:d,rootSelector:g,getCssVar:h,colorSchemes:k,font:{...fs(j.typography),...j.font},spacing:Fs(f.spacing)};Object.keys(R.colorSchemes).forEach(U=>{const c=R.colorSchemes[U].palette,$=W=>{const N=W.split("-"),Y=N[1],L=N[2];return h(W,c[Y][L])};c.mode==="light"&&(T(c.common,"background","#fff"),T(c.common,"onBackground","#000")),c.mode==="dark"&&(T(c.common,"background","#000"),T(c.common,"onBackground","#fff"));function H(W,N,Y){if(S){let L;return W===Qe&&(L=`transparent ${((1-Y)*100).toFixed(0)}%`),W===ie&&(L=`#000 ${(Y*100).toFixed(0)}%`),W===ae&&(L=`#fff ${(Y*100).toFixed(0)}%`),`color-mix(in ${S}, ${N}, ${L})`}return W(N,Y)}if(Ds(c,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),c.mode==="light"){T(c.Alert,"errorColor",H(ie,s?h("palette-error-light"):c.error.light,.6)),T(c.Alert,"infoColor",H(ie,s?h("palette-info-light"):c.info.light,.6)),T(c.Alert,"successColor",H(ie,s?h("palette-success-light"):c.success.light,.6)),T(c.Alert,"warningColor",H(ie,s?h("palette-warning-light"):c.warning.light,.6)),T(c.Alert,"errorFilledBg",$("palette-error-main")),T(c.Alert,"infoFilledBg",$("palette-info-main")),T(c.Alert,"successFilledBg",$("palette-success-main")),T(c.Alert,"warningFilledBg",$("palette-warning-main")),T(c.Alert,"errorFilledColor",He(()=>c.getContrastText(c.error.main))),T(c.Alert,"infoFilledColor",He(()=>c.getContrastText(c.info.main))),T(c.Alert,"successFilledColor",He(()=>c.getContrastText(c.success.main))),T(c.Alert,"warningFilledColor",He(()=>c.getContrastText(c.warning.main))),T(c.Alert,"errorStandardBg",H(ae,s?h("palette-error-light"):c.error.light,.9)),T(c.Alert,"infoStandardBg",H(ae,s?h("palette-info-light"):c.info.light,.9)),T(c.Alert,"successStandardBg",H(ae,s?h("palette-success-light"):c.success.light,.9)),T(c.Alert,"warningStandardBg",H(ae,s?h("palette-warning-light"):c.warning.light,.9)),T(c.Alert,"errorIconColor",$("palette-error-main")),T(c.Alert,"infoIconColor",$("palette-info-main")),T(c.Alert,"successIconColor",$("palette-success-main")),T(c.Alert,"warningIconColor",$("palette-warning-main")),T(c.AppBar,"defaultBg",$("palette-grey-100")),T(c.Avatar,"defaultBg",$("palette-grey-400")),T(c.Button,"inheritContainedBg",$("palette-grey-300")),T(c.Button,"inheritContainedHoverBg",$("palette-grey-A100")),T(c.Chip,"defaultBorder",$("palette-grey-400")),T(c.Chip,"defaultAvatarColor",$("palette-grey-700")),T(c.Chip,"defaultIconColor",$("palette-grey-700")),T(c.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),T(c.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),T(c.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),T(c.LinearProgress,"primaryBg",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.LinearProgress,"secondaryBg",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.LinearProgress,"errorBg",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.LinearProgress,"infoBg",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.LinearProgress,"successBg",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.LinearProgress,"warningBg",H(ae,s?h("palette-warning-light"):c.warning.main,.62)),T(c.Skeleton,"bg",S?H(Qe,s?h("palette-text-primary"):c.text.primary,.11):`rgba(${$("palette-text-primaryChannel")} / 0.11)`),T(c.Slider,"primaryTrack",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.Slider,"secondaryTrack",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.Slider,"errorTrack",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.Slider,"infoTrack",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.Slider,"successTrack",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.Slider,"warningTrack",H(ae,s?h("palette-warning-main"):c.warning.main,.62));const W=S?H(ie,s?h("palette-background-default"):c.background.default,.6825):At(c.background.default,.8);T(c.SnackbarContent,"bg",W),T(c.SnackbarContent,"color",He(()=>S?vr.text.primary:c.getContrastText(W))),T(c.SpeedDialAction,"fabHoverBg",At(c.background.paper,.15)),T(c.StepConnector,"border",$("palette-grey-400")),T(c.StepContent,"border",$("palette-grey-400")),T(c.Switch,"defaultColor",$("palette-common-white")),T(c.Switch,"defaultDisabledColor",$("palette-grey-100")),T(c.Switch,"primaryDisabledColor",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.Switch,"secondaryDisabledColor",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.Switch,"errorDisabledColor",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.Switch,"infoDisabledColor",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.Switch,"successDisabledColor",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.Switch,"warningDisabledColor",H(ae,s?h("palette-warning-main"):c.warning.main,.62)),T(c.TableCell,"border",H(ae,Qe(s?h("palette-divider"):c.divider,1),.88)),T(c.Tooltip,"bg",H(Qe,s?h("palette-grey-700"):c.grey[700],.92))}if(c.mode==="dark"){T(c.Alert,"errorColor",H(ae,s?h("palette-error-light"):c.error.light,.6)),T(c.Alert,"infoColor",H(ae,s?h("palette-info-light"):c.info.light,.6)),T(c.Alert,"successColor",H(ae,s?h("palette-success-light"):c.success.light,.6)),T(c.Alert,"warningColor",H(ae,s?h("palette-warning-light"):c.warning.light,.6)),T(c.Alert,"errorFilledBg",$("palette-error-dark")),T(c.Alert,"infoFilledBg",$("palette-info-dark")),T(c.Alert,"successFilledBg",$("palette-success-dark")),T(c.Alert,"warningFilledBg",$("palette-warning-dark")),T(c.Alert,"errorFilledColor",He(()=>c.getContrastText(c.error.dark))),T(c.Alert,"infoFilledColor",He(()=>c.getContrastText(c.info.dark))),T(c.Alert,"successFilledColor",He(()=>c.getContrastText(c.success.dark))),T(c.Alert,"warningFilledColor",He(()=>c.getContrastText(c.warning.dark))),T(c.Alert,"errorStandardBg",H(ie,s?h("palette-error-light"):c.error.light,.9)),T(c.Alert,"infoStandardBg",H(ie,s?h("palette-info-light"):c.info.light,.9)),T(c.Alert,"successStandardBg",H(ie,s?h("palette-success-light"):c.success.light,.9)),T(c.Alert,"warningStandardBg",H(ie,s?h("palette-warning-light"):c.warning.light,.9)),T(c.Alert,"errorIconColor",$("palette-error-main")),T(c.Alert,"infoIconColor",$("palette-info-main")),T(c.Alert,"successIconColor",$("palette-success-main")),T(c.Alert,"warningIconColor",$("palette-warning-main")),T(c.AppBar,"defaultBg",$("palette-grey-900")),T(c.AppBar,"darkBg",$("palette-background-paper")),T(c.AppBar,"darkColor",$("palette-text-primary")),T(c.Avatar,"defaultBg",$("palette-grey-600")),T(c.Button,"inheritContainedBg",$("palette-grey-800")),T(c.Button,"inheritContainedHoverBg",$("palette-grey-700")),T(c.Chip,"defaultBorder",$("palette-grey-700")),T(c.Chip,"defaultAvatarColor",$("palette-grey-300")),T(c.Chip,"defaultIconColor",$("palette-grey-300")),T(c.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),T(c.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),T(c.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),T(c.LinearProgress,"primaryBg",H(ie,s?h("palette-primary-main"):c.primary.main,.5)),T(c.LinearProgress,"secondaryBg",H(ie,s?h("palette-secondary-main"):c.secondary.main,.5)),T(c.LinearProgress,"errorBg",H(ie,s?h("palette-error-main"):c.error.main,.5)),T(c.LinearProgress,"infoBg",H(ie,s?h("palette-info-main"):c.info.main,.5)),T(c.LinearProgress,"successBg",H(ie,s?h("palette-success-main"):c.success.main,.5)),T(c.LinearProgress,"warningBg",H(ie,s?h("palette-warning-main"):c.warning.main,.5)),T(c.Skeleton,"bg",S?H(Qe,s?h("palette-text-primary"):c.text.primary,.13):`rgba(${$("palette-text-primaryChannel")} / 0.13)`),T(c.Slider,"primaryTrack",H(ie,s?h("palette-primary-main"):c.primary.main,.5)),T(c.Slider,"secondaryTrack",H(ie,s?h("palette-secondary-main"):c.secondary.main,.5)),T(c.Slider,"errorTrack",H(ie,s?h("palette-error-main"):c.error.main,.5)),T(c.Slider,"infoTrack",H(ie,s?h("palette-info-main"):c.info.main,.5)),T(c.Slider,"successTrack",H(ie,s?h("palette-success-main"):c.success.main,.5)),T(c.Slider,"warningTrack",H(ie,s?h("palette-warning-light"):c.warning.main,.5));const W=S?H(ae,s?h("palette-background-default"):c.background.default,.985):At(c.background.default,.98);T(c.SnackbarContent,"bg",W),T(c.SnackbarContent,"color",He(()=>S?Kn.text.primary:c.getContrastText(W))),T(c.SpeedDialAction,"fabHoverBg",At(c.background.paper,.15)),T(c.StepConnector,"border",$("palette-grey-600")),T(c.StepContent,"border",$("palette-grey-600")),T(c.Switch,"defaultColor",$("palette-grey-300")),T(c.Switch,"defaultDisabledColor",$("palette-grey-600")),T(c.Switch,"primaryDisabledColor",H(ie,s?h("palette-primary-main"):c.primary.main,.55)),T(c.Switch,"secondaryDisabledColor",H(ie,s?h("palette-secondary-main"):c.secondary.main,.55)),T(c.Switch,"errorDisabledColor",H(ie,s?h("palette-error-main"):c.error.main,.55)),T(c.Switch,"infoDisabledColor",H(ie,s?h("palette-info-main"):c.info.main,.55)),T(c.Switch,"successDisabledColor",H(ie,s?h("palette-success-main"):c.success.main,.55)),T(c.Switch,"warningDisabledColor",H(ie,s?h("palette-warning-light"):c.warning.main,.55)),T(c.TableCell,"border",H(ie,Qe(s?h("palette-divider"):c.divider,1),.68)),T(c.Tooltip,"bg",H(Qe,s?h("palette-grey-700"):c.grey[700],.92))}s||($e(c.background,"default"),$e(c.background,"paper"),$e(c.common,"background"),$e(c.common,"onBackground"),$e(c,"divider")),Object.keys(c).forEach(W=>{const N=c[W];W!=="tonalOffset"&&!s&&N&&typeof N=="object"&&(N.main&&T(c[W],"mainChannel",yt(bt(N.main))),N.light&&T(c[W],"lightChannel",yt(bt(N.light))),N.dark&&T(c[W],"darkChannel",yt(bt(N.dark))),N.contrastText&&T(c[W],"contrastTextChannel",yt(bt(N.contrastText))),W==="text"&&($e(c[W],"primary"),$e(c[W],"secondary")),W==="action"&&(N.active&&$e(c[W],"active"),N.selected&&$e(c[W],"selected")))})}),R=r.reduce((U,c)=>ke(U,c),R);const O={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:l,getSelector:Is(R),enableContrastVars:s},{vars:P,generateThemeVars:K,generateStyleSheets:Q}=ns(R,O);return R.vars=P,Object.entries(R.colorSchemes[R.defaultColorScheme]).forEach(([U,c])=>{R[U]=c}),R.generateThemeVars=K,R.generateStyleSheets=Q,R.generateSpacing=function(){return _n(f.spacing,kr(this))},R.getColorSchemeSelector=os(d),R.spacing=R.generateSpacing(),R.shouldSkipGeneratingVar=l,R.unstable_sxConfig={...Xt,...f==null?void 0:f.unstable_sxConfig},R.unstable_sx=function(c){return ut({sx:c,theme:this})},R.toRuntimeSource=Qn,R}function Cn(e,r,t){e.colorSchemes&&t&&(e.colorSchemes[r]={...t!==!0&&t,palette:Er({...t===!0?{}:t.palette,mode:r})})}function to(e={},...r){const{palette:t,cssVariables:o=!1,colorSchemes:i=t?void 0:{light:!0},defaultColorScheme:a=t==null?void 0:t.mode,...s}=e,l=a||"light",d=i==null?void 0:i[l],g={...i,...t?{[l]:{...typeof d!="boolean"&&d,palette:t}}:void 0};if(o===!1){if(!("colorSchemes"in e))return Sr(e,...r);let f=t;"palette"in e||g[l]&&(g[l]!==!0?f=g[l].palette:l==="dark"&&(f={mode:"dark"}));const x=Sr({...e,palette:f},...r);return x.defaultColorScheme=l,x.colorSchemes=g,x.palette.mode==="light"&&(x.colorSchemes.light={...g.light!==!0&&g.light,palette:x.palette},Cn(x,"dark",g.dark)),x.palette.mode==="dark"&&(x.colorSchemes.dark={...g.dark!==!0&&g.dark,palette:x.palette},Cn(x,"light",g.light)),x}return!t&&!("light"in g)&&l==="light"&&(g.light=!0),Ms({...s,colorSchemes:g,defaultColorScheme:l,...typeof o!="boolean"&&o},...r)}const Ws=to(),zs="$$material";function _s(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ls=e=>_s(e)&&e!=="classes",Ns=_a({themeId:zs,defaultTheme:Ws,rootShouldForwardProp:Ls}),Vs=Za;process.env.NODE_ENV!=="production"&&(re.node,re.object.isRequired);function Gs(e){return Qa(e)}function Us(e){return Br("MuiSvgIcon",e)}Fa("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Ys=e=>{const{color:r,fontSize:t,classes:o}=e,i={root:["root",r!=="inherit"&&`color${nt(r)}`,`fontSize${nt(t)}`]};return Bi(i,Us,o)},Js=Ns("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${nt(t.color)}`],r[`fontSize${nt(t.fontSize)}`]]}})(Vs(({theme:e})=>{var r,t,o,i,a,s,l,d,g,f,x,m,h,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(r=e.transitions)==null?void 0:r.create)==null?void 0:i.call(r,"fill",{duration:(o=(t=(e.vars??e).transitions)==null?void 0:t.duration)==null?void 0:o.shorter}),variants:[{props:u=>!u.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:s.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((d=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:d.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(g=e.typography)==null?void 0:g.pxToRem)==null?void 0:f.call(g,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,u])=>u&&u.main).map(([u])=>{var b,v;return{props:{color:u},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[u])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(y=(h=(e.vars??e).palette)==null?void 0:h.action)==null?void 0:y.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),_t=Ge.forwardRef(function(r,t){const o=Gs({props:r,name:"MuiSvgIcon"}),{children:i,className:a,color:s="inherit",component:l="svg",fontSize:d="medium",htmlColor:g,inheritViewBox:f=!1,titleAccess:x,viewBox:m="0 0 24 24",...h}=o,y=Ge.isValidElement(i)&&i.type==="svg",u={...o,color:s,component:l,fontSize:d,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:y},b={};f||(b.viewBox=m);const v=Ys(u);return n.jsxs(Js,{as:l,className:On(v.root,a),focusable:"false",color:g,"aria-hidden":x?void 0:!0,role:x?"img":void 0,ref:t,...b,...h,...y&&i.props,ownerState:u,children:[y?i.props.children:i,x?n.jsx("title",{children:x}):null]})});process.env.NODE_ENV!=="production"&&(_t.propTypes={children:re.node,classes:re.object,className:re.string,color:re.oneOfType([re.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),re.string]),component:re.elementType,fontSize:re.oneOfType([re.oneOf(["inherit","large","medium","small"]),re.string]),htmlColor:re.string,inheritViewBox:re.bool,shapeRendering:re.string,sx:re.oneOfType([re.arrayOf(re.oneOfType([re.func,re.object,re.bool])),re.func,re.object]),titleAccess:re.string,viewBox:re.string});_t.muiName="SvgIcon";function kt(e,r){function t(o,i){return n.jsx(_t,{"data-testid":process.env.NODE_ENV!=="production"?`${r}Icon`:void 0,ref:i,...o,children:e})}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=_t.muiName,Ge.memo(Ge.forwardRef(t))}const qs=kt(n.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded"),Ks=kt(n.jsx("path",{d:"M12 5V3.21c0-.45-.54-.67-.85-.35l-2.8 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.32.31.86.09.86-.36V7c3.31 0 6 2.69 6 6 0 2.72-1.83 5.02-4.31 5.75-.42.12-.69.52-.69.95 0 .65.62 1.16 1.25.97C17.57 19.7 20 16.64 20 13c0-4.42-3.58-8-8-8m-6 8c0-1.34.44-2.58 1.19-3.59.3-.4.26-.95-.09-1.31-.42-.42-1.14-.38-1.5.1-1 1.34-1.6 3-1.6 4.8 0 3.64 2.43 6.7 5.75 7.67.63.19 1.25-.32 1.25-.97 0-.43-.27-.83-.69-.95C7.83 18.02 6 15.72 6 13"}),"RestartAltRounded"),Xs=kt(n.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),Qs=kt(n.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),wn=e=>{let r;const t=new Set,o=(g,f)=>{const x=typeof g=="function"?g(r):g;if(!Object.is(x,r)){const m=r;r=f??(typeof x!="object"||x===null)?x:Object.assign({},r,x),t.forEach(h=>h(r,m))}},i=()=>r,l={setState:o,getState:i,getInitialState:()=>d,subscribe:g=>(t.add(g),()=>t.delete(g))},d=r=e(o,i,l);return l},Zs=(e=>e?wn(e):wn),el=e=>e;function tl(e,r=el){const t=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>r(e.getState()),[e,r]),z.useCallback(()=>r(e.getInitialState()),[e,r]));return z.useDebugValue(t),t}const jn=e=>{const r=Zs(e),t=o=>tl(r,o);return Object.assign(t,r),t},ro=(e=>e?jn(e):jn);function rl(e,r){let t;try{t=e()}catch{return}return{getItem:i=>{var a;const s=d=>d===null?null:JSON.parse(d,void 0),l=(a=t.getItem(i))!=null?a:null;return l instanceof Promise?l.then(s):s(l)},setItem:(i,a)=>t.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>t.removeItem(i)}}const Cr=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(o){return Cr(o)(t)},catch(o){return this}}}catch(t){return{then(o){return this},catch(o){return Cr(o)(t)}}}},nl=(e,r)=>(t,o,i)=>{let a={storage:rl(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,v)=>({...v,...b}),...r},s=!1,l=0;const d=new Set,g=new Set;let f=a.storage;if(!f)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),t(...b)},o,i);const x=()=>{const b=a.partialize({...o()});return f.setItem(a.name,{state:b,version:a.version})},m=i.setState;i.setState=(b,v)=>(m(b,v),x());const h=e((...b)=>(t(...b),x()),o,i);i.getInitialState=()=>h;let y;const u=()=>{var b,v;if(!f)return;const k=++l;s=!1,d.forEach(S=>{var j;return S((j=o())!=null?j:h)});const B=((v=a.onRehydrateStorage)==null?void 0:v.call(a,(b=o())!=null?b:h))||void 0;return Cr(f.getItem.bind(f))(a.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==a.version){if(a.migrate){const j=a.migrate(S.state,S.version);return j instanceof Promise?j.then(R=>[!0,R]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var j;if(k!==l)return;const[R,O]=S;if(y=a.merge(O,(j=o())!=null?j:h),t(y,!0),R)return x()}).then(()=>{k===l&&(B==null||B(o(),void 0),y=o(),s=!0,g.forEach(S=>S(y)))}).catch(S=>{k===l&&(B==null||B(void 0,S))})};return i.persist={setOptions:b=>{a={...a,...b},b.storage&&(f=b.storage)},clearStorage:()=>{f==null||f.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>u(),hasHydrated:()=>s,onHydrate:b=>(d.add(b),()=>{d.delete(b)}),onFinishHydration:b=>(g.add(b),()=>{g.delete(b)})},a.skipHydration||u(),y||h},ol=nl,Ct=[{id:"corporate",name:"Corporate Blue",snap:{primaryHex:"#4F6BFF",secondaryHex:"#22D3EE",iconColor:"#4F6BFF",highlightHex:"#6D86FF",cardStyle:"soft",cardShadowPx:20,h1Size:28,h2Size:25,h3Size:22,h4Size:20,h5Size:17,h6Size:14,baseFontPx:15,videoShadowLight:"0px 4px 66px 0px #0409D8",videoShadowDark:"0px 4px 63.7px 0px #00136f"}},{id:"emerald",name:"Emerald",snap:{primaryHex:"#10B981",secondaryHex:"#F5A524",iconColor:"#10B981",highlightHex:"#2EE6A6",cardStyle:"soft",cardShadowPx:20,videoShadowLight:"0px 4px 66.3px 0px #0C3726",videoShadowDark:"0px 4px 66.3px 14px #0C3726",ccBadge:"#14b8a6",hdBadge:"#f59e0b",h1Size:28}},{id:"indigo",name:"Indigo Violet",snap:{primaryHex:"#A97BFF",secondaryHex:"#FF5FA2",iconColor:"#A97BFF",highlightHex:"#A97BFF",cardStyle:"soft",cardShadowPx:20,videoShadowLight:"0px 4px 66px 0px #F50079",videoShadowDark:"0px 4px 63.7px 0px #9F0087",h1Size:28}},{id:"slate",name:"Graphite",snap:{primaryHex:"#455a64",secondaryHex:"#78909c",iconColor:"#455a64",cardStyle:"floating",cardShadowPx:16}},{id:"teal",name:"Ocean Teal",snap:{primaryHex:"#00838f",secondaryHex:"#0277bd",iconColor:"#00838f",cardStyle:"floating",cardShadowPx:20}},{id:"amber",name:"Amber",snap:{primaryHex:"#e65100",secondaryHex:"#d84315",iconColor:"#e65100",cardStyle:"floating",cardShadowPx:20}}],kn={appName:"Crystal Ball",appTagline:"Run your whole business in one place",logoMode:"icon",logoUrl:"",iconColor:"#4F6BFF",presetId:"emerald",mode:"light",primaryHex:"#4F6BFF",secondaryHex:"#22D3EE",highlightHex:"",videoShadowLight:"",videoShadowDark:"",ccBadge:"",hdBadge:"",errorHex:"#d32f2f",warningHex:"#ed6c02",infoHex:"#0288d1",successHex:"#2e7d32",cardBgHex:"",cardHdrHex:"",pageBgHex:"",notifCardHex:"",textPrimaryHex:"",textSecondaryHex:"",dividerHex:"",btnColorHex:"",btnTextHex:"",h1Color:"",h2Color:"",h3Color:"",h4Color:"",h5Color:"",h6Color:"",fontFamily:"Roboto",headingFont:"Inter",customFonts:[],customHeadFonts:[],textSize:"df",baseFontPx:15,bodyLineHeight:0,bodyWeight:300,letterSpace:0,scaleRatio:"default",scaleRatioCustom:0,h1Size:0,h2Size:0,h3Size:0,h4Size:0,h5Size:0,h6Size:0,h1Weight:0,h2Weight:0,h3Weight:0,h4Weight:0,h5Weight:0,h6Weight:0,headingWeight:300,headingLH:0,radiusPreset:"rounded",radiusVal:9,density:"default",densityScale:0,cardShadowPx:-1,contrast:"medium",contrastMode:"auto",containerPadPx:0,edgePadPx:0,cardGapPx:0,cardStyle:"soft",cardHeader:"plain",surfaceTint:"snow",nestedStyle:"recessed",nestedDepth:-1,headerStrength:-1,tintIntensity:-1,btnCase:"upper",accentGradient:!1,statusBold:!1,mapGlass:"light",chartScheme:"brand",tableDensity:"default",tableColDensity:"default",tableDividers:!1,tableColDividers:!1,tableRowDivW:1,tableColDivW:1,tableStripe:!1,tableHeaderStyle:"tinted",tableCellAlignH:"left",tableCellAlignV:"middle",notifPosition:"bottom-right",notifStyle:"toast",notifAccent:"severity",notifBadge:!0,notifAutoDismiss:!1,autoDismissSec:8,toastW:0,navPattern:"sidebar",sidebarWidth:220,appBarH:0,loginLayout:"split",loginImage:"",loginShowTagline:!0,loginPanelColor:"",loginImgOpacity:0,loginCardW:0};var An;const Ce={...kn,...((An=Ct.find(e=>e.id===kn.presetId))==null?void 0:An.snap)??{}},il=["primaryHex","secondaryHex","highlightHex"],Ae=e=>{const{mode:r,...t}=e;return JSON.stringify(t)};function hr(e){const r={...Ce};if(e&&typeof e=="object")for(const t of Object.keys(Ce)){const o=e[t];o!==void 0&&typeof o==typeof Ce[t]&&(r[t]=o)}return r}function al(e){if(!e||typeof e!="object")return!1;const r=Object.keys(Ce);let t=0;for(const o of r){const i=e[o];i!==void 0&&typeof i==typeof Ce[o]&&t++}return t/r.length>=.5}const _=ro()(ol((e,r)=>({settings:{...Ce},savedThemes:[],baseline:Ae(Ce),editingSavedId:null,lastImportedId:null,set:t=>e(o=>{const i=Object.keys(t).some(a=>il.includes(a));return{settings:{...o.settings,...t,...i?{presetId:"custom"}:{}}}}),applyPreset:(t,o)=>e(i=>{const a={...i.settings,...o,presetId:t};return{settings:a,baseline:Ae(a),editingSavedId:null,lastImportedId:null}}),reset:()=>e(()=>({settings:{...Ce},baseline:Ae(Ce),editingSavedId:null,lastImportedId:null})),captureBaseline:()=>e(t=>({baseline:Ae(t.settings)})),restoreBaseline:()=>e(t=>{try{return{settings:{...JSON.parse(t.baseline),mode:t.settings.mode}}}catch{return{}}}),isDirty:()=>Ae(r().settings)!==r().baseline,saveTheme:t=>e(o=>{const i="cust"+Date.now(),a={...o.settings};return{savedThemes:[...o.savedThemes,{id:i,name:t,snap:a}],settings:{...o.settings,presetId:i},baseline:Ae({...o.settings,presetId:i}),editingSavedId:i,lastImportedId:null}}),updateSaved:(t,o,i)=>e(a=>{const s={...i,presetId:t};return{savedThemes:a.savedThemes.map(l=>l.id===t?{...l,name:o,snap:s}:l),settings:s,baseline:Ae(s),editingSavedId:t,lastImportedId:null}}),applySaved:t=>e(()=>{const o={...hr(t.snap),presetId:t.id};return{settings:o,baseline:Ae(o),editingSavedId:t.id,lastImportedId:null}}),renameSaved:(t,o)=>e(i=>({savedThemes:i.savedThemes.map(a=>a.id===t?{...a,name:o}:a)})),deleteSaved:t=>e(o=>({savedThemes:o.savedThemes.filter(i=>i.id!==t),editingSavedId:o.editingSavedId===t?null:o.editingSavedId,lastImportedId:o.lastImportedId===t?null:o.lastImportedId})),deleteCustomFont:(t,o)=>e(i=>{if(o){const a=i.settings.customHeadFonts.filter(l=>l.name!==t),s=i.settings.headingFont===t?Ce.headingFont||"Roboto":i.settings.headingFont;return{settings:{...i.settings,customHeadFonts:a,headingFont:s}}}else{const a=i.settings.customFonts.filter(l=>l.name!==t),s=i.settings.fontFamily===t?Ce.fontFamily||"Roboto":i.settings.fontFamily;return{settings:{...i.settings,customFonts:a,fontFamily:s}}}}),importTheme:(t,o)=>{const i=hr(o),a={id:"imp"+Date.now(),name:t,snap:i};return e(s=>{const l={...i,presetId:a.id};return{savedThemes:[a,...s.savedThemes],settings:l,baseline:Ae(l),editingSavedId:a.id,lastImportedId:a.id}}),a}}),{name:"omnieye-theme-studio",merge:(e,r)=>{const t=e??{};return{...r,...t,settings:hr(t.settings),savedThemes:Array.isArray(t.savedThemes)?t.savedThemes:r.savedThemes}}}));function Pe(e){const r=e==="dark";return{studioBg:r?"#15181d":"#f5f7fa",studioBd:r?"#2a2f38":"#d8dee6",card:r?"#1e222a":"#ffffff",cardBd:r?"#2b313b":"#e6eaf0",inset:r?"#262b34":"#f7f9fb",insetBd:r?"#363d48":"#e9edf2",divider:r?"#262b34":"#f0f3f7",iconTile:r?"#2b313b":"#eef1f6",text:r?"rgba(255,255,255,0.92)":"#1c2127",label:r?"rgba(255,255,255,0.5)":"#9aa4b0",label2:r?"rgba(255,255,255,0.6)":"#7a8593",body:r?"rgba(255,255,255,0.78)":"#5a6573",muted:r?"rgba(255,255,255,0.42)":"#aeb6c0",chevron:r?"rgba(255,255,255,0.42)":"#b3bcc7"}}function wr(e){if(!e||e.length<7)return[210,60,45];const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,i=Math.max(r,t,o),a=Math.min(r,t,o),s=i-a;let l=0,d=0;const g=(i+a)/2;return s&&(d=s/(1-Math.abs(2*g-1)),i===r?l=(t-o)/s%6:i===t?l=(o-r)/s+2:l=(r-t)/s+4,l=Math.round(l*60),l<0&&(l+=360)),[l,Math.round(d*100),Math.round(g*100)]}function te(e,r,t){r/=100,t/=100;const o=i=>{const a=(i+e/30)%12,s=r*Math.min(t,1-t);return Math.round((t-s*Math.max(-1,Math.min(a-3,Math.min(9-a,1))))*255).toString(16).padStart(2,"0")};return"#"+o(0)+o(8)+o(4)}function Se(e){try{const[r,t]=wr(e),o=Math.max(t,18);return{50:te(r,Math.max(Math.round(o*.3),10),96),100:te(r,Math.max(Math.round(o*.42),12),91),200:te(r,Math.max(Math.round(o*.55),16),82),300:te(r,Math.max(Math.round(o*.7),20),70),400:te(r,o,60),500:e,600:te(r,Math.min(o+4,100),44),700:te(r,Math.min(o+8,100),36),800:te(r,Math.max(Math.round(o*.92),16),26),900:te(r,Math.max(Math.round(o*.8),14),16)}}catch{return{50:"#eef",100:"#dde",200:"#bbd",300:"#99c",400:"#77b",500:e||"#4F6BFF",600:"#1257a8",700:"#0e4488",800:"#0a3266",900:"#062044"}}}function gr(e,r){try{const t=l=>{const d=[1,3,5].map(g=>{const f=parseInt(l.slice(g,g+2),16)/255;return f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4)});return .2126*d[0]+.7152*d[1]+.0722*d[2]},o=t(e),i=t(r),a=Math.max(o,i),s=Math.min(o,i);return(a+.05)/(s+.05)}catch{return 1}}function ce(e,r){if(!e||e[0]!=="#"||e.length<7)return"rgba(20,30,48,"+r+")";const t=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba("+t+","+o+","+i+","+r+")"}const sl={corporate:{light:{angle:0,colors:["#141b3c"]},dark:{angle:0,colors:["#141b3c"]}},"corporate-blue":{light:{angle:0,colors:["#141b3c"]},dark:{angle:0,colors:["#141b3c"]}},emerald:{light:{angle:0,colors:["#0d2a20"]},dark:{angle:0,colors:["#041610"]}},indigo:{light:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]},dark:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]}},"indigo-violet":{light:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]},dark:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]}}},ll={corporate:{angle:180,colors:["#070A1B","#111734","#090D22"]},"corporate-blue":{angle:180,colors:["#070A1B","#111734","#090D22"]},emerald:{angle:180,colors:["#06140E","#082318","#061910"]},indigo:{angle:180,colors:["#0D0620","#221236","#2E1F4F"]},"indigo-violet":{angle:180,colors:["#0D0620","#221236","#2E1F4F"]}},Tn={corporate:{angle:90,colors:["#000000","#03205F"]},"corporate-blue":{angle:90,colors:["#000000","#03205F"]}},cl={corporate:{angle:90,colors:["#6CA4FF","#C9D8F2"]},"corporate-blue":{angle:90,colors:["#6CA4FF","#C9D8F2"]},emerald:{angle:90,colors:["#97E1B2","#E6E6E6"]},indigo:{angle:90,colors:["#FCB3D8","#E6E6E6"]},"indigo-violet":{angle:90,colors:["#FCB3D8","#E6E6E6"]}},dl={corporate:{angle:90,colors:["#010D27","#03205F"]},"corporate-blue":{angle:90,colors:["#010D27","#03205F"]},emerald:{angle:90,colors:["#001909","#0A4821"]},indigo:{angle:90,colors:["#010D27","#37107A"]},"indigo-violet":{angle:90,colors:["#010D27","#37107A"]}},pl={corporate:{light:{angle:90,colors:["#0029ff","#00144b"]},dark:{angle:90,colors:["#4f6bff","#22d3ee"]}},"corporate-blue":{light:{angle:90,colors:["#0029ff","#00144b"]},dark:{angle:90,colors:["#4f6bff","#22d3ee"]}},emerald:{light:{angle:90,colors:["#01b979","#d88b00"]},dark:{angle:90,colors:["#2ee6a6","#ffc255"]}},indigo:{light:{angle:90,colors:["#4300c1","#ff388c"]},dark:{angle:90,colors:["#4300c1","#ff388c"]}},"indigo-violet":{light:{angle:90,colors:["#4300c1","#ff388c"]},dark:{angle:90,colors:["#4300c1","#ff388c"]}}},ul={corporate:{light:{angle:135,colors:["#00ddff","#0c26b1"]},dark:{angle:162,colors:["#22d3ee","#126673"],stops:[11.886,91.492]}},emerald:{light:{angle:135,colors:["#F5A524","#10B981"]},dark:{angle:180,colors:["#FFC255","#997433"],overlay:"linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%)"}}},fl={corporate:{angle:0,colors:["#4f6bff","#3f5adb","#2e49b7","#1e3892","#0d276e","#07153f"],stops:[0,13.75,27.5,41.25,55,100]},emerald:{angle:0,colors:["#2EE6A6","#21AB7B","#1A8D65","#146F4F","#0D4E37","#072D20"],stops:[0,27.5,41.25,55,77.5,100]},indigo:{angle:0,colors:["#A97BFF","#4E22A0","#16013E"],stops:[0,50,100]}},hl={emerald:{angle:169,colors:["#28C78F","#18855F"]}},gl={corporate:{angle:136.6683374482933,colors:["#3f5bff","#4b48e6","#7c5cf5"],stops:[0,45,100]}},mt="#0f172a";function no(e,r){const t=r??e.map((o,i)=>e.length===1?0:i/(e.length-1)*100);return e.map((o,i)=>`${o} ${t[i]}%`).join(", ")}function Ie(e){if(e.colors.length===1)return e.colors[0];const r=`linear-gradient(${e.angle}deg, ${no(e.colors,e.stops)})`;return e.overlay?`${e.overlay}, ${r}`:r}function Bn(e,r){return`radial-gradient(${r}, ${no(e.colors,e.stops)})`}function Hr(e){const r=Se(e.primaryHex),t=Se(e.secondaryHex),o=e.mode==="dark",i=o?r[300]:e.primaryHex,a=o?t[300]:e.secondaryHex,s={pMain:i,pDark:r[700],pLight:r[300],highlight:e.highlightHex||i,highlightSoft:ce(e.highlightHex||i,o?.22:.14),highlightBd:ce(e.highlightHex||i,o?.45:.32),pContrast:e.contrastMode==="light"?"#ffffff":e.contrastMode==="dark"?"rgba(0,0,0,0.87)":gr(i,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",pContainer:o?ce(e.primaryHex,.26):r[50],onPContainer:o?r[100]:r[800],sMain:a,sContrast:gr(a,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",bgDefault:o?"#121212":"#f3f5f8",paper:o?"#1e1e1e":"#ffffff",paper2:o?"#262630":"#f6f8fb",frameGutterBg:o?"#0a0a0a":"#e3e7ec",footerBg:o?"#17171c":"#eceef2",textPrimary:o?"rgba(255,255,255,0.92)":"rgba(0,0,0,0.87)",textSecondary:o?"rgba(255,255,255,0.62)":"rgba(0,0,0,0.6)",textDisabled:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.38)",divider:o?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)",outline:o?"rgba(255,255,255,0.23)":"rgba(0,0,0,0.23)"},l=e.statusBold,d=l?e.errorHex:ce(e.errorHex,o?.22:.13),g=l?e.warningHex:ce(e.warningHex,o?.22:.14),f=l?e.infoHex:ce(e.infoHex,o?.22:.13),x=l?e.successHex:ce(e.successHex,o?.22:.13),m=l?"#ffffff":o?Se(e.errorHex)[300]:e.errorHex,h=l?"#ffffff":o?Se(e.warningHex)[300]:Se(e.warningHex)[700],y=l?"#ffffff":o?Se(e.infoHex)[300]:e.infoHex,u=l?"#ffffff":o?Se(e.successHex)[300]:Se(e.successHex)[700],b=wr(e.primaryHex)[0],v={neutral:[220,6],warm:[32,26],cool:[210,30],brand:[b,42],slate:[214,16],snow:[0,0]},k=v[e.surfaceTint]||v.neutral,B=e.tintIntensity>=0?e.tintIntensity:100,S=[k[0],Math.round(k[1]*B/100)];if(o)s.bgDefault=te(S[0],Math.round(S[1]*.7),7),s.paper=te(S[0],Math.round(S[1]*.7),13),s.paper2=te(S[0],Math.round(S[1]*.85),19);else if(e.surfaceTint==="snow"&&!(e.tintIntensity>0))s.bgDefault="#ffffff",s.paper="#ffffff",s.paper2="#ffffff";else{const he=Math.min(100,Math.max(96,100-Math.round(S[1]*.08)));s.bgDefault=te(S[0],Math.round(S[1]*.9),e.surfaceTint==="brand"?94:97),s.paper=te(S[0],Math.round(S[1]*.4),he),s.paper2=te(S[0],Math.round(S[1]*.85),e.surfaceTint==="brand"?95:96.5)}e.pageBgHex&&(s.bgDefault=e.pageBgHex),e.cardBgHex&&(s.paper=e.cardBgHex);const j={soft:0,standard:1,medium:2,high:3},R=j[e.contrast]!==void 0?j[e.contrast]:1,O=o?[["rgba(255,255,255,0.82)","rgba(255,255,255,0.55)","rgba(255,255,255,0.09)","rgba(255,255,255,0.16)"],["rgba(255,255,255,0.92)","rgba(255,255,255,0.62)","rgba(255,255,255,0.12)","rgba(255,255,255,0.23)"],["rgba(255,255,255,0.96)","rgba(255,255,255,0.74)","rgba(255,255,255,0.18)","rgba(255,255,255,0.34)"],["#ffffff","rgba(255,255,255,0.87)","rgba(255,255,255,0.26)","rgba(255,255,255,0.46)"]]:[["rgba(0,0,0,0.72)","rgba(0,0,0,0.5)","rgba(0,0,0,0.08)","rgba(0,0,0,0.16)"],["rgba(0,0,0,0.87)","rgba(0,0,0,0.6)","rgba(0,0,0,0.12)","rgba(0,0,0,0.23)"],["rgba(0,0,0,0.92)","rgba(0,0,0,0.7)","rgba(0,0,0,0.18)","rgba(0,0,0,0.34)"],["#000000","rgba(0,0,0,0.8)","rgba(0,0,0,0.24)","rgba(0,0,0,0.46)"]];s.textPrimary=O[R][0],s.textSecondary=O[R][1],s.divider=O[R][2],s.outline=O[R][3],e.textPrimaryHex&&(s.textPrimary=e.textPrimaryHex),e.textSecondaryHex&&(s.textSecondary=e.textSecondaryHex),e.dividerHex&&(s.divider=e.dividerHex),e.nestedStyle==="lighter"?s.paper2=o?te(S[0],Math.round(S[1]*.9),22):te(S[0],Math.max(Math.round(S[1]*.3),4),100):e.nestedStyle==="bordered"?s.paper2=s.paper:s.paper2=o?te(S[0],Math.round(S[1]*.9),Math.max(3,5)):te(S[0],Math.min(Math.round(S[1]*1.1),60),Math.max(88,94-S[1]*.18));const P=e.btnColorHex||i,K=e.accentGradient?"linear-gradient(135deg,"+P+","+(e.btnColorHex?Se(e.btnColorHex)[700]:r[o?500:700])+")":P,Q=e.btnTextHex||(gr(P,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)"),U=e.h1Color||null,c=e.h2Color||null,$=e.h3Color||null,H=e.h4Color||null,W=e.h5Color||null,N=e.h6Color||null,Y=[{key:"sm",px:13},{key:"df",px:12},{key:"lg",px:18}],L=Y.find(he=>he.key===e.textSize)||Y[1],J=e.baseFontPx>0?e.baseFontPx:L.px,E=e.bodyLineHeight>0?e.bodyLineHeight:1.5,I=e.h1Size>0?e.h1Size:20,q=Math.round(I*1.1),V=I,G=Math.max(Math.round(I*.9),11),D=Math.max(Math.round(I*.8),11),C=Math.max(Math.round(I*.7),10),A=Math.max(Math.round(I*.6),10),F=Math.max(Math.round(I*.5),9),X=J,w=Math.round(J*.92),Z=Math.round(J*.8),M=Math.round(J*.72),fe=e.headingWeight,Me=e.headingLH>0?e.headingLH:1.2,We=e.bodyWeight>0?e.bodyWeight:400,Je=Math.min(900,We+200),qe={compact:.82,default:1,comfortable:1.16},Re=e.densityScale>0?e.densityScale/100:qe[e.density]??1,tr=Math.round(20*Re),ze=Math.round(14*Re),Tt=e.cardGapPx>0?e.cardGapPx:Math.round(16*Re),Ke=Math.round(11*Re*({compact:.66,default:1,comfortable:1.32}[e.tableDensity]??1)),_e=e.containerPadPx>0?e.containerPadPx:Math.round(10*Re),ee=e.radiusVal,ft=ee+"px",ht=Math.max(Math.round(ee*.6),2)+"px",Le=ce(i,o?.22:.14),Ne={0:"none",1:o?`0 2px 8px -1px ${Le}, 0 2px 4px 0 rgba(0,0,0,0.28)`:`0 2px 6px -1px ${Le}, 0 1px 3px 0 rgba(0,0,0,0.08)`,2:o?`0 4px 14px -2px ${Le}, 0 3px 8px 0 rgba(0,0,0,0.32)`:`0 3px 8px -2px ${Le}, 0 2px 6px 0 rgba(0,0,0,0.08)`,4:o?`0 6px 20px -3px ${Le}, 0 4px 12px 0 rgba(0,0,0,0.38)`:`0 4px 12px -2px ${Le}, 0 3px 8px 0 rgba(0,0,0,0.1)`,8:o?`0 8px 32px -4px ${Le}, 0 16px 36px 0 rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08)`:`0 6px 22px -2px ${Le}, 0 8px 24px 0 rgba(0,0,0,0.08)`},$r="1px solid rgba(255,255,255,0.06)";let gt,Xe,Bt;if(e.cardStyle==="outlined"?(gt="none",Xe="1.5px solid "+s.outline,Bt="none"):e.cardStyle==="soft"?(gt=Ne[1],Xe=o?$r:"none",Bt=Ne[1]):(gt=Ne[8],Xe=o?$r:"none",Bt=Ne[4]),e.cardShadowPx>=0){const he=ce(i,o?Math.min(.38,.12+e.cardShadowPx/80):Math.min(.24,.08+e.cardShadowPx/130));gt=`0 ${Math.round(e.cardShadowPx*.4)}px ${Math.round(e.cardShadowPx*1.3)}px ${he}, 0 ${Math.round(e.cardShadowPx*.6)}px ${Math.round(e.cardShadowPx*1.8)}px rgba(0,0,0,${o?.52:.08})`}let Rt="transparent",Ar="1px solid "+s.divider,rr="none";e.cardHeader==="plain"?Ar="none":e.cardHeader==="tinted"?Rt=s.pContainer:e.cardHeader==="accent"&&(rr="inset 3px 0 0 "+i),e.headerStrength>=0&&(e.cardHeader==="tinted"?Rt=ce(e.primaryHex,(o?.14:.08)*(e.headerStrength/100)):e.cardHeader==="accent"&&(rr="inset "+Math.round(e.headerStrength*.06)+"px 0 0 "+i)),e.cardHdrHex&&(Rt=e.cardHdrHex);const ao=o?"none":Ne[4],so=o?"1px solid "+s.divider:"none",lo=e.nestedStyle==="bordered"?"1.5px solid "+s.outline:"1px solid "+s.divider,co=e.nestedDepth>0?"inset 3px 0 0 "+ce(e.primaryHex,.55)+", 0 "+Math.round(e.nestedDepth*.4)+"px "+e.nestedDepth+"px rgba(16,24,40,"+(o?.42:.1)+")":"none",po=(e.appName||"").trim().split(/\s+/).slice(0,2).map(he=>he[0]||"").join("").toUpperCase()||"AP",uo=!!(e.logoMode==="image"&&e.logoUrl),fo=!!e.loginImage,Ir=he=>{const be=he||"Roboto";return be.includes(" ")&&!be.startsWith('"')&&!be.startsWith("'")?`"${be}"`:be},ho=Ir(e.headingFont||e.fontFamily),go=Ir(e.fontFamily),ye=wr(e.primaryHex)[0],me=(he,be)=>te((he%360+360)%360,62,o?60:46),Dr={brand:[i,a,me(ye+42),me(ye+205),me(ye+120)],categorical:[me(ye),me(ye+72),me(ye+144),me(ye+216),me(ye+288)],sequential:[te(ye,55,o?40:78),te(ye,60,o?50:64),i,te(ye,70,o?70:38),te(ye,78,o?82:26)],cbsafe:["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9"],warm:[me(8),me(28),me(45),me(350),me(18)],cool:[me(200),me(220),me(255),me(180),me(235)]},xo=Dr[e.chartScheme]||Dr.brand,mo=[r[600],t[600],te((ye+42)%360,55,46),te((ye+205)%360,50,46)],yo={error:{cb:d,cc:m},success:{cb:x,cc:u},info:{cb:f,cc:y},warning:{cb:g,cc:h}},nr=e.mapGlass==="light",bo=nr?"rgba(255,255,255,0.84)":"rgba(15,20,28,0.74)",vo=nr?"#1c2733":"#f3f6fa",So=nr?"rgba(0,0,0,0.12)":"rgba(255,255,255,0.18)",Co="repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 11px, rgba(255,255,255,0) 11px, rgba(255,255,255,0) 22px), radial-gradient(circle at 50% 38%, "+ce(i,.22)+", rgba(0,0,0,0) 60%), "+"#0f141c",wo="linear-gradient(135deg,"+i+","+r[700]+")",jo="linear-gradient(180deg,"+ce(r[900],.12)+","+ce(r[900],.55)+")",ko="linear-gradient(135deg,"+r[700]+","+r[900]+")",To="linear-gradient(135deg,"+ce(r[900],.55)+","+ce(e.primaryHex,.45)+")",Ee=e.presetId,Bo=ll[Ee]||{angle:180,colors:[te(b,32,5),te(b,32,10),te(b,32,6)]},Fr=Ie(Bo),Or=sl[Ee],Ro=Or?Or[o?"dark":"light"]:{angle:0,colors:[te(b,38,6.5)]},Eo=Ie(Ro),Ho=e.pageBgHex||(o?Fr:"#ffffff"),Po=e.pageBgHex||(o?Tn[Ee]?Ie(Tn[Ee]):Fr:s.bgDefault),$o=o?dl[Ee]||{angle:90,colors:[`color-mix(in srgb, ${e.primaryHex} 25%, black)`,`color-mix(in srgb, ${e.secondaryHex} 55%, black)`]}:cl[Ee]||{angle:90,colors:[`color-mix(in srgb, ${e.primaryHex} 45%, white)`,`color-mix(in srgb, ${e.secondaryHex} 15%, white)`]},Ao=Ie($o),Mr=pl[Ee],Io=Mr?Mr[o?"dark":"light"]:{angle:90,colors:[e.primaryHex,e.secondaryHex]},Do=Ie(Io),Wr=ul[Ee],Fo=Wr?Wr[o?"dark":"light"]:o?{angle:162,colors:[e.secondaryHex,`color-mix(in srgb, ${e.secondaryHex} 48%, black)`],stops:[11.886,91.492]}:{angle:135,colors:[e.secondaryHex,e.primaryHex]},Oo=Ie(Fo),Mo=fl[Ee]||{colors:[e.primaryHex,`color-mix(in srgb, ${e.primaryHex} 78%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 57%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 36%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 16%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 20%, ${mt})`],stops:[0,13.75,27.5,41.25,55,100]},Wo=Bn(Mo,"circle at 50% 30%"),zo=hl[Ee]||{angle:135,colors:[r[300],r[700]]},_o=Ie(zo),zr=gl[Ee]||{angle:136.6683374482933,colors:[e.secondaryHex,e.primaryHex]},Lo=Ie(zr),No=Ie({...zr,angle:165.45289138562782}),Vo="inset 0px 1px 2px 0px rgba(255,255,255,0.3)",Go={colors:[te(b,45,14),te(b,35,9),te(b,10,4)]},Uo=e.loginPanelColor||(o?Bn(Go,"ellipse 70% 65% at 50% 77%"):"#ffffff"),_r={"top-right":{top:"14px",right:"14px"},"top-center":{top:"14px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"14px",right:"14px"},"bottom-left":{bottom:"14px",left:"14px"}},Yo=_r[e.notifPosition]||_r["top-right"],Lr=e.notifAccent==="primary"?{bar:i,icbg:s.pContainer,icc:s.onPContainer,dot:i}:e.notifAccent==="mono"?{bar:s.textSecondary,icbg:s.paper2,icc:s.textPrimary,dot:s.textSecondary}:{bar:e.warningHex,icbg:g,icc:h,dot:e.warningHex};let Et;e.notifStyle==="toast"?Et={boxShadow:Ne[8],border:typeof Xe=="string"&&Xe!=="none"?Xe:"none"}:e.notifStyle==="banner"?Et={boxShadow:Ne[2],borderLeft:"4px solid "+Lr.bar}:Et={boxShadow:"none",border:"1px solid "+s.divider};const Jo=e.notifCardHex||(o?"#1e1e1e":"#ffffff"),qo={compact:"7px",default:"11px",comfortable:"16px"},Ko={compact:"6px",default:"12px",comfortable:"22px"},Xo={top:"flex-start",middle:"center",bottom:"flex-end"},Qo={left:"flex-start",center:"center",right:"flex-end"},Zo={plain:"transparent",tinted:s.paper2,accent:s.highlightSoft},ei={rowPy:qo[e.tableDensity]||"11px",cellPx:Ko[e.tableColDensity]||"12px",rowBorder:e.tableDividers?(e.tableRowDivW||1)+"px solid "+s.divider:"none",colBorder:e.tableColDividers?(e.tableColDivW||1)+"px solid "+s.divider:"none",headBg:Zo[e.tableHeaderStyle]||s.paper2,cellAI:Xo[e.tableCellAlignV]||"center",cellJC:Qo[e.tableCellAlignH]||"flex-start",stripeBg:o?"rgba(255,255,255,0.035)":"rgba(0,0,0,0.028)",statusMap:{Delivered:{sb:x,sc:u},Processing:{sb:s.pContainer,sc:o?s.pLight:s.pDark},Pending:{sb:g,sc:h},Shipped:{sb:f,sc:y}},filters:["All","Delivered","Processing","Pending"].map((he,be)=>({label:he,bg:be===0?s.highlightSoft:"transparent",c:be===0?s.textPrimary:s.textSecondary,brd:be===0?s.highlightBd:s.outline}))},ti={sm:"Small",df:"Default",lg:"Large"},ri={compact:"Compact",default:"Default",comfortable:"Comfortable"},ni={outlined:"Outlined",soft:"Soft",floating:"Floating"},oi={sharp:"Sharp",rounded:"Rounded",round:"Round"},ii=[{key:"sidebar",label:"Sidebar",desc:"Full drawer",ic:"▤"},{key:"rail",label:"Rail",desc:"Icons only",ic:"▥"},{key:"topbar",label:"Top Bar",desc:"Horizontal",ic:"▦"}],ai=e.fontFamily+" · "+(ti[e.textSize]||"Default"),si=(oi[e.radiusPreset]||"Custom")+" · "+(ri[e.density]||"Default")+" · "+(ni[e.cardStyle]||"Soft"),li=[{label:"General",ic:"◉"},{label:"Appearance",ic:"◧"},{label:"Modules",ic:"◫"},{label:"Team",ic:"◍"},{label:"Security",ic:"▣"},{label:"Billing",ic:"◳"}].map((he,be)=>({...he,on:be===1,bg:be===1?s.highlightSoft:"transparent",c:be===1?s.textPrimary:s.textSecondary,bar:be===1?"3px solid "+s.highlight:"3px solid transparent"})),ci=ii.map(he=>({...he,active:e.navPattern===he.key,brd:e.navPattern===he.key?i:s.divider,bg:e.navPattern===he.key?s.pContainer:s.paper,color:e.navPattern===he.key?s.onPContainer:s.textPrimary})),di=e.sidebarWidth,pi=e.appBarH>0?e.appBarH:56,ui=e.appBarH>0?e.appBarH+"px":"Auto (56px)";return{pal:r,spal:t,isDark:o,pMain:i,sMain:a,t:s,errSoft:d,warnSoft:g,infoSoft:f,sucSoft:x,errTxt:m,warnTxt:h,infoTxt:y,sucTxt:u,sevMap:yo,accentBg:K,btnText:Q,hc1:U,hc2:c,hc3:$,hc4:H,hc5:W,hc6:N,base:J,bodyLH:E,h1base:I,tDisplay:q,tH1:V,tH2:G,tTitle:D,tH4:C,tH5:A,tH6:F,tBody:X,tBodySm:w,tCaption:Z,tOverline:M,wH1:fe,wH2:fe,wH3:fe,wH4:fe,wH5:fe,wH6:fe,headLH:Me,bodyWeightEff:We,bwEmph:Je,pad:tr,padSm:ze,gap:Tt,rowPy:Ke,screenPad:_e,r:ee,rad:ft,radSm:ht,SH:Ne,cardShadow:gt,cardBorder:Xe,btnShadow:Bt,cardHdrBg:Rt,cardHdrBorder:Ar,cardHdrAccent:rr,appbarShadow:ao,appbarBorder:so,nestBorder:lo,nestShadow:co,iconInitials:po,hasLogo:uo,hasLoginImage:fo,headFam:ho,bodyFam:go,chartHue:ye,chartPalette:xo,avatarColors:mo,overlaySurface:bo,onOverlay:vo,overlayBorder:So,mediaBg:Co,loginBrandGrad:wo,loginScrimGrad:jo,loginCenteredGrad:ko,loginScrimGradC:To,headerBg:Eo,canvasBg:Ho,accountPageBg:Po,accountCardBg:Ao,brandGradient:Do,gsAccentGradient:Oo,gsModalBgDark:Wo,gsArrowGradient:_o,loginPanelGradient:Uo,reportsAccentTileGradient:Lo,reportsAccentCtaGradient:No,reportsModalInnerHighlight:Vo,npos:Yo,nacc:Lr,toastDeco:Et,toastBg:Jo,btnCase:e.btnCase!=="none"?"uppercase":"none",table:ei,typeSummary:ai,shapeSummary:si,settingsCats:li,navSettingsChips:ci,sidebarWidth:di,appBarHEff:pi,appBarHLabel:ui}}function xl({icon:e,title:r,info:t,open:o,dimmed:i,onToggle:a,onPreviewMenu:s,children:l}){const d=_(v=>v.settings),g=d.mode==="dark",f=d.primaryHex||"#4F6BFF",x=Pe(d.mode),m=Se(f),h=Hr(d),y=o?g?ce(f,.22):ce(f,.1):"transparent",u=o?g?m[200]:m[700]:x.text,b=o?f:x.chevron;return n.jsxs(p.Box,{sx:{background:y,opacity:i?.3:1,transform:o?"translateY(-2px)":"none",transition:"opacity .22s ease, transform .22s ease",borderBottom:`1px solid ${x.divider}`,overflow:"hidden"},children:[n.jsxs(p.Box,{component:"button",onClick:a,sx:{width:"100%",display:"flex",alignItems:"center",gap:"9px",p:"7px 11px",background:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},children:[n.jsx(p.Box,{sx:{width:32,height:32,borderRadius:"10px",background:x.iconTile,color:x.body,display:"grid",placeItems:"center",flexShrink:0,position:"relative"},children:e}),n.jsx(p.Box,{sx:{flex:1,minWidth:0},children:n.jsx(p.Box,{sx:{fontSize:`${h.tH5}px`,fontWeight:h.wH5,fontFamily:`${h.headFam},sans-serif`,lineHeight:1.25,color:u,letterSpacing:"-.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),s&&n.jsx(p.Box,{component:"span",title:"Change preview screen",onClick:v=>{v.stopPropagation(),s()},sx:{width:16,height:16,mr:"6px",flexShrink:0,cursor:"pointer",display:"grid",placeItems:"center",color:x.chevron,transition:"filter .15s ease, transform .1s ease","&:hover":{filter:"brightness(1.15)",transform:"scale(1.12)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("path",{d:"M8 21h8M12 17v4"})]})}),t&&n.jsx(p.Box,{component:"span",title:t,sx:{width:15,height:15,borderRadius:"50%",border:`1.2px solid ${x.chevron}`,color:x.chevron,fontSize:"9px",fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"grid",placeItems:"center",mr:"7px",flexShrink:0,cursor:"help"},children:"i"}),n.jsx(p.Box,{sx:{width:20,height:20,borderRadius:"6px",display:"grid",placeItems:"center",fontSize:"9px",color:b,flexShrink:0,transition:"background .18s, border-color .18s"},children:n.jsx(p.Box,{component:"span",sx:{display:"block",lineHeight:1,transform:o?"rotate(180deg)":"none",transition:"transform .2s"},children:"▼"})})]}),n.jsx(p.Collapse,{in:o,unmountOnExit:!0,timeout:280,children:n.jsx(p.Box,{sx:{p:"2px 13px 12px",borderTop:`1px solid ${x.divider}`},children:l})})]})}function ve(){const e=_(r=>r.settings);return z.useMemo(()=>Hr(e),[e])}function ot({tabs:e,active:r,onChange:t}){const o=_(m=>m.settings.mode),i=_(m=>m.settings.primaryHex)||"#4F6BFF",a=_(m=>m.settings.highlightHex)||"#ffd400",s=_(m=>m.settings.bodyWeight)||400,l=o==="dark",d=Math.min(900,s+200),g=ve(),f=l?"#e6edf3":"#1c2127",x=l?"#cdd4de":"#5a6573";return n.jsx(p.Box,{sx:{display:"flex",gap:"2px",mb:"2px",px:"2px",borderBottom:"1.5px solid rgba(120,130,145,0.5)"},children:e.map(m=>{const h=m.key===r,y=n.jsx(p.Button,{onClick:()=>t(m.key),disableRipple:!0,sx:{flex:1,minWidth:0,px:"2px",pt:"9px",pb:"8px",minHeight:44,borderRadius:"6px 6px 0 0",mb:"-1px",fontSize:`${g.tBodySm}px`,fontFamily:`${g.headFam},sans-serif`,fontWeight:h?d:s,letterSpacing:0,textTransform:"none",whiteSpace:"normal",lineHeight:1.15,textAlign:"center",color:h?f:x,opacity:h?1:.3,bgcolor:h?ce(a,l?.26:.18):"transparent",borderBottom:h?`3px solid ${i}`:"2px solid transparent",transition:"color .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease","&:hover":h?{bgcolor:ce(a,l?.26:.18)}:{opacity:1,bgcolor:"rgba(150,160,175,0.35)",borderRadius:"8px",boxShadow:"0 6px 18px rgba(0,0,0,0.35)",transform:"translateY(-2px)"}},children:m.label},m.key);return m.info?n.jsx(p.Tooltip,{title:m.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:y},m.key):y})})}function ml(){var G,D;const[e,r]=z.useState("presets"),t=_(C=>C.settings),o=t.mode==="dark",i=t.highlightHex||"#ffd400",a=ce(i,o?.3:.18),s=o?"#e6edf3":"#1c2127",l=o?"rgba(255,255,255,0.82)":"#2c333d",d=_(C=>C.savedThemes),g=_(C=>C.applyPreset),f=_(C=>C.applySaved),x=_(C=>C.saveTheme),m=_(C=>C.updateSaved),h=_(C=>C.renameSaved),y=_(C=>C.deleteSaved),u=_(C=>C.importTheme),b=_(C=>C.set),v=_(C=>C.isDirty),k=_(C=>C.editingSavedId),B=_(C=>C.lastImportedId),S=d.find(C=>C.id===k),j=(C,A)=>{const F=new Blob([JSON.stringify({name:C,snap:A},null,2)],{type:"application/json"}),X=URL.createObjectURL(F),w=document.createElement("a");w.href=X,w.download=`${C.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}.theme.json`,w.click(),URL.revokeObjectURL(X)},[R,O]=z.useState("");z.useEffect(()=>{if(!R)return;const C=setTimeout(()=>O(""),5e3);return()=>clearTimeout(C)},[R]);const[P,K]=z.useState(null),Q=C=>{const A=d.map(w=>w.name.toLowerCase());let F=C,X=2;for(;A.includes(F.toLowerCase());)F=`${C} ${X++}`;return F},U=C=>{var X;const A=(X=C.target.files)==null?void 0:X[0];if(!A)return;const F=new FileReader;F.onload=()=>{try{const w=JSON.parse(F.result),Z=w.snap??w;if(!al(Z)){O("Invalid theme file. The selected file is not a valid Theme Studio export.");return}const M=w.name||"Imported Theme";if(d.some(fe=>fe.name.toLowerCase()===M.toLowerCase())){K({name:M,snap:Z});return}O(""),u(M,Z)}catch{O("Invalid theme file. The selected file is not a valid Theme Studio export.")}},F.readAsText(A),C.target.value=""},[c,$]=z.useState(null),[H,W]=z.useState(!1),[N,Y]=z.useState(""),[L,J]=z.useState(null),[E,I]=z.useState(null),q=(S==null?void 0:S.name)||((G=Ct.find(C=>C.id===t.presetId))==null?void 0:G.name)||((D=d.find(C=>C.id===t.presetId))==null?void 0:D.name)||"Custom Theme",V=(C,A)=>{const F=C.trim();return F?d.some(X=>X.name.toLowerCase()===F.toLowerCase()&&X.id!==A)?"Name already exists":"":"Name required"};return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"presets",label:"Presets",info:"Ready-made colour themes."},{key:"saved",label:"My Themes",info:"Your saved custom themes."},{key:"mode",label:"Mode",info:"Light / Dark."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="presets"&&n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:Ct.map(C=>{const A=t.presetId===C.id;return n.jsxs(p.Box,{onClick:()=>g(C.id,C.snap),title:`${C.name} — applies this colour palette`,sx:{display:"flex",alignItems:"center",gap:"9px",p:"9px 10px",borderRadius:"11px",cursor:"pointer",textAlign:"left",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?a:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:C.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:C.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{fontSize:"11px",fontWeight:600,color:A?s:l,lineHeight:1.3},children:C.name})]},C.id)})}),e==="saved"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[d.length===0&&n.jsx(p.Typography,{variant:"caption",sx:{color:"text.secondary",py:2,textAlign:"center"},children:"No saved themes yet."}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:.9},children:d.map(C=>{const A=k===C.id;return n.jsxs(p.Box,{onClick:()=>f(C),title:"Apply this saved theme",sx:{display:"flex",flexDirection:"column",gap:.9,p:"9px 10px",borderRadius:"11px",cursor:"pointer",position:"relative",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?a:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[A&&B===C.id&&n.jsx(p.Tooltip,{title:"recently upload",arrow:!0,children:n.jsx(p.Box,{component:"span",sx:{position:"absolute",top:-2,right:0,width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:C.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:C.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:"11px",fontWeight:600,color:A?s:l,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},children:C.name}),n.jsx(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n.jsx(p.Box,{component:"span",onClick:F=>{F.stopPropagation(),$({el:F.currentTarget,id:C.id})},sx:{cursor:"pointer",color:"text.muted",px:.5},children:"⋮"})})]})]},C.id)})}),R&&n.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,bgcolor:"rgba(211,47,47,0.08)",border:"1px solid rgba(211,47,47,0.35)",borderRadius:"10px",px:1.5,py:1.25,color:"#b3261e"},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:15,lineHeight:1.4},children:"!"}),n.jsx(p.Box,{sx:{fontSize:12.5,lineHeight:1.4},children:R})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1,mt:1},children:[n.jsxs(p.Button,{size:"small",variant:"outlined",component:"label",sx:{flex:1,textTransform:"none"},children:["↑ Import",n.jsx("input",{hidden:!0,type:"file",accept:".json,application/json",onChange:U})]}),n.jsx(p.Button,{size:"small",variant:"outlined",onClick:()=>j(q,t),sx:{flex:1,textTransform:"none"},children:"⤓ Download"}),n.jsx(p.Button,{size:"small",variant:"contained",disabled:!v(),onClick:()=>{Y(S?S.name:""),W(!0)},sx:{flex:1,textTransform:"none"},children:"+ Save"})]})]}),e==="mode"&&n.jsx(p.Box,{sx:{display:"flex",gap:1},children:["light","dark"].map(C=>n.jsx(p.Button,{onClick:()=>b({mode:C}),variant:t.mode===C?"contained":"outlined",sx:{flex:1,textTransform:"capitalize"},children:C},C))})]}),n.jsxs(p.Menu,{open:!!c,anchorEl:c==null?void 0:c.el,onClose:()=>$(null),children:[n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);f(C),$(null)},children:"✏️ Edit"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);J({id:C.id,name:C.name}),$(null)},children:"✎ Rename"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);I({id:C.id,name:C.name}),$(null)},children:"🗑 Delete"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);j(C.name,C.snap),$(null)},children:"⤓ Download"})]}),n.jsxs(p.Dialog,{open:H,onClose:()=>W(!1),children:[n.jsx(p.DialogTitle,{children:S?`Save changes to “${S.name}”`:"Save theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"Theme name",value:N,onChange:C=>Y(C.target.value),error:!!V(N,S==null?void 0:S.id),helperText:V(N,S==null?void 0:S.id),sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>W(!1),children:"Cancel"}),S&&n.jsx(p.Button,{variant:"contained",disabled:!!V(N,S.id),onClick:()=>{m(S.id,N.trim(),t),W(!1)},children:"Update"}),n.jsx(p.Button,{variant:S?"outlined":"contained",disabled:!!V(N),onClick:()=>{x(N.trim()),W(!1)},children:S?"Save as New":"Save"})]})]}),n.jsxs(p.Dialog,{open:!!L,onClose:()=>J(null),children:[n.jsx(p.DialogTitle,{children:"Rename theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"New name",value:(L==null?void 0:L.name)??"",onChange:C=>J(A=>A&&{...A,name:C.target.value}),error:!!(L&&V(L.name,L.id)),helperText:L?V(L.name,L.id):"",sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>J(null),children:"Cancel"}),n.jsx(p.Button,{variant:"contained",disabled:!!(L&&V(L.name,L.id)),onClick:()=>{h(L.id,L.name.trim()),J(null)},children:"Rename"})]})]}),n.jsxs(p.Dialog,{open:!!P,onClose:()=>K(null),children:[n.jsx(p.DialogTitle,{children:"Theme already exists"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["A theme named “",P==null?void 0:P.name,"” is already in My Themes. Upload it anyway as a copy?"]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>{K(null),O("You’ve selected a duplicate file — it already exists.")},children:"Cancel"}),n.jsx(p.Button,{variant:"contained",onClick:()=>{u(Q(P.name),P.snap),K(null)},children:"Yes, continue"})]})]}),n.jsxs(p.Dialog,{open:!!E,onClose:()=>I(null),children:[n.jsx(p.DialogTitle,{children:"Delete theme"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["Delete “",E==null?void 0:E.name,"”? This cannot be undone."]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>I(null),children:"Cancel"}),n.jsx(p.Button,{color:"error",variant:"contained",onClick:()=>{y(E.id),I(null)},children:"Delete"})]})]})]})}function yl({tip:e,sk:r}){return n.jsx(p.Box,{component:"span",title:e,sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${r.chevron}`,color:r.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",flexShrink:0,cursor:"help",verticalAlign:"middle"},children:"i"})}function Ze({children:e,tip:r,sk:t,mt:o}){const i=ve();return n.jsxs(p.Box,{sx:{fontSize:`${i.tCaption}px`,fontWeight:i.bwEmph,fontFamily:`${i.bodyFam},sans-serif`,color:t.label2,textTransform:"uppercase",letterSpacing:".5px",mb:"6px",mt:o?`${o}px`:0,display:"flex",alignItems:"center",gap:"5px"},children:[e,r&&n.jsx(yl,{tip:r,sk:t})]})}function dt({value:e,onChange:r,w:t=30,h:o=24,r:i=7,border:a,sk:s}){return n.jsx(p.Box,{sx:{width:t,height:o,borderRadius:`${i}px`,position:"relative",overflow:"hidden",flexShrink:0,background:e,border:a?`1px solid ${s.insetBd}`:"none"},children:n.jsx(p.Box,{component:"input",type:"color",value:e,onChange:l=>r(l.target.value),sx:{position:"absolute",top:-4,left:-4,width:t+10,height:o+10,opacity:0,cursor:"pointer",border:"none",p:0}})})}const bl=/^#[0-9a-fA-F]{6}$/;function vl({value:e,onCommit:r,onWarnChange:t}){const[o,i]=z.useState(!1),[a,s]=z.useState(e),[l,d]=z.useState(""),g=z.useRef(void 0);z.useEffect(()=>{o||s(e)},[e,o]),z.useEffect(()=>()=>clearTimeout(g.current),[]);const f=m=>{clearTimeout(g.current),d(m),t==null||t(m),m&&(g.current=setTimeout(()=>{d(""),t==null||t("")},3e3))},x=m=>{const h=m.trim();return bl.test(h)?(f(""),r(h),!0):(f("Enter a valid hex colour, e.g. #4F6BFF"),!1)};return o?n.jsx(p.InputBase,{autoFocus:!0,value:a,title:l||void 0,onChange:m=>{s(m.target.value)},onBlur:()=>{x(a)||s(e),i(!1)},onKeyDown:m=>{m.key==="Enter"&&x(a)&&i(!1),m.key==="Escape"&&(s(e),f(""),i(!1))},sx:{color:l?"#ffcdd2":"#fff",fontSize:"12.5px",fontWeight:700,width:100,position:"relative",zIndex:1}}):n.jsxs(p.Box,{component:"span",title:l||void 0,onClick:()=>{s(e),i(!0)},sx:{color:l?"#ffcdd2":"rgba(255,255,255,.85)",fontSize:"12.5px",fontWeight:700,cursor:"text",position:"relative",zIndex:1},children:[e," · tap to change"]})}function Sl(){const[e,r]=z.useState("brand"),[t,o]=z.useState(""),i=_(v=>v.settings),a=_(v=>v.set),s=Pe(i.mode),l=ve(),d={fontSize:"11.5px",color:s.body,fontWeight:600},g={fontSize:`${l.tBodySm}px`,color:s.body,fontWeight:l.bodyWeightEff,fontFamily:`${l.bodyFam},sans-serif`,lineHeight:l.bodyLH},f=i.primaryHex||"#4F6BFF",x=Se(f),m=[50,100,200,300,400,500,600,700,800,900].map(v=>x[v]),h=v=>a({...v,presetId:"custom"}),y=[{key:"h1Color",label:"H1 · Page Title"},{key:"h2Color",label:"H2 · Metric"},{key:"h3Color",label:"H3 · Card Title"},{key:"h4Color",label:"H4 · Section Label"},{key:"h5Color",label:"H5 · Caption"},{key:"h6Color",label:"H6 · Overline"}],u=[{key:"successHex",label:"Success"},{key:"warningHex",label:"Warning"},{key:"infoHex",label:"Info"},{key:"errorHex",label:"Error"}],b=[{key:"cardBgHex",label:"Card background",fb:"#ffffff"},{key:"cardHdrHex",label:"Card header",fb:"#f6f8fb"},{key:"pageBgHex",label:"Page background",fb:"#f4f6f9"},{key:"notifCardHex",label:"Notification background",fb:"#ffffff"}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"brand",label:"Brand",info:"Core brand colours — primary, secondary and the selection highlight colour used across the app."},{key:"text",label:"Text",info:"Heading and body text colours"},{key:"status",label:"Status",info:"Status colours & surface overrides"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px",display:"flex",flexDirection:"column",gap:"11px"},children:[e==="brand"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Primary brand colour — main/filled buttons, active sidebar item, links, focus rings, first chart series, and the login Sign-in button.",children:"Brand Color"}),n.jsxs(p.Box,{sx:{position:"relative",height:46,borderRadius:"11px",background:f,overflow:"hidden",display:"flex",alignItems:"center",px:"14px",boxShadow:`0 3px 10px ${f}44`},children:[n.jsx(vl,{value:f,onCommit:v=>h({primaryHex:v}),onWarnChange:o}),n.jsx(p.Box,{component:"input",type:"color",value:f,onChange:v=>h({primaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})]}),n.jsx(p.Box,{sx:{display:"flex",gap:"2px",borderRadius:"7px",overflow:"hidden",height:14,mt:"7px"},children:m.map((v,k)=>n.jsx(p.Box,{sx:{flex:1,background:v}},k))}),t&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:l.warnSoft,border:`1px solid ${l.warnTxt}`,color:l.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),t]})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Secondary accent — secondary/outlined buttons, switches & toggles, selected chips, and the second data series in charts.",children:"Secondary / Accent"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"9px",background:i.secondaryHex,overflow:"hidden"},children:n.jsx(p.Box,{component:"input",type:"color",value:i.secondaryHex,onChange:v=>h({secondaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Accent colour used to draw attention — highlight panels, featured badges, callouts. Defaults to the brand colour.",children:"Highlight Colour"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"8px",background:i.highlightHex||i.primaryHex,overflow:"hidden",border:`1px solid ${s.insetBd}`},children:n.jsx(p.Box,{component:"input",type:"color",value:i.highlightHex||i.primaryHex,onChange:v=>h({highlightHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]})]}),e==="text"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(Ze,{sk:s,children:"Heading Text Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:y.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i[v.key]||"#1c2127",onChange:k=>a({[v.key]:k})}),n.jsx(p.Box,{component:"span",sx:g,children:v.label})]},v.key))}),n.jsx(Ze,{sk:s,children:"Body Text Colors"}),n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.textPrimaryHex||"#1c2127",onChange:v=>a({textPrimaryHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Main body text colour.",children:"Primary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.textSecondaryHex||"#5a6573",onChange:v=>a({textSecondaryHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Muted text colour.",children:"Secondary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.dividerHex||"#e3e8ee",onChange:v=>a({dividerHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Divider / border colour.",children:"Divider"})]})]})]}),e==="status"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"7px"},children:[n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Success, warning, error & info colours — used for alerts, status pills, toasts and validation states.",children:"Status Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:u.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:s.card,border:`1px solid ${s.insetBd}`,borderRadius:"9px",px:"9px",py:"7px"},children:[n.jsx(dt,{sk:s,w:22,h:22,r:6,value:i[v.key],onChange:k=>a({[v.key]:k})}),n.jsx(p.Box,{component:"span",sx:d,children:v.label})]},v.key))})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Override the auto-generated surface colours. Leave on Auto to follow the surface tint & mode.",children:"Surfaces"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:b.map(v=>{const k=!!i[v.key];return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:s.card,border:`1px solid ${s.insetBd}`,borderRadius:"9px",px:"9px",py:"5px"},children:[n.jsx(dt,{sk:s,w:22,h:22,r:6,border:!0,value:i[v.key]||v.fb,onChange:B=>a({[v.key]:B})}),n.jsx(p.Box,{component:"span",sx:{...d,flex:1},children:v.label}),k&&n.jsx(p.Box,{component:"button",title:"Reset to Auto",onClick:()=>a({[v.key]:""}),sx:{background:"transparent",border:`1px solid ${s.insetBd}`,borderRadius:"6px",color:s.muted,fontSize:"10px",fontWeight:700,px:"7px",py:"3px",cursor:"pointer"},children:"Auto"})]},v.key)})})]})]})]})]})}function xe(e){const{label:r,info:t,value:o,effective:i,min:a,max:s,step:l=1,unit:d="",autoLabel:g,autoValue:f=0,softMin:x,softMax:m,floorValue:h,floorReset:y,floorMessage:u,extra:b,onChange:v}=e,k=Pe(_(Y=>Y.settings.mode)),B=ve(),S=`${B.bodyFam},sans-serif`,[j,R]=z.useState(!1),[O,P]=z.useState(String(i)),[K,Q]=z.useState(""),U=z.useRef(void 0);z.useEffect(()=>{j||P(String(i))},[i,j]),z.useEffect(()=>()=>clearTimeout(U.current),[]);const c=Y=>{clearTimeout(U.current),Q(Y),Y&&(U.current=setTimeout(()=>Q(""),3e3))},$=Y=>x!=null&&Y<x?`Below ${x}${d} may break the UI`:m!=null&&Y>m?`Above ${m}${d} may break the UI`:"",H=()=>{c(u??`Minimum is ${y}${d} — reset`),v(y),P(String(y))},W=Y=>{const L=parseFloat(Y);if(isNaN(L)){c("Enter a number"),P(String(i));return}if(h!=null&&y!=null&&L<=h){H();return}const J=Math.min(s,Math.max(a,L));c(J!==L?`Must be between ${a}${d} and ${s}${d} — clamped to ${J}${d}`:$(J)),P(String(J)),v(J)},N=o===f&&g?g:`${i}${d}`;return n.jsxs(p.Box,{sx:{mb:1.5},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:"8px"},children:[n.jsxs(p.Typography,{sx:{fontSize:`${B.tBodySm}px`,fontWeight:B.bwEmph,fontFamily:S,lineHeight:B.bodyLH,color:k.label2,display:"flex",alignItems:"center",gap:"5px"},children:[r,t&&n.jsx(p.Tooltip,{title:t,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${k.chevron}`,color:k.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"5px",flexShrink:0},children:[j?n.jsx(p.InputBase,{autoFocus:!0,value:O,onChange:Y=>P(Y.target.value),onBlur:()=>{W(O),R(!1)},onKeyDown:Y=>{Y.key==="Enter"&&(W(O),R(!1)),Y.key==="Escape"&&R(!1)},sx:{width:56,fontSize:`${B.tBodySm}px`,fontWeight:700,fontFamily:S,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsxs(p.Box,{component:"button",onClick:()=>{P(String(i)),R(!0)},sx:{display:"inline-flex",alignItems:"center",gap:"5px",fontFamily:S,fontSize:`${B.tBodySm}px`,fontWeight:800,color:k.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"7px",py:"2px",cursor:"pointer",lineHeight:1.3,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:[N,n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",flexShrink:0},children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]})]}),b]})]}),n.jsx(p.Box,{component:"input",type:"range",min:a,max:s,step:l,value:i,onChange:Y=>{const L=parseFloat(Y.target.value);if(h!=null&&y!=null&&L<=h){H();return}c($(L)),v(L)},sx:{WebkitAppearance:"none",appearance:"none",width:"100%",height:"4px",m:0,p:0,display:"block",borderRadius:"2px",outline:"none",cursor:"pointer",background:"#dde3ea",accentColor:"primary.main","&::-webkit-slider-thumb":{WebkitAppearance:"none",width:18,height:18,borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"},"&::-moz-range-thumb":{width:18,height:18,border:"none",borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"}}}),K&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:B.warnSoft,border:`1px solid ${B.warnTxt}`,color:B.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),K]})]})}const Rn=new Set;function oo(e,r){if(Rn.has(e))return;Rn.add(e);const t=document.createElement("style");t.textContent=`@font-face{font-family:'${e}';src:url('${r}');font-display:swap;}`,document.head.appendChild(t)}function En(e){e.forEach(r=>oo(r.name,r.dataUrl))}const Cl=[{key:"Roboto",label:"Roboto",sub:"Material"},{key:"Inter",label:"Inter",sub:"Enterprise"},{key:"DM Sans",label:"DM Sans",sub:"Modern"},{key:"Manrope",label:"Manrope",sub:"Geometric"},{key:"Plus Jakarta Sans",label:"Jakarta",sub:"Friendly"},{key:"Nunito Sans",label:"Nunito",sub:"Rounded"}],wl=[{key:"Figtree",label:"Google Sans"},{key:"Roboto",label:"Roboto"},{key:"Inter",label:"Inter"},{key:"Arial",label:"Arial"},{key:"Manrope",label:"Manrope"},{key:"Plus Jakarta Sans",label:"Jakarta"}];function It({label:e,fam:r,active:t,onClick:o,onDelete:i}){const a=_(x=>x.settings.mode),s=_(x=>x.settings.primaryHex)||"#4F6BFF",l=_(x=>x.settings.highlightHex)||"#ffd400",d=a==="dark",g=Se(s),f=ce(l,d?.3:.18);return n.jsxs(p.Box,{onClick:o,sx:{position:"relative",py:"17px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",border:`1px solid ${t?d?g[400]:s:d?"#363d48":"#e3e8ee"}`,bgcolor:t?f:d?"#262b34":"#ffffff",transition:"all .14s ease","&:hover":t?{}:{borderColor:d?"#4a5361":"#c9d0d9"}},children:[n.jsx(p.Box,{sx:{fontFamily:`${r}, sans-serif`,fontSize:13,fontWeight:700,lineHeight:1,color:t?d?g[200]:g[700]:d?"#aeb6c0":"#5a6573"},children:e}),i&&n.jsx(p.Box,{component:"span",title:`Remove custom font ${e}`,onClick:x=>{x.stopPropagation(),i()},sx:{position:"absolute",top:4,right:4,width:17,height:17,borderRadius:"50%",display:"grid",placeItems:"center",fontSize:10,fontWeight:800,color:d?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)",bgcolor:d?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)",cursor:"pointer",transition:"all .12s ease","&:hover":{bgcolor:"error.main",color:"#ffffff"}},children:"✕"})]})}const jl=["woff2","woff","ttf","otf"],kl=10*1024*1024,Tl=e=>new Promise((r,t)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>t(o.error),o.readAsDataURL(e)}),Bl=e=>new Promise(r=>{const t=setTimeout(()=>r(!1),5e3),o=new FileReader;o.onload=()=>{var s;clearTimeout(t);const i=new Uint8Array(o.result),a=((s=e.name.split(".").pop())==null?void 0:s.toLowerCase())||"";if(a==="woff2"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===50||a==="woff"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===70||a==="otf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79||a==="ttf"&&i[0]===0&&i[1]===1&&i[2]===0&&i[3]===0||a==="ttf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79)return r(!0);r(!1)},o.onerror=()=>{clearTimeout(t),r(!1)};try{o.readAsArrayBuffer(e.slice(0,4))}catch{clearTimeout(t),r(!1)}});function Hn({label:e,list:r,onAdd:t}){const o=Pe(_(f=>f.settings.mode)),i=ve(),[a,s]=z.useState(""),l=z.useRef(void 0);z.useEffect(()=>()=>clearTimeout(l.current),[]);const d=f=>{clearTimeout(l.current),s(f),f&&(l.current=setTimeout(()=>s(""),8e3))},g=async f=>{var k;const x=Array.from(f.target.files??[]);if(f.target.value="",!x.length)return;const m=[],h=[],y=[],u=[],b=[];for(const B of x){const S=((k=B.name.split(".").pop())==null?void 0:k.toLowerCase())||"";if(!jl.includes(S)){y.push(B.name);continue}if(B.size>kl){u.push(B.name);continue}if(!await Bl(B)){b.push(B.name);continue}const j=B.name.replace(/\.[^.]+$/,""),R=P=>P.toLowerCase()===j.toLowerCase();if(r.some(P=>R(P.name))||m.some(P=>R(P.name))){h.push(j);continue}const O=await Tl(B);oo(j,O),m.push({name:j,dataUrl:O})}m.length&&t(m);const v=[];h.length&&v.push(`Already added: ${h.join(", ")}`),y.length&&v.push(`Unsupported file type: ${y.join(", ")}`),u.length&&v.push(`Too large (max 10MB): ${u.join(", ")}`),b.length&&v.push(`Invalid font file: ${b.join(", ")}`),d(v.join(" · "))};return n.jsxs(p.Box,{sx:{mt:1.5},children:[n.jsxs(p.Box,{component:"label",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.75,bgcolor:o.inset,border:`1.5px dashed ${o.insetBd}`,borderRadius:"9px",p:1.5,cursor:"pointer",color:o.body,fontSize:11.5,fontWeight:600,fontFamily:`${i.bodyFam},sans-serif`,textAlign:"center"},children:["⬆ ",e,n.jsx(p.Box,{component:"span",sx:{color:o.muted},children:".woff2 / .ttf / .otf"}),n.jsx("input",{type:"file",accept:".woff2,.woff,.ttf,.otf",multiple:!0,onChange:g,style:{display:"none"}})]}),a&&n.jsxs(p.Box,{sx:{mt:.9,display:"flex",alignItems:"center",justifyContent:"space-between",gap:.9,bgcolor:"error.main",borderRadius:2,px:1.4,py:.9,color:"error.contrastText",fontFamily:`${i.bodyFam},sans-serif`},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.9},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:12},children:"✕"}),n.jsx(p.Box,{component:"span",sx:{fontSize:11.5},children:a})]}),n.jsx(p.Box,{component:"span",title:"Dismiss",onClick:()=>s(""),sx:{cursor:"pointer",fontSize:11,fontWeight:700,px:.5,opacity:.8,"&:hover":{opacity:1}},children:"✕"})]})]})}const Rl={compact:1.15,default:1.25,airy:1.414};function El(){const e=_(f=>f.settings),r=_(f=>f.set),t=Pe(e.mode),o=ve(),[i,a]=z.useState(!1),s=e.scaleRatioCustom>0?e.scaleRatioCustom:Rl[e.scaleRatio]??1.25,[l,d]=z.useState(s.toFixed(2));z.useEffect(()=>{i||d(s.toFixed(2))},[s,i]);const g=()=>{const f=parseFloat(l);isNaN(f)||r({scaleRatioCustom:f}),a(!1)};return i?n.jsx(p.InputBase,{autoFocus:!0,value:l,onChange:f=>d(f.target.value),onBlur:g,onKeyDown:f=>{f.key==="Enter"&&g(),f.key==="Escape"&&a(!1)},sx:{width:56,fontSize:"11.5px",fontWeight:700,fontFamily:`${o.bodyFam},sans-serif`,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsx(p.Box,{component:"button",title:"Configure scale ratio — each heading is the one above ÷ this value",onClick:()=>{d(s.toFixed(2)),a(!0)},sx:{display:"inline-grid",placeItems:"center",color:t.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"6px",py:"3px",cursor:"pointer",fontFamily:`${o.bodyFam},sans-serif`,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})}function Hl(){const[e,r]=z.useState("bodyFont"),t=_(a=>a.settings),o=_(a=>a.set),i=_(a=>a.deleteCustomFont);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"bodyFont",label:"Body Font",info:"Typeface used for body / paragraph text (headings use the Heading Font)"},{key:"headFont",label:"Heading Font",info:"Choose a separate typeface for headings (or match the body font)"},{key:"headText",label:"Heading Text",info:"Fine-tune size & weight per heading level (H1–H4)"},{key:"bodyText",label:"Body Text",info:"Adjust base font size and line height for body copy"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="bodyFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[Cl.map(a=>n.jsx(It,{label:a.label,sub:a.sub,fam:a.key,active:t.fontFamily===a.key,onClick:()=>o({fontFamily:a.key})},a.key)),t.customFonts.map(a=>n.jsx(It,{label:a.name,sub:"Custom",fam:a.name,active:t.fontFamily===a.name,onClick:()=>o({fontFamily:a.name}),onDelete:()=>i(a.name,!1)},a.name))]}),n.jsx(Hn,{label:"Upload custom font",list:t.customFonts,onAdd:a=>o({customFonts:[...a,...t.customFonts],fontFamily:a[0].name})})]}),e==="headFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[wl.map(a=>n.jsx(It,{label:a.label,fam:a.key,active:t.headingFont===a.key,onClick:()=>o({headingFont:a.key})},a.key)),t.customHeadFonts.map(a=>n.jsx(It,{label:a.name,sub:"Custom",fam:a.name,active:t.headingFont===a.name,onClick:()=>o({headingFont:a.name}),onDelete:()=>i(a.name,!0)},a.name))]}),n.jsx(Hn,{label:"Upload heading font",list:t.customHeadFonts,onAdd:a=>o({customHeadFonts:[...a,...t.customHeadFonts],headingFont:a[0].name})})]}),e==="headText"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"H1 size",info:"All heading levels scale from H1 by a modular ratio (configurable via the gear icon).",value:t.h1Size,effective:t.h1Size||20,min:18,max:56,unit:"px",extra:n.jsx(El,{}),onChange:a=>o({h1Size:a})}),n.jsx(xe,{label:"Weight (all headings)",value:t.headingWeight,effective:t.headingWeight,min:300,max:900,step:100,onChange:a=>o({headingWeight:a})}),n.jsx(xe,{label:"Line height (all headings)",value:t.headingLH,effective:t.headingLH||1.2,min:.9,max:2,step:.05,autoLabel:"Auto (1.20)",onChange:a=>o({headingLH:a})})]}),e==="bodyText"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Base font size",info:"Root body text size.",value:t.baseFontPx,effective:t.baseFontPx||12,min:9,max:20,unit:"px",softMin:9,onChange:a=>o({baseFontPx:a})}),n.jsx(xe,{label:"Body weight",value:t.bodyWeight,effective:t.bodyWeight||400,min:300,max:900,step:100,autoLabel:"Auto (400)",onChange:a=>o({bodyWeight:a})}),n.jsx(xe,{label:"Body line height",value:t.bodyLineHeight,effective:t.bodyLineHeight||1.5,min:1.2,max:2,step:.05,autoLabel:"Auto (1.50)",onChange:a=>o({bodyLineHeight:a})})]})]})]})}function je({options:e,value:r,columns:t=3,onChange:o}){const i=_(v=>v.settings.mode),a=_(v=>v.settings.primaryHex)||"#4F6BFF",s=_(v=>v.settings.highlightHex)||"#ffd400",l=i==="dark",d=Se(a),g=ve(),f=`${g.bodyFam},sans-serif`,x=ce(s,l?.3:.18),m=l?d[400]:a,h=l?d[200]:d[700],y=l?"#262b34":"#ffffff",u=l?"#363d48":"#e3e8ee",b=l?"#aeb6c0":"#5a6573";return n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"6px"},children:e.map(v=>{const k=v.key===r,B=n.jsx(p.Box,{onClick:()=>o(v.key),sx:{py:"9px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",userSelect:"none",fontSize:`${g.tCaption}px`,fontWeight:k?g.bwEmph:g.bodyWeightEff,fontFamily:f,border:`1px solid ${k?m:u}`,bgcolor:k?x:y,color:k?h:b,transition:"color .14s ease, background .14s ease, border-color .14s ease","&:hover":k?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:v.label},v.key);return v.info?n.jsx(p.Tooltip,{title:v.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:B},v.key):B})})}const Dt={outlined:0,soft:6,floating:24},Ft={plain:0,tinted:40,accent:60},Pl={bordered:0,recessed:6,lighter:4};function $l(){const[e,r]=z.useState("style"),t=_(d=>d.settings),o=_(d=>d.set),i=t.cardShadowPx>=0?t.cardShadowPx:Dt[t.cardStyle]??24,a=t.headerStrength>=0?t.headerStrength:Ft[t.cardHeader]??45,s=t.nestedDepth>=0?t.nestedDepth:Pl[t.nestedStyle]??6,l=t.tintIntensity>=0?t.tintIntensity:100;return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"style",label:"Style",info:"Card border vs shadow depth."},{key:"header",label:"Header",info:"Card header treatment."},{key:"nested",label:"Nested",info:"How cards-within-cards look."},{key:"tint",label:"Tint",info:"Overall surface tint colour & strength."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="style"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardStyle,onChange:d=>{const g=d;o({cardStyle:g,cardShadowPx:Dt[g]})},options:[{key:"outlined",label:"Outlined"},{key:"soft",label:"Soft"},{key:"floating",label:"Floating"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Shadow depth",info:"Card elevation (px).",value:t.cardShadowPx,effective:i,min:0,max:32,unit:"px",autoValue:-1,autoLabel:`Auto (${i}px)`,softMin:t.cardStyle==="outlined"?void 0:1,softMax:32,floorValue:t.cardStyle==="outlined"?void 0:0,floorReset:Dt[t.cardStyle],floorMessage:`${t.cardStyle==="soft"?"Soft":"Floating"} cards need shadow - reset to ${Dt[t.cardStyle]}px`,onChange:d=>o({cardShadowPx:d})})})]}),e==="header"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardHeader,onChange:d=>{const g=d;o({cardHeader:g,headerStrength:Ft[g]})},options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Header strength",info:"Header tint / accent intensity.",value:t.headerStrength,effective:a,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${a}%)`,softMin:t.cardHeader==="plain"?void 0:1,floorValue:t.cardHeader==="plain"?void 0:0,floorReset:Ft[t.cardHeader],floorMessage:`${t.cardHeader==="tinted"?"Tinted":"Accent"} headers need strength - reset to ${Ft[t.cardHeader]}%`,onChange:d=>o({headerStrength:d})})})]}),e==="nested"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.nestedStyle,onChange:d=>o({nestedStyle:d}),options:[{key:"recessed",label:"Recessed"},{key:"lighter",label:"Lighter"},{key:"bordered",label:"Bordered"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Nested depth",info:"Inset depth of cards-within-cards.",value:t.nestedDepth,effective:s,min:0,max:24,unit:"px",autoValue:-1,autoLabel:`Auto (${s}px)`,onChange:d=>o({nestedDepth:d})})})]}),e==="tint"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.surfaceTint,onChange:d=>o({surfaceTint:d}),options:[{key:"snow",label:"None"},{key:"neutral",label:"Low"},{key:"brand",label:"High"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Tint intensity",info:"Strength of the page surface tint.",value:t.tintIntensity,effective:l,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${l}%)`,onChange:d=>o({tintIntensity:d})})})]})]})]})}function Al(){const[e,r]=z.useState("rows"),t=_(i=>i.settings),o=_(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"rows",label:"Rows",info:"Row density & dividers."},{key:"cols",label:"Columns",info:"Column density & dividers."},{key:"cells",label:"Cells",info:"Cell text & vertical alignment."},{key:"styling",label:"Styling",info:"Header background & row striping."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="rows"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableDensity,onChange:i=>o({tableDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableDividers,onChange:i=>o({tableDividers:i.target.checked})}),label:"Row dividers"}),t.tableDividers&&n.jsx(xe,{label:"Divider width",value:t.tableRowDivW,effective:t.tableRowDivW,min:1,max:4,unit:"px",onChange:i=>o({tableRowDivW:i})})]}),e==="cols"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableColDensity,onChange:i=>o({tableColDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableColDividers,onChange:i=>o({tableColDividers:i.target.checked})}),label:"Column dividers"}),t.tableColDividers&&n.jsx(xe,{label:"Divider width",value:t.tableColDivW,effective:t.tableColDivW,min:1,max:4,unit:"px",onChange:i=>o({tableColDivW:i})})]}),e==="cells"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableCellAlignH,onChange:i=>o({tableCellAlignH:i}),options:[{key:"left",label:"Left"},{key:"center",label:"Center"},{key:"right",label:"Right"}]}),n.jsx(p.Box,{sx:{mt:1},children:n.jsx(je,{value:t.tableCellAlignV,onChange:i=>o({tableCellAlignV:i}),options:[{key:"top",label:"Top"},{key:"middle",label:"Middle"},{key:"bottom",label:"Bottom"}]})})]}),e==="styling"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableHeaderStyle,onChange:i=>o({tableHeaderStyle:i}),options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableStripe,onChange:i=>o({tableStripe:i.target.checked})}),label:"Striped rows"})]})]})]})}const xr={compact:.82,default:1,comfortable:1.16};function Il(){const[e,r]=z.useState("shape"),t=_(d=>d.settings),o=_(d=>d.set),i=Pe(t.mode),a=t.densityScale>0?t.densityScale:Math.round((xr[t.density]??1)*100),s=t.cardGapPx>0?t.cardGapPx:Math.round(16*(xr[t.density]??1)),l=t.containerPadPx>0?t.containerPadPx:Math.round(10*(xr[t.density]??1));return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"shape",label:"Shape",info:"Corner radius & layout density."},{key:"effects",label:"Effects",info:"Spacing, button case & status chips."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="shape"&&n.jsxs(n.Fragment,{children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Corner Radius"}),n.jsx(je,{value:t.radiusPreset,onChange:d=>o({radiusPreset:d,radiusVal:d==="sharp"?0:d==="round"?18:9}),options:[{key:"sharp",label:"Sharp"},{key:"rounded",label:"Rounded"},{key:"round",label:"Round"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(xe,{label:"Exact radius",value:t.radiusVal,effective:t.radiusVal,min:0,max:28,unit:"px",onChange:d=>o({radiusVal:d,radiusPreset:"rounded"})})}),n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75,mt:.5},children:"Density"}),n.jsx(je,{value:t.densityScale>0?"":t.density,onChange:d=>o({density:d,densityScale:0}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(xe,{label:"Exact density",info:"Fine-tune spacing scale (%).",value:t.densityScale,effective:a,min:60,max:140,unit:"%",onChange:d=>o({densityScale:d})})})]}),e==="effects"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Card-to-card gap",value:t.cardGapPx,effective:s,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${s}px)`,onChange:d=>o({cardGapPx:d})}),n.jsx(xe,{label:"Container padding",value:t.containerPadPx,effective:l,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${l}px)`,onChange:d=>o({containerPadPx:d})}),n.jsx(xe,{label:"Edge gap",info:"Space between the preview frame and the outer app card.",value:t.edgePadPx,effective:t.edgePadPx,min:0,max:40,step:2,unit:"px",autoLabel:"0px (flush)",onChange:d=>o({edgePadPx:d})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2},children:"Uppercase button labels"}),n.jsx(p.Switch,{size:"small",checked:t.btnCase==="upper",onChange:d=>o({btnCase:d.target.checked?"upper":"none"})})]}),n.jsxs(p.Box,{sx:{mt:1.25},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Status Chips"}),n.jsx(je,{columns:2,value:t.statusBold?"bold":"soft",onChange:d=>o({statusBold:d==="bold"}),options:[{key:"soft",label:"Soft"},{key:"bold",label:"Bold"}]})]})]})]})]})}function Dl(){const[e,r]=z.useState("placement"),t=_(i=>i.settings),o=_(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"placement",label:"Placement",info:"Where toasts appear."},{key:"behaviour",label:"Behaviour",info:"Width & auto-dismiss."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="placement"&&n.jsx(je,{columns:2,value:t.notifPosition,onChange:i=>o({notifPosition:i}),options:[{key:"top-center",label:"Top Center"},{key:"top-right",label:"Top Right"},{key:"bottom-left",label:"Bottom Left"},{key:"bottom-right",label:"Bottom Right"}]}),e==="behaviour"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Toast width",value:t.toastW,effective:t.toastW||252,min:200,max:500,unit:"px",softMax:500,onChange:i=>o({toastW:i})}),n.jsx(p.FormControlLabel,{sx:{mt:.5},control:n.jsx(p.Switch,{checked:t.notifBadge,onChange:i=>o({notifBadge:i.target.checked})}),label:"Show unread badge"}),n.jsx(p.FormControlLabel,{sx:{mt:.5,display:"flex"},control:n.jsx(p.Switch,{checked:t.notifAutoDismiss,onChange:i=>o({notifAutoDismiss:i.target.checked})}),label:"Auto-dismiss toasts"}),t.notifAutoDismiss&&n.jsx(xe,{label:"Dismiss after",value:t.autoDismissSec,effective:t.autoDismissSec||5,min:5,max:30,unit:"s",onChange:i=>o({autoDismissSec:i})})]})]})]})}function Fl({label:e,info:r,value:t,fallback:o,onChange:i,onReset:a}){const s=Pe(_(f=>f.settings.mode)),[l,d]=z.useState(null),g=t||o;return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[n.jsx(p.Box,{onClick:f=>d(f.currentTarget),sx:{width:22,height:22,borderRadius:1.5,border:`1px solid ${s.insetBd}`,bgcolor:g,cursor:"pointer",flexShrink:0}}),n.jsxs(p.Typography,{variant:"caption",sx:{flex:1,color:s.body,display:"flex",alignItems:"center",gap:.5},children:[e,r&&n.jsx(p.Tooltip,{title:r,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${s.chevron}`,color:s.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),t&&a&&n.jsx(p.Box,{component:"span",onClick:a,title:"Reset to theme default",sx:{fontSize:13,color:s.muted,cursor:"pointer"},children:"↺"}),n.jsx(p.Popover,{open:!!l,anchorEl:l,onClose:()=>d(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:n.jsx(p.Box,{sx:{p:1},children:n.jsx("input",{type:"color",value:g,onChange:f=>i(f.target.value),style:{width:160,height:40,border:"none",background:"none"}})})})]})}function Ol({src:e,aspect:r,onCancel:t,onConfirm:o}){const[i,a]=z.useState(1),[s,l]=z.useState({x:0,y:0}),d=z.useRef(null),g=z.useRef(null),f=z.useRef(null),x=z.useRef(null);z.useEffect(()=>{const y=b=>{x.current&&l({x:x.current.ox+(b.clientX-x.current.sx),y:x.current.oy+(b.clientY-x.current.sy)})},u=()=>{x.current=null};return document.addEventListener("pointermove",y),document.addEventListener("pointerup",u),()=>{document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",u)}},[]);const m=y=>{y.preventDefault(),x.current={sx:y.clientX,sy:y.clientY,ox:s.x,oy:s.y}},h=()=>{const y=d.current,u=g.current,b=f.current;if(!y||!u){o(e);return}const v=(b||y).getBoundingClientRect(),k=1e3,B=Math.round(k*r),S=B/v.width,j=document.createElement("canvas");j.width=B,j.height=k;const R=j.getContext("2d");if(!R){o(e);return}const O=u.getBoundingClientRect(),P=(O.left-v.left)*S,K=(O.top-v.top)*S,Q=O.width*S,U=O.height*S;try{R.drawImage(u,P,K,Q,U),o(j.toDataURL("image/png"))}catch{o(e)}};return hi.createPortal(n.jsx(p.Box,{sx:{position:"fixed",inset:0,zIndex:1400,bgcolor:"rgba(15,23,42,.6)",display:"flex",alignItems:"center",justifyContent:"center",p:2.25,overflow:"auto"},children:n.jsxs(p.Box,{sx:{width:"100%",maxWidth:320,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 20px 50px rgba(15,23,42,.4)",p:2},children:[n.jsx(p.Typography,{sx:{fontSize:14,fontWeight:800,mb:.5},children:"Adjust brand image"}),n.jsx(p.Typography,{sx:{fontSize:11.5,color:"text.secondary",mb:1.5,lineHeight:1.45},children:"Drag and zoom to fit your image inside the bright frame. Anything in the dimmed area is cropped out."}),n.jsxs(p.Box,{ref:d,onPointerDown:m,sx:{position:"relative",width:"100%",aspectRatio:String(r),borderRadius:2.5,overflow:"hidden",bgcolor:"#e9edf2",cursor:"grab",touchAction:"none",display:"grid",placeItems:"center","&:active":{cursor:"grabbing"}},children:[n.jsx("img",{ref:g,src:e,alt:"",draggable:!1,style:{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%,-50%) translate(${s.x}px,${s.y}px) scale(${i})`,transformOrigin:"center",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",userSelect:"none",pointerEvents:"none"}}),n.jsx(p.Box,{ref:f,sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"72%",aspectRatio:String(r),maxWidth:"90%",boxShadow:"0 0 0 9999px rgba(10,15,25,.62)",border:"2px solid #fff",borderRadius:"3px",pointerEvents:"none"}})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,my:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:12,fontWeight:700,color:"text.secondary"},children:"Zoom"}),n.jsx(p.Slider,{size:"small",min:.3,max:4,step:.02,value:i,onChange:(y,u)=>a(u)})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:t,sx:{flex:1,p:1.25,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Cancel"}),n.jsx(p.Box,{component:"button",onClick:h,sx:{flex:1,p:1.25,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Confirm"})]})]})}),document.body)}function Ml(){const e=_(f=>f.settings),r=_(f=>f.set),t=Pe(e.mode),[o,i]=z.useState(null),a=(f,x)=>{var y;const m=(y=f.target.files)==null?void 0:y[0];if(!m)return;const h=new FileReader;h.onload=()=>i({src:h.result,aspect:x==="logoUrl"?3.5:1.55,target:x}),h.readAsDataURL(m),f.target.value=""},s=f=>{o&&(o.target==="logoUrl"?r({logoUrl:f,logoMode:"image"}):r({loginImage:f}),i(null))},l={fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:".6px"},d={display:"flex",alignItems:"center",justifyContent:"center",gap:1,border:`1.5px dashed ${t.insetBd}`,borderRadius:2.5,p:1.75,cursor:"pointer",color:t.body,fontSize:12.5,fontWeight:600,bgcolor:t.inset},g=(f,x)=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:1,p:.9,bgcolor:t.inset,border:`1px solid ${t.insetBd}`,borderRadius:2},children:[n.jsx(p.Typography,{variant:"caption",sx:{flex:1,minWidth:0,color:t.body,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),n.jsx(p.Box,{component:"button",onClick:x,title:"Remove",sx:{border:"none",background:"transparent",color:t.muted,cursor:"pointer",fontSize:14},children:"✕"})]});return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.75},children:[n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Brand Image"}),n.jsxs(p.Box,{component:"label",sx:d,children:["⬆ Choose image",n.jsx("input",{hidden:!0,type:"file",accept:"image/*",onChange:f=>a(f,"loginImage")})]}),e.loginImage&&g("Uploaded image",()=>r({loginImage:""}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Logo"}),n.jsxs(p.Box,{component:"label",sx:d,children:["⬆ Choose logo file",n.jsx("input",{hidden:!0,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp",onChange:f=>a(f,"logoUrl")})]}),e.logoMode==="image"&&e.logoUrl&&g("Uploaded logo",()=>r({logoUrl:"",logoMode:"icon"}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:.5},children:"Panel Colour"}),n.jsx(Fl,{label:"Login panel background",value:e.loginPanelColor,fallback:e.primaryHex,onChange:f=>r({loginPanelColor:f}),onReset:()=>r({loginPanelColor:""})})]}),o&&n.jsx(Ol,{src:o.src,aspect:o.aspect,onCancel:()=>i(null),onConfirm:s})]})}const Wl=[{key:"dashboard",label:"Dashboard"},{key:"orders",label:"Orders"},{key:"reports",label:"Reports"},{key:"cameras",label:"Cameras"},{key:"operations",label:"Operations"},{key:"components",label:"Components"},{key:"login",label:"Login"}],zl=[{key:"dashboard",label:"Dashboard"},{key:"operations",label:"Operations"},{key:"cameras",label:"Cameras"},{key:"reports",label:"Reports"},{key:"orders",label:"Orders"},{key:"components",label:"Components"}],De=ro(e=>({openSection:"",setOpenSection:r=>e({openSection:r}),previewScreen:"dashboard",setPreviewScreen:r=>e({previewScreen:r}),previewMenuOpen:!1,setPreviewMenuOpen:r=>e({previewMenuOpen:r}),studioOpen:!0,setStudioOpen:r=>e({studioOpen:r}),defaultLoginImage:"",setDefaultLoginImage:r=>e({defaultLoginImage:r})}));function _l({onClose:e}){var C,A,F,X;const r=De(w=>w.openSection),t=De(w=>w.setOpenSection),o=De(w=>w.setPreviewScreen),i=De(w=>w.previewScreen),a=De(w=>w.previewMenuOpen),s=De(w=>w.setPreviewMenuOpen),l=_(w=>w.settings),d=_(w=>w.savedThemes),g=_(w=>w.editingSavedId),f=_(w=>w.isDirty),x=_(w=>w.updateSaved),m=_(w=>w.set),h=_(w=>w.reset),y=Pe(l.mode),u=z.useRef("theme"),[b,v]=z.useState(!1),k=(w,Z)=>{const M=r!==w;t(M?w:""),s(!1),M&&u.current!==w&&(o(Z),u.current=w)},B=((C=d.find(w=>w.id===g))==null?void 0:C.name)||((A=Ct.find(w=>w.id===l.presetId))==null?void 0:A.name)||((F=d.find(w=>w.id===l.presetId))==null?void 0:F.name)||"Custom Theme",S=f(),j=((X=Ct.find(w=>w.id===Ce.presetId))==null?void 0:X.name)??"default",R={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},O=({children:w})=>n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",...R,children:w}),P=n.jsxs(O,{children:[n.jsx("circle",{cx:"13.5",cy:"6.5",r:"2.5"}),n.jsx("circle",{cx:"17.5",cy:"10.5",r:"2.5"}),n.jsx("circle",{cx:"8.5",cy:"7.5",r:"2.5"}),n.jsx("circle",{cx:"6.5",cy:"12.5",r:"2.5"}),n.jsx("path",{d:"M12 2a10 10 0 0 0 0 20 3 3 0 0 0 0-6 2 2 0 0 1 0-4 4 4 0 0 0 4-4 6 6 0 0 0-4-6z"})]}),K=n.jsxs(p.Box,{sx:{display:"flex",gap:"2px",width:14,height:14},children:[n.jsx(p.Box,{sx:{flex:1,background:l.secondaryHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.errorHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.successHex,borderRadius:"2px"}})]}),Q=n.jsxs(O,{children:[n.jsx("path",{d:"M4 20 9 5l5 15M6 14h6"}),n.jsx("path",{d:"M15 20l3-9 3 9M16.2 17h3.6"})]}),U=n.jsxs(O,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18"})]}),c=n.jsxs(O,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]}),$=n.jsx(O,{children:n.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})}),H=n.jsxs(n.Fragment,{children:[n.jsxs(O,{children:[n.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),n.jsx("path",{d:"M10 21a2 2 0 0 0 4 0"})]}),n.jsx(p.Box,{sx:{position:"absolute",top:"6px",right:"6px",width:7,height:7,borderRadius:"50%",background:l.primaryHex,border:`1.5px solid ${y.iconTile}`}})]}),W=n.jsxs(O,{children:[n.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),n.jsx("path",{d:"M10 17l5-5-5-5"}),n.jsx("path",{d:"M15 12H3"})]}),N=l.mode==="dark",Y=w=>w.charAt(0).toUpperCase()+w.slice(1),L={sm:"Small",df:"Default",lg:"Large"},J={sharp:"Sharp",rounded:"Rounded",round:"Round"},E={compact:"Compact",default:"Default",comfortable:"Comfortable"},I={flat:"Flat",outlined:"Outlined",soft:"Soft",raised:"Raised",elevated:"Elevated",floating:"Floating"},q={split:"Split Brand",centered:"Centered Card"},V={"top-center":"Top Center","top-right":"Top Right","bottom-left":"Bottom Left","bottom-right":"Bottom Right"},G={theme:`${B} · ${N?"Dark":"Light"}`,color:"Secondary & status colours",type:`${l.fontFamily} · ${L[l.textSize]??"Default"}`,cards:"Card style, header, nesting & surface tint",tables:"Table row density, dividers, striping & header style — previewed on the Orders screen",shape:`${J[l.radiusPreset]??"Custom"} · ${E[l.density]??"Default"} · ${I[l.cardStyle]??""}`,notif:`${V[l.notifPosition]??""} · ${Y(l.notifStyle)}`,login:`${q[l.loginLayout]??""}${l.loginImage?" · image":""}`},D=[{id:"theme",title:"Theme Settings",info:"Presets, saved themes & light/dark mode.",icon:P,screen:"dashboard",body:n.jsx(ml,{})},{id:"color",title:"Colour Settings",info:"Brand, text & status colours.",icon:K,screen:"components",body:n.jsx(Sl,{})},{id:"type",title:"Typography",info:"Fonts, sizes, weight & line-height.",icon:Q,screen:"components",body:n.jsx(Hl,{})},{id:"cards",title:"Cards",info:"Card style, header, nesting & tint.",icon:U,screen:"dashboard",body:n.jsx($l,{})},{id:"tables",title:"Tables",info:"Row/column density, dividers & alignment.",icon:c,screen:"orders",body:n.jsx(Al,{})},{id:"shape",title:"Surface & Shape",info:"Radius, density, elevation & spacing.",icon:$,screen:"dashboard",body:n.jsx(Il,{})},{id:"notif",title:"Notifications",info:"Toast placement & behaviour.",icon:H,screen:"operations",body:n.jsx(Dl,{})},{id:"login",title:"Login Screen",info:"Brand image, logo & panel colour.",icon:W,screen:"login",body:n.jsx(Ml,{})}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",bgcolor:y.card},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.1,borderBottom:`1px solid ${y.divider}`,bgcolor:y.card},children:[n.jsxs(p.Box,{sx:{display:"flex",gap:.5,flexShrink:0},children:[n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.primaryHex}}),n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.secondaryHex}})]}),n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"6px"},children:[n.jsx(p.Typography,{variant:"caption",sx:{minWidth:0,fontWeight:800,color:y.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),S&&n.jsx(p.Tooltip,{title:g?"Unsaved changes — click to save theme":"Unsaved changes",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",onClick:g?()=>{const w=d.find(Z=>Z.id===g);w&&x(g,w.name,l)}:void 0,sx:{width:7,height:7,borderRadius:"50%",bgcolor:"error.main",flexShrink:0,cursor:g?"pointer":"default",transition:"transform 0.15s ease","&:hover":g?{transform:"scale(1.3)"}:{}}})})]}),n.jsx(p.Tooltip,{title:"Reset to defaults",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>v(!0),sx:{bgcolor:"action.selected"},children:n.jsx(Ks,{sx:{fontSize:16}})})}),n.jsx(p.Tooltip,{title:l.mode==="dark"?"Switch to light":"Switch to dark",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>m({mode:l.mode==="dark"?"light":"dark"}),sx:{bgcolor:"action.selected"},children:l.mode==="dark"?n.jsx(Qs,{sx:{fontSize:16}}):n.jsx(Xs,{sx:{fontSize:16}})})})]}),a&&n.jsxs(p.Box,{sx:{borderBottom:"1px solid",borderColor:"divider",borderLeft:"3px solid #eab308",bgcolor:w=>w.palette.mode==="dark"?"rgba(234,179,8,0.14)":"#fef9c3",px:1.6,py:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:".6px",color:w=>w.palette.mode==="dark"?"#f2cd5c":"#854d0e",mb:1},children:"Previewing Screen"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:.75},children:zl.map(w=>{const Z=i===w.key;return n.jsx(p.Box,{component:"button",onClick:()=>{i!==w.key&&o(w.key),s(!1)},sx:{px:.75,py:1,borderRadius:2,cursor:"pointer",fontSize:11,fontWeight:Z?800:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",border:"1.5px solid",borderColor:Z?"#d4a915":"#e6dca8",bgcolor:Z?"#fde68a":"background.paper",color:Z?"#713f12":"text.secondary"},children:w.label},w.key)})})]}),D.map(w=>n.jsx(xl,{icon:w.icon,title:w.title,info:G[w.id]??w.info,open:r===w.id,dimmed:r!==""&&r!==w.id,onToggle:()=>k(w.id,w.screen),onPreviewMenu:()=>s(!a),children:w.body},w.id)),n.jsxs(p.Dialog,{open:b,onClose:()=>v(!1),PaperProps:{sx:{borderRadius:3,width:320,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Reset everything?"}),n.jsxs(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:["This reverts every change you've made — theme preset, light/dark mode, brand colours, logo, typography, cards, surface & shape, notifications and login screen — back to the default ",j," preset. This can't be undone."]}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{h(),v(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"error.main",color:"error.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Reset to defaults"}),n.jsx(p.Box,{component:"button",onClick:()=>v(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Cancel"})]})]})]})}const Ll=kt(n.jsx("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");function Pr(e,r,t){const o=z.useRef(null),[i,a]=z.useState(e);return z.useLayoutEffect(()=>{const s=o.current;if(!s)return;const l=()=>{const x=s.children.length;if(!x)return;const m=parseFloat(getComputedStyle(s).rowGap)||0;let h=0;for(const b of Array.from(s.children))h+=b.offsetHeight;const y=h/x,u=s.clientHeight;u<=0||y<=0||a(Math.max(r,Math.min(t,Math.floor((u+m)/(y+m)))))};l();const d=requestAnimationFrame(l),g=setTimeout(l,300),f=new ResizeObserver(l);return f.observe(s),()=>{cancelAnimationFrame(d),clearTimeout(g),f.disconnect()}},[r,t]),[o,i]}function io(e,r,t){const o=z.useRef(null),i=z.useRef(null),[a,s]=z.useState(e);return z.useLayoutEffect(()=>{const l=i.current;if(!l)return;const d=()=>{var u;const m=Array.from(l.children).filter(b=>getComputedStyle(b).position!=="absolute"),h=m.length?m[0].offsetHeight:((u=o.current)==null?void 0:u.offsetHeight)||36,y=l.clientHeight;y<=0||h<=0||s(Math.max(r,Math.min(t,Math.floor(y/h))))};d();const g=requestAnimationFrame(d),f=setTimeout(d,300),x=new ResizeObserver(d);return x.observe(l),()=>{cancelAnimationFrame(g),clearTimeout(f),x.disconnect()}},[r,t]),[o,i,a]}const Nl=["Jan","Feb","Mar","Apr","May","Jun"],Vl=[44,60,50,74,88,96],Gl=[24,32,30,42,52,60];function Ul(){const e=ve(),r=_(D=>D.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,tH4:m,wH1:h,headFam:y,headLH:u,accentBg:b,btnText:v,tBodySm:k,bwEmph:B,btnCase:S,bodyWeightEff:j,bodyLH:R,tCaption:O,pMain:P,sMain:K}=e,Q=y+",sans-serif",U=r.fontFamily+",sans-serif",c=e.hc1||t.textPrimary,$=e.hc2||t.textPrimary,H=e.hc3||t.textPrimary,W=[{label:"Revenue",val:"$2.41M",chg:"+12.5%",up:!0},{label:"Open Orders",val:"1,284",chg:"+3.2%",up:!0},{label:"Inventory",val:"8,540",chg:"-1.8%",up:!1},{label:"Active Users",val:"342",chg:"+5",up:!0}].map(D=>({...D,cc:D.up?e.sucTxt:e.errTxt,cb:D.up?e.sucSoft:e.errSoft,arrow:D.up?"▲":"▼"})),N=D=>D==="✓"?{cb:e.sucSoft,cc:e.sucTxt}:D==="!"?{cb:e.warnSoft,cc:e.warnTxt}:D==="+"?{cb:e.infoSoft,cc:e.infoTxt}:{cb:t.pContainer,cc:e.isDark?t.pLight:t.pDark},Y=[{title:"Order ORD-1042 delivered to Acme Corp",time:"2m ago",ic:"✓"},{title:"Invoice #4821 paid — $12,400",time:"18m ago",ic:"$"},{title:"Low stock alert: Widget Pro (12 left)",time:"1h ago",ic:"!"},{title:"New customer onboarded: Globex Ltd",time:"3h ago",ic:"+"},{title:'Report "Q2 Summary" exported to PDF',time:"5h ago",ic:"▤"},{title:"Shipment SHP-2093 dispatched — Initech",time:"6h ago",ic:"✓"},{title:"Refund processed — $840 to Umbrella Co",time:"7h ago",ic:"$"},{title:"Payment overdue: Waystar Royco",time:"8h ago",ic:"!"},{title:"New support ticket — Stark Industries",time:"9h ago",ic:"+"},{title:"Backup completed — 12,480 records",time:"11h ago",ic:"✓"},{title:"Purchase order PO-771 approved",time:"13h ago",ic:"$"},{title:"Inventory reconciled — Warehouse 3",time:"15h ago",ic:"▤"},{title:"SLA breach warning — Hooli Inc",time:"17h ago",ic:"!"},{title:"New user invited — M. Fernandez",time:"19h ago",ic:"+"},{title:"Quarterly report scheduled",time:"21h ago",ic:"▤"},{title:"Order ORD-1039 delivered to Oscorp",time:"23h ago",ic:"✓"}].map(D=>({...D,...N(D.ic)})),[L,J]=Pr(5,4,Y.length),E=Y.slice(0,J),I=e.cardBorder==="none"?"none":e.cardBorder,q={background:t.paper,border:I,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},V={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},G={fontSize:x,lineHeight:u,fontWeight:h,color:H,fontFamily:Q};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:I,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:U,fontWeight:j,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:u,fontWeight:h,color:c,letterSpacing:"-.3px",fontFamily:Q},children:"Dashboard"}),n.jsx("span",{title:"Good morning, Admin · Jun 21, 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:B,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:b,color:v,fontSize:k,fontWeight:B,textTransform:S,letterSpacing:".4px",boxShadow:e.btnShadow,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New"})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{...q,marginBottom:l},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:{...G},children:"Performance Overview"}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary,fontWeight:B},children:"This month"})]}),n.jsx("div",{style:{padding:a,display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l},children:W.map(D=>n.jsxs("div",{style:{background:t.paper2,border:e.nestBorder,borderRadius:i,boxShadow:e.nestShadow,padding:s},children:[n.jsx("div",{style:{fontSize:m,color:t.textSecondary,fontWeight:h,fontFamily:Q,textTransform:"uppercase",letterSpacing:".6px",marginBottom:8},children:D.label}),n.jsx("div",{style:{fontSize:f,fontWeight:h,color:$,letterSpacing:"-.8px",lineHeight:1,marginBottom:6},children:D.val}),n.jsxs("span",{style:{fontSize:O,fontWeight:B,color:D.cc,background:D.cb,padding:"3px 9px",borderRadius:999},children:[D.arrow," ",D.chg]})]},D.label))})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...q,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:G,children:"Revenue Trend"}),n.jsx("div",{style:{display:"flex",gap:12},children:[["Revenue",P],["Profit",K]].map(([D,C])=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[n.jsx("div",{style:{width:10,height:10,borderRadius:2,background:C}}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary},children:D})]},D))})]}),n.jsx("div",{style:{padding:`${s}px ${a}px`,display:"flex",alignItems:"flex-end",gap:12,flex:1,minHeight:200},children:Nl.map((D,C)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:Gl[C]+"%",background:K,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:Vl[C]+"%",background:P,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary},children:D})]},D))})]}),n.jsxs("div",{style:{...q,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:G,children:"Recent Activity"})}),n.jsx("div",{ref:L,style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:4,flex:1,minHeight:0},children:E.map((D,C)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:8,borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:D.cb,color:D.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:B},children:D.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:k,color:t.textPrimary,fontFamily:U,fontWeight:j,lineHeight:R,marginBottom:2},children:D.title}),n.jsx("div",{style:{fontSize:O,color:t.textSecondary,fontFamily:U},children:D.time})]})]},C))})]})]})]})]})}const Yl=[{id:"ORD-1042",cust:"Acme Corporation",status:"Delivered",amt:"$12,400",date:"Jun 18"},{id:"ORD-1041",cust:"Globex Ltd",status:"Processing",amt:"$8,750",date:"Jun 17"},{id:"ORD-1040",cust:"Initech",status:"Pending",amt:"$5,200",date:"Jun 16"},{id:"ORD-1039",cust:"Umbrella Co",status:"Shipped",amt:"$22,100",date:"Jun 15"},{id:"ORD-1038",cust:"Waystar Royco",status:"Delivered",amt:"$9,800",date:"Jun 14"},{id:"ORD-1037",cust:"Stark Industries",status:"Processing",amt:"$31,500",date:"Jun 13"},{id:"ORD-1036",cust:"Wayne Enterprises",status:"Delivered",amt:"$18,240",date:"Jun 12"},{id:"ORD-1035",cust:"Soylent Corp",status:"Pending",amt:"$4,120",date:"Jun 11"},{id:"ORD-1034",cust:"Hooli Inc",status:"Shipped",amt:"$27,900",date:"Jun 10"},{id:"ORD-1033",cust:"Cyberdyne Systems",status:"Delivered",amt:"$14,650",date:"Jun 09"},{id:"ORD-1032",cust:"Massive Dynamic",status:"Processing",amt:"$10,300",date:"Jun 08"},{id:"ORD-1031",cust:"Tyrell Corp",status:"Delivered",amt:"$16,780",date:"Jun 07"},{id:"ORD-1030",cust:"Oscorp",status:"Shipped",amt:"$7,940",date:"Jun 06"},{id:"ORD-1029",cust:"Nakatomi Trading",status:"Pending",amt:"$3,560",date:"Jun 05"},{id:"ORD-1028",cust:"Gekko & Co",status:"Delivered",amt:"$25,300",date:"Jun 04"},{id:"ORD-1027",cust:"Bluth Company",status:"Processing",amt:"$6,410",date:"Jun 03"}],mr="100px 1fr 120px 100px 80px 70px";function Jl(){const e=ve(),r=_(J=>J.settings),{t,rad:o,radSm:i,pad:a,padSm:s,screenPad:l,rowPy:d,tH1:g,wH1:f,headFam:x,headLH:m,accentBg:h,btnText:y,btnShadow:u,tBody:b,tBodySm:v,tCaption:k,tOverline:B,bwEmph:S,btnCase:j,bodyWeightEff:R,pMain:O,table:P}=e,K=x+",sans-serif",Q=r.fontFamily+",sans-serif",U=e.hc1||t.textPrimary,[c,$,H]=io(12,3,16),W=Yl.slice(0,H).map((J,E)=>({...J,...P.statusMap[J.status]||{sb:t.divider,sc:t.textSecondary},rowBg:r.tableStripe&&E%2===1?P.stripeBg:"transparent"})),N=e.cardBorder==="none"?"none":e.cardBorder,Y=J=>({fontSize:B,fontWeight:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px",borderRight:P.colBorder,alignSelf:"stretch",display:"flex",alignItems:P.cellAI,justifyContent:P.cellJC,padding:`${P.rowPy} ${P.cellPx}`}),L={alignSelf:"stretch",display:"flex",alignItems:P.cellAI,justifyContent:P.cellJC,padding:`${P.rowPy} ${P.cellPx}`};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:N,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Q,fontWeight:R,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:m,fontWeight:f,color:U,letterSpacing:"-.3px",fontFamily:K},children:"Orders"}),n.jsx("span",{title:"1,284 orders · June 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:S,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:h,color:y,fontSize:v,fontWeight:S,textTransform:j,letterSpacing:".4px",boxShadow:u,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New Order"})]}),n.jsx("div",{style:{padding:l,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:N,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",flex:1,minHeight:0},children:[n.jsxs("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:t.paper,border:"1.5px solid "+t.divider,borderRadius:999,padding:"8px 15px",flex:1,minWidth:170},children:[n.jsx("span",{style:{color:t.textSecondary,fontSize:13},children:"⌕"}),n.jsx("span",{style:{fontSize:v,color:t.textSecondary},children:"Search orders…"})]}),P.filters.map(J=>n.jsx("button",{style:{padding:"7px 14px",borderRadius:999,border:"1px solid "+J.brd,background:J.bg,color:J.c,fontSize:k,fontWeight:S,whiteSpace:"nowrap",cursor:"pointer"},children:J.label},J.label))]}),n.jsxs("div",{ref:c,style:{display:"grid",gridTemplateColumns:mr,padding:`0 ${a}px`,borderBottom:P.rowBorder,background:P.headBg},children:[["Order ID","Customer","Status","Amount","Date"].map(J=>n.jsx("div",{style:Y(),children:J},J)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${P.rowPy} 0`}})]}),n.jsxs("div",{ref:$,style:{position:"relative",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{position:"absolute",inset:0,padding:`0 ${a}px`,display:"grid",gridTemplateColumns:mr,pointerEvents:"none",zIndex:2},children:[n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{})]}),W.map(J=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:mr,padding:`0 ${a}px`,borderBottom:P.rowBorder,alignItems:"stretch",background:J.rowBg},children:[n.jsx("div",{style:{...L,fontSize:v,fontWeight:S,color:O,fontFamily:Q},children:J.id}),n.jsx("div",{style:{...L,fontSize:b,color:t.textPrimary,fontWeight:S},children:J.cust}),n.jsx("div",{style:L,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:k,fontWeight:S,background:J.sb,color:J.sc,whiteSpace:"nowrap"},children:J.status})}),n.jsx("div",{style:{...L,fontSize:b,color:t.textPrimary,fontWeight:S},children:J.amt}),n.jsx("div",{style:{...L,fontSize:v,color:t.textSecondary},children:J.date}),n.jsx("div",{style:L,children:n.jsx("button",{style:{fontSize:k,color:O,background:t.pContainer,border:"none",fontWeight:S,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"View"})})]},J.id))]}),n.jsxs("div",{style:{padding:`${d}px ${a}px`,display:"flex",alignItems:"center",gap:7,borderTop:"1px solid "+t.divider},children:[n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,flex:1},children:["Showing 1–",W.length," of 1,284"]}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"‹"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"none",background:h,color:y,fontWeight:S,cursor:"pointer"},children:"1"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"2"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"›"})]})]})})]})}function ql(){const e=ve(),r=_(ee=>ee.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,tH4:m,tH5:h,tH6:y,tBody:u,tBodySm:b,tCaption:v,wH1:k,headFam:B,headLH:S,accentBg:j,btnText:R,btnShadow:O,bwEmph:P,btnCase:K,bodyWeightEff:Q,bodyLH:U,pMain:c,errSoft:$,errTxt:H,warnSoft:W,warnTxt:N,infoSoft:Y,infoTxt:L,sucSoft:J,sucTxt:E}=e,I=B+",sans-serif",q=r.fontFamily+",sans-serif",V=e.t.highlight,G=e.t.highlightSoft,D=e.t.highlightBd,C=t.pContainer,A=t.onPContainer,F=t.pContrast,X=e.hc1||t.textPrimary,w=e.hc2||t.textPrimary,Z=e.hc3||t.textPrimary,M=e.hc4||t.textPrimary,fe=e.hc5||t.textPrimary,Me=e.hc6||t.textPrimary,We=e.cardBorder==="none"?"none":e.cardBorder,Je={display:"flex",flexDirection:"column",background:t.paper,border:We,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",height:"100%"},qe={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},Re={fontSize:x,lineHeight:S,fontWeight:k,color:Z,fontFamily:I},tr=[{label:"Dashboard Overview",size:g,w:k,color:X,lh:1.1,ls:"-.5px",name:"H1",border:!0},{label:"Revenue Report",size:f,w:k,color:w,lh:1.1,ls:"-.4px",name:"H2",border:!0},{label:"Performance Overview",size:x,w:k,color:Z,lh:1.15,name:"H3",border:!0},{label:"Active Users",size:m,w:k,color:M,lh:1.2,name:"H4",border:!0},{label:"Last updated 2m ago",size:h,w:k,color:fe,lh:1.25,name:"H5",border:!0},{label:"Status · Live",size:y,w:k,color:Me,lh:1.3,name:"H6",border:!0}],ze=ee=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"11px 12px",borderBottom:"1px solid "+t.divider,background:ee?G:"transparent",boxShadow:ee?"inset 3px 0 0 "+V:"none"},children:[n.jsx("div",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(ee?V:t.outline),display:"grid",placeItems:"center",flexShrink:0},children:ee&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:V}})}),n.jsx("span",{style:{flex:1,fontSize:b,fontFamily:q,fontWeight:ee?P:Q,color:t.textPrimary},children:ee?"Selected item":"Unselected item"}),ee&&n.jsx("span",{style:{fontSize:v,fontFamily:q,fontWeight:P,color:t.textSecondary},children:"Active"})]}),Tt=(ee,ft,ht)=>n.jsxs("div",{style:{position:"relative",border:ee?"2px solid "+c:"1.5px solid "+t.outline,borderRadius:i,padding:"12px 13px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:10,background:t.paper,padding:"0 5px",fontSize:v,color:ee?c:t.textSecondary,fontWeight:ee?P:void 0},children:ft}),n.jsx("span",{style:{fontSize:u,color:ee?t.textPrimary:t.textSecondary},children:ht})]}),Ke=(ee,ft,ht)=>n.jsx("span",{style:{padding:"5px 13px",borderRadius:999,background:ee,color:ft,fontSize:v,fontWeight:P},children:ht}),_e=ee=>({padding:"9px 20px",borderRadius:i,fontSize:b,fontWeight:P,textTransform:K,letterSpacing:".4px",cursor:"pointer",...ee});return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:We,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:q,fontWeight:Q,color:t.textPrimary},children:[n.jsx("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:S,fontWeight:k,color:X,letterSpacing:"-.3px",fontFamily:I},children:"Component Library"}),n.jsx("span",{title:"Every Material UI component reflects your live theme",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:P,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Typography Scale"})}),n.jsxs("div",{style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minHeight:0,gap:6},children:[tr.map(ee=>n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,borderBottom:"1px solid "+t.divider,paddingBottom:14},children:[n.jsx("span",{style:{fontSize:ee.size,lineHeight:ee.lh,fontWeight:ee.w,color:ee.color,fontFamily:I,letterSpacing:ee.ls},children:ee.label}),n.jsxs("span",{style:{fontSize:ee.size,color:t.textSecondary,fontWeight:ee.w,whiteSpace:"nowrap",flexShrink:0,fontFamily:I},children:[ee.name," · ",ee.size]})]},ee.name)),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:u,lineHeight:U,color:t.textPrimary,fontFamily:q,fontWeight:Q},children:"Body text — the quick brown fox jumps over the lazy dog."}),n.jsxs("span",{style:{fontSize:u,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:q},children:["Body · ",u]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:v,lineHeight:U,color:t.textSecondary,fontFamily:q,fontWeight:Q},children:"Caption & helper text style"}),n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:q},children:["Caption · ",v]})]})]})]}),n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Selection States"})}),n.jsxs("div",{style:{padding:a,display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{display:"flex",gap:2,borderBottom:"1.5px solid "+t.divider},children:[n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textPrimary,background:G,borderBottom:"2.5px solid "+c,marginBottom:-1.5,borderRadius:"6px 6px 0 0"},children:"Overview"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textSecondary},children:"Activity"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textSecondary},children:"Settings"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",border:"1px solid "+t.divider,borderRadius:i,overflow:"hidden"},children:[ze(!0),ze(!1),ze(!1),ze(!1),ze(!0),ze(!1)]}),n.jsx("div",{style:{display:"inline-flex",alignSelf:"flex-start",padding:"6px 12px",borderRadius:i,background:G,border:"1px solid "+D},children:n.jsx("span",{style:{fontSize:v,fontWeight:P,color:V},children:"2 selected items"})})]})]})]}),n.jsxs("div",{style:{...Je,height:"auto"},children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Inputs & Selection"})}),n.jsxs("div",{style:{padding:a},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,marginBottom:l},children:[Tt(!1,"Outlined","Placeholder…"),Tt(!0,"Focused","Active value")]}),n.jsxs("div",{style:{display:"flex",gap:22,alignItems:"center",flexWrap:"wrap",paddingTop:s,borderTop:"1px solid "+t.divider},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:4,background:c,display:"grid",placeItems:"center",color:F,fontSize:11,fontWeight:P},children:"✓"}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Checkbox"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:"50%",border:"2px solid "+c,display:"grid",placeItems:"center"},children:n.jsx("div",{style:{width:9,height:9,borderRadius:"50%",background:c}})}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Radio"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:38,height:22,borderRadius:999,background:c,position:"relative"},children:n.jsx("div",{style:{position:"absolute",top:3,right:3,width:16,height:16,borderRadius:"50%",background:"#fff"}})}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Switch"})]})]})]})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Buttons"})}),n.jsxs("div",{style:{padding:a,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[n.jsx("button",{style:_e({border:"none",background:j,color:R,boxShadow:O}),children:"Contained"}),n.jsx("button",{style:_e({border:"1.5px solid "+c,background:"transparent",color:c}),children:"Outlined"}),n.jsx("button",{style:_e({border:"none",background:"transparent",color:c}),children:"Text"}),n.jsx("button",{style:_e({border:"none",background:C,color:A}),children:"Tonal"}),n.jsx("button",{style:_e({border:"none",background:j,color:R,boxShadow:O,borderRadius:999}),children:"Rounded"}),n.jsx("button",{style:_e({border:"none",background:$,color:H}),children:"Error"})]})]}),n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Chips, Alerts & Progress"})}),n.jsxs("div",{style:{padding:a},children:[n.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:l},children:[Ke(C,A,"Primary"),Ke(J,E,"Success"),Ke(W,N,"Warning"),Ke(Y,L,"Info"),Ke($,H,"Error")]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:7},children:[n.jsx("span",{style:{fontSize:b,color:t.textPrimary,fontWeight:P},children:"Revenue goal"}),n.jsx("span",{style:{fontSize:b,color:c,fontWeight:P},children:"74%"})]}),n.jsx("div",{style:{height:8,background:t.paper2,border:"1px solid "+t.divider,borderRadius:999,overflow:"hidden"},children:n.jsx("div",{style:{height:"100%",width:"74%",background:c,borderRadius:999}})})]})]})]})]})]})}const Kl=[{label:"Cameras Online",val:"5 / 6"},{label:"Recording",val:"4"},{label:"Motion Alerts",val:"2"},{label:"Storage Used",val:"82%"}],Xl=[{name:"CAM 01",loc:"Main Lobby",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 02",loc:"North Gate",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 03",loc:"Loading Bay",rec:!1,online:!0,time:"14:32:07"},{name:"CAM 04",loc:"Rooftop",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 05",loc:"Parking Deck",rec:!1,online:!1,time:"—"},{name:"CAM 06",loc:"Server Room",rec:!0,online:!0,time:"14:32:08"}],Ql=[{cam:"CAM 04",label:"Motion detected — Rooftop",time:"just now",sev:"error"},{cam:"CAM 02",label:"Person identified — North Gate",time:"6m ago",sev:"info"},{cam:"CAM 01",label:"Loitering cleared — Main Lobby",time:"22m ago",sev:"success"},{cam:"CAM 06",label:"Door forced — Server Room",time:"34m ago",sev:"error"},{cam:"CAM 03",label:"Vehicle detected — Loading Bay",time:"48m ago",sev:"info"},{cam:"CAM 05",label:"Signal restored — Parking Deck",time:"1h ago",sev:"success"},{cam:"CAM 02",label:"Tailgating flagged — North Gate",time:"1h ago",sev:"error"},{cam:"CAM 04",label:"Crowd density normal — Rooftop",time:"2h ago",sev:"success"},{cam:"CAM 01",label:"Object left behind — Main Lobby",time:"2h ago",sev:"info"},{cam:"CAM 03",label:"Motion detected — Loading Bay",time:"3h ago",sev:"error"},{cam:"CAM 06",label:"Access granted — Server Room",time:"3h ago",sev:"success"},{cam:"CAM 05",label:"Camera offline — Parking Deck",time:"4h ago",sev:"error"},{cam:"CAM 02",label:"Face match — North Gate",time:"5h ago",sev:"info"},{cam:"CAM 01",label:"Queue length normal — Main Lobby",time:"6h ago",sev:"success"},{cam:"CAM 04",label:"Perimeter breach — Rooftop",time:"7h ago",sev:"error"},{cam:"CAM 03",label:"Package scanned — Loading Bay",time:"8h ago",sev:"info"}];function Zl(){const e=ve(),r=_(F=>F.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:y,accentBg:u,btnText:b,btnShadow:v,tBodySm:k,tCaption:B,tOverline:S,bwEmph:j,btnCase:R,bodyWeightEff:O,errSoft:P,errTxt:K,mediaBg:Q,overlaySurface:U,overlayBorder:c,onOverlay:$,sevMap:H}=e,W=h+",sans-serif",N=r.fontFamily+",sans-serif",Y=e.hc1||t.textPrimary,L=e.hc2||t.textPrimary,J=e.hc3||t.textPrimary,E=e.cardBorder==="none"?"none":e.cardBorder,I=Xl.map(F=>({...F,dotC:F.online?r.successHex:t.textDisabled})),[q,V]=Pr(3,3,16),G=Ql.slice(0,V).map(F=>({...F,...H[F.sev]})),D={background:t.paper,border:E,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},C={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},A={fontSize:x,lineHeight:y,fontWeight:m,color:J,fontFamily:W};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:E,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:N,fontWeight:O,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:y,fontWeight:m,color:Y,letterSpacing:"-.3px",fontFamily:W},children:"Camera Surveillance"}),n.jsx("span",{title:"6 feeds · live monitoring & recording",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:j,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:B,fontWeight:j,color:K,background:P,padding:"6px 12px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]}),n.jsx("button",{style:{padding:"10px 18px",borderRadius:i,border:"none",background:u,color:b,fontSize:k,fontWeight:j,textTransform:R,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"+ Add Camera"})]})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:Kl.map(F=>n.jsxs("div",{style:D,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:j},children:F.label})}),n.jsx("div",{style:{padding:`${s}px ${a}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:L,letterSpacing:"-.8px",lineHeight:1},children:F.val})})]},F.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...D,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:C,children:[n.jsx("span",{style:A,children:"Camera Wall"}),n.jsx("span",{style:{fontSize:B,color:t.textSecondary,fontWeight:j},children:"2 × 3 grid"})]}),n.jsx("div",{style:{padding:a,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridAutoRows:"1fr",gap:l},children:I.map(F=>n.jsxs("div",{style:{position:"relative",borderRadius:i,overflow:"hidden",background:Q,minHeight:104,border:"1px solid "+t.divider},children:[n.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:n.jsx("span",{style:{fontFamily:"monospace",fontSize:B,color:"rgba(255,255,255,.3)",letterSpacing:1},children:F.loc})}),n.jsxs("div",{style:{position:"absolute",top:7,left:7,display:"flex",alignItems:"center",gap:5,background:U,border:"1px solid "+c,borderRadius:999,padding:"2px 8px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:F.dotC}}),n.jsx("span",{style:{color:$,fontSize:B,fontWeight:700,letterSpacing:".4px"},children:F.name})]}),F.rec&&n.jsxs("div",{style:{position:"absolute",top:7,right:7,display:"flex",alignItems:"center",gap:4,background:U,borderRadius:999,padding:"2px 7px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:r.errorHex}}),n.jsx("span",{style:{color:$,fontSize:8,fontWeight:800,letterSpacing:".5px"},children:"REC"})]}),F.online&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"5px 8px",background:"linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,0))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:n.jsx("span",{style:{color:"#fff",fontSize:B,fontWeight:600,fontFamily:"monospace"},children:F.time})})]},F.name))})]}),n.jsxs("div",{style:{...D,display:"flex",flexDirection:"column"},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:A,children:"Recent Detections"})}),n.jsx("div",{ref:q,style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:2,flex:1,minHeight:0},children:G.map((F,X)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:F.cb,color:F.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:11,fontWeight:800,fontFamily:"monospace"},children:"●"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:k,color:t.textPrimary,fontWeight:O,lineHeight:1.35},children:F.label}),n.jsxs("div",{style:{fontSize:B,color:t.textSecondary,marginTop:2},children:[F.cam," · ",F.time]})]})]},X))})]})]})]})]})}const ec=[{ic:"!",label:"Camera 04 motion detected — Loading Bay",time:"just now",sev:"error",unread:!0},{ic:"✓",label:"Stream reconnected — North Gate feed",time:"4m ago",sev:"success",unread:!0},{ic:"i",label:"Access request — J. Okoro (Operator)",time:"22m ago",sev:"info",unread:!1},{ic:"!",label:"Report archive storage 82% full",time:"1h ago",sev:"warning",unread:!1},{ic:"✓",label:"Backup completed — 12,480 clips archived",time:"2h ago",sev:"success",unread:!1},{ic:"i",label:"Firmware update available — 3 devices",time:"3h ago",sev:"info",unread:!1},{ic:"!",label:"Camera 02 lens obstruction detected",time:"5h ago",sev:"error",unread:!1},{ic:"✓",label:"Nightly health check passed — all nodes",time:"6h ago",sev:"success",unread:!1},{ic:"i",label:"New operator invited — M. Fernandez",time:"7h ago",sev:"info",unread:!1},{ic:"!",label:"Bandwidth spike on West Wing uplink",time:"8h ago",sev:"warning",unread:!1},{ic:"✓",label:"Retention policy applied — 30 day window",time:"9h ago",sev:"success",unread:!1},{ic:"i",label:"Scheduled maintenance — Sat 02:00 UTC",time:"11h ago",sev:"info",unread:!1},{ic:"!",label:"Motion zone breach — Perimeter Gate 3",time:"12h ago",sev:"error",unread:!1},{ic:"✓",label:"Clip export finished — Incident #4821",time:"14h ago",sev:"success",unread:!1},{ic:"i",label:"Analytics model updated — v2.4.1",time:"16h ago",sev:"info",unread:!1},{ic:"!",label:"Disk latency elevated — NVR-02",time:"18h ago",sev:"warning",unread:!1}];function tc(){const e=ve(),r=_(A=>A.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tTitle:f,wH1:x,headFam:m,headLH:h,accentBg:y,btnText:u,tBodySm:b,tCaption:v,tOverline:k,bwEmph:B,bodyWeightEff:S,bodyLH:j,errSoft:R,errTxt:O,pMain:P,mediaBg:K,overlaySurface:Q,overlayBorder:U,onOverlay:c,sevMap:$}=e,H=m+",sans-serif",W=r.fontFamily+",sans-serif",N=e.hc1||t.textPrimary,Y=e.hc3||t.textPrimary,L=e.cardBorder==="none"?"none":e.cardBorder,[J,E]=Pr(7,4,16),I=ec.slice(0,E).map(A=>({...A,...$[A.sev],rowBg:A.unread?ce(r.primaryHex,e.isDark?.12:.05):"transparent"})),q=I.filter(A=>A.unread).length,V={display:"flex",flexDirection:"column",minHeight:0,background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},G={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},D={fontSize:f,lineHeight:h,fontWeight:x,color:Y,fontFamily:H},C={height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:c,fontSize:v,fontWeight:B,cursor:"pointer",fontFamily:"inherit"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:W,fontWeight:S,color:t.textPrimary},children:[n.jsx("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:h,fontWeight:x,color:N,letterSpacing:"-.3px",fontFamily:H},children:"Operations Center"}),n.jsx("span",{title:"Live map, camera feeds, alerts & access — every module themed end to end",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:B,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsx("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 320px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsxs("div",{style:G,children:[n.jsx("span",{style:D,children:"Live Map · Street View"}),n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:v,fontWeight:B,color:O,background:R,padding:"3px 10px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]})]}),n.jsxs("div",{style:{position:"relative",flex:1,minHeight:320,background:K,display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("span",{style:{fontFamily:"monospace",fontSize:v,color:"rgba(255,255,255,.42)",letterSpacing:1.5},children:"◍ GOOGLE STREET VIEW / EARTH EMBED"}),n.jsx("div",{style:{position:"absolute",top:12,left:12,display:"flex",alignItems:"center",gap:7,background:Q,border:"1px solid "+U,borderRadius:999,padding:"6px 12px"},children:n.jsx("span",{style:{color:c,fontSize:v,fontWeight:B},children:"◎ 40.7128, -74.0060 · Manhattan"})}),n.jsxs("div",{style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:4,background:Q,border:"1px solid "+U,borderRadius:i,padding:5},children:[n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:y,color:u,fontSize:16,fontWeight:B,cursor:"pointer"},children:"+"}),n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:c,fontSize:16,fontWeight:B,cursor:"pointer"},children:"−"}),n.jsx("div",{style:{width:1,height:18,background:U,margin:"0 3px"}}),n.jsx("button",{style:{...C,padding:"0 12px"},children:"Layers"}),n.jsx("button",{style:{...C,padding:"0 12px"},children:"◎ Locate"})]})]})]}),n.jsxs("div",{style:V,children:[n.jsxs("div",{style:G,children:[n.jsx("span",{style:D,children:"Notifications"}),n.jsxs("span",{style:{fontSize:k,fontWeight:B,color:t.pContrast,background:P,padding:"2px 9px",borderRadius:999},children:[q," NEW"]})]}),n.jsx("div",{ref:J,style:{padding:s,display:"flex",flexDirection:"column",gap:2,flex:1,minHeight:0},children:I.map((A,F)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i,background:A.rowBg},children:[n.jsx("div",{style:{width:26,height:26,borderRadius:i,background:A.cb,color:A.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:B},children:A.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:b,color:t.textPrimary,fontWeight:S,lineHeight:j},children:A.label}),n.jsx("div",{style:{fontSize:v,color:t.textSecondary,marginTop:2},children:A.time})]}),A.unread&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:P,flexShrink:0,marginTop:6}})]},F))})]})]})})]})}const rc=[{label:"Reports Generated",val:"248"},{label:"Avg Generation",val:"1.2s"},{label:"Data Points",val:"84.2K"},{label:"Scheduled",val:"12"}],nc=["Jan","Feb","Mar","Apr","May","Jun"],oc=[44,60,50,74,88,96],ic=[24,32,30,42,52,60],ac=[{l:"Reports",h:72},{l:"Cameras",h:92},{l:"Alerts",h:40},{l:"Users",h:58},{l:"Storage",h:80}],sc=[{name:"Q2 Revenue Summary",type:"Financial",date:"Jun 20",status:"Ready"},{name:"Camera Uptime Audit",type:"Operations",date:"Jun 19",status:"Ready"},{name:"User Access Log",type:"Security",date:"Jun 18",status:"Ready"},{name:"Inventory Forecast",type:"Analytics",date:"Jun 17",status:"Processing"},{name:"Monthly KPI Digest",type:"Executive",date:"Jun 15",status:"Ready"},{name:"Incident Response Log",type:"Security",date:"Jun 14",status:"Ready"},{name:"Storage Utilization Report",type:"Operations",date:"Jun 13",status:"Ready"},{name:"Weekly Traffic Analysis",type:"Analytics",date:"Jun 12",status:"Processing"},{name:"Vendor SLA Compliance",type:"Financial",date:"Jun 11",status:"Ready"},{name:"Motion Event Rollup",type:"Operations",date:"Jun 10",status:"Ready"},{name:"Quarterly Audit Trail",type:"Security",date:"Jun 09",status:"Ready"},{name:"Energy Consumption Digest",type:"Analytics",date:"Jun 08",status:"Processing"},{name:"Executive Board Pack",type:"Executive",date:"Jun 07",status:"Ready"},{name:"Device Firmware Ledger",type:"Operations",date:"Jun 06",status:"Ready"},{name:"Access Anomaly Report",type:"Security",date:"Jun 05",status:"Ready"},{name:"Cost Allocation Summary",type:"Financial",date:"Jun 04",status:"Ready"}],Pn="1fr 130px 110px 90px 70px";function lc(){const e=ve(),r=_(w=>w.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:y,accentBg:u,btnText:b,btnShadow:v,tBody:k,tBodySm:B,tCaption:S,tOverline:j,bwEmph:R,btnCase:O,bodyWeightEff:P,pMain:K,sMain:Q,chartPalette:U,table:c}=e,$=h+",sans-serif",H=r.fontFamily+",sans-serif",W=e.hc1||t.textPrimary,N=e.hc2||t.textPrimary,Y=e.hc3||t.textPrimary,L=e.cardBorder==="none"?"none":e.cardBorder,[J,E,I]=io(5,3,16),q=sc.slice(0,I).map((w,Z)=>({...w,sb:w.status==="Ready"?e.sucSoft:e.warnSoft,sc:w.status==="Ready"?e.sucTxt:e.warnTxt,rowBg:r.tableStripe&&Z%2===1?c.stripeBg:"transparent"})),V=ac.map((w,Z)=>({...w,c:U[Z%U.length]})),G={borderRight:c.colBorder,alignSelf:"stretch",display:"flex",alignItems:c.cellAI,justifyContent:c.cellJC,padding:`${c.rowPy} ${c.cellPx}`},D={alignSelf:"stretch",display:"flex",alignItems:c.cellAI,justifyContent:c.cellJC,padding:`${c.rowPy} ${c.cellPx}`},C={background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},A={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},F={fontSize:x,lineHeight:y,fontWeight:m,color:Y,fontFamily:$},X={fontSize:j,fontWeight:R,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:H,fontWeight:P,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:y,fontWeight:m,color:W,letterSpacing:"-.3px",fontFamily:$},children:"Reports"}),n.jsx("span",{title:"Generated insights across every module",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:R,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:u,color:b,fontSize:B,fontWeight:R,textTransform:O,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"↓ Export PDF"})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:rc.map(w=>n.jsxs("div",{style:C,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:j,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:R},children:w.label})}),n.jsx("div",{style:{padding:`${s}px ${a}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:N,letterSpacing:"-.8px",lineHeight:1},children:w.val})})]},w.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,marginBottom:l},children:[n.jsxs("div",{style:C,children:[n.jsxs("div",{style:A,children:[n.jsx("span",{style:F,children:"Revenue & Profit Trend"}),n.jsx("span",{style:{fontSize:S,color:t.textSecondary,fontWeight:R},children:"6 months"})]}),n.jsx("div",{style:{padding:a,display:"flex",alignItems:"flex-end",gap:12,height:160},children:nc.map((w,Z)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:ic[Z]+"%",background:Q,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:oc[Z]+"%",background:K,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:S,color:t.textSecondary},children:w})]},w))})]}),n.jsxs("div",{style:C,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:F,children:"By Module"})}),n.jsx("div",{style:{padding:a,display:"flex",alignItems:"flex-end",gap:10,height:128},children:V.map(w=>n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:n.jsx("div",{style:{width:"100%",height:w.h+"%",background:w.c,borderRadius:`${i} ${i} 0 0`}})},w.l))})]})]}),n.jsxs("div",{style:{...C,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:F,children:"Recent Reports"})}),n.jsxs("div",{ref:J,style:{display:"grid",gridTemplateColumns:Pn,padding:`0 ${a}px`,borderBottom:c.rowBorder,background:c.headBg},children:[["Report","Type","Status","Date"].map(w=>n.jsx("div",{style:{...X,...G},children:w},w)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${c.rowPy} 0`}})]}),n.jsx("div",{ref:E,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:q.map(w=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:Pn,padding:`0 ${a}px`,borderBottom:c.rowBorder,background:w.rowBg},children:[n.jsx("div",{style:{...D,fontSize:k,color:t.textPrimary,fontWeight:R},children:w.name}),n.jsx("div",{style:{...D,fontSize:B,color:t.textSecondary},children:w.type}),n.jsx("div",{style:D,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:S,fontWeight:R,background:w.sb,color:w.sc,whiteSpace:"nowrap"},children:w.status})}),n.jsx("div",{style:{...D,fontSize:B,color:t.textSecondary},children:w.date}),n.jsx("div",{style:D,children:n.jsx("button",{style:{fontSize:S,color:K,background:t.pContainer,border:"none",fontWeight:R,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"↓ PDF"})})]},w.name))})]})]})]})}const $n=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),n.jsx("path",{d:"m21 15-5-5L5 21"})]});function cc(){const e=ve(),r=_(L=>L.settings),t=De(L=>L.defaultLoginImage),{t:o,rad:i,radSm:a,pad:s,tH1:l,tBody:d,tBodySm:g,tCaption:f,wH1:x,headLH:m,accentBg:h,btnText:y,btnShadow:u,bwEmph:b,pMain:v,iconInitials:k,loginCenteredGrad:B,loginScrimGradC:S}=e,j=r.fontFamily+",sans-serif",R=e.hc1||o.textPrimary,O=o.pContrast,P=e.cardBorder==="none"?"none":e.cardBorder,K=r.logoMode==="image"&&!!r.logoUrl,Q=e.isDark?o.paper2:"#ffffff",U=r.loginPanelColor||o.bgDefault,c=r.loginImgOpacity>0?r.loginImgOpacity:1,$=r.loginImage||t,H=!!$,W=H?n.jsx("img",{src:$,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0,opacity:c}}):null,N={background:o.paper,border:P,borderRadius:i,boxShadow:e.cardShadow,padding:s,display:"flex",flexDirection:"column",gap:20},Y=L=>({position:"relative",background:o.paper2,border:"1.5px solid "+(L?v:o.outline),borderRadius:a});return r.loginLayout==="centered"?n.jsxs("div",{style:{minHeight:560,background:B,display:"flex",alignItems:"center",justifyContent:"center",padding:40,position:"relative",overflow:"hidden",fontFamily:j,borderRadius:i},children:[W,H&&n.jsx("div",{style:{position:"absolute",inset:0,background:S,zIndex:0}}),n.jsxs("div",{style:{position:"relative",zIndex:1,width:"100%",maxWidth:380,background:o.paper,border:P,borderRadius:i,boxShadow:"0 24px 60px rgba(0,0,0,.35)",padding:s,display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[n.jsx("div",{style:{width:72,height:72,borderRadius:20,background:r.iconColor,display:"grid",placeItems:"center",boxShadow:"0 6px 18px "+r.iconColor+"55"},children:n.jsx("span",{style:{color:"#fff",fontSize:24,fontWeight:b,letterSpacing:"-1px"},children:k})}),n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+o.outline,borderRadius:a,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:o.paper,padding:"0 5px",fontSize:11,color:o.textSecondary},children:"Email"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary},children:"admin@company.com"})]}),n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+o.outline,borderRadius:a,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:o.paper,padding:"0 5px",fontSize:11,color:o.textSecondary},children:"Password"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary,letterSpacing:3},children:"••••••••"})]}),n.jsx("button",{style:{padding:13,borderRadius:a,border:"none",background:h,color:y,fontSize:d,fontWeight:b,textTransform:"uppercase",letterSpacing:".5px",boxShadow:u,cursor:"pointer"},children:"Sign in"})]})]})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"3fr 1fr",minHeight:560,fontFamily:j,borderRadius:i,overflow:"hidden"},children:[n.jsxs("div",{style:{background:Q,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 40px",gap:22,position:"relative",overflow:"hidden"},children:[W,!H&&n.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:o.textSecondary,border:"1.5px dashed "+o.outline,padding:24,boxSizing:"border-box"},children:[n.jsx($n,{size:46}),n.jsx("div",{style:{fontSize:14,fontWeight:b,color:o.textPrimary},children:"No brand image"}),n.jsx("div",{style:{fontSize:12,color:o.textSecondary,textAlign:"center",maxWidth:220},children:"Upload an image in the Login Screen settings to fill this panel."})]})]}),n.jsxs("div",{style:{background:U,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,padding:"48px 40px"},children:[K?n.jsx("img",{src:r.logoUrl,alt:r.appName,style:{maxHeight:64,maxWidth:200,objectFit:"contain"}}):n.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,maxWidth:200,maxHeight:64,border:"1.5px dashed "+o.outline,borderRadius:a,boxSizing:"border-box",color:o.textSecondary,padding:"8px 16px"},children:[n.jsx($n,{size:20}),n.jsx("span",{style:{fontSize:f,fontWeight:b,color:o.textSecondary,whiteSpace:"nowrap"},children:"No logo uploaded"})]}),n.jsxs("div",{style:{width:"100%",maxWidth:340,...N},children:[n.jsxs("div",{style:{textAlign:"center"},children:[n.jsx("div",{style:{fontSize:l,lineHeight:m,fontWeight:x,color:R,letterSpacing:"-.4px",marginBottom:5},children:"Welcome back"}),n.jsx("div",{style:{fontSize:g,color:o.textSecondary},children:"Sign in to continue"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:f,fontWeight:b,color:o.textPrimary,marginBottom:7},children:"Email Address"}),n.jsxs("div",{style:{...Y(!1),padding:"12px 14px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"✉"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary},children:"admin@company.com"})]})]}),n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:f,fontWeight:b,color:o.textPrimary,marginBottom:7},children:"Password"}),n.jsxs("div",{style:{...Y(!0),padding:"12px 40px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"🔒"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary,letterSpacing:3},children:"••••••••"}),n.jsx("span",{style:{position:"absolute",right:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"👁"})]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:17,height:17,borderRadius:4,background:v,display:"grid",placeItems:"center",color:O,fontSize:11,fontWeight:b},children:"✓"}),n.jsx("span",{style:{fontSize:g,color:o.textPrimary},children:"Remember me"})]}),n.jsx("span",{style:{fontSize:g,color:v,fontWeight:b},children:"Forgot password?"})]}),n.jsxs("button",{style:{padding:13,borderRadius:a,border:"none",background:h,color:y,fontSize:d,fontWeight:b,letterSpacing:".3px",boxShadow:u,marginTop:2,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},children:["Login ",n.jsx("span",{style:{fontSize:15},children:"→"})]})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:f,color:o.textSecondary},children:["Powered by ",n.jsx("span",{style:{color:v,fontWeight:b},children:r.appName})," © 2026"]})]})]})]})}function dc(){const e=ve(),r=_(y=>y.settings),[t,o]=z.useState(!1);if(t)return null;const{t:i,npos:a,nacc:s,toastDeco:l,toastBg:d,rad:g,radSm:f,tBodySm:x,tCaption:m}=e,h=(r.toastW>0?r.toastW:252)+"px";return n.jsxs("div",{style:{position:"absolute",zIndex:40,width:h,maxWidth:"70%",boxSizing:"border-box",background:d,borderRadius:g,display:"flex",gap:"10px",alignItems:"flex-start",padding:"12px 13px",fontFamily:r.fontFamily+",sans-serif",...a,...l},children:[n.jsx("div",{style:{width:"30px",height:"30px",borderRadius:f,background:s.icbg,color:s.icc,display:"grid",placeItems:"center",flexShrink:0,fontSize:"15px",fontWeight:800},children:"!"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:x+"px",fontWeight:700,color:i.textPrimary,marginBottom:"2px"},children:"Low stock alert"}),n.jsx("div",{style:{fontSize:m+"px",color:i.textSecondary,lineHeight:1.4},children:"Widget Pro is down to 12 units left."})]}),r.notifAutoDismiss&&n.jsx("div",{title:"Auto-dismiss countdown",style:{flexShrink:0,marginTop:"1px",minWidth:"26px",height:"20px",padding:"0 7px",borderRadius:"999px",background:ce(s.dot,.14),color:s.dot,fontSize:m-.5+"px",fontWeight:800,display:"grid",placeItems:"center",fontVariantNumeric:"tabular-nums"},children:(r.autoDismissSec>0?r.autoDismissSec:8)+"s"}),n.jsx("button",{title:"Dismiss notification",onClick:()=>o(!0),style:{flexShrink:0,width:"20px",height:"20px",marginTop:"1px",border:"none",background:"transparent",color:i.textSecondary,cursor:"pointer",borderRadius:"6px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:n.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}const pc=[75,90,100,125];function uc(){var f;const e=De(x=>x.previewScreen),r=_(x=>x.settings.edgePadPx)||0,t=e==="operations"?0:r,[o,i]=z.useState("fit"),a=z.useRef(null),s=z.useRef(null),[l,d]=z.useState(100);z.useLayoutEffect(()=>{const x=a.current,m=s.current;if(!x||!m)return;const h=()=>{const k=getComputedStyle(x),B=(parseFloat(k.paddingTop)||0)+(parseFloat(k.paddingBottom)||0);if(o!=="fit"){const c=o/100;m.style.zoom=String(c);const $=x.clientHeight-B;m.style.minHeight=($>0?Math.floor($/c):0)+"px",d(o);return}m.style.zoom="1",m.style.minHeight="0px",m.offsetHeight;const S=(parseFloat(k.paddingLeft)||0)+(parseFloat(k.paddingRight)||0),j=x.clientWidth-S,R=x.clientHeight-B,O=m.scrollWidth,P=m.scrollHeight;if(O<=0||P<=0||j<=0||R<=0)return;const K=Math.min(j/O,R/P,1),Q=K<.985?Math.max(.36,K):1;m.style.zoom=String(Q);const U=Math.min(j/O,1);m.style.minHeight=Math.floor(R/Math.max(U,.36))+"px",d(Math.round(Q*100))};let y=0,u=0;const b=()=>{h(),++u<36&&(y=requestAnimationFrame(b))};b();const v=new ResizeObserver(h);return v.observe(x),v.observe(m),()=>{cancelAnimationFrame(y),v.disconnect()}},[o,t,e]);const g=((f=Wl.find(x=>x.key===e))==null?void 0:f.label)??"";return n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[n.jsxs(p.Box,{sx:{px:2.5,py:1.25,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,bgcolor:"background.paper"},children:[n.jsx(Ll,{sx:{fontSize:22,color:"text.secondary"}}),n.jsxs(p.Typography,{variant:"h5",sx:{flex:1,fontSize:18,fontWeight:700,letterSpacing:"-.2px"},children:["Previewing ",g]}),n.jsxs(p.Select,{size:"small",value:o,onChange:x=>i(x.target.value==="fit"?"fit":Number(x.target.value)),sx:{minWidth:128,fontSize:13,fontWeight:600,"& .MuiSelect-select":{py:.75}},children:[n.jsxs(p.MenuItem,{value:"fit",children:["Fit (",l,"%)"]}),pc.map(x=>n.jsxs(p.MenuItem,{value:x,children:[x,"%"]},x))]})]}),n.jsxs(p.Box,{ref:a,sx:{flex:1,overflow:"auto",p:`${t}px`,position:"relative",bgcolor:"background.default"},children:[n.jsxs(p.Box,{ref:s,sx:{width:"100%",display:"flex",flexDirection:"column","& > *":{flex:"1 1 0%",minHeight:0}},children:[e==="dashboard"&&n.jsx(Ul,{}),e==="orders"&&n.jsx(Jl,{}),e==="reports"&&n.jsx(lc,{}),e==="cameras"&&n.jsx(Zl,{}),e==="operations"&&n.jsx(tc,{}),e==="components"&&n.jsx(ql,{}),e==="login"&&n.jsx(cc,{})]}),e!=="login"&&n.jsx(dc,{})]})]})}const fc=300,hc=520;function gc({defaultLoginImage:e}={}){const[r,t]=z.useState(!0),o=De(k=>k.setDefaultLoginImage);z.useEffect(()=>{o(e||"")},[e,o]);const[i,a]=z.useState(300),[s,l]=z.useState(!1),d=_(k=>k.isDirty),g=_(k=>k.captureBaseline),f=_(k=>k.restoreBaseline),x=Pe(_(k=>k.settings.mode)),m=_(k=>k.settings.customFonts),h=_(k=>k.settings.customHeadFonts),y=z.useRef(null);z.useEffect(()=>{En(m),En(h)},[m,h]);const u=k=>{k.preventDefault(),y.current={x:k.clientX,w:i};const B=j=>{if(!y.current)return;const R=Math.max(fc,Math.min(hc,y.current.w+(j.clientX-y.current.x)));a(R)},S=()=>{y.current=null,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",B),window.addEventListener("mouseup",S)},b=()=>{d()?l(!0):t(!1)},v=()=>{t(!0),g()};return n.jsxs(p.Box,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[n.jsx(p.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[r?n.jsxs(p.Box,{sx:{display:"flex",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:i,flexShrink:0,borderRight:`1px solid ${x.studioBd}`,display:"flex",flexDirection:"column",bgcolor:x.card,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},children:n.jsx(_l,{onClose:b})}),n.jsx(p.Box,{onMouseDown:u,sx:{width:5,cursor:"col-resize",flexShrink:0,bgcolor:"divider",opacity:.4,"&:hover":{opacity:1,bgcolor:"primary.main"}}})]}):n.jsx(p.Tooltip,{title:"Open Theme Studio",placement:"right",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{onClick:v,sx:{position:"absolute",left:68,bottom:56,zIndex:10,bgcolor:"primary.main",color:"primary.contrastText",boxShadow:4,"&:hover":{bgcolor:"primary.dark"}},children:n.jsx(qs,{})})}),n.jsx(uc,{})]})}),n.jsxs(p.Dialog,{open:s,onClose:()=>l(!1),PaperProps:{sx:{borderRadius:3,width:300,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Save changes?"}),n.jsx(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:"You've made changes to the theme. Do you want to save them before leaving?"}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{const k=_.getState();if(k.editingSavedId){const B=k.savedThemes.find(S=>S.id===k.editingSavedId);B&&k.updateSaved(k.editingSavedId,B.name,k.settings)}else g();l(!1),t(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Save & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>{f(),l(!1),t(!1)},sx:{p:1.4,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Discard & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>l(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Keep editing"})]})]})]})}function xc(e){var s,l;const r=Hr(e),t=r.t,o=`${r.headFam},sans-serif`,i=`${r.bodyFam},sans-serif`,a=(d,g)=>({fontFamily:o,fontSize:d,fontWeight:r.wH1,lineHeight:r.headLH,color:g||t.textPrimary});if(typeof window<"u"&&typeof document<"u"){const d=["Roboto","Inter","DM Sans","Manrope","Plus Jakarta Sans","Nunito Sans","Figtree"],f=[e.fontFamily,e.headingFont].filter(Boolean).map(m=>m.replace(/"/g,"").replace(/'/g,"")),x=Array.from(new Set(f)).filter(m=>d.includes(m));if(x.length>0){const m="dynamic-google-fonts";let h=document.getElementById(m);const u=`https://fonts.googleapis.com/css2?${x.map(b=>`family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900`).join("&")}&display=swap`;h||(h=document.createElement("link"),h.id=m,h.rel="stylesheet",document.head.appendChild(h)),h.href!==u&&(h.href=u,(l=(s=document.fonts)==null?void 0:s.ready)==null||l.then(()=>window.dispatchEvent(new Event("resize"))))}}return to({palette:{mode:e.mode,primary:{main:r.pMain,dark:r.pal[700],light:r.pal[300],contrastText:t.pContrast},secondary:{main:r.sMain,dark:r.spal[700],light:r.spal[300],contrastText:t.sContrast},success:{main:e.successHex},warning:{main:e.warningHex},info:{main:e.infoHex},error:{main:e.errorHex},background:{default:t.bgDefault,paper:t.paper},text:{primary:t.textPrimary,secondary:t.textSecondary,disabled:t.textDisabled},divider:t.divider},shape:{borderRadius:r.r},typography:{fontFamily:i,fontSize:r.base,h1:a(r.tH1,r.hc1),h2:a(r.tH2,r.hc2),h3:a(r.tTitle,r.hc3),h4:a(r.tH4,r.hc4),h5:a(r.tH5,r.hc5),h6:a(r.tH6,r.hc6),body1:{fontFamily:i,fontSize:r.tBody,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},body2:{fontFamily:i,fontSize:r.tBodySm,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},caption:{fontFamily:i,fontSize:r.tCaption,lineHeight:r.bodyLH},button:{textTransform:r.btnCase,fontWeight:r.bwEmph}},components:{MuiCssBaseline:{styleOverrides:{"button, input, textarea, select":{fontFamily:"inherit"}}},MuiCard:{styleOverrides:{root:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiCardHeader:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiDialog:{styleOverrides:{paper:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiDialogTitle:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiButton:{styleOverrides:{root:{borderRadius:r.r,boxShadow:"none"}},defaultProps:{disableElevation:!0},variants:e.accentGradient?[{props:{variant:"contained"},style:{backgroundImage:r.accentBg}}]:[]},MuiChip:{styleOverrides:{root:{borderRadius:999,fontWeight:e.statusBold?700:500}}}},urmTable:{rowPaddingY:r.table.rowPy,cellPaddingX:r.table.cellPx,headerBg:r.table.headBg,rowDivider:r.table.rowBorder,colDivider:r.table.colBorder,cellAlignH:e.tableCellAlignH,cellAlignV:e.tableCellAlignV,striped:e.tableStripe,stripeBg:r.table.stripeBg},tokens:{toastW:e.toastW>0?e.toastW:void 0,cardBorder:r.toastDeco.border,cardShadow:r.toastDeco.boxShadow,cardBodyBorder:r.cardBorder==="none"?"none":r.cardBorder,cardBodyShadow:r.cardShadow,cardHdrBg:r.cardHdrBg,cardHdrBorder:r.cardHdrBorder,cardHdrAccent:r.cardHdrAccent,cardHeader:e.cardHeader,status:{errSoft:r.errSoft,warnSoft:r.warnSoft,infoSoft:r.infoSoft,sucSoft:r.sucSoft,errTxt:r.errTxt,warnTxt:r.warnTxt,infoTxt:r.infoTxt,sucTxt:r.sucTxt},notifPosition:e.notifPosition,notifStyle:e.notifStyle,notifAccent:e.notifAccent,notifAutoDismiss:e.notifAutoDismiss,toastBg:r.toastBg,autoDismissSec:e.autoDismissSec>0?e.autoDismissSec:void 0,statusBold:e.statusBold,cardHdrHex:e.cardHdrHex||void 0,containerPad:r.screenPad,cardGap:r.gap,edgePad:e.edgePadPx,highlight:t.highlight,highlightSoft:t.highlightSoft,highlightBd:t.highlightBd,headerBg:r.headerBg,canvasBg:r.canvasBg,accountPageBg:r.accountPageBg,accountCardBg:r.accountCardBg,brandGradient:r.brandGradient,gsAccentGradient:r.gsAccentGradient,gsModalBgDark:r.gsModalBgDark,gsArrowGradient:r.gsArrowGradient,loginPanelGradient:r.loginPanelGradient,reportsAccentTileGradient:r.reportsAccentTileGradient,reportsAccentCtaGradient:r.reportsAccentCtaGradient,reportsModalInnerHighlight:r.reportsModalInnerHighlight}})}exports.DEFAULT_SETTINGS=Ce;exports.ThemeStudio=gc;exports.buildMuiTheme=xc;exports.useThemeStore=_;
74
+ To suppress this warning, you need to explicitly provide the \`palette.${r}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function Fs(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const He=e=>{try{return e()}catch{}},Os=(e="mui")=>es(e);function fr(e,r,t,o,i){if(!t)return;t=t===!0?{}:t;const a=i==="dark"?"dark":"light";if(!o){r[i]=Ps({...t,palette:{mode:a,...t==null?void 0:t.palette},colorSpace:e});return}const{palette:s,...l}=Sr({...o,palette:{mode:a,...t==null?void 0:t.palette},colorSpace:e});return r[i]={...t,palette:s,opacity:{...Zn(a),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||eo(a)},l}function Ms(e={},...r){const{colorSchemes:t={light:!0},defaultColorScheme:o,disableCssColorScheme:i=!1,cssVarPrefix:a="mui",nativeColor:s=!1,shouldSkipGeneratingVar:l=$s,colorSchemeSelector:d=t.light&&t.dark?"media":void 0,rootSelector:g=":root",...f}=e,x=Object.keys(t)[0],m=o||(t.light&&x!=="light"?"light":x),h=Os(a),{[m]:y,light:u,dark:b,...v}=t,k={...v};let B=y;if((m==="dark"&&!("dark"in t)||m==="light"&&!("light"in t))&&(B=!0),!B)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${m}\` option is either missing or invalid.`:rt(21,m));let S;s&&(S="oklch");const j=fr(S,k,B,f,m);u&&!k.light&&fr(S,k,u,void 0,"light"),b&&!k.dark&&fr(S,k,b,void 0,"dark");let R={defaultColorScheme:m,...j,cssVarPrefix:a,colorSchemeSelector:d,rootSelector:g,getCssVar:h,colorSchemes:k,font:{...fs(j.typography),...j.font},spacing:Fs(f.spacing)};Object.keys(R.colorSchemes).forEach(U=>{const c=R.colorSchemes[U].palette,$=W=>{const N=W.split("-"),Y=N[1],L=N[2];return h(W,c[Y][L])};c.mode==="light"&&(T(c.common,"background","#fff"),T(c.common,"onBackground","#000")),c.mode==="dark"&&(T(c.common,"background","#000"),T(c.common,"onBackground","#fff"));function H(W,N,Y){if(S){let L;return W===Qe&&(L=`transparent ${((1-Y)*100).toFixed(0)}%`),W===ie&&(L=`#000 ${(Y*100).toFixed(0)}%`),W===ae&&(L=`#fff ${(Y*100).toFixed(0)}%`),`color-mix(in ${S}, ${N}, ${L})`}return W(N,Y)}if(Ds(c,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),c.mode==="light"){T(c.Alert,"errorColor",H(ie,s?h("palette-error-light"):c.error.light,.6)),T(c.Alert,"infoColor",H(ie,s?h("palette-info-light"):c.info.light,.6)),T(c.Alert,"successColor",H(ie,s?h("palette-success-light"):c.success.light,.6)),T(c.Alert,"warningColor",H(ie,s?h("palette-warning-light"):c.warning.light,.6)),T(c.Alert,"errorFilledBg",$("palette-error-main")),T(c.Alert,"infoFilledBg",$("palette-info-main")),T(c.Alert,"successFilledBg",$("palette-success-main")),T(c.Alert,"warningFilledBg",$("palette-warning-main")),T(c.Alert,"errorFilledColor",He(()=>c.getContrastText(c.error.main))),T(c.Alert,"infoFilledColor",He(()=>c.getContrastText(c.info.main))),T(c.Alert,"successFilledColor",He(()=>c.getContrastText(c.success.main))),T(c.Alert,"warningFilledColor",He(()=>c.getContrastText(c.warning.main))),T(c.Alert,"errorStandardBg",H(ae,s?h("palette-error-light"):c.error.light,.9)),T(c.Alert,"infoStandardBg",H(ae,s?h("palette-info-light"):c.info.light,.9)),T(c.Alert,"successStandardBg",H(ae,s?h("palette-success-light"):c.success.light,.9)),T(c.Alert,"warningStandardBg",H(ae,s?h("palette-warning-light"):c.warning.light,.9)),T(c.Alert,"errorIconColor",$("palette-error-main")),T(c.Alert,"infoIconColor",$("palette-info-main")),T(c.Alert,"successIconColor",$("palette-success-main")),T(c.Alert,"warningIconColor",$("palette-warning-main")),T(c.AppBar,"defaultBg",$("palette-grey-100")),T(c.Avatar,"defaultBg",$("palette-grey-400")),T(c.Button,"inheritContainedBg",$("palette-grey-300")),T(c.Button,"inheritContainedHoverBg",$("palette-grey-A100")),T(c.Chip,"defaultBorder",$("palette-grey-400")),T(c.Chip,"defaultAvatarColor",$("palette-grey-700")),T(c.Chip,"defaultIconColor",$("palette-grey-700")),T(c.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),T(c.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),T(c.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),T(c.LinearProgress,"primaryBg",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.LinearProgress,"secondaryBg",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.LinearProgress,"errorBg",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.LinearProgress,"infoBg",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.LinearProgress,"successBg",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.LinearProgress,"warningBg",H(ae,s?h("palette-warning-light"):c.warning.main,.62)),T(c.Skeleton,"bg",S?H(Qe,s?h("palette-text-primary"):c.text.primary,.11):`rgba(${$("palette-text-primaryChannel")} / 0.11)`),T(c.Slider,"primaryTrack",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.Slider,"secondaryTrack",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.Slider,"errorTrack",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.Slider,"infoTrack",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.Slider,"successTrack",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.Slider,"warningTrack",H(ae,s?h("palette-warning-main"):c.warning.main,.62));const W=S?H(ie,s?h("palette-background-default"):c.background.default,.6825):At(c.background.default,.8);T(c.SnackbarContent,"bg",W),T(c.SnackbarContent,"color",He(()=>S?vr.text.primary:c.getContrastText(W))),T(c.SpeedDialAction,"fabHoverBg",At(c.background.paper,.15)),T(c.StepConnector,"border",$("palette-grey-400")),T(c.StepContent,"border",$("palette-grey-400")),T(c.Switch,"defaultColor",$("palette-common-white")),T(c.Switch,"defaultDisabledColor",$("palette-grey-100")),T(c.Switch,"primaryDisabledColor",H(ae,s?h("palette-primary-main"):c.primary.main,.62)),T(c.Switch,"secondaryDisabledColor",H(ae,s?h("palette-secondary-main"):c.secondary.main,.62)),T(c.Switch,"errorDisabledColor",H(ae,s?h("palette-error-main"):c.error.main,.62)),T(c.Switch,"infoDisabledColor",H(ae,s?h("palette-info-main"):c.info.main,.62)),T(c.Switch,"successDisabledColor",H(ae,s?h("palette-success-main"):c.success.main,.62)),T(c.Switch,"warningDisabledColor",H(ae,s?h("palette-warning-main"):c.warning.main,.62)),T(c.TableCell,"border",H(ae,Qe(s?h("palette-divider"):c.divider,1),.88)),T(c.Tooltip,"bg",H(Qe,s?h("palette-grey-700"):c.grey[700],.92))}if(c.mode==="dark"){T(c.Alert,"errorColor",H(ae,s?h("palette-error-light"):c.error.light,.6)),T(c.Alert,"infoColor",H(ae,s?h("palette-info-light"):c.info.light,.6)),T(c.Alert,"successColor",H(ae,s?h("palette-success-light"):c.success.light,.6)),T(c.Alert,"warningColor",H(ae,s?h("palette-warning-light"):c.warning.light,.6)),T(c.Alert,"errorFilledBg",$("palette-error-dark")),T(c.Alert,"infoFilledBg",$("palette-info-dark")),T(c.Alert,"successFilledBg",$("palette-success-dark")),T(c.Alert,"warningFilledBg",$("palette-warning-dark")),T(c.Alert,"errorFilledColor",He(()=>c.getContrastText(c.error.dark))),T(c.Alert,"infoFilledColor",He(()=>c.getContrastText(c.info.dark))),T(c.Alert,"successFilledColor",He(()=>c.getContrastText(c.success.dark))),T(c.Alert,"warningFilledColor",He(()=>c.getContrastText(c.warning.dark))),T(c.Alert,"errorStandardBg",H(ie,s?h("palette-error-light"):c.error.light,.9)),T(c.Alert,"infoStandardBg",H(ie,s?h("palette-info-light"):c.info.light,.9)),T(c.Alert,"successStandardBg",H(ie,s?h("palette-success-light"):c.success.light,.9)),T(c.Alert,"warningStandardBg",H(ie,s?h("palette-warning-light"):c.warning.light,.9)),T(c.Alert,"errorIconColor",$("palette-error-main")),T(c.Alert,"infoIconColor",$("palette-info-main")),T(c.Alert,"successIconColor",$("palette-success-main")),T(c.Alert,"warningIconColor",$("palette-warning-main")),T(c.AppBar,"defaultBg",$("palette-grey-900")),T(c.AppBar,"darkBg",$("palette-background-paper")),T(c.AppBar,"darkColor",$("palette-text-primary")),T(c.Avatar,"defaultBg",$("palette-grey-600")),T(c.Button,"inheritContainedBg",$("palette-grey-800")),T(c.Button,"inheritContainedHoverBg",$("palette-grey-700")),T(c.Chip,"defaultBorder",$("palette-grey-700")),T(c.Chip,"defaultAvatarColor",$("palette-grey-300")),T(c.Chip,"defaultIconColor",$("palette-grey-300")),T(c.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),T(c.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),T(c.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),T(c.LinearProgress,"primaryBg",H(ie,s?h("palette-primary-main"):c.primary.main,.5)),T(c.LinearProgress,"secondaryBg",H(ie,s?h("palette-secondary-main"):c.secondary.main,.5)),T(c.LinearProgress,"errorBg",H(ie,s?h("palette-error-main"):c.error.main,.5)),T(c.LinearProgress,"infoBg",H(ie,s?h("palette-info-main"):c.info.main,.5)),T(c.LinearProgress,"successBg",H(ie,s?h("palette-success-main"):c.success.main,.5)),T(c.LinearProgress,"warningBg",H(ie,s?h("palette-warning-main"):c.warning.main,.5)),T(c.Skeleton,"bg",S?H(Qe,s?h("palette-text-primary"):c.text.primary,.13):`rgba(${$("palette-text-primaryChannel")} / 0.13)`),T(c.Slider,"primaryTrack",H(ie,s?h("palette-primary-main"):c.primary.main,.5)),T(c.Slider,"secondaryTrack",H(ie,s?h("palette-secondary-main"):c.secondary.main,.5)),T(c.Slider,"errorTrack",H(ie,s?h("palette-error-main"):c.error.main,.5)),T(c.Slider,"infoTrack",H(ie,s?h("palette-info-main"):c.info.main,.5)),T(c.Slider,"successTrack",H(ie,s?h("palette-success-main"):c.success.main,.5)),T(c.Slider,"warningTrack",H(ie,s?h("palette-warning-light"):c.warning.main,.5));const W=S?H(ae,s?h("palette-background-default"):c.background.default,.985):At(c.background.default,.98);T(c.SnackbarContent,"bg",W),T(c.SnackbarContent,"color",He(()=>S?Kn.text.primary:c.getContrastText(W))),T(c.SpeedDialAction,"fabHoverBg",At(c.background.paper,.15)),T(c.StepConnector,"border",$("palette-grey-600")),T(c.StepContent,"border",$("palette-grey-600")),T(c.Switch,"defaultColor",$("palette-grey-300")),T(c.Switch,"defaultDisabledColor",$("palette-grey-600")),T(c.Switch,"primaryDisabledColor",H(ie,s?h("palette-primary-main"):c.primary.main,.55)),T(c.Switch,"secondaryDisabledColor",H(ie,s?h("palette-secondary-main"):c.secondary.main,.55)),T(c.Switch,"errorDisabledColor",H(ie,s?h("palette-error-main"):c.error.main,.55)),T(c.Switch,"infoDisabledColor",H(ie,s?h("palette-info-main"):c.info.main,.55)),T(c.Switch,"successDisabledColor",H(ie,s?h("palette-success-main"):c.success.main,.55)),T(c.Switch,"warningDisabledColor",H(ie,s?h("palette-warning-light"):c.warning.main,.55)),T(c.TableCell,"border",H(ie,Qe(s?h("palette-divider"):c.divider,1),.68)),T(c.Tooltip,"bg",H(Qe,s?h("palette-grey-700"):c.grey[700],.92))}s||($e(c.background,"default"),$e(c.background,"paper"),$e(c.common,"background"),$e(c.common,"onBackground"),$e(c,"divider")),Object.keys(c).forEach(W=>{const N=c[W];W!=="tonalOffset"&&!s&&N&&typeof N=="object"&&(N.main&&T(c[W],"mainChannel",yt(bt(N.main))),N.light&&T(c[W],"lightChannel",yt(bt(N.light))),N.dark&&T(c[W],"darkChannel",yt(bt(N.dark))),N.contrastText&&T(c[W],"contrastTextChannel",yt(bt(N.contrastText))),W==="text"&&($e(c[W],"primary"),$e(c[W],"secondary")),W==="action"&&(N.active&&$e(c[W],"active"),N.selected&&$e(c[W],"selected")))})}),R=r.reduce((U,c)=>ke(U,c),R);const O={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:l,getSelector:Is(R),enableContrastVars:s},{vars:P,generateThemeVars:K,generateStyleSheets:Q}=ns(R,O);return R.vars=P,Object.entries(R.colorSchemes[R.defaultColorScheme]).forEach(([U,c])=>{R[U]=c}),R.generateThemeVars=K,R.generateStyleSheets=Q,R.generateSpacing=function(){return _n(f.spacing,kr(this))},R.getColorSchemeSelector=os(d),R.spacing=R.generateSpacing(),R.shouldSkipGeneratingVar=l,R.unstable_sxConfig={...Xt,...f==null?void 0:f.unstable_sxConfig},R.unstable_sx=function(c){return ut({sx:c,theme:this})},R.toRuntimeSource=Qn,R}function Cn(e,r,t){e.colorSchemes&&t&&(e.colorSchemes[r]={...t!==!0&&t,palette:Er({...t===!0?{}:t.palette,mode:r})})}function to(e={},...r){const{palette:t,cssVariables:o=!1,colorSchemes:i=t?void 0:{light:!0},defaultColorScheme:a=t==null?void 0:t.mode,...s}=e,l=a||"light",d=i==null?void 0:i[l],g={...i,...t?{[l]:{...typeof d!="boolean"&&d,palette:t}}:void 0};if(o===!1){if(!("colorSchemes"in e))return Sr(e,...r);let f=t;"palette"in e||g[l]&&(g[l]!==!0?f=g[l].palette:l==="dark"&&(f={mode:"dark"}));const x=Sr({...e,palette:f},...r);return x.defaultColorScheme=l,x.colorSchemes=g,x.palette.mode==="light"&&(x.colorSchemes.light={...g.light!==!0&&g.light,palette:x.palette},Cn(x,"dark",g.dark)),x.palette.mode==="dark"&&(x.colorSchemes.dark={...g.dark!==!0&&g.dark,palette:x.palette},Cn(x,"light",g.light)),x}return!t&&!("light"in g)&&l==="light"&&(g.light=!0),Ms({...s,colorSchemes:g,defaultColorScheme:l,...typeof o!="boolean"&&o},...r)}const Ws=to(),zs="$$material";function _s(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ls=e=>_s(e)&&e!=="classes",Ns=_a({themeId:zs,defaultTheme:Ws,rootShouldForwardProp:Ls}),Vs=Za;process.env.NODE_ENV!=="production"&&(re.node,re.object.isRequired);function Gs(e){return Qa(e)}function Us(e){return Br("MuiSvgIcon",e)}Fa("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Ys=e=>{const{color:r,fontSize:t,classes:o}=e,i={root:["root",r!=="inherit"&&`color${nt(r)}`,`fontSize${nt(t)}`]};return Bi(i,Us,o)},Js=Ns("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${nt(t.color)}`],r[`fontSize${nt(t.fontSize)}`]]}})(Vs(({theme:e})=>{var r,t,o,i,a,s,l,d,g,f,x,m,h,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(r=e.transitions)==null?void 0:r.create)==null?void 0:i.call(r,"fill",{duration:(o=(t=(e.vars??e).transitions)==null?void 0:t.duration)==null?void 0:o.shorter}),variants:[{props:u=>!u.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:s.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((d=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:d.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(g=e.typography)==null?void 0:g.pxToRem)==null?void 0:f.call(g,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,u])=>u&&u.main).map(([u])=>{var b,v;return{props:{color:u},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[u])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(y=(h=(e.vars??e).palette)==null?void 0:h.action)==null?void 0:y.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),_t=Ge.forwardRef(function(r,t){const o=Gs({props:r,name:"MuiSvgIcon"}),{children:i,className:a,color:s="inherit",component:l="svg",fontSize:d="medium",htmlColor:g,inheritViewBox:f=!1,titleAccess:x,viewBox:m="0 0 24 24",...h}=o,y=Ge.isValidElement(i)&&i.type==="svg",u={...o,color:s,component:l,fontSize:d,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:y},b={};f||(b.viewBox=m);const v=Ys(u);return n.jsxs(Js,{as:l,className:On(v.root,a),focusable:"false",color:g,"aria-hidden":x?void 0:!0,role:x?"img":void 0,ref:t,...b,...h,...y&&i.props,ownerState:u,children:[y?i.props.children:i,x?n.jsx("title",{children:x}):null]})});process.env.NODE_ENV!=="production"&&(_t.propTypes={children:re.node,classes:re.object,className:re.string,color:re.oneOfType([re.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),re.string]),component:re.elementType,fontSize:re.oneOfType([re.oneOf(["inherit","large","medium","small"]),re.string]),htmlColor:re.string,inheritViewBox:re.bool,shapeRendering:re.string,sx:re.oneOfType([re.arrayOf(re.oneOfType([re.func,re.object,re.bool])),re.func,re.object]),titleAccess:re.string,viewBox:re.string});_t.muiName="SvgIcon";function kt(e,r){function t(o,i){return n.jsx(_t,{"data-testid":process.env.NODE_ENV!=="production"?`${r}Icon`:void 0,ref:i,...o,children:e})}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=_t.muiName,Ge.memo(Ge.forwardRef(t))}const qs=kt(n.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded"),Ks=kt(n.jsx("path",{d:"M12 5V3.21c0-.45-.54-.67-.85-.35l-2.8 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.32.31.86.09.86-.36V7c3.31 0 6 2.69 6 6 0 2.72-1.83 5.02-4.31 5.75-.42.12-.69.52-.69.95 0 .65.62 1.16 1.25.97C17.57 19.7 20 16.64 20 13c0-4.42-3.58-8-8-8m-6 8c0-1.34.44-2.58 1.19-3.59.3-.4.26-.95-.09-1.31-.42-.42-1.14-.38-1.5.1-1 1.34-1.6 3-1.6 4.8 0 3.64 2.43 6.7 5.75 7.67.63.19 1.25-.32 1.25-.97 0-.43-.27-.83-.69-.95C7.83 18.02 6 15.72 6 13"}),"RestartAltRounded"),Xs=kt(n.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),Qs=kt(n.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),wn=e=>{let r;const t=new Set,o=(g,f)=>{const x=typeof g=="function"?g(r):g;if(!Object.is(x,r)){const m=r;r=f??(typeof x!="object"||x===null)?x:Object.assign({},r,x),t.forEach(h=>h(r,m))}},i=()=>r,l={setState:o,getState:i,getInitialState:()=>d,subscribe:g=>(t.add(g),()=>t.delete(g))},d=r=e(o,i,l);return l},Zs=(e=>e?wn(e):wn),el=e=>e;function tl(e,r=el){const t=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>r(e.getState()),[e,r]),z.useCallback(()=>r(e.getInitialState()),[e,r]));return z.useDebugValue(t),t}const jn=e=>{const r=Zs(e),t=o=>tl(r,o);return Object.assign(t,r),t},ro=(e=>e?jn(e):jn);function rl(e,r){let t;try{t=e()}catch{return}return{getItem:i=>{var a;const s=d=>d===null?null:JSON.parse(d,void 0),l=(a=t.getItem(i))!=null?a:null;return l instanceof Promise?l.then(s):s(l)},setItem:(i,a)=>t.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>t.removeItem(i)}}const Cr=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(o){return Cr(o)(t)},catch(o){return this}}}catch(t){return{then(o){return this},catch(o){return Cr(o)(t)}}}},nl=(e,r)=>(t,o,i)=>{let a={storage:rl(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,v)=>({...v,...b}),...r},s=!1,l=0;const d=new Set,g=new Set;let f=a.storage;if(!f)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),t(...b)},o,i);const x=()=>{const b=a.partialize({...o()});return f.setItem(a.name,{state:b,version:a.version})},m=i.setState;i.setState=(b,v)=>(m(b,v),x());const h=e((...b)=>(t(...b),x()),o,i);i.getInitialState=()=>h;let y;const u=()=>{var b,v;if(!f)return;const k=++l;s=!1,d.forEach(S=>{var j;return S((j=o())!=null?j:h)});const B=((v=a.onRehydrateStorage)==null?void 0:v.call(a,(b=o())!=null?b:h))||void 0;return Cr(f.getItem.bind(f))(a.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==a.version){if(a.migrate){const j=a.migrate(S.state,S.version);return j instanceof Promise?j.then(R=>[!0,R]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var j;if(k!==l)return;const[R,O]=S;if(y=a.merge(O,(j=o())!=null?j:h),t(y,!0),R)return x()}).then(()=>{k===l&&(B==null||B(o(),void 0),y=o(),s=!0,g.forEach(S=>S(y)))}).catch(S=>{k===l&&(B==null||B(void 0,S))})};return i.persist={setOptions:b=>{a={...a,...b},b.storage&&(f=b.storage)},clearStorage:()=>{f==null||f.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>u(),hasHydrated:()=>s,onHydrate:b=>(d.add(b),()=>{d.delete(b)}),onFinishHydration:b=>(g.add(b),()=>{g.delete(b)})},a.skipHydration||u(),y||h},ol=nl,Ct=[{id:"corporate",name:"Corporate Blue",snap:{primaryHex:"#4F6BFF",secondaryHex:"#22D3EE",iconColor:"#4F6BFF",highlightHex:"#6D86FF",cardStyle:"soft",cardShadowPx:20,h1Size:28,h2Size:25,h3Size:22,h4Size:20,h5Size:17,h6Size:14,baseFontPx:15,videoShadowLight:"0px 4px 66px 0px #0409D8",videoShadowDark:"0px 4px 63.7px 0px #00136f"}},{id:"emerald",name:"Emerald",snap:{primaryHex:"#10B981",secondaryHex:"#F5A524",iconColor:"#10B981",highlightHex:"#2EE6A6",cardStyle:"soft",cardShadowPx:20,videoShadowLight:"0px 4px 66.3px 0px #0C3726",videoShadowDark:"0px 4px 66.3px 14px #0C3726",ccBadge:"#14b8a6",hdBadge:"#f59e0b",h1Size:28}},{id:"indigo",name:"Indigo Violet",snap:{primaryHex:"#A97BFF",secondaryHex:"#FF5FA2",iconColor:"#A97BFF",highlightHex:"#A97BFF",cardStyle:"soft",cardShadowPx:20,videoShadowLight:"0px 4px 66px 0px #F50079",videoShadowDark:"0px 4px 63.7px 0px #9F0087",h1Size:28}},{id:"slate",name:"Graphite",snap:{primaryHex:"#455a64",secondaryHex:"#78909c",iconColor:"#455a64",cardStyle:"floating",cardShadowPx:16}},{id:"teal",name:"Ocean Teal",snap:{primaryHex:"#00838f",secondaryHex:"#0277bd",iconColor:"#00838f",cardStyle:"floating",cardShadowPx:20}},{id:"amber",name:"Amber",snap:{primaryHex:"#e65100",secondaryHex:"#d84315",iconColor:"#e65100",cardStyle:"floating",cardShadowPx:20}}],kn={appName:"Crystal Ball",appTagline:"Run your whole business in one place",logoMode:"icon",logoUrl:"",iconColor:"#4F6BFF",presetId:"emerald",mode:"light",primaryHex:"#4F6BFF",secondaryHex:"#22D3EE",highlightHex:"",videoShadowLight:"",videoShadowDark:"",ccBadge:"",hdBadge:"",errorHex:"#d32f2f",warningHex:"#ed6c02",infoHex:"#0288d1",successHex:"#2e7d32",cardBgHex:"",cardHdrHex:"",pageBgHex:"",notifCardHex:"",textPrimaryHex:"",textSecondaryHex:"",dividerHex:"",btnColorHex:"",btnTextHex:"",h1Color:"",h2Color:"",h3Color:"",h4Color:"",h5Color:"",h6Color:"",fontFamily:"Roboto",headingFont:"Inter",customFonts:[],customHeadFonts:[],textSize:"df",baseFontPx:15,bodyLineHeight:0,bodyWeight:300,letterSpace:0,scaleRatio:"default",scaleRatioCustom:0,h1Size:0,h2Size:0,h3Size:0,h4Size:0,h5Size:0,h6Size:0,h1Weight:0,h2Weight:0,h3Weight:0,h4Weight:0,h5Weight:0,h6Weight:0,headingWeight:300,headingLH:0,radiusPreset:"rounded",radiusVal:9,density:"default",densityScale:0,cardShadowPx:-1,contrast:"medium",contrastMode:"auto",containerPadPx:0,edgePadPx:0,cardGapPx:0,cardStyle:"soft",cardHeader:"plain",surfaceTint:"snow",nestedStyle:"recessed",nestedDepth:-1,headerStrength:-1,tintIntensity:-1,btnCase:"upper",accentGradient:!1,statusBold:!1,mapGlass:"light",chartScheme:"brand",tableDensity:"default",tableColDensity:"default",tableDividers:!1,tableColDividers:!1,tableRowDivW:1,tableColDivW:1,tableStripe:!1,tableHeaderStyle:"accent",tableCellAlignH:"left",tableCellAlignV:"middle",notifPosition:"bottom-right",notifStyle:"toast",notifAccent:"severity",notifBadge:!0,notifAutoDismiss:!1,autoDismissSec:8,toastW:0,navPattern:"sidebar",sidebarWidth:220,appBarH:0,loginLayout:"split",loginImage:"",loginShowTagline:!0,loginPanelColor:"",loginImgOpacity:0,loginCardW:0};var An;const Ce={...kn,...((An=Ct.find(e=>e.id===kn.presetId))==null?void 0:An.snap)??{}},il=["primaryHex","secondaryHex","highlightHex"],Ae=e=>{const{mode:r,...t}=e;return JSON.stringify(t)};function hr(e){const r={...Ce};if(e&&typeof e=="object")for(const t of Object.keys(Ce)){const o=e[t];o!==void 0&&typeof o==typeof Ce[t]&&(r[t]=o)}return r}function al(e){if(!e||typeof e!="object")return!1;const r=Object.keys(Ce);let t=0;for(const o of r){const i=e[o];i!==void 0&&typeof i==typeof Ce[o]&&t++}return t/r.length>=.5}const _=ro()(ol((e,r)=>({settings:{...Ce},savedThemes:[],baseline:Ae(Ce),editingSavedId:null,lastImportedId:null,set:t=>e(o=>{const i=Object.keys(t).some(a=>il.includes(a));return{settings:{...o.settings,...t,...i?{presetId:"custom"}:{}}}}),applyPreset:(t,o)=>e(i=>{const a={...i.settings,...o,presetId:t};return{settings:a,baseline:Ae(a),editingSavedId:null,lastImportedId:null}}),reset:()=>e(()=>({settings:{...Ce},baseline:Ae(Ce),editingSavedId:null,lastImportedId:null})),captureBaseline:()=>e(t=>({baseline:Ae(t.settings)})),restoreBaseline:()=>e(t=>{try{return{settings:{...JSON.parse(t.baseline),mode:t.settings.mode}}}catch{return{}}}),isDirty:()=>Ae(r().settings)!==r().baseline,saveTheme:t=>e(o=>{const i="cust"+Date.now(),a={...o.settings};return{savedThemes:[...o.savedThemes,{id:i,name:t,snap:a}],settings:{...o.settings,presetId:i},baseline:Ae({...o.settings,presetId:i}),editingSavedId:i,lastImportedId:null}}),updateSaved:(t,o,i)=>e(a=>{const s={...i,presetId:t};return{savedThemes:a.savedThemes.map(l=>l.id===t?{...l,name:o,snap:s}:l),settings:s,baseline:Ae(s),editingSavedId:t,lastImportedId:null}}),applySaved:t=>e(()=>{const o={...hr(t.snap),presetId:t.id};return{settings:o,baseline:Ae(o),editingSavedId:t.id,lastImportedId:null}}),renameSaved:(t,o)=>e(i=>({savedThemes:i.savedThemes.map(a=>a.id===t?{...a,name:o}:a)})),deleteSaved:t=>e(o=>({savedThemes:o.savedThemes.filter(i=>i.id!==t),editingSavedId:o.editingSavedId===t?null:o.editingSavedId,lastImportedId:o.lastImportedId===t?null:o.lastImportedId})),deleteCustomFont:(t,o)=>e(i=>{if(o){const a=i.settings.customHeadFonts.filter(l=>l.name!==t),s=i.settings.headingFont===t?Ce.headingFont||"Roboto":i.settings.headingFont;return{settings:{...i.settings,customHeadFonts:a,headingFont:s}}}else{const a=i.settings.customFonts.filter(l=>l.name!==t),s=i.settings.fontFamily===t?Ce.fontFamily||"Roboto":i.settings.fontFamily;return{settings:{...i.settings,customFonts:a,fontFamily:s}}}}),importTheme:(t,o)=>{const i=hr(o),a={id:"imp"+Date.now(),name:t,snap:i};return e(s=>{const l={...i,presetId:a.id};return{savedThemes:[a,...s.savedThemes],settings:l,baseline:Ae(l),editingSavedId:a.id,lastImportedId:a.id}}),a}}),{name:"omnieye-theme-studio",merge:(e,r)=>{const t=e??{};return{...r,...t,settings:hr(t.settings),savedThemes:Array.isArray(t.savedThemes)?t.savedThemes:r.savedThemes}}}));function Pe(e){const r=e==="dark";return{studioBg:r?"#15181d":"#f5f7fa",studioBd:r?"#2a2f38":"#d8dee6",card:r?"#1e222a":"#ffffff",cardBd:r?"#2b313b":"#e6eaf0",inset:r?"#262b34":"#f7f9fb",insetBd:r?"#363d48":"#e9edf2",divider:r?"#262b34":"#f0f3f7",iconTile:r?"#2b313b":"#eef1f6",text:r?"rgba(255,255,255,0.92)":"#1c2127",label:r?"rgba(255,255,255,0.5)":"#9aa4b0",label2:r?"rgba(255,255,255,0.6)":"#7a8593",body:r?"rgba(255,255,255,0.78)":"#5a6573",muted:r?"rgba(255,255,255,0.42)":"#aeb6c0",chevron:r?"rgba(255,255,255,0.42)":"#b3bcc7"}}function wr(e){if(!e||e.length<7)return[210,60,45];const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,i=Math.max(r,t,o),a=Math.min(r,t,o),s=i-a;let l=0,d=0;const g=(i+a)/2;return s&&(d=s/(1-Math.abs(2*g-1)),i===r?l=(t-o)/s%6:i===t?l=(o-r)/s+2:l=(r-t)/s+4,l=Math.round(l*60),l<0&&(l+=360)),[l,Math.round(d*100),Math.round(g*100)]}function te(e,r,t){r/=100,t/=100;const o=i=>{const a=(i+e/30)%12,s=r*Math.min(t,1-t);return Math.round((t-s*Math.max(-1,Math.min(a-3,Math.min(9-a,1))))*255).toString(16).padStart(2,"0")};return"#"+o(0)+o(8)+o(4)}function Se(e){try{const[r,t]=wr(e),o=Math.max(t,18);return{50:te(r,Math.max(Math.round(o*.3),10),96),100:te(r,Math.max(Math.round(o*.42),12),91),200:te(r,Math.max(Math.round(o*.55),16),82),300:te(r,Math.max(Math.round(o*.7),20),70),400:te(r,o,60),500:e,600:te(r,Math.min(o+4,100),44),700:te(r,Math.min(o+8,100),36),800:te(r,Math.max(Math.round(o*.92),16),26),900:te(r,Math.max(Math.round(o*.8),14),16)}}catch{return{50:"#eef",100:"#dde",200:"#bbd",300:"#99c",400:"#77b",500:e||"#4F6BFF",600:"#1257a8",700:"#0e4488",800:"#0a3266",900:"#062044"}}}function gr(e,r){try{const t=l=>{const d=[1,3,5].map(g=>{const f=parseInt(l.slice(g,g+2),16)/255;return f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4)});return .2126*d[0]+.7152*d[1]+.0722*d[2]},o=t(e),i=t(r),a=Math.max(o,i),s=Math.min(o,i);return(a+.05)/(s+.05)}catch{return 1}}function ce(e,r){if(!e||e[0]!=="#"||e.length<7)return"rgba(20,30,48,"+r+")";const t=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba("+t+","+o+","+i+","+r+")"}const sl={corporate:{light:{angle:0,colors:["#141b3c"]},dark:{angle:0,colors:["#141b3c"]}},"corporate-blue":{light:{angle:0,colors:["#141b3c"]},dark:{angle:0,colors:["#141b3c"]}},emerald:{light:{angle:0,colors:["#0d2a20"]},dark:{angle:0,colors:["#041610"]}},indigo:{light:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]},dark:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]}},"indigo-violet":{light:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]},dark:{angle:176.18088833734933,colors:["rgb(51, 34, 88)","rgb(50, 20, 56)"],stops:[16.741,83.447]}}},ll={corporate:{angle:180,colors:["#070A1B","#111734","#090D22"]},"corporate-blue":{angle:180,colors:["#070A1B","#111734","#090D22"]},emerald:{angle:180,colors:["#06140E","#082318","#061910"]},indigo:{angle:180,colors:["#0D0620","#221236","#2E1F4F"]},"indigo-violet":{angle:180,colors:["#0D0620","#221236","#2E1F4F"]}},Tn={corporate:{angle:90,colors:["#000000","#03205F"]},"corporate-blue":{angle:90,colors:["#000000","#03205F"]}},cl={corporate:{angle:90,colors:["#6CA4FF","#C9D8F2"]},"corporate-blue":{angle:90,colors:["#6CA4FF","#C9D8F2"]},emerald:{angle:90,colors:["#97E1B2","#E6E6E6"]},indigo:{angle:90,colors:["#FCB3D8","#E6E6E6"]},"indigo-violet":{angle:90,colors:["#FCB3D8","#E6E6E6"]}},dl={corporate:{angle:90,colors:["#010D27","#03205F"]},"corporate-blue":{angle:90,colors:["#010D27","#03205F"]},emerald:{angle:90,colors:["#001909","#0A4821"]},indigo:{angle:90,colors:["#010D27","#37107A"]},"indigo-violet":{angle:90,colors:["#010D27","#37107A"]}},pl={corporate:{light:{angle:90,colors:["#0029ff","#00144b"]},dark:{angle:90,colors:["#4f6bff","#22d3ee"]}},"corporate-blue":{light:{angle:90,colors:["#0029ff","#00144b"]},dark:{angle:90,colors:["#4f6bff","#22d3ee"]}},emerald:{light:{angle:90,colors:["#01b979","#d88b00"]},dark:{angle:90,colors:["#2ee6a6","#ffc255"]}},indigo:{light:{angle:90,colors:["#4300c1","#ff388c"]},dark:{angle:90,colors:["#4300c1","#ff388c"]}},"indigo-violet":{light:{angle:90,colors:["#4300c1","#ff388c"]},dark:{angle:90,colors:["#4300c1","#ff388c"]}}},ul={corporate:{light:{angle:135,colors:["#00ddff","#0c26b1"]},dark:{angle:162,colors:["#22d3ee","#126673"],stops:[11.886,91.492]}},emerald:{light:{angle:135,colors:["#F5A524","#10B981"]},dark:{angle:180,colors:["#FFC255","#997433"],overlay:"linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%)"}}},fl={corporate:{angle:0,colors:["#4f6bff","#3f5adb","#2e49b7","#1e3892","#0d276e","#07153f"],stops:[0,13.75,27.5,41.25,55,100]},emerald:{angle:0,colors:["#2EE6A6","#21AB7B","#1A8D65","#146F4F","#0D4E37","#072D20"],stops:[0,27.5,41.25,55,77.5,100]},indigo:{angle:0,colors:["#A97BFF","#4E22A0","#16013E"],stops:[0,50,100]}},hl={emerald:{angle:169,colors:["#28C78F","#18855F"]}},gl={corporate:{angle:136.6683374482933,colors:["#3f5bff","#4b48e6","#7c5cf5"],stops:[0,45,100]}},mt="#0f172a";function no(e,r){const t=r??e.map((o,i)=>e.length===1?0:i/(e.length-1)*100);return e.map((o,i)=>`${o} ${t[i]}%`).join(", ")}function Ie(e){if(e.colors.length===1)return e.colors[0];const r=`linear-gradient(${e.angle}deg, ${no(e.colors,e.stops)})`;return e.overlay?`${e.overlay}, ${r}`:r}function Bn(e,r){return`radial-gradient(${r}, ${no(e.colors,e.stops)})`}function Hr(e){const r=Se(e.primaryHex),t=Se(e.secondaryHex),o=e.mode==="dark",i=o?r[300]:e.primaryHex,a=o?t[300]:e.secondaryHex,s={pMain:i,pDark:r[700],pLight:r[300],highlight:e.highlightHex||i,highlightSoft:ce(e.highlightHex||i,o?.22:.14),highlightBd:ce(e.highlightHex||i,o?.45:.32),pContrast:e.contrastMode==="light"?"#ffffff":e.contrastMode==="dark"?"rgba(0,0,0,0.87)":gr(i,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",pContainer:o?ce(e.primaryHex,.26):r[50],onPContainer:o?r[100]:r[800],sMain:a,sContrast:gr(a,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",bgDefault:o?"#121212":"#f3f5f8",paper:o?"#1e1e1e":"#ffffff",paper2:o?"#262630":"#f6f8fb",frameGutterBg:o?"#0a0a0a":"#e3e7ec",footerBg:o?"#17171c":"#eceef2",textPrimary:o?"rgba(255,255,255,0.92)":"rgba(0,0,0,0.87)",textSecondary:o?"rgba(255,255,255,0.62)":"rgba(0,0,0,0.6)",textDisabled:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.38)",divider:o?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)",outline:o?"rgba(255,255,255,0.23)":"rgba(0,0,0,0.23)"},l=e.statusBold,d=l?e.errorHex:ce(e.errorHex,o?.22:.13),g=l?e.warningHex:ce(e.warningHex,o?.22:.14),f=l?e.infoHex:ce(e.infoHex,o?.22:.13),x=l?e.successHex:ce(e.successHex,o?.22:.13),m=l?"#ffffff":o?Se(e.errorHex)[300]:e.errorHex,h=l?"#ffffff":o?Se(e.warningHex)[300]:Se(e.warningHex)[700],y=l?"#ffffff":o?Se(e.infoHex)[300]:e.infoHex,u=l?"#ffffff":o?Se(e.successHex)[300]:Se(e.successHex)[700],b=wr(e.primaryHex)[0],v={neutral:[220,6],warm:[32,26],cool:[210,30],brand:[b,42],slate:[214,16],snow:[0,0]},k=v[e.surfaceTint]||v.neutral,B=e.tintIntensity>=0?e.tintIntensity:100,S=[k[0],Math.round(k[1]*B/100)];if(o)s.bgDefault=te(S[0],Math.round(S[1]*.7),7),s.paper=te(S[0],Math.round(S[1]*.7),13),s.paper2=te(S[0],Math.round(S[1]*.85),19);else if(e.surfaceTint==="snow"&&!(e.tintIntensity>0))s.bgDefault="#ffffff",s.paper="#ffffff",s.paper2="#ffffff";else{const he=Math.min(100,Math.max(96,100-Math.round(S[1]*.08)));s.bgDefault=te(S[0],Math.round(S[1]*.9),e.surfaceTint==="brand"?94:97),s.paper=te(S[0],Math.round(S[1]*.4),he),s.paper2=te(S[0],Math.round(S[1]*.85),e.surfaceTint==="brand"?95:96.5)}e.pageBgHex&&(s.bgDefault=e.pageBgHex),e.cardBgHex&&(s.paper=e.cardBgHex);const j={soft:0,standard:1,medium:2,high:3},R=j[e.contrast]!==void 0?j[e.contrast]:1,O=o?[["rgba(255,255,255,0.82)","rgba(255,255,255,0.55)","rgba(255,255,255,0.09)","rgba(255,255,255,0.16)"],["rgba(255,255,255,0.92)","rgba(255,255,255,0.62)","rgba(255,255,255,0.12)","rgba(255,255,255,0.23)"],["rgba(255,255,255,0.96)","rgba(255,255,255,0.74)","rgba(255,255,255,0.18)","rgba(255,255,255,0.34)"],["#ffffff","rgba(255,255,255,0.87)","rgba(255,255,255,0.26)","rgba(255,255,255,0.46)"]]:[["rgba(0,0,0,0.72)","rgba(0,0,0,0.5)","rgba(0,0,0,0.08)","rgba(0,0,0,0.16)"],["rgba(0,0,0,0.87)","rgba(0,0,0,0.6)","rgba(0,0,0,0.12)","rgba(0,0,0,0.23)"],["rgba(0,0,0,0.92)","rgba(0,0,0,0.7)","rgba(0,0,0,0.18)","rgba(0,0,0,0.34)"],["#000000","rgba(0,0,0,0.8)","rgba(0,0,0,0.24)","rgba(0,0,0,0.46)"]];s.textPrimary=O[R][0],s.textSecondary=O[R][1],s.divider=O[R][2],s.outline=O[R][3],e.textPrimaryHex&&(s.textPrimary=e.textPrimaryHex),e.textSecondaryHex&&(s.textSecondary=e.textSecondaryHex),e.dividerHex&&(s.divider=e.dividerHex),e.nestedStyle==="lighter"?s.paper2=o?te(S[0],Math.round(S[1]*.9),22):te(S[0],Math.max(Math.round(S[1]*.3),4),100):e.nestedStyle==="bordered"?s.paper2=s.paper:s.paper2=o?te(S[0],Math.round(S[1]*.9),Math.max(3,5)):te(S[0],Math.min(Math.round(S[1]*1.1),60),Math.max(88,94-S[1]*.18));const P=e.btnColorHex||i,K=e.accentGradient?"linear-gradient(135deg,"+P+","+(e.btnColorHex?Se(e.btnColorHex)[700]:r[o?500:700])+")":P,Q=e.btnTextHex||(gr(P,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)"),U=e.h1Color||null,c=e.h2Color||null,$=e.h3Color||null,H=e.h4Color||null,W=e.h5Color||null,N=e.h6Color||null,Y=[{key:"sm",px:13},{key:"df",px:12},{key:"lg",px:18}],L=Y.find(he=>he.key===e.textSize)||Y[1],J=e.baseFontPx>0?e.baseFontPx:L.px,E=e.bodyLineHeight>0?e.bodyLineHeight:1.5,I=e.h1Size>0?e.h1Size:20,q=Math.round(I*1.1),V=I,G=Math.max(Math.round(I*.9),11),D=Math.max(Math.round(I*.8),11),C=Math.max(Math.round(I*.7),10),A=Math.max(Math.round(I*.6),10),F=Math.max(Math.round(I*.5),9),X=J,w=Math.round(J*.92),Z=Math.round(J*.8),M=Math.round(J*.72),fe=e.headingWeight,Me=e.headingLH>0?e.headingLH:1.2,We=e.bodyWeight>0?e.bodyWeight:400,Je=Math.min(900,We+200),qe={compact:.82,default:1,comfortable:1.16},Re=e.densityScale>0?e.densityScale/100:qe[e.density]??1,tr=Math.round(20*Re),ze=Math.round(14*Re),Tt=e.cardGapPx>0?e.cardGapPx:Math.round(16*Re),Ke=Math.round(11*Re*({compact:.66,default:1,comfortable:1.32}[e.tableDensity]??1)),_e=e.containerPadPx>0?e.containerPadPx:Math.round(10*Re),ee=e.radiusVal,ft=ee+"px",ht=Math.max(Math.round(ee*.6),2)+"px",Le=ce(i,o?.22:.14),Ne={0:"none",1:o?`0 2px 8px -1px ${Le}, 0 2px 4px 0 rgba(0,0,0,0.28)`:`0 2px 6px -1px ${Le}, 0 1px 3px 0 rgba(0,0,0,0.08)`,2:o?`0 4px 14px -2px ${Le}, 0 3px 8px 0 rgba(0,0,0,0.32)`:`0 3px 8px -2px ${Le}, 0 2px 6px 0 rgba(0,0,0,0.08)`,4:o?`0 6px 20px -3px ${Le}, 0 4px 12px 0 rgba(0,0,0,0.38)`:`0 4px 12px -2px ${Le}, 0 3px 8px 0 rgba(0,0,0,0.1)`,8:o?`0 8px 32px -4px ${Le}, 0 16px 36px 0 rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08)`:`0 6px 22px -2px ${Le}, 0 8px 24px 0 rgba(0,0,0,0.08)`},$r="1px solid rgba(255,255,255,0.06)";let gt,Xe,Bt;if(e.cardStyle==="outlined"?(gt="none",Xe="1.5px solid "+s.outline,Bt="none"):e.cardStyle==="soft"?(gt=Ne[1],Xe=o?$r:"none",Bt=Ne[1]):(gt=Ne[8],Xe=o?$r:"none",Bt=Ne[4]),e.cardShadowPx>=0){const he=ce(i,o?Math.min(.38,.12+e.cardShadowPx/80):Math.min(.24,.08+e.cardShadowPx/130));gt=`0 ${Math.round(e.cardShadowPx*.4)}px ${Math.round(e.cardShadowPx*1.3)}px ${he}, 0 ${Math.round(e.cardShadowPx*.6)}px ${Math.round(e.cardShadowPx*1.8)}px rgba(0,0,0,${o?.52:.08})`}let Rt="transparent",Ar="1px solid "+s.divider,rr="none";e.cardHeader==="plain"?Ar="none":e.cardHeader==="tinted"?Rt=s.pContainer:e.cardHeader==="accent"&&(rr="inset 3px 0 0 "+i),e.headerStrength>=0&&(e.cardHeader==="tinted"?Rt=ce(e.primaryHex,(o?.14:.08)*(e.headerStrength/100)):e.cardHeader==="accent"&&(rr="inset "+Math.round(e.headerStrength*.06)+"px 0 0 "+i)),e.cardHdrHex&&(Rt=e.cardHdrHex);const ao=o?"none":Ne[4],so=o?"1px solid "+s.divider:"none",lo=e.nestedStyle==="bordered"?"1.5px solid "+s.outline:"1px solid "+s.divider,co=e.nestedDepth>0?"inset 3px 0 0 "+ce(e.primaryHex,.55)+", 0 "+Math.round(e.nestedDepth*.4)+"px "+e.nestedDepth+"px rgba(16,24,40,"+(o?.42:.1)+")":"none",po=(e.appName||"").trim().split(/\s+/).slice(0,2).map(he=>he[0]||"").join("").toUpperCase()||"AP",uo=!!(e.logoMode==="image"&&e.logoUrl),fo=!!e.loginImage,Ir=he=>{const be=he||"Roboto";return be.includes(" ")&&!be.startsWith('"')&&!be.startsWith("'")?`"${be}"`:be},ho=Ir(e.headingFont||e.fontFamily),go=Ir(e.fontFamily),ye=wr(e.primaryHex)[0],me=(he,be)=>te((he%360+360)%360,62,o?60:46),Dr={brand:[i,a,me(ye+42),me(ye+205),me(ye+120)],categorical:[me(ye),me(ye+72),me(ye+144),me(ye+216),me(ye+288)],sequential:[te(ye,55,o?40:78),te(ye,60,o?50:64),i,te(ye,70,o?70:38),te(ye,78,o?82:26)],cbsafe:["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9"],warm:[me(8),me(28),me(45),me(350),me(18)],cool:[me(200),me(220),me(255),me(180),me(235)]},xo=Dr[e.chartScheme]||Dr.brand,mo=[r[600],t[600],te((ye+42)%360,55,46),te((ye+205)%360,50,46)],yo={error:{cb:d,cc:m},success:{cb:x,cc:u},info:{cb:f,cc:y},warning:{cb:g,cc:h}},nr=e.mapGlass==="light",bo=nr?"rgba(255,255,255,0.84)":"rgba(15,20,28,0.74)",vo=nr?"#1c2733":"#f3f6fa",So=nr?"rgba(0,0,0,0.12)":"rgba(255,255,255,0.18)",Co="repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 11px, rgba(255,255,255,0) 11px, rgba(255,255,255,0) 22px), radial-gradient(circle at 50% 38%, "+ce(i,.22)+", rgba(0,0,0,0) 60%), "+"#0f141c",wo="linear-gradient(135deg,"+i+","+r[700]+")",jo="linear-gradient(180deg,"+ce(r[900],.12)+","+ce(r[900],.55)+")",ko="linear-gradient(135deg,"+r[700]+","+r[900]+")",To="linear-gradient(135deg,"+ce(r[900],.55)+","+ce(e.primaryHex,.45)+")",Ee=e.presetId,Bo=ll[Ee]||{angle:180,colors:[te(b,32,5),te(b,32,10),te(b,32,6)]},Fr=Ie(Bo),Or=sl[Ee],Ro=Or?Or[o?"dark":"light"]:{angle:0,colors:[te(b,38,6.5)]},Eo=Ie(Ro),Ho=e.pageBgHex||(o?Fr:"#ffffff"),Po=e.pageBgHex||(o?Tn[Ee]?Ie(Tn[Ee]):Fr:s.bgDefault),$o=o?dl[Ee]||{angle:90,colors:[`color-mix(in srgb, ${e.primaryHex} 25%, black)`,`color-mix(in srgb, ${e.secondaryHex} 55%, black)`]}:cl[Ee]||{angle:90,colors:[`color-mix(in srgb, ${e.primaryHex} 45%, white)`,`color-mix(in srgb, ${e.secondaryHex} 15%, white)`]},Ao=Ie($o),Mr=pl[Ee],Io=Mr?Mr[o?"dark":"light"]:{angle:90,colors:[e.primaryHex,e.secondaryHex]},Do=Ie(Io),Wr=ul[Ee],Fo=Wr?Wr[o?"dark":"light"]:o?{angle:162,colors:[e.secondaryHex,`color-mix(in srgb, ${e.secondaryHex} 48%, black)`],stops:[11.886,91.492]}:{angle:135,colors:[e.secondaryHex,e.primaryHex]},Oo=Ie(Fo),Mo=fl[Ee]||{colors:[e.primaryHex,`color-mix(in srgb, ${e.primaryHex} 78%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 57%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 36%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 16%, ${mt})`,`color-mix(in srgb, ${e.primaryHex} 20%, ${mt})`],stops:[0,13.75,27.5,41.25,55,100]},Wo=Bn(Mo,"circle at 50% 30%"),zo=hl[Ee]||{angle:135,colors:[r[300],r[700]]},_o=Ie(zo),zr=gl[Ee]||{angle:136.6683374482933,colors:[e.secondaryHex,e.primaryHex]},Lo=Ie(zr),No=Ie({...zr,angle:165.45289138562782}),Vo="inset 0px 1px 2px 0px rgba(255,255,255,0.3)",Go={colors:[te(b,45,14),te(b,35,9),te(b,10,4)]},Uo=e.loginPanelColor||(o?Bn(Go,"ellipse 70% 65% at 50% 77%"):"#ffffff"),_r={"top-right":{top:"14px",right:"14px"},"top-center":{top:"14px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"14px",right:"14px"},"bottom-left":{bottom:"14px",left:"14px"}},Yo=_r[e.notifPosition]||_r["top-right"],Lr=e.notifAccent==="primary"?{bar:i,icbg:s.pContainer,icc:s.onPContainer,dot:i}:e.notifAccent==="mono"?{bar:s.textSecondary,icbg:s.paper2,icc:s.textPrimary,dot:s.textSecondary}:{bar:e.warningHex,icbg:g,icc:h,dot:e.warningHex};let Et;e.notifStyle==="toast"?Et={boxShadow:Ne[8],border:typeof Xe=="string"&&Xe!=="none"?Xe:"none"}:e.notifStyle==="banner"?Et={boxShadow:Ne[2],borderLeft:"4px solid "+Lr.bar}:Et={boxShadow:"none",border:"1px solid "+s.divider};const Jo=e.notifCardHex||(o?"#1e1e1e":"#ffffff"),qo={compact:"7px",default:"11px",comfortable:"16px"},Ko={compact:"6px",default:"12px",comfortable:"22px"},Xo={top:"flex-start",middle:"center",bottom:"flex-end"},Qo={left:"flex-start",center:"center",right:"flex-end"},Zo={plain:"transparent",tinted:s.paper2,accent:s.highlightSoft},ei={rowPy:qo[e.tableDensity]||"11px",cellPx:Ko[e.tableColDensity]||"12px",rowBorder:e.tableDividers?(e.tableRowDivW||1)+"px solid "+s.divider:"none",colBorder:e.tableColDividers?(e.tableColDivW||1)+"px solid "+s.divider:"none",headBg:Zo[e.tableHeaderStyle]||s.paper2,cellAI:Xo[e.tableCellAlignV]||"center",cellJC:Qo[e.tableCellAlignH]||"flex-start",stripeBg:o?"rgba(255,255,255,0.035)":"rgba(0,0,0,0.028)",statusMap:{Delivered:{sb:x,sc:u},Processing:{sb:s.pContainer,sc:o?s.pLight:s.pDark},Pending:{sb:g,sc:h},Shipped:{sb:f,sc:y}},filters:["All","Delivered","Processing","Pending"].map((he,be)=>({label:he,bg:be===0?s.highlightSoft:"transparent",c:be===0?s.textPrimary:s.textSecondary,brd:be===0?s.highlightBd:s.outline}))},ti={sm:"Small",df:"Default",lg:"Large"},ri={compact:"Compact",default:"Default",comfortable:"Comfortable"},ni={outlined:"Outlined",soft:"Soft",floating:"Floating"},oi={sharp:"Sharp",rounded:"Rounded",round:"Round"},ii=[{key:"sidebar",label:"Sidebar",desc:"Full drawer",ic:"▤"},{key:"rail",label:"Rail",desc:"Icons only",ic:"▥"},{key:"topbar",label:"Top Bar",desc:"Horizontal",ic:"▦"}],ai=e.fontFamily+" · "+(ti[e.textSize]||"Default"),si=(oi[e.radiusPreset]||"Custom")+" · "+(ri[e.density]||"Default")+" · "+(ni[e.cardStyle]||"Soft"),li=[{label:"General",ic:"◉"},{label:"Appearance",ic:"◧"},{label:"Modules",ic:"◫"},{label:"Team",ic:"◍"},{label:"Security",ic:"▣"},{label:"Billing",ic:"◳"}].map((he,be)=>({...he,on:be===1,bg:be===1?s.highlightSoft:"transparent",c:be===1?s.textPrimary:s.textSecondary,bar:be===1?"3px solid "+s.highlight:"3px solid transparent"})),ci=ii.map(he=>({...he,active:e.navPattern===he.key,brd:e.navPattern===he.key?i:s.divider,bg:e.navPattern===he.key?s.pContainer:s.paper,color:e.navPattern===he.key?s.onPContainer:s.textPrimary})),di=e.sidebarWidth,pi=e.appBarH>0?e.appBarH:56,ui=e.appBarH>0?e.appBarH+"px":"Auto (56px)";return{pal:r,spal:t,isDark:o,pMain:i,sMain:a,t:s,errSoft:d,warnSoft:g,infoSoft:f,sucSoft:x,errTxt:m,warnTxt:h,infoTxt:y,sucTxt:u,sevMap:yo,accentBg:K,btnText:Q,hc1:U,hc2:c,hc3:$,hc4:H,hc5:W,hc6:N,base:J,bodyLH:E,h1base:I,tDisplay:q,tH1:V,tH2:G,tTitle:D,tH4:C,tH5:A,tH6:F,tBody:X,tBodySm:w,tCaption:Z,tOverline:M,wH1:fe,wH2:fe,wH3:fe,wH4:fe,wH5:fe,wH6:fe,headLH:Me,bodyWeightEff:We,bwEmph:Je,pad:tr,padSm:ze,gap:Tt,rowPy:Ke,screenPad:_e,r:ee,rad:ft,radSm:ht,SH:Ne,cardShadow:gt,cardBorder:Xe,btnShadow:Bt,cardHdrBg:Rt,cardHdrBorder:Ar,cardHdrAccent:rr,appbarShadow:ao,appbarBorder:so,nestBorder:lo,nestShadow:co,iconInitials:po,hasLogo:uo,hasLoginImage:fo,headFam:ho,bodyFam:go,chartHue:ye,chartPalette:xo,avatarColors:mo,overlaySurface:bo,onOverlay:vo,overlayBorder:So,mediaBg:Co,loginBrandGrad:wo,loginScrimGrad:jo,loginCenteredGrad:ko,loginScrimGradC:To,headerBg:Eo,canvasBg:Ho,accountPageBg:Po,accountCardBg:Ao,brandGradient:Do,gsAccentGradient:Oo,gsModalBgDark:Wo,gsArrowGradient:_o,loginPanelGradient:Uo,reportsAccentTileGradient:Lo,reportsAccentCtaGradient:No,reportsModalInnerHighlight:Vo,npos:Yo,nacc:Lr,toastDeco:Et,toastBg:Jo,btnCase:e.btnCase!=="none"?"uppercase":"none",table:ei,typeSummary:ai,shapeSummary:si,settingsCats:li,navSettingsChips:ci,sidebarWidth:di,appBarHEff:pi,appBarHLabel:ui}}function xl({icon:e,title:r,info:t,open:o,dimmed:i,onToggle:a,onPreviewMenu:s,children:l}){const d=_(v=>v.settings),g=d.mode==="dark",f=d.primaryHex||"#4F6BFF",x=Pe(d.mode),m=Se(f),h=Hr(d),y=o?g?ce(f,.22):ce(f,.1):"transparent",u=o?g?m[200]:m[700]:x.text,b=o?f:x.chevron;return n.jsxs(p.Box,{sx:{background:y,opacity:i?.3:1,transform:o?"translateY(-2px)":"none",transition:"opacity .22s ease, transform .22s ease",borderBottom:`1px solid ${x.divider}`,overflow:"hidden"},children:[n.jsxs(p.Box,{component:"button",onClick:a,sx:{width:"100%",display:"flex",alignItems:"center",gap:"9px",p:"7px 11px",background:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},children:[n.jsx(p.Box,{sx:{width:32,height:32,borderRadius:"10px",background:x.iconTile,color:x.body,display:"grid",placeItems:"center",flexShrink:0,position:"relative"},children:e}),n.jsx(p.Box,{sx:{flex:1,minWidth:0},children:n.jsx(p.Box,{sx:{fontSize:`${h.tH5}px`,fontWeight:h.wH5,fontFamily:`${h.headFam},sans-serif`,lineHeight:1.25,color:u,letterSpacing:"-.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),s&&n.jsx(p.Box,{component:"span",title:"Change preview screen",onClick:v=>{v.stopPropagation(),s()},sx:{width:16,height:16,mr:"6px",flexShrink:0,cursor:"pointer",display:"grid",placeItems:"center",color:x.chevron,transition:"filter .15s ease, transform .1s ease","&:hover":{filter:"brightness(1.15)",transform:"scale(1.12)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("path",{d:"M8 21h8M12 17v4"})]})}),t&&n.jsx(p.Box,{component:"span",title:t,sx:{width:15,height:15,borderRadius:"50%",border:`1.2px solid ${x.chevron}`,color:x.chevron,fontSize:"9px",fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"grid",placeItems:"center",mr:"7px",flexShrink:0,cursor:"help"},children:"i"}),n.jsx(p.Box,{sx:{width:20,height:20,borderRadius:"6px",display:"grid",placeItems:"center",fontSize:"9px",color:b,flexShrink:0,transition:"background .18s, border-color .18s"},children:n.jsx(p.Box,{component:"span",sx:{display:"block",lineHeight:1,transform:o?"rotate(180deg)":"none",transition:"transform .2s"},children:"▼"})})]}),n.jsx(p.Collapse,{in:o,unmountOnExit:!0,timeout:280,children:n.jsx(p.Box,{sx:{p:"2px 13px 12px",borderTop:`1px solid ${x.divider}`},children:l})})]})}function ve(){const e=_(r=>r.settings);return z.useMemo(()=>Hr(e),[e])}function ot({tabs:e,active:r,onChange:t}){const o=_(m=>m.settings.mode),i=_(m=>m.settings.primaryHex)||"#4F6BFF",a=_(m=>m.settings.highlightHex)||"#ffd400",s=_(m=>m.settings.bodyWeight)||400,l=o==="dark",d=Math.min(900,s+200),g=ve(),f=l?"#e6edf3":"#1c2127",x=l?"#cdd4de":"#5a6573";return n.jsx(p.Box,{sx:{display:"flex",gap:"2px",mb:"2px",px:"2px",borderBottom:"1.5px solid rgba(120,130,145,0.5)"},children:e.map(m=>{const h=m.key===r,y=n.jsx(p.Button,{onClick:()=>t(m.key),disableRipple:!0,sx:{flex:1,minWidth:0,px:"2px",pt:"9px",pb:"8px",minHeight:44,borderRadius:"6px 6px 0 0",mb:"-1px",fontSize:`${g.tBodySm}px`,fontFamily:`${g.headFam},sans-serif`,fontWeight:h?d:s,letterSpacing:0,textTransform:"none",whiteSpace:"normal",lineHeight:1.15,textAlign:"center",color:h?f:x,opacity:h?1:.3,bgcolor:h?ce(a,l?.26:.18):"transparent",borderBottom:h?`3px solid ${i}`:"2px solid transparent",transition:"color .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease","&:hover":h?{bgcolor:ce(a,l?.26:.18)}:{opacity:1,bgcolor:"rgba(150,160,175,0.35)",borderRadius:"8px",boxShadow:"0 6px 18px rgba(0,0,0,0.35)",transform:"translateY(-2px)"}},children:m.label},m.key);return m.info?n.jsx(p.Tooltip,{title:m.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:y},m.key):y})})}function ml(){var G,D;const[e,r]=z.useState("presets"),t=_(C=>C.settings),o=t.mode==="dark",i=t.highlightHex||"#ffd400",a=ce(i,o?.3:.18),s=o?"#e6edf3":"#1c2127",l=o?"rgba(255,255,255,0.82)":"#2c333d",d=_(C=>C.savedThemes),g=_(C=>C.applyPreset),f=_(C=>C.applySaved),x=_(C=>C.saveTheme),m=_(C=>C.updateSaved),h=_(C=>C.renameSaved),y=_(C=>C.deleteSaved),u=_(C=>C.importTheme),b=_(C=>C.set),v=_(C=>C.isDirty),k=_(C=>C.editingSavedId),B=_(C=>C.lastImportedId),S=d.find(C=>C.id===k),j=(C,A)=>{const F=new Blob([JSON.stringify({name:C,snap:A},null,2)],{type:"application/json"}),X=URL.createObjectURL(F),w=document.createElement("a");w.href=X,w.download=`${C.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}.theme.json`,w.click(),URL.revokeObjectURL(X)},[R,O]=z.useState("");z.useEffect(()=>{if(!R)return;const C=setTimeout(()=>O(""),5e3);return()=>clearTimeout(C)},[R]);const[P,K]=z.useState(null),Q=C=>{const A=d.map(w=>w.name.toLowerCase());let F=C,X=2;for(;A.includes(F.toLowerCase());)F=`${C} ${X++}`;return F},U=C=>{var X;const A=(X=C.target.files)==null?void 0:X[0];if(!A)return;const F=new FileReader;F.onload=()=>{try{const w=JSON.parse(F.result),Z=w.snap??w;if(!al(Z)){O("Invalid theme file. The selected file is not a valid Theme Studio export.");return}const M=w.name||"Imported Theme";if(d.some(fe=>fe.name.toLowerCase()===M.toLowerCase())){K({name:M,snap:Z});return}O(""),u(M,Z)}catch{O("Invalid theme file. The selected file is not a valid Theme Studio export.")}},F.readAsText(A),C.target.value=""},[c,$]=z.useState(null),[H,W]=z.useState(!1),[N,Y]=z.useState(""),[L,J]=z.useState(null),[E,I]=z.useState(null),q=(S==null?void 0:S.name)||((G=Ct.find(C=>C.id===t.presetId))==null?void 0:G.name)||((D=d.find(C=>C.id===t.presetId))==null?void 0:D.name)||"Custom Theme",V=(C,A)=>{const F=C.trim();return F?d.some(X=>X.name.toLowerCase()===F.toLowerCase()&&X.id!==A)?"Name already exists":"":"Name required"};return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"presets",label:"Presets",info:"Ready-made colour themes."},{key:"saved",label:"My Themes",info:"Your saved custom themes."},{key:"mode",label:"Mode",info:"Light / Dark."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="presets"&&n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:Ct.map(C=>{const A=t.presetId===C.id;return n.jsxs(p.Box,{onClick:()=>g(C.id,C.snap),title:`${C.name} — applies this colour palette`,sx:{display:"flex",alignItems:"center",gap:"9px",p:"9px 10px",borderRadius:"11px",cursor:"pointer",textAlign:"left",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?a:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:C.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:C.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{fontSize:"11px",fontWeight:600,color:A?s:l,lineHeight:1.3},children:C.name})]},C.id)})}),e==="saved"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[d.length===0&&n.jsx(p.Typography,{variant:"caption",sx:{color:"text.secondary",py:2,textAlign:"center"},children:"No saved themes yet."}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:.9},children:d.map(C=>{const A=k===C.id;return n.jsxs(p.Box,{onClick:()=>f(C),title:"Apply this saved theme",sx:{display:"flex",flexDirection:"column",gap:.9,p:"9px 10px",borderRadius:"11px",cursor:"pointer",position:"relative",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?a:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[A&&B===C.id&&n.jsx(p.Tooltip,{title:"recently upload",arrow:!0,children:n.jsx(p.Box,{component:"span",sx:{position:"absolute",top:-2,right:0,width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:C.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:C.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:"11px",fontWeight:600,color:A?s:l,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},children:C.name}),n.jsx(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n.jsx(p.Box,{component:"span",onClick:F=>{F.stopPropagation(),$({el:F.currentTarget,id:C.id})},sx:{cursor:"pointer",color:"text.muted",px:.5},children:"⋮"})})]})]},C.id)})}),R&&n.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,bgcolor:"rgba(211,47,47,0.08)",border:"1px solid rgba(211,47,47,0.35)",borderRadius:"10px",px:1.5,py:1.25,color:"#b3261e"},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:15,lineHeight:1.4},children:"!"}),n.jsx(p.Box,{sx:{fontSize:12.5,lineHeight:1.4},children:R})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1,mt:1},children:[n.jsxs(p.Button,{size:"small",variant:"outlined",component:"label",sx:{flex:1,textTransform:"none"},children:["↑ Import",n.jsx("input",{hidden:!0,type:"file",accept:".json,application/json",onChange:U})]}),n.jsx(p.Button,{size:"small",variant:"outlined",onClick:()=>j(q,t),sx:{flex:1,textTransform:"none"},children:"⤓ Download"}),n.jsx(p.Button,{size:"small",variant:"contained",disabled:!v(),onClick:()=>{Y(S?S.name:""),W(!0)},sx:{flex:1,textTransform:"none"},children:"+ Save"})]})]}),e==="mode"&&n.jsx(p.Box,{sx:{display:"flex",gap:1},children:["light","dark"].map(C=>n.jsx(p.Button,{onClick:()=>b({mode:C}),variant:t.mode===C?"contained":"outlined",sx:{flex:1,textTransform:"capitalize"},children:C},C))})]}),n.jsxs(p.Menu,{open:!!c,anchorEl:c==null?void 0:c.el,onClose:()=>$(null),children:[n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);f(C),$(null)},children:"✏️ Edit"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);J({id:C.id,name:C.name}),$(null)},children:"✎ Rename"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);I({id:C.id,name:C.name}),$(null)},children:"🗑 Delete"}),n.jsx(p.MenuItem,{onClick:()=>{const C=d.find(A=>A.id===c.id);j(C.name,C.snap),$(null)},children:"⤓ Download"})]}),n.jsxs(p.Dialog,{open:H,onClose:()=>W(!1),children:[n.jsx(p.DialogTitle,{children:S?`Save changes to “${S.name}”`:"Save theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"Theme name",value:N,onChange:C=>Y(C.target.value),error:!!V(N,S==null?void 0:S.id),helperText:V(N,S==null?void 0:S.id),sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>W(!1),children:"Cancel"}),S&&n.jsx(p.Button,{variant:"contained",disabled:!!V(N,S.id),onClick:()=>{m(S.id,N.trim(),t),W(!1)},children:"Update"}),n.jsx(p.Button,{variant:S?"outlined":"contained",disabled:!!V(N),onClick:()=>{x(N.trim()),W(!1)},children:S?"Save as New":"Save"})]})]}),n.jsxs(p.Dialog,{open:!!L,onClose:()=>J(null),children:[n.jsx(p.DialogTitle,{children:"Rename theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"New name",value:(L==null?void 0:L.name)??"",onChange:C=>J(A=>A&&{...A,name:C.target.value}),error:!!(L&&V(L.name,L.id)),helperText:L?V(L.name,L.id):"",sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>J(null),children:"Cancel"}),n.jsx(p.Button,{variant:"contained",disabled:!!(L&&V(L.name,L.id)),onClick:()=>{h(L.id,L.name.trim()),J(null)},children:"Rename"})]})]}),n.jsxs(p.Dialog,{open:!!P,onClose:()=>K(null),children:[n.jsx(p.DialogTitle,{children:"Theme already exists"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["A theme named “",P==null?void 0:P.name,"” is already in My Themes. Upload it anyway as a copy?"]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>{K(null),O("You’ve selected a duplicate file — it already exists.")},children:"Cancel"}),n.jsx(p.Button,{variant:"contained",onClick:()=>{u(Q(P.name),P.snap),K(null)},children:"Yes, continue"})]})]}),n.jsxs(p.Dialog,{open:!!E,onClose:()=>I(null),children:[n.jsx(p.DialogTitle,{children:"Delete theme"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["Delete “",E==null?void 0:E.name,"”? This cannot be undone."]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>I(null),children:"Cancel"}),n.jsx(p.Button,{color:"error",variant:"contained",onClick:()=>{y(E.id),I(null)},children:"Delete"})]})]})]})}function yl({tip:e,sk:r}){return n.jsx(p.Box,{component:"span",title:e,sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${r.chevron}`,color:r.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",flexShrink:0,cursor:"help",verticalAlign:"middle"},children:"i"})}function Ze({children:e,tip:r,sk:t,mt:o}){const i=ve();return n.jsxs(p.Box,{sx:{fontSize:`${i.tCaption}px`,fontWeight:i.bwEmph,fontFamily:`${i.bodyFam},sans-serif`,color:t.label2,textTransform:"uppercase",letterSpacing:".5px",mb:"6px",mt:o?`${o}px`:0,display:"flex",alignItems:"center",gap:"5px"},children:[e,r&&n.jsx(yl,{tip:r,sk:t})]})}function dt({value:e,onChange:r,w:t=30,h:o=24,r:i=7,border:a,sk:s}){return n.jsx(p.Box,{sx:{width:t,height:o,borderRadius:`${i}px`,position:"relative",overflow:"hidden",flexShrink:0,background:e,border:a?`1px solid ${s.insetBd}`:"none"},children:n.jsx(p.Box,{component:"input",type:"color",value:e,onChange:l=>r(l.target.value),sx:{position:"absolute",top:-4,left:-4,width:t+10,height:o+10,opacity:0,cursor:"pointer",border:"none",p:0}})})}const bl=/^#[0-9a-fA-F]{6}$/;function vl({value:e,onCommit:r,onWarnChange:t}){const[o,i]=z.useState(!1),[a,s]=z.useState(e),[l,d]=z.useState(""),g=z.useRef(void 0);z.useEffect(()=>{o||s(e)},[e,o]),z.useEffect(()=>()=>clearTimeout(g.current),[]);const f=m=>{clearTimeout(g.current),d(m),t==null||t(m),m&&(g.current=setTimeout(()=>{d(""),t==null||t("")},3e3))},x=m=>{const h=m.trim();return bl.test(h)?(f(""),r(h),!0):(f("Enter a valid hex colour, e.g. #4F6BFF"),!1)};return o?n.jsx(p.InputBase,{autoFocus:!0,value:a,title:l||void 0,onChange:m=>{s(m.target.value)},onBlur:()=>{x(a)||s(e),i(!1)},onKeyDown:m=>{m.key==="Enter"&&x(a)&&i(!1),m.key==="Escape"&&(s(e),f(""),i(!1))},sx:{color:l?"#ffcdd2":"#fff",fontSize:"12.5px",fontWeight:700,width:100,position:"relative",zIndex:1}}):n.jsxs(p.Box,{component:"span",title:l||void 0,onClick:()=>{s(e),i(!0)},sx:{color:l?"#ffcdd2":"rgba(255,255,255,.85)",fontSize:"12.5px",fontWeight:700,cursor:"text",position:"relative",zIndex:1},children:[e," · tap to change"]})}function Sl(){const[e,r]=z.useState("brand"),[t,o]=z.useState(""),i=_(v=>v.settings),a=_(v=>v.set),s=Pe(i.mode),l=ve(),d={fontSize:"11.5px",color:s.body,fontWeight:600},g={fontSize:`${l.tBodySm}px`,color:s.body,fontWeight:l.bodyWeightEff,fontFamily:`${l.bodyFam},sans-serif`,lineHeight:l.bodyLH},f=i.primaryHex||"#4F6BFF",x=Se(f),m=[50,100,200,300,400,500,600,700,800,900].map(v=>x[v]),h=v=>a({...v,presetId:"custom"}),y=[{key:"h1Color",label:"H1 · Page Title"},{key:"h2Color",label:"H2 · Metric"},{key:"h3Color",label:"H3 · Card Title"},{key:"h4Color",label:"H4 · Section Label"},{key:"h5Color",label:"H5 · Caption"},{key:"h6Color",label:"H6 · Overline"}],u=[{key:"successHex",label:"Success"},{key:"warningHex",label:"Warning"},{key:"infoHex",label:"Info"},{key:"errorHex",label:"Error"}],b=[{key:"cardBgHex",label:"Card background",fb:"#ffffff"},{key:"cardHdrHex",label:"Card header",fb:"#f6f8fb"},{key:"pageBgHex",label:"Page background",fb:"#f4f6f9"},{key:"notifCardHex",label:"Notification background",fb:"#ffffff"}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"brand",label:"Brand",info:"Core brand colours — primary, secondary and the selection highlight colour used across the app."},{key:"text",label:"Text",info:"Heading and body text colours"},{key:"status",label:"Status",info:"Status colours & surface overrides"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px",display:"flex",flexDirection:"column",gap:"11px"},children:[e==="brand"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Primary brand colour — main/filled buttons, active sidebar item, links, focus rings, first chart series, and the login Sign-in button.",children:"Brand Color"}),n.jsxs(p.Box,{sx:{position:"relative",height:46,borderRadius:"11px",background:f,overflow:"hidden",display:"flex",alignItems:"center",px:"14px",boxShadow:`0 3px 10px ${f}44`},children:[n.jsx(vl,{value:f,onCommit:v=>h({primaryHex:v}),onWarnChange:o}),n.jsx(p.Box,{component:"input",type:"color",value:f,onChange:v=>h({primaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})]}),n.jsx(p.Box,{sx:{display:"flex",gap:"2px",borderRadius:"7px",overflow:"hidden",height:14,mt:"7px"},children:m.map((v,k)=>n.jsx(p.Box,{sx:{flex:1,background:v}},k))}),t&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:l.warnSoft,border:`1px solid ${l.warnTxt}`,color:l.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),t]})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Secondary accent — secondary/outlined buttons, switches & toggles, selected chips, and the second data series in charts.",children:"Secondary / Accent"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"9px",background:i.secondaryHex,overflow:"hidden"},children:n.jsx(p.Box,{component:"input",type:"color",value:i.secondaryHex,onChange:v=>h({secondaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Accent colour used to draw attention — highlight panels, featured badges, callouts. Defaults to the brand colour.",children:"Highlight Colour"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"8px",background:i.highlightHex||i.primaryHex,overflow:"hidden",border:`1px solid ${s.insetBd}`},children:n.jsx(p.Box,{component:"input",type:"color",value:i.highlightHex||i.primaryHex,onChange:v=>h({highlightHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]})]}),e==="text"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(Ze,{sk:s,children:"Heading Text Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:y.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i[v.key]||"#1c2127",onChange:k=>a({[v.key]:k})}),n.jsx(p.Box,{component:"span",sx:g,children:v.label})]},v.key))}),n.jsx(Ze,{sk:s,children:"Body Text Colors"}),n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.textPrimaryHex||"#1c2127",onChange:v=>a({textPrimaryHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Main body text colour.",children:"Primary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.textSecondaryHex||"#5a6573",onChange:v=>a({textSecondaryHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Muted text colour.",children:"Secondary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(dt,{sk:s,border:!0,value:i.dividerHex||"#e3e8ee",onChange:v=>a({dividerHex:v})}),n.jsx(p.Box,{component:"span",sx:d,title:"Divider / border colour.",children:"Divider"})]})]})]}),e==="status"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"7px"},children:[n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Success, warning, error & info colours — used for alerts, status pills, toasts and validation states.",children:"Status Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:u.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:s.card,border:`1px solid ${s.insetBd}`,borderRadius:"9px",px:"9px",py:"7px"},children:[n.jsx(dt,{sk:s,w:22,h:22,r:6,value:i[v.key],onChange:k=>a({[v.key]:k})}),n.jsx(p.Box,{component:"span",sx:d,children:v.label})]},v.key))})]}),n.jsxs(p.Box,{children:[n.jsx(Ze,{sk:s,tip:"Override the auto-generated surface colours. Leave on Auto to follow the surface tint & mode.",children:"Surfaces"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:b.map(v=>{const k=!!i[v.key];return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:s.card,border:`1px solid ${s.insetBd}`,borderRadius:"9px",px:"9px",py:"5px"},children:[n.jsx(dt,{sk:s,w:22,h:22,r:6,border:!0,value:i[v.key]||v.fb,onChange:B=>a({[v.key]:B})}),n.jsx(p.Box,{component:"span",sx:{...d,flex:1},children:v.label}),k&&n.jsx(p.Box,{component:"button",title:"Reset to Auto",onClick:()=>a({[v.key]:""}),sx:{background:"transparent",border:`1px solid ${s.insetBd}`,borderRadius:"6px",color:s.muted,fontSize:"10px",fontWeight:700,px:"7px",py:"3px",cursor:"pointer"},children:"Auto"})]},v.key)})})]})]})]})]})}function xe(e){const{label:r,info:t,value:o,effective:i,min:a,max:s,step:l=1,unit:d="",autoLabel:g,autoValue:f=0,softMin:x,softMax:m,floorValue:h,floorReset:y,floorMessage:u,extra:b,onChange:v}=e,k=Pe(_(Y=>Y.settings.mode)),B=ve(),S=`${B.bodyFam},sans-serif`,[j,R]=z.useState(!1),[O,P]=z.useState(String(i)),[K,Q]=z.useState(""),U=z.useRef(void 0);z.useEffect(()=>{j||P(String(i))},[i,j]),z.useEffect(()=>()=>clearTimeout(U.current),[]);const c=Y=>{clearTimeout(U.current),Q(Y),Y&&(U.current=setTimeout(()=>Q(""),3e3))},$=Y=>x!=null&&Y<x?`Below ${x}${d} may break the UI`:m!=null&&Y>m?`Above ${m}${d} may break the UI`:"",H=()=>{c(u??`Minimum is ${y}${d} — reset`),v(y),P(String(y))},W=Y=>{const L=parseFloat(Y);if(isNaN(L)){c("Enter a number"),P(String(i));return}if(h!=null&&y!=null&&L<=h){H();return}const J=Math.min(s,Math.max(a,L));c(J!==L?`Must be between ${a}${d} and ${s}${d} — clamped to ${J}${d}`:$(J)),P(String(J)),v(J)},N=o===f&&g?g:`${i}${d}`;return n.jsxs(p.Box,{sx:{mb:1.5},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:"8px"},children:[n.jsxs(p.Typography,{sx:{fontSize:`${B.tBodySm}px`,fontWeight:B.bwEmph,fontFamily:S,lineHeight:B.bodyLH,color:k.label2,display:"flex",alignItems:"center",gap:"5px"},children:[r,t&&n.jsx(p.Tooltip,{title:t,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${k.chevron}`,color:k.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"5px",flexShrink:0},children:[j?n.jsx(p.InputBase,{autoFocus:!0,value:O,onChange:Y=>P(Y.target.value),onBlur:()=>{W(O),R(!1)},onKeyDown:Y=>{Y.key==="Enter"&&(W(O),R(!1)),Y.key==="Escape"&&R(!1)},sx:{width:56,fontSize:`${B.tBodySm}px`,fontWeight:700,fontFamily:S,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsxs(p.Box,{component:"button",onClick:()=>{P(String(i)),R(!0)},sx:{display:"inline-flex",alignItems:"center",gap:"5px",fontFamily:S,fontSize:`${B.tBodySm}px`,fontWeight:800,color:k.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"7px",py:"2px",cursor:"pointer",lineHeight:1.3,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:[N,n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",flexShrink:0},children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]})]}),b]})]}),n.jsx(p.Box,{component:"input",type:"range",min:a,max:s,step:l,value:i,onChange:Y=>{const L=parseFloat(Y.target.value);if(h!=null&&y!=null&&L<=h){H();return}c($(L)),v(L)},sx:{WebkitAppearance:"none",appearance:"none",width:"100%",height:"4px",m:0,p:0,display:"block",borderRadius:"2px",outline:"none",cursor:"pointer",background:"#dde3ea",accentColor:"primary.main","&::-webkit-slider-thumb":{WebkitAppearance:"none",width:18,height:18,borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"},"&::-moz-range-thumb":{width:18,height:18,border:"none",borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"}}}),K&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:B.warnSoft,border:`1px solid ${B.warnTxt}`,color:B.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),K]})]})}const Rn=new Set;function oo(e,r){if(Rn.has(e))return;Rn.add(e);const t=document.createElement("style");t.textContent=`@font-face{font-family:'${e}';src:url('${r}');font-display:swap;}`,document.head.appendChild(t)}function En(e){e.forEach(r=>oo(r.name,r.dataUrl))}const Cl=[{key:"Roboto",label:"Roboto",sub:"Material"},{key:"Inter",label:"Inter",sub:"Enterprise"},{key:"DM Sans",label:"DM Sans",sub:"Modern"},{key:"Manrope",label:"Manrope",sub:"Geometric"},{key:"Plus Jakarta Sans",label:"Jakarta",sub:"Friendly"},{key:"Nunito Sans",label:"Nunito",sub:"Rounded"}],wl=[{key:"Figtree",label:"Google Sans"},{key:"Roboto",label:"Roboto"},{key:"Inter",label:"Inter"},{key:"Arial",label:"Arial"},{key:"Manrope",label:"Manrope"},{key:"Plus Jakarta Sans",label:"Jakarta"}];function It({label:e,fam:r,active:t,onClick:o,onDelete:i}){const a=_(x=>x.settings.mode),s=_(x=>x.settings.primaryHex)||"#4F6BFF",l=_(x=>x.settings.highlightHex)||"#ffd400",d=a==="dark",g=Se(s),f=ce(l,d?.3:.18);return n.jsxs(p.Box,{onClick:o,sx:{position:"relative",py:"17px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",border:`1px solid ${t?d?g[400]:s:d?"#363d48":"#e3e8ee"}`,bgcolor:t?f:d?"#262b34":"#ffffff",transition:"all .14s ease","&:hover":t?{}:{borderColor:d?"#4a5361":"#c9d0d9"}},children:[n.jsx(p.Box,{sx:{fontFamily:`${r}, sans-serif`,fontSize:13,fontWeight:700,lineHeight:1,color:t?d?g[200]:g[700]:d?"#aeb6c0":"#5a6573"},children:e}),i&&n.jsx(p.Box,{component:"span",title:`Remove custom font ${e}`,onClick:x=>{x.stopPropagation(),i()},sx:{position:"absolute",top:4,right:4,width:17,height:17,borderRadius:"50%",display:"grid",placeItems:"center",fontSize:10,fontWeight:800,color:d?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.5)",bgcolor:d?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)",cursor:"pointer",transition:"all .12s ease","&:hover":{bgcolor:"error.main",color:"#ffffff"}},children:"✕"})]})}const jl=["woff2","woff","ttf","otf"],kl=10*1024*1024,Tl=e=>new Promise((r,t)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>t(o.error),o.readAsDataURL(e)}),Bl=e=>new Promise(r=>{const t=setTimeout(()=>r(!1),5e3),o=new FileReader;o.onload=()=>{var s;clearTimeout(t);const i=new Uint8Array(o.result),a=((s=e.name.split(".").pop())==null?void 0:s.toLowerCase())||"";if(a==="woff2"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===50||a==="woff"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===70||a==="otf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79||a==="ttf"&&i[0]===0&&i[1]===1&&i[2]===0&&i[3]===0||a==="ttf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79)return r(!0);r(!1)},o.onerror=()=>{clearTimeout(t),r(!1)};try{o.readAsArrayBuffer(e.slice(0,4))}catch{clearTimeout(t),r(!1)}});function Hn({label:e,list:r,onAdd:t}){const o=Pe(_(f=>f.settings.mode)),i=ve(),[a,s]=z.useState(""),l=z.useRef(void 0);z.useEffect(()=>()=>clearTimeout(l.current),[]);const d=f=>{clearTimeout(l.current),s(f),f&&(l.current=setTimeout(()=>s(""),8e3))},g=async f=>{var k;const x=Array.from(f.target.files??[]);if(f.target.value="",!x.length)return;const m=[],h=[],y=[],u=[],b=[];for(const B of x){const S=((k=B.name.split(".").pop())==null?void 0:k.toLowerCase())||"";if(!jl.includes(S)){y.push(B.name);continue}if(B.size>kl){u.push(B.name);continue}if(!await Bl(B)){b.push(B.name);continue}const j=B.name.replace(/\.[^.]+$/,""),R=P=>P.toLowerCase()===j.toLowerCase();if(r.some(P=>R(P.name))||m.some(P=>R(P.name))){h.push(j);continue}const O=await Tl(B);oo(j,O),m.push({name:j,dataUrl:O})}m.length&&t(m);const v=[];h.length&&v.push(`Already added: ${h.join(", ")}`),y.length&&v.push(`Unsupported file type: ${y.join(", ")}`),u.length&&v.push(`Too large (max 10MB): ${u.join(", ")}`),b.length&&v.push(`Invalid font file: ${b.join(", ")}`),d(v.join(" · "))};return n.jsxs(p.Box,{sx:{mt:1.5},children:[n.jsxs(p.Box,{component:"label",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.75,bgcolor:o.inset,border:`1.5px dashed ${o.insetBd}`,borderRadius:"9px",p:1.5,cursor:"pointer",color:o.body,fontSize:11.5,fontWeight:600,fontFamily:`${i.bodyFam},sans-serif`,textAlign:"center"},children:["⬆ ",e,n.jsx(p.Box,{component:"span",sx:{color:o.muted},children:".woff2 / .ttf / .otf"}),n.jsx("input",{type:"file",accept:".woff2,.woff,.ttf,.otf",multiple:!0,onChange:g,style:{display:"none"}})]}),a&&n.jsxs(p.Box,{sx:{mt:.9,display:"flex",alignItems:"center",justifyContent:"space-between",gap:.9,bgcolor:"error.main",borderRadius:2,px:1.4,py:.9,color:"error.contrastText",fontFamily:`${i.bodyFam},sans-serif`},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.9},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:12},children:"✕"}),n.jsx(p.Box,{component:"span",sx:{fontSize:11.5},children:a})]}),n.jsx(p.Box,{component:"span",title:"Dismiss",onClick:()=>s(""),sx:{cursor:"pointer",fontSize:11,fontWeight:700,px:.5,opacity:.8,"&:hover":{opacity:1}},children:"✕"})]})]})}const Rl={compact:1.15,default:1.25,airy:1.414};function El(){const e=_(f=>f.settings),r=_(f=>f.set),t=Pe(e.mode),o=ve(),[i,a]=z.useState(!1),s=e.scaleRatioCustom>0?e.scaleRatioCustom:Rl[e.scaleRatio]??1.25,[l,d]=z.useState(s.toFixed(2));z.useEffect(()=>{i||d(s.toFixed(2))},[s,i]);const g=()=>{const f=parseFloat(l);isNaN(f)||r({scaleRatioCustom:f}),a(!1)};return i?n.jsx(p.InputBase,{autoFocus:!0,value:l,onChange:f=>d(f.target.value),onBlur:g,onKeyDown:f=>{f.key==="Enter"&&g(),f.key==="Escape"&&a(!1)},sx:{width:56,fontSize:"11.5px",fontWeight:700,fontFamily:`${o.bodyFam},sans-serif`,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsx(p.Box,{component:"button",title:"Configure scale ratio — each heading is the one above ÷ this value",onClick:()=>{d(s.toFixed(2)),a(!0)},sx:{display:"inline-grid",placeItems:"center",color:t.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"6px",py:"3px",cursor:"pointer",fontFamily:`${o.bodyFam},sans-serif`,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})}function Hl(){const[e,r]=z.useState("bodyFont"),t=_(a=>a.settings),o=_(a=>a.set),i=_(a=>a.deleteCustomFont);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"bodyFont",label:"Body Font",info:"Typeface used for body / paragraph text (headings use the Heading Font)"},{key:"headFont",label:"Heading Font",info:"Choose a separate typeface for headings (or match the body font)"},{key:"headText",label:"Heading Text",info:"Fine-tune size & weight per heading level (H1–H4)"},{key:"bodyText",label:"Body Text",info:"Adjust base font size and line height for body copy"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="bodyFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[Cl.map(a=>n.jsx(It,{label:a.label,sub:a.sub,fam:a.key,active:t.fontFamily===a.key,onClick:()=>o({fontFamily:a.key})},a.key)),t.customFonts.map(a=>n.jsx(It,{label:a.name,sub:"Custom",fam:a.name,active:t.fontFamily===a.name,onClick:()=>o({fontFamily:a.name}),onDelete:()=>i(a.name,!1)},a.name))]}),n.jsx(Hn,{label:"Upload custom font",list:t.customFonts,onAdd:a=>o({customFonts:[...a,...t.customFonts],fontFamily:a[0].name})})]}),e==="headFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[wl.map(a=>n.jsx(It,{label:a.label,fam:a.key,active:t.headingFont===a.key,onClick:()=>o({headingFont:a.key})},a.key)),t.customHeadFonts.map(a=>n.jsx(It,{label:a.name,sub:"Custom",fam:a.name,active:t.headingFont===a.name,onClick:()=>o({headingFont:a.name}),onDelete:()=>i(a.name,!0)},a.name))]}),n.jsx(Hn,{label:"Upload heading font",list:t.customHeadFonts,onAdd:a=>o({customHeadFonts:[...a,...t.customHeadFonts],headingFont:a[0].name})})]}),e==="headText"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"H1 size",info:"All heading levels scale from H1 by a modular ratio (configurable via the gear icon).",value:t.h1Size,effective:t.h1Size||20,min:18,max:56,unit:"px",extra:n.jsx(El,{}),onChange:a=>o({h1Size:a})}),n.jsx(xe,{label:"Weight (all headings)",value:t.headingWeight,effective:t.headingWeight,min:300,max:900,step:100,onChange:a=>o({headingWeight:a})}),n.jsx(xe,{label:"Line height (all headings)",value:t.headingLH,effective:t.headingLH||1.2,min:.9,max:2,step:.05,autoLabel:"Auto (1.20)",onChange:a=>o({headingLH:a})})]}),e==="bodyText"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Base font size",info:"Root body text size.",value:t.baseFontPx,effective:t.baseFontPx||12,min:9,max:20,unit:"px",softMin:9,onChange:a=>o({baseFontPx:a})}),n.jsx(xe,{label:"Body weight",value:t.bodyWeight,effective:t.bodyWeight||400,min:300,max:900,step:100,autoLabel:"Auto (400)",onChange:a=>o({bodyWeight:a})}),n.jsx(xe,{label:"Body line height",value:t.bodyLineHeight,effective:t.bodyLineHeight||1.5,min:1.2,max:2,step:.05,autoLabel:"Auto (1.50)",onChange:a=>o({bodyLineHeight:a})})]})]})]})}function je({options:e,value:r,columns:t=3,onChange:o}){const i=_(v=>v.settings.mode),a=_(v=>v.settings.primaryHex)||"#4F6BFF",s=_(v=>v.settings.highlightHex)||"#ffd400",l=i==="dark",d=Se(a),g=ve(),f=`${g.bodyFam},sans-serif`,x=ce(s,l?.3:.18),m=l?d[400]:a,h=l?d[200]:d[700],y=l?"#262b34":"#ffffff",u=l?"#363d48":"#e3e8ee",b=l?"#aeb6c0":"#5a6573";return n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"6px"},children:e.map(v=>{const k=v.key===r,B=n.jsx(p.Box,{onClick:()=>o(v.key),sx:{py:"9px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",userSelect:"none",fontSize:`${g.tCaption}px`,fontWeight:k?g.bwEmph:g.bodyWeightEff,fontFamily:f,border:`1px solid ${k?m:u}`,bgcolor:k?x:y,color:k?h:b,transition:"color .14s ease, background .14s ease, border-color .14s ease","&:hover":k?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:v.label},v.key);return v.info?n.jsx(p.Tooltip,{title:v.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:B},v.key):B})})}const Dt={outlined:0,soft:6,floating:24},Ft={plain:0,tinted:40,accent:60},Pl={bordered:0,recessed:6,lighter:4};function $l(){const[e,r]=z.useState("style"),t=_(d=>d.settings),o=_(d=>d.set),i=t.cardShadowPx>=0?t.cardShadowPx:Dt[t.cardStyle]??24,a=t.headerStrength>=0?t.headerStrength:Ft[t.cardHeader]??45,s=t.nestedDepth>=0?t.nestedDepth:Pl[t.nestedStyle]??6,l=t.tintIntensity>=0?t.tintIntensity:100;return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"style",label:"Style",info:"Card border vs shadow depth."},{key:"header",label:"Header",info:"Card header treatment."},{key:"nested",label:"Nested",info:"How cards-within-cards look."},{key:"tint",label:"Tint",info:"Overall surface tint colour & strength."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="style"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardStyle,onChange:d=>{const g=d;o({cardStyle:g,cardShadowPx:Dt[g]})},options:[{key:"outlined",label:"Outlined"},{key:"soft",label:"Soft"},{key:"floating",label:"Floating"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Shadow depth",info:"Card elevation (px).",value:t.cardShadowPx,effective:i,min:0,max:32,unit:"px",autoValue:-1,autoLabel:`Auto (${i}px)`,softMin:t.cardStyle==="outlined"?void 0:1,softMax:32,floorValue:t.cardStyle==="outlined"?void 0:0,floorReset:Dt[t.cardStyle],floorMessage:`${t.cardStyle==="soft"?"Soft":"Floating"} cards need shadow - reset to ${Dt[t.cardStyle]}px`,onChange:d=>o({cardShadowPx:d})})})]}),e==="header"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardHeader,onChange:d=>{const g=d;o({cardHeader:g,headerStrength:Ft[g]})},options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Header strength",info:"Header tint / accent intensity.",value:t.headerStrength,effective:a,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${a}%)`,softMin:t.cardHeader==="plain"?void 0:1,floorValue:t.cardHeader==="plain"?void 0:0,floorReset:Ft[t.cardHeader],floorMessage:`${t.cardHeader==="tinted"?"Tinted":"Accent"} headers need strength - reset to ${Ft[t.cardHeader]}%`,onChange:d=>o({headerStrength:d})})})]}),e==="nested"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.nestedStyle,onChange:d=>o({nestedStyle:d}),options:[{key:"recessed",label:"Recessed"},{key:"lighter",label:"Lighter"},{key:"bordered",label:"Bordered"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Nested depth",info:"Inset depth of cards-within-cards.",value:t.nestedDepth,effective:s,min:0,max:24,unit:"px",autoValue:-1,autoLabel:`Auto (${s}px)`,onChange:d=>o({nestedDepth:d})})})]}),e==="tint"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.surfaceTint,onChange:d=>o({surfaceTint:d}),options:[{key:"snow",label:"None"},{key:"neutral",label:"Low"},{key:"brand",label:"High"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(xe,{label:"Tint intensity",info:"Strength of the page surface tint.",value:t.tintIntensity,effective:l,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${l}%)`,onChange:d=>o({tintIntensity:d})})})]})]})]})}function Al(){const[e,r]=z.useState("rows"),t=_(i=>i.settings),o=_(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"rows",label:"Rows",info:"Row density & dividers."},{key:"cols",label:"Columns",info:"Column density & dividers."},{key:"cells",label:"Cells",info:"Cell text & vertical alignment."},{key:"styling",label:"Styling",info:"Header background & row striping."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="rows"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableDensity,onChange:i=>o({tableDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableDividers,onChange:i=>o({tableDividers:i.target.checked})}),label:"Row dividers"}),t.tableDividers&&n.jsx(xe,{label:"Divider width",value:t.tableRowDivW,effective:t.tableRowDivW,min:1,max:4,unit:"px",onChange:i=>o({tableRowDivW:i})})]}),e==="cols"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableColDensity,onChange:i=>o({tableColDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableColDividers,onChange:i=>o({tableColDividers:i.target.checked})}),label:"Column dividers"}),t.tableColDividers&&n.jsx(xe,{label:"Divider width",value:t.tableColDivW,effective:t.tableColDivW,min:1,max:4,unit:"px",onChange:i=>o({tableColDivW:i})})]}),e==="cells"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableCellAlignH,onChange:i=>o({tableCellAlignH:i}),options:[{key:"left",label:"Left"},{key:"center",label:"Center"},{key:"right",label:"Right"}]}),n.jsx(p.Box,{sx:{mt:1},children:n.jsx(je,{value:t.tableCellAlignV,onChange:i=>o({tableCellAlignV:i}),options:[{key:"top",label:"Top"},{key:"middle",label:"Middle"},{key:"bottom",label:"Bottom"}]})})]}),e==="styling"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableHeaderStyle,onChange:i=>o({tableHeaderStyle:i}),options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableStripe,onChange:i=>o({tableStripe:i.target.checked})}),label:"Striped rows"})]})]})]})}const xr={compact:.82,default:1,comfortable:1.16};function Il(){const[e,r]=z.useState("shape"),t=_(d=>d.settings),o=_(d=>d.set),i=Pe(t.mode),a=t.densityScale>0?t.densityScale:Math.round((xr[t.density]??1)*100),s=t.cardGapPx>0?t.cardGapPx:Math.round(16*(xr[t.density]??1)),l=t.containerPadPx>0?t.containerPadPx:Math.round(10*(xr[t.density]??1));return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"shape",label:"Shape",info:"Corner radius & layout density."},{key:"effects",label:"Effects",info:"Spacing, button case & status chips."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="shape"&&n.jsxs(n.Fragment,{children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Corner Radius"}),n.jsx(je,{value:t.radiusPreset,onChange:d=>o({radiusPreset:d,radiusVal:d==="sharp"?0:d==="round"?18:9}),options:[{key:"sharp",label:"Sharp"},{key:"rounded",label:"Rounded"},{key:"round",label:"Round"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(xe,{label:"Exact radius",value:t.radiusVal,effective:t.radiusVal,min:0,max:28,unit:"px",onChange:d=>o({radiusVal:d,radiusPreset:"rounded"})})}),n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75,mt:.5},children:"Density"}),n.jsx(je,{value:t.densityScale>0?"":t.density,onChange:d=>o({density:d,densityScale:0}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(xe,{label:"Exact density",info:"Fine-tune spacing scale (%).",value:t.densityScale,effective:a,min:60,max:140,unit:"%",onChange:d=>o({densityScale:d})})})]}),e==="effects"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Card-to-card gap",value:t.cardGapPx,effective:s,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${s}px)`,onChange:d=>o({cardGapPx:d})}),n.jsx(xe,{label:"Container padding",value:t.containerPadPx,effective:l,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${l}px)`,onChange:d=>o({containerPadPx:d})}),n.jsx(xe,{label:"Edge gap",info:"Space between the preview frame and the outer app card.",value:t.edgePadPx,effective:t.edgePadPx,min:0,max:40,step:2,unit:"px",autoLabel:"0px (flush)",onChange:d=>o({edgePadPx:d})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2},children:"Uppercase button labels"}),n.jsx(p.Switch,{size:"small",checked:t.btnCase==="upper",onChange:d=>o({btnCase:d.target.checked?"upper":"none"})})]}),n.jsxs(p.Box,{sx:{mt:1.25},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Status Chips"}),n.jsx(je,{columns:2,value:t.statusBold?"bold":"soft",onChange:d=>o({statusBold:d==="bold"}),options:[{key:"soft",label:"Soft"},{key:"bold",label:"Bold"}]})]})]})]})]})}function Dl(){const[e,r]=z.useState("placement"),t=_(i=>i.settings),o=_(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(ot,{active:e,onChange:r,tabs:[{key:"placement",label:"Placement",info:"Where toasts appear."},{key:"behaviour",label:"Behaviour",info:"Width & auto-dismiss."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="placement"&&n.jsx(je,{columns:2,value:t.notifPosition,onChange:i=>o({notifPosition:i}),options:[{key:"top-center",label:"Top Center"},{key:"top-right",label:"Top Right"},{key:"bottom-left",label:"Bottom Left"},{key:"bottom-right",label:"Bottom Right"}]}),e==="behaviour"&&n.jsxs(n.Fragment,{children:[n.jsx(xe,{label:"Toast width",value:t.toastW,effective:t.toastW||252,min:200,max:500,unit:"px",softMax:500,onChange:i=>o({toastW:i})}),n.jsx(p.FormControlLabel,{sx:{mt:.5},control:n.jsx(p.Switch,{checked:t.notifBadge,onChange:i=>o({notifBadge:i.target.checked})}),label:"Show unread badge"}),n.jsx(p.FormControlLabel,{sx:{mt:.5,display:"flex"},control:n.jsx(p.Switch,{checked:t.notifAutoDismiss,onChange:i=>o({notifAutoDismiss:i.target.checked})}),label:"Auto-dismiss toasts"}),t.notifAutoDismiss&&n.jsx(xe,{label:"Dismiss after",value:t.autoDismissSec,effective:t.autoDismissSec||5,min:5,max:30,unit:"s",onChange:i=>o({autoDismissSec:i})})]})]})]})}function Fl({label:e,info:r,value:t,fallback:o,onChange:i,onReset:a}){const s=Pe(_(f=>f.settings.mode)),[l,d]=z.useState(null),g=t||o;return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[n.jsx(p.Box,{onClick:f=>d(f.currentTarget),sx:{width:22,height:22,borderRadius:1.5,border:`1px solid ${s.insetBd}`,bgcolor:g,cursor:"pointer",flexShrink:0}}),n.jsxs(p.Typography,{variant:"caption",sx:{flex:1,color:s.body,display:"flex",alignItems:"center",gap:.5},children:[e,r&&n.jsx(p.Tooltip,{title:r,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${s.chevron}`,color:s.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),t&&a&&n.jsx(p.Box,{component:"span",onClick:a,title:"Reset to theme default",sx:{fontSize:13,color:s.muted,cursor:"pointer"},children:"↺"}),n.jsx(p.Popover,{open:!!l,anchorEl:l,onClose:()=>d(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:n.jsx(p.Box,{sx:{p:1},children:n.jsx("input",{type:"color",value:g,onChange:f=>i(f.target.value),style:{width:160,height:40,border:"none",background:"none"}})})})]})}function Ol({src:e,aspect:r,onCancel:t,onConfirm:o}){const[i,a]=z.useState(1),[s,l]=z.useState({x:0,y:0}),d=z.useRef(null),g=z.useRef(null),f=z.useRef(null),x=z.useRef(null);z.useEffect(()=>{const y=b=>{x.current&&l({x:x.current.ox+(b.clientX-x.current.sx),y:x.current.oy+(b.clientY-x.current.sy)})},u=()=>{x.current=null};return document.addEventListener("pointermove",y),document.addEventListener("pointerup",u),()=>{document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",u)}},[]);const m=y=>{y.preventDefault(),x.current={sx:y.clientX,sy:y.clientY,ox:s.x,oy:s.y}},h=()=>{const y=d.current,u=g.current,b=f.current;if(!y||!u){o(e);return}const v=(b||y).getBoundingClientRect(),k=1e3,B=Math.round(k*r),S=B/v.width,j=document.createElement("canvas");j.width=B,j.height=k;const R=j.getContext("2d");if(!R){o(e);return}const O=u.getBoundingClientRect(),P=(O.left-v.left)*S,K=(O.top-v.top)*S,Q=O.width*S,U=O.height*S;try{R.drawImage(u,P,K,Q,U),o(j.toDataURL("image/png"))}catch{o(e)}};return hi.createPortal(n.jsx(p.Box,{sx:{position:"fixed",inset:0,zIndex:1400,bgcolor:"rgba(15,23,42,.6)",display:"flex",alignItems:"center",justifyContent:"center",p:2.25,overflow:"auto"},children:n.jsxs(p.Box,{sx:{width:"100%",maxWidth:320,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 20px 50px rgba(15,23,42,.4)",p:2},children:[n.jsx(p.Typography,{sx:{fontSize:14,fontWeight:800,mb:.5},children:"Adjust brand image"}),n.jsx(p.Typography,{sx:{fontSize:11.5,color:"text.secondary",mb:1.5,lineHeight:1.45},children:"Drag and zoom to fit your image inside the bright frame. Anything in the dimmed area is cropped out."}),n.jsxs(p.Box,{ref:d,onPointerDown:m,sx:{position:"relative",width:"100%",aspectRatio:String(r),borderRadius:2.5,overflow:"hidden",bgcolor:"#e9edf2",cursor:"grab",touchAction:"none",display:"grid",placeItems:"center","&:active":{cursor:"grabbing"}},children:[n.jsx("img",{ref:g,src:e,alt:"",draggable:!1,style:{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%,-50%) translate(${s.x}px,${s.y}px) scale(${i})`,transformOrigin:"center",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",userSelect:"none",pointerEvents:"none"}}),n.jsx(p.Box,{ref:f,sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"72%",aspectRatio:String(r),maxWidth:"90%",boxShadow:"0 0 0 9999px rgba(10,15,25,.62)",border:"2px solid #fff",borderRadius:"3px",pointerEvents:"none"}})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,my:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:12,fontWeight:700,color:"text.secondary"},children:"Zoom"}),n.jsx(p.Slider,{size:"small",min:.3,max:4,step:.02,value:i,onChange:(y,u)=>a(u)})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:t,sx:{flex:1,p:1.25,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Cancel"}),n.jsx(p.Box,{component:"button",onClick:h,sx:{flex:1,p:1.25,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Confirm"})]})]})}),document.body)}function Ml(){const e=_(f=>f.settings),r=_(f=>f.set),t=Pe(e.mode),[o,i]=z.useState(null),a=(f,x)=>{var y;const m=(y=f.target.files)==null?void 0:y[0];if(!m)return;const h=new FileReader;h.onload=()=>i({src:h.result,aspect:x==="logoUrl"?3.5:1.55,target:x}),h.readAsDataURL(m),f.target.value=""},s=f=>{o&&(o.target==="logoUrl"?r({logoUrl:f,logoMode:"image"}):r({loginImage:f}),i(null))},l={fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:".6px"},d={display:"flex",alignItems:"center",justifyContent:"center",gap:1,border:`1.5px dashed ${t.insetBd}`,borderRadius:2.5,p:1.75,cursor:"pointer",color:t.body,fontSize:12.5,fontWeight:600,bgcolor:t.inset},g=(f,x)=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:1,p:.9,bgcolor:t.inset,border:`1px solid ${t.insetBd}`,borderRadius:2},children:[n.jsx(p.Typography,{variant:"caption",sx:{flex:1,minWidth:0,color:t.body,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),n.jsx(p.Box,{component:"button",onClick:x,title:"Remove",sx:{border:"none",background:"transparent",color:t.muted,cursor:"pointer",fontSize:14},children:"✕"})]});return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.75},children:[n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Brand Image"}),n.jsxs(p.Box,{component:"label",sx:d,children:["⬆ Choose image",n.jsx("input",{hidden:!0,type:"file",accept:"image/*",onChange:f=>a(f,"loginImage")})]}),e.loginImage&&g("Uploaded image",()=>r({loginImage:""}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Logo"}),n.jsxs(p.Box,{component:"label",sx:d,children:["⬆ Choose logo file",n.jsx("input",{hidden:!0,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp",onChange:f=>a(f,"logoUrl")})]}),e.logoMode==="image"&&e.logoUrl&&g("Uploaded logo",()=>r({logoUrl:"",logoMode:"icon"}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:.5},children:"Panel Colour"}),n.jsx(Fl,{label:"Login panel background",value:e.loginPanelColor,fallback:e.primaryHex,onChange:f=>r({loginPanelColor:f}),onReset:()=>r({loginPanelColor:""})})]}),o&&n.jsx(Ol,{src:o.src,aspect:o.aspect,onCancel:()=>i(null),onConfirm:s})]})}const Wl=[{key:"dashboard",label:"Dashboard"},{key:"orders",label:"Orders"},{key:"reports",label:"Reports"},{key:"cameras",label:"Cameras"},{key:"operations",label:"Operations"},{key:"components",label:"Components"},{key:"login",label:"Login"}],zl=[{key:"dashboard",label:"Dashboard"},{key:"operations",label:"Operations"},{key:"cameras",label:"Cameras"},{key:"reports",label:"Reports"},{key:"orders",label:"Orders"},{key:"components",label:"Components"}],De=ro(e=>({openSection:"",setOpenSection:r=>e({openSection:r}),previewScreen:"dashboard",setPreviewScreen:r=>e({previewScreen:r}),previewMenuOpen:!1,setPreviewMenuOpen:r=>e({previewMenuOpen:r}),studioOpen:!0,setStudioOpen:r=>e({studioOpen:r}),defaultLoginImage:"",setDefaultLoginImage:r=>e({defaultLoginImage:r})}));function _l({onClose:e}){var C,A,F,X;const r=De(w=>w.openSection),t=De(w=>w.setOpenSection),o=De(w=>w.setPreviewScreen),i=De(w=>w.previewScreen),a=De(w=>w.previewMenuOpen),s=De(w=>w.setPreviewMenuOpen),l=_(w=>w.settings),d=_(w=>w.savedThemes),g=_(w=>w.editingSavedId),f=_(w=>w.isDirty),x=_(w=>w.updateSaved),m=_(w=>w.set),h=_(w=>w.reset),y=Pe(l.mode),u=z.useRef("theme"),[b,v]=z.useState(!1),k=(w,Z)=>{const M=r!==w;t(M?w:""),s(!1),M&&u.current!==w&&(o(Z),u.current=w)},B=((C=d.find(w=>w.id===g))==null?void 0:C.name)||((A=Ct.find(w=>w.id===l.presetId))==null?void 0:A.name)||((F=d.find(w=>w.id===l.presetId))==null?void 0:F.name)||"Custom Theme",S=f(),j=((X=Ct.find(w=>w.id===Ce.presetId))==null?void 0:X.name)??"default",R={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},O=({children:w})=>n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",...R,children:w}),P=n.jsxs(O,{children:[n.jsx("circle",{cx:"13.5",cy:"6.5",r:"2.5"}),n.jsx("circle",{cx:"17.5",cy:"10.5",r:"2.5"}),n.jsx("circle",{cx:"8.5",cy:"7.5",r:"2.5"}),n.jsx("circle",{cx:"6.5",cy:"12.5",r:"2.5"}),n.jsx("path",{d:"M12 2a10 10 0 0 0 0 20 3 3 0 0 0 0-6 2 2 0 0 1 0-4 4 4 0 0 0 4-4 6 6 0 0 0-4-6z"})]}),K=n.jsxs(p.Box,{sx:{display:"flex",gap:"2px",width:14,height:14},children:[n.jsx(p.Box,{sx:{flex:1,background:l.secondaryHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.errorHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.successHex,borderRadius:"2px"}})]}),Q=n.jsxs(O,{children:[n.jsx("path",{d:"M4 20 9 5l5 15M6 14h6"}),n.jsx("path",{d:"M15 20l3-9 3 9M16.2 17h3.6"})]}),U=n.jsxs(O,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18"})]}),c=n.jsxs(O,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]}),$=n.jsx(O,{children:n.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})}),H=n.jsxs(n.Fragment,{children:[n.jsxs(O,{children:[n.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),n.jsx("path",{d:"M10 21a2 2 0 0 0 4 0"})]}),n.jsx(p.Box,{sx:{position:"absolute",top:"6px",right:"6px",width:7,height:7,borderRadius:"50%",background:l.primaryHex,border:`1.5px solid ${y.iconTile}`}})]}),W=n.jsxs(O,{children:[n.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),n.jsx("path",{d:"M10 17l5-5-5-5"}),n.jsx("path",{d:"M15 12H3"})]}),N=l.mode==="dark",Y=w=>w.charAt(0).toUpperCase()+w.slice(1),L={sm:"Small",df:"Default",lg:"Large"},J={sharp:"Sharp",rounded:"Rounded",round:"Round"},E={compact:"Compact",default:"Default",comfortable:"Comfortable"},I={flat:"Flat",outlined:"Outlined",soft:"Soft",raised:"Raised",elevated:"Elevated",floating:"Floating"},q={split:"Split Brand",centered:"Centered Card"},V={"top-center":"Top Center","top-right":"Top Right","bottom-left":"Bottom Left","bottom-right":"Bottom Right"},G={theme:`${B} · ${N?"Dark":"Light"}`,color:"Secondary & status colours",type:`${l.fontFamily} · ${L[l.textSize]??"Default"}`,cards:"Card style, header, nesting & surface tint",tables:"Table row density, dividers, striping & header style — previewed on the Orders screen",shape:`${J[l.radiusPreset]??"Custom"} · ${E[l.density]??"Default"} · ${I[l.cardStyle]??""}`,notif:`${V[l.notifPosition]??""} · ${Y(l.notifStyle)}`,login:`${q[l.loginLayout]??""}${l.loginImage?" · image":""}`},D=[{id:"theme",title:"Theme Settings",info:"Presets, saved themes & light/dark mode.",icon:P,screen:"dashboard",body:n.jsx(ml,{})},{id:"color",title:"Colour Settings",info:"Brand, text & status colours.",icon:K,screen:"components",body:n.jsx(Sl,{})},{id:"type",title:"Typography",info:"Fonts, sizes, weight & line-height.",icon:Q,screen:"components",body:n.jsx(Hl,{})},{id:"cards",title:"Cards",info:"Card style, header, nesting & tint.",icon:U,screen:"dashboard",body:n.jsx($l,{})},{id:"tables",title:"Tables",info:"Row/column density, dividers & alignment.",icon:c,screen:"orders",body:n.jsx(Al,{})},{id:"shape",title:"Surface & Shape",info:"Radius, density, elevation & spacing.",icon:$,screen:"dashboard",body:n.jsx(Il,{})},{id:"notif",title:"Notifications",info:"Toast placement & behaviour.",icon:H,screen:"operations",body:n.jsx(Dl,{})},{id:"login",title:"Login Screen",info:"Brand image, logo & panel colour.",icon:W,screen:"login",body:n.jsx(Ml,{})}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",bgcolor:y.card},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.1,borderBottom:`1px solid ${y.divider}`,bgcolor:y.card},children:[n.jsxs(p.Box,{sx:{display:"flex",gap:.5,flexShrink:0},children:[n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.primaryHex}}),n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.secondaryHex}})]}),n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"6px"},children:[n.jsx(p.Typography,{variant:"caption",sx:{minWidth:0,fontWeight:800,color:y.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),S&&n.jsx(p.Tooltip,{title:g?"Unsaved changes — click to save theme":"Unsaved changes",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",onClick:g?()=>{const w=d.find(Z=>Z.id===g);w&&x(g,w.name,l)}:void 0,sx:{width:7,height:7,borderRadius:"50%",bgcolor:"error.main",flexShrink:0,cursor:g?"pointer":"default",transition:"transform 0.15s ease","&:hover":g?{transform:"scale(1.3)"}:{}}})})]}),n.jsx(p.Tooltip,{title:"Reset to defaults",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>v(!0),sx:{bgcolor:"action.selected"},children:n.jsx(Ks,{sx:{fontSize:16}})})}),n.jsx(p.Tooltip,{title:l.mode==="dark"?"Switch to light":"Switch to dark",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>m({mode:l.mode==="dark"?"light":"dark"}),sx:{bgcolor:"action.selected"},children:l.mode==="dark"?n.jsx(Qs,{sx:{fontSize:16}}):n.jsx(Xs,{sx:{fontSize:16}})})})]}),a&&n.jsxs(p.Box,{sx:{borderBottom:"1px solid",borderColor:"divider",borderLeft:"3px solid #eab308",bgcolor:w=>w.palette.mode==="dark"?"rgba(234,179,8,0.14)":"#fef9c3",px:1.6,py:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:".6px",color:w=>w.palette.mode==="dark"?"#f2cd5c":"#854d0e",mb:1},children:"Previewing Screen"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:.75},children:zl.map(w=>{const Z=i===w.key;return n.jsx(p.Box,{component:"button",onClick:()=>{i!==w.key&&o(w.key),s(!1)},sx:{px:.75,py:1,borderRadius:2,cursor:"pointer",fontSize:11,fontWeight:Z?800:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",border:"1.5px solid",borderColor:Z?"#d4a915":"#e6dca8",bgcolor:Z?"#fde68a":"background.paper",color:Z?"#713f12":"text.secondary"},children:w.label},w.key)})})]}),D.map(w=>n.jsx(xl,{icon:w.icon,title:w.title,info:G[w.id]??w.info,open:r===w.id,dimmed:r!==""&&r!==w.id,onToggle:()=>k(w.id,w.screen),onPreviewMenu:()=>s(!a),children:w.body},w.id)),n.jsxs(p.Dialog,{open:b,onClose:()=>v(!1),PaperProps:{sx:{borderRadius:3,width:320,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Reset everything?"}),n.jsxs(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:["This reverts every change you've made — theme preset, light/dark mode, brand colours, logo, typography, cards, surface & shape, notifications and login screen — back to the default ",j," preset. This can't be undone."]}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{h(),v(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"error.main",color:"error.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Reset to defaults"}),n.jsx(p.Box,{component:"button",onClick:()=>v(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Cancel"})]})]})]})}const Ll=kt(n.jsx("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");function Pr(e,r,t){const o=z.useRef(null),[i,a]=z.useState(e);return z.useLayoutEffect(()=>{const s=o.current;if(!s)return;const l=()=>{const x=s.children.length;if(!x)return;const m=parseFloat(getComputedStyle(s).rowGap)||0;let h=0;for(const b of Array.from(s.children))h+=b.offsetHeight;const y=h/x,u=s.clientHeight;u<=0||y<=0||a(Math.max(r,Math.min(t,Math.floor((u+m)/(y+m)))))};l();const d=requestAnimationFrame(l),g=setTimeout(l,300),f=new ResizeObserver(l);return f.observe(s),()=>{cancelAnimationFrame(d),clearTimeout(g),f.disconnect()}},[r,t]),[o,i]}function io(e,r,t){const o=z.useRef(null),i=z.useRef(null),[a,s]=z.useState(e);return z.useLayoutEffect(()=>{const l=i.current;if(!l)return;const d=()=>{var u;const m=Array.from(l.children).filter(b=>getComputedStyle(b).position!=="absolute"),h=m.length?m[0].offsetHeight:((u=o.current)==null?void 0:u.offsetHeight)||36,y=l.clientHeight;y<=0||h<=0||s(Math.max(r,Math.min(t,Math.floor(y/h))))};d();const g=requestAnimationFrame(d),f=setTimeout(d,300),x=new ResizeObserver(d);return x.observe(l),()=>{cancelAnimationFrame(g),clearTimeout(f),x.disconnect()}},[r,t]),[o,i,a]}const Nl=["Jan","Feb","Mar","Apr","May","Jun"],Vl=[44,60,50,74,88,96],Gl=[24,32,30,42,52,60];function Ul(){const e=ve(),r=_(D=>D.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,tH4:m,wH1:h,headFam:y,headLH:u,accentBg:b,btnText:v,tBodySm:k,bwEmph:B,btnCase:S,bodyWeightEff:j,bodyLH:R,tCaption:O,pMain:P,sMain:K}=e,Q=y+",sans-serif",U=r.fontFamily+",sans-serif",c=e.hc1||t.textPrimary,$=e.hc2||t.textPrimary,H=e.hc3||t.textPrimary,W=[{label:"Revenue",val:"$2.41M",chg:"+12.5%",up:!0},{label:"Open Orders",val:"1,284",chg:"+3.2%",up:!0},{label:"Inventory",val:"8,540",chg:"-1.8%",up:!1},{label:"Active Users",val:"342",chg:"+5",up:!0}].map(D=>({...D,cc:D.up?e.sucTxt:e.errTxt,cb:D.up?e.sucSoft:e.errSoft,arrow:D.up?"▲":"▼"})),N=D=>D==="✓"?{cb:e.sucSoft,cc:e.sucTxt}:D==="!"?{cb:e.warnSoft,cc:e.warnTxt}:D==="+"?{cb:e.infoSoft,cc:e.infoTxt}:{cb:t.pContainer,cc:e.isDark?t.pLight:t.pDark},Y=[{title:"Order ORD-1042 delivered to Acme Corp",time:"2m ago",ic:"✓"},{title:"Invoice #4821 paid — $12,400",time:"18m ago",ic:"$"},{title:"Low stock alert: Widget Pro (12 left)",time:"1h ago",ic:"!"},{title:"New customer onboarded: Globex Ltd",time:"3h ago",ic:"+"},{title:'Report "Q2 Summary" exported to PDF',time:"5h ago",ic:"▤"},{title:"Shipment SHP-2093 dispatched — Initech",time:"6h ago",ic:"✓"},{title:"Refund processed — $840 to Umbrella Co",time:"7h ago",ic:"$"},{title:"Payment overdue: Waystar Royco",time:"8h ago",ic:"!"},{title:"New support ticket — Stark Industries",time:"9h ago",ic:"+"},{title:"Backup completed — 12,480 records",time:"11h ago",ic:"✓"},{title:"Purchase order PO-771 approved",time:"13h ago",ic:"$"},{title:"Inventory reconciled — Warehouse 3",time:"15h ago",ic:"▤"},{title:"SLA breach warning — Hooli Inc",time:"17h ago",ic:"!"},{title:"New user invited — M. Fernandez",time:"19h ago",ic:"+"},{title:"Quarterly report scheduled",time:"21h ago",ic:"▤"},{title:"Order ORD-1039 delivered to Oscorp",time:"23h ago",ic:"✓"}].map(D=>({...D,...N(D.ic)})),[L,J]=Pr(5,4,Y.length),E=Y.slice(0,J),I=e.cardBorder==="none"?"none":e.cardBorder,q={background:t.paper,border:I,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},V={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},G={fontSize:x,lineHeight:u,fontWeight:h,color:H,fontFamily:Q};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:I,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:U,fontWeight:j,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:u,fontWeight:h,color:c,letterSpacing:"-.3px",fontFamily:Q},children:"Dashboard"}),n.jsx("span",{title:"Good morning, Admin · Jun 21, 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:B,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:b,color:v,fontSize:k,fontWeight:B,textTransform:S,letterSpacing:".4px",boxShadow:e.btnShadow,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New"})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{...q,marginBottom:l},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:{...G},children:"Performance Overview"}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary,fontWeight:B},children:"This month"})]}),n.jsx("div",{style:{padding:a,display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l},children:W.map(D=>n.jsxs("div",{style:{background:t.paper2,border:e.nestBorder,borderRadius:i,boxShadow:e.nestShadow,padding:s},children:[n.jsx("div",{style:{fontSize:m,color:t.textSecondary,fontWeight:h,fontFamily:Q,textTransform:"uppercase",letterSpacing:".6px",marginBottom:8},children:D.label}),n.jsx("div",{style:{fontSize:f,fontWeight:h,color:$,letterSpacing:"-.8px",lineHeight:1,marginBottom:6},children:D.val}),n.jsxs("span",{style:{fontSize:O,fontWeight:B,color:D.cc,background:D.cb,padding:"3px 9px",borderRadius:999},children:[D.arrow," ",D.chg]})]},D.label))})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...q,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:G,children:"Revenue Trend"}),n.jsx("div",{style:{display:"flex",gap:12},children:[["Revenue",P],["Profit",K]].map(([D,C])=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[n.jsx("div",{style:{width:10,height:10,borderRadius:2,background:C}}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary},children:D})]},D))})]}),n.jsx("div",{style:{padding:`${s}px ${a}px`,display:"flex",alignItems:"flex-end",gap:12,flex:1,minHeight:200},children:Nl.map((D,C)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:Gl[C]+"%",background:K,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:Vl[C]+"%",background:P,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:O,color:t.textSecondary},children:D})]},D))})]}),n.jsxs("div",{style:{...q,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:G,children:"Recent Activity"})}),n.jsx("div",{ref:L,style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:4,flex:1,minHeight:0},children:E.map((D,C)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:8,borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:D.cb,color:D.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:B},children:D.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:k,color:t.textPrimary,fontFamily:U,fontWeight:j,lineHeight:R,marginBottom:2},children:D.title}),n.jsx("div",{style:{fontSize:O,color:t.textSecondary,fontFamily:U},children:D.time})]})]},C))})]})]})]})]})}const Yl=[{id:"ORD-1042",cust:"Acme Corporation",status:"Delivered",amt:"$12,400",date:"Jun 18"},{id:"ORD-1041",cust:"Globex Ltd",status:"Processing",amt:"$8,750",date:"Jun 17"},{id:"ORD-1040",cust:"Initech",status:"Pending",amt:"$5,200",date:"Jun 16"},{id:"ORD-1039",cust:"Umbrella Co",status:"Shipped",amt:"$22,100",date:"Jun 15"},{id:"ORD-1038",cust:"Waystar Royco",status:"Delivered",amt:"$9,800",date:"Jun 14"},{id:"ORD-1037",cust:"Stark Industries",status:"Processing",amt:"$31,500",date:"Jun 13"},{id:"ORD-1036",cust:"Wayne Enterprises",status:"Delivered",amt:"$18,240",date:"Jun 12"},{id:"ORD-1035",cust:"Soylent Corp",status:"Pending",amt:"$4,120",date:"Jun 11"},{id:"ORD-1034",cust:"Hooli Inc",status:"Shipped",amt:"$27,900",date:"Jun 10"},{id:"ORD-1033",cust:"Cyberdyne Systems",status:"Delivered",amt:"$14,650",date:"Jun 09"},{id:"ORD-1032",cust:"Massive Dynamic",status:"Processing",amt:"$10,300",date:"Jun 08"},{id:"ORD-1031",cust:"Tyrell Corp",status:"Delivered",amt:"$16,780",date:"Jun 07"},{id:"ORD-1030",cust:"Oscorp",status:"Shipped",amt:"$7,940",date:"Jun 06"},{id:"ORD-1029",cust:"Nakatomi Trading",status:"Pending",amt:"$3,560",date:"Jun 05"},{id:"ORD-1028",cust:"Gekko & Co",status:"Delivered",amt:"$25,300",date:"Jun 04"},{id:"ORD-1027",cust:"Bluth Company",status:"Processing",amt:"$6,410",date:"Jun 03"}],mr="100px 1fr 120px 100px 80px 70px";function Jl(){const e=ve(),r=_(J=>J.settings),{t,rad:o,radSm:i,pad:a,padSm:s,screenPad:l,rowPy:d,tH1:g,wH1:f,headFam:x,headLH:m,accentBg:h,btnText:y,btnShadow:u,tBody:b,tBodySm:v,tCaption:k,tOverline:B,bwEmph:S,btnCase:j,bodyWeightEff:R,pMain:O,table:P}=e,K=x+",sans-serif",Q=r.fontFamily+",sans-serif",U=e.hc1||t.textPrimary,[c,$,H]=io(12,3,16),W=Yl.slice(0,H).map((J,E)=>({...J,...P.statusMap[J.status]||{sb:t.divider,sc:t.textSecondary},rowBg:r.tableStripe&&E%2===1?P.stripeBg:"transparent"})),N=e.cardBorder==="none"?"none":e.cardBorder,Y=J=>({fontSize:B,fontWeight:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px",borderRight:P.colBorder,alignSelf:"stretch",display:"flex",alignItems:P.cellAI,justifyContent:P.cellJC,padding:`${P.rowPy} ${P.cellPx}`}),L={alignSelf:"stretch",display:"flex",alignItems:P.cellAI,justifyContent:P.cellJC,padding:`${P.rowPy} ${P.cellPx}`};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:N,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Q,fontWeight:R,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:m,fontWeight:f,color:U,letterSpacing:"-.3px",fontFamily:K},children:"Orders"}),n.jsx("span",{title:"1,284 orders · June 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:S,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:h,color:y,fontSize:v,fontWeight:S,textTransform:j,letterSpacing:".4px",boxShadow:u,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New Order"})]}),n.jsx("div",{style:{padding:l,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:N,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",flex:1,minHeight:0},children:[n.jsxs("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:t.paper,border:"1.5px solid "+t.divider,borderRadius:999,padding:"8px 15px",flex:1,minWidth:170},children:[n.jsx("span",{style:{color:t.textSecondary,fontSize:13},children:"⌕"}),n.jsx("span",{style:{fontSize:v,color:t.textSecondary},children:"Search orders…"})]}),P.filters.map(J=>n.jsx("button",{style:{padding:"7px 14px",borderRadius:999,border:"1px solid "+J.brd,background:J.bg,color:J.c,fontSize:k,fontWeight:S,whiteSpace:"nowrap",cursor:"pointer"},children:J.label},J.label))]}),n.jsxs("div",{ref:c,style:{display:"grid",gridTemplateColumns:mr,padding:`0 ${a}px`,borderBottom:P.rowBorder,background:P.headBg},children:[["Order ID","Customer","Status","Amount","Date"].map(J=>n.jsx("div",{style:Y(),children:J},J)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${P.rowPy} 0`}})]}),n.jsxs("div",{ref:$,style:{position:"relative",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{position:"absolute",inset:0,padding:`0 ${a}px`,display:"grid",gridTemplateColumns:mr,pointerEvents:"none",zIndex:2},children:[n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{style:{borderRight:P.colBorder}}),n.jsx("div",{})]}),W.map(J=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:mr,padding:`0 ${a}px`,borderBottom:P.rowBorder,alignItems:"stretch",background:J.rowBg},children:[n.jsx("div",{style:{...L,fontSize:v,fontWeight:S,color:O,fontFamily:Q},children:J.id}),n.jsx("div",{style:{...L,fontSize:b,color:t.textPrimary,fontWeight:S},children:J.cust}),n.jsx("div",{style:L,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:k,fontWeight:S,background:J.sb,color:J.sc,whiteSpace:"nowrap"},children:J.status})}),n.jsx("div",{style:{...L,fontSize:b,color:t.textPrimary,fontWeight:S},children:J.amt}),n.jsx("div",{style:{...L,fontSize:v,color:t.textSecondary},children:J.date}),n.jsx("div",{style:L,children:n.jsx("button",{style:{fontSize:k,color:O,background:t.pContainer,border:"none",fontWeight:S,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"View"})})]},J.id))]}),n.jsxs("div",{style:{padding:`${d}px ${a}px`,display:"flex",alignItems:"center",gap:7,borderTop:"1px solid "+t.divider},children:[n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,flex:1},children:["Showing 1–",W.length," of 1,284"]}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"‹"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"none",background:h,color:y,fontWeight:S,cursor:"pointer"},children:"1"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"2"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"›"})]})]})})]})}function ql(){const e=ve(),r=_(ee=>ee.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,tH4:m,tH5:h,tH6:y,tBody:u,tBodySm:b,tCaption:v,wH1:k,headFam:B,headLH:S,accentBg:j,btnText:R,btnShadow:O,bwEmph:P,btnCase:K,bodyWeightEff:Q,bodyLH:U,pMain:c,errSoft:$,errTxt:H,warnSoft:W,warnTxt:N,infoSoft:Y,infoTxt:L,sucSoft:J,sucTxt:E}=e,I=B+",sans-serif",q=r.fontFamily+",sans-serif",V=e.t.highlight,G=e.t.highlightSoft,D=e.t.highlightBd,C=t.pContainer,A=t.onPContainer,F=t.pContrast,X=e.hc1||t.textPrimary,w=e.hc2||t.textPrimary,Z=e.hc3||t.textPrimary,M=e.hc4||t.textPrimary,fe=e.hc5||t.textPrimary,Me=e.hc6||t.textPrimary,We=e.cardBorder==="none"?"none":e.cardBorder,Je={display:"flex",flexDirection:"column",background:t.paper,border:We,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",height:"100%"},qe={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},Re={fontSize:x,lineHeight:S,fontWeight:k,color:Z,fontFamily:I},tr=[{label:"Dashboard Overview",size:g,w:k,color:X,lh:1.1,ls:"-.5px",name:"H1",border:!0},{label:"Revenue Report",size:f,w:k,color:w,lh:1.1,ls:"-.4px",name:"H2",border:!0},{label:"Performance Overview",size:x,w:k,color:Z,lh:1.15,name:"H3",border:!0},{label:"Active Users",size:m,w:k,color:M,lh:1.2,name:"H4",border:!0},{label:"Last updated 2m ago",size:h,w:k,color:fe,lh:1.25,name:"H5",border:!0},{label:"Status · Live",size:y,w:k,color:Me,lh:1.3,name:"H6",border:!0}],ze=ee=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"11px 12px",borderBottom:"1px solid "+t.divider,background:ee?G:"transparent",boxShadow:ee?"inset 3px 0 0 "+V:"none"},children:[n.jsx("div",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(ee?V:t.outline),display:"grid",placeItems:"center",flexShrink:0},children:ee&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:V}})}),n.jsx("span",{style:{flex:1,fontSize:b,fontFamily:q,fontWeight:ee?P:Q,color:t.textPrimary},children:ee?"Selected item":"Unselected item"}),ee&&n.jsx("span",{style:{fontSize:v,fontFamily:q,fontWeight:P,color:t.textSecondary},children:"Active"})]}),Tt=(ee,ft,ht)=>n.jsxs("div",{style:{position:"relative",border:ee?"2px solid "+c:"1.5px solid "+t.outline,borderRadius:i,padding:"12px 13px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:10,background:t.paper,padding:"0 5px",fontSize:v,color:ee?c:t.textSecondary,fontWeight:ee?P:void 0},children:ft}),n.jsx("span",{style:{fontSize:u,color:ee?t.textPrimary:t.textSecondary},children:ht})]}),Ke=(ee,ft,ht)=>n.jsx("span",{style:{padding:"5px 13px",borderRadius:999,background:ee,color:ft,fontSize:v,fontWeight:P},children:ht}),_e=ee=>({padding:"9px 20px",borderRadius:i,fontSize:b,fontWeight:P,textTransform:K,letterSpacing:".4px",cursor:"pointer",...ee});return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:We,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:q,fontWeight:Q,color:t.textPrimary},children:[n.jsx("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:S,fontWeight:k,color:X,letterSpacing:"-.3px",fontFamily:I},children:"Component Library"}),n.jsx("span",{title:"Every Material UI component reflects your live theme",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:P,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Typography Scale"})}),n.jsxs("div",{style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minHeight:0,gap:6},children:[tr.map(ee=>n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,borderBottom:"1px solid "+t.divider,paddingBottom:14},children:[n.jsx("span",{style:{fontSize:ee.size,lineHeight:ee.lh,fontWeight:ee.w,color:ee.color,fontFamily:I,letterSpacing:ee.ls},children:ee.label}),n.jsxs("span",{style:{fontSize:ee.size,color:t.textSecondary,fontWeight:ee.w,whiteSpace:"nowrap",flexShrink:0,fontFamily:I},children:[ee.name," · ",ee.size]})]},ee.name)),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:u,lineHeight:U,color:t.textPrimary,fontFamily:q,fontWeight:Q},children:"Body text — the quick brown fox jumps over the lazy dog."}),n.jsxs("span",{style:{fontSize:u,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:q},children:["Body · ",u]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:v,lineHeight:U,color:t.textSecondary,fontFamily:q,fontWeight:Q},children:"Caption & helper text style"}),n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:q},children:["Caption · ",v]})]})]})]}),n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Selection States"})}),n.jsxs("div",{style:{padding:a,display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{display:"flex",gap:2,borderBottom:"1.5px solid "+t.divider},children:[n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textPrimary,background:G,borderBottom:"2.5px solid "+c,marginBottom:-1.5,borderRadius:"6px 6px 0 0"},children:"Overview"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textSecondary},children:"Activity"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:b,fontWeight:P,color:t.textSecondary},children:"Settings"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",border:"1px solid "+t.divider,borderRadius:i,overflow:"hidden"},children:[ze(!0),ze(!1),ze(!1),ze(!1),ze(!0),ze(!1)]}),n.jsx("div",{style:{display:"inline-flex",alignSelf:"flex-start",padding:"6px 12px",borderRadius:i,background:G,border:"1px solid "+D},children:n.jsx("span",{style:{fontSize:v,fontWeight:P,color:V},children:"2 selected items"})})]})]})]}),n.jsxs("div",{style:{...Je,height:"auto"},children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Inputs & Selection"})}),n.jsxs("div",{style:{padding:a},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,marginBottom:l},children:[Tt(!1,"Outlined","Placeholder…"),Tt(!0,"Focused","Active value")]}),n.jsxs("div",{style:{display:"flex",gap:22,alignItems:"center",flexWrap:"wrap",paddingTop:s,borderTop:"1px solid "+t.divider},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:4,background:c,display:"grid",placeItems:"center",color:F,fontSize:11,fontWeight:P},children:"✓"}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Checkbox"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:"50%",border:"2px solid "+c,display:"grid",placeItems:"center"},children:n.jsx("div",{style:{width:9,height:9,borderRadius:"50%",background:c}})}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Radio"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:38,height:22,borderRadius:999,background:c,position:"relative"},children:n.jsx("div",{style:{position:"absolute",top:3,right:3,width:16,height:16,borderRadius:"50%",background:"#fff"}})}),n.jsx("span",{style:{fontSize:b,color:t.textPrimary},children:"Switch"})]})]})]})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Buttons"})}),n.jsxs("div",{style:{padding:a,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[n.jsx("button",{style:_e({border:"none",background:j,color:R,boxShadow:O}),children:"Contained"}),n.jsx("button",{style:_e({border:"1.5px solid "+c,background:"transparent",color:c}),children:"Outlined"}),n.jsx("button",{style:_e({border:"none",background:"transparent",color:c}),children:"Text"}),n.jsx("button",{style:_e({border:"none",background:C,color:A}),children:"Tonal"}),n.jsx("button",{style:_e({border:"none",background:j,color:R,boxShadow:O,borderRadius:999}),children:"Rounded"}),n.jsx("button",{style:_e({border:"none",background:$,color:H}),children:"Error"})]})]}),n.jsxs("div",{style:Je,children:[n.jsx("div",{style:qe,children:n.jsx("span",{style:Re,children:"Chips, Alerts & Progress"})}),n.jsxs("div",{style:{padding:a},children:[n.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:l},children:[Ke(C,A,"Primary"),Ke(J,E,"Success"),Ke(W,N,"Warning"),Ke(Y,L,"Info"),Ke($,H,"Error")]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:7},children:[n.jsx("span",{style:{fontSize:b,color:t.textPrimary,fontWeight:P},children:"Revenue goal"}),n.jsx("span",{style:{fontSize:b,color:c,fontWeight:P},children:"74%"})]}),n.jsx("div",{style:{height:8,background:t.paper2,border:"1px solid "+t.divider,borderRadius:999,overflow:"hidden"},children:n.jsx("div",{style:{height:"100%",width:"74%",background:c,borderRadius:999}})})]})]})]})]})]})}const Kl=[{label:"Cameras Online",val:"5 / 6"},{label:"Recording",val:"4"},{label:"Motion Alerts",val:"2"},{label:"Storage Used",val:"82%"}],Xl=[{name:"CAM 01",loc:"Main Lobby",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 02",loc:"North Gate",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 03",loc:"Loading Bay",rec:!1,online:!0,time:"14:32:07"},{name:"CAM 04",loc:"Rooftop",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 05",loc:"Parking Deck",rec:!1,online:!1,time:"—"},{name:"CAM 06",loc:"Server Room",rec:!0,online:!0,time:"14:32:08"}],Ql=[{cam:"CAM 04",label:"Motion detected — Rooftop",time:"just now",sev:"error"},{cam:"CAM 02",label:"Person identified — North Gate",time:"6m ago",sev:"info"},{cam:"CAM 01",label:"Loitering cleared — Main Lobby",time:"22m ago",sev:"success"},{cam:"CAM 06",label:"Door forced — Server Room",time:"34m ago",sev:"error"},{cam:"CAM 03",label:"Vehicle detected — Loading Bay",time:"48m ago",sev:"info"},{cam:"CAM 05",label:"Signal restored — Parking Deck",time:"1h ago",sev:"success"},{cam:"CAM 02",label:"Tailgating flagged — North Gate",time:"1h ago",sev:"error"},{cam:"CAM 04",label:"Crowd density normal — Rooftop",time:"2h ago",sev:"success"},{cam:"CAM 01",label:"Object left behind — Main Lobby",time:"2h ago",sev:"info"},{cam:"CAM 03",label:"Motion detected — Loading Bay",time:"3h ago",sev:"error"},{cam:"CAM 06",label:"Access granted — Server Room",time:"3h ago",sev:"success"},{cam:"CAM 05",label:"Camera offline — Parking Deck",time:"4h ago",sev:"error"},{cam:"CAM 02",label:"Face match — North Gate",time:"5h ago",sev:"info"},{cam:"CAM 01",label:"Queue length normal — Main Lobby",time:"6h ago",sev:"success"},{cam:"CAM 04",label:"Perimeter breach — Rooftop",time:"7h ago",sev:"error"},{cam:"CAM 03",label:"Package scanned — Loading Bay",time:"8h ago",sev:"info"}];function Zl(){const e=ve(),r=_(F=>F.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:y,accentBg:u,btnText:b,btnShadow:v,tBodySm:k,tCaption:B,tOverline:S,bwEmph:j,btnCase:R,bodyWeightEff:O,errSoft:P,errTxt:K,mediaBg:Q,overlaySurface:U,overlayBorder:c,onOverlay:$,sevMap:H}=e,W=h+",sans-serif",N=r.fontFamily+",sans-serif",Y=e.hc1||t.textPrimary,L=e.hc2||t.textPrimary,J=e.hc3||t.textPrimary,E=e.cardBorder==="none"?"none":e.cardBorder,I=Xl.map(F=>({...F,dotC:F.online?r.successHex:t.textDisabled})),[q,V]=Pr(3,3,16),G=Ql.slice(0,V).map(F=>({...F,...H[F.sev]})),D={background:t.paper,border:E,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},C={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},A={fontSize:x,lineHeight:y,fontWeight:m,color:J,fontFamily:W};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:E,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:N,fontWeight:O,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:y,fontWeight:m,color:Y,letterSpacing:"-.3px",fontFamily:W},children:"Camera Surveillance"}),n.jsx("span",{title:"6 feeds · live monitoring & recording",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:j,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:B,fontWeight:j,color:K,background:P,padding:"6px 12px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]}),n.jsx("button",{style:{padding:"10px 18px",borderRadius:i,border:"none",background:u,color:b,fontSize:k,fontWeight:j,textTransform:R,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"+ Add Camera"})]})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:Kl.map(F=>n.jsxs("div",{style:D,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:j},children:F.label})}),n.jsx("div",{style:{padding:`${s}px ${a}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:L,letterSpacing:"-.8px",lineHeight:1},children:F.val})})]},F.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...D,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:C,children:[n.jsx("span",{style:A,children:"Camera Wall"}),n.jsx("span",{style:{fontSize:B,color:t.textSecondary,fontWeight:j},children:"2 × 3 grid"})]}),n.jsx("div",{style:{padding:a,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridAutoRows:"1fr",gap:l},children:I.map(F=>n.jsxs("div",{style:{position:"relative",borderRadius:i,overflow:"hidden",background:Q,minHeight:104,border:"1px solid "+t.divider},children:[n.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:n.jsx("span",{style:{fontFamily:"monospace",fontSize:B,color:"rgba(255,255,255,.3)",letterSpacing:1},children:F.loc})}),n.jsxs("div",{style:{position:"absolute",top:7,left:7,display:"flex",alignItems:"center",gap:5,background:U,border:"1px solid "+c,borderRadius:999,padding:"2px 8px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:F.dotC}}),n.jsx("span",{style:{color:$,fontSize:B,fontWeight:700,letterSpacing:".4px"},children:F.name})]}),F.rec&&n.jsxs("div",{style:{position:"absolute",top:7,right:7,display:"flex",alignItems:"center",gap:4,background:U,borderRadius:999,padding:"2px 7px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:r.errorHex}}),n.jsx("span",{style:{color:$,fontSize:8,fontWeight:800,letterSpacing:".5px"},children:"REC"})]}),F.online&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"5px 8px",background:"linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,0))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:n.jsx("span",{style:{color:"#fff",fontSize:B,fontWeight:600,fontFamily:"monospace"},children:F.time})})]},F.name))})]}),n.jsxs("div",{style:{...D,display:"flex",flexDirection:"column"},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:A,children:"Recent Detections"})}),n.jsx("div",{ref:q,style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:2,flex:1,minHeight:0},children:G.map((F,X)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:F.cb,color:F.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:11,fontWeight:800,fontFamily:"monospace"},children:"●"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:k,color:t.textPrimary,fontWeight:O,lineHeight:1.35},children:F.label}),n.jsxs("div",{style:{fontSize:B,color:t.textSecondary,marginTop:2},children:[F.cam," · ",F.time]})]})]},X))})]})]})]})]})}const ec=[{ic:"!",label:"Camera 04 motion detected — Loading Bay",time:"just now",sev:"error",unread:!0},{ic:"✓",label:"Stream reconnected — North Gate feed",time:"4m ago",sev:"success",unread:!0},{ic:"i",label:"Access request — J. Okoro (Operator)",time:"22m ago",sev:"info",unread:!1},{ic:"!",label:"Report archive storage 82% full",time:"1h ago",sev:"warning",unread:!1},{ic:"✓",label:"Backup completed — 12,480 clips archived",time:"2h ago",sev:"success",unread:!1},{ic:"i",label:"Firmware update available — 3 devices",time:"3h ago",sev:"info",unread:!1},{ic:"!",label:"Camera 02 lens obstruction detected",time:"5h ago",sev:"error",unread:!1},{ic:"✓",label:"Nightly health check passed — all nodes",time:"6h ago",sev:"success",unread:!1},{ic:"i",label:"New operator invited — M. Fernandez",time:"7h ago",sev:"info",unread:!1},{ic:"!",label:"Bandwidth spike on West Wing uplink",time:"8h ago",sev:"warning",unread:!1},{ic:"✓",label:"Retention policy applied — 30 day window",time:"9h ago",sev:"success",unread:!1},{ic:"i",label:"Scheduled maintenance — Sat 02:00 UTC",time:"11h ago",sev:"info",unread:!1},{ic:"!",label:"Motion zone breach — Perimeter Gate 3",time:"12h ago",sev:"error",unread:!1},{ic:"✓",label:"Clip export finished — Incident #4821",time:"14h ago",sev:"success",unread:!1},{ic:"i",label:"Analytics model updated — v2.4.1",time:"16h ago",sev:"info",unread:!1},{ic:"!",label:"Disk latency elevated — NVR-02",time:"18h ago",sev:"warning",unread:!1}];function tc(){const e=ve(),r=_(A=>A.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tTitle:f,wH1:x,headFam:m,headLH:h,accentBg:y,btnText:u,tBodySm:b,tCaption:v,tOverline:k,bwEmph:B,bodyWeightEff:S,bodyLH:j,errSoft:R,errTxt:O,pMain:P,mediaBg:K,overlaySurface:Q,overlayBorder:U,onOverlay:c,sevMap:$}=e,H=m+",sans-serif",W=r.fontFamily+",sans-serif",N=e.hc1||t.textPrimary,Y=e.hc3||t.textPrimary,L=e.cardBorder==="none"?"none":e.cardBorder,[J,E]=Pr(7,4,16),I=ec.slice(0,E).map(A=>({...A,...$[A.sev],rowBg:A.unread?ce(r.primaryHex,e.isDark?.12:.05):"transparent"})),q=I.filter(A=>A.unread).length,V={display:"flex",flexDirection:"column",minHeight:0,background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},G={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},D={fontSize:f,lineHeight:h,fontWeight:x,color:Y,fontFamily:H},C={height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:c,fontSize:v,fontWeight:B,cursor:"pointer",fontFamily:"inherit"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:W,fontWeight:S,color:t.textPrimary},children:[n.jsx("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:h,fontWeight:x,color:N,letterSpacing:"-.3px",fontFamily:H},children:"Operations Center"}),n.jsx("span",{title:"Live map, camera feeds, alerts & access — every module themed end to end",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:B,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsx("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 320px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsxs("div",{style:G,children:[n.jsx("span",{style:D,children:"Live Map · Street View"}),n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:v,fontWeight:B,color:O,background:R,padding:"3px 10px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]})]}),n.jsxs("div",{style:{position:"relative",flex:1,minHeight:320,background:K,display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("span",{style:{fontFamily:"monospace",fontSize:v,color:"rgba(255,255,255,.42)",letterSpacing:1.5},children:"◍ GOOGLE STREET VIEW / EARTH EMBED"}),n.jsx("div",{style:{position:"absolute",top:12,left:12,display:"flex",alignItems:"center",gap:7,background:Q,border:"1px solid "+U,borderRadius:999,padding:"6px 12px"},children:n.jsx("span",{style:{color:c,fontSize:v,fontWeight:B},children:"◎ 40.7128, -74.0060 · Manhattan"})}),n.jsxs("div",{style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:4,background:Q,border:"1px solid "+U,borderRadius:i,padding:5},children:[n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:y,color:u,fontSize:16,fontWeight:B,cursor:"pointer"},children:"+"}),n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:c,fontSize:16,fontWeight:B,cursor:"pointer"},children:"−"}),n.jsx("div",{style:{width:1,height:18,background:U,margin:"0 3px"}}),n.jsx("button",{style:{...C,padding:"0 12px"},children:"Layers"}),n.jsx("button",{style:{...C,padding:"0 12px"},children:"◎ Locate"})]})]})]}),n.jsxs("div",{style:V,children:[n.jsxs("div",{style:G,children:[n.jsx("span",{style:D,children:"Notifications"}),n.jsxs("span",{style:{fontSize:k,fontWeight:B,color:t.pContrast,background:P,padding:"2px 9px",borderRadius:999},children:[q," NEW"]})]}),n.jsx("div",{ref:J,style:{padding:s,display:"flex",flexDirection:"column",gap:2,flex:1,minHeight:0},children:I.map((A,F)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i,background:A.rowBg},children:[n.jsx("div",{style:{width:26,height:26,borderRadius:i,background:A.cb,color:A.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:B},children:A.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:b,color:t.textPrimary,fontWeight:S,lineHeight:j},children:A.label}),n.jsx("div",{style:{fontSize:v,color:t.textSecondary,marginTop:2},children:A.time})]}),A.unread&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:P,flexShrink:0,marginTop:6}})]},F))})]})]})})]})}const rc=[{label:"Reports Generated",val:"248"},{label:"Avg Generation",val:"1.2s"},{label:"Data Points",val:"84.2K"},{label:"Scheduled",val:"12"}],nc=["Jan","Feb","Mar","Apr","May","Jun"],oc=[44,60,50,74,88,96],ic=[24,32,30,42,52,60],ac=[{l:"Reports",h:72},{l:"Cameras",h:92},{l:"Alerts",h:40},{l:"Users",h:58},{l:"Storage",h:80}],sc=[{name:"Q2 Revenue Summary",type:"Financial",date:"Jun 20",status:"Ready"},{name:"Camera Uptime Audit",type:"Operations",date:"Jun 19",status:"Ready"},{name:"User Access Log",type:"Security",date:"Jun 18",status:"Ready"},{name:"Inventory Forecast",type:"Analytics",date:"Jun 17",status:"Processing"},{name:"Monthly KPI Digest",type:"Executive",date:"Jun 15",status:"Ready"},{name:"Incident Response Log",type:"Security",date:"Jun 14",status:"Ready"},{name:"Storage Utilization Report",type:"Operations",date:"Jun 13",status:"Ready"},{name:"Weekly Traffic Analysis",type:"Analytics",date:"Jun 12",status:"Processing"},{name:"Vendor SLA Compliance",type:"Financial",date:"Jun 11",status:"Ready"},{name:"Motion Event Rollup",type:"Operations",date:"Jun 10",status:"Ready"},{name:"Quarterly Audit Trail",type:"Security",date:"Jun 09",status:"Ready"},{name:"Energy Consumption Digest",type:"Analytics",date:"Jun 08",status:"Processing"},{name:"Executive Board Pack",type:"Executive",date:"Jun 07",status:"Ready"},{name:"Device Firmware Ledger",type:"Operations",date:"Jun 06",status:"Ready"},{name:"Access Anomaly Report",type:"Security",date:"Jun 05",status:"Ready"},{name:"Cost Allocation Summary",type:"Financial",date:"Jun 04",status:"Ready"}],Pn="1fr 130px 110px 90px 70px";function lc(){const e=ve(),r=_(w=>w.settings),{t,rad:o,radSm:i,pad:a,padSm:s,gap:l,screenPad:d,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:y,accentBg:u,btnText:b,btnShadow:v,tBody:k,tBodySm:B,tCaption:S,tOverline:j,bwEmph:R,btnCase:O,bodyWeightEff:P,pMain:K,sMain:Q,chartPalette:U,table:c}=e,$=h+",sans-serif",H=r.fontFamily+",sans-serif",W=e.hc1||t.textPrimary,N=e.hc2||t.textPrimary,Y=e.hc3||t.textPrimary,L=e.cardBorder==="none"?"none":e.cardBorder,[J,E,I]=io(5,3,16),q=sc.slice(0,I).map((w,Z)=>({...w,sb:w.status==="Ready"?e.sucSoft:e.warnSoft,sc:w.status==="Ready"?e.sucTxt:e.warnTxt,rowBg:r.tableStripe&&Z%2===1?c.stripeBg:"transparent"})),V=ac.map((w,Z)=>({...w,c:U[Z%U.length]})),G={borderRight:c.colBorder,alignSelf:"stretch",display:"flex",alignItems:c.cellAI,justifyContent:c.cellJC,padding:`${c.rowPy} ${c.cellPx}`},D={alignSelf:"stretch",display:"flex",alignItems:c.cellAI,justifyContent:c.cellJC,padding:`${c.rowPy} ${c.cellPx}`},C={background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},A={padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},F={fontSize:x,lineHeight:y,fontWeight:m,color:Y,fontFamily:$},X={fontSize:j,fontWeight:R,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:L,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:H,fontWeight:P,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:a,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:y,fontWeight:m,color:W,letterSpacing:"-.3px",fontFamily:$},children:"Reports"}),n.jsx("span",{title:"Generated insights across every module",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:R,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:u,color:b,fontSize:B,fontWeight:R,textTransform:O,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"↓ Export PDF"})]}),n.jsxs("div",{style:{padding:d,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:rc.map(w=>n.jsxs("div",{style:C,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:j,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:R},children:w.label})}),n.jsx("div",{style:{padding:`${s}px ${a}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:N,letterSpacing:"-.8px",lineHeight:1},children:w.val})})]},w.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,marginBottom:l},children:[n.jsxs("div",{style:C,children:[n.jsxs("div",{style:A,children:[n.jsx("span",{style:F,children:"Revenue & Profit Trend"}),n.jsx("span",{style:{fontSize:S,color:t.textSecondary,fontWeight:R},children:"6 months"})]}),n.jsx("div",{style:{padding:a,display:"flex",alignItems:"flex-end",gap:12,height:160},children:nc.map((w,Z)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:ic[Z]+"%",background:Q,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:oc[Z]+"%",background:K,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:S,color:t.textSecondary},children:w})]},w))})]}),n.jsxs("div",{style:C,children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:F,children:"By Module"})}),n.jsx("div",{style:{padding:a,display:"flex",alignItems:"flex-end",gap:10,height:128},children:V.map(w=>n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:n.jsx("div",{style:{width:"100%",height:w.h+"%",background:w.c,borderRadius:`${i} ${i} 0 0`}})},w.l))})]})]}),n.jsxs("div",{style:{...C,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{padding:`${s}px ${a}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:F,children:"Recent Reports"})}),n.jsxs("div",{ref:J,style:{display:"grid",gridTemplateColumns:Pn,padding:`0 ${a}px`,borderBottom:c.rowBorder,background:c.headBg},children:[["Report","Type","Status","Date"].map(w=>n.jsx("div",{style:{...X,...G},children:w},w)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${c.rowPy} 0`}})]}),n.jsx("div",{ref:E,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:q.map(w=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:Pn,padding:`0 ${a}px`,borderBottom:c.rowBorder,background:w.rowBg},children:[n.jsx("div",{style:{...D,fontSize:k,color:t.textPrimary,fontWeight:R},children:w.name}),n.jsx("div",{style:{...D,fontSize:B,color:t.textSecondary},children:w.type}),n.jsx("div",{style:D,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:S,fontWeight:R,background:w.sb,color:w.sc,whiteSpace:"nowrap"},children:w.status})}),n.jsx("div",{style:{...D,fontSize:B,color:t.textSecondary},children:w.date}),n.jsx("div",{style:D,children:n.jsx("button",{style:{fontSize:S,color:K,background:t.pContainer,border:"none",fontWeight:R,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"↓ PDF"})})]},w.name))})]})]})]})}const $n=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),n.jsx("path",{d:"m21 15-5-5L5 21"})]});function cc(){const e=ve(),r=_(L=>L.settings),t=De(L=>L.defaultLoginImage),{t:o,rad:i,radSm:a,pad:s,tH1:l,tBody:d,tBodySm:g,tCaption:f,wH1:x,headLH:m,accentBg:h,btnText:y,btnShadow:u,bwEmph:b,pMain:v,iconInitials:k,loginCenteredGrad:B,loginScrimGradC:S}=e,j=r.fontFamily+",sans-serif",R=e.hc1||o.textPrimary,O=o.pContrast,P=e.cardBorder==="none"?"none":e.cardBorder,K=r.logoMode==="image"&&!!r.logoUrl,Q=e.isDark?o.paper2:"#ffffff",U=r.loginPanelColor||o.bgDefault,c=r.loginImgOpacity>0?r.loginImgOpacity:1,$=r.loginImage||t,H=!!$,W=H?n.jsx("img",{src:$,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0,opacity:c}}):null,N={background:o.paper,border:P,borderRadius:i,boxShadow:e.cardShadow,padding:s,display:"flex",flexDirection:"column",gap:20},Y=L=>({position:"relative",background:o.paper2,border:"1.5px solid "+(L?v:o.outline),borderRadius:a});return r.loginLayout==="centered"?n.jsxs("div",{style:{minHeight:560,background:B,display:"flex",alignItems:"center",justifyContent:"center",padding:40,position:"relative",overflow:"hidden",fontFamily:j,borderRadius:i},children:[W,H&&n.jsx("div",{style:{position:"absolute",inset:0,background:S,zIndex:0}}),n.jsxs("div",{style:{position:"relative",zIndex:1,width:"100%",maxWidth:380,background:o.paper,border:P,borderRadius:i,boxShadow:"0 24px 60px rgba(0,0,0,.35)",padding:s,display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[n.jsx("div",{style:{width:72,height:72,borderRadius:20,background:r.iconColor,display:"grid",placeItems:"center",boxShadow:"0 6px 18px "+r.iconColor+"55"},children:n.jsx("span",{style:{color:"#fff",fontSize:24,fontWeight:b,letterSpacing:"-1px"},children:k})}),n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+o.outline,borderRadius:a,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:o.paper,padding:"0 5px",fontSize:11,color:o.textSecondary},children:"Email"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary},children:"admin@company.com"})]}),n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+o.outline,borderRadius:a,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:o.paper,padding:"0 5px",fontSize:11,color:o.textSecondary},children:"Password"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary,letterSpacing:3},children:"••••••••"})]}),n.jsx("button",{style:{padding:13,borderRadius:a,border:"none",background:h,color:y,fontSize:d,fontWeight:b,textTransform:"uppercase",letterSpacing:".5px",boxShadow:u,cursor:"pointer"},children:"Sign in"})]})]})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"3fr 1fr",minHeight:560,fontFamily:j,borderRadius:i,overflow:"hidden"},children:[n.jsxs("div",{style:{background:Q,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 40px",gap:22,position:"relative",overflow:"hidden"},children:[W,!H&&n.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:o.textSecondary,border:"1.5px dashed "+o.outline,padding:24,boxSizing:"border-box"},children:[n.jsx($n,{size:46}),n.jsx("div",{style:{fontSize:14,fontWeight:b,color:o.textPrimary},children:"No brand image"}),n.jsx("div",{style:{fontSize:12,color:o.textSecondary,textAlign:"center",maxWidth:220},children:"Upload an image in the Login Screen settings to fill this panel."})]})]}),n.jsxs("div",{style:{background:U,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,padding:"48px 40px"},children:[K?n.jsx("img",{src:r.logoUrl,alt:r.appName,style:{maxHeight:64,maxWidth:200,objectFit:"contain"}}):n.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,maxWidth:200,maxHeight:64,border:"1.5px dashed "+o.outline,borderRadius:a,boxSizing:"border-box",color:o.textSecondary,padding:"8px 16px"},children:[n.jsx($n,{size:20}),n.jsx("span",{style:{fontSize:f,fontWeight:b,color:o.textSecondary,whiteSpace:"nowrap"},children:"No logo uploaded"})]}),n.jsxs("div",{style:{width:"100%",maxWidth:340,...N},children:[n.jsxs("div",{style:{textAlign:"center"},children:[n.jsx("div",{style:{fontSize:l,lineHeight:m,fontWeight:x,color:R,letterSpacing:"-.4px",marginBottom:5},children:"Welcome back"}),n.jsx("div",{style:{fontSize:g,color:o.textSecondary},children:"Sign in to continue"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:f,fontWeight:b,color:o.textPrimary,marginBottom:7},children:"Email Address"}),n.jsxs("div",{style:{...Y(!1),padding:"12px 14px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"✉"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary},children:"admin@company.com"})]})]}),n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:f,fontWeight:b,color:o.textPrimary,marginBottom:7},children:"Password"}),n.jsxs("div",{style:{...Y(!0),padding:"12px 40px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"🔒"}),n.jsx("span",{style:{fontSize:d,color:o.textPrimary,letterSpacing:3},children:"••••••••"}),n.jsx("span",{style:{position:"absolute",right:13,top:"50%",transform:"translateY(-50%)",color:o.textSecondary,fontSize:14},children:"👁"})]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:17,height:17,borderRadius:4,background:v,display:"grid",placeItems:"center",color:O,fontSize:11,fontWeight:b},children:"✓"}),n.jsx("span",{style:{fontSize:g,color:o.textPrimary},children:"Remember me"})]}),n.jsx("span",{style:{fontSize:g,color:v,fontWeight:b},children:"Forgot password?"})]}),n.jsxs("button",{style:{padding:13,borderRadius:a,border:"none",background:h,color:y,fontSize:d,fontWeight:b,letterSpacing:".3px",boxShadow:u,marginTop:2,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},children:["Login ",n.jsx("span",{style:{fontSize:15},children:"→"})]})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:f,color:o.textSecondary},children:["Powered by ",n.jsx("span",{style:{color:v,fontWeight:b},children:r.appName})," © 2026"]})]})]})]})}function dc(){const e=ve(),r=_(y=>y.settings),[t,o]=z.useState(!1);if(t)return null;const{t:i,npos:a,nacc:s,toastDeco:l,toastBg:d,rad:g,radSm:f,tBodySm:x,tCaption:m}=e,h=(r.toastW>0?r.toastW:252)+"px";return n.jsxs("div",{style:{position:"absolute",zIndex:40,width:h,maxWidth:"70%",boxSizing:"border-box",background:d,borderRadius:g,display:"flex",gap:"10px",alignItems:"flex-start",padding:"12px 13px",fontFamily:r.fontFamily+",sans-serif",...a,...l},children:[n.jsx("div",{style:{width:"30px",height:"30px",borderRadius:f,background:s.icbg,color:s.icc,display:"grid",placeItems:"center",flexShrink:0,fontSize:"15px",fontWeight:800},children:"!"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:x+"px",fontWeight:700,color:i.textPrimary,marginBottom:"2px"},children:"Low stock alert"}),n.jsx("div",{style:{fontSize:m+"px",color:i.textSecondary,lineHeight:1.4},children:"Widget Pro is down to 12 units left."})]}),r.notifAutoDismiss&&n.jsx("div",{title:"Auto-dismiss countdown",style:{flexShrink:0,marginTop:"1px",minWidth:"26px",height:"20px",padding:"0 7px",borderRadius:"999px",background:ce(s.dot,.14),color:s.dot,fontSize:m-.5+"px",fontWeight:800,display:"grid",placeItems:"center",fontVariantNumeric:"tabular-nums"},children:(r.autoDismissSec>0?r.autoDismissSec:8)+"s"}),n.jsx("button",{title:"Dismiss notification",onClick:()=>o(!0),style:{flexShrink:0,width:"20px",height:"20px",marginTop:"1px",border:"none",background:"transparent",color:i.textSecondary,cursor:"pointer",borderRadius:"6px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:n.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}const pc=[75,90,100,125];function uc(){var f;const e=De(x=>x.previewScreen),r=_(x=>x.settings.edgePadPx)||0,t=e==="operations"?0:r,[o,i]=z.useState("fit"),a=z.useRef(null),s=z.useRef(null),[l,d]=z.useState(100);z.useLayoutEffect(()=>{const x=a.current,m=s.current;if(!x||!m)return;const h=()=>{const k=getComputedStyle(x),B=(parseFloat(k.paddingTop)||0)+(parseFloat(k.paddingBottom)||0);if(o!=="fit"){const c=o/100;m.style.zoom=String(c);const $=x.clientHeight-B;m.style.minHeight=($>0?Math.floor($/c):0)+"px",d(o);return}m.style.zoom="1",m.style.minHeight="0px",m.offsetHeight;const S=(parseFloat(k.paddingLeft)||0)+(parseFloat(k.paddingRight)||0),j=x.clientWidth-S,R=x.clientHeight-B,O=m.scrollWidth,P=m.scrollHeight;if(O<=0||P<=0||j<=0||R<=0)return;const K=Math.min(j/O,R/P,1),Q=K<.985?Math.max(.36,K):1;m.style.zoom=String(Q);const U=Math.min(j/O,1);m.style.minHeight=Math.floor(R/Math.max(U,.36))+"px",d(Math.round(Q*100))};let y=0,u=0;const b=()=>{h(),++u<36&&(y=requestAnimationFrame(b))};b();const v=new ResizeObserver(h);return v.observe(x),v.observe(m),()=>{cancelAnimationFrame(y),v.disconnect()}},[o,t,e]);const g=((f=Wl.find(x=>x.key===e))==null?void 0:f.label)??"";return n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[n.jsxs(p.Box,{sx:{px:2.5,py:1.25,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,bgcolor:"background.paper"},children:[n.jsx(Ll,{sx:{fontSize:22,color:"text.secondary"}}),n.jsxs(p.Typography,{variant:"h5",sx:{flex:1,fontSize:18,fontWeight:700,letterSpacing:"-.2px"},children:["Previewing ",g]}),n.jsxs(p.Select,{size:"small",value:o,onChange:x=>i(x.target.value==="fit"?"fit":Number(x.target.value)),sx:{minWidth:128,fontSize:13,fontWeight:600,"& .MuiSelect-select":{py:.75}},children:[n.jsxs(p.MenuItem,{value:"fit",children:["Fit (",l,"%)"]}),pc.map(x=>n.jsxs(p.MenuItem,{value:x,children:[x,"%"]},x))]})]}),n.jsxs(p.Box,{ref:a,sx:{flex:1,overflow:"auto",p:`${t}px`,position:"relative",bgcolor:"background.default"},children:[n.jsxs(p.Box,{ref:s,sx:{width:"100%",display:"flex",flexDirection:"column","& > *":{flex:"1 1 0%",minHeight:0}},children:[e==="dashboard"&&n.jsx(Ul,{}),e==="orders"&&n.jsx(Jl,{}),e==="reports"&&n.jsx(lc,{}),e==="cameras"&&n.jsx(Zl,{}),e==="operations"&&n.jsx(tc,{}),e==="components"&&n.jsx(ql,{}),e==="login"&&n.jsx(cc,{})]}),e!=="login"&&n.jsx(dc,{})]})]})}const fc=300,hc=520;function gc({defaultLoginImage:e}={}){const[r,t]=z.useState(!0),o=De(k=>k.setDefaultLoginImage);z.useEffect(()=>{o(e||"")},[e,o]);const[i,a]=z.useState(300),[s,l]=z.useState(!1),d=_(k=>k.isDirty),g=_(k=>k.captureBaseline),f=_(k=>k.restoreBaseline),x=Pe(_(k=>k.settings.mode)),m=_(k=>k.settings.customFonts),h=_(k=>k.settings.customHeadFonts),y=z.useRef(null);z.useEffect(()=>{En(m),En(h)},[m,h]);const u=k=>{k.preventDefault(),y.current={x:k.clientX,w:i};const B=j=>{if(!y.current)return;const R=Math.max(fc,Math.min(hc,y.current.w+(j.clientX-y.current.x)));a(R)},S=()=>{y.current=null,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",B),window.addEventListener("mouseup",S)},b=()=>{d()?l(!0):t(!1)},v=()=>{t(!0),g()};return n.jsxs(p.Box,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[n.jsx(p.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[r?n.jsxs(p.Box,{sx:{display:"flex",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:i,flexShrink:0,borderRight:`1px solid ${x.studioBd}`,display:"flex",flexDirection:"column",bgcolor:x.card,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},children:n.jsx(_l,{onClose:b})}),n.jsx(p.Box,{onMouseDown:u,sx:{width:5,cursor:"col-resize",flexShrink:0,bgcolor:"divider",opacity:.4,"&:hover":{opacity:1,bgcolor:"primary.main"}}})]}):n.jsx(p.Tooltip,{title:"Open Theme Studio",placement:"right",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{onClick:v,sx:{position:"absolute",left:68,bottom:56,zIndex:10,bgcolor:"primary.main",color:"primary.contrastText",boxShadow:4,"&:hover":{bgcolor:"primary.dark"}},children:n.jsx(qs,{})})}),n.jsx(uc,{})]})}),n.jsxs(p.Dialog,{open:s,onClose:()=>l(!1),PaperProps:{sx:{borderRadius:3,width:300,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Save changes?"}),n.jsx(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:"You've made changes to the theme. Do you want to save them before leaving?"}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{const k=_.getState();if(k.editingSavedId){const B=k.savedThemes.find(S=>S.id===k.editingSavedId);B&&k.updateSaved(k.editingSavedId,B.name,k.settings)}else g();l(!1),t(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Save & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>{f(),l(!1),t(!1)},sx:{p:1.4,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Discard & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>l(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Keep editing"})]})]})]})}function xc(e){var s,l;const r=Hr(e),t=r.t,o=`${r.headFam},sans-serif`,i=`${r.bodyFam},sans-serif`,a=(d,g)=>({fontFamily:o,fontSize:d,fontWeight:r.wH1,lineHeight:r.headLH,color:g||t.textPrimary});if(typeof window<"u"&&typeof document<"u"){const d=["Roboto","Inter","DM Sans","Manrope","Plus Jakarta Sans","Nunito Sans","Figtree"],f=[e.fontFamily,e.headingFont].filter(Boolean).map(m=>m.replace(/"/g,"").replace(/'/g,"")),x=Array.from(new Set(f)).filter(m=>d.includes(m));if(x.length>0){const m="dynamic-google-fonts";let h=document.getElementById(m);const u=`https://fonts.googleapis.com/css2?${x.map(b=>`family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900`).join("&")}&display=swap`;h||(h=document.createElement("link"),h.id=m,h.rel="stylesheet",document.head.appendChild(h)),h.href!==u&&(h.href=u,(l=(s=document.fonts)==null?void 0:s.ready)==null||l.then(()=>window.dispatchEvent(new Event("resize"))))}}return to({palette:{mode:e.mode,primary:{main:r.pMain,dark:r.pal[700],light:r.pal[300],contrastText:t.pContrast},secondary:{main:r.sMain,dark:r.spal[700],light:r.spal[300],contrastText:t.sContrast},success:{main:e.successHex},warning:{main:e.warningHex},info:{main:e.infoHex},error:{main:e.errorHex},background:{default:t.bgDefault,paper:t.paper},text:{primary:t.textPrimary,secondary:t.textSecondary,disabled:t.textDisabled},divider:t.divider},shape:{borderRadius:r.r},typography:{fontFamily:i,fontSize:r.base,h1:a(r.tH1,r.hc1),h2:a(r.tH2,r.hc2),h3:a(r.tTitle,r.hc3),h4:a(r.tH4,r.hc4),h5:a(r.tH5,r.hc5),h6:a(r.tH6,r.hc6),body1:{fontFamily:i,fontSize:r.tBody,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},body2:{fontFamily:i,fontSize:r.tBodySm,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},caption:{fontFamily:i,fontSize:r.tCaption,lineHeight:r.bodyLH},button:{textTransform:r.btnCase,fontWeight:r.bwEmph}},components:{MuiCssBaseline:{styleOverrides:{"button, input, textarea, select":{fontFamily:"inherit"}}},MuiCard:{styleOverrides:{root:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiCardHeader:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiDialog:{styleOverrides:{paper:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiDialogTitle:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiButton:{styleOverrides:{root:{borderRadius:r.r,boxShadow:"none"}},defaultProps:{disableElevation:!0},variants:e.accentGradient?[{props:{variant:"contained"},style:{backgroundImage:r.accentBg}}]:[]},MuiChip:{styleOverrides:{root:{borderRadius:999,fontWeight:e.statusBold?700:500}}}},urmTable:{rowPaddingY:r.table.rowPy,cellPaddingX:r.table.cellPx,headerBg:r.table.headBg,rowDivider:r.table.rowBorder,colDivider:r.table.colBorder,cellAlignH:e.tableCellAlignH,cellAlignV:e.tableCellAlignV,striped:e.tableStripe,stripeBg:r.table.stripeBg},tokens:{toastW:e.toastW>0?e.toastW:void 0,cardBorder:r.toastDeco.border,cardShadow:r.toastDeco.boxShadow,cardBodyBorder:r.cardBorder==="none"?"none":r.cardBorder,cardBodyShadow:r.cardShadow,cardHdrBg:r.cardHdrBg,cardHdrBorder:r.cardHdrBorder,cardHdrAccent:r.cardHdrAccent,cardHeader:e.cardHeader,status:{errSoft:r.errSoft,warnSoft:r.warnSoft,infoSoft:r.infoSoft,sucSoft:r.sucSoft,errTxt:r.errTxt,warnTxt:r.warnTxt,infoTxt:r.infoTxt,sucTxt:r.sucTxt},notifPosition:e.notifPosition,notifStyle:e.notifStyle,notifAccent:e.notifAccent,notifAutoDismiss:e.notifAutoDismiss,toastBg:r.toastBg,autoDismissSec:e.autoDismissSec>0?e.autoDismissSec:void 0,statusBold:e.statusBold,cardHdrHex:e.cardHdrHex||void 0,containerPad:r.screenPad,cardGap:r.gap,edgePad:e.edgePadPx,highlight:t.highlight,highlightSoft:t.highlightSoft,highlightBd:t.highlightBd,headerBg:r.headerBg,canvasBg:r.canvasBg,accountPageBg:r.accountPageBg,accountCardBg:r.accountCardBg,brandGradient:r.brandGradient,gsAccentGradient:r.gsAccentGradient,gsModalBgDark:r.gsModalBgDark,gsArrowGradient:r.gsArrowGradient,loginPanelGradient:r.loginPanelGradient,reportsAccentTileGradient:r.reportsAccentTileGradient,reportsAccentCtaGradient:r.reportsAccentCtaGradient,reportsModalInnerHighlight:r.reportsModalInnerHighlight}})}exports.DEFAULT_SETTINGS=Ce;exports.ThemeStudio=gc;exports.buildMuiTheme=xc;exports.useThemeStore=_;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnieye-theme-studio",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",