'use strict'
function _interopDefault(e) {
  return e && 'object' == typeof e && 'default' in e ? e.default : e
}
Object.defineProperty(exports, '__esModule', { value: !0 })
var hyphenate = _interopDefault(require('fbjs/lib/hyphenateStyleName')),
  React = require('react'),
  React__default = _interopDefault(React),
  reactNative = require('react-native'),
  Stylis = _interopDefault(require('stylis')),
  _insertRulePlugin = _interopDefault(require('stylis-rule-sheet')),
  PropTypes = _interopDefault(require('prop-types')),
  hoist = _interopDefault(require('hoist-non-react-statics')),
  reactIs = require('react-is'),
  _typeof =
    '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
        },
  classCallCheck = function(e, t) {
    if (!(e instanceof t))
      throw new TypeError('Cannot call a class as a function')
  },
  createClass = (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
    }
  })(),
  _extends =
    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
    },
  inherits = 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))
  },
  objectWithoutProperties = 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
  },
  possibleConstructorReturn = 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
  },
  isPlainObject = function(e) {
    return (
      'object' === (void 0 === e ? 'undefined' : _typeof(e)) &&
      e.constructor === Object
    )
  },
  StyledComponentsError = (function(e) {
    function t(n) {
      classCallCheck(this, t)
      for (
        var r = arguments.length, o = Array(r > 1 ? r - 1 : 0), i = 1;
        i < r;
        i++
      )
        o[i - 1] = arguments[i]
      var s = possibleConstructorReturn(
        this,
        e.call(
          this,
          'An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#' +
            n +
            ' for more information. ' +
            (o ? 'Additional arguments: ' + o.join(', ') : '')
        )
      )
      return possibleConstructorReturn(s)
    }
    return inherits(t, e), t
  })(Error),
  windowWidth = reactNative.Dimensions.get('window').width,
  objToCss = function e(t, n) {
    var r = Object.keys(t).sort(),
      o = !r.some(function(e) {
        return /\D/g.test(e)
      }),
      i = Object.keys(t)
        .filter(function(e) {
          var n = t[e]
          return null != n && !1 !== n && '' !== n
        })
        .map(function(n) {
          if (o) {
            var i =
              r.find(function(e) {
                return e >= windowWidth
              }) || r[r.length - 1]
            return '' + t[i]
          }
          return isPlainObject(t[n])
            ? e(t[n], n)
            : hyphenate(n) + ': ' + t[n] + ';'
        })
    return o ? i[0] : n ? n + ' {\n  ' + i.join(' ') + '\n}' : i.join(' ')
  },
  flatten = function e(t, n) {
    return t.reduce(function(t, r) {
      if (null == r || !1 === r || '' === r) return t
      if (Array.isArray(r)) return t.push.apply(t, e(r, n)), t
      if (r.hasOwnProperty('styledComponentId'))
        return t.push('.' + r.styledComponentId), t
      if ('function' == typeof r) {
        if (n) {
          var o = r(n)
          if (React__default.isValidElement(o)) {
            var i = r.displayName || r.name
            throw new StyledComponentsError(11, i)
          }
          t.push.apply(t, e([o], n))
        } else t.push(r)
        return t
      }
      return t.push(isPlainObject(r) ? objToCss(r) : r.toString()), t
    }, [])
  },
  COMMENT_REGEX = /^\s*\/\/.*$/gm,
  stylisSplitter = new Stylis({
    global: !1,
    cascade: !0,
    keyframe: !1,
    prefix: !1,
    compress: !1,
    semicolon: !0,
  }),
  stylis = new Stylis({
    global: !1,
    cascade: !0,
    keyframe: !1,
    prefix: !0,
    compress: !1,
    semicolon: !1,
  }),
  parsingRules = [],
  returnRulesPlugin = function(e) {
    if (-2 === e) {
      var t = parsingRules
      return (parsingRules = []), t
    }
  },
  parseRulesPlugin = _insertRulePlugin(function(e) {
    parsingRules.push(e)
  })
stylis.use([parseRulesPlugin, returnRulesPlugin]),
  stylisSplitter.use([parseRulesPlugin, returnRulesPlugin])
var stringifyRules = function(e, t, n) {
    var r = e.join('').replace(COMMENT_REGEX, '')
    return stylis(n || !t ? '' : t, t && n ? n + ' ' + t + ' { ' + r + ' }' : r)
  },
  splitByRules = function(e) {
    return stylisSplitter('', e)
  }
