"use strict";const q=require("../../../../../@emotion_sheet@1.1.1/node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js"),m=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Serializer.js"),C=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Enum.js"),y=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Middleware.js"),N=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Parser.js"),o=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Tokenizer.js"),x=require("../../../../../stylis@4.0.13/node_modules/stylis/src/Utility.js");var I=function(e){return e.length?e[e.length-1]:null},O=function(e,t,r){for(var i=0,s=0;i=s,s=o.peek(),i===38&&s===12&&(t[r]=1),!o.token(s);)o.next();return o.slice(e,o.position)},T=function(e,t){var r=-1,i=44;do switch(o.token(i)){case 0:i===38&&o.peek()===12&&(t[r]=1),e[r]+=O(o.position-1,t,r);break;case 2:e[r]+=o.delimit(i);break;case 4:if(i===44){e[++r]=o.peek()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=x.from(i)}while(i=o.next());return e},S=function(e,t){return o.dealloc(T(o.alloc(e),t))},b=new WeakMap,D=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!b.get(r))&&!i){b.set(e,!0);for(var s=[],l=S(t,s),c=r.props,p=0,h=0;p<l.length;p++)for(var u=0;u<c.length;u++,h++)e.props[h]=s[p]?l[p].replace(/&\f/g,c[u]):c[u]+" "+l[p]}}},M=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}},V="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",W=function(e){return!!e&&e.type==="comm"&&e.children.indexOf(V)>-1},j=function(e){return function(t,r,i){if(t.type==="rule"){var s=t.value.match(/(:first|:nth|:nth-last)-child/g);if(s&&e.compat!==!0){var l=r>0?i[r-1]:null;if(l&&W(I(l.children)))return;s.forEach(function(c){console.error('The pseudo class "'+c+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+c.split("-child")[0]+'-of-type".')})}}}},E=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},U=function(e,t){for(var r=e-1;r>=0;r--)if(!E(t[r]))return!0;return!1},k=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},z=function(e,t,r){!E(e)||(e.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),k(e)):U(t,r)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),k(e)))},L=[y.prefixer],F=function(e){var t=e.key;if(process.env.NODE_ENV!=="production"&&!t)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
If multiple caches share the same key they might "fight" for each other's style elements.`);if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(n){var f=n.getAttribute("data-emotion");f.indexOf(" ")!==-1&&(document.head.appendChild(n),n.setAttribute("data-s",""))})}var i=e.stylisPlugins||L;if(process.env.NODE_ENV!=="production"&&/[^a-z-]/.test(t))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+t+'" was passed');var s={},l,c=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(n){for(var f=n.getAttribute("data-emotion").split(" "),d=1;d<f.length;d++)s[f[d]]=!0;c.push(n)});var p,h=[D,M];process.env.NODE_ENV!=="production"&&h.push(j({get compat(){return v.compat}}),z);{var u,w=[m.stringify,process.env.NODE_ENV!=="production"?function(n){n.root||(n.return?u.insert(n.return):n.value&&n.type!==C.COMMENT&&u.insert(n.value+"{}"))}:y.rulesheet(function(n){u.insert(n)})],A=y.middleware(h.concat(i,w)),_=function(f){return m.serialize(N.compile(f),A)};p=function(f,d,g,P){u=g,process.env.NODE_ENV!=="production"&&d.map!==void 0&&(u={insert:function(R){g.insert(R+d.map)}}),_(f?f+"{"+d.styles+"}":d.styles),P&&(v.inserted[d.name]=!0)}}var v={key:t,sheet:new q.StyleSheet({key:t,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:p};return v.sheet.hydrate(c),v};module.exports=F;
//# sourceMappingURL=emotion-cache.browser.esm.js.map
