import{__spreadArray as e,__assign as t}from"tslib";import n from"@emotion/is-prop-valid";import o,{useRef as r,useState as s,useMemo as i,useEffect as a,useContext as c,useDebugValue as l,createElement as u}from"react";import p from"shallowequal";import*as d from"stylis";import h from"@emotion/unitless";var f="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",m="6.0.8",y=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),v={},g=/invalid hook call/i,S=new Set,w=function(t,n){if("production"!==process.env.NODE_ENV){var o=n?' with the id of "'.concat(n,'"'):"",s="The component ".concat(t).concat(o," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",i=console.error;try{var a=!0;console.error=function(t){for(var n=[],o=1;o?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function I(e){return e.replace(_,"-").replace(C,"")}var A=/(a)(d)/gi,O=function(e){return String.fromCharCode(e+(e>25?39:97))};function D(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=O(t%52)+n;return(O(t%52)+n).replace(A,"$1-$2")}var R,T=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},j=function(e){return T(5381,e)};function x(e){return D(j(e)>>>0)}function k(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function V(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var F="function"==typeof Symbol&&Symbol.for,M=F?Symbol.for("react.memo"):60115,$=F?Symbol.for("react.forward_ref"):60112,z={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},B={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},G={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},L=((R={})[$]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},R[M]=G,R);function Y(e){return("type"in(t=e)&&t.type.$$typeof)===M?G:"$$typeof"in e?L[e.$$typeof]:z;var t}var W=Object.defineProperty,q=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,J=Object.getPrototypeOf,X=Object.prototype;function Z(e,t,n){if("string"!=typeof t){if(X){var o=J(t);o&&o!==X&&Z(e,o,n)}var r=q(t);H&&(r=r.concat(H(t)));for(var s=Y(e),i=Y(t),a=0;a ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document ``\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to ``, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a ``"}:{};function ie(){for(var e=[],t=0;t0?" Args: ".concat(n.join(", ")):"")):new Error(ie.apply(void 0,e([se[t]],n,!1)).trim())}var ce=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,r=o;e>=r;)if((r<<=1)<0)throw ae(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var s=o;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],o=this.indexOfGroup(e),r=o+n,s=o;s1073741824))throw ae(16,"".concat(t));return le.set(e,t),ue.set(t,e),t},he=("style[".concat(f,"][").concat("data-styled-version",'="').concat("6.0.8",'"]'),new RegExp("^".concat(f,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),function(e){for(var t=e.getTag(),n=t.length,o="",r=function(n){var r=function(e){return ue.get(e)}(n);if(void 0===r)return"continue";var s=e.names.get(r),i=t.getGroup(n);if(void 0===s||0===i.length)return"continue";var a="".concat(f,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),o+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat("/*!sc*/\n")},s=0;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0?".".concat(t):e},u=c.slice();u.push(function(e){e.type===d.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(be,n).replace(o,l))}),i.prefix&&u.push(d.prefixer),u.push(d.stringify);var p=function(e,r,s,a){void 0===r&&(r=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=r,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(Ee,""),l=d.compile(s||r?"".concat(s," ").concat(r," { ").concat(c," }"):c);i.namespace&&(l=Ne(l,i.namespace));var p=[];return d.serialize(l,d.middleware(u.concat(d.rulesheet(function(e){return p.push(e)})))),p};return p.hash=c.length?c.reduce(function(e,t){return t.name||ae(15),T(e,t.name)},5381).toString():"",p}var _e=new we,Ce=Pe(),Ie=o.createContext({shouldForwardProp:void 0,styleSheet:_e,stylis:Ce}),Ae=Ie.Consumer,Oe=o.createContext(void 0);function De(){return c(Ie)}function Re(e){var t=s(e.stylisPlugins),n=t[0],r=t[1],c=De().styleSheet,l=i(function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target,c]),u=i(function(){return Pe({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})},[e.enableVendorPrefixes,e.namespace,n]);a(function(){p(n,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]);var d=i(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:l,stylis:u}},[e.shouldForwardProp,l,u]);return o.createElement(Ie.Provider,{value:d},o.createElement(Oe.Provider,{value:u},e.children))}var Te=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ce);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,re(this,function(){throw ae(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Ce),this.name+e.hash},e}(),je=function(e){return e>="A"&&e<="Z"};function xe(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(r,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}o=ee(o,s),this.staticRulesId=s}else{for(var a=T(this.baseHash,n.hash),c="",l=0;l>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),o=ee(o,d)}}return o},e}(),Be=o.createContext(void 0),Ge=Be.Consumer;function Le(){var e=c(Be);if(!e)throw ae(18);return e}function Ye(e){var n=o.useContext(Be),r=i(function(){return function(e,n){if(!e)throw ae(14);if(K(e)){var o=e(n);if("production"!==process.env.NODE_ENV&&(null===o||Array.isArray(o)||"object"!=typeof o))throw ae(7);return o}if(Array.isArray(e)||"object"!=typeof e)throw ae(8);return n?t(t({},n),e):e}(e.theme,n)},[e.theme,n]);return e.children?o.createElement(Be.Provider,{value:r},e.children):null}var We={},qe=new Set;function He(e,r,s){var i=Q(e),a=e,c=!V(e),p=r.attrs,d=void 0===p?b:p,h=r.componentId,f=void 0===h?function(e,t){var n="string"!=typeof e?"sc":I(e);We[n]=(We[n]||0)+1;var o="".concat(n,"-").concat(x("6.0.8"+n+We[n]));return t?"".concat(t,"-").concat(o):o}(r.displayName,r.parentComponentId):h,m=r.displayName,y=void 0===m?function(e){return V(e)?"styled.".concat(e):"Styled(".concat(k(e),")")}(e):m,v=r.displayName&&r.componentId?"".concat(I(r.displayName),"-").concat(r.componentId):r.componentId||f,g=i&&a.attrs?a.attrs.concat(d).filter(Boolean):d,S=r.shouldForwardProp;if(i&&a.shouldForwardProp){var _=a.shouldForwardProp;if(r.shouldForwardProp){var C=r.shouldForwardProp;S=function(e,t){return _(e,t)&&C(e,t)}}else S=_}var A=new ze(s,v,i?a.componentStyle:void 0);function O(e,r){return function(e,r,s){var i=e.attrs,a=e.componentStyle,c=e.defaultProps,p=e.foldedComponentIds,d=e.styledComponentId,h=e.target,f=o.useContext(Be),m=De(),y=e.shouldForwardProp||m.shouldForwardProp;"production"!==process.env.NODE_ENV&&l(d);var v=function(e,n,o){for(var r,s=t(t({},n),{className:void 0,theme:o}),i=0;i` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var b=function(e,t){var n=De(),o=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&l(o),o}(a,v);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(b);var _=ee(p,d);return b&&(_+=" "+b),v.className&&(_+=" "+v.className),S[V(g)&&!P.has(g)?"class":"className"]=_,S.ref=s,u(g,S)}(D,e,r)}"production"!==process.env.NODE_ENV&&(O.displayName=y);var D=o.forwardRef(O);return D.attrs=g,D.componentStyle=A,D.shouldForwardProp=S,"production"!==process.env.NODE_ENV&&(D.displayName=y),D.foldedComponentIds=i?ee(a.foldedComponentIds,a.styledComponentId):"",D.styledComponentId=v,D.target=i?a.target:e,Object.defineProperty(D,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n "),o=!0,n={}}}}(y,v)),re(D,function(){return".".concat(D.styledComponentId)}),c&&Z(D,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),D}function Ue(e,t){for(var n=[e[0]],o=0,r=t.length;o2&&we.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,o)},e}();function tt(n){for(var r=[],s=1;s meta tag to the stylesheet, or simply embedding it manually in your index.html section for a simpler app."),t.styleSheet.server&&u(r,e,t.styleSheet,n,t.stylis),null};function u(e,n,o,r,s){if(c.isStatic)c.renderStyles(e,v,o,s);else{var i=t(t({},n),{theme:N(n,r,l.defaultProps)});c.renderStyles(e,i,o,s)}}return o.memo(l)}function nt(t){for(var n=[],o=1;o").concat(t,"")},this.getStyleTags=function(){if(e.sealed)throw ae(2);return e._emitSheetCSS()},this.getStyleElement=function(){var n;if(e.sealed)throw ae(2);var r=((n={})[f]="",n["data-styled-version"]="6.0.8",n.dangerouslySetInnerHTML={__html:e.instance.toString()},n),s=fe();return s&&(r.nonce=s),[o.createElement("style",t({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new we({isServer:!0}),this.sealed=!1}return e.prototype.collectStyles=function(e){if(this.sealed)throw ae(2);return o.createElement(Re,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){if(this.sealed)throw ae(2);this.seal();var t=require("stream").Transform,n=e,o=this.instance,r=this._emitSheetCSS,s=new t({transform:function(e,t,n){var s=e.toString(),i=r();if(o.clearTag(),rt.test(s)){var a=s.indexOf(">")+1,c=s.slice(0,a),l=s.slice(a);this.push(c+i+l)}else this.push(i+s);n()}});return n.on("error",function(e){s.emit("error",e)}),n.pipe(s)},e}(),it={StyleSheet:we,mainSheet:_e};"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"__sc-".concat(f,"__"),"production"!==process.env.NODE_ENV&&process;export{st as ServerStyleSheet,Ae as StyleSheetConsumer,Ie as StyleSheetContext,Re as StyleSheetManager,Ge as ThemeConsumer,Be as ThemeContext,Ye as ThemeProvider,it as __PRIVATE__,tt as createGlobalStyle,Xe as css,Qe as default,Q as isStyledComponent,nt as keyframes,Qe as styled,Le as useTheme,m as version,ot as withTheme}; //# sourceMappingURL=styled-components.esm.js.map