function isStyledComponent(e) {
  return 'function' == typeof e && 'string' == typeof e.styledComponentId
}
function consolidateStreamedStyles() {}
var charsLength = 52,
  getAlphabeticChar = function(e) {
    return String.fromCharCode(e + (e > 25 ? 39 : 97))
  },
  generateAlphabeticName = function(e) {
    var t = '',
      n = void 0
    for (n = e; n > charsLength; n = Math.floor(n / charsLength))
      t = getAlphabeticChar(n % charsLength) + t
    return getAlphabeticChar(n % charsLength) + t
  },
  interleave = function(e, t) {
    for (var n = [e[0]], r = 0, o = t.length; r < o; r += 1)
      n.push(t[r], e[r + 1])
    return n
  },
  EMPTY_ARRAY = Object.freeze([]),
  EMPTY_OBJECT = Object.freeze({}),
  css = 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 'function' == typeof e || isPlainObject(e)
      ? flatten(interleave(EMPTY_ARRAY, [e].concat(n)))
      : flatten(interleave(e, n))
  },
  SC_ATTR =
    ('undefined' != typeof process && process.env.SC_ATTR) ||
    'data-styled-components',
  SC_STREAM_ATTR = 'data-styled-streamed',
  CONTEXT_KEY = '__styled-components-stylesheet__',
  IS_BROWSER = 'undefined' != typeof window && 'HTMLElement' in window,
  SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,
  extractComps = function(e) {
    var t = '' + (e || ''),
      n = []
    return (
      t.replace(SC_COMPONENT_ID, function(e, t, r) {
        return n.push({ componentId: t, matchIndex: r }), e
      }),
      n.map(function(e, r) {
        var o = e.componentId,
          i = e.matchIndex,
          s = n[r + 1]
        return {
          componentId: o,
          cssFromDOM: s ? t.slice(i, s.matchIndex) : t.slice(i),
        }
      })
    )
  },
  getNonce = function() {
    return 'undefined' != typeof __webpack_nonce__ ? __webpack_nonce__ : null
  },
  once = function(e) {
    var t = !1
    return function() {
      t || ((t = !0), e())
    }
  },
  addNameForId = function(e, t, n) {
    n && ((e[t] || (e[t] = Object.create(null)))[n] = !0)
  },
  resetIdNames = function(e, t) {
    e[t] = Object.create(null)
  },
  hasNameForId = function(e) {
    return function(t, n) {
      return void 0 !== e[t] && e[t][n]
    }
  },
  stringifyNames = function(e) {
    var t = ''
    for (var n in e) t += Object.keys(e[n]).join(' ') + ' '
    return t.trim()
  },
  cloneNames = function(e) {
    var t = Object.create(null)
    for (var n in e) t[n] = _extends({}, e[n])
    return t
  },
  sheetForTag = function(e) {
    if (e.sheet) return e.sheet
    for (var t = document.styleSheets.length, n = 0; n < t; n += 1) {
      var r = document.styleSheets[n]
      if (r.ownerNode === e) return r
    }
    throw new StyledComponentsError(10)
  },
  safeInsertRule = function(e, t, n) {
    if (!t) return !1
    var r = e.cssRules.length
    try {
      e.insertRule(t, n <= r ? n : r)
    } catch (e) {
      return !1
    }
    return !0
  },
  deleteRules = function(e, t, n) {
    for (var r = t - n, o = t; o > r; o -= 1) e.deleteRule(o)
  },
  makeTextMarker = function(e) {
    return '\n/* sc-component-id: ' + e + ' */\n'
  },
  addUpUntilIndex = function(e, t) {
    for (var n = 0, r = 0; r <= t; r += 1) n += e[r]
    return n
  },
  makeStyleTag = function(e, t, n) {
    var r = document.createElement('style')
    r.setAttribute(SC_ATTR, '')
    var o = getNonce()
    if (
      (o && r.setAttribute('nonce', o),
      r.appendChild(document.createTextNode('')),
      e && !t)
    )
      e.appendChild(r)
    else {
      if (!t || !e || !t.parentNode) throw new StyledComponentsError(6)
      t.parentNode.insertBefore(r, n ? t : t.nextSibling)
    }
    return r
  },
  wrapAsHtmlTag = function(e, t) {
    return function(n) {
      var r = getNonce()
      return (
        '<style ' +
        [r && 'nonce="' + r + '"', SC_ATTR + '="' + stringifyNames(t) + '"', n]
          .filter(Boolean)
          .join(' ') +
        '>' +
        e() +
        '</style>'
      )
    }
  },
  wrapAsElement = function(e, t) {
    return function() {
      var n,
        r = (((n = {})[SC_ATTR] = stringifyNames(t)), n),
        o = getNonce()
      return (
        o && (r.nonce = o),
        React__default.createElement(
          'style',
          _extends({}, r, { dangerouslySetInnerHTML: { __html: e() } })
        )
      )
    }
  },
  getIdsFromMarkersFactory = function(e) {
    return function() {
      return Object.keys(e)
    }
  },
  makeSpeedyTag = function(e, t) {
    var n = Object.create(null),
      r = Object.create(null),
      o = [],
      i = void 0 !== t,
      s = !1,
      a = function(e) {
        var t = r[e]
        return void 0 !== t
          ? t
          : ((r[e] = o.length), o.push(0), resetIdNames(n, e), r[e])
      },
      u = function() {
        var t = sheetForTag(e).cssRules,
          n = ''
        for (var i in r) {
          n += makeTextMarker(i)
          for (
            var s = r[i], a = addUpUntilIndex(o, s), u = a - o[s];
            u < a;
            u += 1
          ) {
            var c = t[u]
            void 0 !== c && (n += c.cssText)
          }
        }
        return n
      }
    return {
      clone: function() {
        throw new StyledComponentsError(5)
      },
      css: u,
      getIds: getIdsFromMarkersFactory(r),
      hasNameForId: hasNameForId(n),
      insertMarker: a,
      insertRules: function(r, u, c) {
        for (
          var l = a(r),
            p = sheetForTag(e),
            h = addUpUntilIndex(o, l),
            d = 0,
            f = [],
            m = u.length,
            y = 0;
          y < m;
          y += 1
        ) {
          var g = u[y],
            v = i
          v && -1 !== g.indexOf('@import')
            ? f.push(g)
            : safeInsertRule(p, g, h + d) && ((v = !1), (d += 1))
        }
        i && f.length > 0 && ((s = !0), t().insertRules(r + '-import', f)),
          (o[l] += d),
          addNameForId(n, r, c)
      },
      removeRules: function(a) {
        var u = r[a]
        if (void 0 !== u) {
          var c = o[u],
            l = sheetForTag(e),
            p = addUpUntilIndex(o, u)
          deleteRules(l, p, c),
            (o[u] = 0),
            resetIdNames(n, a),
            i && s && t().removeRules(a + '-import')
        }
      },
      sealed: !1,
      styleTag: e,
      toElement: wrapAsElement(u, n),
      toHTML: wrapAsHtmlTag(u, n),
    }
  },
  makeServerTagInternal = function e(t, n) {
    var r = void 0 === t ? Object.create(null) : t,
      o = void 0 === n ? Object.create(null) : n,
      i = function(e) {
        var t = o[e]
        return void 0 !== t ? t : (o[e] = [''])
      },
      s = function() {
        var e = ''
        for (var t in o) {
          var n = o[t][0]
          n && (e += makeTextMarker(t) + n)
        }
        return e
      }
    return {
      clone: function() {
        var t = cloneNames(r),
          n = Object.create(null)
        for (var i in o) n[i] = [o[i][0]]
        return e(t, n)
      },
      css: s,
      getIds: getIdsFromMarkersFactory(o),
      hasNameForId: hasNameForId(r),
      insertMarker: i,
      insertRules: function(e, t, n) {
        ;(i(e)[0] += t.join(' ')), addNameForId(r, e, n)
      },
      removeRules: function(e) {
        var t = o[e]
        void 0 !== t && ((t[0] = ''), resetIdNames(r, e))
      },
      sealed: !1,
      styleTag: null,
      toElement: wrapAsElement(s, r),
      toHTML: wrapAsHtmlTag(s, r),
    }
  },
  makeServerTag = function() {
    return makeServerTagInternal()
  },
  makeTag = function(e, t, n, r, o) {
    if (IS_BROWSER && !n) {
      var i = makeStyleTag(e, t, r)
      return makeSpeedyTag(i, o)
    }
    return makeServerTag()
  },
  makeRehydrationTag = function(e, t, n, r) {
    var o = once(function() {
      for (var r = 0, o = n.length; r < o; r += 1) {
        var i = n[r],
          s = i.componentId,
          a = i.cssFromDOM,
          u = splitByRules(a)
        e.insertRules(s, u)
      }
      for (var c = 0, l = t.length; c < l; c += 1) {
        var p = t[c]
        p.parentNode && p.parentNode.removeChild(p)
      }
    })
    return (
      r && o(),
      _extends({}, e, {
        insertMarker: function(t) {
          return o(), e.insertMarker(t)
        },
        insertRules: function(t, n, r) {
          return o(), e.insertRules(t, n, r)
        },
      })
    )
  },
  SPLIT_REGEX = /\s+/,
  MAX_SIZE = void 0
