import{useContext as e,createElement as n,useRef as t,useLayoutEffect as o,Fragment as s}from"react";import{StyleSheet as r}from"../../sheet/dist/emotion-sheet.esm.js";import{w as i,T as l,i as c}from"./emotion-element-fecc36da.esm.js";export{T as ThemeContext,a as ThemeProvider,w as withEmotionCache}from"./emotion-element-fecc36da.esm.js";import"../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import{insertStyles as m,getRegisteredStyles as u}from"../../utils/dist/emotion-utils.esm.js";import{serializeStyles as d}from"../../serialize/dist/emotion-serialize.esm.js";var f=!1,h=i((function(s,a){"production"===process.env.NODE_ENV||f||!s.className&&!s.css||(console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"),f=!0);var i=s.styles,u=d([i],void 0,"function"==typeof i||Array.isArray(i)?e(l):void 0);if(!c){for(var h,p=u.name,y=u.styles,v=u.next;void 0!==v;)p+=" "+v.name,y+=v.styles,v=v.next;var g=!0===a.compat,E=a.insert("",{name:p,styles:y},a.sheet,g);return g?null:n("style",((h={})["data-emotion"]=a.key+"-global "+p,h.dangerouslySetInnerHTML={__html:E},h.nonce=a.sheet.nonce,h))}var _=t();return o((function(){var e=a.key+"-global",n=new r({key:e,nonce:a.sheet.nonce,container:a.sheet.container,speedy:a.sheet.isSpeedy}),t=!1,o=document.querySelector('style[data-emotion="'+e+" "+u.name+'"]');return a.sheet.tags.length&&(n.before=a.sheet.tags[0]),null!==o&&(t=!0,o.setAttribute("data-emotion",e),n.hydrate([o])),_.current=[n,t],function(){n.flush()}}),[a]),o((function(){var e=_.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==u.next&&m(a,u.next,!0),n.tags.length){var t=n.tags[n.tags.length-1].nextElementSibling;n.before=t,n.flush()}a.insert("",u,n,!1)}}),[a,u.name]),null}));function p(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return d(n)}"production"!==process.env.NODE_ENV&&(h.displayName="EmotionGlobal");var y=function(){var e=p.apply(void 0,arguments),n="animation-"+e.name;return{name:n,styles:"@keyframes "+n+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},v=function e(n){for(var t=n.length,o=0,s="";o<t;o++){var r=n[o];if(null!=r){var a=void 0;switch(typeof r){case"boolean":break;case"object":if(Array.isArray(r))a=e(r);else for(var i in"production"!==process.env.NODE_ENV&&void 0!==r.styles&&void 0!==r.name&&console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component."),a="",r)r[i]&&i&&(a&&(a+=" "),a+=i);break;default:a=r}a&&(s&&(s+=" "),s+=a)}}return s};function g(e,n,t){var o=[],s=u(e,o,t);return o.length<2?t:s+n(o)}var E=i((function(t,o){var r,a="",i="",u=!1,f=function(){if(u&&"production"!==process.env.NODE_ENV)throw new Error("css can only be used during render");for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var s=d(n,o.registered);if(c)m(o,s,!1);else{var r=m(o,s,!1);void 0!==r&&(a+=r)}return c||(i+=" "+s.name),o.key+"-"+s.name},h={css:f,cx:function(){if(u&&"production"!==process.env.NODE_ENV)throw new Error("cx can only be used during render");for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return g(o.registered,f,v(n))},theme:e(l)},p=t.children(h);return u=!0,c||0===a.length?p:n(s,null,n("style",((r={})["data-emotion"]=o.key+" "+i.substring(1),r.dangerouslySetInnerHTML={__html:a},r.nonce=o.sheet.nonce,r)),p)}));if("production"!==process.env.NODE_ENV&&(E.displayName="EmotionClassNames"),"production"!==process.env.NODE_ENV){var _="undefined"!=typeof document,N="undefined"!=typeof jest;if(_&&!N){var b=_?window:global,x="__EMOTION_REACT_"+"11.4.0".split(".")[0]+"__";b[x]&&console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used."),b[x]=!0}}export{E as ClassNames,h as Global,p as css,y as keyframes};
//# sourceMappingURL=emotion-react.esm.js.map
