const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/props-util/index.js"),r=require("../locale-provider/LocaleReceiver.js"),i=require("../config-provider/hooks/useConfigInject.js"),a=require("../vc-resize-observer/index.js"),o=require("../_util/vue-types/index.js"),s=require("../avatar/index.js"),c=require("../breadcrumb/index.js"),l=require("../_util/hooks/useDestroyed.js"),u=require("../_util/transButton.js"),d=require("../space/index.js"),f=require("./style/index.js");let p=require("vue"),m=require("@antsoo-lib/icons");var h=()=>({backIcon:e.vNodeType(),prefixCls:String,title:e.vNodeType(),subTitle:e.vNodeType(),breadcrumb:o.default.object,tags:e.vNodeType(),footer:e.vNodeType(),extra:e.vNodeType(),avatar:e.objectType(),ghost:{type:Boolean,default:void 0},onBack:Function}),g=(0,p.defineComponent)({compatConfig:{MODE:3},name:`APageHeader`,inheritAttrs:!1,props:h(),slots:Object,setup(e,{emit:o,slots:h,attrs:g}){let{prefixCls:_,direction:v,pageHeader:y}=i.default(`page-header`,e),[b,x]=f.default(_),S=(0,p.shallowRef)(!1),C=l.default(),w=({width:e})=>{C.value||(S.value=e<768)},T=(0,p.computed)(()=>e.ghost??y?.value?.ghost??!0),E=()=>e.backIcon??h.backIcon?.()??(v.value===`rtl`?(0,p.createVNode)(m.ArrowRightOutlined,null,null):(0,p.createVNode)(m.ArrowLeftOutlined,null,null)),D=t=>!t||!e.onBack?null:(0,p.createVNode)(r.default,{componentName:`PageHeader`,children:({back:e})=>(0,p.createVNode)(`div`,{class:`${_.value}-back`},[(0,p.createVNode)(u.default,{onClick:e=>{o(`back`,e)},class:`${_.value}-back-button`,"aria-label":e},{default:()=>[t]})])},null),O=()=>e.breadcrumb?(0,p.createVNode)(c.default,e.breadcrumb,null):h.breadcrumb?.(),k=()=>{let{avatar:t}=e,n=e.title??h.title?.(),r=e.subTitle??h.subTitle?.(),i=e.tags??h.tags?.(),a=e.extra??h.extra?.(),o=`${_.value}-heading`,c=n||r||i||a;if(!c)return null;let l=E(),u=D(l);return(0,p.createVNode)(`div`,{class:o},[(u||t||c)&&(0,p.createVNode)(`div`,{class:`${o}-left`},[u,t?(0,p.createVNode)(s.default,t,null):h.avatar?.(),n&&(0,p.createVNode)(`span`,{class:`${o}-title`,title:typeof n==`string`?n:void 0},[n]),r&&(0,p.createVNode)(`span`,{class:`${o}-sub-title`,title:typeof r==`string`?r:void 0},[r]),i&&(0,p.createVNode)(`span`,{class:`${o}-tags`},[i])]),a&&(0,p.createVNode)(`span`,{class:`${o}-extra`},[(0,p.createVNode)(d.default,null,{default:()=>[a]})])])},A=()=>{let t=e.footer??n.filterEmpty(h.footer?.());return n.isEmptyContent(t)?null:(0,p.createVNode)(`div`,{class:`${_.value}-footer`},[t])},j=e=>(0,p.createVNode)(`div`,{class:`${_.value}-content`},[e]);return()=>{let r=e.breadcrumb?.routes||h.breadcrumb,i=e.footer||h.footer,o=n.flattenChildren(h.default?.()),s=t.default(_.value,{"has-breadcrumb":r,"has-footer":i,[`${_.value}-ghost`]:T.value,[`${_.value}-rtl`]:v.value===`rtl`,[`${_.value}-compact`]:S.value},g.class,x.value);return b((0,p.createVNode)(a.default,{onResize:w},{default:()=>[(0,p.createVNode)(`div`,{...g,class:s},[O(),k(),o.length?j(o):null,A()])]}))}}}),_=e.withInstall(g);exports.default=_,exports.pageHeaderProps=h;