vendor: 5,094 bytes, lines 1-160
1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(require("react")); 4 else if(typeof define === 'function' && define.amd) 5 define(["react"], factory); 6 else if(typeof exports === 'object') 7 exports["createReactClass"] = factory(require("react")); 8 else 9 root["createReactClass"] = factory(root["React"]); 10})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { 11return /******/ (function(modules) { // webpackBootstrap 12/******/ // The module cache 13/******/ var installedModules = {}; 14/******/ 15/******/ // The require function 16/******/ function __webpack_require__(moduleId) { 17/******/ 18/******/ // Check if module is in cache 19/******/ if(installedModules[moduleId]) { 20/******/ return installedModules[moduleId].exports; 21/******/ } 22/******/ // Create a new module (and put it into the cache) 23/******/ var module = installedModules[moduleId] = { 24/******/ i: moduleId, 25/******/ l: false, 26/******/ exports: {} 27/******/ }; 28/******/ 29/******/ // Execute the module function 30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31/******/ 32/******/ // Flag the module as loaded 33/******/ module.l = true; 34/******/ 35/******/ // Return the exports of the module 36/******/ return module.exports; 37/******/ } 38/******/ 39/******/ 40/******/ // expose the modules object (__webpack_modules__) 41/******/ __webpack_require__.m = modules; 42/******/ 43/******/ // expose the module cache 44/******/ __webpack_require__.c = installedModules; 45/******/ 46/******/ // identity function for calling harmony imports with the correct context 47/******/ __webpack_require__.i = function(value) { return value; }; 48/******/ 49/******/ // define getter function for harmony exports 50/******/ __webpack_require__.d = function(exports, name, getter) { 51/******/ if(!__webpack_require__.o(exports, name)) { 52/******/ Object.defineProperty(exports, name, { 53/******/ configurable: false, 54/******/ enumerable: true, 55/******/ get: getter 56/******/ }); 57/******/ } 58/******/ }; 59/******/ 60/******/ // getDefaultExport function for compatibility with non-harmony modules 61/******/ __webpack_require__.n = function(module) { 62/******/ var getter = module && module.__esModule ? 63/******/ function getDefault() { return module['default']; } : 64/******/ function getModuleExports() { return module; }; 65/******/ __webpack_require__.d(getter, 'a', getter); 66/******/ return getter; 67/******/ }; 68/******/ 69/******/ // Object.prototype.hasOwnProperty.call 70/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 71/******/ 72/******/ // __webpack_public_path__ 73/******/ __webpack_require__.p = ""; 74/******/ 75/******/ // Load entry module and return exports 76/******/ return __webpack_require__(__webpack_require__.s = 2); 77/******/ }) 78/************************************************************************/ 79/******/ ([ 80/* 0 */ 81/***/ (function(module, exports, __webpack_require__) { 82 83"use strict"; 84/** 85 * Copyright (c) 2013-present, Facebook, Inc. 86 * 87 * This source code is licensed under the MIT license found in the 88 * LICENSE file in the root directory of this source tree. 89 * 90 */ 91 92 93 94var _assign = __webpack_require__(7); 95 96var emptyObject = __webpack_require__(4); 97var _invariant = __webpack_require__(5); 98 99if (true) { 100 var warning = __webpack_require__(6); 101} 102 103var MIXINS_KEY = 'mixins'; 104 105// Helper function to allow the creation of anonymous functions which do not 106// have .name set to the name of the variable being assigned to. 107function identity(fn) { 108 return fn; 109} 110 111var ReactPropTypeLocationNames; 112if (true) { 113 ReactPropTypeLocationNames = { 114 prop: 'prop', 115 context: 'context', 116 childContext: 'child context' 117 }; 118} else { 119 ReactPropTypeLocationNames = {}; 120} 121 122function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { 123 /** 124 * Policies that describe methods in `ReactClassInterface`. 125 */ 126 127 var injectedMixins = []; 128 129 /** 130 * Composite components are higher-level components that compose other composite 131 * or host components. 132 * 133 * To create a new type of `ReactClass`, pass a specification of 134 * your new class to `React.createClass`. The only requirement of your class 135 * specification is that you implement a `render` method. 136 * 137 * var MyComponent = React.createClass({ 138 * render: function() { 139 * return <div>Hello World</div>; 140 * } 141 * }); 142 * 143 * The class specification supports a specific protocol of methods that have 144 * special meaning (e.g. `render`). See `ReactClassInterface` for 145 * more the comprehensive protocol. Any other properties and methods in the 146 * class specification will be available on the prototype. 147 * 148 * @interface ReactClassInterface 149 * @internal 150 */ 151 var ReactClassInterface = { 152 /** 153 * An array of Mixin objects to include when defining your component. 154 * 155 * @type {array} 156 * @optional 157 */ 158 mixins: 'DEFINE_MANY', 159 160 /**
vendor: 15,102 bytes, lines 161-628
161 * An object containing properties and methods that should be defined on 162 * the component's constructor instead of its prototype (static methods). 163 * 164 * @type {object} 165 * @optional 166 */ 167 statics: 'DEFINE_MANY', 168 169 /** 170 * Definition of prop types for this component. 171 * 172 * @type {object} 173 * @optional 174 */ 175 propTypes: 'DEFINE_MANY', 176 177 /** 178 * Definition of context types for this component. 179 * 180 * @type {object} 181 * @optional 182 */ 183 contextTypes: 'DEFINE_MANY', 184 185 /** 186 * Definition of context types this component sets for its children. 187 * 188 * @type {object} 189 * @optional 190 */ 191 childContextTypes: 'DEFINE_MANY', 192 193 // ==== Definition methods ==== 194 195 /** 196 * Invoked when the component is mounted. Values in the mapping will be set on 197 * `this.props` if that prop is not specified (i.e. using an `in` check). 198 * 199 * This method is invoked before `getInitialState` and therefore cannot rely 200 * on `this.state` or use `this.setState`. 201 * 202 * @return {object} 203 * @optional 204 */ 205 getDefaultProps: 'DEFINE_MANY_MERGED', 206 207 /** 208 * Invoked once before the component is mounted. The return value will be used 209 * as the initial value of `this.state`. 210 * 211 * getInitialState: function() { 212 * return { 213 * isOn: false, 214 * fooBaz: new BazFoo() 215 * } 216 * } 217 * 218 * @return {object} 219 * @optional 220 */ 221 getInitialState: 'DEFINE_MANY_MERGED', 222 223 /** 224 * @return {object} 225 * @optional 226 */ 227 getChildContext: 'DEFINE_MANY_MERGED', 228 229 /** 230 * Uses props from `this.props` and state from `this.state` to render the 231 * structure of the component. 232 * 233 * No guarantees are made about when or how often this method is invoked, so 234 * it must not have side effects. 235 * 236 * render: function() { 237 * var name = this.props.name; 238 * return <div>Hello, {name}!</div>; 239 * } 240 * 241 * @return {ReactComponent} 242 * @required 243 */ 244 render: 'DEFINE_ONCE', 245 246 // ==== Delegate methods ==== 247 248 /** 249 * Invoked when the component is initially created and about to be mounted. 250 * This may have side effects, but any external subscriptions or data created 251 * by this method must be cleaned up in `componentWillUnmount`. 252 * 253 * @optional 254 */ 255 componentWillMount: 'DEFINE_MANY', 256 257 /** 258 * Invoked when the component has been mounted and has a DOM representation. 259 * However, there is no guarantee that the DOM node is in the document. 260 * 261 * Use this as an opportunity to operate on the DOM when the component has 262 * been mounted (initialized and rendered) for the first time. 263 * 264 * @param {DOMElement} rootNode DOM element representing the component. 265 * @optional 266 */ 267 componentDidMount: 'DEFINE_MANY', 268 269 /** 270 * Invoked before the component receives new props. 271 * 272 * Use this as an opportunity to react to a prop transition by updating the 273 * state using `this.setState`. Current props are accessed via `this.props`. 274 * 275 * componentWillReceiveProps: function(nextProps, nextContext) { 276 * this.setState({ 277 * likesIncreasing: nextProps.likeCount > this.props.likeCount 278 * }); 279 * } 280 * 281 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop 282 * transition may cause a state change, but the opposite is not true. If you 283 * need it, you are probably looking for `componentWillUpdate`. 284 * 285 * @param {object} nextProps 286 * @optional 287 */ 288 componentWillReceiveProps: 'DEFINE_MANY', 289 290 /** 291 * Invoked while deciding if the component should be updated as a result of 292 * receiving new props, state and/or context. 293 * 294 * Use this as an opportunity to `return false` when you're certain that the 295 * transition to the new props/state/context will not require a component 296 * update. 297 * 298 * shouldComponentUpdate: function(nextProps, nextState, nextContext) { 299 * return !equal(nextProps, this.props) || 300 * !equal(nextState, this.state) || 301 * !equal(nextContext, this.context); 302 * } 303 * 304 * @param {object} nextProps 305 * @param {?object} nextState 306 * @param {?object} nextContext 307 * @return {boolean} True if the component should update. 308 * @optional 309 */ 310 shouldComponentUpdate: 'DEFINE_ONCE', 311 312 /** 313 * Invoked when the component is about to update due to a transition from 314 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` 315 * and `nextContext`. 316 * 317 * Use this as an opportunity to perform preparation before an update occurs. 318 * 319 * NOTE: You **cannot** use `this.setState()` in this method. 320 * 321 * @param {object} nextProps 322 * @param {?object} nextState 323 * @param {?object} nextContext 324 * @param {ReactReconcileTransaction} transaction 325 * @optional 326 */ 327 componentWillUpdate: 'DEFINE_MANY', 328 329 /** 330 * Invoked when the component's DOM representation has been updated. 331 * 332 * Use this as an opportunity to operate on the DOM when the component has 333 * been updated. 334 * 335 * @param {object} prevProps 336 * @param {?object} prevState 337 * @param {?object} prevContext 338 * @param {DOMElement} rootNode DOM element representing the component. 339 * @optional 340 */ 341 componentDidUpdate: 'DEFINE_MANY', 342 343 /** 344 * Invoked when the component is about to be removed from its parent and have 345 * its DOM representation destroyed. 346 * 347 * Use this as an opportunity to deallocate any external resources. 348 * 349 * NOTE: There is no `componentDidUnmount` since your component will have been 350 * destroyed by that point. 351 * 352 * @optional 353 */ 354 componentWillUnmount: 'DEFINE_MANY', 355 356 // ==== Advanced methods ==== 357 358 /** 359 * Updates the component's currently mounted DOM representation. 360 * 361 * By default, this implements React's rendering and reconciliation algorithm. 362 * Sophisticated clients may wish to override this. 363 * 364 * @param {ReactReconcileTransaction} transaction 365 * @internal 366 * @overridable 367 */ 368 updateComponent: 'OVERRIDE_BASE' 369 }; 370 371 /** 372 * Mapping from class specification keys to special processing functions. 373 * 374 * Although these are declared like instance properties in the specification 375 * when defining classes using `React.createClass`, they are actually static 376 * and are accessible on the constructor instead of the prototype. Despite 377 * being static, they must be defined outside of the "statics" key under 378 * which all other static methods are defined. 379 */ 380 var RESERVED_SPEC_KEYS = { 381 displayName: function(Constructor, displayName) { 382 Constructor.displayName = displayName; 383 }, 384 mixins: function(Constructor, mixins) { 385 if (mixins) { 386 for (var i = 0; i < mixins.length; i++) { 387 mixSpecIntoComponent(Constructor, mixins[i]); 388 } 389 } 390 }, 391 childContextTypes: function(Constructor, childContextTypes) { 392 if (true) { 393 validateTypeDef(Constructor, childContextTypes, 'childContext'); 394 } 395 Constructor.childContextTypes = _assign( 396 {}, 397 Constructor.childContextTypes, 398 childContextTypes 399 ); 400 }, 401 contextTypes: function(Constructor, contextTypes) { 402 if (true) { 403 validateTypeDef(Constructor, contextTypes, 'context'); 404 } 405 Constructor.contextTypes = _assign( 406 {}, 407 Constructor.contextTypes, 408 contextTypes 409 ); 410 }, 411 /** 412 * Special case getDefaultProps which should move into statics but requires 413 * automatic merging. 414 */ 415 getDefaultProps: function(Constructor, getDefaultProps) { 416 if (Constructor.getDefaultProps) { 417 Constructor.getDefaultProps = createMergedResultFunction( 418 Constructor.getDefaultProps, 419 getDefaultProps 420 ); 421 } else { 422 Constructor.getDefaultProps = getDefaultProps; 423 } 424 }, 425 propTypes: function(Constructor, propTypes) { 426 if (true) { 427 validateTypeDef(Constructor, propTypes, 'prop'); 428 } 429 Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); 430 }, 431 statics: function(Constructor, statics) { 432 mixStaticSpecIntoComponent(Constructor, statics); 433 }, 434 autobind: function() {} 435 }; 436 437 function validateTypeDef(Constructor, typeDef, location) { 438 for (var propName in typeDef) { 439 if (typeDef.hasOwnProperty(propName)) { 440 // use a warning instead of an _invariant so components 441 // don't show up in prod but only in __DEV__ 442 if (true) { 443 warning( 444 typeof typeDef[propName] === 'function', 445 '%s: %s type `%s` is invalid; it must be a function, usually from ' + 446 'React.PropTypes.', 447 Constructor.displayName || 'ReactClass', 448 ReactPropTypeLocationNames[location], 449 propName 450 ); 451 } 452 } 453 } 454 } 455 456 function validateMethodOverride(isAlreadyDefined, name) { 457 var specPolicy = ReactClassInterface.hasOwnProperty(name) 458 ? ReactClassInterface[name] 459 : null; 460 461 // Disallow overriding of base class methods unless explicitly allowed. 462 if (ReactClassMixin.hasOwnProperty(name)) { 463 _invariant( 464 specPolicy === 'OVERRIDE_BASE', 465 'ReactClassInterface: You are attempting to override ' + 466 '`%s` from your class specification. Ensure that your method names ' + 467 'do not overlap with React methods.', 468 name 469 ); 470 } 471 472 // Disallow defining methods more than once unless explicitly allowed. 473 if (isAlreadyDefined) { 474 _invariant( 475 specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 476 'ReactClassInterface: You are attempting to define ' + 477 '`%s` on your component more than once. This conflict may be due ' + 478 'to a mixin.', 479 name 480 ); 481 } 482 } 483 484 /** 485 * Mixin helper which handles policy validation and reserved 486 * specification keys when building React classes. 487 */ 488 function mixSpecIntoComponent(Constructor, spec) { 489 if (!spec) { 490 if (true) { 491 var typeofSpec = typeof spec; 492 var isMixinValid = typeofSpec === 'object' && spec !== null; 493 494 if (true) { 495 warning( 496 isMixinValid, 497 "%s: You're attempting to include a mixin that is either null " + 498 'or not an object. Check the mixins included by the component, ' + 499 'as well as any mixins they include themselves. ' + 500 'Expected object but got %s.', 501 Constructor.displayName || 'ReactClass', 502 spec === null ? null : typeofSpec 503 ); 504 } 505 } 506 507 return; 508 } 509 510 _invariant( 511 typeof spec !== 'function', 512 "ReactClass: You're attempting to " + 513 'use a component class or function as a mixin. Instead, just use a ' + 514 'regular object.' 515 ); 516 _invariant( 517 !isValidElement(spec), 518 "ReactClass: You're attempting to " + 519 'use a component as a mixin. Instead, just use a regular object.' 520 ); 521 522 var proto = Constructor.prototype; 523 var autoBindPairs = proto.__reactAutoBindPairs; 524 525 // By handling mixins before any other properties, we ensure the same 526 // chaining order is applied to methods with DEFINE_MANY policy, whether 527 // mixins are listed before or after these methods in the spec. 528 if (spec.hasOwnProperty(MIXINS_KEY)) { 529 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); 530 } 531 532 for (var name in spec) { 533 if (!spec.hasOwnProperty(name)) { 534 continue; 535 } 536 537 if (name === MIXINS_KEY) { 538 // We have already handled mixins in a special case above. 539 continue; 540 } 541 542 var property = spec[name]; 543 var isAlreadyDefined = proto.hasOwnProperty(name); 544 validateMethodOverride(isAlreadyDefined, name); 545 546 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { 547 RESERVED_SPEC_KEYS[name](Constructor, property); 548 } else { 549 // Setup methods on prototype: 550 // The following member methods should not be automatically bound: 551 // 1. Expected ReactClass methods (in the "interface"). 552 // 2. Overridden methods (that were mixed in). 553 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); 554 var isFunction = typeof property === 'function'; 555 var shouldAutoBind = 556 isFunction && 557 !isReactClassMethod && 558 !isAlreadyDefined && 559 spec.autobind !== false; 560 561 if (shouldAutoBind) { 562 autoBindPairs.push(name, property); 563 proto[name] = property; 564 } else { 565 if (isAlreadyDefined) { 566 var specPolicy = ReactClassInterface[name]; 567 568 // These cases should already be caught by validateMethodOverride. 569 _invariant( 570 isReactClassMethod && 571 (specPolicy === 'DEFINE_MANY_MERGED' || 572 specPolicy === 'DEFINE_MANY'), 573 'ReactClass: Unexpected spec policy %s for key %s ' + 574 'when mixing in component specs.', 575 specPolicy, 576 name 577 ); 578 579 // For methods which are defined more than once, call the existing 580 // methods before calling the new property, merging if appropriate. 581 if (specPolicy === 'DEFINE_MANY_MERGED') { 582 proto[name] = createMergedResultFunction(proto[name], property); 583 } else if (specPolicy === 'DEFINE_MANY') { 584 proto[name] = createChainedFunction(proto[name], property); 585 } 586 } else { 587 proto[name] = property; 588 if (true) { 589 // Add verbose displayName to the function, which helps when looking 590 // at profiling tools. 591 if (typeof property === 'function' && spec.displayName) { 592 proto[name].displayName = spec.displayName + '_' + name; 593 } 594 } 595 } 596 } 597 } 598 } 599 } 600 601 function mixStaticSpecIntoComponent(Constructor, statics) { 602 if (!statics) { 603 return; 604 } 605 for (var name in statics) { 606 var property = statics[name]; 607 if (!statics.hasOwnProperty(name)) { 608 continue; 609 } 610 611 var isReserved = name in RESERVED_SPEC_KEYS; 612 _invariant( 613 !isReserved, 614 'ReactClass: You are attempting to define a reserved ' + 615 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 616 'as an instance property instead; it will still be accessible on the ' + 617 'constructor.', 618 name 619 ); 620 621 var isInherited = name in Constructor; 622 _invariant( 623 !isInherited, 624 'ReactClass: You are attempting to define ' + 625 '`%s` on your component more than once. This conflict may be ' + 626 'due to a mixin.', 627 name 628 );
vendor: 10,254 bytes, lines 628-938
628 629 Constructor[name] = property; 630 } 631 } 632 633 /** 634 * Merge two objects, but throw if both contain the same key. 635 * 636 * @param {object} one The first object, which is mutated. 637 * @param {object} two The second object 638 * @return {object} one after it has been mutated to contain everything in two. 639 */ 640 function mergeIntoWithNoDuplicateKeys(one, two) { 641 _invariant( 642 one && two && typeof one === 'object' && typeof two === 'object', 643 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' 644 ); 645 646 for (var key in two) { 647 if (two.hasOwnProperty(key)) { 648 _invariant( 649 one[key] === undefined, 650 'mergeIntoWithNoDuplicateKeys(): ' + 651 'Tried to merge two objects with the same key: `%s`. This conflict ' + 652 'may be due to a mixin; in particular, this may be caused by two ' + 653 'getInitialState() or getDefaultProps() methods returning objects ' + 654 'with clashing keys.', 655 key 656 ); 657 one[key] = two[key]; 658 } 659 } 660 return one; 661 } 662 663 /** 664 * Creates a function that invokes two functions and merges their return values. 665 * 666 * @param {function} one Function to invoke first. 667 * @param {function} two Function to invoke second. 668 * @return {function} Function that invokes the two argument functions. 669 * @private 670 */ 671 function createMergedResultFunction(one, two) { 672 return function mergedResult() { 673 var a = one.apply(this, arguments); 674 var b = two.apply(this, arguments); 675 if (a == null) { 676 return b; 677 } else if (b == null) { 678 return a; 679 } 680 var c = {}; 681 mergeIntoWithNoDuplicateKeys(c, a); 682 mergeIntoWithNoDuplicateKeys(c, b); 683 return c; 684 }; 685 } 686 687 /** 688 * Creates a function that invokes two functions and ignores their return vales. 689 * 690 * @param {function} one Function to invoke first. 691 * @param {function} two Function to invoke second. 692 * @return {function} Function that invokes the two argument functions. 693 * @private 694 */ 695 function createChainedFunction(one, two) { 696 return function chainedFunction() { 697 one.apply(this, arguments); 698 two.apply(this, arguments); 699 }; 700 } 701 702 /** 703 * Binds a method to the component. 704 * 705 * @param {object} component Component whose method is going to be bound. 706 * @param {function} method Method to be bound. 707 * @return {function} The bound method. 708 */ 709 function bindAutoBindMethod(component, method) { 710 var boundMethod = method.bind(component); 711 if (true) { 712 boundMethod.__reactBoundContext = component; 713 boundMethod.__reactBoundMethod = method; 714 boundMethod.__reactBoundArguments = null; 715 var componentName = component.constructor.displayName; 716 var _bind = boundMethod.bind; 717 boundMethod.bind = function(newThis) { 718 for ( 719 var _len = arguments.length, 720 args = Array(_len > 1 ? _len - 1 : 0), 721 _key = 1; 722 _key < _len; 723 _key++ 724 ) { 725 args[_key - 1] = arguments[_key]; 726 } 727 728 // User is trying to bind() an autobound method; we effectively will 729 // ignore the value of "this" that the user is trying to use, so 730 // let's warn. 731 if (newThis !== component && newThis !== null) { 732 if (true) { 733 warning( 734 false, 735 'bind(): React component methods may only be bound to the ' + 736 'component instance. See %s', 737 componentName 738 ); 739 } 740 } else if (!args.length) { 741 if (true) { 742 warning( 743 false, 744 'bind(): You are binding a component method to the component. ' + 745 'React does this for you automatically in a high-performance ' + 746 'way, so you can safely remove this call. See %s', 747 componentName 748 ); 749 } 750 return boundMethod; 751 } 752 var reboundMethod = _bind.apply(boundMethod, arguments); 753 reboundMethod.__reactBoundContext = component; 754 reboundMethod.__reactBoundMethod = method; 755 reboundMethod.__reactBoundArguments = args; 756 return reboundMethod; 757 }; 758 } 759 return boundMethod; 760 } 761 762 /** 763 * Binds all auto-bound methods in a component. 764 * 765 * @param {object} component Component whose method is going to be bound. 766 */ 767 function bindAutoBindMethods(component) { 768 var pairs = component.__reactAutoBindPairs; 769 for (var i = 0; i < pairs.length; i += 2) { 770 var autoBindKey = pairs[i]; 771 var method = pairs[i + 1]; 772 component[autoBindKey] = bindAutoBindMethod(component, method); 773 } 774 } 775 776 var IsMountedPreMixin = { 777 componentDidMount: function() { 778 this.__isMounted = true; 779 } 780 }; 781 782 var IsMountedPostMixin = { 783 componentWillUnmount: function() { 784 this.__isMounted = false; 785 } 786 }; 787 788 /** 789 * Add more to the ReactClass base class. These are all legacy features and 790 * therefore not already part of the modern ReactComponent. 791 */ 792 var ReactClassMixin = { 793 /** 794 * TODO: This will be deprecated because state should always keep a consistent 795 * type signature and the only use case for this, is to avoid that. 796 */ 797 replaceState: function(newState, callback) { 798 this.updater.enqueueReplaceState(this, newState, callback); 799 }, 800 801 /** 802 * Checks whether or not this composite component is mounted. 803 * @return {boolean} True if mounted, false otherwise. 804 * @protected 805 * @final 806 */ 807 isMounted: function() { 808 if (true) { 809 warning( 810 this.__didWarnIsMounted, 811 '%s: isMounted is deprecated. Instead, make sure to clean up ' + 812 'subscriptions and pending requests in componentWillUnmount to ' + 813 'prevent memory leaks.', 814 (this.constructor && this.constructor.displayName) || 815 this.name || 816 'Component' 817 ); 818 this.__didWarnIsMounted = true; 819 } 820 return !!this.__isMounted; 821 } 822 }; 823 824 var ReactClassComponent = function() {}; 825 _assign( 826 ReactClassComponent.prototype, 827 ReactComponent.prototype, 828 ReactClassMixin 829 ); 830 831 /** 832 * Creates a composite component class given a class specification. 833 * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass 834 * 835 * @param {object} spec Class specification (which must define `render`). 836 * @return {function} Component constructor function. 837 * @public 838 */ 839 function createClass(spec) { 840 // To keep our warnings more understandable, we'll use a little hack here to 841 // ensure that Constructor.name !== 'Constructor'. This makes sure we don't 842 // unnecessarily identify a class without displayName as 'Constructor'. 843 var Constructor = identity(function(props, context, updater) { 844 // This constructor gets overridden by mocks. The argument is used 845 // by mocks to assert on what gets mounted. 846 847 if (true) { 848 warning( 849 this instanceof Constructor, 850 'Something is calling a React component directly. Use a factory or ' + 851 'JSX instead. See: https://fb.me/react-legacyfactory' 852 ); 853 } 854 855 // Wire up auto-binding 856 if (this.__reactAutoBindPairs.length) { 857 bindAutoBindMethods(this); 858 } 859 860 this.props = props; 861 this.context = context; 862 this.refs = emptyObject; 863 this.updater = updater || ReactNoopUpdateQueue; 864 865 this.state = null; 866 867 // ReactClasses doesn't have constructors. Instead, they use the 868 // getInitialState and componentWillMount methods for initialization. 869 870 var initialState = this.getInitialState ? this.getInitialState() : null; 871 if (true) { 872 // We allow auto-mocks to proceed as if they're returning null. 873 if ( 874 initialState === undefined && 875 this.getInitialState._isMockFunction 876 ) { 877 // This is probably bad practice. Consider warning here and 878 // deprecating this convenience. 879 initialState = null; 880 } 881 } 882 _invariant( 883 typeof initialState === 'object' && !Array.isArray(initialState), 884 '%s.getInitialState(): must return an object or null', 885 Constructor.displayName || 'ReactCompositeComponent' 886 ); 887 888 this.state = initialState; 889 }); 890 Constructor.prototype = new ReactClassComponent(); 891 Constructor.prototype.constructor = Constructor; 892 Constructor.prototype.__reactAutoBindPairs = []; 893 894 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); 895 896 mixSpecIntoComponent(Constructor, IsMountedPreMixin); 897 mixSpecIntoComponent(Constructor, spec); 898 mixSpecIntoComponent(Constructor, IsMountedPostMixin); 899 900 // Initialize the defaultProps property after all mixins have been merged. 901 if (Constructor.getDefaultProps) { 902 Constructor.defaultProps = Constructor.getDefaultProps(); 903 } 904 905 if (true) { 906 // This is a tag to indicate that the use of these method names is ok, 907 // since it's used with createClass. If it's not, then it's likely a 908 // mistake so we'll warn you to use the static property, property 909 // initializer or constructor respectively. 910 if (Constructor.getDefaultProps) { 911 Constructor.getDefaultProps.isReactClassApproved = {}; 912 } 913 if (Constructor.prototype.getInitialState) { 914 Constructor.prototype.getInitialState.isReactClassApproved = {}; 915 } 916 } 917 918 _invariant( 919 Constructor.prototype.render, 920 'createClass(...): Class specification must implement a `render` method.' 921 ); 922 923 if (true) { 924 warning( 925 !Constructor.prototype.componentShouldUpdate, 926 '%s has a method called ' + 927 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 928 'The name is phrased as a question because the function is ' + 929 'expected to return a value.', 930 spec.displayName || 'A component' 931 ); 932 warning( 933 !Constructor.prototype.componentWillRecieveProps, 934 '%s has a method called ' + 935 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', 936 spec.displayName || 'A component' 937 ); 938
vendor: 8,910 bytes, lines 938-1298
938} 939 940 // Reduce time spent doing lookups by setting these on the prototype. 941 for (var methodName in ReactClassInterface) { 942 if (!Constructor.prototype[methodName]) { 943 Constructor.prototype[methodName] = null; 944 } 945 } 946 947 return Constructor; 948 } 949 950 return createClass; 951} 952 953module.exports = factory; 954 955 956/***/ }), 957/* 1 */ 958/***/ (function(module, exports) { 959 960module.exports = __WEBPACK_EXTERNAL_MODULE_1__; 961 962/***/ }), 963/* 2 */ 964/***/ (function(module, exports, __webpack_require__) { 965 966"use strict"; 967/** 968 * Copyright (c) 2013-present, Facebook, Inc. 969 * 970 * This source code is licensed under the MIT license found in the 971 * LICENSE file in the root directory of this source tree. 972 * 973 */ 974 975 976 977var React = __webpack_require__(1); 978var factory = __webpack_require__(0); 979 980if (typeof React === 'undefined') { 981 throw Error( 982 'create-react-class could not find the React object. If you are using script tags, ' + 983 'make sure that React is being loaded before create-react-class.' 984 ); 985} 986 987// Hack to grab NoopUpdateQueue from isomorphic React 988var ReactNoopUpdateQueue = new React.Component().updater; 989 990module.exports = factory( 991 React.Component, 992 React.isValidElement, 993 ReactNoopUpdateQueue 994); 995 996 997/***/ }), 998/* 3 */ 999/***/ (function(module, exports, __webpack_require__) { 1000 1001"use strict"; 1002 1003 1004/** 1005 * Copyright (c) 2013-present, Facebook, Inc. 1006 * All rights reserved. 1007 * 1008 * This source code is licensed under the BSD-style license found in the 1009 * LICENSE file in the root directory of this source tree. An additional grant 1010 * of patent rights can be found in the PATENTS file in the same directory. 1011 * 1012 * 1013 */ 1014 1015function makeEmptyFunction(arg) { 1016 return function () { 1017 return arg; 1018 }; 1019} 1020 1021/** 1022 * This function accepts and discards inputs; it has no side effects. This is 1023 * primarily useful idiomatically for overridable function endpoints which 1024 * always need to be callable, since JS lacks a null-call idiom ala Cocoa. 1025 */ 1026var emptyFunction = function emptyFunction() {}; 1027 1028emptyFunction.thatReturns = makeEmptyFunction; 1029emptyFunction.thatReturnsFalse = makeEmptyFunction(false); 1030emptyFunction.thatReturnsTrue = makeEmptyFunction(true); 1031emptyFunction.thatReturnsNull = makeEmptyFunction(null); 1032emptyFunction.thatReturnsThis = function () { 1033 return this; 1034}; 1035emptyFunction.thatReturnsArgument = function (arg) { 1036 return arg; 1037}; 1038 1039module.exports = emptyFunction; 1040 1041/***/ }), 1042/* 4 */ 1043/***/ (function(module, exports, __webpack_require__) { 1044 1045"use strict"; 1046/** 1047 * Copyright (c) 2013-present, Facebook, Inc. 1048 * All rights reserved. 1049 * 1050 * This source code is licensed under the BSD-style license found in the 1051 * LICENSE file in the root directory of this source tree. An additional grant 1052 * of patent rights can be found in the PATENTS file in the same directory. 1053 * 1054 */ 1055 1056 1057 1058var emptyObject = {}; 1059 1060if (true) { 1061 Object.freeze(emptyObject); 1062} 1063 1064module.exports = emptyObject; 1065 1066/***/ }), 1067/* 5 */ 1068/***/ (function(module, exports, __webpack_require__) { 1069 1070"use strict"; 1071/** 1072 * Copyright (c) 2013-present, Facebook, Inc. 1073 * All rights reserved. 1074 * 1075 * This source code is licensed under the BSD-style license found in the 1076 * LICENSE file in the root directory of this source tree. An additional grant 1077 * of patent rights can be found in the PATENTS file in the same directory. 1078 * 1079 */ 1080 1081 1082 1083/** 1084 * Use invariant() to assert state which your program assumes to be true. 1085 * 1086 * Provide sprintf-style format (only %s is supported) and arguments 1087 * to provide information about what broke and what you were 1088 * expecting. 1089 * 1090 * The invariant message will be stripped in production, but the invariant 1091 * will remain to ensure logic does not differ in production. 1092 */ 1093 1094var validateFormat = function validateFormat(format) {}; 1095 1096if (true) { 1097 validateFormat = function validateFormat(format) { 1098 if (format === undefined) { 1099 throw new Error('invariant requires an error message argument'); 1100 } 1101 }; 1102} 1103 1104function invariant(condition, format, a, b, c, d, e, f) { 1105 validateFormat(format); 1106 1107 if (!condition) { 1108 var error; 1109 if (format === undefined) { 1110 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); 1111 } else { 1112 var args = [a, b, c, d, e, f]; 1113 var argIndex = 0; 1114 error = new Error(format.replace(/%s/g, function () { 1115 return args[argIndex++]; 1116 })); 1117 error.name = 'Invariant Violation'; 1118 } 1119 1120 error.framesToPop = 1; // we don't care about invariant's own frame 1121 throw error; 1122 } 1123} 1124 1125module.exports = invariant; 1126 1127/***/ }), 1128/* 6 */ 1129/***/ (function(module, exports, __webpack_require__) { 1130 1131"use strict"; 1132/** 1133 * Copyright 2014-2015, Facebook, Inc. 1134 * All rights reserved. 1135 * 1136 * This source code is licensed under the BSD-style license found in the 1137 * LICENSE file in the root directory of this source tree. An additional grant 1138 * of patent rights can be found in the PATENTS file in the same directory. 1139 * 1140 */ 1141 1142 1143 1144var emptyFunction = __webpack_require__(3); 1145 1146/** 1147 * Similar to invariant but only logs a warning if the condition is not met. 1148 * This can be used to log issues in development environments in critical 1149 * paths. Removing the logging code for production environments will keep the 1150 * same logic and follow the same code paths. 1151 */ 1152 1153var warning = emptyFunction; 1154 1155if (true) { 1156 (function () { 1157 var printWarning = function printWarning(format) { 1158 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 1159 args[_key - 1] = arguments[_key]; 1160 } 1161 1162 var argIndex = 0; 1163 var message = 'Warning: ' + format.replace(/%s/g, function () { 1164 return args[argIndex++]; 1165 }); 1166 if (typeof console !== 'undefined') { 1167 console.error(message); 1168 } 1169 try { 1170 // --- Welcome to debugging React --- 1171 // This error was thrown as a convenience so that you can use this stack 1172 // to find the callsite that caused this warning to fire. 1173 throw new Error(message); 1174 } catch (x) {} 1175 }; 1176 1177 warning = function warning(condition, format) { 1178 if (format === undefined) { 1179 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); 1180 } 1181 1182 if (format.indexOf('Failed Composite propType: ') === 0) { 1183 return; // Ignore CompositeComponent proptype check. 1184 } 1185 1186 if (!condition) { 1187 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { 1188 args[_key2 - 2] = arguments[_key2]; 1189 } 1190 1191 printWarning.apply(undefined, [format].concat(args)); 1192 } 1193 }; 1194 })(); 1195} 1196 1197module.exports = warning; 1198 1199/***/ }), 1200/* 7 */ 1201/***/ (function(module, exports, __webpack_require__) { 1202 1203"use strict"; 1204/* 1205object-assign 1206(c) Sindre Sorhus 1207@license MIT 1208*/ 1209 1210 1211/* eslint-disable no-unused-vars */ 1212var getOwnPropertySymbols = Object.getOwnPropertySymbols; 1213var hasOwnProperty = Object.prototype.hasOwnProperty; 1214var propIsEnumerable = Object.prototype.propertyIsEnumerable; 1215 1216function toObject(val) { 1217 if (val === null || val === undefined) { 1218 throw new TypeError('Object.assign cannot be called with null or undefined'); 1219 } 1220 1221 return Object(val); 1222} 1223 1224function shouldUseNative() { 1225 try { 1226 if (!Object.assign) { 1227 return false; 1228 } 1229 1230 // Detect buggy property enumeration order in older V8 versions. 1231 1232 // https://bugs.chromium.org/p/v8/issues/detail?id=4118 1233 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers 1234 test1[5] = 'de'; 1235 if (Object.getOwnPropertyNames(test1)[0] === '5') { 1236 return false; 1237 } 1238 1239 // https://bugs.chromium.org/p/v8/issues/detail?id=3056 1240 var test2 = {}; 1241 for (var i = 0; i < 10; i++) { 1242 test2['_' + String.fromCharCode(i)] = i; 1243 } 1244 var order2 = Object.getOwnPropertyNames(test2).map(function (n) { 1245 return test2[n]; 1246 }); 1247 if (order2.join('') !== '0123456789') { 1248 return false; 1249 } 1250 1251 // https://bugs.chromium.org/p/v8/issues/detail?id=3056 1252 var test3 = {}; 1253 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { 1254 test3[letter] = letter; 1255 }); 1256 if (Object.keys(Object.assign({}, test3)).join('') !== 1257 'abcdefghijklmnopqrst') { 1258 return false; 1259 } 1260 1261 return true; 1262 } catch (err) { 1263 // We don't expect any of the above to throw, but better to be safe. 1264 return false; 1265 } 1266} 1267 1268module.exports = shouldUseNative() ? Object.assign : function (target, source) { 1269 var from; 1270 var to = toObject(target); 1271 var symbols; 1272 1273 for (var s = 1; s < arguments.length; s++) { 1274 from = Object(arguments[s]); 1275 1276 for (var key in from) { 1277 if (hasOwnProperty.call(from, key)) { 1278 to[key] = from[key]; 1279 } 1280 } 1281 1282 if (getOwnPropertySymbols) { 1283 symbols = getOwnPropertySymbols(from); 1284 for (var i = 0; i < symbols.length; i++) { 1285 if (propIsEnumerable.call(from, symbols[i])) { 1286 to[symbols[i]] = from[symbols[i]]; 1287 } 1288 } 1289 } 1290 } 1291 1292 return to; 1293}; 1294 1295 1296/***/ }) 1297/******/ ]); 1298});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.