import{i as X,r as i,d as q,j as e,L as Z}from"./react.6693569e.js";import{u as C,s as p,p as tt,q as et,t as F}from"./index.ab3d776b.js";import{C as ot}from"./Cover.fc91526c.js";import{o as st}from"./mobxreact.esm.d8ee88ee.js";import{L as rt,E as it,a as nt,b as at}from"./LayoutChooser.5845102f.js";import{l as m}from"./size.d81ce6e6.js";import{G as ct}from"./index.0a6cc9fb.js";import{m as lt,S as dt}from"./antd.e57bc55d.js";import"./ColorPicker.0ba20714.js";/* empty css              *//* empty css              *//* empty css              */import"./LogoForm.5580ee89.js";/* empty css               */const pt="_background_m2jst_1",mt="_content_m2jst_7",ht="_logo_m2jst_13",ut="_entry_m2jst_14",gt="_layoutChooser_m2jst_21",vt="_layout_m2jst_21",r={background:pt,content:mt,logo:ht,entry:ut,layoutChooser:gt,layout:vt};function _t(){var v,_,b,y,w,L,O,S,k,N,x,E,R,f,z,j,U,T,$,D;const{T:J}=C(),h=X(),o=p.routeStore.layouts,u=(v=p.settingsStore.main.default)==null?void 0:v.colors,t=p.settingsStore.layoutChooser,g=(_=p.currentUserStore.currentUser)==null?void 0:_.status;i.exports.useEffect(()=>{var s;g===1||g===2?(s=o[0])!=null&&s.id&&h.push({pathname:`${o[0].id}/app-entry`}):o.length===1?h.push({pathname:`${o[0].id}/app-entry`}):o.length===0&&lt.info(J("layoutChoose.intercept"),0)},[h,o,g]),i.exports.useEffect(()=>{u&&tt(et({...u}))},[u]);const[P,Q]=i.exports.useState({}),n=i.exports.useCallback(()=>{var d,a,c,l,G,I,W,Y,A,B,H,K,M,V;const s=(a=(d=t==null?void 0:t.entry)==null?void 0:d.position)!=null&&a.isCenteredHorizontally?{position:"relative",top:((l=(c=t==null?void 0:t.entry)==null?void 0:c.position)==null?void 0:l.top)||void 0,right:((I=(G=t==null?void 0:t.entry)==null?void 0:G.position)==null?void 0:I.right)||void 0,width:Math.floor((window.innerWidth*.8-16)/164)>o.length?void 0:Math.floor((window.innerWidth*.8-16)/164)*164+16,maxWidth:"80vw"}:{position:"absolute",top:((Y=(W=t==null?void 0:t.entry)==null?void 0:W.position)==null?void 0:Y.top)||void 0,right:((B=(A=t==null?void 0:t.entry)==null?void 0:A.position)==null?void 0:B.right)||void 0,bottom:((K=(H=t==null?void 0:t.entry)==null?void 0:H.position)==null?void 0:K.bottom)||void 0,left:((V=(M=t==null?void 0:t.entry)==null?void 0:M.position)==null?void 0:V.left)||void 0,width:`calc(164px * ${(o==null?void 0:o.length)||0})`,maxWidth:"80vw"};Q(s)},[t]);return i.exports.useLayoutEffect(()=>{n()},[n]),i.exports.useEffect(()=>(window.addEventListener("resize",n),()=>window.removeEventListener("onresize",n)),[n]),q(ot,{children:[e("div",{className:r.background,style:{backgroundColor:((b=t==null?void 0:t.backgroundImage)==null?void 0:b.color)||rt},children:((y=t==null?void 0:t.backgroundImage)==null?void 0:y.src)&&e("div",{className:r.background,children:e("img",{src:F({url:t.backgroundImage.src}),style:{fontSize:m,width:"100%",height:"100%"},alt:""})})}),q("div",{className:r.content,children:[e("div",{className:r.logo,children:e("div",{style:{position:"absolute",top:((L=(w=t.logo)==null?void 0:w.position)==null?void 0:L.top)||void 0,right:((S=(O=t.logo)==null?void 0:O.position)==null?void 0:S.right)||void 0,bottom:((N=(k=t.logo)==null?void 0:k.position)==null?void 0:N.bottom)||void 0,left:((E=(x=t.logo)==null?void 0:x.position)==null?void 0:E.left)||void 0},children:t.logo.src?e("img",{style:{height:((f=(R=t.logo)==null?void 0:R.size)==null?void 0:f.height)||m,width:((j=(z=t.logo)==null?void 0:z.size)==null?void 0:j.width)||m},src:F({url:t.logo.src}),alt:""}):e(ct,{style:{fontSize:((T=(U=t.logo)==null?void 0:U.size)==null?void 0:T.width)||((D=($=t.logo)==null?void 0:$.size)==null?void 0:D.height)||m}})})}),e("div",{className:r.entry,children:e("div",{style:P,children:o.length>0?e("div",{className:r.layoutChooser,children:o.map((s,d)=>{var a,c,l;return e(Z,{to:`${s.id}/app-entry`,children:e("div",{className:r.layout,style:{color:((a=t==null?void 0:t.entry)==null?void 0:a.color)||it,borderColor:((c=t==null?void 0:t.entry)==null?void 0:c.borderColor)||nt,backgroundColor:((l=t==null?void 0:t.entry)==null?void 0:l.backgroundColor)||at},children:s.title})},d)})}):e(dt,{spinning:!0})})})]})]})}const Ut=st(_t);export{Ut as default};
