const e=require("../_util/cssinjs/theme/createTheme.js"),t=require("./DisabledContext.js"),n=require("./SizeContext.js"),r=require("./context.js"),i=require("../locale/en_US.js"),a=require("../locale-provider/LocaleReceiver.js"),o=require("../theme/themes/seed.js"),s=require("../theme/internal.js"),c=require("./renderEmpty.js"),l=require("../locale/index.js"),u=require("../locale-provider/index.js"),d=require("../message/index.js"),f=require("../notification/index.js"),p=require("./cssVariables.js"),m=require("./hooks/useTheme.js"),h=require("./style/index.js");let g=require("vue");function _(){return b.prefixCls||`ant`}function v(){return b.iconPrefixCls||`anticon`}var y=(0,g.reactive)({}),b=(0,g.reactive)({});(0,g.watchEffect)(()=>{Object.assign(b,y),b.prefixCls=_(),b.iconPrefixCls=v(),b.getPrefixCls=(e,t)=>t||(e?`${b.prefixCls}-${e}`:b.prefixCls),b.getRootPrefixCls=()=>b.prefixCls?b.prefixCls:_()});var x,S=e=>{x&&x(),x=(0,g.watchEffect)(()=>{Object.assign(y,(0,g.reactive)(e)),Object.assign(b,(0,g.reactive)(e))}),e.theme&&p.registerTheme(_(),e.theme)},C=()=>({getPrefixCls:(e,t)=>t||(e?`${_()}-${e}`:_()),getIconPrefixCls:v,getRootPrefixCls:()=>b.prefixCls?b.prefixCls:_()}),w=(0,g.defineComponent)({compatConfig:{MODE:3},name:`AConfigProvider`,inheritAttrs:!1,props:r.configProviderProps(),setup(p,{slots:_}){let v=r.useConfigContextInject(),b=(e,t)=>{let{prefixCls:n=`ant`}=p;if(t)return t;let r=n||v.getPrefixCls(``);return e?`${r}-${e}`:r},x=(0,g.computed)(()=>p.iconPrefixCls||v.iconPrefixCls.value||`anticon`),S=(0,g.computed)(()=>x.value!==v.iconPrefixCls.value),C=(0,g.computed)(()=>p.csp||v.csp?.value),w=h.default(x),T=m.default((0,g.computed)(()=>p.theme),(0,g.computed)(()=>v.theme?.value)),E=e=>(p.renderEmpty||_.renderEmpty||v.renderEmpty||c.default)(e),D=(0,g.computed)(()=>p.autoInsertSpaceInButton??v.autoInsertSpaceInButton?.value),O=(0,g.computed)(()=>p.locale||v.locale?.value);(0,g.watch)(O,()=>{y.locale=O.value},{immediate:!0});let k=(0,g.computed)(()=>p.direction||v.direction?.value),A=(0,g.computed)(()=>p.space??v.space?.value),j=(0,g.computed)(()=>p.virtual??v.virtual?.value),M=(0,g.computed)(()=>p.dropdownMatchSelectWidth??v.dropdownMatchSelectWidth?.value),N=(0,g.computed)(()=>p.getTargetContainer===void 0?v.getTargetContainer?.value:p.getTargetContainer),P=(0,g.computed)(()=>p.getPopupContainer===void 0?v.getPopupContainer?.value:p.getPopupContainer),F=(0,g.computed)(()=>p.pageHeader===void 0?v.pageHeader?.value:p.pageHeader),I=(0,g.computed)(()=>p.input===void 0?v.input?.value:p.input),L=(0,g.computed)(()=>p.pagination===void 0?v.pagination?.value:p.pagination),R=(0,g.computed)(()=>p.form===void 0?v.form?.value:p.form),z=(0,g.computed)(()=>p.select===void 0?v.select?.value:p.select),B=(0,g.computed)(()=>p.componentSize),V=(0,g.computed)(()=>p.componentDisabled),H=(0,g.computed)(()=>p.wave??v.wave?.value),U={csp:C,autoInsertSpaceInButton:D,locale:O,direction:k,space:A,virtual:j,dropdownMatchSelectWidth:M,getPrefixCls:b,iconPrefixCls:x,theme:(0,g.computed)(()=>T.value??v.theme?.value),renderEmpty:E,getTargetContainer:N,getPopupContainer:P,pageHeader:F,input:I,pagination:L,form:R,select:z,componentSize:B,componentDisabled:V,transformCellText:(0,g.computed)(()=>p.transformCellText),wave:H},W=(0,g.computed)(()=>{let{algorithm:t,token:n,...r}=T.value||{},i=t&&(!Array.isArray(t)||t.length>0)?e.default(t):void 0;return{...r,theme:i,token:{...o.default,...n}}}),G=(0,g.computed)(()=>{let e={};return O.value&&(e=O.value.Form?.defaultValidateMessages||i.default.Form?.defaultValidateMessages||{}),p.form&&p.form.validateMessages&&(e={...e,...p.form.validateMessages}),e});r.useConfigContextProvider(U),r.useProvideGlobalForm({validateMessages:G}),n.useProviderSize(B),t.useProviderDisabled(V);let K=e=>{let t=S.value?w(_.default?.()):_.default?.();if(p.theme){let e=function(){return t}();t=(0,g.createVNode)(s.DesignTokenProvider,{value:W.value},{default:()=>[e]})}return(0,g.createVNode)(u.default,{locale:O.value||e,ANT_MARK__:l.ANT_MARK},{default:()=>[t]})};return(0,g.watchEffect)(()=>{k.value&&(d.default.config({rtl:k.value===`rtl`}),f.default.config({rtl:k.value===`rtl`}))}),()=>(0,g.createVNode)(a.default,{children:(e,t,n)=>K(n)},null)}});w.config=S,w.install=function(e){e.component(w.name,w)},exports.default=w,exports.defaultIconPrefixCls=r.defaultIconPrefixCls,exports.globalConfig=C,exports.globalConfigForApi=b;