2017-07-11 10:43:53 +00:00
/ * *
* Copyright ( c ) 2015 - present , Facebook , Inc .
*
2018-02-17 02:24:55 +00:00
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2017-07-11 10:43:53 +00:00
*
2018-05-11 02:06:46 +00:00
* @ format
2017-07-11 10:43:53 +00:00
* @ polyfill
2017-07-17 10:02:14 +00:00
* @ nolint
2017-07-11 10:43:53 +00:00
* /
2018-01-09 00:54:56 +00:00
/* eslint-disable quotes, curly, no-proto, no-undef-init, dot-notation */
2017-07-11 10:43:53 +00:00
// Created by running:
2018-04-11 23:29:36 +00:00
// require('fs').writeFileSync('babelExternalHelpers.js', require('@babel/core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray wrapNativeSuper assertThisInitialized taggedTemplateLiteralLoose'.split(' ')))// then replacing the `global` reference in the last line to also use `this`.
2017-07-11 10:43:53 +00:00
//
2018-04-11 23:29:36 +00:00
// Actually, that's a lie, because babel omits _extends and
// createRawReactElement. the file is also cleaned up a bit.
// You may need to clear wrapNativeSuper while the bug hasn't been fixed yet.
// Do try to keep diffs to a minimum.
2017-07-11 10:43:53 +00:00
2018-05-11 02:06:46 +00:00
var babelHelpers = ( global . babelHelpers = { } ) ;
2017-07-11 10:43:53 +00:00
2018-05-11 02:06:46 +00:00
babelHelpers . createRawReactElement = ( function ( ) {
var REACT _ELEMENT _TYPE =
( typeof Symbol === 'function' &&
Symbol . for &&
Symbol . for ( 'react.element' ) ) ||
0xeac7 ;
2017-07-11 10:43:53 +00:00
return function createRawReactElement ( type , key , props ) {
return {
$$typeof : REACT _ELEMENT _TYPE ,
type : type ,
key : key ,
ref : null ,
props : props ,
2018-05-11 02:06:46 +00:00
_owner : null ,
2017-07-11 10:43:53 +00:00
} ;
} ;
} ) ( ) ;
2018-05-11 02:06:46 +00:00
babelHelpers . classCallCheck = function ( instance , Constructor ) {
2017-07-11 10:43:53 +00:00
if ( ! ( instance instanceof Constructor ) ) {
2018-05-11 02:06:46 +00:00
throw new TypeError ( 'Cannot call a class as a function' ) ;
2017-07-11 10:43:53 +00:00
}
} ;
2018-04-11 23:29:36 +00:00
function _defineProperties ( target , props ) {
for ( var i = 0 ; i < props . length ; i ++ ) {
var descriptor = props [ i ] ;
descriptor . enumerable = descriptor . enumerable || false ;
descriptor . configurable = true ;
2018-05-11 02:06:46 +00:00
if ( 'value' in descriptor ) descriptor . writable = true ;
2018-04-11 23:29:36 +00:00
Object . defineProperty ( target , descriptor . key , descriptor ) ;
2017-07-11 10:43:53 +00:00
}
2018-04-11 23:29:36 +00:00
}
2017-07-11 10:43:53 +00:00
2018-04-11 23:29:36 +00:00
babelHelpers . createClass = function ( Constructor , protoProps , staticProps ) {
if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
return Constructor ;
2017-07-11 10:43:53 +00:00
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . defineProperty = function ( obj , key , value ) {
2017-07-11 10:43:53 +00:00
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
2018-05-11 02:06:46 +00:00
writable : true ,
2017-07-11 10:43:53 +00:00
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . _extends = babelHelpers . extends =
Object . assign ||
function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
2017-07-11 10:43:53 +00:00
2018-05-11 02:06:46 +00:00
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
2017-07-11 10:43:53 +00:00
}
}
2018-05-11 02:06:46 +00:00
return target ;
} ;
2017-07-11 10:43:53 +00:00
babelHelpers . get = function get ( object , property , receiver ) {
if ( object === null ) object = Function . prototype ;
var desc = Object . getOwnPropertyDescriptor ( object , property ) ;
if ( desc === undefined ) {
var parent = Object . getPrototypeOf ( object ) ;
if ( parent === null ) {
return undefined ;
} else {
return get ( parent , property , receiver ) ;
}
2018-05-11 02:06:46 +00:00
} else if ( 'value' in desc ) {
2017-07-11 10:43:53 +00:00
return desc . value ;
} else {
var getter = desc . get ;
if ( getter === undefined ) {
return undefined ;
}
return getter . call ( receiver ) ;
}
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . inherits = function ( subClass , superClass ) {
if ( typeof superClass !== 'function' && superClass !== null ) {
throw new TypeError ( 'Super expression must either be null or a function' ) ;
2017-07-11 10:43:53 +00:00
}
subClass . prototype = Object . create ( superClass && superClass . prototype , {
constructor : {
value : subClass ,
enumerable : false ,
writable : true ,
2018-05-11 02:06:46 +00:00
configurable : true ,
} ,
2017-07-11 10:43:53 +00:00
} ) ;
2018-05-11 02:06:46 +00:00
if ( superClass )
Object . setPrototypeOf
? Object . setPrototypeOf ( subClass , superClass )
: ( subClass . _ _proto _ _ = superClass ) ;
2017-07-11 10:43:53 +00:00
} ;
2018-05-11 02:06:46 +00:00
var _gPO =
Object . getPrototypeOf ||
function _gPO ( o ) {
return o . _ _proto _ _ ;
} ;
var _sPO =
Object . setPrototypeOf ||
function _sPO ( o , p ) {
o . _ _proto _ _ = p ;
return o ;
} ;
2018-04-11 23:29:36 +00:00
var _construct =
2018-05-11 02:06:46 +00:00
// TODO: prepack does not like this line (and we can use the fallback just fine)
// (typeof Reflect === "object" && Reflect.construct) ||
2018-04-11 23:29:36 +00:00
function _construct ( Parent , args , Class ) {
2018-05-11 02:06:46 +00:00
var Constructor ,
a = [ null ] ;
2018-04-11 23:29:36 +00:00
a . push . apply ( a , args ) ;
Constructor = Parent . bind . apply ( Parent , a ) ;
2018-05-11 02:06:46 +00:00
return _sPO ( new Constructor ( ) , Class . prototype ) ;
2018-04-11 23:29:36 +00:00
} ;
2018-05-11 02:06:46 +00:00
var _cache = typeof Map === 'function' && new Map ( ) ;
2018-04-11 23:29:36 +00:00
babelHelpers . wrapNativeSuper = function ( Class ) {
// FB:
// Note: while extending native classes is pretty meh we do have cases, for
// example; Error. There is also a false positive, for example; Blob.
2018-05-11 02:06:46 +00:00
if ( typeof Class !== 'function' ) {
throw new TypeError ( 'Super expression must either be null or a function' ) ;
2018-04-11 23:29:36 +00:00
}
2018-05-11 02:06:46 +00:00
if ( typeof _cache !== 'undefined' ) {
2018-04-11 23:29:36 +00:00
if ( _cache . has ( Class ) ) return _cache . get ( Class ) ;
_cache . set ( Class , Wrapper ) ;
}
function Wrapper ( ) {
// this is a temporary fix for a babel bug (it's invoking the wrong func
// when you do `super()`)
return _construct ( Class , arguments , _gPO ( this ) . constructor ) ;
}
Wrapper . prototype = Object . create ( Class . prototype , {
constructor : {
value : Wrapper ,
enumerable : false ,
writeable : true ,
configurable : true ,
2018-05-11 02:06:46 +00:00
} ,
2018-04-11 23:29:36 +00:00
} ) ;
return _sPO (
Wrapper ,
2018-05-11 02:06:46 +00:00
_sPO ( function Super ( ) {
return _construct ( Class , arguments , _gPO ( this ) . constructor ) ;
} , Class ) ,
2018-04-11 23:29:36 +00:00
) ;
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . interopRequireDefault = function ( obj ) {
return obj && obj . _ _esModule
? obj
: {
default : obj ,
} ;
2017-07-11 10:43:53 +00:00
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . interopRequireWildcard = function ( obj ) {
2017-07-11 10:43:53 +00:00
if ( obj && obj . _ _esModule ) {
return obj ;
} else {
var newObj = { } ;
if ( obj != null ) {
for ( var key in obj ) {
2018-04-11 23:29:36 +00:00
if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) {
2018-05-11 02:06:46 +00:00
var desc =
Object . defineProperty && Object . getOwnPropertyDescriptor
? Object . getOwnPropertyDescriptor ( obj , key )
: { } ;
2018-04-11 23:29:36 +00:00
if ( desc . get || desc . set ) {
Object . defineProperty ( newObj , key , desc ) ;
} else {
newObj [ key ] = obj [ key ] ;
}
}
2017-07-11 10:43:53 +00:00
}
}
newObj . default = obj ;
return newObj ;
}
} ;
2018-04-11 23:29:36 +00:00
babelHelpers . objectWithoutProperties = function ( source , excluded ) {
if ( source == null ) return { } ;
2017-07-11 10:43:53 +00:00
var target = { } ;
2018-04-11 23:29:36 +00:00
var sourceKeys = Object . keys ( source ) ;
var key , i ;
for ( i = 0 ; i < sourceKeys . length ; i ++ ) {
key = sourceKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
target [ key ] = source [ key ] ;
}
if ( Object . getOwnPropertySymbols ) {
var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ;
2017-07-11 10:43:53 +00:00
2018-04-11 23:29:36 +00:00
for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) {
key = sourceSymbolKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ;
target [ key ] = source [ key ] ;
}
2017-07-11 10:43:53 +00:00
}
return target ;
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . possibleConstructorReturn = function ( self , call ) {
if ( call && ( typeof call === 'object' || typeof call === 'function' ) ) {
2018-04-11 23:29:36 +00:00
return call ;
}
if ( self === void 0 ) {
2018-05-11 02:06:46 +00:00
throw new ReferenceError (
"this hasn't been initialised - super() hasn't been called" ,
) ;
2017-07-11 10:43:53 +00:00
}
2018-04-11 23:29:36 +00:00
return self ;
2017-07-11 10:43:53 +00:00
} ;
2018-04-11 23:29:36 +00:00
function _sliceIterator ( arr , i ) {
var _arr = [ ] ;
var _n = true ;
var _d = false ;
var _e = undefined ;
2017-07-11 10:43:53 +00:00
2018-04-11 23:29:36 +00:00
try {
2018-05-11 02:06:46 +00:00
for (
var _i = arr [ Symbol . iterator ] ( ) , _s ;
! ( _n = ( _s = _i . next ( ) ) . done ) ;
_n = true
) {
2018-04-11 23:29:36 +00:00
_arr . push ( _s . value ) ;
2018-04-11 15:12:44 +00:00
2018-04-11 23:29:36 +00:00
if ( i && _arr . length === i ) break ;
}
} catch ( err ) {
_d = true ;
_e = err ;
} finally {
try {
2018-05-11 02:06:46 +00:00
if ( ! _n && _i [ 'return' ] != null ) _i [ 'return' ] ( ) ;
2017-07-11 10:43:53 +00:00
} finally {
2018-04-11 23:29:36 +00:00
if ( _d ) throw _e ;
2017-07-11 10:43:53 +00:00
}
2018-04-11 03:58:22 +00:00
}
2018-04-11 15:12:44 +00:00
2018-04-11 23:29:36 +00:00
return _arr ;
}
babelHelpers . slicedToArray = function ( arr , i ) {
if ( Array . isArray ( arr ) ) {
return arr ;
} else if ( Symbol . iterator in Object ( arr ) ) {
return _sliceIterator ( arr , i ) ;
} else {
2018-05-11 02:06:46 +00:00
throw new TypeError ( 'Invalid attempt to destructure non-iterable instance' ) ;
2018-04-11 23:29:36 +00:00
}
} ;
2017-07-11 10:43:53 +00:00
2018-05-11 02:06:46 +00:00
babelHelpers . taggedTemplateLiteral = function ( strings , raw ) {
return Object . freeze (
Object . defineProperties ( strings , {
raw : {
value : Object . freeze ( raw ) ,
} ,
} ) ,
) ;
2017-07-11 10:43:53 +00:00
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . toArray = function ( arr ) {
2017-07-11 10:43:53 +00:00
return Array . isArray ( arr ) ? arr : Array . from ( arr ) ;
} ;
2018-05-11 02:06:46 +00:00
babelHelpers . toConsumableArray = function ( arr ) {
2017-07-11 10:43:53 +00:00
if ( Array . isArray ( arr ) ) {
2018-05-11 02:06:46 +00:00
for ( var i = 0 , arr2 = new Array ( arr . length ) ; i < arr . length ; i ++ )
arr2 [ i ] = arr [ i ] ;
2017-07-11 10:43:53 +00:00
return arr2 ;
} else {
return Array . from ( arr ) ;
}
} ;
2018-04-11 23:29:36 +00:00
babelHelpers . assertThisInitialized = function ( self ) {
if ( self === void 0 ) {
throw new ReferenceError (
"this hasn't been initialised - super() hasn't been called" ,
) ;
}
return self ;
} ;
babelHelpers . taggedTemplateLiteralLoose = function ( strings , raw ) {
strings . raw = raw ;
return strings ;
} ;