/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
/* global chrome */
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 _Panel = __webpack_require__(4);
var checkForReact = __webpack_require__(236);
var _inject = __webpack_require__(237);
var config = {
reload: reload,
checkForReact: checkForReact,
alreadyFoundReact: false,
reloadSubscribe: function reloadSubscribe(reloadFn) {
chrome.devtools.network.onNavigated.addListener(reloadFn);
return function () {
chrome.devtools.network.onNavigated.removeListener(reloadFn);
};
},
getNewSelection: function getNewSelection(bridge) {
chrome.devtools.inspectedWindow.eval('window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = $0');
bridge.send('checkSelection');
},
selectElement: function selectElement(id, bridge) {
bridge.send('putSelectedNode', id);
setTimeout(function () {
chrome.devtools.inspectedWindow.eval('inspect(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$node)');
}, 100);
},
showComponentSource: function showComponentSource(vbl) {
// if it is an es6 class-based component, (isMounted throws), then inspect
// the constructor. Otherwise, inspect the render function.
var code = 'Object.getOwnPropertyDescriptor(window.' + vbl + '.__proto__.__proto__, \'isMounted\') &&\n Object.getOwnPropertyDescriptor(window.' + vbl + '.__proto__.__proto__, \'isMounted\').value ?\n inspect(window.' + vbl + '.render) : inspect(window.' + vbl + '.constructor)';
chrome.devtools.inspectedWindow.eval(code, function (res, err) {
if (err) {
console.error('Failed to inspect component', err);
}
});
},
showAttrSource: function showAttrSource(path) {
var attrs = '[' + path.map(function (m) {
return JSON.stringify(m);
}).join('][') + ']';
var code = 'inspect(window.$r' + attrs + ')';
chrome.devtools.inspectedWindow.eval(code, function (res, err) {
if (err) {
console.error('Failed to inspect source', err);
}
});
},
executeFn: function executeFn(path) {
var attrs = '[' + path.map(function (m) {
return JSON.stringify(m);
}).join('][') + ']';
var code = 'window.$r' + attrs + '()';
chrome.devtools.inspectedWindow.eval(code, function (res, err) {
if (err) {
console.error('Failed to call function', err);
}
});
},
inject: function inject(done) {
_inject(chrome.runtime.getURL('build/backend.js'), function () {
var port = chrome.runtime.connect({
name: '' + chrome.devtools.inspectedWindow.tabId
});
var disconnected = false;
var wall = {
listen: function listen(fn) {
port.onMessage.addListener(function (message) {
return fn(message);
});
},
send: function send(data) {
if (disconnected) {
return;
}
port.postMessage(data);
}
};
port.onDisconnect.addListener(function () {
disconnected = true;
});
done(wall, function () {
return port.disconnect();
});
});
}
};
var Panel = __webpack_require__(4);
var React = __webpack_require__(31);
var ReactDOM = __webpack_require__(190);
var node = document.getElementById('container');
function reload() {
setTimeout(function () {
ReactDOM.unmountComponentAtNode(node);
node.innerHTML = '';
ReactDOM.render(React.createElement(Panel, config), node);
}, 100);
}
ReactDOM.render(React.createElement(Panel, _extends({ alreadyFoundReact: true }, config)), node);
/***/ },
/* 1 */,
/* 2 */,
/* 3 */,
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
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 _types = __webpack_require__(5);
var _Bridge = __webpack_require__(6);
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
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 React = __webpack_require__(31);
var Container = __webpack_require__(188);
var Store = __webpack_require__(214);
var keyboardNav = __webpack_require__(222);
var invariant = __webpack_require__(206);
var assign = __webpack_require__(192);
var Bridge = __webpack_require__(6);
var NativeStyler = __webpack_require__(224);
var RelayPlugin = __webpack_require__(227);
var consts = __webpack_require__(7);
var Panel = (function (_React$Component) {
_inherits(Panel, _React$Component);
// TODO: typecheck plugin interface
function Panel(props) {
_classCallCheck(this, Panel);
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Panel).call(this, props));
_this.state = { loading: true, isReact: _this.props.alreadyFoundReact };
_this._unMounted = false;
window.panel = _this;
_this.plugins = [];
return _this;
}
_createClass(Panel, [{
key: 'getChildContext',
value: function getChildContext() {
return {
store: this._store
};
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
if (this.props.alreadyFoundReact) {
this.inject();
} else {
this.lookForReact();
}
if (this.props.reloadSubscribe) {
this._unsub = this.props.reloadSubscribe(function () {
return _this2.reload();
});
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._unMounted = true;
if (this._unsub) {
this._unsub();
}
}
}, {
key: 'pauseTransfer',
value: function pauseTransfer() {
if (this._bridge) {
this._bridge.pause();
}
}
}, {
key: 'resumeTransfer',
value: function resumeTransfer() {
if (this._bridge) {
this._bridge.resume();
}
}
}, {
key: 'reload',
value: function reload() {
if (this._unsub) {
this._unsub();
}
this.teardown();
if (!this._unMounted) {
this.setState({ loading: true }, this.props.reload);
}
}
}, {
key: 'getNewSelection',
value: function getNewSelection() {
if (!this._bridge || !this.props.getNewSelection) {
return;
}
this.props.getNewSelection(this._bridge);
}
}, {
key: 'hideHighlight',
value: function hideHighlight() {
this._store.hideHighlight();
}
}, {
key: 'sendSelection',
value: function sendSelection(id) {
if (!this._bridge || !id && !this._store.selected) {
return;
}
invariant(this.props.selectElement, 'cannot send selection if props.selectElement is not defined');
// $FlowFixMe either id or this._store.selected is a string
this.props.selectElement(id || this._store.selected, this._bridge);
}
}, {
key: 'inspectComponent',
value: function inspectComponent(vbl) {
invariant(this.props.showComponentSource, 'cannot inspect component if props.showComponentSource is not supplied');
this.props.showComponentSource(vbl || '$r');
}
}, {
key: 'viewSource',
value: function viewSource(id) {
var _this3 = this;
if (!this._bridge) {
return;
}
this._bridge.send('putSelectedInstance', id);
setTimeout(function () {
invariant(_this3.props.showComponentSource, 'cannot view source if props.showComponentSource is not supplied');
_this3.props.showComponentSource('__REACT_DEVTOOLS_GLOBAL_HOOK__.$inst');
}, 100);
}
}, {
key: 'teardown',
value: function teardown() {
this.plugins.forEach(function (p) {
return p.teardown();
});
this.plugins = [];
if (this._keyListener) {
window.removeEventListener('keydown', this._keyListener);
this._keyListener = null;
}
if (this._bridge) {
this._bridge.send('shutdown');
}
if (this._teardownWall) {
this._teardownWall();
this._teardownWall = null;
}
}
}, {
key: 'inject',
value: function inject() {
var _this4 = this;
this.props.inject(function (wall, teardown) {
_this4._teardownWall = teardown;
_this4._bridge = new Bridge(wall);
_this4._store = new Store(_this4._bridge);
var refresh = function refresh() {
return _this4.forceUpdate();
};
_this4.plugins = [new RelayPlugin(_this4._store, _this4._bridge, refresh)];
_this4._keyListener = keyboardNav(_this4._store, window);
window.addEventListener('keydown', _this4._keyListener);
_this4._store.on('connected', function () {
_this4.setState({ loading: false });
_this4.getNewSelection();
});
});
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
var _this5 = this;
if (!this.state.isReact) {
if (!this._checkTimeout) {
this._checkTimeout = setTimeout(function () {
_this5._checkTimeout = null;
_this5.lookForReact();
}, 200);
}
}
}
}, {
key: 'lookForReact',
value: function lookForReact() {
var _this6 = this;
if (typeof this.props.checkForReact !== 'function') {
return;
}
this.props.checkForReact(function (isReact) {
if (isReact) {
_this6.setState({ isReact: true, loading: true });
_this6.inject();
} else {
console.log('still looking...');
_this6.setState({ isReact: false, loading: false });
}
});
}
}, {
key: 'render',
value: function render() {
var _ref,
_this7 = this;
if (this.state.loading) {
// TODO: This currently shows in the Firefox shell when navigating from a
// React page to a non-React page. We should show a better message but
// properly doing so probably requires refactoring how we load the panel
// and communicate with the bridge.
return React.createElement(
'div',
{ style: styles.loading },
React.createElement(
'h1',
null,
'Connecting to React...'
),
React.createElement('br', null),
'If this is React Native, you need to interact with the app (just tap the screen) in order to establish the bridge.'
);
}
if (!this.state.isReact) {
return React.createElement(
'div',
{ style: styles.loading },
React.createElement(
'h1',
null,
'Looking for React...'
)
);
}
var extraTabs = assign.apply(null, [{}].concat(this.plugins.map(function (p) {
return p.tabs();
})));
var extraPanes = (_ref = []).concat.apply(_ref, _toConsumableArray(this.plugins.map(function (p) {
return p.panes();
})));
if (this._store.capabilities.rnStyle) {
extraPanes.push(panelRNStyle(this._bridge));
}
return React.createElement(Container, {
reload: this.props.reload && this.reload.bind(this),
menuItems: {
attr: function attr(id, node, val, path, name) {
if (!val || node.get('nodeType') !== 'Composite' || val[consts.type] !== 'function') {
return undefined;
}
return [_this7.props.showAttrSource && {
title: 'Show Source',
// $FlowFixMe showAttrSource is provided
action: function action() {
return _this7.props.showAttrSource(path);
}
}, _this7.props.executeFn && {
title: 'Execute function',
// $FlowFixMe executeFn is provided
action: function action() {
return _this7.props.executeFn(path);
}
}];
},
tree: function tree(id, node) {
return [_this7.props.showComponentSource && node.get('nodeType') === 'Composite' && {
title: 'Show Source',
action: function action() {
return _this7.viewSource(id);
}
}, _this7.props.selectElement && _this7._store.capabilities.dom && {
title: 'Show in Elements Pane',
action: function action() {
return _this7.sendSelection(id);
}
}];
}
},
extraPanes: extraPanes,
extraTabs: extraTabs
});
}
}]);
return Panel;
})(React.Component);
Panel.childContextTypes = {
store: React.PropTypes.object
};
var panelRNStyle = function panelRNStyle(bridge) {
return function (node, id) {
var props = node.get('props');
if (!props || !props.style) {
return React.createElement(
'strong',
null,
'No style'
);
}
return React.createElement(
'div',
null,
React.createElement(
'h3',
null,
'React Native Style Editor'
),
React.createElement(NativeStyler, { id: id, bridge: bridge })
);
};
};
var styles = {
chromePane: {
display: 'flex'
},
stretch: {
flex: 1
},
loading: {
textAlign: 'center',
color: '#888',
padding: 30,
flex: 1
}
};
module.exports = Panel;
/***/ },
/* 5 */
/***/ function(module, exports) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
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 _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; }; })();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var consts = __webpack_require__(7);
var hydrate = __webpack_require__(26);
var dehydrate = __webpack_require__(27);
var performanceNow = __webpack_require__(28);
/**
* The bridge is responsible for serializing requests between the Agent and
* the Frontend Store. It needs to be connected to a Wall object that can send
* JSONable data to the bridge on the other side.
*
* complex data
* |
* v
* [Bridge]
* |
* jsonable data
* |
* v
* [wall]
* |
* v
* ~ some barrier ~
* |
* v
* [wall]
* |
* v
* [Bridge]
* |
* v
* "hydrated" data
*
* When an item is passed in that can't be serialized (anything other than a
* plain array, object, or literal value), the object is "cleaned", and
* rehydrated on the other side with `Symbol` attributes indicating that the
* object needs to be inspected for more detail.
*
* Example:
*
* bridge.send('evname', {id: 'someid', foo: MyCoolObjectInstance})
* ->
* shows up, hydrated as
* {
* id: 'someid',
* foo: {
* [consts.name]: 'MyCoolObjectInstance',
* [consts.type]: 'object',
* [consts.meta]: {},
* [consts.inspected]: false,
* }
* }
*
* The `consts` variables are Symbols, and as such are non-ennumerable.
* The front-end therefore needs to check for `consts.inspected` on received
* objects, and can thereby display object proxies and inspect them.
*
* Complex objects that are passed are expected to have a top-level `id`
* attribute, which is used for later lookup + inspection. Once it has been
* determined that an object is no longer needed, call `.forget(id)` to clean
* up.
*/
var Bridge = (function () {
function Bridge(wall) {
_classCallCheck(this, Bridge);
this._cbs = new Map();
this._inspectables = new Map();
this._cid = 0;
this._listeners = {};
this._buffer = [];
this._waiting = null;
this._lastTime = 5;
this._callers = {};
this._paused = false;
this._wall = wall;
wall.listen(this._handleMessage.bind(this));
}
_createClass(Bridge, [{
key: 'inspect',
value: function inspect(id, path, cb) {
var _cid = this._cid++;
this._cbs.set(_cid, function (data, cleaned, proto, protoclean) {
if (cleaned.length) {
hydrate(data, cleaned);
}
if (proto && protoclean.length) {
hydrate(proto, protoclean);
}
if (proto) {
data[consts.proto] = proto;
}
cb(data);
});
this._wall.send({
type: 'inspect',
callback: _cid,
path: path,
id: id
});
}
}, {
key: 'call',
value: function call(name, args, cb) {
var _cid = this._cid++;
this._cbs.set(_cid, cb);
this._wall.send({
type: 'call',
callback: _cid,
args: args,
name: name
});
}
}, {
key: 'onCall',
value: function onCall(name, handler) {
if (this._callers[name]) {
throw new Error('only one call handler per call name allowed');
}
this._callers[name] = handler;
}
}, {
key: 'pause',
value: function pause() {
this._wall.send({
type: 'pause'
});
}
}, {
key: 'resume',
value: function resume() {
this._wall.send({
type: 'resume'
});
}
}, {
key: 'setInspectable',
value: function setInspectable(id, data) {
var prev = this._inspectables.get(id);
if (!prev) {
this._inspectables.set(id, data);
return;
}
this._inspectables.set(id, _extends({}, prev, data));
}
}, {
key: 'sendOne',
value: function sendOne(evt, data) {
var cleaned = [];
var san = dehydrate(data, cleaned);
if (cleaned.length) {
this.setInspectable(data.id, data);
}
this._wall.send({ type: 'event', evt: evt, data: san, cleaned: cleaned });
}
}, {
key: 'send',
value: function send(evt, data) {
var _this = this;
if (!this._waiting && !this._paused) {
this._buffer = [];
var nextTime = this._lastTime * 3;
if (nextTime > 500) {
// flush is taking an unexpected amount of time
nextTime = 500;
}
this._waiting = setTimeout(function () {
_this.flush();
_this._waiting = null;
}, nextTime);
}
this._buffer.push({ evt: evt, data: data });
}
}, {
key: 'flush',
value: function flush() {
var _this2 = this;
var start = performanceNow();
var events = this._buffer.map(function (_ref) {
var evt = _ref.evt;
var data = _ref.data;
var cleaned = [];
var san = dehydrate(data, cleaned);
if (cleaned.length) {
_this2.setInspectable(data.id, data);
}
return { type: 'event', evt: evt, data: san, cleaned: cleaned };
});
this._wall.send({ type: 'many-events', events: events });
this._buffer = [];
this._waiting = null;
this._lastTime = performanceNow() - start;
}
}, {
key: 'forget',
value: function forget(id) {
this._inspectables.delete(id);
}
}, {
key: 'on',
value: function on(evt, fn) {
if (!this._listeners[evt]) {
this._listeners[evt] = [fn];
} else {
this._listeners[evt].push(fn);
}
}
}, {
key: 'off',
value: function off(evt, fn) {
if (!this._listeners[evt]) {
return;
}
var ix = this._listeners[evt].indexOf(fn);
if (ix !== -1) {
this._listeners[evt].splice(ix, 1);
}
}
}, {
key: 'once',
value: function once(evt, fn) {
var self = this;
var listener = function listener() {
fn.apply(this, arguments);
self.off(evt, listener);
};
this.on(evt, listener);
}
}, {
key: '_handleMessage',
value: function _handleMessage(payload) {
var _this3 = this;
if (payload.type === 'resume') {
this._paused = false;
this._waiting = null;
this.flush();
return;
}
if (payload.type === 'pause') {
this._paused = true;
clearTimeout(this._waiting);
this._waiting = null;
return;
}
if (payload.type === 'callback') {
var callback = this._cbs.get(payload.id);
if (callback) {
callback.apply(undefined, _toConsumableArray(payload.args));
this._cbs.delete(payload.id);
}
return;
}
if (payload.type === 'call') {
this._handleCall(payload.name, payload.args, payload.callback);
return;
}
if (payload.type === 'inspect') {
this._inspectResponse(payload.id, payload.path, payload.callback);
return;
}
if (payload.type === 'event') {
// console.log('[bridge<-]', payload.evt);
if (payload.cleaned) {
hydrate(payload.data, payload.cleaned);
}
var fns = this._listeners[payload.evt];
var data = payload.data;
if (fns) {
fns.forEach(function (fn) {
return fn(data);
});
}
}
if (payload.type === 'many-events') {
payload.events.forEach(function (event) {
// console.log('[bridge<-]', payload.evt);
if (event.cleaned) {
hydrate(event.data, event.cleaned);
}
var handlers = _this3._listeners[event.evt];
if (handlers) {
handlers.forEach(function (fn) {
return fn(event.data);
});
}
});
}
}
}, {
key: '_handleCall',
value: function _handleCall(name, args, callback) {
if (!this._callers[name]) {
console.warn('unknown call: "' + name + '"');
return;
}
args = !Array.isArray(args) ? [args] : args;
var result;
try {
result = this._callers[name].apply(null, args);
} catch (e) {
console.error('Failed to call', e);
return;
}
this._wall.send({
type: 'callback',
id: callback,
args: [result]
});
}
}, {
key: '_inspectResponse',
value: function _inspectResponse(id, path, callback) {
var inspectable = this._inspectables.get(id);
var result = {};
var cleaned = [];
var proto = null;
var protoclean = [];
if (inspectable) {
var val = getIn(inspectable, path);
var protod = false;
var isFn = typeof val === 'function';
Object.getOwnPropertyNames(val).forEach(function (name) {
if (name === '__proto__') {
protod = true;
}
if (isFn && (name === 'arguments' || name === 'callee' || name === 'caller')) {
return;
}
result[name] = dehydrate(val[name], cleaned, [name]);
});
/* eslint-disable no-proto */
if (!protod && val.__proto__ && val.constructor.name !== 'Object') {
var newProto = {};
var pIsFn = typeof val.__proto__ === 'function';
Object.getOwnPropertyNames(val.__proto__).forEach(function (name) {
if (pIsFn && (name === 'arguments' || name === 'callee' || name === 'caller')) {
return;
}
newProto[name] = dehydrate(val.__proto__[name], protoclean, [name]);
});
proto = newProto;
}
/* eslint-enable no-proto */
}
this._wall.send({
type: 'callback',
id: callback,
args: [result, cleaned, proto, protoclean]
});
}
}]);
return Bridge;
})();
function getIn(base, path) {
return path.reduce(function (obj, attr) {
return obj ? obj[attr] : null;
}, base);
}
module.exports = Bridge;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
var Symbol = __webpack_require__(8);
module.exports = {
name: Symbol('name'),
type: Symbol('type'),
inspected: Symbol('inspected'),
meta: Symbol('meta'),
proto: Symbol('proto')
};
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(9)() ? Symbol : __webpack_require__(10);
/***/ },
/* 9 */
/***/ function(module, exports) {
'use strict';
module.exports = function () {
var symbol;
if (typeof Symbol !== 'function') return false;
symbol = Symbol('test symbol');
try { String(symbol); } catch (e) { return false; }
if (typeof Symbol.iterator === 'symbol') return true;
// Return 'true' for polyfills
if (typeof Symbol.isConcatSpreadable !== 'object') return false;
if (typeof Symbol.iterator !== 'object') return false;
if (typeof Symbol.toPrimitive !== 'object') return false;
if (typeof Symbol.toStringTag !== 'object') return false;
if (typeof Symbol.unscopables !== 'object') return false;
return true;
};
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
// ES2015 Symbol polyfill for environments that do not support it (or partially support it_
'use strict';
var d = __webpack_require__(11)
, validateSymbol = __webpack_require__(24)
, create = Object.create, defineProperties = Object.defineProperties
, defineProperty = Object.defineProperty, objPrototype = Object.prototype
, NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null);
if (typeof Symbol === 'function') NativeSymbol = Symbol;
var generateName = (function () {
var created = create(null);
return function (desc) {
var postfix = 0, name, ie11BugWorkaround;
while (created[desc + (postfix || '')]) ++postfix;
desc += (postfix || '');
created[desc] = true;
name = '@@' + desc;
defineProperty(objPrototype, name, d.gs(null, function (value) {
// For IE11 issue see:
// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
// ie11-broken-getters-on-dom-objects
// https://github.com/medikoo/es6-symbol/issues/12
if (ie11BugWorkaround) return;
ie11BugWorkaround = true;
defineProperty(this, name, d(value));
ie11BugWorkaround = false;
}));
return name;
};
}());
// Internal constructor (not one exposed) for creating Symbol instances.
// This one is used to ensure that `someSymbol instanceof Symbol` always return false
HiddenSymbol = function Symbol(description) {
if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
return SymbolPolyfill(description);
};
// Exposed `Symbol` constructor
// (returns instances of HiddenSymbol)
module.exports = SymbolPolyfill = function Symbol(description) {
var symbol;
if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
symbol = create(HiddenSymbol.prototype);
description = (description === undefined ? '' : String(description));
return defineProperties(symbol, {
__description__: d('', description),
__name__: d('', generateName(description))
});
};
defineProperties(SymbolPolyfill, {
for: d(function (key) {
if (globalSymbols[key]) return globalSymbols[key];
return (globalSymbols[key] = SymbolPolyfill(String(key)));
}),
keyFor: d(function (s) {
var key;
validateSymbol(s);
for (key in globalSymbols) if (globalSymbols[key] === s) return key;
}),
// If there's native implementation of given symbol, let's fallback to it
// to ensure proper interoperability with other native functions e.g. Array.from
hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')),
isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
SymbolPolyfill('isConcatSpreadable')),
iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')),
match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')),
replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')),
search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')),
species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')),
split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')),
toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')),
toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')),
unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables'))
});
// Internal tweaks for real symbol producer
defineProperties(HiddenSymbol.prototype, {
constructor: d(SymbolPolyfill),
toString: d('', function () { return this.__name__; })
});
// Proper implementation of methods exposed on Symbol.prototype
// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
defineProperties(SymbolPolyfill.prototype, {
toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
valueOf: d(function () { return validateSymbol(this); })
});
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('',
function () { return validateSymbol(this); }));
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
// Note: It's important to define `toPrimitive` as last one, as some implementations
// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
// And that may invoke error in definition flow:
// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var assign = __webpack_require__(12)
, normalizeOpts = __webpack_require__(19)
, isCallable = __webpack_require__(20)
, contains = __webpack_require__(21)
, d;
d = module.exports = function (dscr, value/*, options*/) {
var c, e, w, options, desc;
if ((arguments.length < 2) || (typeof dscr !== 'string')) {
options = value;
value = dscr;
dscr = null;
} else {
options = arguments[2];
}
if (dscr == null) {
c = w = true;
e = false;
} else {
c = contains.call(dscr, 'c');
e = contains.call(dscr, 'e');
w = contains.call(dscr, 'w');
}
desc = { value: value, configurable: c, enumerable: e, writable: w };
return !options ? desc : assign(normalizeOpts(options), desc);
};
d.gs = function (dscr, get, set/*, options*/) {
var c, e, options, desc;
if (typeof dscr !== 'string') {
options = set;
set = get;
get = dscr;
dscr = null;
} else {
options = arguments[3];
}
if (get == null) {
get = undefined;
} else if (!isCallable(get)) {
options = get;
get = set = undefined;
} else if (set == null) {
set = undefined;
} else if (!isCallable(set)) {
options = set;
set = undefined;
}
if (dscr == null) {
c = true;
e = false;
} else {
c = contains.call(dscr, 'c');
e = contains.call(dscr, 'e');
}
desc = { get: get, set: set, configurable: c, enumerable: e };
return !options ? desc : assign(normalizeOpts(options), desc);
};
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(13)()
? Object.assign
: __webpack_require__(14);
/***/ },
/* 13 */
/***/ function(module, exports) {
'use strict';
module.exports = function () {
var assign = Object.assign, obj;
if (typeof assign !== 'function') return false;
obj = { foo: 'raz' };
assign(obj, { bar: 'dwa' }, { trzy: 'trzy' });
return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy';
};
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var keys = __webpack_require__(15)
, value = __webpack_require__(18)
, max = Math.max;
module.exports = function (dest, src/*, …srcn*/) {
var error, i, l = max(arguments.length, 2), assign;
dest = Object(value(dest));
assign = function (key) {
try { dest[key] = src[key]; } catch (e) {
if (!error) error = e;
}
};
for (i = 1; i < l; ++i) {
src = arguments[i];
keys(src).forEach(assign);
}
if (error !== undefined) throw error;
return dest;
};
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(16)()
? Object.keys
: __webpack_require__(17);
/***/ },
/* 16 */
/***/ function(module, exports) {
'use strict';
module.exports = function () {
try {
Object.keys('primitive');
return true;
} catch (e) { return false; }
};
/***/ },
/* 17 */
/***/ function(module, exports) {
'use strict';
var keys = Object.keys;
module.exports = function (object) {
return keys(object == null ? object : Object(object));
};
/***/ },
/* 18 */
/***/ function(module, exports) {
'use strict';
module.exports = function (value) {
if (value == null) throw new TypeError("Cannot use null or undefined");
return value;
};
/***/ },
/* 19 */
/***/ function(module, exports) {
'use strict';
var forEach = Array.prototype.forEach, create = Object.create;
var process = function (src, obj) {
var key;
for (key in src) obj[key] = src[key];
};
module.exports = function (options/*, …options*/) {
var result = create(null);
forEach.call(arguments, function (options) {
if (options == null) return;
process(Object(options), result);
});
return result;
};
/***/ },
/* 20 */
/***/ function(module, exports) {
// Deprecated
'use strict';
module.exports = function (obj) { return typeof obj === 'function'; };
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(22)()
? String.prototype.contains
: __webpack_require__(23);
/***/ },
/* 22 */
/***/ function(module, exports) {
'use strict';
var str = 'razdwatrzy';
module.exports = function () {
if (typeof str.contains !== 'function') return false;
return ((str.contains('dwa') === true) && (str.contains('foo') === false));
};
/***/ },
/* 23 */
/***/ function(module, exports) {
'use strict';
var indexOf = String.prototype.indexOf;
module.exports = function (searchString/*, position*/) {
return indexOf.call(this, searchString, arguments[1]) > -1;
};
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var isSymbol = __webpack_require__(25);
module.exports = function (value) {
if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
return value;
};
/***/ },
/* 25 */
/***/ function(module, exports) {
'use strict';
module.exports = function (x) {
return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false;
};
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
var consts = __webpack_require__(7);
function hydrate(data, cleaned) {
cleaned.forEach(function (path) {
var last = path.pop();
var obj = path.reduce(function (obj_, attr) {
return obj_ ? obj_[attr] : null;
}, data);
if (!obj || !obj[last]) {
return;
}
var replace = {};
replace[consts.name] = obj[last].name;
replace[consts.type] = obj[last].type;
replace[consts.meta] = obj[last].meta;
replace[consts.inspected] = false;
obj[last] = replace;
});
}
module.exports = hydrate;
/***/ },
/* 27 */
/***/ function(module, exports) {
/**
* Copyright (c) 2015-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.
*
*
*/
'use strict';
/**
* Strip out complex data (instances, functions, and data nested > 2 levels
* deep). The paths of the stripped out objects are appended to the `cleaned`
* list. On the other side of the barrier, the cleaned list is used to
* "re-hydrate" the cleaned representation into an object with symbols as
* attributes, so that a sanitized object can be distinguished from a normal
* object.
*
* Input: {"some": {"attr": fn()}, "other": AnInstance}
* Output: {
* "some": {
* "attr": {"name": the fn.name, type: "function"}
* },
* "other": {
* "name": "AnInstance",
* "type": "object",
* },
* }
* and cleaned = [["some", "attr"], ["other"]]
*/
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
function dehydrate(data, cleaned, path, level) {
level = level || 0;
path = path || [];
if (typeof data === 'function') {
cleaned.push(path);
return {
name: data.name,
type: 'function'
};
}
if (!data || (typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== 'object') {
if (typeof data === 'string' && data.length > 500) {
return data.slice(0, 500) + '...';
}
// We have to do this assignment b/c Flow doesn't think "symbol" is
// something typeof would return. Error 'unexpected predicate "symbol"'
var type = typeof data === 'undefined' ? 'undefined' : _typeof(data);
if (type === 'symbol') {
cleaned.push(path);
return {
type: 'symbol',
name: data.toString()
};
}
return data;
}
if (data._reactFragment) {
// React Fragments error if you try to inspect them.
return 'A react fragment';
}
if (level > 2) {
cleaned.push(path);
return {
type: Array.isArray(data) ? 'array' : 'object',
name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name,
meta: Array.isArray(data) ? {
length: data.length
} : null
};
}
if (Array.isArray(data)) {
// $FlowFixMe path is not undefined.
return data.map(function (item, i) {
return dehydrate(item, cleaned, path.concat([i]), level + 1);
});
}
// TODO when this is in the iframe window, we can just use Object
if (data.constructor && typeof data.constructor === 'function' && data.constructor.name !== 'Object') {
cleaned.push(path);
return {
name: data.constructor.name,
type: 'object'
};
}
var res = {};
for (var name in data) {
res[name] = dehydrate(data[name], cleaned, path.concat([name]), level + 1);
}
return res;
}
module.exports = dehydrate;
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule performanceNow
* @typechecks
*/
'use strict';
var performance = __webpack_require__(29);
var performanceNow;
/**
* Detect if we can use `window.performance.now()` and gracefully fallback to
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
* because of Facebook's testing infrastructure.
*/
if (performance.now) {
performanceNow = function () {
return performance.now();
};
} else {
performanceNow = function () {
return Date.now();
};
}
module.exports = performanceNow;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule performance
* @typechecks
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(30);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.webkitPerformance;
}
module.exports = performance || {};
/***/ },
/* 30 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ExecutionEnvironment
*/
'use strict';
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
* Simple, lightweight module assisting with the detection and context of
* Worker. Helps avoid circular dependencies and allows code to reason about
* whether or not they are in a Worker, even if they never include the main
* `ReactWorker` dependency.
*/
var ExecutionEnvironment = {
canUseDOM: canUseDOM,
canUseWorkers: typeof Worker !== 'undefined',
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
canUseViewport: canUseDOM && !!window.screen,
isInWorker: !canUseDOM // For now, this is true - might change in the future.
};
module.exports = ExecutionEnvironment;
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(32);
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
/**
* 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.
*
* @providesModule React
*/
'use strict';
var ReactDOM = __webpack_require__(33);
var ReactDOMServer = __webpack_require__(178);
var ReactIsomorphic = __webpack_require__(182);
var assign = __webpack_require__(69);
var deprecated = __webpack_require__(187);
// `version` will be added here by ReactIsomorphic.
var React = {};
assign(React, ReactIsomorphic);
assign(React, {
// ReactDOM
findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
// ReactDOMServer
renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
});
React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
module.exports = React;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
/* 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.
*
* @providesModule ReactDOM
*/
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
'use strict';
var ReactCurrentOwner = __webpack_require__(35);
var ReactDOMTextComponent = __webpack_require__(36);
var ReactDefaultInjection = __webpack_require__(101);
var ReactInstanceHandles = __webpack_require__(75);
var ReactMount = __webpack_require__(58);
var ReactPerf = __webpack_require__(48);
var ReactReconciler = __webpack_require__(80);
var ReactUpdates = __webpack_require__(84);
var ReactVersion = __webpack_require__(176);
var findDOMNode = __webpack_require__(121);
var renderSubtreeIntoContainer = __webpack_require__(177);
var warning = __webpack_require__(55);
ReactDefaultInjection.inject();
var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
findDOMNode: findDOMNode,
render: render,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
version: ReactVersion,
/* eslint-disable camelcase */
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
};
// Inject the runtime into a devtools global hook regardless of browser.
// Allows for debugging when the hook is injected on the page.
/* eslint-enable camelcase */
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
CurrentOwner: ReactCurrentOwner,
InstanceHandles: ReactInstanceHandles,
Mount: ReactMount,
Reconciler: ReactReconciler,
TextComponent: ReactDOMTextComponent
});
}
if (process.env.NODE_ENV !== 'production') {
var ExecutionEnvironment = __webpack_require__(39);
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// First check if devtools is not installed
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
// If we're in Chrome or Firefox, provide a download link if not installed.
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
}
}
// If we're in IE8, check to see if we are in compatibility mode and provide
// information on preventing compatibility mode
var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '') : undefined;
var expectedFeatures = [
// shims
Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
// shams
Object.create, Object.freeze];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
break;
}
}
}
}
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(34)))
/***/ },
/* 34 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 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) {
setTimeout(drainQueue, 0);
}
};
// 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.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; };
/***/ },
/* 35 */
/***/ function(module, exports) {
/**
* 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.
*
* @providesModule ReactCurrentOwner
*/
'use strict';
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
/* 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.
*
* @providesModule ReactDOMTextComponent
* @typechecks static-only
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(37);
var DOMPropertyOperations = __webpack_require__(52);
var ReactComponentBrowserEnvironment = __webpack_require__(56);
var ReactMount = __webpack_require__(58);
var assign = __webpack_require__(69);
var escapeTextContentForBrowser = __webpack_require__(51);
var setTextContent = __webpack_require__(50);
var validateDOMNesting = __webpack_require__(100);
/**
* Text nodes violate a couple assumptions that React makes about components:
*
* - When mounting text into the DOM, adjacent text nodes are merged.
* - Text nodes cannot be assigned a React root ID.
*
* This component is used to wrap strings in elements so that they can undergo
* the same reconciliation that is applied to elements.
*
* TODO: Investigate representing React components in the DOM with text nodes.
*
* @class ReactDOMTextComponent
* @extends ReactComponent
* @internal
*/
var ReactDOMTextComponent = function (props) {
// This constructor and its argument is currently used by mocks.
};
assign(ReactDOMTextComponent.prototype, {
/**
* @param {ReactText} text
* @internal
*/
construct: function (text) {
// TODO: This is really a ReactText (ReactNode), not a ReactElement
this._currentElement = text;
this._stringText = '' + text;
// Properties
this._rootNodeID = null;
this._mountIndex = 0;
},
/**
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function (rootID, transaction, context) {
if (process.env.NODE_ENV !== 'production') {
if (context[validateDOMNesting.ancestorInfoContextKey]) {
validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
}
}
this._rootNodeID = rootID;
if (transaction.useCreateElement) {
var ownerDocument = context[ReactMount.ownerDocumentContextKey];
var el = ownerDocument.createElement('span');
DOMPropertyOperations.setAttributeForID(el, rootID);
// Populate node cache
ReactMount.getID(el);
setTextContent(el, this._stringText);
return el;
} else {
var escapedText = escapeTextContentForBrowser(this._stringText);
if (transaction.renderToStaticMarkup) {
// Normally we'd wrap this in a `span` for the reasons stated above, but
// since this is a situation where React won't take over (static pages),
// we can simply return the text as it is.
return escapedText;
}
return '' + escapedText + '';
}
},
/**
* Updates this component by updating the text content.
*
* @param {ReactText} nextText The next text content
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function (nextText, transaction) {
if (nextText !== this._currentElement) {
this._currentElement = nextText;
var nextStringText = '' + nextText;
if (nextStringText !== this._stringText) {
// TODO: Save this as pending props and use performUpdateIfNecessary
// and/or updateComponent to do the actual update for consistency with
// other component types?
this._stringText = nextStringText;
var node = ReactMount.getNode(this._rootNodeID);
DOMChildrenOperations.updateTextContent(node, nextStringText);
}
}
},
unmountComponent: function () {
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
}
});
module.exports = ReactDOMTextComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(34)))
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
/* 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.
*
* @providesModule DOMChildrenOperations
* @typechecks static-only
*/
'use strict';
var Danger = __webpack_require__(38);
var ReactMultiChildUpdateTypes = __webpack_require__(46);
var ReactPerf = __webpack_require__(48);
var setInnerHTML = __webpack_require__(49);
var setTextContent = __webpack_require__(50);
var invariant = __webpack_require__(43);
/**
* Inserts `childNode` as a child of `parentNode` at the `index`.
*
* @param {DOMElement} parentNode Parent node in which to insert.
* @param {DOMElement} childNode Child node to insert.
* @param {number} index Index at which to insert the child.
* @internal
*/
function insertChildAt(parentNode, childNode, index) {
// By exploiting arrays returning `undefined` for an undefined index, we can
// rely exclusively on `insertBefore(node, null)` instead of also using
// `appendChild(node)`. However, using `undefined` is not allowed by all
// browsers so we must replace it with `null`.
// fix render order error in safari
// IE8 will throw error when index out of list size.
var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
parentNode.insertBefore(childNode, beforeChild);
}
/**
* Operations for updating with DOM children.
*/
var DOMChildrenOperations = {
dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
updateTextContent: setTextContent,
/**
* Updates a component's children by processing a series of updates. The
* update configurations are each expected to have a `parentNode` property.
*
* @param {array