styled-components 6.0.0-beta.14 → 6.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as t}from"tslib";import n,{useRef as r,useState as o,useMemo as s,useEffect as i,useContext as a,useDebugValue as c,createElement as l}from"react";import u from"shallowequal";import{prefixer as p,stringify as d,RULESET as h,compile as f,middleware as m}from"stylis";import y from"@emotion/unitless";var v="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",g="6.0.0-beta.14",S=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),w={},b=/invalid hook call/i,E=new Set,N=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=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];b.test(t)?(a=!1,E.delete(s)):i.apply(void 0,e([t],n,!1))},r(),a&&!E.has(s)&&(console.warn(s),E.add(s))}catch(e){b.test(e.message)&&E.delete(s)}finally{console.error=i}}},P=Object.freeze([]),_=Object.freeze({});function C(e,t,n){return void 0===n&&(n=_),e.theme!==n.theme&&e.theme||t||n.theme}var I=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),A=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,O=/(^-|-$)/g;function R(e){return e.replace(A,"-").replace(O,"")}var D=/(a)(d)/gi,T=function(e){return String.fromCharCode(e+(e>25?39:97))};function j(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=T(t%52)+n;return(T(t%52)+n).replace(D,"$1-$2")}var x,k=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},V=function(e){return k(5381,e)};function F(e){return j(V(e)>>>0)}function M(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function $(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var B="function"==typeof Symbol&&Symbol.for,z=B?Symbol.for("react.memo"):60115,G=B?Symbol.for("react.forward_ref"):60112,L={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Y={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},q={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},H=((x={})[G]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x[z]=q,x);function W(e){return("type"in(t=e)&&t.type.$$typeof)===z?q:"$$typeof"in e?H[e.$$typeof]:L;var t}var U=Object.defineProperty,J=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,Z=Object.getOwnPropertyDescriptor,K=Object.getPrototypeOf,Q=Object.prototype;function ee(e,t,n){if("string"!=typeof t){if(Q){var r=K(t);r&&r!==Q&&ee(e,r,n)}var o=J(t);X&&(o=o.concat(X(t)));for(var s=W(e),i=W(t),a=0;a<o.length;++a){var c=o[a];if(!(c in Y||n&&n[c]||i&&c in i||s&&c in s)){var l=Z(t,c);try{U(e,c,l)}catch(e){}}}}return e}function te(e){return"function"==typeof e}function ne(e){return"object"==typeof e&&"styledComponentId"in e}function re(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function oe(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function se(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ie(e,t,n){if(void 0===n&&(n=!1),!n&&!se(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=ie(e[r],t[r]);else if(se(t))for(var r in t)e[r]=ie(e[r],t[r]);return e}var ae="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\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 `<StyleSheetManager stylisPlugins={[]}>`, 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"}:{};function ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function le(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(ce.apply(void 0,e([ae[t]],n,!1)).trim())}var ue=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<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw le(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat("/*!sc*/\n");return t},e}(),pe=new Map,de=new Map,he=1,fe=function(e){if(pe.has(e))return pe.get(e);for(;de.has(he);)he++;var t=he++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>1073741824))throw le(16,"".concat(t));return pe.set(e,t),de.set(t,e),t},me=("style[".concat(v,"][").concat("data-styled-version",'="').concat(g,'"]'),new RegExp("^".concat(v,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return de.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),i=t.getGroup(n);if(void 0===s||0===i.length)return"continue";var a="".concat(v,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat("/*!sc*/\n")},s=0;s<n;s++)o(s);return r});function ye(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null}var ve=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(v))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(v,"active"),r.setAttribute("data-styled-version",g);var i=ye();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},ge=function(){function e(e){this.element=ve(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw le(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Se=function(){function e(e){this.element=ve(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=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 e<this.length?this.nodes[e].textContent:""},e}(),we=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),be={isServer:!0,useCSSOMInjection:!S},Ee=function(){function e(e,n,r){void 0===e&&(e=_),void 0===n&&(n={}),this.options=t(t({},be),e),this.gs=n,this.names=new Map(r),this.server=!!e.isServer}return e.registerId=function(e){return fe(e)},e.prototype.reconstructWithOptions=function(n,r){return void 0===r&&(r=!0),new e(t(t({},this.options),n),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new we(n):t?new ge(n):new Se(n)}(this.options),new ue(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(fe(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(fe(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(fe(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e.prototype.toString=function(){return me(this)},e}(),Ne=/^\s*\/\/.*$/gm,Pe=[":","[",".","#"];function _e(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&(e.children=_e(e.children,t)),e})}function Ce(e){var t,n,r,o,s=void 0===e?_:e,i=s.options,a=void 0===i?_:i,c=s.plugins,l=void 0===c?P:c,u=function(e,r,s){return 0===r&&Pe.includes(s[n.length])||s.match(o)?e:".".concat(t)},y=l.slice();a.prefix&&y.unshift(p),y.push(function(e){e.type===h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(r,u))},d);var v=function(e,s,i,c){void 0===s&&(s=""),void 0===i&&(i=""),void 0===c&&(c="&"),t=c,n=s,r=new RegExp("\\".concat(n,"\\b"),"g"),o=new RegExp("(\\".concat(n,"\\b){2,}"));var l=e.replace(Ne,""),u=f(i||s?"".concat(i," ").concat(s," { ").concat(l," }"):l);return a.namespace&&(u=_e(u,a.namespace)),function(e,t){for(var n=[],r=0,o=void 0;r<e.length;r+=1)(o=t(e[r],r,e,t))&&n.push(o);return n}(u,m(y))};return v.hash=l.length?l.reduce(function(e,t){return t.name||le(15),k(e,t.name)},5381).toString():"",v}var Ie=new Ee,Ae=Ce(),Oe=n.createContext({shouldForwardProp:void 0,styleSheet:Ie,stylis:Ae}),Re=Oe.Consumer,De=n.createContext(void 0);function Te(){return a(Oe)}function je(e){var t=o(e.stylisPlugins),r=t[0],a=t[1],c=Te().styleSheet,l=s(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]),p=s(function(){return Ce({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:r})},[e.enableVendorPrefixes,e.namespace,r]);return i(function(){u(r,e.stylisPlugins)||a(e.stylisPlugins)},[e.stylisPlugins]),n.createElement(Oe.Provider,{value:{shouldForwardProp:e.shouldForwardProp,styleSheet:l,stylis:p}},n.createElement(De.Provider,{value:p},e.children))}var xe=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ae);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){throw le(12,String(n.name))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ae),this.name+e.hash},e}(),ke=function(e){return e>="A"&&e<="Z"};function Ve(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;ke(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Fe=function(e){return null==e||!1===e||""===e},Me=function(t){var n,r=[];for(var o in t){var s=t[o];t.hasOwnProperty(o)&&!Fe(s)&&(Array.isArray(s)&&s.isCss||te(s)?r.push("".concat(Ve(o),":"),s,";"):se(s)?r.push.apply(r,e(e(["".concat(o," {")],Me(s),!1),["}"],!1)):r.push("".concat(Ve(o),": ").concat(null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||o in y?String(n).trim():"".concat(n,"px"),";")))}return r};function $e(e,t,n,r){if(Fe(e))return[];if(ne(e))return[".".concat(e.styledComponentId)];if(te(e)){if(!te(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof xe||se(o)||null===o||console.error("".concat(M(e)," 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.")),$e(o,t,n,r)}var s;return e instanceof xe?n?(e.inject(n,r),[e.getName(r)]):[e]:se(e)?Me(e):Array.isArray(e)?e.flatMap(function(e){return $e(e,t,n,r)}):[e.toString()]}function Be(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(te(n)&&!ne(n))return!1}return!0}var ze=V(g),Ge=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Be(e),this.componentId=t,this.baseHash=k(ze,t),this.baseStyle=n,Ee.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=re(r,this.staticRulesId);else{var o=oe($e(this.rules,e,t,n)),s=j(k(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=re(r,s),this.staticRulesId=s}else{for(var a=k(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u,"production"!==process.env.NODE_ENV&&(a=k(a,u));else if(u){var p=oe($e(u,e,t,n));a=k(a,p),c+=p}}if(c){var d=j(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),r=re(r,d)}}return r},e}(),Le=n.createContext(void 0),Ye=Le.Consumer;function qe(){return a(Le)}function He(e){var r=qe(),o=s(function(){return function(e,n){if(!e)throw le(14);if(te(e)){var r=e(n);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw le(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw le(8);return n?t(t({},n),e):e}(e.theme,r)},[e.theme,r]);return e.children?n.createElement(Le.Provider,{value:o},e.children):null}var We={};function Ue(e,r,o){var s=ne(e),i=e,a=!$(e),u=r.attrs,p=void 0===u?P:u,d=r.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":R(e);We[n]=(We[n]||0)+1;var r="".concat(n,"-").concat(F(g+n+We[n]));return t?"".concat(t,"-").concat(r):r}(r.displayName,r.parentComponentId):d,f=r.displayName,m=void 0===f?function(e){return $(e)?"styled.".concat(e):"Styled(".concat(M(e),")")}(e):f,y=r.displayName&&r.componentId?"".concat(R(r.displayName),"-").concat(r.componentId):r.componentId||h,v=s&&i.attrs?i.attrs.concat(p).filter(Boolean):p,S=r.shouldForwardProp;if(s&&i.shouldForwardProp){var w=i.shouldForwardProp;if(r.shouldForwardProp){var b=r.shouldForwardProp;S=function(e,t){return w(e,t)&&b(e,t)}}else S=w}var E=new Ge(o,y,s?i.componentStyle:void 0),A=E.isStatic&&0===p.length;function O(e,n){return function(e,n,r,o){var s=e.attrs,i=e.componentStyle,a=e.defaultProps,u=e.foldedComponentIds,p=e.styledComponentId,d=e.target,h=qe(),f=Te(),m=e.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&c(p);var y=function(e,n,r){for(var o,s=t(t({},n),{className:void 0,theme:r}),i=0;i<e.length;i+=1){var a=te(o=e[i])?o(s):o;for(var c in a)s[c]="className"===c?re(s[c],a[c]):"style"===c?t(t({},s[c]),a[c]):a[c]}return n.className&&(s.className=re(s.className,n.className)),s}(s,n,C(n,h,a)||_),v=y.as||d,g={};for(var S in y)void 0===y[S]||"$"===S[0]||"as"===S||"theme"===S||("forwardedAs"===S?g.as=y.forwardedAs:m&&!m(S,v)||(g[S]=y[S]));var w=function(e,t,n){var r=Te(),o=e.generateAndInjectStyles(t?_:n,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&c(o),o}(i,o,y);"production"!==process.env.NODE_ENV&&!o&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var b=re(u,p);return w&&(b+=" "+w),y.className&&(b+=" "+y.className),g[$(v)&&!I.has(v)?"class":"className"]=b,g.ref=r,l(v,g)}(D,e,n,A)}O.displayName=m;var D=n.forwardRef(O);return D.attrs=v,D.componentStyle=E,D.displayName=m,D.shouldForwardProp=S,D.foldedComponentIds=s?re(i.foldedComponentIds,i.styledComponentId):"",D.styledComponentId=y,D.target=s?i.target:e,Object.defineProperty(D,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)ie(e,o[r],!0);return e}({},i.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(N(m,y),D.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=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 <Component />"),r=!0,n={}}}}(m,y)),Object.defineProperty(D,"toString",{value:function(){return".".concat(D.styledComponentId)}}),a&&ee(D,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),D}function Je(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Xe=function(e){return Object.assign(e,{isCss:!0})};function Ze(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(te(t)||se(t)){var o=t;return Xe($e(Je(P,e([o],n,!0))))}var s=t;return 0===n.length&&1===s.length&&"string"==typeof s[0]?$e(s):Xe($e(Je(s,n)))}function Ke(n,r,o){if(void 0===o&&(o=_),!r)throw le(1,r);var s=function(t){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return n(r,o,Ze.apply(void 0,e([t],s,!1)))};return s.attrs=function(e){return Ke(n,r,t(t({},o),{attrs:Array.prototype.concat(o.attrs,e).filter(Boolean)}))},s.withConfig=function(e){return Ke(n,r,t(t({},o),e))},s}var Qe=function(e){return Ke(Ue,e)},et=Qe;I.forEach(function(e){et[e]=Qe(e)});var tt=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Be(e),Ee.registerId(this.componentId+1)}return e.prototype.createStyles=function(e,t,n,r){var o=r(oe($e(this.rules,t,n,r)),""),s=this.componentId+e;n.insertRules(s,s,o)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,r){e>2&&Ee.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function nt(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];var i=Ze.apply(void 0,e([r],o,!1)),a="sc-global-".concat(F(JSON.stringify(i))),c=new tt(i,a);"production"!==process.env.NODE_ENV&&N(a);var l=function(e){var t=Te(),r=qe(),o=n.useRef(t.styleSheet.allocateGSInstance(a)).current;return"production"!==process.env.NODE_ENV&&n.Children.count(e.children)&&console.warn("The global style component ".concat(a," was given child JSX. createGlobalStyle does not render children.")),"production"!==process.env.NODE_ENV&&i.some(function(e){return"string"==typeof e&&-1!==e.indexOf("@import")})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),t.styleSheet.server&&u(o,e,t.styleSheet,r,t.stylis),null};function u(e,n,r,o,s){if(c.isStatic)c.renderStyles(e,w,r,s);else{var i=t(t({},n),{theme:C(n,o,l.defaultProps)});c.renderStyles(e,i,r,s)}}return n.memo(l)}function rt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var o=oe(Ze.apply(void 0,e([t],n,!1))),s=F(o);return new xe(s,o)}function ot(e){var r=n.forwardRef(function(r,o){var s=C(r,qe(),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===s&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(M(e),'"')),n.createElement(e,t({},r,{theme:s,ref:o}))});return r.displayName="WithTheme(".concat(M(e),")"),ee(r,e)}var st=/^\s*<\/[a-z]/i,it=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ye(),r=oe([n&&'nonce="'.concat(n,'"'),"".concat(v,'="true"'),"".concat("data-styled-version",'="').concat(g,'"')].filter(Boolean)," ");return"<style ".concat(r,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw le(2);return e._emitSheetCSS()},this.getStyleElement=function(){var r;if(e.sealed)throw le(2);var o=((r={})[v]="",r["data-styled-version"]=g,r.dangerouslySetInnerHTML={__html:e.instance.toString()},r),s=ye();return s&&(o.nonce=s),[n.createElement("style",t({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ee({isServer:!0}),this.sealed=!1}return e.prototype.collectStyles=function(e){if(this.sealed)throw le(2);return n.createElement(je,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){if(this.sealed)throw le(2);this.seal();var t=require("stream").Transform,n=e,r=this.instance,o=this._emitSheetCSS,s=new t({transform:function(e,t,n){var s=e.toString(),i=o();if(r.clearTag(),st.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}(),at={StyleSheet:Ee,mainSheet:Ie};"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(v,"__"),"production"!==process.env.NODE_ENV&&process;export{it as ServerStyleSheet,Re as StyleSheetConsumer,Oe as StyleSheetContext,je as StyleSheetManager,Ye as ThemeConsumer,Le as ThemeContext,He as ThemeProvider,at as __PRIVATE__,nt as createGlobalStyle,Ze as css,et as default,ne as isStyledComponent,rt as keyframes,et as styled,qe as useTheme,g as version,ot as withTheme};
1
+ import{__spreadArray as e,__assign as t}from"tslib";import n,{useRef as r,useState as o,useMemo as s,useEffect as i,useContext as a,useDebugValue as c,createElement as l}from"react";import u from"shallowequal";import{prefixer as p,stringify as d,RULESET as h,compile as f,middleware as m}from"stylis";import y from"@emotion/unitless";var v="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",g="6.0.0-beta.15",S=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),w={},b=/invalid hook call/i,E=new Set,N=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=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];b.test(t)?(a=!1,E.delete(s)):i.apply(void 0,e([t],n,!1))},r(),a&&!E.has(s)&&(console.warn(s),E.add(s))}catch(e){b.test(e.message)&&E.delete(s)}finally{console.error=i}}},P=Object.freeze([]),_=Object.freeze({});function C(e,t,n){return void 0===n&&(n=_),e.theme!==n.theme&&e.theme||t||n.theme}var I=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),A=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,O=/(^-|-$)/g;function D(e){return e.replace(A,"-").replace(O,"")}var R=/(a)(d)/gi,T=function(e){return String.fromCharCode(e+(e>25?39:97))};function j(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=T(t%52)+n;return(T(t%52)+n).replace(R,"$1-$2")}var x,k=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},V=function(e){return k(5381,e)};function F(e){return j(V(e)>>>0)}function M(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function $(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var B="function"==typeof Symbol&&Symbol.for,z=B?Symbol.for("react.memo"):60115,G=B?Symbol.for("react.forward_ref"):60112,L={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Y={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},q=((x={})[G]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x[z]=W,x);function H(e){return("type"in(t=e)&&t.type.$$typeof)===z?W:"$$typeof"in e?q[e.$$typeof]:L;var t}var U=Object.defineProperty,J=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,Z=Object.getOwnPropertyDescriptor,K=Object.getPrototypeOf,Q=Object.prototype;function ee(e,t,n){if("string"!=typeof t){if(Q){var r=K(t);r&&r!==Q&&ee(e,r,n)}var o=J(t);X&&(o=o.concat(X(t)));for(var s=H(e),i=H(t),a=0;a<o.length;++a){var c=o[a];if(!(c in Y||n&&n[c]||i&&c in i||s&&c in s)){var l=Z(t,c);try{U(e,c,l)}catch(e){}}}}return e}function te(e){return"function"==typeof e}function ne(e){return"object"==typeof e&&"styledComponentId"in e}function re(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function oe(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function se(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ie(e,t,n){if(void 0===n&&(n=!1),!n&&!se(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=ie(e[r],t[r]);else if(se(t))for(var r in t)e[r]=ie(e[r],t[r]);return e}var ae="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\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 `<StyleSheetManager stylisPlugins={[]}>`, 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"}:{};function ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function le(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(ce.apply(void 0,e([ae[t]],n,!1)).trim())}var ue=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<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw le(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat("/*!sc*/\n");return t},e}(),pe=new Map,de=new Map,he=1,fe=function(e){if(pe.has(e))return pe.get(e);for(;de.has(he);)he++;var t=he++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>1073741824))throw le(16,"".concat(t));return pe.set(e,t),de.set(t,e),t},me=("style[".concat(v,"][").concat("data-styled-version",'="').concat(g,'"]'),new RegExp("^".concat(v,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return de.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),i=t.getGroup(n);if(void 0===s||0===i.length)return"continue";var a="".concat(v,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat("/*!sc*/\n")},s=0;s<n;s++)o(s);return r});function ye(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null}var ve=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(v))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(v,"active"),r.setAttribute("data-styled-version",g);var i=ye();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},ge=function(){function e(e){this.element=ve(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw le(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Se=function(){function e(e){this.element=ve(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=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 e<this.length?this.nodes[e].textContent:""},e}(),we=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),be={isServer:!0,useCSSOMInjection:!S},Ee=function(){function e(e,n,r){void 0===e&&(e=_),void 0===n&&(n={}),this.options=t(t({},be),e),this.gs=n,this.names=new Map(r),this.server=!!e.isServer}return e.registerId=function(e){return fe(e)},e.prototype.reconstructWithOptions=function(n,r){return void 0===r&&(r=!0),new e(t(t({},this.options),n),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new we(n):t?new ge(n):new Se(n)}(this.options),new ue(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(fe(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(fe(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(fe(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e.prototype.toString=function(){return me(this)},e}(),Ne=/^\s*\/\/.*$/gm;function Pe(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Pe(e.children,t)),e})}function _e(e){var t,n,r,o=void 0===e?_:e,s=o.options,i=void 0===s?_:s,a=o.plugins,c=void 0===a?P:a,l=function(e,r,o){return o===n||o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},u=c.slice();i.prefix&&u.unshift(p),u.push(function(e){e.type===h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(r,l))},d);var y=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(Ne,""),l=f(s||o?"".concat(s," ").concat(o," { ").concat(c," }"):c);return i.namespace&&(l=Pe(l,i.namespace)),function(e,t){for(var n=[],r=0,o=void 0;r<e.length;r+=1)(o=t(e[r],r,e,t))&&n.push(o);return n}(l,m(u))};return y.hash=c.length?c.reduce(function(e,t){return t.name||le(15),k(e,t.name)},5381).toString():"",y}var Ce=new Ee,Ie=_e(),Ae=n.createContext({shouldForwardProp:void 0,styleSheet:Ce,stylis:Ie}),Oe=Ae.Consumer,De=n.createContext(void 0);function Re(){return a(Ae)}function Te(e){var t=o(e.stylisPlugins),r=t[0],a=t[1],c=Re().styleSheet,l=s(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]),p=s(function(){return _e({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:r})},[e.enableVendorPrefixes,e.namespace,r]);return i(function(){u(r,e.stylisPlugins)||a(e.stylisPlugins)},[e.stylisPlugins]),n.createElement(Ae.Provider,{value:{shouldForwardProp:e.shouldForwardProp,styleSheet:l,stylis:p}},n.createElement(De.Provider,{value:p},e.children))}var je=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ie);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){throw le(12,String(n.name))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ie),this.name+e.hash},e}(),xe=function(e){return e>="A"&&e<="Z"};function ke(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;xe(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Ve=function(e){return null==e||!1===e||""===e},Fe=function(t){var n,r,o=[];for(var s in t){var i=t[s];t.hasOwnProperty(s)&&!Ve(i)&&(Array.isArray(i)&&i.isCss||te(i)?o.push("".concat(ke(s),":"),i,";"):se(i)?o.push.apply(o,e(e(["".concat(s," {")],Fe(i),!1),["}"],!1)):o.push("".concat(ke(s),": ").concat((n=s,null==(r=i)||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||n in y||n.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return o};function Me(e,t,n,r){if(Ve(e))return[];if(ne(e))return[".".concat(e.styledComponentId)];if(te(e)){if(!te(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof je||se(o)||null===o||console.error("".concat(M(e)," 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.")),Me(o,t,n,r)}var s;return e instanceof je?n?(e.inject(n,r),[e.getName(r)]):[e]:se(e)?Fe(e):Array.isArray(e)?e.flatMap(function(e){return Me(e,t,n,r)}):[e.toString()]}function $e(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(te(n)&&!ne(n))return!1}return!0}var Be=V(g),ze=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&$e(e),this.componentId=t,this.baseHash=k(Be,t),this.baseStyle=n,Ee.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=re(r,this.staticRulesId);else{var o=oe(Me(this.rules,e,t,n)),s=j(k(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i)}r=re(r,s),this.staticRulesId=s}else{for(var a=k(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u,"production"!==process.env.NODE_ENV&&(a=k(a,u));else if(u){var p=oe(Me(u,e,t,n));a=k(a,p),c+=p}}if(c){var d=j(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),r=re(r,d)}}return r},e}(),Ge=n.createContext(void 0),Le=Ge.Consumer;function Ye(){return a(Ge)}function We(e){var r=Ye(),o=s(function(){return function(e,n){if(!e)throw le(14);if(te(e)){var r=e(n);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw le(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw le(8);return n?t(t({},n),e):e}(e.theme,r)},[e.theme,r]);return e.children?n.createElement(Ge.Provider,{value:o},e.children):null}var qe={};function He(e,r,o){var s=ne(e),i=e,a=!$(e),u=r.attrs,p=void 0===u?P:u,d=r.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":D(e);qe[n]=(qe[n]||0)+1;var r="".concat(n,"-").concat(F(g+n+qe[n]));return t?"".concat(t,"-").concat(r):r}(r.displayName,r.parentComponentId):d,f=r.displayName,m=void 0===f?function(e){return $(e)?"styled.".concat(e):"Styled(".concat(M(e),")")}(e):f,y=r.displayName&&r.componentId?"".concat(D(r.displayName),"-").concat(r.componentId):r.componentId||h,v=s&&i.attrs?i.attrs.concat(p).filter(Boolean):p,S=r.shouldForwardProp;if(s&&i.shouldForwardProp){var w=i.shouldForwardProp;if(r.shouldForwardProp){var b=r.shouldForwardProp;S=function(e,t){return w(e,t)&&b(e,t)}}else S=w}var E=new ze(o,y,s?i.componentStyle:void 0),A=E.isStatic&&0===p.length;function O(e,n){return function(e,n,r,o){var s=e.attrs,i=e.componentStyle,a=e.defaultProps,u=e.foldedComponentIds,p=e.styledComponentId,d=e.target,h=Ye(),f=Re(),m=e.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&c(p);var y=function(e,n,r){for(var o,s=t(t({},n),{className:void 0,theme:r}),i=0;i<e.length;i+=1){var a=te(o=e[i])?o(s):o;for(var c in a)s[c]="className"===c?re(s[c],a[c]):"style"===c?t(t({},s[c]),a[c]):a[c]}return n.className&&(s.className=re(s.className,n.className)),s}(s,n,C(n,h,a)||_),v=y.as||d,g={};for(var S in y)void 0===y[S]||"$"===S[0]||"as"===S||"theme"===S||("forwardedAs"===S?g.as=y.forwardedAs:m&&!m(S,v)||(g[S]=y[S]));var w=function(e,t,n){var r=Re(),o=e.generateAndInjectStyles(t?_:n,r.styleSheet,r.stylis);return"production"!==process.env.NODE_ENV&&c(o),o}(i,o,y);"production"!==process.env.NODE_ENV&&!o&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var b=re(u,p);return w&&(b+=" "+w),y.className&&(b+=" "+y.className),g[$(v)&&!I.has(v)?"class":"className"]=b,g.ref=r,l(v,g)}(R,e,n,A)}O.displayName=m;var R=n.forwardRef(O);return R.attrs=v,R.componentStyle=E,R.displayName=m,R.shouldForwardProp=S,R.foldedComponentIds=s?re(i.foldedComponentIds,i.styledComponentId):"",R.styledComponentId=y,R.target=s?i.target:e,Object.defineProperty(R,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)ie(e,o[r],!0);return e}({},i.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(N(m,y),R.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=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 <Component />"),r=!0,n={}}}}(m,y)),Object.defineProperty(R,"toString",{value:function(){return".".concat(R.styledComponentId)}}),a&&ee(R,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),R}function Ue(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Je=function(e){return Object.assign(e,{isCss:!0})};function Xe(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(te(t)||se(t)){var o=t;return Je(Me(Ue(P,e([o],n,!0))))}var s=t;return 0===n.length&&1===s.length&&"string"==typeof s[0]?Me(s):Je(Me(Ue(s,n)))}function Ze(n,r,o){if(void 0===o&&(o=_),!r)throw le(1,r);var s=function(t){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return n(r,o,Xe.apply(void 0,e([t],s,!1)))};return s.attrs=function(e){return Ze(n,r,t(t({},o),{attrs:Array.prototype.concat(o.attrs,e).filter(Boolean)}))},s.withConfig=function(e){return Ze(n,r,t(t({},o),e))},s}var Ke=function(e){return Ze(He,e)},Qe=Ke;I.forEach(function(e){Qe[e]=Ke(e)});var et=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=$e(e),Ee.registerId(this.componentId+1)}return e.prototype.createStyles=function(e,t,n,r){var o=r(oe(Me(this.rules,t,n,r)),""),s=this.componentId+e;n.insertRules(s,s,o)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,r){e>2&&Ee.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function tt(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];var i=Xe.apply(void 0,e([r],o,!1)),a="sc-global-".concat(F(JSON.stringify(i))),c=new et(i,a);"production"!==process.env.NODE_ENV&&N(a);var l=function(e){var t=Re(),r=Ye(),o=n.useRef(t.styleSheet.allocateGSInstance(a)).current;return"production"!==process.env.NODE_ENV&&n.Children.count(e.children)&&console.warn("The global style component ".concat(a," was given child JSX. createGlobalStyle does not render children.")),"production"!==process.env.NODE_ENV&&i.some(function(e){return"string"==typeof e&&-1!==e.indexOf("@import")})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),t.styleSheet.server&&u(o,e,t.styleSheet,r,t.stylis),null};function u(e,n,r,o,s){if(c.isStatic)c.renderStyles(e,w,r,s);else{var i=t(t({},n),{theme:C(n,o,l.defaultProps)});c.renderStyles(e,i,r,s)}}return n.memo(l)}function nt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var o=oe(Xe.apply(void 0,e([t],n,!1))),s=F(o);return new je(s,o)}function rt(e){var r=n.forwardRef(function(r,o){var s=C(r,Ye(),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===s&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(M(e),'"')),n.createElement(e,t({},r,{theme:s,ref:o}))});return r.displayName="WithTheme(".concat(M(e),")"),ee(r,e)}var ot=/^\s*<\/[a-z]/i,st=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=ye(),r=oe([n&&'nonce="'.concat(n,'"'),"".concat(v,'="true"'),"".concat("data-styled-version",'="').concat(g,'"')].filter(Boolean)," ");return"<style ".concat(r,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw le(2);return e._emitSheetCSS()},this.getStyleElement=function(){var r;if(e.sealed)throw le(2);var o=((r={})[v]="",r["data-styled-version"]=g,r.dangerouslySetInnerHTML={__html:e.instance.toString()},r),s=ye();return s&&(o.nonce=s),[n.createElement("style",t({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ee({isServer:!0}),this.sealed=!1}return e.prototype.collectStyles=function(e){if(this.sealed)throw le(2);return n.createElement(Te,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){if(this.sealed)throw le(2);this.seal();var t=require("stream").Transform,n=e,r=this.instance,o=this._emitSheetCSS,s=new t({transform:function(e,t,n){var s=e.toString(),i=o();if(r.clearTag(),ot.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:Ee,mainSheet:Ce};"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(v,"__"),"production"!==process.env.NODE_ENV&&process;export{st as ServerStyleSheet,Oe as StyleSheetConsumer,Ae as StyleSheetContext,Te as StyleSheetManager,Le as ThemeConsumer,Ge as ThemeContext,We as ThemeProvider,it as __PRIVATE__,tt as createGlobalStyle,Xe as css,Qe as default,ne as isStyledComponent,nt as keyframes,Qe as styled,Ye as useTheme,g as version,rt as withTheme};
2
2
  //# sourceMappingURL=styled-components.esm.js.map