pretty-lights
Advanced tools
Comparing version 1.0.0 to 1.0.1-alpha.1
@@ -1,2 +0,2 @@ | ||
var e=require("@emotion/stylis"),t=require("@emotion/weak-memoize"),r=require("@emotion/hash"),n=require("@emotion/unitless"),o=require("@emotion/memoize"),i=require("react"),s=require("@emotion/is-prop-valid"),a=require("hoist-non-react-statics");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var u=c(e),p=c(t),d=c(r),f=c(n),h=c(o),m=c(i),v=l(i),y=c(s),g=c(a),b=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),_={current:null};function E(e){e&&_.current.insert(e+"}")}var N,w=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return _.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return _.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(E)}},x=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},O="undefined"!=typeof document,k=/\/\*\|\*\//g,C={},S=O?void 0:p.default(function(){var e=p.default(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}}),P="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j=/[A-Z]|^ms/g,A=/_EMO_([^_]+?)_([^]*?)_EMO_/g,D=function(e){return 45===e.charCodeAt(1)},T=function(e){return null!=e&&"boolean"!=typeof e},V=h.default(function(e){return D(e)?e:e.replace(j,"-$&").toLowerCase()}),q=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(A,function(e,t,r){return N={name:t,styles:r,next:N},t})}return 1===f.default[e]||D(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var R=/(attr|calc|counters?|url)\(/,z=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],I=q,G=/^-ms-/,L=/-(.)/g,M={};q=function(e,t){"content"===e&&("string"!=typeof t||-1===z.indexOf(t)&&!R.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=I(e,t);return""===r||D(e)||-1===e.indexOf("-")||void 0!==M[e]||(M[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(G,"ms-").replace(L,function(e,t){return t.toUpperCase()})+"?")),r}}function Y(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return N={name:r.name,styles:r.styles,next:N},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)N={name:i.name,styles:i.styles,next:N},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=Y(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":T(s)&&(n+=V(i)+":"+q(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=Y(e,t,s,!1);switch(i){case"animation":case"animationName":n+=V(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)T(s[c])&&(n+=V(i)+":"+q(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=N,c=r(e);return N=a,Y(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(A,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var U,F=/label:\s*([^\s;\n{]+)\s*;/g;function $(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";N=void 0;var i,s=e[0];null==s||void 0===s.raw?(n=!1,o+=Y(r,t,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(P),o+=s[0]);for(var a=1;a<e.length;a+=1)o+=Y(r,t,e[a],46===o.charCodeAt(o.length-1)),n&&("production"!==process.env.NODE_ENV&&void 0===s[a]&&console.error(P),o+=s[a]);"production"!==process.env.NODE_ENV&&(o=o.replace(U,function(e){return i=e,""})),F.lastIndex=0;for(var c,l="";null!==(c=F.exec(o));)l+="-"+c[1];return{name:d.default(o)+l,styles:o,map:i,next:N}}"production"!==process.env.NODE_ENV&&(U=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var H="undefined"!=typeof document;function W(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var B=function(e,t){var r=e.key+"-"+t.name;if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);H||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!H&&0!==n.length)return n}};function J(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function Z(e,t,r){var n=[],o=W(e,n,r);return n.length<2?r:o+t(n)}var K=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function Q(){return(Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ee=m.default.createContext({}),te="undefined"!=typeof document,re=y.default,ne=function(e){return"theme"!==e&&"innerRef"!==e},oe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?re:ne},ie=p.default(function(e){return p.default(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return Q({},e,t)}(e,t)})}),se=function(e){return v.createElement(ee.Consumer,null,function(t){return e.theme!==t&&(t=ie(t)(e.theme)),v.createElement(ee.Provider,{value:t},e.children)})};function ae(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function ce(e,t){return function(r){return ae(e,r,t)}}se.displayName="ThemeProvider",ce.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ae(e,n,o)}};var le=function(e,t){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;var r=function(e){void 0===e&&(e={});var t,r,n=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+n+'" was passed');void 0!==e.prefix&&(r={prefix:e.prefix});var o,i,s=new u.default(r),a={};if(O){o=e.container||document.head;var c="data-lights-"+n,l=document.querySelectorAll("style["+c+"]");Array.prototype.forEach.call(l,function(e){(e.getAttribute(c)||"").split(" ").forEach(function(e){a[e]=!0}),e.parentNode!==o&&o.appendChild(e)})}if(O)s.use(e.stylisPlugins)(w),i=function(e,r,n,o,i){if(_.current=n,"production"!==process.env.NODE_ENV&&void 0!==r.map){var a=r.map;_.current={insert:function(e){n.insert(e+a)}}}if(void 0===t.inserted[r.name]){var c=s(e,r.styles);o&&(t.inserted[r.name]=c.replace(k,""),""===e&&i&&(t.global[r.name]=!0))}};else{s.use(x);var p=C;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),p=S(e.stylisPlugins||C)(e.prefix)),i=function(e,r,n,o,i){if(void 0===t.inserted[r.name]){var a=function(e,t){var r=t.name;return void 0===p[r]&&(p[r]=s(e,t.styles)),p[r]}(e,r);if(!o)return a;t.inserted[r.name]=a,""===e&&i&&(t.global[r.name]=!0)}}}if("production"!==process.env.NODE_ENV){var d=/\/\*/g,f=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;d.test(t);){if(f.lastIndex=d.lastIndex,!f.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');d.lastIndex=f.lastIndex}d.lastIndex=0}})}return t={key:n,sheet:new b({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:a,registered:{},global:{},insert:i}}(void 0);r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var n=function(){var e=$([].slice.call(arguments),r.registered),t=r.key+"-"+e.name;return B(r,e),t},o={css:n,cx:function(){return Z(r.registered,n,K([].slice.call(arguments)))},injectGlobal:function(){var e=$([].slice.call(arguments),r.registered);J(r,e,!0)},keyframes:function(){var e=$([].slice.call(arguments),r.registered),t="animation-"+e.name;return J(r,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.global={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:W,merge:Z.bind(null,r.registered,n)};return e.__SECRET_LIGHTS__=o,o}("undefined"!=typeof global?global:{}),ue=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,X(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new b({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&B(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!te){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var i=((e={})["data-global-"+this.props.cache.key]=r,e);return v.createElement("style",i)}return null},n}(v.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return v.createElement(ee.Consumer,null,function(r){var o=$([n(r)],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})});var o=$([n],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})}}(le),pe=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,s;void 0!==n&&(o=n.label,s=n.target,i=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=r.__lights_real===r,c=a&&r.__lights_base||r;"function"!=typeof i&&a&&(i=r.__lights_forwardProp);var l=i||oe(c),u=!l("as");return function(){var p=[].slice.call(arguments),d=a&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==p[0]||void 0===p[0].raw)d.push.apply(d,p);else{"production"!==process.env.NODE_ENV&&void 0===p[0][0]&&console.error(P),d.push(p[0][0]);for(var f=p.length,h=1;h<f;h+=1)"production"!==process.env.NODE_ENV&&void 0===p[0][h]&&console.error(P),d.push(p[h],p[0][h])}var m=function(t){return v.createElement(ee.Consumer,null,function(r){var n=u&&t.as||c,o="",a=[],p=t;if(null==t.theme){for(var f in p={},t)p[f]=t[f];p.theme=r}"string"==typeof t.className?o=W(e.cache.registered,a,t.className):null!=t.className&&(o=t.className+" ");var h=$(d.concat(a),e.cache.registered,p);B(e.cache,h),o+=e.cache.key+"-"+h.name,void 0!==s&&(o+=" "+s);var m=u&&void 0===i?oe(n):l,y={};for(var g in t)u&&"as"===g||m(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,v.createElement(n,y)})};return m.displayName=void 0!==o?o:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",void 0!==r.defaultProps&&(m.defaultProps=r.defaultProps),m.__lights_styles=d,m.__lights_base=c,m.__lights_real=m,m.__lights_forwardProp=i,Object.defineProperty(m,"toString",{value:function(){return void 0===s&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+s}}),m.withComponent=function(e,r){return t(e,void 0!==r?Q({},n||{},r):n).apply(void 0,d)},m}}}(le).bind();["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","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){pe[e]=pe(e)});var de=le.flush,fe=le.hydrate,he=le.cx,me=le.merge,ve=le.getRegisteredStyles,ye=le.injectGlobal,ge=le.keyframes,be=le.css,_e=le.sheet,Ee=le.cache;exports.Global=ue,exports.ThemeContext=ee,exports.ThemeProvider=se,exports.cache=Ee,exports.css=be,exports.cx=he,exports.flush=de,exports.getRegisteredStyles=ve,exports.hydrate=fe,exports.injectGlobal=ye,exports.keyframes=ge,exports.merge=me,exports.sheet=_e,exports.styled=pe,exports.themeFn=ce,exports.useTheme=function(){return m.default.useContext(ee)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=v.forwardRef(function(t,r){return v.createElement(ee.Consumer,null,function(n){return v.createElement(e,Q({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",g.default(r,e)}; | ||
var e=require("@emotion/stylis"),t=require("@emotion/weak-memoize"),r=require("@emotion/hash"),n=require("@emotion/unitless"),o=require("@emotion/memoize"),i=require("react"),s=require("@emotion/is-prop-valid"),a=require("hoist-non-react-statics");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var u=c(e),p=c(t),d=c(r),f=c(n),h=c(o),m=c(i),v=l(i),y=c(s),g=c(a),b=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);if(0===this.tags.length){if(!this.before){var n=document.querySelector("[name=pretty-lights-insertion-point]");n&&(this.before=n)}t=this.before}else t=this.tags[this.tags.length-1].nextSibling;this.container.insertBefore(r,t),this.tags.push(r)}var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(o);try{var s=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,s?0:i.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else o.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),_={current:null};function E(e){e&&_.current.insert(e+"}")}var N,w=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return _.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return _.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(E)}},x=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},O="undefined"!=typeof document,k=/\/\*\|\*\//g,S={},C=O?void 0:p.default(function(){var e=p.default(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}}),P="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",j=/[A-Z]|^ms/g,A=/_EMO_([^_]+?)_([^]*?)_EMO_/g,D=function(e){return 45===e.charCodeAt(1)},T=function(e){return null!=e&&"boolean"!=typeof e},V=h.default(function(e){return D(e)?e:e.replace(j,"-$&").toLowerCase()}),q=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(A,function(e,t,r){return N={name:t,styles:r,next:N},t})}return 1===f.default[e]||D(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var R=/(attr|calc|counters?|url)\(/,z=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],I=q,G=/^-ms-/,L=/-(.)/g,M={};q=function(e,t){"content"===e&&("string"!=typeof t||-1===z.indexOf(t)&&!R.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=I(e,t);return""===r||D(e)||-1===e.indexOf("-")||void 0!==M[e]||(M[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(G,"ms-").replace(L,function(e,t){return t.toUpperCase()})+"?")),r}}function Y(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return N={name:r.name,styles:r.styles,next:N},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)N={name:i.name,styles:i.styles,next:N},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=Y(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":T(s)&&(n+=V(i)+":"+q(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=Y(e,t,s,!1);switch(i){case"animation":case"animationName":n+=V(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)T(s[c])&&(n+=V(i)+":"+q(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=N,c=r(e);return N=a,Y(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(A,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var U,F=/label:\s*([^\s;\n{]+)\s*;/g;function $(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";N=void 0;var i,s=e[0];null==s||void 0===s.raw?(n=!1,o+=Y(r,t,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(P),o+=s[0]);for(var a=1;a<e.length;a+=1)o+=Y(r,t,e[a],46===o.charCodeAt(o.length-1)),n&&("production"!==process.env.NODE_ENV&&void 0===s[a]&&console.error(P),o+=s[a]);"production"!==process.env.NODE_ENV&&(o=o.replace(U,function(e){return i=e,""})),F.lastIndex=0;for(var c,l="";null!==(c=F.exec(o));)l+="-"+c[1];return{name:d.default(o)+l,styles:o,map:i,next:N}}"production"!==process.env.NODE_ENV&&(U=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var H="undefined"!=typeof document;function W(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var B=function(e,t){var r=e.key+"-"+t.name;if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);H||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!H&&0!==n.length)return n}};function J(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function Z(e,t,r){var n=[],o=W(e,n,r);return n.length<2?r:o+t(n)}var K=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function Q(){return(Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ee=m.default.createContext({}),te="undefined"!=typeof document,re=y.default,ne=function(e){return"theme"!==e&&"innerRef"!==e},oe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?re:ne},ie=p.default(function(e){return p.default(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return Q({},e,t)}(e,t)})}),se=function(e){return v.createElement(ee.Consumer,null,function(t){return e.theme!==t&&(t=ie(t)(e.theme)),v.createElement(ee.Provider,{value:t},e.children)})};function ae(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function ce(e,t){return function(r){return ae(e,r,t)}}se.displayName="ThemeProvider",ce.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ae(e,n,o)}};var le=function(e,t){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;var r=function(e){void 0===e&&(e={});var t,r,n=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+n+'" was passed');void 0!==e.prefix&&(r={prefix:e.prefix});var o,i,s=new u.default(r),a={};if(O){o=e.container||document.head;var c="data-lights-"+n,l=document.querySelectorAll("style["+c+"]");Array.prototype.forEach.call(l,function(e){(e.getAttribute(c)||"").split(" ").forEach(function(e){a[e]=!0}),e.parentNode!==o&&o.appendChild(e)})}if(O)s.use(e.stylisPlugins)(w),i=function(e,r,n,o,i){if(_.current=n,"production"!==process.env.NODE_ENV&&void 0!==r.map){var a=r.map;_.current={insert:function(e){n.insert(e+a)}}}if(void 0===t.inserted[r.name]){var c=s(e,r.styles);o&&(t.inserted[r.name]=c.replace(k,""),""===e&&i&&(t.global[r.name]=!0))}};else{s.use(x);var p=S;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),p=C(e.stylisPlugins||S)(e.prefix)),i=function(e,r,n,o,i){if(void 0===t.inserted[r.name]){var a=function(e,t){var r=t.name;return void 0===p[r]&&(p[r]=s(e,t.styles)),p[r]}(e,r);if(!o)return a;t.inserted[r.name]=a,""===e&&i&&(t.global[r.name]=!0)}}}if("production"!==process.env.NODE_ENV){var d=/\/\*/g,f=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;d.test(t);){if(f.lastIndex=d.lastIndex,!f.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');d.lastIndex=f.lastIndex}d.lastIndex=0}})}return t={key:n,sheet:new b({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:a,registered:{},global:{},insert:i}}(void 0);r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var n=function(){var e=$([].slice.call(arguments),r.registered),t=r.key+"-"+e.name;return B(r,e),t},o={css:n,cx:function(){return Z(r.registered,n,K([].slice.call(arguments)))},injectGlobal:function(){var e=$([].slice.call(arguments),r.registered);J(r,e,!0)},keyframes:function(){var e=$([].slice.call(arguments),r.registered),t="animation-"+e.name;return J(r,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.global={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:W,merge:Z.bind(null,r.registered,n)};return e.__SECRET_LIGHTS__=o,o}("undefined"!=typeof global?global:{}),ue=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,X(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new b({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&B(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!te){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var i=((e={})["data-global-"+this.props.cache.key]=r,e);return v.createElement("style",i)}return null},n}(v.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return v.createElement(ee.Consumer,null,function(r){var o=$([n(r)],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})});var o=$([n],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})}}(le),pe=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,s;void 0!==n&&(o=n.label,s=n.target,i=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=r.__lights_real===r,c=a&&r.__lights_base||r;"function"!=typeof i&&a&&(i=r.__lights_forwardProp);var l=i||oe(c),u=!l("as");return function(){var p=[].slice.call(arguments),d=a&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==p[0]||void 0===p[0].raw)d.push.apply(d,p);else{"production"!==process.env.NODE_ENV&&void 0===p[0][0]&&console.error(P),d.push(p[0][0]);for(var f=p.length,h=1;h<f;h+=1)"production"!==process.env.NODE_ENV&&void 0===p[0][h]&&console.error(P),d.push(p[h],p[0][h])}var m=function(t){return v.createElement(ee.Consumer,null,function(r){var n=u&&t.as||c,o="",a=[],p=t;if(null==t.theme){for(var f in p={},t)p[f]=t[f];p.theme=r}"string"==typeof t.className?o=W(e.cache.registered,a,t.className):null!=t.className&&(o=t.className+" ");var h=$(d.concat(a),e.cache.registered,p);B(e.cache,h),o+=e.cache.key+"-"+h.name,void 0!==s&&(o+=" "+s);var m=u&&void 0===i?oe(n):l,y={};for(var g in t)u&&"as"===g||m(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,v.createElement(n,y)})};return m.displayName=void 0!==o?o:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",void 0!==r.defaultProps&&(m.defaultProps=r.defaultProps),m.__lights_styles=d,m.__lights_base=c,m.__lights_real=m,m.__lights_forwardProp=i,Object.defineProperty(m,"toString",{value:function(){return void 0===s&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+s}}),m.withComponent=function(e,r){return t(e,void 0!==r?Q({},n||{},r):n).apply(void 0,d)},m}}}(le).bind();["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","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){pe[e]=pe(e)});var de=le.flush,fe=le.hydrate,he=le.cx,me=le.merge,ve=le.getRegisteredStyles,ye=le.injectGlobal,ge=le.keyframes,be=le.css,_e=le.sheet,Ee=le.cache;exports.Global=ue,exports.ThemeContext=ee,exports.ThemeProvider=se,exports.cache=Ee,exports.css=be,exports.cx=he,exports.flush=de,exports.getRegisteredStyles=ve,exports.hydrate=fe,exports.injectGlobal=ye,exports.keyframes=ge,exports.merge=me,exports.sheet=_e,exports.styled=pe,exports.themeFn=ce,exports.useTheme=function(){return m.default.useContext(ee)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=v.forwardRef(function(t,r){return v.createElement(ee.Consumer,null,function(n){return v.createElement(e,Q({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",g.default(r,e)}; | ||
//# sourceMappingURL=pretty-lights.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"@emotion/stylis";import t from"@emotion/weak-memoize";import r from"@emotion/hash";import n from"@emotion/unitless";import o from"@emotion/memoize";import*as i from"react";import s from"react";import a from"@emotion/is-prop-valid";import c from"hoist-non-react-statics";var l=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),u={current:null};function p(e){e&&u.current.insert(e+"}")}var d,h=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return u.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return u.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(p)}},f=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},m="undefined"!=typeof document,v=/\/\*\|\*\//g,y={},g=m?void 0:t(function(){var e=t(function(){return{}}),r={},n={};return function(t){return void 0===t||!0===t?r:!1===t?n:e(t)}}),b="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",_=/[A-Z]|^ms/g,E=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!=typeof e},O=o(function(e){return N(e)?e:e.replace(_,"-$&").toLowerCase()}),k=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(E,function(e,t,r){return d={name:t,styles:r,next:d},t})}return 1===n[e]||N(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var x=/(attr|calc|counters?|url)\(/,C=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],S=k,A=/^-ms-/,P=/-(.)/g,D={};k=function(e,t){"content"===e&&("string"!=typeof t||-1===C.indexOf(t)&&!x.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=S(e,t);return""===r||N(e)||-1===e.indexOf("-")||void 0!==D[e]||(D[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(A,"ms-").replace(P,function(e,t){return t.toUpperCase()})+"?")),r}}function j(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return d={name:r.name,styles:r.styles,next:d},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)d={name:i.name,styles:i.styles,next:d},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=j(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":w(s)&&(n+=O(i)+":"+k(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=j(e,t,s,!1);switch(i){case"animation":case"animationName":n+=O(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)w(s[c])&&(n+=O(i)+":"+k(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=d,c=r(e);return d=a,j(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(E,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var V,T=/label:\s*([^\s;\n{]+)\s*;/g;function R(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,i="";d=void 0;var s,a=e[0];null==a||void 0===a.raw?(o=!1,i+=j(n,t,a,!1)):("production"!==process.env.NODE_ENV&&void 0===a[0]&&console.error(b),i+=a[0]);for(var c=1;c<e.length;c+=1)i+=j(n,t,e[c],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===a[c]&&console.error(b),i+=a[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(V,function(e){return s=e,""})),T.lastIndex=0;for(var l,u="";null!==(l=T.exec(i));)u+="-"+l[1];return{name:r(i)+u,styles:i,map:s,next:d}}"production"!==process.env.NODE_ENV&&(V=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var z="undefined"!=typeof document;function I(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var q=function(e,t){var r=e.key+"-"+t.name;if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);z||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!z&&0!==n.length)return n}};function L(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function G(e,t,r){var n=[],o=I(e,n,r);return n.length<2?r:o+t(n)}var Y=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var F=s.createContext({}),$="undefined"!=typeof document,H=a,W=function(e){return"theme"!==e&&"innerRef"!==e},B=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:W},J=t(function(e){return t(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return M({},e,t)}(e,t)})}),Z=function(e){return i.createElement(F.Consumer,null,function(t){return e.theme!==t&&(t=J(t)(e.theme)),i.createElement(F.Provider,{value:t},e.children)})};function K(e){var t=e.displayName||e.name||"Component",r=i.forwardRef(function(t,r){return i.createElement(F.Consumer,null,function(n){return i.createElement(e,M({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",c(r,e)}function Q(){return s.useContext(F)}function X(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function ee(e,t){return function(r){return X(e,r,t)}}Z.displayName="ThemeProvider",ee.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&X(e,n,o)}};var te=function(t,r){if(void 0!==t.__SECRET_LIGHTS__)return t.__SECRET_LIGHTS__;var n=function(t){void 0===t&&(t={});var r,n,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+o+'" was passed');void 0!==t.prefix&&(n={prefix:t.prefix});var i,s,a=new e(n),c={};if(m){i=t.container||document.head;var p="data-lights-"+o,d=document.querySelectorAll("style["+p+"]");Array.prototype.forEach.call(d,function(e){(e.getAttribute(p)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(m)a.use(t.stylisPlugins)(h),s=function(e,t,n,o,i){if(u.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var s=t.map;u.current={insert:function(e){n.insert(e+s)}}}if(void 0===r.inserted[t.name]){var c=a(e,t.styles);o&&(r.inserted[t.name]=c.replace(v,""),""===e&&i&&(r.global[t.name]=!0))}};else{a.use(f);var b=y;(t.stylisPlugins||void 0!==t.prefix)&&(a.use(t.stylisPlugins),b=g(t.stylisPlugins||y)(t.prefix)),s=function(e,t,n,o,i){if(void 0===r.inserted[t.name]){var s=function(e,t){var r=t.name;return void 0===b[r]&&(b[r]=a(e,t.styles)),b[r]}(e,t);if(!o)return s;r.inserted[t.name]=s,""===e&&i&&(r.global[t.name]=!0)}}}if("production"!==process.env.NODE_ENV){var _=/\/\*/g,E=/\*\//g;a.use(function(e,t){switch(e){default:break;case-1:for(;_.test(t);){if(E.lastIndex=_.lastIndex,!E.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');_.lastIndex=E.lastIndex}_.lastIndex=0}})}return r={key:o,sheet:new l({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},global:{},insert:s}}(void 0);n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var o=function(){var e=R([].slice.call(arguments),n.registered),t=n.key+"-"+e.name;return q(n,e),t},i={css:o,cx:function(){return G(n.registered,o,Y([].slice.call(arguments)))},injectGlobal:function(){var e=R([].slice.call(arguments),n.registered);L(n,e,!0)},keyframes:function(){var e=R([].slice.call(arguments),n.registered),t="animation-"+e.name;return L(n,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.global={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:I,merge:G.bind(null,n.registered,o)};return t.__SECRET_LIGHTS__=i,i}("undefined"!=typeof global?global:{}),re=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,U(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new l({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&q(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!$){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var s=((e={})["data-global-"+this.props.cache.key]=r,e);return i.createElement("style",s)}return null},n}(i.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return i.createElement(F.Consumer,null,function(r){var o=R([n(r)],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})});var o=R([n],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})}}(te),ne=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,s,a;void 0!==n&&(o=n.label,a=n.target,s=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var c=r.__lights_real===r,l=c&&r.__lights_base||r;"function"!=typeof s&&c&&(s=r.__lights_forwardProp);var u=s||B(l),p=!u("as");return function(){var d=[].slice.call(arguments),h=c&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)h.push.apply(h,d);else{"production"!==process.env.NODE_ENV&&void 0===d[0][0]&&console.error(b),h.push(d[0][0]);for(var f=d.length,m=1;m<f;m+=1)"production"!==process.env.NODE_ENV&&void 0===d[0][m]&&console.error(b),h.push(d[m],d[0][m])}var v=function(t){return i.createElement(F.Consumer,null,function(r){var n=p&&t.as||l,o="",c=[],d=t;if(null==t.theme){for(var f in d={},t)d[f]=t[f];d.theme=r}"string"==typeof t.className?o=I(e.cache.registered,c,t.className):null!=t.className&&(o=t.className+" ");var m=R(h.concat(c),e.cache.registered,d);q(e.cache,m),o+=e.cache.key+"-"+m.name,void 0!==a&&(o+=" "+a);var v=p&&void 0===s?B(n):u,y={};for(var g in t)p&&"as"===g||v(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,i.createElement(n,y)})};return v.displayName=void 0!==o?o:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",void 0!==r.defaultProps&&(v.defaultProps=r.defaultProps),v.__lights_styles=h,v.__lights_base=l,v.__lights_real=v,v.__lights_forwardProp=s,Object.defineProperty(v,"toString",{value:function(){return void 0===a&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+a}}),v.withComponent=function(e,r){return t(e,void 0!==r?M({},n||{},r):n).apply(void 0,h)},v}}}(te).bind();["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","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ne[e]=ne(e)});var oe=te.flush,ie=te.hydrate,se=te.cx,ae=te.merge,ce=te.getRegisteredStyles,le=te.injectGlobal,ue=te.keyframes,pe=te.css,de=te.sheet,he=te.cache;export{re as Global,F as ThemeContext,Z as ThemeProvider,he as cache,pe as css,se as cx,oe as flush,ce as getRegisteredStyles,ie as hydrate,le as injectGlobal,ue as keyframes,ae as merge,de as sheet,ne as styled,ee as themeFn,Q as useTheme,K as withTheme}; | ||
import e from"@emotion/stylis";import t from"@emotion/weak-memoize";import r from"@emotion/hash";import n from"@emotion/unitless";import o from"@emotion/memoize";import*as i from"react";import s from"react";import a from"@emotion/is-prop-valid";import c from"hoist-non-react-statics";var l=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);if(0===this.tags.length){if(!this.before){var n=document.querySelector("[name=pretty-lights-insertion-point]");n&&(this.before=n)}t=this.before}else t=this.tags[this.tags.length-1].nextSibling;this.container.insertBefore(r,t),this.tags.push(r)}var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(o);try{var s=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,s?0:i.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else o.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),u={current:null};function p(e){e&&u.current.insert(e+"}")}var d,h=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return u.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return u.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(p)}},f=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},m="undefined"!=typeof document,v=/\/\*\|\*\//g,y={},g=m?void 0:t(function(){var e=t(function(){return{}}),r={},n={};return function(t){return void 0===t||!0===t?r:!1===t?n:e(t)}}),b="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",_=/[A-Z]|^ms/g,E=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!=typeof e},O=o(function(e){return N(e)?e:e.replace(_,"-$&").toLowerCase()}),k=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(E,function(e,t,r){return d={name:t,styles:r,next:d},t})}return 1===n[e]||N(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var x=/(attr|calc|counters?|url)\(/,S=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],C=k,A=/^-ms-/,P=/-(.)/g,D={};k=function(e,t){"content"===e&&("string"!=typeof t||-1===S.indexOf(t)&&!x.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=C(e,t);return""===r||N(e)||-1===e.indexOf("-")||void 0!==D[e]||(D[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(A,"ms-").replace(P,function(e,t){return t.toUpperCase()})+"?")),r}}function j(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return d={name:r.name,styles:r.styles,next:d},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)d={name:i.name,styles:i.styles,next:d},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=j(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":w(s)&&(n+=O(i)+":"+k(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=j(e,t,s,!1);switch(i){case"animation":case"animationName":n+=O(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)w(s[c])&&(n+=O(i)+":"+k(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=d,c=r(e);return d=a,j(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(E,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var V,T=/label:\s*([^\s;\n{]+)\s*;/g;function R(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,i="";d=void 0;var s,a=e[0];null==a||void 0===a.raw?(o=!1,i+=j(n,t,a,!1)):("production"!==process.env.NODE_ENV&&void 0===a[0]&&console.error(b),i+=a[0]);for(var c=1;c<e.length;c+=1)i+=j(n,t,e[c],46===i.charCodeAt(i.length-1)),o&&("production"!==process.env.NODE_ENV&&void 0===a[c]&&console.error(b),i+=a[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(V,function(e){return s=e,""})),T.lastIndex=0;for(var l,u="";null!==(l=T.exec(i));)u+="-"+l[1];return{name:r(i)+u,styles:i,map:s,next:d}}"production"!==process.env.NODE_ENV&&(V=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var q="undefined"!=typeof document;function z(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var I=function(e,t){var r=e.key+"-"+t.name;if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);q||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!q&&0!==n.length)return n}};function L(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function G(e,t,r){var n=[],o=z(e,n,r);return n.length<2?r:o+t(n)}var Y=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var F=s.createContext({}),$="undefined"!=typeof document,H=a,W=function(e){return"theme"!==e&&"innerRef"!==e},B=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?H:W},J=t(function(e){return t(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return M({},e,t)}(e,t)})}),Z=function(e){return i.createElement(F.Consumer,null,function(t){return e.theme!==t&&(t=J(t)(e.theme)),i.createElement(F.Provider,{value:t},e.children)})};function K(e){var t=e.displayName||e.name||"Component",r=i.forwardRef(function(t,r){return i.createElement(F.Consumer,null,function(n){return i.createElement(e,M({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",c(r,e)}function Q(){return s.useContext(F)}function X(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function ee(e,t){return function(r){return X(e,r,t)}}Z.displayName="ThemeProvider",ee.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&X(e,n,o)}};var te=function(t,r){if(void 0!==t.__SECRET_LIGHTS__)return t.__SECRET_LIGHTS__;var n=function(t){void 0===t&&(t={});var r,n,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+o+'" was passed');void 0!==t.prefix&&(n={prefix:t.prefix});var i,s,a=new e(n),c={};if(m){i=t.container||document.head;var p="data-lights-"+o,d=document.querySelectorAll("style["+p+"]");Array.prototype.forEach.call(d,function(e){(e.getAttribute(p)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(m)a.use(t.stylisPlugins)(h),s=function(e,t,n,o,i){if(u.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var s=t.map;u.current={insert:function(e){n.insert(e+s)}}}if(void 0===r.inserted[t.name]){var c=a(e,t.styles);o&&(r.inserted[t.name]=c.replace(v,""),""===e&&i&&(r.global[t.name]=!0))}};else{a.use(f);var b=y;(t.stylisPlugins||void 0!==t.prefix)&&(a.use(t.stylisPlugins),b=g(t.stylisPlugins||y)(t.prefix)),s=function(e,t,n,o,i){if(void 0===r.inserted[t.name]){var s=function(e,t){var r=t.name;return void 0===b[r]&&(b[r]=a(e,t.styles)),b[r]}(e,t);if(!o)return s;r.inserted[t.name]=s,""===e&&i&&(r.global[t.name]=!0)}}}if("production"!==process.env.NODE_ENV){var _=/\/\*/g,E=/\*\//g;a.use(function(e,t){switch(e){default:break;case-1:for(;_.test(t);){if(E.lastIndex=_.lastIndex,!E.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');_.lastIndex=E.lastIndex}_.lastIndex=0}})}return r={key:o,sheet:new l({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},global:{},insert:s}}(void 0);n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var o=function(){var e=R([].slice.call(arguments),n.registered),t=n.key+"-"+e.name;return I(n,e),t},i={css:o,cx:function(){return G(n.registered,o,Y([].slice.call(arguments)))},injectGlobal:function(){var e=R([].slice.call(arguments),n.registered);L(n,e,!0)},keyframes:function(){var e=R([].slice.call(arguments),n.registered),t="animation-"+e.name;return L(n,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.global={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:z,merge:G.bind(null,n.registered,o)};return t.__SECRET_LIGHTS__=i,i}("undefined"!=typeof global?global:{}),re=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,U(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new l({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&I(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!$){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var s=((e={})["data-global-"+this.props.cache.key]=r,e);return i.createElement("style",s)}return null},n}(i.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return i.createElement(F.Consumer,null,function(r){var o=R([n(r)],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})});var o=R([n],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})}}(te),ne=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,s,a;void 0!==n&&(o=n.label,a=n.target,s=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var c=r.__lights_real===r,l=c&&r.__lights_base||r;"function"!=typeof s&&c&&(s=r.__lights_forwardProp);var u=s||B(l),p=!u("as");return function(){var d=[].slice.call(arguments),h=c&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)h.push.apply(h,d);else{"production"!==process.env.NODE_ENV&&void 0===d[0][0]&&console.error(b),h.push(d[0][0]);for(var f=d.length,m=1;m<f;m+=1)"production"!==process.env.NODE_ENV&&void 0===d[0][m]&&console.error(b),h.push(d[m],d[0][m])}var v=function(t){return i.createElement(F.Consumer,null,function(r){var n=p&&t.as||l,o="",c=[],d=t;if(null==t.theme){for(var f in d={},t)d[f]=t[f];d.theme=r}"string"==typeof t.className?o=z(e.cache.registered,c,t.className):null!=t.className&&(o=t.className+" ");var m=R(h.concat(c),e.cache.registered,d);I(e.cache,m),o+=e.cache.key+"-"+m.name,void 0!==a&&(o+=" "+a);var v=p&&void 0===s?B(n):u,y={};for(var g in t)p&&"as"===g||v(g)&&(y[g]=t[g]);return y.className=o,y.ref=t.innerRef,i.createElement(n,y)})};return v.displayName=void 0!==o?o:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",void 0!==r.defaultProps&&(v.defaultProps=r.defaultProps),v.__lights_styles=h,v.__lights_base=l,v.__lights_real=v,v.__lights_forwardProp=s,Object.defineProperty(v,"toString",{value:function(){return void 0===a&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+a}}),v.withComponent=function(e,r){return t(e,void 0!==r?M({},n||{},r):n).apply(void 0,h)},v}}}(te).bind();["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","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ne[e]=ne(e)});var oe=te.flush,ie=te.hydrate,se=te.cx,ae=te.merge,ce=te.getRegisteredStyles,le=te.injectGlobal,ue=te.keyframes,pe=te.css,de=te.sheet,he=te.cache;export{re as Global,F as ThemeContext,Z as ThemeProvider,he as cache,pe as css,se as cx,oe as flush,ce as getRegisteredStyles,ie as hydrate,le as injectGlobal,ue as keyframes,ae as merge,de as sheet,ne as styled,ee as themeFn,Q as useTheme,K as withTheme}; | ||
//# sourceMappingURL=pretty-lights.modern.js.map |
{ | ||
"name": "pretty-lights", | ||
"version": "1.0.0", | ||
"version": "1.0.1-alpha.1", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -5,0 +5,0 @@ "main": "lib/pretty-lights.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
235400
47
0
3