import s from"../../../canUseDom.mjs";import{ATTR_MARK as d}from"../../StyleContext.mjs";const l="data-ant-cssinjs-cache-path",u="_FILE_STYLE__";function y(e){return Object.keys(e).map(t=>{const n=e[t];return`${t}:${n}`}).join(";")}let o,c=!0;function m(){if(!o&&(o={},s())){const e=document.createElement("div");e.className=l,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(i=>{const[r,a]=i.split(":");o[r]=a});const n=document.querySelector(`style[${l}]`);n&&(c=!1,n.parentNode?.removeChild(n)),document.body.removeChild(e)}}function h(e){return m(),!!o[e]}function S(e){const t=o[e];let n=null;if(t&&s())if(c)n=u;else{const i=document.querySelector(`style[${d}="${o[e]}"]`);i?n=i.innerHTML:delete o[e]}return[n,t]}export{l as ATTR_CACHE_MAP,u as CSS_FILE_STYLE,h as existPath,S as getStyleAndHash,m as prepare,y as serialize};
