diff --git a/.DS_Store b/.DS_Store index 7148006..387dd24 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/package.json b/package.json index 1a4a340..6817c8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-xp-app", - "version": "0.3.4", + "version": "0.4.0", "description": "react xp project generator", "main": "index.js", "bin": { diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/README.md b/src/README.md index b3748b4..aea4d39 100644 --- a/src/README.md +++ b/src/README.md @@ -1,4 +1,4 @@ -# RXP +# RXPHelloWorld This app works on React Native (iOS, Android) and web. Most of the app's code is contained in `App.tsx`. @@ -7,10 +7,6 @@ The commands in the instructions below assume you are in the root of this repo. ### Initial Setup - Run `npm install`. This fetches the dependencies. -- Open `node_modules/reactxp/dist/native-common/App.js` and replace -`RN.AppRegistry.registerComponent('RXApp',` -with -`RN.AppRegistry.registerComponent('reactXPTest',` ### Building for Web diff --git a/src/__tests__/index.android.js b/src/__tests__/index.android.js deleted file mode 100644 index b49b908..0000000 --- a/src/__tests__/index.android.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.android.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/src/__tests__/index.ios.js b/src/__tests__/index.ios.js deleted file mode 100644 index ba7c5b5..0000000 --- a/src/__tests__/index.ios.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.ios.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/src/android/app/BUCK b/src/android/app/BUCK index d97d877..0872039 100644 --- a/src/android/app/BUCK +++ b/src/android/app/BUCK @@ -1,5 +1,3 @@ -import re - # To learn about Buck see [Docs](https://buckbuild.com/). # To run your application with Buck: # - install Buck @@ -11,8 +9,9 @@ import re # lib_deps = [] + for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] lib_deps.append(':' + name) prebuilt_jar( name = name, @@ -20,7 +19,7 @@ for jarfile in glob(['libs/*.jar']): ) for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] lib_deps.append(':' + name) android_prebuilt_aar( name = name, @@ -28,39 +27,39 @@ for aarfile in glob(['libs/*.aar']): ) android_library( - name = 'all-libs', - exported_deps = lib_deps + name = "all-libs", + exported_deps = lib_deps, ) android_library( - name = 'app-code', - srcs = glob([ - 'src/main/java/**/*.java', - ]), - deps = [ - ':all-libs', - ':build_config', - ':res', - ], + name = "app-code", + srcs = glob([ + "src/main/java/**/*.java", + ]), + deps = [ + ":all-libs", + ":build_config", + ":res", + ], ) android_build_config( - name = 'build_config', - package = 'com.rxapp', + name = "build_config", + package = "com.rxphelloworld", ) android_resource( - name = 'res', - res = 'src/main/res', - package = 'com.rxapp', + name = "res", + package = "com.rxphelloworld", + res = "src/main/res", ) android_binary( - name = 'app', - package_type = 'debug', - manifest = 'src/main/AndroidManifest.xml', - keystore = '//android/keystores:debug', - deps = [ - ':app-code', - ], + name = "app", + keystore = "//android/keystores:debug", + manifest = "src/main/AndroidManifest.xml", + package_type = "debug", + deps = [ + ":app-code", + ], ) diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index 229b5e3..151f7bf 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -84,10 +84,10 @@ def enableProguardInReleaseBuilds = false android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion '25.0.0' defaultConfig { - applicationId "com.rxapp" + applicationId "com.rxphelloworld" minSdkVersion 16 targetSdkVersion 22 versionCode 1 @@ -126,6 +126,8 @@ android { } dependencies { + compile project(':react-native-video') + compile project(':react-native-svg') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 3def3cf..ccedd85 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ diff --git a/src/android/app/src/main/java/com/rxapp/MainActivity.java b/src/android/app/src/main/java/com/rxphelloworld/MainActivity.java similarity index 92% rename from src/android/app/src/main/java/com/rxapp/MainActivity.java rename to src/android/app/src/main/java/com/rxphelloworld/MainActivity.java index d27010f..beb21b2 100644 --- a/src/android/app/src/main/java/com/rxapp/MainActivity.java +++ b/src/android/app/src/main/java/com/rxphelloworld/MainActivity.java @@ -1,4 +1,4 @@ -package com.rxapp; +package com.rxphelloworld; import com.facebook.react.ReactActivity; diff --git a/src/android/app/src/main/java/com/rxapp/MainApplication.java b/src/android/app/src/main/java/com/rxphelloworld/MainApplication.java similarity index 80% rename from src/android/app/src/main/java/com/rxapp/MainApplication.java rename to src/android/app/src/main/java/com/rxphelloworld/MainApplication.java index f9924a8..56a2713 100644 --- a/src/android/app/src/main/java/com/rxapp/MainApplication.java +++ b/src/android/app/src/main/java/com/rxphelloworld/MainApplication.java @@ -1,8 +1,10 @@ -package com.rxapp; +package com.rxphelloworld; import android.app.Application; import com.facebook.react.ReactApplication; +import com.brentvatne.react.ReactVideoPackage; +import com.horcrux.svg.RNSvgPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; @@ -22,7 +24,9 @@ public boolean getUseDeveloperSupport() { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage() + new MainReactPackage(), + new ReactVideoPackage(), + new RNSvgPackage() ); } }; diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 4931b25..714eb11 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - rxapp + RXPHelloWorld diff --git a/src/android/gradle/wrapper/gradle-wrapper.properties b/src/android/gradle/wrapper/gradle-wrapper.properties index dbdc05d..275d566 100644 --- a/src/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Sun Apr 09 20:23:19 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/src/android/gradlew b/src/android/gradlew old mode 100755 new mode 100644 diff --git a/src/android/gradlew.bat b/src/android/gradlew.bat index aec9973..8a0b282 100644 --- a/src/android/gradlew.bat +++ b/src/android/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/android/keystores/BUCK b/src/android/keystores/BUCK index 15da20e..88e4c31 100644 --- a/src/android/keystores/BUCK +++ b/src/android/keystores/BUCK @@ -1,8 +1,8 @@ keystore( - name = 'debug', - store = 'debug.keystore', - properties = 'debug.keystore.properties', - visibility = [ - 'PUBLIC', - ], + name = "debug", + properties = "debug.keystore.properties", + store = "debug.keystore", + visibility = [ + "PUBLIC", + ], ) diff --git a/src/android/settings.gradle b/src/android/settings.gradle index 34ebd29..70def8e 100644 --- a/src/android/settings.gradle +++ b/src/android/settings.gradle @@ -1,3 +1,7 @@ -rootProject.name = 'rxapp' +rootProject.name = 'RXPHelloWorld' +include ':react-native-video' +project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android') +include ':react-native-svg' +project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') include ':app' diff --git a/src/app.json b/src/app.json deleted file mode 100644 index 5bba725..0000000 --- a/src/app.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "rxapp", - "displayName": "rxapp" -} \ No newline at end of file diff --git a/src/dist/App.js b/src/dist/App.js index 7511670..9d31db7 100644 --- a/src/dist/App.js +++ b/src/dist/App.js @@ -8,60 +8,56 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var RX = require("reactxp"); +var MainPanel = require("./MainPanel"); +var SecondPanel = require("./SecondPanel"); +var NavigationRouteId; +(function (NavigationRouteId) { + NavigationRouteId[NavigationRouteId["MainPanel"] = 0] = "MainPanel"; + NavigationRouteId[NavigationRouteId["SecondPanel"] = 1] = "SecondPanel"; +})(NavigationRouteId || (NavigationRouteId = {})); var styles = { - container: RX.Styles.createViewStyle({ - flex: 1, - justifyContent: 'center', - alignItems: 'center', + navCardStyle: RX.Styles.createViewStyle({ backgroundColor: '#f5fcff' - }), - helloWorld: RX.Styles.createTextStyle({ - fontSize: 48, - fontWeight: 'bold', - marginBottom: 28 - }), - welcome: RX.Styles.createTextStyle({ - fontSize: 32, - marginBottom: 12 - }), - instructions: RX.Styles.createTextStyle({ - fontSize: 16, - color: '#aaa', - marginBottom: 40 - }), - docLink: RX.Styles.createLinkStyle({ - fontSize: 16, - color: 'blue' }) }; var App = (function (_super) { __extends(App, _super); function App() { - var _this = _super.call(this) || this; - _this._translationValue = new RX.Animated.Value(-100); - _this._animatedStyle = RX.Styles.createAnimatedTextStyle({ - transform: [ - { - translateY: _this._translationValue + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._onNavigatorRef = function (navigator) { + _this._navigator = navigator; + }; + _this._renderScene = function (navigatorRoute) { + switch (navigatorRoute.routeId) { + case NavigationRouteId.MainPanel: + return RX.createElement(MainPanel, { onPressNavigate: _this._onPressNavigate }); + case NavigationRouteId.SecondPanel: + return RX.createElement(SecondPanel, { onNavigateBack: _this._onPressBack }); + } + return null; + }; + _this._onPressNavigate = function () { + _this._navigator.push({ + routeId: NavigationRouteId.SecondPanel, + sceneConfigType: RX.Types.NavigatorSceneConfigType.FloatFromRight, + customSceneConfig: { + hideShadow: true } - ] - }); + }); + }; + _this._onPressBack = function () { + _this._navigator.pop(); + }; return _this; } App.prototype.componentDidMount = function () { - var animation = RX.Animated.timing(this._translationValue, { - toValue: 0, - easing: RX.Animated.Easing.OutBack(), - duration: 500 - }); - animation.start(); + this._navigator.immediatelyResetRouteStack([{ + routeId: NavigationRouteId.MainPanel, + sceneConfigType: RX.Types.NavigatorSceneConfigType.Fade + }]); }; App.prototype.render = function () { - return (RX.createElement(RX.View, { style: styles.container }, - RX.createElement(RX.Animated.Text, { style: [styles.helloWorld, this._animatedStyle] }, "Hello World"), - RX.createElement(RX.Text, { style: styles.welcome }, "Welcome to ReactXP"), - RX.createElement(RX.Text, { style: styles.instructions }, "Edit App.tsx to get started"), - RX.createElement(RX.Link, { style: styles.docLink, url: 'https://microsoft.github.io/reactxp/docs' }, "View ReactXP documentation"))); + return (RX.createElement(RX.Navigator, { ref: this._onNavigatorRef, renderScene: this._renderScene, cardStyle: styles.navCardStyle })); }; return App; }(RX.Component)); diff --git a/src/dist/App.js.map b/src/dist/App.js.map index 08b05f7..85e0102 100644 --- a/src/dist/App.js.map +++ b/src/dist/App.js.map @@ -1 +1 @@ -{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA;;EAEE;;;;;;;AAEF,4BAA+B;AAE/B,IAAM,MAAM,GAAG;IACX,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACjC,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,SAAS;KAC7B,CAAC;IACF,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC/B,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC/B,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;KAChB,CAAC;CACL,CAAC;AAEF;IAAkB,uBAAwB;IAItC;QAAA,YACI,iBAAO,SAUV;QARG,KAAI,CAAC,iBAAiB,GAAG,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACrD,KAAI,CAAC,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC;YACpD,SAAS,EAAE;gBACP;oBACI,UAAU,EAAE,KAAI,CAAC,iBAAiB;iBACrC;aACJ;SACJ,CAAC,CAAC;;IACP,CAAC;IAED,+BAAiB,GAAjB;QACI,IAAI,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE;YACrD,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE;YACpC,QAAQ,EAAE,GAAG;SACd,CACJ,CAAC;QAEF,SAAS,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,oBAAM,GAAN;QACI,MAAM,CAAC,CACH,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,SAAS;YAC7B,iBAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAG,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,kBAE/C;YACnB,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,OAAO,yBAErB;YACV,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,YAAY,kCAE1B;YACV,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,OAAO,EAAG,GAAG,EAAG,0CAA0C,iCAExE,CACJ,CACb,CAAC;IACN,CAAC;IACL,UAAC;AAAD,CAAC,AA9CD,CAAkB,EAAE,CAAC,SAAS,GA8C7B;AAED,iBAAS,GAAG,CAAC"} \ No newline at end of file +{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA;;EAEE;;;;;;;AAEF,4BAA+B;AAE/B,uCAA0C;AAC1C,2CAA8C;AAE9C,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IAClB,mEAAS,CAAA;IACT,uEAAW,CAAA;AACf,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,IAAM,MAAM,GAAG;IACX,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACpC,eAAe,EAAE,SAAS;KAC7B,CAAC;CACL,CAAC;AAEF;IAAkB,uBAAsB;IAAxC;QAAA,qEAiDC;QA7BW,qBAAe,GAAG,UAAC,SAAuB;YAC9C,KAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAChC,CAAC,CAAA;QAEO,kBAAY,GAAG,UAAC,cAAuC;YAC3D,MAAM,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7B,KAAK,iBAAiB,CAAC,SAAS;oBAC5B,MAAM,CAAC,iBAAC,SAAS,IAAC,eAAe,EAAG,KAAI,CAAC,gBAAgB,GAAK,CAAA;gBAElE,KAAK,iBAAiB,CAAC,WAAW;oBAC9B,MAAM,CAAC,iBAAC,WAAW,IAAC,cAAc,EAAG,KAAI,CAAC,YAAY,GAAK,CAAA;YACnE,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC,CAAA;QAEO,sBAAgB,GAAG;YACvB,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACjB,OAAO,EAAE,iBAAiB,CAAC,WAAW;gBACtC,eAAe,EAAE,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,cAAc;gBACjE,iBAAiB,EAAE;oBACf,UAAU,EAAE,IAAI;iBACnB;aACJ,CAAC,CAAC;QACP,CAAC,CAAA;QAEO,kBAAY,GAAG;YACnB,KAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC,CAAA;;IACL,CAAC;IA9CG,+BAAiB,GAAjB;QACI,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;gBACxC,OAAO,EAAE,iBAAiB,CAAC,SAAS;gBACpC,eAAe,EAAE,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,IAAI;aAC1D,CAAC,CAAC,CAAC;IACR,CAAC;IAED,oBAAM,GAAN;QACI,MAAM,CAAC,CACH,iBAAC,EAAE,CAAC,SAAS,IACT,GAAG,EAAG,IAAI,CAAC,eAAe,EAC1B,WAAW,EAAG,IAAI,CAAC,YAAY,EAC/B,SAAS,EAAG,MAAM,CAAC,YAAY,GACjC,CACL,CAAC;IACN,CAAC;IA+BL,UAAC;AAAD,CAAC,AAjDD,CAAkB,EAAE,CAAC,SAAS,GAiD7B;AAED,iBAAS,GAAG,CAAC"} \ No newline at end of file diff --git a/src/dist/MainPanel.js b/src/dist/MainPanel.js new file mode 100644 index 0000000..91c5d7a --- /dev/null +++ b/src/dist/MainPanel.js @@ -0,0 +1,90 @@ +/* +* This file demonstrates a basic ReactXP app. +*/ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var RX = require("reactxp"); +var styles = { + scroll: RX.Styles.createScrollViewStyle({ + alignSelf: 'stretch', + backgroundColor: '#f5fcff' + }), + container: RX.Styles.createViewStyle({ + padding: 16, + justifyContent: 'center', + alignItems: 'center' + }), + helloWorld: RX.Styles.createTextStyle({ + fontSize: 48, + fontWeight: 'bold', + marginBottom: 28 + }), + welcome: RX.Styles.createTextStyle({ + fontSize: 32, + marginBottom: 12 + }), + instructions: RX.Styles.createTextStyle({ + fontSize: 16, + color: '#aaa', + marginBottom: 16 + }), + docLink: RX.Styles.createLinkStyle({ + fontSize: 16, + color: 'blue', + marginBottom: 16 + }), + roundButton: RX.Styles.createViewStyle({ + margin: 16, + borderRadius: 16, + backgroundColor: '#7d88a9' + }), + buttonText: RX.Styles.createTextStyle({ + fontSize: 16, + marginVertical: 6, + marginHorizontal: 12, + color: 'white' + }) +}; +var MainPanel = (function (_super) { + __extends(MainPanel, _super); + function MainPanel() { + var _this = _super.call(this) || this; + _this._onPressNavigate = function () { + _this.props.onPressNavigate(); + }; + _this._translationValue = new RX.Animated.Value(-100); + _this._animatedStyle = RX.Styles.createAnimatedTextStyle({ + transform: [ + { + translateY: _this._translationValue + } + ] + }); + return _this; + } + MainPanel.prototype.componentDidMount = function () { + var animation = RX.Animated.timing(this._translationValue, { + toValue: 0, + easing: RX.Animated.Easing.OutBack(), + duration: 500 + }); + animation.start(); + }; + MainPanel.prototype.render = function () { + return (RX.createElement(RX.ScrollView, { style: styles.scroll }, + RX.createElement(RX.View, { style: styles.container }, + RX.createElement(RX.Animated.Text, { style: [styles.helloWorld, this._animatedStyle] }, "Hello World"), + RX.createElement(RX.Text, { style: styles.welcome }, "Welcome to ReactXP"), + RX.createElement(RX.Text, { style: styles.instructions }, "Edit App.tsx to get started"), + RX.createElement(RX.Link, { style: styles.docLink, url: 'https://microsoft.github.io/reactxp/docs' }, "View ReactXP documentation"), + RX.createElement(RX.Button, { style: styles.roundButton, onPress: this._onPressNavigate }, + RX.createElement(RX.Text, { style: styles.buttonText }, "See More Examples"))))); + }; + return MainPanel; +}(RX.Component)); +module.exports = MainPanel; +//# sourceMappingURL=MainPanel.js.map \ No newline at end of file diff --git a/src/dist/MainPanel.js.map b/src/dist/MainPanel.js.map new file mode 100644 index 0000000..06f3491 --- /dev/null +++ b/src/dist/MainPanel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MainPanel.js","sourceRoot":"","sources":["../src/MainPanel.tsx"],"names":[],"mappings":"AAAA;;EAEE;;;;;;;AAEF,4BAA+B;AAM/B,IAAM,MAAM,GAAG;IACX,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC;QACpC,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,SAAS;KAC7B,CAAC;IACF,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACjC,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACvB,CAAC;IACF,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC/B,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC/B,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,WAAW,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACnC,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,SAAS;KAC7B,CAAC;IACF,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,EAAE;QACpB,KAAK,EAAE,OAAO;KACjB,CAAC;CACL,CAAC;AAEF;IAAwB,6BAAkC;IAItD;QAAA,YACI,iBAAO,SAUV;QAwCO,sBAAgB,GAAG;YACvB,KAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC,CAAA;QAlDG,KAAI,CAAC,iBAAiB,GAAG,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACrD,KAAI,CAAC,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC;YACpD,SAAS,EAAE;gBACP;oBACI,UAAU,EAAE,KAAI,CAAC,iBAAiB;iBACrC;aACJ;SACJ,CAAC,CAAC;;IACP,CAAC;IAED,qCAAiB,GAAjB;QACI,IAAI,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE;YACrD,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE;YACpC,QAAQ,EAAE,GAAG;SACd,CACJ,CAAC;QAEF,SAAS,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,0BAAM,GAAN;QACI,MAAM,CAAC,CACH,iBAAC,EAAE,CAAC,UAAU,IAAC,KAAK,EAAG,MAAM,CAAC,MAAM;YAChC,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,SAAS;gBAC7B,iBAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAG,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,kBAE/C;gBACnB,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,OAAO,yBAErB;gBACV,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,YAAY,kCAE1B;gBACV,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,OAAO,EAAG,GAAG,EAAG,0CAA0C,iCAExE;gBAEV,iBAAC,EAAE,CAAC,MAAM,IAAC,KAAK,EAAG,MAAM,CAAC,WAAW,EAAG,OAAO,EAAG,IAAI,CAAC,gBAAgB;oBACnE,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,UAAU,wBAExB,CACF,CACN,CACE,CACnB,CAAC;IACN,CAAC;IAKL,gBAAC;AAAD,CAAC,AA1DD,CAAwB,EAAE,CAAC,SAAS,GA0DnC;AAED,iBAAS,SAAS,CAAC"} \ No newline at end of file diff --git a/src/dist/ProgressIndicator.js b/src/dist/ProgressIndicator.js new file mode 100644 index 0000000..664e228 --- /dev/null +++ b/src/dist/ProgressIndicator.js @@ -0,0 +1,40 @@ +/** +* ProgressIndicator.tsx +* Copyright: Microsoft 2017 +* +* Circular progress indicator that shows off the use of ImageSVG +* ReactXP extension. +*/ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var RX = require("reactxp"); +var reactxp_imagesvg_1 = require("reactxp-imagesvg"); +var ProgressIndicator = (function (_super) { + __extends(ProgressIndicator, _super); + function ProgressIndicator() { + return _super !== null && _super.apply(this, arguments) || this; + } + ProgressIndicator.prototype.render = function () { + var size = this.props.size; + var progress = this.props.progress; + var radius = size / 2; + var deg = progress * 360; + var radians = Math.PI * (deg - 90) / 180; + var endX = radius + radius * Math.cos(radians); + var endY = radius + radius * Math.sin(radians); + var path = 'M' + radius + ',' + radius + + ' L' + radius + ',0' + + ' A' + radius + ',' + radius + ' 0 ' + (deg > 180 ? 1 : 0) + ',1 ' + endX + ',' + endY + + 'z'; + return (RX.createElement(reactxp_imagesvg_1.default, { viewBox: '0 0 ' + size + ' ' + size, style: this.props.style, width: size, height: size }, + RX.createElement(reactxp_imagesvg_1.SvgPath, { fillColor: this.props.fillColor, d: path }))); + }; + return ProgressIndicator; +}(RX.Component)); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ProgressIndicator; +//# sourceMappingURL=ProgressIndicator.js.map \ No newline at end of file diff --git a/src/dist/ProgressIndicator.js.map b/src/dist/ProgressIndicator.js.map new file mode 100644 index 0000000..01bf8d4 --- /dev/null +++ b/src/dist/ProgressIndicator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ProgressIndicator.js","sourceRoot":"","sources":["../src/ProgressIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;EAME;;;;;;;AAEF,4BAA+B;AAC/B,qDAA+E;AAQ/E;IAAgC,qCAAwC;IAAxE;;IA2BA,CAAC;IA1BG,kCAAM,GAAN;QACI,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACrC,IAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC;QACxB,IAAM,GAAG,GAAG,QAAQ,GAAI,GAAG,CAAC;QAC5B,IAAM,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;QAC3C,IAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjD,IAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjD,IAAM,IAAI,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM;YAC3B,IAAI,GAAG,MAAM,GAAG,IAAI;YACpB,IAAI,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI;YACtF,GAAG,CAAC;QACjB,MAAM,CAAC,CACH,iBAAC,0BAAU,IACP,OAAO,EAAG,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACpC,KAAK,EAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EACxB,KAAK,EAAG,IAAI,EACZ,MAAM,EAAG,IAAI;YAEb,iBAAC,0BAAS,IACN,SAAS,EAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAChC,CAAC,EAAG,IAAI,GACV,CACO,CAChB,CAAC;IACN,CAAC;IACL,wBAAC;AAAD,CAAC,AA3BD,CAAgC,EAAE,CAAC,SAAS,GA2B3C;;AAED,kBAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/src/dist/SecondPanel.js b/src/dist/SecondPanel.js new file mode 100644 index 0000000..17c4a3a --- /dev/null +++ b/src/dist/SecondPanel.js @@ -0,0 +1,114 @@ +/* +* This file demonstrates a basic ReactXP app. +*/ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var RX = require("reactxp"); +var reactxp_video_1 = require("reactxp-video"); +var ProgressIndicator_1 = require("./ProgressIndicator"); +var ToggleSwitch_1 = require("./ToggleSwitch"); +var styles = { + scroll: RX.Styles.createScrollViewStyle({ + alignSelf: 'stretch', + backgroundColor: '#f5fcff' + }), + container: RX.Styles.createViewStyle({ + padding: 16, + justifyContent: 'center', + alignItems: 'center' + }), + titleText: RX.Styles.createTextStyle({ + fontSize: 16, + textAlign: 'center', + marginTop: 12, + color: 'black' + }), + videoTitleText: RX.Styles.createTextStyle({ + marginBottom: 8 + }), + progressMargin: RX.Styles.createViewStyle({ + margin: 8 + }), + video: RX.Styles.createViewStyle({ + height: 176, + width: 320 + }), + roundButton: RX.Styles.createViewStyle({ + margin: 16, + borderRadius: 16, + backgroundColor: '#7d88a9' + }), + buttonText: RX.Styles.createTextStyle({ + fontSize: 16, + marginVertical: 6, + marginHorizontal: 12, + color: 'white' + }) +}; +var SecondPanel = (function (_super) { + __extends(SecondPanel, _super); + function SecondPanel() { + var _this = _super.call(this) || this; + _this._onPressBack = function () { + _this.props.onNavigateBack(); + }; + _this._playVideo = function () { + var video = _this.refs['video']; + if (video) { + video.mute(true); + video.play(); + } + }; + // Note that we define this as a variable rather than a normal method. Using this + // method, we prebind the method to this component instance. This prebinding ensures + // that each time we pass the variable as a prop in the render function, it will + // not change. We want to avoid unnecessary prop changes because this will trigger + // extra work within React's virtual DOM diffing mechanism. + _this._onChangeToggle = function (newValue) { + _this.setState({ toggleValue: newValue }); + }; + _this.state = { + toggleValue: true, + progressValue: 0 + }; + return _this; + } + SecondPanel.prototype.componentDidMount = function () { + this._startProgressIndicator(); + }; + SecondPanel.prototype.componentWillUnmount = function () { + this._stopProgressIndicator(); + }; + SecondPanel.prototype.render = function () { + return (RX.createElement(RX.ScrollView, { style: styles.scroll }, + RX.createElement(RX.View, { style: styles.container }, + RX.createElement(RX.Button, { style: styles.roundButton, onPress: this._onPressBack }, + RX.createElement(RX.Text, { style: styles.buttonText }, "Go Back")), + RX.createElement(RX.Text, { style: styles.titleText }, "Here is a simple control built using ReactXP"), + RX.createElement(ToggleSwitch_1.default, { value: this.state.toggleValue, onChange: this._onChangeToggle }), + RX.createElement(RX.Text, { style: styles.titleText }, "Here is an SVG image using the ImageSvg extension"), + RX.createElement(ProgressIndicator_1.default, { style: styles.progressMargin, progress: this.state.progressValue, fillColor: '#ddd', size: 32 }), + RX.createElement(RX.Text, { style: [styles.titleText, styles.videoTitleText] }, "Here is a video using the Video extension"), + RX.createElement(reactxp_video_1.default, { ref: 'video', style: styles.video, source: 'https://www.w3schools.com/html/mov_bbb.mp4', loop: true, onCanPlay: this._playVideo })))); + }; + SecondPanel.prototype._startProgressIndicator = function () { + var _this = this; + this._progressTimerToken = window.setInterval(function () { + var newProgressValue = (_this.state.progressValue + 0.02) % 1; + _this.setState({ progressValue: newProgressValue }); + }, 1000 / 15); + }; + SecondPanel.prototype._stopProgressIndicator = function () { + if (this._progressTimerToken) { + window.clearInterval(this._progressTimerToken); + this._progressTimerToken = undefined; + } + }; + return SecondPanel; +}(RX.Component)); +module.exports = SecondPanel; +//# sourceMappingURL=SecondPanel.js.map \ No newline at end of file diff --git a/src/dist/SecondPanel.js.map b/src/dist/SecondPanel.js.map new file mode 100644 index 0000000..baf147b --- /dev/null +++ b/src/dist/SecondPanel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SecondPanel.js","sourceRoot":"","sources":["../src/SecondPanel.tsx"],"names":[],"mappings":"AAAA;;EAEE;;;;;;;AAEF,4BAA+B;AAC/B,+CAAmD;AAEnD,yDAAoD;AACpD,+CAA0C;AAW1C,IAAM,MAAM,GAAG;IACX,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC;QACpC,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,SAAS;KAC7B,CAAC;IACF,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACjC,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACvB,CAAC;IACF,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACjC,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,OAAO;KACjB,CAAC;IACF,cAAc,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACtC,YAAY,EAAE,CAAC;KAClB,CAAC;IACF,cAAc,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACtC,MAAM,EAAE,CAAC;KACZ,CAAC;IACF,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC7B,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;KACb,CAAC;IACF,WAAW,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACnC,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,SAAS;KAC7B,CAAC;IACF,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,EAAE;QACpB,KAAK,EAAE,OAAO;KACjB,CAAC;CACL,CAAC;AAEF;IAA0B,+BAAgD;IAGtE;QAAA,YACI,iBAAO,SAMV;QAqDO,kBAAY,GAAG;YACnB,KAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAChC,CAAC,CAAA;QAEO,gBAAU,GAAG;YACjB,IAAM,KAAK,GAAG,KAAI,CAAC,IAAI,CAAC,OAAO,CAAY,CAAC;YAC5C,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,KAAK,CAAC,IAAI,EAAE,CAAC;YACjB,CAAC;QACL,CAAC,CAAA;QAgBD,iFAAiF;QACjF,oFAAoF;QACpF,gFAAgF;QAChF,kFAAkF;QAClF,2DAA2D;QACnD,qBAAe,GAAG,UAAC,QAAiB;YACxC,KAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAA;QA1FG,KAAI,CAAC,KAAK,GAAG;YACT,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,CAAC;SACnB,CAAC;;IACN,CAAC;IAED,uCAAiB,GAAjB;QACI,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACnC,CAAC;IAED,0CAAoB,GAApB;QACI,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAED,4BAAM,GAAN;QACI,MAAM,CAAC,CACH,iBAAC,EAAE,CAAC,UAAU,IAAC,KAAK,EAAG,MAAM,CAAC,MAAM;YAChC,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,SAAS;gBAC7B,iBAAC,EAAE,CAAC,MAAM,IAAC,KAAK,EAAG,MAAM,CAAC,WAAW,EAAG,OAAO,EAAG,IAAI,CAAC,YAAY;oBAC/D,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,UAAU,cAExB,CACF;gBAEZ,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,SAAS,mDAEvB;gBACV,iBAAC,sBAAY,IACT,KAAK,EAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAG,IAAI,CAAC,eAAe,GACjC;gBAEF,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,MAAM,CAAC,SAAS,wDAEvB;gBACV,iBAAC,2BAAiB,IACd,KAAK,EAAG,MAAM,CAAC,cAAc,EAC7B,QAAQ,EAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EACnC,SAAS,EAAG,MAAM,EAClB,IAAI,EAAG,EAAE,GACX;gBAEF,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,gDAEhD;gBACV,iBAAC,uBAAO,IACJ,GAAG,EAAC,OAAO,EACX,KAAK,EAAG,MAAM,CAAC,KAAK,EACpB,MAAM,EAAG,4CAA4C,EACrD,IAAI,EAAG,IAAI,EACX,SAAS,EAAG,IAAI,CAAC,UAAU,GAC7B,CACI,CACE,CACnB,CAAC;IACN,CAAC;IAcO,6CAAuB,GAA/B;QAAA,iBAKC;QAJG,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAAC;YAC1C,IAAM,gBAAgB,GAAG,CAAC,KAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/D,KAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,CAAC;QACvD,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IAClB,CAAC;IAEO,4CAAsB,GAA9B;QACI,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YAC3B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YAC/C,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACzC,CAAC;IACL,CAAC;IAUL,kBAAC;AAAD,CAAC,AAjGD,CAA0B,EAAE,CAAC,SAAS,GAiGrC;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/src/dist/ToggleSwitch.js b/src/dist/ToggleSwitch.js new file mode 100644 index 0000000..efb30d3 --- /dev/null +++ b/src/dist/ToggleSwitch.js @@ -0,0 +1,105 @@ +/** +* ToggleSwitch.tsx +* Copyright: Microsoft 2017 +* +* A simple toggle control built in ReactXP that allows users to +* pick between two values. +*/ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var RX = require("reactxp"); +var _knobLeftOff = 2; // In pixels +var _knobLeftOn = 22; // In pixels +var _animationDuration = 250; // In milliseconds +var _styles = { + container: RX.Styles.createButtonStyle({ + flexDirection: 'row', + alignItems: 'center' + }), + toggleSwitch: RX.Styles.createViewStyle({ + flexDirection: 'row', + borderRadius: 15, + marginVertical: 8, + height: 30, + width: 50, + backgroundColor: '#ddd' + }), + toggleSwitchBackground: RX.Styles.createViewStyle({ + position: 'absolute', + top: 0, + bottom: 0, + left: 0, + right: 0, + borderRadius: 15 + }), + toggleKnob: RX.Styles.createViewStyle({ + top: 2, + height: 26, + width: 26, + borderRadius: 13, + backgroundColor: 'white' + }) +}; +var ToggleSwitch = (function (_super) { + __extends(ToggleSwitch, _super); + function ToggleSwitch(props) { + var _this = _super.call(this, props) || this; + _this._handleClick = function (e) { + e.stopPropagation(); + if (_this.props.onChange) { + _this.props.onChange(!_this.props.value); + } + }; + // This value controls the left offset of the knob, which we will + // animate when the user toggles the control. + _this._knobLeftAnimationValue = new RX.Animated.Value(_this.props.value ? _knobLeftOn : _knobLeftOff); + _this._knobLeftAnimationStyle = RX.Styles.createAnimatedViewStyle({ + left: _this._knobLeftAnimationValue + }); + // This value controls the background color of the control. Here we make + // use of the interpolate method to smoothly transition between two colors. + _this._toggleColorAnimationValue = new RX.Animated.Value(_this.props.value ? 1 : 0); + _this._toggleColorAnimationStyle = RX.Styles.createAnimatedTextInputStyle({ + backgroundColor: _this._toggleColorAnimationValue.interpolate({ + inputRange: [0, 1], + outputRange: ['#66f', '#ddd'] + }) + }); + return _this; + } + ToggleSwitch.prototype.componentWillUpdate = function (newProps) { + // If the value of the toggle changes, animate the toggle sliding + // from one side to the other. In parallel, animate the opacity change. + if (this.props.value !== newProps.value) { + RX.Animated.parallel([ + RX.Animated.timing(this._knobLeftAnimationValue, { + toValue: newProps.value ? _knobLeftOn : _knobLeftOff, + duration: _animationDuration, + easing: RX.Animated.Easing.InOut() + }), + RX.Animated.timing(this._toggleColorAnimationValue, { + toValue: newProps.value ? 1 : 0, + duration: _animationDuration, + easing: RX.Animated.Easing.InOut() + }) + ]) + .start(); + } + }; + ToggleSwitch.prototype.render = function () { + var knobStyles = [_styles.toggleKnob, this._knobLeftAnimationStyle]; + var backgroundStyle = [_styles.toggleSwitchBackground, this._toggleColorAnimationStyle]; + return (RX.createElement(RX.Button, { style: _styles.container, onPress: this._handleClick }, + RX.createElement(RX.View, { style: _styles.toggleSwitch }, + RX.createElement(RX.Animated.View, { style: backgroundStyle }), + RX.createElement(RX.Animated.View, { style: knobStyles })))); + }; + return ToggleSwitch; +}(RX.Component)); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ToggleSwitch; +//# sourceMappingURL=ToggleSwitch.js.map \ No newline at end of file diff --git a/src/dist/ToggleSwitch.js.map b/src/dist/ToggleSwitch.js.map new file mode 100644 index 0000000..e43c905 --- /dev/null +++ b/src/dist/ToggleSwitch.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ToggleSwitch.js","sourceRoot":"","sources":["../src/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;EAME;;;;;;;AAEF,4BAA+B;AAO/B,IAAM,YAAY,GAAG,CAAC,CAAC,CAAC,YAAY;AACpC,IAAM,WAAW,GAAG,EAAE,CAAC,CAAC,YAAY;AACpC,IAAM,kBAAkB,GAAG,GAAG,CAAC,CAAC,kBAAkB;AAElD,IAAM,OAAO,GAAG;IACZ,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC;QACnC,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACvB,CAAC;IACF,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACpC,aAAa,EAAE,KAAK;QACpB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,CAAC;QACjB,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,MAAM;KAC1B,CAAC;IACF,sBAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAC9C,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,EAAE;KACnB,CAAC;IACF,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,OAAO;KAC3B,CAAC;CACL,CAAC;AAEF;IAA2B,gCAAqC;IAO5D,sBAAY,KAAwB;QAApC,YACI,kBAAM,KAAK,CAAC,SAkBf;QAqCO,kBAAY,GAAG,UAAC,CAA0B;YAC9C,CAAC,CAAC,eAAe,EAAE,CAAC;YAEpB,EAAE,CAAC,CAAC,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACtB,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3C,CAAC;QACL,CAAC,CAAA;QA3DG,iEAAiE;QACjE,6CAA6C;QAC7C,KAAI,CAAC,uBAAuB,GAAG,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAI,CAAC,KAAK,CAAC,KAAK,GAAG,WAAW,GAAG,YAAY,CAAC,CAAC;QACpG,KAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC;YAC7D,IAAI,EAAE,KAAI,CAAC,uBAAuB;SACrC,CAAC,CAAC;QAEH,wEAAwE;QACxE,2EAA2E;QAC3E,KAAI,CAAC,0BAA0B,GAAG,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAClF,KAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC;YACrE,eAAe,EAAE,KAAI,CAAC,0BAA0B,CAAC,WAAW,CAAC;gBACzD,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;gBAClB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;aAChC,CAAC;SACL,CAAC,CAAC;;IACP,CAAC;IAED,0CAAmB,GAAnB,UAAoB,QAA2B;QAE3C,iEAAiE;QACjE,uEAAuE;QACvE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACtC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACjB,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE;oBAC7C,OAAO,EAAE,QAAQ,CAAC,KAAK,GAAG,WAAW,GAAG,YAAY;oBACpD,QAAQ,EAAE,kBAAkB;oBAC5B,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE;iBACrC,CAAC;gBACF,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE;oBAChD,OAAO,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC;oBAC/B,QAAQ,EAAE,kBAAkB;oBAC5B,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE;iBACrC,CAAC;aACL,CAAC;iBACD,KAAK,EAAE,CAAC;QACb,CAAC;IACL,CAAC;IAED,6BAAM,GAAN;QACI,IAAM,UAAU,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACtE,IAAM,eAAe,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAE1F,MAAM,CAAC,CACH,iBAAC,EAAE,CAAC,MAAM,IAAC,KAAK,EAAG,OAAO,CAAC,SAAS,EAAG,OAAO,EAAG,IAAI,CAAC,YAAY;YAC9D,iBAAC,EAAE,CAAC,IAAI,IAAC,KAAK,EAAG,OAAO,CAAC,YAAY;gBACjC,iBAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAG,eAAe,GAAI;gBAC7C,iBAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAG,UAAU,GAAI,CAClC,CACD,CAChB,CAAC;IACN,CAAC;IASL,mBAAC;AAAD,CAAC,AAtED,CAA2B,EAAE,CAAC,SAAS,GAsEtC;;AAED,kBAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/src/dist/bundle.js b/src/dist/bundle.js index e4bb92c..437b9c1 100644 --- a/src/dist/bundle.js +++ b/src/dist/bundle.js @@ -63,7 +63,7 @@ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 492); +/******/ return __webpack_require__(__webpack_require__.s = 620); /******/ }) /************************************************************************/ /******/ ([ @@ -240,6 +240,10 @@ process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); @@ -256,6 +260,26 @@ process.umask = function() { return 0; }; /* 1 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +module.exports = __webpack_require__(52); + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(427); + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. @@ -315,7 +339,7 @@ module.exports = invariant; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 2 */ +/* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -331,7 +355,7 @@ module.exports = invariant; -var emptyFunction = __webpack_require__(17); +var emptyFunction = __webpack_require__(25); /** * Similar to invariant but only logs a warning if the condition is not met. @@ -388,7 +412,7 @@ module.exports = warning; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 3 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -432,7 +456,7 @@ function reactProdInvariant(code) { module.exports = reactProdInvariant; /***/ }), -/* 4 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -451,10 +475,10 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var React = __webpack_require__(6); -var AppConfig_1 = __webpack_require__(195); -var SubscribableEvent = __webpack_require__(114); -var Types = __webpack_require__(14); +var React = __webpack_require__(1); +var AppConfig_1 = __webpack_require__(241); +var SubscribableEvent = __webpack_require__(157); +var Types = __webpack_require__(19); exports.Types = Types; var ActivityIndicator = (function (_super) { __extends(ActivityIndicator, _super); @@ -512,16 +536,11 @@ var AnimatedView = (function (_super) { exports.AnimatedView = AnimatedView; var AnimatedValue = (function () { function AnimatedValue(val) { + // No-op } return AnimatedValue; }()); exports.AnimatedValue = AnimatedValue; -var Profiling = (function () { - function Profiling() { - } - return Profiling; -}()); -exports.Profiling = Profiling; var App = (function () { function App() { this.activationStateChangedEvent = new SubscribableEvent.SubscribableEvent(); @@ -643,7 +662,6 @@ var DeviceNetworkType; DeviceNetworkType[DeviceNetworkType["MOBILE_3G"] = 4] = "MOBILE_3G"; DeviceNetworkType[DeviceNetworkType["MOBILE_4G"] = 5] = "MOBILE_4G"; })(DeviceNetworkType = exports.DeviceNetworkType || (exports.DeviceNetworkType = {})); -; var Network = (function () { function Network() { this.connectivityChangedEvent = new SubscribableEvent.SubscribableEvent(); @@ -744,209 +762,811 @@ exports.WebView = WebView; /***/ }), -/* 5 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT +/** +* Interfaces.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Defines the template for the ReactXP interface that needs to be +* implemented for each platform. */ - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; +var React = __webpack_require__(1); +var AppConfig_1 = __webpack_require__(250); +var SubscribableEvent = __webpack_require__(161); +var Types = __webpack_require__(21); +exports.Types = Types; +var ActivityIndicator = (function (_super) { + __extends(ActivityIndicator, _super); + function ActivityIndicator() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ActivityIndicator; +}(React.Component)); +exports.ActivityIndicator = ActivityIndicator; +var Alert = (function () { + function Alert() { + } + return Alert; +}()); +exports.Alert = Alert; +var AnimatedComponent = (function (_super) { + __extends(AnimatedComponent, _super); + function AnimatedComponent() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedComponent; +}(React.Component)); +exports.AnimatedComponent = AnimatedComponent; +var AnimatedImage = (function (_super) { + __extends(AnimatedImage, _super); + function AnimatedImage() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedImage; +}(AnimatedComponent)); +exports.AnimatedImage = AnimatedImage; +var AnimatedText = (function (_super) { + __extends(AnimatedText, _super); + function AnimatedText() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedText; +}(AnimatedComponent)); +exports.AnimatedText = AnimatedText; +var AnimatedTextInput = (function (_super) { + __extends(AnimatedTextInput, _super); + function AnimatedTextInput() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedTextInput; +}(AnimatedComponent)); +exports.AnimatedTextInput = AnimatedTextInput; +var AnimatedView = (function (_super) { + __extends(AnimatedView, _super); + function AnimatedView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedView; +}(AnimatedComponent)); +exports.AnimatedView = AnimatedView; +var AnimatedValue = (function () { + function AnimatedValue(val) { + // No-op + } + return AnimatedValue; +}()); +exports.AnimatedValue = AnimatedValue; +var App = (function () { + function App() { + this.activationStateChangedEvent = new SubscribableEvent.SubscribableEvent(); + // Memory Warnings + this.memoryWarningEvent = new SubscribableEvent.SubscribableEvent(); + } + // Initialization + App.prototype.initialize = function (debug, development) { + AppConfig_1.default.setAppConfig(debug, development); + }; + return App; +}()); +exports.App = App; +var UserInterface = (function () { + function UserInterface() { + this.contentSizeMultiplierChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return UserInterface; +}()); +exports.UserInterface = UserInterface; +var Modal = (function () { + function Modal() { + } + return Modal; +}()); +exports.Modal = Modal; +var Popup = (function () { + function Popup() { + } + return Popup; +}()); +exports.Popup = Popup; +var Linking = (function () { + function Linking() { + this.deepLinkRequestEvent = new SubscribableEvent.SubscribableEvent(); + } + return Linking; +}()); +exports.Linking = Linking; +var Accessibility = (function () { + function Accessibility() { + this.screenReaderChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return Accessibility; +}()); +exports.Accessibility = Accessibility; +var Button = (function (_super) { + __extends(Button, _super); + function Button() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Button; +}(React.Component)); +exports.Button = Button; +var Picker = (function (_super) { + __extends(Picker, _super); + function Picker() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Picker; +}(React.Component)); +exports.Picker = Picker; +var Component = (function (_super) { + __extends(Component, _super); + function Component() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Component; +}(React.Component)); +exports.Component = Component; +var Image = (function (_super) { + __extends(Image, _super); + function Image() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Image; +}(React.Component)); +exports.Image = Image; +var Clipboard = (function () { + function Clipboard() { + } + return Clipboard; +}()); +exports.Clipboard = Clipboard; +var Link = (function (_super) { + __extends(Link, _super); + function Link() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Link; +}(React.Component)); +exports.Link = Link; +var Storage = (function () { + function Storage() { + } + return Storage; +}()); +exports.Storage = Storage; +var Location = (function () { + function Location() { + } + return Location; +}()); +exports.Location = Location; +var Navigator = (function (_super) { + __extends(Navigator, _super); + function Navigator() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Navigator; +}(React.Component)); +exports.Navigator = Navigator; +var DeviceNetworkType; +(function (DeviceNetworkType) { + DeviceNetworkType[DeviceNetworkType["UNKNOWN"] = 0] = "UNKNOWN"; + DeviceNetworkType[DeviceNetworkType["NONE"] = 1] = "NONE"; + DeviceNetworkType[DeviceNetworkType["WIFI"] = 2] = "WIFI"; + DeviceNetworkType[DeviceNetworkType["MOBILE_2G"] = 3] = "MOBILE_2G"; + DeviceNetworkType[DeviceNetworkType["MOBILE_3G"] = 4] = "MOBILE_3G"; + DeviceNetworkType[DeviceNetworkType["MOBILE_4G"] = 5] = "MOBILE_4G"; +})(DeviceNetworkType = exports.DeviceNetworkType || (exports.DeviceNetworkType = {})); +var Network = (function () { + function Network() { + this.connectivityChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return Network; +}()); +exports.Network = Network; +var Platform = (function () { + function Platform() { + } + return Platform; +}()); +exports.Platform = Platform; +var Input = (function () { + function Input() { + this.backButtonEvent = new SubscribableEvent.SubscribableEvent(); + this.keyDownEvent = new SubscribableEvent.SubscribableEvent(); + this.keyUpEvent = new SubscribableEvent.SubscribableEvent(); + } + return Input; +}()); +exports.Input = Input; +var ScrollView = (function (_super) { + __extends(ScrollView, _super); + function ScrollView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ScrollView; +}(React.Component)); +exports.ScrollView = ScrollView; +var StatusBar = (function () { + function StatusBar() { + } + return StatusBar; +}()); +exports.StatusBar = StatusBar; +var Styles = (function () { + function Styles() { + } + return Styles; +}()); +exports.Styles = Styles; +var Text = (function (_super) { + __extends(Text, _super); + function Text() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Text; +}(React.Component)); +exports.Text = Text; +var TextInput = (function (_super) { + __extends(TextInput, _super); + function TextInput() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextInput; +}(React.Component)); +exports.TextInput = TextInput; +var UserPresence = (function () { + function UserPresence() { + this.userPresenceChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return UserPresence; +}()); +exports.UserPresence = UserPresence; +var ViewBase = (function (_super) { + __extends(ViewBase, _super); + function ViewBase() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ViewBase; +}(React.Component)); +exports.ViewBase = ViewBase; +var View = (function (_super) { + __extends(View, _super); + function View() { + return _super !== null && _super.apply(this, arguments) || this; + } + return View; +}(ViewBase)); +exports.View = View; +var GestureView = (function (_super) { + __extends(GestureView, _super); + function GestureView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return GestureView; +}(ViewBase)); +exports.GestureView = GestureView; +var WebView = (function (_super) { + __extends(WebView, _super); + function WebView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return WebView; +}(ViewBase)); +exports.WebView = WebView; /***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(39); - - -/***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - - - -var _prodInvariant = __webpack_require__(3); - -var DOMProperty = __webpack_require__(27); -var ReactDOMComponentFlags = __webpack_require__(172); - -var invariant = __webpack_require__(1); - -var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; -var Flags = ReactDOMComponentFlags; - -var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); - -/** - * Check if a given node should be cached. - */ -function shouldPrecacheNode(node, nodeID) { - return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' '; -} - -/** - * Drill down (through composites and empty components) until we get a host or - * host text component. - * - * This is pretty polymorphic but unavoidable with the current structure we have - * for `_renderedChildren`. - */ -function getRenderedHostOrTextFromComponent(component) { - var rendered; - while (rendered = component._renderedComponent) { - component = rendered; - } - return component; -} - /** - * Populate `_hostNode` on the rendered host/text component with the given - * DOM node. The passed `inst` can be a composite. - */ -function precacheNode(inst, node) { - var hostInst = getRenderedHostOrTextFromComponent(inst); - hostInst._hostNode = node; - node[internalInstanceKey] = hostInst; -} - -function uncacheNode(inst) { - var node = inst._hostNode; - if (node) { - delete node[internalInstanceKey]; - inst._hostNode = null; - } -} +* Interfaces.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Defines the template for the ReactXP interface that needs to be +* implemented for each platform. +*/ -/** - * Populate `_hostNode` on each child of `inst`, assuming that the children - * match up with the DOM (element) children of `node`. - * - * We cache entire levels at once to avoid an n^2 problem where we access the - * children of a node sequentially and have to walk from the start to our target - * node every time. - * - * Since we update `_renderedChildren` and the actual DOM at (slightly) - * different times, we could race here and see a newer `_renderedChildren` than - * the DOM nodes we see. To avoid this, ReactMultiChild calls - * `prepareToManageChildren` before we change `_renderedChildren`, at which - * time the container's child nodes are always cached (until it unmounts). - */ -function precacheChildNodes(inst, node) { - if (inst._flags & Flags.hasCachedChildNodes) { - return; - } - var children = inst._renderedChildren; - var childNode = node.firstChild; - outer: for (var name in children) { - if (!children.hasOwnProperty(name)) { - continue; - } - var childInst = children[name]; - var childID = getRenderedHostOrTextFromComponent(childInst)._domID; - if (childID === 0) { - // We're currently unmounting this child in ReactMultiChild; skip it. +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var React = __webpack_require__(1); +var AppConfig_1 = __webpack_require__(260); +var SubscribableEvent = __webpack_require__(165); +var Types = __webpack_require__(23); +exports.Types = Types; +var ActivityIndicator = (function (_super) { + __extends(ActivityIndicator, _super); + function ActivityIndicator() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ActivityIndicator; +}(React.Component)); +exports.ActivityIndicator = ActivityIndicator; +var Alert = (function () { + function Alert() { + } + return Alert; +}()); +exports.Alert = Alert; +var AnimatedComponent = (function (_super) { + __extends(AnimatedComponent, _super); + function AnimatedComponent() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedComponent; +}(React.Component)); +exports.AnimatedComponent = AnimatedComponent; +var AnimatedImage = (function (_super) { + __extends(AnimatedImage, _super); + function AnimatedImage() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedImage; +}(AnimatedComponent)); +exports.AnimatedImage = AnimatedImage; +var AnimatedText = (function (_super) { + __extends(AnimatedText, _super); + function AnimatedText() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedText; +}(AnimatedComponent)); +exports.AnimatedText = AnimatedText; +var AnimatedTextInput = (function (_super) { + __extends(AnimatedTextInput, _super); + function AnimatedTextInput() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedTextInput; +}(AnimatedComponent)); +exports.AnimatedTextInput = AnimatedTextInput; +var AnimatedView = (function (_super) { + __extends(AnimatedView, _super); + function AnimatedView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AnimatedView; +}(AnimatedComponent)); +exports.AnimatedView = AnimatedView; +var AnimatedValue = (function () { + function AnimatedValue(val) { + // No-op + } + return AnimatedValue; +}()); +exports.AnimatedValue = AnimatedValue; +var App = (function () { + function App() { + this.activationStateChangedEvent = new SubscribableEvent.SubscribableEvent(); + // Memory Warnings + this.memoryWarningEvent = new SubscribableEvent.SubscribableEvent(); + } + // Initialization + App.prototype.initialize = function (debug, development) { + AppConfig_1.default.setAppConfig(debug, development); + }; + return App; +}()); +exports.App = App; +var UserInterface = (function () { + function UserInterface() { + this.contentSizeMultiplierChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return UserInterface; +}()); +exports.UserInterface = UserInterface; +var Modal = (function () { + function Modal() { + } + return Modal; +}()); +exports.Modal = Modal; +var Popup = (function () { + function Popup() { + } + return Popup; +}()); +exports.Popup = Popup; +var Linking = (function () { + function Linking() { + this.deepLinkRequestEvent = new SubscribableEvent.SubscribableEvent(); + } + return Linking; +}()); +exports.Linking = Linking; +var Accessibility = (function () { + function Accessibility() { + this.screenReaderChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return Accessibility; +}()); +exports.Accessibility = Accessibility; +var Button = (function (_super) { + __extends(Button, _super); + function Button() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Button; +}(React.Component)); +exports.Button = Button; +var Picker = (function (_super) { + __extends(Picker, _super); + function Picker() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Picker; +}(React.Component)); +exports.Picker = Picker; +var Component = (function (_super) { + __extends(Component, _super); + function Component() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Component; +}(React.Component)); +exports.Component = Component; +var Image = (function (_super) { + __extends(Image, _super); + function Image() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Image; +}(React.Component)); +exports.Image = Image; +var Clipboard = (function () { + function Clipboard() { + } + return Clipboard; +}()); +exports.Clipboard = Clipboard; +var Link = (function (_super) { + __extends(Link, _super); + function Link() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Link; +}(React.Component)); +exports.Link = Link; +var Storage = (function () { + function Storage() { + } + return Storage; +}()); +exports.Storage = Storage; +var Location = (function () { + function Location() { + } + return Location; +}()); +exports.Location = Location; +var Navigator = (function (_super) { + __extends(Navigator, _super); + function Navigator() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Navigator; +}(React.Component)); +exports.Navigator = Navigator; +var DeviceNetworkType; +(function (DeviceNetworkType) { + DeviceNetworkType[DeviceNetworkType["UNKNOWN"] = 0] = "UNKNOWN"; + DeviceNetworkType[DeviceNetworkType["NONE"] = 1] = "NONE"; + DeviceNetworkType[DeviceNetworkType["WIFI"] = 2] = "WIFI"; + DeviceNetworkType[DeviceNetworkType["MOBILE_2G"] = 3] = "MOBILE_2G"; + DeviceNetworkType[DeviceNetworkType["MOBILE_3G"] = 4] = "MOBILE_3G"; + DeviceNetworkType[DeviceNetworkType["MOBILE_4G"] = 5] = "MOBILE_4G"; +})(DeviceNetworkType = exports.DeviceNetworkType || (exports.DeviceNetworkType = {})); +var Network = (function () { + function Network() { + this.connectivityChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return Network; +}()); +exports.Network = Network; +var Platform = (function () { + function Platform() { + } + return Platform; +}()); +exports.Platform = Platform; +var Input = (function () { + function Input() { + this.backButtonEvent = new SubscribableEvent.SubscribableEvent(); + this.keyDownEvent = new SubscribableEvent.SubscribableEvent(); + this.keyUpEvent = new SubscribableEvent.SubscribableEvent(); + } + return Input; +}()); +exports.Input = Input; +var ScrollView = (function (_super) { + __extends(ScrollView, _super); + function ScrollView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ScrollView; +}(React.Component)); +exports.ScrollView = ScrollView; +var StatusBar = (function () { + function StatusBar() { + } + return StatusBar; +}()); +exports.StatusBar = StatusBar; +var Styles = (function () { + function Styles() { + } + return Styles; +}()); +exports.Styles = Styles; +var Text = (function (_super) { + __extends(Text, _super); + function Text() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Text; +}(React.Component)); +exports.Text = Text; +var TextInput = (function (_super) { + __extends(TextInput, _super); + function TextInput() { + return _super !== null && _super.apply(this, arguments) || this; + } + return TextInput; +}(React.Component)); +exports.TextInput = TextInput; +var UserPresence = (function () { + function UserPresence() { + this.userPresenceChangedEvent = new SubscribableEvent.SubscribableEvent(); + } + return UserPresence; +}()); +exports.UserPresence = UserPresence; +var ViewBase = (function (_super) { + __extends(ViewBase, _super); + function ViewBase() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ViewBase; +}(React.Component)); +exports.ViewBase = ViewBase; +var View = (function (_super) { + __extends(View, _super); + function View() { + return _super !== null && _super.apply(this, arguments) || this; + } + return View; +}(ViewBase)); +exports.View = View; +var GestureView = (function (_super) { + __extends(GestureView, _super); + function GestureView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return GestureView; +}(ViewBase)); +exports.GestureView = GestureView; +var WebView = (function (_super) { + __extends(WebView, _super); + function WebView() { + return _super !== null && _super.apply(this, arguments) || this; + } + return WebView; +}(ViewBase)); +exports.WebView = WebView; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var _prodInvariant = __webpack_require__(5); + +var DOMProperty = __webpack_require__(37); +var ReactDOMComponentFlags = __webpack_require__(216); + +var invariant = __webpack_require__(3); + +var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; +var Flags = ReactDOMComponentFlags; + +var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); + +/** + * Check if a given node should be cached. + */ +function shouldPrecacheNode(node, nodeID) { + return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' '; +} + +/** + * Drill down (through composites and empty components) until we get a host or + * host text component. + * + * This is pretty polymorphic but unavoidable with the current structure we have + * for `_renderedChildren`. + */ +function getRenderedHostOrTextFromComponent(component) { + var rendered; + while (rendered = component._renderedComponent) { + component = rendered; + } + return component; +} + +/** + * Populate `_hostNode` on the rendered host/text component with the given + * DOM node. The passed `inst` can be a composite. + */ +function precacheNode(inst, node) { + var hostInst = getRenderedHostOrTextFromComponent(inst); + hostInst._hostNode = node; + node[internalInstanceKey] = hostInst; +} + +function uncacheNode(inst) { + var node = inst._hostNode; + if (node) { + delete node[internalInstanceKey]; + inst._hostNode = null; + } +} + +/** + * Populate `_hostNode` on each child of `inst`, assuming that the children + * match up with the DOM (element) children of `node`. + * + * We cache entire levels at once to avoid an n^2 problem where we access the + * children of a node sequentially and have to walk from the start to our target + * node every time. + * + * Since we update `_renderedChildren` and the actual DOM at (slightly) + * different times, we could race here and see a newer `_renderedChildren` than + * the DOM nodes we see. To avoid this, ReactMultiChild calls + * `prepareToManageChildren` before we change `_renderedChildren`, at which + * time the container's child nodes are always cached (until it unmounts). + */ +function precacheChildNodes(inst, node) { + if (inst._flags & Flags.hasCachedChildNodes) { + return; + } + var children = inst._renderedChildren; + var childNode = node.firstChild; + outer: for (var name in children) { + if (!children.hasOwnProperty(name)) { + continue; + } + var childInst = children[name]; + var childID = getRenderedHostOrTextFromComponent(childInst)._domID; + if (childID === 0) { + // We're currently unmounting this child in ReactMultiChild; skip it. continue; } // We assume the child nodes are in the same order as the child instances. @@ -1052,120 +1672,476 @@ module.exports = ReactDOMComponentTree; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 8 */ +/* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +/* WEBPACK VAR INJECTION */(function(setImmediate) {/** + * SyncTasks.ts + * Author: David de Regt + * Copyright: Microsoft 2015 * + * A very simple promise library that resolves all promises synchronously instead of + * kicking them back to the main ticking thread. This affirmatively rejects the A+ + * standard for promises, and is used for a combination of performance (wrapping + * things back to the main thread is really slow) and because indexeddb loses + * context for its calls if you send them around the event loop and transactions + * automatically close. */ - - -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. - +Object.defineProperty(exports, "__esModule", { value: true }); +exports.config = { + // If we catch exceptions in success/fail blocks, it silently falls back to the fail case of the outer promise. + // If this is global variable is true, it will also spit out a console.error with the exception for debugging. + exceptionsToConsole: true, + // Whether or not to actually attempt to catch exceptions with try/catch blocks inside the resolution cases. + // Disable this for debugging when you'd rather the debugger caught the exception synchronously rather than + // digging through a stack trace. + catchExceptions: true, + // Use this option in order to debug double resolution asserts locally. + // Enabling this option in the release would have a negative impact on the application performance. + traceEnabled: false, + exceptionHandler: null, + // If an ErrorFunc is not added to the task (then, catch, always) before the task rejects or synchonously + // after that, then this function is called with the error. Default throws the error. + unhandledErrorHandler: (function (err) { throw err; }) }; - -module.exports = ExecutionEnvironment; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +function fromThenable(thenable) { + var deferred = Defer(); + // NOTE: The {} around the error handling is critical to ensure that + // we do not trigger "Possible unhandled rejection" warnings. By adding + // the braces, the error handler rejects the outer promise, but returns + // void. If we remove the braces, it would *also* return something which + // would be unhandled + thenable.then(function (value) { deferred.resolve(value); return undefined; }, function (err) { deferred.reject(err); }); + return deferred.promise(); +} +exports.fromThenable = fromThenable; +function isThenable(object) { + return object !== null && object !== void 0 && typeof object.then === 'function'; +} +function isCancelable(object) { + return object !== null && object !== void 0 && typeof object.cancel === 'function'; +} +// Runs trier(). If config.catchExceptions is set then any exception is caught and handed to catcher. +function run(trier, catcher) { + if (exports.config.catchExceptions) { + // Any try/catch/finally block in a function makes the entire function ineligible for optimization is most JS engines. + // Make sure this stays in a small/quick function, or break out into its own function. + try { + return trier(); + } + catch (e) { + return catcher(e); + } + } + else { + return trier(); + } +} +var asyncCallbacks = []; +// Ideally, we use setImmediate, but that's only supported on some environments. +// Suggestion: Use the "setimmediate" NPM package to polyfill where it's not available. +var useSetImmediate = typeof setImmediate !== 'undefined'; /** -* lodashMini.ts -* -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT license. -* -* Import and re-export of part of the lodash module. This helps reduce bundle size. -*/ - -var assign = __webpack_require__(326); -exports.assign = assign; -var clone = __webpack_require__(158); -exports.clone = clone; -var cloneDeep = __webpack_require__(328); -exports.cloneDeep = cloneDeep; -var defer = __webpack_require__(332); -exports.defer = defer; -var each = __webpack_require__(333); -exports.each = each; -var endsWith = __webpack_require__(334); -exports.endsWith = endsWith; -var extend = __webpack_require__(335); -exports.extend = extend; -var filter = __webpack_require__(159); -exports.filter = filter; -var findIndex = __webpack_require__(336); -exports.findIndex = findIndex; -var findLast = __webpack_require__(337); -exports.findLast = findLast; -var flatten = __webpack_require__(160); -exports.flatten = flatten; -var get = __webpack_require__(161); -exports.get = get; -var isArray = __webpack_require__(10); -exports.isArray = isArray; -var isEmpty = __webpack_require__(341); -exports.isEmpty = isEmpty; -var isEqual = __webpack_require__(342); -exports.isEqual = isEqual; -var isNumber = __webpack_require__(343); -exports.isNumber = isNumber; -var isObject = __webpack_require__(12); -exports.isObject = isObject; -var kebabCase = __webpack_require__(344); -exports.kebabCase = kebabCase; -var keys = __webpack_require__(26); -exports.keys = keys; -var map = __webpack_require__(346); -exports.map = map; -var mapValues = __webpack_require__(347); -exports.mapValues = mapValues; -var max = __webpack_require__(348); -exports.max = max; -var memoize = __webpack_require__(164); -exports.memoize = memoize; -var merge = __webpack_require__(349); -exports.merge = merge; -var omit = __webpack_require__(352); -exports.omit = omit; -var remove = __webpack_require__(356); -exports.remove = remove; -var throttle = __webpack_require__(359); -exports.throttle = throttle; -var union = __webpack_require__(362); -exports.union = union; + * This function will defer callback of the specified callback lambda until the next JS tick, simulating standard A+ promise behavior + */ +function asyncCallback(callback) { + asyncCallbacks.push(callback); + if (asyncCallbacks.length === 1) { + // Start a callback for the next tick + if (useSetImmediate) { + setImmediate(resolveAsyncCallbacks); + } + else { + setTimeout(resolveAsyncCallbacks, 0); + } + } +} +exports.asyncCallback = asyncCallback; +function resolveAsyncCallbacks() { + var savedCallbacks = asyncCallbacks; + asyncCallbacks = []; + for (var i = 0; i < savedCallbacks.length; i++) { + savedCallbacks[i](); + } +} +function Defer() { + return new Internal.SyncTask(); +} +exports.Defer = Defer; +function Resolved(val) { + return new Internal.SyncTask().resolve(val).promise(); +} +exports.Resolved = Resolved; +function Rejected(val) { + return new Internal.SyncTask().reject(val).promise(); +} +exports.Rejected = Rejected; +var Internal; +(function (Internal) { + var SyncTask = (function () { + function SyncTask() { + this._completedSuccess = false; + this._completedFail = false; + this._traceEnabled = false; + this._cancelCallbacks = []; + this._wasCanceled = false; + this._resolving = false; + this._storedCallbackSets = []; + // 'Handled' just means there was a callback set added. + // Note: If that callback does not handle the error then that callback's task will be 'unhandled' instead of this one. + this._mustHandleError = true; + } + SyncTask.prototype._addCallbackSet = function (set, callbackWillChain) { + var task = new SyncTask(); + task.onCancel(this.cancel.bind(this)); + set.task = task; + this._storedCallbackSets.push(set); + if (callbackWillChain) { + // The callback inherits responsibility for "handling" errors. + this._mustHandleError = false; + } + else { + // The callback can never "handle" errors since nothing can chain to it. + task._mustHandleError = false; + } + // The _resolve* functions handle callbacks being added while they are running. + if (!this._resolving) { + if (this._completedSuccess) { + this._resolveSuccesses(); + } + else if (this._completedFail) { + this._resolveFailures(); + } + } + return task.promise(); + }; + SyncTask.prototype.onCancel = function (callback) { + // Only register cancel callback handler on promise that hasn't been completed + if (!this._completedSuccess && !this._completedFail) { + if (this._wasCanceled) { + callback(this._cancelContext); + } + else { + this._cancelCallbacks.push(callback); + } + } + return this; + }; + SyncTask.prototype.then = function (successFunc, errorFunc) { + return this._addCallbackSet({ + successFunc: successFunc, + failFunc: errorFunc + }, true); + }; + SyncTask.prototype.thenAsync = function (successFunc, errorFunc) { + return this._addCallbackSet({ + successFunc: successFunc, + failFunc: errorFunc, + asyncCallback: true + }, true); + }; + SyncTask.prototype.catch = function (errorFunc) { + return this._addCallbackSet({ + failFunc: errorFunc + }, true); + }; + SyncTask.prototype.always = function (func) { + return this._addCallbackSet({ + successFunc: func, + failFunc: func + }, true); + }; + SyncTask.prototype.setTracingEnabled = function (enabled) { + this._traceEnabled = enabled; + return this; + }; + // Finally should let you inspect the value of the promise as it passes through without affecting the then chaining + // i.e. a failed promise with a finally after it should then chain to the fail case of the next then + SyncTask.prototype.finally = function (func) { + this._addCallbackSet({ + successFunc: func, + failFunc: func + }, false); + return this; + }; + SyncTask.prototype.done = function (successFunc) { + this._addCallbackSet({ + successFunc: successFunc + }, false); + return this; + }; + SyncTask.prototype.fail = function (errorFunc) { + this._addCallbackSet({ + failFunc: errorFunc + }, false); + return this; + }; + SyncTask.prototype.resolve = function (obj) { + this._checkState(true); + this._completedSuccess = true; + this._storedResolution = obj; + this._resolveSuccesses(); + return this; + }; + SyncTask.prototype.reject = function (obj) { + this._checkState(false); + this._completedFail = true; + this._storedErrResolution = obj; + this._resolveFailures(); + SyncTask._enforceErrorHandled(this); + return this; + }; + SyncTask.prototype._checkState = function (resolve) { + if (this._completedSuccess || this._completedFail) { + if (this._completeStack) { + console.error(this._completeStack.message, this._completeStack.stack); + } + var message = 'Failed to ' + (resolve ? 'resolve' : 'reject') + + ': the task is already ' + (this._completedSuccess ? 'resolved' : 'rejected'); + throw new Error(message); + } + if (exports.config.traceEnabled || this._traceEnabled) { + this._completeStack = new Error( true ? 'resolve' : 'reject'); + } + }; + // Make sure any rejected task has its failured handled. + SyncTask._enforceErrorHandled = function (task) { + if (!task._mustHandleError) { + return; + } + SyncTask._rejectedTasks.push(task); + // Wait for some async time in the future to check these tasks. + if (!SyncTask._enforceErrorHandledTimer) { + SyncTask._enforceErrorHandledTimer = setTimeout(function () { + SyncTask._enforceErrorHandledTimer = null; + var rejectedTasks = SyncTask._rejectedTasks; + SyncTask._rejectedTasks = []; + rejectedTasks.forEach(function (rejectedTask, i) { + if (rejectedTask._mustHandleError) { + // Unhandled! + exports.config.unhandledErrorHandler(rejectedTask._storedErrResolution); + } + }); + }, 0); + } + }; + SyncTask.prototype.cancel = function (context) { + var _this = this; + if (this._wasCanceled) { + throw new Error('Already Canceled'); + } + this._wasCanceled = true; + this._cancelContext = context; + if (this._cancelCallbacks.length > 0) { + this._cancelCallbacks.forEach(function (callback) { + if (!_this._completedSuccess && !_this._completedFail) { + callback(_this._cancelContext); + } + }); + } + }; + SyncTask.prototype.promise = function () { + return this; + }; + SyncTask.prototype._resolveSuccesses = function () { + var _this = this; + this._resolving = true; + // New callbacks can be added as the current callbacks run: use a loop to get through all of them. + while (this._storedCallbackSets.length) { + // Only iterate over the current list of callbacks. + var callbacks = this._storedCallbackSets; + this._storedCallbackSets = []; + callbacks.forEach(function (callback) { + if (callback.asyncCallback) { + asyncCallback(_this._resolveCallback.bind(_this, callback)); + } + else { + _this._resolveCallback(callback); + } + }); + } + this._resolving = false; + }; + SyncTask.prototype._resolveCallback = function (callback) { + var _this = this; + if (callback.successFunc) { + run(function () { + var ret = callback.successFunc(_this._storedResolution); + if (isCancelable(ret)) { + _this._cancelCallbacks.push(ret.cancel.bind(ret)); + if (_this._wasCanceled) { + ret.cancel(_this._cancelContext); + } + } + if (isThenable(ret)) { + // The success block of a then returned a new promise, so + ret.then(function (r) { callback.task.resolve(r); }, function (e) { callback.task.reject(e); }); + } + else { + callback.task.resolve(ret); + } + }, function (e) { + _this._handleException(e, 'SyncTask caught exception in success block: ' + e.toString()); + callback.task.reject(e); + }); + } + else { + callback.task.resolve(this._storedResolution); + } + }; + SyncTask.prototype._resolveFailures = function () { + var _this = this; + this._resolving = true; + // New callbacks can be added as the current callbacks run: use a loop to get through all of them. + while (this._storedCallbackSets.length) { + // Only iterate over the current list of callbacks. + var callbacks = this._storedCallbackSets; + this._storedCallbackSets = []; + callbacks.forEach(function (callback) { + if (callback.failFunc) { + run(function () { + var ret = callback.failFunc(_this._storedErrResolution); + if (isCancelable(ret)) { + _this._cancelCallbacks.push(ret.cancel.bind(ret)); + if (_this._wasCanceled) { + ret.cancel(_this._cancelContext); + } + } + if (isThenable(ret)) { + ret.then(function (r) { callback.task.resolve(r); }, function (e) { callback.task.reject(e); }); + } + else { + // The failure has been handled: ret is the resolved value. + callback.task.resolve(ret); + } + }, function (e) { + _this._handleException(e, 'SyncTask caught exception in failure block: ' + e.toString()); + callback.task.reject(e); + }); + } + else { + callback.task.reject(_this._storedErrResolution); + } + }); + } + this._resolving = false; + }; + SyncTask.prototype._handleException = function (e, message) { + if (exports.config.exceptionsToConsole) { + console.error(message); + } + if (exports.config.exceptionHandler) { + exports.config.exceptionHandler(e); + } + }; + return SyncTask; + }()); + SyncTask._rejectedTasks = []; + SyncTask._enforceErrorHandledTimer = null; + Internal.SyncTask = SyncTask; +})(Internal || (Internal = {})); +function all(items) { + if (items.length === 0) { + return Resolved([]); + } + var outTask = Defer(); + var countRemaining = items.length; + var foundError = null; + var results = Array(items.length); + outTask.onCancel(function (val) { + items.forEach(function (item) { + if (isCancelable(item)) { + item.cancel(val); + } + }); + }); + var checkFinish = function () { + if (--countRemaining === 0) { + if (foundError !== null) { + outTask.reject(foundError); + } + else { + outTask.resolve(results); + } + } + }; + items.forEach(function (item, index) { + if (isThenable(item)) { + var task = item; + task.then(function (res) { + results[index] = res; + checkFinish(); + }, function (err) { + if (foundError === null) { + foundError = (err !== null) ? err : true; + } + checkFinish(); + }); + } + else { + // Not a task, so resolve directly with the item + results[index] = item; + checkFinish(); + } + }); + return outTask.promise(); +} +exports.all = all; +function race(items) { + var outTask = Defer(); + var hasSettled = false; + outTask.onCancel(function (val) { + items.forEach(function (item) { + if (isCancelable(item)) { + item.cancel(val); + } + }); + }); + items.forEach(function (item) { + if (isThenable(item)) { + var task = item; + task.then(function (res) { + if (!hasSettled) { + hasSettled = true; + outTask.resolve(res); + } + }, function (err) { + if (!hasSettled) { + hasSettled = true; + outTask.reject(err); + } + }); + } + else { + // Not a task, so resolve directly with the item + if (!hasSettled) { + hasSettled = true; + outTask.resolve(item); + } + } + }); + return outTask.promise(); +} +exports.race = race; +function raceTimer(promise, timeMs) { + var timerDef = Defer(); + var token = setTimeout(function () { + timerDef.resolve({ timedOut: true }); + }, timeMs); + var adaptedPromise = promise.then(function (resp) { + clearTimeout(token); + return { timedOut: false, result: resp }; + }); + return race([adaptedPromise, timerDef.promise()]); +} +exports.raceTimer = raceTimer; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(269).setImmediate)) /***/ }), -/* 10 */ +/* 12 */ /***/ (function(module, exports) { /** @@ -1197,18 +2173,265 @@ module.exports = isArray; /***/ }), -/* 11 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ -module.exports = __webpack_require__(380); +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -/***/ }), -/* 12 */ -/***/ (function(module, exports) { +/** + * 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; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* lodashMini.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Import and re-export of part of the lodash module. This helps reduce bundle size. +*/ + +var assign = __webpack_require__(116); +exports.assign = assign; +var clone = __webpack_require__(46); +exports.clone = clone; +var cloneDeep = __webpack_require__(117); +exports.cloneDeep = cloneDeep; +var defer = __webpack_require__(118); +exports.defer = defer; +var each = __webpack_require__(119); +exports.each = each; +var endsWith = __webpack_require__(120); +exports.endsWith = endsWith; +var extend = __webpack_require__(76); +exports.extend = extend; +var filter = __webpack_require__(47); +exports.filter = filter; +var findIndex = __webpack_require__(121); +exports.findIndex = findIndex; +var findLast = __webpack_require__(122); +exports.findLast = findLast; +var flatten = __webpack_require__(77); +exports.flatten = flatten; +var get = __webpack_require__(78); +exports.get = get; +var isArray = __webpack_require__(12); +exports.isArray = isArray; +var isEmpty = __webpack_require__(123); +exports.isEmpty = isEmpty; +var isEqual = __webpack_require__(124); +exports.isEqual = isEqual; +var isNumber = __webpack_require__(127); +exports.isNumber = isNumber; +var isObject = __webpack_require__(17); +exports.isObject = isObject; +var kebabCase = __webpack_require__(128); +exports.kebabCase = kebabCase; +var keys = __webpack_require__(28); +exports.keys = keys; +var map = __webpack_require__(129); +exports.map = map; +var mapValues = __webpack_require__(130); +exports.mapValues = mapValues; +var max = __webpack_require__(131); +exports.max = max; +var memoize = __webpack_require__(80); +exports.memoize = memoize; +var merge = __webpack_require__(132); +exports.merge = merge; +var omit = __webpack_require__(133); +exports.omit = omit; +var remove = __webpack_require__(135); +exports.remove = remove; +var throttle = __webpack_require__(137); +exports.throttle = throttle; +var union = __webpack_require__(139); +exports.union = union; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* lodashMini.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Import and re-export of part of the lodash module. This helps reduce bundle size. +*/ + +var assign = __webpack_require__(116); +exports.assign = assign; +var clone = __webpack_require__(46); +exports.clone = clone; +var cloneDeep = __webpack_require__(117); +exports.cloneDeep = cloneDeep; +var defer = __webpack_require__(118); +exports.defer = defer; +var each = __webpack_require__(119); +exports.each = each; +var endsWith = __webpack_require__(120); +exports.endsWith = endsWith; +var extend = __webpack_require__(76); +exports.extend = extend; +var filter = __webpack_require__(47); +exports.filter = filter; +var findIndex = __webpack_require__(121); +exports.findIndex = findIndex; +var findLast = __webpack_require__(122); +exports.findLast = findLast; +var flatten = __webpack_require__(77); +exports.flatten = flatten; +var get = __webpack_require__(78); +exports.get = get; +var isArray = __webpack_require__(12); +exports.isArray = isArray; +var isEmpty = __webpack_require__(123); +exports.isEmpty = isEmpty; +var isEqual = __webpack_require__(124); +exports.isEqual = isEqual; +var isNumber = __webpack_require__(127); +exports.isNumber = isNumber; +var isObject = __webpack_require__(17); +exports.isObject = isObject; +var kebabCase = __webpack_require__(128); +exports.kebabCase = kebabCase; +var keys = __webpack_require__(28); +exports.keys = keys; +var map = __webpack_require__(129); +exports.map = map; +var mapValues = __webpack_require__(130); +exports.mapValues = mapValues; +var max = __webpack_require__(131); +exports.max = max; +var memoize = __webpack_require__(80); +exports.memoize = memoize; +var merge = __webpack_require__(132); +exports.merge = merge; +var omit = __webpack_require__(133); +exports.omit = omit; +var remove = __webpack_require__(135); +exports.remove = remove; +var throttle = __webpack_require__(137); +exports.throttle = throttle; +var union = __webpack_require__(139); +exports.union = union; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* lodashMini.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Import and re-export of part of the lodash module. This helps reduce bundle size. +*/ + +var assign = __webpack_require__(116); +exports.assign = assign; +var clone = __webpack_require__(46); +exports.clone = clone; +var cloneDeep = __webpack_require__(117); +exports.cloneDeep = cloneDeep; +var defer = __webpack_require__(118); +exports.defer = defer; +var each = __webpack_require__(119); +exports.each = each; +var endsWith = __webpack_require__(120); +exports.endsWith = endsWith; +var extend = __webpack_require__(76); +exports.extend = extend; +var filter = __webpack_require__(47); +exports.filter = filter; +var findIndex = __webpack_require__(121); +exports.findIndex = findIndex; +var findLast = __webpack_require__(122); +exports.findLast = findLast; +var flatten = __webpack_require__(77); +exports.flatten = flatten; +var get = __webpack_require__(78); +exports.get = get; +var isArray = __webpack_require__(12); +exports.isArray = isArray; +var isEmpty = __webpack_require__(123); +exports.isEmpty = isEmpty; +var isEqual = __webpack_require__(124); +exports.isEqual = isEqual; +var isNumber = __webpack_require__(127); +exports.isNumber = isNumber; +var isObject = __webpack_require__(17); +exports.isObject = isObject; +var kebabCase = __webpack_require__(128); +exports.kebabCase = kebabCase; +var keys = __webpack_require__(28); +exports.keys = keys; +var map = __webpack_require__(129); +exports.map = map; +var mapValues = __webpack_require__(130); +exports.mapValues = mapValues; +var max = __webpack_require__(131); +exports.max = max; +var memoize = __webpack_require__(80); +exports.memoize = memoize; +var merge = __webpack_require__(132); +exports.merge = merge; +var omit = __webpack_require__(133); +exports.omit = omit; +var remove = __webpack_require__(135); +exports.remove = remove; +var throttle = __webpack_require__(137); +exports.throttle = throttle; +var union = __webpack_require__(139); +exports.union = union; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { /** * Checks if `value` is the @@ -1244,7 +2467,7 @@ module.exports = isObject; /***/ }), -/* 13 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1261,12 +2484,12 @@ module.exports = isObject; -var _prodInvariant = __webpack_require__(32); +var _prodInvariant = __webpack_require__(53); -var ReactCurrentOwner = __webpack_require__(20); +var ReactCurrentOwner = __webpack_require__(30); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); +var invariant = __webpack_require__(3); +var warning = __webpack_require__(4); function isNative(fn) { // Based on isNative() from Lodash @@ -1274,11 +2497,11 @@ function isNative(fn) { var hasOwnProperty = Object.prototype.hasOwnProperty; var reIsNative = RegExp('^' + funcToString // Take an example native function source for comparison - .call(hasOwnProperty) + .call(hasOwnProperty // Strip regex characters so we can use it for regex - .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&' // Remove hasOwnProperty from the template to make it generic - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); try { var source = funcToString.call(fn); return reIsNative.test(source); @@ -1577,14 +2800,59 @@ var ReactComponentTreeHook = { getRootIDs: getRootIDs, - getRegisteredIDs: getItemIDs + getRegisteredIDs: getItemIDs, + + pushNonStandardWarningStack: function (isCreatingElement, currentSource) { + if (typeof console.reactStack !== 'function') { + return; + } + + var stack = []; + var currentOwner = ReactCurrentOwner.current; + var id = currentOwner && currentOwner._debugID; + + try { + if (isCreatingElement) { + stack.push({ + name: id ? ReactComponentTreeHook.getDisplayName(id) : null, + fileName: currentSource ? currentSource.fileName : null, + lineNumber: currentSource ? currentSource.lineNumber : null + }); + } + + while (id) { + var element = ReactComponentTreeHook.getElement(id); + var parentID = ReactComponentTreeHook.getParentID(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null; + var source = element && element._source; + stack.push({ + name: ownerName, + fileName: source ? source.fileName : null, + lineNumber: source ? source.lineNumber : null + }); + id = parentID; + } + } catch (err) { + // Internal state is messed up. + // Stop building the stack (it's just a nice to have). + } + + console.reactStack(stack); + }, + popNonStandardWarningStack: function () { + if (typeof console.reactStackEnd !== 'function') { + return; + } + console.reactStackEnd(); + } }; module.exports = ReactComponentTreeHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 14 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1597,7 +2865,7 @@ module.exports = ReactComponentTreeHook; * Type definitions for ReactXP framework. */ -var SubscribableEvent_1 = __webpack_require__(114); +var SubscribableEvent_1 = __webpack_require__(157); exports.SubscribableEvent = SubscribableEvent_1.SubscribableEvent; exports.SubscriptionToken = SubscribableEvent_1.SubscriptionToken; // Auto, Yes, No - iOS & Android. @@ -1664,7 +2932,6 @@ var AccessibilityTrait; // is the highest priority trait. AccessibilityTrait[AccessibilityTrait["None"] = 32] = "None"; })(AccessibilityTrait = exports.AccessibilityTrait || (exports.AccessibilityTrait = {})); -; var GestureMouseCursor; (function (GestureMouseCursor) { GestureMouseCursor[GestureMouseCursor["Default"] = 0] = "Default"; @@ -1716,7 +2983,6 @@ var LocationErrorType; // ---------------------------------------------------------------------- var Animated; (function (Animated) { - ; })(Animated = exports.Animated || (exports.Animated = {})); var LinkingErrorCode; (function (LinkingErrorCode) { @@ -1737,7 +3003,7 @@ var AppActivationState; /***/ }), -/* 15 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1755,9 +3021,9 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var _ = __webpack_require__(9); -var RX = __webpack_require__(4); -var StyleLeakDetector_1 = __webpack_require__(457); +var _ = __webpack_require__(14); +var RX = __webpack_require__(6); +var StyleLeakDetector_1 = __webpack_require__(508); var Styles = (function (_super) { __extends(Styles, _super); function Styles() { @@ -2102,403 +3368,1476 @@ exports.default = new Styles(); /***/ }), -/* 16 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2016-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. - * - * - */ - - - -// Trust the developer to only use ReactInstrumentation with a __DEV__ check - -var debugTool = null; +/** +* Types.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Type definitions for ReactXP framework. +*/ -if (process.env.NODE_ENV !== 'production') { - var ReactDebugTool = __webpack_require__(174); - debugTool = ReactDebugTool; -} +var SubscribableEvent_1 = __webpack_require__(161); +exports.SubscribableEvent = SubscribableEvent_1.SubscribableEvent; +exports.SubscriptionToken = SubscribableEvent_1.SubscriptionToken; +// Auto, Yes, No - iOS & Android. +// NoHideDescendants - iOS, Android, & Desktop. +var ImportantForAccessibility; +(function (ImportantForAccessibility) { + ImportantForAccessibility[ImportantForAccessibility["Auto"] = 1] = "Auto"; + ImportantForAccessibility[ImportantForAccessibility["Yes"] = 2] = "Yes"; + ImportantForAccessibility[ImportantForAccessibility["No"] = 3] = "No"; + ImportantForAccessibility[ImportantForAccessibility["NoHideDescendants"] = 4] = "NoHideDescendants"; +})(ImportantForAccessibility = exports.ImportantForAccessibility || (exports.ImportantForAccessibility = {})); +// Android & Desktop supported prop, which allows screen-reader to inform its users when a +// component has dynamically changed. For example, the content of an inApp toast. +var AccessibilityLiveRegion; +(function (AccessibilityLiveRegion) { + AccessibilityLiveRegion[AccessibilityLiveRegion["None"] = 0] = "None"; + AccessibilityLiveRegion[AccessibilityLiveRegion["Polite"] = 1] = "Polite"; + AccessibilityLiveRegion[AccessibilityLiveRegion["Assertive"] = 2] = "Assertive"; +})(AccessibilityLiveRegion = exports.AccessibilityLiveRegion || (exports.AccessibilityLiveRegion = {})); +// NOTE: This enum is organized based on priority of these traits (0 is the lowest), +// which can be assigned to an accessible object. On native, all traits are combined as +// a list. On desktop, trait with the maximum value is picked. Whenever you are adding +// a new trait add it in the right priority order in the list. +var AccessibilityTrait; +(function (AccessibilityTrait) { + // Desktop and iOS. + AccessibilityTrait[AccessibilityTrait["Summary"] = 0] = "Summary"; + AccessibilityTrait[AccessibilityTrait["Adjustable"] = 1] = "Adjustable"; + // Desktop, iOS, and Android. + AccessibilityTrait[AccessibilityTrait["Button"] = 2] = "Button"; + AccessibilityTrait[AccessibilityTrait["Tab"] = 3] = "Tab"; + AccessibilityTrait[AccessibilityTrait["Selected"] = 4] = "Selected"; + // Android only. + AccessibilityTrait[AccessibilityTrait["Radio_button_checked"] = 5] = "Radio_button_checked"; + AccessibilityTrait[AccessibilityTrait["Radio_button_unchecked"] = 6] = "Radio_button_unchecked"; + // iOS only. + AccessibilityTrait[AccessibilityTrait["Link"] = 7] = "Link"; + AccessibilityTrait[AccessibilityTrait["Header"] = 8] = "Header"; + AccessibilityTrait[AccessibilityTrait["Search"] = 9] = "Search"; + AccessibilityTrait[AccessibilityTrait["Image"] = 10] = "Image"; + AccessibilityTrait[AccessibilityTrait["Plays"] = 11] = "Plays"; + AccessibilityTrait[AccessibilityTrait["Key"] = 12] = "Key"; + AccessibilityTrait[AccessibilityTrait["Text"] = 13] = "Text"; + AccessibilityTrait[AccessibilityTrait["Disabled"] = 14] = "Disabled"; + AccessibilityTrait[AccessibilityTrait["FrequentUpdates"] = 15] = "FrequentUpdates"; + AccessibilityTrait[AccessibilityTrait["StartsMedia"] = 16] = "StartsMedia"; + AccessibilityTrait[AccessibilityTrait["AllowsDirectInteraction"] = 17] = "AllowsDirectInteraction"; + AccessibilityTrait[AccessibilityTrait["PageTurn"] = 18] = "PageTurn"; + // Desktop only. + AccessibilityTrait[AccessibilityTrait["Menu"] = 19] = "Menu"; + AccessibilityTrait[AccessibilityTrait["MenuItem"] = 20] = "MenuItem"; + AccessibilityTrait[AccessibilityTrait["MenuBar"] = 21] = "MenuBar"; + AccessibilityTrait[AccessibilityTrait["TabList"] = 22] = "TabList"; + AccessibilityTrait[AccessibilityTrait["List"] = 23] = "List"; + AccessibilityTrait[AccessibilityTrait["ListItem"] = 24] = "ListItem"; + AccessibilityTrait[AccessibilityTrait["ListBox"] = 25] = "ListBox"; + AccessibilityTrait[AccessibilityTrait["Group"] = 26] = "Group"; + AccessibilityTrait[AccessibilityTrait["CheckBox"] = 27] = "CheckBox"; + AccessibilityTrait[AccessibilityTrait["ComboBox"] = 28] = "ComboBox"; + AccessibilityTrait[AccessibilityTrait["Log"] = 29] = "Log"; + AccessibilityTrait[AccessibilityTrait["Status"] = 30] = "Status"; + AccessibilityTrait[AccessibilityTrait["Dialog"] = 31] = "Dialog"; + // Desktop & mobile. This is at the end because this + // is the highest priority trait. + AccessibilityTrait[AccessibilityTrait["None"] = 32] = "None"; +})(AccessibilityTrait = exports.AccessibilityTrait || (exports.AccessibilityTrait = {})); +var GestureMouseCursor; +(function (GestureMouseCursor) { + GestureMouseCursor[GestureMouseCursor["Default"] = 0] = "Default"; + GestureMouseCursor[GestureMouseCursor["Pointer"] = 1] = "Pointer"; + GestureMouseCursor[GestureMouseCursor["Grab"] = 2] = "Grab"; + GestureMouseCursor[GestureMouseCursor["Move"] = 3] = "Move"; +})(GestureMouseCursor = exports.GestureMouseCursor || (exports.GestureMouseCursor = {})); +var PreferredPanGesture; +(function (PreferredPanGesture) { + PreferredPanGesture[PreferredPanGesture["Horizontal"] = 0] = "Horizontal"; + PreferredPanGesture[PreferredPanGesture["Vertical"] = 1] = "Vertical"; +})(PreferredPanGesture = exports.PreferredPanGesture || (exports.PreferredPanGesture = {})); +var WebViewSandboxMode; +(function (WebViewSandboxMode) { + WebViewSandboxMode[WebViewSandboxMode["None"] = 0] = "None"; + WebViewSandboxMode[WebViewSandboxMode["AllowForms"] = 1] = "AllowForms"; + WebViewSandboxMode[WebViewSandboxMode["AllowModals"] = 2] = "AllowModals"; + WebViewSandboxMode[WebViewSandboxMode["AllowOrientationLock"] = 4] = "AllowOrientationLock"; + WebViewSandboxMode[WebViewSandboxMode["AllowPointerLock"] = 8] = "AllowPointerLock"; + WebViewSandboxMode[WebViewSandboxMode["AllowPopups"] = 16] = "AllowPopups"; + WebViewSandboxMode[WebViewSandboxMode["AllowPopupsToEscapeSandbox"] = 32] = "AllowPopupsToEscapeSandbox"; + WebViewSandboxMode[WebViewSandboxMode["AllowPresentation"] = 64] = "AllowPresentation"; + WebViewSandboxMode[WebViewSandboxMode["AllowSameOrigin"] = 128] = "AllowSameOrigin"; + WebViewSandboxMode[WebViewSandboxMode["AllowScripts"] = 256] = "AllowScripts"; + WebViewSandboxMode[WebViewSandboxMode["AllowTopNavigation"] = 512] = "AllowTopNavigation"; +})(WebViewSandboxMode = exports.WebViewSandboxMode || (exports.WebViewSandboxMode = {})); +// +// Navigator +// ---------------------------------------------------------------------- +var NavigatorSceneConfigType; +(function (NavigatorSceneConfigType) { + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromRight"] = 0] = "FloatFromRight"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromLeft"] = 1] = "FloatFromLeft"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromBottom"] = 2] = "FloatFromBottom"; + NavigatorSceneConfigType[NavigatorSceneConfigType["Fade"] = 3] = "Fade"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FadeWithSlide"] = 4] = "FadeWithSlide"; +})(NavigatorSceneConfigType = exports.NavigatorSceneConfigType || (exports.NavigatorSceneConfigType = {})); +// +// Location +// ---------------------------------------------------------------------- +var LocationErrorType; +(function (LocationErrorType) { + LocationErrorType[LocationErrorType["PermissionDenied"] = 1] = "PermissionDenied"; + LocationErrorType[LocationErrorType["PositionUnavailable"] = 2] = "PositionUnavailable"; + LocationErrorType[LocationErrorType["Timeout"] = 3] = "Timeout"; +})(LocationErrorType = exports.LocationErrorType || (exports.LocationErrorType = {})); +// +// Animated +// ---------------------------------------------------------------------- +var Animated; +(function (Animated) { +})(Animated = exports.Animated || (exports.Animated = {})); +var LinkingErrorCode; +(function (LinkingErrorCode) { + LinkingErrorCode[LinkingErrorCode["NoAppFound"] = 0] = "NoAppFound"; + LinkingErrorCode[LinkingErrorCode["UnexpectedFailure"] = 1] = "UnexpectedFailure"; + LinkingErrorCode[LinkingErrorCode["Blocked"] = 2] = "Blocked"; + LinkingErrorCode[LinkingErrorCode["InitialUrlNotFound"] = 3] = "InitialUrlNotFound"; +})(LinkingErrorCode = exports.LinkingErrorCode || (exports.LinkingErrorCode = {})); +// +// App +// ---------------------------------------------------------------------- +var AppActivationState; +(function (AppActivationState) { + AppActivationState[AppActivationState["Active"] = 1] = "Active"; + AppActivationState[AppActivationState["Background"] = 2] = "Background"; + AppActivationState[AppActivationState["Inactive"] = 3] = "Inactive"; +})(AppActivationState = exports.AppActivationState || (exports.AppActivationState = {})); -module.exports = { debugTool: debugTool }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 17 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; +* Styles.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of style functions. +*/ -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - -module.exports = emptyFunction; - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -var freeGlobal = __webpack_require__(145); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - - - -var _prodInvariant = __webpack_require__(3), - _assign = __webpack_require__(5); - -var CallbackQueue = __webpack_require__(170); -var PooledClass = __webpack_require__(30); -var ReactFeatureFlags = __webpack_require__(176); -var ReactReconciler = __webpack_require__(38); -var Transaction = __webpack_require__(67); - -var invariant = __webpack_require__(1); - -var dirtyComponents = []; -var updateBatchNumber = 0; -var asapCallbackQueue = CallbackQueue.getPooled(); -var asapEnqueued = false; - -var batchingStrategy = null; - -function ensureInjected() { - !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0; -} - -var NESTED_UPDATES = { - initialize: function () { - this.dirtyComponentsLength = dirtyComponents.length; - }, - close: function () { - if (this.dirtyComponentsLength !== dirtyComponents.length) { - // Additional updates were enqueued by componentDidUpdate handlers or - // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run - // these new updates so that if A's componentDidUpdate calls setState on - // B, B will update before the callback A's updater provided when calling - // setState. - dirtyComponents.splice(0, this.dirtyComponentsLength); - flushBatchedUpdates(); - } else { - dirtyComponents.length = 0; +var _ = __webpack_require__(15); +var RX = __webpack_require__(7); +var StyleLeakDetector_1 = __webpack_require__(550); +var Styles = (function (_super) { + __extends(Styles, _super); + function Styles() { + var _this = _super !== null && _super.apply(this, arguments) || this; + // Use memoize to cache the result after the first call. + _this._createDummyElement = _.memoize(function () { + return document.createElement('testCss'); + }); + _this._getCssPropertyAliasesJsStyle = _.memoize(function () { + var props = [ + 'flex', + 'flexDirection', + 'alignItems', + 'justifyContent', + 'alignSelf', + 'transform', + 'transition', + 'animationDuration', + 'animationTimingFunction', + 'animationDirection', + 'animationDelay', + 'animationIterationCount', + 'animationName', + 'hyphens', + 'filter', + 'appRegion' + ]; + var aliases = {}; + props.forEach(function (prop) { + var alias = _this._getCssPropertyAlias(prop); + if (prop !== alias) { + aliases[prop] = alias; + } + }); + return aliases; + }); + _this.getCssPropertyAliasesCssStyle = memoize(function () { + var jsStyleAliases = _this._getCssPropertyAliasesJsStyle(); + var aliases = {}; + _.each(_.keys(jsStyleAliases), function (prop) { + aliases[prop] = _this._convertJsToCssStyle(jsStyleAliases[prop]); + }); + return aliases; + }); + return _this; } - } -}; - -var UPDATE_QUEUEING = { - initialize: function () { - this.callbackQueue.reset(); - }, - close: function () { - this.callbackQueue.notifyAll(); - } -}; - -var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; - -function ReactUpdatesFlushTransaction() { - this.reinitializeTransaction(); - this.dirtyComponentsLength = null; - this.callbackQueue = CallbackQueue.getPooled(); - this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( - /* useCreateElement */true); -} - -_assign(ReactUpdatesFlushTransaction.prototype, Transaction, { - getTransactionWrappers: function () { - return TRANSACTION_WRAPPERS; - }, - - destructor: function () { - this.dirtyComponentsLength = null; - CallbackQueue.release(this.callbackQueue); - this.callbackQueue = null; - ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); - this.reconcileTransaction = null; - }, - - perform: function (method, scope, a) { - // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` - // with this transaction's wrappers around it. - return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); - } -}); - -PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); - -function batchedUpdates(callback, a, b, c, d, e) { - ensureInjected(); - return batchingStrategy.batchedUpdates(callback, a, b, c, d, e); -} - -/** - * Array comparator for ReactComponents by mount ordering. - * - * @param {ReactComponent} c1 first component you're comparing - * @param {ReactComponent} c2 second component you're comparing - * @return {number} Return value usable by Array.prototype.sort(). - */ -function mountOrderComparator(c1, c2) { - return c1._mountOrder - c2._mountOrder; -} - -function runBatchedUpdates(transaction) { - var len = transaction.dirtyComponentsLength; - !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0; - - // Since reconciling a component higher in the owner hierarchy usually (not - // always -- see shouldComponentUpdate()) will reconcile children, reconcile - // them before their children by sorting the array. - dirtyComponents.sort(mountOrderComparator); - - // Any updates enqueued while reconciling must be performed after this entire - // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and - // C, B could update twice in a single batch if C's render enqueues an update - // to B (since B would have already updated, we should skip it, and the only - // way we can know to do so is by checking the batch counter). - updateBatchNumber++; - - for (var i = 0; i < len; i++) { - // If a component is unmounted before pending changes apply, it will still - // be here, but we assume that it has cleared its _pendingCallbacks and - // that performUpdateIfNecessary is a noop. - var component = dirtyComponents[i]; - - // If performUpdateIfNecessary happens to enqueue any new updates, we - // shouldn't execute the callbacks until the next render happens, so - // stash the callbacks first - var callbacks = component._pendingCallbacks; - component._pendingCallbacks = null; - - var markerName; - if (ReactFeatureFlags.logTopLevelRenders) { - var namedComponent = component; - // Duck type TopLevelWrapper. This is probably always true. - if (component._currentElement.type.isReactTopLevelWrapper) { - namedComponent = component._renderedComponent; - } - markerName = 'React update: ' + namedComponent.getName(); - console.time(markerName); - } - - ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); - - if (markerName) { - console.timeEnd(markerName); - } - - if (callbacks) { - for (var j = 0; j < callbacks.length; j++) { - transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance()); - } - } - } -} - -var flushBatchedUpdates = function () { - // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents - // array and perform any updates enqueued by mount-ready handlers (i.e., - // componentDidUpdate) but we need to check here too in order to catch - // updates enqueued by setState callbacks and asap calls. - while (dirtyComponents.length || asapEnqueued) { - if (dirtyComponents.length) { - var transaction = ReactUpdatesFlushTransaction.getPooled(); - transaction.perform(runBatchedUpdates, null, transaction); - ReactUpdatesFlushTransaction.release(transaction); - } - - if (asapEnqueued) { - asapEnqueued = false; - var queue = asapCallbackQueue; - asapCallbackQueue = CallbackQueue.getPooled(); - queue.notifyAll(); - CallbackQueue.release(queue); - } - } -}; - -/** - * Mark a component as needing a rerender, adding an optional callback to a - * list of functions which will be executed once the rerender occurs. - */ -function enqueueUpdate(component) { - ensureInjected(); - - // Various parts of our code (such as ReactCompositeComponent's - // _renderValidatedComponent) assume that calls to render aren't nested; - // verify that that's the case. (This is called by each top-level update - // function, like setState, forceUpdate, etc.; creation and - // destruction of top-level components is guarded in ReactMount.) - - if (!batchingStrategy.isBatchingUpdates) { - batchingStrategy.batchedUpdates(enqueueUpdate, component); - return; - } - - dirtyComponents.push(component); - if (component._updateBatchNumber == null) { - component._updateBatchNumber = updateBatchNumber + 1; - } -} - -/** - * Enqueue a callback to be run at the end of the current batching cycle. Throws - * if no updates are currently being performed. - */ -function asap(callback, context) { - !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; - asapCallbackQueue.enqueue(callback, context); - asapEnqueued = true; + // Combines a set of styles + Styles.prototype.combine = function (defaultStyle, ruleSet) { + var combinedStyles = {}; + if (defaultStyle) { + combinedStyles = _.extend(combinedStyles, defaultStyle); + } + if (ruleSet) { + combinedStyles = _.extend.apply(_, [combinedStyles].concat(ruleSet)); + } + if ((combinedStyles.marginLeft !== undefined || combinedStyles.marginRight !== undefined || + combinedStyles.marginTop !== undefined || combinedStyles.marginBottom !== undefined) && + combinedStyles.margin !== undefined) { + console.error('Conflicting rules for margin specified.'); + delete combinedStyles.margin; + } + if ((combinedStyles.paddingLeft !== undefined || combinedStyles.paddingRight !== undefined || + combinedStyles.paddingTop !== undefined || combinedStyles.paddingBottom !== undefined) && + combinedStyles.padding !== undefined) { + console.error('Conflicting rules for padding specified.'); + delete combinedStyles.padding; + } + return combinedStyles; + }; + // Creates opaque styles that can be used for View + Styles.prototype.createViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for View + Styles.prototype.createAnimatedViewStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for ScrollView + Styles.prototype.createScrollViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Button + Styles.prototype.createButtonStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for WebView + Styles.prototype.createWebViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Text + Styles.prototype.createTextStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Text + Styles.prototype.createAnimatedTextStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for TextInput + Styles.prototype.createTextInputStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for TextInput + Styles.prototype.createAnimatedTextInputStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for Link + Styles.prototype.createLinkStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Image + Styles.prototype.createImageStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Image + Styles.prototype.createAnimatedImageStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for Picker + Styles.prototype.createPickerStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Returns the name of a CSS property or its alias. Returns null if the property is not supported. + Styles.prototype._getCssPropertyAlias = function (name) { + // If we're inside unit tests, document may not be defined yet. We don't need prefixes for tests + if (typeof document === 'undefined') { + return null; + } + var upperName = name.charAt(0).toUpperCase() + name.slice(1); + var propsToTest = [name, upperName]; + propsToTest = propsToTest.concat(['Webkit', 'webkit', 'Moz', 'O', 'ms'].map(function (prefix) { return prefix + upperName; })); + var testElement = this._createDummyElement(); + var styleObj = testElement.style; + for (var i = 0; i < propsToTest.length; i++) { + var prop = propsToTest[i]; + if (styleObj[prop] !== undefined) { + return prop; + } + } + return null; + }; + // Converts a property from JavaScript style (camel-case) to CSS style (lowercase with hyphens). + Styles.prototype._convertJsToCssStyle = function (prop) { + var cssString = ''; + if (prop) { + for (var i = 0; i < prop.length; i++) { + var lowerChar = prop[i].toLowerCase(); + if (lowerChar === prop[i]) { + cssString += lowerChar; + } + else { + cssString += '-' + lowerChar; + } + } + } + return cssString; + }; + Styles.prototype.getParentComponentName = function (component) { + var parentConstructor; + var internalInstance = component['_reactInternalInstance']; + if (internalInstance && internalInstance._currentElement && + internalInstance._currentElement._owner && internalInstance._currentElement._owner._instance) { + parentConstructor = internalInstance._currentElement._owner._instance.constructor; + } + if (!parentConstructor) { + return ''; + } + return parentConstructor.name ? parentConstructor.name : parentConstructor; + }; + Styles.prototype._adaptStyles = function (def, validate) { + if (validate) { + StyleLeakDetector_1.default.detectLeaks(def); + } + // Expand composite types. + if (def.font) { + if (def.font.fontFamily !== undefined) { + def.fontFamily = def.font.fontFamily; + } + if (def.font.fontWeight !== undefined) { + def.fontWeight = def.font.fontWeight; + } + if (def.font.fontStyle !== undefined) { + def.fontStyle = def.font.fontStyle; + } + delete def.font; + } + if (def.flex !== undefined) { + var flexValue = def.flex; + delete def.flex; + if (flexValue > 0) { + def.flex = flexValue.toString() + ' 1 auto'; + } + else if (flexValue < 0) { + def.flex = '0 1 auto'; + } + else { + def.flex = '0 0 auto'; + } + } + if (def.transform) { + var transformStrings_1 = []; + var animatedTransforms_1 = []; + _.each(def.transform, function (t) { + _.each(_.keys(t), function (key) { + // Animated transforms use AnimatedValue objects rather + // than strings. We need to store these separately. + if (typeof t[key] === 'object') { + animatedTransforms_1.push({ type: key, value: t[key] }); + } + else { + var value = t[key].toString(); + if (key.indexOf('rotate') === 0) { + value += 'deg'; + } + else if (key.indexOf('translate') === 0) { + value += 'px'; + } + transformStrings_1.push(key + '(' + value + ')'); + } + }); + }); + delete def.transform; + if (transformStrings_1.length > 0) { + def['transform'] = transformStrings_1.join(' '); + } + if (animatedTransforms_1.length > 0) { + def['animatedTransform'] = animatedTransforms_1; + } + } + if (def.shadowOffset !== undefined || def.shadowRadius !== undefined || def.shadowColor !== undefined) { + var width = 0; + var height = 0; + var radius = 0; + var color = 'black'; + if (def.shadowOffset !== undefined) { + width = def.shadowOffset.width; + height = def.shadowOffset.height; + delete def.shadowOffset; + } + if (def.shadowRadius !== undefined) { + radius = def.shadowRadius; + delete def.shadowRadius; + } + if (def.shadowColor !== undefined) { + color = def.shadowColor; + delete def.shadowColor; + } + def['boxShadow'] = width + 'px ' + height + 'px ' + radius + 'px 0px ' + color; + } + // CSS (and React JS) support lineHeight defined as either a multiple of the font + // size or a pixel count. The Types interface always uses a pixel count. We need to + // convert to the string notation to make CSS happy. + if (def.lineHeight !== undefined) { + def['lineHeight'] = def.lineHeight + 'px'; + } + // Add default border width if border style was provided. Otherwise + // the browser will default to a one-pixel border. + if (def.borderStyle) { + if (def.borderWidth === undefined) { + if (def.borderTopWidth === undefined) { + def.borderTopWidth = 0; + } + if (def.borderRightWidth === undefined) { + def.borderRightWidth = 0; + } + if (def.borderBottomWidth === undefined) { + def.borderBottomWidth = 0; + } + if (def.borderLeftWidth === undefined) { + def.borderLeftWidth = 0; + } + } + } + // CSS doesn't support vertical/horizontal margins or padding. + if (def.marginVertical !== undefined) { + def.marginTop = def.marginVertical; + def.marginBottom = def.marginVertical; + delete def.marginVertical; + } + if (def.marginHorizontal !== undefined) { + def.marginLeft = def.marginHorizontal; + def.marginRight = def.marginHorizontal; + delete def.marginHorizontal; + } + if ((def.marginHorizontal !== undefined || def.marginVertical !== undefined || + def.marginLeft !== undefined || def.marginRight !== undefined || + def.marginTop !== undefined || def.marginBottom !== undefined) && def.margin !== undefined) { + console.error('Conflicting rules for margin specified.'); + delete def.margin; + } + if (def.paddingVertical !== undefined) { + def.paddingTop = def.paddingVertical; + def.paddingBottom = def.paddingVertical; + delete def.paddingVertical; + } + if (def.paddingHorizontal !== undefined) { + def.paddingLeft = def.paddingHorizontal; + def.paddingRight = def.paddingHorizontal; + delete def.paddingHorizontal; + } + if ((def.paddingHorizontal !== undefined || def.paddingVertical !== undefined || + def.paddingLeft !== undefined || def.paddingRight !== undefined || + def.paddingTop !== undefined || def.paddingBottom !== undefined) && def.padding !== undefined) { + console.error('Conflicting rules for padding specified.'); + delete def.padding; + } + // CSS doesn't support 'textDecorationLine' + if (def.textDecorationLine !== undefined) { + def['textDecoration'] = def.textDecorationLine; + delete def.textDecorationLine; + } + // Add common aliases if necessary. + var jsAliases = this._getCssPropertyAliasesJsStyle(); + for (var prop in jsAliases) { + if (def[prop] !== undefined && jsAliases[prop]) { + def[jsAliases[prop]] = def[prop]; + } + } + // Add IE-specific word wrap property. + if (def.wordBreak === 'break-word') { + def['wordWrap'] = 'break-word'; + } + return def; + }; + return Styles; +}(RX.Styles)); +exports.Styles = Styles; +function memoize(func, resolver) { + return _.memoize(func, resolver); } +exports.memoize = memoize; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new Styles(); -var ReactUpdatesInjection = { - injectReconcileTransaction: function (ReconcileTransaction) { - !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0; - ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; - }, - - injectBatchingStrategy: function (_batchingStrategy) { - !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0; - !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0; - !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0; - batchingStrategy = _batchingStrategy; - } -}; - -var ReactUpdates = { - /** - * React references `ReactReconcileTransaction` using this property in order - * to allow dependency injection. - * - * @internal - */ - ReactReconcileTransaction: null, - - batchedUpdates: batchedUpdates, - enqueueUpdate: enqueueUpdate, - flushBatchedUpdates: flushBatchedUpdates, - injection: ReactUpdatesInjection, - asap: asap -}; - -module.exports = ReactUpdates; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 20 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - - - -/** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ -var ReactCurrentOwner = { +* Types.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Type definitions for ReactXP framework. +*/ - /** - * @internal - * @type {ReactComponent} - */ - current: null +var SubscribableEvent_1 = __webpack_require__(165); +exports.SubscribableEvent = SubscribableEvent_1.SubscribableEvent; +exports.SubscriptionToken = SubscribableEvent_1.SubscriptionToken; +// Auto, Yes, No - iOS & Android. +// NoHideDescendants - iOS, Android, & Desktop. +var ImportantForAccessibility; +(function (ImportantForAccessibility) { + ImportantForAccessibility[ImportantForAccessibility["Auto"] = 1] = "Auto"; + ImportantForAccessibility[ImportantForAccessibility["Yes"] = 2] = "Yes"; + ImportantForAccessibility[ImportantForAccessibility["No"] = 3] = "No"; + ImportantForAccessibility[ImportantForAccessibility["NoHideDescendants"] = 4] = "NoHideDescendants"; +})(ImportantForAccessibility = exports.ImportantForAccessibility || (exports.ImportantForAccessibility = {})); +// Android & Desktop supported prop, which allows screen-reader to inform its users when a +// component has dynamically changed. For example, the content of an inApp toast. +var AccessibilityLiveRegion; +(function (AccessibilityLiveRegion) { + AccessibilityLiveRegion[AccessibilityLiveRegion["None"] = 0] = "None"; + AccessibilityLiveRegion[AccessibilityLiveRegion["Polite"] = 1] = "Polite"; + AccessibilityLiveRegion[AccessibilityLiveRegion["Assertive"] = 2] = "Assertive"; +})(AccessibilityLiveRegion = exports.AccessibilityLiveRegion || (exports.AccessibilityLiveRegion = {})); +// NOTE: This enum is organized based on priority of these traits (0 is the lowest), +// which can be assigned to an accessible object. On native, all traits are combined as +// a list. On desktop, trait with the maximum value is picked. Whenever you are adding +// a new trait add it in the right priority order in the list. +var AccessibilityTrait; +(function (AccessibilityTrait) { + // Desktop and iOS. + AccessibilityTrait[AccessibilityTrait["Summary"] = 0] = "Summary"; + AccessibilityTrait[AccessibilityTrait["Adjustable"] = 1] = "Adjustable"; + // Desktop, iOS, and Android. + AccessibilityTrait[AccessibilityTrait["Button"] = 2] = "Button"; + AccessibilityTrait[AccessibilityTrait["Tab"] = 3] = "Tab"; + AccessibilityTrait[AccessibilityTrait["Selected"] = 4] = "Selected"; + // Android only. + AccessibilityTrait[AccessibilityTrait["Radio_button_checked"] = 5] = "Radio_button_checked"; + AccessibilityTrait[AccessibilityTrait["Radio_button_unchecked"] = 6] = "Radio_button_unchecked"; + // iOS only. + AccessibilityTrait[AccessibilityTrait["Link"] = 7] = "Link"; + AccessibilityTrait[AccessibilityTrait["Header"] = 8] = "Header"; + AccessibilityTrait[AccessibilityTrait["Search"] = 9] = "Search"; + AccessibilityTrait[AccessibilityTrait["Image"] = 10] = "Image"; + AccessibilityTrait[AccessibilityTrait["Plays"] = 11] = "Plays"; + AccessibilityTrait[AccessibilityTrait["Key"] = 12] = "Key"; + AccessibilityTrait[AccessibilityTrait["Text"] = 13] = "Text"; + AccessibilityTrait[AccessibilityTrait["Disabled"] = 14] = "Disabled"; + AccessibilityTrait[AccessibilityTrait["FrequentUpdates"] = 15] = "FrequentUpdates"; + AccessibilityTrait[AccessibilityTrait["StartsMedia"] = 16] = "StartsMedia"; + AccessibilityTrait[AccessibilityTrait["AllowsDirectInteraction"] = 17] = "AllowsDirectInteraction"; + AccessibilityTrait[AccessibilityTrait["PageTurn"] = 18] = "PageTurn"; + // Desktop only. + AccessibilityTrait[AccessibilityTrait["Menu"] = 19] = "Menu"; + AccessibilityTrait[AccessibilityTrait["MenuItem"] = 20] = "MenuItem"; + AccessibilityTrait[AccessibilityTrait["MenuBar"] = 21] = "MenuBar"; + AccessibilityTrait[AccessibilityTrait["TabList"] = 22] = "TabList"; + AccessibilityTrait[AccessibilityTrait["List"] = 23] = "List"; + AccessibilityTrait[AccessibilityTrait["ListItem"] = 24] = "ListItem"; + AccessibilityTrait[AccessibilityTrait["ListBox"] = 25] = "ListBox"; + AccessibilityTrait[AccessibilityTrait["Group"] = 26] = "Group"; + AccessibilityTrait[AccessibilityTrait["CheckBox"] = 27] = "CheckBox"; + AccessibilityTrait[AccessibilityTrait["ComboBox"] = 28] = "ComboBox"; + AccessibilityTrait[AccessibilityTrait["Log"] = 29] = "Log"; + AccessibilityTrait[AccessibilityTrait["Status"] = 30] = "Status"; + AccessibilityTrait[AccessibilityTrait["Dialog"] = 31] = "Dialog"; + // Desktop & mobile. This is at the end because this + // is the highest priority trait. + AccessibilityTrait[AccessibilityTrait["None"] = 32] = "None"; +})(AccessibilityTrait = exports.AccessibilityTrait || (exports.AccessibilityTrait = {})); +var GestureMouseCursor; +(function (GestureMouseCursor) { + GestureMouseCursor[GestureMouseCursor["Default"] = 0] = "Default"; + GestureMouseCursor[GestureMouseCursor["Pointer"] = 1] = "Pointer"; + GestureMouseCursor[GestureMouseCursor["Grab"] = 2] = "Grab"; + GestureMouseCursor[GestureMouseCursor["Move"] = 3] = "Move"; +})(GestureMouseCursor = exports.GestureMouseCursor || (exports.GestureMouseCursor = {})); +var PreferredPanGesture; +(function (PreferredPanGesture) { + PreferredPanGesture[PreferredPanGesture["Horizontal"] = 0] = "Horizontal"; + PreferredPanGesture[PreferredPanGesture["Vertical"] = 1] = "Vertical"; +})(PreferredPanGesture = exports.PreferredPanGesture || (exports.PreferredPanGesture = {})); +var WebViewSandboxMode; +(function (WebViewSandboxMode) { + WebViewSandboxMode[WebViewSandboxMode["None"] = 0] = "None"; + WebViewSandboxMode[WebViewSandboxMode["AllowForms"] = 1] = "AllowForms"; + WebViewSandboxMode[WebViewSandboxMode["AllowModals"] = 2] = "AllowModals"; + WebViewSandboxMode[WebViewSandboxMode["AllowOrientationLock"] = 4] = "AllowOrientationLock"; + WebViewSandboxMode[WebViewSandboxMode["AllowPointerLock"] = 8] = "AllowPointerLock"; + WebViewSandboxMode[WebViewSandboxMode["AllowPopups"] = 16] = "AllowPopups"; + WebViewSandboxMode[WebViewSandboxMode["AllowPopupsToEscapeSandbox"] = 32] = "AllowPopupsToEscapeSandbox"; + WebViewSandboxMode[WebViewSandboxMode["AllowPresentation"] = 64] = "AllowPresentation"; + WebViewSandboxMode[WebViewSandboxMode["AllowSameOrigin"] = 128] = "AllowSameOrigin"; + WebViewSandboxMode[WebViewSandboxMode["AllowScripts"] = 256] = "AllowScripts"; + WebViewSandboxMode[WebViewSandboxMode["AllowTopNavigation"] = 512] = "AllowTopNavigation"; +})(WebViewSandboxMode = exports.WebViewSandboxMode || (exports.WebViewSandboxMode = {})); +// +// Navigator +// ---------------------------------------------------------------------- +var NavigatorSceneConfigType; +(function (NavigatorSceneConfigType) { + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromRight"] = 0] = "FloatFromRight"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromLeft"] = 1] = "FloatFromLeft"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FloatFromBottom"] = 2] = "FloatFromBottom"; + NavigatorSceneConfigType[NavigatorSceneConfigType["Fade"] = 3] = "Fade"; + NavigatorSceneConfigType[NavigatorSceneConfigType["FadeWithSlide"] = 4] = "FadeWithSlide"; +})(NavigatorSceneConfigType = exports.NavigatorSceneConfigType || (exports.NavigatorSceneConfigType = {})); +// +// Location +// ---------------------------------------------------------------------- +var LocationErrorType; +(function (LocationErrorType) { + LocationErrorType[LocationErrorType["PermissionDenied"] = 1] = "PermissionDenied"; + LocationErrorType[LocationErrorType["PositionUnavailable"] = 2] = "PositionUnavailable"; + LocationErrorType[LocationErrorType["Timeout"] = 3] = "Timeout"; +})(LocationErrorType = exports.LocationErrorType || (exports.LocationErrorType = {})); +// +// Animated +// ---------------------------------------------------------------------- +var Animated; +(function (Animated) { +})(Animated = exports.Animated || (exports.Animated = {})); +var LinkingErrorCode; +(function (LinkingErrorCode) { + LinkingErrorCode[LinkingErrorCode["NoAppFound"] = 0] = "NoAppFound"; + LinkingErrorCode[LinkingErrorCode["UnexpectedFailure"] = 1] = "UnexpectedFailure"; + LinkingErrorCode[LinkingErrorCode["Blocked"] = 2] = "Blocked"; + LinkingErrorCode[LinkingErrorCode["InitialUrlNotFound"] = 3] = "InitialUrlNotFound"; +})(LinkingErrorCode = exports.LinkingErrorCode || (exports.LinkingErrorCode = {})); +// +// App +// ---------------------------------------------------------------------- +var AppActivationState; +(function (AppActivationState) { + AppActivationState[AppActivationState["Active"] = 1] = "Active"; + AppActivationState[AppActivationState["Background"] = 2] = "Background"; + AppActivationState[AppActivationState["Inactive"] = 3] = "Inactive"; +})(AppActivationState = exports.AppActivationState || (exports.AppActivationState = {})); + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* Styles.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of style functions. +*/ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; +var _ = __webpack_require__(16); +var RX = __webpack_require__(8); +var StyleLeakDetector_1 = __webpack_require__(586); +var Styles = (function (_super) { + __extends(Styles, _super); + function Styles() { + var _this = _super !== null && _super.apply(this, arguments) || this; + // Use memoize to cache the result after the first call. + _this._createDummyElement = _.memoize(function () { + return document.createElement('testCss'); + }); + _this._getCssPropertyAliasesJsStyle = _.memoize(function () { + var props = [ + 'flex', + 'flexDirection', + 'alignItems', + 'justifyContent', + 'alignSelf', + 'transform', + 'transition', + 'animationDuration', + 'animationTimingFunction', + 'animationDirection', + 'animationDelay', + 'animationIterationCount', + 'animationName', + 'hyphens', + 'filter', + 'appRegion' + ]; + var aliases = {}; + props.forEach(function (prop) { + var alias = _this._getCssPropertyAlias(prop); + if (prop !== alias) { + aliases[prop] = alias; + } + }); + return aliases; + }); + _this.getCssPropertyAliasesCssStyle = memoize(function () { + var jsStyleAliases = _this._getCssPropertyAliasesJsStyle(); + var aliases = {}; + _.each(_.keys(jsStyleAliases), function (prop) { + aliases[prop] = _this._convertJsToCssStyle(jsStyleAliases[prop]); + }); + return aliases; + }); + return _this; + } + // Combines a set of styles + Styles.prototype.combine = function (defaultStyle, ruleSet) { + var combinedStyles = {}; + if (defaultStyle) { + combinedStyles = _.extend(combinedStyles, defaultStyle); + } + if (ruleSet) { + combinedStyles = _.extend.apply(_, [combinedStyles].concat(ruleSet)); + } + if ((combinedStyles.marginLeft !== undefined || combinedStyles.marginRight !== undefined || + combinedStyles.marginTop !== undefined || combinedStyles.marginBottom !== undefined) && + combinedStyles.margin !== undefined) { + console.error('Conflicting rules for margin specified.'); + delete combinedStyles.margin; + } + if ((combinedStyles.paddingLeft !== undefined || combinedStyles.paddingRight !== undefined || + combinedStyles.paddingTop !== undefined || combinedStyles.paddingBottom !== undefined) && + combinedStyles.padding !== undefined) { + console.error('Conflicting rules for padding specified.'); + delete combinedStyles.padding; + } + return combinedStyles; + }; + // Creates opaque styles that can be used for View + Styles.prototype.createViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for View + Styles.prototype.createAnimatedViewStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for ScrollView + Styles.prototype.createScrollViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Button + Styles.prototype.createButtonStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for WebView + Styles.prototype.createWebViewStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Text + Styles.prototype.createTextStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Text + Styles.prototype.createAnimatedTextStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for TextInput + Styles.prototype.createTextInputStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for TextInput + Styles.prototype.createAnimatedTextInputStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for Link + Styles.prototype.createLinkStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Image + Styles.prototype.createImageStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Creates opaque styles that can be used for Image + Styles.prototype.createAnimatedImageStyle = function (ruleSet) { + return this._adaptStyles(ruleSet, false); + }; + // Creates opaque styles that can be used for Picker + Styles.prototype.createPickerStyle = function (ruleSet, cacheStyle) { + if (cacheStyle === void 0) { cacheStyle = true; } + return this._adaptStyles(ruleSet, cacheStyle); + }; + // Returns the name of a CSS property or its alias. Returns null if the property is not supported. + Styles.prototype._getCssPropertyAlias = function (name) { + // If we're inside unit tests, document may not be defined yet. We don't need prefixes for tests + if (typeof document === 'undefined') { + return null; + } + var upperName = name.charAt(0).toUpperCase() + name.slice(1); + var propsToTest = [name, upperName]; + propsToTest = propsToTest.concat(['Webkit', 'webkit', 'Moz', 'O', 'ms'].map(function (prefix) { return prefix + upperName; })); + var testElement = this._createDummyElement(); + var styleObj = testElement.style; + for (var i = 0; i < propsToTest.length; i++) { + var prop = propsToTest[i]; + if (styleObj[prop] !== undefined) { + return prop; + } + } + return null; + }; + // Converts a property from JavaScript style (camel-case) to CSS style (lowercase with hyphens). + Styles.prototype._convertJsToCssStyle = function (prop) { + var cssString = ''; + if (prop) { + for (var i = 0; i < prop.length; i++) { + var lowerChar = prop[i].toLowerCase(); + if (lowerChar === prop[i]) { + cssString += lowerChar; + } + else { + cssString += '-' + lowerChar; + } + } + } + return cssString; + }; + Styles.prototype.getParentComponentName = function (component) { + var parentConstructor; + var internalInstance = component['_reactInternalInstance']; + if (internalInstance && internalInstance._currentElement && + internalInstance._currentElement._owner && internalInstance._currentElement._owner._instance) { + parentConstructor = internalInstance._currentElement._owner._instance.constructor; + } + if (!parentConstructor) { + return ''; + } + return parentConstructor.name ? parentConstructor.name : parentConstructor; + }; + Styles.prototype._adaptStyles = function (def, validate) { + if (validate) { + StyleLeakDetector_1.default.detectLeaks(def); + } + // Expand composite types. + if (def.font) { + if (def.font.fontFamily !== undefined) { + def.fontFamily = def.font.fontFamily; + } + if (def.font.fontWeight !== undefined) { + def.fontWeight = def.font.fontWeight; + } + if (def.font.fontStyle !== undefined) { + def.fontStyle = def.font.fontStyle; + } + delete def.font; + } + if (def.flex !== undefined) { + var flexValue = def.flex; + delete def.flex; + if (flexValue > 0) { + def.flex = flexValue.toString() + ' 1 auto'; + } + else if (flexValue < 0) { + def.flex = '0 1 auto'; + } + else { + def.flex = '0 0 auto'; + } + } + if (def.transform) { + var transformStrings_1 = []; + var animatedTransforms_1 = []; + _.each(def.transform, function (t) { + _.each(_.keys(t), function (key) { + // Animated transforms use AnimatedValue objects rather + // than strings. We need to store these separately. + if (typeof t[key] === 'object') { + animatedTransforms_1.push({ type: key, value: t[key] }); + } + else { + var value = t[key].toString(); + if (key.indexOf('rotate') === 0) { + value += 'deg'; + } + else if (key.indexOf('translate') === 0) { + value += 'px'; + } + transformStrings_1.push(key + '(' + value + ')'); + } + }); + }); + delete def.transform; + if (transformStrings_1.length > 0) { + def['transform'] = transformStrings_1.join(' '); + } + if (animatedTransforms_1.length > 0) { + def['animatedTransform'] = animatedTransforms_1; + } + } + if (def.shadowOffset !== undefined || def.shadowRadius !== undefined || def.shadowColor !== undefined) { + var width = 0; + var height = 0; + var radius = 0; + var color = 'black'; + if (def.shadowOffset !== undefined) { + width = def.shadowOffset.width; + height = def.shadowOffset.height; + delete def.shadowOffset; + } + if (def.shadowRadius !== undefined) { + radius = def.shadowRadius; + delete def.shadowRadius; + } + if (def.shadowColor !== undefined) { + color = def.shadowColor; + delete def.shadowColor; + } + def['boxShadow'] = width + 'px ' + height + 'px ' + radius + 'px 0px ' + color; + } + // CSS (and React JS) support lineHeight defined as either a multiple of the font + // size or a pixel count. The Types interface always uses a pixel count. We need to + // convert to the string notation to make CSS happy. + if (def.lineHeight !== undefined) { + def['lineHeight'] = def.lineHeight + 'px'; + } + // Add default border width if border style was provided. Otherwise + // the browser will default to a one-pixel border. + if (def.borderStyle) { + if (def.borderWidth === undefined) { + if (def.borderTopWidth === undefined) { + def.borderTopWidth = 0; + } + if (def.borderRightWidth === undefined) { + def.borderRightWidth = 0; + } + if (def.borderBottomWidth === undefined) { + def.borderBottomWidth = 0; + } + if (def.borderLeftWidth === undefined) { + def.borderLeftWidth = 0; + } + } + } + // CSS doesn't support vertical/horizontal margins or padding. + if (def.marginVertical !== undefined) { + def.marginTop = def.marginVertical; + def.marginBottom = def.marginVertical; + delete def.marginVertical; + } + if (def.marginHorizontal !== undefined) { + def.marginLeft = def.marginHorizontal; + def.marginRight = def.marginHorizontal; + delete def.marginHorizontal; + } + if ((def.marginHorizontal !== undefined || def.marginVertical !== undefined || + def.marginLeft !== undefined || def.marginRight !== undefined || + def.marginTop !== undefined || def.marginBottom !== undefined) && def.margin !== undefined) { + console.error('Conflicting rules for margin specified.'); + delete def.margin; + } + if (def.paddingVertical !== undefined) { + def.paddingTop = def.paddingVertical; + def.paddingBottom = def.paddingVertical; + delete def.paddingVertical; + } + if (def.paddingHorizontal !== undefined) { + def.paddingLeft = def.paddingHorizontal; + def.paddingRight = def.paddingHorizontal; + delete def.paddingHorizontal; + } + if ((def.paddingHorizontal !== undefined || def.paddingVertical !== undefined || + def.paddingLeft !== undefined || def.paddingRight !== undefined || + def.paddingTop !== undefined || def.paddingBottom !== undefined) && def.padding !== undefined) { + console.error('Conflicting rules for padding specified.'); + delete def.padding; + } + // CSS doesn't support 'textDecorationLine' + if (def.textDecorationLine !== undefined) { + def['textDecoration'] = def.textDecorationLine; + delete def.textDecorationLine; + } + // Add common aliases if necessary. + var jsAliases = this._getCssPropertyAliasesJsStyle(); + for (var prop in jsAliases) { + if (def[prop] !== undefined && jsAliases[prop]) { + def[jsAliases[prop]] = def[prop]; + } + } + // Add IE-specific word wrap property. + if (def.wordBreak === 'break-word') { + def['wordWrap'] = 'break-word'; + } + return def; + }; + return Styles; +}(RX.Styles)); +exports.Styles = Styles; +function memoize(func, resolver) { + return _.memoize(func, resolver); +} +exports.memoize = memoize; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new Styles(); -module.exports = ReactCurrentOwner; /***/ }), -/* 21 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { -var isFunction = __webpack_require__(94), - isLength = __webpack_require__(95); +"use strict"; + /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2016-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. + * + * + */ + + + +// Trust the developer to only use ReactInstrumentation with a __DEV__ check + +var debugTool = null; + +if (process.env.NODE_ENV !== 'production') { + var ReactDebugTool = __webpack_require__(442); + debugTool = ReactDebugTool; +} + +module.exports = { debugTool: debugTool }; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(194); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(179), + baseKeys = __webpack_require__(185), + isArrayLike = __webpack_require__(31); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var _prodInvariant = __webpack_require__(5), + _assign = __webpack_require__(9); + +var CallbackQueue = __webpack_require__(214); +var PooledClass = __webpack_require__(41); +var ReactFeatureFlags = __webpack_require__(219); +var ReactReconciler = __webpack_require__(51); +var Transaction = __webpack_require__(85); + +var invariant = __webpack_require__(3); + +var dirtyComponents = []; +var updateBatchNumber = 0; +var asapCallbackQueue = CallbackQueue.getPooled(); +var asapEnqueued = false; + +var batchingStrategy = null; + +function ensureInjected() { + !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0; +} + +var NESTED_UPDATES = { + initialize: function () { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function () { + if (this.dirtyComponentsLength !== dirtyComponents.length) { + // Additional updates were enqueued by componentDidUpdate handlers or + // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run + // these new updates so that if A's componentDidUpdate calls setState on + // B, B will update before the callback A's updater provided when calling + // setState. + dirtyComponents.splice(0, this.dirtyComponentsLength); + flushBatchedUpdates(); + } else { + dirtyComponents.length = 0; + } + } +}; + +var UPDATE_QUEUEING = { + initialize: function () { + this.callbackQueue.reset(); + }, + close: function () { + this.callbackQueue.notifyAll(); + } +}; + +var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; + +function ReactUpdatesFlushTransaction() { + this.reinitializeTransaction(); + this.dirtyComponentsLength = null; + this.callbackQueue = CallbackQueue.getPooled(); + this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( + /* useCreateElement */true); +} + +_assign(ReactUpdatesFlushTransaction.prototype, Transaction, { + getTransactionWrappers: function () { + return TRANSACTION_WRAPPERS; + }, + + destructor: function () { + this.dirtyComponentsLength = null; + CallbackQueue.release(this.callbackQueue); + this.callbackQueue = null; + ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); + this.reconcileTransaction = null; + }, + + perform: function (method, scope, a) { + // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` + // with this transaction's wrappers around it. + return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); + } +}); + +PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); + +function batchedUpdates(callback, a, b, c, d, e) { + ensureInjected(); + return batchingStrategy.batchedUpdates(callback, a, b, c, d, e); +} + +/** + * Array comparator for ReactComponents by mount ordering. + * + * @param {ReactComponent} c1 first component you're comparing + * @param {ReactComponent} c2 second component you're comparing + * @return {number} Return value usable by Array.prototype.sort(). + */ +function mountOrderComparator(c1, c2) { + return c1._mountOrder - c2._mountOrder; +} + +function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0; + + // Since reconciling a component higher in the owner hierarchy usually (not + // always -- see shouldComponentUpdate()) will reconcile children, reconcile + // them before their children by sorting the array. + dirtyComponents.sort(mountOrderComparator); + + // Any updates enqueued while reconciling must be performed after this entire + // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and + // C, B could update twice in a single batch if C's render enqueues an update + // to B (since B would have already updated, we should skip it, and the only + // way we can know to do so is by checking the batch counter). + updateBatchNumber++; + + for (var i = 0; i < len; i++) { + // If a component is unmounted before pending changes apply, it will still + // be here, but we assume that it has cleared its _pendingCallbacks and + // that performUpdateIfNecessary is a noop. + var component = dirtyComponents[i]; + + // If performUpdateIfNecessary happens to enqueue any new updates, we + // shouldn't execute the callbacks until the next render happens, so + // stash the callbacks first + var callbacks = component._pendingCallbacks; + component._pendingCallbacks = null; + + var markerName; + if (ReactFeatureFlags.logTopLevelRenders) { + var namedComponent = component; + // Duck type TopLevelWrapper. This is probably always true. + if (component._currentElement.type.isReactTopLevelWrapper) { + namedComponent = component._renderedComponent; + } + markerName = 'React update: ' + namedComponent.getName(); + console.time(markerName); + } + + ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); + + if (markerName) { + console.timeEnd(markerName); + } + + if (callbacks) { + for (var j = 0; j < callbacks.length; j++) { + transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance()); + } + } + } +} + +var flushBatchedUpdates = function () { + // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents + // array and perform any updates enqueued by mount-ready handlers (i.e., + // componentDidUpdate) but we need to check here too in order to catch + // updates enqueued by setState callbacks and asap calls. + while (dirtyComponents.length || asapEnqueued) { + if (dirtyComponents.length) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction); + ReactUpdatesFlushTransaction.release(transaction); + } + + if (asapEnqueued) { + asapEnqueued = false; + var queue = asapCallbackQueue; + asapCallbackQueue = CallbackQueue.getPooled(); + queue.notifyAll(); + CallbackQueue.release(queue); + } + } +}; + +/** + * Mark a component as needing a rerender, adding an optional callback to a + * list of functions which will be executed once the rerender occurs. + */ +function enqueueUpdate(component) { + ensureInjected(); + + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (This is called by each top-level update + // function, like setState, forceUpdate, etc.; creation and + // destruction of top-level components is guarded in ReactMount.) + + if (!batchingStrategy.isBatchingUpdates) { + batchingStrategy.batchedUpdates(enqueueUpdate, component); + return; + } + + dirtyComponents.push(component); + if (component._updateBatchNumber == null) { + component._updateBatchNumber = updateBatchNumber + 1; + } +} + +/** + * Enqueue a callback to be run at the end of the current batching cycle. Throws + * if no updates are currently being performed. + */ +function asap(callback, context) { + !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; +} + +var ReactUpdatesInjection = { + injectReconcileTransaction: function (ReconcileTransaction) { + !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0; + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; + }, + + injectBatchingStrategy: function (_batchingStrategy) { + !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0; + !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0; + !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0; + batchingStrategy = _batchingStrategy; + } +}; + +var ReactUpdates = { + /** + * React references `ReactReconcileTransaction` using this property in order + * to allow dependency injection. + * + * @internal + */ + ReactReconcileTransaction: null, + + batchedUpdates: batchedUpdates, + enqueueUpdate: enqueueUpdate, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection, + asap: asap +}; + +module.exports = ReactUpdates; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + + + +/** + * 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; + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(125), + isLength = __webpack_require__(126); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example @@ -2523,7 +4862,44 @@ module.exports = isArrayLike; /***/ }), -/* 22 */ +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(212)(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(413)(); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2539,12 +4915,12 @@ module.exports = isArrayLike; -var _assign = __webpack_require__(5); +var _assign = __webpack_require__(9); -var PooledClass = __webpack_require__(30); +var PooledClass = __webpack_require__(41); -var emptyFunction = __webpack_require__(17); -var warning = __webpack_require__(2); +var emptyFunction = __webpack_require__(25); +var warning = __webpack_require__(4); var didWarnForAddedNewProperty = false; var isProxySupported = typeof Proxy === 'function'; @@ -2631,7 +5007,6 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg } _assign(SyntheticEvent.prototype, { - preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; @@ -2641,8 +5016,8 @@ _assign(SyntheticEvent.prototype, { if (event.preventDefault) { event.preventDefault(); + // eslint-disable-next-line valid-typeof } else if (typeof event.returnValue !== 'unknown') { - // eslint-disable-line valid-typeof event.returnValue = false; } this.isDefaultPrevented = emptyFunction.thatReturnsTrue; @@ -2656,8 +5031,8 @@ _assign(SyntheticEvent.prototype, { if (event.stopPropagation) { event.stopPropagation(); + // eslint-disable-next-line valid-typeof } else if (typeof event.cancelBubble !== 'unknown') { - // eslint-disable-line valid-typeof // The ChangeEventPlugin registers a "propertychange" event for // IE. This event does not support bubbling or cancelling, and // any references to cancelBubble throw "Member not found". A @@ -2706,7 +5081,6 @@ _assign(SyntheticEvent.prototype, { Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); } } - }); SyntheticEvent.Interface = EventInterface; @@ -2722,7 +5096,7 @@ if (process.env.NODE_ENV !== 'production') { return new Proxy(constructor.apply(that, args), { set: function (target, prop, value) { if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { - process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; didWarnForAddedNewProperty = true; } target[prop] = value; @@ -2791,20 +5165,20 @@ function getPooledWarningPropertyDefinition(propName, getVal) { function warn(action, result) { var warningCondition = false; - process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; + process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; } } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 23 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { -var baseMatches = __webpack_require__(248), - baseMatchesProperty = __webpack_require__(249), - identity = __webpack_require__(35), - isArray = __webpack_require__(10), - property = __webpack_require__(353); +var baseMatches = __webpack_require__(318), + baseMatchesProperty = __webpack_require__(319), + identity = __webpack_require__(48), + isArray = __webpack_require__(12), + property = __webpack_require__(406); /** * The base implementation of `_.iteratee`. @@ -2834,11 +5208,11 @@ module.exports = baseIteratee; /***/ }), -/* 24 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { -var assignValue = __webpack_require__(79), - baseAssignValue = __webpack_require__(56); +var assignValue = __webpack_require__(101), + baseAssignValue = __webpack_require__(70); /** * Copies properties of `source` to `object`. @@ -2880,7 +5254,7 @@ module.exports = copyObject; /***/ }), -/* 25 */ +/* 36 */ /***/ (function(module, exports) { /** @@ -2915,50 +5289,7 @@ module.exports = isObjectLike; /***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayLikeKeys = __webpack_require__(130), - baseKeys = __webpack_require__(136), - isArrayLike = __webpack_require__(21); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -module.exports = keys; - - -/***/ }), -/* 27 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2974,9 +5305,9 @@ module.exports = keys; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var invariant = __webpack_require__(1); +var invariant = __webpack_require__(3); function checkMask(value, bitmask) { return (value & bitmask) === bitmask; @@ -3100,7 +5431,6 @@ var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\ * @see http://jsperf.com/key-missing */ var DOMProperty = { - ID_ATTRIBUTE_NAME: 'data-reactid', ROOT_ATTRIBUTE_NAME: 'data-reactroot', @@ -3174,31 +5504,529 @@ module.exports = DOMProperty; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 28 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { -var Symbol = __webpack_require__(34), - getRawTag = __webpack_require__(285), - objectToString = __webpack_require__(313); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +// original notice: -/** - * The base implementation of `getTag` without fallbacks for buggy environments. +/*! + * The buffer module from node.js, for the browser. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @author Feross Aboukhadijeh + * @license MIT */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } +function compare(a, b) { + if (a === b) { + return 0; + } + + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) { + return -1; + } + if (y < x) { + return 1; + } + return 0; +} +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + return !!(b != null && b._isBuffer); +} + +// based on node assert, original notice: + +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +var util = __webpack_require__(619); +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; +var functionsHaveNames = (function () { + return function foo() {}.name === 'foo'; +}()); +function pToString (obj) { + return Object.prototype.toString.call(obj); +} +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + if (!arrbuf) { + return false; + } + if (arrbuf instanceof DataView) { + return true; + } + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + return false; +} +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +var regex = /\s*function\s+([^\(\s]*)\s*/; +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js +function getName(func) { + if (!util.isFunction(func)) { + return; + } + if (functionsHaveNames) { + return func.name; + } + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; +} +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + + self.operator + ' ' + + truncate(inspect(self.expected), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; + + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), + new Uint8Array(expected.buffer)) === 0; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || {actual: [], expected: []}; + + var actualIndex = memos.actual.indexOf(actual); + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } + } + + memos.actual.push(actual); + memos.expected.push(expected); + + return objEquiv(actual, expected, strict, memos); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) + return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length !== kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) + return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} + + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; +} + +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); + } + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + actual = _tryBlock(block); + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws(true, block, error, message); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); +}; + +assert.ifError = function(err) { if (err) throw err; }; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(95))) + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(45), + getRawTag = __webpack_require__(355), + objectToString = __webpack_require__(383); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); @@ -3208,11 +6036,11 @@ module.exports = baseGetTag; /***/ }), -/* 29 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsNative = __webpack_require__(245), - getValue = __webpack_require__(286); +var baseIsNative = __webpack_require__(315), + getValue = __webpack_require__(356); /** * Gets the native function at `key` of `object`. @@ -3231,7 +6059,7 @@ module.exports = getNative; /***/ }), -/* 30 */ +/* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3248,9 +6076,9 @@ module.exports = getNative; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var invariant = __webpack_require__(1); +var invariant = __webpack_require__(3); /** * Static poolers. Several custom versions for each potential number of @@ -3349,7 +6177,7 @@ module.exports = PooledClass; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 31 */ +/* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3365,15 +6193,15 @@ module.exports = PooledClass; -var _assign = __webpack_require__(5); +var _assign = __webpack_require__(9); -var ReactCurrentOwner = __webpack_require__(20); +var ReactCurrentOwner = __webpack_require__(30); -var warning = __webpack_require__(2); -var canDefineProperty = __webpack_require__(70); +var warning = __webpack_require__(4); +var canDefineProperty = __webpack_require__(88); var hasOwnProperty = Object.prototype.hasOwnProperty; -var REACT_ELEMENT_TYPE = __webpack_require__(191); +var REACT_ELEMENT_TYPE = __webpack_require__(236); var RESERVED_PROPS = { key: true, @@ -3696,647 +6524,563 @@ module.exports = ReactElement; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 32 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. + + +// Export web by default. Other platforms have custom index.[platform].js files +module.exports = __webpack_require__(605); + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_RESULT__;(function() { + (function(root, factory) { + if (true) { + return !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return factory(); + }.call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports === 'object') { + return module.exports = factory(); + } else { + return root.ifvisible = factory(); + } + })(this, function() { + var addEvent, customEvent, doc, fireEvent, hidden, idleStartedTime, idleTime, ie, ifvisible, init, initialized, status, trackIdleStatus, visibilityChange; + ifvisible = {}; + doc = document; + initialized = false; + status = "active"; + idleTime = 60000; + idleStartedTime = false; + customEvent = (function() { + var S4, addCustomEvent, cgid, fireCustomEvent, guid, listeners, removeCustomEvent; + S4 = function() { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); + }; + guid = function() { + return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); + }; + listeners = {}; + cgid = '__ceGUID'; + addCustomEvent = function(obj, event, callback) { + obj[cgid] = undefined; + if (!obj[cgid]) { + obj[cgid] = "ifvisible.object.event.identifier"; + } + if (!listeners[obj[cgid]]) { + listeners[obj[cgid]] = {}; + } + if (!listeners[obj[cgid]][event]) { + listeners[obj[cgid]][event] = []; + } + return listeners[obj[cgid]][event].push(callback); + }; + fireCustomEvent = function(obj, event, memo) { + var ev, j, len, ref, results; + if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { + ref = listeners[obj[cgid]][event]; + results = []; + for (j = 0, len = ref.length; j < len; j++) { + ev = ref[j]; + results.push(ev(memo || {})); + } + return results; + } + }; + removeCustomEvent = function(obj, event, callback) { + var cl, i, j, len, ref; + if (callback) { + if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { + ref = listeners[obj[cgid]][event]; + for (i = j = 0, len = ref.length; j < len; i = ++j) { + cl = ref[i]; + if (cl === callback) { + listeners[obj[cgid]][event].splice(i, 1); + return cl; + } + } + } + } else { + if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { + return delete listeners[obj[cgid]][event]; + } + } + }; + return { + add: addCustomEvent, + remove: removeCustomEvent, + fire: fireCustomEvent + }; + })(); + addEvent = (function() { + var setListener; + setListener = false; + return function(el, ev, fn) { + if (!setListener) { + if (el.addEventListener) { + setListener = function(el, ev, fn) { + return el.addEventListener(ev, fn, false); + }; + } else if (el.attachEvent) { + setListener = function(el, ev, fn) { + return el.attachEvent('on' + ev, fn, false); + }; + } else { + setListener = function(el, ev, fn) { + return el['on' + ev] = fn; + }; + } + } + return setListener(el, ev, fn); + }; + })(); + fireEvent = function(element, event) { + var evt; + if (doc.createEventObject) { + return element.fireEvent('on' + event, evt); + } else { + evt = doc.createEvent('HTMLEvents'); + evt.initEvent(event, true, true); + return !element.dispatchEvent(evt); + } + }; + ie = (function() { + var all, check, div, undef, v; + undef = void 0; + v = 3; + div = doc.createElement("div"); + all = div.getElementsByTagName("i"); + check = function() { + return (div.innerHTML = "", all[0]); + }; + while (check()) { + continue; + } + if (v > 4) { + return v; + } else { + return undef; + } + })(); + hidden = false; + visibilityChange = void 0; + if (typeof doc.hidden !== "undefined") { + hidden = "hidden"; + visibilityChange = "visibilitychange"; + } else if (typeof doc.mozHidden !== "undefined") { + hidden = "mozHidden"; + visibilityChange = "mozvisibilitychange"; + } else if (typeof doc.msHidden !== "undefined") { + hidden = "msHidden"; + visibilityChange = "msvisibilitychange"; + } else if (typeof doc.webkitHidden !== "undefined") { + hidden = "webkitHidden"; + visibilityChange = "webkitvisibilitychange"; + } + trackIdleStatus = function() { + var timer, wakeUp; + timer = false; + wakeUp = function() { + clearTimeout(timer); + if (status !== "active") { + ifvisible.wakeup(); + } + idleStartedTime = +(new Date()); + return timer = setTimeout(function() { + if (status === "active") { + return ifvisible.idle(); + } + }, idleTime); + }; + wakeUp(); + addEvent(doc, "mousemove", wakeUp); + addEvent(doc, "keyup", wakeUp); + addEvent(doc, "touchstart", wakeUp); + addEvent(window, "scroll", wakeUp); + ifvisible.focus(wakeUp); + return ifvisible.wakeup(wakeUp); + }; + init = function() { + var blur; + if (initialized) { + return true; + } + if (hidden === false) { + blur = "blur"; + if (ie < 9) { + blur = "focusout"; + } + addEvent(window, blur, function() { + return ifvisible.blur(); + }); + addEvent(window, "focus", function() { + return ifvisible.focus(); + }); + } else { + addEvent(doc, visibilityChange, function() { + if (doc[hidden]) { + return ifvisible.blur(); + } else { + return ifvisible.focus(); + } + }, false); + } + initialized = true; + return trackIdleStatus(); + }; + ifvisible = { + setIdleDuration: function(seconds) { + return idleTime = seconds * 1000; + }, + getIdleDuration: function() { + return idleTime; + }, + getIdleInfo: function() { + var now, res; + now = +(new Date()); + res = {}; + if (status === "idle") { + res.isIdle = true; + res.idleFor = now - idleStartedTime; + res.timeLeft = 0; + res.timeLeftPer = 100; + } else { + res.isIdle = false; + res.idleFor = now - idleStartedTime; + res.timeLeft = (idleStartedTime + idleTime) - now; + res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2); + } + return res; + }, + focus: function(callback) { + if (typeof callback === "function") { + this.on("focus", callback); + } else { + status = "active"; + customEvent.fire(this, "focus"); + customEvent.fire(this, "wakeup"); + customEvent.fire(this, "statusChanged", { + status: status + }); + } + return this; + }, + blur: function(callback) { + if (typeof callback === "function") { + this.on("blur", callback); + } else { + status = "hidden"; + customEvent.fire(this, "blur"); + customEvent.fire(this, "idle"); + customEvent.fire(this, "statusChanged", { + status: status + }); + } + return this; + }, + idle: function(callback) { + if (typeof callback === "function") { + this.on("idle", callback); + } else { + status = "idle"; + customEvent.fire(this, "idle"); + customEvent.fire(this, "statusChanged", { + status: status + }); + } + return this; + }, + wakeup: function(callback) { + if (typeof callback === "function") { + this.on("wakeup", callback); + } else { + status = "active"; + customEvent.fire(this, "wakeup"); + customEvent.fire(this, "statusChanged", { + status: status + }); + } + return this; + }, + on: function(name, callback) { + init(); + customEvent.add(this, name, callback); + return this; + }, + off: function(name, callback) { + init(); + customEvent.remove(this, name, callback); + return this; + }, + onEvery: function(seconds, callback) { + var paused, t; + init(); + paused = false; + if (callback) { + t = setInterval(function() { + if (status === "active" && paused === false) { + return callback(); + } + }, seconds * 1000); + } + return { + stop: function() { + return clearInterval(t); + }, + pause: function() { + return paused = true; + }, + resume: function() { + return paused = false; + }, + code: t, + callback: callback + }; + }, + now: function(check) { + init(); + return status === (check || "active"); + } + }; + return ifvisible; + }); + +}).call(this); + +//# sourceMappingURL=ifvisible.js.map + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(27); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseClone = __webpack_require__(102); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. * - * 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. + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. * - * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); +} + +module.exports = clone; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(178), + baseFilter = __webpack_require__(307), + baseIteratee = __webpack_require__(34), + isArray = __webpack_require__(12); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} +module.exports = filter; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { /** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true */ +function identity(value) { + return value; +} -function reactProdInvariant(code) { - var argCount = arguments.length - 1; +module.exports = identity; - var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; - for (var argIdx = 0; argIdx < argCount; argIdx++) { - message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); - } +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { - message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; +var baseGetTag = __webpack_require__(39), + isObjectLike = __webpack_require__(36); - var error = new Error(message); - error.name = 'Invariant Violation'; - error.framesToPop = 1; // we don't care about reactProdInvariant's own frame +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; - throw error; +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); } -module.exports = reactProdInvariant; +module.exports = isSymbol; + /***/ }), -/* 33 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(setImmediate) {/** - * SyncTasks.ts - * Author: David de Regt - * Copyright: Microsoft 2015 +/** + * Copyright 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. * - * A very simple promise library that resolves all promises synchronously instead of - * kicking them back to the main ticking thread. This affirmatively rejects the A+ - * standard for promises, and is used for a combination of performance (wrapping - * things back to the main thread is really slow) and because indexeddb loses - * context for its calls if you send them around the event loop and transactions - * automatically close. - */ - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.config = { - // If we catch exceptions in success/fail blocks, it silently falls back to the fail case of the outer promise. - // If this is global variable is true, it will also spit out a console.error with the exception for debugging. - exceptionsToConsole: true, - // Whether or not to actually attempt to catch exceptions with try/catch blocks inside the resolution cases. - // Disable this for debugging when you'd rather the debugger caught the exception synchronously rather than - // digging through a stack trace. - catchExceptions: true, - // Use this option in order to debug double resolution asserts locally. - // Enabling this option in the release would have a negative impact on the application performance. - traceEnabled: false, - exceptionHandler: null, - // If an ErrorFunc is not added to the task (then, catch, always) before the task rejects or synchonously - // after that, then this function is called with the error. Default throws the error. - unhandledErrorHandler: (function (err) { throw err; }) -}; -function fromThenable(thenable) { - var deferred = Defer(); - // NOTE: The {} around the error handling is critical to ensure that - // we do not trigger "Possible unhandled rejection" warnings. By adding - // the braces, the error handler rejects the outer promise, but returns - // void. If we remove the braces, it would *also* return something which - // would be unhandled - thenable.then(function (value) { deferred.resolve(value); return undefined; }, function (err) { deferred.reject(err); }); - return deferred.promise(); -} -exports.fromThenable = fromThenable; -function isThenable(object) { - return object !== null && object !== void 0 && typeof object.then === 'function'; -} -function isCancelable(object) { - return object !== null && object !== void 0 && typeof object.cancel === 'function'; -} -// Runs trier(). If config.catchExceptions is set then any exception is caught and handed to catcher. -function run(trier, catcher) { - if (exports.config.catchExceptions) { - // Any try/catch/finally block in a function makes the entire function ineligible for optimization is most JS engines. - // Make sure this stays in a small/quick function, or break out into its own function. - try { - return trier(); - } - catch (e) { - return catcher(e); - } - } - else { - return trier(); - } -} -var asyncCallbacks = []; -// Ideally, we use setImmediate, but that's only supported on some environments. -// Suggestion: Use the "setimmediate" NPM package to polyfill where it's not available. -var useSetImmediate = typeof setImmediate !== 'undefined'; -/** - * This function will defer callback of the specified callback lambda until the next JS tick, simulating standard A+ promise behavior */ -function asyncCallback(callback) { - asyncCallbacks.push(callback); - if (asyncCallbacks.length === 1) { - // Start a callback for the next tick - if (useSetImmediate) { - setImmediate(resolveAsyncCallbacks); - } - else { - setTimeout(resolveAsyncCallbacks, 0); - } - } -} -exports.asyncCallback = asyncCallback; -function resolveAsyncCallbacks() { - var savedCallbacks = asyncCallbacks; - asyncCallbacks = []; - for (var i = 0; i < savedCallbacks.length; i++) { - savedCallbacks[i](); - } -} -function Defer() { - return new Internal.SyncTask(); -} -exports.Defer = Defer; -function Resolved(val) { - return new Internal.SyncTask().resolve(val).promise(); -} -exports.Resolved = Resolved; -function Rejected(val) { - return new Internal.SyncTask().reject(val).promise(); -} -exports.Rejected = Rejected; -var Internal; -(function (Internal) { - var SyncTask = (function () { - function SyncTask() { - this._completedSuccess = false; - this._completedFail = false; - this._traceEnabled = false; - this._cancelCallbacks = []; - this._wasCanceled = false; - this._resolving = false; - this._storedCallbackSets = []; - // 'Handled' just means there was a callback set added. - // Note: If that callback does not handle the error then that callback's task will be 'unhandled' instead of this one. - this._mustHandleError = true; - } - SyncTask.prototype._addCallbackSet = function (set, callbackWillChain) { - var task = new SyncTask(); - task.onCancel(this.cancel.bind(this)); - set.task = task; - this._storedCallbackSets.push(set); - if (callbackWillChain) { - // The callback inherits responsibility for "handling" errors. - this._mustHandleError = false; - } - else { - // The callback can never "handle" errors since nothing can chain to it. - task._mustHandleError = false; - } - // The _resolve* functions handle callbacks being added while they are running. - if (!this._resolving) { - if (this._completedSuccess) { - this._resolveSuccesses(); - } - else if (this._completedFail) { - this._resolveFailures(); - } - } - return task.promise(); - }; - SyncTask.prototype.onCancel = function (callback) { - // Only register cancel callback handler on promise that hasn't been completed - if (!this._completedSuccess && !this._completedFail) { - if (this._wasCanceled) { - callback(this._cancelContext); - } - else { - this._cancelCallbacks.push(callback); - } - } - return this; - }; - SyncTask.prototype.then = function (successFunc, errorFunc) { - return this._addCallbackSet({ - successFunc: successFunc, - failFunc: errorFunc - }, true); - }; - SyncTask.prototype.thenAsync = function (successFunc, errorFunc) { - return this._addCallbackSet({ - successFunc: successFunc, - failFunc: errorFunc, - asyncCallback: true - }, true); - }; - SyncTask.prototype.catch = function (errorFunc) { - return this._addCallbackSet({ - failFunc: errorFunc - }, true); - }; - SyncTask.prototype.always = function (func) { - return this._addCallbackSet({ - successFunc: func, - failFunc: func - }, true); - }; - SyncTask.prototype.setTracingEnabled = function (enabled) { - this._traceEnabled = enabled; - return this; - }; - // Finally should let you inspect the value of the promise as it passes through without affecting the then chaining - // i.e. a failed promise with a finally after it should then chain to the fail case of the next then - SyncTask.prototype.finally = function (func) { - this._addCallbackSet({ - successFunc: func, - failFunc: func - }, false); - return this; - }; - SyncTask.prototype.done = function (successFunc) { - this._addCallbackSet({ - successFunc: successFunc - }, false); - return this; - }; - SyncTask.prototype.fail = function (errorFunc) { - this._addCallbackSet({ - failFunc: errorFunc - }, false); - return this; - }; - SyncTask.prototype.resolve = function (obj) { - this._checkState(true); - this._completedSuccess = true; - this._storedResolution = obj; - this._resolveSuccesses(); - return this; - }; - SyncTask.prototype.reject = function (obj) { - this._checkState(false); - this._completedFail = true; - this._storedErrResolution = obj; - this._resolveFailures(); - SyncTask._enforceErrorHandled(this); - return this; - }; - SyncTask.prototype._checkState = function (resolve) { - if (this._completedSuccess || this._completedFail) { - if (this._completeStack) { - console.error(this._completeStack.message, this._completeStack.stack); - } - var message = 'Failed to ' + (resolve ? 'resolve' : 'reject') + - ': the task is already ' + (this._completedSuccess ? 'resolved' : 'rejected'); - throw new Error(message); - } - if (exports.config.traceEnabled || this._traceEnabled) { - this._completeStack = new Error( true ? 'resolve' : 'reject'); - } - }; - // Make sure any rejected task has its failured handled. - SyncTask._enforceErrorHandled = function (task) { - if (!task._mustHandleError) { - return; - } - SyncTask._rejectedTasks.push(task); - // Wait for some async time in the future to check these tasks. - if (!SyncTask._enforceErrorHandledTimer) { - SyncTask._enforceErrorHandledTimer = setTimeout(function () { - SyncTask._enforceErrorHandledTimer = null; - var rejectedTasks = SyncTask._rejectedTasks; - SyncTask._rejectedTasks = []; - rejectedTasks.forEach(function (rejectedTask, i) { - if (rejectedTask._mustHandleError) { - // Unhandled! - exports.config.unhandledErrorHandler(rejectedTask._storedErrResolution); - } - }); - }, 0); - } - }; - SyncTask.prototype.cancel = function (context) { - var _this = this; - if (this._wasCanceled) { - throw new Error('Already Canceled'); - } - this._wasCanceled = true; - this._cancelContext = context; - if (this._cancelCallbacks.length > 0) { - this._cancelCallbacks.forEach(function (callback) { - if (!_this._completedSuccess && !_this._completedFail) { - callback(_this._cancelContext); - } - }); - } - }; - SyncTask.prototype.promise = function () { - return this; - }; - SyncTask.prototype._resolveSuccesses = function () { - var _this = this; - this._resolving = true; - // New callbacks can be added as the current callbacks run: use a loop to get through all of them. - while (this._storedCallbackSets.length) { - // Only iterate over the current list of callbacks. - var callbacks = this._storedCallbackSets; - this._storedCallbackSets = []; - callbacks.forEach(function (callback) { - if (callback.asyncCallback) { - asyncCallback(_this._resolveCallback.bind(_this, callback)); - } - else { - _this._resolveCallback(callback); - } - }); - } - this._resolving = false; - }; - SyncTask.prototype._resolveCallback = function (callback) { - var _this = this; - if (callback.successFunc) { - run(function () { - var ret = callback.successFunc(_this._storedResolution); - if (isCancelable(ret)) { - _this._cancelCallbacks.push(ret.cancel.bind(ret)); - if (_this._wasCanceled) { - ret.cancel(_this._cancelContext); - } - } - if (isThenable(ret)) { - // The success block of a then returned a new promise, so - ret.then(function (r) { callback.task.resolve(r); }, function (e) { callback.task.reject(e); }); - } - else { - callback.task.resolve(ret); - } - }, function (e) { - _this._handleException(e, 'SyncTask caught exception in success block: ' + e.toString()); - callback.task.reject(e); - }); - } - else { - callback.task.resolve(this._storedResolution); - } - }; - SyncTask.prototype._resolveFailures = function () { - var _this = this; - this._resolving = true; - // New callbacks can be added as the current callbacks run: use a loop to get through all of them. - while (this._storedCallbackSets.length) { - // Only iterate over the current list of callbacks. - var callbacks = this._storedCallbackSets; - this._storedCallbackSets = []; - callbacks.forEach(function (callback) { - if (callback.failFunc) { - run(function () { - var ret = callback.failFunc(_this._storedErrResolution); - if (isCancelable(ret)) { - _this._cancelCallbacks.push(ret.cancel.bind(ret)); - if (_this._wasCanceled) { - ret.cancel(_this._cancelContext); - } - } - if (isThenable(ret)) { - ret.then(function (r) { callback.task.resolve(r); }, function (e) { callback.task.reject(e); }); - } - else { - // The failure has been handled: ret is the resolved value. - callback.task.resolve(ret); - } - }, function (e) { - _this._handleException(e, 'SyncTask caught exception in failure block: ' + e.toString()); - callback.task.reject(e); - }); - } - else { - callback.task.reject(_this._storedErrResolution); - } - }); - } - this._resolving = false; - }; - SyncTask.prototype._handleException = function (e, message) { - if (exports.config.exceptionsToConsole) { - console.error(message); - } - if (exports.config.exceptionHandler) { - exports.config.exceptionHandler(e); - } - }; - return SyncTask; - }()); - SyncTask._rejectedTasks = []; - SyncTask._enforceErrorHandledTimer = null; - Internal.SyncTask = SyncTask; -})(Internal || (Internal = {})); -function all(items) { - if (items.length === 0) { - return Resolved([]); - } - var outTask = Defer(); - var countRemaining = items.length; - var foundError = null; - var results = Array(items.length); - outTask.onCancel(function (val) { - items.forEach(function (item) { - if (isCancelable(item)) { - item.cancel(val); - } - }); - }); - var checkFinish = function () { - if (--countRemaining === 0) { - if (foundError !== null) { - outTask.reject(foundError); - } - else { - outTask.resolve(results); - } - } - }; - items.forEach(function (item, index) { - if (isThenable(item)) { - var task = item; - task.then(function (res) { - results[index] = res; - checkFinish(); - }, function (err) { - if (foundError === null) { - foundError = (err !== null) ? err : true; - } - checkFinish(); - }); - } - else { - // Not a task, so resolve directly with the item - results[index] = item; - checkFinish(); - } - }); - return outTask.promise(); -} -exports.all = all; -function race(items) { - var outTask = Defer(); - var hasSettled = false; - outTask.onCancel(function (val) { - items.forEach(function (item) { - if (isCancelable(item)) { - item.cancel(val); - } - }); - }); - items.forEach(function (item) { - if (isThenable(item)) { - var task = item; - task.then(function (res) { - if (!hasSettled) { - hasSettled = true; - outTask.resolve(res); - } - }, function (err) { - if (!hasSettled) { - hasSettled = true; - outTask.reject(err); - } - }); - } - else { - // Not a task, so resolve directly with the item - if (!hasSettled) { - hasSettled = true; - outTask.resolve(item); - } - } - }); - return outTask.promise(); -} -exports.race = race; -function raceTimer(promise, timeMs) { - var timerDef = Defer(); - var token = setTimeout(function () { - timerDef.resolve({ timedOut: true }); - }, timeMs); - var adaptedPromise = promise.then(function (resp) { - clearTimeout(token); - return { timedOut: false, result: resp }; - }); - return race([adaptedPromise, timerDef.promise()]); -} -exports.raceTimer = raceTimer; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(204).setImmediate)) - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { -var root = __webpack_require__(18); -/** Built-in value references. */ -var Symbol = root.Symbol; -module.exports = Symbol; +var DOMNamespaces = __webpack_require__(142); +var setInnerHTML = __webpack_require__(87); +var createMicrosoftUnsafeLocalFunction = __webpack_require__(149); +var setTextContent = __webpack_require__(233); -/***/ }), -/* 35 */ -/***/ (function(module, exports) { +var ELEMENT_NODE_TYPE = 1; +var DOCUMENT_FRAGMENT_NODE_TYPE = 11; /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example + * In IE (8-11) and Edge, appending nodes with no children is dramatically + * faster than appending a full subtree, so we essentially queue up the + * .appendChild calls here and apply them so each node is added to its parent + * before any children are added. * - * var object = { 'a': 1 }; + * In other browsers, doing so is slower or neutral compared to the other order + * (in Firefox, twice as slow) so we only do this inversion in IE. * - * console.log(_.identity(object) === object); - * // => true + * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode. */ -function identity(value) { - return value; -} - -module.exports = identity; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { +var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent); -var baseGetTag = __webpack_require__(28), - isObjectLike = __webpack_require__(25); - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} - -module.exports = isSymbol; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright 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. - * - */ - - - -var DOMNamespaces = __webpack_require__(98); -var setInnerHTML = __webpack_require__(69); - -var createMicrosoftUnsafeLocalFunction = __webpack_require__(105); -var setTextContent = __webpack_require__(189); - -var ELEMENT_NODE_TYPE = 1; -var DOCUMENT_FRAGMENT_NODE_TYPE = 11; - -/** - * In IE (8-11) and Edge, appending nodes with no children is dramatically - * faster than appending a full subtree, so we essentially queue up the - * .appendChild calls here and apply them so each node is added to its parent - * before any children are added. - * - * In other browsers, doing so is slower or neutral compared to the other order - * (in Firefox, twice as slow) so we only do this inversion in IE. - * - * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode. - */ -var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent); - -function insertTreeChildren(tree) { - if (!enableLazy) { - return; - } - var node = tree.node; - var children = tree.children; - if (children.length) { - for (var i = 0; i < children.length; i++) { - insertTreeBefore(node, children[i], null); - } - } else if (tree.html != null) { - setInnerHTML(node, tree.html); - } else if (tree.text != null) { - setTextContent(node, tree.text); - } -} +function insertTreeChildren(tree) { + if (!enableLazy) { + return; + } + var node = tree.node; + var children = tree.children; + if (children.length) { + for (var i = 0; i < children.length; i++) { + insertTreeBefore(node, children[i], null); + } + } else if (tree.html != null) { + setInnerHTML(node, tree.html); + } else if (tree.text != null) { + setTextContent(node, tree.text); + } +} var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) { // DocumentFragments aren't actually part of the DOM after insertion so @@ -4406,7 +7150,7 @@ DOMLazyTree.queueText = queueText; module.exports = DOMLazyTree; /***/ }), -/* 38 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4422,10 +7166,10 @@ module.exports = DOMLazyTree; -var ReactRef = __webpack_require__(409); -var ReactInstrumentation = __webpack_require__(16); +var ReactRef = __webpack_require__(456); +var ReactInstrumentation = __webpack_require__(26); -var warning = __webpack_require__(2); +var warning = __webpack_require__(4); /** * Helper to call ReactRef.attachRefs with this composite component, split out @@ -4436,7 +7180,6 @@ function attachRefs() { } var ReactReconciler = { - /** * Initializes the component, renders markup, and registers event listeners. * @@ -4448,8 +7191,8 @@ var ReactReconciler = { * @final * @internal */ - mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots - ) { + mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots + { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); @@ -4573,14 +7316,13 @@ var ReactReconciler = { } } } - }; module.exports = ReactReconciler; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 39 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4596,27 +7338,26 @@ module.exports = ReactReconciler; -var _assign = __webpack_require__(5); +var _assign = __webpack_require__(9); -var ReactChildren = __webpack_require__(439); -var ReactComponent = __webpack_require__(112); -var ReactPureComponent = __webpack_require__(444); -var ReactClass = __webpack_require__(440); -var ReactDOMFactories = __webpack_require__(441); -var ReactElement = __webpack_require__(31); -var ReactPropTypes = __webpack_require__(442); -var ReactVersion = __webpack_require__(445); +var ReactBaseClasses = __webpack_require__(235); +var ReactChildren = __webpack_require__(486); +var ReactDOMFactories = __webpack_require__(487); +var ReactElement = __webpack_require__(42); +var ReactPropTypes = __webpack_require__(489); +var ReactVersion = __webpack_require__(491); -var onlyChild = __webpack_require__(448); -var warning = __webpack_require__(2); +var createReactClass = __webpack_require__(493); +var onlyChild = __webpack_require__(495); var createElement = ReactElement.createElement; var createFactory = ReactElement.createFactory; var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { - var canDefineProperty = __webpack_require__(70); - var ReactElementValidator = __webpack_require__(192); + var lowPriorityWarning = __webpack_require__(156); + var canDefineProperty = __webpack_require__(88); + var ReactElementValidator = __webpack_require__(237); var didWarnPropTypesDeprecated = false; createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; @@ -4624,18 +7365,27 @@ if (process.env.NODE_ENV !== 'production') { } var __spread = _assign; +var createMixin = function (mixin) { + return mixin; +}; if (process.env.NODE_ENV !== 'production') { - var warned = false; + var warnedForSpread = false; + var warnedForCreateMixin = false; __spread = function () { - process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0; - warned = true; + lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.'); + warnedForSpread = true; return _assign.apply(null, arguments); }; + + createMixin = function (mixin) { + lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.'); + warnedForCreateMixin = true; + return mixin; + }; } var React = { - // Modern Children: { @@ -4646,8 +7396,8 @@ var React = { only: onlyChild }, - Component: ReactComponent, - PureComponent: ReactPureComponent, + Component: ReactBaseClasses.Component, + PureComponent: ReactBaseClasses.PureComponent, createElement: createElement, cloneElement: cloneElement, @@ -4656,12 +7406,9 @@ var React = { // Classic PropTypes: ReactPropTypes, - createClass: ReactClass.createClass, + createClass: createReactClass, createFactory: createFactory, - createMixin: function (mixin) { - // Currently a noop. Will be used to validate and trace mixins. - return mixin; - }, + createMixin: createMixin, // This looks DOM specific but these are actually isomorphic helpers // since they are just generating DOM strings. @@ -4673,28 +7420,51 @@ var React = { __spread: __spread }; -// TODO: Fix tests so that this deprecation warning doesn't cause failures. if (process.env.NODE_ENV !== 'production') { + var warnedForCreateClass = false; if (canDefineProperty) { Object.defineProperty(React, 'PropTypes', { get: function () { - process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0; + lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs'); didWarnPropTypesDeprecated = true; return ReactPropTypes; } }); + + Object.defineProperty(React, 'createClass', { + get: function () { + lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class'); + warnedForCreateClass = true; + return createReactClass; + } + }); } + + // React.DOM factories are deprecated. Wrap these methods so that + // invocations of the React.DOM namespace and alert users to switch + // to the `react-dom-factories` package. + React.DOM = {}; + var warnedForFactories = false; + Object.keys(ReactDOMFactories).forEach(function (factory) { + React.DOM[factory] = function () { + if (!warnedForFactories) { + lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory); + warnedForFactories = true; + } + return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments); + }; + }); } module.exports = React; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 40 */ +/* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** +/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * @@ -4702,21 +7472,39 @@ module.exports = React; * 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. * + * */ +/** + * WARNING: DO NOT manually require this module. + * This is a replacement for `invariant(...)` used by the error code system + * and will _only_ be required by the corresponding babel pass. + * It always throws. + */ -var emptyObject = {}; +function reactProdInvariant(code) { + var argCount = arguments.length - 1; -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); + var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; + + for (var argIdx = 0; argIdx < argCount; argIdx++) { + message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); + } + + message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; + + var error = new Error(message); + error.name = 'Invariant Violation'; + error.framesToPop = 1; // we don't care about reactProdInvariant's own frame + + throw error; } -module.exports = emptyObject; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +module.exports = reactProdInvariant; /***/ }), -/* 41 */ +/* 54 */ /***/ (function(module, exports) { /** @@ -4743,12 +7531,12 @@ module.exports = arrayMap; /***/ }), -/* 42 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { -var identity = __webpack_require__(35), - overRest = __webpack_require__(155), - setToString = __webpack_require__(156); +var identity = __webpack_require__(48), + overRest = __webpack_require__(204), + setToString = __webpack_require__(205); /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. @@ -4766,7 +7554,7 @@ module.exports = baseRest; /***/ }), -/* 43 */ +/* 56 */ /***/ (function(module, exports) { /** Used for built-in method references. */ @@ -4790,10 +7578,10 @@ module.exports = isPrototype; /***/ }), -/* 44 */ +/* 57 */ /***/ (function(module, exports, __webpack_require__) { -var isSymbol = __webpack_require__(36); +var isSymbol = __webpack_require__(49); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; @@ -4817,7 +7605,7 @@ module.exports = toKey; /***/ }), -/* 45 */ +/* 58 */ /***/ (function(module, exports) { /** @@ -4860,11 +7648,11 @@ module.exports = eq; /***/ }), -/* 46 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsArguments = __webpack_require__(241), - isObjectLike = __webpack_require__(25); +var baseIsArguments = __webpack_require__(311), + isObjectLike = __webpack_require__(36); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -4902,11 +7690,11 @@ module.exports = isArguments; /***/ }), -/* 47 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(18), - stubFalse = __webpack_require__(358); +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(27), + stubFalse = __webpack_require__(408); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; @@ -4944,15 +7732,15 @@ var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(118)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(170)(module))) /***/ }), -/* 48 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { -var arrayLikeKeys = __webpack_require__(130), - baseKeysIn = __webpack_require__(247), - isArrayLike = __webpack_require__(21); +var arrayLikeKeys = __webpack_require__(179), + baseKeysIn = __webpack_require__(317), + isArrayLike = __webpack_require__(31); /** * Creates an array of the own and inherited enumerable property names of `object`. @@ -4985,7 +7773,7 @@ module.exports = keysIn; /***/ }), -/* 49 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5001,15 +7789,15 @@ module.exports = keysIn; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var EventPluginRegistry = __webpack_require__(64); -var EventPluginUtils = __webpack_require__(99); -var ReactErrorUtils = __webpack_require__(103); +var EventPluginRegistry = __webpack_require__(82); +var EventPluginUtils = __webpack_require__(143); +var ReactErrorUtils = __webpack_require__(147); -var accumulateInto = __webpack_require__(183); -var forEachAccumulated = __webpack_require__(184); -var invariant = __webpack_require__(1); +var accumulateInto = __webpack_require__(226); +var forEachAccumulated = __webpack_require__(227); +var invariant = __webpack_require__(3); /** * Internal store for event listeners @@ -5096,12 +7884,10 @@ function shouldPreventMouseEvent(name, type, props) { * @public */ var EventPluginHub = { - /** * Methods for injecting dependencies. */ injection: { - /** * @param {array} InjectedEventPluginOrder * @public @@ -5112,7 +7898,6 @@ var EventPluginHub = { * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName - }, /** @@ -5262,14 +8047,13 @@ var EventPluginHub = { __getListenerBank: function () { return listenerBank; } - }; module.exports = EventPluginHub; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 50 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5285,12 +8069,12 @@ module.exports = EventPluginHub; -var EventPluginHub = __webpack_require__(49); -var EventPluginUtils = __webpack_require__(99); +var EventPluginHub = __webpack_require__(62); +var EventPluginUtils = __webpack_require__(143); -var accumulateInto = __webpack_require__(183); -var forEachAccumulated = __webpack_require__(184); -var warning = __webpack_require__(2); +var accumulateInto = __webpack_require__(226); +var forEachAccumulated = __webpack_require__(227); +var warning = __webpack_require__(4); var getListener = EventPluginHub.getListener; @@ -5409,7 +8193,7 @@ module.exports = EventPropagators; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 51 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5435,7 +8219,6 @@ module.exports = EventPropagators; // TODO: Replace this with ES6: var ReactInstanceMap = new Map(); var ReactInstanceMap = { - /** * This API should be called `delete` but we'd have to make sure to always * transform these to strings for IE support. When this transform is fully @@ -5456,13 +8239,12 @@ var ReactInstanceMap = { set: function (key, value) { key._reactInternalInstance = value; } - }; module.exports = ReactInstanceMap; /***/ }), -/* 52 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5478,9 +8260,9 @@ module.exports = ReactInstanceMap; -var SyntheticEvent = __webpack_require__(22); +var SyntheticEvent = __webpack_require__(33); -var getEventTarget = __webpack_require__(108); +var getEventTarget = __webpack_require__(152); /** * @interface UIEvent @@ -5526,14 +8308,40 @@ SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; /***/ }), -/* 53 */ +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var emptyObject = {}; + +if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 67 */ /***/ (function(module, exports, __webpack_require__) { -var listCacheClear = __webpack_require__(299), - listCacheDelete = __webpack_require__(300), - listCacheGet = __webpack_require__(301), - listCacheHas = __webpack_require__(302), - listCacheSet = __webpack_require__(303); +var listCacheClear = __webpack_require__(369), + listCacheDelete = __webpack_require__(370), + listCacheGet = __webpack_require__(371), + listCacheHas = __webpack_require__(372), + listCacheSet = __webpack_require__(373); /** * Creates an list cache object. @@ -5564,15 +8372,15 @@ module.exports = ListCache; /***/ }), -/* 54 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { -var ListCache = __webpack_require__(53), - stackClear = __webpack_require__(318), - stackDelete = __webpack_require__(319), - stackGet = __webpack_require__(320), - stackHas = __webpack_require__(321), - stackSet = __webpack_require__(322); +var ListCache = __webpack_require__(67), + stackClear = __webpack_require__(388), + stackDelete = __webpack_require__(389), + stackGet = __webpack_require__(390), + stackHas = __webpack_require__(391), + stackSet = __webpack_require__(392); /** * Creates a stack cache object to store key-value pairs. @@ -5597,10 +8405,10 @@ module.exports = Stack; /***/ }), -/* 55 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { -var eq = __webpack_require__(45); +var eq = __webpack_require__(58); /** * Gets the index at which the `key` is found in `array` of key-value pairs. @@ -5624,10 +8432,10 @@ module.exports = assocIndexOf; /***/ }), -/* 56 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { -var defineProperty = __webpack_require__(143); +var defineProperty = __webpack_require__(192); /** * The base implementation of `assignValue` and `assignMergeValue` without @@ -5655,13 +8463,13 @@ module.exports = baseAssignValue; /***/ }), -/* 57 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { -var isArray = __webpack_require__(10), - isKey = __webpack_require__(93), - stringToPath = __webpack_require__(324), - toString = __webpack_require__(63); +var isArray = __webpack_require__(12), + isKey = __webpack_require__(115), + stringToPath = __webpack_require__(394), + toString = __webpack_require__(81); /** * Casts `value` to a path array if it's not one. @@ -5682,10 +8490,10 @@ module.exports = castPath; /***/ }), -/* 58 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { -var isKeyable = __webpack_require__(297); +var isKeyable = __webpack_require__(367); /** * Gets the data for `map`. @@ -5706,7 +8514,7 @@ module.exports = getMapData; /***/ }), -/* 59 */ +/* 73 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ @@ -5734,10 +8542,10 @@ module.exports = isIndex; /***/ }), -/* 60 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { -var getNative = __webpack_require__(29); +var getNative = __webpack_require__(40); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); @@ -5746,7 +8554,7 @@ module.exports = nativeCreate; /***/ }), -/* 61 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -5770,12 +8578,86 @@ module.exports = setToArray; /***/ }), -/* 62 */ +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(396); + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(105); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGet = __webpack_require__(106); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), +/* 79 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsTypedArray = __webpack_require__(246), - baseUnary = __webpack_require__(86), - nodeUtil = __webpack_require__(312); +var baseIsTypedArray = __webpack_require__(316), + baseUnary = __webpack_require__(108), + nodeUtil = __webpack_require__(382); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; @@ -5803,10 +8685,89 @@ module.exports = isTypedArray; /***/ }), -/* 63 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { -var baseToString = __webpack_require__(138); +var MapCache = __webpack_require__(98); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToString = __webpack_require__(187); /** * Converts `value` to a string. An empty string is returned for `null` @@ -5837,7 +8798,7 @@ module.exports = toString; /***/ }), -/* 64 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5854,9 +8815,9 @@ module.exports = toString; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var invariant = __webpack_require__(1); +var invariant = __webpack_require__(3); /** * Injectable ordering of event plugins. @@ -5951,7 +8912,6 @@ function publishRegistrationName(registrationName, pluginModule, eventName) { * @see {EventPluginHub} */ var EventPluginRegistry = { - /** * Ordered list of injected plugins. */ @@ -6091,14 +9051,13 @@ var EventPluginRegistry = { } } } - }; module.exports = EventPluginRegistry; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 65 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6114,14 +9073,14 @@ module.exports = EventPluginRegistry; -var _assign = __webpack_require__(5); +var _assign = __webpack_require__(9); -var EventPluginRegistry = __webpack_require__(64); -var ReactEventEmitterMixin = __webpack_require__(398); -var ViewportMetrics = __webpack_require__(182); +var EventPluginRegistry = __webpack_require__(82); +var ReactEventEmitterMixin = __webpack_require__(446); +var ViewportMetrics = __webpack_require__(225); -var getVendorPrefixedEventName = __webpack_require__(434); -var isEventSupported = __webpack_require__(109); +var getVendorPrefixedEventName = __webpack_require__(481); +var isEventSupported = __webpack_require__(153); /** * Summary of `ReactBrowserEventEmitter` event handling: @@ -6279,7 +9238,6 @@ function getListeningForDocument(mountAt) { * @internal */ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { - /** * Injectable event backend */ @@ -6353,14 +9311,12 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); } } else if (dependency === 'topScroll') { - if (isEventSupported('scroll', true)) { ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); } else { ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); } } else if (dependency === 'topFocus' || dependency === 'topBlur') { - if (isEventSupported('focus', true)) { ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); @@ -6425,13 +9381,12 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { isMonitoringScrollValue = true; } } - }); module.exports = ReactBrowserEventEmitter; /***/ }), -/* 66 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6447,10 +9402,10 @@ module.exports = ReactBrowserEventEmitter; -var SyntheticUIEvent = __webpack_require__(52); -var ViewportMetrics = __webpack_require__(182); +var SyntheticUIEvent = __webpack_require__(65); +var ViewportMetrics = __webpack_require__(225); -var getEventModifierState = __webpack_require__(107); +var getEventModifierState = __webpack_require__(151); /** * @interface MouseEvent @@ -6508,7 +9463,7 @@ SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; /***/ }), -/* 67 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6525,9 +9480,9 @@ module.exports = SyntheticMouseEvent; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var invariant = __webpack_require__(1); +var invariant = __webpack_require__(3); var OBSERVED_ERROR = {}; @@ -6622,6 +9577,8 @@ var TransactionImpl = { return !!this._isInTransaction; }, + /* eslint-disable space-before-function-paren */ + /** * Executes the function within a safety window. Use this for the top level * methods that result in large amounts of computation/mutations that would @@ -6640,6 +9597,7 @@ var TransactionImpl = { * @return {*} Return value from `method`. */ perform: function (method, scope, a, b, c, d, e, f) { + /* eslint-enable space-before-function-paren */ !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; var errorThrown; var ret; @@ -6739,7 +9697,7 @@ module.exports = TransactionImpl; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 68 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6847,7 +9805,6 @@ function escapeHtml(string) { } // end code copied and modified from escape-html - /** * Escapes text to prevent scripting attacks. * @@ -6867,7 +9824,7 @@ function escapeTextContentForBrowser(text) { module.exports = escapeTextContentForBrowser; /***/ }), -/* 69 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6883,13 +9840,13 @@ module.exports = escapeTextContentForBrowser; -var ExecutionEnvironment = __webpack_require__(8); -var DOMNamespaces = __webpack_require__(98); +var ExecutionEnvironment = __webpack_require__(13); +var DOMNamespaces = __webpack_require__(142); var WHITESPACE_TEST = /^[ \r\n\t\f]/; var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; -var createMicrosoftUnsafeLocalFunction = __webpack_require__(105); +var createMicrosoftUnsafeLocalFunction = __webpack_require__(149); // SVG temp container for IE lacking innerHTML var reusableSVGContainer; @@ -6949,7 +9906,7 @@ if (ExecutionEnvironment.canUseDOM) { // in hopes that this is preserved even if "\uFEFF" is transformed to // the actual Unicode character (by Babel, for example). // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 - node.innerHTML = String.fromCharCode(0xFEFF) + html; + node.innerHTML = String.fromCharCode(0xfeff) + html; // deleteData leaves an empty `TextNode` which offsets the index of all // children. Definitely want to avoid this. @@ -6970,7 +9927,7 @@ if (ExecutionEnvironment.canUseDOM) { module.exports = setInnerHTML; /***/ }), -/* 70 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7002,7 +9959,7 @@ module.exports = canDefineProperty; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 71 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7021,9 +9978,9 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var _ = __webpack_require__(9); -var AccessibilityUtil_1 = __webpack_require__(451); -var Types = __webpack_require__(14); +var _ = __webpack_require__(14); +var AccessibilityUtil_1 = __webpack_require__(503); +var Types = __webpack_require__(19); // Map of accessibility trait to an aria role attribute. // What's a role attribute? https://www.w3.org/wiki/PF/XTech/HTML5/RoleAttribute var roleMap = (_a = {}, @@ -7088,7 +10045,7 @@ var AccessibilityUtil = (function (_super) { return traits.indexOf(Types.AccessibilityTrait.Selected) !== -1 ? true : undefined; } // Here we are returning undefined if the above condtion is not met - // as we dont want to poluute the dom with "aria-selected = false" for every falsy condition + // as we dont want to pollute the dom with "aria-selected = false" for every falsy condition return undefined; }; return AccessibilityUtil; @@ -7100,7 +10057,7 @@ var _a, _b; /***/ }), -/* 72 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7126,12 +10083,14 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { } return t; }; -var React = __webpack_require__(6); -var AccessibilityUtil_1 = __webpack_require__(71); -var AnimateListEdits_1 = __webpack_require__(484); -var restyleForInlineText = __webpack_require__(203); -var Styles_1 = __webpack_require__(15); -var ViewBase_1 = __webpack_require__(117); +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var PropTypes = __webpack_require__(32); +var AccessibilityUtil_1 = __webpack_require__(89); +var AnimateListEdits_1 = __webpack_require__(535); +var restyleForInlineText = __webpack_require__(249); +var Styles_1 = __webpack_require__(20); +var ViewBase_1 = __webpack_require__(160); var _styles = { defaultStyle: { position: 'relative', @@ -7140,6 +10099,29 @@ var _styles = { flex: '0 0 auto', overflow: 'hidden', alignItems: 'stretch' + }, + // See resize detector comments in renderResizeDetectorIfNeeded() method below. + resizeDetectorContainerStyles: { + position: 'absolute', + left: '0', + top: '0', + right: '0', + bottom: '0', + overflow: 'scroll', + zIndex: '-1', + visibility: 'hidden' + }, + resizeGrowDetectorStyles: { + position: 'absolute', + left: '100500px', + top: '100500px', + width: '1px', + height: '1px' + }, + resizeShrinkDetectorStyles: { + position: 'absolute', + width: '150%', + height: '150%' } }; if (typeof document !== 'undefined') { @@ -7150,12 +10132,393 @@ if (typeof document !== 'undefined') { style.appendChild(document.createTextNode(ignorePointerEvents)); head.appendChild(style); } -; var View = (function (_super) { __extends(View, _super); function View() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.resizeDetectorNodes = {}; + return _this; + } + View.prototype.renderResizeDetectorIfNeeded = function (containerStyles) { + // If needed, additional invisible DOM elements will be added inside the + // view to track the size changes that are performed behind our back by + // the browser's layout engine faster (ViewBase checks for the layout + // updates once a second and sometimes it's not fast enough). + var _this = this; + // Unfortunately
doesn't have `resize` event, so we're trying to + // detect the fact that the view has been resized with `scroll` events. + // To do that, we create two scrollable
s and we put them into a + // state in which `scroll` event is triggered by the browser when the + // container gets resized (one element triggers `scroll` when the + // container gets bigger, another triggers `scroll` when the container + // gets smaller). + if (!this.props.importantForLayout) { + return null; + } + if (containerStyles.position !== 'relative') { + console.error('View: importantForLayout property is applicable only for a view with relative position'); + return null; + } + var initResizer = function (key, ref) { + var cur = _this.resizeDetectorNodes[key]; + var element = ReactDOM.findDOMNode(ref); + if (cur) { + delete _this.resizeDetectorNodes[key]; + } + if (element) { + _this.resizeDetectorNodes[key] = element; + } + _this.resizeDetectorOnScroll(); + }; + return [ + (React.createElement("div", { key: 'grow', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('grow', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeGrowDetectorStyles }))), + (React.createElement("div", { key: 'shrink', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('shrink', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeShrinkDetectorStyles }))) + ]; + }; + View.prototype.resizeDetectorReset = function () { + // Scroll the detectors to the bottom-right corner so + // that `scroll` events will be triggered when the container + // is resized. + var scrollMax = 100500; + var node = this.resizeDetectorNodes.grow; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + node = this.resizeDetectorNodes.shrink; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + }; + View.prototype.resizeDetectorOnScroll = function () { + var _this = this; + if (this.resizeDetectorAnimationFrame) { + // Do not execute action more often than once per animation frame. + return; + } + this.resizeDetectorAnimationFrame = window.requestAnimationFrame(function () { + _this.resizeDetectorReset(); + _this.resizeDetectorAnimationFrame = undefined; + ViewBase_1.default._checkViews(); + }); + }; + View.prototype.getChildContext = function () { + // Let descendant Types components know that their nearest Types ancestor is not an Types.Text. + // Because they're in an Types.View, they should use their normal styling rather than their + // special styling for appearing inline with text. + return { isRxParentAText: false }; + }; + View.prototype._getContainerRef = function () { + return this; + }; + View.prototype.render = function () { + var combinedStyles = Styles_1.default.combine(_styles.defaultStyle, this.props.style); + var ariaRole = AccessibilityUtil_1.default.accessibilityTraitToString(this.props.accessibilityTraits); + var ariaSelected = AccessibilityUtil_1.default.accessibilityTraitToAriaSelected(this.props.accessibilityTraits); + var isAriaHidden = AccessibilityUtil_1.default.isHidden(this.props.importantForAccessibility); + var props = { + role: ariaRole, + tabIndex: this.props.tabIndex, + style: combinedStyles, + title: this.props.title, + 'aria-label': this.props.accessibilityLabel, + 'aria-hidden': isAriaHidden, + 'aria-selected': ariaSelected, + onContextMenu: this.props.onContextMenu, + onMouseEnter: this.props.onMouseEnter, + onMouseLeave: this.props.onMouseLeave, + onMouseOver: this.props.onMouseOver, + onMouseMove: this.props.onMouseMove, + onDragEnter: this.props.onDragEnter, + onDragOver: this.props.onDragOver, + onDragLeave: this.props.onDragLeave, + onDrop: this.props.onDrop, + onClick: this.props.onPress, + onFocus: this.props.onFocus, + onBlur: this.props.onBlur, + onKeyDown: this.props.onKeyPress, + }; + if (this.props.ignorePointerEvents) { + props.className = 'reactxp-ignore-pointer-events'; + combinedStyles['pointerEvents'] = 'none'; + } + var reactElement; + var childAnimationsEnabled = this.props.animateChildEnter || this.props.animateChildMove || this.props.animateChildLeave; + if (childAnimationsEnabled) { + reactElement = (React.createElement(AnimateListEdits_1.default, __assign({}, props, { animateChildEnter: this.props.animateChildEnter, animateChildMove: this.props.animateChildMove, animateChildLeave: this.props.animateChildLeave }), this.props.children)); + } + else { + reactElement = (React.createElement("div", __assign({}, props), + this.renderResizeDetectorIfNeeded(combinedStyles), + this.props.children)); + } + return this.context.isRxParentAText ? + restyleForInlineText(reactElement) : + reactElement; + }; + return View; +}(ViewBase_1.default)); +View.contextTypes = { + isRxParentAText: PropTypes.bool +}; +View.childContextTypes = { + isRxParentAText: PropTypes.bool.isRequired +}; +exports.View = View; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = View; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* AccessibilityUtil.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of accessiblity functions for cross-platform +* ReactXP framework. +*/ + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var _ = __webpack_require__(15); +var AccessibilityUtil_1 = __webpack_require__(545); +var Types = __webpack_require__(21); +// Map of accessibility trait to an aria role attribute. +// What's a role attribute? https://www.w3.org/wiki/PF/XTech/HTML5/RoleAttribute +var roleMap = (_a = {}, + _a[Types.AccessibilityTrait.None] = 'presentation', + _a[Types.AccessibilityTrait.Button] = 'button', + _a[Types.AccessibilityTrait.Link] = 'link', + _a[Types.AccessibilityTrait.Header] = 'heading', + _a[Types.AccessibilityTrait.Search] = 'search', + _a[Types.AccessibilityTrait.Image] = 'img', + _a[Types.AccessibilityTrait.Summary] = 'region', + _a[Types.AccessibilityTrait.Adjustable] = 'slider', + _a[Types.AccessibilityTrait.Menu] = 'menu', + _a[Types.AccessibilityTrait.MenuItem] = 'menuitem', + _a[Types.AccessibilityTrait.MenuBar] = 'menubar', + _a[Types.AccessibilityTrait.Tab] = 'tab', + _a[Types.AccessibilityTrait.TabList] = 'tablist', + _a[Types.AccessibilityTrait.List] = 'list', + _a[Types.AccessibilityTrait.ListItem] = 'listitem', + _a[Types.AccessibilityTrait.ListBox] = 'listbox', + _a[Types.AccessibilityTrait.Group] = 'group', + _a[Types.AccessibilityTrait.CheckBox] = 'checkbox', + _a[Types.AccessibilityTrait.ComboBox] = 'combobox', + _a[Types.AccessibilityTrait.Log] = 'log', + _a[Types.AccessibilityTrait.Status] = 'status', + _a[Types.AccessibilityTrait.Dialog] = 'dialog', + _a); +// Map of accesssibility live region to an aria-live property. +var liveRegionMap = (_b = {}, + _b[Types.AccessibilityLiveRegion.None] = 'off', + _b[Types.AccessibilityLiveRegion.Assertive] = 'assertive', + _b[Types.AccessibilityLiveRegion.Polite] = 'polite', + _b); +var AccessibilityUtil = (function (_super) { + __extends(AccessibilityUtil, _super); + function AccessibilityUtil() { return _super !== null && _super.apply(this, arguments) || this; } + // Web equivalent value for aria-live property. + AccessibilityUtil.prototype.accessibilityLiveRegionToString = function (liveRegion) { + if (liveRegion) { + return liveRegionMap[liveRegion]; + } + return undefined; + }; + // Web equivalent value for role property. + // NOTE: Web only supports a single aria-role on a component. + AccessibilityUtil.prototype.accessibilityTraitToString = function (traits, defaultTrait) { + // Combine & remove duplicate traits. + var combinedTraits = defaultTrait ? [defaultTrait] : []; + if (traits) { + combinedTraits = _.union(combinedTraits, _.isArray(traits) ? traits : [traits]); + } + // Max enum value in this array of traits is role for web. Return corresponding + // role string from roleMap. + return combinedTraits.length > 0 ? + roleMap[_.max(_.filter(combinedTraits, function (t) { return roleMap.hasOwnProperty(t); }))] + : undefined; + }; + AccessibilityUtil.prototype.accessibilityTraitToAriaSelected = function (traits) { + // Walk through each trait and check if there's a selected trait. Return if one is found. + if (traits && _.isArray(traits) && traits.indexOf(Types.AccessibilityTrait.Tab) !== -1) { + return traits.indexOf(Types.AccessibilityTrait.Selected) !== -1 ? true : undefined; + } + // Here we are returning undefined if the above condtion is not met + // as we dont want to pollute the dom with "aria-selected = false" for every falsy condition + return undefined; + }; + return AccessibilityUtil; +}(AccessibilityUtil_1.AccessibilityUtil)); +exports.AccessibilityUtil = AccessibilityUtil; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new AccessibilityUtil(); +var _a, _b; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* View.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of the cross-platform View abstraction. +*/ + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var PropTypes = __webpack_require__(32); +var AccessibilityUtil_1 = __webpack_require__(91); +var AnimateListEdits_1 = __webpack_require__(577); +var restyleForInlineText = __webpack_require__(258); +var Styles_1 = __webpack_require__(22); +var ViewBase_1 = __webpack_require__(164); +var _styles = { + defaultStyle: { + position: 'relative', + display: 'flex', + flexDirection: 'column', + flex: '0 0 auto', + overflow: 'hidden', + alignItems: 'stretch' + }, + // See resize detector comments in renderResizeDetectorIfNeeded() method below. + resizeDetectorContainerStyles: { + position: 'absolute', + left: '0', + top: '0', + right: '0', + bottom: '0', + overflow: 'scroll', + zIndex: '-1', + visibility: 'hidden' + }, + resizeGrowDetectorStyles: { + position: 'absolute', + left: '100500px', + top: '100500px', + width: '1px', + height: '1px' + }, + resizeShrinkDetectorStyles: { + position: 'absolute', + width: '150%', + height: '150%' + } +}; +if (typeof document !== 'undefined') { + var ignorePointerEvents = '.reactxp-ignore-pointer-events * { pointer-events: auto; }'; + var head = document.head; + var style = document.createElement('style'); + style.type = 'text/css'; + style.appendChild(document.createTextNode(ignorePointerEvents)); + head.appendChild(style); +} +var View = (function (_super) { + __extends(View, _super); + function View() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.resizeDetectorNodes = {}; + return _this; + } + View.prototype.renderResizeDetectorIfNeeded = function (containerStyles) { + // If needed, additional invisible DOM elements will be added inside the + // view to track the size changes that are performed behind our back by + // the browser's layout engine faster (ViewBase checks for the layout + // updates once a second and sometimes it's not fast enough). + var _this = this; + // Unfortunately
doesn't have `resize` event, so we're trying to + // detect the fact that the view has been resized with `scroll` events. + // To do that, we create two scrollable
s and we put them into a + // state in which `scroll` event is triggered by the browser when the + // container gets resized (one element triggers `scroll` when the + // container gets bigger, another triggers `scroll` when the container + // gets smaller). + if (!this.props.importantForLayout) { + return null; + } + if (containerStyles.position !== 'relative') { + console.error('View: importantForLayout property is applicable only for a view with relative position'); + return null; + } + var initResizer = function (key, ref) { + var cur = _this.resizeDetectorNodes[key]; + var element = ReactDOM.findDOMNode(ref); + if (cur) { + delete _this.resizeDetectorNodes[key]; + } + if (element) { + _this.resizeDetectorNodes[key] = element; + } + _this.resizeDetectorOnScroll(); + }; + return [ + (React.createElement("div", { key: 'grow', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('grow', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeGrowDetectorStyles }))), + (React.createElement("div", { key: 'shrink', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('shrink', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeShrinkDetectorStyles }))) + ]; + }; + View.prototype.resizeDetectorReset = function () { + // Scroll the detectors to the bottom-right corner so + // that `scroll` events will be triggered when the container + // is resized. + var scrollMax = 100500; + var node = this.resizeDetectorNodes.grow; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + node = this.resizeDetectorNodes.shrink; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + }; + View.prototype.resizeDetectorOnScroll = function () { + var _this = this; + if (this.resizeDetectorAnimationFrame) { + // Do not execute action more often than once per animation frame. + return; + } + this.resizeDetectorAnimationFrame = window.requestAnimationFrame(function () { + _this.resizeDetectorReset(); + _this.resizeDetectorAnimationFrame = undefined; + ViewBase_1.default._checkViews(); + }); + }; View.prototype.getChildContext = function () { // Let descendant Types components know that their nearest Types ancestor is not an Types.Text. // Because they're in an Types.View, they should use their normal styling rather than their @@ -7202,7 +10565,9 @@ var View = (function (_super) { reactElement = (React.createElement(AnimateListEdits_1.default, __assign({}, props, { animateChildEnter: this.props.animateChildEnter, animateChildMove: this.props.animateChildMove, animateChildLeave: this.props.animateChildLeave }), this.props.children)); } else { - reactElement = (React.createElement("div", __assign({}, props), this.props.children)); + reactElement = (React.createElement("div", __assign({}, props), + this.renderResizeDetectorIfNeeded(combinedStyles), + this.props.children)); } return this.context.isRxParentAText ? restyleForInlineText(reactElement) : @@ -7211,10 +10576,10 @@ var View = (function (_super) { return View; }(ViewBase_1.default)); View.contextTypes = { - isRxParentAText: React.PropTypes.bool + isRxParentAText: PropTypes.bool }; View.childContextTypes = { - isRxParentAText: React.PropTypes.bool.isRequired + isRxParentAText: PropTypes.bool.isRequired }; exports.View = View; Object.defineProperty(exports, "__esModule", { value: true }); @@ -7222,7 +10587,321 @@ exports.default = View; /***/ }), -/* 73 */ +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* AccessibilityUtil.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of accessiblity functions for cross-platform +* ReactXP framework. +*/ + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var _ = __webpack_require__(16); +var AccessibilityUtil_1 = __webpack_require__(581); +var Types = __webpack_require__(23); +// Map of accessibility trait to an aria role attribute. +// What's a role attribute? https://www.w3.org/wiki/PF/XTech/HTML5/RoleAttribute +var roleMap = (_a = {}, + _a[Types.AccessibilityTrait.None] = 'presentation', + _a[Types.AccessibilityTrait.Button] = 'button', + _a[Types.AccessibilityTrait.Link] = 'link', + _a[Types.AccessibilityTrait.Header] = 'heading', + _a[Types.AccessibilityTrait.Search] = 'search', + _a[Types.AccessibilityTrait.Image] = 'img', + _a[Types.AccessibilityTrait.Summary] = 'region', + _a[Types.AccessibilityTrait.Adjustable] = 'slider', + _a[Types.AccessibilityTrait.Menu] = 'menu', + _a[Types.AccessibilityTrait.MenuItem] = 'menuitem', + _a[Types.AccessibilityTrait.MenuBar] = 'menubar', + _a[Types.AccessibilityTrait.Tab] = 'tab', + _a[Types.AccessibilityTrait.TabList] = 'tablist', + _a[Types.AccessibilityTrait.List] = 'list', + _a[Types.AccessibilityTrait.ListItem] = 'listitem', + _a[Types.AccessibilityTrait.ListBox] = 'listbox', + _a[Types.AccessibilityTrait.Group] = 'group', + _a[Types.AccessibilityTrait.CheckBox] = 'checkbox', + _a[Types.AccessibilityTrait.ComboBox] = 'combobox', + _a[Types.AccessibilityTrait.Log] = 'log', + _a[Types.AccessibilityTrait.Status] = 'status', + _a[Types.AccessibilityTrait.Dialog] = 'dialog', + _a); +// Map of accesssibility live region to an aria-live property. +var liveRegionMap = (_b = {}, + _b[Types.AccessibilityLiveRegion.None] = 'off', + _b[Types.AccessibilityLiveRegion.Assertive] = 'assertive', + _b[Types.AccessibilityLiveRegion.Polite] = 'polite', + _b); +var AccessibilityUtil = (function (_super) { + __extends(AccessibilityUtil, _super); + function AccessibilityUtil() { + return _super !== null && _super.apply(this, arguments) || this; + } + // Web equivalent value for aria-live property. + AccessibilityUtil.prototype.accessibilityLiveRegionToString = function (liveRegion) { + if (liveRegion) { + return liveRegionMap[liveRegion]; + } + return undefined; + }; + // Web equivalent value for role property. + // NOTE: Web only supports a single aria-role on a component. + AccessibilityUtil.prototype.accessibilityTraitToString = function (traits, defaultTrait) { + // Combine & remove duplicate traits. + var combinedTraits = defaultTrait ? [defaultTrait] : []; + if (traits) { + combinedTraits = _.union(combinedTraits, _.isArray(traits) ? traits : [traits]); + } + // Max enum value in this array of traits is role for web. Return corresponding + // role string from roleMap. + return combinedTraits.length > 0 ? + roleMap[_.max(_.filter(combinedTraits, function (t) { return roleMap.hasOwnProperty(t); }))] + : undefined; + }; + AccessibilityUtil.prototype.accessibilityTraitToAriaSelected = function (traits) { + // Walk through each trait and check if there's a selected trait. Return if one is found. + if (traits && _.isArray(traits) && traits.indexOf(Types.AccessibilityTrait.Tab) !== -1) { + return traits.indexOf(Types.AccessibilityTrait.Selected) !== -1 ? true : undefined; + } + // Here we are returning undefined if the above condtion is not met + // as we dont want to pollute the dom with "aria-selected = false" for every falsy condition + return undefined; + }; + return AccessibilityUtil; +}(AccessibilityUtil_1.AccessibilityUtil)); +exports.AccessibilityUtil = AccessibilityUtil; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new AccessibilityUtil(); +var _a, _b; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** +* View.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Web-specific implementation of the cross-platform View abstraction. +*/ + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var PropTypes = __webpack_require__(32); +var AccessibilityUtil_1 = __webpack_require__(93); +var AnimateListEdits_1 = __webpack_require__(613); +var restyleForInlineText = __webpack_require__(268); +var Styles_1 = __webpack_require__(24); +var ViewBase_1 = __webpack_require__(168); +var _styles = { + defaultStyle: { + position: 'relative', + display: 'flex', + flexDirection: 'column', + flex: '0 0 auto', + overflow: 'hidden', + alignItems: 'stretch' + }, + // See resize detector comments in renderResizeDetectorIfNeeded() method below. + resizeDetectorContainerStyles: { + position: 'absolute', + left: '0', + top: '0', + right: '0', + bottom: '0', + overflow: 'scroll', + zIndex: '-1', + visibility: 'hidden' + }, + resizeGrowDetectorStyles: { + position: 'absolute', + left: '100500px', + top: '100500px', + width: '1px', + height: '1px' + }, + resizeShrinkDetectorStyles: { + position: 'absolute', + width: '150%', + height: '150%' + } +}; +if (typeof document !== 'undefined') { + var ignorePointerEvents = '.reactxp-ignore-pointer-events * { pointer-events: auto; }'; + var head = document.head; + var style = document.createElement('style'); + style.type = 'text/css'; + style.appendChild(document.createTextNode(ignorePointerEvents)); + head.appendChild(style); +} +var View = (function (_super) { + __extends(View, _super); + function View() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.resizeDetectorNodes = {}; + return _this; + } + View.prototype.renderResizeDetectorIfNeeded = function (containerStyles) { + // If needed, additional invisible DOM elements will be added inside the + // view to track the size changes that are performed behind our back by + // the browser's layout engine faster (ViewBase checks for the layout + // updates once a second and sometimes it's not fast enough). + var _this = this; + // Unfortunately
doesn't have `resize` event, so we're trying to + // detect the fact that the view has been resized with `scroll` events. + // To do that, we create two scrollable
s and we put them into a + // state in which `scroll` event is triggered by the browser when the + // container gets resized (one element triggers `scroll` when the + // container gets bigger, another triggers `scroll` when the container + // gets smaller). + if (!this.props.importantForLayout) { + return null; + } + if (containerStyles.position !== 'relative') { + console.error('View: importantForLayout property is applicable only for a view with relative position'); + return null; + } + var initResizer = function (key, ref) { + var cur = _this.resizeDetectorNodes[key]; + var element = ReactDOM.findDOMNode(ref); + if (cur) { + delete _this.resizeDetectorNodes[key]; + } + if (element) { + _this.resizeDetectorNodes[key] = element; + } + _this.resizeDetectorOnScroll(); + }; + return [ + (React.createElement("div", { key: 'grow', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('grow', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeGrowDetectorStyles }))), + (React.createElement("div", { key: 'shrink', style: _styles.resizeDetectorContainerStyles, ref: function (ref) { return initResizer('shrink', ref); }, onScroll: function () { return _this.resizeDetectorOnScroll(); } }, + React.createElement("div", { style: _styles.resizeShrinkDetectorStyles }))) + ]; + }; + View.prototype.resizeDetectorReset = function () { + // Scroll the detectors to the bottom-right corner so + // that `scroll` events will be triggered when the container + // is resized. + var scrollMax = 100500; + var node = this.resizeDetectorNodes.grow; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + node = this.resizeDetectorNodes.shrink; + if (node) { + node.scrollLeft = scrollMax; + node.scrollTop = scrollMax; + } + }; + View.prototype.resizeDetectorOnScroll = function () { + var _this = this; + if (this.resizeDetectorAnimationFrame) { + // Do not execute action more often than once per animation frame. + return; + } + this.resizeDetectorAnimationFrame = window.requestAnimationFrame(function () { + _this.resizeDetectorReset(); + _this.resizeDetectorAnimationFrame = undefined; + ViewBase_1.default._checkViews(); + }); + }; + View.prototype.getChildContext = function () { + // Let descendant Types components know that their nearest Types ancestor is not an Types.Text. + // Because they're in an Types.View, they should use their normal styling rather than their + // special styling for appearing inline with text. + return { isRxParentAText: false }; + }; + View.prototype._getContainerRef = function () { + return this; + }; + View.prototype.render = function () { + var combinedStyles = Styles_1.default.combine(_styles.defaultStyle, this.props.style); + var ariaRole = AccessibilityUtil_1.default.accessibilityTraitToString(this.props.accessibilityTraits); + var ariaSelected = AccessibilityUtil_1.default.accessibilityTraitToAriaSelected(this.props.accessibilityTraits); + var isAriaHidden = AccessibilityUtil_1.default.isHidden(this.props.importantForAccessibility); + var props = { + role: ariaRole, + tabIndex: this.props.tabIndex, + style: combinedStyles, + title: this.props.title, + 'aria-label': this.props.accessibilityLabel, + 'aria-hidden': isAriaHidden, + 'aria-selected': ariaSelected, + onContextMenu: this.props.onContextMenu, + onMouseEnter: this.props.onMouseEnter, + onMouseLeave: this.props.onMouseLeave, + onMouseOver: this.props.onMouseOver, + onMouseMove: this.props.onMouseMove, + onDragEnter: this.props.onDragEnter, + onDragOver: this.props.onDragOver, + onDragLeave: this.props.onDragLeave, + onDrop: this.props.onDrop, + onClick: this.props.onPress, + onFocus: this.props.onFocus, + onBlur: this.props.onBlur, + onKeyDown: this.props.onKeyPress, + }; + if (this.props.ignorePointerEvents) { + props.className = 'reactxp-ignore-pointer-events'; + combinedStyles['pointerEvents'] = 'none'; + } + var reactElement; + var childAnimationsEnabled = this.props.animateChildEnter || this.props.animateChildMove || this.props.animateChildLeave; + if (childAnimationsEnabled) { + reactElement = (React.createElement(AnimateListEdits_1.default, __assign({}, props, { animateChildEnter: this.props.animateChildEnter, animateChildMove: this.props.animateChildMove, animateChildLeave: this.props.animateChildLeave }), this.props.children)); + } + else { + reactElement = (React.createElement("div", __assign({}, props), + this.renderResizeDetectorIfNeeded(combinedStyles), + this.props.children)); + } + return this.context.isRxParentAText ? + restyleForInlineText(reactElement) : + reactElement; + }; + return View; +}(ViewBase_1.default)); +View.contextTypes = { + isRxParentAText: PropTypes.bool +}; +View.childContextTypes = { + isRxParentAText: PropTypes.bool.isRequired +}; +exports.View = View; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = View; + + +/***/ }), +/* 95 */ /***/ (function(module, exports) { var g; @@ -7249,7 +10928,7 @@ module.exports = g; /***/ }), -/* 74 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7322,11 +11001,11 @@ function shallowEqual(objA, objB) { module.exports = shallowEqual; /***/ }), -/* 75 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { -var getNative = __webpack_require__(29), - root = __webpack_require__(18); +var getNative = __webpack_require__(40), + root = __webpack_require__(27); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); @@ -7335,14 +11014,14 @@ module.exports = Map; /***/ }), -/* 76 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { -var mapCacheClear = __webpack_require__(304), - mapCacheDelete = __webpack_require__(305), - mapCacheGet = __webpack_require__(306), - mapCacheHas = __webpack_require__(307), - mapCacheSet = __webpack_require__(308); +var mapCacheClear = __webpack_require__(374), + mapCacheDelete = __webpack_require__(375), + mapCacheGet = __webpack_require__(376), + mapCacheHas = __webpack_require__(377), + mapCacheSet = __webpack_require__(378); /** * Creates a map cache object to store key-value pairs. @@ -7373,7 +11052,7 @@ module.exports = MapCache; /***/ }), -/* 77 */ +/* 99 */ /***/ (function(module, exports) { /** @@ -7399,7 +11078,7 @@ module.exports = arrayPush; /***/ }), -/* 78 */ +/* 100 */ /***/ (function(module, exports) { /** @@ -7431,11 +11110,11 @@ module.exports = arrayReduce; /***/ }), -/* 79 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(56), - eq = __webpack_require__(45); +var baseAssignValue = __webpack_require__(70), + eq = __webpack_require__(58); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -7465,28 +11144,28 @@ module.exports = assignValue; /***/ }), -/* 80 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { -var Stack = __webpack_require__(54), - arrayEach = __webpack_require__(128), - assignValue = __webpack_require__(79), - baseAssign = __webpack_require__(231), - baseAssignIn = __webpack_require__(232), - cloneBuffer = __webpack_require__(141), - copyArray = __webpack_require__(88), - copySymbols = __webpack_require__(271), - copySymbolsIn = __webpack_require__(272), - getAllKeys = __webpack_require__(146), - getAllKeysIn = __webpack_require__(147), - getTag = __webpack_require__(92), - initCloneArray = __webpack_require__(294), - initCloneByTag = __webpack_require__(295), - initCloneObject = __webpack_require__(149), - isArray = __webpack_require__(10), - isBuffer = __webpack_require__(47), - isObject = __webpack_require__(12), - keys = __webpack_require__(26); +var Stack = __webpack_require__(68), + arrayEach = __webpack_require__(177), + assignValue = __webpack_require__(101), + baseAssign = __webpack_require__(301), + baseAssignIn = __webpack_require__(302), + cloneBuffer = __webpack_require__(190), + copyArray = __webpack_require__(110), + copySymbols = __webpack_require__(341), + copySymbolsIn = __webpack_require__(342), + getAllKeys = __webpack_require__(195), + getAllKeysIn = __webpack_require__(196), + getTag = __webpack_require__(114), + initCloneArray = __webpack_require__(364), + initCloneByTag = __webpack_require__(365), + initCloneObject = __webpack_require__(198), + isArray = __webpack_require__(12), + isBuffer = __webpack_require__(60), + isObject = __webpack_require__(17), + keys = __webpack_require__(28); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, @@ -7624,11 +11303,11 @@ module.exports = baseClone; /***/ }), -/* 81 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { -var baseForOwn = __webpack_require__(133), - createBaseEach = __webpack_require__(274); +var baseForOwn = __webpack_require__(182), + createBaseEach = __webpack_require__(344); /** * The base implementation of `_.forEach` without support for iteratee shorthands. @@ -7644,7 +11323,7 @@ module.exports = baseEach; /***/ }), -/* 82 */ +/* 104 */ /***/ (function(module, exports) { /** @@ -7674,11 +11353,11 @@ module.exports = baseFindIndex; /***/ }), -/* 83 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { -var arrayPush = __webpack_require__(77), - isFlattenable = __webpack_require__(296); +var arrayPush = __webpack_require__(99), + isFlattenable = __webpack_require__(366); /** * The base implementation of `_.flatten` with support for restricting flattening. @@ -7718,11 +11397,11 @@ module.exports = baseFlatten; /***/ }), -/* 84 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { -var castPath = __webpack_require__(57), - toKey = __webpack_require__(44); +var castPath = __webpack_require__(71), + toKey = __webpack_require__(57); /** * The base implementation of `_.get` without support for default values. @@ -7748,11 +11427,11 @@ module.exports = baseGet; /***/ }), -/* 85 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsEqualDeep = __webpack_require__(242), - isObjectLike = __webpack_require__(25); +var baseIsEqualDeep = __webpack_require__(312), + isObjectLike = __webpack_require__(36); /** * The base implementation of `_.isEqual` which supports partial comparisons @@ -7782,7 +11461,7 @@ module.exports = baseIsEqual; /***/ }), -/* 86 */ +/* 108 */ /***/ (function(module, exports) { /** @@ -7802,10 +11481,10 @@ module.exports = baseUnary; /***/ }), -/* 87 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { -var Uint8Array = __webpack_require__(127); +var Uint8Array = __webpack_require__(176); /** * Creates a clone of `arrayBuffer`. @@ -7824,7 +11503,7 @@ module.exports = cloneArrayBuffer; /***/ }), -/* 88 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -7850,11 +11529,11 @@ module.exports = copyArray; /***/ }), -/* 89 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(42), - isIterateeCall = __webpack_require__(150); +var baseRest = __webpack_require__(55), + isIterateeCall = __webpack_require__(199); /** * Creates a function like `_.assign`. @@ -7893,10 +11572,10 @@ module.exports = createAssigner; /***/ }), -/* 90 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { -var overArg = __webpack_require__(154); +var overArg = __webpack_require__(203); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); @@ -7905,11 +11584,11 @@ module.exports = getPrototype; /***/ }), -/* 91 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(129), - stubArray = __webpack_require__(165); +var arrayFilter = __webpack_require__(178), + stubArray = __webpack_require__(209); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -7941,16 +11620,16 @@ module.exports = getSymbols; /***/ }), -/* 92 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { -var DataView = __webpack_require__(220), - Map = __webpack_require__(75), - Promise = __webpack_require__(222), - Set = __webpack_require__(125), - WeakMap = __webpack_require__(223), - baseGetTag = __webpack_require__(28), - toSource = __webpack_require__(157); +var DataView = __webpack_require__(290), + Map = __webpack_require__(97), + Promise = __webpack_require__(292), + Set = __webpack_require__(174), + WeakMap = __webpack_require__(293), + baseGetTag = __webpack_require__(39), + toSource = __webpack_require__(206); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -8005,11 +11684,11 @@ module.exports = getTag; /***/ }), -/* 93 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { -var isArray = __webpack_require__(10), - isSymbol = __webpack_require__(36); +var isArray = __webpack_require__(12), + isSymbol = __webpack_require__(49); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, @@ -8040,11 +11719,414 @@ module.exports = isKey; /***/ }), -/* 94 */ +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +var assignValue = __webpack_require__(101), + copyObject = __webpack_require__(35), + createAssigner = __webpack_require__(111), + isArrayLike = __webpack_require__(31), + isPrototype = __webpack_require__(56), + keys = __webpack_require__(28); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseClone = __webpack_require__(102); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); +} + +module.exports = cloneDeep; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseDelay = __webpack_require__(305), + baseRest = __webpack_require__(55); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(401); + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseClamp = __webpack_require__(303), + baseToString = __webpack_require__(187), + toInteger = __webpack_require__(138), + toString = __webpack_require__(81); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; +} + +module.exports = endsWith; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseFindIndex = __webpack_require__(104), + baseIteratee = __webpack_require__(34), + toInteger = __webpack_require__(138); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var createFind = __webpack_require__(347), + findLastIndex = __webpack_require__(400); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +var findLast = createFind(findLastIndex); + +module.exports = findLast; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseKeys = __webpack_require__(185), + getTag = __webpack_require__(114), + isArguments = __webpack_require__(59), + isArray = __webpack_require__(12), + isArrayLike = __webpack_require__(31), + isBuffer = __webpack_require__(60), + isPrototype = __webpack_require__(56), + isTypedArray = __webpack_require__(79); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(107); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; + + +/***/ }), +/* 125 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(28), - isObject = __webpack_require__(12); +var baseGetTag = __webpack_require__(39), + isObject = __webpack_require__(17); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', @@ -8083,7 +12165,7 @@ module.exports = isFunction; /***/ }), -/* 95 */ +/* 126 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ @@ -8124,537 +12206,633 @@ module.exports = isLength; /***/ }), -/* 96 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { -var toFinite = __webpack_require__(360); +var baseGetTag = __webpack_require__(39), + isObjectLike = __webpack_require__(36); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; /** - * Converts `value` to an integer. + * Checks if `value` is classified as a `Number` primitive or object. * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.1.0 * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * - * _.toInteger(3.2); - * // => 3 + * _.isNumber(3); + * // => true * - * _.toInteger(Number.MIN_VALUE); - * // => 0 + * _.isNumber(Number.MIN_VALUE); + * // => true * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 + * _.isNumber(Infinity); + * // => true * - * _.toInteger('3.2'); - * // => 3 + * _.isNumber('3'); + * // => false */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); } -module.exports = toInteger; +module.exports = isNumber; /***/ }), -/* 97 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. +var createCompounder = __webpack_require__(346); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * - * 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. + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); +module.exports = kebabCase; -var DOMLazyTree = __webpack_require__(37); -var Danger = __webpack_require__(372); -var ReactDOMComponentTree = __webpack_require__(7); -var ReactInstrumentation = __webpack_require__(16); - -var createMicrosoftUnsafeLocalFunction = __webpack_require__(105); -var setInnerHTML = __webpack_require__(69); -var setTextContent = __webpack_require__(189); +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { -function getNodeAfter(parentNode, node) { - // Special case for text components, which return [open, close] comments - // from getHostNode. - if (Array.isArray(node)) { - node = node[1]; - } - return node ? node.nextSibling : parentNode.firstChild; -} +var arrayMap = __webpack_require__(54), + baseIteratee = __webpack_require__(34), + baseMap = __webpack_require__(186), + isArray = __webpack_require__(12); /** - * Inserts `childNode` as a child of `parentNode` at the `index`. + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). * - * @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 - */ -var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { - // We rely exclusively on `insertBefore(node, null)` instead of also using - // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so - // we are careful to use `null`.) - parentNode.insertBefore(childNode, referenceNode); -}); - -function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { - DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); -} - -function moveChild(parentNode, childNode, referenceNode) { - if (Array.isArray(childNode)) { - moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); - } else { - insertChildAt(parentNode, childNode, referenceNode); - } -} - -function removeChild(parentNode, childNode) { - if (Array.isArray(childNode)) { - var closingComment = childNode[1]; - childNode = childNode[0]; - removeDelimitedText(parentNode, childNode, closingComment); - parentNode.removeChild(closingComment); - } - parentNode.removeChild(childNode); -} - -function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { - var node = openingComment; - while (true) { - var nextNode = node.nextSibling; - insertChildAt(parentNode, node, referenceNode); - if (node === closingComment) { - break; - } - node = nextNode; - } + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ +function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, baseIteratee(iteratee, 3)); } -function removeDelimitedText(parentNode, startNode, closingComment) { - while (true) { - var node = startNode.nextSibling; - if (node === closingComment) { - // The closing comment is removed by ReactMultiChild. - break; - } else { - parentNode.removeChild(node); - } - } -} +module.exports = map; -function replaceDelimitedText(openingComment, closingComment, stringText) { - var parentNode = openingComment.parentNode; - var nodeAfterComment = openingComment.nextSibling; - if (nodeAfterComment === closingComment) { - // There are no text nodes between the opening and closing comments; insert - // a new one if stringText isn't empty. - if (stringText) { - insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); - } - } else { - if (stringText) { - // Set the text content of the first node after the opening comment, and - // remove all following nodes up until the closing comment. - setTextContent(nodeAfterComment, stringText); - removeDelimitedText(parentNode, nodeAfterComment, closingComment); - } else { - removeDelimitedText(parentNode, openingComment, closingComment); - } - } - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, - type: 'replace text', - payload: stringText - }); - } -} +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { -var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; -if (process.env.NODE_ENV !== 'production') { - dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { - Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); - if (prevInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: prevInstance._debugID, - type: 'replace with', - payload: markup.toString() - }); - } else { - var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); - if (nextInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: nextInstance._debugID, - type: 'mount', - payload: markup.toString() - }); - } - } - }; -} +var baseAssignValue = __webpack_require__(70), + baseForOwn = __webpack_require__(182), + baseIteratee = __webpack_require__(34); /** - * Operations for updating with DOM children. + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ -var DOMChildrenOperations = { - - dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, - - replaceDelimitedText: replaceDelimitedText, - - /** - * Updates a component's children by processing a series of updates. The - * update configurations are each expected to have a `parentNode` property. - * - * @param {array} updates List of update configurations. - * @internal - */ - processUpdates: function (parentNode, updates) { - if (process.env.NODE_ENV !== 'production') { - var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; - } +function mapValues(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); - for (var k = 0; k < updates.length; k++) { - var update = updates[k]; - switch (update.type) { - case 'INSERT_MARKUP': - insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'insert child', - payload: { toIndex: update.toIndex, content: update.content.toString() } - }); - } - break; - case 'MOVE_EXISTING': - moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'move child', - payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } - }); - } - break; - case 'SET_MARKUP': - setInnerHTML(parentNode, update.content); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'replace children', - payload: update.content.toString() - }); - } - break; - case 'TEXT_CONTENT': - setTextContent(parentNode, update.content); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'replace text', - payload: update.content.toString() - }); - } - break; - case 'REMOVE_NODE': - removeChild(parentNode, update.fromNode); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'remove child', - payload: { fromIndex: update.fromIndex } - }); - } - break; - } - } - } + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; +} -}; +module.exports = mapValues; -module.exports = DOMChildrenOperations; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 98 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var baseExtremum = __webpack_require__(306), + baseGt = __webpack_require__(308), + identity = __webpack_require__(48); + /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. * - * 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. + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 * + * _.max([]); + * // => undefined */ +function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; +} +module.exports = max; -var DOMNamespaces = { - html: 'http://www.w3.org/1999/xhtml', - mathml: 'http://www.w3.org/1998/Math/MathML', - svg: 'http://www.w3.org/2000/svg' -}; - -module.exports = DOMNamespaces; - /***/ }), -/* 99 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. +var baseMerge = __webpack_require__(320), + createAssigner = __webpack_require__(111); + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. * - * 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. + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); +module.exports = merge; -var _prodInvariant = __webpack_require__(3); - -var ReactErrorUtils = __webpack_require__(103); +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); +var arrayMap = __webpack_require__(54), + baseClone = __webpack_require__(102), + baseUnset = __webpack_require__(188), + castPath = __webpack_require__(71), + copyObject = __webpack_require__(35), + customOmitClone = __webpack_require__(349), + flatRest = __webpack_require__(353), + getAllKeysIn = __webpack_require__(196); -/** - * Injected dependencies: - */ +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; /** - * - `ComponentTree`: [required] Module that can convert between React instances - * and actual node references. + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } */ -var ComponentTree; -var TreeTraversal; -var injection = { - injectComponentTree: function (Injected) { - ComponentTree = Injected; - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; - } - }, - injectTreeTraversal: function (Injected) { - TreeTraversal = Injected; - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; - } +var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; } -}; - -function isEndish(topLevelType) { - return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; -} - -function isMoveish(topLevelType) { - return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; -} -function isStartish(topLevelType) { - return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; -} + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; +}); -var validateEventDispatches; -if (process.env.NODE_ENV !== 'production') { - validateEventDispatches = function (event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; +module.exports = omit; - var listenersIsArr = Array.isArray(dispatchListeners); - var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - var instancesIsArr = Array.isArray(dispatchInstances); - var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { - process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; - }; -} +var baseRest = __webpack_require__(55), + pullAll = __webpack_require__(407); /** - * Dispatch the event to the listener. - * @param {SyntheticEvent} event SyntheticEvent to handle - * @param {boolean} simulated If the event is simulated (changes exn behavior) - * @param {function} listener Application-level callback - * @param {*} inst Internal component instance + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] */ -function executeDispatch(event, simulated, listener, inst) { - var type = event.type || 'unknown-event'; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); - if (simulated) { - ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); - } else { - ReactErrorUtils.invokeGuardedCallback(type, listener, event); - } - event.currentTarget = null; -} +var pull = baseRest(pullAll); + +module.exports = pull; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIteratee = __webpack_require__(34), + basePullAt = __webpack_require__(327); /** - * Standard/simple iteration through an event's collected dispatches. + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] */ -function executeDispatchesInOrder(event, simulated) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - if (process.env.NODE_ENV !== 'production') { - validateEventDispatches(event); +function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; } - if (Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length; i++) { - if (event.isPropagationStopped()) { - break; - } - // Listeners and Instances are two parallel arrays that are always in sync. - executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); + var index = -1, + indexes = [], + length = array.length; + + predicate = baseIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); } - } else if (dispatchListeners) { - executeDispatch(event, simulated, dispatchListeners, dispatchInstances); } - event._dispatchListeners = null; - event._dispatchInstances = null; + basePullAt(array, indexes); + return result; } +module.exports = remove; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseFlatten = __webpack_require__(105), + baseOrderBy = __webpack_require__(322), + baseRest = __webpack_require__(55), + isIterateeCall = __webpack_require__(199); + /** - * Standard/simple iteration through an event's collected dispatches, but stops - * at the first dispatch execution returning true, and returns that id. + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). * - * @return {?string} id of the first dispatch execution who's listener returns - * true, or null if no listener returned true. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ -function executeDispatchesInOrderStopAtTrueImpl(event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - if (process.env.NODE_ENV !== 'production') { - validateEventDispatches(event); +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; } - if (Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length; i++) { - if (event.isPropagationStopped()) { - break; - } - // Listeners and Instances are two parallel arrays that are always in sync. - if (dispatchListeners[i](event, dispatchInstances[i])) { - return dispatchInstances[i]; - } - } - } else if (dispatchListeners) { - if (dispatchListeners(event, dispatchInstances)) { - return dispatchInstances; - } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; } - return null; -} + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); -/** - * @see executeDispatchesInOrderStopAtTrueImpl - */ -function executeDispatchesInOrderStopAtTrue(event) { - var ret = executeDispatchesInOrderStopAtTrueImpl(event); - event._dispatchInstances = null; - event._dispatchListeners = null; - return ret; -} +module.exports = sortBy; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +var debounce = __webpack_require__(398), + isObject = __webpack_require__(17); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * Execution of a "direct" dispatch - there must be at most one dispatch - * accumulated on the event or it is considered an error. It doesn't really make - * sense for an event with multiple dispatches (bubbled) to keep track of the - * return values at each dispatch execution, but it does tend to make sense when - * dealing with "direct" dispatches. + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. * - * @return {*} The return value of executing the single dispatch. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); */ -function executeDirectDispatch(event) { - if (process.env.NODE_ENV !== 'production') { - validateEventDispatches(event); +function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - var dispatchListener = event._dispatchListeners; - var dispatchInstance = event._dispatchInstances; - !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; - event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; - var res = dispatchListener ? dispatchListener(event) : null; - event.currentTarget = null; - event._dispatchListeners = null; - event._dispatchInstances = null; - return res; + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); } +module.exports = throttle; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +var toFinite = __webpack_require__(409); + /** - * @param {SyntheticEvent} event - * @return {boolean} True iff number of dispatches accumulated is greater than 0. + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 */ -function hasDispatches(event) { - return !!event._dispatchListeners; +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; } -/** - * General utilities that are useful in creating custom Event Plugins. - */ -var EventPluginUtils = { - isEndish: isEndish, - isMoveish: isMoveish, - isStartish: isStartish, +module.exports = toInteger; - executeDirectDispatch: executeDirectDispatch, - executeDispatchesInOrder: executeDispatchesInOrder, - executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, - hasDispatches: hasDispatches, - getInstanceFromNode: function (node) { - return ComponentTree.getInstanceFromNode(node); - }, - getNodeFromInstance: function (node) { - return ComponentTree.getNodeFromInstance(node); - }, - isAncestor: function (a, b) { - return TreeTraversal.isAncestor(a, b); - }, - getLowestCommonAncestor: function (a, b) { - return TreeTraversal.getLowestCommonAncestor(a, b); - }, - getParentInstance: function (inst) { - return TreeTraversal.getParentInstance(inst); - }, - traverseTwoPhase: function (target, fn, arg) { - return TreeTraversal.traverseTwoPhase(target, fn, arg); - }, - traverseEnterLeave: function (from, to, fn, argFrom, argTo) { - return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); - }, +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { - injection: injection -}; +var baseFlatten = __webpack_require__(105), + baseRest = __webpack_require__(55), + baseUniq = __webpack_require__(332), + isArrayLikeObject = __webpack_require__(207); + +/** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ +var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); +}); + +module.exports = union; -module.exports = EventPluginUtils; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 100 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8665,60 +12843,17 @@ module.exports = EventPluginUtils; * 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. - * - * - */ - - - -/** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. */ -function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - '=': '=0', - ':': '=2' - }; - var escapedString = ('' + key).replace(escapeRegex, function (match) { - return escaperLookup[match]; - }); - - return '$' + escapedString; -} -/** - * Unescape and unwrap key for human-readable display - * - * @param {string} key to unescape. - * @return {string} the unescaped key. - */ -function unescape(key) { - var unescapeRegex = /(=0|=2)/g; - var unescaperLookup = { - '=0': '=', - '=2': ':' - }; - var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); - return ('' + keySubstring).replace(unescapeRegex, function (match) { - return unescaperLookup[match]; - }); -} +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; -var KeyEscapeUtils = { - escape: escape, - unescape: unescape -}; +module.exports = ReactPropTypesSecret; -module.exports = KeyEscapeUtils; /***/ }), -/* 101 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8734,135 +12869,688 @@ module.exports = KeyEscapeUtils; -var _prodInvariant = __webpack_require__(3); - -var ReactPropTypesSecret = __webpack_require__(181); -var propTypesFactory = __webpack_require__(167); +var DOMLazyTree = __webpack_require__(50); +var Danger = __webpack_require__(419); +var ReactDOMComponentTree = __webpack_require__(10); +var ReactInstrumentation = __webpack_require__(26); -var React = __webpack_require__(39); -var PropTypes = propTypesFactory(React.isValidElement); +var createMicrosoftUnsafeLocalFunction = __webpack_require__(149); +var setInnerHTML = __webpack_require__(87); +var setTextContent = __webpack_require__(233); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); +function getNodeAfter(parentNode, node) { + // Special case for text components, which return [open, close] comments + // from getHostNode. + if (Array.isArray(node)) { + node = node[1]; + } + return node ? node.nextSibling : parentNode.firstChild; +} -var hasReadOnlyValue = { - 'button': true, - 'checkbox': true, - 'image': true, - 'hidden': true, - 'radio': true, - 'reset': true, - 'submit': true -}; +/** + * 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 + */ +var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { + // We rely exclusively on `insertBefore(node, null)` instead of also using + // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so + // we are careful to use `null`.) + parentNode.insertBefore(childNode, referenceNode); +}); -function _assertSingleLink(inputProps) { - !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0; +function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { + DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); } -function _assertValueLink(inputProps) { - _assertSingleLink(inputProps); - !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0; + +function moveChild(parentNode, childNode, referenceNode) { + if (Array.isArray(childNode)) { + moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); + } else { + insertChildAt(parentNode, childNode, referenceNode); + } } -function _assertCheckedLink(inputProps) { - _assertSingleLink(inputProps); - !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0; +function removeChild(parentNode, childNode) { + if (Array.isArray(childNode)) { + var closingComment = childNode[1]; + childNode = childNode[0]; + removeDelimitedText(parentNode, childNode, closingComment); + parentNode.removeChild(closingComment); + } + parentNode.removeChild(childNode); } -var propTypes = { - value: function (props, propName, componentName) { - if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { - return null; - } - return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - }, - checked: function (props, propName, componentName) { - if (!props[propName] || props.onChange || props.readOnly || props.disabled) { - return null; +function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { + var node = openingComment; + while (true) { + var nextNode = node.nextSibling; + insertChildAt(parentNode, node, referenceNode); + if (node === closingComment) { + break; } - return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - }, - onChange: PropTypes.func -}; + node = nextNode; + } +} -var loggedTypeFailures = {}; -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; +function removeDelimitedText(parentNode, startNode, closingComment) { + while (true) { + var node = startNode.nextSibling; + if (node === closingComment) { + // The closing comment is removed by ReactMultiChild. + break; + } else { + parentNode.removeChild(node); } } - return ''; } -/** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ -var LinkedValueUtils = { - checkPropTypes: function (tagName, props, owner) { - for (var propName in propTypes) { - if (propTypes.hasOwnProperty(propName)) { - var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret); - } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; +function replaceDelimitedText(openingComment, closingComment, stringText) { + var parentNode = openingComment.parentNode; + var nodeAfterComment = openingComment.nextSibling; + if (nodeAfterComment === closingComment) { + // There are no text nodes between the opening and closing comments; insert + // a new one if stringText isn't empty. + if (stringText) { + insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); + } + } else { + if (stringText) { + // Set the text content of the first node after the opening comment, and + // remove all following nodes up until the closing comment. + setTextContent(nodeAfterComment, stringText); + removeDelimitedText(parentNode, nodeAfterComment, closingComment); + } else { + removeDelimitedText(parentNode, openingComment, closingComment); + } + } - var addendum = getDeclarationErrorAddendum(owner); - process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0; + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, + type: 'replace text', + payload: stringText + }); + } +} + +var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; +if (process.env.NODE_ENV !== 'production') { + dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { + Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); + if (prevInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: prevInstance._debugID, + type: 'replace with', + payload: markup.toString() + }); + } else { + var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); + if (nextInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: nextInstance._debugID, + type: 'mount', + payload: markup.toString() + }); } } - }, + }; +} - /** - * @param {object} inputProps Props for form component - * @return {*} current value of the input either from value prop or link. - */ - getValue: function (inputProps) { - if (inputProps.valueLink) { - _assertValueLink(inputProps); - return inputProps.valueLink.value; - } - return inputProps.value; - }, +/** + * Operations for updating with DOM children. + */ +var DOMChildrenOperations = { + dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, - /** - * @param {object} inputProps Props for form component - * @return {*} current checked status of the input either from checked prop - * or link. - */ - getChecked: function (inputProps) { - if (inputProps.checkedLink) { - _assertCheckedLink(inputProps); - return inputProps.checkedLink.value; - } - return inputProps.checked; - }, + replaceDelimitedText: replaceDelimitedText, /** - * @param {object} inputProps Props for form component - * @param {SyntheticEvent} event change event to handle + * Updates a component's children by processing a series of updates. The + * update configurations are each expected to have a `parentNode` property. + * + * @param {array} updates List of update configurations. + * @internal */ - executeOnChange: function (inputProps, event) { - if (inputProps.valueLink) { - _assertValueLink(inputProps); - return inputProps.valueLink.requestChange(event.target.value); - } else if (inputProps.checkedLink) { - _assertCheckedLink(inputProps); - return inputProps.checkedLink.requestChange(event.target.checked); - } else if (inputProps.onChange) { - return inputProps.onChange.call(undefined, event); + processUpdates: function (parentNode, updates) { + if (process.env.NODE_ENV !== 'production') { + var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; } - } -}; + + for (var k = 0; k < updates.length; k++) { + var update = updates[k]; + switch (update.type) { + case 'INSERT_MARKUP': + insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'insert child', + payload: { + toIndex: update.toIndex, + content: update.content.toString() + } + }); + } + break; + case 'MOVE_EXISTING': + moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'move child', + payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } + }); + } + break; + case 'SET_MARKUP': + setInnerHTML(parentNode, update.content); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace children', + payload: update.content.toString() + }); + } + break; + case 'TEXT_CONTENT': + setTextContent(parentNode, update.content); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace text', + payload: update.content.toString() + }); + } + break; + case 'REMOVE_NODE': + removeChild(parentNode, update.fromNode); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'remove child', + payload: { fromIndex: update.fromIndex } + }); + } + break; + } + } + } +}; + +module.exports = DOMChildrenOperations; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var DOMNamespaces = { + html: 'http://www.w3.org/1999/xhtml', + mathml: 'http://www.w3.org/1998/Math/MathML', + svg: 'http://www.w3.org/2000/svg' +}; + +module.exports = DOMNamespaces; + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var _prodInvariant = __webpack_require__(5); + +var ReactErrorUtils = __webpack_require__(147); + +var invariant = __webpack_require__(3); +var warning = __webpack_require__(4); + +/** + * Injected dependencies: + */ + +/** + * - `ComponentTree`: [required] Module that can convert between React instances + * and actual node references. + */ +var ComponentTree; +var TreeTraversal; +var injection = { + injectComponentTree: function (Injected) { + ComponentTree = Injected; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; + } + }, + injectTreeTraversal: function (Injected) { + TreeTraversal = Injected; + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; + } + } +}; + +function isEndish(topLevelType) { + return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; +} + +function isMoveish(topLevelType) { + return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; +} +function isStartish(topLevelType) { + return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; +} + +var validateEventDispatches; +if (process.env.NODE_ENV !== 'production') { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + + process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; + }; +} + +/** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {boolean} simulated If the event is simulated (changes exn behavior) + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ +function executeDispatch(event, simulated, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); + if (simulated) { + ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); + } else { + ReactErrorUtils.invokeGuardedCallback(type, listener, event); + } + event.currentTarget = null; +} + +/** + * Standard/simple iteration through an event's collected dispatches. + */ +function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and Instances are two parallel arrays that are always in sync. + executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, simulated, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; +} + +/** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return {?string} id of the first dispatch execution who's listener returns + * true, or null if no listener returned true. + */ +function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and Instances are two parallel arrays that are always in sync. + if (dispatchListeners[i](event, dispatchInstances[i])) { + return dispatchInstances[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchInstances)) { + return dispatchInstances; + } + } + return null; +} + +/** + * @see executeDispatchesInOrderStopAtTrueImpl + */ +function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchInstances = null; + event._dispatchListeners = null; + return ret; +} + +/** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ +function executeDirectDispatch(event) { + if (process.env.NODE_ENV !== 'production') { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchInstance = event._dispatchInstances; + !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; + event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return res; +} + +/** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ +function hasDispatches(event) { + return !!event._dispatchListeners; +} + +/** + * General utilities that are useful in creating custom Event Plugins. + */ +var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + + getInstanceFromNode: function (node) { + return ComponentTree.getInstanceFromNode(node); + }, + getNodeFromInstance: function (node) { + return ComponentTree.getNodeFromInstance(node); + }, + isAncestor: function (a, b) { + return TreeTraversal.isAncestor(a, b); + }, + getLowestCommonAncestor: function (a, b) { + return TreeTraversal.getLowestCommonAncestor(a, b); + }, + getParentInstance: function (inst) { + return TreeTraversal.getParentInstance(inst); + }, + traverseTwoPhase: function (target, fn, arg) { + return TreeTraversal.traverseTwoPhase(target, fn, arg); + }, + traverseEnterLeave: function (from, to, fn, argFrom, argTo) { + return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); + }, + + injection: injection +}; + +module.exports = EventPluginUtils; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + + + +/** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +/** + * Unescape and unwrap key for human-readable display + * + * @param {string} key to unescape. + * @return {string} the unescaped key. + */ +function unescape(key) { + var unescapeRegex = /(=0|=2)/g; + var unescaperLookup = { + '=0': '=', + '=2': ':' + }; + var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); + + return ('' + keySubstring).replace(unescapeRegex, function (match) { + return unescaperLookup[match]; + }); +} + +var KeyEscapeUtils = { + escape: escape, + unescape: unescape +}; + +module.exports = KeyEscapeUtils; + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var _prodInvariant = __webpack_require__(5); + +var ReactPropTypesSecret = __webpack_require__(224); +var propTypesFactory = __webpack_require__(211); + +var React = __webpack_require__(52); +var PropTypes = propTypesFactory(React.isValidElement); + +var invariant = __webpack_require__(3); +var warning = __webpack_require__(4); + +var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true +}; + +function _assertSingleLink(inputProps) { + !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0; +} +function _assertValueLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0; +} + +function _assertCheckedLink(inputProps) { + _assertSingleLink(inputProps); + !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0; +} + +var propTypes = { + value: function (props, propName, componentName) { + if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (!props[propName] || props.onChange || props.readOnly || props.disabled) { + return null; + } + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + onChange: PropTypes.func +}; + +var loggedTypeFailures = {}; +function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +/** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ +var LinkedValueUtils = { + checkPropTypes: function (tagName, props, owner) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var addendum = getDeclarationErrorAddendum(owner); + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0; + } + } + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current value of the input either from value prop or link. + */ + getValue: function (inputProps) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.value; + } + return inputProps.value; + }, + + /** + * @param {object} inputProps Props for form component + * @return {*} current checked status of the input either from checked prop + * or link. + */ + getChecked: function (inputProps) { + if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.value; + } + return inputProps.checked; + }, + + /** + * @param {object} inputProps Props for form component + * @param {SyntheticEvent} event change event to handle + */ + executeOnChange: function (inputProps, event) { + if (inputProps.valueLink) { + _assertValueLink(inputProps); + return inputProps.valueLink.requestChange(event.target.value); + } else if (inputProps.checkedLink) { + _assertCheckedLink(inputProps); + return inputProps.checkedLink.requestChange(event.target.checked); + } else if (inputProps.onChange) { + return inputProps.onChange.call(undefined, event); + } + } +}; module.exports = LinkedValueUtils; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 102 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8879,14 +13567,13 @@ module.exports = LinkedValueUtils; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var invariant = __webpack_require__(1); +var invariant = __webpack_require__(3); var injected = false; var ReactComponentEnvironment = { - /** * Optionally injectable hook for swapping out mount images in the middle of * the tree. @@ -8907,14 +13594,13 @@ var ReactComponentEnvironment = { injected = true; } } - }; module.exports = ReactComponentEnvironment; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 103 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8996,7 +13682,7 @@ module.exports = ReactErrorUtils; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 104 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9012,15 +13698,15 @@ module.exports = ReactErrorUtils; -var _prodInvariant = __webpack_require__(3); +var _prodInvariant = __webpack_require__(5); -var ReactCurrentOwner = __webpack_require__(20); -var ReactInstanceMap = __webpack_require__(51); -var ReactInstrumentation = __webpack_require__(16); -var ReactUpdates = __webpack_require__(19); +var ReactCurrentOwner = __webpack_require__(30); +var ReactInstanceMap = __webpack_require__(64); +var ReactInstrumentation = __webpack_require__(26); +var ReactUpdates = __webpack_require__(29); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); +var invariant = __webpack_require__(3); +var warning = __webpack_require__(4); function enqueueUpdate(internalInstance) { ReactUpdates.enqueueUpdate(internalInstance); @@ -9053,7 +13739,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { } if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + "within `render` or another component's constructor). Render methods " + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; } return internalInstance; @@ -9064,7 +13750,6 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { * reconciliation step. */ var ReactUpdateQueue = { - /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. @@ -9231,14 +13916,13 @@ var ReactUpdateQueue = { validateCallback: function (callback, callerName) { !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0; } - }; module.exports = ReactUpdateQueue; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 105 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9275,7 +13959,7 @@ var createMicrosoftUnsafeLocalFunction = function (func) { module.exports = createMicrosoftUnsafeLocalFunction; /***/ }), -/* 106 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9330,7 +14014,7 @@ function getEventCharCode(nativeEvent) { module.exports = getEventCharCode; /***/ }), -/* 107 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9352,10 +14036,10 @@ module.exports = getEventCharCode; */ var modifierKeyToProp = { - 'Alt': 'altKey', - 'Control': 'ctrlKey', - 'Meta': 'metaKey', - 'Shift': 'shiftKey' + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' }; // IE8 does not implement getModifierState so we simply map it to the only @@ -9378,7 +14062,7 @@ function getEventModifierState(nativeEvent) { module.exports = getEventModifierState; /***/ }), -/* 108 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9418,7 +14102,7 @@ function getEventTarget(nativeEvent) { module.exports = getEventTarget; /***/ }), -/* 109 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9434,7 +14118,7 @@ module.exports = getEventTarget; -var ExecutionEnvironment = __webpack_require__(8); +var ExecutionEnvironment = __webpack_require__(13); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -9483,7 +14167,7 @@ function isEventSupported(eventNameSuffix, capture) { module.exports = isEventSupported; /***/ }), -/* 110 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9530,7 +14214,7 @@ function shouldUpdateReactComponent(prevElement, nextElement) { module.exports = shouldUpdateReactComponent; /***/ }), -/* 111 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9546,10 +14230,10 @@ module.exports = shouldUpdateReactComponent; -var _assign = __webpack_require__(5); +var _assign = __webpack_require__(9); -var emptyFunction = __webpack_require__(17); -var warning = __webpack_require__(2); +var emptyFunction = __webpack_require__(25); +var warning = __webpack_require__(4); var validateDOMNesting = emptyFunction; @@ -9657,7 +14341,6 @@ if (process.env.NODE_ENV !== 'production') { // but case 'option': return tag === '#text'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption // No special behavior since these rules fall back to "in body" mode for @@ -9666,25 +14349,20 @@ if (process.env.NODE_ENV !== 'production') { // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr case 'tr': return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody case 'tbody': case 'thead': case 'tfoot': return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup case 'colgroup': return tag === 'col' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable case 'table': return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead case 'head': return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element case 'html': return tag === 'head' || tag === 'body'; @@ -9880,7 +14558,7 @@ if (process.env.NODE_ENV !== 'production') { tagDisplayName = 'Text nodes'; } else { tagDisplayName = 'Whitespace text nodes'; - whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.'; + whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; } } else { tagDisplayName = '<' + childTag + '>'; @@ -9913,12 +14591,12 @@ module.exports = validateDOMNesting; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 112 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. + * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the @@ -9929,217 +14607,62 @@ module.exports = validateDOMNesting; -var _prodInvariant = __webpack_require__(32); - -var ReactNoopUpdateQueue = __webpack_require__(113); - -var canDefineProperty = __webpack_require__(70); -var emptyObject = __webpack_require__(40); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -ReactComponent.prototype.isReactComponent = {}; - /** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. */ -ReactComponent.prototype.setState = function (partialState, callback) { - !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; - this.updater.enqueueSetState(this, partialState); - if (callback) { - this.updater.enqueueCallback(this, callback, 'setState'); - } -}; -/** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ -ReactComponent.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this); - if (callback) { - this.updater.enqueueCallback(this, callback, 'forceUpdate'); - } -}; +var lowPriorityWarning = function () {}; -/** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ if (process.env.NODE_ENV !== 'production') { - var deprecatedAPIs = { - isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], - replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] - }; - var defineDeprecationWarning = function (methodName, info) { - if (canDefineProperty) { - Object.defineProperty(ReactComponent.prototype, methodName, { - get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; - return undefined; - } - }); - } - }; - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - } -} - -module.exports = ReactComponent; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 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. - * - */ - + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; -var warning = __webpack_require__(2); + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } -function warnNoop(publicInstance, callerName) { - if (process.env.NODE_ENV !== 'production') { - var constructor = publicInstance.constructor; - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; - } + printWarning.apply(undefined, [format].concat(args)); + } + }; } -/** - * This is the abstract API for an update queue. - */ -var ReactNoopUpdateQueue = { - - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function (publicInstance) { - return false; - }, - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @internal - */ - enqueueCallback: function (publicInstance, callback) {}, - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @internal - */ - enqueueForceUpdate: function (publicInstance) { - warnNoop(publicInstance, 'forceUpdate'); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState) { - warnNoop(publicInstance, 'replaceState'); - }, - - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @internal - */ - enqueueSetState: function (publicInstance, partialState) { - warnNoop(publicInstance, 'setState'); - } -}; - -module.exports = ReactNoopUpdateQueue; +module.exports = lowPriorityWarning; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 114 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10152,7 +14675,7 @@ module.exports = ReactNoopUpdateQueue; * A simple strongly-typed pub/sub/fire eventing system. */ -var _ = __webpack_require__(115); +var _ = __webpack_require__(158); var SubscriptionToken = (function () { function SubscriptionToken(_event, _callback) { this._event = _event; @@ -10202,7 +14725,7 @@ exports.SubscribableEvent = SubscribableEvent; /***/ }), -/* 115 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10215,18 +14738,18 @@ exports.SubscribableEvent = SubscribableEvent; * Imports a subset of lodash library needed for ReactXP's implementation. */ -var clone = __webpack_require__(158); +var clone = __webpack_require__(46); exports.clone = clone; -var filter = __webpack_require__(159); +var filter = __webpack_require__(47); exports.filter = filter; -var pull = __webpack_require__(354); +var pull = __webpack_require__(134); exports.pull = pull; -var sortBy = __webpack_require__(357); +var sortBy = __webpack_require__(136); exports.sortBy = sortBy; /***/ }), -/* 116 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10239,9 +14762,9 @@ exports.sortBy = sortBy; * Manages the layering of the main view, modals and popups. */ -var React = __webpack_require__(6); -var ReactDOM = __webpack_require__(11); -var RootView_1 = __webpack_require__(477); +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var RootView_1 = __webpack_require__(528); var FrontLayerViewManager = (function () { function FrontLayerViewManager() { var _this = this; @@ -10255,7 +14778,7 @@ var FrontLayerViewManager = (function () { this._popupShowDelayTimer = null; this._shouldPopupBeDismissed = function (options) { return _this._activePopupOptions && - _this._activePopupOptions.getAnchor() == options.getAnchor(); + _this._activePopupOptions.getAnchor() === options.getAnchor(); }; } FrontLayerViewManager.prototype.setMainView = function (element) { @@ -10287,7 +14810,8 @@ var FrontLayerViewManager = (function () { } }; FrontLayerViewManager.prototype.showPopup = function (options, popupId, showDelay) { - // If options.dismissIfShown is true, calling this methos will behave like a toggle. On one call, it will open the popup. If it is called when pop up is seen, it will dismiss the popup. + // If options.dismissIfShown is true, calling this methos will behave like a toggle. On one call, it will open the popup. + // If it is called when pop up is seen, it will dismiss the popup. // If options.dismissIfShown is false, we will simply show the popup always. if (options.dismissIfShown) { if (this._shouldPopupBeDismissed(options)) { @@ -10367,7 +14891,7 @@ exports.default = new FrontLayerViewManager(); /***/ }), -/* 117 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10385,11 +14909,11 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var _ = __webpack_require__(9); -var ReactDOM = __webpack_require__(11); -var RX = __webpack_require__(4); -var SyncTasks = __webpack_require__(33); -var Types = __webpack_require__(14); +var _ = __webpack_require__(14); +var ReactDOM = __webpack_require__(2); +var RX = __webpack_require__(6); +var SyncTasks = __webpack_require__(11); +var Types = __webpack_require__(19); // We create a periodic timer to detect layout changes that are performed behind // our back by the browser's layout engine. We do this more aggressively when // the app is known to be active and in the foreground. @@ -10591,3630 +15115,3423 @@ exports.default = ViewBase; /***/ }), -/* 118 */ -/***/ (function(module, exports) { +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/** +* SubscribableEvent.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* A simple strongly-typed pub/sub/fire eventing system. +*/ + +var _ = __webpack_require__(162); +var SubscriptionToken = (function () { + function SubscriptionToken(_event, _callback) { + this._event = _event; + this._callback = _callback; + } + SubscriptionToken.prototype.unsubscribe = function () { + this._event.unsubscribe(this._callback); + }; + return SubscriptionToken; +}()); +exports.SubscriptionToken = SubscriptionToken; +var SubscribableEvent = (function () { + function SubscribableEvent() { + var _this = this; + this.fire = (function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // Clone the array so original can be modified by handlers. + var subs = _.clone(_this._subscribers); + // Execute handlers in the reverse order in which they + // were registered. + for (var i = subs.length - 1; i >= 0; i--) { + if (subs[i].apply(null, args)) { + // If the value was handled, early out. + return true; + } + } + return false; + }); + this._subscribers = []; + } + SubscribableEvent.prototype.dispose = function () { + this._subscribers = []; + }; + SubscribableEvent.prototype.subscribe = function (callback) { + this._subscribers.push(callback); + return new SubscriptionToken(this, callback); + }; + SubscribableEvent.prototype.unsubscribe = function (callback) { + _.pull(this._subscribers, callback); + }; + return SubscribableEvent; +}()); +exports.SubscribableEvent = SubscribableEvent; /***/ }), -/* 119 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +/** +* lodashMini.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Imports a subset of lodash library needed for ReactXP's implementation. +*/ - -// Export web by default. Other platforms have custom index.[platform].js files -module.exports = __webpack_require__(476); +var clone = __webpack_require__(46); +exports.clone = clone; +var filter = __webpack_require__(47); +exports.filter = filter; +var pull = __webpack_require__(134); +exports.pull = pull; +var sortBy = __webpack_require__(136); +exports.sortBy = sortBy; /***/ }), -/* 120 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js -// original notice: - -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -function compare(a, b) { - if (a === b) { - return 0; - } - - var x = a.length; - var y = b.length; +/** +* FrontLayerViewManager.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Manages the layering of the main view, modals and popups. +*/ - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break; +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var RootView_1 = __webpack_require__(570); +var FrontLayerViewManager = (function () { + function FrontLayerViewManager() { + var _this = this; + this._mainView = null; + this._modalStack = []; + this._activePopupOptions = null; + this._activePopupId = null; + this._activePopupAutoDismiss = false; + this._activePopupAutoDismissDelay = 0; + this._activePopupShowDelay = 0; + this._popupShowDelayTimer = null; + this._shouldPopupBeDismissed = function (options) { + return _this._activePopupOptions && + _this._activePopupOptions.getAnchor() === options.getAnchor(); + }; } - } + FrontLayerViewManager.prototype.setMainView = function (element) { + this._mainView = element; + this._renderRootView(); + }; + FrontLayerViewManager.prototype.isModalDisplayed = function (modalId) { + return this._modalStack.some(function (d) { return d.id === modalId; }); + }; + FrontLayerViewManager.prototype.showModal = function (modal, modalId) { + if (!modalId) { + console.error('modal must have valid ID'); + } + // Dismiss any active popups. + if (this._activePopupOptions) { + this.dismissPopup(this._activePopupId); + } + this._modalStack.push({ modal: modal, id: modalId }); + this._renderRootView(); + }; + FrontLayerViewManager.prototype.dismissModal = function (modalId) { + this._modalStack = this._modalStack.filter(function (d) { return d.id !== modalId; }); + this._renderRootView(); + }; + FrontLayerViewManager.prototype.dismissAllModals = function () { + if (this._modalStack.length > 0) { + this._modalStack = []; + this._renderRootView(); + } + }; + FrontLayerViewManager.prototype.showPopup = function (options, popupId, showDelay) { + // If options.dismissIfShown is true, calling this methos will behave like a toggle. On one call, it will open the popup. + // If it is called when pop up is seen, it will dismiss the popup. + // If options.dismissIfShown is false, we will simply show the popup always. + if (options.dismissIfShown) { + if (this._shouldPopupBeDismissed(options)) { + this.dismissPopup(popupId); + return false; + } + } + this._showPopup(options, popupId, showDelay); + return true; + }; + FrontLayerViewManager.prototype._showPopup = function (options, popupId, showDelay) { + var _this = this; + if (this._activePopupOptions) { + if (this._activePopupOptions.onDismiss) { + this._activePopupOptions.onDismiss(); + } + } + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupOptions = options; + this._activePopupId = popupId; + this._activePopupAutoDismiss = false; + this._activePopupAutoDismissDelay = 0; + this._activePopupShowDelay = showDelay || 0; + this._renderRootView(); + if (this._activePopupShowDelay > 0) { + this._popupShowDelayTimer = window.setTimeout(function () { + _this._activePopupShowDelay = 0; + _this._popupShowDelayTimer = null; + _this._renderRootView(); + }, this._activePopupShowDelay); + } + }; + FrontLayerViewManager.prototype.autoDismissPopup = function (popupId, dismissDelay) { + if (popupId === this._activePopupId && this._activePopupOptions) { + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupAutoDismiss = true; + this._activePopupAutoDismissDelay = dismissDelay || 0; + this._renderRootView(); + } + }; + FrontLayerViewManager.prototype.dismissPopup = function (popupId) { + if (popupId === this._activePopupId && this._activePopupOptions) { + if (this._activePopupOptions.onDismiss) { + this._activePopupOptions.onDismiss(); + } + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupOptions = null; + this._activePopupId = null; + this._renderRootView(); + } + }; + FrontLayerViewManager.prototype.dismissAllPopups = function () { + this.dismissPopup(this._activePopupId); + }; + FrontLayerViewManager.prototype._renderRootView = function () { + var _this = this; + var topModal = this._modalStack.length > 0 ? + this._modalStack[this._modalStack.length - 1].modal : null; + var rootView = (React.createElement(RootView_1.RootView, { mainView: this._mainView, keyBoardFocusOutline: this._mainView.props.keyBoardFocusOutline, mouseFocusOutline: this._mainView.props.mouseFocusOutline, modal: topModal, activePopupOptions: this._activePopupShowDelay > 0 ? null : this._activePopupOptions, autoDismiss: this._activePopupAutoDismiss, autoDismissDelay: this._activePopupAutoDismissDelay, onDismissPopup: function () { return _this.dismissPopup(_this._activePopupId); } })); + var container = document.getElementsByClassName('app-container')[0]; + ReactDOM.render(rootView, container); + }; + return FrontLayerViewManager; +}()); +exports.FrontLayerViewManager = FrontLayerViewManager; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new FrontLayerViewManager(); - if (x < y) { - return -1; - } - if (y < x) { - return 1; - } - return 0; -} -function isBuffer(b) { - if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { - return global.Buffer.isBuffer(b); - } - return !!(b != null && b._isBuffer); -} -// based on node assert, original notice: +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// -// Originally from narwhal.js (http://narwhaljs.org) -// Copyright (c) 2009 Thomas Robinson <280north.com> -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -var util = __webpack_require__(491); -var hasOwn = Object.prototype.hasOwnProperty; -var pSlice = Array.prototype.slice; -var functionsHaveNames = (function () { - return function foo() {}.name === 'foo'; -}()); -function pToString (obj) { - return Object.prototype.toString.call(obj); -} -function isView(arrbuf) { - if (isBuffer(arrbuf)) { - return false; - } - if (typeof global.ArrayBuffer !== 'function') { - return false; - } - if (typeof ArrayBuffer.isView === 'function') { - return ArrayBuffer.isView(arrbuf); - } - if (!arrbuf) { - return false; - } - if (arrbuf instanceof DataView) { - return true; - } - if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { - return true; - } - return false; -} -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -var regex = /\s*function\s+([^\(\s]*)\s*/; -// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js -function getName(func) { - if (!util.isFunction(func)) { - return; - } - if (functionsHaveNames) { - return func.name; - } - var str = func.toString(); - var match = str.match(regex); - return match && match[1]; -} -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - if (options.message) { - this.message = options.message; - this.generatedMessage = false; - } else { - this.message = getMessage(this); - this.generatedMessage = true; - } - var stackStartFunction = options.stackStartFunction || fail; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } else { - // non v8 browsers so we can have a stacktrace - var err = new Error(); - if (err.stack) { - var out = err.stack; - - // try to strip useless frames - var fn_name = getName(stackStartFunction); - var idx = out.indexOf('\n' + fn_name); - if (idx >= 0) { - // once we have located the function frame - // we need to strip out everything before it (and its line) - var next_line = out.indexOf('\n', idx + 1); - out = out.substring(next_line + 1); - } +"use strict"; +/** +* ViewBase.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* A base class for the Web-specific implementation of the cross-platform View abstraction. +*/ - this.stack = out; - } - } +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; +var _ = __webpack_require__(15); +var ReactDOM = __webpack_require__(2); +var RX = __webpack_require__(7); +var SyncTasks = __webpack_require__(11); +var Types = __webpack_require__(21); +// We create a periodic timer to detect layout changes that are performed behind +// our back by the browser's layout engine. We do this more aggressively when +// the app is known to be active and in the foreground. +var _layoutTimerActiveDuration = 1000; +var _layoutTimerInactiveDuration = 10000; +var ViewBase = (function (_super) { + __extends(ViewBase, _super); + function ViewBase() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._isMounted = false; + _this._lastX = 0; + _this._lastY = 0; + _this._lastWidth = 0; + _this._lastHeight = 0; + return _this; + } + ViewBase.prototype._getContainer = function () { + // Perf: Don't prefetch this since we might never need it + var containerRef = this._getContainerRef(); + if (!this._container && containerRef) { + this._container = ReactDOM.findDOMNode(containerRef); + } + return this._container; + }; + // Sets the activation state so we can stop our periodic timer + // when the app is in the background. + ViewBase.setActivationState = function (newState) { + if (ViewBase._appActivationState !== newState) { + ViewBase._appActivationState = newState; + // Cancel any existing timers. + if (ViewBase._viewCheckingTimer) { + window.clearInterval(ViewBase._viewCheckingTimer); + ViewBase._viewCheckingTimer = null; + } + if (ViewBase._viewCheckingList.length > 0) { + // If we're becoming active, check and report layout changes immediately. + if (newState === Types.AppActivationState.Active) { + ViewBase._checkViews(); + } + ViewBase._viewCheckingTimer = setInterval(ViewBase._checkViews, newState === Types.AppActivationState.Active ? + _layoutTimerActiveDuration : _layoutTimerInactiveDuration); + } + } + }; + ViewBase.prototype.componentWillReceiveProps = function (nextProps) { + if (!!this.props.onLayout !== !!nextProps.onLayout) { + if (this.props.onLayout) { + this._checkViewCheckerUnbuild(); + } + if (nextProps.onLayout) { + this._checkViewCheckerBuild(); + } + } + }; + ViewBase._checkViews = function () { + _.each(ViewBase._viewCheckingList, function (view) { + view._checkAndReportLayout(); + }); + }; + ViewBase._reportLayoutChange = function (func) { + this._layoutReportList.push(func); + if (!ViewBase._layoutReportingTimer) { + ViewBase._layoutReportingTimer = window.setTimeout(function () { + ViewBase._layoutReportingTimer = null; + ViewBase._reportDeferredLayoutChanges(); + }, 0); + } + }; + ViewBase._reportDeferredLayoutChanges = function () { + var reportList = this._layoutReportList; + this._layoutReportList = []; + _.each(reportList, function (func) { + try { + func(); + } + catch (e) { + console.error('Caught exception on onLayout response: ', e); + } + }); + }; + // Returns a promise to indicate when firing of onLayout event has completed (if any) + ViewBase.prototype._checkAndReportLayout = function () { + var _this = this; + if (!this._isMounted) { + return SyncTasks.Resolved(); + } + var container = this._getContainer(); + if (!container) { + return SyncTasks.Resolved(); + } + var newX = container.offsetLeft; + var newY = container.offsetTop; + var marginTop = !container.style.marginTop ? 0 : parseInt(container.style.marginTop, 10) || 0; + var marginBottom = !container.style.marginBottom ? 0 : parseInt(container.style.marginBottom, 10) || 0; + var marginRight = !container.style.marginRight ? 0 : parseInt(container.style.marginRight, 10) || 0; + var marginLeft = !container.style.marginLeft ? 0 : parseInt(container.style.marginLeft, 10) || 0; + var newWidth = container.offsetWidth + marginRight + marginLeft; + var newHeight = container.offsetHeight + marginTop + marginBottom; + if (this._lastX !== newX || this._lastY !== newY || this._lastWidth !== newWidth || this._lastHeight !== newHeight) { + this._lastX = newX; + this._lastY = newY; + this._lastWidth = newWidth; + this._lastHeight = newHeight; + var deferred_1 = SyncTasks.Defer(); + ViewBase._reportLayoutChange(function () { + if (!_this._isMounted || !_this.props.onLayout) { + deferred_1.resolve(); + return; + } + _this.props.onLayout({ + x: newX, + y: newY, + width: _this._lastWidth, + height: _this._lastHeight + }); + deferred_1.resolve(); + }); + return deferred_1.promise(); + } + return SyncTasks.Resolved(); + }; + ViewBase.prototype._checkViewCheckerBuild = function () { + // Enable the timer to check for layout changes. Use a different duration + // when the app is active versus inactive. + if (!ViewBase._viewCheckingTimer) { + ViewBase._viewCheckingTimer = setInterval(ViewBase._checkViews, ViewBase._appActivationState === Types.AppActivationState.Active ? + _layoutTimerActiveDuration : _layoutTimerInactiveDuration); + } + if (!ViewBase._isResizeHandlerInstalled) { + window.addEventListener('resize', ViewBase._onResize); + ViewBase._isResizeHandlerInstalled = true; + } + ViewBase._viewCheckingList.push(this); + }; + ViewBase.prototype._checkViewCheckerUnbuild = function () { + var _this = this; + ViewBase._viewCheckingList = _.filter(ViewBase._viewCheckingList, function (v) { return v !== _this; }); + if (ViewBase._viewCheckingList.length === 0) { + if (ViewBase._viewCheckingTimer) { + clearInterval(ViewBase._viewCheckingTimer); + ViewBase._viewCheckingTimer = null; + } + if (ViewBase._isResizeHandlerInstalled) { + window.removeEventListener('resize', ViewBase._onResize); + ViewBase._isResizeHandlerInstalled = false; + } + } + }; + ViewBase.prototype.componentDidMount = function () { + this._isMounted = true; + if (this.props.onLayout) { + this._checkViewCheckerBuild(); + } + // Chain through to the same render-checking code + this.componentDidUpdate(); + }; + ViewBase.prototype.componentDidUpdate = function () { + if (this.props.onLayout) { + this._checkAndReportLayout(); + } + }; + ViewBase._onResize = function () { + // Often views change size in response to an overall window resize. Rather than + // wait for the next timer to fire, do it immediately. + ViewBase._checkViews(); + }; + ViewBase.prototype.componentWillUnmount = function () { + this._isMounted = false; + // Don't retain a reference to a DOM object. This can cause memory leaks + // because the GC may not be able to clean them up. + this._container = null; + if (this.props.onLayout) { + this._checkViewCheckerUnbuild(); + } + }; + ViewBase.prototype.blur = function () { + var el = ReactDOM.findDOMNode(this); + if (el) { + el.blur(); + } + }; + ViewBase.prototype.focus = function () { + var el = ReactDOM.findDOMNode(this); + if (el) { + el.focus(); + } + }; + return ViewBase; +}(RX.ViewBase)); +ViewBase._viewCheckingTimer = null; +ViewBase._isResizeHandlerInstalled = false; +ViewBase._viewCheckingList = []; +ViewBase._appActivationState = Types.AppActivationState.Active; +ViewBase._layoutReportList = []; +ViewBase._layoutReportingTimer = null; +exports.ViewBase = ViewBase; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ViewBase; -// assert.AssertionError instanceof Error -util.inherits(assert.AssertionError, Error); - -function truncate(s, n) { - if (typeof s === 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} -function inspect(something) { - if (functionsHaveNames || !util.isFunction(something)) { - return util.inspect(something); - } - var rawname = getName(something); - var name = rawname ? ': ' + rawname : ''; - return '[Function' + name + ']'; -} -function getMessage(self) { - return truncate(inspect(self.actual), 128) + ' ' + - self.operator + ' ' + - truncate(inspect(self.expected), 128); -} - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, !!guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); +"use strict"; +/** +* SubscribableEvent.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* A simple strongly-typed pub/sub/fire eventing system. +*/ -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; +var _ = __webpack_require__(166); +var SubscriptionToken = (function () { + function SubscriptionToken(_event, _callback) { + this._event = _event; + this._callback = _callback; + } + SubscriptionToken.prototype.unsubscribe = function () { + this._event.unsubscribe(this._callback); + }; + return SubscriptionToken; +}()); +exports.SubscriptionToken = SubscriptionToken; +var SubscribableEvent = (function () { + function SubscribableEvent() { + var _this = this; + this.fire = (function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // Clone the array so original can be modified by handlers. + var subs = _.clone(_this._subscribers); + // Execute handlers in the reverse order in which they + // were registered. + for (var i = subs.length - 1; i >= 0; i--) { + if (subs[i].apply(null, args)) { + // If the value was handled, early out. + return true; + } + } + return false; + }); + this._subscribers = []; + } + SubscribableEvent.prototype.dispose = function () { + this._subscribers = []; + }; + SubscribableEvent.prototype.subscribe = function (callback) { + this._subscribers.push(callback); + return new SubscriptionToken(this, callback); + }; + SubscribableEvent.prototype.unsubscribe = function (callback) { + _.pull(this._subscribers, callback); + }; + return SubscribableEvent; +}()); +exports.SubscribableEvent = SubscribableEvent; -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected, false)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { -assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { - if (!_deepEqual(actual, expected, true)) { - fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); - } -}; +"use strict"; +/** +* lodashMini.ts +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Imports a subset of lodash library needed for ReactXP's implementation. +*/ -function _deepEqual(actual, expected, strict, memos) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - } else if (isBuffer(actual) && isBuffer(expected)) { - return compare(actual, expected) === 0; +var clone = __webpack_require__(46); +exports.clone = clone; +var filter = __webpack_require__(47); +exports.filter = filter; +var pull = __webpack_require__(134); +exports.pull = pull; +var sortBy = __webpack_require__(136); +exports.sortBy = sortBy; - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (util.isDate(actual) && util.isDate(expected)) { - return actual.getTime() === expected.getTime(); - // 7.3 If the expected value is a RegExp object, the actual value is - // equivalent if it is also a RegExp object with the same source and - // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). - } else if (util.isRegExp(actual) && util.isRegExp(expected)) { - return actual.source === expected.source && - actual.global === expected.global && - actual.multiline === expected.multiline && - actual.lastIndex === expected.lastIndex && - actual.ignoreCase === expected.ignoreCase; +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { - // 7.4. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if ((actual === null || typeof actual !== 'object') && - (expected === null || typeof expected !== 'object')) { - return strict ? actual === expected : actual == expected; +"use strict"; +/** +* FrontLayerViewManager.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* Manages the layering of the main view, modals and popups. +*/ - // If both values are instances of typed arrays, wrap their underlying - // ArrayBuffers in a Buffer each to increase performance - // This optimization requires the arrays to have the same type as checked by - // Object.prototype.toString (aka pToString). Never perform binary - // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their - // bit patterns are not identical. - } else if (isView(actual) && isView(expected) && - pToString(actual) === pToString(expected) && - !(actual instanceof Float32Array || - actual instanceof Float64Array)) { - return compare(new Uint8Array(actual.buffer), - new Uint8Array(expected.buffer)) === 0; - - // 7.5 For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else if (isBuffer(actual) !== isBuffer(expected)) { - return false; - } else { - memos = memos || {actual: [], expected: []}; - - var actualIndex = memos.actual.indexOf(actual); - if (actualIndex !== -1) { - if (actualIndex === memos.expected.indexOf(expected)) { - return true; - } - } - - memos.actual.push(actual); - memos.expected.push(expected); - - return objEquiv(actual, expected, strict, memos); - } -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b, strict, actualVisitedObjects) { - if (a === null || a === undefined || b === null || b === undefined) - return false; - // if one is a primitive, the other must be same - if (util.isPrimitive(a) || util.isPrimitive(b)) - return a === b; - if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) - return false; - var aIsArgs = isArguments(a); - var bIsArgs = isArguments(b); - if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) - return false; - if (aIsArgs) { - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b, strict); - } - var ka = objectKeys(a); - var kb = objectKeys(b); - var key, i; - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length !== kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] !== kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) - return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected, false)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -assert.notDeepStrictEqual = notDeepStrictEqual; -function notDeepStrictEqual(actual, expected, message) { - if (_deepEqual(actual, expected, true)) { - fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); - } -} - - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (Object.prototype.toString.call(expected) == '[object RegExp]') { - return expected.test(actual); - } - - try { - if (actual instanceof expected) { - return true; +var React = __webpack_require__(1); +var ReactDOM = __webpack_require__(2); +var RootView_1 = __webpack_require__(606); +var FrontLayerViewManager = (function () { + function FrontLayerViewManager() { + var _this = this; + this._mainView = null; + this._modalStack = []; + this._activePopupOptions = null; + this._activePopupId = null; + this._activePopupAutoDismiss = false; + this._activePopupAutoDismissDelay = 0; + this._activePopupShowDelay = 0; + this._popupShowDelayTimer = null; + this._shouldPopupBeDismissed = function (options) { + return _this._activePopupOptions && + _this._activePopupOptions.getAnchor() === options.getAnchor(); + }; } - } catch (e) { - // Ignore. The instanceof check doesn't work for arrow functions. - } - - if (Error.isPrototypeOf(expected)) { - return false; - } - - return expected.call({}, actual) === true; -} - -function _tryBlock(block) { - var error; - try { - block(); - } catch (e) { - error = e; - } - return error; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof block !== 'function') { - throw new TypeError('"block" argument must be a function'); - } - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - actual = _tryBlock(block); - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail(actual, expected, 'Missing expected exception' + message); - } - - var userProvidedMessage = typeof message === 'string'; - var isUnwantedException = !shouldThrow && util.isError(actual); - var isUnexpectedException = !shouldThrow && actual && !expected; - - if ((isUnwantedException && - userProvidedMessage && - expectedException(actual, expected)) || - isUnexpectedException) { - fail(actual, expected, 'Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws(true, block, error, message); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws(false, block, error, message); -}; - -assert.ifError = function(err) { if (err) throw err; }; - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - if (hasOwn.call(obj, key)) keys.push(key); - } - return keys; -}; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73))) - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @typechecks - */ - -var emptyFunction = __webpack_require__(17); - -/** - * Upstream version of event listener. Does not take into account specific - * nature of platform. - */ -var EventListener = { - /** - * Listen to DOM events during the bubble phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - listen: function listen(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, false); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, false); + FrontLayerViewManager.prototype.setMainView = function (element) { + this._mainView = element; + this._renderRootView(); + }; + FrontLayerViewManager.prototype.isModalDisplayed = function (modalId) { + return this._modalStack.some(function (d) { return d.id === modalId; }); + }; + FrontLayerViewManager.prototype.showModal = function (modal, modalId) { + if (!modalId) { + console.error('modal must have valid ID'); } - }; - } else if (target.attachEvent) { - target.attachEvent('on' + eventType, callback); - return { - remove: function remove() { - target.detachEvent('on' + eventType, callback); + // Dismiss any active popups. + if (this._activePopupOptions) { + this.dismissPopup(this._activePopupId); } - }; - } - }, - - /** - * Listen to DOM events during the capture phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - capture: function capture(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, true); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, true); + this._modalStack.push({ modal: modal, id: modalId }); + this._renderRootView(); + }; + FrontLayerViewManager.prototype.dismissModal = function (modalId) { + this._modalStack = this._modalStack.filter(function (d) { return d.id !== modalId; }); + this._renderRootView(); + }; + FrontLayerViewManager.prototype.dismissAllModals = function () { + if (this._modalStack.length > 0) { + this._modalStack = []; + this._renderRootView(); } - }; - } else { - if (process.env.NODE_ENV !== 'production') { - console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); - } - return { - remove: emptyFunction - }; - } - }, - - registerDefault: function registerDefault() {} -}; - -module.exports = EventListener; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - - - -/** - * @param {DOMElement} node input/textarea to focus - */ - -function focusNode(node) { - // IE8 can throw "Can't move focus to the control because it is invisible, - // not enabled, or of a type that does not accept the focus." for all kinds of - // reasons that are too expensive and fragile to test. - try { - node.focus(); - } catch (e) {} -} + }; + FrontLayerViewManager.prototype.showPopup = function (options, popupId, showDelay) { + // If options.dismissIfShown is true, calling this methos will behave like a toggle. On one call, it will open the popup. + // If it is called when pop up is seen, it will dismiss the popup. + // If options.dismissIfShown is false, we will simply show the popup always. + if (options.dismissIfShown) { + if (this._shouldPopupBeDismissed(options)) { + this.dismissPopup(popupId); + return false; + } + } + this._showPopup(options, popupId, showDelay); + return true; + }; + FrontLayerViewManager.prototype._showPopup = function (options, popupId, showDelay) { + var _this = this; + if (this._activePopupOptions) { + if (this._activePopupOptions.onDismiss) { + this._activePopupOptions.onDismiss(); + } + } + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupOptions = options; + this._activePopupId = popupId; + this._activePopupAutoDismiss = false; + this._activePopupAutoDismissDelay = 0; + this._activePopupShowDelay = showDelay || 0; + this._renderRootView(); + if (this._activePopupShowDelay > 0) { + this._popupShowDelayTimer = window.setTimeout(function () { + _this._activePopupShowDelay = 0; + _this._popupShowDelayTimer = null; + _this._renderRootView(); + }, this._activePopupShowDelay); + } + }; + FrontLayerViewManager.prototype.autoDismissPopup = function (popupId, dismissDelay) { + if (popupId === this._activePopupId && this._activePopupOptions) { + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupAutoDismiss = true; + this._activePopupAutoDismissDelay = dismissDelay || 0; + this._renderRootView(); + } + }; + FrontLayerViewManager.prototype.dismissPopup = function (popupId) { + if (popupId === this._activePopupId && this._activePopupOptions) { + if (this._activePopupOptions.onDismiss) { + this._activePopupOptions.onDismiss(); + } + if (this._popupShowDelayTimer) { + clearTimeout(this._popupShowDelayTimer); + this._popupShowDelayTimer = null; + } + this._activePopupOptions = null; + this._activePopupId = null; + this._renderRootView(); + } + }; + FrontLayerViewManager.prototype.dismissAllPopups = function () { + this.dismissPopup(this._activePopupId); + }; + FrontLayerViewManager.prototype._renderRootView = function () { + var _this = this; + var topModal = this._modalStack.length > 0 ? + this._modalStack[this._modalStack.length - 1].modal : null; + var rootView = (React.createElement(RootView_1.RootView, { mainView: this._mainView, keyBoardFocusOutline: this._mainView.props.keyBoardFocusOutline, mouseFocusOutline: this._mainView.props.mouseFocusOutline, modal: topModal, activePopupOptions: this._activePopupShowDelay > 0 ? null : this._activePopupOptions, autoDismiss: this._activePopupAutoDismiss, autoDismissDelay: this._activePopupAutoDismissDelay, onDismissPopup: function () { return _this.dismissPopup(_this._activePopupId); } })); + var container = document.getElementsByClassName('app-container')[0]; + ReactDOM.render(rootView, container); + }; + return FrontLayerViewManager; +}()); +exports.FrontLayerViewManager = FrontLayerViewManager; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = new FrontLayerViewManager(); -module.exports = focusNode; /***/ }), -/* 123 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - */ - -/* eslint-disable fb-www/typeof-undefined */ - /** - * Same as document.activeElement but wraps in a try-catch block. In IE it is - * not safe to call document.activeElement if there is nothing focused. - * - * The activeElement will be null only if the document or document body is not - * yet defined. - * - * @param {?DOMDocument} doc Defaults to current document. - * @return {?DOMElement} - */ -function getActiveElement(doc) /*?DOMElement*/{ - doc = doc || (typeof document !== 'undefined' ? document : undefined); - if (typeof doc === 'undefined') { - return null; - } - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } -} - -module.exports = getActiveElement; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { +* ViewBase.tsx +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT license. +* +* A base class for the Web-specific implementation of the cross-platform View abstraction. +*/ -var __WEBPACK_AMD_DEFINE_RESULT__;(function() { - (function(root, factory) { - if (true) { - return !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { - return factory(); - }.call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - return module.exports = factory(); - } else { - return root.ifvisible = factory(); - } - })(this, function() { - var addEvent, customEvent, doc, fireEvent, hidden, idleStartedTime, idleTime, ie, ifvisible, init, initialized, status, trackIdleStatus, visibilityChange; - ifvisible = {}; - doc = document; - initialized = false; - status = "active"; - idleTime = 60000; - idleStartedTime = false; - customEvent = (function() { - var S4, addCustomEvent, cgid, fireCustomEvent, guid, listeners, removeCustomEvent; - S4 = function() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - }; - guid = function() { - return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); - }; - listeners = {}; - cgid = '__ceGUID'; - addCustomEvent = function(obj, event, callback) { - obj[cgid] = undefined; - if (!obj[cgid]) { - obj[cgid] = "ifvisible.object.event.identifier"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var _ = __webpack_require__(16); +var ReactDOM = __webpack_require__(2); +var RX = __webpack_require__(8); +var SyncTasks = __webpack_require__(11); +var Types = __webpack_require__(23); +// We create a periodic timer to detect layout changes that are performed behind +// our back by the browser's layout engine. We do this more aggressively when +// the app is known to be active and in the foreground. +var _layoutTimerActiveDuration = 1000; +var _layoutTimerInactiveDuration = 10000; +var ViewBase = (function (_super) { + __extends(ViewBase, _super); + function ViewBase() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._isMounted = false; + _this._lastX = 0; + _this._lastY = 0; + _this._lastWidth = 0; + _this._lastHeight = 0; + return _this; + } + ViewBase.prototype._getContainer = function () { + // Perf: Don't prefetch this since we might never need it + var containerRef = this._getContainerRef(); + if (!this._container && containerRef) { + this._container = ReactDOM.findDOMNode(containerRef); } - if (!listeners[obj[cgid]]) { - listeners[obj[cgid]] = {}; + return this._container; + }; + // Sets the activation state so we can stop our periodic timer + // when the app is in the background. + ViewBase.setActivationState = function (newState) { + if (ViewBase._appActivationState !== newState) { + ViewBase._appActivationState = newState; + // Cancel any existing timers. + if (ViewBase._viewCheckingTimer) { + window.clearInterval(ViewBase._viewCheckingTimer); + ViewBase._viewCheckingTimer = null; + } + if (ViewBase._viewCheckingList.length > 0) { + // If we're becoming active, check and report layout changes immediately. + if (newState === Types.AppActivationState.Active) { + ViewBase._checkViews(); + } + ViewBase._viewCheckingTimer = setInterval(ViewBase._checkViews, newState === Types.AppActivationState.Active ? + _layoutTimerActiveDuration : _layoutTimerInactiveDuration); + } } - if (!listeners[obj[cgid]][event]) { - listeners[obj[cgid]][event] = []; + }; + ViewBase.prototype.componentWillReceiveProps = function (nextProps) { + if (!!this.props.onLayout !== !!nextProps.onLayout) { + if (this.props.onLayout) { + this._checkViewCheckerUnbuild(); + } + if (nextProps.onLayout) { + this._checkViewCheckerBuild(); + } } - return listeners[obj[cgid]][event].push(callback); - }; - fireCustomEvent = function(obj, event, memo) { - var ev, j, len, ref, results; - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - ref = listeners[obj[cgid]][event]; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - ev = ref[j]; - results.push(ev(memo || {})); - } - return results; + }; + ViewBase._checkViews = function () { + _.each(ViewBase._viewCheckingList, function (view) { + view._checkAndReportLayout(); + }); + }; + ViewBase._reportLayoutChange = function (func) { + this._layoutReportList.push(func); + if (!ViewBase._layoutReportingTimer) { + ViewBase._layoutReportingTimer = window.setTimeout(function () { + ViewBase._layoutReportingTimer = null; + ViewBase._reportDeferredLayoutChanges(); + }, 0); } - }; - removeCustomEvent = function(obj, event, callback) { - var cl, i, j, len, ref; - if (callback) { - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - ref = listeners[obj[cgid]][event]; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - cl = ref[i]; - if (cl === callback) { - listeners[obj[cgid]][event].splice(i, 1); - return cl; - } + }; + ViewBase._reportDeferredLayoutChanges = function () { + var reportList = this._layoutReportList; + this._layoutReportList = []; + _.each(reportList, function (func) { + try { + func(); } - } - } else { - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - return delete listeners[obj[cgid]][event]; - } + catch (e) { + console.error('Caught exception on onLayout response: ', e); + } + }); + }; + // Returns a promise to indicate when firing of onLayout event has completed (if any) + ViewBase.prototype._checkAndReportLayout = function () { + var _this = this; + if (!this._isMounted) { + return SyncTasks.Resolved(); } - }; - return { - add: addCustomEvent, - remove: removeCustomEvent, - fire: fireCustomEvent - }; - })(); - addEvent = (function() { - var setListener; - setListener = false; - return function(el, ev, fn) { - if (!setListener) { - if (el.addEventListener) { - setListener = function(el, ev, fn) { - return el.addEventListener(ev, fn, false); - }; - } else if (el.attachEvent) { - setListener = function(el, ev, fn) { - return el.attachEvent('on' + ev, fn, false); - }; - } else { - setListener = function(el, ev, fn) { - return el['on' + ev] = fn; - }; - } + var container = this._getContainer(); + if (!container) { + return SyncTasks.Resolved(); } - return setListener(el, ev, fn); - }; - })(); - fireEvent = function(element, event) { - var evt; - if (doc.createEventObject) { - return element.fireEvent('on' + event, evt); - } else { - evt = doc.createEvent('HTMLEvents'); - evt.initEvent(event, true, true); - return !element.dispatchEvent(evt); - } - }; - ie = (function() { - var all, check, div, undef, v; - undef = void 0; - v = 3; - div = doc.createElement("div"); - all = div.getElementsByTagName("i"); - check = function() { - return (div.innerHTML = "", all[0]); - }; - while (check()) { - continue; - } - if (v > 4) { - return v; - } else { - return undef; - } - })(); - hidden = false; - visibilityChange = void 0; - if (typeof doc.hidden !== "undefined") { - hidden = "hidden"; - visibilityChange = "visibilitychange"; - } else if (typeof doc.mozHidden !== "undefined") { - hidden = "mozHidden"; - visibilityChange = "mozvisibilitychange"; - } else if (typeof doc.msHidden !== "undefined") { - hidden = "msHidden"; - visibilityChange = "msvisibilitychange"; - } else if (typeof doc.webkitHidden !== "undefined") { - hidden = "webkitHidden"; - visibilityChange = "webkitvisibilitychange"; - } - trackIdleStatus = function() { - var timer, wakeUp; - timer = false; - wakeUp = function() { - clearTimeout(timer); - if (status !== "active") { - ifvisible.wakeup(); + var newX = container.offsetLeft; + var newY = container.offsetTop; + var marginTop = !container.style.marginTop ? 0 : parseInt(container.style.marginTop, 10) || 0; + var marginBottom = !container.style.marginBottom ? 0 : parseInt(container.style.marginBottom, 10) || 0; + var marginRight = !container.style.marginRight ? 0 : parseInt(container.style.marginRight, 10) || 0; + var marginLeft = !container.style.marginLeft ? 0 : parseInt(container.style.marginLeft, 10) || 0; + var newWidth = container.offsetWidth + marginRight + marginLeft; + var newHeight = container.offsetHeight + marginTop + marginBottom; + if (this._lastX !== newX || this._lastY !== newY || this._lastWidth !== newWidth || this._lastHeight !== newHeight) { + this._lastX = newX; + this._lastY = newY; + this._lastWidth = newWidth; + this._lastHeight = newHeight; + var deferred_1 = SyncTasks.Defer(); + ViewBase._reportLayoutChange(function () { + if (!_this._isMounted || !_this.props.onLayout) { + deferred_1.resolve(); + return; + } + _this.props.onLayout({ + x: newX, + y: newY, + width: _this._lastWidth, + height: _this._lastHeight + }); + deferred_1.resolve(); + }); + return deferred_1.promise(); } - idleStartedTime = +(new Date()); - return timer = setTimeout(function() { - if (status === "active") { - return ifvisible.idle(); - } - }, idleTime); - }; - wakeUp(); - addEvent(doc, "mousemove", wakeUp); - addEvent(doc, "keyup", wakeUp); - addEvent(doc, "touchstart", wakeUp); - addEvent(window, "scroll", wakeUp); - ifvisible.focus(wakeUp); - return ifvisible.wakeup(wakeUp); + return SyncTasks.Resolved(); }; - init = function() { - var blur; - if (initialized) { - return true; - } - if (hidden === false) { - blur = "blur"; - if (ie < 9) { - blur = "focusout"; + ViewBase.prototype._checkViewCheckerBuild = function () { + // Enable the timer to check for layout changes. Use a different duration + // when the app is active versus inactive. + if (!ViewBase._viewCheckingTimer) { + ViewBase._viewCheckingTimer = setInterval(ViewBase._checkViews, ViewBase._appActivationState === Types.AppActivationState.Active ? + _layoutTimerActiveDuration : _layoutTimerInactiveDuration); } - addEvent(window, blur, function() { - return ifvisible.blur(); - }); - addEvent(window, "focus", function() { - return ifvisible.focus(); - }); - } else { - addEvent(doc, visibilityChange, function() { - if (doc[hidden]) { - return ifvisible.blur(); - } else { - return ifvisible.focus(); - } - }, false); - } - initialized = true; - return trackIdleStatus(); + if (!ViewBase._isResizeHandlerInstalled) { + window.addEventListener('resize', ViewBase._onResize); + ViewBase._isResizeHandlerInstalled = true; + } + ViewBase._viewCheckingList.push(this); }; - ifvisible = { - setIdleDuration: function(seconds) { - return idleTime = seconds * 1000; - }, - getIdleDuration: function() { - return idleTime; - }, - getIdleInfo: function() { - var now, res; - now = +(new Date()); - res = {}; - if (status === "idle") { - res.isIdle = true; - res.idleFor = now - idleStartedTime; - res.timeLeft = 0; - res.timeLeftPer = 100; - } else { - res.isIdle = false; - res.idleFor = now - idleStartedTime; - res.timeLeft = (idleStartedTime + idleTime) - now; - res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2); + ViewBase.prototype._checkViewCheckerUnbuild = function () { + var _this = this; + ViewBase._viewCheckingList = _.filter(ViewBase._viewCheckingList, function (v) { return v !== _this; }); + if (ViewBase._viewCheckingList.length === 0) { + if (ViewBase._viewCheckingTimer) { + clearInterval(ViewBase._viewCheckingTimer); + ViewBase._viewCheckingTimer = null; + } + if (ViewBase._isResizeHandlerInstalled) { + window.removeEventListener('resize', ViewBase._onResize); + ViewBase._isResizeHandlerInstalled = false; + } } - return res; - }, - focus: function(callback) { - if (typeof callback === "function") { - this.on("focus", callback); - } else { - status = "active"; - customEvent.fire(this, "focus"); - customEvent.fire(this, "wakeup"); - customEvent.fire(this, "statusChanged", { - status: status - }); + }; + ViewBase.prototype.componentDidMount = function () { + this._isMounted = true; + if (this.props.onLayout) { + this._checkViewCheckerBuild(); } - return this; - }, - blur: function(callback) { - if (typeof callback === "function") { - this.on("blur", callback); - } else { - status = "hidden"; - customEvent.fire(this, "blur"); - customEvent.fire(this, "idle"); - customEvent.fire(this, "statusChanged", { - status: status - }); + // Chain through to the same render-checking code + this.componentDidUpdate(); + }; + ViewBase.prototype.componentDidUpdate = function () { + if (this.props.onLayout) { + this._checkAndReportLayout(); } - return this; - }, - idle: function(callback) { - if (typeof callback === "function") { - this.on("idle", callback); - } else { - status = "idle"; - customEvent.fire(this, "idle"); - customEvent.fire(this, "statusChanged", { - status: status - }); + }; + ViewBase._onResize = function () { + // Often views change size in response to an overall window resize. Rather than + // wait for the next timer to fire, do it immediately. + ViewBase._checkViews(); + }; + ViewBase.prototype.componentWillUnmount = function () { + this._isMounted = false; + // Don't retain a reference to a DOM object. This can cause memory leaks + // because the GC may not be able to clean them up. + this._container = null; + if (this.props.onLayout) { + this._checkViewCheckerUnbuild(); } - return this; - }, - wakeup: function(callback) { - if (typeof callback === "function") { - this.on("wakeup", callback); - } else { - status = "active"; - customEvent.fire(this, "wakeup"); - customEvent.fire(this, "statusChanged", { - status: status - }); + }; + ViewBase.prototype.blur = function () { + var el = ReactDOM.findDOMNode(this); + if (el) { + el.blur(); } - return this; - }, - on: function(name, callback) { - init(); - customEvent.add(this, name, callback); - return this; - }, - off: function(name, callback) { - init(); - customEvent.remove(this, name, callback); - return this; - }, - onEvery: function(seconds, callback) { - var paused, t; - init(); - paused = false; - if (callback) { - t = setInterval(function() { - if (status === "active" && paused === false) { - return callback(); - } - }, seconds * 1000); + }; + ViewBase.prototype.focus = function () { + var el = ReactDOM.findDOMNode(this); + if (el) { + el.focus(); } - return { - stop: function() { - return clearInterval(t); - }, - pause: function() { - return paused = true; - }, - resume: function() { - return paused = false; - }, - code: t, - callback: callback - }; - }, - now: function(check) { - init(); - return status === (check || "active"); - } }; - return ifvisible; - }); - -}).call(this); - -//# sourceMappingURL=ifvisible.js.map - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -var getNative = __webpack_require__(29), - root = __webpack_require__(18); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -var MapCache = __webpack_require__(76), - setCacheAdd = __webpack_require__(315), - setCacheHas = __webpack_require__(316); - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; + return ViewBase; +}(RX.ViewBase)); +ViewBase._viewCheckingTimer = null; +ViewBase._isResizeHandlerInstalled = false; +ViewBase._viewCheckingList = []; +ViewBase._appActivationState = Types.AppActivationState.Active; +ViewBase._layoutReportList = []; +ViewBase._layoutReportingTimer = null; +exports.ViewBase = ViewBase; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ViewBase; /***/ }), -/* 127 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { -var root = __webpack_require__(18); - -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; - -module.exports = Uint8Array; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports) { +/* WEBPACK VAR INJECTION */(function(process, setImmediate) {// Rebound +// ======= +// **Rebound** is a simple library that models Spring dynamics for the +// purpose of driving physical animations. +// +// Origin +// ------ +// [Rebound](http://facebook.github.io/rebound) was originally written +// in Java to provide a lightweight physics system for +// [Home](https://play.google.com/store/apps/details?id=com.facebook.home) and +// [Chat Heads](https://play.google.com/store/apps/details?id=com.facebook.orca) +// on Android. It's now been adopted by several other Android +// applications. This JavaScript port was written to provide a quick +// way to demonstrate Rebound animations on the web for a +// [conference talk](https://www.youtube.com/watch?v=s5kNm-DgyjY). Since then +// the JavaScript version has been used to build some really nice interfaces. +// Check out [brandonwalkin.com](http://brandonwalkin.com) for an +// example. +// +// Overview +// -------- +// The Library provides a SpringSystem for maintaining a set of Spring +// objects and iterating those Springs through a physics solver loop +// until equilibrium is achieved. The Spring class is the basic +// animation driver provided by Rebound. By attaching a listener to +// a Spring, you can observe its motion. The observer function is +// notified of position changes on the spring as it solves for +// equilibrium. These position updates can be mapped to an animation +// range to drive animated property updates on your user interface +// elements (translation, rotation, scale, etc). +// +// Example +// ------- +// Here's a simple example. Pressing and releasing on the logo below +// will cause it to scale up and down with a springy animation. +// +//
+// +//
+// +// +// +// Here's how it works. +// +// ``` +// // Get a reference to the logo element. +// var el = document.getElementById('logo'); +// +// // create a SpringSystem and a Spring with a bouncy config. +// var springSystem = new rebound.SpringSystem(); +// var spring = springSystem.createSpring(50, 3); +// +// // Add a listener to the spring. Every time the physics +// // solver updates the Spring's value onSpringUpdate will +// // be called. +// spring.addListener({ +// onSpringUpdate: function(spring) { +// var val = spring.getCurrentValue(); +// val = rebound.MathUtil +// .mapValueInRange(val, 0, 1, 1, 0.5); +// scale(el, val); +// } +// }); +// +// // Listen for mouse down/up/out and toggle the +// //springs endValue from 0 to 1. +// el.addEventListener('mousedown', function() { +// spring.setEndValue(1); +// }); +// +// el.addEventListener('mouseout', function() { +// spring.setEndValue(0); +// }); +// +// el.addEventListener('mouseup', function() { +// spring.setEndValue(0); +// }); +// +// // Helper for scaling an element with css transforms. +// function scale(el, val) { +// el.style.mozTransform = +// el.style.msTransform = +// el.style.webkitTransform = +// el.style.transform = 'scale3d(' + +// val + ', ' + val + ', 1)'; +// } +// ``` -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; +(function() { + var rebound = {}; + var util = rebound.util = {}; + var concat = Array.prototype.concat; + var slice = Array.prototype.slice; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; + // Bind a function to a context object. + util.bind = function bind(func, context) { + var args = slice.call(arguments, 2); + return function() { + func.apply(context, concat.call(args, slice.call(arguments))); + }; + }; + + // Add all the properties in the source to the target. + util.extend = function extend(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key]; + } } - } - return array; -} + }; -module.exports = arrayEach; + // SpringSystem + // ------------ + // **SpringSystem** is a set of Springs that all run on the same physics + // timing loop. To get started with a Rebound animation you first + // create a new SpringSystem and then add springs to it. + var SpringSystem = rebound.SpringSystem = function SpringSystem(looper) { + this._springRegistry = {}; + this._activeSprings = []; + this.listeners = []; + this._idleSpringIndices = []; + this.looper = looper || new AnimationLooper(); + this.looper.springSystem = this; + }; + util.extend(SpringSystem.prototype, { -/***/ }), -/* 129 */ -/***/ (function(module, exports) { + _springRegistry: null, -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + _isIdle: true, - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} + _lastTimeMillis: -1, -module.exports = arrayFilter; + _activeSprings: null, + listeners: null, -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { + _idleSpringIndices: null, -var baseTimes = __webpack_require__(261), - isArguments = __webpack_require__(46), - isArray = __webpack_require__(10), - isBuffer = __webpack_require__(47), - isIndex = __webpack_require__(59), - isTypedArray = __webpack_require__(62); + // A SpringSystem is iterated by a looper. The looper is responsible + // for executing each frame as the SpringSystem is resolved to idle. + // There are three types of Loopers described below AnimationLooper, + // SimulationLooper, and SteppingSimulationLooper. AnimationLooper is + // the default as it is the most useful for common UI animations. + setLooper: function(looper) { + this.looper = looper; + looper.springSystem = this; + }, -/** Used for built-in method references. */ -var objectProto = Object.prototype; + // Add a new spring to this SpringSystem. This Spring will now be solved for + // during the physics iteration loop. By default the spring will use the + // default Origami spring config with 40 tension and 7 friction, but you can + // also provide your own values here. + createSpring: function(tension, friction) { + var springConfig; + if (tension === undefined || friction === undefined) { + springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG; + } else { + springConfig = + SpringConfig.fromOrigamiTensionAndFriction(tension, friction); + } + return this.createSpringWithConfig(springConfig); + }, -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + // Add a spring with a specified bounciness and speed. To replicate Origami + // compositions based on PopAnimation patches, use this factory method to + // create matching springs. + createSpringWithBouncinessAndSpeed: function(bounciness, speed) { + var springConfig; + if (bounciness === undefined || speed === undefined) { + springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG; + } else { + springConfig = + SpringConfig.fromBouncinessAndSpeed(bounciness, speed); + } + return this.createSpringWithConfig(springConfig); + }, -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + // Add a spring with the provided SpringConfig. + createSpringWithConfig: function(springConfig) { + var spring = new Spring(this); + this.registerSpring(spring); + spring.setSpringConfig(springConfig); + return spring; + }, - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} + // You can check if a SpringSystem is idle or active by calling + // getIsIdle. If all of the Springs in the SpringSystem are at rest, + // i.e. the physics forces have reached equilibrium, then this + // method will return true. + getIsIdle: function() { + return this._isIdle; + }, -module.exports = arrayLikeKeys; + // Retrieve a specific Spring from the SpringSystem by id. This + // can be useful for inspecting the state of a spring before + // or after an integration loop in the SpringSystem executes. + getSpringById: function (id) { + return this._springRegistry[id]; + }, + // Get a listing of all the springs registered with this + // SpringSystem. + getAllSprings: function() { + var vals = []; + for (var id in this._springRegistry) { + if (this._springRegistry.hasOwnProperty(id)) { + vals.push(this._springRegistry[id]); + } + } + return vals; + }, -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { + // registerSpring is called automatically as soon as you create + // a Spring with SpringSystem#createSpring. This method sets the + // spring up in the registry so that it can be solved in the + // solver loop. + registerSpring: function(spring) { + this._springRegistry[spring.getId()] = spring; + }, -var baseAssignValue = __webpack_require__(56), - eq = __webpack_require__(45); + // Deregister a spring with this SpringSystem. The SpringSystem will + // no longer consider this Spring during its integration loop once + // this is called. This is normally done automatically for you when + // you call Spring#destroy. + deregisterSpring: function(spring) { + removeFirst(this._activeSprings, spring); + delete this._springRegistry[spring.getId()]; + }, -/** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} + advance: function(time, deltaTime) { + while(this._idleSpringIndices.length > 0) this._idleSpringIndices.pop(); + for (var i = 0, len = this._activeSprings.length; i < len; i++) { + var spring = this._activeSprings[i]; + if (spring.systemShouldAdvance()) { + spring.advance(time / 1000.0, deltaTime / 1000.0); + } else { + this._idleSpringIndices.push(this._activeSprings.indexOf(spring)); + } + } + while(this._idleSpringIndices.length > 0) { + var idx = this._idleSpringIndices.pop(); + idx >= 0 && this._activeSprings.splice(idx, 1); + } + }, -module.exports = assignMergeValue; + // This is our main solver loop called to move the simulation + // forward through time. Before each pass in the solver loop + // onBeforeIntegrate is called on an any listeners that have + // registered themeselves with the SpringSystem. This gives you + // an opportunity to apply any constraints or adjustments to + // the springs that should be enforced before each iteration + // loop. Next the advance method is called to move each Spring in + // the systemShouldAdvance forward to the current time. After the + // integration step runs in advance, onAfterIntegrate is called + // on any listeners that have registered themselves with the + // SpringSystem. This gives you an opportunity to run any post + // integration constraints or adjustments on the Springs in the + // SpringSystem. + loop: function(currentTimeMillis) { + var listener; + if (this._lastTimeMillis === -1) { + this._lastTimeMillis = currentTimeMillis -1; + } + var ellapsedMillis = currentTimeMillis - this._lastTimeMillis; + this._lastTimeMillis = currentTimeMillis; + var i = 0, len = this.listeners.length; + for (i = 0; i < len; i++) { + listener = this.listeners[i]; + listener.onBeforeIntegrate && listener.onBeforeIntegrate(this); + } -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { + this.advance(currentTimeMillis, ellapsedMillis); + if (this._activeSprings.length === 0) { + this._isIdle = true; + this._lastTimeMillis = -1; + } -var createBaseFor = __webpack_require__(275); + for (i = 0; i < len; i++) { + listener = this.listeners[i]; + listener.onAfterIntegrate && listener.onAfterIntegrate(this); + } -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); + if (!this._isIdle) { + this.looper.run(); + } + }, -module.exports = baseFor; + // activateSpring is used to notify the SpringSystem that a Spring + // has become displaced. The system responds by starting its solver + // loop up if it is currently idle. + activateSpring: function(springId) { + var spring = this._springRegistry[springId]; + if (this._activeSprings.indexOf(spring) == -1) { + this._activeSprings.push(spring); + } + if (this.getIsIdle()) { + this._isIdle = false; + this.looper.run(); + } + }, + // Add a listener to the SpringSystem so that you can receive + // before/after integration notifications allowing Springs to be + // constrained or adjusted. + addListener: function(listener) { + this.listeners.push(listener); + }, -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { + // Remove a previously added listener on the SpringSystem. + removeListener: function(listener) { + removeFirst(this.listeners, listener); + }, -var baseFor = __webpack_require__(132), - keys = __webpack_require__(26); + // Remove all previously added listeners on the SpringSystem. + removeAllListeners: function() { + this.listeners = []; + } -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} + }); -module.exports = baseForOwn; + // Spring + // ------ + // **Spring** provides a model of a classical spring acting to + // resolve a body to equilibrium. Springs have configurable + // tension which is a force multipler on the displacement of the + // spring from its rest point or `endValue` as defined by [Hooke's + // law](http://en.wikipedia.org/wiki/Hooke's_law). Springs also have + // configurable friction, which ensures that they do not oscillate + // infinitely. When a Spring is displaced by updating it's resting + // or `currentValue`, the SpringSystems that contain that Spring + // will automatically start looping to solve for equilibrium. As each + // timestep passes, `SpringListener` objects attached to the Spring + // will be notified of the updates providing a way to drive an + // animation off of the spring's resolution curve. + var Spring = rebound.Spring = function Spring(springSystem) { + this._id = 's' + Spring._ID++; + this._springSystem = springSystem; + this.listeners = []; + this._currentState = new PhysicsState(); + this._previousState = new PhysicsState(); + this._tempState = new PhysicsState(); + }; + util.extend(Spring, { + _ID: 0, -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { + MAX_DELTA_TIME_SEC: 0.064, -var arrayPush = __webpack_require__(77), - isArray = __webpack_require__(10); + SOLVER_TIMESTEP_SEC: 0.001 -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} + }); -module.exports = baseGetAllKeys; + util.extend(Spring.prototype, { + _id: 0, -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { + _springConfig: null, -var baseFindIndex = __webpack_require__(82), - baseIsNaN = __webpack_require__(244), - strictIndexOf = __webpack_require__(323); + _overshootClampingEnabled: false, -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); -} + _currentState: null, -module.exports = baseIndexOf; + _previousState: null, + _tempState: null, -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { + _startValue: 0, -var isPrototype = __webpack_require__(43), - nativeKeys = __webpack_require__(310); + _endValue: 0, -/** Used for built-in method references. */ -var objectProto = Object.prototype; + _wasAtRest: true, -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + _restSpeedThreshold: 0.001, -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} + _displacementFromRestThreshold: 0.001, -module.exports = baseKeys; + listeners: null, + _timeAccumulator: 0, -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { + _springSystem: null, -var baseEach = __webpack_require__(81), - isArrayLike = __webpack_require__(21); + // Remove a Spring from simulation and clear its listeners. + destroy: function() { + this.listeners = []; + this.frames = []; + this._springSystem.deregisterSpring(this); + }, -/** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; + // Get the id of the spring, which can be used to retrieve it from + // the SpringSystems it participates in later. + getId: function() { + return this._id; + }, - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; -} + // Set the configuration values for this Spring. A SpringConfig + // contains the tension and friction values used to solve for the + // equilibrium of the Spring in the physics loop. + setSpringConfig: function(springConfig) { + this._springConfig = springConfig; + return this; + }, -module.exports = baseMap; + // Retrieve the SpringConfig used by this Spring. + getSpringConfig: function() { + return this._springConfig; + }, + // Set the current position of this Spring. Listeners will be updated + // with this value immediately. If the rest or `endValue` is not + // updated to match this value, then the spring will be dispalced and + // the SpringSystem will start to loop to restore the spring to the + // `endValue`. + // + // A common pattern is to move a Spring around without animation by + // calling. + // + // ``` + // spring.setCurrentValue(n).setAtRest(); + // ``` + // + // This moves the Spring to a new position `n`, sets the endValue + // to `n`, and removes any velocity from the `Spring`. By doing + // this you can allow the `SpringListener` to manage the position + // of UI elements attached to the spring even when moving without + // animation. For example, when dragging an element you can + // update the position of an attached view through a spring + // by calling `spring.setCurrentValue(x)`. When + // the gesture ends you can update the Springs + // velocity and endValue + // `spring.setVelocity(gestureEndVelocity).setEndValue(flingTarget)` + // to cause it to naturally animate the UI element to the resting + // position taking into account existing velocity. The codepaths for + // synchronous movement and spring driven animation can + // be unified using this technique. + setCurrentValue: function(currentValue, skipSetAtRest) { + this._startValue = currentValue; + this._currentState.position = currentValue; + if (!skipSetAtRest) { + this.setAtRest(); + } + this.notifyPositionUpdated(false, false); + return this; + }, -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { + // Get the position that the most recent animation started at. This + // can be useful for determining the number off oscillations that + // have occurred. + getStartValue: function() { + return this._startValue; + }, -var Symbol = __webpack_require__(34), - arrayMap = __webpack_require__(41), - isArray = __webpack_require__(10), - isSymbol = __webpack_require__(36); + // Retrieve the current value of the Spring. + getCurrentValue: function() { + return this._currentState.position; + }, -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; + // Get the absolute distance of the Spring from it's resting endValue + // position. + getCurrentDisplacementDistance: function() { + return this.getDisplacementDistanceForState(this._currentState); + }, -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; + getDisplacementDistanceForState: function(state) { + return Math.abs(this._endValue - state.position); + }, -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} + // Set the endValue or resting position of the spring. If this + // value is different than the current value, the SpringSystem will + // be notified and will begin running its solver loop to resolve + // the Spring to equilibrium. Any listeners that are registered + // for onSpringEndStateChange will also be notified of this update + // immediately. + setEndValue: function(endValue) { + if (this._endValue == endValue && this.isAtRest()) { + return this; + } + this._startValue = this.getCurrentValue(); + this._endValue = endValue; + this._springSystem.activateSpring(this.getId()); + for (var i = 0, len = this.listeners.length; i < len; i++) { + var listener = this.listeners[i]; + var onChange = listener.onSpringEndStateChange; + onChange && onChange(this); + } + return this; + }, -module.exports = baseToString; + // Retrieve the endValue or resting position of this spring. + getEndValue: function() { + return this._endValue; + }, + // Set the current velocity of the Spring. As previously mentioned, + // this can be useful when you are performing a direct manipulation + // gesture. When a UI element is released you may call setVelocity + // on its animation Spring so that the Spring continues with the + // same velocity as the gesture ended with. The friction, tension, + // and displacement of the Spring will then govern its motion to + // return to rest on a natural feeling curve. + setVelocity: function(velocity) { + if (velocity === this._currentState.velocity) { + return this; + } + this._currentState.velocity = velocity; + this._springSystem.activateSpring(this.getId()); + return this; + }, -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { + // Get the current velocity of the Spring. + getVelocity: function() { + return this._currentState.velocity; + }, -var castPath = __webpack_require__(57), - last = __webpack_require__(345), - parent = __webpack_require__(314), - toKey = __webpack_require__(44); + // Set a threshold value for the movement speed of the Spring below + // which it will be considered to be not moving or resting. + setRestSpeedThreshold: function(restSpeedThreshold) { + this._restSpeedThreshold = restSpeedThreshold; + return this; + }, -/** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ -function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; -} + // Retrieve the rest speed threshold for this Spring. + getRestSpeedThreshold: function() { + return this._restSpeedThreshold; + }, -module.exports = baseUnset; + // Set a threshold value for displacement below which the Spring + // will be considered to be not displaced i.e. at its resting + // `endValue`. + setRestDisplacementThreshold: function(displacementFromRestThreshold) { + this._displacementFromRestThreshold = displacementFromRestThreshold; + }, + // Retrieve the rest displacement threshold for this spring. + getRestDisplacementThreshold: function() { + return this._displacementFromRestThreshold; + }, -/***/ }), -/* 140 */ -/***/ (function(module, exports) { + // Enable overshoot clamping. This means that the Spring will stop + // immediately when it reaches its resting position regardless of + // any existing momentum it may have. This can be useful for certain + // types of animations that should not oscillate such as a scale + // down to 0 or alpha fade. + setOvershootClampingEnabled: function(enabled) { + this._overshootClampingEnabled = enabled; + return this; + }, -/** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} + // Check if overshoot clamping is enabled for this spring. + isOvershootClampingEnabled: function() { + return this._overshootClampingEnabled; + }, -module.exports = cacheHas; + // Check if the Spring has gone past its end point by comparing + // the direction it was moving in when it started to the current + // position and end value. + isOvershooting: function() { + var start = this._startValue; + var end = this._endValue; + return this._springConfig.tension > 0 && + ((start < end && this.getCurrentValue() > end) || + (start > end && this.getCurrentValue() < end)); + }, + // Spring.advance is the main solver method for the Spring. It takes + // the current time and delta since the last time step and performs + // an RK4 integration to get the new position and velocity state + // for the Spring based on the tension, friction, velocity, and + // displacement of the Spring. + advance: function(time, realDeltaTime) { + var isAtRest = this.isAtRest(); -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { + if (isAtRest && this._wasAtRest) { + return; + } -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(18); + var adjustedDeltaTime = realDeltaTime; + if (realDeltaTime > Spring.MAX_DELTA_TIME_SEC) { + adjustedDeltaTime = Spring.MAX_DELTA_TIME_SEC; + } -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + this._timeAccumulator += adjustedDeltaTime; -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + var tension = this._springConfig.tension, + friction = this._springConfig.friction, -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + position = this._currentState.position, + velocity = this._currentState.velocity, + tempPosition = this._tempState.position, + tempVelocity = this._tempState.velocity, -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + aVelocity, aAcceleration, + bVelocity, bAcceleration, + cVelocity, cAcceleration, + dVelocity, dAcceleration, -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + dxdt, dvdt; - buffer.copy(result); - return result; -} + while(this._timeAccumulator >= Spring.SOLVER_TIMESTEP_SEC) { -module.exports = cloneBuffer; + this._timeAccumulator -= Spring.SOLVER_TIMESTEP_SEC; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(118)(module))) + if (this._timeAccumulator < Spring.SOLVER_TIMESTEP_SEC) { + this._previousState.position = position; + this._previousState.velocity = velocity; + } -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { + aVelocity = velocity; + aAcceleration = + (tension * (this._endValue - tempPosition)) - friction * velocity; -var cloneArrayBuffer = __webpack_require__(87); + tempPosition = position + aVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5; + tempVelocity = + velocity + aAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5; + bVelocity = tempVelocity; + bAcceleration = + (tension * (this._endValue - tempPosition)) - friction * tempVelocity; -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} + tempPosition = position + bVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5; + tempVelocity = + velocity + bAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5; + cVelocity = tempVelocity; + cAcceleration = + (tension * (this._endValue - tempPosition)) - friction * tempVelocity; -module.exports = cloneTypedArray; + tempPosition = position + cVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5; + tempVelocity = + velocity + cAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5; + dVelocity = tempVelocity; + dAcceleration = + (tension * (this._endValue - tempPosition)) - friction * tempVelocity; + dxdt = + 1.0/6.0 * (aVelocity + 2.0 * (bVelocity + cVelocity) + dVelocity); + dvdt = 1.0/6.0 * ( + aAcceleration + 2.0 * (bAcceleration + cAcceleration) + dAcceleration + ); -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { + position += dxdt * Spring.SOLVER_TIMESTEP_SEC; + velocity += dvdt * Spring.SOLVER_TIMESTEP_SEC; + } -var getNative = __webpack_require__(29); + this._tempState.position = tempPosition; + this._tempState.velocity = tempVelocity; -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); + this._currentState.position = position; + this._currentState.velocity = velocity; -module.exports = defineProperty; + if (this._timeAccumulator > 0) { + this._interpolate(this._timeAccumulator / Spring.SOLVER_TIMESTEP_SEC); + } + if (this.isAtRest() || + this._overshootClampingEnabled && this.isOvershooting()) { -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { + if (this._springConfig.tension > 0) { + this._startValue = this._endValue; + this._currentState.position = this._endValue; + } else { + this._endValue = this._currentState.position; + this._startValue = this._endValue; + } + this.setVelocity(0); + isAtRest = true; + } -var SetCache = __webpack_require__(126), - arraySome = __webpack_require__(229), - cacheHas = __webpack_require__(140); + var notifyActivate = false; + if (this._wasAtRest) { + this._wasAtRest = false; + notifyActivate = true; + } -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; + var notifyAtRest = false; + if (isAtRest) { + this._wasAtRest = true; + notifyAtRest = true; + } -/** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; + this.notifyPositionUpdated(notifyActivate, notifyAtRest); + }, - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + notifyPositionUpdated: function(notifyActivate, notifyAtRest) { + for (var i = 0, len = this.listeners.length; i < len; i++) { + var listener = this.listeners[i]; + if (notifyActivate && listener.onSpringActivate) { + listener.onSpringActivate(this); + } - stack.set(array, other); - stack.set(other, array); + if (listener.onSpringUpdate) { + listener.onSpringUpdate(this); + } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; + if (notifyAtRest && listener.onSpringAtRest) { + listener.onSpringAtRest(this); + } + } + }, - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -module.exports = equalArrays; + // Check if the SpringSystem should advance. Springs are advanced + // a final frame after they reach equilibrium to ensure that the + // currentValue is exactly the requested endValue regardless of the + // displacement threshold. + systemShouldAdvance: function() { + return !this.isAtRest() || !this.wasAtRest(); + }, -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73))) + wasAtRest: function() { + return this._wasAtRest; + }, -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { + // Check if the Spring is atRest meaning that it's currentValue and + // endValue are the same and that it has no velocity. The previously + // described thresholds for speed and displacement define the bounds + // of this equivalence check. If the Spring has 0 tension, then it will + // be considered at rest whenever its absolute velocity drops below the + // restSpeedThreshold. + isAtRest: function() { + return Math.abs(this._currentState.velocity) < this._restSpeedThreshold && + (this.getDisplacementDistanceForState(this._currentState) <= + this._displacementFromRestThreshold || + this._springConfig.tension === 0); + }, -var baseGetAllKeys = __webpack_require__(134), - getSymbols = __webpack_require__(91), - keys = __webpack_require__(26); + // Force the spring to be at rest at its current position. As + // described in the documentation for setCurrentValue, this method + // makes it easy to do synchronous non-animated updates to ui + // elements that are attached to springs via SpringListeners. + setAtRest: function() { + this._endValue = this._currentState.position; + this._tempState.position = this._currentState.position; + this._currentState.velocity = 0; + return this; + }, -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} + _interpolate: function(alpha) { + this._currentState.position = this._currentState.position * + alpha + this._previousState.position * (1 - alpha); + this._currentState.velocity = this._currentState.velocity * + alpha + this._previousState.velocity * (1 - alpha); + }, -module.exports = getAllKeys; + getListeners: function() { + return this.listeners; + }, + addListener: function(newListener) { + this.listeners.push(newListener); + return this; + }, -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { + removeListener: function(listenerToRemove) { + removeFirst(this.listeners, listenerToRemove); + return this; + }, -var baseGetAllKeys = __webpack_require__(134), - getSymbolsIn = __webpack_require__(148), - keysIn = __webpack_require__(48); + removeAllListeners: function() { + this.listeners = []; + return this; + }, -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); -} + currentValueIsApproximately: function(value) { + return Math.abs(this.getCurrentValue() - value) <= + this.getRestDisplacementThreshold(); + } -module.exports = getAllKeysIn; + }); + // PhysicsState + // ------------ + // **PhysicsState** consists of a position and velocity. A Spring uses + // this internally to keep track of its current and prior position and + // velocity values. + var PhysicsState = function PhysicsState() {}; -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { + util.extend(PhysicsState.prototype, { + position: 0, + velocity: 0 + }); -var arrayPush = __webpack_require__(77), - getPrototype = __webpack_require__(90), - getSymbols = __webpack_require__(91), - stubArray = __webpack_require__(165); + // SpringConfig + // ------------ + // **SpringConfig** maintains a set of tension and friction constants + // for a Spring. You can use fromOrigamiTensionAndFriction to convert + // values from the [Origami](http://facebook.github.io/origami/) + // design tool directly to Rebound spring constants. + var SpringConfig = rebound.SpringConfig = + function SpringConfig(tension, friction) { + this.tension = tension; + this.friction = friction; + }; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; + // Loopers + // ------- + // **AnimationLooper** plays each frame of the SpringSystem on animation + // timing loop. This is the default type of looper for a new spring system + // as it is the most common when developing UI. + var AnimationLooper = rebound.AnimationLooper = function AnimationLooper() { + this.springSystem = null; + var _this = this; + var _run = function() { + _this.springSystem.loop(Date.now()); + }; -/** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; -}; + this.run = function() { + util.onFrame(_run); + }; + }; -module.exports = getSymbolsIn; + // **SimulationLooper** resolves the SpringSystem to a resting state in a + // tight and blocking loop. This is useful for synchronously generating + // pre-recorded animations that can then be played on a timing loop later. + // Sometimes this lead to better performance to pre-record a single spring + // curve and use it to drive many animations; however, it can make dynamic + // response to user input a bit trickier to implement. + rebound.SimulationLooper = function SimulationLooper(timestep) { + this.springSystem = null; + var time = 0; + var running = false; + timestep=timestep || 16.667; + this.run = function() { + if (running) { + return; + } + running = true; + while(!this.springSystem.getIsIdle()) { + this.springSystem.loop(time+=timestep); + } + running = false; + }; + }; -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { + // **SteppingSimulationLooper** resolves the SpringSystem one step at a + // time controlled by an outside loop. This is useful for testing and + // verifying the behavior of a SpringSystem or if you want to control your own + // timing loop for some reason e.g. slowing down or speeding up the + // simulation. + rebound.SteppingSimulationLooper = function(timestep) { + this.springSystem = null; + var time = 0; -var baseCreate = __webpack_require__(234), - getPrototype = __webpack_require__(90), - isPrototype = __webpack_require__(43); + // this.run is NOOP'd here to allow control from the outside using + // this.step. + this.run = function(){}; -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} + // Perform one step toward resolving the SpringSystem. + this.step = function(timestep) { + this.springSystem.loop(time+=timestep); + }; + }; -module.exports = initCloneObject; + // Math for converting from + // [Origami](http://facebook.github.io/origami/) to + // [Rebound](http://facebook.github.io/rebound). + // You mostly don't need to worry about this, just use + // SpringConfig.fromOrigamiTensionAndFriction(v, v); + var OrigamiValueConverter = rebound.OrigamiValueConverter = { + tensionFromOrigamiValue: function(oValue) { + return (oValue - 30.0) * 3.62 + 194.0; + }, + origamiValueFromTension: function(tension) { + return (tension - 194.0) / 3.62 + 30.0; + }, -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { + frictionFromOrigamiValue: function(oValue) { + return (oValue - 8.0) * 3.0 + 25.0; + }, -var eq = __webpack_require__(45), - isArrayLike = __webpack_require__(21), - isIndex = __webpack_require__(59), - isObject = __webpack_require__(12); + origamiFromFriction: function(friction) { + return (friction - 25.0) / 3.0 + 8.0; + } + }; -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); + // BouncyConversion provides math for converting from Origami PopAnimation + // config values to regular Origami tension and friction values. If you are + // trying to replicate prototypes made with PopAnimation patches in Origami, + // then you should create your springs with + // SpringSystem.createSpringWithBouncinessAndSpeed, which uses this Math + // internally to create a spring to match the provided PopAnimation + // configuration from Origami. + var BouncyConversion = rebound.BouncyConversion = function(bounciness, speed){ + this.bounciness = bounciness; + this.speed = speed; + var b = this.normalize(bounciness / 1.7, 0, 20.0); + b = this.projectNormal(b, 0.0, 0.8); + var s = this.normalize(speed / 1.7, 0, 20.0); + this.bouncyTension = this.projectNormal(s, 0.5, 200) + this.bouncyFriction = this.quadraticOutInterpolation( + b, + this.b3Nobounce(this.bouncyTension), + 0.01); } - return false; -} - -module.exports = isIterateeCall; + util.extend(BouncyConversion.prototype, { -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { + normalize: function(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + }, -var isObject = __webpack_require__(12); + projectNormal: function(n, start, end) { + return start + (n * (end - start)); + }, -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} + linearInterpolation: function(t, start, end) { + return t * end + (1.0 - t) * start; + }, -module.exports = isStrictComparable; + quadraticOutInterpolation: function(t, start, end) { + return this.linearInterpolation(2*t - t*t, start, end); + }, + b3Friction1: function(x) { + return (0.0007 * Math.pow(x, 3)) - + (0.031 * Math.pow(x, 2)) + 0.64 * x + 1.28; + }, -/***/ }), -/* 152 */ -/***/ (function(module, exports) { + b3Friction2: function(x) { + return (0.000044 * Math.pow(x, 3)) - + (0.006 * Math.pow(x, 2)) + 0.36 * x + 2.; + }, -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); + b3Friction3: function(x) { + return (0.00000045 * Math.pow(x, 3)) - + (0.000332 * Math.pow(x, 2)) + 0.1078 * x + 5.84; + }, - map.forEach(function(value, key) { - result[++index] = [key, value]; + b3Nobounce: function(tension) { + var friction = 0; + if (tension <= 18) { + friction = this.b3Friction1(tension); + } else if (tension > 18 && tension <= 44) { + friction = this.b3Friction2(tension); + } else { + friction = this.b3Friction3(tension); + } + return friction; + } }); - return result; -} - -module.exports = mapToArray; + util.extend(SpringConfig, { + // Convert an origami Spring tension and friction to Rebound spring + // constants. If you are prototyping a design with Origami, this + // makes it easy to make your springs behave exactly the same in + // Rebound. + fromOrigamiTensionAndFriction: function(tension, friction) { + return new SpringConfig( + OrigamiValueConverter.tensionFromOrigamiValue(tension), + OrigamiValueConverter.frictionFromOrigamiValue(friction)); + }, -/***/ }), -/* 153 */ -/***/ (function(module, exports) { + // Convert an origami PopAnimation Spring bounciness and speed to Rebound + // spring constants. If you are using PopAnimation patches in Origami, this + // utility will provide springs that match your prototype. + fromBouncinessAndSpeed: function(bounciness, speed) { + var bouncyConversion = new rebound.BouncyConversion(bounciness, speed); + return this.fromOrigamiTensionAndFriction( + bouncyConversion.bouncyTension, + bouncyConversion.bouncyFriction); + }, -/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; + // Create a SpringConfig with no tension or a coasting spring with some + // amount of Friction so that it does not coast infininitely. + coastingConfigWithOrigamiFriction: function(friction) { + return new SpringConfig( + 0, + OrigamiValueConverter.frictionFromOrigamiValue(friction) + ); } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; -} - -module.exports = matchesStrictComparable; - - -/***/ }), -/* 154 */ -/***/ (function(module, exports) { - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -module.exports = overArg; - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -var apply = __webpack_require__(226); + }); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; + SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG = + SpringConfig.fromOrigamiTensionAndFriction(40, 7); -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + util.extend(SpringConfig.prototype, {friction: 0, tension: 0}); - while (++index < length) { - array[index] = args[start + index]; + // Here are a couple of function to convert colors between hex codes and RGB + // component values. These are handy when performing color + // tweening animations. + var colorCache = {}; + util.hexToRGB = function(color) { + if (colorCache[color]) { + return colorCache[color]; } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; + color = color.replace('#', ''); + if (color.length === 3) { + color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} + var parts = color.match(/.{2}/g); -module.exports = overRest; + var ret = { + r: parseInt(parts[0], 16), + g: parseInt(parts[1], 16), + b: parseInt(parts[2], 16) + }; + colorCache[color] = ret; + return ret; + }; -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { + util.rgbToHex = function(r, g, b) { + r = r.toString(16); + g = g.toString(16); + b = b.toString(16); + r = r.length < 2 ? '0' + r : r; + g = g.length < 2 ? '0' + g : g; + b = b.length < 2 ? '0' + b : b; + return '#' + r + g + b; + }; -var baseSetToString = __webpack_require__(258), - shortOut = __webpack_require__(317); + var MathUtil = rebound.MathUtil = { + // This helper function does a linear interpolation of a value from + // one range to another. This can be very useful for converting the + // motion of a Spring to a range of UI property values. For example a + // spring moving from position 0 to 1 could be interpolated to move a + // view from pixel 300 to 350 and scale it from 0.5 to 1. The current + // position of the `Spring` just needs to be run through this method + // taking its input range in the _from_ parameters with the property + // animation range in the _to_ parameters. + mapValueInRange: function(value, fromLow, fromHigh, toLow, toHigh) { + var fromRangeSize = fromHigh - fromLow; + var toRangeSize = toHigh - toLow; + var valueScale = (value - fromLow) / fromRangeSize; + return toLow + (valueScale * toRangeSize); + }, -/** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var setToString = shortOut(baseSetToString); + // Interpolate two hex colors in a 0 - 1 range or optionally provide a + // custom range with fromLow,fromHight. The output will be in hex by default + // unless asRGB is true in which case it will be returned as an rgb string. + interpolateColor: + function(val, startColor, endColor, fromLow, fromHigh, asRGB) { + fromLow = fromLow === undefined ? 0 : fromLow; + fromHigh = fromHigh === undefined ? 1 : fromHigh; + startColor = util.hexToRGB(startColor); + endColor = util.hexToRGB(endColor); + var r = Math.floor( + util.mapValueInRange(val, fromLow, fromHigh, startColor.r, endColor.r) + ); + var g = Math.floor( + util.mapValueInRange(val, fromLow, fromHigh, startColor.g, endColor.g) + ); + var b = Math.floor( + util.mapValueInRange(val, fromLow, fromHigh, startColor.b, endColor.b) + ); + if (asRGB) { + return 'rgb(' + r + ',' + g + ',' + b + ')'; + } else { + return util.rgbToHex(r, g, b); + } + }, -module.exports = setToString; + degreesToRadians: function(deg) { + return (deg * Math.PI) / 180; + }, + radiansToDegrees: function(rad) { + return (rad * 180) / Math.PI; + } -/***/ }), -/* 157 */ -/***/ (function(module, exports) { + } -/** Used for built-in method references. */ -var funcProto = Function.prototype; + util.extend(util, MathUtil); -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} + // Utilities + // --------- + // Here are a few useful JavaScript utilities. -module.exports = toSource; + // Lop off the first occurence of the reference in the Array. + function removeFirst(array, item) { + var idx = array.indexOf(item); + idx != -1 && array.splice(idx, 1); + } + var _onFrame; + if (typeof window !== 'undefined') { + _onFrame = window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000 / 60); + }; + } + if (!_onFrame && typeof process !== 'undefined' && process.title === 'node') { + _onFrame = setImmediate; + } -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { + // Cross browser/node timer functions. + util.onFrame = function onFrame(func) { + return _onFrame(func); + }; -var baseClone = __webpack_require__(80); + // Export the public api using exports for common js or the window for + // normal browser inclusion. + if (true) { + util.extend(exports, rebound); + } else if (typeof window != 'undefined') { + window.rebound = rebound; + } +})(); -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; +// Legal Stuff +// ----------- /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * Copyright (c) 2013, Facebook, Inc. + * All rights reserved. * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ -function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); -} -module.exports = clone; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(269).setImmediate)) + +/***/ }), +/* 170 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; /***/ }), -/* 159 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(129), - baseFilter = __webpack_require__(237), - baseIteratee = __webpack_require__(23), - isArray = __webpack_require__(10); +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; + * Copyright (c) 2013-present, Facebook, Inc. * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] + * http://www.apache.org/licenses/LICENSE-2.0 * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] + * @typechecks */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); -} -module.exports = filter; +var emptyFunction = __webpack_require__(25); + +/** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ +var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function listen(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, false); + } + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function remove() { + target.detachEvent('on' + eventType, callback); + } + }; + } + }, + + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function capture(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, true); + } + }; + } else { + if (process.env.NODE_ENV !== 'production') { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; + } + }, + + registerDefault: function registerDefault() {} +}; +module.exports = EventListener; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 160 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { -var baseFlatten = __webpack_require__(83); - +"use strict"; /** - * Flattens `array` a single level deep. + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example + * 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. * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] */ -function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; -} - -module.exports = flatten; - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(84); /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' + * @param {DOMElement} node input/textarea to focus */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} -module.exports = get; +function focusNode(node) { + // IE8 can throw "Can't move focus to the control because it is invisible, + // not enabled, or of a type that does not accept the focus." for all kinds of + // reasons that are too expensive and fragile to test. + try { + node.focus(); + } catch (e) {} +} +module.exports = focusNode; /***/ }), -/* 162 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { -var isArrayLike = __webpack_require__(21), - isObjectLike = __webpack_require__(25); +"use strict"; + /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. * - * _.isArrayLikeObject([1, 2, 3]); - * // => true + * 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. * - * _.isArrayLikeObject(document.body.children); - * // => true + * @typechecks + */ + +/* eslint-disable fb-www/typeof-undefined */ + +/** + * Same as document.activeElement but wraps in a try-catch block. In IE it is + * not safe to call document.activeElement if there is nothing focused. * - * _.isArrayLikeObject('abc'); - * // => false + * The activeElement will be null only if the document or document body is not + * yet defined. * - * _.isArrayLikeObject(_.noop); - * // => false + * @param {?DOMDocument} doc Defaults to current document. + * @return {?DOMElement} */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); +function getActiveElement(doc) /*?DOMElement*/{ + doc = doc || (typeof document !== 'undefined' ? document : undefined); + if (typeof doc === 'undefined') { + return null; + } + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } } -module.exports = isArrayLikeObject; - +module.exports = getActiveElement; /***/ }), -/* 163 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(28), - getPrototype = __webpack_require__(90), - isObjectLike = __webpack_require__(25); +var getNative = __webpack_require__(40), + root = __webpack_require__(27); -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +module.exports = Set; -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +var MapCache = __webpack_require__(98), + setCacheAdd = __webpack_require__(385), + setCacheHas = __webpack_require__(386); /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true + * Creates an array cache object to store unique values. * - * _.isPlainObject(Object.create(null)); - * // => true + * @private + * @constructor + * @param {Array} [values] The values to cache. */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; } -module.exports = isPlainObject; +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; /***/ }), -/* 164 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { -var MapCache = __webpack_require__(76); +var root = __webpack_require__(27); -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports) { /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; - if (cache.has(key)) { - return cache.get(key); + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; + } + return array; } -// Expose `MapCache`. -memoize.Cache = MapCache; - -module.exports = memoize; +module.exports = arrayEach; /***/ }), -/* 165 */ +/* 178 */ /***/ (function(module, exports) { /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. * - * console.log(arrays[0] === arrays[1]); - * // => false + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ -function stubArray() { - return []; +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; } -module.exports = stubArray; +module.exports = arrayFilter; /***/ }), -/* 166 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(12), - isSymbol = __webpack_require__(36); +var baseTimes = __webpack_require__(331), + isArguments = __webpack_require__(59), + isArray = __webpack_require__(12), + isBuffer = __webpack_require__(60), + isIndex = __webpack_require__(73), + isTypedArray = __webpack_require__(79); -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; +module.exports = arrayLikeKeys; -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(70), + eq = __webpack_require__(58); /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. * - * _.toNumber('3.2'); - * // => 3.2 + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); } -module.exports = toNumber; +module.exports = assignMergeValue; /***/ }), -/* 167 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var createBaseFor = __webpack_require__(345); + /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * - * 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. + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. */ +var baseFor = createBaseFor(); - - -// React 15.5 references this module, and assumes PropTypes are still callable in production. -// Therefore we re-export development-only version with all the PropTypes checks here. -// However if one is migrating to the `prop-types` npm library, they will go through the -// `index.js` entry point, and it will branch depending on the environment. -var factory = __webpack_require__(365); -module.exports = function(isValidElement) { - // It is still allowed in 15.5. - var throwOnDirectAccess = false; - return factory(isValidElement, throwOnDirectAccess); -}; +module.exports = baseFor; /***/ }), -/* 168 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var baseFor = __webpack_require__(181), + keys = __webpack_require__(28); + /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * The base implementation of `_.forOwn` without support for iteratee shorthands. * - * 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. + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; +module.exports = baseForOwn; /***/ }), -/* 169 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var arrayPush = __webpack_require__(99), + isArray = __webpack_require__(12); + /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} +module.exports = baseGetAllKeys; -/** - * CSS properties which accept numbers but are not in units of "px". - */ - -var isUnitlessNumber = { - animationIterationCount: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridRow: true, - gridColumn: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { - // SVG-related properties - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true -}; +var baseFindIndex = __webpack_require__(104), + baseIsNaN = __webpack_require__(314), + strictIndexOf = __webpack_require__(393); /** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } -/** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ -var prefixes = ['Webkit', 'ms', 'Moz', 'O']; +module.exports = baseIndexOf; -// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. -Object.keys(isUnitlessNumber).forEach(function (prop) { - prefixes.forEach(function (prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); -}); + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +var isPrototype = __webpack_require__(56), + nativeKeys = __webpack_require__(380); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -var shorthandPropertyExpansions = { - background: { - backgroundAttachment: true, - backgroundColor: true, - backgroundImage: true, - backgroundPositionX: true, - backgroundPositionY: true, - backgroundRepeat: true - }, - backgroundPosition: { - backgroundPositionX: true, - backgroundPositionY: true - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true - }, - outline: { - outlineWidth: true, - outlineStyle: true, - outlineColor: true +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); } -}; + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} -var CSSProperty = { - isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions -}; +module.exports = baseKeys; -module.exports = CSSProperty; /***/ }), -/* 170 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +var baseEach = __webpack_require__(103), + isArrayLike = __webpack_require__(31); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. * - * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} +module.exports = baseMap; -var _prodInvariant = __webpack_require__(3); +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var Symbol = __webpack_require__(45), + arrayMap = __webpack_require__(54), + isArray = __webpack_require__(12), + isSymbol = __webpack_require__(49); -var PooledClass = __webpack_require__(30); +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; -var invariant = __webpack_require__(1); +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; /** - * A specialized pseudo-event module to help keep track of components waiting to - * be notified when their DOM representations are available for use. - * - * This implements `PooledClass`, so you should never need to instantiate this. - * Instead, use `CallbackQueue.getPooled()`. + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. * - * @class ReactMountReady - * @implements PooledClass - * @internal + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} -var CallbackQueue = function () { - function CallbackQueue(arg) { - _classCallCheck(this, CallbackQueue); - - this._callbacks = null; - this._contexts = null; - this._arg = arg; - } - - /** - * Enqueues a callback to be invoked when `notifyAll` is invoked. - * - * @param {function} callback Invoked when `notifyAll` is invoked. - * @param {?object} context Context to call `callback` with. - * @internal - */ +module.exports = baseToString; - CallbackQueue.prototype.enqueue = function enqueue(callback, context) { - this._callbacks = this._callbacks || []; - this._callbacks.push(callback); - this._contexts = this._contexts || []; - this._contexts.push(context); - }; +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Invokes all enqueued callbacks and clears the queue. This is invoked after - * the DOM representation of a component has been created or updated. - * - * @internal - */ +var castPath = __webpack_require__(71), + last = __webpack_require__(403), + parent = __webpack_require__(384), + toKey = __webpack_require__(57); +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} - CallbackQueue.prototype.notifyAll = function notifyAll() { - var callbacks = this._callbacks; - var contexts = this._contexts; - var arg = this._arg; - if (callbacks && contexts) { - !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; - this._callbacks = null; - this._contexts = null; - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].call(contexts[i], arg); - } - callbacks.length = 0; - contexts.length = 0; - } - }; +module.exports = baseUnset; - CallbackQueue.prototype.checkpoint = function checkpoint() { - return this._callbacks ? this._callbacks.length : 0; - }; - CallbackQueue.prototype.rollback = function rollback(len) { - if (this._callbacks && this._contexts) { - this._callbacks.length = len; - this._contexts.length = len; - } - }; +/***/ }), +/* 189 */ +/***/ (function(module, exports) { - /** - * Resets the internal queue. - * - * @internal - */ +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} +module.exports = cacheHas; - CallbackQueue.prototype.reset = function reset() { - this._callbacks = null; - this._contexts = null; - }; - /** - * `PooledClass` looks for this. - */ +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(27); - CallbackQueue.prototype.destructor = function destructor() { - this.reset(); - }; +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - return CallbackQueue; -}(); +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; -module.exports = PooledClass.addPoolingTo(CallbackQueue); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +/** + * Creates a clone of `buffer`. * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); + return result; +} +module.exports = cloneBuffer; -var DOMProperty = __webpack_require__(27); -var ReactDOMComponentTree = __webpack_require__(7); -var ReactInstrumentation = __webpack_require__(16); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(170)(module))) -var quoteAttributeValueForBrowser = __webpack_require__(435); -var warning = __webpack_require__(2); +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; +var cloneArrayBuffer = __webpack_require__(109); -function isAttributeNameSafe(attributeName) { - if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { - return true; - } - if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { - return false; - } - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0; - return false; +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } -function shouldIgnoreValue(propertyInfo, value) { - return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; -} +module.exports = cloneTypedArray; -/** - * Operations for dealing with DOM properties. - */ -var DOMPropertyOperations = { - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ - createMarkupForID: function (id) { - return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); - }, +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { - setAttributeForID: function (node, id) { - node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); - }, +var getNative = __webpack_require__(40); - createMarkupForRoot: function () { - return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""'; - }, +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); - setAttributeForRoot: function (node) { - node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, ''); - }, +module.exports = defineProperty; - /** - * Creates markup for a property. - * - * @param {string} name - * @param {*} value - * @return {?string} Markup string, or null if the property was invalid. - */ - createMarkupForProperty: function (name, value) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - if (shouldIgnoreValue(propertyInfo, value)) { - return ''; - } - var attributeName = propertyInfo.attributeName; - if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - return attributeName + '=""'; - } - return attributeName + '=' + quoteAttributeValueForBrowser(value); - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - return ''; - } - return name + '=' + quoteAttributeValueForBrowser(value); - } - return null; - }, - /** - * Creates markup for a custom property. - * - * @param {string} name - * @param {*} value - * @return {string} Markup string, or empty string if the property was invalid. - */ - createMarkupForCustomAttribute: function (name, value) { - if (!isAttributeNameSafe(name) || value == null) { - return ''; - } - return name + '=' + quoteAttributeValueForBrowser(value); - }, +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - setValueForProperty: function (node, name, value) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(propertyInfo, value)) { - this.deleteValueForProperty(node, name); - return; - } else if (propertyInfo.mustUseProperty) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propertyInfo.propertyName] = value; - } else { - var attributeName = propertyInfo.attributeName; - var namespace = propertyInfo.attributeNamespace; - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - if (namespace) { - node.setAttributeNS(namespace, attributeName, '' + value); - } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - node.setAttribute(attributeName, ''); - } else { - node.setAttribute(attributeName, '' + value); - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - DOMPropertyOperations.setValueForAttribute(node, name, value); - return; - } +var SetCache = __webpack_require__(175), + arraySome = __webpack_require__(299), + cacheHas = __webpack_require__(189); - if (process.env.NODE_ENV !== 'production') { - var payload = {}; - payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'update attribute', - payload: payload - }); - } - }, +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; - setValueForAttribute: function (node, name, value) { - if (!isAttributeNameSafe(name)) { - return; - } - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; - if (process.env.NODE_ENV !== 'production') { - var payload = {}; - payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'update attribute', - payload: payload - }); - } - }, + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - /** - * Deletes an attributes from a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForAttribute: function (node, name) { - node.removeAttribute(name); - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'remove attribute', - payload: name - }); - } - }, + stack.set(array, other); + stack.set(other, array); - /** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForProperty: function (node, name) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (propertyInfo.mustUseProperty) { - var propName = propertyInfo.propertyName; - if (propertyInfo.hasBooleanValue) { - node[propName] = false; - } else { - node[propName] = ''; - } - } else { - node.removeAttribute(propertyInfo.attributeName); + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; } - } else if (DOMProperty.isCustomAttribute(name)) { - node.removeAttribute(name); + result = false; + break; } - - if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'remove attribute', - payload: name - }); + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; } } + stack['delete'](array); + stack['delete'](other); + return result; +} -}; +module.exports = equalArrays; -module.exports = DOMPropertyOperations; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 172 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/** - * Copyright 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. - * - */ - - +/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -var ReactDOMComponentFlags = { - hasCachedChildNodes: 1 << 0 -}; +module.exports = freeGlobal; -module.exports = ReactDOMComponentFlags; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(95))) /***/ }), -/* 173 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +var baseGetAllKeys = __webpack_require__(183), + getSymbols = __webpack_require__(113), + keys = __webpack_require__(28); + +/** + * Creates an array of own enumerable property names and symbols of `object`. * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} +module.exports = getAllKeys; -var _assign = __webpack_require__(5); +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { -var LinkedValueUtils = __webpack_require__(101); -var ReactDOMComponentTree = __webpack_require__(7); -var ReactUpdates = __webpack_require__(19); +var baseGetAllKeys = __webpack_require__(183), + getSymbolsIn = __webpack_require__(197), + keysIn = __webpack_require__(61); -var warning = __webpack_require__(2); +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} -var didWarnValueLink = false; -var didWarnValueDefaultValue = false; +module.exports = getAllKeysIn; -function updateOptionsIfPendingUpdateAndMounted() { - if (this._rootNodeID && this._wrapperState.pendingUpdate) { - this._wrapperState.pendingUpdate = false; - var props = this._currentElement.props; - var value = LinkedValueUtils.getValue(props); +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { - if (value != null) { - updateOptions(this, Boolean(props.multiple), value); - } +var arrayPush = __webpack_require__(99), + getPrototype = __webpack_require__(112), + getSymbols = __webpack_require__(113), + stubArray = __webpack_require__(209); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseCreate = __webpack_require__(304), + getPrototype = __webpack_require__(112), + isPrototype = __webpack_require__(56); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; } -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } +module.exports = initCloneObject; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +var eq = __webpack_require__(58), + isArrayLike = __webpack_require__(31), + isIndex = __webpack_require__(73), + isObject = __webpack_require__(17); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; } - return ''; + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; } -var valuePropNames = ['value', 'defaultValue']; +module.exports = isIterateeCall; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(17); /** - * Validation function for `value` and `defaultValue`. + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. */ -function checkSelectPropTypes(inst, props) { - var owner = inst._currentElement._owner; - LinkedValueUtils.checkPropTypes('select', props, owner); +function isStrictComparable(value) { + return value === value && !isObject(value); +} - if (props.valueLink !== undefined && !didWarnValueLink) { - process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0; - didWarnValueLink = true; - } +module.exports = isStrictComparable; - for (var i = 0; i < valuePropNames.length; i++) { - var propName = valuePropNames[i]; - if (props[propName] == null) { - continue; - } - var isArray = Array.isArray(props[propName]); - if (props.multiple && !isArray) { - process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; - } - } -} + +/***/ }), +/* 201 */ +/***/ (function(module, exports) { /** - * @param {ReactDOMComponent} inst - * @param {boolean} multiple - * @param {*} propValue A stringable (with `multiple`, a list of stringables). + * Converts `map` to its key-value pairs. + * * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. */ -function updateOptions(inst, multiple, propValue) { - var selectedValue, i; - var options = ReactDOMComponentTree.getNodeFromInstance(inst).options; +function mapToArray(map) { + var index = -1, + result = Array(map.size); - if (multiple) { - selectedValue = {}; - for (i = 0; i < propValue.length; i++) { - selectedValue['' + propValue[i]] = true; - } - for (i = 0; i < options.length; i++) { - var selected = selectedValue.hasOwnProperty(options[i].value); - if (options[i].selected !== selected) { - options[i].selected = selected; - } - } - } else { - // Do not set `select.value` as exact behavior isn't consistent across all - // browsers for all cases. - selectedValue = '' + propValue; - for (i = 0; i < options.length; i++) { - if (options[i].value === selectedValue) { - options[i].selected = true; - return; - } - } - if (options.length) { - options[0].selected = true; - } - } + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; } +module.exports = mapToArray; + + +/***/ }), +/* 202 */ +/***/ (function(module, exports) { + /** - * Implements a must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; + } else if (!props.multiple && isArray) { + process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to host component that allows optionally setting the + * props `value` and `defaultValue`. If `multiple` is false, the prop must be a + * stringable. If `multiple` is true, the prop must be an array of stringables. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * If `value` is not supplied (or null/undefined), user actions that change the + * selected option will trigger updates to the rendered options. + * + * If it is supplied (and not null/undefined), the rendered options will not + * update in response to user actions. Instead, the `value` prop must change in + * order for the rendered options to update. * + * If `defaultValue` is provided, any options with the supplied values will be + * selected. */ +var ReactDOMSelect = { + getHostProps: function (inst, props) { + return _assign({}, props, { + onChange: inst._wrapperState.onChange, + value: undefined + }); + }, + mountWrapper: function (inst, props) { + if (process.env.NODE_ENV !== 'production') { + checkSelectPropTypes(inst, props); + } + var value = LinkedValueUtils.getValue(props); + inst._wrapperState = { + pendingUpdate: false, + initialValue: value != null ? value : props.defaultValue, + listeners: null, + onChange: _handleChange.bind(inst), + wasMultiple: Boolean(props.multiple) + }; -var ViewportMetrics = { + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; + didWarnValueDefaultValue = true; + } + }, - currentScrollLeft: 0, + getSelectValueContext: function (inst) { + // ReactDOMOption looks at this initial value so the initial generated + // markup has correct `selected` attributes + return inst._wrapperState.initialValue; + }, - currentScrollTop: 0, + postUpdateWrapper: function (inst) { + var props = inst._currentElement.props; - refreshScrollValues: function (scrollPosition) { - ViewportMetrics.currentScrollLeft = scrollPosition.x; - ViewportMetrics.currentScrollTop = scrollPosition.y; - } + // After the initial mount, we control selected-ness manually so don't pass + // this value down + inst._wrapperState.initialValue = undefined; + + var wasMultiple = inst._wrapperState.wasMultiple; + inst._wrapperState.wasMultiple = Boolean(props.multiple); + var value = LinkedValueUtils.getValue(props); + if (value != null) { + inst._wrapperState.pendingUpdate = false; + updateOptions(inst, Boolean(props.multiple), value); + } else if (wasMultiple !== Boolean(props.multiple)) { + // For simplicity, reapply `defaultValue` if `multiple` is toggled. + if (props.defaultValue != null) { + updateOptions(inst, Boolean(props.multiple), props.defaultValue); + } else { + // Revert the select back to its default unselected state. + updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : ''); + } + } + } }; -module.exports = ViewportMetrics; +function _handleChange(event) { + var props = this._currentElement.props; + var returnValue = LinkedValueUtils.executeOnChange(props, event); + + if (this._rootNodeID) { + this._wrapperState.pendingUpdate = true; + } + ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); + return returnValue; +} + +module.exports = ReactDOMSelect; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 183 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** +/** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * @@ -15100,59 +19845,30 @@ module.exports = ViewportMetrics; * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * */ -var _prodInvariant = __webpack_require__(3); - -var invariant = __webpack_require__(1); - -/** - * Accumulates items that must not be null or undefined into the first one. This - * is used to conserve memory by avoiding array allocations, and thus sacrifices - * API cleanness. Since `current` can be null before being passed in and not - * null after this function, make sure to assign it back to `current`: - * - * `a = accumulateInto(a, b);` - * - * This API should be sparingly used. Try `accumulate` for something cleaner. - * - * @return {*|array<*>} An accumulation of items. - */ - -function accumulateInto(current, next) { - !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0; - - if (current == null) { - return next; - } +var emptyComponentFactory; - // Both are not empty. Warning: Never call x.concat(y) when you are not - // certain that x is an Array (x could be a string with concat method). - if (Array.isArray(current)) { - if (Array.isArray(next)) { - current.push.apply(current, next); - return current; - } - current.push(next); - return current; +var ReactEmptyComponentInjection = { + injectEmptyComponentFactory: function (factory) { + emptyComponentFactory = factory; } +}; - if (Array.isArray(next)) { - // A bit too dangerous to mutate `next`. - return [current].concat(next); +var ReactEmptyComponent = { + create: function (instantiate) { + return emptyComponentFactory(instantiate); } +}; - return [current, next]; -} +ReactEmptyComponent.injection = ReactEmptyComponentInjection; -module.exports = accumulateInto; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +module.exports = ReactEmptyComponent; /***/ }), -/* 184 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15169,31 +19885,22 @@ module.exports = accumulateInto; -/** - * @param {array} arr an "accumulation" of items which is either an Array or - * a single item. Useful when paired with the `accumulate` module. This is a - * simple utility that allows us to reason about a collection of items, but - * handling the case when there is exactly one item (and we do not need to - * allocate an array). - */ - -function forEachAccumulated(arr, cb, scope) { - if (Array.isArray(arr)) { - arr.forEach(cb, scope); - } else if (arr) { - cb.call(scope, arr); - } -} +var ReactFeatureFlags = { + // When true, call console.time() before and .timeEnd() after each top-level + // render (both initial renders and updates). Useful when looking at prod-mode + // timeline profiles in Chrome, for example. + logTopLevelRenders: false +}; -module.exports = forEachAccumulated; +module.exports = ReactFeatureFlags; /***/ }), -/* 185 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright 2013-present, Facebook, Inc. +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the @@ -15204,68 +19911,69 @@ module.exports = forEachAccumulated; -var ReactNodeTypes = __webpack_require__(180); +var _prodInvariant = __webpack_require__(5); -function getHostComponentFromComposite(inst) { - var type; +var invariant = __webpack_require__(3); - while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) { - inst = inst._renderedComponent; - } +var genericComponentClass = null; +var textComponentClass = null; - if (type === ReactNodeTypes.HOST) { - return inst._renderedComponent; - } else if (type === ReactNodeTypes.EMPTY) { - return null; +var ReactHostComponentInjection = { + // This accepts a class that receives the tag string. This is a catch all + // that can render any kind of tag. + injectGenericComponentClass: function (componentClass) { + genericComponentClass = componentClass; + }, + // This accepts a text component class that takes the text string to be + // rendered as props. + injectTextComponentClass: function (componentClass) { + textComponentClass = componentClass; } -} - -module.exports = getHostComponentFromComposite; - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { +}; -"use strict"; /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * Get a host internal component class for a specific tag. * + * @param {ReactElement} element The element to create. + * @return {function} The internal class constructor function. */ +function createInternalComponent(element) { + !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0; + return new genericComponentClass(element); +} - - -var ExecutionEnvironment = __webpack_require__(8); - -var contentKey = null; +/** + * @param {ReactText} text + * @return {ReactComponent} + */ +function createInstanceForText(text) { + return new textComponentClass(text); +} /** - * Gets the key used to access text content on a DOM node. - * - * @return {?string} Key used to access text content. - * @internal + * @param {ReactComponent} component + * @return {boolean} */ -function getTextContentAccessor() { - if (!contentKey && ExecutionEnvironment.canUseDOM) { - // Prefer textContent to innerText because many browsers support both but - // SVG elements don't support innerText even when
does. - contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; - } - return contentKey; +function isTextComponent(component) { + return component instanceof textComponentClass; } -module.exports = getTextContentAccessor; +var ReactHostComponent = { + createInternalComponent: createInternalComponent, + createInstanceForText: createInstanceForText, + isTextComponent: isTextComponent, + injection: ReactHostComponentInjection +}; + +module.exports = ReactHostComponent; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 187 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** +/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * @@ -15277,130 +19985,123 @@ module.exports = getTextContentAccessor; -var _prodInvariant = __webpack_require__(3), - _assign = __webpack_require__(5); +var ReactDOMSelection = __webpack_require__(437); -var ReactCompositeComponent = __webpack_require__(379); -var ReactEmptyComponent = __webpack_require__(175); -var ReactHostComponent = __webpack_require__(177); +var containsNode = __webpack_require__(278); +var focusNode = __webpack_require__(172); +var getActiveElement = __webpack_require__(173); -var getNextDebugID = __webpack_require__(447); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -// To avoid a cyclic dependency, we create the final class in this module -var ReactCompositeComponentWrapper = function (element) { - this.construct(element); -}; - -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; +function isInDocument(node) { + return containsNode(document.documentElement, node); } /** - * Check if the type reference is a known internal type. I.e. not a user - * provided composite type. - * - * @param {function} type - * @return {boolean} Returns true if this is a valid internal type. + * @ReactInputSelection: React input selection module. Based on Selection.js, + * but modified to be suitable for react and has a couple of bug fixes (doesn't + * assume buttons have range selections allowed). + * Input selection module for React. */ -function isInternalComponentType(type) { - return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; -} +var ReactInputSelection = { + hasSelectionCapabilities: function (elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); + }, -/** - * Given a ReactNode, create an instance that will actually be mounted. - * - * @param {ReactNode} node - * @param {boolean} shouldHaveDebugID - * @return {object} A new instance of the element's constructor. - * @protected - */ -function instantiateReactComponent(node, shouldHaveDebugID) { - var instance; + getSelectionInformation: function () { + var focusedElem = getActiveElement(); + return { + focusedElem: focusedElem, + selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null + }; + }, - if (node === null || node === false) { - instance = ReactEmptyComponent.create(instantiateReactComponent); - } else if (typeof node === 'object') { - var element = node; - var type = element.type; - if (typeof type !== 'function' && typeof type !== 'string') { - var info = ''; - if (process.env.NODE_ENV !== 'production') { - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; - } + /** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + restoreSelection: function (priorSelectionInformation) { + var curFocusedElem = getActiveElement(); + var priorFocusedElem = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; + if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { + if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { + ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); } - info += getDeclarationErrorAddendum(element._owner); - true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0; + focusNode(priorFocusedElem); } + }, - // Special case string values - if (typeof element.type === 'string') { - instance = ReactHostComponent.createInternalComponent(element); - } else if (isInternalComponentType(element.type)) { - // This is temporarily available for custom components that are not string - // representations. I.e. ART. Once those are updated to use the string - // representation, we can drop this code path. - instance = new element.type(element); + /** + * @getSelection: Gets the selection bounds of a focused textarea, input or + * contentEditable node. + * -@input: Look up selection bounds of this input + * -@return {start: selectionStart, end: selectionEnd} + */ + getSelection: function (input) { + var selection; - // We renamed this. Allow the old name for compat. :( - if (!instance.getHostNode) { - instance.getHostNode = instance.getNativeNode; + if ('selectionStart' in input) { + // Modern browser with input or textarea. + selection = { + start: input.selectionStart, + end: input.selectionEnd + }; + } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { + // IE8 input. + var range = document.selection.createRange(); + // There can only be one selection per document in IE, so it must + // be in our element. + if (range.parentElement() === input) { + selection = { + start: -range.moveStart('character', -input.value.length), + end: -range.moveEnd('character', -input.value.length) + }; } } else { - instance = new ReactCompositeComponentWrapper(element); + // Content editable or old IE textarea. + selection = ReactDOMSelection.getOffsets(input); } - } else if (typeof node === 'string' || typeof node === 'number') { - instance = ReactHostComponent.createInstanceForText(node); - } else { - true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0; - } - - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0; - } - // These two fields are used by the DOM and ART diffing algorithms - // respectively. Instead of using expandos on components, we should be - // storing the state needed by the diffing algorithms elsewhere. - instance._mountIndex = 0; - instance._mountImage = null; + return selection || { start: 0, end: 0 }; + }, - if (process.env.NODE_ENV !== 'production') { - instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0; - } + /** + * @setSelection: Sets the selection bounds of a textarea or input and focuses + * the input. + * -@input Set selection bounds of this input or textarea + * -@offsets Object of same form that is returned from get* + */ + setSelection: function (input, offsets) { + var start = offsets.start; + var end = offsets.end; + if (end === undefined) { + end = start; + } - // Internal instances should fully constructed at this point, so they should - // not get any new fields added to them at this point. - if (process.env.NODE_ENV !== 'production') { - if (Object.preventExtensions) { - Object.preventExtensions(instance); + if ('selectionStart' in input) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { + var range = input.createTextRange(); + range.collapse(true); + range.moveStart('character', start); + range.moveEnd('character', end - start); + range.select(); + } else { + ReactDOMSelection.setOffsets(input, offsets); } } +}; - return instance; -} - -_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { - _instantiateReactComponent: instantiateReactComponent -}); - -module.exports = instantiateReactComponent; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +module.exports = ReactInputSelection; /***/ }), -/* 188 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** +/* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * @@ -15408,295 +20109,590 @@ module.exports = instantiateReactComponent; * 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. * - * */ -/** - * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary - */ +var _prodInvariant = __webpack_require__(5); -var supportedInputTypes = { - 'color': true, - 'date': true, - 'datetime': true, - 'datetime-local': true, - 'email': true, - 'month': true, - 'number': true, - 'password': true, - 'range': true, - 'search': true, - 'tel': true, - 'text': true, - 'time': true, - 'url': true, - 'week': true -}; +var DOMLazyTree = __webpack_require__(50); +var DOMProperty = __webpack_require__(37); +var React = __webpack_require__(52); +var ReactBrowserEventEmitter = __webpack_require__(83); +var ReactCurrentOwner = __webpack_require__(30); +var ReactDOMComponentTree = __webpack_require__(10); +var ReactDOMContainerInfo = __webpack_require__(429); +var ReactDOMFeatureFlags = __webpack_require__(431); +var ReactFeatureFlags = __webpack_require__(219); +var ReactInstanceMap = __webpack_require__(64); +var ReactInstrumentation = __webpack_require__(26); +var ReactMarkupChecksum = __webpack_require__(451); +var ReactReconciler = __webpack_require__(51); +var ReactUpdateQueue = __webpack_require__(148); +var ReactUpdates = __webpack_require__(29); -function isTextInputElement(elem) { - var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); +var emptyObject = __webpack_require__(66); +var instantiateReactComponent = __webpack_require__(231); +var invariant = __webpack_require__(3); +var setInnerHTML = __webpack_require__(87); +var shouldUpdateReactComponent = __webpack_require__(154); +var warning = __webpack_require__(4); - if (nodeName === 'input') { - return !!supportedInputTypes[elem.type]; +var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; +var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME; + +var ELEMENT_NODE_TYPE = 1; +var DOC_NODE_TYPE = 9; +var DOCUMENT_FRAGMENT_NODE_TYPE = 11; + +var instancesByReactRootID = {}; + +/** + * Finds the index of the first character + * that's not common between the two given strings. + * + * @return {number} the index of the character where the strings diverge + */ +function firstDifferenceIndex(string1, string2) { + var minLen = Math.min(string1.length, string2.length); + for (var i = 0; i < minLen; i++) { + if (string1.charAt(i) !== string2.charAt(i)) { + return i; + } } + return string1.length === string2.length ? -1 : minLen; +} - if (nodeName === 'textarea') { - return true; +/** + * @param {DOMElement|DOMDocument} container DOM element that may contain + * a React component + * @return {?*} DOM element that may have the reactRoot ID, or null. + */ +function getReactRootElementInContainer(container) { + if (!container) { + return null; } - return false; + if (container.nodeType === DOC_NODE_TYPE) { + return container.documentElement; + } else { + return container.firstChild; + } } -module.exports = isTextInputElement; - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { +function internalGetID(node) { + // If node is something like a window, document, or text node, none of + // which support attributes or a .getAttribute method, gracefully return + // the empty string, as if the attribute were missing. + return node.getAttribute && node.getAttribute(ATTR_NAME) || ''; +} -"use strict"; /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * Mounts this component and inserts it into the DOM. * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {DOMElement} container DOM element to mount into. + * @param {ReactReconcileTransaction} transaction + * @param {boolean} shouldReuseMarkup If true, do not insert markup */ +function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) { + var markerName; + if (ReactFeatureFlags.logTopLevelRenders) { + var wrappedElement = wrapperInstance._currentElement.props.child; + var type = wrappedElement.type; + markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name); + console.time(markerName); + } + var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */ + ); + if (markerName) { + console.timeEnd(markerName); + } -var ExecutionEnvironment = __webpack_require__(8); -var escapeTextContentForBrowser = __webpack_require__(68); -var setInnerHTML = __webpack_require__(69); + wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance; + ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction); +} /** - * Set the textContent property of a node, ensuring that whitespace is preserved - * even in IE8. innerText is a poor substitute for textContent and, among many - * issues, inserts
instead of the literal newline chars. innerHTML behaves - * as it should. + * Batched mount. * - * @param {DOMElement} node - * @param {string} text + * @param {ReactComponent} componentInstance The instance to mount. + * @param {DOMElement} container DOM element to mount into. + * @param {boolean} shouldReuseMarkup If true, do not insert markup + */ +function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( + /* useCreateElement */ + !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement); + transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context); + ReactUpdates.ReactReconcileTransaction.release(transaction); +} + +/** + * Unmounts a component and removes it from the DOM. + * + * @param {ReactComponent} instance React component instance. + * @param {DOMElement} container DOM element to unmount from. + * @final * @internal + * @see {ReactMount.unmountComponentAtNode} */ -var setTextContent = function (node, text) { - if (text) { - var firstChild = node.firstChild; +function unmountComponentFromNode(instance, container, safely) { + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onBeginFlush(); + } + ReactReconciler.unmountComponent(instance, safely); + if (process.env.NODE_ENV !== 'production') { + ReactInstrumentation.debugTool.onEndFlush(); + } - if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { - firstChild.nodeValue = text; - return; - } + if (container.nodeType === DOC_NODE_TYPE) { + container = container.documentElement; } - node.textContent = text; -}; -if (ExecutionEnvironment.canUseDOM) { - if (!('textContent' in document.documentElement)) { - setTextContent = function (node, text) { - if (node.nodeType === 3) { - node.nodeValue = text; - return; - } - setInnerHTML(node, escapeTextContentForBrowser(text)); - }; + // http://jsperf.com/emptying-a-node + while (container.lastChild) { + container.removeChild(container.lastChild); } } -module.exports = setTextContent; - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. +/** + * True if the supplied DOM node has a direct React-rendered child that is + * not a React root element. Useful for warning in `render`, + * `unmountComponentAtNode`, etc. * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM element contains a direct child that was + * rendered by React but is not a root element. + * @internal */ - - - -var _prodInvariant = __webpack_require__(3); - -var ReactCurrentOwner = __webpack_require__(20); -var REACT_ELEMENT_TYPE = __webpack_require__(397); - -var getIteratorFn = __webpack_require__(432); -var invariant = __webpack_require__(1); -var KeyEscapeUtils = __webpack_require__(100); -var warning = __webpack_require__(2); - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; +function hasNonRootReactChild(container) { + var rootEl = getReactRootElementInContainer(container); + if (rootEl) { + var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl); + return !!(inst && inst._hostParent); + } +} /** - * This is inlined from ReactElement since this file is shared between - * isomorphic and renderers. We could extract this to a + * True if the supplied DOM node is a React DOM element and + * it has been rendered by another copy of React. * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM has been rendered by another copy of React + * @internal */ +function nodeIsRenderedByOtherInstance(container) { + var rootEl = getReactRootElementInContainer(container); + return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl)); +} /** - * TODO: Test that a single child and an array with one item have the same key - * pattern. + * True if the supplied DOM node is a valid node element. + * + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM is a valid DOM node. + * @internal */ - -var didWarnAboutMaps = false; +function isValidContainer(node) { + return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); +} /** - * Generate a key string that identifies a component within a set. + * True if the supplied DOM node is a valid React node element. * - * @param {*} component A component that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} + * @param {?DOMElement} node The candidate DOM node. + * @return {boolean} True if the DOM is a valid React DOM node. + * @internal */ -function getComponentKey(component, index) { - // Do some typechecking here since we call this blindly. We want to ensure - // that we don't block potential future ES APIs. - if (component && typeof component === 'object' && component.key != null) { - // Explicit key - return KeyEscapeUtils.escape(component.key); - } - // Implicit key determined by the index in the set - return index.toString(36); +function isReactNode(node) { + return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME)); } -/** - * @param {?*} children Children tree container. - * @param {!string} nameSoFar Name of the key path so far. - * @param {!function} callback Callback to invoke with each child found. - * @param {?*} traverseContext Used to pass information throughout the traversal - * process. - * @return {!number} The number of children in this subtree. - */ -function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { - var type = typeof children; +function getHostRootInstanceInContainer(container) { + var rootEl = getReactRootElementInContainer(container); + var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl); + return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null; +} - if (type === 'undefined' || type === 'boolean') { - // All of the above are perceived as null. - children = null; - } +function getTopLevelWrapperInContainer(container) { + var root = getHostRootInstanceInContainer(container); + return root ? root._hostContainerInfo._topLevelWrapper : null; +} - if (children === null || type === 'string' || type === 'number' || - // The following is inlined from ReactElement. This means we can optimize - // some checks. React Fiber also inlines this logic for similar purposes. - type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { - callback(traverseContext, children, - // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows. - nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); - return 1; - } +/** + * Temporary (?) hack so that we can store all top-level pending updates on + * composites instead of having to worry about different types of components + * here. + */ +var topLevelRootCounter = 1; +var TopLevelWrapper = function () { + this.rootID = topLevelRootCounter++; +}; +TopLevelWrapper.prototype.isReactComponent = {}; +if (process.env.NODE_ENV !== 'production') { + TopLevelWrapper.displayName = 'TopLevelWrapper'; +} +TopLevelWrapper.prototype.render = function () { + return this.props.child; +}; +TopLevelWrapper.isReactTopLevelWrapper = true; - var child; - var nextName; - var subtreeCount = 0; // Count of children found in the current subtree. - var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; +/** + * Mounting is the process of initializing a React component by creating its + * representative DOM elements and inserting them into a supplied `container`. + * Any prior content inside `container` is destroyed in the process. + * + * ReactMount.render( + * component, + * document.getElementById('container') + * ); + * + *
<-- Supplied `container`. + *
<-- Rendered reactRoot of React + * // ... component. + *
+ *
+ * + * Inside of `container`, the first element rendered is the "reactRoot". + */ +var ReactMount = { + TopLevelWrapper: TopLevelWrapper, - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getComponentKey(child, i); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + /** + * Used by devtools. The keys are not important. + */ + _instancesByReactRootID: instancesByReactRootID, + + /** + * This is a hook provided to support rendering React components while + * ensuring that the apparent scroll position of its `container` does not + * change. + * + * @param {DOMElement} container The `container` being rendered into. + * @param {function} renderCallback This must be called once to do the render. + */ + scrollMonitor: function (container, renderCallback) { + renderCallback(); + }, + + /** + * Take a component that's already mounted into the DOM and replace its props + * @param {ReactComponent} prevComponent component instance already in the DOM + * @param {ReactElement} nextElement component instance to render + * @param {DOMElement} container container to render into + * @param {?function} callback function triggered on completion + */ + _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) { + ReactMount.scrollMonitor(container, function () { + ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); + } + }); + + return prevComponent; + }, + + /** + * Render a new component into the DOM. Hooked by hooks! + * + * @param {ReactElement} nextElement element to render + * @param {DOMElement} container container to render into + * @param {boolean} shouldReuseMarkup if we should skip the markup insertion + * @return {ReactComponent} nextComponent + */ + _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; + + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0; + + ReactBrowserEventEmitter.ensureScrollValueMonitoring(); + var componentInstance = instantiateReactComponent(nextElement, false); + + // The initial render is synchronous but any updates that happen during + // rendering, in componentWillMount or componentDidMount, will be batched + // according to the current batching strategy. + + ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context); + + var wrapperID = componentInstance._instance.rootID; + instancesByReactRootID[wrapperID] = componentInstance; + + return componentInstance; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactComponent} parentComponent The conceptual parent of this render tree. + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0; + return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); + }, + + _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { + ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render'); + !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or
." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or
." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; + + process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0; + + var nextWrappedElement = React.createElement(TopLevelWrapper, { + child: nextElement + }); + + var nextContext; + if (parentComponent) { + var parentInst = ReactInstanceMap.get(parentComponent); + nextContext = parentInst._processChildContext(parentInst._context); + } else { + nextContext = emptyObject; } - } else { - var iteratorFn = getIteratorFn(children); - if (iteratorFn) { - var iterator = iteratorFn.call(children); - var step; - if (iteratorFn !== children.entries) { - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getComponentKey(child, ii++); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } + + var prevComponent = getTopLevelWrapperInContainer(container); + + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement; + var prevElement = prevWrappedElement.props.child; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + var publicInst = prevComponent._renderedComponent.getPublicInstance(); + var updatedCallback = callback && function () { + callback.call(publicInst); + }; + ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback); + return publicInst; } else { - if (process.env.NODE_ENV !== 'production') { - var mapsAsChildrenAddendum = ''; - if (ReactCurrentOwner.current) { - var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); - if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; - } - } - process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; - didWarnAboutMaps = true; - } - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - child = entry[1]; - nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + ReactMount.unmountComponentAtNode(container); + } + } + + var reactRootElement = getReactRootElementInContainer(container); + var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0; + + if (!containerHasReactMarkup || reactRootElement.nextSibling) { + var rootElementSibling = reactRootElement; + while (rootElementSibling) { + if (internalGetID(rootElementSibling)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0; + break; } + rootElementSibling = rootElementSibling.nextSibling; } } - } else if (type === 'object') { - var addendum = ''; + } + + var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; + var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance(); + if (callback) { + callback.call(component); + } + return component; + }, + + /** + * Renders a React component into the DOM in the supplied `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + render: function (nextElement, container, callback) { + return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); + }, + + /** + * Unmounts and destroys the React component rendered in the `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode + * + * @param {DOMElement} container DOM element containing a React component. + * @return {boolean} True if a component was found in and unmounted from + * `container` + */ + unmountComponentAtNode: function (container) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (Strictly speaking, unmounting won't cause a + // render but we still don't expect to be in a render call here.) + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; + + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0; + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0; + } + + var prevComponent = getTopLevelWrapperInContainer(container); + if (!prevComponent) { + // Check if the node being unmounted was rendered by React, but isn't a + // root node. + var containerHasNonRootReactChild = hasNonRootReactChild(container); + + // Check if the container itself is a React root node. + var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME); + if (process.env.NODE_ENV !== 'production') { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; - if (children._isReactElement) { - addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; - } - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - addendum += ' Check the render method of `' + name + '`.'; + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; + } + + return false; + } + delete instancesByReactRootID[prevComponent._instance.rootID]; + ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false); + return true; + }, + + _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) { + !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0; + + if (shouldReuseMarkup) { + var rootElement = getReactRootElementInContainer(container); + if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { + ReactDOMComponentTree.precacheNode(instance, rootElement); + return; + } else { + var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); + + var rootMarkup = rootElement.outerHTML; + rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); + + var normalizedMarkup = markup; + if (process.env.NODE_ENV !== 'production') { + // because rootMarkup is retrieved from the DOM, various normalizations + // will have occurred which will not be present in `markup`. Here, + // insert markup into a
or