1 |
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).goober={})}(this,function(e){let t={data:""},r=e=>{if("undefined"!=typeof window){let t=e?e.querySelector("#_goober"):window._goober;return t||(t=(e||document.head).appendChild(document.createElement("style")),t.innerHTML=" ",t.id="_goober"),t.firstChild}return e||t},o=/(?:([A-Z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,n=/\/\*[\s\S]*?\*\/|\s{2,}|\n/gm,l=(e,t)=>{let r,o="",n="",a="";for(let s in e){let c=e[s];"object"==typeof c?(r=t?t.replace(/([^,])+/g,e=>s.replace(/([^,])+/g,t=>/&/g.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):s,n+="@"==s[0]?"f"==s[1]?l(c,s):s+"{"+l(c,"k"==s[1]?"":t)+"}":l(c,r)):"@"==s[0]&&"i"==s[1]?o=s+" "+c+";":a+=l.p?l.p(s.replace(/[A-Z]/g,"-$&").toLowerCase(),c):s.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+c+";"}return a[0]?(r=t?t+"{"+a+"}":a,o+r+n):o+n},a={},s=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?s(e[r]):e[r]);return t},c=(e,t,r,c,i)=>{let f="object"==typeof e?s(e):e,p=a[f]||(a[f]=(e=>{let t=0,r=e.length,o=11;for(;t<r;)o=101*o+e.charCodeAt(t++)>>>0;return"go"+o})(f));if(!a[p]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=o.exec(e.replace(n,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);a[p]=l(i?{["@keyframes "+p]:t}:t,r?"":"."+p)}return((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(a[p],t,c),p},i=(e,t,r)=>e.reduce((e,o,n)=>{let a=t[n];if(a&&a.call){let e=a(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?"."+t:e&&"object"==typeof e?e.props?"":l(e,""):e}return e+o+(null==a?"":a)},"");function f(e){let t=this||{},o=e.call?e(t.p):e;return c(o.unshift?o.raw?i(o,[].slice.call(arguments,1),t.p):o.reduce((e,r)=>r?Object.assign(e,r.call?r(t.p):r):e,{}):o,r(t.target),t.g,t.o,t.k)}let p,d,u,g=f.bind({g:1}),b=f.bind({k:1});e.css=f,e.extractCss=e=>{let t=r(e),o=t.data;return t.data="",o},e.glob=g,e.keyframes=b,e.setup=function(e,t,r,o){l.p=t,p=e,d=r,u=o},e.styled=function(e,t){let r=this||{};return function(){let o=arguments;function n(l,a){let s=Object.assign({},l),c=s.className||n.className;r.p=Object.assign({theme:d&&d()},s),r.o=/ *go\d+/g.test(c),s.className=f.apply(r,o)+(c?" "+c:""),t&&(s.ref=a);let i=s.as||e;return u&&i[0]&&u(s),p(i,s)}return t?t(n):n}}});
|