MAX_SIZE = IS_BROWSER ? 1e3 : -1
var _StyleSheetManager$ch,
  sheetRunningId = 0,
  master = void 0,
  StyleSheet = (function() {
    function e() {
      var t = this,
        n =
          arguments.length > 0 && void 0 !== arguments[0]
            ? arguments[0]
            : IS_BROWSER ? document.head : null,
        r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
      classCallCheck(this, e),
        (this.getImportRuleTag = function() {
          var e = t.importRuleTag
          if (void 0 !== e) return e
          var n = t.tags[0]
          return (t.importRuleTag = makeTag(
            t.target,
            n ? n.styleTag : null,
            t.forceServer,
            !0
          ))
        }),
        (sheetRunningId += 1),
        (this.id = sheetRunningId),
        (this.forceServer = r),
        (this.target = r ? null : n),
        (this.tagMap = {}),
        (this.deferred = {}),
        (this.rehydratedNames = {}),
        (this.ignoreRehydratedNames = {}),
        (this.tags = []),
        (this.capacity = 1),
        (this.clones = [])
    }
    return (
      (e.prototype.rehydrate = function() {
        if (!IS_BROWSER || this.forceServer) return this
        var e = [],
          t = [],
          n = !1,
          r = document.querySelectorAll('style[' + SC_ATTR + ']'),
          o = r.length
        if (0 === o) return this
        for (var i = 0; i < o; i += 1) {
          var s = r[i]
          n || (n = !!s.getAttribute(SC_STREAM_ATTR))
          for (
            var a = (s.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX),
              u = a.length,
              c = 0;
            c < u;
            c += 1
          ) {
            var l = a[c]
            this.rehydratedNames[l] = !0
          }
          t.push.apply(t, extractComps(s.textContent)), e.push(s)
        }
        var p = t.length
        if (0 === p) return this
        var h = this.makeTag(null),
          d = makeRehydrationTag(h, e, t, n)
        ;(this.capacity = Math.max(1, MAX_SIZE - p)), this.tags.push(d)
        for (var f = 0; f < p; f += 1) this.tagMap[t[f].componentId] = d
        return this
      }),
      (e.reset = function() {
        var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
        master = new e(void 0, t).rehydrate()
      }),
      (e.prototype.clone = function() {
        var t = new e(this.target, this.forceServer)
        return (
          this.clones.push(t),
          (t.tags = this.tags.map(function(e) {
            for (var n = e.getIds(), r = e.clone(), o = 0; o < n.length; o += 1)
              t.tagMap[n[o]] = r
            return r
          })),
          (t.rehydratedNames = _extends({}, this.rehydratedNames)),
          (t.deferred = _extends({}, this.deferred)),
          t
        )
      }),
      (e.prototype.sealAllTags = function() {
        ;(this.capacity = 1),
          this.tags.forEach(function(e) {
            e.sealed = !0
          })
      }),
      (e.prototype.makeTag = function(e) {
        var t = e ? e.styleTag : null
        return makeTag(
          this.target,
          t,
          this.forceServer,
          !1,
          this.getImportRuleTag
        )
      }),
      (e.prototype.getTagForId = function(e) {
        var t = this.tagMap[e]
        if (void 0 !== t && !t.sealed) return t
        var n = this.tags[this.tags.length - 1]
        return (
          (this.capacity -= 1),
          0 === this.capacity &&
            ((this.capacity = MAX_SIZE),
            (n = this.makeTag(n)),
            this.tags.push(n)),
          (this.tagMap[e] = n)
        )
      }),
      (e.prototype.hasId = function(e) {
        return void 0 !== this.tagMap[e]
      }),
      (e.prototype.hasNameForId = function(e, t) {
        if (void 0 === this.ignoreRehydratedNames[e] && this.rehydratedNames[t])
          return !0
        var n = this.tagMap[e]
        return void 0 !== n && n.hasNameForId(e, t)
      }),
      (e.prototype.deferredInject = function(e, t) {
        if (void 0 === this.tagMap[e]) {
          for (var n = this.clones, r = 0; r < n.length; r += 1)
            n[r].deferredInject(e, t)
          this.getTagForId(e).insertMarker(e), (this.deferred[e] = t)
        }
      }),
      (e.prototype.inject = function(e, t, n) {
        for (var r = this.clones, o = 0; o < r.length; o += 1)
          r[o].inject(e, t, n)
        var i = this.getTagForId(e)
        if (void 0 !== this.deferred[e]) {
          var s = this.deferred[e].concat(t)
          i.insertRules(e, s, n), (this.deferred[e] = void 0)
        } else i.insertRules(e, t, n)
      }),
      (e.prototype.remove = function(e) {
        var t = this.tagMap[e]
        if (void 0 !== t) {
          for (var n = this.clones, r = 0; r < n.length; r += 1) n[r].remove(e)
          t.removeRules(e),
            (this.ignoreRehydratedNames[e] = !0),
            (this.deferred[e] = void 0)
        }
      }),
      (e.prototype.toHTML = function() {
        return this.tags
          .map(function(e) {
            return e.toHTML()
          })
          .join('')
      }),
      (e.prototype.toReactElements = function() {
        var e = this.id
        return this.tags.map(function(t, n) {
          var r = 'sc-' + e + '-' + n
          return React.cloneElement(t.toElement(), { key: r })
        })
      }),
      createClass(e, null, [
        {
          key: 'master',
          get: function() {
            return master || (master = new e().rehydrate())
          },
        },
        {
          key: 'instance',
          get: function() {
            return e.master
          },
        },
      ]),
      e
    )
  })(),
  StyleSheetManager = (function(e) {
    function t() {
      return (
        classCallCheck(this, t),
        possibleConstructorReturn(this, e.apply(this, arguments))
      )
    }
    return (
      inherits(t, e),
      (t.prototype.getChildContext = function() {
        var e
        return ((e = {})[CONTEXT_KEY] = this.sheetInstance), e
      }),
      (t.prototype.componentWillMount = function() {
        if (this.props.sheet) this.sheetInstance = this.props.sheet
        else {
          if (!this.props.target) throw new StyledComponentsError(4)
          this.sheetInstance = new StyleSheet(this.props.target)
        }
      }),
      (t.prototype.render = function() {
        return React__default.Children.only(this.props.children)
      }),
      t
    )
  })(React.Component)
