/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("@gsc-basic/utils"),n=require("../../hooks/useLocale.js"),t=require("./constants.js"),r=e.ref();function u(o,n=void 0){const u=e.getCurrentInstance()?e.inject(t.configProviderContextKey,r):r;return o?e.computed(()=>u.value?.[o]??n):u}const i=(n,i,s=!1)=>{const c=!!e.getCurrentInstance(),l=c?u():void 0,d=i?.provide??(c?e.provide:void 0);if(!d)return void console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const a=e.computed(()=>{const t=e.unref(n);return l?.value?o.deepMerge(l.value,t):t});return d(t.configProviderContextKey,a),d(t.localeContextKey,e.computed(()=>e.unref(a).locale)),d(t.zIndexContextKey,e.computed(()=>e.unref(a).zIndex)),d(t.sizeInjectionKey,{size:e.computed(()=>e.unref(a).size||"")}),!s&&r.value||(r.value=e.unref(a)),a};exports.provideGlobalConfig=i,exports.useGlobalComponentSettings=function(o){const r=u(),s=n.useLocale(e.computed(()=>r.value?.locale)),c=e.computed(()=>e.unref(o)||r.value?.size||"");return i(e.computed(()=>e.unref(r)||{})),{locale:s,zIndex:r.value?.zIndex||t.defaultInitialZIndex,size:c}},exports.useGlobalConfig=u;