styled-components 2.1.1 → 2.2.1
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.
- package/CHANGELOG.md +31 -1
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +12 -67
- package/dist/styled-components.es.js +273 -110
- package/dist/styled-components.js +325 -119
- package/dist/styled-components.min.js +2 -2
- package/lib/hoc/withTheme.js +13 -7
- package/lib/models/BrowserStyleSheet.js +11 -0
- package/lib/models/ComponentStyle.js +45 -2
- package/lib/models/InlineStyle.js +1 -1
- package/lib/models/ServerStyleSheet.js +33 -17
- package/lib/models/StyleSheet.js +9 -0
- package/lib/models/StyledComponent.js +82 -38
- package/lib/models/StyledNativeComponent.js +31 -15
- package/lib/models/ThemeProvider.js +44 -12
- package/lib/native/index.js +1 -1
- package/lib/test/utils.js +5 -2
- package/lib/utils/create-broadcast.js +34 -24
- package/lib/utils/domElements.js +1 -1
- package/lib/utils/flatten.js +4 -1
- package/lib/utils/generateAlphabeticName.js +1 -1
- package/lib/utils/nonce.js +10 -0
- package/lib/utils/once.js +17 -0
- package/package.json +10 -10
- package/src/hoc/withTheme.js +14 -7
- package/src/models/BrowserStyleSheet.js +8 -0
- package/src/models/ComponentStyle.js +42 -2
- package/src/models/InlineStyle.js +1 -1
- package/src/models/ServerStyleSheet.js +27 -12
- package/src/models/StyleSheet.js +9 -0
- package/src/models/StyledComponent.js +81 -26
- package/src/models/StyledNativeComponent.js +30 -10
- package/src/models/ThemeProvider.js +38 -9
- package/src/models/test/ThemeProvider.test.js +7 -8
- package/src/native/index.js +1 -1
- package/src/native/test/native.test.js +14 -0
- package/src/test/__snapshots__/ssr.test.js.snap +147 -0
- package/src/test/expanded-api.test.js +24 -0
- package/src/test/props.test.js +14 -3
- package/src/test/ssr.test.js +90 -123
- package/src/test/styles.test.js +52 -0
- package/src/test/utils.js +5 -2
- package/src/utils/create-broadcast.js +31 -17
- package/src/utils/domElements.js +1 -0
- package/src/utils/flatten.js +16 -6
- package/src/utils/generateAlphabeticName.js +1 -1
- package/src/utils/nonce.js +6 -0
- package/src/utils/once.js +12 -0
- package/typings/styled-components.d.ts +15 -21
- package/typings/tests/issue1068.tsx +226 -0
- package/typings/tests/main-test.tsx +1 -1
- package/typings/tests/string-tags-test.tsx +62 -0
- package/typings/tests/themed-tests/issue1068.tsx +226 -0
- package/typings/tests/themed-tests/mytheme-styled-components.tsx +1 -1
- package/typings/tests/themed-tests/with-theme-test.tsx +2 -1
- package/typings/tests/with-theme-test.tsx +17 -0
- package/lib/constructors/test/injectGlobal.test.js +0 -63
- package/lib/constructors/test/keyframes.test.js +0 -48
- package/lib/constructors/test/styled.test.js +0 -19
- package/lib/models/AbstractStyledComponent.js +0 -43
- package/lib/models/test/ThemeProvider.test.js +0 -200
- package/lib/native/test/native.test.js +0 -290
- package/lib/no-parser/test/basic.test.js +0 -46
- package/lib/no-parser/test/flatten.test.js +0 -125
- package/lib/no-parser/test/keyframes.test.js +0 -45
- package/lib/primitives/test/primitives.test.js +0 -289
- package/lib/test/attrs.test.js +0 -158
- package/lib/test/basic.test.js +0 -267
- package/lib/test/css.test.js +0 -43
- package/lib/test/expanded-api.test.js +0 -90
- package/lib/test/extending.test.js +0 -198
- package/lib/test/overriding.test.js +0 -35
- package/lib/test/props.test.js +0 -38
- package/lib/test/rehydration.test.js +0 -306
- package/lib/test/ssr.test.js +0 -187
- package/lib/test/styles.test.js +0 -146
- package/lib/test/theme.test.js +0 -497
- package/lib/test/warnTooManyClasses.test.js +0 -71
- package/lib/utils/test/extractCompsFromCSS.test.js +0 -46
- package/lib/utils/test/flatten.test.js +0 -109
- package/lib/utils/test/generateAlphabeticName.test.js +0 -14
- package/lib/utils/test/interleave.test.js +0 -22
- package/lib/utils/test/validAttr.test.js +0 -560
- package/src/models/AbstractStyledComponent.js +0 -21
- package/typings/tags.d.ts +0 -137
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.styled=e.styled||{},e.React)}(this,function(e,t){"use strict";function n(e){return e.replace(g,"-$1").toLowerCase()}function r(e){return C(e).replace(v,"-ms-")}function o(e){return!0===P(e)&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(e){return function(){return e}}function s(e,t,n,r,o,a,i,s){if(ee(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,s],l=0;c=new Error(t.replace(/%s/g,function(){return u[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}function c(e){return"string"==typeof e}function u(e){return"function"==typeof e&&"string"==typeof e.styledComponentId}function l(e){return e.displayName||e.name||"Component"}function p(e){var t=be.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}function h(e,t){for(var n=1540483477,r=t^e.length,o=e.length,a=0;o>=4;){var i=d(e,a);i=m(i,n),i^=i>>>24,i=m(i,n),r=m(r,n),r^=i,a+=4,o-=4}switch(o){case 3:r^=f(e,a),r^=e.charCodeAt(a+2)<<16,r=m(r,n);break;case 2:r^=f(e,a),r=m(r,n);break;case 1:r^=e.charCodeAt(a),r=m(r,n)}return r^=r>>>13,r=m(r,n),(r^=r>>>15)>>>0}function d(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function f(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function m(e,t){return e|=0,t|=0,(65535&e)*t+(((e>>>16)*t&65535)<<16)|0}var y="default"in t?t.default:t,g=/([A-Z])/g,b=n,C=b,v=/^ms-/,k=r,w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},O=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},j=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},E=function(e){return null!=e&&"object"===(void 0===e?"undefined":w(e))&&!Array.isArray(e)},P=E,I=function(e){var t,n;return!1!==o(e)&&("function"==typeof(t=e.constructor)&&(n=t.prototype,!1!==o(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))},M=function e(t,n){var r=Object.keys(t).map(function(n){return I(t[n])?e(t[n],n):k(n)+": "+t[n]+";"}).join(" ");return n?n+" {\n "+r+"\n}":r},N=function e(t,n){return t.reduce(function(t,r){return void 0===r||null===r||!1===r||""===r?t:Array.isArray(r)?[].concat(t,e(r,n)):r.hasOwnProperty("styledComponentId")?[].concat(t,["."+r.styledComponentId]):"function"==typeof r?n?t.concat.apply(t,e([r(n)],n)):t.concat(r):t.concat(I(r)?M(r):r.toString())},[])},D=a(function(e,t){!function(n){"object"===(void 0===t?"undefined":w(t))&&void 0!==e?e.exports=n():window.stylis=n()}(function e(t){function n(e,t,o,i){for(var u,l,p=0,h=0,m=0,y=0,g=0,b=0,C=0,v=0,k=0,w=0,x=0,T=0,j=0,E=0,P=0,I=0,M=0,N=0,Z=0,xe=o.length,Te=xe-1,je="",Pe="",Ie="",We="",He="",_e="";P<xe;){if(C=o.charCodeAt(P),h+y+m+p===0){if(P===Te&&(I>0&&(Pe=Pe.replace(f,"")),(Pe=Pe.trim()).length>0)){switch(C){case X:case V:case L:case q:case B:break;default:Pe+=o.charAt(P)}C=L}if(1===M)switch(C){case U:case Q:M=0;break;case V:case q:case B:case X:break;default:P--,C=L}switch(C){case U:for(Pe=Pe.trim(),g=Pe.charCodeAt(0),x=1,P++;P<xe;){switch(C=o.charCodeAt(P)){case U:x++;break;case z:x--}if(0===x)break;Ie+=o.charAt(P++)}switch(g===se&&(g=(Pe=Pe.replace(d,"").trim()).charCodeAt(0)),g){case K:switch(I>0&&(Pe=Pe.replace(f,"")),b=Pe.charCodeAt(1)){case ge:case pe:case he:u=t;break;default:u=Oe}if(Ie=n(t,u,Ie,b),Z=Ie.length,Se>0&&0===Z&&(Z=Pe.length),Ee>0&&(u=r(Oe,Pe,N),l=c(Re,Ie,u,t,Ce,be,Z,b),Pe=u.join(""),void 0!==l&&0===(Z=(Ie=l.trim()).length)&&(b=0,Ie="")),Z>0)switch(b){case ge:case pe:case he:Ie=Pe+"{"+Ie+"}";break;case le:Pe=Pe.replace(A,"$1 $2"+(Le>0?ze:"")),Ie=Pe+"{"+Ie+"}",Ie="@"+(we>0?D+Ie+"@"+Ie:Ie);break;default:Ie=Pe+Ie}else Ie="";break;default:Ie=n(t,r(t,Pe,N),Ie,i)}He+=Ie,T=0,M=0,E=0,I=0,N=0,j=0,Pe="",Ie="",P++;break;case z:case L:if(Pe=(I>0?Pe.replace(f,""):Pe).trim(),C!==z||Pe.length>0)switch(0===E&&((g=Pe.charCodeAt(0))===Y||g>96&&g<123)&&Pe.indexOf(" ")&&(Pe=Pe.replace(" ",": ")),Ee>0&&void 0!==(l=c(Ne,Pe,t,e,Ce,be,We.length,i))&&0===(Pe=l.trim()).length&&(Pe="\0\0"),g=Pe.charCodeAt(0),b=Pe.charCodeAt(1),g+b){case se:break;case me:case ye:_e+=Pe+o.charAt(P);break;default:We+=E>0?a(Pe,g,b,Pe.charCodeAt(2)):Pe+";"}T=0,M=0,E=0,I=0,N=0,Pe="",P++}}switch(C){case q:case B:if(h+y+m+p+Ae===0)switch(w){case K:case ie:case oe:case J:case ae:case re:case Y:case ee:case Q:case L:case U:case z:break;default:E>0&&(M=1)}h===re&&(h=0),Ee*Fe>0&&c(Me,Pe,t,e,Ce,be,We.length,i),be=1,Ce++;break;default:if(be++,C===V)break;switch(je=o.charAt(P),C){case se:je="\\0";break;case ce:je="\\f";break;case ue:je="\\v";break;case G:y+h+p===0&&ke>0&&(N=1,I=1,je="\f"+je);break;case 108:if(y+h+p+ve===0&&E>0)switch(P-E){case 2:v===de&&o.charCodeAt(P-3)===ee&&(ve=v);case 8:k===fe&&(ve=k)}break;case ee:y+h+p===0&&(E=P);break;case Q:h+m+y+p===0&&(I=1,je+="\r");break;case ne:case te:0===h&&(y=y===C?0:0===y?C:y);break;case H:y+h+m===0&&p++;break;case _:y+h+m===0&&p--;break;case W:y+h+p===0&&(P===Te&&(Te++,xe++),m--);break;case $:if(y+h+p===0){if(0===T)switch(2*v+3*k){case 533:break;default:x=0,T=1}m++}break;case K:h+m+y+p+E+j===0&&(j=1);break;case J:case re:if(y+p+m>0)break;switch(h){case 0:switch(2*C+3*o.charCodeAt(P+1)){case 235:h=re;break;case 220:h=J}break;case J:C===re&&v===J&&(je="",h=0)}}if(0===h){if(ke+y+p+j===0&&i!==le&&C!==L)switch(C){case Q:case ie:case oe:case ae:case W:case $:if(0===T){switch(v){case V:case X:case B:case q:je+="\0";break;default:je="\0"+je+(C===Q?"":"\0")}I=1}else switch(C){case $:T=++x;break;case W:0==(T=--x)&&(I=1,je+="\0")}break;case X:switch(v){case se:case U:case z:case L:case Q:case ce:case V:case X:case B:case q:break;default:0===T&&(I=1,je+="\0")}}Pe+=je,C!==X&&(w=C)}}k=v,v=C,P++}if(Z=We.length,Se>0&&0===Z&&0===He.length&&0===t[0].length==!1&&(i!==pe||1===t.length&&(ke>0?Ue:$e)===t[0])&&(Z=t.join(",").length+2),Z>0){if(0===ke&&i!==le&&s(t),Ee>0&&void 0!==(l=c(De,We,t,e,Ce,be,Z,i))&&0===(We=l).length)return _e+We+He;if(We=t.join(",")+"{"+We+"}",we*ve>0){switch(ve){case fe:We=We.replace(O,":"+R+"$1")+We;break;case de:We=We.replace(S,"::"+D+"input-$1")+We.replace(S,"::"+R+"$1")+We.replace(S,":"+F+"input-$1")+We}ve=0}}return _e+We+He}function r(e,t,n){var r=t.trim().split(k),a=r,i=r.length,s=e.length;switch(s){case 0:case 1:for(var c=0,u=0===s?"":e[0]+" ";c<i;c++)a[c]=o(u,a[c],n,s).trim();break;default:for(var c=0,l=0,a=[];c<i;c++)for(var p=0;p<s;p++)a[l++]=o(e[p]+" ",r[c],n,s).trim()}return a}function o(e,t,n,r){var o=t,a=o.charCodeAt(0);switch(a<33&&(a=(o=o.trim()).charCodeAt(0)),a){case G:switch(ke+r){case 0:case 1:if(0===e.trim().length)break;default:return o.replace(w,"$1"+e.trim())}break;case ee:switch(o.charCodeAt(1)){case 103:if(xe>0&&ke>0)return o.replace(x,"$1").replace(w,"$1"+$e);break;default:return e.trim()+o}default:if(n*ke>0&&o.indexOf("\f")>0)return o.replace(w,(e.charCodeAt(0)===ee?"":"$1")+e.trim())}return e+o}function a(e,t,n,r){var o,a=e+";",s=0,c=2*t+3*n+4*r;if(944===c)a=i(a);else if(we>0)switch(c){case 963:110===a.charCodeAt(5)&&(a=D+a+a);break;case 978:a=D+a+R+a+a;break;case 1019:case 983:a=D+a+R+a+F+a+a;break;case 883:a.charCodeAt(8)===Y&&(a=D+a+a);break;case 932:a=D+a+F+a+a;break;case 964:a=D+a+F+"flex-"+a+a;break;case 1023:o=a.substring(a.indexOf(":",15)).replace("flex-",""),a=D+"box-pack"+o+D+a+F+"flex-pack"+o+a;break;case 975:switch(s=(a=e).length-10,o=(33===a.charCodeAt(s)?a.substring(0,s):a).substring(8).trim(),c=o.charCodeAt(0)+(0|o.charCodeAt(7))){case 203:o.charCodeAt(8)>110&&(a=a.replace(o,D+o)+";"+a);break;case 207:case 102:a=a.replace(o,D+(c>102?"inline-":"")+"box")+";"+a.replace(o,D+o)+";"+a.replace(o,F+o+"box")+";"+a}a+=";";break;case 938:if(a.charCodeAt(5)===Y)switch(a.charCodeAt(6)){case 105:o=a.replace("-items",""),a=D+a+D+"box-"+o+F+"flex-"+o+a;break;case 115:a=D+a+F+"flex-item-"+a.replace("-self","")+a;break;default:a=D+a+F+"flex-line-pack"+a.replace("align-content","")+a}break;case 1005:y.test(a)&&(a=a.replace(m,": "+D)+a.replace(m,": "+R)+a);break;case 953:(s=a.indexOf("-content",9))>0&&(o=a.substring(s-3),a="width:"+D+o+"width:"+R+o+"width:"+o);break;case 962:case 1015:a=D+a+(102===a.charCodeAt(5)?F+a:"")+a,n+r===211&&105===a.charCodeAt(13)&&a.indexOf("transform",10)>0&&(a=a.substring(0,a.indexOf(";",27)+1).replace(g,"$1"+D+"$2")+a);break;case 1e3:switch(o=a.substring(13).trim(),s=o.indexOf("-")+1,o.charCodeAt(0)+o.charCodeAt(s)){case 226:o=a.replace(N,"tb");break;case 232:o=a.replace(N,"tb-rl");break;case 220:o=a.replace(N,"lr");break;default:return a}a=D+a+F+o+a}return a}function i(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim(),a="";if(e.charCodeAt(9)!==Y)for(var i=o.split(b),s=0,n=0,t=i.length;s<t;n=0,s++){for(var c=i[s],u=c.split(C);c=u[n];){var l=c.charCodeAt(0);if(1===Le&&(l>K&&l<90||l>96&&l<123||l===Z||l===Y&&c.charCodeAt(1)!==Y))switch(isNaN(parseFloat(c))+(-1!==c.indexOf("("))){case 1:switch(c){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reversed":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:c+=ze}}u[n++]=c}a+=(0===s?"":",")+u.join(" ")}else a+=110===e.charCodeAt(10)?o+(1===Le?ze:""):o;return a=r+a+";",we>0?D+a+a:a}function s(e){for(var t,n,r=0,o=e.length;r<o;r++){for(var a=e[r].split(v),i="",s=0,c=0,u=0,l=0,p=a.length;s<p;s++)if(!(0===(c=(n=a[s]).length)&&p>1)){if(u=i.charCodeAt(i.length-1),l=n.charCodeAt(0),t="",0!==s)switch(u){case J:case ie:case oe:case ae:case X:case $:break;default:t=" "}switch(l){case G:n=t+Ue;case ie:case oe:case ae:case X:case W:case $:break;case H:n=t+n+Ue;break;case ee:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(xe>0){n=t+n.substring(8,c-1);break}default:(s<1||a[s-1].length<1)&&(n=t+Ue+n)}break;case Q:t="";default:n=c>1&&n.indexOf(":")>0?t+n.replace(M,"$1"+Ue+"$2"):t+n+Ue}i+=n}e[r]=i.replace(f,"").trim()}}function c(e,t,n,r,o,a,i,s){for(var c,u=0,l=t;u<Ee;u++)switch(c=je[u].call(h,e,l,n,r,o,a,i,s)){case void 0:case!1:case!0:case null:break;default:l=c}switch(l){case void 0:case!1:case!0:case null:case t:break;default:return l}}function u(e){return e.replace(f,"").replace(j,"").replace(E,"$1").replace(P,"$1").replace(I," ")}function l(e){switch(e){case void 0:case null:Ee=je.length=0;break;default:switch(e.constructor){case Array:for(var t=0,n=e.length;t<n;t++)l(e[t]);break;case Function:je[Ee++]=e;break;case Boolean:Fe=0|!!e}}return l}function p(e){for(var t in e){var n=e[t];switch(t){case"keyframe":Le=0|n;break;case"global":xe=0|n;break;case"cascade":ke=0|n;break;case"compress":Te=0|n;break;case"prefix":we=0|n;break;case"semicolon":Ae=0|n;break;case"preserve":Se=0|n}}return p}function h(t,r){if(void 0!==this&&this.constructor===h)return e(t);var o=t,a=o.charCodeAt(0);a<33&&(a=(o=o.trim()).charCodeAt(0)),Le>0&&(ze=o.replace(T,a===H?"":"-")),a=1,1===ke?$e=o:Ue=o;var i,s=[$e];Ee>0&&void 0!==(i=c(Ie,r,s,s,Ce,be,0,0))&&"string"==typeof(r=i)&&(r=i);var l=n(Oe,s,r,0);return Ee>0&&void 0!==(i=c(Pe,l,s,s,Ce,be,l.length,0))&&"string"!=typeof(l=i)&&(a=0),ze="",$e="",Ue="",ve=0,Ce=1,be=1,Te*a==0?l:u(l)}var d=/^\0+/g,f=/[\0\r\f]/g,m=/: */g,y=/zoo|gra/,g=/([,: ])(transform)/g,b=/,+\s*(?![^(]*[)])/g,C=/ +\s*(?![^(]*[)])/g,v=/ *[\0] */g,k=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,x=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,T=/\W+/g,A=/@(k\w+)\s*(\S*)\s*/,S=/::(place)/g,O=/:(read-only)/g,j=/\s+(?=[{\];=:>])/g,E=/([[}=:>])\s+/g,P=/(\{[^{]+?);(?=\})/g,I=/\s{2,}/g,M=/([^\(])(:+) */g,N=/[svh]\w+-[tblr]{2}/,D="-webkit-",R="-moz-",F="-ms-",L=59,z=125,U=123,$=40,W=41,H=91,_=93,B=10,q=13,V=9,K=64,X=32,G=38,Y=45,Z=95,J=42,Q=44,ee=58,te=39,ne=34,re=47,oe=62,ae=43,ie=126,se=0,ce=12,ue=11,le=107,pe=109,he=115,de=112,fe=111,me=169,ye=163,ge=100,be=1,Ce=1,ve=0,ke=1,we=1,xe=1,Te=0,Ae=0,Se=0,Oe=[],je=[],Ee=0,Pe=-2,Ie=-1,Me=0,Ne=1,De=2,Re=3,Fe=0,Le=1,ze="",Ue="",$e="";return h.use=l,h.set=p,void 0!==t&&p(t),h})}),R=new D({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!0}),F=function(e,t,n){var r=e.join("").replace(/^\s*\/\/.*$/gm,""),o=t&&n?n+" "+t+" { "+r+" }":r;return R(n||!t?"":t,o)},L="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),z=L.length,U=function(e){var t="",n=void 0;for(n=e;n>z;n=Math.floor(n/L.length))t=L[n%z]+t;return L[n%z]+t},$=function(e,t){return t.reduce(function(t,n,r){return t.concat(n,e[r+1])},[e[0]])},W=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return N($(e,n))},H=function(e){var t=""+(e||""),n=[];return t.replace(/^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//gm,function(e,t,r){return n.push({componentId:t,matchIndex:r}),e}),n.map(function(e,r){var o=e.componentId,a=e.matchIndex,i=n[r+1];return{componentId:o,cssFromDOM:i?t.slice(a,i.matchIndex):t.slice(a)}})},_=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";x(this,e),this.el=t,this.isLocal=n,this.ready=!1;var o=H(r);this.size=o.length,this.components=o.reduce(function(e,t){return e[t.componentId]=t,e},{})}return e.prototype.isFull=function(){return this.size>=40},e.prototype.addComponent=function(e){if(this.ready||this.replaceElement(),this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");var t={componentId:e,textNode:document.createTextNode("")};this.el.appendChild(t.textNode),this.size+=1,this.components[e]=t},e.prototype.inject=function(e,t,n){this.ready||this.replaceElement();var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");if(""===r.textNode.data&&r.textNode.appendData("\n/* sc-component-id: "+e+" */\n"),r.textNode.appendData(t),n){var o=this.el.getAttribute(q);this.el.setAttribute(q,o?o+" "+n:n)}},e.prototype.toHTML=function(){return this.el.outerHTML},e.prototype.toReactElement=function(){throw new Error("BrowserTag doesn't implement toReactElement!")},e.prototype.clone=function(){throw new Error("BrowserTag cannot be cloned!")},e.prototype.replaceElement=function(){var e=this;if(this.ready=!0,0!==this.size){var t=this.el.cloneNode();if(t.appendChild(document.createTextNode("\n")),Object.keys(this.components).forEach(function(n){var r=e.components[n];r.textNode=document.createTextNode(r.cssFromDOM),t.appendChild(r.textNode)}),!this.el.parentNode)throw new Error("Trying to replace an element that wasn't mounted!");this.el.parentNode.replaceChild(t,this.el),this.el=t}},e}(),B={create:function(){for(var e=[],t={},n=document.querySelectorAll("["+q+"]"),r=n.length,o=0;o<r;o+=1){var a=n[o];e.push(new _(a,"true"===a.getAttribute(V),a.innerHTML));var i=a.getAttribute(q);i&&i.trim().split(/\s+/).forEach(function(e){t[e]=!0})}return new Y(function(e){var t=document.createElement("style");if(t.type="text/css",t.setAttribute(q,""),t.setAttribute(V,e?"true":"false"),!document.head)throw new Error("Missing document <head>");return document.head.appendChild(t),new _(t,e)},e,t)}},q="data-styled-components",V="data-styled-components-is-local",K="__styled-components-stylesheet__",X=null,G=[],Y=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.hashes={},this.deferredInjections={},this.tagConstructor=t,this.tags=n,this.names=r,this.constructComponentTagMap()}return e.prototype.constructComponentTagMap=function(){var e=this;this.componentTags={},this.tags.forEach(function(t){Object.keys(t.components).forEach(function(n){e.componentTags[n]=t})})},e.prototype.getName=function(e){return this.hashes[e.toString()]},e.prototype.alreadyInjected=function(e,t){return!!this.names[t]&&(this.hashes[e.toString()]=t,!0)},e.prototype.hasInjectedComponent=function(e){return!!this.componentTags[e]},e.prototype.deferredInject=function(e,t,n){this===X&&G.forEach(function(r){r.deferredInject(e,t,n)}),this.getOrCreateTag(e,t),this.deferredInjections[e]=n},e.prototype.inject=function(e,t,n,r,o){this===X&&G.forEach(function(r){r.inject(e,t,n)});var a=this.getOrCreateTag(e,t),i=this.deferredInjections[e];i&&(a.inject(e,i),delete this.deferredInjections[e]),a.inject(e,n,o),r&&o&&(this.hashes[r.toString()]=o)},e.prototype.toHTML=function(){return this.tags.map(function(e){return e.toHTML()}).join("")},e.prototype.toReactElements=function(){return this.tags.map(function(e,t){return e.toReactElement("sc-"+t)})},e.prototype.getOrCreateTag=function(e,t){var n=this.componentTags[e];if(n)return n;var r=this.tags[this.tags.length-1],o=!r||r.isFull()||r.isLocal!==t?this.createNewTag(t):r;return this.componentTags[e]=o,o.addComponent(e),o},e.prototype.createNewTag=function(e){var t=this.tagConstructor(e);return this.tags.push(t),t},e.reset=function(t){X=e.create(t)},e.create=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof document)?le:B).create()},e.clone=function(t){var n=new e(t.tagConstructor,t.tags.map(function(e){return e.clone()}),A({},t.names));return n.hashes=A({},t.hashes),n.deferredInjections=A({},t.deferredInjections),G.push(n),n},T(e,null,[{key:"instance",get:function(){return X||(X=e.create())}}]),e}(),Z=function(){};Z.thatReturns=i,Z.thatReturnsFalse=i(!1),Z.thatReturnsTrue=i(!0),Z.thatReturnsNull=i(null),Z.thatReturnsThis=function(){return this},Z.thatReturnsArgument=function(e){return e};var J,Q=Z,ee=function(e){},te=s,ne=Q,re=te,oe=function(){function e(){re(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=ne,n.PropTypes=n,n},ae=a(function(e){e.exports=oe()}),ie=function(e){function t(){return x(this,t),j(this,e.apply(this,arguments))}return S(t,e),t.prototype.getChildContext=function(){var e;return e={},e[K]=this.props.sheet,e},t.prototype.render=function(){return y.Children.only(this.props.children)},t}(t.Component);ie.childContextTypes=(J={},J[K]=ae.instanceOf(Y).isRequired,J);var se,ce,ue=function(){function e(t){x(this,e),this.isLocal=t,this.components={},this.size=0,this.names=[]}return e.prototype.isFull=function(){return!1},e.prototype.addComponent=function(e){if(this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");this.components[e]={componentId:e,css:""},this.size+=1},e.prototype.inject=function(e,t,n){var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");""===r.css&&(r.css="/* sc-component-id: "+e+" */\n"),r.css+=t.replace(/\n*$/,"\n"),n&&this.names.push(n)},e.prototype.toHTML=function(){var e=this;return'<style type="text/css" '+q+'="'+this.names.join(" ")+'" '+V+'="'+(this.isLocal?"true":"false")+'">\n'+Object.keys(this.components).map(function(t){return e.components[t].css}).join("")+"\n</style>"},e.prototype.toReactElement=function(e){var t,n=this,r=(t={},t[q]=this.names.join(" "),t[V]=this.isLocal.toString(),t),o=Object.keys(this.components).map(function(e){return n.components[e].css}).join("");return y.createElement("style",A({key:e,type:"text/css"},r,{dangerouslySetInnerHTML:{__html:o}}))},e.prototype.clone=function(){var t=this,n=new e(this.isLocal);return n.names=[].concat(this.names),n.size=this.size,n.components=Object.keys(this.components).reduce(function(e,n){return e[n]=A({},t.components[n]),e},{}),n},e}(),le=function(){function e(){x(this,e),this.instance=Y.clone(Y.instance)}return e.prototype.collectStyles=function(e){if(this.closed)throw new Error("Can't collect styles once you've called getStyleTags!");return y.createElement(ie,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.closed||(G.splice(G.indexOf(this.instance),1),this.closed=!0),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.closed||(G.splice(G.indexOf(this.instance),1),this.closed=!0),this.instance.toReactElements()},e.create=function(){return new Y(function(e){return new ue(e)})},e}(),pe={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,valueLink:!0,defaultChecked:!0,checkedLink:!0,innerHTML:!0,suppressContentEditableWarning:!0,onFocusIn:!0,onFocusOut:!0,className:!0,onCopy:!0,onCut:!0,onPaste:!0,onCompositionEnd:!0,onCompositionStart:!0,onCompositionUpdate:!0,onKeyDown:!0,onKeyPress:!0,onKeyUp:!0,onFocus:!0,onBlur:!0,onChange:!0,onInput:!0,onSubmit:!0,onClick:!0,onContextMenu:!0,onDoubleClick:!0,onDrag:!0,onDragEnd:!0,onDragEnter:!0,onDragExit:!0,onDragLeave:!0,onDragOver:!0,onDragStart:!0,onDrop:!0,onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOut:!0,onMouseOver:!0,onMouseUp:!0,onSelect:!0,onTouchCancel:!0,onTouchEnd:!0,onTouchMove:!0,onTouchStart:!0,onScroll:!0,onWheel:!0,onAbort:!0,onCanPlay:!0,onCanPlayThrough:!0,onDurationChange:!0,onEmptied:!0,onEncrypted:!0,onEnded:!0,onError:!0,onLoadedData:!0,onLoadedMetadata:!0,onLoadStart:!0,onPause:!0,onPlay:!0,onPlaying:!0,onProgress:!0,onRateChange:!0,onSeeked:!0,onSeeking:!0,onStalled:!0,onSuspend:!0,onTimeUpdate:!0,onVolumeChange:!0,onWaiting:!0,onLoad:!0,onAnimationStart:!0,onAnimationEnd:!0,onAnimationIteration:!0,onTransitionEnd:!0,onCopyCapture:!0,onCutCapture:!0,onPasteCapture:!0,onCompositionEndCapture:!0,onCompositionStartCapture:!0,onCompositionUpdateCapture:!0,onKeyDownCapture:!0,onKeyPressCapture:!0,onKeyUpCapture:!0,onFocusCapture:!0,onBlurCapture:!0,onChangeCapture:!0,onInputCapture:!0,onSubmitCapture:!0,onClickCapture:!0,onContextMenuCapture:!0,onDoubleClickCapture:!0,onDragCapture:!0,onDragEndCapture:!0,onDragEnterCapture:!0,onDragExitCapture:!0,onDragLeaveCapture:!0,onDragOverCapture:!0,onDragStartCapture:!0,onDropCapture:!0,onMouseDownCapture:!0,onMouseEnterCapture:!0,onMouseLeaveCapture:!0,onMouseMoveCapture:!0,onMouseOutCapture:!0,onMouseOverCapture:!0,onMouseUpCapture:!0,onSelectCapture:!0,onTouchCancelCapture:!0,onTouchEndCapture:!0,onTouchMoveCapture:!0,onTouchStartCapture:!0,onScrollCapture:!0,onWheelCapture:!0,onAbortCapture:!0,onCanPlayCapture:!0,onCanPlayThroughCapture:!0,onDurationChangeCapture:!0,onEmptiedCapture:!0,onEncryptedCapture:!0,onEndedCapture:!0,onErrorCapture:!0,onLoadedDataCapture:!0,onLoadedMetadataCapture:!0,onLoadStartCapture:!0,onPauseCapture:!0,onPlayCapture:!0,onPlayingCapture:!0,onProgressCapture:!0,onRateChangeCapture:!0,onSeekedCapture:!0,onSeekingCapture:!0,onStalledCapture:!0,onSuspendCapture:!0,onTimeUpdateCapture:!0,onVolumeChangeCapture:!0,onWaitingCapture:!0,onLoadCapture:!0,onAnimationStartCapture:!0,onAnimationEndCapture:!0,onAnimationIterationCapture:!0,onTransitionEndCapture:!0},he={accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,as:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,charSet:!0,challenge:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,default:!0,defer:!0,dir:!0,disabled:!0,download:!0,draggable:!0,encType:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,icon:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loop:!0,low:!0,manifest:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,results:!0,security:!0,unselectable:0},de={accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baseProfile:!0,baselineShift:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPath:!0,clipRule:!0,clipPathUnits:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,paintOrder:!0,panose1:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0},fe=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),me={}.hasOwnProperty,ye=function(e){return me.call(he,e)||me.call(de,e)||fe(e.toLowerCase())||me.call(pe,e)},ge=p,be=Object.prototype.toString,Ce=function(e){var t=[],n=e;return{publish:function(e){n=e,t.forEach(function(e){return e(n)})},subscribe:function(e){return t.push(e),e(n),function(){t=t.filter(function(t){return t!==e})}}}},ve="__styled-components__",ke=function(e){function t(){x(this,t);var n=j(this,e.call(this));return n.getTheme=n.getTheme.bind(n),n}return S(t,e),t.prototype.componentWillMount=function(){var e=this;if(this.context[ve]){var t=this.context[ve];this.unsubscribeToOuter=t(function(t){e.outerTheme=t})}this.broadcast=Ce(this.getTheme())},t.prototype.getChildContext=function(){var e;return A({},this.context,(e={},e[ve]=this.broadcast.subscribe,e))},t.prototype.componentWillReceiveProps=function(e){this.props.theme!==e.theme&&this.broadcast.publish(this.getTheme(e.theme))},t.prototype.componentWillUnmount=function(){this.context[ve]&&this.unsubscribeToOuter()},t.prototype.getTheme=function(e){var t=e||this.props.theme;if(ge(t)){var n=t(this.outerTheme);if(!I(n))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return n}if(!I(t))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return A({},this.outerTheme,t)},t.prototype.render=function(){return this.props.children?y.Children.only(this.props.children):null},t}(t.Component);ke.childContextTypes=(se={},se[ve]=ae.func.isRequired,se),ke.contextTypes=(ce={},ce[ve]=ae.func,ce);var we,xe=function(e){function t(){return x(this,t),j(this,e.apply(this,arguments))}return S(t,e),t}(t.Component);xe.contextTypes=(we={},we[ve]=ae.func,we[K]=ae.instanceOf(Y),we)
|
|
2
|
-
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.styled=e.styled||{},e.React)}(this,function(e,t){"use strict";function n(e){return e.replace(g,"-$1").toLowerCase()}function r(e){return v(e).replace(C,"-ms-")}function o(e){return!0===E(e)&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(e){return function(){return e}}function s(e,t,n,r,o,a,i,s){if(te(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,s],l=0;c=new Error(t.replace(/%s/g,function(){return u[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}function c(e){return"string"==typeof e}function u(e){return"function"==typeof e&&"string"==typeof e.styledComponentId}function l(e){return e.displayName||e.name||"Component"}function p(e){var t=ve.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}function h(e,t){for(var n=1540483477,r=t^e.length,o=e.length,a=0;o>=4;){var i=d(e,a);i=m(i,n),i^=i>>>24,i=m(i,n),r=m(r,n),r^=i,a+=4,o-=4}switch(o){case 3:r^=f(e,a),r^=e.charCodeAt(a+2)<<16,r=m(r,n);break;case 2:r^=f(e,a),r=m(r,n);break;case 1:r^=e.charCodeAt(a),r=m(r,n)}return r^=r>>>13,r=m(r,n),(r^=r>>>15)>>>0}function d(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function f(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function m(e,t){return e|=0,t|=0,(65535&e)*t+(((e>>>16)*t&65535)<<16)|0}var y="default"in t?t.default:t,g=/([A-Z])/g,b=n,v=b,C=/^ms-/,k=r,w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},j=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},O=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},I=function(e){return null!=e&&"object"===(void 0===e?"undefined":w(e))&&!Array.isArray(e)},E=I,P=function(e){var t,n;return!1!==o(e)&&("function"==typeof(t=e.constructor)&&(n=t.prototype,!1!==o(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))},M=function e(t,n){var r=Object.keys(t).filter(function(e){var n=t[e];return void 0!==n&&null!==n&&!1!==n&&""!==n}).map(function(n){return P(t[n])?e(t[n],n):k(n)+": "+t[n]+";"}).join(" ");return n?n+" {\n "+r+"\n}":r},N=function e(t,n){return t.reduce(function(t,r){return void 0===r||null===r||!1===r||""===r?t:Array.isArray(r)?[].concat(t,e(r,n)):r.hasOwnProperty("styledComponentId")?[].concat(t,["."+r.styledComponentId]):"function"==typeof r?n?t.concat.apply(t,e([r(n)],n)):t.concat(r):t.concat(P(r)?M(r):r.toString())},[])},D=a(function(e,t){!function(n){"object"===(void 0===t?"undefined":w(t))&&void 0!==e?e.exports=n():window.stylis=n()}(function e(t){function n(e,t,o,i){for(var u,l,p=0,h=0,m=0,y=0,g=0,b=0,v=0,C=0,k=0,w=0,x=0,T=0,O=0,I=0,E=0,P=0,M=0,N=0,Z=0,xe=o.length,Te=xe-1,Oe="",Ee="",Pe="",We="",$e="",He="";E<xe;){if(v=o.charCodeAt(E),h+y+m+p===0){if(E===Te&&(P>0&&(Ee=Ee.replace(f,"")),(Ee=Ee.trim()).length>0)){switch(v){case X:case V:case L:case q:case B:break;default:Ee+=o.charAt(E)}v=L}if(1===M)switch(v){case U:case Q:M=0;break;case V:case q:case B:case X:break;default:E--,v=L}switch(v){case U:for(Ee=Ee.trim(),g=Ee.charCodeAt(0),x=1,E++;E<xe;){switch(v=o.charCodeAt(E)){case U:x++;break;case _:x--}if(0===x)break;Pe+=o.charAt(E++)}switch(g===se&&(g=(Ee=Ee.replace(d,"").trim()).charCodeAt(0)),g){case K:switch(P>0&&(Ee=Ee.replace(f,"")),b=Ee.charCodeAt(1)){case ge:case pe:case he:u=t;break;default:u=je}if(Pe=n(t,u,Pe,b),Z=Pe.length,Ae>0&&0===Z&&(Z=Ee.length),Ie>0&&(u=r(je,Ee,N),l=c(Fe,Pe,u,t,ve,be,Z,b),Ee=u.join(""),void 0!==l&&0===(Z=(Pe=l.trim()).length)&&(b=0,Pe="")),Z>0)switch(b){case ge:case pe:case he:Pe=Ee+"{"+Pe+"}";break;case le:Ee=Ee.replace(S,"$1 $2"+(Le>0?_e:"")),Pe=Ee+"{"+Pe+"}",Pe="@"+(we>0?D+Pe+"@"+Pe:Pe);break;default:Pe=Ee+Pe}else Pe="";break;default:Pe=n(t,r(t,Ee,N),Pe,i)}$e+=Pe,T=0,M=0,I=0,P=0,N=0,O=0,Ee="",Pe="",E++;break;case _:case L:if(Ee=(P>0?Ee.replace(f,""):Ee).trim(),v!==_||Ee.length>0)switch(0===I&&((g=Ee.charCodeAt(0))===Y||g>96&&g<123)&&Ee.indexOf(" ")&&(Ee=Ee.replace(" ",": ")),Ie>0&&void 0!==(l=c(Ne,Ee,t,e,ve,be,We.length,i))&&0===(Ee=l.trim()).length&&(Ee="\0\0"),g=Ee.charCodeAt(0),b=Ee.charCodeAt(1),g+b){case se:break;case me:case ye:He+=Ee+o.charAt(E);break;default:We+=I>0?a(Ee,g,b,Ee.charCodeAt(2)):Ee+";"}T=0,M=0,I=0,P=0,N=0,Ee="",E++}}switch(v){case q:case B:if(h+y+m+p+Se===0)switch(w){case K:case ie:case oe:case J:case ae:case re:case Y:case ee:case Q:case L:case U:case _:break;default:I>0&&(M=1)}h===re&&(h=0),Ie*Re>0&&c(Me,Ee,t,e,ve,be,We.length,i),be=1,ve++;break;default:if(be++,v===V)break;switch(Oe=o.charAt(E),v){case se:Oe="\\0";break;case ce:Oe="\\f";break;case ue:Oe="\\v";break;case G:y+h+p===0&&ke>0&&(N=1,P=1,Oe="\f"+Oe);break;case 108:if(y+h+p+Ce===0&&I>0)switch(E-I){case 2:C===de&&o.charCodeAt(E-3)===ee&&(Ce=C);case 8:k===fe&&(Ce=k)}break;case ee:y+h+p===0&&(I=E);break;case Q:h+m+y+p===0&&(P=1,Oe+="\r");break;case ne:case te:0===h&&(y=y===v?0:0===y?v:y);break;case $:y+h+m===0&&p++;break;case H:y+h+m===0&&p--;break;case W:y+h+p===0&&(E===Te&&(Te++,xe++),m--);break;case z:if(y+h+p===0){if(0===T)switch(2*C+3*k){case 533:break;default:x=0,T=1}m++}break;case K:h+m+y+p+I+O===0&&(O=1);break;case J:case re:if(y+p+m>0)break;switch(h){case 0:switch(2*v+3*o.charCodeAt(E+1)){case 235:h=re;break;case 220:h=J}break;case J:v===re&&C===J&&(Oe="",h=0)}}if(0===h){if(ke+y+p+O===0&&i!==le&&v!==L)switch(v){case Q:case ie:case oe:case ae:case W:case z:if(0===T){switch(C){case V:case X:case B:case q:Oe+="\0";break;default:Oe="\0"+Oe+(v===Q?"":"\0")}P=1}else switch(v){case z:T=++x;break;case W:0==(T=--x)&&(P=1,Oe+="\0")}break;case X:switch(C){case se:case U:case _:case L:case Q:case ce:case V:case X:case B:case q:break;default:0===T&&(P=1,Oe+="\0")}}Ee+=Oe,v!==X&&(w=v)}}k=C,C=v,E++}if(Z=We.length,Ae>0&&0===Z&&0===$e.length&&0===t[0].length==!1&&(i!==pe||1===t.length&&(ke>0?Ue:ze)===t[0])&&(Z=t.join(",").length+2),Z>0){if(0===ke&&i!==le&&s(t),Ie>0&&void 0!==(l=c(De,We,t,e,ve,be,Z,i))&&0===(We=l).length)return He+We+$e;if(We=t.join(",")+"{"+We+"}",we*Ce>0){switch(Ce){case fe:We=We.replace(j,":"+F+"$1")+We;break;case de:We=We.replace(A,"::"+D+"input-$1")+We.replace(A,"::"+F+"$1")+We.replace(A,":"+R+"input-$1")+We}Ce=0}}return He+We+$e}function r(e,t,n){var r=t.trim().split(k),a=r,i=r.length,s=e.length;switch(s){case 0:case 1:for(var c=0,u=0===s?"":e[0]+" ";c<i;c++)a[c]=o(u,a[c],n,s).trim();break;default:for(var c=0,l=0,a=[];c<i;c++)for(var p=0;p<s;p++)a[l++]=o(e[p]+" ",r[c],n,s).trim()}return a}function o(e,t,n,r){var o=t,a=o.charCodeAt(0);switch(a<33&&(a=(o=o.trim()).charCodeAt(0)),a){case G:switch(ke+r){case 0:case 1:if(0===e.trim().length)break;default:return o.replace(w,"$1"+e.trim())}break;case ee:switch(o.charCodeAt(1)){case 103:if(xe>0&&ke>0)return o.replace(x,"$1").replace(w,"$1"+ze);break;default:return e.trim()+o}default:if(n*ke>0&&o.indexOf("\f")>0)return o.replace(w,(e.charCodeAt(0)===ee?"":"$1")+e.trim())}return e+o}function a(e,t,n,r){var o,a=e+";",s=0,c=2*t+3*n+4*r;if(944===c)a=i(a);else if(we>0)switch(c){case 963:110===a.charCodeAt(5)&&(a=D+a+a);break;case 978:a=D+a+F+a+a;break;case 1019:case 983:a=D+a+F+a+R+a+a;break;case 883:a.charCodeAt(8)===Y&&(a=D+a+a);break;case 932:a=D+a+R+a+a;break;case 964:a=D+a+R+"flex-"+a+a;break;case 1023:o=a.substring(a.indexOf(":",15)).replace("flex-",""),a=D+"box-pack"+o+D+a+R+"flex-pack"+o+a;break;case 975:switch(s=(a=e).length-10,o=(33===a.charCodeAt(s)?a.substring(0,s):a).substring(8).trim(),c=o.charCodeAt(0)+(0|o.charCodeAt(7))){case 203:o.charCodeAt(8)>110&&(a=a.replace(o,D+o)+";"+a);break;case 207:case 102:a=a.replace(o,D+(c>102?"inline-":"")+"box")+";"+a.replace(o,D+o)+";"+a.replace(o,R+o+"box")+";"+a}a+=";";break;case 938:if(a.charCodeAt(5)===Y)switch(a.charCodeAt(6)){case 105:o=a.replace("-items",""),a=D+a+D+"box-"+o+R+"flex-"+o+a;break;case 115:a=D+a+R+"flex-item-"+a.replace("-self","")+a;break;default:a=D+a+R+"flex-line-pack"+a.replace("align-content","")+a}break;case 1005:y.test(a)&&(a=a.replace(m,": "+D)+a.replace(m,": "+F)+a);break;case 953:(s=a.indexOf("-content",9))>0&&(o=a.substring(s-3),a="width:"+D+o+"width:"+F+o+"width:"+o);break;case 962:case 1015:a=D+a+(102===a.charCodeAt(5)?R+a:"")+a,n+r===211&&105===a.charCodeAt(13)&&a.indexOf("transform",10)>0&&(a=a.substring(0,a.indexOf(";",27)+1).replace(g,"$1"+D+"$2")+a);break;case 1e3:switch(o=a.substring(13).trim(),s=o.indexOf("-")+1,o.charCodeAt(0)+o.charCodeAt(s)){case 226:o=a.replace(N,"tb");break;case 232:o=a.replace(N,"tb-rl");break;case 220:o=a.replace(N,"lr");break;default:return a}a=D+a+R+o+a}return a}function i(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim(),a="";if(e.charCodeAt(9)!==Y)for(var i=o.split(b),s=0,n=0,t=i.length;s<t;n=0,s++){for(var c=i[s],u=c.split(v);c=u[n];){var l=c.charCodeAt(0);if(1===Le&&(l>K&&l<90||l>96&&l<123||l===Z||l===Y&&c.charCodeAt(1)!==Y))switch(isNaN(parseFloat(c))+(-1!==c.indexOf("("))){case 1:switch(c){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reversed":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:c+=_e}}u[n++]=c}a+=(0===s?"":",")+u.join(" ")}else a+=110===e.charCodeAt(10)?o+(1===Le?_e:""):o;return a=r+a+";",we>0?D+a+a:a}function s(e){for(var t,n,r=0,o=e.length;r<o;r++){for(var a=e[r].split(C),i="",s=0,c=0,u=0,l=0,p=a.length;s<p;s++)if(!(0===(c=(n=a[s]).length)&&p>1)){if(u=i.charCodeAt(i.length-1),l=n.charCodeAt(0),t="",0!==s)switch(u){case J:case ie:case oe:case ae:case X:case z:break;default:t=" "}switch(l){case G:n=t+Ue;case ie:case oe:case ae:case X:case W:case z:break;case $:n=t+n+Ue;break;case ee:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(xe>0){n=t+n.substring(8,c-1);break}default:(s<1||a[s-1].length<1)&&(n=t+Ue+n)}break;case Q:t="";default:n=c>1&&n.indexOf(":")>0?t+n.replace(M,"$1"+Ue+"$2"):t+n+Ue}i+=n}e[r]=i.replace(f,"").trim()}}function c(e,t,n,r,o,a,i,s){for(var c,u=0,l=t;u<Ie;u++)switch(c=Oe[u].call(h,e,l,n,r,o,a,i,s)){case void 0:case!1:case!0:case null:break;default:l=c}switch(l){case void 0:case!1:case!0:case null:case t:break;default:return l}}function u(e){return e.replace(f,"").replace(O,"").replace(I,"$1").replace(E,"$1").replace(P," ")}function l(e){switch(e){case void 0:case null:Ie=Oe.length=0;break;default:switch(e.constructor){case Array:for(var t=0,n=e.length;t<n;t++)l(e[t]);break;case Function:Oe[Ie++]=e;break;case Boolean:Re=0|!!e}}return l}function p(e){for(var t in e){var n=e[t];switch(t){case"keyframe":Le=0|n;break;case"global":xe=0|n;break;case"cascade":ke=0|n;break;case"compress":Te=0|n;break;case"prefix":we=0|n;break;case"semicolon":Se=0|n;break;case"preserve":Ae=0|n}}return p}function h(t,r){if(void 0!==this&&this.constructor===h)return e(t);var o=t,a=o.charCodeAt(0);a<33&&(a=(o=o.trim()).charCodeAt(0)),Le>0&&(_e=o.replace(T,a===$?"":"-")),a=1,1===ke?ze=o:Ue=o;var i,s=[ze];Ie>0&&void 0!==(i=c(Pe,r,s,s,ve,be,0,0))&&"string"==typeof(r=i)&&(r=i);var l=n(je,s,r,0);return Ie>0&&void 0!==(i=c(Ee,l,s,s,ve,be,l.length,0))&&"string"!=typeof(l=i)&&(a=0),_e="",ze="",Ue="",Ce=0,ve=1,be=1,Te*a==0?l:u(l)}var d=/^\0+/g,f=/[\0\r\f]/g,m=/: */g,y=/zoo|gra/,g=/([,: ])(transform)/g,b=/,+\s*(?![^(]*[)])/g,v=/ +\s*(?![^(]*[)])/g,C=/ *[\0] */g,k=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,x=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,T=/\W+/g,S=/@(k\w+)\s*(\S*)\s*/,A=/::(place)/g,j=/:(read-only)/g,O=/\s+(?=[{\];=:>])/g,I=/([[}=:>])\s+/g,E=/(\{[^{]+?);(?=\})/g,P=/\s{2,}/g,M=/([^\(])(:+) */g,N=/[svh]\w+-[tblr]{2}/,D="-webkit-",F="-moz-",R="-ms-",L=59,_=125,U=123,z=40,W=41,$=91,H=93,B=10,q=13,V=9,K=64,X=32,G=38,Y=45,Z=95,J=42,Q=44,ee=58,te=39,ne=34,re=47,oe=62,ae=43,ie=126,se=0,ce=12,ue=11,le=107,pe=109,he=115,de=112,fe=111,me=169,ye=163,ge=100,be=1,ve=1,Ce=0,ke=1,we=1,xe=1,Te=0,Se=0,Ae=0,je=[],Oe=[],Ie=0,Ee=-2,Pe=-1,Me=0,Ne=1,De=2,Fe=3,Re=0,Le=1,_e="",Ue="",ze="";return h.use=l,h.set=p,void 0!==t&&p(t),h})}),F=new D({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!0}),R=function(e,t,n){var r=e.join("").replace(/^\s*\/\/.*$/gm,""),o=t&&n?n+" "+t+" { "+r+" }":r;return F(n||!t?"":t,o)},L="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),_=L.length,U=function(e){var t="",n=void 0;for(n=e;n>_;n=Math.floor(n/_))t=L[n%_]+t;return L[n%_]+t},z=function(e,t){return t.reduce(function(t,n,r){return t.concat(n,e[r+1])},[e[0]])},W=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return N(z(e,n))},$=function(e){var t=""+(e||""),n=[];return t.replace(/^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//gm,function(e,t,r){return n.push({componentId:t,matchIndex:r}),e}),n.map(function(e,r){var o=e.componentId,a=e.matchIndex,i=n[r+1];return{componentId:o,cssFromDOM:i?t.slice(a,i.matchIndex):t.slice(a)}})},H=function(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null},B=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";x(this,e),this.el=t,this.isLocal=n,this.ready=!1;var o=$(r);this.size=o.length,this.components=o.reduce(function(e,t){return e[t.componentId]=t,e},{})}return e.prototype.isFull=function(){return this.size>=40},e.prototype.addComponent=function(e){if(this.ready||this.replaceElement(),this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");var t={componentId:e,textNode:document.createTextNode("")};this.el.appendChild(t.textNode),this.size+=1,this.components[e]=t},e.prototype.inject=function(e,t,n){this.ready||this.replaceElement();var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");if(""===r.textNode.data&&r.textNode.appendData("\n/* sc-component-id: "+e+" */\n"),r.textNode.appendData(t),n){var o=this.el.getAttribute(V);this.el.setAttribute(V,o?o+" "+n:n)}var a=H();a&&this.el.setAttribute("nonce",a)},e.prototype.toHTML=function(){return this.el.outerHTML},e.prototype.toReactElement=function(){throw new Error("BrowserTag doesn't implement toReactElement!")},e.prototype.clone=function(){throw new Error("BrowserTag cannot be cloned!")},e.prototype.replaceElement=function(){var e=this;if(this.ready=!0,0!==this.size){var t=this.el.cloneNode();if(t.appendChild(document.createTextNode("\n")),Object.keys(this.components).forEach(function(n){var r=e.components[n];r.textNode=document.createTextNode(r.cssFromDOM),t.appendChild(r.textNode)}),!this.el.parentNode)throw new Error("Trying to replace an element that wasn't mounted!");this.el.parentNode.replaceChild(t,this.el),this.el=t}},e}(),q={create:function(){for(var e=[],t={},n=document.querySelectorAll("["+V+"]"),r=n.length,o=0;o<r;o+=1){var a=n[o];e.push(new B(a,"true"===a.getAttribute(K),a.innerHTML));var i=a.getAttribute(V);i&&i.trim().split(/\s+/).forEach(function(e){t[e]=!0})}return new Z(function(e){var t=document.createElement("style");if(t.type="text/css",t.setAttribute(V,""),t.setAttribute(K,e?"true":"false"),!document.head)throw new Error("Missing document <head>");return document.head.appendChild(t),new B(t,e)},e,t)}},V="data-styled-components",K="data-styled-components-is-local",X="__styled-components-stylesheet__",G=null,Y=[],Z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.hashes={},this.deferredInjections={},this.stylesCacheable="undefined"!=typeof document,this.tagConstructor=t,this.tags=n,this.names=r,this.constructComponentTagMap()}return e.prototype.constructComponentTagMap=function(){var e=this;this.componentTags={},this.tags.forEach(function(t){Object.keys(t.components).forEach(function(n){e.componentTags[n]=t})})},e.prototype.getName=function(e){return this.hashes[e.toString()]},e.prototype.alreadyInjected=function(e,t){return!!this.names[t]&&(this.hashes[e.toString()]=t,!0)},e.prototype.hasInjectedComponent=function(e){return!!this.componentTags[e]},e.prototype.deferredInject=function(e,t,n){this===G&&Y.forEach(function(r){r.deferredInject(e,t,n)}),this.getOrCreateTag(e,t),this.deferredInjections[e]=n},e.prototype.inject=function(e,t,n,r,o){this===G&&Y.forEach(function(r){r.inject(e,t,n)});var a=this.getOrCreateTag(e,t),i=this.deferredInjections[e];i&&(a.inject(e,i),delete this.deferredInjections[e]),a.inject(e,n,o),r&&o&&(this.hashes[r.toString()]=o)},e.prototype.toHTML=function(){return this.tags.map(function(e){return e.toHTML()}).join("")},e.prototype.toReactElements=function(){return this.tags.map(function(e,t){return e.toReactElement("sc-"+t)})},e.prototype.getOrCreateTag=function(e,t){var n=this.componentTags[e];if(n)return n;var r=this.tags[this.tags.length-1],o=!r||r.isFull()||r.isLocal!==t?this.createNewTag(t):r;return this.componentTags[e]=o,o.addComponent(e),o},e.prototype.createNewTag=function(e){var t=this.tagConstructor(e);return this.tags.push(t),t},e.reset=function(t){G=e.create(t)},e.create=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof document)?pe:q).create()},e.clone=function(t){var n=new e(t.tagConstructor,t.tags.map(function(e){return e.clone()}),S({},t.names));return n.hashes=S({},t.hashes),n.deferredInjections=S({},t.deferredInjections),Y.push(n),n},T(e,null,[{key:"instance",get:function(){return G||(G=e.create())}}]),e}(),J=function(){};J.thatReturns=i,J.thatReturnsFalse=i(!1),J.thatReturnsTrue=i(!0),J.thatReturnsNull=i(null),J.thatReturnsThis=function(){return this},J.thatReturnsArgument=function(e){return e};var Q,ee=J,te=function(e){},ne=s,re=ee,oe=ne,ae=function(){function e(){oe(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=re,n.PropTypes=n,n},ie=a(function(e){e.exports=ae()}),se=function(e){function t(){return x(this,t),O(this,e.apply(this,arguments))}return A(t,e),t.prototype.getChildContext=function(){var e;return e={},e[X]=this.props.sheet,e},t.prototype.render=function(){return y.Children.only(this.props.children)},t}(t.Component);se.childContextTypes=(Q={},Q[X]=ie.instanceOf(Z).isRequired,Q);var ce,ue,le=function(){function e(t){x(this,e),this.isLocal=t,this.components={},this.size=0,this.names=[]}return e.prototype.isFull=function(){return!1},e.prototype.addComponent=function(e){if(this.components[e])throw new Error("Trying to add Component '"+e+"' twice!");this.components[e]={componentId:e,css:""},this.size+=1},e.prototype.concatenateCSS=function(){var e=this;return Object.keys(this.components).reduce(function(t,n){return t+e.components[n].css},"")},e.prototype.inject=function(e,t,n){var r=this.components[e];if(!r)throw new Error("Must add a new component before you can inject css into it");""===r.css&&(r.css="/* sc-component-id: "+e+" */\n"),r.css+=t.replace(/\n*$/,"\n"),n&&this.names.push(n)},e.prototype.toHTML=function(){var e=['type="text/css"',V+'="'+this.names.join(" ")+'"',K+'="'+(this.isLocal?"true":"false")+'"'],t=H();return t&&e.push('nonce="'+t+'"'),"<style "+e.join(" ")+">"+this.concatenateCSS()+"</style>"},e.prototype.toReactElement=function(e){var t,n=(t={},t[V]=this.names.join(" "),t[K]=this.isLocal.toString(),t),r=H();return r&&(n.nonce=r),y.createElement("style",S({key:e,type:"text/css"},n,{dangerouslySetInnerHTML:{__html:this.concatenateCSS()}}))},e.prototype.clone=function(){var t=this,n=new e(this.isLocal);return n.names=[].concat(this.names),n.size=this.size,n.components=Object.keys(this.components).reduce(function(e,n){return e[n]=S({},t.components[n]),e},{}),n},e}(),pe=function(){function e(){x(this,e),this.instance=Z.clone(Z.instance)}return e.prototype.collectStyles=function(e){if(this.closed)throw new Error("Can't collect styles once you've called getStyleTags!");return y.createElement(se,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.closed||(Y.splice(Y.indexOf(this.instance),1),this.closed=!0),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.closed||(Y.splice(Y.indexOf(this.instance),1),this.closed=!0),this.instance.toReactElements()},e.create=function(){return new Z(function(e){return new le(e)})},e}(),he={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,valueLink:!0,defaultChecked:!0,checkedLink:!0,innerHTML:!0,suppressContentEditableWarning:!0,onFocusIn:!0,onFocusOut:!0,className:!0,onCopy:!0,onCut:!0,onPaste:!0,onCompositionEnd:!0,onCompositionStart:!0,onCompositionUpdate:!0,onKeyDown:!0,onKeyPress:!0,onKeyUp:!0,onFocus:!0,onBlur:!0,onChange:!0,onInput:!0,onSubmit:!0,onClick:!0,onContextMenu:!0,onDoubleClick:!0,onDrag:!0,onDragEnd:!0,onDragEnter:!0,onDragExit:!0,onDragLeave:!0,onDragOver:!0,onDragStart:!0,onDrop:!0,onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOut:!0,onMouseOver:!0,onMouseUp:!0,onSelect:!0,onTouchCancel:!0,onTouchEnd:!0,onTouchMove:!0,onTouchStart:!0,onScroll:!0,onWheel:!0,onAbort:!0,onCanPlay:!0,onCanPlayThrough:!0,onDurationChange:!0,onEmptied:!0,onEncrypted:!0,onEnded:!0,onError:!0,onLoadedData:!0,onLoadedMetadata:!0,onLoadStart:!0,onPause:!0,onPlay:!0,onPlaying:!0,onProgress:!0,onRateChange:!0,onSeeked:!0,onSeeking:!0,onStalled:!0,onSuspend:!0,onTimeUpdate:!0,onVolumeChange:!0,onWaiting:!0,onLoad:!0,onAnimationStart:!0,onAnimationEnd:!0,onAnimationIteration:!0,onTransitionEnd:!0,onCopyCapture:!0,onCutCapture:!0,onPasteCapture:!0,onCompositionEndCapture:!0,onCompositionStartCapture:!0,onCompositionUpdateCapture:!0,onKeyDownCapture:!0,onKeyPressCapture:!0,onKeyUpCapture:!0,onFocusCapture:!0,onBlurCapture:!0,onChangeCapture:!0,onInputCapture:!0,onSubmitCapture:!0,onClickCapture:!0,onContextMenuCapture:!0,onDoubleClickCapture:!0,onDragCapture:!0,onDragEndCapture:!0,onDragEnterCapture:!0,onDragExitCapture:!0,onDragLeaveCapture:!0,onDragOverCapture:!0,onDragStartCapture:!0,onDropCapture:!0,onMouseDownCapture:!0,onMouseEnterCapture:!0,onMouseLeaveCapture:!0,onMouseMoveCapture:!0,onMouseOutCapture:!0,onMouseOverCapture:!0,onMouseUpCapture:!0,onSelectCapture:!0,onTouchCancelCapture:!0,onTouchEndCapture:!0,onTouchMoveCapture:!0,onTouchStartCapture:!0,onScrollCapture:!0,onWheelCapture:!0,onAbortCapture:!0,onCanPlayCapture:!0,onCanPlayThroughCapture:!0,onDurationChangeCapture:!0,onEmptiedCapture:!0,onEncryptedCapture:!0,onEndedCapture:!0,onErrorCapture:!0,onLoadedDataCapture:!0,onLoadedMetadataCapture:!0,onLoadStartCapture:!0,onPauseCapture:!0,onPlayCapture:!0,onPlayingCapture:!0,onProgressCapture:!0,onRateChangeCapture:!0,onSeekedCapture:!0,onSeekingCapture:!0,onStalledCapture:!0,onSuspendCapture:!0,onTimeUpdateCapture:!0,onVolumeChangeCapture:!0,onWaitingCapture:!0,onLoadCapture:!0,onAnimationStartCapture:!0,onAnimationEndCapture:!0,onAnimationIterationCapture:!0,onTransitionEndCapture:!0},de={accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,as:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,charSet:!0,challenge:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,default:!0,defer:!0,dir:!0,disabled:!0,download:!0,draggable:!0,encType:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,icon:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loop:!0,low:!0,manifest:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,results:!0,security:!0,unselectable:0},fe={accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baseProfile:!0,baselineShift:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPath:!0,clipRule:!0,clipPathUnits:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,paintOrder:!0,panose1:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0},me=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),ye={}.hasOwnProperty,ge=function(e){return ye.call(de,e)||ye.call(fe,e)||me(e.toLowerCase())||ye.call(he,e)},be=p,ve=Object.prototype.toString,Ce=function(e){function t(e){i=e;for(var t in o){var n=o[t];void 0!==n&&n(i)}}function n(e){var t=a;return o[t]=e,a+=1,e(i),t}function r(e){o[e]=void 0}var o={},a=0,i=e;return{publish:t,subscribe:n,unsubscribe:r}},ke="__styled-components__",we=ke+"next__",xe=ie.shape({getTheme:ie.func,subscribe:ie.func,unsubscribe:ie.func}),Te=function(e){var t=!1;return function(){t||(t=!0,e())}}(function(){console.error("Warning: Usage of `context."+ke+"` as a function is deprecated. It will be replaced with the object on `.context."+we+"` in a future version.")}),Se=function(e){function t(){x(this,t);var n=O(this,e.call(this));return n.unsubscribeToOuterId=-1,n.getTheme=n.getTheme.bind(n),n}return A(t,e),t.prototype.componentWillMount=function(){var e=this,t=this.context[we];void 0!==t&&(this.unsubscribeToOuterId=t.subscribe(function(t){e.outerTheme=t})),this.broadcast=Ce(this.getTheme())},t.prototype.getChildContext=function(){var e,t=this;return S({},this.context,(e={},e[we]={getTheme:this.getTheme,subscribe:this.broadcast.subscribe,unsubscribe:this.broadcast.unsubscribe},e[ke]=function(e){Te();var n=t.broadcast.subscribe(e);return function(){return t.broadcast.unsubscribe(n)}},e))},t.prototype.componentWillReceiveProps=function(e){this.props.theme!==e.theme&&this.broadcast.publish(this.getTheme(e.theme))},t.prototype.componentWillUnmount=function(){-1!==this.unsubscribeToOuterId&&this.context[we].unsubscribe(this.unsubscribeToOuterId)},t.prototype.getTheme=function(e){var t=e||this.props.theme;if(be(t)){var n=t(this.outerTheme);if(!P(n))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return n}if(!P(t))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return S({},this.outerTheme,t)},t.prototype.render=function(){return this.props.children?y.Children.only(this.props.children):null},t}(t.Component);Se.childContextTypes=(ce={},ce[ke]=ie.func,ce[we]=xe,ce),Se.contextTypes=(ue={},ue[we]=xe,ue);var Ae={},je=function e(t){for(var n=0;n<t.length;n+=1){var r=t[n];if(Array.isArray(r)&&!e(r))return!1;if("function"==typeof r&&!u(r))return!1}return!0
|
|
2
|
+
},Oe=["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","marquee","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","var","video","wbr","circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ie=function(e){return e.replace(/\s|\\n/g,"")},Ee={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},Pe={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},Me="function"==typeof Object.getOwnPropertySymbols,Ne=function(e,t,n){if("string"!=typeof t){var r=Object.getOwnPropertyNames(t);Me&&(r=r.concat(Object.getOwnPropertySymbols(t)));for(var o=0;o<r.length;++o)if(!(Ee[r[o]]||Pe[r[o]]||n&&n[r[o]]))try{e[r[o]]=t[r[o]]}catch(e){}}return e},De=function(e){var t,n=e.displayName||e.name||"Component",r=u(e),o=function(t){function n(){var e,r,o;x(this,n);for(var a=arguments.length,i=Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=r=O(this,t.call.apply(t,[this].concat(i))),r.state={},r.unsubscribeId=-1,o=e,O(r,o)}return A(n,t),n.prototype.componentWillMount=function(){var e=this,t=this.context[we];if(void 0===t)return void console.error("[withTheme] Please use ThemeProvider to be able to use withTheme");var n=t.subscribe;this.unsubscribeId=n(function(t){e.setState({theme:t})})},n.prototype.componentWillUnmount=function(){-1!==this.unsubscribeId&&this.context[we].unsubscribe(this.unsubscribeId)},n.prototype.render=function(){var t=this.props.innerRef,n=this.state.theme;return y.createElement(e,S({theme:n},this.props,{innerRef:r?t:void 0,ref:r?void 0:t}))},n}(y.Component);return o.displayName="WithTheme("+n+")",o.styledComponentId="withTheme",o.contextTypes=(t={},t[ke]=ie.func,t[we]=xe,t),Ne(o,e)},Fe=function(e,t,n){return function(){function r(e,t){if(x(this,r),this.rules=e,this.isStatic=je(e),this.componentId=t,!Z.instance.hasInjectedComponent(this.componentId)){Z.instance.deferredInject(t,!0,"")}}return r.prototype.generateAndInjectStyles=function(r,o){var a=this.isStatic,i=this.lastClassName;if(a&&void 0!==i)return i;var s=t(this.rules,r),c=h(this.componentId+s.join("")),u=o.getName(c);if(void 0!==u)return o.stylesCacheable&&(this.lastClassName=u),u;var l=e(c);if(o.stylesCacheable&&(this.lastClassName=u),o.alreadyInjected(c,l))return l;var p="\n"+n(s,"."+l);return o.inject(this.componentId,!0,p,c,l),l},r.generateName=function(t){return e(h(t))},r}()}(U,N,R),Re=function(e){return function t(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"!=typeof r&&"function"!=typeof r)throw new Error("Cannot create styled-component for component: "+r);var a=function(t){for(var a=arguments.length,i=Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];return n(r,o,e.apply(void 0,[t].concat(i)))};return a.withConfig=function(e){return t(n,r,S({},o,e))},a.attrs=function(e){return t(n,r,S({},o,{attrs:S({},o.attrs||{},e)}))},a}}(W),Le=function(e,n){var r={},o=function(t,n){var o="string"!=typeof t?"sc":t.replace(/[[\].#*$><+~=|^:(),"'`]/g,"-").replace(/--+/g,"-"),a=(r[o]||0)+1;r[o]=a;var i=e.generateName(o+a),s=o+"-"+i;return void 0!==n?n+"-"+s:s},a=function(e){function n(){var t,r,o;x(this,n);for(var a=arguments.length,i=Array(a),s=0;s<a;s++)i[s]=arguments[s];return t=r=O(this,e.call.apply(e,[this].concat(i))),r.attrs={},r.state={theme:null,generatedClassName:""},r.unsubscribeId=-1,o=t,O(r,o)}return A(n,e),n.prototype.unsubscribeFromContext=function(){-1!==this.unsubscribeId&&this.context[we].unsubscribe(this.unsubscribeId)},n.prototype.buildExecutionContext=function(e,t){var n=this.constructor.attrs,r=S({},t,{theme:e});return void 0===n?r:(this.attrs=Object.keys(n).reduce(function(e,t){var o=n[t];return e[t]="function"==typeof o?o(r):o,e},{}),S({},r,this.attrs))},n.prototype.generateAndInjectStyles=function(e,t){var n=this.constructor,r=n.attrs,o=n.componentStyle,a=n.warnTooManyClasses,i=this.context[X]||Z.instance;if(o.isStatic&&void 0===r)return o.generateAndInjectStyles(Ae,i);var s=this.buildExecutionContext(e,t),c=o.generateAndInjectStyles(s,i);return void 0!==a&&a(c),c},n.prototype.componentWillMount=function(){var e=this,t=this.constructor.componentStyle,n=this.context[we];if(t.isStatic){var r=this.generateAndInjectStyles(Ae,this.props);this.setState({generatedClassName:r})}else if(void 0!==n){var o=n.subscribe;this.unsubscribeId=o(function(t){var n=e.constructor.defaultProps,r=n&&e.props.theme===n.theme,o=e.props.theme&&!r?e.props.theme:t,a=e.generateAndInjectStyles(o,e.props);e.setState({theme:o,generatedClassName:a})})}else{var a=this.props.theme||{},i=this.generateAndInjectStyles(a,this.props);this.setState({theme:a,generatedClassName:i})}},n.prototype.componentWillReceiveProps=function(e){var t=this;this.constructor.componentStyle.isStatic||this.setState(function(n){var r=t.constructor.defaultProps,o=r&&e.theme===r.theme,a=e.theme&&!o?e.theme:n.theme;return{theme:a,generatedClassName:t.generateAndInjectStyles(a,e)}})},n.prototype.componentWillUnmount=function(){this.unsubscribeFromContext()},n.prototype.render=function(){var e=this,n=this.props.innerRef,r=this.state.generatedClassName,o=this.constructor,a=o.styledComponentId,i=o.target,s=c(i),l=[this.props.className,a,this.attrs.className,r].filter(Boolean).join(" "),p=S({},this.attrs,{className:l});u(i)?p.innerRef=n:p.ref=n;var h=Object.keys(this.props).reduce(function(t,n){return"innerRef"===n||"className"===n||s&&!ge(n)||(t[n]=e.props[n]),t},p);return t.createElement(i,h)},n}(t.Component);return function t(r,i,s){var u,p=i.displayName,h=void 0===p?c(r)?"styled."+r:"Styled("+l(r)+")":p,d=i.componentId,f=void 0===d?o(i.displayName,i.parentComponentId):d,m=i.ParentComponent,y=void 0===m?a:m,g=i.rules,b=i.attrs,v=i.displayName&&i.componentId?i.displayName+"-"+i.componentId:f,C=new e(void 0===g?s:g.concat(s),v),k=function(e){function o(){return x(this,o),O(this,e.apply(this,arguments))}return A(o,e),o.withComponent=function(e){var n=i.componentId,r=j(i,["componentId"]),a=n&&n+"-"+(c(e)?e:l(e)),u=S({},r,{componentId:a,ParentComponent:o});return t(e,u,s)},T(o,null,[{key:"extend",get:function(){var e=i.rules,a=i.componentId,c=j(i,["rules","componentId"]),u=void 0===e?s:e.concat(s),l=S({},c,{rules:u,parentComponentId:a,ParentComponent:o});return n(t,r,l)}}]),o}(y);return k.contextTypes=(u={},u[ke]=ie.func,u[we]=xe,u[X]=ie.instanceOf(Z),u),k.displayName=h,k.styledComponentId=v,k.attrs=b,k.componentStyle=C,k.warnTooManyClasses=void 0,k.target=r,k}}(Fe,Re),_e=function(e,t,n){return function(r){for(var o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];var s=n.apply(void 0,[r].concat(a)),c=h(Ie(JSON.stringify(s))),u=Z.instance.getName(c);if(u)return u;var l=e(c);if(Z.instance.alreadyInjected(c,l))return l;var p=t(s,l,"@keyframes");return Z.instance.inject("sc-keyframes-"+l,!0,p,c,l),l}}(U,R,W),Ue=function(e,t){return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var i=t.apply(void 0,[n].concat(o)),s=h(JSON.stringify(i)),c="sc-global-"+s;Z.instance.hasInjectedComponent(c)||Z.instance.inject(c,!1,e(i))}}(R,W),ze=function(e,t){var n=function(n){return t(e,n)};return Oe.forEach(function(e){n[e]=n(e)}),n}(Le,Re);e.default=ze,e.css=W,e.keyframes=_e,e.injectGlobal=Ue,e.ThemeProvider=Se,e.withTheme=De,e.ServerStyleSheet=pe,e.StyleSheetManager=se,Object.defineProperty(e,"__esModule",{value:!0})});
|
package/lib/hoc/withTheme.js
CHANGED
|
@@ -50,7 +50,7 @@ var wrapWithTheme = function wrapWithTheme(Component) {
|
|
|
50
50
|
args[_key] = arguments[_key];
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
53
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _this.unsubscribeId = -1, _temp), _possibleConstructorReturn(_this, _ret);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// NOTE: This is so that isStyledComponent passes for the innerRef unwrapping
|
|
@@ -59,18 +59,24 @@ var wrapWithTheme = function wrapWithTheme(Component) {
|
|
|
59
59
|
WithTheme.prototype.componentWillMount = function componentWillMount() {
|
|
60
60
|
var _this2 = this;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
var styledContext = this.context[_ThemeProvider.CHANNEL_NEXT];
|
|
63
|
+
if (styledContext === undefined) {
|
|
64
|
+
// eslint-disable-next-line no-console
|
|
65
|
+
console.error('[withTheme] Please use ThemeProvider to be able to use withTheme');
|
|
66
|
+
return;
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
var subscribe =
|
|
67
|
-
|
|
69
|
+
var subscribe = styledContext.subscribe;
|
|
70
|
+
|
|
71
|
+
this.unsubscribeId = subscribe(function (theme) {
|
|
68
72
|
_this2.setState({ theme: theme });
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
WithTheme.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
73
|
-
if (
|
|
77
|
+
if (this.unsubscribeId !== -1) {
|
|
78
|
+
this.context[_ThemeProvider.CHANNEL_NEXT].unsubscribe(this.unsubscribeId);
|
|
79
|
+
}
|
|
74
80
|
};
|
|
75
81
|
|
|
76
82
|
WithTheme.prototype.render = function render() {
|
|
@@ -92,7 +98,7 @@ var wrapWithTheme = function wrapWithTheme(Component) {
|
|
|
92
98
|
|
|
93
99
|
WithTheme.displayName = 'WithTheme(' + componentName + ')';
|
|
94
100
|
WithTheme.styledComponentId = 'withTheme';
|
|
95
|
-
WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[_ThemeProvider.CHANNEL] = _propTypes2.default.func, _WithTheme$contextTyp);
|
|
101
|
+
WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[_ThemeProvider.CHANNEL] = _propTypes2.default.func, _WithTheme$contextTyp[_ThemeProvider.CHANNEL_NEXT] = _ThemeProvider.CONTEXT_CHANNEL_SHAPE, _WithTheme$contextTyp);
|
|
96
102
|
|
|
97
103
|
|
|
98
104
|
return (0, _hoistNonReactStatics2.default)(WithTheme, Component);
|
|
@@ -7,6 +7,10 @@ var _extractCompsFromCSS = require('../utils/extractCompsFromCSS');
|
|
|
7
7
|
|
|
8
8
|
var _extractCompsFromCSS2 = _interopRequireDefault(_extractCompsFromCSS);
|
|
9
9
|
|
|
10
|
+
var _nonce = require('../utils/nonce');
|
|
11
|
+
|
|
12
|
+
var _nonce2 = _interopRequireDefault(_nonce);
|
|
13
|
+
|
|
10
14
|
var _StyleSheet = require('./StyleSheet');
|
|
11
15
|
|
|
12
16
|
var _StyleSheet2 = _interopRequireDefault(_StyleSheet);
|
|
@@ -14,6 +18,7 @@ var _StyleSheet2 = _interopRequireDefault(_StyleSheet);
|
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
|
|
16
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
/* eslint-disable no-underscore-dangle */
|
|
17
22
|
/*
|
|
18
23
|
* Browser Style Sheet with Rehydration
|
|
19
24
|
*
|
|
@@ -82,6 +87,12 @@ var BrowserTag = function () {
|
|
|
82
87
|
var existingNames = this.el.getAttribute(_StyleSheet.SC_ATTR);
|
|
83
88
|
this.el.setAttribute(_StyleSheet.SC_ATTR, existingNames ? existingNames + ' ' + name : name);
|
|
84
89
|
}
|
|
90
|
+
|
|
91
|
+
var nonce = (0, _nonce2.default)();
|
|
92
|
+
|
|
93
|
+
if (nonce) {
|
|
94
|
+
this.el.setAttribute('nonce', nonce);
|
|
95
|
+
}
|
|
85
96
|
};
|
|
86
97
|
|
|
87
98
|
BrowserTag.prototype.toHTML = function toHTML() {
|
|
@@ -10,6 +10,10 @@ var _StyleSheet = require('./StyleSheet');
|
|
|
10
10
|
|
|
11
11
|
var _StyleSheet2 = _interopRequireDefault(_StyleSheet);
|
|
12
12
|
|
|
13
|
+
var _isStyledComponent = require('../utils/isStyledComponent');
|
|
14
|
+
|
|
15
|
+
var _isStyledComponent2 = _interopRequireDefault(_isStyledComponent);
|
|
16
|
+
|
|
13
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
18
|
|
|
15
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -22,16 +26,35 @@ var babelPluginFlowReactPropTypes_proptype_NameGenerator = require('../types').b
|
|
|
22
26
|
|
|
23
27
|
var babelPluginFlowReactPropTypes_proptype_RuleSet = require('../types').babelPluginFlowReactPropTypes_proptype_RuleSet || require('prop-types').any;
|
|
24
28
|
|
|
29
|
+
var isStaticRules = function isStaticRules(rules) {
|
|
30
|
+
for (var i = 0; i < rules.length; i += 1) {
|
|
31
|
+
var rule = rules[i];
|
|
32
|
+
|
|
33
|
+
// recursive case
|
|
34
|
+
if (Array.isArray(rule) && !isStaticRules(rule)) {
|
|
35
|
+
return false;
|
|
36
|
+
} else if (typeof rule === 'function' && !(0, _isStyledComponent2.default)(rule)) {
|
|
37
|
+
// functions are allowed to be static if they're just being
|
|
38
|
+
// used to get the classname of a nested styled copmonent
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
|
|
25
46
|
/*
|
|
26
47
|
ComponentStyle is all the CSS-specific stuff, not
|
|
27
48
|
the React-specific stuff.
|
|
28
49
|
*/
|
|
50
|
+
|
|
29
51
|
exports.default = function (nameGenerator, flatten, stringifyRules) {
|
|
30
52
|
var ComponentStyle = function () {
|
|
31
53
|
function ComponentStyle(rules, componentId) {
|
|
32
54
|
_classCallCheck(this, ComponentStyle);
|
|
33
55
|
|
|
34
56
|
this.rules = rules;
|
|
57
|
+
this.isStatic = isStaticRules(rules);
|
|
35
58
|
this.componentId = componentId;
|
|
36
59
|
if (!_StyleSheet2.default.instance.hasInjectedComponent(this.componentId)) {
|
|
37
60
|
var placeholder = process.env.NODE_ENV !== 'production' ? '.' + componentId + ' {}' : '';
|
|
@@ -47,16 +70,36 @@ exports.default = function (nameGenerator, flatten, stringifyRules) {
|
|
|
47
70
|
|
|
48
71
|
|
|
49
72
|
ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
|
|
73
|
+
var isStatic = this.isStatic,
|
|
74
|
+
lastClassName = this.lastClassName;
|
|
75
|
+
|
|
76
|
+
if (isStatic && lastClassName !== undefined) {
|
|
77
|
+
return lastClassName;
|
|
78
|
+
}
|
|
79
|
+
|
|
50
80
|
var flatCSS = flatten(this.rules, executionContext);
|
|
51
81
|
var hash = (0, _hash2.default)(this.componentId + flatCSS.join(''));
|
|
52
82
|
|
|
53
83
|
var existingName = styleSheet.getName(hash);
|
|
54
|
-
if (existingName)
|
|
84
|
+
if (existingName !== undefined) {
|
|
85
|
+
if (styleSheet.stylesCacheable) {
|
|
86
|
+
this.lastClassName = existingName;
|
|
87
|
+
}
|
|
88
|
+
return existingName;
|
|
89
|
+
}
|
|
55
90
|
|
|
56
91
|
var name = nameGenerator(hash);
|
|
57
|
-
if (styleSheet.
|
|
92
|
+
if (styleSheet.stylesCacheable) {
|
|
93
|
+
this.lastClassName = existingName;
|
|
94
|
+
}
|
|
95
|
+
if (styleSheet.alreadyInjected(hash, name)) {
|
|
96
|
+
return name;
|
|
97
|
+
}
|
|
58
98
|
|
|
59
99
|
var css = '\n' + stringifyRules(flatCSS, '.' + name);
|
|
100
|
+
// NOTE: this can only be set when we inject the class-name.
|
|
101
|
+
// For some reason, presumably due to how css is stringifyRules behaves in
|
|
102
|
+
// differently between client and server, styles break.
|
|
60
103
|
styleSheet.inject(this.componentId, true, css, hash, name);
|
|
61
104
|
return name;
|
|
62
105
|
};
|
|
@@ -56,7 +56,7 @@ exports.default = function (styleSheet) {
|
|
|
56
56
|
root.each(function (node) {
|
|
57
57
|
if (node.type === 'decl') {
|
|
58
58
|
declPairs.push([node.prop, node.value]);
|
|
59
|
-
} else {
|
|
59
|
+
} else if (node.type !== 'comment') {
|
|
60
60
|
/* eslint-disable no-console */
|
|
61
61
|
console.warn('Node of type ' + node.type + ' not supported as an inline style');
|
|
62
62
|
}
|
|
@@ -16,9 +16,15 @@ var _StyleSheetManager = require('./StyleSheetManager');
|
|
|
16
16
|
|
|
17
17
|
var _StyleSheetManager2 = _interopRequireDefault(_StyleSheetManager);
|
|
18
18
|
|
|
19
|
+
var _nonce = require('../utils/nonce');
|
|
20
|
+
|
|
21
|
+
var _nonce2 = _interopRequireDefault(_nonce);
|
|
22
|
+
|
|
19
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
24
|
|
|
21
25
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
+
/* eslint-disable no-underscore-dangle */
|
|
27
|
+
|
|
22
28
|
|
|
23
29
|
var babelPluginFlowReactPropTypes_proptype_Tag = require('./StyleSheet').babelPluginFlowReactPropTypes_proptype_Tag || require('prop-types').any;
|
|
24
30
|
|
|
@@ -42,6 +48,14 @@ var ServerTag = function () {
|
|
|
42
48
|
this.size += 1;
|
|
43
49
|
};
|
|
44
50
|
|
|
51
|
+
ServerTag.prototype.concatenateCSS = function concatenateCSS() {
|
|
52
|
+
var _this = this;
|
|
53
|
+
|
|
54
|
+
return Object.keys(this.components).reduce(function (styles, k) {
|
|
55
|
+
return styles + _this.components[k].css;
|
|
56
|
+
}, '');
|
|
57
|
+
};
|
|
58
|
+
|
|
45
59
|
ServerTag.prototype.inject = function inject(componentId, css, name) {
|
|
46
60
|
var comp = this.components[componentId];
|
|
47
61
|
|
|
@@ -54,40 +68,42 @@ var ServerTag = function () {
|
|
|
54
68
|
};
|
|
55
69
|
|
|
56
70
|
ServerTag.prototype.toHTML = function toHTML() {
|
|
57
|
-
var
|
|
71
|
+
var attrs = ['type="text/css"', _StyleSheet.SC_ATTR + '="' + this.names.join(' ') + '"', _StyleSheet.LOCAL_ATTR + '="' + (this.isLocal ? 'true' : 'false') + '"'];
|
|
72
|
+
|
|
73
|
+
var nonce = (0, _nonce2.default)();
|
|
58
74
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return _this.components[key].css;
|
|
63
|
-
}).join('');
|
|
75
|
+
if (nonce) {
|
|
76
|
+
attrs.push('nonce="' + nonce + '"');
|
|
77
|
+
}
|
|
64
78
|
|
|
65
|
-
return '<style
|
|
79
|
+
return '<style ' + attrs.join(' ') + '>' + this.concatenateCSS() + '</style>';
|
|
66
80
|
};
|
|
67
81
|
|
|
68
82
|
ServerTag.prototype.toReactElement = function toReactElement(key) {
|
|
69
|
-
var
|
|
70
|
-
_this2 = this;
|
|
83
|
+
var _attrs;
|
|
71
84
|
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
var attrs = (_attrs = {}, _attrs[_StyleSheet.SC_ATTR] = this.names.join(' '), _attrs[_StyleSheet.LOCAL_ATTR] = this.isLocal.toString(), _attrs);
|
|
86
|
+
|
|
87
|
+
var nonce = (0, _nonce2.default)();
|
|
88
|
+
|
|
89
|
+
if (nonce) {
|
|
90
|
+
attrs.nonce = nonce;
|
|
91
|
+
}
|
|
76
92
|
|
|
77
93
|
return _react2.default.createElement('style', _extends({
|
|
78
|
-
key: key, type: 'text/css' },
|
|
79
|
-
dangerouslySetInnerHTML: { __html:
|
|
94
|
+
key: key, type: 'text/css' }, attrs, {
|
|
95
|
+
dangerouslySetInnerHTML: { __html: this.concatenateCSS() }
|
|
80
96
|
}));
|
|
81
97
|
};
|
|
82
98
|
|
|
83
99
|
ServerTag.prototype.clone = function clone() {
|
|
84
|
-
var
|
|
100
|
+
var _this2 = this;
|
|
85
101
|
|
|
86
102
|
var copy = new ServerTag(this.isLocal);
|
|
87
103
|
copy.names = [].concat(this.names);
|
|
88
104
|
copy.size = this.size;
|
|
89
105
|
copy.components = Object.keys(this.components).reduce(function (acc, key) {
|
|
90
|
-
acc[key] = _extends({},
|
|
106
|
+
acc[key] = _extends({}, _this2.components[key]); // eslint-disable-line no-param-reassign
|
|
91
107
|
return acc;
|
|
92
108
|
}, {});
|
|
93
109
|
|
package/lib/models/StyleSheet.js
CHANGED
|
@@ -40,12 +40,21 @@ var StyleSheet = function () {
|
|
|
40
40
|
|
|
41
41
|
this.hashes = {};
|
|
42
42
|
this.deferredInjections = {};
|
|
43
|
+
this.stylesCacheable = typeof document !== 'undefined';
|
|
43
44
|
|
|
44
45
|
this.tagConstructor = tagConstructor;
|
|
45
46
|
this.tags = tags;
|
|
46
47
|
this.names = names;
|
|
47
48
|
this.constructComponentTagMap();
|
|
48
49
|
}
|
|
50
|
+
// helper for `ComponentStyle` to know when it cache static styles.
|
|
51
|
+
// staticly styled-component can not safely cache styles on the server
|
|
52
|
+
// without all `ComponentStyle` instances saving a reference to the
|
|
53
|
+
// the styleSheet instance they last rendered with,
|
|
54
|
+
// or listening to creation / reset events. otherwise you might create
|
|
55
|
+
// a component with one stylesheet and render it another api response
|
|
56
|
+
// with another, losing styles on from your server-side render.
|
|
57
|
+
|
|
49
58
|
|
|
50
59
|
StyleSheet.prototype.constructComponentTagMap = function constructComponentTagMap() {
|
|
51
60
|
var _this = this;
|