StyleSheetManager.childContextTypes = (((_StyleSheetManager$ch = {})[
  CONTEXT_KEY
] = PropTypes.oneOfType([
  PropTypes.instanceOf(StyleSheet),
  PropTypes.instanceOf(ServerStyleSheet),
]).isRequired),
_StyleSheetManager$ch)
var ServerStyleSheet = (function() {
    function e() {
      classCallCheck(this, e),
        (this.masterSheet = StyleSheet.master),
        (this.instance = this.masterSheet.clone()),
        (this.closed = !1)
    }
    return (
      (e.prototype.complete = function() {
        if (!this.closed) {
          var e = this.masterSheet.clones.indexOf(this.instance)
          this.masterSheet.clones.splice(e, 1), (this.closed = !0)
        }
      }),
      (e.prototype.collectStyles = function(e) {
        if (this.closed) throw new StyledComponentsError(2)
        return React__default.createElement(
          StyleSheetManager,
          { sheet: this.instance },
          e
        )
      }),
      (e.prototype.getStyleTags = function() {
        return this.complete(), this.instance.toHTML()
      }),
      (e.prototype.getStyleElement = function() {
        return this.complete(), this.instance.toReactElements()
      }),
      (e.prototype.interleaveWithNodeStream = function(e) {
        throw new StyledComponentsError(3)
      }),
      e
    )
  })(),
  determineTheme = function(e, t, n) {
    var r = n && e.theme === n.theme
    return e.theme && !r ? e.theme : t
  },
  escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g,
  dashesAtEnds = /(^-|-$)/g
