"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),m=require("@aplus-frontend/antdv"),l=require("lodash-unified"),C=require("../utils/warning.js"),n=require("../utils/config-provider-preset.js"),P=require("./config-provider-props.js"),h=require("./constants.js"),p=require("./hooks/use-global-config.js");function b(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!r.isVNode(o)}const a=r.ref({}),T=r.defineComponent({name:"AplusConfigProvider",props:P.configProviderProps(),setup(o,{slots:c}){C.useDevWarning("ConfigProvider")(!o.uiMode,"breaking","uiMode has been remove, see migrate guide https://aplus.aplnk.com/aplus-ui/guide/migrate-7.2.html");function e(i,f){return o[i]??t.value?.[i]??f}const t=p.useGlobalConfig(),s=r.computed(()=>l.merge(l.cloneDeep(t.value?.aplusToken||{}),o.aplusToken)),d=r.computed(()=>l.merge({...t.value?.valueTypeMap??{}},o.valueTypeMap)),g=r.computed(()=>({namespace:e("namespace",h.DEFAULT_NAMESPACE),apGrid:e("apGrid"),agGrid:e("agGrid"),apProCard:e("apProCard"),apImage:e("apImage"),apTitle:e("apTitle"),searchForm:e("searchForm"),apUpload:e("apUpload"),apDescriptions:e("apDescriptions"),apFilePreview:e("apFilePreview"),apExportGroup:e("apExportGroup"),apView:e("apView"),aplusLocale:e("aplusLocale"),aplusToken:s.value,api:e("api"),valueTypeMap:d.value,downloadCenterTriggerConfig:e("downloadCenterTriggerConfig"),scrollYDomName:e("scrollYDomName"),viewCacheOption:e("viewCacheOption"),maskVisible:e("maskVisible")})),v=p.provideGlobalConfig(g);let u=!0;return r.watch(()=>o,i=>{a.value=n.mergeAntdProviderConfigWithCache(n.mergeAntdProvideConfig(i),a.value)},{deep:!0,immediate:!0}),r.onActivated(()=>{if(u){u=!1;return}a.value=n.mergeAntdProviderConfigWithCache(n.mergeAntdProvideConfig(o),a.value)}),()=>{let i;return r.createVNode(m.ConfigProvider,a.value,b(i=r.renderSlot(c,"default",{config:v?.value}))?i:{default:()=>[i]})}}});exports.ConfigProvider=T;exports.globalConfigCached=a;
