import"./rolldown-runtime-BM3Ffeng.js";import{l as e,ot as t,u as n}from"./element-plus-vendor-BF9PNysW.js";import{A as r,C as i,D as a,E as o,G as s,I as c,N as l,O as u,P as d,Pt as f,Q as p,Tt as m,Xt as h,Z as g,et as _,ht as v,k as y,l as b,nt as x,ot as S,pt as C,rt as w,x as T}from"./vue-vendor-DMUmTARL.js";import{Ci as E}from"./icons-vendor-Db5MGAkr.js";import{t as D}from"./_plugin-vue_export-helper-CWyGVBf-.js";var O={class:`flex min-h-0 flex-1 flex-col`},k={key:0,class:`space-y-6`},A={key:1,class:`border border-border bg-surface p-6 shadow-sm sm:rounded-xl md:p-8`},j=[`data-admin-search-target`],M={key:2,class:`space-y-6 border border-border bg-surface p-6 shadow-sm sm:rounded-xl md:p-8`},N={key:0,class:`pointer-events-auto absolute bottom-16 right-4 z-20 xl:bottom-0 xl:right-16`},P=D(c({__name:`AdminSettingLayout`,props:{plain:{type:Boolean,default:!1},showSaveButton:{type:Boolean,default:!1},saveLoading:{type:Boolean,default:!1},saveButtonText:{type:String,default:`保存更改`},tabs:{type:Array,default:()=>[]},activeTab:{type:String,default:``}},emits:[`save`,`update:activeTab`],setup(c,{emit:D}){let P=c,F=D,I=o({get:()=>P.activeTab||(P.tabs.length?P.tabs[0].name:``),set:e=>F(`update:activeTab`,e)}),L=m(null),R=m(!0),z=m(!1),B=null,V=()=>{B&&=(B.disconnect(),null)},H=async()=>{if(await s(),V(),!L.value){R.value=!0;return}B=new IntersectionObserver(e=>{R.value=e[0].isIntersecting},{threshold:0}),B.observe(L.value)};return g(()=>{z.value=!0,H()}),C(()=>P.showSaveButton,()=>{H()}),p(()=>{V()}),(o,s)=>{let p=e,m=n,g=t;return _(),r(`div`,O,[c.plain?(_(),r(`div`,k,[w(o.$slots,`default`,{},void 0,!0)])):c.tabs&&c.tabs.length?(_(),r(`div`,A,[d(m,{modelValue:I.value,"onUpdate:modelValue":s[0]||=e=>I.value=e,class:`zf-admin-setting-tabs`},{default:v(()=>[(_(!0),r(T,null,x(c.tabs,e=>(_(),u(p,{key:e.name,name:e.name},{label:v(()=>[a(`span`,{class:`zf-admin-setting-tab-label`,"data-admin-search-target":e.name},[e.icon?(_(),u(S(e.icon),{key:0,class:`zf-admin-setting-tab-icon`})):y(``,!0),a(`span`,null,h(e.label),1)],8,j)]),default:v(()=>[w(o.$slots,`tab-${e.name}`,{},void 0,!0)]),_:2},1032,[`name`]))),128))]),_:3},8,[`modelValue`])])):(_(),r(`div`,M,[w(o.$slots,`default`,{},void 0,!0)])),o.$slots.footer||c.showSaveButton?(_(),r(`div`,{key:3,ref_key:`footerRef`,ref:L,class:`-p-4 mt-8 flex items-center justify-between gap-4 px-6`},[w(o.$slots,`footer`,{},()=>[c.showSaveButton?(_(),r(T,{key:0},[s[3]||=a(`div`,{class:`text-xs text-placeholder`},null,-1),d(g,{type:`primary`,icon:f(E),loading:c.saveLoading,size:`large`,class:`!h-10 !rounded-lg !px-8 !text-sm`,onClick:s[1]||=e=>o.$emit(`save`)},{default:v(()=>[l(h(c.saveButtonText),1)]),_:1},8,[`icon`,`loading`])],64)):y(``,!0)],!0)],512)):y(``,!0),z.value?(_(),u(i,{key:4,to:`#admin-float-layer`},[d(b,{name:`zf-admin-float-btn`},{default:v(()=>[(c.showSaveButton||o.$slots.floatButton)&&!R.value?(_(),r(`div`,N,[w(o.$slots,`floatButton`,{},()=>[c.showSaveButton?(_(),u(g,{key:0,type:`primary`,icon:f(E),loading:c.saveLoading,size:`large`,class:`!rounded-full !px-5 shadow-lg`,onClick:s[2]||=e=>o.$emit(`save`)},{default:v(()=>[...s[4]||=[l(` 保存 `,-1)]]),_:1},8,[`icon`,`loading`])):y(``,!0)],!0)])):y(``,!0)]),_:3})])):y(``,!0)])}}}),[[`__scopeId`,`data-v-f976d844`]]);export{P as t};