function escape(e) {
  return e.replace(escapeRegex, '-').replace(dashesAtEnds, '')
}
function getComponentName(e) {
  return e.displayName || e.name || 'Component'
}
function isTag(e) {
  return 'string' == typeof e
}
function generateDisplayName(e) {
  return isTag(e) ? 'styled.' + e : 'Styled(' + getComponentName(e) + ')'
}
var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:Animation|Touch|Load|Drag)Start|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|Lo(?:stPointer|ad)|TimeUpdate|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|GotPointer|MouseDown|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|KeyPress|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|P(?:rogress|laying)|DragEnd|Key(?:Down|Up)|(?:MouseU|Dro)p|(?:Wait|Seek)ing|Scroll|Focus|Paste|Abort|Drag|Play|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|onPointerLeav|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|onPointerMov|(?:attribute|glyph)Nam|playsInlin|(?:writing|input|edge)Mod|(?:formE|e)ncTyp|(?:amplitu|mo)d|(?:xlinkTy|itemSco|keyTy|slo)p|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ord)s|o(?:lor(?:Interpolation)?|nt(?:rols|ent))|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|(?:ontrolsLis|apHeigh)t|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|o(?:ntextMenu|ls)|(?:rossOrigi|olSpa)n|l(?:ip(?:Path)?|ass)|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|auto[Ff]ocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|on(?:PointerDow|FocusI)|formActio|zoomAndPa|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveAspectRatio|ointsAt[X-Z]|anose1)|(?:(?:allowPaymentReque|(?:fontSize|length)Adju|manife)s|strokeMiterlimi|(?:(?:specularE|e)xpon|renderingInt|asc)en|(?:specularConsta|repeatCou|fontVaria)n|d(?:iffuseConsta|esce)n|baselineShif|vectorEffec|onPointerOu|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|markerStar|a(?:utoCorrec|bou)|onFocusOu|intercep|restar|forma|inlis|heigh|lis)t|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:gradientT|patternT|t)ransform|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|(?:markerM|onInval)i|preloa|metho|kin)d|k(?:ernel(?:UnitLength|Matrix)|[1-4])|strokeDasharray|(?:onPointerCanc|lab)el|(?:allowFullScre|hidd)en|a(?:l(?:lowUserMedia|phabetic|t)|rabicForm|sync)|systemLanguage|(?:(?:o(?:nPointer(?:Ent|Ov)|rd)|allowReord|placehold|frameBord|paintOrd|post)e|repeatDu|d(?:efe|u))r|(?:pointerEve|keyPoi)nts|preserveAlpha|(?:strokeLineca|onPointerU|itemPro|useMa|wra|loo)p|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|unicodeRange|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|(?:vI|i)deographic|mathematical|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|vAlphabetic|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|(?:xmlnsXl|valueL)ink|mediaGroup|spellCheck|(?:text|m(?:in|ax))Length|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|pathLength|(?:xlinkHr|glyphR)ef|innerHTML|xlinkShow|f(?:o(?:ntSize|rm?)|il(?:ter|l))|(?:tabInde|(?:sand|b)bo|viewBo)x|autoPlay|r(?:e(?:quired|sult|f))?|(?:(?:href|xml|src)La|kerni)ng|o(?:verflow|pen)|i(?:temRef|n2|s)|p(?:attern|oints)|unicode|d(?:efault|ata|ir)?|divisor|t(?:arget[XY]|o)|(?:stri|la)ng|(?:width|size)s|prefix|typeof|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|s(?:t(?:roke|art)|hape|cope|rc)|a(?:ccept|llow|s)|itemID|t(?:arget|ype)|m(?:edia|a(?:sk|x)|in)|value|width|x(?:mlns)?|size|href|k(?:ey)?|end|low|by|x[12]|y[12]|g[12]|i[dn]|f[xy]|[yz])$/,
  ATTRIBUTE_NAME_START_CHAR =
    ':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',
  ATTRIBUTE_NAME_CHAR =
    ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
  isCustomAttribute = RegExp.prototype.test.bind(
    new RegExp('^(x|data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$')
  ),
  validAttr = function(e) {
    return ATTRIBUTE_REGEX.test(e) || isCustomAttribute(e.toLowerCase())
  }
