import{ATTR_MARK as e}from"../../StyleContext.mjs";import t from"../../../canUseDom.mjs";var n=`data-ant-cssinjs-cache-path`,r=`_FILE_STYLE__`;function i(e){return Object.keys(e).map(t=>`${t}:${e[t]}`).join(`;`)}var a,o=!0;function s(){if(!a&&(a={},t())){let e=document.createElement(`div`);e.className=n,e.style.position=`fixed`,e.style.visibility=`hidden`,e.style.top=`-9999px`,document.body.appendChild(e);let t=getComputedStyle(e).content||``;t=t.replace(/^"/,``).replace(/"$/,``),t.split(`;`).forEach(e=>{let[t,n]=e.split(`:`);a[t]=n});let r=document.querySelector(`style[${n}]`);r&&(o=!1,r.parentNode?.removeChild(r)),document.body.removeChild(e)}}function c(e){return s(),!!a[e]}function l(n){let i=a[n],s=null;if(i&&t())if(o)s=r;else{let t=document.querySelector(`style[${e}="${a[n]}"]`);t?s=t.innerHTML:delete a[n]}return[s,i]}export{n as ATTR_CACHE_MAP,r as CSS_FILE_STYLE,c as existPath,l as getStyleAndHash,s as prepare,i as serialize};