import{shallowRef as a,defineComponent as u,computed as o,provide as l,watch as p,unref as c,triggerRef as d,inject as v}from"vue";import"../_util/cssinjs/StyleContext.mjs";import f from"../_util/cssinjs/hooks/useCacheToken.mjs";import T from"../_util/cssinjs/theme/createTheme.mjs";import"../_util/cssinjs/transformers/legacyLogicalProperties.mjs";import{objectType as h}from"../_util/type.mjs";import k from"./themes/default/index.mjs";import m from"./themes/seed.mjs";import g from"./util/alias.mjs";import"../config-provider/context.mjs";const C=T(k),D={token:m,hashed:!0},s=Symbol("DesignTokenContext"),n=a(),x=e=>{l(s,e),p(e,()=>{n.value=c(e),d(n)},{immediate:!0,deep:!0})},q=u({props:{value:h()},setup(e,{slots:t}){return x(o(()=>e.value)),()=>t.default?.()}});function z(){const e=v(s,o(()=>n.value||D)),t=o(()=>`${e.value.hashed||""}`),r=o(()=>e.value.theme||C),i=f(r,o(()=>[m,e.value.token]),o(()=>({salt:t.value,override:{override:e.value.token,...e.value.components},formatToken:g})));return[r,o(()=>i.value[0]),o(()=>e.value.hashed?i.value[1]:"")]}export{q as DesignTokenProvider,D as defaultConfig,n as globalDesignTokenApi,x as useDesignTokenProvider,z as useToken};