function hasInInheritanceChain(e, t) {
  for (var n = e; n; ) if ((n = Object.getPrototypeOf(n)) && n === t) return !0
  return !1
}
var _contextShape,
  _ThemeProvider$contex,
  _babelHelpers$extends,
  createBroadcast = function(e) {
    var t = {},
      n = 0,
      r = e
    return {
      publish: function(e) {
        for (var n in ((r = e), t)) {
          var o = t[n]
          void 0 !== o && o(r)
        }
      },
      subscribe: function(e) {
        var o = n
        return (t[o] = e), (n += 1), e(r), o
      },
      unsubscribe: function(e) {
        t[e] = void 0
      },
    }
  },
  CHANNEL = '__styled-components__',
  CHANNEL_NEXT = CHANNEL + 'next__',
  CONTEXT_CHANNEL_SHAPE = PropTypes.shape({
    getTheme: PropTypes.func,
    subscribe: PropTypes.func,
    unsubscribe: PropTypes.func,
  }),
  contextShape = (((_contextShape = {})[CHANNEL] = PropTypes.func),
  (_contextShape[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE),
  _contextShape),
  isFunction = function(e) {
    return 'function' == typeof e
  },
  ThemeProvider = (function(e) {
    function t() {
      classCallCheck(this, t)
      var n = possibleConstructorReturn(this, e.call(this))
      return (n.unsubscribeToOuterId = -1), (n.getTheme = n.getTheme.bind(n)), n
    }
    return (
      inherits(t, e),
      (t.prototype.componentWillMount = function() {
        var e = this,
          t = this.context[CHANNEL_NEXT]
        void 0 !== t &&
          (this.unsubscribeToOuterId = t.subscribe(function(t) {
            ;(e.outerTheme = t),
              void 0 !== e.broadcast && e.publish(e.props.theme)
          })),
          (this.broadcast = createBroadcast(this.getTheme()))
      }),
      (t.prototype.getChildContext = function() {
        var e,
          t = this
        return _extends(
          {},
          this.context,
          (((e = {})[CHANNEL_NEXT] = {
            getTheme: this.getTheme,
            subscribe: this.broadcast.subscribe,
            unsubscribe: this.broadcast.unsubscribe,
          }),
          (e[CHANNEL] = function(e) {
            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.publish(e.theme)
      }),
      (t.prototype.componentWillUnmount = function() {
        ;-1 !== this.unsubscribeToOuterId &&
          this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeToOuterId)
      }),
      (t.prototype.getTheme = function(e) {
        var t = e || this.props.theme
        if (isFunction(t)) return t(this.outerTheme)
        if (
          null === t ||
          Array.isArray(t) ||
          'object' !== (void 0 === t ? 'undefined' : _typeof(t))
        )
          throw new StyledComponentsError(8)
        return _extends({}, this.outerTheme, t)
      }),
      (t.prototype.publish = function(e) {
        this.broadcast.publish(this.getTheme(e))
      }),
      (t.prototype.render = function() {
        return this.props.children
          ? React__default.Children.only(this.props.children)
          : null
      }),
      t
    )
  })(React.Component)
;(ThemeProvider.childContextTypes = contextShape),
  (ThemeProvider.contextTypes = (((_ThemeProvider$contex = {})[
    CHANNEL_NEXT
  ] = CONTEXT_CHANNEL_SHAPE),
  _ThemeProvider$contex))
var STATIC_EXECUTION_CONTEXT = {},
  modifiedContextShape = _extends(
    {},
    contextShape,
    (((_babelHelpers$extends = {})[CONTEXT_KEY] = PropTypes.oneOfType([
      PropTypes.instanceOf(StyleSheet),
      PropTypes.instanceOf(ServerStyleSheet),
    ])),
    _babelHelpers$extends)
  ),
  identifiers = {},
  generateId = function(e, t, n) {
    var r = 'string' != typeof t ? 'sc' : escape(t),
      o = (identifiers[r] || 0) + 1
    identifiers[r] = o
    var i = r + '-' + e.generateName(r + o)
    return void 0 !== n ? n + '-' + i : i
  },
  warnExtendDeprecated = function() {},
  BaseStyledComponent = (function(e) {
    function t() {
      var n, r
      classCallCheck(this, t)
      for (var o = arguments.length, i = Array(o), s = 0; s < o; s++)
        i[s] = arguments[s]
      return (
        (n = r = possibleConstructorReturn(
          this,
          e.call.apply(e, [this].concat(i))
        )),
        (r.attrs = {}),
        (r.state = { theme: null, generatedClassName: '' }),
        (r.unsubscribeId = -1),
        possibleConstructorReturn(r, n)
      )
    }
    return (
      inherits(t, e),
      (t.prototype.unsubscribeFromContext = function() {
        ;-1 !== this.unsubscribeId &&
          this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId)
      }),
      (t.prototype.buildExecutionContext = function(e, t) {
        var n = this.constructor.attrs,
          r = _extends({}, 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 ||
                  hasInInheritanceChain(o, React.Component)
                    ? o
                    : o(r)),
                e
              )
            }, {})),
            _extends({}, r, this.attrs))
      }),
      (t.prototype.generateAndInjectStyles = function(e, t) {
        var n = this.constructor,
          r = n.attrs,
          o = n.componentStyle,
          i = (n.warnTooManyClasses,
          this.context[CONTEXT_KEY] || StyleSheet.master)
        if (o.isStatic && void 0 === r)
          return o.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, i)
        var s = this.buildExecutionContext(e, t)
        return o.generateAndInjectStyles(s, i)
      }),
      (t.prototype.componentWillMount = function() {
        var e = this,
          t = this.constructor.componentStyle,
          n = this.context[CHANNEL_NEXT]
        if (t.isStatic) {
          var r = this.generateAndInjectStyles(
            STATIC_EXECUTION_CONTEXT,
            this.props
          )
          this.setState({ generatedClassName: r })
        } else if (void 0 !== n) {
          var o = n.subscribe
          this.unsubscribeId = o(function(t) {
            var n = determineTheme(e.props, t, e.constructor.defaultProps),
              r = e.generateAndInjectStyles(n, e.props)
            e.setState({ theme: n, generatedClassName: r })
          })
        } else {
          var i = this.props.theme || EMPTY_OBJECT,
            s = this.generateAndInjectStyles(i, this.props)
          this.setState({ theme: i, generatedClassName: s })
        }
      }),
      (t.prototype.componentWillReceiveProps = function(e) {
        var t = this
        this.constructor.componentStyle.isStatic ||
          this.setState(function(n) {
            var r = determineTheme(e, n.theme, t.constructor.defaultProps)
            return {
              theme: r,
              generatedClassName: t.generateAndInjectStyles(r, e),
            }
          })
      }),
      (t.prototype.componentWillUnmount = function() {
        this.unsubscribeFromContext()
      }),
      (t.prototype.render = function() {
        var e = this.props.innerRef,
          t = this.state.generatedClassName,
          n = this.constructor,
          r = n.styledComponentId,
          o = n.target,
          i = isTag(o),
          s = [this.props.className, r, this.attrs.className, t]
            .filter(Boolean)
            .join(' '),
          a = _extends({}, this.attrs, { className: s })
        isStyledComponent(o) ? (a.innerRef = e) : (a.ref = e)
        var u = a,
          c = void 0
        for (c in this.props)
          'innerRef' === c ||
            'className' === c ||
            (i && !validAttr(c)) ||
            (u[c] =
              'style' === c && c in this.attrs
                ? _extends({}, this.attrs[c], this.props[c])
                : this.props[c])
        return React.createElement(o, u)
      }),
      t
    )
  })(React.Component),
  _StyledComponent = function(e, t) {
    return function n(r, o, i) {
      var s = o.isClass,
        a = void 0 === s ? !isTag(r) : s,
        u = o.displayName,
        c = void 0 === u ? generateDisplayName(r) : u,
        l = o.componentId,
        p =
          void 0 === l ? generateId(e, o.displayName, o.parentComponentId) : l,
        h = o.ParentComponent,
        d = void 0 === h ? BaseStyledComponent : h,
        f = o.rules,
        m = o.attrs,
        y =
          o.displayName && o.componentId
            ? escape(o.displayName) + '-' + o.componentId
            : o.componentId || p,
        g = new e(void 0 === f ? i : f.concat(i), m, y),
        v = (function(e) {
          function s() {
            return (
              classCallCheck(this, s),
              possibleConstructorReturn(this, e.apply(this, arguments))
            )
          }
          return (
            inherits(s, e),
            (s.withComponent = function(e) {
              var t = o.componentId,
                r = objectWithoutProperties(o, ['componentId']),
                a = t && t + '-' + (isTag(e) ? e : escape(getComponentName(e))),
                u = _extends({}, r, { componentId: a, ParentComponent: s })
              return n(e, u, i)
            }),
            createClass(s, null, [
              {
                key: 'extend',
                get: function() {
                  var e = o.rules,
                    a = o.componentId,
                    u = objectWithoutProperties(o, ['rules', 'componentId']),
                    c = void 0 === e ? i : e.concat(i),
                    l = _extends({}, u, {
                      rules: c,
                      parentComponentId: a,
                      ParentComponent: s,
                    })
                  return warnExtendDeprecated(), t(n, r, l)
                },
              },
            ]),
            s
          )
        })(d)
      return (
        (v.attrs = m),
        (v.componentStyle = g),
        (v.contextTypes = modifiedContextShape),
        (v.displayName = c),
        (v.styledComponentId = y),
        (v.target = r),
        a &&
          hoist(v, r, {
            attrs: !0,
            componentStyle: !0,
            displayName: !0,
            extend: !0,
            styledComponentId: !0,
            target: !0,
            warnTooManyClasses: !0,
            withComponent: !0,
          }),
        v
      )
    }
  }
