import"./rolldown-runtime-Bh1tDfsg.js";import{Ci as e,Cn as t,Mi as n,Nn as r,Si as i,Sn as a,bn as o,cr as s,hn as c,ir as l,ki as u,xn as d}from"./ra-BWTkRGwR.js";import{Ut as f}from"./mui-7yojldoe.js";import{K as p}from"./serverVersion-CTVcDU76.js";import{d as m,n as h,s as g,t as _}from"./i18n-C38mAdbY.js";n();var v=u(),y=({message:e,onBack:n})=>{let s=p(),c=i(),l=`Ketesa`,u=`./images/logo.webp`,_=`./images/logo.webp`,y=``;return s.name&&(l=s.name),s.logo_url&&(u=s.logo_url,_=s.logo_url),s.background_url&&(y=s.background_url),(0,v.jsxs)(h,{backgroundUrl:y,children:[!y&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`login-orb login-orb-1`}),(0,v.jsx)(`div`,{className:`login-orb login-orb-2`}),(0,v.jsx)(`div`,{className:`login-orb login-orb-3`})]}),(0,v.jsxs)(o,{className:`card`,children:[(0,v.jsx)(a,{className:`avatar`,children:(0,v.jsx)(t,{sx:{width:{xs:`80px`,sm:`120px`},height:{xs:`80px`,sm:`120px`}},src:u})}),(0,v.jsx)(a,{className:`hint`,children:c(`ketesa.auth.welcome`,{name:l})}),(0,v.jsxs)(a,{className:`form`,children:[(0,v.jsx)(r,{variant:`h6`,sx:{marginBottom:`0.5rem`},children:c(`ra.page.authentication_error`)}),(0,v.jsx)(r,{variant:`body2`,sx:{color:`text.secondary`},children:e})]}),(0,v.jsx)(f,{className:`actions`,children:(0,v.jsx)(d,{variant:`contained`,type:`button`,color:`primary`,onClick:n,fullWidth:!0,children:c(`ra.action.back`)})})]}),(0,v.jsx)(m,{children:(0,v.jsx)(g,{logoSrc:_})})]})},b=async(t,{message:n,onBack:r})=>{let i=s({palette:{mode:window.matchMedia?.(`(prefers-color-scheme: dark)`)?.matches??!1?`dark`:`light`}}),a=await _();t.render((0,v.jsxs)(l,{theme:i,children:[(0,v.jsx)(c,{}),(0,v.jsx)(e,{value:a,children:(0,v.jsx)(y,{message:n,onBack:r})})]}))};export{b as renderAuthCallbackError};