From f8b61281be84a6e4e7a44be5109e688a7c56c671 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Jul 2017 21:18:33 +0200 Subject: refactor files so list updates while processing --- public/bundle.js | 13230 +++++++++++++++++++++++++++-------------------------- 1 file changed, 6750 insertions(+), 6480 deletions(-) (limited to 'public/bundle.js') diff --git a/public/bundle.js b/public/bundle.js index 62ee11b..eab42b5 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -60,739 +60,13 @@ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 22); +/******/ return __webpack_require__(__webpack_require__.s = 39); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -if (process.env.NODE_ENV !== 'production') { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(26)(isValidElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(28)(); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOM", function() { return DOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Children", function() { return Children; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render$1; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClass", function() { return createClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFactory", function() { return createFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneElement", function() { return cloneElement$1; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidElement", function() { return isValidElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return findDOMNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return unmountComponentAtNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component$1; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PureComponent", function() { return PureComponent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unstable_renderSubtreeIntoContainer", function() { return renderSubtreeIntoContainer; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_preact__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_preact___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_preact__); -/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "PropTypes", function() { return __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a; }); - - - -var version = '15.1.0'; // trick libraries to think we are react - -var ELEMENTS = 'a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan'.split(' '); - -var REACT_ELEMENT_TYPE = (typeof Symbol!=='undefined' && Symbol.for && Symbol.for('react.element')) || 0xeac7; - -var COMPONENT_WRAPPER_KEY = typeof Symbol!=='undefined' ? Symbol.for('__preactCompatWrapper') : '__preactCompatWrapper'; - -// don't autobind these methods since they already have guaranteed context. -var AUTOBIND_BLACKLIST = { - constructor: 1, - render: 1, - shouldComponentUpdate: 1, - componentWillReceiveProps: 1, - componentWillUpdate: 1, - componentDidUpdate: 1, - componentWillMount: 1, - componentDidMount: 1, - componentWillUnmount: 1, - componentDidUnmount: 1 -}; - - -var CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vert|word|writing|x)[A-Z]/; - - -var BYPASS_HOOK = {}; - -/*global process*/ -var DEV = typeof process==='undefined' || !process.env || process.env.NODE_ENV!=='production'; - -// a component that renders nothing. Used to replace components for unmountComponentAtNode. -function EmptyComponent() { return null; } - - - -// make react think we're react. -var VNode = __WEBPACK_IMPORTED_MODULE_1_preact__["h"]('a', null).constructor; -VNode.prototype.$$typeof = REACT_ELEMENT_TYPE; -VNode.prototype.preactCompatUpgraded = false; -VNode.prototype.preactCompatNormalized = false; - -Object.defineProperty(VNode.prototype, 'type', { - get: function() { return this.nodeName; }, - set: function(v) { this.nodeName = v; }, - configurable:true -}); - -Object.defineProperty(VNode.prototype, 'props', { - get: function() { return this.attributes; }, - set: function(v) { this.attributes = v; }, - configurable:true -}); - - - -var oldEventHook = __WEBPACK_IMPORTED_MODULE_1_preact__["options"].event; -__WEBPACK_IMPORTED_MODULE_1_preact__["options"].event = function (e) { - if (oldEventHook) { e = oldEventHook(e); } - e.persist = Object; - e.nativeEvent = e; - return e; -}; - - -var oldVnodeHook = __WEBPACK_IMPORTED_MODULE_1_preact__["options"].vnode; -__WEBPACK_IMPORTED_MODULE_1_preact__["options"].vnode = function (vnode) { - if (!vnode.preactCompatUpgraded) { - vnode.preactCompatUpgraded = true; - - var tag = vnode.nodeName, - attrs = vnode.attributes = extend({}, vnode.attributes); - - if (typeof tag==='function') { - if (tag[COMPONENT_WRAPPER_KEY]===true || (tag.prototype && 'isReactComponent' in tag.prototype)) { - if (vnode.children && String(vnode.children)==='') { vnode.children = undefined; } - if (vnode.children) { attrs.children = vnode.children; } - - if (!vnode.preactCompatNormalized) { - normalizeVNode(vnode); - } - handleComponentVNode(vnode); - } - } - else { - if (vnode.children && String(vnode.children)==='') { vnode.children = undefined; } - if (vnode.children) { attrs.children = vnode.children; } - - if (attrs.defaultValue) { - if (!attrs.value && attrs.value!==0) { - attrs.value = attrs.defaultValue; - } - delete attrs.defaultValue; - } - - handleElementVNode(vnode, attrs); - } - } - - if (oldVnodeHook) { oldVnodeHook(vnode); } -}; - -function handleComponentVNode(vnode) { - var tag = vnode.nodeName, - a = vnode.attributes; - - vnode.attributes = {}; - if (tag.defaultProps) { extend(vnode.attributes, tag.defaultProps); } - if (a) { extend(vnode.attributes, a); } -} - -function handleElementVNode(vnode, a) { - var shouldSanitize, attrs, i; - if (a) { - for (i in a) { if ((shouldSanitize = CAMEL_PROPS.test(i))) { break; } } - if (shouldSanitize) { - attrs = vnode.attributes = {}; - for (i in a) { - if (a.hasOwnProperty(i)) { - attrs[ CAMEL_PROPS.test(i) ? i.replace(/([A-Z0-9])/, '-$1').toLowerCase() : i ] = a[i]; - } - } - } - } -} - - - -// proxy render() since React returns a Component reference. -function render$1(vnode, parent, callback) { - var prev = parent && parent._preactCompatRendered && parent._preactCompatRendered.base; - - // ignore impossible previous renders - if (prev && prev.parentNode!==parent) { prev = null; } - - // default to first Element child - if (!prev) { prev = parent.children[0]; } - - // remove unaffected siblings - for (var i=parent.childNodes.length; i--; ) { - if (parent.childNodes[i]!==prev) { - parent.removeChild(parent.childNodes[i]); - } - } - - var out = __WEBPACK_IMPORTED_MODULE_1_preact__["render"](vnode, parent, prev); - if (parent) { parent._preactCompatRendered = out && (out._component || { base: out }); } - if (typeof callback==='function') { callback(); } - return out && out._component || out; -} - - -var ContextProvider = function () {}; - -ContextProvider.prototype.getChildContext = function () { - return this.props.context; -}; -ContextProvider.prototype.render = function (props) { - return props.children[0]; -}; - -function renderSubtreeIntoContainer(parentComponent, vnode, container, callback) { - var wrap = __WEBPACK_IMPORTED_MODULE_1_preact__["h"](ContextProvider, { context: parentComponent.context }, vnode); - var c = render$1(wrap, container); - if (callback) { callback(c); } - return c._component || c.base; -} - - -function unmountComponentAtNode(container) { - var existing = container._preactCompatRendered && container._preactCompatRendered.base; - if (existing && existing.parentNode===container) { - __WEBPACK_IMPORTED_MODULE_1_preact__["render"](__WEBPACK_IMPORTED_MODULE_1_preact__["h"](EmptyComponent), container, existing); - return true; - } - return false; -} - - - -var ARR = []; - -// This API is completely unnecessary for Preact, so it's basically passthrough. -var Children = { - map: function(children, fn, ctx) { - if (children == null) { return null; } - children = Children.toArray(children); - if (ctx && ctx!==children) { fn = fn.bind(ctx); } - return children.map(fn); - }, - forEach: function(children, fn, ctx) { - if (children == null) { return null; } - children = Children.toArray(children); - if (ctx && ctx!==children) { fn = fn.bind(ctx); } - children.forEach(fn); - }, - count: function(children) { - return children && children.length || 0; - }, - only: function(children) { - children = Children.toArray(children); - if (children.length!==1) { throw new Error('Children.only() expects only one child.'); } - return children[0]; - }, - toArray: function(children) { - if (children == null) { return []; } - return Array.isArray && Array.isArray(children) ? children : ARR.concat(children); - } -}; - - -/** Track current render() component for ref assignment */ -var currentComponent; - - -function createFactory(type) { - return createElement.bind(null, type); -} - - -var DOM = {}; -for (var i=ELEMENTS.length; i--; ) { - DOM[ELEMENTS[i]] = createFactory(ELEMENTS[i]); -} - -function upgradeToVNodes(arr, offset) { - for (var i=offset || 0; i 0 ) children[ len ] = arguments[ len + 2 ]; - - if (!isValidElement(element)) { return element; } - var elementProps = element.attributes || element.props; - var node = __WEBPACK_IMPORTED_MODULE_1_preact__["h"]( - element.nodeName || element.type, - elementProps, - element.children || elementProps && elementProps.children - ); - // Only provide the 3rd argument if needed. - // Arguments 3+ overwrite element.children in preactCloneElement - var cloneArgs = [node, props]; - if (children && children.length) { - cloneArgs.push(children); - } - else if (props && props.children) { - cloneArgs.push(props.children); - } - return normalizeVNode(__WEBPACK_IMPORTED_MODULE_1_preact__["cloneElement"].apply(void 0, cloneArgs)); -} - - -function isValidElement(element) { - return element && ((element instanceof VNode) || element.$$typeof===REACT_ELEMENT_TYPE); -} - - -function createStringRefProxy(name, component) { - return component._refProxies[name] || (component._refProxies[name] = function (resolved) { - if (component && component.refs) { - component.refs[name] = resolved; - if (resolved===null) { - delete component._refProxies[name]; - component = null; - } - } - }); -} - - -function applyEventNormalization(ref) { - var nodeName = ref.nodeName; - var attributes = ref.attributes; - - if (!attributes || typeof nodeName!=='string') { return; } - var props = {}; - for (var i in attributes) { - props[i.toLowerCase()] = i; - } - if (props.ondoubleclick) { - attributes.ondblclick = attributes[props.ondoubleclick]; - delete attributes[props.ondoubleclick]; - } - // for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`: - if (props.onchange && (nodeName==='textarea' || (nodeName.toLowerCase()==='input' && !/^fil|che|rad/i.test(attributes.type)))) { - var normalized = props.oninput || 'oninput'; - if (!attributes[normalized]) { - attributes[normalized] = multihook([attributes[normalized], attributes[props.onchange]]); - delete attributes[props.onchange]; - } - } -} - - -function applyClassName(ref) { - var attributes = ref.attributes; - - if (!attributes) { return; } - var cl = attributes.className || attributes.class; - if (cl) { attributes.className = cl; } -} - - -function extend(base, props) { - for (var key in props) { - if (props.hasOwnProperty(key)) { - base[key] = props[key]; - } - } - return base; -} - - -function shallowDiffers(a, b) { - for (var i in a) { if (!(i in b)) { return true; } } - for (var i$1 in b) { if (a[i$1]!==b[i$1]) { return true; } } - return false; -} - - -function findDOMNode(component) { - return component && component.base || component; -} - - -function F(){} - -function createClass(obj) { - function cl(props, context) { - bindAll(this); - Component$1.call(this, props, context, BYPASS_HOOK); - newComponentHook.call(this, props, context); - } - - obj = extend({ constructor: cl }, obj); - - // We need to apply mixins here so that getDefaultProps is correctly mixed - if (obj.mixins) { - applyMixins(obj, collateMixins(obj.mixins)); - } - if (obj.statics) { - extend(cl, obj.statics); - } - if (obj.propTypes) { - cl.propTypes = obj.propTypes; - } - if (obj.defaultProps) { - cl.defaultProps = obj.defaultProps; - } - if (obj.getDefaultProps) { - cl.defaultProps = obj.getDefaultProps(); - } - - F.prototype = Component$1.prototype; - cl.prototype = extend(new F(), obj); - - cl.displayName = obj.displayName || 'Component'; - - return cl; -} - - -// Flatten an Array of mixins to a map of method name to mixin implementations -function collateMixins(mixins) { - var keyed = {}; - for (var i=0; i 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOM", function() { return DOM; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Children", function() { return Children; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render$1; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClass", function() { return createClass; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFactory", function() { return createFactory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneElement", function() { return cloneElement$1; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidElement", function() { return isValidElement; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return findDOMNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return unmountComponentAtNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component$1; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PureComponent", function() { return PureComponent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unstable_renderSubtreeIntoContainer", function() { return renderSubtreeIntoContainer; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_preact__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_preact___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_preact__); +/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "PropTypes", function() { return __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a; }); + + + +var version = '15.1.0'; // trick libraries to think we are react + +var ELEMENTS = 'a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan'.split(' '); + +var REACT_ELEMENT_TYPE = (typeof Symbol!=='undefined' && Symbol.for && Symbol.for('react.element')) || 0xeac7; + +var COMPONENT_WRAPPER_KEY = typeof Symbol!=='undefined' ? Symbol.for('__preactCompatWrapper') : '__preactCompatWrapper'; + +// don't autobind these methods since they already have guaranteed context. +var AUTOBIND_BLACKLIST = { + constructor: 1, + render: 1, + shouldComponentUpdate: 1, + componentWillReceiveProps: 1, + componentWillUpdate: 1, + componentDidUpdate: 1, + componentWillMount: 1, + componentDidMount: 1, + componentWillUnmount: 1, + componentDidUnmount: 1 +}; + + +var CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vert|word|writing|x)[A-Z]/; + + +var BYPASS_HOOK = {}; + +/*global process*/ +var DEV = typeof process==='undefined' || !process.env || process.env.NODE_ENV!=='production'; + +// a component that renders nothing. Used to replace components for unmountComponentAtNode. +function EmptyComponent() { return null; } + + + +// make react think we're react. +var VNode = __WEBPACK_IMPORTED_MODULE_1_preact__["h"]('a', null).constructor; +VNode.prototype.$$typeof = REACT_ELEMENT_TYPE; +VNode.prototype.preactCompatUpgraded = false; +VNode.prototype.preactCompatNormalized = false; + +Object.defineProperty(VNode.prototype, 'type', { + get: function() { return this.nodeName; }, + set: function(v) { this.nodeName = v; }, + configurable:true +}); + +Object.defineProperty(VNode.prototype, 'props', { + get: function() { return this.attributes; }, + set: function(v) { this.attributes = v; }, + configurable:true +}); + + + +var oldEventHook = __WEBPACK_IMPORTED_MODULE_1_preact__["options"].event; +__WEBPACK_IMPORTED_MODULE_1_preact__["options"].event = function (e) { + if (oldEventHook) { e = oldEventHook(e); } + e.persist = Object; + e.nativeEvent = e; + return e; +}; + + +var oldVnodeHook = __WEBPACK_IMPORTED_MODULE_1_preact__["options"].vnode; +__WEBPACK_IMPORTED_MODULE_1_preact__["options"].vnode = function (vnode) { + if (!vnode.preactCompatUpgraded) { + vnode.preactCompatUpgraded = true; + + var tag = vnode.nodeName, + attrs = vnode.attributes = extend({}, vnode.attributes); + + if (typeof tag==='function') { + if (tag[COMPONENT_WRAPPER_KEY]===true || (tag.prototype && 'isReactComponent' in tag.prototype)) { + if (vnode.children && String(vnode.children)==='') { vnode.children = undefined; } + if (vnode.children) { attrs.children = vnode.children; } + + if (!vnode.preactCompatNormalized) { + normalizeVNode(vnode); + } + handleComponentVNode(vnode); + } + } + else { + if (vnode.children && String(vnode.children)==='') { vnode.children = undefined; } + if (vnode.children) { attrs.children = vnode.children; } + + if (attrs.defaultValue) { + if (!attrs.value && attrs.value!==0) { + attrs.value = attrs.defaultValue; + } + delete attrs.defaultValue; + } + + handleElementVNode(vnode, attrs); + } + } + + if (oldVnodeHook) { oldVnodeHook(vnode); } +}; + +function handleComponentVNode(vnode) { + var tag = vnode.nodeName, + a = vnode.attributes; + + vnode.attributes = {}; + if (tag.defaultProps) { extend(vnode.attributes, tag.defaultProps); } + if (a) { extend(vnode.attributes, a); } +} + +function handleElementVNode(vnode, a) { + var shouldSanitize, attrs, i; + if (a) { + for (i in a) { if ((shouldSanitize = CAMEL_PROPS.test(i))) { break; } } + if (shouldSanitize) { + attrs = vnode.attributes = {}; + for (i in a) { + if (a.hasOwnProperty(i)) { + attrs[ CAMEL_PROPS.test(i) ? i.replace(/([A-Z0-9])/, '-$1').toLowerCase() : i ] = a[i]; + } + } + } + } +} + + + +// proxy render() since React returns a Component reference. +function render$1(vnode, parent, callback) { + var prev = parent && parent._preactCompatRendered && parent._preactCompatRendered.base; + + // ignore impossible previous renders + if (prev && prev.parentNode!==parent) { prev = null; } + + // default to first Element child + if (!prev) { prev = parent.children[0]; } + + // remove unaffected siblings + for (var i=parent.childNodes.length; i--; ) { + if (parent.childNodes[i]!==prev) { + parent.removeChild(parent.childNodes[i]); + } + } + + var out = __WEBPACK_IMPORTED_MODULE_1_preact__["render"](vnode, parent, prev); + if (parent) { parent._preactCompatRendered = out && (out._component || { base: out }); } + if (typeof callback==='function') { callback(); } + return out && out._component || out; +} + + +var ContextProvider = function () {}; + +ContextProvider.prototype.getChildContext = function () { + return this.props.context; +}; +ContextProvider.prototype.render = function (props) { + return props.children[0]; +}; + +function renderSubtreeIntoContainer(parentComponent, vnode, container, callback) { + var wrap = __WEBPACK_IMPORTED_MODULE_1_preact__["h"](ContextProvider, { context: parentComponent.context }, vnode); + var c = render$1(wrap, container); + if (callback) { callback(c); } + return c._component || c.base; +} + + +function unmountComponentAtNode(container) { + var existing = container._preactCompatRendered && container._preactCompatRendered.base; + if (existing && existing.parentNode===container) { + __WEBPACK_IMPORTED_MODULE_1_preact__["render"](__WEBPACK_IMPORTED_MODULE_1_preact__["h"](EmptyComponent), container, existing); + return true; + } + return false; +} + + + +var ARR = []; + +// This API is completely unnecessary for Preact, so it's basically passthrough. +var Children = { + map: function(children, fn, ctx) { + if (children == null) { return null; } + children = Children.toArray(children); + if (ctx && ctx!==children) { fn = fn.bind(ctx); } + return children.map(fn); + }, + forEach: function(children, fn, ctx) { + if (children == null) { return null; } + children = Children.toArray(children); + if (ctx && ctx!==children) { fn = fn.bind(ctx); } + children.forEach(fn); + }, + count: function(children) { + return children && children.length || 0; + }, + only: function(children) { + children = Children.toArray(children); + if (children.length!==1) { throw new Error('Children.only() expects only one child.'); } + return children[0]; + }, + toArray: function(children) { + if (children == null) { return []; } + return Array.isArray && Array.isArray(children) ? children : ARR.concat(children); + } +}; + + +/** Track current render() component for ref assignment */ +var currentComponent; + + +function createFactory(type) { + return createElement.bind(null, type); +} + + +var DOM = {}; +for (var i=ELEMENTS.length; i--; ) { + DOM[ELEMENTS[i]] = createFactory(ELEMENTS[i]); +} + +function upgradeToVNodes(arr, offset) { + for (var i=offset || 0; i 0 ) children[ len ] = arguments[ len + 2 ]; + + if (!isValidElement(element)) { return element; } + var elementProps = element.attributes || element.props; + var node = __WEBPACK_IMPORTED_MODULE_1_preact__["h"]( + element.nodeName || element.type, + elementProps, + element.children || elementProps && elementProps.children + ); + // Only provide the 3rd argument if needed. + // Arguments 3+ overwrite element.children in preactCloneElement + var cloneArgs = [node, props]; + if (children && children.length) { + cloneArgs.push(children); + } + else if (props && props.children) { + cloneArgs.push(props.children); + } + return normalizeVNode(__WEBPACK_IMPORTED_MODULE_1_preact__["cloneElement"].apply(void 0, cloneArgs)); } -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } +function isValidElement(element) { + return element && ((element instanceof VNode) || element.$$typeof===REACT_ELEMENT_TYPE); +} + + +function createStringRefProxy(name, component) { + return component._refProxies[name] || (component._refProxies[name] = function (resolved) { + if (component && component.refs) { + component.refs[name] = resolved; + if (resolved===null) { + delete component._refProxies[name]; + component = null; + } + } + }); } -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } +function applyEventNormalization(ref) { + var nodeName = ref.nodeName; + var attributes = ref.attributes; + if (!attributes || typeof nodeName!=='string') { return; } + var props = {}; + for (var i in attributes) { + props[i.toLowerCase()] = i; + } + if (props.ondoubleclick) { + attributes.ondblclick = attributes[props.ondoubleclick]; + delete attributes[props.ondoubleclick]; + } + // for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`: + if (props.onchange && (nodeName==='textarea' || (nodeName.toLowerCase()==='input' && !/^fil|che|rad/i.test(attributes.type)))) { + var normalized = props.oninput || 'oninput'; + if (!attributes[normalized]) { + attributes[normalized] = multihook([attributes[normalized], attributes[props.onchange]]); + delete attributes[props.onchange]; + } + } } -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } + +function applyClassName(ref) { + var attributes = ref.attributes; + + if (!attributes) { return; } + var cl = attributes.className || attributes.class; + if (cl) { attributes.className = cl; } +} + + +function extend(base, props) { + for (var key in props) { + if (props.hasOwnProperty(key)) { + base[key] = props[key]; + } + } + return base; +} + + +function shallowDiffers(a, b) { + for (var i in a) { if (!(i in b)) { return true; } } + for (var i$1 in b) { if (a[i$1]!==b[i$1]) { return true; } } + return false; +} + + +function findDOMNode(component) { + return component && component.base || component; +} + + +function F(){} + +function createClass(obj) { + function cl(props, context) { + bindAll(this); + Component$1.call(this, props, context, BYPASS_HOOK); + newComponentHook.call(this, props, context); + } + + obj = extend({ constructor: cl }, obj); + + // We need to apply mixins here so that getDefaultProps is correctly mixed + if (obj.mixins) { + applyMixins(obj, collateMixins(obj.mixins)); + } + if (obj.statics) { + extend(cl, obj.statics); + } + if (obj.propTypes) { + cl.propTypes = obj.propTypes; + } + if (obj.defaultProps) { + cl.defaultProps = obj.defaultProps; + } + if (obj.getDefaultProps) { + cl.defaultProps = obj.getDefaultProps(); + } + + F.prototype = Component$1.prototype; + cl.prototype = extend(new F(), obj); + + cl.displayName = obj.displayName || 'Component'; + + return cl; +} + + +// Flatten an Array of mixins to a map of method name to mixin implementations +function collateMixins(mixins) { + var keyed = {}; + for (var i=0; i 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; +function bindAll(ctx) { + for (var i in ctx) { + var v = ctx[i]; + if (typeof v==='function' && !v.__bound && !AUTOBIND_BLACKLIST.hasOwnProperty(i)) { + (ctx[i] = v.bind(ctx)).__bound = true; + } + } } -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; -process.listeners = function (name) { return [] } -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; +function callMethod(ctx, m, args) { + if (typeof m==='string') { + m = ctx.constructor.prototype[m]; + } + if (typeof m==='function') { + return m.apply(ctx, args); + } +} -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; +function multihook(hooks, skipDuplicates) { + return function() { + var arguments$1 = arguments; + var this$1 = this; + var ret; + for (var i=0; i 2 ? len - 2 : 0); - for (var key = 2; key < len; key++) { - args[key - 2] = arguments[key]; - } - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } - - if (format.length < 10 || (/^[s\W]*$/).test(format)) { - throw new Error( - 'The warning format should be able to uniquely identify this ' + - 'warning. Please, use a more descriptive format than: ' + format - ); - } + * of patent rights can be found in the PATENTS file in the same directory. + */ - if (!condition) { - var argIndex = 0; - var message = 'Warning: ' + - format.replace(/%s/g, function() { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch(x) {} - } +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; }; -} -module.exports = warning; + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(41)(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(43)(); +} -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { +/* 4 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__ = __webpack_require__(86); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Prompt__ = __webpack_require__(88); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__Prompt__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Redirect__ = __webpack_require__(89); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__Redirect__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(36); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_3__Route__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(20); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_4__Router__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__StaticRouter__ = __webpack_require__(92); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_5__StaticRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Switch__ = __webpack_require__(93); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_6__Switch__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__matchPath__ = __webpack_require__(21); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_7__matchPath__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__withRouter__ = __webpack_require__(94); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_8__withRouter__["a"]; }); + + -exports.__esModule = true; -var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) { - return path.charAt(0) === '/' ? path : '/' + path; -}; -var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) { - return path.charAt(0) === '/' ? path.substr(1) : path; -}; -var hasBasename = exports.hasBasename = function hasBasename(path, prefix) { - return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); -}; -var stripBasename = exports.stripBasename = function stripBasename(path, prefix) { - return hasBasename(path, prefix) ? path.substr(prefix.length) : path; -}; -var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) { - return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; -}; -var parsePath = exports.parsePath = function parsePath(path) { - var pathname = path || '/'; - var search = ''; - var hash = ''; - var hashIndex = pathname.indexOf('#'); - if (hashIndex !== -1) { - hash = pathname.substr(hashIndex); - pathname = pathname.substr(0, hashIndex); - } - var searchIndex = pathname.indexOf('?'); - if (searchIndex !== -1) { - search = pathname.substr(searchIndex); - pathname = pathname.substr(0, searchIndex); - } - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -}; -var createPath = exports.createPath = function createPath(location) { - var pathname = location.pathname, - search = location.search, - hash = location.hash; - var path = pathname || '/'; - if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search; - if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash; - return path; -}; /***/ }), -/* 8 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1701,121 +1507,213 @@ function error(err) { } /***/ }), -/* 9 */ +/* 6 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(45); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; }); + + + + + + +/***/ }), +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* AudioPlayer */ -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ +var audioPlayFile = exports.audioPlayFile = function audioPlayFile(file) { + return { + type: 'AUDIO_PLAY_FILE', + file: file + }; +}; +var audioPause = exports.audioPause = function audioPause() { + return { + type: 'AUDIO_PAUSE' + }; +}; -var invariant = function(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } +/* currentTask */ - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } +var setContent = exports.setContent = function setContent(content) { + return { + type: 'SET_CONTENT', + file: content + }; +}; +var setStyle = exports.setStyle = function setStyle(style) { + return { + type: 'SET_STYLE', + file: style + }; +}; +var setAlpha = exports.setAlpha = function setAlpha(alpha) { + return { + type: 'SET_ALPHA', + alpha: alpha + }; +}; +var createTask = exports.createTask = function createTask() { + return { + type: 'CREATE_TASK' + }; +}; +var addTask = exports.addTask = function addTask() { + return { + type: 'ADD_TASK' + }; +}; - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } +/* tasks */ + +var loadTasks = exports.loadTasks = function loadTasks(tasks) { + return { + type: 'LOAD_TASKS', + tasks: tasks + }; }; -module.exports = invariant; +/* folders */ -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) +var loadFolders = exports.loadFolders = function loadFolders(folders) { + return { + type: 'LOAD_FOLDERS', + folders: folders + }; +}; +var loadFiles = exports.loadFiles = function loadFiles(files) { + return { + type: 'LOAD_FILES', + files: files + }; +}; +var loadOpenFolders = exports.loadOpenFolders = function loadOpenFolders(folders) { + return { + type: 'LOAD_OPEN_FOLDERS', + folders: folders + }; +}; +var openFolder = exports.openFolder = function openFolder(folder) { + return { + type: 'OPEN_FOLDER', + folder: folder + }; +}; +var closeFolder = exports.closeFolder = function closeFolder(folder) { + return { + type: 'CLOSE_FOLDER', + folder: folder + }; +}; +var addFolder = exports.addFolder = function addFolder(folder) { + return { + type: 'ADD_FOLDER', + folder: folder + }; +}; +var updateFile = exports.updateFile = function updateFile(file) { + return { + type: 'UPDATE_FILE', + file: file + }; +}; /***/ }), -/* 10 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = function() {}; +if (process.env.NODE_ENV !== 'production') { + warning = function(condition, format, args) { + var len = arguments.length; + args = new Array(len > 2 ? len - 2 : 0); + for (var key = 2; key < len; key++) { + args[key - 2] = arguments[key]; + } + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); + } -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ + if (format.length < 10 || (/^[s\W]*$/).test(format)) { + throw new Error( + 'The warning format should be able to uniquely identify this ' + + 'warning. Please, use a more descriptive format than: ' + format + ); + } -function makeEmptyFunction(arg) { - return function () { - return arg; + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + + format.replace(/%s/g, function() { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch(x) {} + } }; } -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; +module.exports = warning; -module.exports = emptyFunction; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 11 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. - * */ @@ -1831,574 +1729,613 @@ module.exports = emptyFunction; * will remain to ensure logic does not differ in production. */ -var validateFormat = function validateFormat(format) {}; - -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { +var invariant = function(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { if (format === undefined) { throw new Error('invariant requires an error message argument'); } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); + } if (!condition) { var error; if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } -} +}; module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 13 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.locationsAreEqual = exports.createLocation = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _resolvePathname = __webpack_require__(30); - -var _resolvePathname2 = _interopRequireDefault(_resolvePathname); - -var _valueEqual = __webpack_require__(31); - -var _valueEqual2 = _interopRequireDefault(_valueEqual); - -var _PathUtils = __webpack_require__(7); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) { - var location = void 0; - if (typeof path === 'string') { - // Two-arg form: push(path, state) - location = (0, _PathUtils.parsePath)(path); - location.state = state; - } else { - // One-arg form: push(location) - location = _extends({}, path); - - if (location.pathname === undefined) location.pathname = ''; - - if (location.search) { - if (location.search.charAt(0) !== '?') location.search = '?' + location.search; - } else { - location.search = ''; - } - - if (location.hash) { - if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; - } else { - location.hash = ''; - } - - if (state !== undefined && location.state === undefined) location.state = state; - } - - try { - location.pathname = decodeURI(location.pathname); - } catch (e) { - if (e instanceof URIError) { - throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); - } else { - throw e; - } - } - - if (key) location.key = key; - - if (currentLocation) { - // Resolve incomplete/relative pathname relative to current location. - if (!location.pathname) { - location.pathname = currentLocation.pathname; - } else if (location.pathname.charAt(0) !== '/') { - location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname); - } - } else { - // When there is no prior location and pathname is empty, set it to / - if (!location.pathname) { - location.pathname = '/'; - } - } - - return location; +var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) { + return path.charAt(0) === '/' ? path : '/' + path; }; -var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) { - return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state); +var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; }; -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _warning = __webpack_require__(6); +var hasBasename = exports.hasBasename = function hasBasename(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); +}; -var _warning2 = _interopRequireDefault(_warning); +var stripBasename = exports.stripBasename = function stripBasename(path, prefix) { + return hasBasename(path, prefix) ? path.substr(prefix.length) : path; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; +}; -var createTransitionManager = function createTransitionManager() { - var prompt = null; +var parsePath = exports.parsePath = function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; - var setPrompt = function setPrompt(nextPrompt) { - (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time'); + var hashIndex = pathname.indexOf('#'); + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } - prompt = nextPrompt; + var searchIndex = pathname.indexOf('?'); + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } - return function () { - if (prompt === nextPrompt) prompt = null; - }; + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash }; +}; - var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { - // TODO: If another transition starts while we're still confirming - // the previous one, we may end up in a weird state. Figure out the - // best way to handle this. - if (prompt != null) { - var result = typeof prompt === 'function' ? prompt(location, action) : prompt; - - if (typeof result === 'string') { - if (typeof getUserConfirmation === 'function') { - getUserConfirmation(result, callback); - } else { - (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); - - callback(true); - } - } else { - // Return false from a transition hook to cancel the transition. - callback(result !== false); - } - } else { - callback(true); - } - }; +var createPath = exports.createPath = function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; - var listeners = []; - var appendListener = function appendListener(fn) { - var isActive = true; + var path = pathname || '/'; - var listener = function listener() { - if (isActive) fn.apply(undefined, arguments); - }; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search; - listeners.push(listener); + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash; - return function () { - isActive = false; - listeners = listeners.filter(function (item) { - return item !== listener; - }); - }; - }; + return path; +}; - var notifyListeners = function notifyListeners() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { - listeners.forEach(function (listener) { - return listener.apply(undefined, args); - }); - }; +"use strict"; - return { - setPrompt: setPrompt, - confirmTransitionTo: confirmTransitionTo, - appendListener: appendListener, - notifyListeners: notifyListeners + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; }; -exports.default = createTransitionManager; +module.exports = emptyFunction; /***/ }), -/* 15 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} +module.exports = invariant; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; /** - * The public API for putting history on context. + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ -var Router = function (_React$Component) { - _inherits(Router, _React$Component); - - function Router() { - var _temp, _this, _ret; - _classCallCheck(this, Router); - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { - match: _this.computeMatch(_this.props.history.location.pathname) - }, _temp), _possibleConstructorReturn(_this, _ret); - } +module.exports = ReactPropTypesSecret; - Router.prototype.getChildContext = function getChildContext() { - return { - router: _extends({}, this.context.router, { - history: this.props.history, - route: { - location: this.props.history.location, - match: this.state.match - } - }) - }; - }; - Router.prototype.computeMatch = function computeMatch(pathname) { - return { - path: '/', - url: '/', - params: {}, - isExact: pathname === '/' - }; - }; +/***/ }), +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - Router.prototype.componentWillMount = function componentWillMount() { - var _this2 = this; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = warning; +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); + } + /* eslint-enable no-console */ + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + /* eslint-disable no-empty */ + } catch (e) {} + /* eslint-enable no-empty */ +} - var _props = this.props, - children = _props.children, - history = _props.history; +/***/ }), +/* 15 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(26); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(61); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(30); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(29); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); - __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(children == null || __WEBPACK_IMPORTED_MODULE_2_react__["default"].Children.count(children) === 1, 'A may have only one child element'); - // Do this here so we can setState when a changes the - // location in componentWillMount. This happens e.g. when doing - // server rendering using a . - this.unlisten = history.listen(function () { - _this2.setState({ - match: _this2.computeMatch(history.location.pathname) - }); - }); - }; - Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(this.props.history === nextProps.history, 'You cannot change '); - }; - Router.prototype.componentWillUnmount = function componentWillUnmount() { - this.unlisten(); - }; - Router.prototype.render = function render() { - var children = this.props.children; - return children ? __WEBPACK_IMPORTED_MODULE_2_react__["default"].Children.only(children) : null; - }; - return Router; -}(__WEBPACK_IMPORTED_MODULE_2_react__["default"].Component); +/* +* This is a dummy function to check if the function name has been altered by minification. +* If the function has been minified and NODE_ENV !== 'production', warn the user. +*/ +function isCrushed() {} -Router.propTypes = { - history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, - children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node -}; -Router.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object -}; -Router.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired -}; +if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { + __WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */]('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); +} -/* harmony default export */ __webpack_exports__["a"] = (Router); +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) /***/ }), /* 16 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(36); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(53); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(55); -var patternCache = {}; -var cacheLimit = 10000; -var cacheCount = 0; -var compilePath = function compilePath(pattern, options) { - var cacheKey = '' + options.end + options.strict; - var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {}); - if (cache[pattern]) return cache[pattern]; +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; - var keys = []; - var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a(pattern, keys, options); - var compiledPattern = { re: re, keys: keys }; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; - if (cacheCount < cacheLimit) { - cache[pattern] = compiledPattern; - cacheCount++; - } +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; - return compiledPattern; -}; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); /** - * Public API for matching a URL pathname to a path pattern. + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true */ -var matchPath = function matchPath(pathname) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +function isPlainObject(value) { + if (!__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */](value) || __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */](value) != objectTag) { + return false; + } + var proto = __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */](value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} - if (typeof options === 'string') options = { path: options }; +/* harmony default export */ __webpack_exports__["a"] = (isPlainObject); - var _options = options, - _options$path = _options.path, - path = _options$path === undefined ? '/' : _options$path, - _options$exact = _options.exact, - exact = _options$exact === undefined ? false : _options$exact, - _options$strict = _options.strict, - strict = _options$strict === undefined ? false : _options$strict; - var _compilePath = compilePath(path, { end: exact, strict: strict }), - re = _compilePath.re, - keys = _compilePath.keys; +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { - var match = re.exec(pathname); +"use strict"; - if (!match) return null; - var url = match[0], - values = match.slice(1); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var isExact = pathname === url; +var _preact = __webpack_require__(0); - if (exact && !isExact) return null; +var _react = __webpack_require__(2); - return { - path: path, // the path pattern used to match - url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL - isExact: isExact, // whether or not we matched exactly - params: keys.reduce(function (memo, key, index) { - memo[key.name] = values[index]; - return memo; - }, {}) - }; +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types' + +var Link = function Link(_ref) { + var active = _ref.active, + children = _ref.children, + _onClick = _ref.onClick; + + if (active) { + return (0, _preact.h)( + 'span', + null, + children + ); + } + + return ( + // eslint-disable-next-line + (0, _preact.h)( + 'a', + { href: '#', + onClick: function onClick(e) { + e.preventDefault(); + _onClick(); + } + }, + children + ) + ); }; -/* harmony default export */ __webpack_exports__["a"] = (matchPath); +// Link.propTypes = { +// active: PropTypes.bool.isRequired, +// children: PropTypes.node.isRequired, +// onClick: PropTypes.func.isRequired +// } + +exports.default = Link; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +exports.__esModule = true; +exports.locationsAreEqual = exports.createLocation = undefined; -var emptyFunction = __webpack_require__(10); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ +var _resolvePathname = __webpack_require__(84); -var warning = emptyFunction; +var _resolvePathname2 = _interopRequireDefault(_resolvePathname); -if (process.env.NODE_ENV !== 'production') { - (function () { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } +var _valueEqual = __webpack_require__(85); - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; +var _valueEqual2 = _interopRequireDefault(_valueEqual); - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } +var _PathUtils = __webpack_require__(10); - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } +var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) { + var location = void 0; + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = (0, _PathUtils.parsePath)(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); - printWarning.apply(undefined, [format].concat(args)); - } - }; - })(); -} + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } -module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + return location; +}; + +var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state); +}; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) { - return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener); -}; +var _warning = __webpack_require__(8); -var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) { - return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener); -}; +var _warning2 = _interopRequireDefault(_warning); -var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) { - return callback(window.confirm(message)); -}; // eslint-disable-line no-alert +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Returns true if the HTML5 history API is supported. Taken from Modernizr. - * - * https://github.com/Modernizr/Modernizr/blob/master/LICENSE - * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 - */ -var supportsHistory = exports.supportsHistory = function supportsHistory() { - var ua = window.navigator.userAgent; +var createTransitionManager = function createTransitionManager() { + var prompt = null; - if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + var setPrompt = function setPrompt(nextPrompt) { + (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time'); - return window.history && 'pushState' in window.history; -}; + prompt = nextPrompt; -/** - * Returns true if browser fires popstate on hash change. - * IE10 and IE11 do not. - */ -var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { - return window.navigator.userAgent.indexOf('Trident') === -1; -}; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + }; -/** - * Returns false if using go(n) with hash history causes a full page reload. - */ -var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { - return window.navigator.userAgent.indexOf('Firefox') === -1; -}; + var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; -/** - * Returns true if a given popstate event is an extraneous WebKit event. - * Accounts for the fact that Chrome on iOS fires real popstate events - * containing undefined state when pressing the back button. - */ -var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { - return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + }; + + var listeners = []; + + var appendListener = function appendListener(fn) { + var isActive = true; + + var listener = function listener() { + if (isActive) fn.apply(undefined, arguments); + }; + + listeners.push(listener); + + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + }; + + var notifyListeners = function notifyListeners() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(undefined, args); + }); + }; + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; }; +exports.default = createTransitionManager; + /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2413,1532 +2350,1587 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The public API for matching a single path and rendering. + * The public API for putting history on context. */ -var Route = function (_React$Component) { - _inherits(Route, _React$Component); +var Router = function (_React$Component) { + _inherits(Router, _React$Component); - function Route() { + function Router() { var _temp, _this, _ret; - _classCallCheck(this, Route); + _classCallCheck(this, Router); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { - match: _this.computeMatch(_this.props, _this.context.router) + match: _this.computeMatch(_this.props.history.location.pathname) }, _temp), _possibleConstructorReturn(_this, _ret); } - Route.prototype.getChildContext = function getChildContext() { + Router.prototype.getChildContext = function getChildContext() { return { router: _extends({}, this.context.router, { + history: this.props.history, route: { - location: this.props.location || this.context.router.route.location, + location: this.props.history.location, match: this.state.match } }) }; }; - Route.prototype.computeMatch = function computeMatch(_ref, _ref2) { - var computedMatch = _ref.computedMatch, - location = _ref.location, - path = _ref.path, - strict = _ref.strict, - exact = _ref.exact; - var route = _ref2.route; - - if (computedMatch) return computedMatch; // already computed the match for us - - var pathname = (location || route.location).pathname; - - return path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](pathname, { path: path, strict: strict, exact: exact }) : route.match; + Router.prototype.computeMatch = function computeMatch(pathname) { + return { + path: '/', + url: '/', + params: {}, + isExact: pathname === '/' + }; }; - Route.prototype.componentWillMount = function componentWillMount() { - var _props = this.props, - component = _props.component, - render = _props.render, - children = _props.children; + Router.prototype.componentWillMount = function componentWillMount() { + var _this2 = this; + var _props = this.props, + children = _props.children, + history = _props.history; - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && render), 'You should not use and in the same route; will be ignored'); - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && children), 'You should not use and in the same route; will be ignored'); + __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(children == null || __WEBPACK_IMPORTED_MODULE_2_react__["default"].Children.count(children) === 1, 'A may have only one child element'); - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(render && children), 'You should not use and in the same route; will be ignored'); + // Do this here so we can setState when a changes the + // location in componentWillMount. This happens e.g. when doing + // server rendering using a . + this.unlisten = history.listen(function () { + _this2.setState({ + match: _this2.computeMatch(history.location.pathname) + }); + }); }; - Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); - - __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); - - this.setState({ - match: this.computeMatch(nextProps, nextContext.router) - }); + Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(this.props.history === nextProps.history, 'You cannot change '); }; - Route.prototype.render = function render() { - var match = this.state.match; - var _props2 = this.props, - children = _props2.children, - component = _props2.component, - render = _props2.render; - var _context$router = this.context.router, - history = _context$router.history, - route = _context$router.route, - staticContext = _context$router.staticContext; + Router.prototype.componentWillUnmount = function componentWillUnmount() { + this.unlisten(); + }; - var location = this.props.location || route.location; - var props = { match: match, location: location, history: history, staticContext: staticContext }; + Router.prototype.render = function render() { + var children = this.props.children; - return component ? // component prop gets first priority, only called if there's a match - match ? __WEBPACK_IMPORTED_MODULE_1_react__["default"].createElement(component, props) : null : render ? // render prop is next, only called if there's a match - match ? render(props) : null : children ? // children come last, always called - typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array - __WEBPACK_IMPORTED_MODULE_1_react__["default"].Children.only(children) : null : null; + return children ? __WEBPACK_IMPORTED_MODULE_2_react__["default"].Children.only(children) : null; }; - return Route; -}(__WEBPACK_IMPORTED_MODULE_1_react__["default"].Component); + return Router; +}(__WEBPACK_IMPORTED_MODULE_2_react__["default"].Component); -Route.propTypes = { - computedMatch: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object, // private, from - path: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, - exact: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, - strict: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, - component: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, - render: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, - children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node]), - location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object +Router.propTypes = { + history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, + children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node }; -Route.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, - route: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, - staticContext: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object - }) +Router.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object }; -Route.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired +Router.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired }; -/* harmony default export */ __webpack_exports__["a"] = (Route); +/* harmony default export */ __webpack_exports__["a"] = (Router); /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(90); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var patternCache = {}; +var cacheLimit = 10000; +var cacheCount = 0; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var compilePath = function compilePath(pattern, options) { + var cacheKey = '' + options.end + options.strict; + var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {}); + if (cache[pattern]) return cache[pattern]; + var keys = []; + var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a(pattern, keys, options); + var compiledPattern = { re: re, keys: keys }; + if (cacheCount < cacheLimit) { + cache[pattern] = compiledPattern; + cacheCount++; + } -var isModifiedEvent = function isModifiedEvent(event) { - return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + return compiledPattern; }; /** - * The public API for rendering a history-aware . + * Public API for matching a URL pathname to a path pattern. */ +var matchPath = function matchPath(pathname) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; -var Link = function (_React$Component) { - _inherits(Link, _React$Component); - - function Link() { - var _temp, _this, _ret; - - _classCallCheck(this, Link); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + if (typeof options === 'string') options = { path: options }; - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) { - if (_this.props.onClick) _this.props.onClick(event); + var _options = options, + _options$path = _options.path, + path = _options$path === undefined ? '/' : _options$path, + _options$exact = _options.exact, + exact = _options$exact === undefined ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === undefined ? false : _options$strict; - if (!event.defaultPrevented && // onClick prevented default - event.button === 0 && // ignore right clicks - !_this.props.target && // let browser handle "target=_blank" etc. - !isModifiedEvent(event) // ignore clicks with modifier keys - ) { - event.preventDefault(); + var _compilePath = compilePath(path, { end: exact, strict: strict }), + re = _compilePath.re, + keys = _compilePath.keys; - var history = _this.context.router.history; - var _this$props = _this.props, - replace = _this$props.replace, - to = _this$props.to; + var match = re.exec(pathname); + if (!match) return null; - if (replace) { - history.replace(to); - } else { - history.push(to); - } - } - }, _temp), _possibleConstructorReturn(_this, _ret); - } + var url = match[0], + values = match.slice(1); - Link.prototype.render = function render() { - var _props = this.props, - replace = _props.replace, - to = _props.to, - props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars + var isExact = pathname === url; - var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to); + if (exact && !isExact) return null; - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement('a', _extends({}, props, { onClick: this.handleClick, href: href })); + return { + path: path, // the path pattern used to match + url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL + isExact: isExact, // whether or not we matched exactly + params: keys.reduce(function (memo, key, index) { + memo[key.name] = values[index]; + return memo; + }, {}) }; - - return Link; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); - -Link.propTypes = { - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired -}; -Link.defaultProps = { - replace: false -}; -Link.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired - }).isRequired }; - -/* harmony default export */ __webpack_exports__["a"] = (Link); +/* harmony default export */ __webpack_exports__["a"] = (matchPath); /***/ }), -/* 21 */, /* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ -var _preact = __webpack_require__(3); -var _redux = __webpack_require__(69); +var emptyFunction = __webpack_require__(11); -var _reactRedux = __webpack_require__(94); +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ -var _App = __webpack_require__(23); +var warning = emptyFunction; -var _App2 = _interopRequireDefault(_App); +if (process.env.NODE_ENV !== 'production') { + (function () { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } -var _index = __webpack_require__(104); + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; -var _index2 = _interopRequireDefault(_index); + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } -var store = (0, _redux.createStore)(_index2.default); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } -var app = (0, _preact.h)( - _reactRedux.Provider, - { store: store }, - (0, _preact.h)(_App2.default, null) -); + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); +} -(0, _preact.render)(app, document.getElementById('container')); +module.exports = warning; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), /* 23 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); -Object.defineProperty(exports, "__esModule", { - value: true +var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ + trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired +}); + +var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ + subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, + getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired }); -var _preact = __webpack_require__(3); +/***/ }), +/* 24 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(44); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(23); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + + + +var hotReloadingVersion = 0; +var dummyState = {}; +function noop() {} +function makeSelectorStateful(sourceSelector, store) { + // wrap the selector in an object that tracks its results between runs. + var selector = { + run: function runComponentSelector(props) { + try { + var nextProps = sourceSelector(store.getState(), props); + if (nextProps !== selector.props || selector.error) { + selector.shouldComponentUpdate = true; + selector.props = nextProps; + selector.error = null; + } + } catch (error) { + selector.shouldComponentUpdate = true; + selector.error = error; + } + } + }; + + return selector; +} + +function connectAdvanced( +/* + selectorFactory is a func that is responsible for returning the selector function used to + compute new props from state, props, and dispatch. For example: + export default connectAdvanced((dispatch, options) => (state, props) => ({ + thing: state.things[props.thingId], + saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), + }))(YourComponent) + Access to dispatch is provided to the factory so selectorFactories can bind actionCreators + outside of their selector as an optimization. Options passed to connectAdvanced are passed to + the selectorFactory, along with displayName and WrappedComponent, as the second argument. + Note that selectorFactory is responsible for all caching/memoization of inbound and outbound + props. Do not use connectAdvanced directly without memoizing results between calls to your + selector, otherwise the Connect component will re-render on every state or props change. +*/ +selectorFactory) { + var _contextTypes, _childContextTypes; -var _util = __webpack_require__(24); + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$getDisplayName = _ref.getDisplayName, + getDisplayName = _ref$getDisplayName === undefined ? function (name) { + return 'ConnectAdvanced(' + name + ')'; + } : _ref$getDisplayName, + _ref$methodName = _ref.methodName, + methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, + _ref$renderCountProp = _ref.renderCountProp, + renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, + _ref$shouldHandleStat = _ref.shouldHandleStateChanges, + shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, + _ref$storeKey = _ref.storeKey, + storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, + _ref$withRef = _ref.withRef, + withRef = _ref$withRef === undefined ? false : _ref$withRef, + connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); -var _Header = __webpack_require__(54); + var subscriptionKey = storeKey + 'Subscription'; + var version = hotReloadingVersion++; -var _Header2 = _interopRequireDefault(_Header); + var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes); + var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes); -var _Browser = __webpack_require__(61); + return function wrapWithConnect(WrappedComponent) { + __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent))); -var _Browser2 = _interopRequireDefault(_Browser); + var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; -var _Tasks = __webpack_require__(59); + var displayName = getDisplayName(wrappedComponentName); -var _Tasks2 = _interopRequireDefault(_Tasks); + var selectorFactoryOptions = _extends({}, connectOptions, { + getDisplayName: getDisplayName, + methodName: methodName, + renderCountProp: renderCountProp, + shouldHandleStateChanges: shouldHandleStateChanges, + storeKey: storeKey, + withRef: withRef, + displayName: displayName, + wrappedComponentName: wrappedComponentName, + WrappedComponent: WrappedComponent + }); -var _client = __webpack_require__(8); + var Connect = function (_Component) { + _inherits(Connect, _Component); -var _client2 = _interopRequireDefault(_client); + function Connect(props, context) { + _classCallCheck(this, Connect); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); -// import db from '../db' + _this.version = version; + _this.state = {}; + _this.renderCount = 0; + _this.store = props[storeKey] || context[storeKey]; + _this.propsMode = Boolean(props[storeKey]); + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); -var socket = io(window.location.origin); + __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a , ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".')); -socket.on('connect', function (data) { - console.log('connected'); -}); -socket.on('worker', function (data) { - console.log('worker connected', data); -}); -socket.on('processed', function (data) { - console.log('processed', data); -}); + _this.initSelector(); + _this.initSubscription(); + return _this; + } -var App = function App() { - return (0, _preact.h)( - 'div', - null, - (0, _preact.h)(_Header2.default, null), - (0, _preact.h)( - 'div', - { 'class': 'columns' }, - (0, _preact.h)(_Browser2.default, null), - (0, _preact.h)(_Tasks2.default, null) - ) - ); -}; + Connect.prototype.getChildContext = function getChildContext() { + var _ref2; -exports.default = App; + // If this component received store from props, its subscription should be transparent + // to any descendants receiving store+subscription from context; it passes along + // subscription passed to it. Otherwise, it shadows the parent subscription, which allows + // Connect to control ordering of notifications to flow top-down. + var subscription = this.propsMode ? null : this.subscription; + return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2; + }; -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { + Connect.prototype.componentDidMount = function componentDidMount() { + if (!shouldHandleStateChanges) return; -"use strict"; + // componentWillMount fires during server side rendering, but componentDidMount and + // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount. + // Otherwise, unsubscription would never take place during SSR, causing a memory leak. + // To handle the case where a child component may have triggered a state change by + // dispatching an action in its componentWillMount, we have to re-run the select and maybe + // re-render. + this.subscription.trySubscribe(); + this.selector.run(this.props); + if (this.selector.shouldComponentUpdate) this.forceUpdate(); + }; + Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + this.selector.run(nextProps); + }; -Object.defineProperty(exports, "__esModule", { - value: true -}); -var isIphone = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i); -var isIpad = navigator.userAgent.match(/iPad/i); -var isAndroid = navigator.userAgent.match(/Android/i); -var isMobile = isIphone || isIpad || isAndroid; -var isDesktop = !isMobile; + Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() { + return this.selector.shouldComponentUpdate; + }; -document.body.classList.add(isMobile ? 'mobile' : 'desktop'); + Connect.prototype.componentWillUnmount = function componentWillUnmount() { + if (this.subscription) this.subscription.tryUnsubscribe(); + this.subscription = null; + this.notifyNestedSubs = noop; + this.store = null; + this.selector.run = noop; + this.selector.shouldComponentUpdate = false; + }; -var browser = { isIphone: isIphone, isIpad: isIpad, isAndroid: isAndroid, isMobile: isMobile, isDesktop: isDesktop }; + Connect.prototype.getWrappedInstance = function getWrappedInstance() { + __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.')); + return this.wrappedInstance; + }; -function clamp(n, a, b) { - return n < a ? a : n < b ? n : b; -} -function mod(n, m) { - return n - m * Math.floor(n / m); -} -function choice(a) { - return a[randint(a.length)]; -} -function randint(n) { - return Math.floor(Math.random() * n); -} -function randrange(a, b) { - return Math.random() * (b - a) + a; -} -function firstTouch(f) { - return function (e) { - e.preventDefault();f(e.touches[0]); - }; -} + Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) { + this.wrappedInstance = ref; + }; -exports.browser = browser; -exports.clamp = clamp; -exports.mod = mod; -exports.choice = choice; -exports.randint = randint; -exports.randrange = randrange; -exports.firstTouch = firstTouch; + Connect.prototype.initSelector = function initSelector() { + var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); + this.selector = makeSelectorStateful(sourceSelector, this.store); + this.selector.run(this.props); + }; -/***/ }), -/* 25 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + Connect.prototype.initSubscription = function initSubscription() { + if (!shouldHandleStateChanges) return; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__ = __webpack_require__(29); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(2); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // parentSub's source should match where store came from: props vs. context. A component + // connected to the store via props shouldn't use subscription from context, or vice versa. + var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; + this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this)); -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in + // the middle of the notification loop, where `this.subscription` will then be null. An + // extra null check every change can be avoided by copying the method onto `this` and then + // replacing it with a no-op on unmount. This can probably be avoided if Subscription's + // listeners logic is changed to not call listeners that have been unsubscribed in the + // middle of the notification loop. + this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); + }; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + Connect.prototype.onStateChange = function onStateChange() { + this.selector.run(this.props); + if (!this.selector.shouldComponentUpdate) { + this.notifyNestedSubs(); + } else { + this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; + this.setState(dummyState); + } + }; + Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() { + // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it + // needs to notify nested subs. Once called, it unimplements itself until further state + // changes occur. Doing it this way vs having a permanent `componentDidMount` that does + // a boolean check every time avoids an extra method call most of the time, resulting + // in some perf boost. + this.componentDidUpdate = undefined; + this.notifyNestedSubs(); + }; + Connect.prototype.isSubscribed = function isSubscribed() { + return Boolean(this.subscription) && this.subscription.isSubscribed(); + }; + Connect.prototype.addExtraProps = function addExtraProps(props) { + if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; + // make a shallow copy so that fields added don't leak to the original selector. + // this is especially important for 'ref' since that's a reference back to the component + // instance. a singleton memoized selector would then be holding a reference to the + // instance, preventing the instance from being garbage collected, and that would be bad + var withExtras = _extends({}, props); + if (withRef) withExtras.ref = this.setWrappedInstance; + if (renderCountProp) withExtras[renderCountProp] = this.renderCount++; + if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription; + return withExtras; + }; + Connect.prototype.render = function render() { + var selector = this.selector; + selector.shouldComponentUpdate = false; -/** - * The public API for a that uses HTML5 history. - */ + if (selector.error) { + throw selector.error; + } else { + return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"](WrappedComponent, this.addExtraProps(selector.props)); + } + }; -var BrowserRouter = function (_React$Component) { - _inherits(BrowserRouter, _React$Component); + return Connect; + }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); - function BrowserRouter() { - var _temp, _this, _ret; + Connect.WrappedComponent = WrappedComponent; + Connect.displayName = displayName; + Connect.childContextTypes = childContextTypes; + Connect.contextTypes = contextTypes; + Connect.propTypes = contextTypes; - _classCallCheck(this, BrowserRouter); + if (process.env.NODE_ENV !== 'production') { + Connect.prototype.componentWillUpdate = function componentWillUpdate() { + // We are hot reloading! + if (this.version !== version) { + this.version = version; + this.initSelector(); - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + if (this.subscription) this.subscription.tryUnsubscribe(); + this.initSubscription(); + if (shouldHandleStateChanges) this.subscription.trySubscribe(); + } + }; } - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); - } - - BrowserRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); + return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default.a(Connect, WrappedComponent); }; - - return BrowserRouter; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); - -BrowserRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - forceRefresh: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; - - -/* harmony default export */ __webpack_exports__["a"] = (BrowserRouter); +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) /***/ }), -/* 26 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ +var REACT_STATICS = { + childContextTypes: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + mixins: true, + propTypes: true, + type: true +}; -var emptyFunction = __webpack_require__(10); -var invariant = __webpack_require__(11); -var warning = __webpack_require__(17); - -var ReactPropTypesSecret = __webpack_require__(12); -var checkPropTypes = __webpack_require__(27); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + arguments: true, + arity: true +}; - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ +var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; - var ANONYMOUS = '<>'; +module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components + var keys = Object.getOwnPropertyNames(sourceComponent); - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), + /* istanbul ignore else */ + if (isGetOwnPropertySymbolsAvailable) { + keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent)); + } - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker - }; + for (var i = 0; i < keys.length; ++i) { + if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) { + try { + targetComponent[keys[i]] = sourceComponent[keys[i]]; + } catch (error) { - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; + } + } + } } - } - /*eslint-enable no-self-compare*/ - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; + return targetComponent; +}; - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } +/***/ }), +/* 26 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); +/* harmony export (immutable) */ __webpack_exports__["b"] = createStore; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - return chainedCheckType; - } - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); +/** + * These are private action types reserved by Redux. + * For any unknown actions, you must return the current state. + * If the current state is undefined, you must return the initial state. + * Do not reference these action types directly in your code. + */ +var ActionTypes = { + INIT: '@@redux/INIT' - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } + /** + * Creates a Redux store that holds the state tree. + * The only way to change the data in the store is to call `dispatch()` on it. + * + * There should only be a single store in your app. To specify how different + * parts of the state tree respond to actions, you may combine several reducers + * into a single reducer function by using `combineReducers`. + * + * @param {Function} reducer A function that returns the next state tree, given + * the current state tree and the action to handle. + * + * @param {any} [preloadedState] The initial state. You may optionally specify it + * to hydrate the state from the server in universal apps, or to restore a + * previously serialized user session. + * If you use `combineReducers` to produce the root reducer function, this must be + * an object with the same shape as `combineReducers` keys. + * + * @param {Function} [enhancer] The store enhancer. You may optionally specify it + * to enhance the store with third-party capabilities such as middleware, + * time travel, persistence, etc. The only store enhancer that ships with Redux + * is `applyMiddleware()`. + * + * @returns {Store} A Redux store that lets you read the state, dispatch actions + * and subscribe to changes. + */ +};function createStore(reducer, preloadedState, enhancer) { + var _ref2; - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { + enhancer = preloadedState; + preloadedState = undefined; } - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; + if (typeof enhancer !== 'undefined') { + if (typeof enhancer !== 'function') { + throw new Error('Expected the enhancer to be a function.'); } - return createChainableTypeChecker(validate); + + return enhancer(createStore)(reducer, preloadedState); } - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); + if (typeof reducer !== 'function') { + throw new Error('Expected the reducer to be a function.'); } - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; + var currentReducer = reducer; + var currentState = preloadedState; + var currentListeners = []; + var nextListeners = currentListeners; + var isDispatching = false; + + function ensureCanMutateNextListeners() { + if (nextListeners === currentListeners) { + nextListeners = currentListeners.slice(); } - return createChainableTypeChecker(validate); } - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; + /** + * Reads the state tree managed by the store. + * + * @returns {any} The current state tree of your application. + */ + function getState() { + return currentState; + } + + /** + * Adds a change listener. It will be called any time an action is dispatched, + * and some part of the state tree may potentially have changed. You may then + * call `getState()` to read the current state tree inside the callback. + * + * You may call `dispatch()` from a change listener, with the following + * caveats: + * + * 1. The subscriptions are snapshotted just before every `dispatch()` call. + * If you subscribe or unsubscribe while the listeners are being invoked, this + * will not have any effect on the `dispatch()` that is currently in progress. + * However, the next `dispatch()` call, whether nested or not, will use a more + * recent snapshot of the subscription list. + * + * 2. The listener should not expect to see all state changes, as the state + * might have been updated multiple times during a nested `dispatch()` before + * the listener is called. It is, however, guaranteed that all subscribers + * registered before the `dispatch()` started will be called with the latest + * state by the time it exits. + * + * @param {Function} listener A callback to be invoked on every dispatch. + * @returns {Function} A function to remove this change listener. + */ + function subscribe(listener) { + if (typeof listener !== 'function') { + throw new Error('Expected listener to be a function.'); } - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } + var isSubscribed = true; - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } + ensureCanMutateNextListeners(); + nextListeners.push(listener); - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } + return function unsubscribe() { + if (!isSubscribed) { + return; } - return null; - } - return createChainableTypeChecker(validate); + + isSubscribed = false; + + ensureCanMutateNextListeners(); + var index = nextListeners.indexOf(listener); + nextListeners.splice(index, 1); + }; } - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will + * be considered the **next** state of the tree, and the change listeners + * will be notified. + * + * The base implementation only supports plain object actions. If you want to + * dispatch a Promise, an Observable, a thunk, or something else, you need to + * wrap your store creating function into the corresponding middleware. For + * example, see the documentation for the `redux-thunk` package. Even the + * middleware will eventually dispatch plain object actions using this method. + * + * @param {Object} action A plain object representing “what changed”. It is + * a good idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must have + * a `type` property which may not be `undefined`. It is a good idea to use + * string constants for action types. + * + * @returns {Object} For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + function dispatch(action) { + if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */](action)) { + throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } + if (typeof action.type === 'undefined') { + throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); } - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } + if (isDispatching) { + throw new Error('Reducers may not dispatch actions.'); + } - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + try { + isDispatching = true; + currentState = currentReducer(currentState, action); + } finally { + isDispatching = false; } - return createChainableTypeChecker(validate); - } - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; + var listeners = currentListeners = nextListeners; + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); } - return createChainableTypeChecker(validate); + + return action; } - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param {Function} nextReducer The reducer for the store to use instead. + * @returns {void} + */ + function replaceReducer(nextReducer) { + if (typeof nextReducer !== 'function') { + throw new Error('Expected the nextReducer to be a function.'); } - return createChainableTypeChecker(validate); + + currentReducer = nextReducer; + dispatch({ type: ActionTypes.INIT }); } - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ + function observable() { + var _ref; + + var outerSubscribe = subscribe; + return _ref = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: function subscribe(observer) { + if (typeof observer !== 'object') { + throw new TypeError('Expected the observer to be an object.'); } - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } + function observeState() { + if (observer.next) { + observer.next(getState()); } - } else { - return false; } - return true; - default: - return false; - } + observeState(); + var unsubscribe = outerSubscribe(observeState); + return { unsubscribe: unsubscribe }; + } + }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () { + return this; + }, _ref; } - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } + // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + dispatch({ type: ActionTypes.INIT }); - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2; +} - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } +/***/ }), +/* 27 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return false; - } +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(49); - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; +/** Built-in value references. */ +var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; + +/* harmony default export */ __webpack_exports__["a"] = (Symbol); + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 29 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = warning; +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); } + /* eslint-enable no-console */ + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + /* eslint-disable no-empty */ + } catch (e) {} + /* eslint-enable no-empty */ +} + +/***/ }), +/* 30 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = compose; +/** + * Composes single-argument functions from right to left. The rightmost + * function can take multiple arguments as it provides the signature for + * the resulting composite function. + * + * @param {...Function} funcs The functions to compose. + * @returns {Function} A function obtained by composing the argument functions + * from right to left. For example, compose(f, g, h) is identical to doing + * (...args) => f(g(h(...args))). + */ - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } +function compose() { + for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { + funcs[_key] = arguments[_key]; } - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; + if (funcs.length === 0) { + return function (arg) { + return arg; + }; } - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; + if (funcs.length === 1) { + return funcs[0]; + } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + return funcs.reduce(function (a, b) { + return function () { + return a(b.apply(undefined, arguments)); + }; + }); +} /***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { +/* 31 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; +/* unused harmony export getDependsOnOwnProps */ +/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(32); +function wrapMapToPropsConstant(getConstant) { + return function initConstantSelector(dispatch, options) { + var constant = getConstant(dispatch, options); -if (process.env.NODE_ENV !== 'production') { - var invariant = __webpack_require__(11); - var warning = __webpack_require__(17); - var ReactPropTypesSecret = __webpack_require__(12); - var loggedTypeFailures = {}; + function constantSelector() { + return constant; + } + constantSelector.dependsOnOwnProps = false; + return constantSelector; + }; } -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (process.env.NODE_ENV !== 'production') { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; +// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args +// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine +// whether mapToProps needs to be invoked when props have changed. +// +// A length of one signals that mapToProps does not depend on props from the parent component. +// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and +// therefore not reporting its length accurately.. +function getDependsOnOwnProps(mapToProps) { + return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; +} - var stack = getStack ? getStack() : ''; +// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, +// this function wraps mapToProps in a proxy function which does several things: +// +// * Detects whether the mapToProps function being called depends on props, which +// is used by selectorFactory to decide if it should reinvoke on props changes. +// +// * On first call, handles mapToProps if returns another function, and treats that +// new function as the true mapToProps for subsequent calls. +// +// * On first call, verifies the first result is a plain object, in order to warn +// the developer that their mapToProps function is not returning a valid result. +// +function wrapMapToPropsFunc(mapToProps, methodName) { + return function initProxySelector(dispatch, _ref) { + var displayName = _ref.displayName; - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } + var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { + return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); + }; + + // allow detectFactoryAndVerify to get ownProps + proxy.dependsOnOwnProps = true; + + proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { + proxy.mapToProps = mapToProps; + proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); + var props = proxy(stateOrDispatch, ownProps); + + if (typeof props === 'function') { + proxy.mapToProps = props; + proxy.dependsOnOwnProps = getDependsOnOwnProps(props); + props = proxy(stateOrDispatch, ownProps); } - } - } + + if (process.env.NODE_ENV !== 'production') __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */](props, displayName, methodName); + + return props; + }; + + return proxy; + }; } +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) -module.exports = checkPropTypes; +/***/ }), +/* 32 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(14); + + + +function verifyPlainObject(value, displayName, methodName) { + if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */](value)) { + __WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */](methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.'); + } +} /***/ }), -/* 28 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +Object.defineProperty(exports, "__esModule", { + value: true +}); -var emptyFunction = __webpack_require__(10); -var invariant = __webpack_require__(11); -var ReactPropTypesSecret = __webpack_require__(12); +var _reactRedux = __webpack_require__(6); -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; +var _actions = __webpack_require__(7); + +var _Link = __webpack_require__(17); + +var _Link2 = _interopRequireDefault(_Link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var mapStateToProps = function mapStateToProps(state, ownProps) { + return {}; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return { + onClick: function onClick() { + switch (ownProps.file.type) { + case 'audio': + dispatch((0, _actions.audioPlayFile)(ownProps.file)); + break; + } } - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use PropTypes.checkPropTypes() to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - }; - shim.isRequired = shim; - function getShim() { - return shim; }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, +}; + +var FileLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); + +exports.default = FileLink; + +/***/ }), +/* 34 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(82); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(95); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return __WEBPACK_IMPORTED_MODULE_1__HashRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(37); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(97); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(98); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return __WEBPACK_IMPORTED_MODULE_4__NavLink__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(99); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_5__Prompt__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(100); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(101); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__(102); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_8__Router__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(103); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__StaticRouter__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(104); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_10__Switch__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(105); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_11__matchPath__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(106); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_12__withRouter__["a"]; }); - any: shim, - arrayOf: getShim, - element: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim - }; - ReactPropTypes.checkPropTypes = emptyFunction; - ReactPropTypes.PropTypes = ReactPropTypes; - return ReactPropTypes; -}; -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; -exports.__esModule = true; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _warning = __webpack_require__(6); -var _warning2 = _interopRequireDefault(_warning); -var _invariant = __webpack_require__(9); -var _invariant2 = _interopRequireDefault(_invariant); -var _LocationUtils = __webpack_require__(13); -var _PathUtils = __webpack_require__(7); -var _createTransitionManager = __webpack_require__(14); -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); -var _DOMUtils = __webpack_require__(18); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var PopStateEvent = 'popstate'; -var HashChangeEvent = 'hashchange'; -var getHistoryState = function getHistoryState() { - try { - return window.history.state || {}; - } catch (e) { - // IE 11 sometimes throws when accessing window.history.state - // See https://github.com/ReactTraining/history/pull/289 - return {}; - } -}; -/** - * Creates a history object that uses the HTML5 history API including - * pushState, replaceState, and the popstate event. - */ -var createBrowserHistory = function createBrowserHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM'); - var globalHistory = window.history; - var canUseHistory = (0, _DOMUtils.supportsHistory)(); - var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)(); - var _props$forceRefresh = props.forceRefresh, - forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh, - _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { - var getDOMLocation = function getDOMLocation(historyState) { - var _ref = historyState || {}, - key = _ref.key, - state = _ref.state; +"use strict"; - var _window$location = window.location, - pathname = _window$location.pathname, - search = _window$location.search, - hash = _window$location.hash; +exports.__esModule = true; +var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - var path = pathname + search + hash; +var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) { + return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener); +}; - (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); +var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) { + return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener); +}; - if (basename) path = (0, _PathUtils.stripBasename)(path, basename); +var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) { + return callback(window.confirm(message)); +}; // eslint-disable-line no-alert - return (0, _LocationUtils.createLocation)(path, state, key); - }; +/** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ +var supportsHistory = exports.supportsHistory = function supportsHistory() { + var ua = window.navigator.userAgent; - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; - var transitionManager = (0, _createTransitionManager2.default)(); + return window.history && 'pushState' in window.history; +}; - var setState = function setState(nextState) { - _extends(history, nextState); +/** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ +var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { + return window.navigator.userAgent.indexOf('Trident') === -1; +}; - history.length = globalHistory.length; +/** + * Returns false if using go(n) with hash history causes a full page reload. + */ +var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { + return window.navigator.userAgent.indexOf('Firefox') === -1; +}; - transitionManager.notifyListeners(history.location, history.action); - }; +/** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ +var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { + return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; +}; - var handlePopState = function handlePopState(event) { - // Ignore extraneous popstate events in WebKit. - if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return; +/***/ }), +/* 36 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - handlePop(getDOMLocation(event.state)); - }; +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(21); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var handleHashChange = function handleHashChange() { - handlePop(getDOMLocation(getHistoryState())); - }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var forceNextPop = false; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } - }; - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; - // TODO: We could probably make this more reliable by - // keeping a list of keys we've seen in sessionStorage. - // Instead, we just default to 0 for keys we don't know. - var toIndex = allKeys.indexOf(toLocation.key); - if (toIndex === -1) toIndex = 0; - var fromIndex = allKeys.indexOf(fromLocation.key); +/** + * The public API for matching a single path and rendering. + */ - if (fromIndex === -1) fromIndex = 0; +var Route = function (_React$Component) { + _inherits(Route, _React$Component); - var delta = toIndex - fromIndex; + function Route() { + var _temp, _this, _ret; - if (delta) { - forceNextPop = true; - go(delta); - } - }; + _classCallCheck(this, Route); - var initialLocation = getDOMLocation(getHistoryState()); - var allKeys = [initialLocation.key]; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - // Public interface + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { + match: _this.computeMatch(_this.props, _this.context.router) + }, _temp), _possibleConstructorReturn(_this, _ret); + } - var createHref = function createHref(location) { - return basename + (0, _PathUtils.createPath)(location); + Route.prototype.getChildContext = function getChildContext() { + return { + router: _extends({}, this.context.router, { + route: { + location: this.props.location || this.context.router.route.location, + match: this.state.match + } + }) + }; }; - var push = function push(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + Route.prototype.computeMatch = function computeMatch(_ref, _ref2) { + var computedMatch = _ref.computedMatch, + location = _ref.location, + path = _ref.path, + strict = _ref.strict, + exact = _ref.exact; + var route = _ref2.route; - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + if (computedMatch) return computedMatch; // already computed the match for us - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; + var pathname = (location || route.location).pathname; - var href = createHref(location); - var key = location.key, - state = location.state; + return path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](pathname, { path: path, strict: strict, exact: exact }) : route.match; + }; + Route.prototype.componentWillMount = function componentWillMount() { + var _props = this.props, + component = _props.component, + render = _props.render, + children = _props.children; - if (canUseHistory) { - globalHistory.pushState({ key: key, state: state }, null, href); - if (forceRefresh) { - window.location.href = href; - } else { - var prevIndex = allKeys.indexOf(history.location.key); - var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && render), 'You should not use and in the same route; will be ignored'); - nextKeys.push(location.key); - allKeys = nextKeys; + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(component && children), 'You should not use and in the same route; will be ignored'); - setState({ action: action, location: location }); - } - } else { - (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(render && children), 'You should not use and in the same route; will be ignored'); + }; - window.location.href = href; - } + Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + + __WEBPACK_IMPORTED_MODULE_0_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + + this.setState({ + match: this.computeMatch(nextProps, nextContext.router) }); }; - var replace = function replace(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + Route.prototype.render = function render() { + var match = this.state.match; + var _props2 = this.props, + children = _props2.children, + component = _props2.component, + render = _props2.render; + var _context$router = this.context.router, + history = _context$router.history, + route = _context$router.route, + staticContext = _context$router.staticContext; - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + var location = this.props.location || route.location; + var props = { match: match, location: location, history: history, staticContext: staticContext }; - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; + return component ? // component prop gets first priority, only called if there's a match + match ? __WEBPACK_IMPORTED_MODULE_1_react__["default"].createElement(component, props) : null : render ? // render prop is next, only called if there's a match + match ? render(props) : null : children ? // children come last, always called + typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array + __WEBPACK_IMPORTED_MODULE_1_react__["default"].Children.only(children) : null : null; + }; - var href = createHref(location); - var key = location.key, - state = location.state; + return Route; +}(__WEBPACK_IMPORTED_MODULE_1_react__["default"].Component); +Route.propTypes = { + computedMatch: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object, // private, from + path: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + exact: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + strict: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + component: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, + render: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node]), + location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object +}; +Route.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + route: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + staticContext: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object + }) +}; +Route.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired +}; - if (canUseHistory) { - globalHistory.replaceState({ key: key, state: state }, null, href); - if (forceRefresh) { - window.location.replace(href); - } else { - var prevIndex = allKeys.indexOf(history.location.key); +/* harmony default export */ __webpack_exports__["a"] = (Route); - if (prevIndex !== -1) allKeys[prevIndex] = location.key; +/***/ }), +/* 37 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - setState({ action: action, location: location }); - } - } else { - (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - window.location.replace(href); - } - }); - }; +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var go = function go(n) { - globalHistory.go(n); - }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var goBack = function goBack() { - return go(-1); - }; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - var goForward = function goForward() { - return go(1); - }; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var listenerCount = 0; - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - if (listenerCount === 1) { - (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState); - if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState); +var isModifiedEvent = function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +}; - if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); - } - }; +/** + * The public API for rendering a history-aware . + */ - var isBlocked = false; +var Link = function (_React$Component) { + _inherits(Link, _React$Component); - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + function Link() { + var _temp, _this, _ret; - var unblock = transitionManager.setPrompt(prompt); + _classCallCheck(this, Link); - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } - - return unblock(); - }; - }; + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) { + if (_this.props.onClick) _this.props.onClick(event); - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); + if (!event.defaultPrevented && // onClick prevented default + event.button === 0 && // ignore right clicks + !_this.props.target && // let browser handle "target=_blank" etc. + !isModifiedEvent(event) // ignore clicks with modifier keys + ) { + event.preventDefault(); - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; + var history = _this.context.router.history; + var _this$props = _this.props, + replace = _this$props.replace, + to = _this$props.to; - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; - return history; -}; + if (replace) { + history.replace(to); + } else { + history.push(to); + } + } + }, _temp), _possibleConstructorReturn(_this, _ret); + } -exports.default = createBrowserHistory; + Link.prototype.render = function render() { + var _props = this.props, + replace = _props.replace, + to = _props.to, + props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { + var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to); -"use strict"; + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement('a', _extends({}, props, { onClick: this.handleClick, href: href })); + }; + return Link; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); -var isAbsolute = function isAbsolute(pathname) { - return pathname.charAt(0) === '/'; +Link.propTypes = { + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired }; - -// About 1.5x faster than the two-arg version of Array#splice() -var spliceOne = function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { - list[i] = list[k]; - }list.pop(); +Link.defaultProps = { + replace: false +}; +Link.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired + }).isRequired }; -// This implementation is based heavily on node's url.parse -var resolvePathname = function resolvePathname(to) { - var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var toParts = to && to.split('/') || []; - var fromParts = from && from.split('/') || []; +/* harmony default export */ __webpack_exports__["a"] = (Link); - var isToAbs = to && isAbsolute(to); - var isFromAbs = from && isAbsolute(from); - var mustEndAbs = isToAbs || isFromAbs; +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { - if (to && isAbsolute(to)) { - // to is absolute - fromParts = toParts; - } else if (toParts.length) { - // to is relative, drop the filename - fromParts.pop(); - fromParts = fromParts.concat(toParts); - } +"use strict"; - if (!fromParts.length) return '/'; - var hasTrailingSlash = void 0; - if (fromParts.length) { - var last = fromParts[fromParts.length - 1]; - hasTrailingSlash = last === '.' || last === '..' || last === ''; - } else { - hasTrailingSlash = false; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - var up = 0; - for (var i = fromParts.length; i >= 0; i--) { - var part = fromParts[i]; +var _redux = __webpack_require__(15); - if (part === '.') { - spliceOne(fromParts, i); - } else if (part === '..') { - spliceOne(fromParts, i); - up++; - } else if (up) { - spliceOne(fromParts, i); - up--; - } - } +var _index = __webpack_require__(111); - if (!mustEndAbs) for (; up--; up) { - fromParts.unshift('..'); - }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); +var _index2 = _interopRequireDefault(_index); + +var _index3 = __webpack_require__(7); - var result = fromParts.join('/'); +var _client = __webpack_require__(5); - if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; +var _client2 = _interopRequireDefault(_client); - return result; -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -module.exports = resolvePathname; +var store = (0, _redux.createStore)(_index2.default, { + currentTask: { + content: null, + style: null, + alpha: 0.001 + }, + tasks: [], + folders: { + openFolders: [], + folders: [] + }, + audioPlayer: { + file: null + } +}); + +_client2.default.folder.index().then(function (folders) { + store.dispatch((0, _index3.loadFolders)(folders)); + try { + var openFolders = JSON.parse(localStorage['openFolders']); + store.dispatch((0, _index3.loadOpenFolders)(openFolders)); + openFolders.forEach(function (folder_id) { + _client2.default.file.index({ folder_id: folder_id }).then(function (files) { + store.dispatch((0, _index3.loadFiles)(files)); + }); + }); + } catch (e) { + console.log('error opening folders'); + } +}); +_client2.default.task.index().then(function (tasks) { + store.dispatch((0, _index3.loadTasks)(tasks)); +}); + +exports.default = store; /***/ }), -/* 31 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.__esModule = true; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var valueEqual = function valueEqual(a, b) { - if (a === b) return true; - - if (a == null || b == null) return false; +var _preact = __webpack_require__(0); - if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { - return valueEqual(item, b[index]); - }); +var _reactRedux = __webpack_require__(6); - var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); - var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); +var _App = __webpack_require__(67); - if (aType !== bType) return false; +var _App2 = _interopRequireDefault(_App); - if (aType === 'object') { - var aValue = a.valueOf(); - var bValue = b.valueOf(); +var _store = __webpack_require__(38); - if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); +var _store2 = _interopRequireDefault(_store); - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); +var _socket = __webpack_require__(116); - if (aKeys.length !== bKeys.length) return false; +var _socket2 = _interopRequireDefault(_socket); - return aKeys.every(function (key) { - return valueEqual(a[key], b[key]); - }); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return false; -}; +var app = (0, _preact.h)( + _reactRedux.Provider, + { store: _store2.default }, + (0, _preact.h)(_App2.default, null) +); -exports.default = valueEqual; +(0, _preact.render)(app, document.getElementById('container')); /***/ }), -/* 32 */ +/* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = createProvider; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__ = __webpack_require__(33); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Router__ = __webpack_require__(15); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(23); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(14); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -3950,1738 +3942,1988 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" -/** - * The public API for a that stores location in memory. - */ - -var MemoryRouter = function (_React$Component) { - _inherits(MemoryRouter, _React$Component); - - function MemoryRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, MemoryRouter); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); +var didWarnAboutReceivingStore = false; +function warnAboutReceivingStore() { + if (didWarnAboutReceivingStore) { + return; } + didWarnAboutReceivingStore = true; - MemoryRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Router__["a" /* default */], { history: this.history, children: this.props.children }); - }; - - return MemoryRouter; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); - -MemoryRouter.propTypes = { - initialEntries: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array, - initialIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; + __WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */](' does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.'); +} +function createProvider() { + var _Provider$childContex; -/* harmony default export */ __webpack_exports__["a"] = (MemoryRouter); + var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store'; + var subKey = arguments[1]; -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { + var subscriptionKey = subKey || storeKey + 'Subscription'; -"use strict"; + var Provider = function (_Component) { + _inherits(Provider, _Component); + Provider.prototype.getChildContext = function getChildContext() { + var _ref; -exports.__esModule = true; + return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref; + }; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + function Provider(props, context) { + _classCallCheck(this, Provider); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); -var _warning = __webpack_require__(6); + _this[storeKey] = props.store; + return _this; + } -var _warning2 = _interopRequireDefault(_warning); + Provider.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children); + }; -var _PathUtils = __webpack_require__(7); + return Provider; + }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); -var _LocationUtils = __webpack_require__(13); + if (process.env.NODE_ENV !== 'production') { + Provider.prototype.componentWillReceiveProps = function (nextProps) { + if (this[storeKey] !== nextProps.store) { + warnAboutReceivingStore(); + } + }; + } -var _createTransitionManager = __webpack_require__(14); + Provider.propTypes = { + store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired + }; + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex); + Provider.displayName = 'Provider'; -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + return Provider; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* harmony default export */ __webpack_exports__["b"] = (createProvider()); +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) -var clamp = function clamp(n, lowerBound, upperBound) { - return Math.min(Math.max(n, lowerBound), upperBound); -}; +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { -/** - * Creates a history object that stores locations in memory. +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ -var createMemoryHistory = function createMemoryHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var getUserConfirmation = props.getUserConfirmation, - _props$initialEntries = props.initialEntries, - initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries, - _props$initialIndex = props.initialIndex, - initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - var transitionManager = (0, _createTransitionManager2.default)(); - var setState = function setState(nextState) { - _extends(history, nextState); +var emptyFunction = __webpack_require__(11); +var invariant = __webpack_require__(12); +var warning = __webpack_require__(22); - history.length = history.entries.length; +var ReactPropTypesSecret = __webpack_require__(13); +var checkPropTypes = __webpack_require__(42); - transitionManager.notifyListeners(history.location, history.action); - }; +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } - var index = clamp(initialIndex, 0, initialEntries.length - 1); - var entries = initialEntries.map(function (entry) { - return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey()); - }); + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ - // Public interface + var ANONYMOUS = '<>'; - var createHref = _PathUtils.createPath; + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), - var push = function push(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; - var prevIndex = history.index; - var nextIndex = prevIndex + 1; + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; - var nextEntries = history.entries.slice(0); - if (nextEntries.length > nextIndex) { - nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; } else { - nextEntries.push(location); + return validate(props, propName, componentName, location, propFullName); } + } - setState({ - action: action, - location: location, - index: nextIndex, - entries: nextEntries - }); - }); - }; - - var replace = function replace(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - history.entries[history.index] = location; - - setState({ action: action, location: location }); - }); - }; + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); - var go = function go(n) { - var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + return chainedCheckType; + } - var action = 'POP'; - var location = history.entries[nextIndex]; + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location, - index: nextIndex - }); - } else { - // Mimic the behavior of DOM histories by - // causing a render after a cancelled POP. - setState(); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } - }); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; + return null; + } + return createChainableTypeChecker(validate); + } - var canGo = function canGo(n) { - var nextIndex = history.index + n; - return nextIndex >= 0 && nextIndex < history.entries.length; - }; + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - return transitionManager.setPrompt(prompt); - }; + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } - var listen = function listen(listener) { - return transitionManager.appendListener(listener); - }; + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } - var history = { - length: entries.length, - action: 'POP', - location: entries[index], - index: index, - entries: entries, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - canGo: canGo, - block: block, - listen: listen - }; + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } - return history; -}; + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } -exports.default = createMemoryHistory; + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } -/***/ }), -/* 34 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } -/** - * The public API for prompting the user before navigating away - * from a screen with a component. - */ + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } -var Prompt = function (_React$Component) { - _inherits(Prompt, _React$Component); + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } - function Prompt() { - _classCallCheck(this, Prompt); + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + return true; + default: + return false; + } } - Prompt.prototype.enable = function enable(message) { - if (this.unblock) this.unblock(); + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } - this.unblock = this.context.router.history.block(message); - }; + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } - Prompt.prototype.disable = function disable() { - if (this.unblock) { - this.unblock(); - this.unblock = null; + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; } - }; - Prompt.prototype.componentWillMount = function componentWillMount() { - if (this.props.when) this.enable(this.props.message); - }; + return false; + } - Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - if (nextProps.when) { - if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message); - } else { - this.disable(); + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; } - }; + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } - Prompt.prototype.componentWillUnmount = function componentWillUnmount() { - this.disable(); - }; + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } - Prompt.prototype.render = function render() { - return null; - }; + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } - return Prompt; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; -Prompt.propTypes = { - when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired -}; -Prompt.defaultProps = { - when: true -}; -Prompt.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired - }).isRequired + return ReactPropTypes; }; - -/* harmony default export */ __webpack_exports__["a"] = (Prompt); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 35 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +if (process.env.NODE_ENV !== 'production') { + var invariant = __webpack_require__(12); + var warning = __webpack_require__(22); + var ReactPropTypesSecret = __webpack_require__(13); + var loggedTypeFailures = {}; +} /** - * The public API for updating the location programatically - * with a component. + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; -var Redirect = function (_React$Component) { - _inherits(Redirect, _React$Component); - - function Redirect() { - _classCallCheck(this, Redirect); - - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - - Redirect.prototype.isStatic = function isStatic() { - return this.context.router && this.context.router.staticContext; - }; - - Redirect.prototype.componentWillMount = function componentWillMount() { - if (this.isStatic()) this.perform(); - }; - - Redirect.prototype.componentDidMount = function componentDidMount() { - if (!this.isStatic()) this.perform(); - }; - - Redirect.prototype.perform = function perform() { - var history = this.context.router.history; - var _props = this.props, - push = _props.push, - to = _props.to; - + var stack = getStack ? getStack() : ''; - if (push) { - history.push(to); - } else { - history.replace(to); + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } } - }; - - Redirect.prototype.render = function render() { - return null; - }; - - return Redirect; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); - -Redirect.propTypes = { - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]) -}; -Redirect.defaultProps = { - push: false -}; -Redirect.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired, - staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object - }).isRequired -}; + } +} +module.exports = checkPropTypes; -/* harmony default export */ __webpack_exports__["a"] = (Redirect); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 36 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { -var isarray = __webpack_require__(37) - -/** - * Expose `pathToRegexp`. - */ -module.exports = pathToRegexp -module.exports.parse = parse -module.exports.compile = compile -module.exports.tokensToFunction = tokensToFunction -module.exports.tokensToRegExp = tokensToRegExp - -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') - +"use strict"; /** - * Parse a string for the raw tokens. + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. * - * @param {string} str - * @param {Object=} options - * @return {!Array} + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ -function parse (str, options) { - var tokens = [] - var key = 0 - var index = 0 - var path = '' - var defaultDelimiter = options && options.delimiter || '/' - var res - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0] - var escaped = res[1] - var offset = res.index - path += str.slice(index, offset) - index = offset + m.length - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1] - continue - } - var next = str[index] - var prefix = res[2] - var name = res[3] - var capture = res[4] - var group = res[5] - var modifier = res[6] - var asterisk = res[7] +var emptyFunction = __webpack_require__(11); +var invariant = __webpack_require__(12); +var ReactPropTypesSecret = __webpack_require__(13); - // Push the current path onto the tokens. - if (path) { - tokens.push(path) - path = '' +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, - var partial = prefix != null && next != null && next !== prefix - var repeat = modifier === '+' || modifier === '*' - var optional = modifier === '?' || modifier === '*' - var delimiter = res[2] || defaultDelimiter - var pattern = capture || group + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - partial: partial, - asterisk: !!asterisk, - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) - } + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index) - } + return ReactPropTypes; +}; - // If the path exists, push it onto the end. - if (path) { - tokens.push(path) - } - return tokens -} +/***/ }), +/* 44 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/** - * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile (str, options) { - return tokensToFunction(parse(str, options)) -} +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} - */ -function encodeURIComponentPretty (str) { - return encodeURI(str).replace(/[\/?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} +// encapsulates the subscription logic for connecting a component to the redux store, as +// well as nesting subscriptions of descendant components, so that we can ensure the +// ancestor components re-render before descendants -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk (str) { - return encodeURI(str).replace(/[?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} +var CLEARED = null; +var nullListeners = { + notify: function notify() {} +}; -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction (tokens) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length) +function createListenerCollection() { + // the current/next pattern is copied from redux's createStore code. + // TODO: refactor+expose that code to be reusable here? + var current = []; + var next = []; - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') - } - } + return { + clear: function clear() { + next = CLEARED; + current = CLEARED; + }, + notify: function notify() { + var listeners = current = next; + for (var i = 0; i < listeners.length; i++) { + listeners[i](); + } + }, + subscribe: function subscribe(listener) { + var isSubscribed = true; + if (next === current) next = current.slice(); + next.push(listener); - return function (obj, opts) { - var path = '' - var data = obj || {} - var options = opts || {} - var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent + return function unsubscribe() { + if (!isSubscribed || current === CLEARED) return; + isSubscribed = false; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] + if (next === current) next = current.slice(); + next.splice(next.indexOf(listener), 1); + }; + } + }; +} - if (typeof token === 'string') { - path += token +var Subscription = function () { + function Subscription(store, parentSub, onStateChange) { + _classCallCheck(this, Subscription); - continue - } + this.store = store; + this.parentSub = parentSub; + this.onStateChange = onStateChange; + this.unsubscribe = null; + this.listeners = nullListeners; + } - var value = data[token.name] - var segment + Subscription.prototype.addNestedSub = function addNestedSub(listener) { + this.trySubscribe(); + return this.listeners.subscribe(listener); + }; - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix - } + Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() { + this.listeners.notify(); + }; - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } + Subscription.prototype.isSubscribed = function isSubscribed() { + return Boolean(this.unsubscribe); + }; - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') - } + Subscription.prototype.trySubscribe = function trySubscribe() { + if (!this.unsubscribe) { + this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } - } + this.listeners = createListenerCollection(); + } + }; - for (var j = 0; j < value.length; j++) { - segment = encode(value[j]) + Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() { + if (this.unsubscribe) { + this.unsubscribe(); + this.unsubscribe = null; + this.listeners.clear(); + this.listeners = nullListeners; + } + }; - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') - } + return Subscription; +}(); - path += (j === 0 ? token.prefix : token.delimiter) + segment - } - continue - } - segment = token.asterisk ? encodeAsterisk(value) : encode(value) +/***/ }), +/* 45 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } +"use strict"; +/* unused harmony export createConnect */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(63); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(64); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(65); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - path += token.prefix + segment - } +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - return path - } -} -/** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} - */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') -} -/** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {string} group - * @return {string} - */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') -} -/** - * Attach the keys as a property of the regexp. - * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} - */ -function attachKeys (re, keys) { - re.keys = keys - return re -} -/** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} - */ -function flags (options) { - return options.sensitive ? '' : 'i' -} -/** - * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} - */ -function regexpToRegexp (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g) - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }) - } - } - return attachKeys(path, keys) -} +/* + connect is a facade over connectAdvanced. It turns its args into a compatible + selectorFactory, which has the signature: -/** - * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} + (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps + + connect passes its args to connectAdvanced as options, which will in turn pass them to + selectorFactory each time a Connect component instance is instantiated or hot reloaded. + + selectorFactory returns a final props selector from its mapStateToProps, + mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, + mergePropsFactories, and pure args. + + The resulting final props selector is called by the Connect component instance whenever + it receives new props or store state. */ -function arrayToRegexp (path, keys, options) { - var parts = [] - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source) +function match(arg, factories, name) { + for (var i = factories.length - 1; i >= 0; i--) { + var result = factories[i](arg); + if (result) return result; } - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) - - return attachKeys(regexp, keys) + return function (dispatch, options) { + throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); + }; } -/** - * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function stringToRegexp (path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options) +function strictEqual(a, b) { + return a === b; } -/** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function tokensToRegExp (tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } +// createConnect with default args builds the 'official' connect behavior. Calling it with +// different options opens up some testing and extensibility scenarios +function createConnect() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$connectHOC = _ref.connectHOC, + connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC, + _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, + mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF, + _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, + mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro, + _ref$mergePropsFactor = _ref.mergePropsFactories, + mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor, + _ref$selectorFactory = _ref.selectorFactory, + selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory; - options = options || {} + return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { + var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + _ref2$pure = _ref2.pure, + pure = _ref2$pure === undefined ? true : _ref2$pure, + _ref2$areStatesEqual = _ref2.areStatesEqual, + areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, + _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, + areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua, + _ref2$areStatePropsEq = _ref2.areStatePropsEqual, + areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq, + _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, + areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE, + extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); - var strict = options.strict - var end = options.end !== false - var route = '' + var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); + var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); + var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] + return connectHOC(selectorFactory, _extends({ + // used in error messages + methodName: 'connect', - if (typeof token === 'string') { - route += escapeString(token) - } else { - var prefix = escapeString(token.prefix) - var capture = '(?:' + token.pattern + ')' + // used to compute Connect's displayName from the wrapped component's displayName. + getDisplayName: function getDisplayName(name) { + return 'Connect(' + name + ')'; + }, - keys.push(token) + // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes + shouldHandleStateChanges: Boolean(mapStateToProps), - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*' - } + // passed through to selectorFactory + initMapStateToProps: initMapStateToProps, + initMapDispatchToProps: initMapDispatchToProps, + initMergeProps: initMergeProps, + pure: pure, + areStatesEqual: areStatesEqual, + areOwnPropsEqual: areOwnPropsEqual, + areStatePropsEqual: areStatePropsEqual, + areMergedPropsEqual: areMergedPropsEqual - if (token.optional) { - if (!token.partial) { - capture = '(?:' + prefix + '(' + capture + '))?' - } else { - capture = prefix + '(' + capture + ')?' - } - } else { - capture = prefix + '(' + capture + ')' - } + }, extraOptions)); + }; +} - route += capture - } - } +/* harmony default export */ __webpack_exports__["a"] = (createConnect()); - var delimiter = escapeString(options.delimiter || '/') - var endsWithDelimiter = route.slice(-delimiter.length) === delimiter +/***/ }), +/* 46 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' - } +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual; +var hasOwn = Object.prototype.hasOwnProperty; - if (end) { - route += '$' +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' + return x !== x && y !== y; } - - return attachKeys(new RegExp('^' + route, flags(options)), keys) } -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function pathToRegexp (path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] +function shallowEqual(objA, objB) { + if (is(objA, objB)) return true; + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; } - options = options || {} + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)) - } + if (keysA.length !== keysB.length) return false; - if (isarray(path)) { - return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + for (var i = 0; i < keysA.length; i++) { + if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } } - return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) + return true; } - /***/ }), -/* 37 */ -/***/ (function(module, exports) { +/* 47 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; +"use strict"; +/* unused harmony export whenMapDispatchToPropsIsFunction */ +/* unused harmony export whenMapDispatchToPropsIsMissing */ +/* unused harmony export whenMapDispatchToPropsIsObject */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(15); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(31); + + + +function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { + return typeof mapDispatchToProps === 'function' ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */](mapDispatchToProps, 'mapDispatchToProps') : undefined; +} + +function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { + return !mapDispatchToProps ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function (dispatch) { + return { dispatch: dispatch }; + }) : undefined; +} + +function whenMapDispatchToPropsIsObject(mapDispatchToProps) { + return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function (dispatch) { + return __WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"](mapDispatchToProps, dispatch); + }) : undefined; +} +/* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); /***/ }), -/* 38 */ +/* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(15); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(27); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(52); -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */](value) + : __WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */](value); +} +/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); +/***/ }), +/* 49 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(50); -var normalizeLocation = function normalizeLocation(object) { - var _object$pathname = object.pathname, - pathname = _object$pathname === undefined ? '/' : _object$pathname, - _object$search = object.search, - search = _object$search === undefined ? '' : _object$search, - _object$hash = object.hash, - hash = _object$hash === undefined ? '' : _object$hash; +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +/** Used as a reference to the global object. */ +var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -}; +/* harmony default export */ __webpack_exports__["a"] = (root); -var addBasename = function addBasename(basename, location) { - if (!basename) return location; - return _extends({}, location, { - pathname: __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename) + location.pathname - }); -}; +/***/ }), +/* 50 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var stripBasename = function stripBasename(basename, location) { - if (!basename) return location; +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - var base = __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename); +/* harmony default export */ __webpack_exports__["a"] = (freeGlobal); - if (location.pathname.indexOf(base) !== 0) return location; +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(28))) - return _extends({}, location, { - pathname: location.pathname.substr(base.length) - }); -}; +/***/ }), +/* 51 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var createLocation = function createLocation(location) { - return typeof location === 'string' ? __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["parsePath"](location) : normalizeLocation(location); -}; +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(27); -var createURL = function createURL(location) { - return typeof location === 'string' ? location : __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["createPath"](location); -}; -var staticHandler = function staticHandler(methodName) { - return function () { - __WEBPACK_IMPORTED_MODULE_0_invariant___default.a(false, 'You cannot %s with ', methodName); - }; -}; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -var noop = function noop() {}; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * The public top-level API for a "static" , so-called because it - * can't actually change the current location. Instead, it just records - * location changes in a context object. Useful mainly in testing and - * server-rendering scenarios. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. */ +var nativeObjectToString = objectProto.toString; -var StaticRouter = function (_React$Component) { - _inherits(StaticRouter, _React$Component); +/** Built-in value references. */ +var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; - function StaticRouter() { - var _temp, _this, _ret; +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - _classCallCheck(this, StaticRouter); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) { - return __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](_this.props.basename + createURL(path)); - }, _this.handlePush = function (location) { - var _this$props = _this.props, - basename = _this$props.basename, - context = _this$props.context; - - context.action = 'PUSH'; - context.location = addBasename(basename, createLocation(location)); - context.url = createURL(context.location); - }, _this.handleReplace = function (location) { - var _this$props2 = _this.props, - basename = _this$props2.basename, - context = _this$props2.context; - - context.action = 'REPLACE'; - context.location = addBasename(basename, createLocation(location)); - context.url = createURL(context.location); - }, _this.handleListen = function () { - return noop; - }, _this.handleBlock = function () { - return noop; - }, _temp), _possibleConstructorReturn(_this, _ret); } + return result; +} - StaticRouter.prototype.getChildContext = function getChildContext() { - return { - router: { - staticContext: this.props.context - } - }; - }; +/* harmony default export */ __webpack_exports__["a"] = (getRawTag); - StaticRouter.prototype.render = function render() { - var _props = this.props, - basename = _props.basename, - context = _props.context, - location = _props.location, - props = _objectWithoutProperties(_props, ['basename', 'context', 'location']); - var history = { - createHref: this.createHref, - action: 'POP', - location: stripBasename(basename, createLocation(location)), - push: this.handlePush, - replace: this.handleReplace, - go: staticHandler('go'), - goBack: staticHandler('goBack'), - goForward: staticHandler('goForward'), - listen: this.handleListen, - block: this.handleBlock - }; +/***/ }), +/* 52 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return __WEBPACK_IMPORTED_MODULE_1_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], _extends({}, props, { history: history })); - }; +"use strict"; +/** Used for built-in method references. */ +var objectProto = Object.prototype; - return StaticRouter; -}(__WEBPACK_IMPORTED_MODULE_1_react__["default"].Component); +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; -StaticRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, - context: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, - location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object]) -}; -StaticRouter.defaultProps = { - basename: '', - location: '/' -}; -StaticRouter.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired -}; +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} +/* harmony default export */ __webpack_exports__["a"] = (objectToString); -/* harmony default export */ __webpack_exports__["a"] = (StaticRouter); /***/ }), -/* 39 */ +/* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(16); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(54); +/** Built-in value references. */ +var getPrototype = __WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */](Object.getPrototypeOf, Object); +/* harmony default export */ __webpack_exports__["a"] = (getPrototype); +/***/ }), +/* 54 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; /** - * The public API for rendering the first that matches. + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. */ - -var Switch = function (_React$Component) { - _inherits(Switch, _React$Component); - - function Switch() { - _classCallCheck(this, Switch); - - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - - Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); - - __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); }; +} - Switch.prototype.render = function render() { - var route = this.context.router.route; - var children = this.props.children; - - var location = this.props.location || route.location; - - var match = void 0, - child = void 0; - __WEBPACK_IMPORTED_MODULE_0_react__["default"].Children.forEach(children, function (element) { - if (!__WEBPACK_IMPORTED_MODULE_0_react__["default"].isValidElement(element)) return; - - var _element$props = element.props, - pathProp = _element$props.path, - exact = _element$props.exact, - strict = _element$props.strict, - from = _element$props.from; +/* harmony default export */ __webpack_exports__["a"] = (overArg); - var path = pathProp || from; - if (match == null) { - child = element; - match = path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](location.pathname, { path: path, exact: exact, strict: strict }) : route.match; - } - }); +/***/ }), +/* 55 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return match ? __WEBPACK_IMPORTED_MODULE_0_react__["default"].cloneElement(child, { location: location, computedMatch: match }) : null; - }; +"use strict"; +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} - return Switch; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); +/* harmony default export */ __webpack_exports__["a"] = (isObjectLike); -Switch.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired - }).isRequired -}; -Switch.propTypes = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(57); -/* harmony default export */ __webpack_exports__["a"] = (Switch); /***/ }), -/* 40 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(41); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(19); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +/* WEBPACK VAR INJECTION */(function(global, module) { -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _ponyfill = __webpack_require__(59); +var _ponyfill2 = _interopRequireDefault(_ponyfill); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var root; /* global window */ -/** - * A public higher-order component to access the imperative API - */ -var withRouter = function withRouter(Component) { - var C = function C(props) { - var wrappedComponentRef = props.wrappedComponentRef, - remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']); +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (true) { + root = module; +} else { + root = Function('return this')(); +} - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], { render: function render(routeComponentProps) { - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef })); - } }); - }; +var result = (0, _ponyfill2['default'])(root); +exports['default'] = result; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28), __webpack_require__(58)(module))) - C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')'; - C.WrappedComponent = Component; - C.propTypes = { - wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func - }; +/***/ }), +/* 58 */ +/***/ (function(module, exports) { - return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default.a(C, Component); -}; +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -/* harmony default export */ __webpack_exports__["a"] = (withRouter); /***/ }), -/* 41 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ -var REACT_STATICS = { - childContextTypes: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - mixins: true, - propTypes: true, - type: true -}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports['default'] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var _Symbol = root.Symbol; -var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - arguments: true, - arity: true + if (typeof _Symbol === 'function') { + if (_Symbol.observable) { + result = _Symbol.observable; + } else { + result = _Symbol('observable'); + _Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; }; -var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; +/***/ }), +/* 60 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { - if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components - var keys = Object.getOwnPropertyNames(sourceComponent); +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(26); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(29); - /* istanbul ignore else */ - if (isGetOwnPropertySymbolsAvailable) { - keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent)); - } - for (var i = 0; i < keys.length; ++i) { - if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) { - try { - targetComponent[keys[i]] = sourceComponent[keys[i]]; - } catch (error) { - } - } - } - } - return targetComponent; -}; +function getUndefinedStateErrorMessage(key, action) { + var actionType = action && action.type; + var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; + return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; +} -/***/ }), -/* 42 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { + var reducerKeys = Object.keys(reducers); + var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(2); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (reducerKeys.length === 0) { + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; + } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + if (!__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */](inputState)) { + return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var unexpectedKeys = Object.keys(inputState).filter(function (key) { + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; + }); + unexpectedKeys.forEach(function (key) { + unexpectedKeyCache[key] = true; + }); + if (unexpectedKeys.length > 0) { + return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); + } +} +function assertReducerShape(reducers) { + Object.keys(reducers).forEach(function (key) { + var reducer = reducers[key]; + var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT }); + if (typeof initialState === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); + } + var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); + if (typeof reducer(undefined, { type: type }) === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); + } + }); +} /** - * The public API for a that uses window.location.hash. + * Turns an object whose values are different reducer functions, into a single + * reducer function. It will call every child reducer, and gather their results + * into a single state object, whose keys correspond to the keys of the passed + * reducer functions. + * + * @param {Object} reducers An object whose values correspond to different + * reducer functions that need to be combined into one. One handy way to obtain + * it is to use ES6 `import * as reducers` syntax. The reducers may never return + * undefined for any action. Instead, they should return their initial state + * if the state passed to them was undefined, and the current state for any + * unrecognized action. + * + * @returns {Function} A reducer function that invokes every reducer inside the + * passed object, and builds a state object with the same shape. */ +function combineReducers(reducers) { + var reducerKeys = Object.keys(reducers); + var finalReducers = {}; + for (var i = 0; i < reducerKeys.length; i++) { + var key = reducerKeys[i]; -var HashRouter = function (_React$Component) { - _inherits(HashRouter, _React$Component); - - function HashRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, HashRouter); + if (process.env.NODE_ENV !== 'production') { + if (typeof reducers[key] === 'undefined') { + __WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */]('No reducer provided for key "' + key + '"'); + } + } - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + if (typeof reducers[key] === 'function') { + finalReducers[key] = reducers[key]; } + } + var finalReducerKeys = Object.keys(finalReducers); - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + var unexpectedKeyCache = void 0; + if (process.env.NODE_ENV !== 'production') { + unexpectedKeyCache = {}; } - HashRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); - }; + var shapeAssertionError = void 0; + try { + assertReducerShape(finalReducers); + } catch (e) { + shapeAssertionError = e; + } - return HashRouter; -}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + return function combination() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; -HashRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - hashType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']), - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; + if (shapeAssertionError) { + throw shapeAssertionError; + } + if (process.env.NODE_ENV !== 'production') { + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); + if (warningMessage) { + __WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */](warningMessage); + } + } -/* harmony default export */ __webpack_exports__["a"] = (HashRouter); + var hasChanged = false; + var nextState = {}; + for (var _i = 0; _i < finalReducerKeys.length; _i++) { + var _key = finalReducerKeys[_i]; + var reducer = finalReducers[_key]; + var previousStateForKey = state[_key]; + var nextStateForKey = reducer(previousStateForKey, action); + if (typeof nextStateForKey === 'undefined') { + var errorMessage = getUndefinedStateErrorMessage(_key, action); + throw new Error(errorMessage); + } + nextState[_key] = nextStateForKey; + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; + } + return hasChanged ? nextState : state; + }; +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) /***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { +/* 61 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators; +function bindActionCreator(actionCreator, dispatch) { + return function () { + return dispatch(actionCreator.apply(undefined, arguments)); + }; +} +/** + * Turns an object whose values are action creators, into an object with the + * same keys, but with every function wrapped into a `dispatch` call so they + * may be invoked directly. This is just a convenience method, as you can call + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. + * + * For convenience, you can also pass a single function as the first argument, + * and get a function in return. + * + * @param {Function|Object} actionCreators An object whose values are action + * creator functions. One handy way to obtain it is to use ES6 `import * as` + * syntax. You may also pass a single function. + * + * @param {Function} dispatch The `dispatch` function available on your Redux + * store. + * + * @returns {Function|Object} The object mimicking the original object, but with + * every action creator wrapped into the `dispatch` call. If you passed a + * function as `actionCreators`, the return value will also be a single + * function. + */ +function bindActionCreators(actionCreators, dispatch) { + if (typeof actionCreators === 'function') { + return bindActionCreator(actionCreators, dispatch); + } -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _warning = __webpack_require__(6); - -var _warning2 = _interopRequireDefault(_warning); - -var _invariant = __webpack_require__(9); - -var _invariant2 = _interopRequireDefault(_invariant); - -var _LocationUtils = __webpack_require__(13); - -var _PathUtils = __webpack_require__(7); - -var _createTransitionManager = __webpack_require__(14); - -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - -var _DOMUtils = __webpack_require__(18); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HashChangeEvent = 'hashchange'; + if (typeof actionCreators !== 'object' || actionCreators === null) { + throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); + } -var HashPathCoders = { - hashbang: { - encodePath: function encodePath(path) { - return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path); - }, - decodePath: function decodePath(path) { - return path.charAt(0) === '!' ? path.substr(1) : path; + var keys = Object.keys(actionCreators); + var boundActionCreators = {}; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var actionCreator = actionCreators[key]; + if (typeof actionCreator === 'function') { + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } - }, - noslash: { - encodePath: _PathUtils.stripLeadingSlash, - decodePath: _PathUtils.addLeadingSlash - }, - slash: { - encodePath: _PathUtils.addLeadingSlash, - decodePath: _PathUtils.addLeadingSlash } -}; - -var getHashPath = function getHashPath() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = window.location.href; - var hashIndex = href.indexOf('#'); - return hashIndex === -1 ? '' : href.substring(hashIndex + 1); -}; - -var pushHashPath = function pushHashPath(path) { - return window.location.hash = path; -}; - -var replaceHashPath = function replaceHashPath(path) { - var hashIndex = window.location.href.indexOf('#'); + return boundActionCreators; +} - window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); -}; +/***/ }), +/* 62 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var createHashHistory = function createHashHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(30); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM'); - var globalHistory = window.history; - var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)(); - var _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, - _props$hashType = props.hashType, - hashType = _props$hashType === undefined ? 'slash' : _props$hashType; +/** + * Creates a store enhancer that applies middleware to the dispatch method + * of the Redux store. This is handy for a variety of tasks, such as expressing + * asynchronous actions in a concise manner, or logging every action payload. + * + * See `redux-thunk` package as an example of the Redux middleware. + * + * Because middleware is potentially asynchronous, this should be the first + * store enhancer in the composition chain. + * + * Note that each middleware will be given the `dispatch` and `getState` functions + * as named arguments. + * + * @param {...Function} middlewares The middleware chain to be applied. + * @returns {Function} A store enhancer applying the middleware. + */ +function applyMiddleware() { + for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { + middlewares[_key] = arguments[_key]; + } - var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; + return function (createStore) { + return function (reducer, preloadedState, enhancer) { + var store = createStore(reducer, preloadedState, enhancer); + var _dispatch = store.dispatch; + var chain = []; - var _HashPathCoders$hashT = HashPathCoders[hashType], - encodePath = _HashPathCoders$hashT.encodePath, - decodePath = _HashPathCoders$hashT.decodePath; + var middlewareAPI = { + getState: store.getState, + dispatch: function dispatch(action) { + return _dispatch(action); + } + }; + chain = middlewares.map(function (middleware) { + return middleware(middlewareAPI); + }); + _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); + return _extends({}, store, { + dispatch: _dispatch + }); + }; + }; +} - var getDOMLocation = function getDOMLocation() { - var path = decodePath(getHashPath()); +/***/ }), +/* 63 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); +"use strict"; +/* unused harmony export whenMapStateToPropsIsFunction */ +/* unused harmony export whenMapStateToPropsIsMissing */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(31); - if (basename) path = (0, _PathUtils.stripBasename)(path, basename); - return (0, _LocationUtils.createLocation)(path); - }; +function whenMapStateToPropsIsFunction(mapStateToProps) { + return typeof mapStateToProps === 'function' ? __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */](mapStateToProps, 'mapStateToProps') : undefined; +} - var transitionManager = (0, _createTransitionManager2.default)(); +function whenMapStateToPropsIsMissing(mapStateToProps) { + return !mapStateToProps ? __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function () { + return {}; + }) : undefined; +} - var setState = function setState(nextState) { - _extends(history, nextState); +/* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); - history.length = globalHistory.length; +/***/ }), +/* 64 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - transitionManager.notifyListeners(history.location, history.action); - }; +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export defaultMergeProps */ +/* unused harmony export wrapMergePropsFunc */ +/* unused harmony export whenMergePropsIsFunction */ +/* unused harmony export whenMergePropsIsOmitted */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(32); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var forceNextPop = false; - var ignorePath = null; - var handleHashChange = function handleHashChange() { - var path = getHashPath(); - var encodedPath = encodePath(path); - if (path !== encodedPath) { - // Ensure we always have a properly-encoded hash. - replaceHashPath(encodedPath); - } else { - var location = getDOMLocation(); - var prevLocation = history.location; +function defaultMergeProps(stateProps, dispatchProps, ownProps) { + return _extends({}, ownProps, stateProps, dispatchProps); +} - if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change. +function wrapMergePropsFunc(mergeProps) { + return function initMergePropsProxy(dispatch, _ref) { + var displayName = _ref.displayName, + pure = _ref.pure, + areMergedPropsEqual = _ref.areMergedPropsEqual; - if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace. + var hasRunOnce = false; + var mergedProps = void 0; - ignorePath = null; + return function mergePropsProxy(stateProps, dispatchProps, ownProps) { + var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); - handlePop(location); - } - }; + if (hasRunOnce) { + if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; + } else { + hasRunOnce = true; + mergedProps = nextMergedProps; - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; + if (process.env.NODE_ENV !== 'production') __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */](mergedProps, displayName, 'mergeProps'); + } - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } + return mergedProps; + }; }; +} - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; +function whenMergePropsIsFunction(mergeProps) { + return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; +} - // TODO: We could probably make this more reliable by - // keeping a list of paths we've seen in sessionStorage. - // Instead, we just default to 0 for paths we don't know. +function whenMergePropsIsOmitted(mergeProps) { + return !mergeProps ? function () { + return defaultMergeProps; + } : undefined; +} - var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation)); +/* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]); +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) - if (toIndex === -1) toIndex = 0; +/***/ }), +/* 65 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation)); +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */ +/* unused harmony export pureFinalPropsSelectorFactory */ +/* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(66); +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - if (fromIndex === -1) fromIndex = 0; - var delta = toIndex - fromIndex; - if (delta) { - forceNextPop = true; - go(delta); - } +function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { + return function impureFinalPropsSelector(state, ownProps) { + return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); }; +} - // Ensure the hash is encoded properly before doing anything else. - var path = getHashPath(); - var encodedPath = encodePath(path); +function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { + var areStatesEqual = _ref.areStatesEqual, + areOwnPropsEqual = _ref.areOwnPropsEqual, + areStatePropsEqual = _ref.areStatePropsEqual; - if (path !== encodedPath) replaceHashPath(encodedPath); + var hasRunAtLeastOnce = false; + var state = void 0; + var ownProps = void 0; + var stateProps = void 0; + var dispatchProps = void 0; + var mergedProps = void 0; - var initialLocation = getDOMLocation(); - var allPaths = [(0, _PathUtils.createPath)(initialLocation)]; + function handleFirstCall(firstState, firstOwnProps) { + state = firstState; + ownProps = firstOwnProps; + stateProps = mapStateToProps(state, ownProps); + dispatchProps = mapDispatchToProps(dispatch, ownProps); + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + hasRunAtLeastOnce = true; + return mergedProps; + } - // Public interface + function handleNewPropsAndNewState() { + stateProps = mapStateToProps(state, ownProps); - var createHref = function createHref(location) { - return '#' + encodePath(basename + (0, _PathUtils.createPath)(location)); - }; + if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); - var push = function push(path, state) { - (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored'); + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + return mergedProps; + } - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); + function handleNewProps() { + if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; + if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); - var path = (0, _PathUtils.createPath)(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; + mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + return mergedProps; + } - if (hashChanged) { - // We cannot tell if a hashchange was caused by a PUSH, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - pushHashPath(encodedPath); + function handleNewState() { + var nextStateProps = mapStateToProps(state, ownProps); + var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); + stateProps = nextStateProps; - var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location)); - var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); - nextPaths.push(path); - allPaths = nextPaths; + return mergedProps; + } - setState({ action: action, location: location }); - } else { - (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); + function handleSubsequentCalls(nextState, nextOwnProps) { + var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); + var stateChanged = !areStatesEqual(nextState, state); + state = nextState; + ownProps = nextOwnProps; - setState(); - } - }); + if (propsChanged && stateChanged) return handleNewPropsAndNewState(); + if (propsChanged) return handleNewProps(); + if (stateChanged) return handleNewState(); + return mergedProps; + } + + return function pureFinalPropsSelector(nextState, nextOwnProps) { + return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; +} - var replace = function replace(path, state) { - (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored'); +// TODO: Add more comments - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); +// If pure is true, the selector returned by selectorFactory will memoize its results, +// allowing connectAdvanced's shouldComponentUpdate to return false if final +// props have not changed. If false, the selector will always return a new +// object and shouldComponentUpdate will always return true. - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; +function finalPropsSelectorFactory(dispatch, _ref2) { + var initMapStateToProps = _ref2.initMapStateToProps, + initMapDispatchToProps = _ref2.initMapDispatchToProps, + initMergeProps = _ref2.initMergeProps, + options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); - var path = (0, _PathUtils.createPath)(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; + var mapStateToProps = initMapStateToProps(dispatch, options); + var mapDispatchToProps = initMapDispatchToProps(dispatch, options); + var mergeProps = initMergeProps(dispatch, options); - if (hashChanged) { - // We cannot tell if a hashchange was caused by a REPLACE, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - replaceHashPath(encodedPath); - } + if (process.env.NODE_ENV !== 'production') { + __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__["a" /* default */](mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); + } - var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location)); + var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; - if (prevIndex !== -1) allPaths[prevIndex] = path; + return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); +} +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) - setState({ action: action, location: location }); - }); - }; +/***/ }), +/* 66 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - var go = function go(n) { - (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = verifySubselectors; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(14); - globalHistory.go(n); - }; - var goBack = function goBack() { - return go(-1); - }; +function verify(selector, methodName, displayName) { + if (!selector) { + throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.'); + } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { + if (!selector.hasOwnProperty('dependsOnOwnProps')) { + __WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */]('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.'); + } + } +} + +function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) { + verify(mapStateToProps, 'mapStateToProps', displayName); + verify(mapDispatchToProps, 'mapDispatchToProps', displayName); + verify(mergeProps, 'mergeProps', displayName); +} - var goForward = function goForward() { - return go(1); - }; +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { - var listenerCount = 0; +"use strict"; - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - if (listenerCount === 1) { - (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); - } - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - var isBlocked = false; +var _preact = __webpack_require__(0); - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; +var _util = __webpack_require__(68); - var unblock = transitionManager.setPrompt(prompt); +var _Header = __webpack_require__(69); - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } +var _Header2 = _interopRequireDefault(_Header); - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } +var _browser = __webpack_require__(72); - return unblock(); - }; - }; +var _browser2 = _interopRequireDefault(_browser); - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); +var _Tasks = __webpack_require__(81); - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; +var _Tasks2 = _interopRequireDefault(_Tasks); - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; +var _client = __webpack_require__(5); - return history; -}; +var _client2 = _interopRequireDefault(_client); -exports.default = createHashHistory; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }), -/* 44 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// import db from '../db' -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["a"]; }); +var App = function App() { + return (0, _preact.h)( + 'div', + null, + (0, _preact.h)(_Header2.default, null), + (0, _preact.h)( + 'div', + { 'class': 'columns' }, + (0, _preact.h)(_browser2.default, null), + (0, _preact.h)(_Tasks2.default, null) + ) + ); +}; +exports.default = App; /***/ }), -/* 45 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(20); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +var isIphone = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i); +var isIpad = navigator.userAgent.match(/iPad/i); +var isAndroid = navigator.userAgent.match(/Android/i); +var isMobile = isIphone || isIpad || isAndroid; +var isDesktop = !isMobile; +document.body.classList.add(isMobile ? 'mobile' : 'desktop'); +var browser = { isIphone: isIphone, isIpad: isIpad, isAndroid: isAndroid, isMobile: isMobile, isDesktop: isDesktop }; +function clamp(n, a, b) { + return n < a ? a : n < b ? n : b; +} +function mod(n, m) { + return n - m * Math.floor(n / m); +} +function choice(a) { + return a[randint(a.length)]; +} +function randint(n) { + return Math.floor(Math.random() * n); +} +function randrange(a, b) { + return Math.random() * (b - a) + a; +} +function firstTouch(f) { + return function (e) { + e.preventDefault();f(e.touches[0]); + }; +} +exports.browser = browser; +exports.clamp = clamp; +exports.mod = mod; +exports.choice = choice; +exports.randint = randint; +exports.randrange = randrange; +exports.firstTouch = firstTouch; -/** - * A wrapper that knows if it's "active" or not. - */ -var NavLink = function NavLink(_ref) { - var to = _ref.to, - exact = _ref.exact, - strict = _ref.strict, - location = _ref.location, - activeClassName = _ref.activeClassName, - className = _ref.className, - activeStyle = _ref.activeStyle, - style = _ref.style, - getIsActive = _ref.isActive, - rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive']); +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["d" /* Route */], { - path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to, - exact: exact, - strict: strict, - location: location, - children: function children(_ref2) { - var location = _ref2.location, - match = _ref2.match; +"use strict"; - var isActive = !!(getIsActive ? getIsActive(match, location) : match); - return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({ - to: to, - className: isActive ? [activeClassName, className].filter(function (i) { - return i; - }).join(' ') : className, - style: isActive ? _extends({}, style, activeStyle) : style - }, rest)); - } - }); -}; +Object.defineProperty(exports, "__esModule", { + value: true +}); -NavLink.propTypes = { - to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to, - exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func -}; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -NavLink.defaultProps = { - activeClassName: 'active' -}; +var _preact = __webpack_require__(0); -/* harmony default export */ __webpack_exports__["a"] = (NavLink); +var _audioPlayer = __webpack_require__(70); -/***/ }), -/* 46 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var _audioPlayer2 = _interopRequireDefault(_audioPlayer); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["b"]; }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/***/ }), -/* 47 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["c"]; }); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var Header = function (_Component) { + _inherits(Header, _Component); -/***/ }), -/* 48 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + function Header(props) { + _classCallCheck(this, Header); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["d"]; }); + var _this = _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).call(this)); + _this.state = {}; + return _this; + } -/***/ }), -/* 49 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + _createClass(Header, [{ + key: 'render', + value: function render() { + return (0, _preact.h)( + 'div', + { 'class': 'header' }, + (0, _preact.h)( + 'b', + null, + 'spawn cortex' + ), + (0, _preact.h)(_audioPlayer2.default, null) + ); + } + }]); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["e"]; }); + return Header; +}(_preact.Component); +exports.default = Header; /***/ }), -/* 50 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["f"]; }); -/***/ }), -/* 51 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["g"]; }); +var _reactRedux = __webpack_require__(6); +var _AudioPlayerView = __webpack_require__(71); -/***/ }), -/* 52 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var _AudioPlayerView2 = _interopRequireDefault(_AudioPlayerView); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["h"]; }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var mapStateToProps = function mapStateToProps(state) { + return state.audioPlayer; +}; -/***/ }), -/* 53 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return {}; +}; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(2); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["i"]; }); +var AudioPlayer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_AudioPlayerView2.default); +exports.default = AudioPlayer; /***/ }), -/* 54 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5690,61 +5932,94 @@ NavLink.defaultProps = { Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = AudioPlayerView; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _preact = __webpack_require__(0); -var _preact = __webpack_require__(3); +var audio = document.createElement('audio'); -var _audioPlayerContainer = __webpack_require__(114); +function AudioPlayerView(props) { + if (props.file) { + document.body.style.backgroundImage = 'url(' + pngpath(props.file) + ')'; + audio.src = mp3path(props.file); + audio.play(); + return (0, _preact.h)( + 'div', + null, + 'Playing ', + props.file.name + ); + } else { + return (0, _preact.h)( + 'div', + null, + 'Not Playing' + ); + } +} -var _audioPlayerContainer2 = _interopRequireDefault(_audioPlayerContainer); +function filepath(file) { + return '/data/' + file.folder_id + '/' + encodeURIComponent(file.name); +} +function mp3path(file) { + if (file.mime !== 'audio/mp3') { + return filepath(file) + '.mp3'; + } + return filepath(file); +} +function pngpath(file) { + return filepath(file) + '.png'; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +"use strict"; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -// import { Link } from 'react-router-dom' +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _reactRedux = __webpack_require__(6); -var Header = function (_Component) { - _inherits(Header, _Component); +var _BrowserView = __webpack_require__(73); - function Header(props) { - _classCallCheck(this, Header); +var _BrowserView2 = _interopRequireDefault(_BrowserView); - var _this = _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).call(this)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - _this.state = {}; - return _this; - } +var mapStateToProps = function mapStateToProps(state) { + return state.folders; +}; - _createClass(Header, [{ - key: 'render', - value: function render() { - return (0, _preact.h)( - 'div', - { 'class': 'header' }, - (0, _preact.h)( - 'b', - null, - 'spawn cortex' - ), - (0, _preact.h)(_audioPlayerContainer2.default, null) - ); +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return { + addFolder: function addFolder(folder) { + // this.setState({ folders: this.state.folders.concat([folder]) }) + }, + openFolder: function openFolder(folder) { + // if (this.state.openFolders.indexOf(folder.id) === -1) { + // const newOpenFolders = this.state.openFolders.concat(folder.id) + // localStorage['openFolders'] = JSON.stringify(newOpenFolders) + // this.setState({ openFolders: newOpenFolders }) + // } + }, + closeFolder: function closeFolder(folder) { + // const openFolders = this.state.openFolders.filter( folder_id => folder_id !== folder.id ) + // localStorage['openFolders'] = JSON.stringify(openFolders) + // this.setState({ openFolders }) } - }]); + }; +}; - return Header; -}(_preact.Component); +var Browser = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_BrowserView2.default); -exports.default = Header; +exports.default = Browser; /***/ }), -/* 55 */, -/* 56 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5753,56 +6028,53 @@ exports.default = Header; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = BrowserView; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _preact = __webpack_require__(3); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _preact = __webpack_require__(0); -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var _Folders = __webpack_require__(74); -var Modal = function (_Component) { - _inherits(Modal, _Component); +var _Folders2 = _interopRequireDefault(_Folders); - function Modal(props) { - _classCallCheck(this, Modal); +var _Files = __webpack_require__(77); - return _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this)); - } +var _Files2 = _interopRequireDefault(_Files); - _createClass(Modal, [{ - key: 'render', - value: function render() { - var className = this.props.visible ? 'modal visible' : 'modal'; - return (0, _preact.h)( - 'div', - { 'class': className }, - (0, _preact.h)( - 'div', - { 'class': 'inner' }, - this.props.children - ), - (0, _preact.h)( - 'div', - { 'class': 'close', onClick: this.props.onClose }, - '\xD7' - ) - ); - } - }]); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return Modal; -}(_preact.Component); +function BrowserView(props) { + console.log('browser view', props); + var openFolders = (props.openFolders || []).map(function (folder_id) { + var folder_list = props.folders.filter(function (folder) { + return folder.id === folder_id; + }); + if (!folder_list.length) return; + var folder = folder_list[0]; + return (0, _preact.h)(_Files2.default, { + folder: folder, + onClose: function onClose() { + return props.closeFolder(folder); + } + }); + }); -exports.default = Modal; + return (0, _preact.h)( + 'div', + { 'class': 'column' }, + (0, _preact.h)(_Folders2.default, { folders: props.folders, + openFolder: function openFolder(folder) { + return props.openFolder(folder); + }, + addFolder: function addFolder(folder) { + return props.addFolder(folder); + } + }), + openFolders + ); +} /***/ }), -/* 57 */, -/* 58 */, -/* 59 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5814,15 +6086,17 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var _reactRouterDom = __webpack_require__(5); +var _Modal = __webpack_require__(75); -var _taskForm = __webpack_require__(110); +var _Modal2 = _interopRequireDefault(_Modal); -var _taskForm2 = _interopRequireDefault(_taskForm); +var _FolderForm = __webpack_require__(76); + +var _FolderForm2 = _interopRequireDefault(_FolderForm); -var _client = __webpack_require__(8); +var _client = __webpack_require__(5); var _client2 = _interopRequireDefault(_client); @@ -5834,110 +6108,166 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var Tasks = function (_Component) { - _inherits(Tasks, _Component); +var Folders = function (_Component) { + _inherits(Folders, _Component); - function Tasks(props) { - _classCallCheck(this, Tasks); + function Folders(props) { + _classCallCheck(this, Folders); - var _this = _possibleConstructorReturn(this, (Tasks.__proto__ || Object.getPrototypeOf(Tasks)).call(this)); + var _this = _possibleConstructorReturn(this, (Folders.__proto__ || Object.getPrototypeOf(Folders)).call(this)); _this.state = { - adding: false, - tasks: [] + adding: false }; - _client2.default.task.index().then(function (tasks) { - return _this.setState({ tasks: tasks }); - }); return _this; } - _createClass(Tasks, [{ + _createClass(Folders, [{ + key: 'openModal', + value: function openModal() { + this.setState({ adding: true }); + } + }, { + key: 'closeModal', + value: function closeModal() { + this.setState({ adding: false }); + } + }, { + key: 'toggle', + value: function toggle(folder) { + var _this2 = this; + + folder.open = !folder.open; + if (folder.open && !folder.files) { + _client2.default.file.index({ 'folder_id': folder.id }).then(function (files) { + console.log(files); + folder.files = files; + _this2.props.openFolder(folder); + }); + } + } + }, { key: 'render', value: function render() { - var _this2 = this; + var _this3 = this; - // {task.result_file.name} - var tasks = (this.state.tasks || []).map(function (task, i) { + var folders = (this.props.folders || []).map(function (folder, i) { return (0, _preact.h)( 'div', { key: i, onClick: function onClick() { - return _this2.toggle(task); + return _this3.toggle(folder); } }, - (0, _preact.h)( - 'span', - null, - task.id - ), - (0, _preact.h)( - 'span', - null, - task.created_at - ), (0, _preact.h)( 'span', { 'class': 'name' }, - task.content_file.name - ), + folder.name + ) + ); + }); + return (0, _preact.h)( + 'div', + { 'class': 'window' }, + (0, _preact.h)( + 'div', + { 'class': 'heading' }, (0, _preact.h)( - 'span', - { 'class': 'name' }, - task.style_file.name + 'b', + null, + 'browser' ), (0, _preact.h)( - 'span', - null, - task.alpha + 'div', + { 'class': 'buttons' }, + (0, _preact.h)( + 'button', + { onClick: function onClick() { + return _this3.openModal(); + } }, + '+ folder' + ) ) - ); - }); + ), + (0, _preact.h)( + 'div', + { 'class': 'list' }, + folders + ), + (0, _preact.h)( + _Modal2.default, + { visible: this.state.adding, onClose: function onClose() { + return _this3.closeModal(); + } }, + (0, _preact.h)(_FolderForm2.default, { addFolder: this.props.addFolder, onClose: function onClose() { + return _this3.closeModal(); + } }) + ) + ); + } + }]); + + return Folders; +}(_preact.Component); + +exports.default = Folders; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _preact = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Modal = function (_Component) { + _inherits(Modal, _Component); + + function Modal(props) { + _classCallCheck(this, Modal); + + return _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this)); + } + + _createClass(Modal, [{ + key: 'render', + value: function render() { + var className = this.props.visible ? 'modal visible' : 'modal'; return (0, _preact.h)( 'div', - { 'class': 'column' }, + { 'class': className }, (0, _preact.h)( 'div', - { 'class': 'window' }, - (0, _preact.h)( - 'div', - { 'class': 'heading' }, - (0, _preact.h)( - 'b', - null, - 'create task' - ) - ), - (0, _preact.h)(_taskForm2.default, null) + { 'class': 'inner' }, + this.props.children ), (0, _preact.h)( 'div', - { 'class': 'window' }, - (0, _preact.h)( - 'div', - { 'class': 'heading' }, - (0, _preact.h)( - 'b', - null, - 'recent tasks' - ) - ), - (0, _preact.h)( - 'div', - { 'class': 'list' }, - tasks - ) + { 'class': 'close', onClick: this.props.onClose }, + '\xD7' ) ); } }]); - return Tasks; + return Modal; }(_preact.Component); -exports.default = Tasks; +exports.default = Modal; /***/ }), -/* 60 */, -/* 61 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5949,111 +6279,103 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _preact = __webpack_require__(3); - -var _Folders = __webpack_require__(62); - -var _Folders2 = _interopRequireDefault(_Folders); - -var _Files = __webpack_require__(111); - -var _Files2 = _interopRequireDefault(_Files); +var _preact = __webpack_require__(0); -var _client = __webpack_require__(8); +var _client = __webpack_require__(5); var _client2 = _interopRequireDefault(_client); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var Browser = function (_Component) { - _inherits(Browser, _Component); +var FolderForm = function (_Component) { + _inherits(FolderForm, _Component); - function Browser(props) { - _classCallCheck(this, Browser); + function FolderForm(props) { + _classCallCheck(this, FolderForm); - var _this = _possibleConstructorReturn(this, (Browser.__proto__ || Object.getPrototypeOf(Browser)).call(this)); + var _this = _possibleConstructorReturn(this, (FolderForm.__proto__ || Object.getPrototypeOf(FolderForm)).call(this)); - var openFolders = JSON.parse(localStorage['openFolders'] || 'null'); _this.state = { - folders: [], - openFolders: openFolders || [] + name: '' }; - _client2.default.folder.index().then(function (folders) { - return _this.setState({ folders: folders }); - }); + _this.updateState = _this.updateState.bind(_this); + _this.handleSubmit = _this.handleSubmit.bind(_this); return _this; } - _createClass(Browser, [{ - key: 'openFolder', - value: function openFolder(folder) { - if (this.state.openFolders.indexOf(folder.id) === -1) { - var newOpenFolders = this.state.openFolders.concat(folder.id); - localStorage['openFolders'] = JSON.stringify(newOpenFolders); - this.setState({ openFolders: newOpenFolders }); - } + _createClass(FolderForm, [{ + key: 'updateState', + value: function updateState(event) { + var _setState; + + var name = event.target.name; + var value = event.target.value; + console.log(name, value); + this.setState((_setState = {}, _defineProperty(_setState, name, value), _defineProperty(_setState, 'error', null), _setState)); } }, { - key: 'closeFolder', - value: function closeFolder(folder) { - var openFolders = this.state.openFolders.filter(function (folder_id) { - return folder_id !== folder.id; + key: 'handleSubmit', + value: function handleSubmit(event) { + var _this2 = this; + + event.preventDefault(); + var rec = Object.assign({}, this.state); + delete rec.error; + this.props.onClose(); + _client2.default.folder.create(rec).then(function (data) { + _this2.props.addFolder(data); }); - localStorage['openFolders'] = JSON.stringify(openFolders); - this.setState({ openFolders: openFolders }); - } - }, { - key: 'addFolder', - value: function addFolder(folder) { - this.setState({ folders: this.state.folders.concat([folder]) }); } }, { key: 'render', value: function render() { - var _this2 = this; - - var openFolders = this.state.openFolders.map(function (folder_id) { - var folder_list = _this2.state.folders.filter(function (folder) { - return folder.id === folder_id; - }); - if (!folder_list.length) return; - var folder = folder_list[0]; - return (0, _preact.h)(_Files2.default, { - folder: folder, - onClose: function onClose() { - return _this2.closeFolder(folder); - } - }); - }); return (0, _preact.h)( 'div', - { 'class': 'column' }, - (0, _preact.h)(_Folders2.default, { folders: this.state.folders, - openFolder: function openFolder(folder) { - return _this2.openFolder(folder); - }, - addFolder: function addFolder(folder) { - return _this2.addFolder(folder); - } - }), - openFolders + { 'class': 'form' }, + (0, _preact.h)( + 'h1', + null, + 'new folder' + ), + (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + 'label', + { 'for': 'folders_folder_name' }, + 'Name' + ), + (0, _preact.h)('input', { type: 'text', id: 'folders_folder_name', name: 'name', value: this.state.name, onChange: this.updateState }) + ), + (0, _preact.h)( + 'div', + null, + (0, _preact.h)('label', null), + (0, _preact.h)( + 'button', + { onClick: this.handleSubmit }, + 'Create' + ) + ) ); } }]); - return Browser; + return FolderForm; }(_preact.Component); -exports.default = Browser; +exports.default = FolderForm; /***/ }), -/* 62 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6065,19 +6387,29 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var _Modal = __webpack_require__(56); +var _actions = __webpack_require__(7); -var _Modal2 = _interopRequireDefault(_Modal); +var _client = __webpack_require__(5); + +var _client2 = _interopRequireDefault(_client); -var _FolderForm = __webpack_require__(63); +var _FileUploadButton = __webpack_require__(78); -var _FolderForm2 = _interopRequireDefault(_FolderForm); +var _FileUploadButton2 = _interopRequireDefault(_FileUploadButton); -var _client = __webpack_require__(8); +var _fileLink = __webpack_require__(33); -var _client2 = _interopRequireDefault(_client); +var _fileLink2 = _interopRequireDefault(_fileLink); + +var _taskContentLink = __webpack_require__(79); + +var _taskContentLink2 = _interopRequireDefault(_taskContentLink); + +var _taskStyleLink = __webpack_require__(80); + +var _taskStyleLink2 = _interopRequireDefault(_taskStyleLink); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6087,59 +6419,83 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var Folders = function (_Component) { - _inherits(Folders, _Component); +var Files = function (_Component) { + _inherits(Files, _Component); - function Folders(props) { - _classCallCheck(this, Folders); + function Files(props) { + _classCallCheck(this, Files); - var _this = _possibleConstructorReturn(this, (Folders.__proto__ || Object.getPrototypeOf(Folders)).call(this)); + var _this = _possibleConstructorReturn(this, (Files.__proto__ || Object.getPrototypeOf(Files)).call(this)); _this.state = { - adding: false + selected: null }; + _this.addFiles = _this.addFiles.bind(_this); return _this; } - _createClass(Folders, [{ - key: 'openModal', - value: function openModal() { - this.setState({ adding: true }); - } - }, { - key: 'closeModal', - value: function closeModal() { - this.setState({ adding: false }); + _createClass(Files, [{ + key: 'addFiles', + value: function addFiles(newFiles) { + if (!newFiles) return; + var files = this.state.files.concat(newFiles).sort(function (a, b) { + return b.id - a.id; + }); + this.setState({ files: files }); } }, { - key: 'toggle', - value: function toggle(folder) { - var _this2 = this; - - folder.open = !folder.open; - if (folder.open && !folder.files) { - _client2.default.file.index({ 'folder_id': folder.id }).then(function (files) { - console.log(files); - folder.files = files; - _this2.props.openFolder(folder); - }); - } + key: 'handleClick', + value: function handleClick(file) { + this.setState({ selected: file }); } }, { key: 'render', value: function render() { - var _this3 = this; + var _this2 = this; - var folders = (this.props.folders || []).map(function (folder, i) { + var file_list = void 0; + if (this.props.folder && this.props.folder.files) { + file_list = this.props.folder.files; + } else { + file_list = []; + } + var files = file_list.map(toFilenamePair).sort(sortByFilename).map(fromPair).map(function (file, i) { + if (!file) return; return (0, _preact.h)( 'div', - { key: i, onClick: function onClick() { - return _this3.toggle(folder); - } }, + { key: i, 'class': _this2.state.selected === file ? 'selected' : '' }, (0, _preact.h)( 'span', { 'class': 'name' }, - folder.name + (0, _preact.h)( + _fileLink2.default, + { file: file }, + file.name + ) + ), + (0, _preact.h)( + 'span', + { 'class': 'mime' }, + file.processed ? file.mime : 'working...' + ), + (0, _preact.h)( + 'span', + { 'class': 'duration' }, + file.duration ? file.duration.toFixed(1) + 's' : '' + ), + (0, _preact.h)( + 'span', + { 'class': 'actions' }, + (0, _preact.h)( + _taskContentLink2.default, + { file: file }, + 'content' + ), + (0, _preact.h)( + _taskStyleLink2.default, + { file: file }, + 'style' + ) ) ); }); @@ -6152,45 +6508,59 @@ var Folders = function (_Component) { (0, _preact.h)( 'b', null, - 'browser' + this.props.folder.name ), (0, _preact.h)( 'div', { 'class': 'buttons' }, + (0, _preact.h)(_FileUploadButton2.default, { folder: this.props.folder, addFiles: this.addFiles }), (0, _preact.h)( 'button', - { onClick: function onClick() { - return _this3.openModal(); - } }, - '+ folder' + { onClick: this.props.onClose }, + '\xD7' ) ) ), - (0, _preact.h)( - 'div', - { 'class': 'list' }, - folders - ), - (0, _preact.h)( - _Modal2.default, - { visible: this.state.adding, onClose: function onClose() { - return _this3.closeModal(); - } }, - (0, _preact.h)(_FolderForm2.default, { addFolder: this.props.addFolder, onClose: function onClose() { - return _this3.closeModal(); - } }) + (0, _preact.h)( + 'div', + { 'class': 'list' }, + files ) ); } }]); - return Folders; + return Files; }(_preact.Component); -exports.default = Folders; +exports.default = Files; + + +function toFilenamePair(file) { + return [file.name.toLowerCase(), file]; +} +function sortByFilename(a, b) { + return a[0] < b[0] ? -1 : a[0] == b[0] ? 0 : 1; +} +function fromPair(pair) { + return pair[1]; +} + +function filepath(file) { + return '/data/' + file.folder_id + '/' + encodeURIComponent(file.name); +} +function mp3path(file) { + if (file.mime !== 'audio/mp3') { + return filepath(file) + '.mp3'; + } + return filepath(file); +} +function pngpath(file) { + return filepath(file) + '.png'; +} /***/ }), -/* 63 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6202,104 +6572,148 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var _client = __webpack_require__(8); +var _client = __webpack_require__(5); var _client2 = _interopRequireDefault(_client); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var FolderForm = function (_Component) { - _inherits(FolderForm, _Component); +var Folder = function (_Component) { + _inherits(Folder, _Component); - function FolderForm(props) { - _classCallCheck(this, FolderForm); + function Folder(props) { + _classCallCheck(this, Folder); - var _this = _possibleConstructorReturn(this, (FolderForm.__proto__ || Object.getPrototypeOf(FolderForm)).call(this)); + var _this = _possibleConstructorReturn(this, (Folder.__proto__ || Object.getPrototypeOf(Folder)).call(this)); - _this.state = { - name: '' - }; - _this.updateState = _this.updateState.bind(_this); - _this.handleSubmit = _this.handleSubmit.bind(_this); + _this.state = {}; + _this.updateFiles = _this.updateFiles.bind(_this); return _this; } - _createClass(FolderForm, [{ - key: 'updateState', - value: function updateState(event) { - var _setState; - - var name = event.target.name; - var value = event.target.value; - console.log(name, value); - this.setState((_setState = {}, _defineProperty(_setState, name, value), _defineProperty(_setState, 'error', null), _setState)); - } - }, { - key: 'handleSubmit', - value: function handleSubmit(event) { + _createClass(Folder, [{ + key: 'updateFiles', + value: function updateFiles(event) { var _this2 = this; - event.preventDefault(); - var rec = Object.assign({}, this.state); - delete rec.error; - this.props.onClose(); - _client2.default.folder.create(rec).then(function (data) { - _this2.props.addFolder(data); + var name = event.target.name; + var files = event.target.files; + _client2.default.upload(this.props.folder.id, files).then(function (got_files) { + _this2.props.addFiles(got_files); }); } }, { key: 'render', value: function render() { + var files = (this.props.folder.files || []).map(function (file, i) { + return (0, _preact.h)( + 'div', + { key: i }, + file.name + ); + }); return (0, _preact.h)( 'div', - { 'class': 'form' }, - (0, _preact.h)( - 'h1', - null, - 'new folder' - ), - (0, _preact.h)( - 'div', - null, - (0, _preact.h)( - 'label', - { 'for': 'folders_folder_name' }, - 'Name' - ), - (0, _preact.h)('input', { type: 'text', id: 'folders_folder_name', name: 'name', value: this.state.name, onChange: this.updateState }) - ), + { 'class': 'fileUploadButton' }, + (0, _preact.h)('input', { type: 'file', multiple: true, name: 'files', onChange: this.updateFiles }), (0, _preact.h)( - 'div', + 'span', null, - (0, _preact.h)('label', null), - (0, _preact.h)( - 'button', - { onClick: this.handleSubmit }, - 'Create' - ) + '+ upload' ) ); } }]); - return FolderForm; + return Folder; }(_preact.Component); -exports.default = FolderForm; +exports.default = Folder; /***/ }), -/* 64 */, -/* 65 */ +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactRedux = __webpack_require__(6); + +var _actions = __webpack_require__(7); + +var _Link = __webpack_require__(17); + +var _Link2 = _interopRequireDefault(_Link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var mapStateToProps = function mapStateToProps(state, ownProps) { + return {}; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return { + onClick: function onClick() { + dispatch((0, _actions.setContent)(ownProps.file)); + } + }; +}; + +var TaskContentLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); + +exports.default = TaskContentLink; + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactRedux = __webpack_require__(6); + +var _actions = __webpack_require__(7); + +var _Link = __webpack_require__(17); + +var _Link2 = _interopRequireDefault(_Link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var mapStateToProps = function mapStateToProps(state, ownProps) { + return {}; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return { + onClick: function onClick() { + dispatch((0, _actions.setStyle)(ownProps.file)); + } + }; +}; + +var TaskStyleLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); + +exports.default = TaskStyleLink; + +/***/ }), +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6311,11 +6725,17 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var _client = __webpack_require__(8); +var _reactRouterDom = __webpack_require__(34); -var _client2 = _interopRequireDefault(_client); +var _taskForm = __webpack_require__(107); + +var _taskForm2 = _interopRequireDefault(_taskForm); + +var _taskList = __webpack_require__(109); + +var _taskList2 = _interopRequireDefault(_taskList); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6325,2512 +6745,2249 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var Folder = function (_Component) { - _inherits(Folder, _Component); - - function Folder(props) { - _classCallCheck(this, Folder); +var Tasks = function (_Component) { + _inherits(Tasks, _Component); - var _this = _possibleConstructorReturn(this, (Folder.__proto__ || Object.getPrototypeOf(Folder)).call(this)); + function Tasks() { + _classCallCheck(this, Tasks); - _this.state = {}; - _this.updateFiles = _this.updateFiles.bind(_this); - return _this; + return _possibleConstructorReturn(this, (Tasks.__proto__ || Object.getPrototypeOf(Tasks)).apply(this, arguments)); } - _createClass(Folder, [{ - key: 'updateFiles', - value: function updateFiles(event) { - var _this2 = this; - - var name = event.target.name; - var files = event.target.files; - _client2.default.upload(this.props.folder.id, files).then(function (got_files) { - _this2.props.addFiles(got_files); - }); - } - }, { + _createClass(Tasks, [{ key: 'render', value: function render() { - var files = (this.props.folder.files || []).map(function (file, i) { - return (0, _preact.h)( - 'div', - { key: i }, - file.name - ); - }); return (0, _preact.h)( 'div', - { 'class': 'fileUploadButton' }, - (0, _preact.h)('input', { type: 'file', multiple: true, name: 'files', onChange: this.updateFiles }), + { 'class': 'column' }, (0, _preact.h)( - 'span', - null, - '+ upload' + 'div', + { 'class': 'window' }, + (0, _preact.h)( + 'div', + { 'class': 'heading' }, + (0, _preact.h)( + 'b', + null, + 'create task' + ) + ), + (0, _preact.h)(_taskForm2.default, null) + ), + (0, _preact.h)( + 'div', + { 'class': 'window' }, + (0, _preact.h)( + 'div', + { 'class': 'heading' }, + (0, _preact.h)( + 'b', + null, + 'recent tasks' + ) + ), + (0, _preact.h)(_taskList2.default, null) ) ); } }]); - return Folder; + return Tasks; }(_preact.Component); -exports.default = Folder; +exports.default = Tasks; /***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { +/* 82 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__ = __webpack_require__(83); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(4); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = TaskFormView; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var _preact = __webpack_require__(3); -var _reactRouterDom = __webpack_require__(5); -var _client = __webpack_require__(8); -var _client2 = _interopRequireDefault(_client); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function TaskFormView(props) { - // console.log(props) - return (0, _preact.h)( - 'div', - { 'class': 'form' }, - (0, _preact.h)( - 'div', - null, - props.content && (0, _preact.h)( - 'div', - null, - props.content.name - ), - (0, _preact.h)( - 'label', - null, - 'content' - ), - (0, _preact.h)( - 'button', - { onClick: props.clearContent }, - 'x' - ) - ), - (0, _preact.h)( - 'div', - null, - props.style && (0, _preact.h)( - 'div', - null, - props.style.name - ), - (0, _preact.h)( - 'label', - null, - 'style' - ), - (0, _preact.h)( - 'button', - { onClick: props.clearStyle }, - 'x' - ) - ), - (0, _preact.h)( - 'div', - null, - (0, _preact.h)('input', { type: 'range', step: '0.01', min: '0.001', max: '1', value: props.alpha, - onInput: function onInput(e) { - return props.setAlpha(e.target.value); - } - }), - 'alpha: ', - props.alpha - ), - (0, _preact.h)( - 'div', - null, - (0, _preact.h)( - 'button', - { onClick: props.createTask }, - 'Create' - ) - ) - ); -} +/** + * The public API for a that uses HTML5 history. + */ + +var BrowserRouter = function (_React$Component) { + _inherits(BrowserRouter, _React$Component); + + function BrowserRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, BrowserRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + BrowserRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); + }; + + return BrowserRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + +BrowserRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + forceRefresh: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (BrowserRouter); /***/ }), -/* 67 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(79); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(84); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(86); +exports.__esModule = true; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +var _warning = __webpack_require__(8); -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +var _warning2 = _interopRequireDefault(_warning); -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var _invariant = __webpack_require__(9); -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +var _invariant2 = _interopRequireDefault(_invariant); -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */](value) || __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */](value) != objectTag) { - return false; - } - var proto = __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */](value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} +var _LocationUtils = __webpack_require__(18); -/* harmony default export */ __webpack_exports__["a"] = (isPlainObject); +var _PathUtils = __webpack_require__(10); +var _createTransitionManager = __webpack_require__(19); -/***/ }), -/* 68 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + +var _DOMUtils = __webpack_require__(35); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var PopStateEvent = 'popstate'; +var HashChangeEvent = 'hashchange'; + +var getHistoryState = function getHistoryState() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } +}; -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = warning; /** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. */ -function warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { - console.error(message); - } - /* eslint-enable no-console */ - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. - throw new Error(message); - /* eslint-disable no-empty */ - } catch (e) {} - /* eslint-enable no-empty */ -} +var createBrowserHistory = function createBrowserHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; -/***/ }), -/* 69 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM'); -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(70); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(91); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(92); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(93); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(74); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(73); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); + var globalHistory = window.history; + var canUseHistory = (0, _DOMUtils.supportsHistory)(); + var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)(); + var _props$forceRefresh = props.forceRefresh, + forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh, + _props$getUserConfirm = props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, + _props$keyLength = props.keyLength, + keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; + + var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; + var getDOMLocation = function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + var path = pathname + search + hash; + (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = (0, _PathUtils.stripBasename)(path, basename); -/* -* This is a dummy function to check if the function name has been altered by minification. -* If the function has been minified and NODE_ENV !== 'production', warn the user. -*/ -function isCrushed() {} + return (0, _LocationUtils.createLocation)(path, state, key); + }; -if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { - __WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */]('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); -} + var createKey = function createKey() { + return Math.random().toString(36).substr(2, keyLength); + }; + var transitionManager = (0, _createTransitionManager2.default)(); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) + var setState = function setState(nextState) { + _extends(history, nextState); -/***/ }), -/* 70 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + history.length = globalHistory.length; -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); -/* harmony export (immutable) */ __webpack_exports__["b"] = createStore; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(67); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(87); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); + transitionManager.notifyListeners(history.location, history.action); + }; + var handlePopState = function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return; + handlePop(getDOMLocation(event.state)); + }; -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -var ActionTypes = { - INIT: '@@redux/INIT' + var handleHashChange = function handleHashChange() { + handlePop(getDOMLocation(getHistoryState())); + }; - /** - * Creates a Redux store that holds the state tree. - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ -};function createStore(reducer, preloadedState, enhancer) { - var _ref2; + var forceNextPop = false; - if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { - enhancer = preloadedState; - preloadedState = undefined; - } + var handlePop = function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; - if (typeof enhancer !== 'undefined') { - if (typeof enhancer !== 'function') { - throw new Error('Expected the enhancer to be a function.'); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ action: action, location: location }); + } else { + revertPop(location); + } + }); } + }; - return enhancer(createStore)(reducer, preloadedState); - } - - if (typeof reducer !== 'function') { - throw new Error('Expected the reducer to be a function.'); - } - - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; + var revertPop = function revertPop(fromLocation) { + var toLocation = history.location; - function ensureCanMutateNextListeners() { - if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); - } - } + // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. - /** - * Reads the state tree managed by the store. - * - * @returns {any} The current state tree of your application. - */ - function getState() { - return currentState; - } + var toIndex = allKeys.indexOf(toLocation.key); - /** - * Adds a change listener. It will be called any time an action is dispatched, - * and some part of the state tree may potentially have changed. You may then - * call `getState()` to read the current state tree inside the callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, this - * will not have any effect on the `dispatch()` that is currently in progress. - * However, the next `dispatch()` call, whether nested or not, will use a more - * recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all state changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param {Function} listener A callback to be invoked on every dispatch. - * @returns {Function} A function to remove this change listener. - */ - function subscribe(listener) { - if (typeof listener !== 'function') { - throw new Error('Expected listener to be a function.'); - } + if (toIndex === -1) toIndex = 0; - var isSubscribed = true; + var fromIndex = allKeys.indexOf(fromLocation.key); - ensureCanMutateNextListeners(); - nextListeners.push(listener); + if (fromIndex === -1) fromIndex = 0; - return function unsubscribe() { - if (!isSubscribed) { - return; - } + var delta = toIndex - fromIndex; - isSubscribed = false; + if (delta) { + forceNextPop = true; + go(delta); + } + }; - ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); - }; - } + var initialLocation = getDOMLocation(getHistoryState()); + var allKeys = [initialLocation.key]; - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - function dispatch(action) { - if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */](action)) { - throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); - } + // Public interface - if (typeof action.type === 'undefined') { - throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); - } + var createHref = function createHref(location) { + return basename + (0, _PathUtils.createPath)(location); + }; - if (isDispatching) { - throw new Error('Reducers may not dispatch actions.'); - } + var push = function push(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - try { - isDispatching = true; - currentState = currentReducer(currentState, action); - } finally { - isDispatching = false; - } + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - var listeners = currentListeners = nextListeners; - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(); - } + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; - return action; - } + var href = createHref(location); + var key = location.key, + state = location.state; - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { - throw new Error('Expected the nextReducer to be a function.'); - } - currentReducer = nextReducer; - dispatch({ type: ActionTypes.INIT }); - } + if (canUseHistory) { + globalHistory.pushState({ key: key, state: state }, null, href); - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - function observable() { - var _ref; + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); - var outerSubscribe = subscribe; - return _ref = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object') { - throw new TypeError('Expected the observer to be an object.'); - } + nextKeys.push(location.key); + allKeys = nextKeys; - function observeState() { - if (observer.next) { - observer.next(getState()); - } + setState({ action: action, location: location }); } + } else { + (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); - observeState(); - var unsubscribe = outerSubscribe(observeState); - return { unsubscribe: unsubscribe }; + window.location.href = href; } - }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () { - return this; - }, _ref; - } + }); + }; - // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - dispatch({ type: ActionTypes.INIT }); + var replace = function replace(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2; -} + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); -/***/ }), -/* 71 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(80); + var href = createHref(location); + var key = location.key, + state = location.state; -/** Built-in value references. */ -var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; + if (canUseHistory) { + globalHistory.replaceState({ key: key, state: state }, null, href); -/* harmony default export */ __webpack_exports__["a"] = (Symbol); + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + if (prevIndex !== -1) allKeys[prevIndex] = location.key; -/***/ }), -/* 72 */ -/***/ (function(module, exports) { + setState({ action: action, location: location }); + } + } else { + (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; + window.location.replace(href); + } + }); + }; + var go = function go(n) { + globalHistory.go(n); + }; -/***/ }), -/* 73 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var goBack = function goBack() { + return go(-1); + }; -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = warning; -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ -function warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { - console.error(message); - } - /* eslint-enable no-console */ - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. - throw new Error(message); - /* eslint-disable no-empty */ - } catch (e) {} - /* eslint-enable no-empty */ -} + var goForward = function goForward() { + return go(1); + }; -/***/ }), -/* 74 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var listenerCount = 0; -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = compose; -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for - * the resulting composite function. - * - * @param {...Function} funcs The functions to compose. - * @returns {Function} A function obtained by composing the argument functions - * from right to left. For example, compose(f, g, h) is identical to doing - * (...args) => f(g(h(...args))). - */ + var checkDOMListeners = function checkDOMListeners(delta) { + listenerCount += delta; -function compose() { - for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } + if (listenerCount === 1) { + (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState); - if (funcs.length === 0) { - return function (arg) { - return arg; - }; - } + if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState); - if (funcs.length === 1) { - return funcs[0]; - } + if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); + } + }; - return funcs.reduce(function (a, b) { - return function () { - return a(b.apply(undefined, arguments)); - }; - }); -} + var isBlocked = false; -/***/ }), -/* 75 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); + var unblock = transitionManager.setPrompt(prompt); + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } -var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ - trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, - tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, - notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, - isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired -}); + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } -var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ - subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, - dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, - getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired -}); + return unblock(); + }; + }; -/***/ }), -/* 76 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var listen = function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(41); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(96); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(75); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + return function () { + checkDOMListeners(-1); + unlisten(); + }; + }; + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + return history; +}; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +exports.default = createBrowserHistory; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } +"use strict"; +var isAbsolute = function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; +}; +// About 1.5x faster than the two-arg version of Array#splice() +var spliceOne = function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { + list[i] = list[k]; + }list.pop(); +}; +// This implementation is based heavily on node's url.parse +var resolvePathname = function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } -var hotReloadingVersion = 0; -var dummyState = {}; -function noop() {} -function makeSelectorStateful(sourceSelector, store) { - // wrap the selector in an object that tracks its results between runs. - var selector = { - run: function runComponentSelector(props) { - try { - var nextProps = sourceSelector(store.getState(), props); - if (nextProps !== selector.props || selector.error) { - selector.shouldComponentUpdate = true; - selector.props = nextProps; - selector.error = null; - } - } catch (error) { - selector.shouldComponentUpdate = true; - selector.error = error; - } - } - }; + if (!fromParts.length) return '/'; - return selector; -} + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } -function connectAdvanced( -/* - selectorFactory is a func that is responsible for returning the selector function used to - compute new props from state, props, and dispatch. For example: - export default connectAdvanced((dispatch, options) => (state, props) => ({ - thing: state.things[props.thingId], - saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), - }))(YourComponent) - Access to dispatch is provided to the factory so selectorFactories can bind actionCreators - outside of their selector as an optimization. Options passed to connectAdvanced are passed to - the selectorFactory, along with displayName and WrappedComponent, as the second argument. - Note that selectorFactory is responsible for all caching/memoization of inbound and outbound - props. Do not use connectAdvanced directly without memoizing results between calls to your - selector, otherwise the Connect component will re-render on every state or props change. -*/ -selectorFactory) { - var _contextTypes, _childContextTypes; + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$getDisplayName = _ref.getDisplayName, - getDisplayName = _ref$getDisplayName === undefined ? function (name) { - return 'ConnectAdvanced(' + name + ')'; - } : _ref$getDisplayName, - _ref$methodName = _ref.methodName, - methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, - _ref$renderCountProp = _ref.renderCountProp, - renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, - _ref$shouldHandleStat = _ref.shouldHandleStateChanges, - shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, - _ref$storeKey = _ref.storeKey, - storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, - _ref$withRef = _ref.withRef, - withRef = _ref$withRef === undefined ? false : _ref$withRef, - connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } - var subscriptionKey = storeKey + 'Subscription'; - var version = hotReloadingVersion++; + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); - var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes); - var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes); + var result = fromParts.join('/'); - return function wrapWithConnect(WrappedComponent) { - __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent))); + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; - var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; + return result; +}; - var displayName = getDisplayName(wrappedComponentName); +module.exports = resolvePathname; - var selectorFactoryOptions = _extends({}, connectOptions, { - getDisplayName: getDisplayName, - methodName: methodName, - renderCountProp: renderCountProp, - shouldHandleStateChanges: shouldHandleStateChanges, - storeKey: storeKey, - withRef: withRef, - displayName: displayName, - wrappedComponentName: wrappedComponentName, - WrappedComponent: WrappedComponent - }); +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { - var Connect = function (_Component) { - _inherits(Connect, _Component); +"use strict"; - function Connect(props, context) { - _classCallCheck(this, Connect); - var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); +exports.__esModule = true; - _this.version = version; - _this.state = {}; - _this.renderCount = 0; - _this.store = props[storeKey] || context[storeKey]; - _this.propsMode = Boolean(props[storeKey]); - _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a , ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".')); +var valueEqual = function valueEqual(a, b) { + if (a === b) return true; - _this.initSelector(); - _this.initSubscription(); - return _this; - } + if (a == null || b == null) return false; - Connect.prototype.getChildContext = function getChildContext() { - var _ref2; + if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); - // If this component received store from props, its subscription should be transparent - // to any descendants receiving store+subscription from context; it passes along - // subscription passed to it. Otherwise, it shadows the parent subscription, which allows - // Connect to control ordering of notifications to flow top-down. - var subscription = this.propsMode ? null : this.subscription; - return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2; - }; + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); - Connect.prototype.componentDidMount = function componentDidMount() { - if (!shouldHandleStateChanges) return; + if (aType !== bType) return false; - // componentWillMount fires during server side rendering, but componentDidMount and - // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount. - // Otherwise, unsubscription would never take place during SSR, causing a memory leak. - // To handle the case where a child component may have triggered a state change by - // dispatching an action in its componentWillMount, we have to re-run the select and maybe - // re-render. - this.subscription.trySubscribe(); - this.selector.run(this.props); - if (this.selector.shouldComponentUpdate) this.forceUpdate(); - }; + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); - Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - this.selector.run(nextProps); - }; + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); - Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() { - return this.selector.shouldComponentUpdate; - }; + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); - Connect.prototype.componentWillUnmount = function componentWillUnmount() { - if (this.subscription) this.subscription.tryUnsubscribe(); - this.subscription = null; - this.notifyNestedSubs = noop; - this.store = null; - this.selector.run = noop; - this.selector.shouldComponentUpdate = false; - }; + if (aKeys.length !== bKeys.length) return false; - Connect.prototype.getWrappedInstance = function getWrappedInstance() { - __WEBPACK_IMPORTED_MODULE_1_invariant___default.a(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.')); - return this.wrappedInstance; - }; + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } - Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) { - this.wrappedInstance = ref; - }; + return false; +}; - Connect.prototype.initSelector = function initSelector() { - var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); - this.selector = makeSelectorStateful(sourceSelector, this.store); - this.selector.run(this.props); - }; +exports.default = valueEqual; - Connect.prototype.initSubscription = function initSubscription() { - if (!shouldHandleStateChanges) return; +/***/ }), +/* 86 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - // parentSub's source should match where store came from: props vs. context. A component - // connected to the store via props shouldn't use subscription from context, or vice versa. - var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; - this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this)); +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__ = __webpack_require__(87); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Router__ = __webpack_require__(20); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in - // the middle of the notification loop, where `this.subscription` will then be null. An - // extra null check every change can be avoided by copying the method onto `this` and then - // replacing it with a no-op on unmount. This can probably be avoided if Subscription's - // listeners logic is changed to not call listeners that have been unsubscribed in the - // middle of the notification loop. - this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); - }; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Connect.prototype.onStateChange = function onStateChange() { - this.selector.run(this.props); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - if (!this.selector.shouldComponentUpdate) { - this.notifyNestedSubs(); - } else { - this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; - this.setState(dummyState); - } - }; - Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() { - // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it - // needs to notify nested subs. Once called, it unimplements itself until further state - // changes occur. Doing it this way vs having a permanent `componentDidMount` that does - // a boolean check every time avoids an extra method call most of the time, resulting - // in some perf boost. - this.componentDidUpdate = undefined; - this.notifyNestedSubs(); - }; - Connect.prototype.isSubscribed = function isSubscribed() { - return Boolean(this.subscription) && this.subscription.isSubscribed(); - }; - Connect.prototype.addExtraProps = function addExtraProps(props) { - if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; - // make a shallow copy so that fields added don't leak to the original selector. - // this is especially important for 'ref' since that's a reference back to the component - // instance. a singleton memoized selector would then be holding a reference to the - // instance, preventing the instance from being garbage collected, and that would be bad - var withExtras = _extends({}, props); - if (withRef) withExtras.ref = this.setWrappedInstance; - if (renderCountProp) withExtras[renderCountProp] = this.renderCount++; - if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription; - return withExtras; - }; - Connect.prototype.render = function render() { - var selector = this.selector; - selector.shouldComponentUpdate = false; - if (selector.error) { - throw selector.error; - } else { - return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"](WrappedComponent, this.addExtraProps(selector.props)); - } - }; +/** + * The public API for a that stores location in memory. + */ - return Connect; - }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); +var MemoryRouter = function (_React$Component) { + _inherits(MemoryRouter, _React$Component); - Connect.WrappedComponent = WrappedComponent; - Connect.displayName = displayName; - Connect.childContextTypes = childContextTypes; - Connect.contextTypes = contextTypes; - Connect.propTypes = contextTypes; + function MemoryRouter() { + var _temp, _this, _ret; - if (process.env.NODE_ENV !== 'production') { - Connect.prototype.componentWillUpdate = function componentWillUpdate() { - // We are hot reloading! - if (this.version !== version) { - this.version = version; - this.initSelector(); + _classCallCheck(this, MemoryRouter); - if (this.subscription) this.subscription.tryUnsubscribe(); - this.initSubscription(); - if (shouldHandleStateChanges) this.subscription.trySubscribe(); - } - }; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default.a(Connect, WrappedComponent); + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + MemoryRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Router__["a" /* default */], { history: this.history, children: this.props.children }); }; -} -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) + + return MemoryRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + +MemoryRouter.propTypes = { + initialEntries: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array, + initialIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (MemoryRouter); /***/ }), -/* 77 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; -/* unused harmony export getDependsOnOwnProps */ -/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(78); -function wrapMapToPropsConstant(getConstant) { - return function initConstantSelector(dispatch, options) { - var constant = getConstant(dispatch, options); +exports.__esModule = true; - function constantSelector() { - return constant; - } - constantSelector.dependsOnOwnProps = false; - return constantSelector; - }; -} +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args -// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine -// whether mapToProps needs to be invoked when props have changed. -// -// A length of one signals that mapToProps does not depend on props from the parent component. -// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and -// therefore not reporting its length accurately.. -function getDependsOnOwnProps(mapToProps) { - return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; -} +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, -// this function wraps mapToProps in a proxy function which does several things: -// -// * Detects whether the mapToProps function being called depends on props, which -// is used by selectorFactory to decide if it should reinvoke on props changes. -// -// * On first call, handles mapToProps if returns another function, and treats that -// new function as the true mapToProps for subsequent calls. -// -// * On first call, verifies the first result is a plain object, in order to warn -// the developer that their mapToProps function is not returning a valid result. -// -function wrapMapToPropsFunc(mapToProps, methodName) { - return function initProxySelector(dispatch, _ref) { - var displayName = _ref.displayName; +var _warning = __webpack_require__(8); - var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { - return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); - }; +var _warning2 = _interopRequireDefault(_warning); - // allow detectFactoryAndVerify to get ownProps - proxy.dependsOnOwnProps = true; +var _PathUtils = __webpack_require__(10); - proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { - proxy.mapToProps = mapToProps; - proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); - var props = proxy(stateOrDispatch, ownProps); +var _LocationUtils = __webpack_require__(18); - if (typeof props === 'function') { - proxy.mapToProps = props; - proxy.dependsOnOwnProps = getDependsOnOwnProps(props); - props = proxy(stateOrDispatch, ownProps); - } +var _createTransitionManager = __webpack_require__(19); - if (process.env.NODE_ENV !== 'production') __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */](props, displayName, methodName); +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - return props; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return proxy; +var clamp = function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); +}; + +/** + * Creates a history object that stores locations in memory. + */ +var createMemoryHistory = function createMemoryHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var getUserConfirmation = props.getUserConfirmation, + _props$initialEntries = props.initialEntries, + initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries, + _props$initialIndex = props.initialIndex, + initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex, + _props$keyLength = props.keyLength, + keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; + + + var transitionManager = (0, _createTransitionManager2.default)(); + + var setState = function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + + transitionManager.notifyListeners(history.location, history.action); }; -} -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) -/***/ }), -/* 78 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var createKey = function createKey() { + return Math.random().toString(36).substr(2, keyLength); + }; -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(67); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(68); + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey()); + }); + // Public interface + var createHref = _PathUtils.createPath; -function verifyPlainObject(value, displayName, methodName) { - if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */](value)) { - __WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */](methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.'); - } -} + var push = function push(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); -/***/ }), -/* 79 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(71); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(82); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(83); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + }; -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; + var replace = function replace(path, state) { + (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); -/** Built-in value references. */ -var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */](value) - : __WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */](value); -} + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; -/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); + history.entries[history.index] = location; + setState({ action: action, location: location }); + }); + }; -/***/ }), -/* 80 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var go = function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(81); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + }; -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + var goBack = function goBack() { + return go(-1); + }; -/** Used as a reference to the global object. */ -var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); + var goForward = function goForward() { + return go(1); + }; -/* harmony default export */ __webpack_exports__["a"] = (root); + var canGo = function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + }; + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + return transitionManager.setPrompt(prompt); + }; -/***/ }), -/* 81 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var listen = function listen(listener) { + return transitionManager.appendListener(listener); + }; -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; -/* harmony default export */ __webpack_exports__["a"] = (freeGlobal); + return history; +}; -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(72))) +exports.default = createMemoryHistory; /***/ }), -/* 82 */ +/* 88 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(71); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/** Used for built-in method references. */ -var objectProto = Object.prototype; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; -/** Built-in value references. */ -var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * The public API for prompting the user before navigating away + * from a screen with a component. */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/* harmony default export */ __webpack_exports__["a"] = (getRawTag); - - -/***/ }), -/* 83 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +var Prompt = function (_React$Component) { + _inherits(Prompt, _React$Component); -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} + function Prompt() { + _classCallCheck(this, Prompt); -/* harmony default export */ __webpack_exports__["a"] = (objectToString); + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + Prompt.prototype.enable = function enable(message) { + if (this.unblock) this.unblock(); -/***/ }), -/* 84 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + this.unblock = this.context.router.history.block(message); + }; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(85); + Prompt.prototype.disable = function disable() { + if (this.unblock) { + this.unblock(); + this.unblock = null; + } + }; + Prompt.prototype.componentWillMount = function componentWillMount() { + if (this.props.when) this.enable(this.props.message); + }; -/** Built-in value references. */ -var getPrototype = __WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */](Object.getPrototypeOf, Object); + Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (nextProps.when) { + if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message); + } else { + this.disable(); + } + }; -/* harmony default export */ __webpack_exports__["a"] = (getPrototype); + Prompt.prototype.componentWillUnmount = function componentWillUnmount() { + this.disable(); + }; + Prompt.prototype.render = function render() { + return null; + }; -/***/ }), -/* 85 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + return Prompt; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); -"use strict"; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} +Prompt.propTypes = { + when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired +}; +Prompt.defaultProps = { + when: true +}; +Prompt.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired + }).isRequired +}; -/* harmony default export */ __webpack_exports__["a"] = (overArg); +/* harmony default export */ __webpack_exports__["a"] = (Prompt); /***/ }), -/* 86 */ +/* 89 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/* harmony default export */ __webpack_exports__["a"] = (isObjectLike); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(88); -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { +/** + * The public API for updating the location programatically + * with a component. + */ -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, module) { +var Redirect = function (_React$Component) { + _inherits(Redirect, _React$Component); -Object.defineProperty(exports, "__esModule", { - value: true -}); + function Redirect() { + _classCallCheck(this, Redirect); -var _ponyfill = __webpack_require__(90); + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } -var _ponyfill2 = _interopRequireDefault(_ponyfill); + Redirect.prototype.isStatic = function isStatic() { + return this.context.router && this.context.router.staticContext; + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + Redirect.prototype.componentWillMount = function componentWillMount() { + if (this.isStatic()) this.perform(); + }; -var root; /* global window */ + Redirect.prototype.componentDidMount = function componentDidMount() { + if (!this.isStatic()) this.perform(); + }; + Redirect.prototype.perform = function perform() { + var history = this.context.router.history; + var _props = this.props, + push = _props.push, + to = _props.to; -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (true) { - root = module; -} else { - root = Function('return this')(); -} -var result = (0, _ponyfill2['default'])(root); -exports['default'] = result; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(72), __webpack_require__(89)(module))) + if (push) { + history.push(to); + } else { + history.replace(to); + } + }; -/***/ }), -/* 89 */ -/***/ (function(module, exports) { + Redirect.prototype.render = function render() { + return null; + }; -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; + return Redirect; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + +Redirect.propTypes = { + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]) +}; +Redirect.defaultProps = { + push: false +}; +Redirect.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired + }).isRequired, + staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object + }).isRequired +}; +/* harmony default export */ __webpack_exports__["a"] = (Redirect); + /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var isarray = __webpack_require__(91) +/** + * Expose `pathToRegexp`. + */ +module.exports = pathToRegexp +module.exports.parse = parse +module.exports.compile = compile +module.exports.tokensToFunction = tokensToFunction +module.exports.tokensToRegExp = tokensToRegExp -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = symbolObservablePonyfill; -function symbolObservablePonyfill(root) { - var result; - var _Symbol = root.Symbol; +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' +].join('|'), 'g') - if (typeof _Symbol === 'function') { - if (_Symbol.observable) { - result = _Symbol.observable; - } else { - result = _Symbol('observable'); - _Symbol.observable = result; - } - } else { - result = '@@observable'; - } +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse (str, options) { + var tokens = [] + var key = 0 + var index = 0 + var path = '' + var defaultDelimiter = options && options.delimiter || '/' + var res - return result; -}; + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0] + var escaped = res[1] + var offset = res.index + path += str.slice(index, offset) + index = offset + m.length -/***/ }), -/* 91 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1] + continue + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(70); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(67); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(73); + var next = str[index] + var prefix = res[2] + var name = res[3] + var capture = res[4] + var group = res[5] + var modifier = res[6] + var asterisk = res[7] + + // Push the current path onto the tokens. + if (path) { + tokens.push(path) + path = '' + } + var partial = prefix != null && next != null && next !== prefix + var repeat = modifier === '+' || modifier === '*' + var optional = modifier === '?' || modifier === '*' + var delimiter = res[2] || defaultDelimiter + var pattern = capture || group + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }) + } + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index) + } -function getUndefinedStateErrorMessage(key, action) { - var actionType = action && action.type; - var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; + // If the path exists, push it onto the end. + if (path) { + tokens.push(path) + } - return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; + return tokens } -function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile (str, options) { + return tokensToFunction(parse(str, options)) +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} - if (reducerKeys.length === 0) { - return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; - } +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length) - if (!__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */](inputState)) { - return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') + } } - var unexpectedKeys = Object.keys(inputState).filter(function (key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - - unexpectedKeys.forEach(function (key) { - unexpectedKeyCache[key] = true; - }); + return function (obj, opts) { + var path = '' + var data = obj || {} + var options = opts || {} + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent - if (unexpectedKeys.length > 0) { - return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); - } -} + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] -function assertReducerShape(reducers) { - Object.keys(reducers).forEach(function (key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT }); + if (typeof token === 'string') { + path += token - if (typeof initialState === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); - } + continue + } - var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); - if (typeof reducer(undefined, { type: type }) === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); - } - }); -} + var value = data[token.name] + var segment -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @param {Object} reducers An object whose values correspond to different - * reducer functions that need to be combined into one. One handy way to obtain - * it is to use ES6 `import * as reducers` syntax. The reducers may never return - * undefined for any action. Instead, they should return their initial state - * if the state passed to them was undefined, and the current state for any - * unrecognized action. - * - * @returns {Function} A reducer function that invokes every reducer inside the - * passed object, and builds a state object with the same shape. - */ -function combineReducers(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - for (var i = 0; i < reducerKeys.length; i++) { - var key = reducerKeys[i]; + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix + } - if (process.env.NODE_ENV !== 'production') { - if (typeof reducers[key] === 'undefined') { - __WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */]('No reducer provided for key "' + key + '"'); + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } } - } - if (typeof reducers[key] === 'function') { - finalReducers[key] = reducers[key]; - } - } - var finalReducerKeys = Object.keys(finalReducers); + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } - var unexpectedKeyCache = void 0; - if (process.env.NODE_ENV !== 'production') { - unexpectedKeyCache = {}; - } + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } - var shapeAssertionError = void 0; - try { - assertReducerShape(finalReducers); - } catch (e) { - shapeAssertionError = e; - } + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]) - return function combination() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments[1]; + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } - if (shapeAssertionError) { - throw shapeAssertionError; - } + path += (j === 0 ? token.prefix : token.delimiter) + segment + } - if (process.env.NODE_ENV !== 'production') { - var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); - if (warningMessage) { - __WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */](warningMessage); + continue } - } - var hasChanged = false; - var nextState = {}; - for (var _i = 0; _i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); - if (typeof nextStateForKey === 'undefined') { - var errorMessage = getUndefinedStateErrorMessage(_key, action); - throw new Error(errorMessage); + segment = token.asterisk ? encodeAsterisk(value) : encode(value) + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') } - nextState[_key] = nextStateForKey; - hasChanged = hasChanged || nextStateForKey !== previousStateForKey; - } - return hasChanged ? nextState : state; - }; -} -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) -/***/ }), -/* 92 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + path += token.prefix + segment + } -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators; -function bindActionCreator(actionCreator, dispatch) { - return function () { - return dispatch(actionCreator.apply(undefined, arguments)); - }; + return path + } } /** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. + * Escape a regular expression string. * - * For convenience, you can also pass a single function as the first argument, - * and get a function in return. + * @param {string} str + * @return {string} + */ +function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') +} + +/** + * Escape the capturing group by escaping special characters and meaning. * - * @param {Function|Object} actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. + * @param {string} group + * @return {string} + */ +function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') +} + +/** + * Attach the keys as a property of the regexp. * - * @param {Function} dispatch The `dispatch` function available on your Redux - * store. + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ +function attachKeys (re, keys) { + re.keys = keys + return re +} + +/** + * Get the flags for a regexp from the options. * - * @returns {Function|Object} The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. + * @param {Object} options + * @return {string} */ -function bindActionCreators(actionCreators, dispatch) { - if (typeof actionCreators === 'function') { - return bindActionCreator(actionCreators, dispatch); - } +function flags (options) { + return options.sensitive ? '' : 'i' +} - if (typeof actionCreators !== 'object' || actionCreators === null) { - throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); - } +/** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ +function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g) - var keys = Object.keys(actionCreators); - var boundActionCreators = {}; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var actionCreator = actionCreators[key]; - if (typeof actionCreator === 'function') { - boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }) } } - return boundActionCreators; + + return attachKeys(path, keys) } -/***/ }), -/* 93 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function arrayToRegexp (path, keys, options) { + var parts = [] -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(74); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source) + } + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) + return attachKeys(regexp, keys) +} /** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. + * Create a path regexp from string input. * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) +} + +/** + * Expose a function for taking tokens and returning a RegExp. * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} */ -function applyMiddleware() { - for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { - middlewares[_key] = arguments[_key]; +function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] } - return function (createStore) { - return function (reducer, preloadedState, enhancer) { - var store = createStore(reducer, preloadedState, enhancer); - var _dispatch = store.dispatch; - var chain = []; + options = options || {} - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch(action) { - return _dispatch(action); - } - }; - chain = middlewares.map(function (middleware) { - return middleware(middlewareAPI); - }); - _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); + var strict = options.strict + var end = options.end !== false + var route = '' - return _extends({}, store, { - dispatch: _dispatch - }); - }; - }; -} + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] -/***/ }), -/* 94 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (typeof token === 'string') { + route += escapeString(token) + } else { + var prefix = escapeString(token.prefix) + var capture = '(?:' + token.pattern + ')' -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(95); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(76); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(97); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; }); + keys.push(token) + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*' + } + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?' + } else { + capture = prefix + '(' + capture + ')?' + } + } else { + capture = prefix + '(' + capture + ')' + } + route += capture + } + } + var delimiter = escapeString(options.delimiter || '/') + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' + } -/***/ }), -/* 95 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (end) { + route += '$' + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = createProvider; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(75); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(68); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + return attachKeys(new RegExp('^' + route, flags(options)), keys) +} -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + options = options || {} + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) +} +/***/ }), +/* 91 */ +/***/ (function(module, exports) { -var didWarnAboutReceivingStore = false; -function warnAboutReceivingStore() { - if (didWarnAboutReceivingStore) { - return; - } - didWarnAboutReceivingStore = true; +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; - __WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */](' does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.'); -} -function createProvider() { - var _Provider$childContex; +/***/ }), +/* 92 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store'; - var subKey = arguments[1]; +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(20); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var subscriptionKey = subKey || storeKey + 'Subscription'; +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var Provider = function (_Component) { - _inherits(Provider, _Component); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - Provider.prototype.getChildContext = function getChildContext() { - var _ref; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref; - }; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function Provider(props, context) { - _classCallCheck(this, Provider); - var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); - _this[storeKey] = props.store; - return _this; - } - Provider.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children); - }; - return Provider; - }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - if (process.env.NODE_ENV !== 'production') { - Provider.prototype.componentWillReceiveProps = function (nextProps) { - if (this[storeKey] !== nextProps.store) { - warnAboutReceivingStore(); - } - }; - } - Provider.propTypes = { - store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired +var normalizeLocation = function normalizeLocation(object) { + var _object$pathname = object.pathname, + pathname = _object$pathname === undefined ? '/' : _object$pathname, + _object$search = object.search, + search = _object$search === undefined ? '' : _object$search, + _object$hash = object.hash, + hash = _object$hash === undefined ? '' : _object$hash; + + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash }; - Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex); - Provider.displayName = 'Provider'; +}; - return Provider; -} +var addBasename = function addBasename(basename, location) { + if (!basename) return location; + + return _extends({}, location, { + pathname: __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename) + location.pathname + }); +}; + +var stripBasename = function stripBasename(basename, location) { + if (!basename) return location; -/* harmony default export */ __webpack_exports__["b"] = (createProvider()); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) + var base = __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](basename); -/***/ }), -/* 96 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (location.pathname.indexOf(base) !== 0) return location; -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); +}; -// encapsulates the subscription logic for connecting a component to the redux store, as -// well as nesting subscriptions of descendant components, so that we can ensure the -// ancestor components re-render before descendants +var createLocation = function createLocation(location) { + return typeof location === 'string' ? __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["parsePath"](location) : normalizeLocation(location); +}; -var CLEARED = null; -var nullListeners = { - notify: function notify() {} +var createURL = function createURL(location) { + return typeof location === 'string' ? location : __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["createPath"](location); }; -function createListenerCollection() { - // the current/next pattern is copied from redux's createStore code. - // TODO: refactor+expose that code to be reusable here? - var current = []; - var next = []; +var staticHandler = function staticHandler(methodName) { + return function () { + __WEBPACK_IMPORTED_MODULE_0_invariant___default.a(false, 'You cannot %s with ', methodName); + }; +}; - return { - clear: function clear() { - next = CLEARED; - current = CLEARED; - }, - notify: function notify() { - var listeners = current = next; - for (var i = 0; i < listeners.length; i++) { - listeners[i](); - } - }, - subscribe: function subscribe(listener) { - var isSubscribed = true; - if (next === current) next = current.slice(); - next.push(listener); +var noop = function noop() {}; - return function unsubscribe() { - if (!isSubscribed || current === CLEARED) return; - isSubscribed = false; +/** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ - if (next === current) next = current.slice(); - next.splice(next.indexOf(listener), 1); - }; +var StaticRouter = function (_React$Component) { + _inherits(StaticRouter, _React$Component); + + function StaticRouter() { + var _temp, _this, _ret; + + _classCallCheck(this, StaticRouter); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - }; -} -var Subscription = function () { - function Subscription(store, parentSub, onStateChange) { - _classCallCheck(this, Subscription); + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) { + return __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"](_this.props.basename + createURL(path)); + }, _this.handlePush = function (location) { + var _this$props = _this.props, + basename = _this$props.basename, + context = _this$props.context; - this.store = store; - this.parentSub = parentSub; - this.onStateChange = onStateChange; - this.unsubscribe = null; - this.listeners = nullListeners; - } + context.action = 'PUSH'; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }, _this.handleReplace = function (location) { + var _this$props2 = _this.props, + basename = _this$props2.basename, + context = _this$props2.context; - Subscription.prototype.addNestedSub = function addNestedSub(listener) { - this.trySubscribe(); - return this.listeners.subscribe(listener); - }; + context.action = 'REPLACE'; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }, _this.handleListen = function () { + return noop; + }, _this.handleBlock = function () { + return noop; + }, _temp), _possibleConstructorReturn(_this, _ret); + } - Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() { - this.listeners.notify(); + StaticRouter.prototype.getChildContext = function getChildContext() { + return { + router: { + staticContext: this.props.context + } + }; }; - Subscription.prototype.isSubscribed = function isSubscribed() { - return Boolean(this.unsubscribe); - }; + StaticRouter.prototype.render = function render() { + var _props = this.props, + basename = _props.basename, + context = _props.context, + location = _props.location, + props = _objectWithoutProperties(_props, ['basename', 'context', 'location']); - Subscription.prototype.trySubscribe = function trySubscribe() { - if (!this.unsubscribe) { - this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); + var history = { + createHref: this.createHref, + action: 'POP', + location: stripBasename(basename, createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler('go'), + goBack: staticHandler('goBack'), + goForward: staticHandler('goForward'), + listen: this.handleListen, + block: this.handleBlock + }; - this.listeners = createListenerCollection(); - } + return __WEBPACK_IMPORTED_MODULE_1_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], _extends({}, props, { history: history })); }; - Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() { - if (this.unsubscribe) { - this.unsubscribe(); - this.unsubscribe = null; - this.listeners.clear(); - this.listeners = nullListeners; - } - }; + return StaticRouter; +}(__WEBPACK_IMPORTED_MODULE_1_react__["default"].Component); - return Subscription; -}(); +StaticRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + context: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired, + location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object]) +}; +StaticRouter.defaultProps = { + basename: '', + location: '/' +}; +StaticRouter.childContextTypes = { + router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired +}; +/* harmony default export */ __webpack_exports__["a"] = (StaticRouter); /***/ }), -/* 97 */ +/* 93 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* unused harmony export createConnect */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(76); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(98); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(99); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(100); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(101); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(102); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(21); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/* - connect is a facade over connectAdvanced. It turns its args into a compatible - selectorFactory, which has the signature: - (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps - - connect passes its args to connectAdvanced as options, which will in turn pass them to - selectorFactory each time a Connect component instance is instantiated or hot reloaded. +/** + * The public API for rendering the first that matches. + */ - selectorFactory returns a final props selector from its mapStateToProps, - mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, - mergePropsFactories, and pure args. +var Switch = function (_React$Component) { + _inherits(Switch, _React$Component); - The resulting final props selector is called by the Connect component instance whenever - it receives new props or store state. - */ + function Switch() { + _classCallCheck(this, Switch); -function match(arg, factories, name) { - for (var i = factories.length - 1; i >= 0; i--) { - var result = factories[i](arg); - if (result) return result; + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } - return function (dispatch, options) { - throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); + Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + + __WEBPACK_IMPORTED_MODULE_2_warning___default.a(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); }; -} -function strictEqual(a, b) { - return a === b; -} + Switch.prototype.render = function render() { + var route = this.context.router.route; + var children = this.props.children; -// createConnect with default args builds the 'official' connect behavior. Calling it with -// different options opens up some testing and extensibility scenarios -function createConnect() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$connectHOC = _ref.connectHOC, - connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC, - _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, - mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF, - _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, - mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro, - _ref$mergePropsFactor = _ref.mergePropsFactories, - mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor, - _ref$selectorFactory = _ref.selectorFactory, - selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory; + var location = this.props.location || route.location; - return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { - var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, - _ref2$pure = _ref2.pure, - pure = _ref2$pure === undefined ? true : _ref2$pure, - _ref2$areStatesEqual = _ref2.areStatesEqual, - areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, - _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, - areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua, - _ref2$areStatePropsEq = _ref2.areStatePropsEqual, - areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq, - _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, - areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE, - extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); + var match = void 0, + child = void 0; + __WEBPACK_IMPORTED_MODULE_0_react__["default"].Children.forEach(children, function (element) { + if (!__WEBPACK_IMPORTED_MODULE_0_react__["default"].isValidElement(element)) return; + + var _element$props = element.props, + pathProp = _element$props.path, + exact = _element$props.exact, + strict = _element$props.strict, + from = _element$props.from; - var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); - var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); - var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); + var path = pathProp || from; - return connectHOC(selectorFactory, _extends({ - // used in error messages - methodName: 'connect', + if (match == null) { + child = element; + match = path ? __WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */](location.pathname, { path: path, exact: exact, strict: strict }) : route.match; + } + }); - // used to compute Connect's displayName from the wrapped component's displayName. - getDisplayName: function getDisplayName(name) { - return 'Connect(' + name + ')'; - }, + return match ? __WEBPACK_IMPORTED_MODULE_0_react__["default"].cloneElement(child, { location: location, computedMatch: match }) : null; + }; - // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes - shouldHandleStateChanges: Boolean(mapStateToProps), + return Switch; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); - // passed through to selectorFactory - initMapStateToProps: initMapStateToProps, - initMapDispatchToProps: initMapDispatchToProps, - initMergeProps: initMergeProps, - pure: pure, - areStatesEqual: areStatesEqual, - areOwnPropsEqual: areOwnPropsEqual, - areStatePropsEqual: areStatePropsEqual, - areMergedPropsEqual: areMergedPropsEqual +Switch.contextTypes = { + router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired + }).isRequired +}; +Switch.propTypes = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; - }, extraOptions)); - }; -} -/* harmony default export */ __webpack_exports__["a"] = (createConnect()); +/* harmony default export */ __webpack_exports__["a"] = (Switch); /***/ }), -/* 98 */ +/* 94 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual; -var hasOwn = Object.prototype.hasOwnProperty; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(36); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -function is(x, y) { - if (x === y) { - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } -} +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } -function shallowEqual(objA, objB) { - if (is(objA, objB)) return true; - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); - if (keysA.length !== keysB.length) return false; - for (var i = 0; i < keysA.length; i++) { - if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} +/** + * A public higher-order component to access the imperative API + */ +var withRouter = function withRouter(Component) { + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']); + + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], { render: function render(routeComponentProps) { + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef })); + } }); + }; + + C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')'; + C.WrappedComponent = Component; + C.propTypes = { + wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func + }; + + return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default.a(C, Component); +}; + +/* harmony default export */ __webpack_exports__["a"] = (withRouter); /***/ }), -/* 99 */ +/* 95 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* unused harmony export whenMapDispatchToPropsIsFunction */ -/* unused harmony export whenMapDispatchToPropsIsMissing */ -/* unused harmony export whenMapDispatchToPropsIsObject */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(69); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(77); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__ = __webpack_require__(96); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(4); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { - return typeof mapDispatchToProps === 'function' ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */](mapDispatchToProps, 'mapDispatchToProps') : undefined; -} -function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { - return !mapDispatchToProps ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function (dispatch) { - return { dispatch: dispatch }; - }) : undefined; -} -function whenMapDispatchToPropsIsObject(mapDispatchToProps) { - return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function (dispatch) { - return __WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"](mapDispatchToProps, dispatch); - }) : undefined; -} -/* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); -/***/ }), -/* 100 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* unused harmony export whenMapStateToPropsIsFunction */ -/* unused harmony export whenMapStateToPropsIsMissing */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(77); +/** + * The public API for a that uses window.location.hash. + */ +var HashRouter = function (_React$Component) { + _inherits(HashRouter, _React$Component); -function whenMapStateToPropsIsFunction(mapStateToProps) { - return typeof mapStateToProps === 'function' ? __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */](mapStateToProps, 'mapStateToProps') : undefined; -} + function HashRouter() { + var _temp, _this, _ret; -function whenMapStateToPropsIsMissing(mapStateToProps) { - return !mapStateToProps ? __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */](function () { - return {}; - }) : undefined; -} + _classCallCheck(this, HashRouter); -/* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default.a(_this.props), _temp), _possibleConstructorReturn(_this, _ret); + } + + HashRouter.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["e" /* Router */], { history: this.history, children: this.props.children }); + }; + + return HashRouter; +}(__WEBPACK_IMPORTED_MODULE_0_react__["default"].Component); + +HashRouter.propTypes = { + basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + hashType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']), + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + + +/* harmony default export */ __webpack_exports__["a"] = (HashRouter); /***/ }), -/* 101 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export defaultMergeProps */ -/* unused harmony export wrapMergePropsFunc */ -/* unused harmony export whenMergePropsIsFunction */ -/* unused harmony export whenMergePropsIsOmitted */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(78); + + +exports.__esModule = true; + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +var _warning = __webpack_require__(8); +var _warning2 = _interopRequireDefault(_warning); -function defaultMergeProps(stateProps, dispatchProps, ownProps) { - return _extends({}, ownProps, stateProps, dispatchProps); -} +var _invariant = __webpack_require__(9); -function wrapMergePropsFunc(mergeProps) { - return function initMergePropsProxy(dispatch, _ref) { - var displayName = _ref.displayName, - pure = _ref.pure, - areMergedPropsEqual = _ref.areMergedPropsEqual; +var _invariant2 = _interopRequireDefault(_invariant); - var hasRunOnce = false; - var mergedProps = void 0; +var _LocationUtils = __webpack_require__(18); - return function mergePropsProxy(stateProps, dispatchProps, ownProps) { - var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); +var _PathUtils = __webpack_require__(10); - if (hasRunOnce) { - if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; - } else { - hasRunOnce = true; - mergedProps = nextMergedProps; +var _createTransitionManager = __webpack_require__(19); - if (process.env.NODE_ENV !== 'production') __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */](mergedProps, displayName, 'mergeProps'); - } +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - return mergedProps; - }; - }; -} +var _DOMUtils = __webpack_require__(35); -function whenMergePropsIsFunction(mergeProps) { - return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var HashChangeEvent = 'hashchange'; + +var HashPathCoders = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: _PathUtils.stripLeadingSlash, + decodePath: _PathUtils.addLeadingSlash + }, + slash: { + encodePath: _PathUtils.addLeadingSlash, + decodePath: _PathUtils.addLeadingSlash + } +}; + +var getHashPath = function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); +}; + +var pushHashPath = function pushHashPath(path) { + return window.location.hash = path; +}; + +var replaceHashPath = function replaceHashPath(path) { + var hashIndex = window.location.href.indexOf('#'); + + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); +}; + +var createHashHistory = function createHashHistory() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM'); -function whenMergePropsIsOmitted(mergeProps) { - return !mergeProps ? function () { - return defaultMergeProps; - } : undefined; -} + var globalHistory = window.history; + var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)(); -/* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) + var _props$getUserConfirm = props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, + _props$hashType = props.hashType, + hashType = _props$hashType === undefined ? 'slash' : _props$hashType; -/***/ }), -/* 102 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */ -/* unused harmony export pureFinalPropsSelectorFactory */ -/* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(103); -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + var _HashPathCoders$hashT = HashPathCoders[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + var getDOMLocation = function getDOMLocation() { + var path = decodePath(getHashPath()); -function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { - return function impureFinalPropsSelector(state, ownProps) { - return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); - }; -} + (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); -function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { - var areStatesEqual = _ref.areStatesEqual, - areOwnPropsEqual = _ref.areOwnPropsEqual, - areStatePropsEqual = _ref.areStatePropsEqual; + if (basename) path = (0, _PathUtils.stripBasename)(path, basename); - var hasRunAtLeastOnce = false; - var state = void 0; - var ownProps = void 0; - var stateProps = void 0; - var dispatchProps = void 0; - var mergedProps = void 0; + return (0, _LocationUtils.createLocation)(path); + }; - function handleFirstCall(firstState, firstOwnProps) { - state = firstState; - ownProps = firstOwnProps; - stateProps = mapStateToProps(state, ownProps); - dispatchProps = mapDispatchToProps(dispatch, ownProps); - mergedProps = mergeProps(stateProps, dispatchProps, ownProps); - hasRunAtLeastOnce = true; - return mergedProps; - } + var transitionManager = (0, _createTransitionManager2.default)(); - function handleNewPropsAndNewState() { - stateProps = mapStateToProps(state, ownProps); + var setState = function setState(nextState) { + _extends(history, nextState); - if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); + history.length = globalHistory.length; - mergedProps = mergeProps(stateProps, dispatchProps, ownProps); - return mergedProps; - } + transitionManager.notifyListeners(history.location, history.action); + }; - function handleNewProps() { - if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); + var forceNextPop = false; + var ignorePath = null; - if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); + var handleHashChange = function handleHashChange() { + var path = getHashPath(); + var encodedPath = encodePath(path); - mergedProps = mergeProps(stateProps, dispatchProps, ownProps); - return mergedProps; - } + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; - function handleNewState() { - var nextStateProps = mapStateToProps(state, ownProps); - var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); - stateProps = nextStateProps; + if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change. - if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); + if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace. - return mergedProps; - } + ignorePath = null; - function handleSubsequentCalls(nextState, nextOwnProps) { - var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); - var stateChanged = !areStatesEqual(nextState, state); - state = nextState; - ownProps = nextOwnProps; + handlePop(location); + } + }; - if (propsChanged && stateChanged) return handleNewPropsAndNewState(); - if (propsChanged) return handleNewProps(); - if (stateChanged) return handleNewState(); - return mergedProps; - } + var handlePop = function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; - return function pureFinalPropsSelector(nextState, nextOwnProps) { - return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ action: action, location: location }); + } else { + revertPop(location); + } + }); + } }; -} -// TODO: Add more comments + var revertPop = function revertPop(fromLocation) { + var toLocation = history.location; -// If pure is true, the selector returned by selectorFactory will memoize its results, -// allowing connectAdvanced's shouldComponentUpdate to return false if final -// props have not changed. If false, the selector will always return a new -// object and shouldComponentUpdate will always return true. + // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. -function finalPropsSelectorFactory(dispatch, _ref2) { - var initMapStateToProps = _ref2.initMapStateToProps, - initMapDispatchToProps = _ref2.initMapDispatchToProps, - initMergeProps = _ref2.initMergeProps, - options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); + var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation)); - var mapStateToProps = initMapStateToProps(dispatch, options); - var mapDispatchToProps = initMapDispatchToProps(dispatch, options); - var mergeProps = initMergeProps(dispatch, options); + if (toIndex === -1) toIndex = 0; - if (process.env.NODE_ENV !== 'production') { - __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__["a" /* default */](mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); - } + var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation)); - var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; + if (fromIndex === -1) fromIndex = 0; - return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); -} -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4))) + var delta = toIndex - fromIndex; -/***/ }), -/* 103 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + if (delta) { + forceNextPop = true; + go(delta); + } + }; -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = verifySubselectors; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(68); + // Ensure the hash is encoded properly before doing anything else. + var path = getHashPath(); + var encodedPath = encodePath(path); + if (path !== encodedPath) replaceHashPath(encodedPath); -function verify(selector, methodName, displayName) { - if (!selector) { - throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.'); - } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { - if (!selector.hasOwnProperty('dependsOnOwnProps')) { - __WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */]('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.'); - } - } -} + var initialLocation = getDOMLocation(); + var allPaths = [(0, _PathUtils.createPath)(initialLocation)]; -function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) { - verify(mapStateToProps, 'mapStateToProps', displayName); - verify(mapDispatchToProps, 'mapDispatchToProps', displayName); - verify(mergeProps, 'mergeProps', displayName); -} + // Public interface -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { + var createHref = function createHref(location) { + return '#' + encodePath(basename + (0, _PathUtils.createPath)(location)); + }; -"use strict"; + var push = function push(path, state) { + (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored'); + var action = 'PUSH'; + var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); -Object.defineProperty(exports, "__esModule", { - value: true -}); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; -var _redux = __webpack_require__(69); + var path = (0, _PathUtils.createPath)(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; -var _currentTask = __webpack_require__(109); + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath(encodedPath); -var _currentTask2 = _interopRequireDefault(_currentTask); + var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); -var _audioPlayer = __webpack_require__(115); + nextPaths.push(path); + allPaths = nextPaths; -var _audioPlayer2 = _interopRequireDefault(_audioPlayer); + setState({ action: action, location: location }); + } else { + (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + setState(); + } + }); + }; -var cortexApp = (0, _redux.combineReducers)({ - currentTask: _currentTask2.default, - audioPlayer: _audioPlayer2.default -}); + var replace = function replace(path, state) { + (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored'); -exports.default = cortexApp; + var action = 'REPLACE'; + var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; -"use strict"; + var path = (0, _PathUtils.createPath)(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath(encodedPath); + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -var audioPlayFile = exports.audioPlayFile = function audioPlayFile(file) { - return { - type: 'AUDIO_PLAY_FILE', - file: file - }; -}; + var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location)); -var audioPause = exports.audioPause = function audioPause() { - return { - type: 'AUDIO_PAUSE' - }; -}; + if (prevIndex !== -1) allPaths[prevIndex] = path; -var setContent = exports.setContent = function setContent(content) { - return { - type: 'SET_CONTENT', - file: content + setState({ action: action, location: location }); + }); }; -}; -var setStyle = exports.setStyle = function setStyle(style) { - return { - type: 'SET_STYLE', - file: style - }; -}; + var go = function go(n) { + (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); -var setAlpha = exports.setAlpha = function setAlpha(alpha) { - return { - type: 'SET_ALPHA', - alpha: alpha + globalHistory.go(n); }; -}; -var createTask = exports.createTask = function createTask() { - return { - type: 'CREATE_TASK' + var goBack = function goBack() { + return go(-1); }; -}; -var addTask = exports.addTask = function addTask() { - return { - type: 'ADD_TASK' + var goForward = function goForward() { + return go(1); }; -}; -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { + var listenerCount = 0; -"use strict"; + var checkDOMListeners = function checkDOMListeners(delta) { + listenerCount += delta; + if (listenerCount === 1) { + (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); + } + }; -Object.defineProperty(exports, "__esModule", { - value: true -}); + var isBlocked = false; -var _reactRedux = __webpack_require__(94); + var block = function block() { + var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; -var _actions = __webpack_require__(105); + var unblock = transitionManager.setPrompt(prompt); -var _Link = __webpack_require__(108); + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } -var _Link2 = _interopRequireDefault(_Link); + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return unblock(); + }; + }; -var mapStateToProps = function mapStateToProps(state, ownProps) { - return {}; -}; + var listen = function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); -var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { - return { - onClick: function onClick() { - dispatch((0, _actions.setContent)(ownProps.file)); - } + return function () { + checkDOMListeners(-1); + unlisten(); + }; + }; + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen }; + + return history; }; -var TaskContentLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); +exports.default = createHashHistory; + +/***/ }), +/* 97 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["a"]; }); -exports.default = TaskContentLink; /***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { +/* 98 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(37); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -Object.defineProperty(exports, "__esModule", { - value: true -}); +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } -var _reactRedux = __webpack_require__(94); -var _actions = __webpack_require__(105); -var _Link = __webpack_require__(108); -var _Link2 = _interopRequireDefault(_Link); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var mapStateToProps = function mapStateToProps(state, ownProps) { - return {}; -}; +/** + * A wrapper that knows if it's "active" or not. + */ +var NavLink = function NavLink(_ref) { + var to = _ref.to, + exact = _ref.exact, + strict = _ref.strict, + location = _ref.location, + activeClassName = _ref.activeClassName, + className = _ref.className, + activeStyle = _ref.activeStyle, + style = _ref.style, + getIsActive = _ref.isActive, + rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive']); -var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { - return { - onClick: function onClick() { - dispatch((0, _actions.setStyle)(ownProps.file)); + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["d" /* Route */], { + path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to, + exact: exact, + strict: strict, + location: location, + children: function children(_ref2) { + var location = _ref2.location, + match = _ref2.match; + + var isActive = !!(getIsActive ? getIsActive(match, location) : match); + + return __WEBPACK_IMPORTED_MODULE_0_react__["default"].createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({ + to: to, + className: isActive ? [activeClassName, className].filter(function (i) { + return i; + }).join(' ') : className, + style: isActive ? _extends({}, style, activeStyle) : style + }, rest)); } - }; + }); }; -var TaskStyleLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); +NavLink.propTypes = { + to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to, + exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func +}; -exports.default = TaskStyleLink; +NavLink.defaultProps = { + activeClassName: 'active' +}; + +/* harmony default export */ __webpack_exports__["a"] = (NavLink); /***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { +/* 99 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["b"]; }); -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _preact = __webpack_require__(3); - -var _react = __webpack_require__(1); +/***/ }), +/* 100 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var _react2 = _interopRequireDefault(_react); +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["c"]; }); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// import PropTypes from 'prop-types' +/***/ }), +/* 101 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var Link = function Link(_ref) { - var active = _ref.active, - children = _ref.children, - _onClick = _ref.onClick; +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["d"]; }); - if (active) { - return (0, _preact.h)( - 'span', - null, - children - ); - } - return ( - // eslint-disable-next-line - (0, _preact.h)( - 'a', - { href: '#', - onClick: function onClick(e) { - e.preventDefault(); - _onClick(); - } - }, - children - ) - ); -}; +/***/ }), +/* 102 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -// Link.propTypes = { -// active: PropTypes.bool.isRequired, -// children: PropTypes.node.isRequired, -// onClick: PropTypes.func.isRequired -// } +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["e"]; }); -exports.default = Link; /***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { +/* 103 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["f"]; }); -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +/***/ }), +/* 104 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var _actions = __webpack_require__(105); +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["g"]; }); -var _client = __webpack_require__(8); -var _client2 = _interopRequireDefault(_client); +/***/ }), +/* 105 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["h"]; }); -var currentTask = function currentTask() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments[1]; - switch (action.type) { - case 'SET_CONTENT': - return _extends({}, state, { - content: action.file - }); - case 'SET_STYLE': - return _extends({}, state, { - style: action.file - }); - case 'SET_ALPHA': - return _extends({}, state, { - alpha: action.alpha - }); - case 'CREATE_TASK': - var record = { - content_file_id: state.content.id, - style_file_id: state.style.id, - alpha: state.alpha || '0.001', - command: 'nsatf.py', - completed: false - }; - _client2.default.task.create(record).then(function (data) { - (0, _actions.addTask)(data); - }); +/***/ }), +/* 106 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return state; - // case 'ADD_TASK': - // return { - // ...state - // } - default: - return state; - } -}; +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(4); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["i"]; }); -exports.default = currentTask; /***/ }), -/* 110 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8840,19 +8997,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _preact = __webpack_require__(3); - -var _reactRouterDom = __webpack_require__(5); +var _reactRedux = __webpack_require__(6); -var _client = __webpack_require__(8); +var _actions = __webpack_require__(7); -var _client2 = _interopRequireDefault(_client); - -var _reactRedux = __webpack_require__(94); - -var _actions = __webpack_require__(105); - -var _TaskFormView = __webpack_require__(66); +var _TaskFormView = __webpack_require__(108); var _TaskFormView2 = _interopRequireDefault(_TaskFormView); @@ -8882,7 +9031,7 @@ var TaskForm = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Ta exports.default = TaskForm; /***/ }), -/* 111 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8891,184 +9040,117 @@ exports.default = TaskForm; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = TaskFormView; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var _actions = __webpack_require__(105); +var _reactRouterDom = __webpack_require__(34); -var _client = __webpack_require__(8); +var _client = __webpack_require__(5); var _client2 = _interopRequireDefault(_client); -var _FileUploadButton = __webpack_require__(65); - -var _FileUploadButton2 = _interopRequireDefault(_FileUploadButton); - -var _fileLink = __webpack_require__(116); - -var _fileLink2 = _interopRequireDefault(_fileLink); - -var _taskContentLink = __webpack_require__(106); - -var _taskContentLink2 = _interopRequireDefault(_taskContentLink); - -var _taskStyleLink = __webpack_require__(107); - -var _taskStyleLink2 = _interopRequireDefault(_taskStyleLink); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Files = function (_Component) { - _inherits(Files, _Component); - - function Files(props) { - _classCallCheck(this, Files); +function TaskFormView(props) { + // console.log(props) + return (0, _preact.h)( + 'div', + { 'class': 'form' }, + (0, _preact.h)( + 'div', + null, + props.content && (0, _preact.h)( + 'div', + null, + props.content.name + ), + (0, _preact.h)( + 'label', + null, + 'content' + ), + (0, _preact.h)( + 'button', + { onClick: props.clearContent }, + 'x' + ) + ), + (0, _preact.h)( + 'div', + null, + props.style && (0, _preact.h)( + 'div', + null, + props.style.name + ), + (0, _preact.h)( + 'label', + null, + 'style' + ), + (0, _preact.h)( + 'button', + { onClick: props.clearStyle }, + 'x' + ) + ), + (0, _preact.h)( + 'div', + null, + (0, _preact.h)('input', { type: 'range', step: '0.01', min: '0.001', max: '1', value: props.alpha, + onInput: function onInput(e) { + return props.setAlpha(e.target.value); + } + }), + 'alpha: ', + props.alpha + ), + (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + 'button', + { onClick: props.createTask }, + 'Create' + ) + ) + ); +} - var _this = _possibleConstructorReturn(this, (Files.__proto__ || Object.getPrototypeOf(Files)).call(this)); +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { - _this.state = { - files: props.folder.files || [], - selected: null - }; - _this.addFiles = _this.addFiles.bind(_this); - if (!props.folder.files) { - _client2.default.file.index({ folder_id: props.folder.id }).then(function (files) { - return _this.setState({ files: files }); - }); - } - return _this; - } +"use strict"; - _createClass(Files, [{ - key: 'addFiles', - value: function addFiles(newFiles) { - if (!newFiles) return; - var files = this.state.files.concat(newFiles).sort(function (a, b) { - return b.id - a.id; - }); - this.setState({ files: files }); - } - }, { - key: 'handleClick', - value: function handleClick(file) { - this.setState({ selected: file }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - var files = this.state.files.map(toFilenamePair).sort(sortByFilename).map(fromPair).map(function (file, i) { - if (!file) return; - return (0, _preact.h)( - 'div', - { key: i, 'class': _this2.state.selected === file ? 'selected' : '' }, - (0, _preact.h)( - 'span', - { 'class': 'name' }, - (0, _preact.h)( - _fileLink2.default, - { file: file }, - file.name - ) - ), - (0, _preact.h)( - 'span', - { 'class': 'mime' }, - file.processed ? file.mime : 'working...' - ), - (0, _preact.h)( - 'span', - { 'class': 'duration' }, - file.duration ? file.duration.toFixed(1) + 's' : '' - ), - (0, _preact.h)( - 'span', - { 'class': 'actions' }, - (0, _preact.h)( - _taskContentLink2.default, - { file: file }, - 'content' - ), - (0, _preact.h)( - _taskStyleLink2.default, - { file: file }, - 'style' - ) - ) - ); - }); - return (0, _preact.h)( - 'div', - { 'class': 'window' }, - (0, _preact.h)( - 'div', - { 'class': 'heading' }, - (0, _preact.h)( - 'b', - null, - this.props.folder.name - ), - (0, _preact.h)( - 'div', - { 'class': 'buttons' }, - (0, _preact.h)(_FileUploadButton2.default, { folder: this.props.folder, addFiles: this.addFiles }), - (0, _preact.h)( - 'button', - { onClick: this.props.onClose }, - '\xD7' - ) - ) - ), - (0, _preact.h)( - 'div', - { 'class': 'list' }, - files - ) - ); - } - }]); +Object.defineProperty(exports, "__esModule", { + value: true +}); - return Files; -}(_preact.Component); +var _reactRedux = __webpack_require__(6); -exports.default = Files; +var _TaskListView = __webpack_require__(110); +var _TaskListView2 = _interopRequireDefault(_TaskListView); -function toFilenamePair(file) { - return [file.name.toLowerCase(), file]; -} -function sortByFilename(a, b) { - return a[0] < b[0] ? -1 : a[0] == b[0] ? 0 : 1; -} -function fromPair(pair) { - return pair[1]; -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var mapStateToProps = function mapStateToProps(state) { + return { tasks: state.tasks }; +}; +// import {} from '../actions' -function filepath(file) { - return '/data/' + file.folder_id + '/' + encodeURIComponent(file.name); -} -function mp3path(file) { - if (file.mime !== 'audio/mp3') { - return filepath(file) + '.mp3'; - } - return filepath(file); -} -function pngpath(file) { - return filepath(file) + '.png'; -} + +var mapDispatchToProps = {}; + +var TaskList = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_TaskListView2.default); + +exports.default = TaskList; /***/ }), -/* 112 */, -/* 113 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9077,47 +9159,66 @@ function pngpath(file) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = AudioPlayer; +exports.default = TaskListView; -var _preact = __webpack_require__(3); +var _preact = __webpack_require__(0); -var audio = document.createElement('audio'); +var _fileLink = __webpack_require__(33); -function AudioPlayer(props) { - if (props.file) { - document.body.style.backgroundImage = 'url(' + pngpath(file) + ')'; - audio.src = mp3path(props.file); - audio.play(); - return (0, _preact.h)( - 'div', - null, - 'Playing ', - props.file.name - ); - } else { +var _fileLink2 = _interopRequireDefault(_fileLink); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function TaskListView(props) { + var tasks = (props.tasks || []).map(function (task, i) { return (0, _preact.h)( 'div', - null, - 'Not Playing' + { key: i }, + (0, _preact.h)( + 'span', + null, + task.id + ), + (0, _preact.h)( + 'span', + null, + task.created_at + ), + (0, _preact.h)( + 'span', + { 'class': 'name' }, + (0, _preact.h)( + _fileLink2.default, + { file: task.content_file }, + task.content_file.name + ) + ), + (0, _preact.h)( + 'span', + { 'class': 'name' }, + (0, _preact.h)( + _fileLink2.default, + { file: task.style_file }, + task.style_file.name + ) + ), + (0, _preact.h)( + 'span', + null, + task.alpha + ) ); - } -} - -function filepath(file) { - return '/data/' + file.folder_id + '/' + encodeURIComponent(file.name); -} -function mp3path(file) { - if (file.mime !== 'audio/mp3') { - return filepath(file) + '.mp3'; - } - return filepath(file); -} -function pngpath(file) { - return filepath(file) + '.png'; + // {task.result_file.name} + }); + return (0, _preact.h)( + 'div', + { 'class': 'list' }, + tasks + ); } /***/ }), -/* 114 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9127,28 +9228,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _reactRedux = __webpack_require__(94); +var _redux = __webpack_require__(15); -var _AudioPlayer = __webpack_require__(113); +var _audioPlayer = __webpack_require__(112); -var _AudioPlayer2 = _interopRequireDefault(_AudioPlayer); +var _audioPlayer2 = _interopRequireDefault(_audioPlayer); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _currentTask = __webpack_require__(113); -var mapStateToProps = function mapStateToProps(state) { - return state.audioPlayer; -}; +var _currentTask2 = _interopRequireDefault(_currentTask); -var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { - return {}; -}; +var _tasks = __webpack_require__(114); + +var _tasks2 = _interopRequireDefault(_tasks); + +var _folders = __webpack_require__(115); + +var _folders2 = _interopRequireDefault(_folders); -var AudioPlayerContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_AudioPlayer2.default); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var cortexApp = (0, _redux.combineReducers)({ + audioPlayer: _audioPlayer2.default, + currentTask: _currentTask2.default, + tasks: _tasks2.default, + folders: _folders2.default +}); -exports.default = AudioPlayerContainer; +exports.default = cortexApp; /***/ }), -/* 115 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9160,7 +9270,7 @@ Object.defineProperty(exports, "__esModule", { var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _client = __webpack_require__(8); +var _client = __webpack_require__(5); var _client2 = _interopRequireDefault(_client); @@ -9187,7 +9297,7 @@ var audioPlayer = function audioPlayer() { exports.default = audioPlayer; /***/ }), -/* 116 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9197,35 +9307,195 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _reactRedux = __webpack_require__(94); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _actions = __webpack_require__(105); +var _actions = __webpack_require__(7); -var _Link = __webpack_require__(108); +var _client = __webpack_require__(5); -var _Link2 = _interopRequireDefault(_Link); +var _client2 = _interopRequireDefault(_client); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var mapStateToProps = function mapStateToProps(state, ownProps) { - return {}; +var currentTask = function currentTask() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'SET_CONTENT': + return _extends({}, state, { + content: action.file + }); + case 'SET_STYLE': + return _extends({}, state, { + style: action.file + }); + case 'SET_ALPHA': + return _extends({}, state, { + alpha: action.alpha + }); + case 'CREATE_TASK': + var record = { + content_file_id: state.content.id, + style_file_id: state.style.id, + alpha: state.alpha || '0.001', + command: 'nsatf.py', + completed: false + }; + _client2.default.task.create(record).then(function (data) { + (0, _actions.addTask)(data); + }); + + return state; + // case 'ADD_TASK': + // return { + // ...state + // } + default: + return state; + } }; -var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { - return { - onClick: function onClick() { - switch (ownProps.file.type) { - case 'audio': - dispatch((0, _actions.audioPlayFile)(ownProps.file)); - break; +exports.default = currentTask; + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _client = __webpack_require__(5); + +var _client2 = _interopRequireDefault(_client); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var tasks = function tasks() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + switch (action.type) { + case 'LOAD_TASKS': + return action.tasks; + default: + return state; + } +}; // import { addTask } from '../actions' +exports.default = tasks; + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // import { addTask } from '../actions' + + +var _client = __webpack_require__(5); + +var _client2 = _interopRequireDefault(_client); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var folders = function folders() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + var file = void 0, + folders = void 0, + folder_id = void 0; + + switch (action.type) { + case 'LOAD_FOLDERS': + return _extends({}, state, { + folders: action.folders + }); + case 'LOAD_FILES': + if (!action.files.length) { + return state; } - } - }; + folder_id = action.files[0].folder_id; + console.log(state.folders); + folders = state.folders.map(function (folder) { + if (folder.id === folder_id) { + folder.files = action.files; + } + return folder; + }); + return _extends({}, state, { + folders: folders + }); + case 'LOAD_OPEN_FOLDERS': + return _extends({}, state, { + openFolders: action.folders + }); + case 'UPDATE_FILE': + file = action.file; + folders = state.folders.map(function (folder) { + if (folder.id === file.folder_id && folder.files) { + folder.files = folder.files.map(function (f) { + return f.id == file.id ? file : f; + }); + return Object.assign({}, folder); + } else { + return folder; + } + }); + + return _extends({}, state, { + folders: folders + }); + default: + return state; + } }; -var FileLink = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Link2.default); +exports.default = folders; -exports.default = FileLink; +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _actions = __webpack_require__(7); + +var _store = __webpack_require__(38); + +var _store2 = _interopRequireDefault(_store); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var socket = io(window.location.origin); + +socket.on('connect', function (data) { + console.log('connected'); +}); +socket.on('worker', function (data) { + console.log('worker connected', data); +}); +socket.on('processed', function (data) { + console.log('processed', data); + _store2.default.dispatch((0, _actions.updateFile)(data.file)); +}); + +exports.default = socket; /***/ }) /******/ ]); -- cgit v1.2.3-70-g09d2