function murmurhash(e) {
  for (var t, n = 0 | e.length, r = 0 | n, o = 0; n >= 4; )
    (t =
      1540483477 *
        (65535 &
          (t =
            (255 & e.charCodeAt(o)) |
            ((255 & e.charCodeAt(++o)) << 8) |
            ((255 & e.charCodeAt(++o)) << 16) |
            ((255 & e.charCodeAt(++o)) << 24))) +
      (((1540483477 * (t >>> 16)) & 65535) << 16)),
      (r =
        (1540483477 * (65535 & r) +
          (((1540483477 * (r >>> 16)) & 65535) << 16)) ^
        (t =
          1540483477 * (65535 & (t ^= t >>> 24)) +
          (((1540483477 * (t >>> 16)) & 65535) << 16))),
      (n -= 4),
      ++o
  switch (n) {
    case 3:
      r ^= (255 & e.charCodeAt(o + 2)) << 16
    case 2:
      r ^= (255 & e.charCodeAt(o + 1)) << 8
    case 1:
      r =
        1540483477 * (65535 & (r ^= 255 & e.charCodeAt(o))) +
        (((1540483477 * (r >>> 16)) & 65535) << 16)
  }
  return (
    (r =
      1540483477 * (65535 & (r ^= r >>> 13)) +
      (((1540483477 * (r >>> 16)) & 65535) << 16)),
    (r ^= r >>> 15) >>> 0
  )
}
var areStylesCacheable = IS_BROWSER,
  isStaticRules = function e(t, n) {
    for (var r = 0, o = t.length; r < o; r += 1) {
      var i = t[r]
      if (Array.isArray(i) && !e(i)) return !1
      if ('function' == typeof i && !isStyledComponent(i)) return !1
    }
    if (void 0 !== n) for (var s in n) if ('function' == typeof n[s]) return !1
    return !0
  },
  isHMREnabled = 'undefined' != typeof module && module.hot && !1,
  _ComponentStyle = function(e, t, n) {
    var r = function(t) {
      return e(murmurhash(t))
    }
    return (function() {
      function e(t, n, r) {
        if (
          (classCallCheck(this, e),
          (this.rules = t),
          (this.isStatic = !isHMREnabled && isStaticRules(t, n)),
          (this.componentId = r),
          !StyleSheet.master.hasId(r))
        ) {
          StyleSheet.master.deferredInject(r, [])
        }
      }
      return (
        (e.prototype.generateAndInjectStyles = function(e, o) {
          var i = this.isStatic,
            s = this.componentId,
            a = this.lastClassName
          if (areStylesCacheable && i && void 0 !== a && o.hasNameForId(s, a))
            return a
          var u = t(this.rules, e),
            c = r(this.componentId + u.join(''))
          return (
            o.hasNameForId(s, c) ||
              o.inject(this.componentId, n(u, '.' + c), c),
            (this.lastClassName = c),
            c
          )
        }),
        (e.generateName = function(e) {
          return r(e)
        }),
        e
      )
    })()
  },
  domElements = [
    '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',
  ],
  _styled = function(e, t) {
    var n = function(n) {
      return t(e, n)
    }
    return (
      domElements.forEach(function(e) {
        n[e] = n(e)
      }),
      n
    )
  },
  replaceWhitespace = function(e) {
    return e.replace(/\s|\\n/g, '')
  },
  _keyframes = function(e, t, n) {
    return function() {
      var r = StyleSheet.master,
        o = n.apply(void 0, arguments),
        i = e(murmurhash(replaceWhitespace(JSON.stringify(o)))),
        s = 'sc-keyframes-' + i
      return r.hasNameForId(s, i) || r.inject(s, t(o, i, '@keyframes'), i), i
    }
  },
  _injectGlobal = function(e, t) {
    return function() {
      var n = StyleSheet.master,
        r = t.apply(void 0, arguments),
        o = 'sc-global-' + murmurhash(JSON.stringify(r))
      n.hasId(o) || n.inject(o, e(r))
    }
  },
  _constructWithOptions = function(e) {
    return function t(n, r) {
      var o =
        arguments.length > 2 && void 0 !== arguments[2]
          ? arguments[2]
          : EMPTY_OBJECT
      if (!reactIs.isValidElementType(r))
        throw new StyledComponentsError(1, String(r))
      var i = function() {
        return n(r, o, e.apply(void 0, arguments))
      }
      return (
        (i.withConfig = function(e) {
          return t(n, r, _extends({}, o, e))
        }),
        (i.attrs = function(e) {
          return t(
            n,
            r,
            _extends({}, o, { attrs: _extends({}, o.attrs || EMPTY_OBJECT, e) })
          )
        }),
        i
      )
    }
  },
  withTheme = function(e) {
    var t =
        'function' == typeof e &&
        !(e.prototype && 'isReactComponent' in e.prototype),
      n = isStyledComponent(e) || t,
      r = (function(t) {
        function r() {
          var e, n
          classCallCheck(this, r)
          for (var o = arguments.length, i = Array(o), s = 0; s < o; s++)
            i[s] = arguments[s]
          return (
            (e = n = possibleConstructorReturn(
              this,
              t.call.apply(t, [this].concat(i))
            )),
            (n.state = EMPTY_OBJECT),
            (n.unsubscribeId = -1),
            possibleConstructorReturn(n, e)
          )
        }
        return (
          inherits(r, t),
          (r.prototype.componentWillMount = function() {
            var e = this,
              t = this.constructor.defaultProps,
              n = this.context[CHANNEL_NEXT],
              r = determineTheme(this.props, void 0, t)
            if (void 0 === n && void 0 !== r) this.setState({ theme: r })
            else {
              var o = n.subscribe
              this.unsubscribeId = o(function(n) {
                var r = determineTheme(e.props, n, t)
                e.setState({ theme: r })
              })
            }
          }),
          (r.prototype.componentWillReceiveProps = function(e) {
            var t = this.constructor.defaultProps
            this.setState(function(n) {
              return { theme: determineTheme(e, n.theme, t) }
            })
          }),
          (r.prototype.componentWillUnmount = function() {
            ;-1 !== this.unsubscribeId &&
              this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId)
          }),
          (r.prototype.render = function() {
            var t = _extends({ theme: this.state.theme }, this.props)
            return (
              n || ((t.ref = t.innerRef), delete t.innerRef),
              React__default.createElement(e, t)
            )
          }),
          r
        )
      })(React__default.Component)
    return (
      (r.contextTypes = contextShape),
      (r.displayName = 'WithTheme(' + getComponentName(e) + ')'),
      (r.styledComponentId = 'withTheme'),
      hoist(r, e)
    )
  },
  __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
    StyleSheet: StyleSheet,
  },
  ComponentStyle = _ComponentStyle(
    generateAlphabeticName,
    flatten,
    stringifyRules
  ),
  constructWithOptions = _constructWithOptions(css),
  StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions),
  keyframes = _keyframes(generateAlphabeticName, stringifyRules, css),
  injectGlobal = _injectGlobal(stringifyRules, css),
  styled = _styled(StyledComponent, constructWithOptions)
;(exports.default = styled),
  (exports.css = css),
  (exports.keyframes = keyframes),
  (exports.injectGlobal = injectGlobal),
  (exports.isStyledComponent = isStyledComponent),
  (exports.consolidateStreamedStyles = consolidateStreamedStyles),
  (exports.ThemeProvider = ThemeProvider),
  (exports.withTheme = withTheme),
  (exports.ServerStyleSheet = ServerStyleSheet),
  (exports.StyleSheetManager = StyleSheetManager),
  (exports.__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS)
//# sourceMappingURL=styled-components.browser.cjs.min.js.map
