diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index c7682c902..33d66e2e2 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -17,6 +17,12 @@ 32185B311F20FA2B00752141 /* LanguagePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32185B301F20FA2B00752141 /* LanguagePickerViewController.m */; }; 322806A01F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3228069E1F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.m */; }; 322806A11F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3228069F1F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.xib */; }; + 3233F7311F31F4BF006ACA81 /* JitsiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3233F72F1F31F4BF006ACA81 /* JitsiViewController.m */; }; + 3233F7321F31F4BF006ACA81 /* JitsiViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3233F7301F31F4BF006ACA81 /* JitsiViewController.xib */; }; + 3233F73C1F3306A7006ACA81 /* WidgetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3233F73B1F3306A7006ACA81 /* WidgetManager.m */; }; + 3233F73F1F331F05006ACA81 /* Widget.m in Sources */ = {isa = PBXBuildFile; fileRef = 3233F73E1F331F05006ACA81 /* Widget.m */; }; + 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; }; + 3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 32471CDC1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32471CDA1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.m */; }; 32471CDD1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32471CDB1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib */; }; 32471CE11F13AC1500BDF50A /* RoomMembershipExpandedWithPaginationTitleBubbleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32471CDF1F13AC1500BDF50A /* RoomMembershipExpandedWithPaginationTitleBubbleCell.m */; }; @@ -494,6 +500,20 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 3233F7481F3497E2006ACA81 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 1129C74A281B080432B1A1A1 /* Pods-Riot.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Riot.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Riot/Pods-Riot.debug.xcconfig"; sourceTree = ""; }; 24B5103C1EFA7083004C6AD2 /* ReadReceiptsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadReceiptsViewController.h; sourceTree = ""; }; @@ -512,6 +532,14 @@ 3228069D1F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoomMembershipExpandedBubbleCell.h; sourceTree = ""; }; 3228069E1F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoomMembershipExpandedBubbleCell.m; sourceTree = ""; }; 3228069F1F0F64C4008C53D7 /* RoomMembershipExpandedBubbleCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RoomMembershipExpandedBubbleCell.xib; sourceTree = ""; }; + 3233F72E1F31F4BF006ACA81 /* JitsiViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitsiViewController.h; sourceTree = ""; }; + 3233F72F1F31F4BF006ACA81 /* JitsiViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitsiViewController.m; sourceTree = ""; }; + 3233F7301F31F4BF006ACA81 /* JitsiViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JitsiViewController.xib; sourceTree = ""; }; + 3233F73A1F3306A6006ACA81 /* WidgetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetManager.h; sourceTree = ""; }; + 3233F73B1F3306A7006ACA81 /* WidgetManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WidgetManager.m; sourceTree = ""; }; + 3233F73D1F331F05006ACA81 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = ""; }; + 3233F73E1F331F05006ACA81 /* Widget.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Widget.m; sourceTree = ""; }; + 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = ""; }; 32471CD91F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoomMembershipCollapsedWithPaginationTitleBubbleCell.h; sourceTree = ""; }; 32471CDA1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoomMembershipCollapsedWithPaginationTitleBubbleCell.m; sourceTree = ""; }; 32471CDB1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib; sourceTree = ""; }; @@ -1116,6 +1144,7 @@ buildActionMask = 2147483647; files = ( E2EAC1A4FBD6FE5228584591 /* libPods-Riot.a in Frameworks */, + 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1142,6 +1171,43 @@ path = Directory; sourceTree = ""; }; + 3233F7291F31F3B4006ACA81 /* libs */ = { + isa = PBXGroup; + children = ( + 3233F7431F3497DA006ACA81 /* jitsi-meet */, + ); + path = libs; + sourceTree = ""; + }; + 3233F72D1F31F47E006ACA81 /* Widgets */ = { + isa = PBXGroup; + children = ( + 3233F72E1F31F4BF006ACA81 /* JitsiViewController.h */, + 3233F72F1F31F4BF006ACA81 /* JitsiViewController.m */, + 3233F7301F31F4BF006ACA81 /* JitsiViewController.xib */, + ); + path = Widgets; + sourceTree = ""; + }; + 3233F7391F33065F006ACA81 /* Widgets */ = { + isa = PBXGroup; + children = ( + 3233F73A1F3306A6006ACA81 /* WidgetManager.h */, + 3233F73B1F3306A7006ACA81 /* WidgetManager.m */, + 3233F73D1F331F05006ACA81 /* Widget.h */, + 3233F73E1F331F05006ACA81 /* Widget.m */, + ); + path = Widgets; + sourceTree = ""; + }; + 3233F7431F3497DA006ACA81 /* jitsi-meet */ = { + isa = PBXGroup; + children = ( + 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */, + ); + path = "jitsi-meet"; + sourceTree = ""; + }; 327382A71F276AD200356143 /* de.lproj */ = { isa = PBXGroup; children = ( @@ -1226,6 +1292,7 @@ F083BC0F1E7009EC00A9B29C /* Utils */, F083BC191E7009EC00A9B29C /* ViewController */, F083BC571E7009EC00A9B29C /* Views */, + 3233F7291F31F3B4006ACA81 /* libs */, F083BB0C1E7009EC00A9B29C /* AppDelegate.h */, F083BB0D1E7009EC00A9B29C /* AppDelegate.m */, F083BBE21E7009EC00A9B29C /* Main.storyboard */, @@ -1593,6 +1660,7 @@ F083BC0F1E7009EC00A9B29C /* Utils */ = { isa = PBXGroup; children = ( + 3233F7391F33065F006ACA81 /* Widgets */, F083BC101E7009EC00A9B29C /* AvatarGenerator.h */, F083BC111E7009EC00A9B29C /* AvatarGenerator.m */, F083BC121E7009EC00A9B29C /* EventFormatter.h */, @@ -1608,6 +1676,7 @@ F083BC191E7009EC00A9B29C /* ViewController */ = { isa = PBXGroup; children = ( + 3233F72D1F31F47E006ACA81 /* Widgets */, F0131DE31F2200D600CBF707 /* RiotSplitViewController.h */, F0131DE41F2200D600CBF707 /* RiotSplitViewController.m */, F0E059FE1E963103004B83FB /* FavouritesViewController.h */, @@ -2073,6 +2142,7 @@ F094A9A01B78D8F000B1FBBF /* Resources */, 44C35695CFA4F9799C449367 /* [CP] Copy Pods Resources */, 381DA4CC07D2104BFA23E45A /* [CP] Embed Pods Frameworks */, + 3233F7481F3497E2006ACA81 /* Embed Frameworks */, ); buildRules = ( ); @@ -2189,6 +2259,7 @@ F083BD3D1E7009ED00A9B29C /* call_hangup_icon@2x.png in Resources */, F083BE551E7009ED00A9B29C /* RoomOutgoingEncryptedTextMsgWithoutSenderNameBubbleCell.xib in Resources */, 32471CDD1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib in Resources */, + 3233F7321F31F4BF006ACA81 /* JitsiViewController.xib in Resources */, F083BD301E7009ED00A9B29C /* bubbles_bg_landscape.png in Resources */, F083BDA41E7009ED00A9B29C /* notifications.png in Resources */, F083BE0F1E7009ED00A9B29C /* ContactsTableViewController.xib in Resources */, @@ -2592,6 +2663,7 @@ F083BE661E7009ED00A9B29C /* RoomIncomingTextMsgWithPaginationTitleBubbleCell.m in Sources */, F083BE141E7009ED00A9B29C /* HomeViewController.m in Sources */, F083BDFB1E7009ED00A9B29C /* RoomSearchDataSource.m in Sources */, + 3233F73C1F3306A7006ACA81 /* WidgetManager.m in Sources */, F083BE281E7009ED00A9B29C /* StartChatViewController.m in Sources */, F083BE841E7009ED00A9B29C /* RoomIdOrAliasTableViewCell.m in Sources */, F083BD1D1E7009ED00A9B29C /* RageShakeManager.m in Sources */, @@ -2621,6 +2693,7 @@ F083BE2F1E7009ED00A9B29C /* ContactTableViewCell.m in Sources */, F083BE901E7009ED00A9B29C /* RoomTitleView.m in Sources */, F083BE6E1E7009ED00A9B29C /* RoomOutgoingAttachmentWithPaginationTitleBubbleCell.m in Sources */, + 3233F7311F31F4BF006ACA81 /* JitsiViewController.m in Sources */, F083BE2A1E7009ED00A9B29C /* UsersDevicesViewController.m in Sources */, F083BE2D1E7009ED00A9B29C /* ForgotPasswordInputsView.m in Sources */, F083BE7E1E7009ED00A9B29C /* InviteRecentTableViewCell.m in Sources */, @@ -2644,6 +2717,7 @@ F083BE401E7009ED00A9B29C /* RoomIncomingEncryptedTextMsgBubbleCell.m in Sources */, 32AE61E91F0CE099007255F4 /* RoomMembershipWithPaginationTitleBubbleCell.m in Sources */, F083BDFD1E7009ED00A9B29C /* PublicRoomsDirectoryDataSource.m in Sources */, + 3233F73F1F331F05006ACA81 /* Widget.m in Sources */, F083BE191E7009ED00A9B29C /* RecentsViewController.m in Sources */, F083BE351E7009ED00A9B29C /* MediaAlbumTableCell.m in Sources */, F083BE4C1E7009ED00A9B29C /* RoomOutgoingEncryptedAttachmentWithoutSenderInfoBubbleCell.m in Sources */, @@ -2923,6 +2997,11 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 7J4U792NQT; ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Riot/libs", + "$(PROJECT_DIR)/Riot/libs/jitsi-meet", + ); INFOPLIST_FILE = Riot/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -2940,6 +3019,11 @@ CODE_SIGN_ENTITLEMENTS = Riot/Riot.entitlements; DEVELOPMENT_TEAM = 7J4U792NQT; ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Riot/libs", + "$(PROJECT_DIR)/Riot/libs/jitsi-meet", + ); INFOPLIST_FILE = Riot/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf new file mode 100644 index 000000000..1c8f5e910 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf new file mode 100644 index 000000000..b270f9851 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf new file mode 100644 index 000000000..35acda2fa Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf new file mode 100644 index 000000000..6cce217dd Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h new file mode 100644 index 000000000..e1b00906d --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h @@ -0,0 +1,18 @@ +/* + * Copyright @ 2017-present Atlassian Pty Ltd + * + * 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. + */ + +#import +#import diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h new file mode 100644 index 000000000..f328d8f44 --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h @@ -0,0 +1,46 @@ +/* + * Copyright @ 2017-present Atlassian Pty Ltd + * + * 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. + */ + +#import +#import + +#import "JitsiMeetViewDelegate.h" + +@interface JitsiMeetView : UIView + +@property (nonatomic, nullable, weak) id delegate; + +@property (nonatomic) BOOL welcomePageEnabled; + ++ (BOOL)application:(UIApplication *_Nonnull)application + didFinishLaunchingWithOptions:(NSDictionary *_Nonnull)launchOptions; + ++ (BOOL)application:(UIApplication * _Nonnull)application + continueUserActivity:(NSUserActivity * _Nonnull)userActivity + restorationHandler:(void (^ _Nullable)(NSArray * _Nullable))restorationHandler; + ++ (BOOL)application:(UIApplication * _Nonnull)application + openURL:(NSURL * _Nonnull)URL + sourceApplication:(NSString * _Nullable)sourceApplication + annotation:(id _Nullable)annotation; + +- (void)loadURL:(NSURL * _Nullable)url; + +- (void)loadURLObject:(NSDictionary * _Nullable)urlObject; + +- (void)loadURLString:(NSString * _Nullable)urlString; + +@end diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h new file mode 100644 index 000000000..66748e57b --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h @@ -0,0 +1,62 @@ +/* + * Copyright @ 2017-present Atlassian Pty Ltd + * + * 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. + */ + +@protocol JitsiMeetViewDelegate + +@optional + +/** + * Called when a joining a conference was unsuccessful or when there was an + * error while in a conference. + * + * The {@code data} dictionary contains an "error" key describing the error and + * a {@code url} key with the conference URL. + */ +- (void) conferenceFailed:(NSDictionary *)data; + +/** + * Called when a conference was joined. + * + * The {@code data} dictionary contains a {@code url} key with the conference + * URL. + */ +- (void) conferenceJoined:(NSDictionary *)data; + +/** + * Called when a conference was left. + * + * The {@code data} dictionary contains a {@code url} key with the conference + * URL. + */ +- (void) conferenceLeft:(NSDictionary *)data; + +/** + * Called before a conference is joined. + * + * The {@code data} dictionary contains a {@code url} key with the conference + * URL. + */ +- (void) conferenceWillJoin:(NSDictionary *)data; + +/** + * Called before a conference is left. + * + * The {@code data} dictionary contains a {@code url} key with the conference + * URL. + */ +- (void) conferenceWillLeave:(NSDictionary *)data; + +@end diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist b/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist new file mode 100644 index 000000000..7f88aa473 --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist @@ -0,0 +1,76 @@ + + + + + BuildMachineOSBuild + 16F73 + CFBundleDevelopmentRegion + en + CFBundleExecutable + JitsiMeet + CFBundleIdentifier + org.jitsi.JitsiMeetSDK.ios + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + JitsiMeet + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 14E8301 + DTPlatformName + iphoneos + DTPlatformVersion + 10.3 + DTSDKBuild + 14E8301 + DTSDKName + iphoneos10.3 + DTXcode + 0833 + DTXcodeBuild + 8E3004b + JitsiMeetFonts + + FontAwesome.ttf + jitsi.ttf + + MinimumOSVersion + 10.3 + NSAppTransportSecurity + + NSExceptionDomains + + 192.168.2.9.xip.io + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + localhost + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + + diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf new file mode 100644 index 000000000..307ad889a Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet b/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet new file mode 100755 index 000000000..6bf51cc49 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf new file mode 100644 index 000000000..832a57b3d Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf new file mode 100644 index 000000000..7015564ad Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap b/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap new file mode 100644 index 000000000..c0d81130d --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module JitsiMeet { + umbrella header "JitsiMeet.h" + + export * + module * { export * } +} diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf new file mode 100644 index 000000000..5b1f7d6ea Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf new file mode 100644 index 000000000..6ecb68683 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf new file mode 100644 index 000000000..e4ae46c62 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png new file mode 100644 index 000000000..4244656b9 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@1.5x.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@1.5x.png new file mode 100644 index 000000000..e43fa0622 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@1.5x.png differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@2x.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@2x.png new file mode 100644 index 000000000..a8b6e9a63 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@2x.png differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@3x.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@3x.png new file mode 100644 index 000000000..07ea37b4e Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@3x.png differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@4x.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@4x.png new file mode 100644 index 000000000..7899053f6 Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon@4x.png differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/ip.txt b/Riot/libs/jitsi-meet/JitsiMeet.framework/ip.txt new file mode 100644 index 000000000..374d5c6fa --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/ip.txt @@ -0,0 +1 @@ +192.168.2.9.xip.io diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf new file mode 100755 index 000000000..4542f317c Binary files /dev/null and b/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle b/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle new file mode 100644 index 000000000..3efe0e4fc --- /dev/null +++ b/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle @@ -0,0 +1,110469 @@ +(function(global) { + +global.__DEV__ = true; + +global.__BUNDLE_START_TIME__ = Date.now(); +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +'use strict'; + +global.require = _require; +global.__d = define; + +var modules = Object.create(null); +if (__DEV__) { + var verboseNamesToModuleIds = Object.create(null); +} + +function define(factory, moduleId, dependencyMap) { + if (moduleId in modules) { + return; + } + modules[moduleId] = { + dependencyMap: dependencyMap, + exports: undefined, + factory: factory, + hasError: false, + isInitialized: false + }; + if (__DEV__) { + modules[moduleId].hot = createHotReloadingObject(); + + var _verboseName = arguments[3]; + if (_verboseName) { + modules[moduleId].verboseName = _verboseName; + verboseNamesToModuleIds[_verboseName] = moduleId; + } + } +} + +function _require(moduleId) { + if (__DEV__ && typeof moduleId === 'string') { + var _verboseName2 = moduleId; + moduleId = verboseNamesToModuleIds[moduleId]; + if (moduleId == null) { + throw new Error('Unknown named module: \'' + _verboseName2 + '\''); + } else { + console.warn('Requiring module \'' + _verboseName2 + '\' by name is only supported for ' + 'debugging purposes and will BREAK IN PRODUCTION!'); + } + } + + var moduleIdReallyIsNumber = moduleId; + var module = modules[moduleIdReallyIsNumber]; + return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module); +} + +var inGuard = false; +function guardedLoadModule(moduleId, module) { + if (!inGuard && global.ErrorUtils) { + inGuard = true; + var returnValue = void 0; + try { + returnValue = loadModuleImplementation(moduleId, module); + } catch (e) { + global.ErrorUtils.reportFatalError(e); + } + inGuard = false; + return returnValue; + } else { + return loadModuleImplementation(moduleId, module); + } +} + +function loadModuleImplementation(moduleId, module) { + var nativeRequire = global.nativeRequire; + if (!module && nativeRequire) { + nativeRequire(moduleId); + module = modules[moduleId]; + } + + if (!module) { + throw unknownModuleError(moduleId); + } + + if (module.hasError) { + throw moduleThrewError(moduleId); + } + + if (__DEV__) { + var Systrace = _require.Systrace; + } + + module.isInitialized = true; + var exports = module.exports = {}; + var _module = module, + factory = _module.factory, + dependencyMap = _module.dependencyMap; + + try { + if (__DEV__) { + Systrace.beginEvent('JS_require_' + (module.verboseName || moduleId)); + } + + var _moduleObject = { exports: exports }; + if (__DEV__ && module.hot) { + _moduleObject.hot = module.hot; + } + + factory(global, _require, _moduleObject, exports, dependencyMap); + + if (!__DEV__) { + module.factory = undefined; + } + + if (__DEV__) { + Systrace.endEvent(); + } + return module.exports = _moduleObject.exports; + } catch (e) { + module.hasError = true; + module.isInitialized = false; + module.exports = undefined; + throw e; + } +} + +function unknownModuleError(id) { + var message = 'Requiring unknown module "' + id + '".'; + if (__DEV__) { + message += 'If you are sure the module is there, try restarting the packager or running "npm install".'; + } + return Error(message); +} + +function moduleThrewError(id) { + return Error('Requiring module "' + id + '", which threw an exception.'); +} + +if (__DEV__) { + _require.Systrace = { beginEvent: function beginEvent() {}, endEvent: function endEvent() {} }; + + var createHotReloadingObject = function createHotReloadingObject() { + var hot = { + acceptCallback: null, + accept: function accept(callback) { + hot.acceptCallback = callback; + } + }; + return hot; + }; + + var acceptAll = function acceptAll(dependentModules, inverseDependencies) { + if (!dependentModules || dependentModules.length === 0) { + return true; + } + + var notAccepted = dependentModules.filter(function (module) { + return !_accept(module, undefined, inverseDependencies); + }); + + var parents = []; + for (var i = 0; i < notAccepted.length; i++) { + if (inverseDependencies[notAccepted[i]].length === 0) { + return false; + } + + parents.push.apply(parents, babelHelpers.toConsumableArray(inverseDependencies[notAccepted[i]])); + } + + return acceptAll(parents, inverseDependencies); + }; + + var _accept = function _accept(id, factory, inverseDependencies) { + var mod = modules[id]; + + if (!mod && factory) { + define(factory, id); + return true; + } + + var hot = mod.hot; + + if (!hot) { + console.warn('Cannot accept module because Hot Module Replacement ' + 'API was not installed.'); + return false; + } + + if (factory) { + mod.factory = factory; + } + mod.hasError = false; + mod.isInitialized = false; + _require(id); + + if (hot.acceptCallback) { + hot.acceptCallback(); + return true; + } else { + if (!inverseDependencies) { + throw new Error('Undefined `inverseDependencies`'); + } + + return acceptAll(inverseDependencies[id], inverseDependencies); + } + }; + + global.__accept = _accept; +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +Object.assign = function (target, sources) { + if (__DEV__) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + if (typeof target !== 'object' && typeof target !== 'function') { + throw new TypeError('In this environment the target of assign MUST be an object.' + 'This error is a performance optimization and not spec compliant.'); + } + } + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + if (nextSource == null) { + continue; + } + + if (__DEV__) { + if (typeof nextSource !== 'object' && typeof nextSource !== 'function') { + throw new TypeError('In this environment the sources for assign MUST be an object.' + 'This error is a performance optimization and not spec compliant.'); + } + } + + for (var key in nextSource) { + if (__DEV__) { + var hasOwnProperty = Object.prototype.hasOwnProperty; + if (!hasOwnProperty.call(nextSource, key)) { + throw new TypeError('One of the sources for assign has an enumerable key on the ' + 'prototype chain. Are you trying to assign a prototype property? ' + 'We don\'t allow it, as this is an edge case that we do not support. ' + 'This error is a performance optimization and not spec compliant.'); + } + } + target[key] = nextSource[key]; + } + } + + return target; +}; +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { +var inspect = function () { + + function inspect(obj, opts) { + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + return formatValue(ctx, obj, opts.depth); + } + + function stylizeNoColor(str, styleType) { + return str; + } + + function arrayToHash(array) { + var hash = {}; + + array.forEach(function (val, idx) { + hash[val] = true; + }); + + return hash; + } + + function formatValue(ctx, value, recurseTimes) { + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', + array = false, + braces = ['{', '}']; + + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); + } + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); + + if (isNull(value)) return ctx.stylize('null', 'null'); + } + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); + } + }); + return output; + } + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + function isArray(ar) { + return Array.isArray(ar); + } + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + + function isNull(arg) { + return arg === null; + } + + function isNullOrUndefined(arg) { + return arg == null; + } + + function isNumber(arg) { + return typeof arg === 'number'; + } + + function isString(arg) { + return typeof arg === 'string'; + } + + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + + function isUndefined(arg) { + return arg === void 0; + } + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + + function isError(e) { + return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); + } + + function isFunction(arg) { + return typeof arg === 'function'; + } + + function isPrimitive(arg) { + return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || typeof arg === 'undefined'; + } + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + return inspect; +}(); + +var OBJECT_COLUMN_NAME = '(index)'; +var LOG_LEVELS = { + trace: 0, + info: 1, + warn: 2, + error: 3 +}; +var INSPECTOR_LEVELS = []; +INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug'; +INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log'; +INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning'; +INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error'; + +var INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1; + +function setupConsole(global) { + if (!global.nativeLoggingHook) { + return; + } + + function getNativeLogFunction(level) { + return function () { + var str = void 0; + if (arguments.length === 1 && typeof arguments[0] === 'string') { + str = arguments[0]; + } else { + str = Array.prototype.map.call(arguments, function (arg) { + return inspect(arg, { depth: 10 }); + }).join(', '); + } + + var logLevel = level; + if (str.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) { + logLevel = LOG_LEVELS.warn; + } + if (global.__inspectorLog) { + global.__inspectorLog(INSPECTOR_LEVELS[logLevel], str, [].slice.call(arguments), INSPECTOR_FRAMES_TO_SKIP); + } + global.nativeLoggingHook(str, logLevel); + }; + } + + function repeat(element, n) { + return Array.apply(null, Array(n)).map(function () { + return element; + }); + }; + + function consoleTablePolyfill(rows) { + if (!Array.isArray(rows)) { + var data = rows; + rows = []; + for (var key in data) { + if (data.hasOwnProperty(key)) { + var row = data[key]; + row[OBJECT_COLUMN_NAME] = key; + rows.push(row); + } + } + } + if (rows.length === 0) { + global.nativeLoggingHook('', LOG_LEVELS.info); + return; + } + + var columns = Object.keys(rows[0]).sort(); + var stringRows = []; + var columnWidths = []; + + columns.forEach(function (k, i) { + columnWidths[i] = k.length; + for (var j = 0; j < rows.length; j++) { + var cellStr = (rows[j][k] || '?').toString(); + stringRows[j] = stringRows[j] || []; + stringRows[j][i] = cellStr; + columnWidths[i] = Math.max(columnWidths[i], cellStr.length); + } + }); + + function joinRow(row, space) { + var cells = row.map(function (cell, i) { + var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join(''); + return cell + extraSpaces; + }); + space = space || ' '; + return cells.join(space + '|' + space); + }; + + var separators = columnWidths.map(function (columnWidth) { + return repeat('-', columnWidth).join(''); + }); + var separatorRow = joinRow(separators, '-'); + var header = joinRow(columns); + var table = [header, separatorRow]; + + for (var i = 0; i < rows.length; i++) { + table.push(joinRow(stringRows[i])); + } + + global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info); + } + + var originalConsole = global.console; + var descriptor = Object.getOwnPropertyDescriptor(global, 'console'); + if (descriptor) { + Object.defineProperty(global, 'originalConsole', descriptor); + } + + global.console = { + error: getNativeLogFunction(LOG_LEVELS.error), + info: getNativeLogFunction(LOG_LEVELS.info), + log: getNativeLogFunction(LOG_LEVELS.info), + warn: getNativeLogFunction(LOG_LEVELS.warn), + trace: getNativeLogFunction(LOG_LEVELS.trace), + debug: getNativeLogFunction(LOG_LEVELS.trace), + table: consoleTablePolyfill + }; + + if (__DEV__ && originalConsole) { + Object.keys(console).forEach(function (methodName) { + var reactNativeMethod = console[methodName]; + if (originalConsole[methodName]) { + console[methodName] = function () { + originalConsole[methodName].apply(originalConsole, arguments); + reactNativeMethod.apply(console, arguments); + }; + } + }); + } +} + +if (typeof module !== 'undefined') { + module.exports = setupConsole; +} else { + setupConsole(global); +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +var _inGuard = 0; + +var _globalHandler = function onError(e) { + throw e; +}; + +var ErrorUtils = { + setGlobalHandler: function setGlobalHandler(fun) { + _globalHandler = fun; + }, + getGlobalHandler: function getGlobalHandler() { + return _globalHandler; + }, + reportError: function reportError(error) { + _globalHandler && _globalHandler(error); + }, + reportFatalError: function reportFatalError(error) { + _globalHandler && _globalHandler(error, true); + }, + applyWithGuard: function applyWithGuard(fun, context, args) { + try { + _inGuard++; + return fun.apply(context, args); + } catch (e) { + ErrorUtils.reportError(e); + } finally { + _inGuard--; + } + }, + applyWithGuardIfNeeded: function applyWithGuardIfNeeded(fun, context, args) { + if (ErrorUtils.inGuard()) { + return fun.apply(context, args); + } else { + ErrorUtils.applyWithGuard(fun, context, args); + } + }, + inGuard: function inGuard() { + return _inGuard; + }, + guard: function guard(fun, name, context) { + if (typeof fun !== 'function') { + console.warn('A function must be passed to ErrorUtils.guard, got ', fun); + return null; + } + name = name || fun.name || ''; + function guarded() { + return ErrorUtils.applyWithGuard(fun, context || this, arguments, null, name); + } + + return guarded; + } +}; + +global.ErrorUtils = ErrorUtils; +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +if (Number.EPSILON === undefined) { + Object.defineProperty(Number, 'EPSILON', { + value: Math.pow(2, -52) + }); +} +if (Number.MAX_SAFE_INTEGER === undefined) { + Object.defineProperty(Number, 'MAX_SAFE_INTEGER', { + value: Math.pow(2, 53) - 1 + }); +} +if (Number.MIN_SAFE_INTEGER === undefined) { + Object.defineProperty(Number, 'MIN_SAFE_INTEGER', { + value: -(Math.pow(2, 53) - 1) + }); +} +if (!Number.isNaN) { + var globalIsNaN = global.isNaN; + Object.defineProperty(Number, 'isNaN', { + configurable: true, + enumerable: false, + value: function isNaN(value) { + return typeof value === 'number' && globalIsNaN(value); + }, + writable: true + }); +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (search) { + 'use strict'; + + if (this == null) { + throw TypeError(); + } + var string = String(this); + var pos = arguments.length > 1 ? Number(arguments[1]) || 0 : 0; + var start = Math.min(Math.max(pos, 0), string.length); + return string.indexOf(String(search), pos) === start; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (search) { + 'use strict'; + + if (this == null) { + throw TypeError(); + } + var string = String(this); + var stringLength = string.length; + var searchString = String(search); + var pos = arguments.length > 1 ? Number(arguments[1]) || 0 : stringLength; + var end = Math.min(Math.max(pos, 0), stringLength); + var start = end - searchString.length; + if (start < 0) { + return false; + } + return string.lastIndexOf(searchString, start) === start; + }; +} + +if (!String.prototype.repeat) { + String.prototype.repeat = function (count) { + 'use strict'; + + if (this == null) { + throw TypeError(); + } + var string = String(this); + count = Number(count) || 0; + if (count < 0 || count === Infinity) { + throw RangeError(); + } + if (count === 1) { + return string; + } + var result = ''; + while (count) { + if (count & 1) { + result += string; + } + if (count >>= 1) { + string += string; + } + } + return result; + }; +} + +if (!String.prototype.includes) { + String.prototype.includes = function (search, start) { + 'use strict'; + + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > this.length) { + return false; + } else { + return this.indexOf(search, start) !== -1; + } + }; +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { +function findIndex(predicate, context) { + if (this == null) { + throw new TypeError('Array.prototype.findIndex called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + for (var i = 0; i < length; i++) { + if (predicate.call(context, list[i], i, list)) { + return i; + } + } + return -1; +} + +if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, 'findIndex', { + enumerable: false, + writable: true, + configurable: true, + value: findIndex + }); +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + enumerable: false, + writable: true, + configurable: true, + value: function value(predicate, context) { + if (this == null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + var index = findIndex.call(this, predicate, context); + return index === -1 ? undefined : this[index]; + } + }); +} + +if (!Array.prototype.includes) { + Object.defineProperty(Array.prototype, 'includes', { + enumerable: false, + writable: true, + configurable: true, + value: function value(searchElement) { + var O = Object(this); + var len = parseInt(O.length) || 0; + if (len === 0) { + return false; + } + var n = parseInt(arguments[1]) || 0; + var k; + if (n >= 0) { + k = n; + } else { + k = len + n; + if (k < 0) { + k = 0; + } + } + var currentElement; + while (k < len) { + currentElement = O[k]; + if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { + return true; + } + k++; + } + return false; + } + }); +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { +if (!Array.from) { + Array.from = function (arrayLike) { + if (arrayLike == null) { + throw new TypeError('Object is null or undefined'); + } + + var mapFn = arguments[1]; + var thisArg = arguments[2]; + + var C = this; + var items = Object(arrayLike); + var symbolIterator = typeof Symbol === 'function' ? typeof Symbol === 'function' ? Symbol.iterator : '@@iterator' : '@@iterator'; + var mapping = typeof mapFn === 'function'; + var usingIterator = typeof items[symbolIterator] === 'function'; + var key = 0; + var ret; + var value; + + if (usingIterator) { + ret = typeof C === 'function' ? new C() : []; + var it = items[symbolIterator](); + var next; + + while (!(next = it.next()).done) { + value = next.value; + + if (mapping) { + value = mapFn.call(thisArg, value, key); + } + + ret[key] = value; + key += 1; + } + + ret.length = key; + return ret; + } + + var len = items.length; + if (isNaN(len) || len < 0) { + len = 0; + } + + ret = typeof C === 'function' ? new C(len) : new Array(len); + + while (key < len) { + value = items[key]; + + if (mapping) { + value = mapFn.call(thisArg, value, key); + } + + ret[key] = value; + + key += 1; + } + + ret.length = key; + return ret; + }; +} +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +(function () { + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + if (typeof Object.entries !== 'function') { + Object.entries = function (object) { + if (object == null) { + throw new TypeError('Object.entries called on non-object'); + } + + var entries = []; + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + entries.push([key, object[key]]); + } + } + return entries; + }; + } + + if (typeof Object.values !== 'function') { + Object.values = function (object) { + if (object == null) { + throw new TypeError('Object.values called on non-object'); + } + + var values = []; + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + values.push(object[key]); + } + } + return values; + }; + } +})(); +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +(function(global) { + +var babelHelpers = global.babelHelpers = {}; + +babelHelpers.typeof = typeof Symbol === "function" && typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof obj; +}; + +babelHelpers.createRawReactElement = function () { + var REACT_ELEMENT_TYPE = typeof Symbol === "function" && (typeof Symbol === "function" ? Symbol.for : "@@for") && (typeof Symbol === "function" ? Symbol.for : "@@for")("react.element") || 0xeac7; + return function createRawReactElement(type, key, props) { + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: null, + props: props, + _owner: null + }; + }; +}(); + +babelHelpers.classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +babelHelpers.createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +babelHelpers.defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; + +babelHelpers._extends = babelHelpers.extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +babelHelpers.get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; + +babelHelpers.inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + +babelHelpers.interopRequireDefault = function (obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +}; + +babelHelpers.interopRequireWildcard = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +}; + +babelHelpers.objectWithoutProperties = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +}; + +babelHelpers.possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +babelHelpers.slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((typeof Symbol === "function" ? Symbol.iterator : "@@iterator") in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + +babelHelpers.taggedTemplateLiteral = function (strings, raw) { + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +}; + +babelHelpers.toArray = function (arr) { + return Array.isArray(arr) ? arr : Array.from(arr); +}; + +babelHelpers.toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + }return arr2; + } else { + return Array.from(arr); + } +}; +})(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this); +__d(/* jitsi-meet/index.ios.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = require(12 ); // 12 = ./react/index.native + +Object.keys(_index).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _index[key]; + } + }); +}); +}, 0, null, "jitsi-meet/index.ios.js"); +__d(/* jitsi-meet/react/index.native.js */function(global, require, module, exports) {var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/react/index.native.js'; + +require(13 ); // 13 = es6-symbol/implement + +var _react = require(34 ); // 34 = react + +var _react2 = babelHelpers.interopRequireDefault(_react); + +var _reactNative = require(69 ); // 69 = react-native + +var _app = require(430 ); // 430 = ./features/app + +var _redux = require(505 ); // 505 = ./features/base/redux + +var Root = function (_Component) { + babelHelpers.inherits(Root, _Component); + + function Root(props) { + babelHelpers.classCallCheck(this, Root); + + var _this = babelHelpers.possibleConstructorReturn(this, (Root.__proto__ || Object.getPrototypeOf(Root)).call(this, props)); + + _this.state = { + url: _this.props.url + }; + + if (typeof _this.props.url === 'undefined') { + _reactNative.Linking.getInitialURL().then(function (url) { + if (typeof _this.state.url === 'undefined') { + _this.setState({ url: url }); + } + }).catch(function (err) { + console.error('Failed to get initial URL', err); + + if (typeof _this.state.url === 'undefined') { + _this.setState({ url: null }); + } + }); + } + return _this; + } + + babelHelpers.createClass(Root, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(_ref) { + var url = _ref.url; + + if (!(0, _redux.equals)(this.props.url, url)) { + this.setState({ url: url || null }); + } + } + }, { + key: 'render', + value: function render() { + var url = this.state.url; + + if (typeof url === 'undefined') { + return null; + } + + var _props = this.props, + _ = _props.url, + props = babelHelpers.objectWithoutProperties(_props, ['url']); + + + return _react2.default.createElement(_app.App, babelHelpers.extends({}, props, { + url: url, __source: { + fileName: _jsxFileName, + lineNumber: 122 + } + })); + } + }]); + return Root; +}(_react.Component); + +Root.propTypes = { + url: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.object, _react2.default.PropTypes.string]), + + welcomePageEnabled: _react2.default.PropTypes.bool +}; + +_reactNative.AppRegistry.registerComponent('App', function () { + return Root; +}); +}, 12, null, "jitsi-meet/react/index.native.js"); +__d(/* es6-symbol/implement.js */function(global, require, module, exports) {'use strict'; + +if (!require(14 )()) { // 14 = ./is-implemented + Object.defineProperty(require(15 ), 'Symbol', { value: require(16 ), configurable: true, enumerable: false, // 16 = ./polyfill // 15 = es5-ext/global + writable: true }); +} +}, 13, null, "es6-symbol/implement.js"); +__d(/* es6-symbol/is-implemented.js */function(global, require, module, exports) {'use strict'; + +var validTypes = { object: true, symbol: true }; + +module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { + String(symbol); + } catch (e) { + return false; + } + + if (!validTypes[typeof (typeof Symbol === 'function' ? Symbol.iterator : '@@iterator')]) return false; + if (!validTypes[typeof (typeof Symbol === 'function' ? Symbol.toPrimitive : '@@toPrimitive')]) return false; + if (!validTypes[typeof (typeof Symbol === 'function' ? Symbol.toStringTag : '@@toStringTag')]) return false; + + return true; +}; +}, 14, null, "es6-symbol/is-implemented.js"); +__d(/* es5-ext/global.js */function(global, require, module, exports) { + +module.exports = function () { + return this; +}(); +}, 15, null, "es5-ext/global.js"); +__d(/* es6-symbol/polyfill.js */function(global, require, module, exports) { + +'use strict'; + +var d = require(17 ), // 17 = d + validateSymbol = require(32 ), // 32 = ./validate-symbol + create = Object.create, + defineProperties = Object.defineProperties, + defineProperty = Object.defineProperty, + objPrototype = Object.prototype, + NativeSymbol, + SymbolPolyfill, + HiddenSymbol, + globalSymbols = create(null), + isNativeSafe; + +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} + +var generateName = function () { + var created = create(null); + return function (desc) { + var postfix = 0, + name, + ie11BugWorkaround; + while (created[desc + (postfix || '')]) { + ++postfix; + }desc += postfix || ''; + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + })); + return name; + }; +}(); + +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor'); + return SymbolPolyfill(description); +}; + +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = description === undefined ? '' : String(description); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return globalSymbols[key] = SymbolPolyfill(String(key)); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) { + if (globalSymbols[key] === s) return key; + } + }), + + hasInstance: d('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')), + iterator: d('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')), + match: d('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')), + replace: d('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')), + search: d('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')), + species: d('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')), + split: d('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')), + toPrimitive: d('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')), + toStringTag: d('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')), + unscopables: d('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables')) +}); + +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d('', function () { + return this.__name__; + }) +}); + +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { + return 'Symbol (' + validateSymbol(this).__description__ + ')'; + }), + valueOf: d(function () { + return validateSymbol(this); + }) +}); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); +})); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); + +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); +}, 16, null, "es6-symbol/polyfill.js"); +__d(/* d/index.js */function(global, require, module, exports) {'use strict'; + +var assign = require(18 ), // 18 = es5-ext/object/assign + normalizeOpts = require(27 ), // 27 = es5-ext/object/normalize-options + isCallable = require(28 ), // 28 = es5-ext/object/is-callable + contains = require(29 ), // 29 = es5-ext/string/#/contains + d; + +d = module.exports = function (dscr, value) { + var c, e, w, options, desc; + if (arguments.length < 2 || typeof dscr !== 'string') { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (dscr == null) { + c = w = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + w = contains.call(dscr, 'w'); + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOpts(options), desc); +}; + +d.gs = function (dscr, get, set) { + var c, e, options, desc; + if (typeof dscr !== 'string') { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (get == null) { + get = undefined; + } else if (!isCallable(get)) { + options = get; + get = set = undefined; + } else if (set == null) { + set = undefined; + } else if (!isCallable(set)) { + options = set; + set = undefined; + } + if (dscr == null) { + c = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOpts(options), desc); +}; +}, 17, null, "d/index.js"); +__d(/* es5-ext/object/assign/index.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(19 )() ? Object.assign : require(20 ); // 20 = ./shim // 19 = ./is-implemented +}, 18, null, "es5-ext/object/assign/index.js"); +__d(/* es5-ext/object/assign/is-implemented.js */function(global, require, module, exports) {"use strict"; + +module.exports = function () { + var assign = Object.assign, + obj; + if (typeof assign !== "function") return false; + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; +}; +}, 19, null, "es5-ext/object/assign/is-implemented.js"); +__d(/* es5-ext/object/assign/shim.js */function(global, require, module, exports) {"use strict"; + +var keys = require(21 ), // 21 = ../keys + value = require(26 ), // 26 = ../valid-value + max = Math.max; + +module.exports = function (dest, src) { + var error, + i, + length = max(arguments.length, 2), + assign; + dest = Object(value(dest)); + assign = function assign(key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < length; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; +}; +}, 20, null, "es5-ext/object/assign/shim.js"); +__d(/* es5-ext/object/keys/index.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(22 )() ? Object.keys : require(23 ); // 23 = ./shim // 22 = ./is-implemented +}, 21, null, "es5-ext/object/keys/index.js"); +__d(/* es5-ext/object/keys/is-implemented.js */function(global, require, module, exports) {"use strict"; + +module.exports = function () { + try { + Object.keys("primitive"); + return true; + } catch (e) { + return false; + } +}; +}, 22, null, "es5-ext/object/keys/is-implemented.js"); +__d(/* es5-ext/object/keys/shim.js */function(global, require, module, exports) {"use strict"; + +var isValue = require(24 ); // 24 = ../is-value + +var keys = Object.keys; + +module.exports = function (object) { + return keys(isValue(object) ? Object(object) : object); +}; +}, 23, null, "es5-ext/object/keys/shim.js"); +__d(/* es5-ext/object/is-value.js */function(global, require, module, exports) {"use strict"; + +var _undefined = require(25 )(); // 25 = ../function/noop + +module.exports = function (val) { + return val !== _undefined && val !== null; +}; +}, 24, null, "es5-ext/object/is-value.js"); +__d(/* es5-ext/function/noop.js */function(global, require, module, exports) {"use strict"; + +module.exports = function () {}; +}, 25, null, "es5-ext/function/noop.js"); +__d(/* es5-ext/object/valid-value.js */function(global, require, module, exports) {"use strict"; + +var isValue = require(24 ); // 24 = ./is-value + +module.exports = function (value) { + if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); + return value; +}; +}, 26, null, "es5-ext/object/valid-value.js"); +__d(/* es5-ext/object/normalize-options.js */function(global, require, module, exports) {"use strict"; + +var isValue = require(24 ); // 24 = ./is-value + +var forEach = Array.prototype.forEach, + create = Object.create; + +var process = function process(src, obj) { + var key; + for (key in src) { + obj[key] = src[key]; + } +}; + +module.exports = function (opts1) { + var result = create(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) return; + process(Object(options), result); + }); + return result; +}; +}, 27, null, "es5-ext/object/normalize-options.js"); +__d(/* es5-ext/object/is-callable.js */function(global, require, module, exports) { + +"use strict"; + +module.exports = function (obj) { + return typeof obj === "function"; +}; +}, 28, null, "es5-ext/object/is-callable.js"); +__d(/* es5-ext/string/#/contains/index.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(30 )() ? String.prototype.contains : require(31 ); // 31 = ./shim // 30 = ./is-implemented +}, 29, null, "es5-ext/string/#/contains/index.js"); +__d(/* es5-ext/string/#/contains/is-implemented.js */function(global, require, module, exports) {"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.contains !== "function") return false; + return str.contains("dwa") === true && str.contains("foo") === false; +}; +}, 30, null, "es5-ext/string/#/contains/is-implemented.js"); +__d(/* es5-ext/string/#/contains/shim.js */function(global, require, module, exports) {"use strict"; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; +}, 31, null, "es5-ext/string/#/contains/shim.js"); +__d(/* es6-symbol/validate-symbol.js */function(global, require, module, exports) {'use strict'; + +var isSymbol = require(33 ); // 33 = ./is-symbol + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; +}, 32, null, "es6-symbol/validate-symbol.js"); +__d(/* es6-symbol/is-symbol.js */function(global, require, module, exports) {'use strict'; + +module.exports = function (x) { + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return x[x.constructor.toStringTag] === 'Symbol'; +}; +}, 33, null, "es6-symbol/is-symbol.js"); +__d(/* react/react.js */function(global, require, module, exports) {'use strict'; + +module.exports = require(35 ); // 35 = ./lib/React +}, 34, null, "react/react.js"); +__d(/* react/lib/React.js */function(global, require, module, exports) { + +'use strict'; + +var _assign = require(36 ); // 36 = object-assign + +var ReactBaseClasses = require(37 ); // 37 = ./ReactBaseClasses +var ReactChildren = require(46 ); // 46 = ./ReactChildren +var ReactDOMFactories = require(54 ); // 54 = ./ReactDOMFactories +var ReactElement = require(48 ); // 48 = ./ReactElement +var ReactPropTypes = require(60 ); // 60 = ./ReactPropTypes +var ReactVersion = require(65 ); // 65 = ./ReactVersion + +var createReactClass = require(66 ); // 66 = ./createClass +var onlyChild = require(68 ); // 68 = ./onlyChild + +var createElement = ReactElement.createElement; +var createFactory = ReactElement.createFactory; +var cloneElement = ReactElement.cloneElement; + +if (process.env.NODE_ENV !== 'production') { + var lowPriorityWarning = require(45 ); // 45 = ./lowPriorityWarning + var canDefineProperty = require(42 ); // 42 = ./canDefineProperty + var ReactElementValidator = require(55 ); // 55 = ./ReactElementValidator + var didWarnPropTypesDeprecated = false; + createElement = ReactElementValidator.createElement; + createFactory = ReactElementValidator.createFactory; + cloneElement = ReactElementValidator.cloneElement; +} + +var __spread = _assign; +var createMixin = function createMixin(mixin) { + return mixin; +}; + +if (process.env.NODE_ENV !== 'production') { + var warnedForSpread = false; + var warnedForCreateMixin = false; + __spread = function __spread() { + 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 createMixin(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 = { + + Children: { + map: ReactChildren.map, + forEach: ReactChildren.forEach, + count: ReactChildren.count, + toArray: ReactChildren.toArray, + only: onlyChild + }, + + Component: ReactBaseClasses.Component, + PureComponent: ReactBaseClasses.PureComponent, + + createElement: createElement, + cloneElement: cloneElement, + isValidElement: ReactElement.isValidElement, + + PropTypes: ReactPropTypes, + createClass: createReactClass, + createFactory: createFactory, + createMixin: createMixin, + + DOM: ReactDOMFactories, + + version: ReactVersion, + + __spread: __spread +}; + +if (process.env.NODE_ENV !== 'production') { + var warnedForCreateClass = false; + if (canDefineProperty) { + Object.defineProperty(React, 'PropTypes', { + get: function get() { + 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 get() { + 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 = {}; + 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; +}, 35, null, "react/lib/React.js"); +__d(/* object-assign/index.js */function(global, require, module, exports) {/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; + +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; + } + + var test1 = new String('abc'); + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + 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; + } + + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(babelHelpers.extends({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + 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; +}; +}, 36, null, "object-assign/index.js"); +__d(/* react/lib/ReactBaseClasses.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ), // 38 = ./reactProdInvariant + _assign = require(36 ); // 36 = object-assign + +var ReactNoopUpdateQueue = require(39 ); // 39 = ./ReactNoopUpdateQueue + +var canDefineProperty = require(42 ); // 42 = ./canDefineProperty +var emptyObject = require(43 ); // 43 = fbjs/lib/emptyObject +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var lowPriorityWarning = require(45 ); // 45 = ./lowPriorityWarning + +function ReactComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + + this.updater = updater || ReactNoopUpdateQueue; +} + +ReactComponent.prototype.isReactComponent = {}; + +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'); + } +}; + +ReactComponent.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this); + if (callback) { + this.updater.enqueueCallback(this, callback, 'forceUpdate'); + } +}; + +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 defineDeprecationWarning(methodName, info) { + if (canDefineProperty) { + Object.defineProperty(ReactComponent.prototype, methodName, { + get: function get() { + lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; + } + }); + } + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } +} + +function ReactPureComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + + this.updater = updater || ReactNoopUpdateQueue; +} + +function ComponentDummy() {} +ComponentDummy.prototype = ReactComponent.prototype; +ReactPureComponent.prototype = new ComponentDummy(); +ReactPureComponent.prototype.constructor = ReactPureComponent; + +_assign(ReactPureComponent.prototype, ReactComponent.prototype); +ReactPureComponent.prototype.isPureReactComponent = true; + +module.exports = { + Component: ReactComponent, + PureComponent: ReactPureComponent +}; +}, 37, null, "react/lib/ReactBaseClasses.js"); +__d(/* react/lib/reactProdInvariant.js */function(global, require, module, exports) { +'use strict'; + +function reactProdInvariant(code) { + var argCount = arguments.length - 1; + + 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; + + throw error; +} + +module.exports = reactProdInvariant; +}, 38, null, "react/lib/reactProdInvariant.js"); +__d(/* react/lib/ReactNoopUpdateQueue.js */function(global, require, module, exports) { + +'use strict'; + +var warning = require(40 ); // 40 = fbjs/lib/warning + +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; + } +} + +var ReactNoopUpdateQueue = { + isMounted: function isMounted(publicInstance) { + return false; + }, + + enqueueCallback: function enqueueCallback(publicInstance, callback) {}, + + enqueueForceUpdate: function enqueueForceUpdate(publicInstance) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + enqueueReplaceState: function enqueueReplaceState(publicInstance, completeState) { + warnNoop(publicInstance, 'replaceState'); + }, + + enqueueSetState: function enqueueSetState(publicInstance, partialState) { + warnNoop(publicInstance, 'setState'); + } +}; + +module.exports = ReactNoopUpdateQueue; +}, 39, null, "react/lib/ReactNoopUpdateQueue.js"); +__d(/* fbjs/lib/warning.js */function(global, require, module, exports) { + +'use strict'; + +var emptyFunction = require(41 ); // 41 = ./emptyFunction + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = warning; +}, 40, null, "fbjs/lib/warning.js"); +__d(/* fbjs/lib/emptyFunction.js */function(global, require, module, exports) {"use strict"; + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +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; +}, 41, null, "fbjs/lib/emptyFunction.js"); +__d(/* react/lib/canDefineProperty.js */function(global, require, module, exports) { + +'use strict'; + +var canDefineProperty = false; +if (process.env.NODE_ENV !== 'production') { + try { + Object.defineProperty({}, 'x', { get: function get() {} }); + canDefineProperty = true; + } catch (x) {} +} + +module.exports = canDefineProperty; +}, 42, null, "react/lib/canDefineProperty.js"); +__d(/* fbjs/lib/emptyObject.js */function(global, require, module, exports) { + +'use strict'; + +var emptyObject = {}; + +if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +}, 43, null, "fbjs/lib/emptyObject.js"); +__d(/* fbjs/lib/invariant.js */function(global, require, module, exports) { + +'use strict'; + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; + throw error; + } +} + +module.exports = invariant; +}, 44, null, "fbjs/lib/invariant.js"); +__d(/* react/lib/lowPriorityWarning.js */function(global, require, module, exports) { + +'use strict'; + +var lowPriorityWarning = function lowPriorityWarning() {}; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function lowPriorityWarning(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]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = lowPriorityWarning; +}, 45, null, "react/lib/lowPriorityWarning.js"); +__d(/* react/lib/ReactChildren.js */function(global, require, module, exports) { + +'use strict'; + +var PooledClass = require(47 ); // 47 = ./PooledClass +var ReactElement = require(48 ); // 48 = ./ReactElement + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var traverseAllChildren = require(51 ); // 51 = ./traverseAllChildren + +var twoArgumentPooler = PooledClass.twoArgumentPooler; +var fourArgumentPooler = PooledClass.fourArgumentPooler; + +var userProvidedKeyEscapeRegex = /\/+/g; +function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); +} + +function ForEachBookKeeping(forEachFunction, forEachContext) { + this.func = forEachFunction; + this.context = forEachContext; + this.count = 0; +} +ForEachBookKeeping.prototype.destructor = function () { + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); + +function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); +} + +function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); +} + +function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { + this.result = mapResult; + this.keyPrefix = keyPrefix; + this.func = mapFunction; + this.context = mapContext; + this.count = 0; +} +MapBookKeeping.prototype.destructor = function () { + this.result = null; + this.keyPrefix = null; + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); + +function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + } else if (mappedChild != null) { + if (ReactElement.isValidElement(mappedChild)) { + mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + result.push(mappedChild); + } +} + +function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); +} + +function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; +} + +function forEachSingleChildDummy(traverseContext, child, name) { + return null; +} + +function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); +} + +function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + return result; +} + +var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, + count: countChildren, + toArray: toArray +}; + +module.exports = ReactChildren; +}, 46, null, "react/lib/ReactChildren.js"); +__d(/* react/lib/PooledClass.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var oneArgumentPooler = function oneArgumentPooler(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } +}; + +var twoArgumentPooler = function twoArgumentPooler(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } +}; + +var threeArgumentPooler = function threeArgumentPooler(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } +}; + +var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4); + return instance; + } else { + return new Klass(a1, a2, a3, a4); + } +}; + +var standardReleaser = function standardReleaser(instance) { + var Klass = this; + !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; + instance.destructor(); + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } +}; + +var DEFAULT_POOL_SIZE = 10; +var DEFAULT_POOLER = oneArgumentPooler; + +var addPoolingTo = function addPoolingTo(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; +}; + +var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler +}; + +module.exports = PooledClass; +}, 47, null, "react/lib/PooledClass.js"); +__d(/* react/lib/ReactElement.js */function(global, require, module, exports) { + +'use strict'; + +var _assign = require(36 ); // 36 = object-assign + +var ReactCurrentOwner = require(49 ); // 49 = ./ReactCurrentOwner + +var warning = require(40 ); // 40 = fbjs/lib/warning +var canDefineProperty = require(42 ); // 42 = ./canDefineProperty +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var REACT_ELEMENT_TYPE = require(50 ); // 50 = ./ReactElementSymbol + +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; + +var specialPropKeyWarningShown, specialPropRefWarningShown; + +function hasValidRef(config) { + if (process.env.NODE_ENV !== 'production') { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; +} + +function hasValidKey(config) { + if (process.env.NODE_ENV !== 'production') { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function warnAboutAccessingKey() { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); +} + +function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function warnAboutAccessingRef() { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); +} + +var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) { + var element = { + $$typeof: REACT_ELEMENT_TYPE, + + type: type, + key: key, + ref: ref, + props: props, + + _owner: owner + }; + + if (process.env.NODE_ENV !== 'production') { + element._store = {}; + + if (canDefineProperty) { + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + } else { + element._store.validated = false; + element._self = self; + element._source = source; + } + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; + +ReactElement.createElement = function (type, config, children) { + var propName; + + var props = {}; + + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + if (process.env.NODE_ENV !== 'production') { + if (Object.freeze) { + Object.freeze(childArray); + } + } + props.children = childArray; + } + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + if (process.env.NODE_ENV !== 'production') { + if (key || ref) { + if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); +}; + +ReactElement.createFactory = function (type) { + var factory = ReactElement.createElement.bind(null, type); + + factory.type = type; + return factory; +}; + +ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + + return newElement; +}; + +ReactElement.cloneElement = function (element, config, children) { + var propName; + + var props = _assign({}, element.props); + + var key = element.key; + var ref = element.ref; + + var self = element._self; + + var source = element._source; + + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + var defaultProps; + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); +}; + +ReactElement.isValidElement = function (object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +}; + +module.exports = ReactElement; +}, 48, null, "react/lib/ReactElement.js"); +__d(/* react/lib/ReactCurrentOwner.js */function(global, require, module, exports) { + +'use strict'; + +var ReactCurrentOwner = { + current: null +}; + +module.exports = ReactCurrentOwner; +}, 49, null, "react/lib/ReactCurrentOwner.js"); +__d(/* react/lib/ReactElementSymbol.js */function(global, require, module, exports) { + +'use strict'; + +var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + +module.exports = REACT_ELEMENT_TYPE; +}, 50, null, "react/lib/ReactElementSymbol.js"); +__d(/* react/lib/traverseAllChildren.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var ReactCurrentOwner = require(49 ); // 49 = ./ReactCurrentOwner +var REACT_ELEMENT_TYPE = require(50 ); // 50 = ./ReactElementSymbol + +var getIteratorFn = require(52 ); // 52 = ./getIteratorFn +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var KeyEscapeUtils = require(53 ); // 53 = ./KeyEscapeUtils +var warning = require(40 ); // 40 = fbjs/lib/warning + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; + +var didWarnAboutMaps = false; + +function getComponentKey(component, index) { + if (component && typeof component === 'object' && component.key != null) { + return KeyEscapeUtils.escape(component.key); + } + + return index.toString(36); +} + +function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + children = null; + } + + if (children === null || type === 'string' || type === 'number' || type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { + callback(traverseContext, children, nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + 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); + } + } 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); + } + } 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; + } + + 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); + } + } + } + } else if (type === 'object') { + var addendum = ''; + 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 + '`.'; + } + } + } + var childrenString = String(children); + !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; + } + } + + return subtreeCount; +} + +function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); +} + +module.exports = traverseAllChildren; +}, 51, null, "react/lib/traverseAllChildren.js"); +__d(/* react/lib/getIteratorFn.js */function(global, require, module, exports) { + +'use strict'; + +var ITERATOR_SYMBOL = typeof Symbol === 'function' && (typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'); +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} + +module.exports = getIteratorFn; +}, 52, null, "react/lib/getIteratorFn.js"); +__d(/* react/lib/KeyEscapeUtils.js */function(global, require, module, exports) { + +'use strict'; + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +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; +}, 53, null, "react/lib/KeyEscapeUtils.js"); +__d(/* react/lib/ReactDOMFactories.js */function(global, require, module, exports) { + +'use strict'; + +var ReactElement = require(48 ); // 48 = ./ReactElement + +var createDOMFactory = ReactElement.createFactory; +if (process.env.NODE_ENV !== 'production') { + var ReactElementValidator = require(55 ); // 55 = ./ReactElementValidator + createDOMFactory = ReactElementValidator.createFactory; +} + +var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + 'var': createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), + + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan') +}; + +module.exports = ReactDOMFactories; +}, 54, null, "react/lib/ReactDOMFactories.js"); +__d(/* react/lib/ReactElementValidator.js */function(global, require, module, exports) { + +'use strict'; + +var ReactCurrentOwner = require(49 ); // 49 = ./ReactCurrentOwner +var ReactComponentTreeHook = require(56 ); // 56 = ./ReactComponentTreeHook +var ReactElement = require(48 ); // 48 = ./ReactElement + +var checkReactTypeSpec = require(57 ); // 57 = ./checkReactTypeSpec + +var canDefineProperty = require(42 ); // 42 = ./canDefineProperty +var getIteratorFn = require(52 ); // 52 = ./getIteratorFn +var warning = require(40 ); // 40 = fbjs/lib/warning +var lowPriorityWarning = require(45 ); // 45 = ./lowPriorityWarning + +function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +function getSourceInfoErrorAddendum(elementProps) { + if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { + var source = elementProps.__source; + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return ' Check your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; +} + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = ' Check the top-level render call using <' + parentName + '>.'; + } + } + return info; +} + +function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + + var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); + + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (memoizer[currentComponentErrorInfo]) { + return; + } + memoizer[currentComponentErrorInfo] = true; + + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; + } + + process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; +} + +function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (ReactElement.isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (ReactElement.isValidElement(node)) { + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (iteratorFn) { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (ReactElement.isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } +} + +function validatePropTypes(element) { + var componentClass = element.type; + if (typeof componentClass !== 'function') { + return; + } + var name = componentClass.displayName || componentClass.name; + if (componentClass.propTypes) { + checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); + } + if (typeof componentClass.getDefaultProps === 'function') { + process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + } +} + +var ReactElementValidator = { + createElement: function createElement(type, props, children) { + var validType = typeof type === 'string' || typeof type === 'function'; + + if (!validType) { + if (typeof type !== 'function' && typeof type !== 'string') { + var info = ''; + 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."; + } + + var sourceInfo = getSourceInfoErrorAddendum(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + info += ReactComponentTreeHook.getCurrentStackAddendum(); + + var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; + ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: 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) : void 0; + ReactComponentTreeHook.popNonStandardWarningStack(); + } + } + + var element = ReactElement.createElement.apply(this, arguments); + + if (element == null) { + return element; + } + + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + validatePropTypes(element); + + return element; + }, + + createFactory: function createFactory(type) { + var validatedFactory = ReactElementValidator.createElement.bind(null, type); + + validatedFactory.type = type; + + if (process.env.NODE_ENV !== 'production') { + if (canDefineProperty) { + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function get() { + lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + } + + return validatedFactory; + }, + + cloneElement: function cloneElement(element, props, children) { + var newElement = ReactElement.cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } +}; + +module.exports = ReactElementValidator; +}, 55, null, "react/lib/ReactElementValidator.js"); +__d(/* react/lib/ReactComponentTreeHook.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var ReactCurrentOwner = require(49 ); // 49 = ./ReactCurrentOwner + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +function isNative(fn) { + var funcToString = Function.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + try { + var source = funcToString.call(fn); + return reIsNative.test(source); + } catch (err) { + return false; + } +} + +var canUseCollections = typeof Array.from === 'function' && typeof Map === 'function' && isNative(Map) && Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && typeof Set === 'function' && isNative(Set) && Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); + +var setItem; +var getItem; +var removeItem; +var getItemIDs; +var addRoot; +var removeRoot; +var getRootIDs; + +if (canUseCollections) { + var itemMap = new Map(); + var rootIDSet = new Set(); + + setItem = function setItem(id, item) { + itemMap.set(id, item); + }; + getItem = function getItem(id) { + return itemMap.get(id); + }; + removeItem = function removeItem(id) { + itemMap['delete'](id); + }; + getItemIDs = function getItemIDs() { + return Array.from(itemMap.keys()); + }; + + addRoot = function addRoot(id) { + rootIDSet.add(id); + }; + removeRoot = function removeRoot(id) { + rootIDSet['delete'](id); + }; + getRootIDs = function getRootIDs() { + return Array.from(rootIDSet.keys()); + }; +} else { + var itemByKey = {}; + var rootByKey = {}; + + var getKeyFromID = function getKeyFromID(id) { + return '.' + id; + }; + var getIDFromKey = function getIDFromKey(key) { + return parseInt(key.substr(1), 10); + }; + + setItem = function setItem(id, item) { + var key = getKeyFromID(id); + itemByKey[key] = item; + }; + getItem = function getItem(id) { + var key = getKeyFromID(id); + return itemByKey[key]; + }; + removeItem = function removeItem(id) { + var key = getKeyFromID(id); + delete itemByKey[key]; + }; + getItemIDs = function getItemIDs() { + return Object.keys(itemByKey).map(getIDFromKey); + }; + + addRoot = function addRoot(id) { + var key = getKeyFromID(id); + rootByKey[key] = true; + }; + removeRoot = function removeRoot(id) { + var key = getKeyFromID(id); + delete rootByKey[key]; + }; + getRootIDs = function getRootIDs() { + return Object.keys(rootByKey).map(getIDFromKey); + }; +} + +var unmountedIDs = []; + +function purgeDeep(id) { + var item = getItem(id); + if (item) { + var childIDs = item.childIDs; + + removeItem(id); + childIDs.forEach(purgeDeep); + } +} + +function describeComponentFrame(name, source, ownerName) { + return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); +} + +function _getDisplayName(element) { + if (element == null) { + return '#empty'; + } else if (typeof element === 'string' || typeof element === 'number') { + return '#text'; + } else if (typeof element.type === 'string') { + return element.type; + } else { + return element.type.displayName || element.type.name || 'Unknown'; + } +} + +function describeID(id) { + var name = ReactComponentTreeHook.getDisplayName(id); + var element = ReactComponentTreeHook.getElement(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var ownerName; + if (ownerID) { + ownerName = ReactComponentTreeHook.getDisplayName(ownerID); + } + process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; + return describeComponentFrame(name, element && element._source, ownerName); +} + +var ReactComponentTreeHook = { + onSetChildren: function onSetChildren(id, nextChildIDs) { + var item = getItem(id); + !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; + item.childIDs = nextChildIDs; + + for (var i = 0; i < nextChildIDs.length; i++) { + var nextChildID = nextChildIDs[i]; + var nextChild = getItem(nextChildID); + !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; + !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; + !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; + if (nextChild.parentID == null) { + nextChild.parentID = id; + } + !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; + } + }, + onBeforeMountComponent: function onBeforeMountComponent(id, element, parentID) { + var item = { + element: element, + parentID: parentID, + text: null, + childIDs: [], + isMounted: false, + updateCount: 0 + }; + setItem(id, item); + }, + onBeforeUpdateComponent: function onBeforeUpdateComponent(id, element) { + var item = getItem(id); + if (!item || !item.isMounted) { + return; + } + item.element = element; + }, + onMountComponent: function onMountComponent(id) { + var item = getItem(id); + !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; + item.isMounted = true; + var isRoot = item.parentID === 0; + if (isRoot) { + addRoot(id); + } + }, + onUpdateComponent: function onUpdateComponent(id) { + var item = getItem(id); + if (!item || !item.isMounted) { + return; + } + item.updateCount++; + }, + onUnmountComponent: function onUnmountComponent(id) { + var item = getItem(id); + if (item) { + item.isMounted = false; + var isRoot = item.parentID === 0; + if (isRoot) { + removeRoot(id); + } + } + unmountedIDs.push(id); + }, + purgeUnmountedComponents: function purgeUnmountedComponents() { + if (ReactComponentTreeHook._preventPurging) { + return; + } + + for (var i = 0; i < unmountedIDs.length; i++) { + var id = unmountedIDs[i]; + purgeDeep(id); + } + unmountedIDs.length = 0; + }, + isMounted: function isMounted(id) { + var item = getItem(id); + return item ? item.isMounted : false; + }, + getCurrentStackAddendum: function getCurrentStackAddendum(topElement) { + var info = ''; + if (topElement) { + var name = _getDisplayName(topElement); + var owner = topElement._owner; + info += describeComponentFrame(name, topElement._source, owner && owner.getName()); + } + + var currentOwner = ReactCurrentOwner.current; + var id = currentOwner && currentOwner._debugID; + + info += ReactComponentTreeHook.getStackAddendumByID(id); + return info; + }, + getStackAddendumByID: function getStackAddendumByID(id) { + var info = ''; + while (id) { + info += describeID(id); + id = ReactComponentTreeHook.getParentID(id); + } + return info; + }, + getChildIDs: function getChildIDs(id) { + var item = getItem(id); + return item ? item.childIDs : []; + }, + getDisplayName: function getDisplayName(id) { + var element = ReactComponentTreeHook.getElement(id); + if (!element) { + return null; + } + return _getDisplayName(element); + }, + getElement: function getElement(id) { + var item = getItem(id); + return item ? item.element : null; + }, + getOwnerID: function getOwnerID(id) { + var element = ReactComponentTreeHook.getElement(id); + if (!element || !element._owner) { + return null; + } + return element._owner._debugID; + }, + getParentID: function getParentID(id) { + var item = getItem(id); + return item ? item.parentID : null; + }, + getSource: function getSource(id) { + var item = getItem(id); + var element = item ? item.element : null; + var source = element != null ? element._source : null; + return source; + }, + getText: function getText(id) { + var element = ReactComponentTreeHook.getElement(id); + if (typeof element === 'string') { + return element; + } else if (typeof element === 'number') { + return '' + element; + } else { + return null; + } + }, + getUpdateCount: function getUpdateCount(id) { + var item = getItem(id); + return item ? item.updateCount : 0; + }, + + getRootIDs: getRootIDs, + getRegisteredIDs: getItemIDs, + + pushNonStandardWarningStack: function pushNonStandardWarningStack(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) {} + + console.reactStack(stack); + }, + popNonStandardWarningStack: function popNonStandardWarningStack() { + if (typeof console.reactStackEnd !== 'function') { + return; + } + console.reactStackEnd(); + } +}; + +module.exports = ReactComponentTreeHook; +}, 56, null, "react/lib/ReactComponentTreeHook.js"); +__d(/* react/lib/checkReactTypeSpec.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var ReactPropTypeLocationNames = require(58 ); // 58 = ./ReactPropTypeLocationNames +var ReactPropTypesSecret = require(59 ); // 59 = ./ReactPropTypesSecret + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + ReactComponentTreeHook = require(56 ); // 56 = ./ReactComponentTreeHook +} + +var loggedTypeFailures = {}; + +function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + + try { + !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + + var componentStackInfo = ''; + + if (process.env.NODE_ENV !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = require(56 ); // 56 = ./ReactComponentTreeHook + } + if (debugID !== null) { + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); + } else if (element !== null) { + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); + } + } + + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; + } + } + } +} + +module.exports = checkReactTypeSpec; +}, 57, null, "react/lib/checkReactTypeSpec.js"); +__d(/* react/lib/ReactPropTypeLocationNames.js */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypeLocationNames = {}; + +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} + +module.exports = ReactPropTypeLocationNames; +}, 58, null, "react/lib/ReactPropTypeLocationNames.js"); +__d(/* react/lib/ReactPropTypesSecret.js */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; +}, 59, null, "react/lib/ReactPropTypesSecret.js"); +__d(/* react/lib/ReactPropTypes.js */function(global, require, module, exports) { + +'use strict'; + +var _require = require(48 ), // 48 = ./ReactElement + isValidElement = _require.isValidElement; + +var factory = require(61 ); // 61 = prop-types/factory + +module.exports = factory(isValidElement); +}, 60, null, "react/lib/ReactPropTypes.js"); +__d(/* prop-types/factory.js */function(global, require, module, exports) { + +'use strict'; + +var factory = require(62 ); // 62 = ./factoryWithTypeCheckers +module.exports = function (isValidElement) { + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; +}, 61, null, "prop-types/factory.js"); +__d(/* prop-types/factoryWithTypeCheckers.js */function(global, require, module, exports) { + +'use strict'; + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactPropTypesSecret = require(63 ); // 63 = ./lib/ReactPropTypesSecret +var checkPropTypes = require(64 ); // 64 = ./checkPropTypes + +module.exports = function (isValidElement, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol === 'function' && (typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'); + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + var ANONYMOUS = '<>'; + + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + function is(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + } + + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + var cacheKey = componentName + ':' + propName; + if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { + warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning(false, 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + if (propType === 'symbol') { + return true; + } + + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; +}, 62, null, "prop-types/factoryWithTypeCheckers.js"); +__d(/* prop-types/lib/ReactPropTypesSecret.js */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; +}, 63, null, "prop-types/lib/ReactPropTypesSecret.js"); +__d(/* prop-types/checkPropTypes.js */function(global, require, module, exports) { + +'use strict'; + +if (process.env.NODE_ENV !== 'production') { + var invariant = require(44 ); // 44 = fbjs/lib/invariant + var warning = require(40 ); // 40 = fbjs/lib/warning + var ReactPropTypesSecret = require(63 ); // 63 = ./lib/ReactPropTypesSecret + var loggedTypeFailures = {}; +} + +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + + try { + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; +}, 64, null, "prop-types/checkPropTypes.js"); +__d(/* react/lib/ReactVersion.js */function(global, require, module, exports) { + +'use strict'; + +module.exports = '15.6.1'; +}, 65, null, "react/lib/ReactVersion.js"); +__d(/* react/lib/createClass.js */function(global, require, module, exports) { + +'use strict'; + +var _require = require(37 ), // 37 = ./ReactBaseClasses + Component = _require.Component; + +var _require2 = require(48 ), // 48 = ./ReactElement + isValidElement = _require2.isValidElement; + +var ReactNoopUpdateQueue = require(39 ); // 39 = ./ReactNoopUpdateQueue +var factory = require(67 ); // 67 = create-react-class/factory + +module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); +}, 66, null, "react/lib/createClass.js"); +__d(/* create-react-class/factory.js */function(global, require, module, exports) { + +'use strict'; + +var _assign = require(36 ); // 36 = object-assign + +var emptyObject = require(43 ); // 43 = fbjs/lib/emptyObject +var _invariant = require(44 ); // 44 = fbjs/lib/invariant + +if (process.env.NODE_ENV !== 'production') { + var warning = require(40 ); // 40 = fbjs/lib/warning +} + +var MIXINS_KEY = 'mixins'; + +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else { + ReactPropTypeLocationNames = {}; +} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + + var injectedMixins = []; + + var ReactClassInterface = { + mixins: 'DEFINE_MANY', + + statics: 'DEFINE_MANY', + + propTypes: 'DEFINE_MANY', + + contextTypes: 'DEFINE_MANY', + + childContextTypes: 'DEFINE_MANY', + + getDefaultProps: 'DEFINE_MANY_MERGED', + + getInitialState: 'DEFINE_MANY_MERGED', + + getChildContext: 'DEFINE_MANY_MERGED', + + render: 'DEFINE_ONCE', + + componentWillMount: 'DEFINE_MANY', + + componentDidMount: 'DEFINE_MANY', + + componentWillReceiveProps: 'DEFINE_MANY', + + shouldComponentUpdate: 'DEFINE_ONCE', + + componentWillUpdate: 'DEFINE_MANY', + + componentDidUpdate: 'DEFINE_MANY', + + componentWillUnmount: 'DEFINE_MANY', + + updateComponent: 'OVERRIDE_BASE' + }; + + var RESERVED_SPEC_KEYS = { + displayName: function displayName(Constructor, _displayName) { + Constructor.displayName = _displayName; + }, + mixins: function mixins(Constructor, _mixins) { + if (_mixins) { + for (var i = 0; i < _mixins.length; i++) { + mixSpecIntoComponent(Constructor, _mixins[i]); + } + } + }, + childContextTypes: function childContextTypes(Constructor, _childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, _childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, _childContextTypes); + }, + contextTypes: function contextTypes(Constructor, _contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, _contextTypes, 'context'); + } + Constructor.contextTypes = _assign({}, Constructor.contextTypes, _contextTypes); + }, + + getDefaultProps: function getDefaultProps(Constructor, _getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, _getDefaultProps); + } else { + Constructor.getDefaultProps = _getDefaultProps; + } + }, + propTypes: function propTypes(Constructor, _propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, _propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, _propTypes); + }, + statics: function statics(Constructor, _statics) { + mixStaticSpecIntoComponent(Constructor, _statics); + }, + autobind: function autobind() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + if (process.env.NODE_ENV !== 'production') { + warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; + + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name); + } + + if (isAlreadyDefined) { + _invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name); + } + } + + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (process.env.NODE_ENV !== 'production') { + warning(isMixinValid, "%s: You're attempting to include a mixin that is either null " + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec); + } + } + + return; + } + + _invariant(typeof spec !== 'function', "ReactClass: You're attempting to " + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.'); + _invariant(!isValidElement(spec), "ReactClass: You're attempting to " + 'use a component as a mixin. Instead, just use a regular object.'); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + _invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name); + + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name); + + var isInherited = name in Constructor; + _invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name); + Constructor[name] = property; + } + } + + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key); + one[key] = two[key]; + } + } + return one; + } + + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function (newThis) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (newThis !== component && newThis !== null) { + if (process.env.NODE_ENV !== 'production') { + warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName); + } + } else if (!args.length) { + if (process.env.NODE_ENV !== 'production') { + warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function componentDidMount() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function componentWillUnmount() { + this.__isMounted = false; + } + }; + + var ReactClassMixin = { + replaceState: function replaceState(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + isMounted: function isMounted() { + if (process.env.NODE_ENV !== 'production') { + warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component'); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function ReactClassComponent() {}; + _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); + + function createClass(spec) { + var Constructor = identity(function (props, context, updater) { + + if (process.env.NODE_ENV !== 'production') { + warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory'); + } + + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + if (initialState === undefined && this.getInitialState._isMockFunction) { + initialState = null; + } + } + _invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent'); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.'); + + if (process.env.NODE_ENV !== 'production') { + warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component'); + warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component'); + } + + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; +}, 67, null, "create-react-class/factory.js"); +__d(/* react/lib/onlyChild.js */function(global, require, module, exports) { +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var ReactElement = require(48 ); // 48 = ./ReactElement + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function onlyChild(children) { + !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; + return children; +} + +module.exports = onlyChild; +}, 68, null, "react/lib/onlyChild.js"); +__d(/* react-native/Libraries/react-native/react-native.js */function(global, require, module, exports) { +'use strict'; + +var warning = require(40 ); // 40 = fbjs/lib/warning + +if (__DEV__) { + var warningDedupe = {}; + var addonWarn = function addonWarn(prevName, newPackageName) { + warning(warningDedupe[prevName], 'React.addons.' + prevName + ' is deprecated. Please import the "' + newPackageName + '" package instead.'); + warningDedupe[prevName] = true; + }; +} + +var ReactNative = { + get ActivityIndicator() { + return require(70 ); // 70 = ActivityIndicator + }, + get ART() { + return require(203 ); // 203 = ReactNativeART + }, + get Button() { + return require(209 ); // 209 = Button + }, + get DatePickerIOS() { + return require(297 ); // 297 = DatePickerIOS + }, + get DrawerLayoutAndroid() { + return require(298 ); // 298 = DrawerLayoutAndroid + }, + get Image() { + return require(237 ); // 237 = Image + }, + get ImageEditor() { + return require(299 ); // 299 = ImageEditor + }, + get ImageStore() { + return require(300 ); // 300 = ImageStore + }, + get KeyboardAvoidingView() { + return require(301 ); // 301 = KeyboardAvoidingView + }, + get ListView() { + return require(303 ); // 303 = ListView + }, + get MapView() { + return require(308 ); // 308 = MapView + }, + get Modal() { + return require(309 ); // 309 = Modal + }, + get Navigator() { + return require(332 ); // 332 = Navigator + }, + get NavigatorIOS() { + return require(350 ); // 350 = NavigatorIOS + }, + get Picker() { + return require(352 ); // 352 = Picker + }, + get PickerIOS() { + return require(353 ); // 353 = PickerIOS + }, + get ProgressBarAndroid() { + return require(355 ); // 355 = ProgressBarAndroid + }, + get ProgressViewIOS() { + return require(356 ); // 356 = ProgressViewIOS + }, + get ScrollView() { + return require(239 ); // 239 = ScrollView + }, + get SegmentedControlIOS() { + return require(357 ); // 357 = SegmentedControlIOS + }, + get Slider() { + return require(358 ); // 358 = Slider + }, + get SnapshotViewIOS() { + return require(359 ); // 359 = SnapshotViewIOS + }, + get Switch() { + return require(360 ); // 360 = Switch + }, + get RefreshControl() { + return require(361 ); // 361 = RefreshControl + }, + get StatusBar() { + return require(362 ); // 362 = StatusBar + }, + get SwipeableListView() { + return require(363 ); // 363 = SwipeableListView + }, + get TabBarIOS() { + return require(366 ); // 366 = TabBarIOS + }, + get Text() { + return require(210 ); // 210 = Text + }, + get TextInput() { + return require(368 ); // 368 = TextInput + }, + get ToastAndroid() { + return require(375 ); // 375 = ToastAndroid + }, + get ToolbarAndroid() { + return require(376 ); // 376 = ToolbarAndroid + }, + get Touchable() { + return require(211 ); // 211 = Touchable + }, + get TouchableHighlight() { + return require(321 ); // 321 = TouchableHighlight + }, + get TouchableNativeFeedback() { + return require(217 ); // 217 = TouchableNativeFeedback + }, + get TouchableOpacity() { + return require(218 ); // 218 = TouchableOpacity + }, + get TouchableWithoutFeedback() { + return require(295 ); // 295 = TouchableWithoutFeedback + }, + get View() { + return require(146 ); // 146 = View + }, + get ViewPagerAndroid() { + return require(377 ); // 377 = ViewPagerAndroid + }, + get WebView() { + return require(378 ); // 378 = WebView + }, + + get ActionSheetIOS() { + return require(379 ); // 379 = ActionSheetIOS + }, + get AdSupportIOS() { + return require(380 ); // 380 = AdSupportIOS + }, + get Alert() { + return require(250 ); // 250 = Alert + }, + get AlertIOS() { + return require(251 ); // 251 = AlertIOS + }, + get Animated() { + return require(219 ); // 219 = Animated + }, + get AppRegistry() { + return require(381 ); // 381 = AppRegistry + }, + get AppState() { + return require(111 ); // 111 = AppState + }, + get AsyncStorage() { + return require(389 ); // 389 = AsyncStorage + }, + get BackAndroid() { + return require(386 ); // 386 = BackAndroid + }, + get CameraRoll() { + return require(390 ); // 390 = CameraRoll + }, + get Clipboard() { + return require(391 ); // 391 = Clipboard + }, + get DatePickerAndroid() { + return require(392 ); // 392 = DatePickerAndroid + }, + get Dimensions() { + return require(129 ); // 129 = Dimensions + }, + get Easing() { + return require(235 ); // 235 = Easing + }, + get I18nManager() { + return require(331 ); // 331 = I18nManager + }, + get ImagePickerIOS() { + return require(393 ); // 393 = ImagePickerIOS + }, + get InteractionManager() { + return require(221 ); // 221 = InteractionManager + }, + get Keyboard() { + return require(109 ); // 109 = Keyboard + }, + get LayoutAnimation() { + return require(302 ); // 302 = LayoutAnimation + }, + get Linking() { + return require(394 ); // 394 = Linking + }, + get NativeEventEmitter() { + return require(102 ); // 102 = NativeEventEmitter + }, + get NavigationExperimental() { + return require(395 ); // 395 = NavigationExperimental + }, + get NetInfo() { + return require(416 ); // 416 = NetInfo + }, + get PanResponder() { + return require(346 ); // 346 = PanResponder + }, + get PermissionsAndroid() { + return require(417 ); // 417 = PermissionsAndroid + }, + get PixelRatio() { + return require(128 ); // 128 = PixelRatio + }, + get PushNotificationIOS() { + return require(418 ); // 418 = PushNotificationIOS + }, + get Settings() { + return require(419 ); // 419 = Settings + }, + get Share() { + return require(420 ); // 420 = Share + }, + get StatusBarIOS() { + return require(108 ); // 108 = StatusBarIOS + }, + get StyleSheet() { + return require(127 ); // 127 = StyleSheet + }, + get Systrace() { + return require(85 ); // 85 = Systrace + }, + get TimePickerAndroid() { + return require(421 ); // 421 = TimePickerAndroid + }, + get UIManager() { + return require(123 ); // 123 = UIManager + }, + get Vibration() { + return require(422 ); // 422 = Vibration + }, + get VibrationIOS() { + return require(423 ); // 423 = VibrationIOS + }, + + get DeviceEventEmitter() { + return require(107 ); // 107 = RCTDeviceEventEmitter + }, + get NativeAppEventEmitter() { + return require(272 ); // 272 = RCTNativeAppEventEmitter + }, + get NativeModules() { + return require(80 ); // 80 = NativeModules + }, + get Platform() { + return require(79 ); // 79 = Platform + }, + get processColor() { + return require(121 ); // 121 = processColor + }, + get requireNativeComponent() { + return require(155 ); // 155 = requireNativeComponent + }, + + get ColorPropType() { + return require(71 ); // 71 = ColorPropType + }, + get EdgeInsetsPropType() { + return require(147 ); // 147 = EdgeInsetsPropType + }, + get PointPropType() { + return require(240 ); // 240 = PointPropType + }, + + addons: { + get LinkedStateMixin() { + if (__DEV__) { + addonWarn('LinkedStateMixin', 'react-addons-linked-state-mixin'); + } + return require(424 ); // 424 = react/lib/LinkedStateMixin + }, + get PureRenderMixin() { + if (__DEV__) { + addonWarn('PureRenderMixin', 'react-addons-pure-render-mixin'); + } + return require(413 ); // 413 = react/lib/ReactComponentWithPureRenderMixin + }, + get TestModule() { + if (__DEV__) { + warning(warningDedupe.TestModule, 'React.addons.TestModule is deprecated. ' + 'Use ReactNative.NativeModules.TestModule instead.'); + warningDedupe.TestModule = true; + } + return require(80 ).TestModule; // 80 = NativeModules + }, + get batchedUpdates() { + if (__DEV__) { + warning(warningDedupe.batchedUpdates, 'React.addons.batchedUpdates is deprecated. ' + 'Use ReactNative.unstable_batchedUpdates instead.'); + warningDedupe.batchedUpdates = true; + } + return require(169 ).batchedUpdates; // 169 = ReactUpdates + }, + get createFragment() { + if (__DEV__) { + addonWarn('createFragment', 'react-addons-create-fragment'); + } + return require(427 ).create; // 427 = react/lib/ReactFragment + }, + get update() { + if (__DEV__) { + addonWarn('update', 'react-addons-update'); + } + return require(428 ); // 428 = react/lib/update + } + } +}; + +if (__DEV__) { + (function () { + var throwOnWrongReactAPI = require(429 ); // 429 = throwOnWrongReactAPI + var reactAPIs = ['createClass', 'Component']; + + var _loop = function _loop(key) { + Object.defineProperty(ReactNative, key, { + get: function get() { + throwOnWrongReactAPI(key); + }, + + enumerable: false, + configurable: false + }); + }; + + for (var _iterator = reactAPIs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var key = _ref; + + _loop(key); + } + })(); +} + +var ReactNativeInternal = require(241 ); // 241 = ReactNative +function applyForwarding(key) { + if (__DEV__) { + Object.defineProperty(ReactNative, key, Object.getOwnPropertyDescriptor(ReactNativeInternal, key)); + return; + } + ReactNative[key] = ReactNativeInternal[key]; +} +for (var key in ReactNativeInternal) { + applyForwarding(key); +} +module.exports = ReactNative; +}, 69, null, "react-native/Libraries/react-native/react-native.js"); +__d(/* ActivityIndicator */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var GRAY = '#999999'; + +var ActivityIndicator = React.createClass({ + displayName: 'ActivityIndicator', + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + animating: PropTypes.bool, + + color: ColorPropType, + + size: PropTypes.oneOfType([PropTypes.oneOf(['small', 'large']), PropTypes.number]), + + hidesWhenStopped: PropTypes.bool + }), + + getDefaultProps: function getDefaultProps() { + return { + animating: true, + color: Platform.OS === 'ios' ? GRAY : undefined, + hidesWhenStopped: true, + size: 'small' + }; + }, + render: function render() { + var _props = this.props, + onLayout = _props.onLayout, + style = _props.style, + props = babelHelpers.objectWithoutProperties(_props, ['onLayout', 'style']); + + var sizeStyle = void 0; + + switch (props.size) { + case 'small': + sizeStyle = styles.sizeSmall; + break; + case 'large': + sizeStyle = styles.sizeLarge; + break; + default: + sizeStyle = { height: props.size, width: props.size }; + break; + } + + return React.createElement( + View, + { + onLayout: onLayout, + style: [styles.container, style], __source: { + fileName: _jsxFileName, + lineNumber: 94 + } + }, + React.createElement(RCTActivityIndicator, babelHelpers.extends({}, props, { + style: sizeStyle, + styleAttr: 'Normal', + indeterminate: true, + __source: { + fileName: _jsxFileName, + lineNumber: 97 + } + })) + ); + } +}); + +var styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'center' + }, + sizeSmall: { + width: 20, + height: 20 + }, + sizeLarge: { + width: 36, + height: 36 + } +}); + +if (Platform.OS === 'ios') { + var RCTActivityIndicator = requireNativeComponent('RCTActivityIndicatorView', ActivityIndicator, { nativeOnly: { activityIndicatorViewStyle: true } }); +} else if (Platform.OS === 'android') { + var RCTActivityIndicator = requireNativeComponent('AndroidProgressBar', ActivityIndicator, { nativeOnly: { + indeterminate: true, + progress: true, + styleAttr: true + } }); +} + +module.exports = ActivityIndicator; +}, 70, null, "ActivityIndicator"); +__d(/* ColorPropType */function(global, require, module, exports) { +'use strict'; + +var ReactPropTypeLocationNames = require(58 ); // 58 = react/lib/ReactPropTypeLocationNames + +var normalizeColor = require(72 ); // 72 = normalizeColor + +var colorPropType = function colorPropType(isRequired, props, propName, componentName, location, propFullName) { + var color = props[propName]; + if (color === undefined || color === null) { + if (isRequired) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Required ' + locationName + ' `' + (propFullName || propName) + '` was not specified in `' + componentName + '`.'); + } + return; + } + + if (typeof color === 'number') { + return; + } + + if (normalizeColor(color) === null) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error('Invalid ' + locationName + ' `' + (propFullName || propName) + '` supplied to `' + componentName + '`: ' + color + '\n' + 'Valid color formats are\n - \'#f0f\' (#rgb)\n - \'#f0fc\' (#rgba)\n - \'#ff00ff\' (#rrggbb)\n - \'#ff00ff00\' (#rrggbbaa)\n - \'rgb(255, 255, 255)\'\n - \'rgba(255, 255, 255, 1.0)\'\n - \'hsl(360, 100%, 100%)\'\n - \'hsla(360, 100%, 100%, 1.0)\'\n - \'transparent\'\n - \'red\'\n - 0xff00ff00 (0xrrggbbaa)\n'); + } +}; + +var ColorPropType = colorPropType.bind(null, false); +ColorPropType.isRequired = colorPropType.bind(null, true); + +module.exports = ColorPropType; +}, 71, null, "ColorPropType"); +__d(/* normalizeColor */function(global, require, module, exports) { +'use strict'; + +function normalizeColor(color) { + var match; + + if (typeof color === 'number') { + if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { + return color; + } + return null; + } + + if (match = matchers.hex6.exec(color)) { + return parseInt(match[1] + 'ff', 16) >>> 0; + } + + if (names.hasOwnProperty(color)) { + return names[color]; + } + + if (match = matchers.rgb.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0; + } + + if (match = matchers.rgba.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0; + } + + if (match = matchers.hex3.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0; + } + + if (match = matchers.hex8.exec(color)) { + return parseInt(match[1], 16) >>> 0; + } + + if (match = matchers.hex4.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0; + } + + if (match = matchers.hsl.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0; + } + + if (match = matchers.hsla.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0; + } + + return null; +} + +function hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + if (t > 1) { + t -= 1; + } + if (t < 1 / 6) { + return p + (q - p) * 6 * t; + } + if (t < 1 / 2) { + return q; + } + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + return p; +} + +function hslToRgb(h, s, l) { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + var r = hue2rgb(p, q, h + 1 / 3); + var g = hue2rgb(p, q, h); + var b = hue2rgb(p, q, h - 1 / 3); + + return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; +} + +var NUMBER = '[-+]?\\d*\\.?\\d+'; +var PERCENTAGE = NUMBER + '%'; + +function call() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)'; +} + +var matchers = { + rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)), + rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)), + hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)), + hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)), + hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^#([0-9a-fA-F]{6})$/, + hex8: /^#([0-9a-fA-F]{8})$/ +}; + +function parse255(str) { + var int = parseInt(str, 10); + if (int < 0) { + return 0; + } + if (int > 255) { + return 255; + } + return int; +} + +function parse360(str) { + var int = parseFloat(str); + return (int % 360 + 360) % 360 / 360; +} + +function parse1(str) { + var num = parseFloat(str); + if (num < 0) { + return 0; + } + if (num > 1) { + return 255; + } + return Math.round(num * 255); +} + +function parsePercentage(str) { + var int = parseFloat(str, 10); + if (int < 0) { + return 0; + } + if (int > 100) { + return 1; + } + return int / 100; +} + +var names = { + transparent: 0x00000000, + + aliceblue: 0xf0f8ffff, + antiquewhite: 0xfaebd7ff, + aqua: 0x00ffffff, + aquamarine: 0x7fffd4ff, + azure: 0xf0ffffff, + beige: 0xf5f5dcff, + bisque: 0xffe4c4ff, + black: 0x000000ff, + blanchedalmond: 0xffebcdff, + blue: 0x0000ffff, + blueviolet: 0x8a2be2ff, + brown: 0xa52a2aff, + burlywood: 0xdeb887ff, + burntsienna: 0xea7e5dff, + cadetblue: 0x5f9ea0ff, + chartreuse: 0x7fff00ff, + chocolate: 0xd2691eff, + coral: 0xff7f50ff, + cornflowerblue: 0x6495edff, + cornsilk: 0xfff8dcff, + crimson: 0xdc143cff, + cyan: 0x00ffffff, + darkblue: 0x00008bff, + darkcyan: 0x008b8bff, + darkgoldenrod: 0xb8860bff, + darkgray: 0xa9a9a9ff, + darkgreen: 0x006400ff, + darkgrey: 0xa9a9a9ff, + darkkhaki: 0xbdb76bff, + darkmagenta: 0x8b008bff, + darkolivegreen: 0x556b2fff, + darkorange: 0xff8c00ff, + darkorchid: 0x9932ccff, + darkred: 0x8b0000ff, + darksalmon: 0xe9967aff, + darkseagreen: 0x8fbc8fff, + darkslateblue: 0x483d8bff, + darkslategray: 0x2f4f4fff, + darkslategrey: 0x2f4f4fff, + darkturquoise: 0x00ced1ff, + darkviolet: 0x9400d3ff, + deeppink: 0xff1493ff, + deepskyblue: 0x00bfffff, + dimgray: 0x696969ff, + dimgrey: 0x696969ff, + dodgerblue: 0x1e90ffff, + firebrick: 0xb22222ff, + floralwhite: 0xfffaf0ff, + forestgreen: 0x228b22ff, + fuchsia: 0xff00ffff, + gainsboro: 0xdcdcdcff, + ghostwhite: 0xf8f8ffff, + gold: 0xffd700ff, + goldenrod: 0xdaa520ff, + gray: 0x808080ff, + green: 0x008000ff, + greenyellow: 0xadff2fff, + grey: 0x808080ff, + honeydew: 0xf0fff0ff, + hotpink: 0xff69b4ff, + indianred: 0xcd5c5cff, + indigo: 0x4b0082ff, + ivory: 0xfffff0ff, + khaki: 0xf0e68cff, + lavender: 0xe6e6faff, + lavenderblush: 0xfff0f5ff, + lawngreen: 0x7cfc00ff, + lemonchiffon: 0xfffacdff, + lightblue: 0xadd8e6ff, + lightcoral: 0xf08080ff, + lightcyan: 0xe0ffffff, + lightgoldenrodyellow: 0xfafad2ff, + lightgray: 0xd3d3d3ff, + lightgreen: 0x90ee90ff, + lightgrey: 0xd3d3d3ff, + lightpink: 0xffb6c1ff, + lightsalmon: 0xffa07aff, + lightseagreen: 0x20b2aaff, + lightskyblue: 0x87cefaff, + lightslategray: 0x778899ff, + lightslategrey: 0x778899ff, + lightsteelblue: 0xb0c4deff, + lightyellow: 0xffffe0ff, + lime: 0x00ff00ff, + limegreen: 0x32cd32ff, + linen: 0xfaf0e6ff, + magenta: 0xff00ffff, + maroon: 0x800000ff, + mediumaquamarine: 0x66cdaaff, + mediumblue: 0x0000cdff, + mediumorchid: 0xba55d3ff, + mediumpurple: 0x9370dbff, + mediumseagreen: 0x3cb371ff, + mediumslateblue: 0x7b68eeff, + mediumspringgreen: 0x00fa9aff, + mediumturquoise: 0x48d1ccff, + mediumvioletred: 0xc71585ff, + midnightblue: 0x191970ff, + mintcream: 0xf5fffaff, + mistyrose: 0xffe4e1ff, + moccasin: 0xffe4b5ff, + navajowhite: 0xffdeadff, + navy: 0x000080ff, + oldlace: 0xfdf5e6ff, + olive: 0x808000ff, + olivedrab: 0x6b8e23ff, + orange: 0xffa500ff, + orangered: 0xff4500ff, + orchid: 0xda70d6ff, + palegoldenrod: 0xeee8aaff, + palegreen: 0x98fb98ff, + paleturquoise: 0xafeeeeff, + palevioletred: 0xdb7093ff, + papayawhip: 0xffefd5ff, + peachpuff: 0xffdab9ff, + peru: 0xcd853fff, + pink: 0xffc0cbff, + plum: 0xdda0ddff, + powderblue: 0xb0e0e6ff, + purple: 0x800080ff, + rebeccapurple: 0x663399ff, + red: 0xff0000ff, + rosybrown: 0xbc8f8fff, + royalblue: 0x4169e1ff, + saddlebrown: 0x8b4513ff, + salmon: 0xfa8072ff, + sandybrown: 0xf4a460ff, + seagreen: 0x2e8b57ff, + seashell: 0xfff5eeff, + sienna: 0xa0522dff, + silver: 0xc0c0c0ff, + skyblue: 0x87ceebff, + slateblue: 0x6a5acdff, + slategray: 0x708090ff, + slategrey: 0x708090ff, + snow: 0xfffafaff, + springgreen: 0x00ff7fff, + steelblue: 0x4682b4ff, + tan: 0xd2b48cff, + teal: 0x008080ff, + thistle: 0xd8bfd8ff, + tomato: 0xff6347ff, + turquoise: 0x40e0d0ff, + violet: 0xee82eeff, + wheat: 0xf5deb3ff, + white: 0xffffffff, + whitesmoke: 0xf5f5f5ff, + yellow: 0xffff00ff, + yellowgreen: 0x9acd32ff +}; + +module.exports = normalizeColor; +}, 72, null, "normalizeColor"); +__d(/* NativeMethodsMixin */function(global, require, module, exports) { +'use strict'; + +var ReactNativeAttributePayload = require(74 ); // 74 = ReactNativeAttributePayload +var TextInputState = require(78 ); // 78 = TextInputState +var UIManager = require(123 ); // 123 = UIManager + +var findNodeHandle = require(124 ); // 124 = findNodeHandle +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function warnForStyleProps(props, validAttributes) { + for (var key in validAttributes.style) { + if (!(validAttributes[key] || props[key] === undefined)) { + console.error('You are setting the style `{ ' + key + ': ... }` as a prop. You ' + 'should nest it in a style object. ' + 'E.g. `{ style: { ' + key + ': ... } }`'); + } + } +} + +var NativeMethodsMixin = { + measure: function measure(callback) { + UIManager.measure(findNodeHandle(this), mountSafeCallback(this, callback)); + }, + + measureInWindow: function measureInWindow(callback) { + UIManager.measureInWindow(findNodeHandle(this), mountSafeCallback(this, callback)); + }, + + measureLayout: function measureLayout(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); + }, + + setNativeProps: function setNativeProps(nativeProps) { + if (!this.viewConfig) { + var ctor = this.constructor; + var componentName = ctor.displayName || ctor.name || ''; + invariant(false, componentName + ' "viewConfig" is not defined.'); + } + + if (__DEV__) { + warnForStyleProps(nativeProps, this.viewConfig.validAttributes); + } + + var updatePayload = ReactNativeAttributePayload.create(nativeProps, this.viewConfig.validAttributes); + + UIManager.updateView(findNodeHandle(this), this.viewConfig.uiViewClassName, updatePayload); + }, + + focus: function focus() { + TextInputState.focusTextInput(findNodeHandle(this)); + }, + + blur: function blur() { + TextInputState.blurTextInput(findNodeHandle(this)); + } +}; + +function throwOnStylesProp(component, props) { + if (props.styles !== undefined) { + var owner = component._owner || null; + var name = component.constructor.displayName; + var msg = '`styles` is not a supported property of `' + name + '`, did ' + 'you mean `style` (singular)?'; + if (owner && owner.constructor && owner.constructor.displayName) { + msg += '\n\nCheck the `' + owner.constructor.displayName + '` parent ' + ' component.'; + } + throw new Error(msg); + } +} +if (__DEV__) { + var NativeMethodsMixin_DEV = NativeMethodsMixin; + invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, 'Do not override existing functions.'); + NativeMethodsMixin_DEV.componentWillMount = function () { + throwOnStylesProp(this, this.props); + }; + NativeMethodsMixin_DEV.componentWillReceiveProps = function (newProps) { + throwOnStylesProp(this, newProps); + }; +} + +function mountSafeCallback(context, callback) { + return function () { + if (!callback || context.isMounted && !context.isMounted()) { + return undefined; + } + return callback.apply(context, arguments); + }; +} + +module.exports = NativeMethodsMixin; +}, 73, null, "NativeMethodsMixin"); +__d(/* ReactNativeAttributePayload */function(global, require, module, exports) { +'use strict'; + +var ReactNativePropRegistry = require(75 ); // 75 = ReactNativePropRegistry + +var deepDiffer = require(76 ); // 76 = deepDiffer +var flattenStyle = require(77 ); // 77 = flattenStyle + +var emptyObject = {}; + +var removedKeys = null; +var removedKeyCount = 0; + +function defaultDiffer(prevProp, nextProp) { + if (typeof nextProp !== 'object' || nextProp === null) { + return true; + } else { + return deepDiffer(prevProp, nextProp); + } +} + +function resolveObject(idOrObject) { + if (typeof idOrObject === 'number') { + return ReactNativePropRegistry.getByID(idOrObject); + } + return idOrObject; +} + +function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (Array.isArray(node)) { + var i = node.length; + while (i-- && removedKeyCount > 0) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } + } else if (node && removedKeyCount > 0) { + var obj = resolveObject(node); + for (var propKey in removedKeys) { + if (!removedKeys[propKey]) { + continue; + } + var nextProp = obj[propKey]; + if (nextProp === undefined) { + continue; + } + + var attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; + } + + if (typeof nextProp === 'function') { + nextProp = true; + } + if (typeof nextProp === 'undefined') { + nextProp = null; + } + + if (typeof attributeConfig !== 'object') { + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + var nextValue = typeof attributeConfig.process === 'function' ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + removedKeys[propKey] = false; + removedKeyCount--; + } + } +} + +function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + var i; + for (i = 0; i < minLength; i++) { + updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + } + for (; i < prevArray.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + } + for (; i < nextArray.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + } + return updatePayload; +} + +function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + + if (!updatePayload && prevProp === nextProp) { + return updatePayload; + } + + if (!prevProp || !nextProp) { + if (nextProp) { + return addNestedProperty(updatePayload, nextProp, validAttributes); + } + if (prevProp) { + return clearNestedProperty(updatePayload, prevProp, validAttributes); + } + return updatePayload; + } + + if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) { + return diffProperties(updatePayload, resolveObject(prevProp), resolveObject(nextProp), validAttributes); + } + + if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + return diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes); + } + + if (Array.isArray(prevProp)) { + return diffProperties(updatePayload, flattenStyle(prevProp), resolveObject(nextProp), validAttributes); + } + + return diffProperties(updatePayload, resolveObject(prevProp), flattenStyle(nextProp), validAttributes); +} + +function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) { + return updatePayload; + } + + if (!Array.isArray(nextProp)) { + return addProperties(updatePayload, resolveObject(nextProp), validAttributes); + } + + for (var i = 0; i < nextProp.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + + return updatePayload; +} + +function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) { + return updatePayload; + } + + if (!Array.isArray(prevProp)) { + return clearProperties(updatePayload, resolveObject(prevProp), validAttributes); + } + + for (var i = 0; i < prevProp.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + return updatePayload; +} + +function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig; + var nextProp; + var prevProp; + + for (var propKey in nextProps) { + attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; + } + + prevProp = prevProps[propKey]; + nextProp = nextProps[propKey]; + + if (typeof nextProp === 'function') { + nextProp = true; + + if (typeof prevProp === 'function') { + prevProp = true; + } + } + + if (typeof nextProp === 'undefined') { + nextProp = null; + if (typeof prevProp === 'undefined') { + prevProp = null; + } + } + + if (removedKeys) { + removedKeys[propKey] = false; + } + + if (updatePayload && updatePayload[propKey] !== undefined) { + if (typeof attributeConfig !== 'object') { + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + var nextValue = typeof attributeConfig.process === 'function' ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + continue; + } + + if (prevProp === nextProp) { + continue; + } + + if (typeof attributeConfig !== 'object') { + if (defaultDiffer(prevProp, nextProp)) { + (updatePayload || (updatePayload = {}))[propKey] = nextProp; + } + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + var shouldUpdate = prevProp === undefined || (typeof attributeConfig.diff === 'function' ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + if (shouldUpdate) { + nextValue = typeof attributeConfig.process === 'function' ? attributeConfig.process(nextProp) : nextProp; + (updatePayload || (updatePayload = {}))[propKey] = nextValue; + } + } else { + removedKeys = null; + removedKeyCount = 0; + + updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig); + if (removedKeyCount > 0 && updatePayload) { + restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig); + removedKeys = null; + } + } + } + + for (propKey in prevProps) { + if (nextProps[propKey] !== undefined) { + continue; + } + attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; + } + + if (updatePayload && updatePayload[propKey] !== undefined) { + continue; + } + + prevProp = prevProps[propKey]; + if (prevProp === undefined) { + continue; + } + + if (typeof attributeConfig !== 'object' || typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + (updatePayload || (updatePayload = {}))[propKey] = null; + if (!removedKeys) { + removedKeys = {}; + } + if (!removedKeys[propKey]) { + removedKeys[propKey] = true; + removedKeyCount++; + } + } else { + updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig); + } + } + return updatePayload; +} + +function addProperties(updatePayload, props, validAttributes) { + return diffProperties(updatePayload, emptyObject, props, validAttributes); +} + +function clearProperties(updatePayload, prevProps, validAttributes) { + return diffProperties(updatePayload, prevProps, emptyObject, validAttributes); +} + +var ReactNativeAttributePayload = { + + create: function create(props, validAttributes) { + return addProperties(null, props, validAttributes); + }, + + diff: function diff(prevProps, nextProps, validAttributes) { + return diffProperties(null, prevProps, nextProps, validAttributes); + } + +}; + +module.exports = ReactNativeAttributePayload; +}, 74, null, "ReactNativeAttributePayload"); +__d(/* ReactNativePropRegistry */function(global, require, module, exports) { +'use strict'; + +var objects = {}; +var uniqueID = 1; +var emptyObject = {}; + +var ReactNativePropRegistry = function () { + function ReactNativePropRegistry() { + babelHelpers.classCallCheck(this, ReactNativePropRegistry); + } + + babelHelpers.createClass(ReactNativePropRegistry, null, [{ + key: 'register', + value: function register(object) { + var id = ++uniqueID; + if (__DEV__) { + Object.freeze(object); + } + objects[id] = object; + return id; + } + }, { + key: 'getByID', + value: function getByID(id) { + if (!id) { + return emptyObject; + } + + var object = objects[id]; + if (!object) { + console.warn('Invalid style with id `' + id + '`. Skipping ...'); + return emptyObject; + } + return object; + } + }]); + return ReactNativePropRegistry; +}(); + +module.exports = ReactNativePropRegistry; +}, 75, null, "ReactNativePropRegistry"); +__d(/* deepDiffer */function(global, require, module, exports) { +'use strict'; + +var deepDiffer = function deepDiffer(one, two) { + if (one === two) { + return false; + } + if (typeof one === 'function' && typeof two === 'function') { + return false; + } + if (typeof one !== 'object' || one === null) { + return one !== two; + } + if (typeof two !== 'object' || two === null) { + return true; + } + if (one.constructor !== two.constructor) { + return true; + } + if (Array.isArray(one)) { + var len = one.length; + if (two.length !== len) { + return true; + } + for (var ii = 0; ii < len; ii++) { + if (deepDiffer(one[ii], two[ii])) { + return true; + } + } + } else { + for (var key in one) { + if (deepDiffer(one[key], two[key])) { + return true; + } + } + for (var twoKey in two) { + if (one[twoKey] === undefined && two[twoKey] !== undefined) { + return true; + } + } + } + return false; +}; + +module.exports = deepDiffer; +}, 76, null, "deepDiffer"); +__d(/* flattenStyle */function(global, require, module, exports) { +'use strict'; + +var ReactNativePropRegistry = require(75 ); // 75 = ReactNativePropRegistry +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function getStyle(style) { + if (typeof style === 'number') { + return ReactNativePropRegistry.getByID(style); + } + return style; +} + +function flattenStyle(style) { + if (!style) { + return undefined; + } + invariant(style !== true, 'style may be false but not true'); + + if (!Array.isArray(style)) { + return getStyle(style); + } + + var result = {}; + for (var i = 0, styleLength = style.length; i < styleLength; ++i) { + var computedStyle = flattenStyle(style[i]); + if (computedStyle) { + for (var key in computedStyle) { + result[key] = computedStyle[key]; + } + } + } + return result; +} + +module.exports = flattenStyle; +}, 77, null, "flattenStyle"); +__d(/* TextInputState */function(global, require, module, exports) { +'use strict'; + +var Platform = require(79 ); // 79 = Platform +var UIManager = require(123 ); // 123 = UIManager + +var TextInputState = { + _currentlyFocusedID: null, + + currentlyFocusedField: function currentlyFocusedField() { + return this._currentlyFocusedID; + }, + + focusTextInput: function focusTextInput(textFieldID) { + if (this._currentlyFocusedID !== textFieldID && textFieldID !== null) { + this._currentlyFocusedID = textFieldID; + if (Platform.OS === 'ios') { + UIManager.focus(textFieldID); + } else if (Platform.OS === 'android') { + UIManager.dispatchViewManagerCommand(textFieldID, UIManager.AndroidTextInput.Commands.focusTextInput, null); + } + } + }, + + blurTextInput: function blurTextInput(textFieldID) { + if (this._currentlyFocusedID === textFieldID && textFieldID !== null) { + this._currentlyFocusedID = null; + if (Platform.OS === 'ios') { + UIManager.blur(textFieldID); + } else if (Platform.OS === 'android') { + UIManager.dispatchViewManagerCommand(textFieldID, UIManager.AndroidTextInput.Commands.blurTextInput, null); + } + } + } +}; + +module.exports = TextInputState; +}, 78, null, "TextInputState"); +__d(/* Platform */function(global, require, module, exports) { + +'use strict'; + +var Platform = { + OS: 'ios', + get Version() { + var constants = require(80 ).IOSConstants; // 80 = NativeModules + return constants ? constants.osVersion : ''; + }, + get isTVOS() { + var constants = require(80 ).IOSConstants; // 80 = NativeModules + return constants ? constants.interfaceIdiom === 'tv' : false; + }, + get isTesting() { + var constants = require(80 ).IOSConstants; // 80 = NativeModules + return constants && constants.isTesting; + }, + select: function select(obj) { + return obj.ios; + } +}; + +module.exports = Platform; +}, 79, null, "Platform"); +__d(/* NativeModules */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge + +var defineLazyObjectProperty = require(122 ); // 122 = defineLazyObjectProperty +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function genModule(config, moduleID) { + if (!config) { + return null; + } + + var _config = babelHelpers.slicedToArray(config, 5), + moduleName = _config[0], + constants = _config[1], + methods = _config[2], + promiseMethods = _config[3], + syncMethods = _config[4]; + + invariant(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'), 'Module name prefixes should\'ve been stripped by the native side ' + 'but wasn\'t for ' + moduleName); + + if (!constants && !methods) { + return { name: moduleName }; + } + + var module = {}; + methods && methods.forEach(function (methodName, methodID) { + var isPromise = promiseMethods && arrayContains(promiseMethods, methodID); + var isSync = syncMethods && arrayContains(syncMethods, methodID); + invariant(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook'); + var methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async'; + module[methodName] = genMethod(moduleID, methodID, methodType); + }); + babelHelpers.extends(module, constants); + + if (__DEV__) { + BatchedBridge.createDebugLookup(moduleID, moduleName, methods); + } + + return { name: moduleName, module: module }; +} + +global.__fbGenNativeModule = genModule; + +function loadModule(name, moduleID) { + invariant(global.nativeRequireModuleConfig, 'Can\'t lazily create module without nativeRequireModuleConfig'); + var config = global.nativeRequireModuleConfig(name); + var info = genModule(config, moduleID); + return info && info.module; +} + +function genMethod(moduleID, methodID, type) { + var fn = null; + if (type === 'promise') { + fn = function fn() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new Promise(function (resolve, reject) { + BatchedBridge.enqueueNativeCall(moduleID, methodID, args, function (data) { + return resolve(data); + }, function (errorData) { + return reject(createErrorFromErrorData(errorData)); + }); + }); + }; + } else if (type === 'sync') { + fn = function fn() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return global.nativeCallSyncHook(moduleID, methodID, args); + }; + } else { + fn = function fn() { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + var lastArg = args.length > 0 ? args[args.length - 1] : null; + var secondLastArg = args.length > 1 ? args[args.length - 2] : null; + var hasSuccessCallback = typeof lastArg === 'function'; + var hasErrorCallback = typeof secondLastArg === 'function'; + hasErrorCallback && invariant(hasSuccessCallback, 'Cannot have a non-function arg after a function arg.'); + var onSuccess = hasSuccessCallback ? lastArg : null; + var onFail = hasErrorCallback ? secondLastArg : null; + var callbackCount = hasSuccessCallback + hasErrorCallback; + args = args.slice(0, args.length - callbackCount); + BatchedBridge.enqueueNativeCall(moduleID, methodID, args, onFail, onSuccess); + }; + } + fn.type = type; + return fn; +} + +function arrayContains(array, value) { + return array.indexOf(value) !== -1; +} + +function createErrorFromErrorData(errorData) { + var message = errorData.message, + extraErrorInfo = babelHelpers.objectWithoutProperties(errorData, ['message']); + + var error = new Error(message); + error.framesToPop = 1; + return babelHelpers.extends(error, extraErrorInfo); +} + +var NativeModules = {}; +if (global.nativeModuleProxy) { + NativeModules = global.nativeModuleProxy; +} else { + var bridgeConfig = global.__fbBatchedBridgeConfig; + invariant(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules'); + + (bridgeConfig.remoteModuleConfig || []).forEach(function (config, moduleID) { + var info = genModule(config, moduleID); + if (!info) { + return; + } + + if (info.module) { + NativeModules[info.name] = info.module; + } else { + defineLazyObjectProperty(NativeModules, info.name, { + get: function get() { + return loadModule(info.name, moduleID); + } + }); + } + }); +} + +module.exports = NativeModules; +}, 80, null, "NativeModules"); +__d(/* BatchedBridge */function(global, require, module, exports) { +'use strict'; + +var MessageQueue = require(82 ); // 82 = MessageQueue +var BatchedBridge = new MessageQueue(); + +BatchedBridge.registerCallableModule('Systrace', require(85 )); // 85 = Systrace +BatchedBridge.registerCallableModule('JSTimersExecution', require(84 )); // 84 = JSTimersExecution +BatchedBridge.registerCallableModule('HeapCapture', require(98 )); // 98 = HeapCapture +BatchedBridge.registerCallableModule('SamplingProfiler', require(99 )); // 99 = SamplingProfiler + +if (__DEV__) { + BatchedBridge.registerCallableModule('HMRClient', require(100 )); // 100 = HMRClient +} + +Object.defineProperty(global, '__fbBatchedBridge', { + configurable: true, + value: BatchedBridge +}); + +module.exports = BatchedBridge; +}, 81, null, "BatchedBridge"); +__d(/* MessageQueue */function(global, require, module, exports) { + +'use strict'; + +var ErrorUtils = require(83 ); // 83 = ErrorUtils +var JSTimersExecution = require(84 ); // 84 = JSTimersExecution +var Systrace = require(85 ); // 85 = Systrace + +var deepFreezeAndThrowOnMutationInDev = require(96 ); // 96 = deepFreezeAndThrowOnMutationInDev +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var stringifySafe = require(97 ); // 97 = stringifySafe + +var TO_JS = 0; +var TO_NATIVE = 1; + +var MODULE_IDS = 0; +var METHOD_IDS = 1; +var PARAMS = 2; +var MIN_TIME_BETWEEN_FLUSHES_MS = 5; + +var TRACE_TAG_REACT_APPS = 1 << 17; + +var DEBUG_INFO_LIMIT = 32; + +var guard = function guard(fn) { + try { + fn(); + } catch (error) { + ErrorUtils.reportFatalError(error); + } +}; + +var MessageQueue = function () { + function MessageQueue() { + babelHelpers.classCallCheck(this, MessageQueue); + + this._callableModules = {}; + this._queue = [[], [], [], 0]; + this._callbacks = []; + this._callbackID = 0; + this._callID = 0; + this._lastFlush = 0; + this._eventLoopStartTime = new Date().getTime(); + + if (__DEV__) { + this._debugInfo = {}; + this._remoteModuleTable = {}; + this._remoteMethodTable = {}; + } + + this.callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind(this); + this.callFunctionReturnResultAndFlushedQueue = this.callFunctionReturnResultAndFlushedQueue.bind(this); + this.flushedQueue = this.flushedQueue.bind(this); + this.invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind(this); + } + + babelHelpers.createClass(MessageQueue, [{ + key: 'callFunctionReturnFlushedQueue', + value: function callFunctionReturnFlushedQueue(module, method, args) { + var _this = this; + + guard(function () { + _this.__callFunction(module, method, args); + _this.__callImmediates(); + }); + + return this.flushedQueue(); + } + }, { + key: 'callFunctionReturnResultAndFlushedQueue', + value: function callFunctionReturnResultAndFlushedQueue(module, method, args) { + var _this2 = this; + + var result = void 0; + guard(function () { + result = _this2.__callFunction(module, method, args); + _this2.__callImmediates(); + }); + + return [result, this.flushedQueue()]; + } + }, { + key: 'invokeCallbackAndReturnFlushedQueue', + value: function invokeCallbackAndReturnFlushedQueue(cbID, args) { + var _this3 = this; + + guard(function () { + _this3.__invokeCallback(cbID, args); + _this3.__callImmediates(); + }); + + return this.flushedQueue(); + } + }, { + key: 'flushedQueue', + value: function flushedQueue() { + this.__callImmediates(); + + var queue = this._queue; + this._queue = [[], [], [], this._callID]; + return queue[0].length ? queue : null; + } + }, { + key: 'getEventLoopRunningTime', + value: function getEventLoopRunningTime() { + return new Date().getTime() - this._eventLoopStartTime; + } + }, { + key: 'registerCallableModule', + value: function registerCallableModule(name, module) { + this._callableModules[name] = module; + } + }, { + key: 'enqueueNativeCall', + value: function enqueueNativeCall(moduleID, methodID, params, onFail, onSucc) { + if (onFail || onSucc) { + if (__DEV__) { + var callId = this._callbackID >> 1; + this._debugInfo[callId] = [moduleID, methodID]; + if (callId > DEBUG_INFO_LIMIT) { + delete this._debugInfo[callId - DEBUG_INFO_LIMIT]; + } + } + onFail && params.push(this._callbackID); + + this._callbacks[this._callbackID++] = onFail; + onSucc && params.push(this._callbackID); + + this._callbacks[this._callbackID++] = onSucc; + } + + if (__DEV__) { + global.nativeTraceBeginAsyncFlow && global.nativeTraceBeginAsyncFlow(TRACE_TAG_REACT_APPS, 'native', this._callID); + } + this._callID++; + + this._queue[MODULE_IDS].push(moduleID); + this._queue[METHOD_IDS].push(methodID); + + if (__DEV__) { + JSON.stringify(params); + + deepFreezeAndThrowOnMutationInDev(params); + } + this._queue[PARAMS].push(params); + + var now = new Date().getTime(); + if (global.nativeFlushQueueImmediate && now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS) { + global.nativeFlushQueueImmediate(this._queue); + this._queue = [[], [], [], this._callID]; + this._lastFlush = now; + } + Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length); + if (__DEV__ && this.__spy && isFinite(moduleID)) { + this.__spy({ type: TO_NATIVE, + module: this._remoteModuleTable[moduleID], + method: this._remoteMethodTable[moduleID][methodID], + args: params }); + } + } + }, { + key: 'createDebugLookup', + value: function createDebugLookup(moduleID, name, methods) { + if (__DEV__) { + this._remoteModuleTable[moduleID] = name; + this._remoteMethodTable[moduleID] = methods; + } + } + }, { + key: '__callImmediates', + value: function __callImmediates() { + Systrace.beginEvent('JSTimersExecution.callImmediates()'); + guard(function () { + return JSTimersExecution.callImmediates(); + }); + Systrace.endEvent(); + } + }, { + key: '__callFunction', + value: function __callFunction(module, method, args) { + this._lastFlush = new Date().getTime(); + this._eventLoopStartTime = this._lastFlush; + Systrace.beginEvent(module + '.' + method + '()'); + if (__DEV__ && this.__spy) { + this.__spy({ type: TO_JS, module: module, method: method, args: args }); + } + var moduleMethods = this._callableModules[module]; + invariant(!!moduleMethods, 'Module %s is not a registered callable module (calling %s)', module, method); + invariant(!!moduleMethods[method], 'Method %s does not exist on module %s', method, module); + var result = moduleMethods[method].apply(moduleMethods, args); + Systrace.endEvent(); + return result; + } + }, { + key: '__invokeCallback', + value: function __invokeCallback(cbID, args) { + this._lastFlush = new Date().getTime(); + this._eventLoopStartTime = this._lastFlush; + var callback = this._callbacks[cbID]; + + if (__DEV__) { + var debug = this._debugInfo[cbID >> 1]; + var _module = debug && this._remoteModuleTable[debug[0]]; + var _method = debug && this._remoteMethodTable[debug[0]][debug[1]]; + if (callback == null) { + var errorMessage = 'Callback with id ' + cbID + ': ' + _module + '.' + _method + '() not found'; + if (_method) { + errorMessage = 'The callback ' + _method + '() exists in module ' + _module + ', ' + 'but only one callback may be registered to a function in a native module.'; + } + invariant(callback, errorMessage); + } + var profileName = debug ? '' : cbID; + if (callback && this.__spy && __DEV__) { + this.__spy({ type: TO_JS, module: null, method: profileName, args: args }); + } + Systrace.beginEvent('MessageQueue.invokeCallback(' + profileName + ', ' + stringifySafe(args) + ')'); + } else { + if (!callback) { + return; + } + } + + this._callbacks[cbID & ~1] = null; + + this._callbacks[cbID | 1] = null; + + callback.apply(null, args); + + if (__DEV__) { + Systrace.endEvent(); + } + } + }], [{ + key: 'spy', + value: function spy(spyOrToggle) { + if (spyOrToggle === true) { + MessageQueue.prototype.__spy = function (info) { + console.log((info.type === TO_JS ? 'N->JS' : 'JS->N') + ' : ' + ('' + (info.module ? info.module + '.' : '') + info.method) + ('(' + JSON.stringify(info.args) + ')')); + }; + } else if (spyOrToggle === false) { + MessageQueue.prototype.__spy = null; + } else { + MessageQueue.prototype.__spy = spyOrToggle; + } + } + }]); + return MessageQueue; +}(); + +module.exports = MessageQueue; +}, 82, null, "MessageQueue"); +__d(/* ErrorUtils */function(global, require, module, exports) { +module.exports = global.ErrorUtils; +}, 83, null, "ErrorUtils"); +__d(/* JSTimersExecution */function(global, require, module, exports) { +'use strict'; + +var Systrace = require(85 ); // 85 = Systrace + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var performanceNow = require(90 ); // 90 = fbjs/lib/performanceNow +var warning = require(40 ); // 40 = fbjs/lib/warning + +var FRAME_DURATION = 1000 / 60; +var IDLE_CALLBACK_FRAME_DEADLINE = 1; + +var hasEmittedTimeDriftWarning = false; + +var JSTimersExecution = { + GUID: 1, + + callbacks: [], + types: [], + timerIDs: [], + immediates: [], + requestIdleCallbacks: [], + identifiers: [], + + errors: null, + + callTimer: function callTimer(timerID, frameTime) { + warning(timerID <= JSTimersExecution.GUID, 'Tried to call timer with ID %s but no such timer exists.', timerID); + + var timerIndex = JSTimersExecution.timerIDs.indexOf(timerID); + if (timerIndex === -1) { + return; + } + + var type = JSTimersExecution.types[timerIndex]; + var callback = JSTimersExecution.callbacks[timerIndex]; + if (!callback || !type) { + console.error('No callback found for timerID ' + timerID); + return; + } + + if (__DEV__) { + var identifier = JSTimersExecution.identifiers[timerIndex] || {}; + Systrace.beginEvent('Systrace.callTimer: ' + identifier.methodName); + } + + if (type === 'setTimeout' || type === 'setImmediate' || type === 'requestAnimationFrame' || type === 'requestIdleCallback') { + JSTimersExecution._clearIndex(timerIndex); + } + + try { + if (type === 'setTimeout' || type === 'setInterval' || type === 'setImmediate') { + callback(); + } else if (type === 'requestAnimationFrame') { + callback(performanceNow()); + } else if (type === 'requestIdleCallback') { + callback({ + timeRemaining: function timeRemaining() { + return Math.max(0, FRAME_DURATION - (performanceNow() - frameTime)); + } + }); + } else { + console.error('Tried to call a callback with invalid type: ' + type); + } + } catch (e) { + if (!JSTimersExecution.errors) { + JSTimersExecution.errors = [e]; + } else { + JSTimersExecution.errors.push(e); + } + } + + if (__DEV__) { + Systrace.endEvent(); + } + }, + callTimers: function callTimers(timerIDs) { + invariant(timerIDs.length !== 0, 'Cannot call `callTimers` with an empty list of IDs.'); + + JSTimersExecution.errors = null; + for (var i = 0; i < timerIDs.length; i++) { + JSTimersExecution.callTimer(timerIDs[i], 0); + } + + var errors = JSTimersExecution.errors; + if (errors) { + var errorCount = errors.length; + if (errorCount > 1) { + for (var ii = 1; ii < errorCount; ii++) { + require(92 ).setTimeout(function (error) { // 92 = JSTimers + throw error; + }.bind(null, errors[ii]), 0); + } + } + throw errors[0]; + } + }, + + + callIdleCallbacks: function callIdleCallbacks(frameTime) { + if (FRAME_DURATION - (performanceNow() - frameTime) < IDLE_CALLBACK_FRAME_DEADLINE) { + return; + } + + JSTimersExecution.errors = null; + if (JSTimersExecution.requestIdleCallbacks.length > 0) { + var passIdleCallbacks = JSTimersExecution.requestIdleCallbacks.slice(); + JSTimersExecution.requestIdleCallbacks = []; + + for (var i = 0; i < passIdleCallbacks.length; ++i) { + JSTimersExecution.callTimer(passIdleCallbacks[i], frameTime); + } + } + + if (JSTimersExecution.requestIdleCallbacks.length === 0) { + var _require = require(80 ), // 80 = NativeModules + Timing = _require.Timing; + + Timing.setSendIdleEvents(false); + } + + if (JSTimersExecution.errors) { + JSTimersExecution.errors.forEach(function (error) { + return require(92 ).setTimeout(function () { // 92 = JSTimers + throw error; + }, 0); + }); + } + }, + + callImmediatesPass: function callImmediatesPass() { + Systrace.beginEvent('JSTimersExecution.callImmediatesPass()'); + + if (JSTimersExecution.immediates.length > 0) { + var passImmediates = JSTimersExecution.immediates.slice(); + JSTimersExecution.immediates = []; + + for (var i = 0; i < passImmediates.length; ++i) { + JSTimersExecution.callTimer(passImmediates[i], 0); + } + } + + Systrace.endEvent(); + + return JSTimersExecution.immediates.length > 0; + }, + callImmediates: function callImmediates() { + JSTimersExecution.errors = null; + while (JSTimersExecution.callImmediatesPass()) {} + if (JSTimersExecution.errors) { + JSTimersExecution.errors.forEach(function (error) { + return require(92 ).setTimeout(function () { // 92 = JSTimers + throw error; + }, 0); + }); + } + }, + emitTimeDriftWarning: function emitTimeDriftWarning(warningMessage) { + if (hasEmittedTimeDriftWarning) { + return; + } + hasEmittedTimeDriftWarning = true; + console.warn(warningMessage); + }, + _clearIndex: function _clearIndex(i) { + JSTimersExecution.timerIDs[i] = null; + JSTimersExecution.callbacks[i] = null; + JSTimersExecution.types[i] = null; + JSTimersExecution.identifiers[i] = null; + } +}; + +module.exports = JSTimersExecution; +}, 84, null, "JSTimersExecution"); +__d(/* Systrace */function(global, require, module, exports) { +'use strict'; + +var TRACE_TAG_REACT_APPS = 1 << 17; +var TRACE_TAG_JSC_CALLS = 1 << 27; + +var _enabled = false; +var _asyncCookie = 0; + +var ReactSystraceDevtool = __DEV__ ? { + onBeforeMountComponent: function onBeforeMountComponent(debugID) { + var displayName = require(56 ).getDisplayName(debugID); // 56 = react/lib/ReactComponentTreeHook + Systrace.beginEvent('ReactReconciler.mountComponent(' + displayName + ')'); + }, + onMountComponent: function onMountComponent(debugID) { + Systrace.endEvent(); + }, + onBeforeUpdateComponent: function onBeforeUpdateComponent(debugID) { + var displayName = require(56 ).getDisplayName(debugID); // 56 = react/lib/ReactComponentTreeHook + Systrace.beginEvent('ReactReconciler.updateComponent(' + displayName + ')'); + }, + onUpdateComponent: function onUpdateComponent(debugID) { + Systrace.endEvent(); + }, + onBeforeUnmountComponent: function onBeforeUnmountComponent(debugID) { + var displayName = require(56 ).getDisplayName(debugID); // 56 = react/lib/ReactComponentTreeHook + Systrace.beginEvent('ReactReconciler.unmountComponent(' + displayName + ')'); + }, + onUnmountComponent: function onUnmountComponent(debugID) { + Systrace.endEvent(); + }, + onBeginLifeCycleTimer: function onBeginLifeCycleTimer(debugID, timerType) { + var displayName = require(56 ).getDisplayName(debugID); // 56 = react/lib/ReactComponentTreeHook + Systrace.beginEvent(displayName + '.' + timerType + '()'); + }, + onEndLifeCycleTimer: function onEndLifeCycleTimer(debugID, timerType) { + Systrace.endEvent(); + } +} : null; + +var Systrace = { + setEnabled: function setEnabled(enabled) { + if (_enabled !== enabled) { + if (__DEV__) { + if (enabled) { + global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS); + require(86 ).addHook(ReactSystraceDevtool); // 86 = ReactDebugTool + } else { + global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS); + require(86 ).removeHook(ReactSystraceDevtool); // 86 = ReactDebugTool + } + } + _enabled = enabled; + } + }, + beginEvent: function beginEvent(profileName, args) { + if (_enabled) { + profileName = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args); + } + }, + endEvent: function endEvent() { + if (_enabled) { + global.nativeTraceEndSection(TRACE_TAG_REACT_APPS); + } + }, + beginAsyncEvent: function beginAsyncEvent(profileName) { + var cookie = _asyncCookie; + if (_enabled) { + _asyncCookie++; + profileName = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie, 0); + } + return cookie; + }, + endAsyncEvent: function endAsyncEvent(profileName, cookie) { + if (_enabled) { + profileName = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie, 0); + } + }, + counterEvent: function counterEvent(profileName, value) { + if (_enabled) { + profileName = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceCounter && global.nativeTraceCounter(TRACE_TAG_REACT_APPS, profileName, value); + } + }, + attachToRelayProfiler: function attachToRelayProfiler(relayProfiler) { + relayProfiler.attachProfileHandler('*', function (name) { + var cookie = Systrace.beginAsyncEvent(name); + return function () { + Systrace.endAsyncEvent(name, cookie); + }; + }); + + relayProfiler.attachAggregateHandler('*', function (name, callback) { + Systrace.beginEvent(name); + callback(); + Systrace.endEvent(); + }); + }, + swizzleJSON: function swizzleJSON() { + Systrace.measureMethods(JSON, 'JSON', ['parse', 'stringify']); + }, + measureMethods: function measureMethods(object, objectName, methodNames) { + if (!__DEV__) { + return; + } + + methodNames.forEach(function (methodName) { + object[methodName] = Systrace.measure(objectName, methodName, object[methodName]); + }); + }, + measure: function measure(objName, fnName, func) { + if (!__DEV__) { + return func; + } + + var profileName = objName + '.' + fnName; + return function () { + if (!_enabled) { + return func.apply(this, arguments); + } + + Systrace.beginEvent(profileName); + var ret = func.apply(this, arguments); + Systrace.endEvent(); + return ret; + }; + } +}; + +if (__DEV__) { + require.Systrace = Systrace; +} + +module.exports = Systrace; +}, 85, null, "Systrace"); +__d(/* ReactDebugTool */function(global, require, module, exports) { + +'use strict'; + +var ReactInvalidSetStateWarningHook = require(87 ); // 87 = ReactInvalidSetStateWarningHook +var ReactHostOperationHistoryHook = require(88 ); // 88 = ReactHostOperationHistoryHook +var ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook +var ExecutionEnvironment = require(89 ); // 89 = fbjs/lib/ExecutionEnvironment + +var performanceNow = require(90 ); // 90 = fbjs/lib/performanceNow +var warning = require(40 ); // 40 = fbjs/lib/warning + +var hooks = []; +var didHookThrowForEvent = {}; + +function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) { + try { + fn.call(context, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack); + didHookThrowForEvent[event] = true; + } +} + +function emitEvent(event, arg1, arg2, arg3, arg4, arg5) { + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i]; + var fn = hook[event]; + if (fn) { + callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); + } + } +} + +var _isProfiling = false; +var flushHistory = []; +var lifeCycleTimerStack = []; +var currentFlushNesting = 0; +var currentFlushMeasurements = []; +var currentFlushStartTime = 0; +var currentTimerDebugID = null; +var currentTimerStartTime = 0; +var currentTimerNestedFlushDuration = 0; +var currentTimerType = null; + +var lifeCycleTimerHasWarned = false; + +function clearHistory() { + ReactComponentTreeHook.purgeUnmountedComponents(); + ReactHostOperationHistoryHook.clearHistory(); +} + +function getTreeSnapshot(registeredIDs) { + return registeredIDs.reduce(function (tree, id) { + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var parentID = ReactComponentTreeHook.getParentID(id); + tree[id] = { + displayName: ReactComponentTreeHook.getDisplayName(id), + text: ReactComponentTreeHook.getText(id), + updateCount: ReactComponentTreeHook.getUpdateCount(id), + childIDs: ReactComponentTreeHook.getChildIDs(id), + + ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, + parentID: parentID + }; + return tree; + }, {}); +} + +function resetMeasurements() { + var previousStartTime = currentFlushStartTime; + var previousMeasurements = currentFlushMeasurements; + var previousOperations = ReactHostOperationHistoryHook.getHistory(); + + if (currentFlushNesting === 0) { + currentFlushStartTime = 0; + currentFlushMeasurements = []; + clearHistory(); + return; + } + + if (previousMeasurements.length || previousOperations.length) { + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); + flushHistory.push({ + duration: performanceNow() - previousStartTime, + measurements: previousMeasurements || [], + operations: previousOperations || [], + treeSnapshot: getTreeSnapshot(registeredIDs) + }); + } + + clearHistory(); + currentFlushStartTime = performanceNow(); + currentFlushMeasurements = []; +} + +function checkDebugID(debugID) { + var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (allowRoot && debugID === 0) { + return; + } + if (!debugID) { + warning(false, 'ReactDebugTool: debugID may not be empty.'); + } +} + +function beginLifeCycleTimer(debugID, timerType) { + if (currentFlushNesting === 0) { + return; + } + if (currentTimerType && !lifeCycleTimerHasWarned) { + warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another'); + lifeCycleTimerHasWarned = true; + } + currentTimerStartTime = performanceNow(); + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = debugID; + currentTimerType = timerType; +} + +function endLifeCycleTimer(debugID, timerType) { + if (currentFlushNesting === 0) { + return; + } + if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) { + warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another'); + lifeCycleTimerHasWarned = true; + } + if (_isProfiling) { + currentFlushMeasurements.push({ + timerType: timerType, + instanceID: debugID, + duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration + }); + } + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = null; + currentTimerType = null; +} + +function pauseCurrentLifeCycleTimer() { + var currentTimer = { + startTime: currentTimerStartTime, + nestedFlushStartTime: performanceNow(), + debugID: currentTimerDebugID, + timerType: currentTimerType + }; + lifeCycleTimerStack.push(currentTimer); + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; + currentTimerDebugID = null; + currentTimerType = null; +} + +function resumeCurrentLifeCycleTimer() { + var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), + startTime = _lifeCycleTimerStack$.startTime, + nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, + debugID = _lifeCycleTimerStack$.debugID, + timerType = _lifeCycleTimerStack$.timerType; + + var nestedFlushDuration = performanceNow() - nestedFlushStartTime; + currentTimerStartTime = startTime; + currentTimerNestedFlushDuration += nestedFlushDuration; + currentTimerDebugID = debugID; + currentTimerType = timerType; +} + +var lastMarkTimeStamp = 0; +var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; + +function shouldMark(debugID) { + if (!_isProfiling || !canUsePerformanceMeasure) { + return false; + } + var element = ReactComponentTreeHook.getElement(debugID); + if (element == null || typeof element !== 'object') { + return false; + } + var isHostElement = typeof element.type === 'string'; + if (isHostElement) { + return false; + } + return true; +} + +function markBegin(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + lastMarkTimeStamp = performanceNow(); + performance.mark(markName); +} + +function markEnd(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown'; + + var timeStamp = performanceNow(); + if (timeStamp - lastMarkTimeStamp > 0.1) { + var measurementName = displayName + ' [' + markType + ']'; + performance.measure(measurementName, markName); + } + + performance.clearMarks(markName); + performance.clearMeasures(measurementName); +} + +var ReactDebugTool = { + addHook: function addHook(hook) { + hooks.push(hook); + }, + removeHook: function removeHook(hook) { + for (var i = 0; i < hooks.length; i++) { + if (hooks[i] === hook) { + hooks.splice(i, 1); + i--; + } + } + }, + isProfiling: function isProfiling() { + return _isProfiling; + }, + beginProfiling: function beginProfiling() { + if (_isProfiling) { + return; + } + + _isProfiling = true; + flushHistory.length = 0; + resetMeasurements(); + ReactDebugTool.addHook(ReactHostOperationHistoryHook); + }, + endProfiling: function endProfiling() { + if (!_isProfiling) { + return; + } + + _isProfiling = false; + resetMeasurements(); + ReactDebugTool.removeHook(ReactHostOperationHistoryHook); + }, + getFlushHistory: function getFlushHistory() { + return flushHistory; + }, + onBeginFlush: function onBeginFlush() { + currentFlushNesting++; + resetMeasurements(); + pauseCurrentLifeCycleTimer(); + emitEvent('onBeginFlush'); + }, + onEndFlush: function onEndFlush() { + resetMeasurements(); + currentFlushNesting--; + resumeCurrentLifeCycleTimer(); + emitEvent('onEndFlush'); + }, + onBeginLifeCycleTimer: function onBeginLifeCycleTimer(debugID, timerType) { + checkDebugID(debugID); + emitEvent('onBeginLifeCycleTimer', debugID, timerType); + markBegin(debugID, timerType); + beginLifeCycleTimer(debugID, timerType); + }, + onEndLifeCycleTimer: function onEndLifeCycleTimer(debugID, timerType) { + checkDebugID(debugID); + endLifeCycleTimer(debugID, timerType); + markEnd(debugID, timerType); + emitEvent('onEndLifeCycleTimer', debugID, timerType); + }, + onBeginProcessingChildContext: function onBeginProcessingChildContext() { + emitEvent('onBeginProcessingChildContext'); + }, + onEndProcessingChildContext: function onEndProcessingChildContext() { + emitEvent('onEndProcessingChildContext'); + }, + onHostOperation: function onHostOperation(operation) { + checkDebugID(operation.instanceID); + emitEvent('onHostOperation', operation); + }, + onSetState: function onSetState() { + emitEvent('onSetState'); + }, + onSetChildren: function onSetChildren(debugID, childDebugIDs) { + checkDebugID(debugID); + childDebugIDs.forEach(checkDebugID); + emitEvent('onSetChildren', debugID, childDebugIDs); + }, + onBeforeMountComponent: function onBeforeMountComponent(debugID, element, parentDebugID) { + checkDebugID(debugID); + checkDebugID(parentDebugID, true); + emitEvent('onBeforeMountComponent', debugID, element, parentDebugID); + markBegin(debugID, 'mount'); + }, + onMountComponent: function onMountComponent(debugID) { + checkDebugID(debugID); + markEnd(debugID, 'mount'); + emitEvent('onMountComponent', debugID); + }, + onBeforeUpdateComponent: function onBeforeUpdateComponent(debugID, element) { + checkDebugID(debugID); + emitEvent('onBeforeUpdateComponent', debugID, element); + markBegin(debugID, 'update'); + }, + onUpdateComponent: function onUpdateComponent(debugID) { + checkDebugID(debugID); + markEnd(debugID, 'update'); + emitEvent('onUpdateComponent', debugID); + }, + onBeforeUnmountComponent: function onBeforeUnmountComponent(debugID) { + checkDebugID(debugID); + emitEvent('onBeforeUnmountComponent', debugID); + markBegin(debugID, 'unmount'); + }, + onUnmountComponent: function onUnmountComponent(debugID) { + checkDebugID(debugID); + markEnd(debugID, 'unmount'); + emitEvent('onUnmountComponent', debugID); + }, + onTestEvent: function onTestEvent() { + emitEvent('onTestEvent'); + } +}; + +ReactDebugTool.addHook(ReactInvalidSetStateWarningHook); +ReactDebugTool.addHook(ReactComponentTreeHook); +var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; +if (/[?&]react_perf\b/.test(url)) { + ReactDebugTool.beginProfiling(); +} + +module.exports = ReactDebugTool; +}, 86, null, "ReactDebugTool"); +__d(/* ReactInvalidSetStateWarningHook */function(global, require, module, exports) { + +'use strict'; + +var warning = require(40 ); // 40 = fbjs/lib/warning + +if (__DEV__) { + var processingChildContext = false; + + var warnInvalidSetState = function warnInvalidSetState() { + warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()'); + }; +} + +var ReactInvalidSetStateWarningHook = { + onBeginProcessingChildContext: function onBeginProcessingChildContext() { + processingChildContext = true; + }, + onEndProcessingChildContext: function onEndProcessingChildContext() { + processingChildContext = false; + }, + onSetState: function onSetState() { + warnInvalidSetState(); + } +}; + +module.exports = ReactInvalidSetStateWarningHook; +}, 87, null, "ReactInvalidSetStateWarningHook"); +__d(/* ReactHostOperationHistoryHook */function(global, require, module, exports) { + +'use strict'; + +var history = []; + +var ReactHostOperationHistoryHook = { + onHostOperation: function onHostOperation(operation) { + history.push(operation); + }, + clearHistory: function clearHistory() { + if (ReactHostOperationHistoryHook._preventClearing) { + return; + } + + history = []; + }, + getHistory: function getHistory() { + return history; + } +}; + +module.exports = ReactHostOperationHistoryHook; +}, 88, null, "ReactHostOperationHistoryHook"); +__d(/* fbjs/lib/ExecutionEnvironment.js */function(global, require, module, exports) { + +'use strict'; + +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM }; + +module.exports = ExecutionEnvironment; +}, 89, null, "fbjs/lib/ExecutionEnvironment.js"); +__d(/* fbjs/lib/performanceNow.js */function(global, require, module, exports) {'use strict'; + +var performance = require(91 ); // 91 = ./performance + +var performanceNow; + +if (performance.now) { + performanceNow = function performanceNow() { + return performance.now(); + }; +} else { + performanceNow = function performanceNow() { + return Date.now(); + }; +} + +module.exports = performanceNow; +}, 90, null, "fbjs/lib/performanceNow.js"); +__d(/* fbjs/lib/performance.js */function(global, require, module, exports) { + +'use strict'; + +var ExecutionEnvironment = require(89 ); // 89 = ./ExecutionEnvironment + +var performance; + +if (ExecutionEnvironment.canUseDOM) { + performance = window.performance || window.msPerformance || window.webkitPerformance; +} + +module.exports = performance || {}; +}, 91, null, "fbjs/lib/performance.js"); +__d(/* JSTimers */function(global, require, module, exports) { +'use strict'; + +var RCTTiming = require(80 ).Timing; // 80 = NativeModules +var JSTimersExecution = require(84 ); // 84 = JSTimersExecution + +var parseErrorStack = require(93 ); // 93 = parseErrorStack + +function _getFreeIndex() { + var freeIndex = JSTimersExecution.timerIDs.indexOf(null); + if (freeIndex === -1) { + freeIndex = JSTimersExecution.timerIDs.length; + } + return freeIndex; +} + +function _allocateCallback(func, type) { + var id = JSTimersExecution.GUID++; + var freeIndex = _getFreeIndex(); + JSTimersExecution.timerIDs[freeIndex] = id; + JSTimersExecution.callbacks[freeIndex] = func; + JSTimersExecution.types[freeIndex] = type; + if (__DEV__) { + var e = new Error(); + e.framesToPop = 1; + var stack = parseErrorStack(e); + if (stack) { + JSTimersExecution.identifiers[freeIndex] = stack.shift(); + } + } + return id; +} + +function _freeCallback(timerID) { + if (timerID == null) { + return; + } + + var index = JSTimersExecution.timerIDs.indexOf(timerID); + + if (index !== -1) { + JSTimersExecution._clearIndex(index); + var type = JSTimersExecution.types[index]; + if (type !== 'setImmediate' && type !== 'requestIdleCallback') { + RCTTiming.deleteTimer(timerID); + } + } +} + +var JSTimers = { + setTimeout: function setTimeout(func, duration) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setTimeout'); + RCTTiming.createTimer(id, duration || 0, Date.now(), false); + return id; + }, + + setInterval: function setInterval(func, duration) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setInterval'); + RCTTiming.createTimer(id, duration || 0, Date.now(), true); + return id; + }, + + setImmediate: function setImmediate(func) { + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setImmediate'); + JSTimersExecution.immediates.push(id); + return id; + }, + + requestAnimationFrame: function requestAnimationFrame(func) { + var id = _allocateCallback(func, 'requestAnimationFrame'); + RCTTiming.createTimer(id, 1, Date.now(), false); + return id; + }, + + requestIdleCallback: function requestIdleCallback(func) { + if (JSTimersExecution.requestIdleCallbacks.length === 0) { + RCTTiming.setSendIdleEvents(true); + } + + var id = _allocateCallback(func, 'requestIdleCallback'); + JSTimersExecution.requestIdleCallbacks.push(id); + return id; + }, + + cancelIdleCallback: function cancelIdleCallback(timerID) { + _freeCallback(timerID); + var index = JSTimersExecution.requestIdleCallbacks.indexOf(timerID); + if (index !== -1) { + JSTimersExecution.requestIdleCallbacks.splice(index, 1); + } + + if (JSTimersExecution.requestIdleCallbacks.length === 0) { + RCTTiming.setSendIdleEvents(false); + } + }, + + clearTimeout: function clearTimeout(timerID) { + _freeCallback(timerID); + }, + + clearInterval: function clearInterval(timerID) { + _freeCallback(timerID); + }, + + clearImmediate: function clearImmediate(timerID) { + _freeCallback(timerID); + var index = JSTimersExecution.immediates.indexOf(timerID); + if (index !== -1) { + JSTimersExecution.immediates.splice(index, 1); + } + }, + + cancelAnimationFrame: function cancelAnimationFrame(timerID) { + _freeCallback(timerID); + } +}; + +module.exports = JSTimers; +}, 92, null, "JSTimers"); +__d(/* parseErrorStack */function(global, require, module, exports) { +'use strict'; + +var stacktraceParser = require(94 ); // 94 = stacktrace-parser + +function parseErrorStack(e) { + if (!e || !e.stack) { + return []; + } + + var stack = Array.isArray(e.stack) ? e.stack : stacktraceParser.parse(e.stack); + + var framesToPop = typeof e.framesToPop === 'number' ? e.framesToPop : 0; + while (framesToPop--) { + stack.shift(); + } + + return stack; +} + +module.exports = parseErrorStack; +}, 93, null, "parseErrorStack"); +__d(/* stacktrace-parser/index.js */function(global, require, module, exports) {module.exports = require(95 ); // 95 = ./lib/stacktrace-parser.js +}, 94, null, "stacktrace-parser/index.js"); +__d(/* stacktrace-parser/lib/stacktrace-parser.js */function(global, require, module, exports) { + +var UNKNOWN_FUNCTION = ''; + +var StackTraceParser = { + parse: function parse(stackString) { + var chrome = /^\s*at (?:(?:(?:Anonymous function)?|((?:\[object object\])?\S+(?: \[as \S+\])?)) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i, + gecko = /^(?:\s*([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i, + node = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i, + lines = stackString.split('\n'), + stack = [], + parts, + element; + + for (var i = 0, j = lines.length; i < j; ++i) { + if (parts = gecko.exec(lines[i])) { + element = { + 'file': parts[3], + 'methodName': parts[1] || UNKNOWN_FUNCTION, + 'lineNumber': +parts[4], + 'column': parts[5] ? +parts[5] : null + }; + } else if (parts = chrome.exec(lines[i])) { + element = { + 'file': parts[2], + 'methodName': parts[1] || UNKNOWN_FUNCTION, + 'lineNumber': +parts[3], + 'column': parts[4] ? +parts[4] : null + }; + } else if (parts = node.exec(lines[i])) { + element = { + 'file': parts[2], + 'methodName': parts[1] || UNKNOWN_FUNCTION, + 'lineNumber': +parts[3], + 'column': parts[4] ? +parts[4] : null + }; + } else { + continue; + } + + stack.push(element); + } + + return stack; + } +}; + +module.exports = StackTraceParser; +}, 95, null, "stacktrace-parser/lib/stacktrace-parser.js"); +__d(/* deepFreezeAndThrowOnMutationInDev */function(global, require, module, exports) { + +'use strict'; + +function deepFreezeAndThrowOnMutationInDev(object) { + if (__DEV__) { + if (typeof object !== 'object' || object === null || Object.isFrozen(object) || Object.isSealed(object)) { + return; + } + + var keys = Object.keys(object); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (object.hasOwnProperty(key)) { + object.__defineGetter__(key, identity.bind(null, object[key])); + object.__defineSetter__(key, throwOnImmutableMutation.bind(null, key)); + } + } + + Object.freeze(object); + Object.seal(object); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (object.hasOwnProperty(key)) { + deepFreezeAndThrowOnMutationInDev(object[key]); + } + } + } +} + +function throwOnImmutableMutation(key, value) { + throw Error('You attempted to set the key `' + key + '` with the value `' + JSON.stringify(value) + '` on an object that is meant to be immutable ' + 'and has been frozen.'); +} + +function identity(value) { + return value; +} + +module.exports = deepFreezeAndThrowOnMutationInDev; +}, 96, null, "deepFreezeAndThrowOnMutationInDev"); +__d(/* stringifySafe */function(global, require, module, exports) { +'use strict'; + +function stringifySafe(arg) { + var ret; + var type = typeof arg; + if (arg === undefined) { + ret = 'undefined'; + } else if (arg === null) { + ret = 'null'; + } else if (type === 'string') { + ret = '"' + arg + '"'; + } else if (type === 'function') { + try { + ret = arg.toString(); + } catch (e) { + ret = '[function unknown]'; + } + } else { + try { + ret = JSON.stringify(arg); + } catch (e) { + if (typeof arg.toString === 'function') { + try { + ret = arg.toString(); + } catch (E) {} + } + } + } + return ret || '["' + type + '" failed to stringify]'; +} + +module.exports = stringifySafe; +}, 97, null, "stringifySafe"); +__d(/* HeapCapture */function(global, require, module, exports) { +'use strict'; + +var HeapCapture = { + captureHeap: function captureHeap(path) { + var error = null; + try { + global.nativeCaptureHeap(path); + console.log('HeapCapture.captureHeap succeeded: ' + path); + } catch (e) { + console.log('HeapCapture.captureHeap error: ' + e.toString()); + error = e.toString(); + } + require(80 ).JSCHeapCapture.captureComplete(path, error); // 80 = NativeModules + } +}; + +module.exports = HeapCapture; +}, 98, null, "HeapCapture"); +__d(/* SamplingProfiler */function(global, require, module, exports) { +'use strict'; + +var SamplingProfiler = { + poke: function poke(token) { + var error = null; + var result = null; + try { + result = global.pokeSamplingProfiler(); + if (result === null) { + console.log('The JSC Sampling Profiler has started'); + } else { + console.log('The JSC Sampling Profiler has stopped'); + } + } catch (e) { + console.log('Error occured when restarting Sampling Profiler: ' + e.toString()); + error = e.toString(); + } + require(80 ).JSCSamplingProfiler.operationComplete(token, result, error); // 80 = NativeModules + } +}; + +module.exports = SamplingProfiler; +}, 99, null, "SamplingProfiler"); +__d(/* HMRClient */function(global, require, module, exports) { +'use strict'; + +var Platform = require(79 ); // 79 = Platform +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var HMRClient = { + enable: function enable(platform, bundleEntry, host, port) { + invariant(platform, 'Missing required parameter `platform`'); + invariant(bundleEntry, 'Missing required paramenter `bundleEntry`'); + invariant(host, 'Missing required paramenter `host`'); + + var WebSocket = require(101 ); // 101 = WebSocket + + var wsHostPort = port !== null && port !== '' ? host + ':' + port : host; + + var wsUrl = 'ws://' + wsHostPort + '/hot?' + ('platform=' + platform + '&') + ('bundleEntry=' + bundleEntry.replace('.bundle', '.js')); + + var activeWS = new WebSocket(wsUrl); + activeWS.onerror = function (e) { + var error = 'Hot loading isn\'t working because it cannot connect to the development server.\n\nTry the following to fix the issue:\n- Ensure that the packager server is running and available on the same network'; + + if (Platform.OS === 'ios') { + error += '\n- Ensure that the Packager server URL is correctly set in AppDelegate'; + } else { + error += '\n- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run \'adb devices\' to see a list of connected devices\n- If you\'re on a physical device connected to the same machine, run \'adb reverse tcp:8081 tcp:8081\' to forward requests from your device\n- If your device is on the same Wi-Fi network, set \'Debug server host & port for device\' in \'Dev settings\' to your machine\'s IP address and the port of the local dev server - e.g. 10.0.1.1:8081'; + } + + error += '\n\nURL: ' + host + ':' + port + '\n\nError: ' + e.message; + + throw new Error(error); + }; + activeWS.onmessage = function (_ref) { + var data = _ref.data; + + var HMRLoadingView = require(120 ); // 120 = HMRLoadingView + + data = JSON.parse(data); + + switch (data.type) { + case 'update-start': + { + HMRLoadingView.showMessage('Hot Loading...'); + break; + } + case 'update': + { + var _data$body = data.body, + modules = _data$body.modules, + sourceMappingURLs = _data$body.sourceMappingURLs, + sourceURLs = _data$body.sourceURLs, + inverseDependencies = _data$body.inverseDependencies; + + + if (Platform.OS === 'ios') { + var RCTRedBox = require(80 ).RedBox; // 80 = NativeModules + RCTRedBox && RCTRedBox.dismiss && RCTRedBox.dismiss(); + } else { + var RCTExceptionsManager = require(80 ).ExceptionsManager; // 80 = NativeModules + RCTExceptionsManager && RCTExceptionsManager.dismissRedbox && RCTExceptionsManager.dismissRedbox(); + } + + modules.forEach(function (_ref2, i) { + var id = _ref2.id, + code = _ref2.code; + + code = code + '\n\n' + sourceMappingURLs[i]; + + var injectFunction = typeof global.nativeInjectHMRUpdate === 'function' ? global.nativeInjectHMRUpdate : eval; + + code = ['__accept(', id + ',', 'function(global,require,module,exports){', '' + code, '\n},', '' + JSON.stringify(inverseDependencies), ');'].join(''); + + injectFunction(code, sourceURLs[i]); + }); + + HMRLoadingView.hide(); + break; + } + case 'update-done': + { + HMRLoadingView.hide(); + break; + } + case 'error': + { + HMRLoadingView.hide(); + throw new Error(data.body.type + ' ' + data.body.description); + } + default: + { + throw new Error('Unexpected message: ' + data); + } + } + }; + } +}; + +module.exports = HMRClient; +}, 100, null, "HMRClient"); +__d(/* WebSocket */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var Platform = require(79 ); // 79 = Platform +var RCTWebSocketModule = require(80 ).WebSocketModule; // 80 = NativeModules +var WebSocketEvent = require(113 ); // 113 = WebSocketEvent +var binaryToBase64 = require(114 ); // 114 = binaryToBase64 + +var EventTarget = require(116 ); // 116 = event-target-shim +var base64 = require(115 ); // 115 = base64-js + +var CONNECTING = 0; +var OPEN = 1; +var CLOSING = 2; +var CLOSED = 3; + +var CLOSE_NORMAL = 1000; + +var WEBSOCKET_EVENTS = ['close', 'error', 'message', 'open']; + +var nextWebSocketId = 0; + +var WebSocket = function (_EventTarget) { + babelHelpers.inherits(WebSocket, _EventTarget); + + function WebSocket(url, protocols, options) { + babelHelpers.classCallCheck(this, WebSocket); + + var _this = babelHelpers.possibleConstructorReturn(this, (WebSocket.__proto__ || Object.getPrototypeOf(WebSocket)).call(this)); + + _this.CONNECTING = CONNECTING; + _this.OPEN = OPEN; + _this.CLOSING = CLOSING; + _this.CLOSED = CLOSED; + _this.readyState = CONNECTING; + + if (typeof protocols === 'string') { + protocols = [protocols]; + } + + if (!Array.isArray(protocols)) { + protocols = null; + } + + _this._eventEmitter = new NativeEventEmitter(RCTWebSocketModule); + _this._socketId = nextWebSocketId++; + RCTWebSocketModule.connect(url, protocols, options, _this._socketId); + _this._registerEvents(); + return _this; + } + + babelHelpers.createClass(WebSocket, [{ + key: 'close', + value: function close(code, reason) { + if (this.readyState === this.CLOSING || this.readyState === this.CLOSED) { + return; + } + + this.readyState = this.CLOSING; + this._close(code, reason); + } + }, { + key: 'send', + value: function send(data) { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + + if (typeof data === 'string') { + RCTWebSocketModule.send(data, this._socketId); + return; + } + + if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { + RCTWebSocketModule.sendBinary(binaryToBase64(data), this._socketId); + return; + } + + throw new Error('Unsupported data type'); + } + }, { + key: 'ping', + value: function ping() { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + + RCTWebSocketModule.ping(this._socketId); + } + }, { + key: '_close', + value: function _close(code, reason) { + if (Platform.OS === 'android') { + var statusCode = typeof code === 'number' ? code : CLOSE_NORMAL; + var closeReason = typeof reason === 'string' ? reason : ''; + RCTWebSocketModule.close(statusCode, closeReason, this._socketId); + } else { + RCTWebSocketModule.close(this._socketId); + } + } + }, { + key: '_unregisterEvents', + value: function _unregisterEvents() { + this._subscriptions.forEach(function (e) { + return e.remove(); + }); + this._subscriptions = []; + } + }, { + key: '_registerEvents', + value: function _registerEvents() { + var _this2 = this; + + this._subscriptions = [this._eventEmitter.addListener('websocketMessage', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.dispatchEvent(new WebSocketEvent('message', { + data: ev.type === 'binary' ? base64.toByteArray(ev.data).buffer : ev.data + })); + }), this._eventEmitter.addListener('websocketOpen', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.OPEN; + _this2.dispatchEvent(new WebSocketEvent('open')); + }), this._eventEmitter.addListener('websocketClosed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.CLOSED; + _this2.dispatchEvent(new WebSocketEvent('close', { + code: ev.code, + reason: ev.reason + })); + _this2._unregisterEvents(); + _this2.close(); + }), this._eventEmitter.addListener('websocketFailed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.CLOSED; + _this2.dispatchEvent(new WebSocketEvent('error', { + message: ev.message + })); + _this2.dispatchEvent(new WebSocketEvent('close', { + message: ev.message + })); + _this2._unregisterEvents(); + _this2.close(); + })]; + } + }]); + return WebSocket; +}(EventTarget.apply(undefined, WEBSOCKET_EVENTS)); + +WebSocket.CONNECTING = CONNECTING; +WebSocket.OPEN = OPEN; +WebSocket.CLOSING = CLOSING; +WebSocket.CLOSED = CLOSED; + + +module.exports = WebSocket; +}, 101, null, "WebSocket"); +__d(/* NativeEventEmitter */function(global, require, module, exports) { +'use strict'; + +var EventEmitter = require(103 ); // 103 = EventEmitter +var Platform = require(79 ); // 79 = Platform +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var NativeEventEmitter = function (_EventEmitter) { + babelHelpers.inherits(NativeEventEmitter, _EventEmitter); + + function NativeEventEmitter(nativeModule) { + babelHelpers.classCallCheck(this, NativeEventEmitter); + + var _this = babelHelpers.possibleConstructorReturn(this, (NativeEventEmitter.__proto__ || Object.getPrototypeOf(NativeEventEmitter)).call(this, RCTDeviceEventEmitter.sharedSubscriber)); + + if (Platform.OS === 'ios') { + invariant(nativeModule, 'Native module cannot be null.'); + _this._nativeModule = nativeModule; + } + return _this; + } + + babelHelpers.createClass(NativeEventEmitter, [{ + key: 'addListener', + value: function addListener(eventType, listener, context) { + if (Platform.OS === 'ios') { + this._nativeModule.addListener(eventType); + } + return babelHelpers.get(NativeEventEmitter.prototype.__proto__ || Object.getPrototypeOf(NativeEventEmitter.prototype), 'addListener', this).call(this, eventType, listener, context); + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners(eventType) { + invariant(eventType, 'eventType argument is required.'); + if (Platform.OS === 'ios') { + var count = this.listeners(eventType).length; + this._nativeModule.removeListeners(count); + } + babelHelpers.get(NativeEventEmitter.prototype.__proto__ || Object.getPrototypeOf(NativeEventEmitter.prototype), 'removeAllListeners', this).call(this, eventType); + } + }, { + key: 'removeSubscription', + value: function removeSubscription(subscription) { + if (Platform.OS === 'ios') { + this._nativeModule.removeListeners(1); + } + babelHelpers.get(NativeEventEmitter.prototype.__proto__ || Object.getPrototypeOf(NativeEventEmitter.prototype), 'removeSubscription', this).call(this, subscription); + } + }]); + return NativeEventEmitter; +}(EventEmitter); + +module.exports = NativeEventEmitter; +}, 102, null, "NativeEventEmitter"); +__d(/* EventEmitter */function(global, require, module, exports) { +'use strict'; + +var EmitterSubscription = require(104 ); // 104 = EmitterSubscription +var EventSubscriptionVendor = require(106 ); // 106 = EventSubscriptionVendor + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var EventEmitter = function () { + function EventEmitter(subscriber) { + babelHelpers.classCallCheck(this, EventEmitter); + + this._subscriber = subscriber || new EventSubscriptionVendor(); + } + + babelHelpers.createClass(EventEmitter, [{ + key: 'addListener', + value: function addListener(eventType, listener, context) { + + return this._subscriber.addSubscription(eventType, new EmitterSubscription(this, this._subscriber, listener, context)); + } + }, { + key: 'once', + value: function once(eventType, listener, context) { + var _this = this; + + return this.addListener(eventType, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this.removeCurrentListener(); + listener.apply(context, args); + }); + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners(eventType) { + this._subscriber.removeAllSubscriptions(eventType); + } + }, { + key: 'removeCurrentListener', + value: function removeCurrentListener() { + invariant(!!this._currentSubscription, 'Not in an emitting cycle; there is no current subscription'); + this.removeSubscription(this._currentSubscription); + } + }, { + key: 'removeSubscription', + value: function removeSubscription(subscription) { + invariant(subscription.emitter === this, 'Subscription does not belong to this emitter.'); + this._subscriber.removeSubscription(subscription); + } + }, { + key: 'listeners', + value: function listeners(eventType) { + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + return subscriptions ? subscriptions.filter(emptyFunction.thatReturnsTrue).map(function (subscription) { + return subscription.listener; + }) : []; + } + }, { + key: 'emit', + value: function emit(eventType) { + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + if (subscriptions) { + for (var i = 0, l = subscriptions.length; i < l; i++) { + var subscription = subscriptions[i]; + + if (subscription) { + this._currentSubscription = subscription; + subscription.listener.apply(subscription.context, Array.prototype.slice.call(arguments, 1)); + } + } + this._currentSubscription = null; + } + } + }, { + key: 'removeListener', + value: function removeListener(eventType, listener) { + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + if (subscriptions) { + for (var i = 0, l = subscriptions.length; i < l; i++) { + var subscription = subscriptions[i]; + + if (subscription && subscription.listener === listener) { + subscription.remove(); + } + } + } + } + }]); + return EventEmitter; +}(); + +module.exports = EventEmitter; +}, 103, null, "EventEmitter"); +__d(/* EmitterSubscription */function(global, require, module, exports) { +'use strict'; + +var EventSubscription = require(105 ); // 105 = EventSubscription + +var EmitterSubscription = function (_EventSubscription) { + babelHelpers.inherits(EmitterSubscription, _EventSubscription); + + function EmitterSubscription(emitter, subscriber, listener, context) { + babelHelpers.classCallCheck(this, EmitterSubscription); + + var _this = babelHelpers.possibleConstructorReturn(this, (EmitterSubscription.__proto__ || Object.getPrototypeOf(EmitterSubscription)).call(this, subscriber)); + + _this.emitter = emitter; + _this.listener = listener; + _this.context = context; + return _this; + } + + babelHelpers.createClass(EmitterSubscription, [{ + key: 'remove', + value: function remove() { + this.emitter.removeSubscription(this); + } + }]); + return EmitterSubscription; +}(EventSubscription); + +module.exports = EmitterSubscription; +}, 104, null, "EmitterSubscription"); +__d(/* EventSubscription */function(global, require, module, exports) { +'use strict'; + +var EventSubscription = function () { + function EventSubscription(subscriber) { + babelHelpers.classCallCheck(this, EventSubscription); + + this.subscriber = subscriber; + } + + babelHelpers.createClass(EventSubscription, [{ + key: 'remove', + value: function remove() { + this.subscriber.removeSubscription(this); + } + }]); + return EventSubscription; +}(); + +module.exports = EventSubscription; +}, 105, null, "EventSubscription"); +__d(/* EventSubscriptionVendor */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var EventSubscriptionVendor = function () { + function EventSubscriptionVendor() { + babelHelpers.classCallCheck(this, EventSubscriptionVendor); + + this._subscriptionsForType = {}; + this._currentSubscription = null; + } + + babelHelpers.createClass(EventSubscriptionVendor, [{ + key: 'addSubscription', + value: function addSubscription(eventType, subscription) { + invariant(subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.'); + if (!this._subscriptionsForType[eventType]) { + this._subscriptionsForType[eventType] = []; + } + var key = this._subscriptionsForType[eventType].length; + this._subscriptionsForType[eventType].push(subscription); + subscription.eventType = eventType; + subscription.key = key; + return subscription; + } + }, { + key: 'removeAllSubscriptions', + value: function removeAllSubscriptions(eventType) { + if (eventType === undefined) { + this._subscriptionsForType = {}; + } else { + delete this._subscriptionsForType[eventType]; + } + } + }, { + key: 'removeSubscription', + value: function removeSubscription(subscription) { + var eventType = subscription.eventType; + var key = subscription.key; + + var subscriptionsForType = this._subscriptionsForType[eventType]; + if (subscriptionsForType) { + delete subscriptionsForType[key]; + } + } + }, { + key: 'getSubscriptionsForType', + value: function getSubscriptionsForType(eventType) { + return this._subscriptionsForType[eventType]; + } + }]); + return EventSubscriptionVendor; +}(); + +module.exports = EventSubscriptionVendor; +}, 106, null, "EventSubscriptionVendor"); +__d(/* RCTDeviceEventEmitter */function(global, require, module, exports) { +'use strict'; + +var EventEmitter = require(103 ); // 103 = EventEmitter +var EventSubscriptionVendor = require(106 ); // 106 = EventSubscriptionVendor +var BatchedBridge = require(81 ); // 81 = BatchedBridge + +var RCTDeviceEventEmitter = function (_EventEmitter) { + babelHelpers.inherits(RCTDeviceEventEmitter, _EventEmitter); + + function RCTDeviceEventEmitter() { + babelHelpers.classCallCheck(this, RCTDeviceEventEmitter); + + var sharedSubscriber = new EventSubscriptionVendor(); + + var _this = babelHelpers.possibleConstructorReturn(this, (RCTDeviceEventEmitter.__proto__ || Object.getPrototypeOf(RCTDeviceEventEmitter)).call(this, sharedSubscriber)); + + _this.sharedSubscriber = sharedSubscriber; + return _this; + } + + babelHelpers.createClass(RCTDeviceEventEmitter, [{ + key: '_nativeEventModule', + value: function _nativeEventModule(eventType) { + if (eventType) { + if (eventType.lastIndexOf('statusBar', 0) === 0) { + console.warn('`%s` event should be registered via the StatusBarIOS module', eventType); + return require(108 ); // 108 = StatusBarIOS + } + if (eventType.lastIndexOf('keyboard', 0) === 0) { + console.warn('`%s` event should be registered via the Keyboard module', eventType); + return require(109 ); // 109 = Keyboard + } + if (eventType === 'appStateDidChange' || eventType === 'memoryWarning') { + console.warn('`%s` event should be registered via the AppState module', eventType); + return require(111 ); // 111 = AppState + } + } + return null; + } + }, { + key: 'addListener', + value: function addListener(eventType, listener, context) { + var eventModule = this._nativeEventModule(eventType); + return eventModule ? eventModule.addListener(eventType, listener, context) : babelHelpers.get(RCTDeviceEventEmitter.prototype.__proto__ || Object.getPrototypeOf(RCTDeviceEventEmitter.prototype), 'addListener', this).call(this, eventType, listener, context); + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners(eventType) { + var eventModule = this._nativeEventModule(eventType); + eventModule && eventType ? eventModule.removeAllListeners(eventType) : babelHelpers.get(RCTDeviceEventEmitter.prototype.__proto__ || Object.getPrototypeOf(RCTDeviceEventEmitter.prototype), 'removeAllListeners', this).call(this, eventType); + } + }, { + key: 'removeSubscription', + value: function removeSubscription(subscription) { + if (subscription.emitter !== this) { + subscription.emitter.removeSubscription(subscription); + } else { + babelHelpers.get(RCTDeviceEventEmitter.prototype.__proto__ || Object.getPrototypeOf(RCTDeviceEventEmitter.prototype), 'removeSubscription', this).call(this, subscription); + } + } + }]); + return RCTDeviceEventEmitter; +}(EventEmitter); + +RCTDeviceEventEmitter = new RCTDeviceEventEmitter(); + +BatchedBridge.registerCallableModule('RCTDeviceEventEmitter', RCTDeviceEventEmitter); + +module.exports = RCTDeviceEventEmitter; +}, 107, null, "RCTDeviceEventEmitter"); +__d(/* StatusBarIOS */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter + +var _require = require(80 ), // 80 = NativeModules + StatusBarManager = _require.StatusBarManager; + +var StatusBarIOS = function (_NativeEventEmitter) { + babelHelpers.inherits(StatusBarIOS, _NativeEventEmitter); + + function StatusBarIOS() { + babelHelpers.classCallCheck(this, StatusBarIOS); + return babelHelpers.possibleConstructorReturn(this, (StatusBarIOS.__proto__ || Object.getPrototypeOf(StatusBarIOS)).apply(this, arguments)); + } + + return StatusBarIOS; +}(NativeEventEmitter); + +module.exports = new StatusBarIOS(StatusBarManager); +}, 108, null, "StatusBarIOS"); +__d(/* Keyboard */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var KeyboardObserver = require(80 ).KeyboardObserver; // 80 = NativeModules +var dismissKeyboard = require(110 ); // 110 = dismissKeyboard +var KeyboardEventEmitter = new NativeEventEmitter(KeyboardObserver); + +var Keyboard = { + addListener: function addListener(eventName, callback) { + invariant(false, 'Dummy method used for documentation'); + }, + removeListener: function removeListener(eventName, callback) { + invariant(false, 'Dummy method used for documentation'); + }, + removeAllListeners: function removeAllListeners(eventName) { + invariant(false, 'Dummy method used for documentation'); + }, + dismiss: function dismiss() { + invariant(false, 'Dummy method used for documentation'); + } +}; + +Keyboard = KeyboardEventEmitter; +Keyboard.dismiss = dismissKeyboard; + +module.exports = Keyboard; +}, 109, null, "Keyboard"); +__d(/* dismissKeyboard */function(global, require, module, exports) { +'use strict'; + +var TextInputState = require(78 ); // 78 = TextInputState + +function dismissKeyboard() { + TextInputState.blurTextInput(TextInputState.currentlyFocusedField()); +} + +module.exports = dismissKeyboard; +}, 110, null, "dismissKeyboard"); +__d(/* AppState */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var NativeModules = require(80 ); // 80 = NativeModules +var RCTAppState = NativeModules.AppState; + +var logError = require(112 ); // 112 = logError +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var AppState = function (_NativeEventEmitter) { + babelHelpers.inherits(AppState, _NativeEventEmitter); + + function AppState() { + babelHelpers.classCallCheck(this, AppState); + + var _this = babelHelpers.possibleConstructorReturn(this, (AppState.__proto__ || Object.getPrototypeOf(AppState)).call(this, RCTAppState)); + + _this._eventHandlers = { + change: new Map(), + memoryWarning: new Map() + }; + + _this.currentState = RCTAppState.initialAppState || 'active'; + + _this.addListener('appStateDidChange', function (appStateData) { + _this.currentState = appStateData.app_state; + }); + + RCTAppState.getCurrentAppState(function (appStateData) { + _this.currentState = appStateData.app_state; + }, logError); + return _this; + } + + babelHelpers.createClass(AppState, [{ + key: 'addEventListener', + value: function addEventListener(type, handler) { + invariant(['change', 'memoryWarning'].indexOf(type) !== -1, 'Trying to subscribe to unknown event: "%s"', type); + if (type === 'change') { + this._eventHandlers[type].set(handler, this.addListener('appStateDidChange', function (appStateData) { + handler(appStateData.app_state); + })); + } else if (type === 'memoryWarning') { + this._eventHandlers[type].set(handler, this.addListener('memoryWarning', handler)); + } + } + }, { + key: 'removeEventListener', + value: function removeEventListener(type, handler) { + invariant(['change', 'memoryWarning'].indexOf(type) !== -1, 'Trying to remove listener for unknown event: "%s"', type); + if (!this._eventHandlers[type].has(handler)) { + return; + } + this._eventHandlers[type].get(handler).remove(); + this._eventHandlers[type].delete(handler); + } + }]); + return AppState; +}(NativeEventEmitter); + +AppState = new AppState(); + +module.exports = AppState; +}, 111, null, "AppState"); +__d(/* logError */function(global, require, module, exports) { +'use strict'; + +var logError = function logError() { + if (arguments.length === 1 && arguments[0] instanceof Error) { + var err = arguments[0]; + console.error('Error: "' + err.message + '". Stack:\n' + err.stack); + } else { + console.error.apply(console, arguments); + } +}; + +module.exports = logError; +}, 112, null, "logError"); +__d(/* WebSocketEvent */function(global, require, module, exports) { + +'use strict'; + +var WebSocketEvent = function WebSocketEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, WebSocketEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +module.exports = WebSocketEvent; +}, 113, null, "WebSocketEvent"); +__d(/* binaryToBase64 */function(global, require, module, exports) { +'use strict'; + +var base64 = require(115 ); // 115 = base64-js + +function binaryToBase64(data) { + if (data instanceof ArrayBuffer) { + data = new Uint8Array(data); + } + if (data instanceof Uint8Array) { + return base64.fromByteArray(data); + } + if (!ArrayBuffer.isView(data)) { + throw new Error('data must be ArrayBuffer or typed array'); + } + var _data = data, + buffer = _data.buffer, + byteOffset = _data.byteOffset, + byteLength = _data.byteLength; + + return base64.fromByteArray(new Uint8Array(buffer, byteOffset, byteLength)); +} + +module.exports = binaryToBase64; +}, 114, null, "binaryToBase64"); +__d(/* base64-js/index.js */function(global, require, module, exports) {'use strict'; + +exports.byteLength = byteLength; +exports.toByteArray = toByteArray; +exports.fromByteArray = fromByteArray; + +var lookup = []; +var revLookup = []; +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; +} + +revLookup['-'.charCodeAt(0)] = 62; +revLookup['_'.charCodeAt(0)] = 63; + +function placeHoldersCount(b64) { + var len = b64.length; + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } + + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; +} + +function byteLength(b64) { + return b64.length * 3 / 4 - placeHoldersCount(b64); +} + +function toByteArray(b64) { + var i, l, tmp, placeHolders, arr; + var len = b64.length; + placeHolders = placeHoldersCount(b64); + + arr = new Arr(len * 3 / 4 - placeHolders); + + l = placeHolders > 0 ? len - 4 : len; + + var L = 0; + + for (i = 0; i < l; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[L++] = tmp >> 16 & 0xFF; + arr[L++] = tmp >> 8 & 0xFF; + arr[L++] = tmp & 0xFF; + } + + if (placeHolders === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[L++] = tmp & 0xFF; + } else if (placeHolders === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[L++] = tmp >> 8 & 0xFF; + arr[L++] = tmp & 0xFF; + } + + return arr; +} + +function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; +} + +function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2]; + output.push(tripletToBase64(tmp)); + } + return output.join(''); +} + +function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; + var output = ''; + var parts = []; + var maxChunkLength = 16383; + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + output += lookup[tmp >> 2]; + output += lookup[tmp << 4 & 0x3F]; + output += '=='; + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + output += lookup[tmp >> 10]; + output += lookup[tmp >> 4 & 0x3F]; + output += lookup[tmp << 2 & 0x3F]; + output += '='; + } + + parts.push(output); + + return parts.join(''); +} +}, 115, null, "base64-js/index.js"); +__d(/* event-target-shim/lib/event-target.js */function(global, require, module, exports) { + +"use strict"; + +var Commons = require(117 ); // 117 = ./commons +var CustomEventTarget = require(118 ); // 118 = ./custom-event-target +var EventWrapper = require(119 ); // 119 = ./event-wrapper +var LISTENERS = Commons.LISTENERS; +var CAPTURE = Commons.CAPTURE; +var BUBBLE = Commons.BUBBLE; +var ATTRIBUTE = Commons.ATTRIBUTE; +var newNode = Commons.newNode; +var defineCustomEventTarget = CustomEventTarget.defineCustomEventTarget; +var createEventWrapper = EventWrapper.createEventWrapper; +var STOP_IMMEDIATE_PROPAGATION_FLAG = EventWrapper.STOP_IMMEDIATE_PROPAGATION_FLAG; + +var HAS_EVENTTARGET_INTERFACE = typeof window !== "undefined" && typeof window.EventTarget !== "undefined"; + +var EventTarget = module.exports = function EventTarget() { + if (this instanceof EventTarget) { + Object.defineProperty(this, LISTENERS, { value: Object.create(null) }); + } else if (arguments.length === 1 && Array.isArray(arguments[0])) { + return defineCustomEventTarget(EventTarget, arguments[0]); + } else if (arguments.length > 0) { + var types = Array(arguments.length); + for (var i = 0; i < arguments.length; ++i) { + types[i] = arguments[i]; + } + + return defineCustomEventTarget(EventTarget, types); + } else { + throw new TypeError("Cannot call a class as a function"); + } +}; + +EventTarget.prototype = Object.create((HAS_EVENTTARGET_INTERFACE ? window.EventTarget : Object).prototype, { + constructor: { + value: EventTarget, + writable: true, + configurable: true + }, + + addEventListener: { + value: function addEventListener(type, listener, capture) { + if (listener == null) { + return false; + } + if (typeof listener !== "function" && typeof listener !== "object") { + throw new TypeError("\"listener\" is not an object."); + } + + var kind = capture ? CAPTURE : BUBBLE; + var node = this[LISTENERS][type]; + if (node == null) { + this[LISTENERS][type] = newNode(listener, kind); + return true; + } + + var prev = null; + while (node != null) { + if (node.listener === listener && node.kind === kind) { + return false; + } + prev = node; + node = node.next; + } + + prev.next = newNode(listener, kind); + return true; + }, + configurable: true, + writable: true + }, + + removeEventListener: { + value: function removeEventListener(type, listener, capture) { + if (listener == null) { + return false; + } + + var kind = capture ? CAPTURE : BUBBLE; + var prev = null; + var node = this[LISTENERS][type]; + while (node != null) { + if (node.listener === listener && node.kind === kind) { + if (prev == null) { + this[LISTENERS][type] = node.next; + } else { + prev.next = node.next; + } + return true; + } + + prev = node; + node = node.next; + } + + return false; + }, + configurable: true, + writable: true + }, + + dispatchEvent: { + value: function dispatchEvent(event) { + var node = this[LISTENERS][event.type]; + if (node == null) { + return true; + } + + var wrapped = createEventWrapper(event, this); + + while (node != null) { + if (typeof node.listener === "function") { + node.listener.call(this, wrapped); + } else if (node.kind !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { + node.listener.handleEvent(wrapped); + } + + if (wrapped[STOP_IMMEDIATE_PROPAGATION_FLAG]) { + break; + } + node = node.next; + } + + return !wrapped.defaultPrevented; + }, + configurable: true, + writable: true + } +}); +}, 116, null, "event-target-shim/lib/event-target.js"); +__d(/* event-target-shim/lib/commons.js */function(global, require, module, exports) { + +"use strict"; + +var createUniqueKey = exports.createUniqueKey = typeof Symbol !== "undefined" ? Symbol : function createUniqueKey(name) { + return "[[" + name + "_" + Math.random().toFixed(8).slice(2) + "]]"; +}; + +exports.LISTENERS = createUniqueKey("listeners"); + +exports.CAPTURE = 1; + +exports.BUBBLE = 2; + +exports.ATTRIBUTE = 3; + +exports.newNode = function newNode(listener, kind) { + return { listener: listener, kind: kind, next: null }; +}; +}, 117, null, "event-target-shim/lib/commons.js"); +__d(/* event-target-shim/lib/custom-event-target.js */function(global, require, module, exports) { + +"use strict"; + +var Commons = require(117 ); // 117 = ./commons +var LISTENERS = Commons.LISTENERS; +var ATTRIBUTE = Commons.ATTRIBUTE; +var newNode = Commons.newNode; + +function getAttributeListener(eventTarget, type) { + var node = eventTarget[LISTENERS][type]; + while (node != null) { + if (node.kind === ATTRIBUTE) { + return node.listener; + } + node = node.next; + } + return null; +} + +function setAttributeListener(eventTarget, type, listener) { + if (typeof listener !== "function" && typeof listener !== "object") { + listener = null; + } + + var prev = null; + var node = eventTarget[LISTENERS][type]; + while (node != null) { + if (node.kind === ATTRIBUTE) { + if (prev == null) { + eventTarget[LISTENERS][type] = node.next; + } else { + prev.next = node.next; + } + } else { + prev = node; + } + + node = node.next; + } + + if (listener != null) { + if (prev == null) { + eventTarget[LISTENERS][type] = newNode(listener, ATTRIBUTE); + } else { + prev.next = newNode(listener, ATTRIBUTE); + } + } +} + +exports.defineCustomEventTarget = function (EventTargetBase, types) { + function EventTarget() { + EventTargetBase.call(this); + } + + var descripter = { + constructor: { + value: EventTarget, + configurable: true, + writable: true + } + }; + + types.forEach(function (type) { + descripter["on" + type] = { + get: function get() { + return getAttributeListener(this, type); + }, + set: function set(listener) { + setAttributeListener(this, type, listener); + }, + configurable: true, + enumerable: true + }; + }); + + EventTarget.prototype = Object.create(EventTargetBase.prototype, descripter); + + return EventTarget; +}; +}, 118, null, "event-target-shim/lib/custom-event-target.js"); +__d(/* event-target-shim/lib/event-wrapper.js */function(global, require, module, exports) { + +"use strict"; + +var createUniqueKey = require(117 ).createUniqueKey; // 117 = ./commons + +var STOP_IMMEDIATE_PROPAGATION_FLAG = createUniqueKey("stop_immediate_propagation_flag"); + +var CANCELED_FLAG = createUniqueKey("canceled_flag"); + +var ORIGINAL_EVENT = createUniqueKey("original_event"); + +var wrapperPrototypeDefinition = Object.freeze({ + stopPropagation: Object.freeze({ + value: function stopPropagation() { + var e = this[ORIGINAL_EVENT]; + if (typeof e.stopPropagation === "function") { + e.stopPropagation(); + } + }, + writable: true, + configurable: true + }), + + stopImmediatePropagation: Object.freeze({ + value: function stopImmediatePropagation() { + this[STOP_IMMEDIATE_PROPAGATION_FLAG] = true; + + var e = this[ORIGINAL_EVENT]; + if (typeof e.stopImmediatePropagation === "function") { + e.stopImmediatePropagation(); + } + }, + writable: true, + configurable: true + }), + + preventDefault: Object.freeze({ + value: function preventDefault() { + if (this.cancelable === true) { + this[CANCELED_FLAG] = true; + } + + var e = this[ORIGINAL_EVENT]; + if (typeof e.preventDefault === "function") { + e.preventDefault(); + } + }, + writable: true, + configurable: true + }), + + defaultPrevented: Object.freeze({ + get: function defaultPrevented() { + return this[CANCELED_FLAG]; + }, + enumerable: true, + configurable: true + }) +}); + +exports.STOP_IMMEDIATE_PROPAGATION_FLAG = STOP_IMMEDIATE_PROPAGATION_FLAG; + +exports.createEventWrapper = function createEventWrapper(event, eventTarget) { + var timeStamp = typeof event.timeStamp === "number" ? event.timeStamp : Date.now(); + var propertyDefinition = { + type: { value: event.type, enumerable: true }, + target: { value: eventTarget, enumerable: true }, + currentTarget: { value: eventTarget, enumerable: true }, + eventPhase: { value: 2, enumerable: true }, + bubbles: { value: Boolean(event.bubbles), enumerable: true }, + cancelable: { value: Boolean(event.cancelable), enumerable: true }, + timeStamp: { value: timeStamp, enumerable: true }, + isTrusted: { value: false, enumerable: true } + }; + propertyDefinition[STOP_IMMEDIATE_PROPAGATION_FLAG] = { value: false, writable: true }; + propertyDefinition[CANCELED_FLAG] = { value: false, writable: true }; + propertyDefinition[ORIGINAL_EVENT] = { value: event }; + + if (typeof event.detail !== "undefined") { + propertyDefinition.detail = { value: event.detail, enumerable: true }; + } + + return Object.create(Object.create(event, wrapperPrototypeDefinition), propertyDefinition); +}; +}, 119, null, "event-target-shim/lib/event-wrapper.js"); +__d(/* HMRLoadingView */function(global, require, module, exports) { + +'use strict'; + +var processColor = require(121 ); // 121 = processColor + +var _require = require(80 ), // 80 = NativeModules + DevLoadingView = _require.DevLoadingView; + +var HMRLoadingView = function () { + function HMRLoadingView() { + babelHelpers.classCallCheck(this, HMRLoadingView); + } + + babelHelpers.createClass(HMRLoadingView, null, [{ + key: 'showMessage', + value: function showMessage(message) { + DevLoadingView.showMessage(message, processColor('#000000'), processColor('#aaaaaa')); + } + }, { + key: 'hide', + value: function hide() { + DevLoadingView.hide(); + } + }]); + return HMRLoadingView; +}(); + +module.exports = HMRLoadingView; +}, 120, null, "HMRLoadingView"); +__d(/* processColor */function(global, require, module, exports) { +'use strict'; + +var Platform = require(79 ); // 79 = Platform + +var normalizeColor = require(72 ); // 72 = normalizeColor + +function processColor(color) { + if (color === undefined || color === null) { + return color; + } + + var int32Color = normalizeColor(color); + if (int32Color === null) { + return undefined; + } + + int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0; + + if (Platform.OS === 'android') { + int32Color = int32Color | 0x0; + } + return int32Color; +} + +module.exports = processColor; +}, 121, null, "processColor"); +__d(/* defineLazyObjectProperty */function(global, require, module, exports) { + +'use strict'; + +function defineLazyObjectProperty(object, name, descriptor) { + var get = descriptor.get; + + var enumerable = descriptor.enumerable !== false; + var writable = descriptor.writable !== false; + + var value = void 0; + var valueSet = false; + function getValue() { + if (!valueSet) { + valueSet = true; + setValue(get()); + } + return value; + } + function setValue(newValue) { + value = newValue; + valueSet = true; + Object.defineProperty(object, name, { + value: newValue, + configurable: true, + enumerable: enumerable, + writable: writable + }); + } + + Object.defineProperty(object, name, { + get: getValue, + set: setValue, + configurable: true, + enumerable: enumerable + }); +} + +module.exports = defineLazyObjectProperty; +}, 122, null, "defineLazyObjectProperty"); +__d(/* UIManager */function(global, require, module, exports) { +'use strict'; + +var NativeModules = require(80 ); // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform + +var defineLazyObjectProperty = require(122 ); // 122 = defineLazyObjectProperty +var findNodeHandle = require(124 ); // 124 = findNodeHandle +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var UIManager = NativeModules.UIManager; + + +invariant(UIManager, 'UIManager is undefined. The native module config is probably incorrect.'); + +var _takeSnapshot = UIManager.takeSnapshot; + +UIManager.takeSnapshot = function _callee(view, options) { + return regeneratorRuntime.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (_takeSnapshot) { + _context.next = 3; + break; + } + + console.warn('UIManager.takeSnapshot is not available on this platform'); + return _context.abrupt('return'); + + case 3: + if (typeof view !== 'number' && view !== 'window') { + view = findNodeHandle(view) || 'window'; + } + return _context.abrupt('return', _takeSnapshot(view, options)); + + case 5: + case 'end': + return _context.stop(); + } + } + }, null, this); +}; + +if (Platform.OS === 'ios') { + Object.keys(UIManager).forEach(function (viewName) { + var viewConfig = UIManager[viewName]; + if (viewConfig.Manager) { + defineLazyObjectProperty(viewConfig, 'Constants', { + get: function get() { + var viewManager = NativeModules[viewConfig.Manager]; + var constants = {}; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + if (typeof value !== 'function') { + constants[key] = value; + } + }); + return constants; + } + }); + defineLazyObjectProperty(viewConfig, 'Commands', { + get: function get() { + var viewManager = NativeModules[viewConfig.Manager]; + var commands = {}; + var index = 0; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + if (typeof value === 'function') { + commands[key] = index++; + } + }); + return commands; + } + }); + } + }); +} else if (Platform.OS === 'android' && UIManager.AndroidLazyViewManagersEnabled) { + UIManager.ViewManagerNames.forEach(function (viewManagerName) { + defineLazyObjectProperty(UIManager, viewManagerName, { + get: function get() { + return NativeModules[viewManagerName.replace(/^(RCT|RK)/, '')]; + } + }); + }); +} + +module.exports = UIManager; +}, 123, null, "UIManager"); +__d(/* findNodeHandle */function(global, require, module, exports) { + +'use strict'; + +var ReactCurrentOwner = require(49 ); // 49 = react/lib/ReactCurrentOwner +var ReactInstanceMap = require(125 ); // 125 = ReactInstanceMap + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +function findNodeHandle(componentOrHandle) { + if (__DEV__) { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + warning(owner._warnedAboutRefsInRender, '%s is accessing findNodeHandle inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component'); + owner._warnedAboutRefsInRender = true; + } + } + if (componentOrHandle == null) { + return null; + } + if (typeof componentOrHandle === 'number') { + return componentOrHandle; + } + + var component = componentOrHandle; + + var internalInstance = ReactInstanceMap.get(component); + if (internalInstance) { + return internalInstance.getHostNode(); + } else { + var rootNodeID = component._rootNodeID; + if (rootNodeID) { + return rootNodeID; + } else { + invariant(typeof component === 'object' && '_rootNodeID' in component || component.render != null && typeof component.render === 'function', 'findNodeHandle(...): Argument is not a component ' + '(type: %s, keys: %s)', typeof component, Object.keys(component)); + invariant(false, 'findNodeHandle(...): Unable to find node handle for unmounted ' + 'component.'); + } + } +} + +module.exports = findNodeHandle; +}, 124, null, "findNodeHandle"); +__d(/* ReactInstanceMap */function(global, require, module, exports) { + +'use strict'; + +var ReactInstanceMap = { + remove: function remove(key) { + key._reactInternalInstance = undefined; + }, + + get: function get(key) { + return key._reactInternalInstance; + }, + + has: function has(key) { + return key._reactInternalInstance !== undefined; + }, + + set: function set(key, value) { + key._reactInternalInstance = value; + } + +}; + +module.exports = ReactInstanceMap; +}, 125, null, "ReactInstanceMap"); +__d(/* React */function(global, require, module, exports) { + +'use strict'; + +module.exports = require(35 ); // 35 = react/lib/React +}, 126, null, "React"); +__d(/* StyleSheet */function(global, require, module, exports) { +'use strict'; + +var PixelRatio = require(128 ); // 128 = PixelRatio +var ReactNativePropRegistry = require(75 ); // 75 = ReactNativePropRegistry +var ReactNativeStyleAttributes = require(130 ); // 130 = ReactNativeStyleAttributes +var StyleSheetValidation = require(145 ); // 145 = StyleSheetValidation + +var flatten = require(77 ); // 77 = flattenStyle + +var hairlineWidth = PixelRatio.roundToNearestPixel(0.4); +if (hairlineWidth === 0) { + hairlineWidth = 1 / PixelRatio.get(); +} + +var absoluteFillObject = { + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0 +}; +var absoluteFill = ReactNativePropRegistry.register(absoluteFillObject); +module.exports = { + hairlineWidth: hairlineWidth, + + absoluteFill: absoluteFill, + + absoluteFillObject: absoluteFillObject, + + flatten: flatten, + + setStyleAttributePreprocessor: function setStyleAttributePreprocessor(property, process) { + var value = void 0; + + if (typeof ReactNativeStyleAttributes[property] === 'string') { + value = {}; + } else if (typeof ReactNativeStyleAttributes[property] === 'object') { + value = ReactNativeStyleAttributes[property]; + } else { + console.error(property + ' is not a valid style attribute'); + return; + } + + if (__DEV__ && typeof value.process === 'function') { + console.warn('Overwriting ' + property + ' style attribute preprocessor'); + } + + ReactNativeStyleAttributes[property] = babelHelpers.extends({}, value, { process: process }); + }, + create: function create(obj) { + var result = {}; + for (var key in obj) { + StyleSheetValidation.validateStyle(key, obj); + result[key] = ReactNativePropRegistry.register(obj[key]); + } + return result; + } +}; +}, 127, null, "StyleSheet"); +__d(/* PixelRatio */function(global, require, module, exports) { +'use strict'; + +var Dimensions = require(129 ); // 129 = Dimensions + +var PixelRatio = function () { + function PixelRatio() { + babelHelpers.classCallCheck(this, PixelRatio); + } + + babelHelpers.createClass(PixelRatio, null, [{ + key: 'get', + value: function get() { + return Dimensions.get('window').scale; + } + }, { + key: 'getFontScale', + value: function getFontScale() { + return Dimensions.get('window').fontScale || PixelRatio.get(); + } + }, { + key: 'getPixelSizeForLayoutSize', + value: function getPixelSizeForLayoutSize(layoutSize) { + return Math.round(layoutSize * PixelRatio.get()); + } + }, { + key: 'roundToNearestPixel', + value: function roundToNearestPixel(layoutSize) { + var ratio = PixelRatio.get(); + return Math.round(layoutSize * ratio) / ratio; + } + }, { + key: 'startDetecting', + value: function startDetecting() {} + }]); + return PixelRatio; +}(); + +module.exports = PixelRatio; +}, 128, null, "PixelRatio"); +__d(/* Dimensions */function(global, require, module, exports) { +'use strict'; + +var Platform = require(79 ); // 79 = Platform +var UIManager = require(123 ); // 123 = UIManager +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var dimensions = {}; + +var Dimensions = function () { + function Dimensions() { + babelHelpers.classCallCheck(this, Dimensions); + } + + babelHelpers.createClass(Dimensions, null, [{ + key: 'set', + value: function set(dims) { + if (dims && dims.windowPhysicalPixels) { + dims = JSON.parse(JSON.stringify(dims)); + + var windowPhysicalPixels = dims.windowPhysicalPixels; + dims.window = { + width: windowPhysicalPixels.width / windowPhysicalPixels.scale, + height: windowPhysicalPixels.height / windowPhysicalPixels.scale, + scale: windowPhysicalPixels.scale, + fontScale: windowPhysicalPixels.fontScale + }; + if (Platform.OS === 'android') { + var screenPhysicalPixels = dims.screenPhysicalPixels; + dims.screen = { + width: screenPhysicalPixels.width / screenPhysicalPixels.scale, + height: screenPhysicalPixels.height / screenPhysicalPixels.scale, + scale: screenPhysicalPixels.scale, + fontScale: screenPhysicalPixels.fontScale + }; + + delete dims.screenPhysicalPixels; + } else { + dims.screen = dims.window; + } + + delete dims.windowPhysicalPixels; + } + + babelHelpers.extends(dimensions, dims); + } + }, { + key: 'get', + value: function get(dim) { + invariant(dimensions[dim], 'No dimension set for key ' + dim); + return dimensions[dim]; + } + }]); + return Dimensions; +}(); + +Dimensions.set(UIManager.Dimensions); +RCTDeviceEventEmitter.addListener('didUpdateDimensions', function (update) { + Dimensions.set(update); +}); + +module.exports = Dimensions; +}, 129, null, "Dimensions"); +__d(/* ReactNativeStyleAttributes */function(global, require, module, exports) { + +'use strict'; + +var ImageStylePropTypes = require(131 ); // 131 = ImageStylePropTypes +var TextStylePropTypes = require(139 ); // 139 = TextStylePropTypes +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror +var matricesDiffer = require(141 ); // 141 = matricesDiffer +var processColor = require(121 ); // 121 = processColor +var processTransform = require(142 ); // 142 = processTransform +var sizesDiffer = require(144 ); // 144 = sizesDiffer + +var ReactNativeStyleAttributes = babelHelpers.extends({}, keyMirror(ViewStylePropTypes), keyMirror(TextStylePropTypes), keyMirror(ImageStylePropTypes)); + +ReactNativeStyleAttributes.transform = { process: processTransform }; +ReactNativeStyleAttributes.transformMatrix = { diff: matricesDiffer }; +ReactNativeStyleAttributes.shadowOffset = { diff: sizesDiffer }; + +ReactNativeStyleAttributes.decomposedMatrix = 'decomposedMatrix'; + +var colorAttributes = { process: processColor }; +ReactNativeStyleAttributes.backgroundColor = colorAttributes; +ReactNativeStyleAttributes.borderBottomColor = colorAttributes; +ReactNativeStyleAttributes.borderColor = colorAttributes; +ReactNativeStyleAttributes.borderLeftColor = colorAttributes; +ReactNativeStyleAttributes.borderRightColor = colorAttributes; +ReactNativeStyleAttributes.borderTopColor = colorAttributes; +ReactNativeStyleAttributes.color = colorAttributes; +ReactNativeStyleAttributes.shadowColor = colorAttributes; +ReactNativeStyleAttributes.textDecorationColor = colorAttributes; +ReactNativeStyleAttributes.tintColor = colorAttributes; +ReactNativeStyleAttributes.textShadowColor = colorAttributes; +ReactNativeStyleAttributes.overlayColor = colorAttributes; + +module.exports = ReactNativeStyleAttributes; +}, 130, null, "ReactNativeStyleAttributes"); +__d(/* ImageStylePropTypes */function(global, require, module, exports) { +'use strict'; + +var ImageResizeMode = require(132 ); // 132 = ImageResizeMode +var LayoutPropTypes = require(134 ); // 134 = LayoutPropTypes +var ColorPropType = require(71 ); // 71 = ColorPropType +var ShadowPropTypesIOS = require(135 ); // 135 = ShadowPropTypesIOS +var TransformPropTypes = require(136 ); // 136 = TransformPropTypes + +var ReactPropTypes = require(126 ).PropTypes; // 126 = React + +var ImageStylePropTypes = babelHelpers.extends({}, LayoutPropTypes, ShadowPropTypesIOS, TransformPropTypes, { + resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)), + backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']), + backgroundColor: ColorPropType, + borderColor: ColorPropType, + borderWidth: ReactPropTypes.number, + borderRadius: ReactPropTypes.number, + overflow: ReactPropTypes.oneOf(['visible', 'hidden']), + + tintColor: ColorPropType, + opacity: ReactPropTypes.number, + + overlayColor: ReactPropTypes.string, + + borderTopLeftRadius: ReactPropTypes.number, + borderTopRightRadius: ReactPropTypes.number, + borderBottomLeftRadius: ReactPropTypes.number, + borderBottomRightRadius: ReactPropTypes.number +}); + +module.exports = ImageStylePropTypes; +}, 131, null, "ImageStylePropTypes"); +__d(/* ImageResizeMode */function(global, require, module, exports) { +'use strict'; + +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror + +var ImageResizeMode = keyMirror({ + contain: null, + + cover: null, + + stretch: null, + + center: null, + + repeat: null +}); + +module.exports = ImageResizeMode; +}, 132, null, "ImageResizeMode"); +__d(/* fbjs/lib/keyMirror.js */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = ./invariant + +var keyMirror = function keyMirror(obj) { + var ret = {}; + var key; + !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0; + for (key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + ret[key] = key; + } + return ret; +}; + +module.exports = keyMirror; +}, 133, null, "fbjs/lib/keyMirror.js"); +__d(/* LayoutPropTypes */function(global, require, module, exports) { +'use strict'; + +var ReactPropTypes = require(126 ).PropTypes; // 126 = React + +var LayoutPropTypes = { + width: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + height: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + top: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + left: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + right: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + bottom: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + minWidth: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + maxWidth: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + minHeight: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + maxHeight: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + margin: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginVertical: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginHorizontal: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginTop: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginBottom: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginLeft: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + marginRight: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + padding: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingVertical: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingHorizontal: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingTop: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingBottom: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingLeft: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + paddingRight: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + borderWidth: ReactPropTypes.number, + + borderTopWidth: ReactPropTypes.number, + + borderRightWidth: ReactPropTypes.number, + + borderBottomWidth: ReactPropTypes.number, + + borderLeftWidth: ReactPropTypes.number, + + position: ReactPropTypes.oneOf(['absolute', 'relative']), + + flexDirection: ReactPropTypes.oneOf(['row', 'row-reverse', 'column', 'column-reverse']), + + flexWrap: ReactPropTypes.oneOf(['wrap', 'nowrap']), + + justifyContent: ReactPropTypes.oneOf(['flex-start', 'flex-end', 'center', 'space-between', 'space-around']), + + alignItems: ReactPropTypes.oneOf(['flex-start', 'flex-end', 'center', 'stretch', 'baseline']), + + alignSelf: ReactPropTypes.oneOf(['auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline']), + + overflow: ReactPropTypes.oneOf(['visible', 'hidden', 'scroll']), + + flex: ReactPropTypes.number, + flexGrow: ReactPropTypes.number, + flexShrink: ReactPropTypes.number, + flexBasis: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), + + aspectRatio: ReactPropTypes.number, + + zIndex: ReactPropTypes.number +}; + +module.exports = LayoutPropTypes; +}, 134, null, "LayoutPropTypes"); +__d(/* ShadowPropTypesIOS */function(global, require, module, exports) { +'use strict'; + +var ColorPropType = require(71 ); // 71 = ColorPropType +var ReactPropTypes = require(126 ).PropTypes; // 126 = React + +var ShadowPropTypesIOS = { + shadowColor: ColorPropType, + + shadowOffset: ReactPropTypes.shape({ width: ReactPropTypes.number, height: ReactPropTypes.number }), + + shadowOpacity: ReactPropTypes.number, + + shadowRadius: ReactPropTypes.number +}; + +module.exports = ShadowPropTypesIOS; +}, 135, null, "ShadowPropTypesIOS"); +__d(/* TransformPropTypes */function(global, require, module, exports) { +'use strict'; + +var deprecatedPropType = require(137 ); // 137 = deprecatedPropType + +var ReactPropTypes = require(126 ).PropTypes; // 126 = React + +var TransformMatrixPropType = function TransformMatrixPropType(props, propName, componentName) { + if (props[propName]) { + return new Error('The transformMatrix style property is deprecated. ' + 'Use `transform: [{ matrix: ... }]` instead.'); + } +}; + +var DecomposedMatrixPropType = function DecomposedMatrixPropType(props, propName, componentName) { + if (props[propName]) { + return new Error('The decomposedMatrix style property is deprecated. ' + 'Use `transform: [...]` instead.'); + } +}; + +var TransformPropTypes = { + transform: ReactPropTypes.arrayOf(ReactPropTypes.oneOfType([ReactPropTypes.shape({ perspective: ReactPropTypes.number }), ReactPropTypes.shape({ rotate: ReactPropTypes.string }), ReactPropTypes.shape({ rotateX: ReactPropTypes.string }), ReactPropTypes.shape({ rotateY: ReactPropTypes.string }), ReactPropTypes.shape({ rotateZ: ReactPropTypes.string }), ReactPropTypes.shape({ scale: ReactPropTypes.number }), ReactPropTypes.shape({ scaleX: ReactPropTypes.number }), ReactPropTypes.shape({ scaleY: ReactPropTypes.number }), ReactPropTypes.shape({ translateX: ReactPropTypes.number }), ReactPropTypes.shape({ translateY: ReactPropTypes.number }), ReactPropTypes.shape({ skewX: ReactPropTypes.string }), ReactPropTypes.shape({ skewY: ReactPropTypes.string })])), + + transformMatrix: TransformMatrixPropType, + decomposedMatrix: DecomposedMatrixPropType, + + scaleX: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'), + scaleY: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'), + rotation: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'), + translateX: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.'), + translateY: deprecatedPropType(ReactPropTypes.number, 'Use the transform prop instead.') +}; + +module.exports = TransformPropTypes; +}, 136, null, "TransformPropTypes"); +__d(/* deprecatedPropType */function(global, require, module, exports) { +'use strict'; + +var UIManager = require(123 ); // 123 = UIManager +var ReactPropTypesSecret = require(59 ); // 59 = react/lib/ReactPropTypesSecret +var ReactPropTypeLocations = require(138 ); // 138 = react/lib/ReactPropTypeLocations + +function deprecatedPropType(propType, explanation) { + return function validate(props, propName, componentName) { + if (!UIManager[componentName] && props[propName] !== undefined) { + console.warn('`' + propName + '` supplied to `' + componentName + '` has been deprecated. ' + explanation); + } + + return propType(props, propName, componentName, ReactPropTypeLocations.prop, null, ReactPropTypesSecret); + }; +} + +module.exports = deprecatedPropType; +}, 137, null, "deprecatedPropType"); +__d(/* react/lib/ReactPropTypeLocations.js */function(global, require, module, exports) { + +'use strict'; +}, 138, null, "react/lib/ReactPropTypeLocations.js"); +__d(/* TextStylePropTypes */function(global, require, module, exports) { +'use strict'; + +var ReactPropTypes = require(126 ).PropTypes; // 126 = React +var ColorPropType = require(71 ); // 71 = ColorPropType +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var TextStylePropTypes = babelHelpers.extends({}, ViewStylePropTypes, { + + color: ColorPropType, + fontFamily: ReactPropTypes.string, + fontSize: ReactPropTypes.number, + fontStyle: ReactPropTypes.oneOf(['normal', 'italic']), + + fontWeight: ReactPropTypes.oneOf(['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900']), + + fontVariant: ReactPropTypes.arrayOf(ReactPropTypes.oneOf(['small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums'])), + textShadowOffset: ReactPropTypes.shape({ width: ReactPropTypes.number, height: ReactPropTypes.number }), + textShadowRadius: ReactPropTypes.number, + textShadowColor: ColorPropType, + + letterSpacing: ReactPropTypes.number, + lineHeight: ReactPropTypes.number, + + textAlign: ReactPropTypes.oneOf(['auto', 'left', 'right', 'center', 'justify']), + + textAlignVertical: ReactPropTypes.oneOf(['auto', 'top', 'bottom', 'center']), + + includeFontPadding: ReactPropTypes.bool, + textDecorationLine: ReactPropTypes.oneOf(['none', 'underline', 'line-through', 'underline line-through']), + + textDecorationStyle: ReactPropTypes.oneOf(['solid', 'double', 'dotted', 'dashed']), + + textDecorationColor: ColorPropType, + + writingDirection: ReactPropTypes.oneOf(['auto', 'ltr', 'rtl']) +}); + +module.exports = TextStylePropTypes; +}, 139, null, "TextStylePropTypes"); +__d(/* ViewStylePropTypes */function(global, require, module, exports) { +'use strict'; + +var LayoutPropTypes = require(134 ); // 134 = LayoutPropTypes +var ReactPropTypes = require(126 ).PropTypes; // 126 = React +var ColorPropType = require(71 ); // 71 = ColorPropType +var ShadowPropTypesIOS = require(135 ); // 135 = ShadowPropTypesIOS +var TransformPropTypes = require(136 ); // 136 = TransformPropTypes + +var ViewStylePropTypes = babelHelpers.extends({}, LayoutPropTypes, ShadowPropTypesIOS, TransformPropTypes, { + backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']), + backgroundColor: ColorPropType, + borderColor: ColorPropType, + borderTopColor: ColorPropType, + borderRightColor: ColorPropType, + borderBottomColor: ColorPropType, + borderLeftColor: ColorPropType, + borderRadius: ReactPropTypes.number, + borderTopLeftRadius: ReactPropTypes.number, + borderTopRightRadius: ReactPropTypes.number, + borderBottomLeftRadius: ReactPropTypes.number, + borderBottomRightRadius: ReactPropTypes.number, + borderStyle: ReactPropTypes.oneOf(['solid', 'dotted', 'dashed']), + borderWidth: ReactPropTypes.number, + borderTopWidth: ReactPropTypes.number, + borderRightWidth: ReactPropTypes.number, + borderBottomWidth: ReactPropTypes.number, + borderLeftWidth: ReactPropTypes.number, + opacity: ReactPropTypes.number, + + elevation: ReactPropTypes.number +}); + +module.exports = ViewStylePropTypes; +}, 140, null, "ViewStylePropTypes"); +__d(/* matricesDiffer */function(global, require, module, exports) { +'use strict'; + +var matricesDiffer = function matricesDiffer(one, two) { + if (one === two) { + return false; + } + return !one || !two || one[12] !== two[12] || one[13] !== two[13] || one[14] !== two[14] || one[5] !== two[5] || one[10] !== two[10] || one[1] !== two[1] || one[2] !== two[2] || one[3] !== two[3] || one[4] !== two[4] || one[6] !== two[6] || one[7] !== two[7] || one[8] !== two[8] || one[9] !== two[9] || one[11] !== two[11] || one[15] !== two[15]; +}; + +module.exports = matricesDiffer; +}, 141, null, "matricesDiffer"); +__d(/* processTransform */function(global, require, module, exports) { +'use strict'; + +var MatrixMath = require(143 ); // 143 = MatrixMath +var Platform = require(79 ); // 79 = Platform + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var stringifySafe = require(97 ); // 97 = stringifySafe + +function processTransform(transform) { + if (__DEV__) { + _validateTransforms(transform); + } + + if (Platform.OS === 'android' || Platform.OS === 'ios') { + return transform; + } + + var result = MatrixMath.createIdentityMatrix(); + + transform.forEach(function (transformation) { + var key = Object.keys(transformation)[0]; + var value = transformation[key]; + + switch (key) { + case 'matrix': + MatrixMath.multiplyInto(result, result, value); + break; + case 'perspective': + _multiplyTransform(result, MatrixMath.reusePerspectiveCommand, [value]); + break; + case 'rotateX': + _multiplyTransform(result, MatrixMath.reuseRotateXCommand, [_convertToRadians(value)]); + break; + case 'rotateY': + _multiplyTransform(result, MatrixMath.reuseRotateYCommand, [_convertToRadians(value)]); + break; + case 'rotate': + case 'rotateZ': + _multiplyTransform(result, MatrixMath.reuseRotateZCommand, [_convertToRadians(value)]); + break; + case 'scale': + _multiplyTransform(result, MatrixMath.reuseScaleCommand, [value]); + break; + case 'scaleX': + _multiplyTransform(result, MatrixMath.reuseScaleXCommand, [value]); + break; + case 'scaleY': + _multiplyTransform(result, MatrixMath.reuseScaleYCommand, [value]); + break; + case 'translate': + _multiplyTransform(result, MatrixMath.reuseTranslate3dCommand, [value[0], value[1], value[2] || 0]); + break; + case 'translateX': + _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [value, 0]); + break; + case 'translateY': + _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [0, value]); + break; + case 'skewX': + _multiplyTransform(result, MatrixMath.reuseSkewXCommand, [_convertToRadians(value)]); + break; + case 'skewY': + _multiplyTransform(result, MatrixMath.reuseSkewYCommand, [_convertToRadians(value)]); + break; + default: + throw new Error('Invalid transform name: ' + key); + } + }); + + return result; +} + +function _multiplyTransform(result, matrixMathFunction, args) { + var matrixToApply = MatrixMath.createIdentityMatrix(); + var argsWithIdentity = [matrixToApply].concat(args); + matrixMathFunction.apply(this, argsWithIdentity); + MatrixMath.multiplyInto(result, result, matrixToApply); +} + +function _convertToRadians(value) { + var floatValue = parseFloat(value, 10); + return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180; +} + +function _validateTransforms(transform) { + transform.forEach(function (transformation) { + var keys = Object.keys(transformation); + invariant(keys.length === 1, 'You must specify exactly one property per transform object. Passed properties: %s', stringifySafe(transformation)); + var key = keys[0]; + var value = transformation[key]; + _validateTransform(key, value, transformation); + }); +} + +function _validateTransform(key, value, transformation) { + invariant(!value.getValue, 'You passed an Animated.Value to a normal component. ' + 'You need to wrap that component in an Animated. For example, ' + 'replace by .'); + + var multivalueTransforms = ['matrix', 'translate']; + if (multivalueTransforms.indexOf(key) !== -1) { + invariant(Array.isArray(value), 'Transform with key of %s must have an array as the value: %s', key, stringifySafe(transformation)); + } + switch (key) { + case 'matrix': + invariant(value.length === 9 || value.length === 16, 'Matrix transform must have a length of 9 (2d) or 16 (3d). ' + 'Provided matrix has a length of %s: %s', value.length, stringifySafe(transformation)); + break; + case 'translate': + invariant(value.length === 2 || value.length === 3, 'Transform with key translate must be an array of length 2 or 3, found %s: %s', value.length, stringifySafe(transformation)); + break; + case 'rotateX': + case 'rotateY': + case 'rotateZ': + case 'rotate': + case 'skewX': + case 'skewY': + invariant(typeof value === 'string', 'Transform with key of "%s" must be a string: %s', key, stringifySafe(transformation)); + invariant(value.indexOf('deg') > -1 || value.indexOf('rad') > -1, 'Rotate transform must be expressed in degrees (deg) or radians ' + '(rad): %s', stringifySafe(transformation)); + break; + case 'perspective': + invariant(typeof value === 'number', 'Transform with key of "%s" must be a number: %s', key, stringifySafe(transformation)); + invariant(value !== 0, 'Transform with key of "%s" cannot be zero: %s', key, stringifySafe(transformation)); + break; + case 'translateX': + case 'translateY': + case 'scale': + case 'scaleX': + case 'scaleY': + invariant(typeof value === 'number', 'Transform with key of "%s" must be a number: %s', key, stringifySafe(transformation)); + break; + default: + invariant(false, 'Invalid transform %s: %s', key, stringifySafe(transformation)); + } +} + +module.exports = processTransform; +}, 142, null, "processTransform"); +__d(/* MatrixMath */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var MatrixMath = { + createIdentityMatrix: function createIdentityMatrix() { + return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; + }, + + createCopy: function createCopy(m) { + return [m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15]]; + }, + + createOrthographic: function createOrthographic(left, right, bottom, top, near, far) { + var a = 2 / (right - left); + var b = 2 / (top - bottom); + var c = -2 / (far - near); + + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + + return [a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, tx, ty, tz, 1]; + }, + + createFrustum: function createFrustum(left, right, bottom, top, near, far) { + var r_width = 1 / (right - left); + var r_height = 1 / (top - bottom); + var r_depth = 1 / (near - far); + var x = 2 * (near * r_width); + var y = 2 * (near * r_height); + var A = (right + left) * r_width; + var B = (top + bottom) * r_height; + var C = (far + near) * r_depth; + var D = 2 * (far * near * r_depth); + return [x, 0, 0, 0, 0, y, 0, 0, A, B, C, -1, 0, 0, D, 0]; + }, + + createPerspective: function createPerspective(fovInRadians, aspect, near, far) { + var h = 1 / Math.tan(fovInRadians / 2); + var r_depth = 1 / (near - far); + var C = (far + near) * r_depth; + var D = 2 * (far * near * r_depth); + return [h / aspect, 0, 0, 0, 0, h, 0, 0, 0, 0, C, -1, 0, 0, D, 0]; + }, + + createTranslate2d: function createTranslate2d(x, y) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseTranslate2dCommand(mat, x, y); + return mat; + }, + + reuseTranslate2dCommand: function reuseTranslate2dCommand(matrixCommand, x, y) { + matrixCommand[12] = x; + matrixCommand[13] = y; + }, + + reuseTranslate3dCommand: function reuseTranslate3dCommand(matrixCommand, x, y, z) { + matrixCommand[12] = x; + matrixCommand[13] = y; + matrixCommand[14] = z; + }, + + createScale: function createScale(factor) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseScaleCommand(mat, factor); + return mat; + }, + + reuseScaleCommand: function reuseScaleCommand(matrixCommand, factor) { + matrixCommand[0] = factor; + matrixCommand[5] = factor; + }, + + reuseScale3dCommand: function reuseScale3dCommand(matrixCommand, x, y, z) { + matrixCommand[0] = x; + matrixCommand[5] = y; + matrixCommand[10] = z; + }, + + reusePerspectiveCommand: function reusePerspectiveCommand(matrixCommand, p) { + matrixCommand[11] = -1 / p; + }, + + reuseScaleXCommand: function reuseScaleXCommand(matrixCommand, factor) { + matrixCommand[0] = factor; + }, + reuseScaleYCommand: function reuseScaleYCommand(matrixCommand, factor) { + matrixCommand[5] = factor; + }, + reuseScaleZCommand: function reuseScaleZCommand(matrixCommand, factor) { + matrixCommand[10] = factor; + }, + + + reuseRotateXCommand: function reuseRotateXCommand(matrixCommand, radians) { + matrixCommand[5] = Math.cos(radians); + matrixCommand[6] = Math.sin(radians); + matrixCommand[9] = -Math.sin(radians); + matrixCommand[10] = Math.cos(radians); + }, + + reuseRotateYCommand: function reuseRotateYCommand(matrixCommand, amount) { + matrixCommand[0] = Math.cos(amount); + matrixCommand[2] = -Math.sin(amount); + matrixCommand[8] = Math.sin(amount); + matrixCommand[10] = Math.cos(amount); + }, + + reuseRotateZCommand: function reuseRotateZCommand(matrixCommand, radians) { + matrixCommand[0] = Math.cos(radians); + matrixCommand[1] = Math.sin(radians); + matrixCommand[4] = -Math.sin(radians); + matrixCommand[5] = Math.cos(radians); + }, + + createRotateZ: function createRotateZ(radians) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseRotateZCommand(mat, radians); + return mat; + }, + + reuseSkewXCommand: function reuseSkewXCommand(matrixCommand, radians) { + matrixCommand[4] = Math.tan(radians); + }, + + reuseSkewYCommand: function reuseSkewYCommand(matrixCommand, radians) { + matrixCommand[1] = Math.tan(radians); + }, + + multiplyInto: function multiplyInto(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11], + a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4];b1 = b[5];b2 = b[6];b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8];b1 = b[9];b2 = b[10];b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12];b1 = b[13];b2 = b[14];b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + }, + + determinant: function determinant(matrix) { + var _matrix = babelHelpers.slicedToArray(matrix, 16), + m00 = _matrix[0], + m01 = _matrix[1], + m02 = _matrix[2], + m03 = _matrix[3], + m10 = _matrix[4], + m11 = _matrix[5], + m12 = _matrix[6], + m13 = _matrix[7], + m20 = _matrix[8], + m21 = _matrix[9], + m22 = _matrix[10], + m23 = _matrix[11], + m30 = _matrix[12], + m31 = _matrix[13], + m32 = _matrix[14], + m33 = _matrix[15]; + + return m03 * m12 * m21 * m30 - m02 * m13 * m21 * m30 - m03 * m11 * m22 * m30 + m01 * m13 * m22 * m30 + m02 * m11 * m23 * m30 - m01 * m12 * m23 * m30 - m03 * m12 * m20 * m31 + m02 * m13 * m20 * m31 + m03 * m10 * m22 * m31 - m00 * m13 * m22 * m31 - m02 * m10 * m23 * m31 + m00 * m12 * m23 * m31 + m03 * m11 * m20 * m32 - m01 * m13 * m20 * m32 - m03 * m10 * m21 * m32 + m00 * m13 * m21 * m32 + m01 * m10 * m23 * m32 - m00 * m11 * m23 * m32 - m02 * m11 * m20 * m33 + m01 * m12 * m20 * m33 + m02 * m10 * m21 * m33 - m00 * m12 * m21 * m33 - m01 * m10 * m22 * m33 + m00 * m11 * m22 * m33; + }, + inverse: function inverse(matrix) { + var det = MatrixMath.determinant(matrix); + if (!det) { + return matrix; + } + + var _matrix2 = babelHelpers.slicedToArray(matrix, 16), + m00 = _matrix2[0], + m01 = _matrix2[1], + m02 = _matrix2[2], + m03 = _matrix2[3], + m10 = _matrix2[4], + m11 = _matrix2[5], + m12 = _matrix2[6], + m13 = _matrix2[7], + m20 = _matrix2[8], + m21 = _matrix2[9], + m22 = _matrix2[10], + m23 = _matrix2[11], + m30 = _matrix2[12], + m31 = _matrix2[13], + m32 = _matrix2[14], + m33 = _matrix2[15]; + + return [(m12 * m23 * m31 - m13 * m22 * m31 + m13 * m21 * m32 - m11 * m23 * m32 - m12 * m21 * m33 + m11 * m22 * m33) / det, (m03 * m22 * m31 - m02 * m23 * m31 - m03 * m21 * m32 + m01 * m23 * m32 + m02 * m21 * m33 - m01 * m22 * m33) / det, (m02 * m13 * m31 - m03 * m12 * m31 + m03 * m11 * m32 - m01 * m13 * m32 - m02 * m11 * m33 + m01 * m12 * m33) / det, (m03 * m12 * m21 - m02 * m13 * m21 - m03 * m11 * m22 + m01 * m13 * m22 + m02 * m11 * m23 - m01 * m12 * m23) / det, (m13 * m22 * m30 - m12 * m23 * m30 - m13 * m20 * m32 + m10 * m23 * m32 + m12 * m20 * m33 - m10 * m22 * m33) / det, (m02 * m23 * m30 - m03 * m22 * m30 + m03 * m20 * m32 - m00 * m23 * m32 - m02 * m20 * m33 + m00 * m22 * m33) / det, (m03 * m12 * m30 - m02 * m13 * m30 - m03 * m10 * m32 + m00 * m13 * m32 + m02 * m10 * m33 - m00 * m12 * m33) / det, (m02 * m13 * m20 - m03 * m12 * m20 + m03 * m10 * m22 - m00 * m13 * m22 - m02 * m10 * m23 + m00 * m12 * m23) / det, (m11 * m23 * m30 - m13 * m21 * m30 + m13 * m20 * m31 - m10 * m23 * m31 - m11 * m20 * m33 + m10 * m21 * m33) / det, (m03 * m21 * m30 - m01 * m23 * m30 - m03 * m20 * m31 + m00 * m23 * m31 + m01 * m20 * m33 - m00 * m21 * m33) / det, (m01 * m13 * m30 - m03 * m11 * m30 + m03 * m10 * m31 - m00 * m13 * m31 - m01 * m10 * m33 + m00 * m11 * m33) / det, (m03 * m11 * m20 - m01 * m13 * m20 - m03 * m10 * m21 + m00 * m13 * m21 + m01 * m10 * m23 - m00 * m11 * m23) / det, (m12 * m21 * m30 - m11 * m22 * m30 - m12 * m20 * m31 + m10 * m22 * m31 + m11 * m20 * m32 - m10 * m21 * m32) / det, (m01 * m22 * m30 - m02 * m21 * m30 + m02 * m20 * m31 - m00 * m22 * m31 - m01 * m20 * m32 + m00 * m21 * m32) / det, (m02 * m11 * m30 - m01 * m12 * m30 - m02 * m10 * m31 + m00 * m12 * m31 + m01 * m10 * m32 - m00 * m11 * m32) / det, (m01 * m12 * m20 - m02 * m11 * m20 + m02 * m10 * m21 - m00 * m12 * m21 - m01 * m10 * m22 + m00 * m11 * m22) / det]; + }, + transpose: function transpose(m) { + return [m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], m[3], m[7], m[11], m[15]]; + }, + multiplyVectorByMatrix: function multiplyVectorByMatrix(v, m) { + var _v = babelHelpers.slicedToArray(v, 4), + vx = _v[0], + vy = _v[1], + vz = _v[2], + vw = _v[3]; + + return [vx * m[0] + vy * m[4] + vz * m[8] + vw * m[12], vx * m[1] + vy * m[5] + vz * m[9] + vw * m[13], vx * m[2] + vy * m[6] + vz * m[10] + vw * m[14], vx * m[3] + vy * m[7] + vz * m[11] + vw * m[15]]; + }, + v3Length: function v3Length(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); + }, + v3Normalize: function v3Normalize(vector, v3Length) { + var im = 1 / (v3Length || MatrixMath.v3Length(vector)); + return [vector[0] * im, vector[1] * im, vector[2] * im]; + }, + v3Dot: function v3Dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + }, + v3Combine: function v3Combine(a, b, aScale, bScale) { + return [aScale * a[0] + bScale * b[0], aScale * a[1] + bScale * b[1], aScale * a[2] + bScale * b[2]]; + }, + v3Cross: function v3Cross(a, b) { + return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; + }, + quaternionToDegreesXYZ: function quaternionToDegreesXYZ(q, matrix, row) { + var _q = babelHelpers.slicedToArray(q, 4), + qx = _q[0], + qy = _q[1], + qz = _q[2], + qw = _q[3]; + + var qw2 = qw * qw; + var qx2 = qx * qx; + var qy2 = qy * qy; + var qz2 = qz * qz; + var test = qx * qy + qz * qw; + var unit = qw2 + qx2 + qy2 + qz2; + var conv = 180 / Math.PI; + + if (test > 0.49999 * unit) { + return [0, 2 * Math.atan2(qx, qw) * conv, 90]; + } + if (test < -0.49999 * unit) { + return [0, -2 * Math.atan2(qx, qw) * conv, -90]; + } + + return [MatrixMath.roundTo3Places(Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx2 - 2 * qz2) * conv), MatrixMath.roundTo3Places(Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy2 - 2 * qz2) * conv), MatrixMath.roundTo3Places(Math.asin(2 * qx * qy + 2 * qz * qw) * conv)]; + }, + roundTo3Places: function roundTo3Places(n) { + var arr = n.toString().split('e'); + return Math.round(arr[0] + 'e' + (arr[1] ? +arr[1] - 3 : 3)) * 0.001; + }, + decomposeMatrix: function decomposeMatrix(transformMatrix) { + + invariant(transformMatrix.length === 16, 'Matrix decomposition needs a list of 3d matrix values, received %s', transformMatrix); + + var perspective = []; + var quaternion = []; + var scale = []; + var skew = []; + var translation = []; + + if (!transformMatrix[15]) { + return; + } + var matrix = []; + var perspectiveMatrix = []; + for (var i = 0; i < 4; i++) { + matrix.push([]); + for (var j = 0; j < 4; j++) { + var value = transformMatrix[i * 4 + j] / transformMatrix[15]; + matrix[i].push(value); + perspectiveMatrix.push(j === 3 ? 0 : value); + } + } + perspectiveMatrix[15] = 1; + + if (!MatrixMath.determinant(perspectiveMatrix)) { + return; + } + + if (matrix[0][3] !== 0 || matrix[1][3] !== 0 || matrix[2][3] !== 0) { + var rightHandSide = [matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]]; + + var inversePerspectiveMatrix = MatrixMath.inverse(perspectiveMatrix); + var transposedInversePerspectiveMatrix = MatrixMath.transpose(inversePerspectiveMatrix); + var perspective = MatrixMath.multiplyVectorByMatrix(rightHandSide, transposedInversePerspectiveMatrix); + } else { + perspective[0] = perspective[1] = perspective[2] = 0; + perspective[3] = 1; + } + + for (var i = 0; i < 3; i++) { + translation[i] = matrix[3][i]; + } + + var row = []; + for (i = 0; i < 3; i++) { + row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]]; + } + + scale[0] = MatrixMath.v3Length(row[0]); + row[0] = MatrixMath.v3Normalize(row[0], scale[0]); + + skew[0] = MatrixMath.v3Dot(row[0], row[1]); + row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]); + + skew[0] = MatrixMath.v3Dot(row[0], row[1]); + row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]); + + scale[1] = MatrixMath.v3Length(row[1]); + row[1] = MatrixMath.v3Normalize(row[1], scale[1]); + skew[0] /= scale[1]; + + skew[1] = MatrixMath.v3Dot(row[0], row[2]); + row[2] = MatrixMath.v3Combine(row[2], row[0], 1.0, -skew[1]); + skew[2] = MatrixMath.v3Dot(row[1], row[2]); + row[2] = MatrixMath.v3Combine(row[2], row[1], 1.0, -skew[2]); + + scale[2] = MatrixMath.v3Length(row[2]); + row[2] = MatrixMath.v3Normalize(row[2], scale[2]); + skew[1] /= scale[2]; + skew[2] /= scale[2]; + + var pdum3 = MatrixMath.v3Cross(row[1], row[2]); + if (MatrixMath.v3Dot(row[0], pdum3) < 0) { + for (i = 0; i < 3; i++) { + scale[i] *= -1; + row[i][0] *= -1; + row[i][1] *= -1; + row[i][2] *= -1; + } + } + + quaternion[0] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0)); + quaternion[1] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0)); + quaternion[2] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0)); + quaternion[3] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0)); + + if (row[2][1] > row[1][2]) { + quaternion[0] = -quaternion[0]; + } + if (row[0][2] > row[2][0]) { + quaternion[1] = -quaternion[1]; + } + if (row[1][0] > row[0][1]) { + quaternion[2] = -quaternion[2]; + } + + var rotationDegrees; + if (quaternion[0] < 0.001 && quaternion[0] >= 0 && quaternion[1] < 0.001 && quaternion[1] >= 0) { + rotationDegrees = [0, 0, MatrixMath.roundTo3Places(Math.atan2(row[0][1], row[0][0]) * 180 / Math.PI)]; + } else { + rotationDegrees = MatrixMath.quaternionToDegreesXYZ(quaternion, matrix, row); + } + + return { + rotationDegrees: rotationDegrees, + perspective: perspective, + quaternion: quaternion, + scale: scale, + skew: skew, + translation: translation, + + rotate: rotationDegrees[2], + rotateX: rotationDegrees[0], + rotateY: rotationDegrees[1], + scaleX: scale[0], + scaleY: scale[1], + translateX: translation[0], + translateY: translation[1] + }; + } +}; + +module.exports = MatrixMath; +}, 143, null, "MatrixMath"); +__d(/* sizesDiffer */function(global, require, module, exports) { +'use strict'; + +var dummySize = { width: undefined, height: undefined }; + +var sizesDiffer = function sizesDiffer(one, two) { + one = one || dummySize; + two = two || dummySize; + return one !== two && (one.width !== two.width || one.height !== two.height); +}; + +module.exports = sizesDiffer; +}, 144, null, "sizesDiffer"); +__d(/* StyleSheetValidation */function(global, require, module, exports) { +'use strict'; + +var ImageStylePropTypes = require(131 ); // 131 = ImageStylePropTypes +var ReactPropTypeLocations = require(138 ); // 138 = react/lib/ReactPropTypeLocations +var ReactPropTypesSecret = require(59 ); // 59 = react/lib/ReactPropTypesSecret +var TextStylePropTypes = require(139 ); // 139 = TextStylePropTypes +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var StyleSheetValidation = function () { + function StyleSheetValidation() { + babelHelpers.classCallCheck(this, StyleSheetValidation); + } + + babelHelpers.createClass(StyleSheetValidation, null, [{ + key: 'validateStyleProp', + value: function validateStyleProp(prop, style, caller) { + if (!__DEV__) { + return; + } + if (allStylePropTypes[prop] === undefined) { + var message1 = '"' + prop + '" is not a valid style property.'; + var message2 = '\nValid style props: ' + JSON.stringify(Object.keys(allStylePropTypes).sort(), null, ' '); + styleError(message1, style, caller, message2); + } + var error = allStylePropTypes[prop](style, prop, caller, ReactPropTypeLocations.prop, null, ReactPropTypesSecret); + if (error) { + styleError(error.message, style, caller); + } + } + }, { + key: 'validateStyle', + value: function validateStyle(name, styles) { + if (!__DEV__) { + return; + } + for (var prop in styles[name]) { + StyleSheetValidation.validateStyleProp(prop, styles[name], 'StyleSheet ' + name); + } + } + }, { + key: 'addValidStylePropTypes', + value: function addValidStylePropTypes(stylePropTypes) { + for (var key in stylePropTypes) { + allStylePropTypes[key] = stylePropTypes[key]; + } + } + }]); + return StyleSheetValidation; +}(); + +var styleError = function styleError(message1, style, caller, message2) { + invariant(false, message1 + '\n' + (caller || '<>') + ': ' + JSON.stringify(style, null, ' ') + (message2 || '')); +}; + +var allStylePropTypes = {}; + +StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes); +StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes); +StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes); + +module.exports = StyleSheetValidation; +}, 145, null, "StyleSheetValidation"); +__d(/* View */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/View/View.js'; +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var NativeModules = require(80 ); // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var ReactNativeStyleAttributes = require(130 ); // 130 = ReactNativeStyleAttributes +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var TVViewPropTypes = {}; +if (Platform.isTVOS) { + TVViewPropTypes = require(154 ); // 154 = TVViewPropTypes +} + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var stylePropType = StyleSheetPropType(ViewStylePropTypes); + +var AccessibilityTraits = ['none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text', 'summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn']; + +var AccessibilityComponentType = ['none', 'button', 'radiobutton_checked', 'radiobutton_unchecked']; + +var forceTouchAvailable = NativeModules.IOSConstants && NativeModules.IOSConstants.forceTouchAvailable || false; + +var statics = { + AccessibilityTraits: AccessibilityTraits, + AccessibilityComponentType: AccessibilityComponentType, + + forceTouchAvailable: forceTouchAvailable +}; + +var View = React.createClass({ + displayName: 'View', + + mixins: [NativeMethodsMixin], + + viewConfig: { + uiViewClassName: 'RCTView', + validAttributes: ReactNativeViewAttributes.RCTView + }, + + statics: babelHelpers.extends({}, statics), + + propTypes: babelHelpers.extends({}, TVViewPropTypes, { + accessible: PropTypes.bool, + + accessibilityLabel: PropTypes.node, + + accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentType), + + accessibilityLiveRegion: PropTypes.oneOf(['none', 'polite', 'assertive']), + + importantForAccessibility: PropTypes.oneOf(['auto', 'yes', 'no', 'no-hide-descendants']), + + accessibilityTraits: PropTypes.oneOfType([PropTypes.oneOf(AccessibilityTraits), PropTypes.arrayOf(PropTypes.oneOf(AccessibilityTraits))]), + + onAccessibilityTap: PropTypes.func, + + onMagicTap: PropTypes.func, + + testID: PropTypes.string, + + onResponderGrant: PropTypes.func, + + onResponderMove: PropTypes.func, + + onResponderReject: PropTypes.func, + + onResponderRelease: PropTypes.func, + + onResponderTerminate: PropTypes.func, + + onResponderTerminationRequest: PropTypes.func, + + onStartShouldSetResponder: PropTypes.func, + + onStartShouldSetResponderCapture: PropTypes.func, + + onMoveShouldSetResponder: PropTypes.func, + + onMoveShouldSetResponderCapture: PropTypes.func, + + hitSlop: EdgeInsetsPropType, + + onLayout: PropTypes.func, + + pointerEvents: PropTypes.oneOf(['box-none', 'none', 'box-only', 'auto']), + style: stylePropType, + + removeClippedSubviews: PropTypes.bool, + + renderToHardwareTextureAndroid: PropTypes.bool, + + shouldRasterizeIOS: PropTypes.bool, + + collapsable: PropTypes.bool, + + needsOffscreenAlphaCompositing: PropTypes.bool + }), + + contextTypes: { + isInAParentText: React.PropTypes.bool + }, + + render: function render() { + invariant(!(this.context.isInAParentText && Platform.OS === 'android'), 'Nesting of within is not supported on Android.'); + + return React.createElement(RCTView, babelHelpers.extends({}, this.props, { + __source: { + fileName: _jsxFileName, + lineNumber: 524 + } + })); + } +}); + +var RCTView = requireNativeComponent('RCTView', View, { + nativeOnly: { + nativeBackgroundAndroid: true, + nativeForegroundAndroid: true + } +}); + +if (__DEV__) { + var UIManager = require(123 ); // 123 = UIManager + var viewConfig = UIManager.viewConfigs && UIManager.viewConfigs.RCTView || {}; + for (var prop in viewConfig.nativeProps) { + var viewAny = View; + if (!viewAny.propTypes[prop] && !ReactNativeStyleAttributes[prop]) { + throw new Error('View is missing propType for native prop `' + prop + '`'); + } + } +} + +var ViewToExport = RCTView; +if (__DEV__) { + ViewToExport = View; +} else { + babelHelpers.extends(RCTView, statics); +} + +module.exports = ViewToExport; +}, 146, null, "View"); +__d(/* EdgeInsetsPropType */function(global, require, module, exports) { +'use strict'; + +var _require = require(126 ), // 126 = React + PropTypes = _require.PropTypes; + +var createStrictShapeTypeChecker = require(148 ); // 148 = createStrictShapeTypeChecker + +var EdgeInsetsPropType = createStrictShapeTypeChecker({ + top: PropTypes.number, + left: PropTypes.number, + bottom: PropTypes.number, + right: PropTypes.number +}); + +module.exports = EdgeInsetsPropType; +}, 147, null, "EdgeInsetsPropType"); +__d(/* createStrictShapeTypeChecker */function(global, require, module, exports) { +'use strict'; + +var ReactPropTypeLocationNames = require(58 ); // 58 = react/lib/ReactPropTypeLocationNames +var ReactPropTypesSecret = require(59 ); // 59 = react/lib/ReactPropTypesSecret + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var merge = require(149 ); // 149 = merge + +function createStrictShapeTypeChecker(shapeTypes) { + function checkType(isRequired, props, propName, componentName, location) { + if (!props[propName]) { + if (isRequired) { + invariant(false, 'Required object `' + propName + '` was not specified in ' + ('`' + componentName + '`.')); + } + return; + } + var propValue = props[propName]; + var propType = typeof propValue; + var locationName = location && ReactPropTypeLocationNames[location] || '(unknown)'; + if (propType !== 'object') { + invariant(false, 'Invalid ' + locationName + ' `' + propName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + + var allKeys = merge(props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + invariant(false, 'Invalid props.' + propName + ' key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); + } + var error = checker(propValue, key, componentName, location, null, ReactPropTypesSecret); + if (error) { + invariant(false, error.message + '\nBad object: ' + JSON.stringify(props[propName], null, ' ')); + } + } + } + function chainedCheckType(props, propName, componentName, location) { + return checkType(false, props, propName, componentName, location); + } + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; +} + +module.exports = createStrictShapeTypeChecker; +}, 148, null, "createStrictShapeTypeChecker"); +__d(/* merge */function(global, require, module, exports) { + +"use strict"; + +var mergeInto = require(150 ); // 150 = mergeInto + +var merge = function merge(one, two) { + var result = {}; + mergeInto(result, one); + mergeInto(result, two); + return result; +}; + +module.exports = merge; +}, 149, null, "merge"); +__d(/* mergeInto */function(global, require, module, exports) { + +"use strict"; + +var mergeHelpers = require(151 ); // 151 = mergeHelpers + +var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; +var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg; + +function mergeInto(one, two) { + checkMergeIntoObjectArg(one); + if (two != null) { + checkMergeObjectArg(two); + for (var key in two) { + if (!two.hasOwnProperty(key)) { + continue; + } + one[key] = two[key]; + } + } +} + +module.exports = mergeInto; +}, 150, null, "mergeInto"); +__d(/* mergeHelpers */function(global, require, module, exports) { + +"use strict"; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror + +var MAX_MERGE_DEPTH = 36; + +var isTerminal = function isTerminal(o) { + return typeof o !== 'object' || o === null; +}; + +var mergeHelpers = { + + MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, + + isTerminal: isTerminal, + + normalizeMergeArg: function normalizeMergeArg(arg) { + return arg === undefined || arg === null ? {} : arg; + }, + + checkMergeArrayArgs: function checkMergeArrayArgs(one, two) { + invariant(Array.isArray(one) && Array.isArray(two), 'Tried to merge arrays, instead got %s and %s.', one, two); + }, + + checkMergeObjectArgs: function checkMergeObjectArgs(one, two) { + mergeHelpers.checkMergeObjectArg(one); + mergeHelpers.checkMergeObjectArg(two); + }, + + checkMergeObjectArg: function checkMergeObjectArg(arg) { + invariant(!isTerminal(arg) && !Array.isArray(arg), 'Tried to merge an object, instead got %s.', arg); + }, + + checkMergeIntoObjectArg: function checkMergeIntoObjectArg(arg) { + invariant((!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg), 'Tried to merge into an object, instead got %s.', arg); + }, + + checkMergeLevel: function checkMergeLevel(level) { + invariant(level < MAX_MERGE_DEPTH, 'Maximum deep merge depth exceeded. You may be attempting to merge ' + 'circular structures in an unsupported way.'); + }, + + checkArrayStrategy: function checkArrayStrategy(strategy) { + invariant(strategy === undefined || strategy in mergeHelpers.ArrayStrategies, 'You must provide an array strategy to deep merge functions to ' + 'instruct the deep merge how to resolve merging two arrays.'); + }, + + ArrayStrategies: keyMirror({ + Clobber: true, + IndexByIndex: true + }) + +}; + +module.exports = mergeHelpers; +}, 151, null, "mergeHelpers"); +__d(/* ReactNativeViewAttributes */function(global, require, module, exports) { +'use strict'; + +var ReactNativeStyleAttributes = require(130 ); // 130 = ReactNativeStyleAttributes + +var ReactNativeViewAttributes = {}; + +ReactNativeViewAttributes.UIView = { + pointerEvents: true, + accessible: true, + accessibilityLabel: true, + accessibilityComponentType: true, + accessibilityLiveRegion: true, + accessibilityTraits: true, + importantForAccessibility: true, + testID: true, + renderToHardwareTextureAndroid: true, + shouldRasterizeIOS: true, + onLayout: true, + onAccessibilityTap: true, + onMagicTap: true, + collapsable: true, + needsOffscreenAlphaCompositing: true, + style: ReactNativeStyleAttributes +}; + +ReactNativeViewAttributes.RCTView = babelHelpers.extends({}, ReactNativeViewAttributes.UIView, { + removeClippedSubviews: true +}); + +module.exports = ReactNativeViewAttributes; +}, 152, null, "ReactNativeViewAttributes"); +__d(/* StyleSheetPropType */function(global, require, module, exports) { +'use strict'; + +var createStrictShapeTypeChecker = require(148 ); // 148 = createStrictShapeTypeChecker +var flattenStyle = require(77 ); // 77 = flattenStyle + +function StyleSheetPropType(shape) { + var shapePropType = createStrictShapeTypeChecker(shape); + return function (props, propName, componentName, location) { + var newProps = props; + if (props[propName]) { + newProps = {}; + newProps[propName] = flattenStyle(props[propName]); + } + return shapePropType(newProps, propName, componentName, location); + }; +} + +module.exports = StyleSheetPropType; +}, 153, null, "StyleSheetPropType"); +__d(/* TVViewPropTypes */function(global, require, module, exports) { +'use strict'; + +var PropTypes = require(126 ).PropTypes; // 126 = React + +var TVViewPropTypes = { + isTVSelectable: PropTypes.bool, + + hasTVPreferredFocus: PropTypes.bool, + + tvParallaxProperties: PropTypes.object, + + tvParallaxShiftDistanceX: PropTypes.number, + + tvParallaxShiftDistanceY: PropTypes.number, + + tvParallaxTiltAngle: PropTypes.number, + + tvParallaxMagnification: PropTypes.number + +}; + +module.exports = TVViewPropTypes; +}, 154, null, "TVViewPropTypes"); +__d(/* requireNativeComponent */function(global, require, module, exports) { +'use strict'; + +var ReactNativeStyleAttributes = require(130 ); // 130 = ReactNativeStyleAttributes +var UIManager = require(123 ); // 123 = UIManager +var UnimplementedView = require(156 ); // 156 = UnimplementedView + +var createReactNativeComponentClass = require(157 ); // 157 = createReactNativeComponentClass +var insetsDiffer = require(196 ); // 196 = insetsDiffer +var matricesDiffer = require(141 ); // 141 = matricesDiffer +var pointsDiffer = require(197 ); // 197 = pointsDiffer +var processColor = require(121 ); // 121 = processColor +var resolveAssetSource = require(198 ); // 198 = resolveAssetSource +var sizesDiffer = require(144 ); // 144 = sizesDiffer +var verifyPropTypes = require(202 ); // 202 = verifyPropTypes +var warning = require(40 ); // 40 = fbjs/lib/warning + +function requireNativeComponent(viewName, componentInterface, extraConfig) { + var viewConfig = UIManager[viewName]; + if (!viewConfig || !viewConfig.NativeProps) { + warning(false, 'Native component for "%s" does not exist', viewName); + return UnimplementedView; + } + + viewConfig.uiViewClassName = viewName; + viewConfig.validAttributes = {}; + viewConfig.propTypes = componentInterface && componentInterface.propTypes; + + var nativeProps = babelHelpers.extends({}, UIManager.RCTView.NativeProps, viewConfig.NativeProps); + for (var key in nativeProps) { + var useAttribute = false; + var attribute = {}; + + var differ = TypeToDifferMap[nativeProps[key]]; + if (differ) { + attribute.diff = differ; + useAttribute = true; + } + + var processor = TypeToProcessorMap[nativeProps[key]]; + if (processor) { + attribute.process = processor; + useAttribute = true; + } + + viewConfig.validAttributes[key] = useAttribute ? attribute : true; + } + + viewConfig.validAttributes.style = ReactNativeStyleAttributes; + + if (__DEV__) { + componentInterface && verifyPropTypes(componentInterface, viewConfig, extraConfig && extraConfig.nativeOnly); + } + + return createReactNativeComponentClass(viewConfig); +} + +var TypeToDifferMap = { + CATransform3D: matricesDiffer, + CGPoint: pointsDiffer, + CGSize: sizesDiffer, + UIEdgeInsets: insetsDiffer +}; + +function processColorArray(colors) { + return colors && colors.map(processColor); +} + +var TypeToProcessorMap = { + CGColor: processColor, + CGColorArray: processColorArray, + UIColor: processColor, + UIColorArray: processColorArray, + CGImage: resolveAssetSource, + UIImage: resolveAssetSource, + RCTImageSource: resolveAssetSource, + + Color: processColor, + ColorArray: processColorArray +}; + +module.exports = requireNativeComponent; +}, 155, null, "requireNativeComponent"); +__d(/* UnimplementedView */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js'; +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet + +var UnimplementedView = function (_React$Component) { + babelHelpers.inherits(UnimplementedView, _React$Component); + + function UnimplementedView() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, UnimplementedView); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = UnimplementedView.__proto__ || Object.getPrototypeOf(UnimplementedView)).call.apply(_ref, [this].concat(args))), _this), _this.setNativeProps = function () {}, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(UnimplementedView, [{ + key: 'render', + value: function render() { + var View = require(146 ); // 146 = View + return React.createElement( + View, + { style: [styles.unimplementedView, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 24 + } + }, + this.props.children + ); + } + }]); + return UnimplementedView; +}(React.Component); + +var styles = StyleSheet.create({ + unimplementedView: { + borderWidth: 1, + borderColor: 'red', + alignSelf: 'flex-start' + } +}); + +module.exports = UnimplementedView; +}, 156, null, "UnimplementedView"); +__d(/* createReactNativeComponentClass */function(global, require, module, exports) { + +'use strict'; + +var ReactNativeBaseComponent = require(158 ); // 158 = ReactNativeBaseComponent + +var createReactNativeComponentClass = function createReactNativeComponentClass(viewConfig) { + var Constructor = function Constructor(element) { + this._currentElement = element; + this._topLevelWrapper = null; + this._hostParent = null; + this._hostContainerInfo = null; + this._rootNodeID = 0; + this._renderedChildren = null; + }; + Constructor.displayName = viewConfig.uiViewClassName; + Constructor.viewConfig = viewConfig; + Constructor.propTypes = viewConfig.propTypes; + Constructor.prototype = new ReactNativeBaseComponent(viewConfig); + Constructor.prototype.constructor = Constructor; + + return Constructor; +}; + +module.exports = createReactNativeComponentClass; +}, 157, null, "createReactNativeComponentClass"); +__d(/* ReactNativeBaseComponent */function(global, require, module, exports) { +'use strict'; + +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var ReactNativeAttributePayload = require(74 ); // 74 = ReactNativeAttributePayload +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var ReactNativeEventEmitter = require(160 ); // 160 = ReactNativeEventEmitter +var ReactNativeTagHandles = require(168 ); // 168 = ReactNativeTagHandles +var ReactMultiChild = require(178 ); // 178 = ReactMultiChild +var UIManager = require(123 ); // 123 = UIManager + +var deepFreezeAndThrowOnMutationInDev = require(96 ); // 96 = deepFreezeAndThrowOnMutationInDev + +var registrationNames = ReactNativeEventEmitter.registrationNames; +var putListener = ReactNativeEventEmitter.putListener; +var deleteListener = ReactNativeEventEmitter.deleteListener; +var deleteAllListeners = ReactNativeEventEmitter.deleteAllListeners; + +var ReactNativeBaseComponent = function ReactNativeBaseComponent(viewConfig) { + this.viewConfig = viewConfig; +}; + +ReactNativeBaseComponent.Mixin = { + getPublicInstance: function getPublicInstance() { + return this; + }, + + unmountComponent: function unmountComponent() { + ReactNativeComponentTree.uncacheNode(this); + deleteAllListeners(this); + this.unmountChildren(); + this._rootNodeID = 0; + }, + + initializeChildren: function initializeChildren(children, containerTag, transaction, context) { + var mountImages = this.mountChildren(children, transaction, context); + + if (mountImages.length) { + var createdTags = []; + for (var i = 0, l = mountImages.length; i < l; i++) { + var mountImage = mountImages[i]; + var childTag = mountImage; + createdTags[i] = childTag; + } + UIManager.setChildren(containerTag, createdTags); + } + }, + + receiveComponent: function receiveComponent(nextElement, transaction, context) { + var prevElement = this._currentElement; + this._currentElement = nextElement; + + if (__DEV__) { + for (var key in this.viewConfig.validAttributes) { + if (nextElement.props.hasOwnProperty(key)) { + deepFreezeAndThrowOnMutationInDev(nextElement.props[key]); + } + } + } + + var updatePayload = ReactNativeAttributePayload.diff(prevElement.props, nextElement.props, this.viewConfig.validAttributes); + + if (updatePayload) { + UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload); + } + + this._reconcileListenersUponUpdate(prevElement.props, nextElement.props); + this.updateChildren(nextElement.props.children, transaction, context); + }, + + _registerListenersUponCreation: function _registerListenersUponCreation(initialProps) { + for (var key in initialProps) { + if (registrationNames[key] && initialProps[key]) { + var listener = initialProps[key]; + putListener(this, key, listener); + } + } + }, + + _reconcileListenersUponUpdate: function _reconcileListenersUponUpdate(prevProps, nextProps) { + for (var key in nextProps) { + if (registrationNames[key] && nextProps[key] !== prevProps[key]) { + if (nextProps[key]) { + putListener(this, key, nextProps[key]); + } else { + deleteListener(this, key); + } + } + } + }, + + getHostNode: function getHostNode() { + return this._rootNodeID; + }, + + mountComponent: function mountComponent(transaction, hostParent, hostContainerInfo, context) { + var tag = ReactNativeTagHandles.allocateTag(); + + this._rootNodeID = tag; + this._hostParent = hostParent; + this._hostContainerInfo = hostContainerInfo; + + if (__DEV__) { + for (var key in this.viewConfig.validAttributes) { + if (this._currentElement.props.hasOwnProperty(key)) { + deepFreezeAndThrowOnMutationInDev(this._currentElement.props[key]); + } + } + } + + var updatePayload = ReactNativeAttributePayload.create(this._currentElement.props, this.viewConfig.validAttributes); + + var nativeTopRootTag = hostContainerInfo._tag; + UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload); + + ReactNativeComponentTree.precacheNode(this, tag); + + this._registerListenersUponCreation(this._currentElement.props); + this.initializeChildren(this._currentElement.props.children, tag, transaction, context); + return tag; + } +}; + +babelHelpers.extends(ReactNativeBaseComponent.prototype, ReactMultiChild, ReactNativeBaseComponent.Mixin, NativeMethodsMixin); + +module.exports = ReactNativeBaseComponent; +}, 158, null, "ReactNativeBaseComponent"); +__d(/* ReactNativeComponentTree */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var instanceCache = {}; + +function getRenderedHostOrTextFromComponent(component) { + var rendered; + while (rendered = component._renderedComponent) { + component = rendered; + } + return component; +} + +function precacheNode(inst, tag) { + var nativeInst = getRenderedHostOrTextFromComponent(inst); + instanceCache[tag] = nativeInst; +} + +function uncacheNode(inst) { + var tag = inst._rootNodeID; + if (tag) { + delete instanceCache[tag]; + } +} + +function getInstanceFromTag(tag) { + return instanceCache[tag] || null; +} + +function getTagFromInstance(inst) { + invariant(inst._rootNodeID, 'All native instances should have a tag.'); + return inst._rootNodeID; +} + +var ReactNativeComponentTree = { + getClosestInstanceFromNode: getInstanceFromTag, + getInstanceFromNode: getInstanceFromTag, + getNodeFromInstance: getTagFromInstance, + precacheNode: precacheNode, + uncacheNode: uncacheNode +}; + +module.exports = ReactNativeComponentTree; +}, 159, null, "ReactNativeComponentTree"); +__d(/* ReactNativeEventEmitter */function(global, require, module, exports) { +'use strict'; + +var EventPluginHub = require(161 ); // 161 = EventPluginHub +var EventPluginRegistry = require(162 ); // 162 = EventPluginRegistry +var ReactEventEmitterMixin = require(167 ); // 167 = ReactEventEmitterMixin +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var ReactNativeTagHandles = require(168 ); // 168 = ReactNativeTagHandles +var ReactUpdates = require(169 ); // 169 = ReactUpdates + +var warning = require(40 ); // 40 = fbjs/lib/warning + +var EMPTY_NATIVE_EVENT = {}; + +var touchSubsequence = function touchSubsequence(touches, indices) { + var ret = []; + for (var i = 0; i < indices.length; i++) { + ret.push(touches[indices[i]]); + } + return ret; +}; + +var removeTouchesAtIndices = function removeTouchesAtIndices(touches, indices) { + var rippedOut = []; + + var temp = touches; + for (var i = 0; i < indices.length; i++) { + var index = indices[i]; + rippedOut.push(touches[index]); + temp[index] = null; + } + var fillAt = 0; + for (var j = 0; j < temp.length; j++) { + var cur = temp[j]; + if (cur !== null) { + temp[fillAt++] = cur; + } + } + temp.length = fillAt; + return rippedOut; +}; + +var ReactNativeEventEmitter = babelHelpers.extends({}, ReactEventEmitterMixin, { + + registrationNames: EventPluginRegistry.registrationNameModules, + + putListener: EventPluginHub.putListener, + + getListener: EventPluginHub.getListener, + + deleteListener: EventPluginHub.deleteListener, + + deleteAllListeners: EventPluginHub.deleteAllListeners, + + _receiveRootNodeIDEvent: function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) { + var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT; + var inst = ReactNativeComponentTree.getInstanceFromNode(rootNodeID); + if (!inst) { + return; + } + ReactUpdates.batchedUpdates(function () { + ReactNativeEventEmitter.handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target); + }); + }, + + receiveEvent: function receiveEvent(tag, topLevelType, nativeEventParam) { + var rootNodeID = tag; + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + }, + + receiveTouches: function receiveTouches(eventTopLevelType, touches, changedIndices) { + var changedTouches = eventTopLevelType === 'topTouchEnd' || eventTopLevelType === 'topTouchCancel' ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices); + + for (var jj = 0; jj < changedTouches.length; jj++) { + var touch = changedTouches[jj]; + + touch.changedTouches = changedTouches; + touch.touches = touches; + var nativeEvent = touch; + var rootNodeID = null; + var target = nativeEvent.target; + if (target !== null && target !== undefined) { + if (target < ReactNativeTagHandles.tagsStartAt) { + if (__DEV__) { + warning(false, 'A view is reporting that a touch occured on tag zero.'); + } + } else { + rootNodeID = target; + } + } + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + } + } +}); + +module.exports = ReactNativeEventEmitter; +}, 160, null, "ReactNativeEventEmitter"); +__d(/* EventPluginHub */function(global, require, module, exports) { + +'use strict'; + +var EventPluginRegistry = require(162 ); // 162 = EventPluginRegistry +var EventPluginUtils = require(163 ); // 163 = EventPluginUtils +var ReactErrorUtils = require(164 ); // 164 = ReactErrorUtils + +var accumulateInto = require(165 ); // 165 = accumulateInto +var forEachAccumulated = require(166 ); // 166 = forEachAccumulated +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var listenerBank = {}; + +var eventQueue = null; + +var executeDispatchesAndRelease = function executeDispatchesAndRelease(event, simulated) { + if (event) { + EventPluginUtils.executeDispatchesInOrder(event, simulated); + + if (!event.isPersistent()) { + event.constructor.release(event); + } + } +}; +var executeDispatchesAndReleaseSimulated = function executeDispatchesAndReleaseSimulated(e) { + return executeDispatchesAndRelease(e, true); +}; +var executeDispatchesAndReleaseTopLevel = function executeDispatchesAndReleaseTopLevel(e) { + return executeDispatchesAndRelease(e, false); +}; + +var getDictionaryKey = function getDictionaryKey(inst) { + return '.' + inst._rootNodeID; +}; + +var EventPluginHub = { + injection: { + injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, + + injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName + + }, + + putListener: function putListener(inst, registrationName, listener) { + invariant(typeof listener === 'function', 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener); + + var key = getDictionaryKey(inst); + var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); + bankForRegistrationName[key] = listener; + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.didPutListener) { + PluginModule.didPutListener(inst, registrationName, listener); + } + }, + + getListener: function getListener(inst, registrationName) { + var bankForRegistrationName = listenerBank[registrationName]; + var key = getDictionaryKey(inst); + return bankForRegistrationName && bankForRegistrationName[key]; + }, + + deleteListener: function deleteListener(inst, registrationName) { + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(inst, registrationName); + } + + var bankForRegistrationName = listenerBank[registrationName]; + + if (bankForRegistrationName) { + var key = getDictionaryKey(inst); + delete bankForRegistrationName[key]; + } + }, + + deleteAllListeners: function deleteAllListeners(inst) { + var key = getDictionaryKey(inst); + for (var registrationName in listenerBank) { + if (!listenerBank.hasOwnProperty(registrationName)) { + continue; + } + + if (!listenerBank[registrationName][key]) { + continue; + } + + var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; + if (PluginModule && PluginModule.willDeleteListener) { + PluginModule.willDeleteListener(inst, registrationName); + } + + delete listenerBank[registrationName][key]; + } + }, + + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events; + var plugins = EventPluginRegistry.plugins; + for (var i = 0; i < plugins.length; i++) { + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + }, + + enqueueEvents: function enqueueEvents(events) { + if (events) { + eventQueue = accumulateInto(eventQueue, events); + } + }, + + processEventQueue: function processEventQueue(simulated) { + var processingEventQueue = eventQueue; + eventQueue = null; + if (simulated) { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); + } else { + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + } + invariant(!eventQueue, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.'); + + ReactErrorUtils.rethrowCaughtError(); + }, + + __purge: function __purge() { + listenerBank = {}; + }, + + __getListenerBank: function __getListenerBank() { + return listenerBank; + } + +}; + +module.exports = EventPluginHub; +}, 161, null, "EventPluginHub"); +__d(/* EventPluginRegistry */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var eventPluginOrder = null; + +var namesToPlugins = {}; + +function recomputePluginOrdering() { + if (!eventPluginOrder) { + return; + } + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + invariant(pluginIndex > -1, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName); + if (EventPluginRegistry.plugins[pluginIndex]) { + continue; + } + invariant(pluginModule.extractEvents, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName); + EventPluginRegistry.plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { + invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName); + } + } +} + +function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName); + EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; + + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + return false; +} + +function publishRegistrationName(registrationName, pluginModule, eventName) { + invariant(!EventPluginRegistry.registrationNameModules[registrationName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName); + EventPluginRegistry.registrationNameModules[registrationName] = pluginModule; + EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + + if (__DEV__) { + var lowerCasedName = registrationName.toLowerCase(); + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName; + } + } +} + +var EventPluginRegistry = { + plugins: [], + + eventNameDispatchConfigs: {}, + + registrationNameModules: {}, + + registrationNameDependencies: {}, + + possibleRegistrationNames: __DEV__ ? {} : null, + + injectEventPluginOrder: function injectEventPluginOrder(injectedEventPluginOrder) { + invariant(!eventPluginOrder, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.'); + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + }, + + injectEventPluginsByName: function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + invariant(!namesToPlugins[pluginName], 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName); + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + }, + + getPluginModuleForEvent: function getPluginModuleForEvent(event) { + var dispatchConfig = event.dispatchConfig; + if (dispatchConfig.registrationName) { + return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; + } + if (dispatchConfig.phasedRegistrationNames !== undefined) { + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + for (var phase in phasedRegistrationNames) { + if (!phasedRegistrationNames.hasOwnProperty(phase)) { + continue; + } + var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]]; + if (pluginModule) { + return pluginModule; + } + } + } + return null; + }, + + _resetEventPlugins: function _resetEventPlugins() { + eventPluginOrder = null; + for (var pluginName in namesToPlugins) { + if (namesToPlugins.hasOwnProperty(pluginName)) { + delete namesToPlugins[pluginName]; + } + } + EventPluginRegistry.plugins.length = 0; + + var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; + for (var eventName in eventNameDispatchConfigs) { + if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { + delete eventNameDispatchConfigs[eventName]; + } + } + + var registrationNameModules = EventPluginRegistry.registrationNameModules; + for (var registrationName in registrationNameModules) { + if (registrationNameModules.hasOwnProperty(registrationName)) { + delete registrationNameModules[registrationName]; + } + } + + if (__DEV__) { + var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames; + for (var lowerCasedName in possibleRegistrationNames) { + if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) { + delete possibleRegistrationNames[lowerCasedName]; + } + } + } + } + +}; + +module.exports = EventPluginRegistry; +}, 162, null, "EventPluginRegistry"); +__d(/* EventPluginUtils */function(global, require, module, exports) { + +'use strict'; + +var ReactErrorUtils = require(164 ); // 164 = ReactErrorUtils + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ComponentTree; +var TreeTraversal; +var injection = { + injectComponentTree: function injectComponentTree(Injected) { + ComponentTree = Injected; + if (__DEV__) { + warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); + } + }, + injectTreeTraversal: function injectTreeTraversal(Injected) { + TreeTraversal = Injected; + if (__DEV__) { + warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.'); + } + } +}; + +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 (__DEV__) { + validateEventDispatches = function validateEventDispatches(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; + + warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.'); + }; +} + +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; +} + +function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (__DEV__) { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + + executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, simulated, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; +} + +function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + if (__DEV__) { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + + if (dispatchListeners[i](event, dispatchInstances[i])) { + return dispatchInstances[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchInstances)) { + return dispatchInstances; + } + } + return null; +} + +function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchInstances = null; + event._dispatchListeners = null; + return ret; +} + +function executeDirectDispatch(event) { + if (__DEV__) { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchInstance = event._dispatchInstances; + invariant(!Array.isArray(dispatchListener), 'executeDirectDispatch(...): Invalid `event`.'); + event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return res; +} + +function hasDispatches(event) { + return !!event._dispatchListeners; +} + +var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + + getInstanceFromNode: function getInstanceFromNode(node) { + return ComponentTree.getInstanceFromNode(node); + }, + getNodeFromInstance: function getNodeFromInstance(node) { + return ComponentTree.getNodeFromInstance(node); + }, + isAncestor: function isAncestor(a, b) { + return TreeTraversal.isAncestor(a, b); + }, + getLowestCommonAncestor: function getLowestCommonAncestor(a, b) { + return TreeTraversal.getLowestCommonAncestor(a, b); + }, + getParentInstance: function getParentInstance(inst) { + return TreeTraversal.getParentInstance(inst); + }, + traverseTwoPhase: function traverseTwoPhase(target, fn, arg) { + return TreeTraversal.traverseTwoPhase(target, fn, arg); + }, + traverseEnterLeave: function traverseEnterLeave(from, to, fn, argFrom, argTo) { + return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); + }, + + injection: injection +}; + +module.exports = EventPluginUtils; +}, 163, null, "EventPluginUtils"); +__d(/* ReactErrorUtils */function(global, require, module, exports) { + +'use strict'; + +var caughtError = null; + +function invokeGuardedCallback(name, func, a) { + try { + func(a); + } catch (x) { + if (caughtError === null) { + caughtError = x; + } + } +} + +var ReactErrorUtils = { + invokeGuardedCallback: invokeGuardedCallback, + + invokeGuardedCallbackWithCatch: invokeGuardedCallback, + + rethrowCaughtError: function rethrowCaughtError() { + if (caughtError) { + var error = caughtError; + caughtError = null; + throw error; + } + } +}; + +if (__DEV__) { + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + ReactErrorUtils.invokeGuardedCallback = function (name, func, a) { + var boundFunc = func.bind(null, a); + var evtType = 'react-' + name; + fakeNode.addEventListener(evtType, boundFunc, false); + var evt = document.createEvent('Event'); + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + fakeNode.removeEventListener(evtType, boundFunc, false); + }; + } +} + +module.exports = ReactErrorUtils; +}, 164, null, "ReactErrorUtils"); +__d(/* accumulateInto */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function accumulateInto(current, next) { + invariant(next != null, 'accumulateInto(...): Accumulated items must not be null or undefined.'); + + if (current == null) { + return next; + } + + if (Array.isArray(current)) { + if (Array.isArray(next)) { + current.push.apply(current, next); + return current; + } + current.push(next); + return current; + } + + if (Array.isArray(next)) { + return [current].concat(next); + } + + return [current, next]; +} + +module.exports = accumulateInto; +}, 165, null, "accumulateInto"); +__d(/* forEachAccumulated */function(global, require, module, exports) { + +'use strict'; + +function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } +} + +module.exports = forEachAccumulated; +}, 166, null, "forEachAccumulated"); +__d(/* ReactEventEmitterMixin */function(global, require, module, exports) { + +'use strict'; + +var EventPluginHub = require(161 ); // 161 = EventPluginHub + +function runEventQueueInBatch(events) { + EventPluginHub.enqueueEvents(events); + EventPluginHub.processEventQueue(false); +} + +var ReactEventEmitterMixin = { + handleTopLevel: function handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventQueueInBatch(events); + } +}; + +module.exports = ReactEventEmitterMixin; +}, 167, null, "ReactEventEmitterMixin"); +__d(/* ReactNativeTagHandles */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var INITIAL_TAG_COUNT = 1; +var ReactNativeTagHandles = { + tagsStartAt: INITIAL_TAG_COUNT, + tagCount: INITIAL_TAG_COUNT, + + allocateTag: function allocateTag() { + while (this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)) { + ReactNativeTagHandles.tagCount++; + } + var tag = ReactNativeTagHandles.tagCount; + ReactNativeTagHandles.tagCount++; + return tag; + }, + + assertRootTag: function assertRootTag(tag) { + invariant(this.reactTagIsNativeTopRootID(tag), 'Expect a native root tag, instead got %s', tag); + }, + + reactTagIsNativeTopRootID: function reactTagIsNativeTopRootID(reactTag) { + return reactTag % 10 === 1; + } +}; + +module.exports = ReactNativeTagHandles; +}, 168, null, "ReactNativeTagHandles"); +__d(/* ReactUpdates */function(global, require, module, exports) { + +'use strict'; + +var CallbackQueue = require(170 ); // 170 = CallbackQueue +var PooledClass = require(171 ); // 171 = PooledClass +var ReactFeatureFlags = require(172 ); // 172 = ReactFeatureFlags +var ReactReconciler = require(173 ); // 173 = ReactReconciler +var Transaction = require(177 ); // 177 = Transaction + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var dirtyComponents = []; +var updateBatchNumber = 0; +var asapCallbackQueue = CallbackQueue.getPooled(); +var asapEnqueued = false; + +var batchingStrategy = null; + +function ensureInjected() { + invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy'); +} + +var NESTED_UPDATES = { + initialize: function initialize() { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function close() { + if (this.dirtyComponentsLength !== dirtyComponents.length) { + dirtyComponents.splice(0, this.dirtyComponentsLength); + flushBatchedUpdates(); + } else { + dirtyComponents.length = 0; + } + } +}; + +var UPDATE_QUEUEING = { + initialize: function initialize() { + this.callbackQueue.reset(); + }, + close: function close() { + 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(true); +} + +babelHelpers.extends(ReactUpdatesFlushTransaction.prototype, Transaction, { + getTransactionWrappers: function getTransactionWrappers() { + return TRANSACTION_WRAPPERS; + }, + + destructor: function destructor() { + this.dirtyComponentsLength = null; + CallbackQueue.release(this.callbackQueue); + this.callbackQueue = null; + ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); + this.reconcileTransaction = null; + }, + + perform: function perform(method, scope, a) { + 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); +} + +function mountOrderComparator(c1, c2) { + return c1._mountOrder - c2._mountOrder; +} + +function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + invariant(len === dirtyComponents.length, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length); + + dirtyComponents.sort(mountOrderComparator); + + updateBatchNumber++; + + for (var i = 0; i < len; i++) { + var component = dirtyComponents[i]; + + var callbacks = component._pendingCallbacks; + component._pendingCallbacks = null; + + var markerName; + if (ReactFeatureFlags.logTopLevelRenders) { + var namedComponent = component; + + 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 flushBatchedUpdates() { + 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); + } + } +}; + +function enqueueUpdate(component) { + ensureInjected(); + + if (!batchingStrategy.isBatchingUpdates) { + batchingStrategy.batchedUpdates(enqueueUpdate, component); + return; + } + + dirtyComponents.push(component); + if (component._updateBatchNumber == null) { + component._updateBatchNumber = updateBatchNumber + 1; + } +} + +function asap(callback, context) { + invariant(batchingStrategy.isBatchingUpdates, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.'); + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; +} + +var ReactUpdatesInjection = { + injectReconcileTransaction: function injectReconcileTransaction(ReconcileTransaction) { + invariant(ReconcileTransaction, 'ReactUpdates: must provide a reconcile transaction class'); + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; + }, + + injectBatchingStrategy: function injectBatchingStrategy(_batchingStrategy) { + invariant(_batchingStrategy, 'ReactUpdates: must provide a batching strategy'); + invariant(typeof _batchingStrategy.batchedUpdates === 'function', 'ReactUpdates: must provide a batchedUpdates() function'); + invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean', 'ReactUpdates: must provide an isBatchingUpdates boolean attribute'); + batchingStrategy = _batchingStrategy; + }, + + getBatchingStrategy: function getBatchingStrategy() { + return batchingStrategy; + } +}; + +var ReactUpdates = { + ReactReconcileTransaction: null, + + batchedUpdates: batchedUpdates, + enqueueUpdate: enqueueUpdate, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection, + asap: asap +}; + +module.exports = ReactUpdates; +}, 169, null, "ReactUpdates"); +__d(/* CallbackQueue */function(global, require, module, exports) { + +'use strict'; + +var PooledClass = require(171 ); // 171 = PooledClass + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var CallbackQueue = function () { + function CallbackQueue(arg) { + babelHelpers.classCallCheck(this, CallbackQueue); + + this._callbacks = null; + this._contexts = null; + this._arg = arg; + } + + babelHelpers.createClass(CallbackQueue, [{ + key: 'enqueue', + value: function enqueue(callback, context) { + this._callbacks = this._callbacks || []; + this._callbacks.push(callback); + this._contexts = this._contexts || []; + this._contexts.push(context); + } + }, { + key: 'notifyAll', + value: function notifyAll() { + var callbacks = this._callbacks; + var contexts = this._contexts; + var arg = this._arg; + if (callbacks && contexts) { + invariant(callbacks.length === contexts.length, 'Mismatched list of contexts in callback queue'); + 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; + } + } + }, { + key: 'checkpoint', + value: function checkpoint() { + return this._callbacks ? this._callbacks.length : 0; + } + }, { + key: 'rollback', + value: function rollback(len) { + if (this._callbacks && this._contexts) { + this._callbacks.length = len; + this._contexts.length = len; + } + } + }, { + key: 'reset', + value: function reset() { + this._callbacks = null; + this._contexts = null; + } + }, { + key: 'destructor', + value: function destructor() { + this.reset(); + } + }]); + return CallbackQueue; +}(); + +module.exports = PooledClass.addPoolingTo(CallbackQueue); +}, 170, null, "CallbackQueue"); +__d(/* PooledClass */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var oneArgumentPooler = function oneArgumentPooler(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } +}; + +var twoArgumentPooler = function twoArgumentPooler(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } +}; + +var threeArgumentPooler = function threeArgumentPooler(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } +}; + +var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4); + return instance; + } else { + return new Klass(a1, a2, a3, a4); + } +}; + +var fiveArgumentPooler = function fiveArgumentPooler(a1, a2, a3, a4, a5) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4, a5); + return instance; + } else { + return new Klass(a1, a2, a3, a4, a5); + } +}; + +var standardReleaser = function standardReleaser(instance) { + var Klass = this; + invariant(instance instanceof Klass, 'Trying to release an instance into a pool of a different type.'); + instance.destructor(); + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } +}; + +var DEFAULT_POOL_SIZE = 10; +var DEFAULT_POOLER = oneArgumentPooler; + +var addPoolingTo = function addPoolingTo(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; +}; + +var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler, + fiveArgumentPooler: fiveArgumentPooler +}; + +module.exports = PooledClass; +}, 171, null, "PooledClass"); +__d(/* ReactFeatureFlags */function(global, require, module, exports) { + +'use strict'; + +var ReactFeatureFlags = { + logTopLevelRenders: false +}; + +module.exports = ReactFeatureFlags; +}, 172, null, "ReactFeatureFlags"); +__d(/* ReactReconciler */function(global, require, module, exports) { + +'use strict'; + +var ReactRef = require(174 ); // 174 = ReactRef +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation + +var warning = require(40 ); // 40 = fbjs/lib/warning + +function attachRefs(transaction) { + ReactRef.attachRefs(this, this._currentElement, transaction); +} + +var ReactReconciler = { + mountComponent: function mountComponent(internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) { + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); + } + } + var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); + if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { + transaction.getReactMountReady().enqueue(attachRefs, internalInstance); + } + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID); + } + } + return markup; + }, + + getHostNode: function getHostNode(internalInstance) { + return internalInstance.getHostNode(); + }, + + unmountComponent: function unmountComponent(internalInstance, safely) { + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID); + } + } + ReactRef.detachRefs(internalInstance, internalInstance._currentElement); + internalInstance.unmountComponent(safely); + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); + } + } + }, + + receiveComponent: function receiveComponent(internalInstance, nextElement, transaction, context) { + var prevElement = internalInstance._currentElement; + + if (nextElement === prevElement && context === internalInstance._context) { + return; + } + + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); + } + } + + var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); + + if (refsChanged) { + ReactRef.detachRefs(internalInstance, prevElement); + } + + internalInstance.receiveComponent(nextElement, transaction, context); + + if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { + transaction.getReactMountReady().enqueue(attachRefs, internalInstance); + } + + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } + } + }, + + performUpdateIfNecessary: function performUpdateIfNecessary(internalInstance, transaction, updateBatchNumber) { + if (internalInstance._updateBatchNumber !== updateBatchNumber) { + warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber); + return; + } + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement); + } + } + internalInstance.performUpdateIfNecessary(transaction); + if (__DEV__) { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } + } + } + +}; + +module.exports = ReactReconciler; +}, 173, null, "ReactReconciler"); +__d(/* ReactRef */function(global, require, module, exports) { + +'use strict'; + +var ReactOwner = require(175 ); // 175 = ReactOwner + +var ReactRef = {}; + +function attachRef(ref, component, owner, transaction) { + if (typeof ref === 'function') { + ref(component.getPublicInstance(transaction)); + } else { + ReactOwner.addComponentAsRefTo(component, ref, owner, transaction); + } +} + +function detachRef(ref, component, owner) { + if (typeof ref === 'function') { + ref(null); + } else { + ReactOwner.removeComponentAsRefFrom(component, ref, owner); + } +} + +ReactRef.attachRefs = function (instance, element, transaction) { + if (element === null || typeof element !== 'object') { + return; + } + var ref = element.ref; + if (ref != null) { + attachRef(ref, instance, element._owner, transaction); + } +}; + +ReactRef.shouldUpdateRefs = function (prevElement, nextElement) { + + var prevRef = null; + var prevOwner = null; + if (prevElement !== null && typeof prevElement === 'object') { + prevRef = prevElement.ref; + prevOwner = prevElement._owner; + } + + var nextRef = null; + var nextOwner = null; + if (nextElement !== null && typeof nextElement === 'object') { + nextRef = nextElement.ref; + nextOwner = nextElement._owner; + } + + return prevRef !== nextRef || typeof nextRef === 'string' && nextOwner !== prevOwner; +}; + +ReactRef.detachRefs = function (instance, element) { + if (element === null || typeof element !== 'object') { + return; + } + var ref = element.ref; + if (ref != null) { + detachRef(ref, instance, element._owner); + } +}; + +module.exports = ReactRef; +}, 174, null, "ReactRef"); +__d(/* ReactOwner */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function isValidOwner(object) { + return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); +} + +var ReactOwner = { + addComponentAsRefTo: function addComponentAsRefTo(component, ref, owner, transaction) { + invariant(isValidOwner(owner), 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).'); + owner.attachRef(ref, component, transaction); + }, + + removeComponentAsRefFrom: function removeComponentAsRefFrom(component, ref, owner) { + invariant(isValidOwner(owner), 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).'); + var ownerPublicInstance = owner.getPublicInstance(); + + if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) { + owner.detachRef(ref); + } + } + +}; + +module.exports = ReactOwner; +}, 175, null, "ReactOwner"); +__d(/* ReactInstrumentation */function(global, require, module, exports) { + +'use strict'; + +var debugTool = null; + +if (__DEV__) { + var ReactDebugTool = require(86 ); // 86 = ReactDebugTool + debugTool = ReactDebugTool; +} + +module.exports = { debugTool: debugTool }; +}, 176, null, "ReactInstrumentation"); +__d(/* Transaction */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var OBSERVED_ERROR = {}; + +var TransactionImpl = { + reinitializeTransaction: function reinitializeTransaction() { + this.transactionWrappers = this.getTransactionWrappers(); + if (this.wrapperInitData) { + this.wrapperInitData.length = 0; + } else { + this.wrapperInitData = []; + } + this._isInTransaction = false; + }, + + _isInTransaction: false, + + getTransactionWrappers: null, + + isInTransaction: function isInTransaction() { + return !!this._isInTransaction; + }, + + perform: function perform(method, scope, a, b, c, d, e, f) { + invariant(!this.isInTransaction(), 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.'); + var errorThrown; + var ret; + try { + this._isInTransaction = true; + + errorThrown = true; + this.initializeAll(0); + ret = method.call(scope, a, b, c, d, e, f); + errorThrown = false; + } finally { + try { + if (errorThrown) { + try { + this.closeAll(0); + } catch (err) {} + } else { + this.closeAll(0); + } + } finally { + this._isInTransaction = false; + } + } + return ret; + }, + + initializeAll: function initializeAll(startIndex) { + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + try { + this.wrapperInitData[i] = OBSERVED_ERROR; + this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; + } finally { + if (this.wrapperInitData[i] === OBSERVED_ERROR) { + try { + this.initializeAll(i + 1); + } catch (err) {} + } + } + } + }, + + closeAll: function closeAll(startIndex) { + invariant(this.isInTransaction(), 'Transaction.closeAll(): Cannot close transaction when none are open.'); + var transactionWrappers = this.transactionWrappers; + for (var i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + var initData = this.wrapperInitData[i]; + var errorThrown; + try { + errorThrown = true; + if (initData !== OBSERVED_ERROR && wrapper.close) { + wrapper.close.call(this, initData); + } + errorThrown = false; + } finally { + if (errorThrown) { + try { + this.closeAll(i + 1); + } catch (e) {} + } + } + } + this.wrapperInitData.length = 0; + } +}; + +module.exports = TransactionImpl; +}, 177, null, "Transaction"); +__d(/* ReactMultiChild */function(global, require, module, exports) { + +'use strict'; + +var ReactComponentEnvironment = require(179 ); // 179 = ReactComponentEnvironment +var ReactInstanceMap = require(125 ); // 125 = ReactInstanceMap +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation + +var ReactCurrentOwner = require(49 ); // 49 = react/lib/ReactCurrentOwner +var ReactReconciler = require(173 ); // 173 = ReactReconciler +var ReactChildReconciler = require(180 ); // 180 = ReactChildReconciler + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var flattenChildren = require(195 ); // 195 = flattenChildren +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function makeInsertMarkup(markup, afterNode, toIndex) { + return { + type: 'INSERT_MARKUP', + content: markup, + fromIndex: null, + fromNode: null, + toIndex: toIndex, + afterNode: afterNode + }; +} + +function makeMove(child, afterNode, toIndex) { + return { + type: 'MOVE_EXISTING', + content: null, + fromIndex: child._mountIndex, + fromNode: ReactReconciler.getHostNode(child), + toIndex: toIndex, + afterNode: afterNode + }; +} + +function makeRemove(child, node) { + return { + type: 'REMOVE_NODE', + content: null, + fromIndex: child._mountIndex, + fromNode: node, + toIndex: null, + afterNode: null + }; +} + +function makeSetMarkup(markup) { + return { + type: 'SET_MARKUP', + content: markup, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; +} + +function makeTextContent(textContent) { + return { + type: 'TEXT_CONTENT', + content: textContent, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; +} + +function enqueue(queue, update) { + if (update) { + queue = queue || []; + queue.push(update); + } + return queue; +} + +function processQueue(inst, updateQueue) { + ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue); +} + +var setChildrenForInstrumentation = emptyFunction; +if (__DEV__) { + var getDebugID = function getDebugID(inst) { + if (!inst._debugID) { + var internal; + if (internal = ReactInstanceMap.get(inst)) { + inst = internal; + } + } + return inst._debugID; + }; + setChildrenForInstrumentation = function setChildrenForInstrumentation(children) { + var debugID = getDebugID(this); + + if (debugID !== 0) { + ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) { + return children[key]._debugID; + }) : []); + } + }; +} + +var ReactMultiChild = { + _reconcilerInstantiateChildren: function _reconcilerInstantiateChildren(nestedChildren, transaction, context) { + if (__DEV__) { + var selfDebugID = getDebugID(this); + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID); + } finally { + ReactCurrentOwner.current = null; + } + } + } + return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context); + }, + + _reconcilerUpdateChildren: function _reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { + var nextChildren; + var selfDebugID = 0; + if (__DEV__) { + selfDebugID = getDebugID(this); + if (this._currentElement) { + try { + ReactCurrentOwner.current = this._currentElement._owner; + nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); + } finally { + ReactCurrentOwner.current = null; + } + ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); + return nextChildren; + } + } + nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); + ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); + return nextChildren; + }, + + mountChildren: function mountChildren(nestedChildren, transaction, context) { + var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); + this._renderedChildren = children; + + var mountImages = []; + var index = 0; + for (var name in children) { + if (children.hasOwnProperty(name)) { + var child = children[name]; + var selfDebugID = 0; + if (__DEV__) { + selfDebugID = getDebugID(this); + } + var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID); + child._mountIndex = index++; + mountImages.push(mountImage); + } + } + + if (__DEV__) { + setChildrenForInstrumentation.call(this, children); + } + + return mountImages; + }, + + updateTextContent: function updateTextContent(nextContent) { + var prevChildren = this._renderedChildren; + + ReactChildReconciler.unmountChildren(prevChildren, false); + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + invariant(false, 'updateTextContent called on non-empty component.'); + } + } + + var updates = [makeTextContent(nextContent)]; + processQueue(this, updates); + }, + + updateMarkup: function updateMarkup(nextMarkup) { + var prevChildren = this._renderedChildren; + + ReactChildReconciler.unmountChildren(prevChildren, false); + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + invariant(false, 'updateTextContent called on non-empty component.'); + } + } + var updates = [makeSetMarkup(nextMarkup)]; + processQueue(this, updates); + }, + + updateChildren: function updateChildren(nextNestedChildrenElements, transaction, context) { + this._updateChildren(nextNestedChildrenElements, transaction, context); + }, + + _updateChildren: function _updateChildren(nextNestedChildrenElements, transaction, context) { + var prevChildren = this._renderedChildren; + var removedNodes = {}; + var mountImages = []; + var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context); + if (!nextChildren && !prevChildren) { + return; + } + var updates = null; + var name; + + var nextIndex = 0; + var lastIndex = 0; + + var nextMountIndex = 0; + var lastPlacedNode = null; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + var prevChild = prevChildren && prevChildren[name]; + var nextChild = nextChildren[name]; + if (prevChild === nextChild) { + updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)); + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + prevChild._mountIndex = nextIndex; + } else { + if (prevChild) { + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + } + + updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)); + nextMountIndex++; + } + nextIndex++; + lastPlacedNode = ReactReconciler.getHostNode(nextChild); + } + + for (name in removedNodes) { + if (removedNodes.hasOwnProperty(name)) { + updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name])); + } + } + if (updates) { + processQueue(this, updates); + } + this._renderedChildren = nextChildren; + + if (__DEV__) { + setChildrenForInstrumentation.call(this, nextChildren); + } + }, + + unmountChildren: function unmountChildren(safely) { + var renderedChildren = this._renderedChildren; + ReactChildReconciler.unmountChildren(renderedChildren, safely); + this._renderedChildren = null; + }, + + moveChild: function moveChild(child, afterNode, toIndex, lastIndex) { + if (child._mountIndex < lastIndex) { + return makeMove(child, afterNode, toIndex); + } + }, + + createChild: function createChild(child, afterNode, mountImage) { + return makeInsertMarkup(mountImage, afterNode, child._mountIndex); + }, + + removeChild: function removeChild(child, node) { + return makeRemove(child, node); + }, + + _mountChildAtIndex: function _mountChildAtIndex(child, mountImage, afterNode, index, transaction, context) { + child._mountIndex = index; + return this.createChild(child, afterNode, mountImage); + }, + + _unmountChild: function _unmountChild(child, node) { + var update = this.removeChild(child, node); + child._mountIndex = null; + return update; + } +}; + +module.exports = ReactMultiChild; +}, 178, null, "ReactMultiChild"); +__d(/* ReactComponentEnvironment */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var injected = false; + +var ReactComponentEnvironment = { + replaceNodeWithMarkup: null, + + processChildrenUpdates: null, + + injection: { + injectEnvironment: function injectEnvironment(environment) { + invariant(!injected, 'ReactCompositeComponent: injectEnvironment() can only be called once.'); + ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup; + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; + injected = true; + } + } + +}; + +module.exports = ReactComponentEnvironment; +}, 179, null, "ReactComponentEnvironment"); +__d(/* ReactChildReconciler */function(global, require, module, exports) { + +'use strict'; + +var ReactReconciler = require(173 ); // 173 = ReactReconciler + +var instantiateReactComponent = require(181 ); // 181 = instantiateReactComponent +var KeyEscapeUtils = require(191 ); // 191 = KeyEscapeUtils +var shouldUpdateReactComponent = require(188 ); // 188 = shouldUpdateReactComponent +var traverseAllChildren = require(192 ); // 192 = traverseAllChildren +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook +} + +function instantiateChild(childInstances, child, name, selfDebugID) { + var keyUnique = childInstances[name] === undefined; + if (__DEV__) { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook + } + if (!keyUnique) { + warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)); + } + } + if (child != null && keyUnique) { + childInstances[name] = instantiateReactComponent(child, true); + } +} + +var ReactChildReconciler = { + instantiateChildren: function instantiateChildren(nestedChildNodes, transaction, context, selfDebugID) { + if (nestedChildNodes == null) { + return null; + } + var childInstances = {}; + + if (__DEV__) { + traverseAllChildren(nestedChildNodes, function (childInsts, child, name) { + return instantiateChild(childInsts, child, name, selfDebugID); + }, childInstances); + } else { + traverseAllChildren(nestedChildNodes, instantiateChild, childInstances); + } + return childInstances; + }, + + updateChildren: function updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) { + if (!nextChildren && !prevChildren) { + return; + } + var name; + var prevChild; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + prevChild = prevChildren && prevChildren[name]; + var prevElement = prevChild && prevChild._currentElement; + var nextElement = nextChildren[name]; + if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) { + ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context); + nextChildren[name] = prevChild; + } else { + if (prevChild) { + removedNodes[name] = ReactReconciler.getHostNode(prevChild); + ReactReconciler.unmountComponent(prevChild, false); + } + + var nextChildInstance = instantiateReactComponent(nextElement, true); + nextChildren[name] = nextChildInstance; + + var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); + mountImages.push(nextChildMountImage); + } + } + + for (name in prevChildren) { + if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { + prevChild = prevChildren[name]; + removedNodes[name] = ReactReconciler.getHostNode(prevChild); + ReactReconciler.unmountComponent(prevChild, false); + } + } + }, + + unmountChildren: function unmountChildren(renderedChildren, safely) { + for (var name in renderedChildren) { + if (renderedChildren.hasOwnProperty(name)) { + var renderedChild = renderedChildren[name]; + ReactReconciler.unmountComponent(renderedChild, safely); + } + } + } + +}; + +module.exports = ReactChildReconciler; +}, 180, null, "ReactChildReconciler"); +__d(/* instantiateReactComponent */function(global, require, module, exports) { + +'use strict'; + +var ReactCompositeComponent = require(182 ); // 182 = ReactCompositeComponent +var ReactEmptyComponent = require(189 ); // 189 = ReactEmptyComponent +var ReactHostComponent = require(190 ); // 190 = ReactHostComponent + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactCompositeComponentWrapper = function ReactCompositeComponentWrapper(element) { + this.construct(element); +}; +babelHelpers.extends(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { + _instantiateReactComponent: instantiateReactComponent +}); + +function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +function isInternalComponentType(type) { + return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; +} + +var nextDebugID = 1; + +function instantiateReactComponent(node, shouldHaveDebugID) { + var instance; + + if (node === null || node === false) { + instance = ReactEmptyComponent.create(instantiateReactComponent); + } else if (typeof node === 'object') { + var element = node; + invariant(element && (typeof element.type === 'function' || typeof element.type === 'string'), 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)); + + if (typeof element.type === 'string') { + instance = ReactHostComponent.createInternalComponent(element); + } else if (isInternalComponentType(element.type)) { + instance = new element.type(element); + + if (!instance.getHostNode) { + instance.getHostNode = instance.getNativeNode; + } + } else { + instance = new ReactCompositeComponentWrapper(element); + } + } else if (typeof node === 'string' || typeof node === 'number') { + instance = ReactHostComponent.createInstanceForText(node); + } else { + invariant(false, 'Encountered invalid React node of type %s', typeof node); + } + + if (__DEV__) { + warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.'); + } + + instance._mountIndex = 0; + instance._mountImage = null; + + if (__DEV__) { + instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0; + } + + if (__DEV__) { + if (Object.preventExtensions) { + Object.preventExtensions(instance); + } + } + + return instance; +} + +module.exports = instantiateReactComponent; +}, 181, null, "instantiateReactComponent"); +__d(/* ReactCompositeComponent */function(global, require, module, exports) { + +'use strict'; + +var React = require(126 ); // 126 = React +var ReactComponentEnvironment = require(179 ); // 179 = ReactComponentEnvironment +var ReactCurrentOwner = require(49 ); // 49 = react/lib/ReactCurrentOwner +var ReactErrorUtils = require(164 ); // 164 = ReactErrorUtils +var ReactInstanceMap = require(125 ); // 125 = ReactInstanceMap +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation +var ReactNodeTypes = require(183 ); // 183 = ReactNodeTypes +var ReactReconciler = require(173 ); // 173 = ReactReconciler + +if (__DEV__) { + var checkReactTypeSpec = require(184 ); // 184 = checkReactTypeSpec +} + +var emptyObject = require(43 ); // 43 = fbjs/lib/emptyObject +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var shallowEqual = require(187 ); // 187 = fbjs/lib/shallowEqual +var shouldUpdateReactComponent = require(188 ); // 188 = shouldUpdateReactComponent +var warning = require(40 ); // 40 = fbjs/lib/warning + +var CompositeTypes = { + ImpureClass: 0, + PureClass: 1, + StatelessFunctional: 2 +}; + +function StatelessComponent(Component) {} +StatelessComponent.prototype.render = function () { + var Component = ReactInstanceMap.get(this)._currentElement.type; + var element = Component(this.props, this.context, this.updater); + warnIfInvalidElement(Component, element); + return element; +}; + +function warnIfInvalidElement(Component, element) { + if (__DEV__) { + warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component'); + warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component'); + } +} + +function shouldConstruct(Component) { + return !!(Component.prototype && Component.prototype.isReactComponent); +} + +function isPureComponent(Component) { + return !!(Component.prototype && Component.prototype.isPureReactComponent); +} + +function measureLifeCyclePerf(fn, debugID, timerType) { + if (debugID === 0) { + return fn(); + } + + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); + try { + return fn(); + } finally { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); + } +} + +var nextMountID = 1; + +var ReactCompositeComponent = { + construct: function construct(element) { + this._currentElement = element; + this._rootNodeID = 0; + this._compositeType = null; + this._instance = null; + this._hostParent = null; + this._hostContainerInfo = null; + + this._updateBatchNumber = null; + this._pendingElement = null; + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + this._renderedNodeType = null; + this._renderedComponent = null; + this._context = null; + this._mountOrder = 0; + this._topLevelWrapper = null; + + this._pendingCallbacks = null; + + this._calledComponentWillUnmount = false; + + if (__DEV__) { + this._warnedAboutRefsInRender = false; + } + }, + + mountComponent: function mountComponent(transaction, hostParent, hostContainerInfo, context) { + var _this = this; + + this._context = context; + this._mountOrder = nextMountID++; + this._hostParent = hostParent; + this._hostContainerInfo = hostContainerInfo; + + var publicProps = this._currentElement.props; + var publicContext = this._processContext(context); + + var Component = this._currentElement.type; + + var updateQueue = transaction.getUpdateQueue(); + + var doConstruct = shouldConstruct(Component); + var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); + var renderedElement; + + if (!doConstruct && (inst == null || inst.render == null)) { + renderedElement = inst; + warnIfInvalidElement(Component, renderedElement); + invariant(inst === null || inst === false || React.isValidElement(inst), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component'); + inst = new StatelessComponent(Component); + this._compositeType = CompositeTypes.StatelessFunctional; + } else { + if (isPureComponent(Component)) { + this._compositeType = CompositeTypes.PureClass; + } else { + this._compositeType = CompositeTypes.ImpureClass; + } + } + + if (__DEV__) { + if (inst.render == null) { + warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component'); + } + + var propsMutated = inst.props !== publicProps; + var componentName = Component.displayName || Component.name || 'Component'; + + warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName); + } + + inst.props = publicProps; + inst.context = publicContext; + inst.refs = emptyObject; + inst.updater = updateQueue; + + this._instance = inst; + + ReactInstanceMap.set(inst, this); + + if (__DEV__) { + warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component'); + warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component'); + warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component'); + warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component'); + warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component'); + warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component'); + warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component'); + } + + var initialState = inst.state; + if (initialState === undefined) { + inst.state = initialState = null; + } + invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent'); + + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + + var markup; + if (inst.unstable_handleError) { + markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context); + } else { + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } + + if (inst.componentDidMount) { + if (__DEV__) { + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(function () { + return inst.componentDidMount(); + }, _this._debugID, 'componentDidMount'); + }); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); + } + } + + return markup; + }, + + _constructComponent: function _constructComponent(doConstruct, publicProps, publicContext, updateQueue) { + if (__DEV__) { + ReactCurrentOwner.current = this; + try { + return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); + } finally { + ReactCurrentOwner.current = null; + } + } else { + return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); + } + }, + + _constructComponentWithoutOwner: function _constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue) { + var Component = this._currentElement.type; + + if (doConstruct) { + if (__DEV__) { + return measureLifeCyclePerf(function () { + return new Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'ctor'); + } else { + return new Component(publicProps, publicContext, updateQueue); + } + } + + if (__DEV__) { + return measureLifeCyclePerf(function () { + return Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'render'); + } else { + return Component(publicProps, publicContext, updateQueue); + } + }, + + performInitialMountWithErrorHandling: function performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) { + var markup; + var checkpoint = transaction.checkpoint(); + try { + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } catch (e) { + transaction.rollback(checkpoint); + this._instance.unstable_handleError(e); + if (this._pendingStateQueue) { + this._instance.state = this._processPendingState(this._instance.props, this._instance.context); + } + checkpoint = transaction.checkpoint(); + + this._renderedComponent.unmountComponent(true); + transaction.rollback(checkpoint); + + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } + return markup; + }, + + performInitialMount: function performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context) { + var inst = this._instance; + + var debugID = 0; + if (__DEV__) { + debugID = this._debugID; + } + + if (inst.componentWillMount) { + if (__DEV__) { + measureLifeCyclePerf(function () { + return inst.componentWillMount(); + }, debugID, 'componentWillMount'); + } else { + inst.componentWillMount(); + } + + if (this._pendingStateQueue) { + inst.state = this._processPendingState(inst.props, inst.context); + } + } + + if (renderedElement === undefined) { + renderedElement = this._renderValidatedComponent(); + } + + var nodeType = ReactNodeTypes.getType(renderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY); + this._renderedComponent = child; + + var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); + + if (__DEV__) { + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + } + } + + return markup; + }, + + getHostNode: function getHostNode() { + return ReactReconciler.getHostNode(this._renderedComponent); + }, + + unmountComponent: function unmountComponent(safely) { + if (!this._renderedComponent) { + return; + } + + var inst = this._instance; + + if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) { + inst._calledComponentWillUnmount = true; + + if (safely) { + var name = this.getName() + '.componentWillUnmount()'; + ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst)); + } else { + if (__DEV__) { + measureLifeCyclePerf(function () { + return inst.componentWillUnmount(); + }, this._debugID, 'componentWillUnmount'); + } else { + inst.componentWillUnmount(); + } + } + } + + if (this._renderedComponent) { + ReactReconciler.unmountComponent(this._renderedComponent, safely); + this._renderedNodeType = null; + this._renderedComponent = null; + this._instance = null; + } + + this._pendingStateQueue = null; + this._pendingReplaceState = false; + this._pendingForceUpdate = false; + this._pendingCallbacks = null; + this._pendingElement = null; + + this._context = null; + this._rootNodeID = 0; + this._topLevelWrapper = null; + + ReactInstanceMap.remove(inst); + }, + + _maskContext: function _maskContext(context) { + var Component = this._currentElement.type; + var contextTypes = Component.contextTypes; + if (!contextTypes) { + return emptyObject; + } + var maskedContext = {}; + for (var contextName in contextTypes) { + maskedContext[contextName] = context[contextName]; + } + return maskedContext; + }, + + _processContext: function _processContext(context) { + var maskedContext = this._maskContext(context); + if (__DEV__) { + var Component = this._currentElement.type; + if (Component.contextTypes) { + this._checkContextTypes(Component.contextTypes, maskedContext, 'context'); + } + } + return maskedContext; + }, + + _processChildContext: function _processChildContext(currentContext) { + var Component = this._currentElement.type; + var inst = this._instance; + var childContext; + + if (inst.getChildContext) { + if (__DEV__) { + ReactInstrumentation.debugTool.onBeginProcessingChildContext(); + try { + childContext = inst.getChildContext(); + } finally { + ReactInstrumentation.debugTool.onEndProcessingChildContext(); + } + } else { + childContext = inst.getChildContext(); + } + } + + if (childContext) { + invariant(typeof Component.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent'); + if (__DEV__) { + this._checkContextTypes(Component.childContextTypes, childContext, 'childContext'); + } + for (var name in childContext) { + invariant(name in Component.childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name); + } + return babelHelpers.extends({}, currentContext, childContext); + } + return currentContext; + }, + + _checkContextTypes: function _checkContextTypes(typeSpecs, values, location) { + if (__DEV__) { + checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID); + } + }, + + receiveComponent: function receiveComponent(nextElement, transaction, nextContext) { + var prevElement = this._currentElement; + var prevContext = this._context; + + this._pendingElement = null; + + this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); + }, + + performUpdateIfNecessary: function performUpdateIfNecessary(transaction) { + if (this._pendingElement != null) { + ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context); + } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) { + this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); + } else { + this._updateBatchNumber = null; + } + }, + + updateComponent: function updateComponent(transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { + var inst = this._instance; + invariant(inst != null, 'Attempted to update component `%s` that has already been unmounted ' + '(or failed to mount).', this.getName() || 'ReactCompositeComponent'); + + var willReceive = false; + var nextContext; + + if (this._context === nextUnmaskedContext) { + nextContext = inst.context; + } else { + nextContext = this._processContext(nextUnmaskedContext); + willReceive = true; + } + + var prevProps = prevParentElement.props; + var nextProps = nextParentElement.props; + + if (prevParentElement !== nextParentElement) { + willReceive = true; + } + + if (willReceive && inst.componentWillReceiveProps) { + if (__DEV__) { + measureLifeCyclePerf(function () { + return inst.componentWillReceiveProps(nextProps, nextContext); + }, this._debugID, 'componentWillReceiveProps'); + } else { + inst.componentWillReceiveProps(nextProps, nextContext); + } + } + + var nextState = this._processPendingState(nextProps, nextContext); + var shouldUpdate = true; + + if (!this._pendingForceUpdate) { + if (inst.shouldComponentUpdate) { + if (__DEV__) { + shouldUpdate = measureLifeCyclePerf(function () { + return inst.shouldComponentUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'shouldComponentUpdate'); + } else { + shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); + } + } else { + if (this._compositeType === CompositeTypes.PureClass) { + shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState); + } + } + } + + if (__DEV__) { + warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent'); + } + + this._updateBatchNumber = null; + if (shouldUpdate) { + this._pendingForceUpdate = false; + + this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext); + } else { + this._currentElement = nextParentElement; + this._context = nextUnmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + } + }, + + _processPendingState: function _processPendingState(props, context) { + var inst = this._instance; + var queue = this._pendingStateQueue; + var replace = this._pendingReplaceState; + this._pendingReplaceState = false; + this._pendingStateQueue = null; + + if (!queue) { + return inst.state; + } + + if (replace && queue.length === 1) { + return queue[0]; + } + + var nextState = babelHelpers.extends({}, replace ? queue[0] : inst.state); + for (var i = replace ? 1 : 0; i < queue.length; i++) { + var partial = queue[i]; + babelHelpers.extends(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial); + } + + return nextState; + }, + + _performComponentUpdate: function _performComponentUpdate(nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { + var _this2 = this; + + var inst = this._instance; + + var hasComponentDidUpdate = Boolean(inst.componentDidUpdate); + var prevProps; + var prevState; + var prevContext; + if (hasComponentDidUpdate) { + prevProps = inst.props; + prevState = inst.state; + prevContext = inst.context; + } + + if (inst.componentWillUpdate) { + if (__DEV__) { + measureLifeCyclePerf(function () { + return inst.componentWillUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'componentWillUpdate'); + } else { + inst.componentWillUpdate(nextProps, nextState, nextContext); + } + } + + this._currentElement = nextElement; + this._context = unmaskedContext; + inst.props = nextProps; + inst.state = nextState; + inst.context = nextContext; + + this._updateRenderedComponent(transaction, unmaskedContext); + + if (hasComponentDidUpdate) { + if (__DEV__) { + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate'); + }); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); + } + } + }, + + _updateRenderedComponent: function _updateRenderedComponent(transaction, context) { + var prevComponentInstance = this._renderedComponent; + var prevRenderedElement = prevComponentInstance._currentElement; + var nextRenderedElement = this._renderValidatedComponent(); + + var debugID = 0; + if (__DEV__) { + debugID = this._debugID; + } + + if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { + ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); + } else { + var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance); + ReactReconciler.unmountComponent(prevComponentInstance, false); + + var nodeType = ReactNodeTypes.getType(nextRenderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY); + this._renderedComponent = child; + + var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); + + if (__DEV__) { + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + } + } + + this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); + } + }, + + _replaceNodeWithMarkup: function _replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance) { + ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance); + }, + + _renderValidatedComponentWithoutOwnerOrContext: function _renderValidatedComponentWithoutOwnerOrContext() { + var inst = this._instance; + var renderedElement; + + if (__DEV__) { + renderedElement = measureLifeCyclePerf(function () { + return inst.render(); + }, this._debugID, 'render'); + } else { + renderedElement = inst.render(); + } + + if (__DEV__) { + if (renderedElement === undefined && inst.render._isMockFunction) { + renderedElement = null; + } + } + + return renderedElement; + }, + + _renderValidatedComponent: function _renderValidatedComponent() { + var renderedElement; + if (__DEV__ || this._compositeType !== CompositeTypes.StatelessFunctional) { + ReactCurrentOwner.current = this; + try { + renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + } finally { + ReactCurrentOwner.current = null; + } + } else { + renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + } + invariant(renderedElement === null || renderedElement === false || React.isValidElement(renderedElement), '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent'); + + return renderedElement; + }, + + attachRef: function attachRef(ref, component, transaction) { + var inst = this.getPublicInstance(); + invariant(inst != null, 'Stateless function components cannot have refs.'); + var publicComponentInstance = component.getPublicInstance(transaction); + if (__DEV__) { + var componentName = component && component.getName ? component.getName() : 'a component'; + warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()); + } + var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; + refs[ref] = publicComponentInstance; + }, + + detachRef: function detachRef(ref) { + var refs = this.getPublicInstance().refs; + delete refs[ref]; + }, + + getName: function getName() { + var type = this._currentElement.type; + var constructor = this._instance && this._instance.constructor; + return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; + }, + + getPublicInstance: function getPublicInstance() { + var inst = this._instance; + if (this._compositeType === CompositeTypes.StatelessFunctional) { + return null; + } + return inst; + }, + + _instantiateReactComponent: null + +}; + +module.exports = ReactCompositeComponent; +}, 182, null, "ReactCompositeComponent"); +__d(/* ReactNodeTypes */function(global, require, module, exports) { + +'use strict'; + +var React = require(126 ); // 126 = React + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var ReactNodeTypes = { + HOST: 0, + COMPOSITE: 1, + EMPTY: 2, + + getType: function getType(node) { + if (node === null || node === false) { + return ReactNodeTypes.EMPTY; + } else if (React.isValidElement(node)) { + if (typeof node.type === 'function') { + return ReactNodeTypes.COMPOSITE; + } else { + return ReactNodeTypes.HOST; + } + } + invariant(false, 'Unexpected node: %s', node); + } +}; + +module.exports = ReactNodeTypes; +}, 183, null, "ReactNodeTypes"); +__d(/* checkReactTypeSpec */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypeLocationNames = require(185 ); // 185 = ReactPropTypeLocationNames +var ReactPropTypesSecret = require(186 ); // 186 = ReactPropTypesSecret + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook +} + +var loggedTypeFailures = {}; + +function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + + try { + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + + var componentStackInfo = ''; + + if (__DEV__) { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook + } + if (debugID !== null) { + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); + } else if (element !== null) { + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); + } + } + + warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo); + } + } + } +} + +module.exports = checkReactTypeSpec; +}, 184, null, "checkReactTypeSpec"); +__d(/* ReactPropTypeLocationNames */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypeLocationNames = {}; + +if (__DEV__) { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} + +module.exports = ReactPropTypeLocationNames; +}, 185, null, "ReactPropTypeLocationNames"); +__d(/* ReactPropTypesSecret */function(global, require, module, exports) { + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; +}, 186, null, "ReactPropTypesSecret"); +__d(/* fbjs/lib/shallowEqual.js */function(global, require, module, exports) { + +'use strict'; + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } +} + +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) { + return false; + } + + for (var i = 0; i < keysA.length; i++) { + if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; +} + +module.exports = shallowEqual; +}, 187, null, "fbjs/lib/shallowEqual.js"); +__d(/* shouldUpdateReactComponent */function(global, require, module, exports) { + +'use strict'; + +function shouldUpdateReactComponent(prevElement, nextElement) { + var prevEmpty = prevElement === null || prevElement === false; + var nextEmpty = nextElement === null || nextElement === false; + if (prevEmpty || nextEmpty) { + return prevEmpty === nextEmpty; + } + + var prevType = typeof prevElement; + var nextType = typeof nextElement; + if (prevType === 'string' || prevType === 'number') { + return nextType === 'string' || nextType === 'number'; + } else { + return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key; + } +} + +module.exports = shouldUpdateReactComponent; +}, 188, null, "shouldUpdateReactComponent"); +__d(/* ReactEmptyComponent */function(global, require, module, exports) { + +'use strict'; + +var emptyComponentFactory; + +var ReactEmptyComponentInjection = { + injectEmptyComponentFactory: function injectEmptyComponentFactory(factory) { + emptyComponentFactory = factory; + } +}; + +var ReactEmptyComponent = { + create: function create(instantiate) { + return emptyComponentFactory(instantiate); + } +}; + +ReactEmptyComponent.injection = ReactEmptyComponentInjection; + +module.exports = ReactEmptyComponent; +}, 189, null, "ReactEmptyComponent"); +__d(/* ReactHostComponent */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var genericComponentClass = null; + +var tagToComponentClass = {}; +var textComponentClass = null; + +var ReactHostComponentInjection = { + injectGenericComponentClass: function injectGenericComponentClass(componentClass) { + genericComponentClass = componentClass; + }, + + injectTextComponentClass: function injectTextComponentClass(componentClass) { + textComponentClass = componentClass; + }, + + injectComponentClasses: function injectComponentClasses(componentClasses) { + babelHelpers.extends(tagToComponentClass, componentClasses); + } +}; + +function createInternalComponent(element) { + invariant(genericComponentClass, 'There is no registered component for the tag %s', element.type); + return new genericComponentClass(element); +} + +function createInstanceForText(text) { + return new textComponentClass(text); +} + +function isTextComponent(component) { + return component instanceof textComponentClass; +} + +var ReactHostComponent = { + createInternalComponent: createInternalComponent, + createInstanceForText: createInstanceForText, + isTextComponent: isTextComponent, + injection: ReactHostComponentInjection +}; + +module.exports = ReactHostComponent; +}, 190, null, "ReactHostComponent"); +__d(/* KeyEscapeUtils */function(global, require, module, exports) { + +'use strict'; + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +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; +}, 191, null, "KeyEscapeUtils"); +__d(/* traverseAllChildren */function(global, require, module, exports) { + +'use strict'; + +var ReactCurrentOwner = require(49 ); // 49 = react/lib/ReactCurrentOwner +var REACT_ELEMENT_TYPE = require(193 ); // 193 = ReactElementSymbol + +var getIteratorFn = require(194 ); // 194 = getIteratorFn +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var KeyEscapeUtils = require(191 ); // 191 = KeyEscapeUtils +var warning = require(40 ); // 40 = fbjs/lib/warning + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; + +var didWarnAboutMaps = false; + +function getComponentKey(component, index) { + if (component && typeof component === 'object' && component.key != null) { + return KeyEscapeUtils.escape(component.key); + } + + return index.toString(36); +} + +function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + children = null; + } + + if (children === null || type === 'string' || type === 'number' || type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { + callback(traverseContext, children, nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + 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); + } + } 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); + } + } else { + if (__DEV__) { + var mapsAsChildrenAddendum = ''; + if (ReactCurrentOwner.current) { + var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); + if (mapsAsChildrenOwnerName) { + mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; + } + } + 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); + didWarnAboutMaps = true; + } + + 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); + } + } + } + } else if (type === 'object') { + var addendum = ''; + if (__DEV__) { + 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 + '`.'; + } + } + } + var childrenString = String(children); + invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum); + } + } + + return subtreeCount; +} + +function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); +} + +module.exports = traverseAllChildren; +}, 192, null, "traverseAllChildren"); +__d(/* ReactElementSymbol */function(global, require, module, exports) { + +'use strict'; + +var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && (typeof Symbol === 'function' ? Symbol.for : '@@for') && (typeof Symbol === 'function' ? Symbol.for : '@@for')('react.element') || 0xeac7; + +module.exports = REACT_ELEMENT_TYPE; +}, 193, null, "ReactElementSymbol"); +__d(/* getIteratorFn */function(global, require, module, exports) { + +'use strict'; + +var ITERATOR_SYMBOL = typeof Symbol === 'function' && (typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'); +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} + +module.exports = getIteratorFn; +}, 194, null, "getIteratorFn"); +__d(/* flattenChildren */function(global, require, module, exports) { + +'use strict'; + +var KeyEscapeUtils = require(191 ); // 191 = KeyEscapeUtils +var traverseAllChildren = require(192 ); // 192 = traverseAllChildren +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook +} + +function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { + if (traverseContext && typeof traverseContext === 'object') { + var result = traverseContext; + var keyUnique = result[name] === undefined; + if (__DEV__) { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = require(56 ); // 56 = react/lib/ReactComponentTreeHook + } + if (!keyUnique) { + warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)); + } + } + if (keyUnique && child != null) { + result[name] = child; + } + } +} + +function flattenChildren(children, selfDebugID) { + if (children == null) { + return children; + } + var result = {}; + + if (__DEV__) { + traverseAllChildren(children, function (traverseContext, child, name) { + return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID); + }, result); + } else { + traverseAllChildren(children, flattenSingleChildIntoContext, result); + } + return result; +} + +module.exports = flattenChildren; +}, 195, null, "flattenChildren"); +__d(/* insetsDiffer */function(global, require, module, exports) { +'use strict'; + +var dummyInsets = { + top: undefined, + left: undefined, + right: undefined, + bottom: undefined +}; + +var insetsDiffer = function insetsDiffer(one, two) { + one = one || dummyInsets; + two = two || dummyInsets; + return one !== two && (one.top !== two.top || one.left !== two.left || one.right !== two.right || one.bottom !== two.bottom); +}; + +module.exports = insetsDiffer; +}, 196, null, "insetsDiffer"); +__d(/* pointsDiffer */function(global, require, module, exports) { +'use strict'; + +var dummyPoint = { x: undefined, y: undefined }; + +var pointsDiffer = function pointsDiffer(one, two) { + one = one || dummyPoint; + two = two || dummyPoint; + return one !== two && (one.x !== two.x || one.y !== two.y); +}; + +module.exports = pointsDiffer; +}, 197, null, "pointsDiffer"); +__d(/* resolveAssetSource */function(global, require, module, exports) { +'use strict'; + +var AssetRegistry = require(199 ); // 199 = AssetRegistry +var AssetSourceResolver = require(200 ); // 200 = AssetSourceResolver + +var _require = require(80 ), // 80 = NativeModules + SourceCode = _require.SourceCode; + +var _customSourceTransformer = void 0, + _serverURL = void 0, + _bundleSourcePath = void 0; + +function getDevServerURL() { + if (_serverURL === undefined) { + var scriptURL = SourceCode.scriptURL; + var match = scriptURL && scriptURL.match(/^https?:\/\/.*?\//); + if (match) { + _serverURL = match[0]; + } else { + _serverURL = null; + } + } + return _serverURL; +} + +function getBundleSourcePath() { + if (_bundleSourcePath === undefined) { + var scriptURL = SourceCode.scriptURL; + if (!scriptURL) { + _bundleSourcePath = null; + return _bundleSourcePath; + } + if (scriptURL.startsWith('assets://')) { + _bundleSourcePath = null; + return _bundleSourcePath; + } + if (scriptURL.startsWith('file://')) { + _bundleSourcePath = scriptURL.substring(7, scriptURL.lastIndexOf('/') + 1); + } else { + _bundleSourcePath = scriptURL.substring(0, scriptURL.lastIndexOf('/') + 1); + } + } + + return _bundleSourcePath; +} + +function setCustomSourceTransformer(transformer) { + _customSourceTransformer = transformer; +} + +function resolveAssetSource(source) { + if (typeof source === 'object') { + return source; + } + + var asset = AssetRegistry.getAssetByID(source); + if (!asset) { + return null; + } + + var resolver = new AssetSourceResolver(getDevServerURL(), getBundleSourcePath(), asset); + if (_customSourceTransformer) { + return _customSourceTransformer(resolver); + } + return resolver.defaultAsset(); +} + +module.exports = resolveAssetSource; +module.exports.pickScale = AssetSourceResolver.pickScale; +module.exports.setCustomSourceTransformer = setCustomSourceTransformer; +}, 198, null, "resolveAssetSource"); +__d(/* AssetRegistry */function(global, require, module, exports) { +'use strict'; + +var assets = []; + +function registerAsset(asset) { + return assets.push(asset); +} + +function getAssetByID(assetId) { + return assets[assetId - 1]; +} + +module.exports = { registerAsset: registerAsset, getAssetByID: getAssetByID }; +}, 199, null, "AssetRegistry"); +__d(/* AssetSourceResolver */function(global, require, module, exports) { +'use strict'; + +var PixelRatio = require(128 ); // 128 = PixelRatio +var Platform = require(79 ); // 79 = Platform + +var assetPathUtils = require(201 ); // 201 = ../../local-cli/bundle/assetPathUtils +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function getScaledAssetPath(asset) { + var scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get()); + var scaleSuffix = scale === 1 ? '' : '@' + scale + 'x'; + var assetDir = assetPathUtils.getBasePath(asset); + return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type; +} + +function getAssetPathInDrawableFolder(asset) { + var scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get()); + var drawbleFolder = assetPathUtils.getAndroidDrawableFolderName(asset, scale); + var fileName = assetPathUtils.getAndroidResourceIdentifier(asset); + return drawbleFolder + '/' + fileName + '.' + asset.type; +} + +var AssetSourceResolver = function () { + function AssetSourceResolver(serverUrl, bundlePath, asset) { + babelHelpers.classCallCheck(this, AssetSourceResolver); + + this.serverUrl = serverUrl; + this.bundlePath = bundlePath; + this.asset = asset; + } + + babelHelpers.createClass(AssetSourceResolver, [{ + key: 'isLoadedFromServer', + value: function isLoadedFromServer() { + return !!this.serverUrl; + } + }, { + key: 'isLoadedFromFileSystem', + value: function isLoadedFromFileSystem() { + return !!this.bundlePath; + } + }, { + key: 'defaultAsset', + value: function defaultAsset() { + if (this.isLoadedFromServer()) { + return this.assetServerURL(); + } + + if (Platform.OS === 'android') { + return this.isLoadedFromFileSystem() ? this.drawableFolderInBundle() : this.resourceIdentifierWithoutScale(); + } else { + return this.scaledAssetPathInBundle(); + } + } + }, { + key: 'assetServerURL', + value: function assetServerURL() { + invariant(!!this.serverUrl, 'need server to load from'); + return this.fromSource(this.serverUrl + getScaledAssetPath(this.asset) + '?platform=' + Platform.OS + '&hash=' + this.asset.hash); + } + }, { + key: 'scaledAssetPath', + value: function scaledAssetPath() { + return this.fromSource(getScaledAssetPath(this.asset)); + } + }, { + key: 'scaledAssetPathInBundle', + value: function scaledAssetPathInBundle() { + var path = this.bundlePath || ''; + return this.fromSource(path + getScaledAssetPath(this.asset)); + } + }, { + key: 'resourceIdentifierWithoutScale', + value: function resourceIdentifierWithoutScale() { + invariant(Platform.OS === 'android', 'resource identifiers work on Android'); + return this.fromSource(assetPathUtils.getAndroidResourceIdentifier(this.asset)); + } + }, { + key: 'drawableFolderInBundle', + value: function drawableFolderInBundle() { + var path = this.bundlePath || ''; + return this.fromSource('file://' + path + getAssetPathInDrawableFolder(this.asset)); + } + }, { + key: 'fromSource', + value: function fromSource(source) { + return { + __packager_asset: true, + width: this.asset.width, + height: this.asset.height, + uri: source, + scale: AssetSourceResolver.pickScale(this.asset.scales, PixelRatio.get()) + }; + } + }], [{ + key: 'pickScale', + value: function pickScale(scales, deviceScale) { + for (var i = 0; i < scales.length; i++) { + if (scales[i] >= deviceScale) { + return scales[i]; + } + } + + return scales[scales.length - 1] || 1; + } + }]); + return AssetSourceResolver; +}(); + +module.exports = AssetSourceResolver; +}, 200, null, "AssetSourceResolver"); +__d(/* react-native/local-cli/bundle/assetPathUtils.js */function(global, require, module, exports) { +'use strict'; + +function getAndroidAssetSuffix(scale) { + switch (scale) { + case 0.75: + return 'ldpi'; + case 1: + return 'mdpi'; + case 1.5: + return 'hdpi'; + case 2: + return 'xhdpi'; + case 3: + return 'xxhdpi'; + case 4: + return 'xxxhdpi'; + } +} + +function getAndroidDrawableFolderName(asset, scale) { + var suffix = getAndroidAssetSuffix(scale); + if (!suffix) { + throw new Error('Don\'t know which android drawable suffix to use for asset: ' + JSON.stringify(asset)); + } + var androidFolder = 'drawable-' + suffix; + return androidFolder; +} + +function getAndroidResourceIdentifier(asset) { + var folderPath = getBasePath(asset); + return (folderPath + '/' + asset.name).toLowerCase().replace(/\//g, '_').replace(/([^a-z0-9_])/g, '').replace(/^assets_/, ''); +} + +function getBasePath(asset) { + var basePath = asset.httpServerLocation; + if (basePath[0] === '/') { + basePath = basePath.substr(1); + } + return basePath; +} + +module.exports = { + getAndroidAssetSuffix: getAndroidAssetSuffix, + getAndroidDrawableFolderName: getAndroidDrawableFolderName, + getAndroidResourceIdentifier: getAndroidResourceIdentifier, + getBasePath: getBasePath +}; +}, 201, null, "react-native/local-cli/bundle/assetPathUtils.js"); +__d(/* verifyPropTypes */function(global, require, module, exports) { +'use strict'; + +var ReactNativeStyleAttributes = require(130 ); // 130 = ReactNativeStyleAttributes + +function verifyPropTypes(componentInterface, viewConfig, nativePropsToIgnore) { + if (!viewConfig) { + return; + } + var componentName = componentInterface.displayName || componentInterface.name || 'unknown'; + + if (!componentInterface.propTypes) { + throw new Error('`' + componentName + '` has no propTypes defined`'); + } + + var nativeProps = viewConfig.NativeProps; + for (var prop in nativeProps) { + if (!componentInterface.propTypes[prop] && !ReactNativeStyleAttributes[prop] && (!nativePropsToIgnore || !nativePropsToIgnore[prop])) { + var message; + if (componentInterface.propTypes.hasOwnProperty(prop)) { + message = '`' + componentName + '` has incorrectly defined propType for native prop `' + viewConfig.uiViewClassName + '.' + prop + '` of native type `' + nativeProps[prop]; + } else { + message = '`' + componentName + '` has no propType for native prop `' + viewConfig.uiViewClassName + '.' + prop + '` of native type `' + nativeProps[prop] + '`'; + } + message += '\nIf you haven\'t changed this prop yourself, this usually means that ' + 'your versions of the native code and JavaScript code are out of sync. Updating both ' + 'should make this error go away.'; + throw new Error(message); + } + } +} + +module.exports = verifyPropTypes; +}, 202, null, "verifyPropTypes"); +__d(/* ReactNativeART */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/ART/ReactNativeART.js'; +var Color = require(204 ); // 204 = art/core/color +var Path = require(205 ); // 205 = ARTSerializablePath +var Transform = require(208 ); // 208 = art/core/transform + +var React = require(126 ); // 126 = React +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes + +var createReactNativeComponentClass = require(157 ); // 157 = createReactNativeComponentClass +var merge = require(149 ); // 149 = merge +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function arrayDiffer(a, b) { + if (a == null || b == null) { + return true; + } + if (a.length !== b.length) { + return true; + } + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { + return true; + } + } + return false; +} + +function fontAndLinesDiffer(a, b) { + if (a === b) { + return false; + } + if (a.font !== b.font) { + if (a.font === null) { + return true; + } + if (b.font === null) { + return true; + } + + if (a.font.fontFamily !== b.font.fontFamily || a.font.fontSize !== b.font.fontSize || a.font.fontWeight !== b.font.fontWeight || a.font.fontStyle !== b.font.fontStyle) { + return true; + } + } + return arrayDiffer(a.lines, b.lines); +} + +var SurfaceViewAttributes = merge(ReactNativeViewAttributes.UIView, {}); + +var NodeAttributes = { + transform: { diff: arrayDiffer }, + opacity: true +}; + +var GroupAttributes = merge(NodeAttributes, { + clipping: { diff: arrayDiffer } +}); + +var RenderableAttributes = merge(NodeAttributes, { + fill: { diff: arrayDiffer }, + stroke: { diff: arrayDiffer }, + strokeWidth: true, + strokeCap: true, + strokeJoin: true, + strokeDash: { diff: arrayDiffer } +}); + +var ShapeAttributes = merge(RenderableAttributes, { + d: { diff: arrayDiffer } +}); + +var TextAttributes = merge(RenderableAttributes, { + alignment: true, + frame: { diff: fontAndLinesDiffer }, + path: { diff: arrayDiffer } +}); + +var NativeSurfaceView = createReactNativeComponentClass({ + validAttributes: SurfaceViewAttributes, + uiViewClassName: 'ARTSurfaceView' +}); + +var NativeGroup = createReactNativeComponentClass({ + validAttributes: GroupAttributes, + uiViewClassName: 'ARTGroup' +}); + +var NativeShape = createReactNativeComponentClass({ + validAttributes: ShapeAttributes, + uiViewClassName: 'ARTShape' +}); + +var NativeText = createReactNativeComponentClass({ + validAttributes: TextAttributes, + uiViewClassName: 'ARTText' +}); + +function childrenAsString(children) { + if (!children) { + return ''; + } + if (typeof children === 'string') { + return children; + } + if (children.length) { + return children.join('\n'); + } + return ''; +} + +var Surface = function (_React$Component) { + babelHelpers.inherits(Surface, _React$Component); + + function Surface() { + babelHelpers.classCallCheck(this, Surface); + return babelHelpers.possibleConstructorReturn(this, (Surface.__proto__ || Object.getPrototypeOf(Surface)).apply(this, arguments)); + } + + babelHelpers.createClass(Surface, [{ + key: 'getChildContext', + value: function getChildContext() { + return { isInSurface: true }; + } + }, { + key: 'render', + value: function render() { + var props = this.props; + var w = extractNumber(props.width, 0); + var h = extractNumber(props.height, 0); + return React.createElement( + NativeSurfaceView, + { style: [props.style, { width: w, height: h }], __source: { + fileName: _jsxFileName, + lineNumber: 154 + } + }, + this.props.children + ); + } + }]); + return Surface; +}(React.Component); + +Surface.childContextTypes = { + isInSurface: React.PropTypes.bool +}; + + +function extractNumber(value, defaultValue) { + if (value == null) { + return defaultValue; + } + return +value; +} + +var pooledTransform = new Transform(); + +function extractTransform(props) { + var scaleX = props.scaleX != null ? props.scaleX : props.scale != null ? props.scale : 1; + var scaleY = props.scaleY != null ? props.scaleY : props.scale != null ? props.scale : 1; + + pooledTransform.transformTo(1, 0, 0, 1, 0, 0).move(props.x || 0, props.y || 0).rotate(props.rotation || 0, props.originX, props.originY).scale(scaleX, scaleY, props.originX, props.originY); + + if (props.transform != null) { + pooledTransform.transform(props.transform); + } + + return [pooledTransform.xx, pooledTransform.yx, pooledTransform.xy, pooledTransform.yy, pooledTransform.x, pooledTransform.y]; +} + +function extractOpacity(props) { + if (props.visible === false) { + return 0; + } + if (props.opacity == null) { + return 1; + } + return +props.opacity; +} + +var Group = function (_React$Component2) { + babelHelpers.inherits(Group, _React$Component2); + + function Group() { + babelHelpers.classCallCheck(this, Group); + return babelHelpers.possibleConstructorReturn(this, (Group.__proto__ || Object.getPrototypeOf(Group)).apply(this, arguments)); + } + + babelHelpers.createClass(Group, [{ + key: 'render', + value: function render() { + var props = this.props; + invariant(this.context.isInSurface, 'ART: must be a child of a '); + return React.createElement( + NativeGroup, + { + opacity: extractOpacity(props), + transform: extractTransform(props), __source: { + fileName: _jsxFileName, + lineNumber: 226 + } + }, + this.props.children + ); + } + }]); + return Group; +}(React.Component); + +Group.contextTypes = { + isInSurface: React.PropTypes.bool.isRequired +}; + +var ClippingRectangle = function (_React$Component3) { + babelHelpers.inherits(ClippingRectangle, _React$Component3); + + function ClippingRectangle() { + babelHelpers.classCallCheck(this, ClippingRectangle); + return babelHelpers.possibleConstructorReturn(this, (ClippingRectangle.__proto__ || Object.getPrototypeOf(ClippingRectangle)).apply(this, arguments)); + } + + babelHelpers.createClass(ClippingRectangle, [{ + key: 'render', + value: function render() { + var props = this.props; + var x = extractNumber(props.x, 0); + var y = extractNumber(props.y, 0); + var w = extractNumber(props.width, 0); + var h = extractNumber(props.height, 0); + var clipping = [x, y, w, h]; + + var propsExcludingXAndY = merge(props); + delete propsExcludingXAndY.x; + delete propsExcludingXAndY.y; + return React.createElement( + NativeGroup, + { + clipping: clipping, + opacity: extractOpacity(props), + transform: extractTransform(propsExcludingXAndY), __source: { + fileName: _jsxFileName, + lineNumber: 248 + } + }, + this.props.children + ); + } + }]); + return ClippingRectangle; +}(React.Component); + +var SOLID_COLOR = 0; +var LINEAR_GRADIENT = 1; +var RADIAL_GRADIENT = 2; +var PATTERN = 3; + +function insertColorIntoArray(color, targetArray, atIndex) { + var c = new Color(color); + targetArray[atIndex + 0] = c.red / 255; + targetArray[atIndex + 1] = c.green / 255; + targetArray[atIndex + 2] = c.blue / 255; + targetArray[atIndex + 3] = c.alpha; +} + +function insertColorsIntoArray(stops, targetArray, atIndex) { + var i = 0; + if ('length' in stops) { + while (i < stops.length) { + insertColorIntoArray(stops[i], targetArray, atIndex + i * 4); + i++; + } + } else { + for (var offset in stops) { + insertColorIntoArray(stops[offset], targetArray, atIndex + i * 4); + i++; + } + } + return atIndex + i * 4; +} + +function insertOffsetsIntoArray(stops, targetArray, atIndex, multi, reverse) { + var offsetNumber; + var i = 0; + if ('length' in stops) { + while (i < stops.length) { + offsetNumber = i / (stops.length - 1) * multi; + targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber; + i++; + } + } else { + for (var offsetString in stops) { + offsetNumber = +offsetString * multi; + targetArray[atIndex + i] = reverse ? 1 - offsetNumber : offsetNumber; + i++; + } + } + return atIndex + i; +} + +function insertColorStopsIntoArray(stops, targetArray, atIndex) { + var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex); + insertOffsetsIntoArray(stops, targetArray, lastIndex, 1, false); +} + +function insertDoubleColorStopsIntoArray(stops, targetArray, atIndex) { + var lastIndex = insertColorsIntoArray(stops, targetArray, atIndex); + lastIndex = insertColorsIntoArray(stops, targetArray, lastIndex); + lastIndex = insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, false); + insertOffsetsIntoArray(stops, targetArray, lastIndex, 0.5, true); +} + +function applyBoundingBoxToBrushData(brushData, props) { + var type = brushData[0]; + var width = +props.width; + var height = +props.height; + if (type === LINEAR_GRADIENT) { + brushData[1] *= width; + brushData[2] *= height; + brushData[3] *= width; + brushData[4] *= height; + } else if (type === RADIAL_GRADIENT) { + brushData[1] *= width; + brushData[2] *= height; + brushData[3] *= width; + brushData[4] *= height; + brushData[5] *= width; + brushData[6] *= height; + } else if (type === PATTERN) {} +} + +function extractBrush(colorOrBrush, props) { + if (colorOrBrush == null) { + return null; + } + if (colorOrBrush._brush) { + if (colorOrBrush._bb) { + applyBoundingBoxToBrushData(colorOrBrush._brush, props); + colorOrBrush._bb = false; + } + return colorOrBrush._brush; + } + var c = new Color(colorOrBrush); + return [SOLID_COLOR, c.red / 255, c.green / 255, c.blue / 255, c.alpha]; +} + +function extractColor(color) { + if (color == null) { + return null; + } + var c = new Color(color); + return [c.red / 255, c.green / 255, c.blue / 255, c.alpha]; +} + +function extractStrokeCap(strokeCap) { + switch (strokeCap) { + case 'butt': + return 0; + case 'square': + return 2; + default: + return 1;} +} + +function extractStrokeJoin(strokeJoin) { + switch (strokeJoin) { + case 'miter': + return 0; + case 'bevel': + return 2; + default: + return 1;} +} + +var Shape = function (_React$Component4) { + babelHelpers.inherits(Shape, _React$Component4); + + function Shape() { + babelHelpers.classCallCheck(this, Shape); + return babelHelpers.possibleConstructorReturn(this, (Shape.__proto__ || Object.getPrototypeOf(Shape)).apply(this, arguments)); + } + + babelHelpers.createClass(Shape, [{ + key: 'render', + value: function render() { + var props = this.props; + var path = props.d || childrenAsString(props.children); + var d = new Path(path).toJSON(); + return React.createElement(NativeShape, { + fill: extractBrush(props.fill, props), + opacity: extractOpacity(props), + stroke: extractColor(props.stroke), + strokeCap: extractStrokeCap(props.strokeCap), + strokeDash: props.strokeDash || null, + strokeJoin: extractStrokeJoin(props.strokeJoin), + strokeWidth: extractNumber(props.strokeWidth, 1), + transform: extractTransform(props), + + d: d, + __source: { + fileName: _jsxFileName, + lineNumber: 396 + } + }); + } + }]); + return Shape; +}(React.Component); + +var cachedFontObjectsFromString = {}; + +var fontFamilyPrefix = /^[\s"']*/; +var fontFamilySuffix = /[\s"']*$/; + +function extractSingleFontFamily(fontFamilyString) { + return fontFamilyString.split(',')[0].replace(fontFamilyPrefix, '').replace(fontFamilySuffix, ''); +} + +function parseFontString(font) { + if (cachedFontObjectsFromString.hasOwnProperty(font)) { + return cachedFontObjectsFromString[font]; + } + var regexp = /^\s*((?:(?:normal|bold|italic)\s+)*)(?:(\d+(?:\.\d+)?)[ptexm\%]*(?:\s*\/.*?)?\s+)?\s*\"?([^\"]*)/i; + var match = regexp.exec(font); + if (!match) { + return null; + } + var fontFamily = extractSingleFontFamily(match[3]); + var fontSize = +match[2] || 12; + var isBold = /bold/.exec(match[1]); + var isItalic = /italic/.exec(match[1]); + cachedFontObjectsFromString[font] = { + fontFamily: fontFamily, + fontSize: fontSize, + fontWeight: isBold ? 'bold' : 'normal', + fontStyle: isItalic ? 'italic' : 'normal' + }; + return cachedFontObjectsFromString[font]; +} + +function extractFont(font) { + if (font == null) { + return null; + } + if (typeof font === 'string') { + return parseFontString(font); + } + var fontFamily = extractSingleFontFamily(font.fontFamily); + var fontSize = +font.fontSize || 12; + return { + fontFamily: fontFamily, + fontSize: fontSize, + fontWeight: font.fontWeight, + fontStyle: font.fontStyle + }; +} + +var newLine = /\n/g; +function extractFontAndLines(font, text) { + return { font: extractFont(font), lines: text.split(newLine) }; +} + +function extractAlignment(alignment) { + switch (alignment) { + case 'right': + return 1; + case 'center': + return 2; + default: + return 0; + } +} + +var Text = function (_React$Component5) { + babelHelpers.inherits(Text, _React$Component5); + + function Text() { + babelHelpers.classCallCheck(this, Text); + return babelHelpers.possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).apply(this, arguments)); + } + + babelHelpers.createClass(Text, [{ + key: 'render', + value: function render() { + var props = this.props; + var textPath = props.path ? new Path(props.path).toJSON() : null; + var textFrame = extractFontAndLines(props.font, childrenAsString(props.children)); + return React.createElement(NativeText, { + fill: extractBrush(props.fill, props), + opacity: extractOpacity(props), + stroke: extractColor(props.stroke), + strokeCap: extractStrokeCap(props.strokeCap), + strokeDash: props.strokeDash || null, + strokeJoin: extractStrokeJoin(props.strokeJoin), + strokeWidth: extractNumber(props.strokeWidth, 1), + transform: extractTransform(props), + + alignment: extractAlignment(props.alignment), + frame: textFrame, + path: textPath, + __source: { + fileName: _jsxFileName, + lineNumber: 493 + } + }); + } + }]); + return Text; +}(React.Component); + +function LinearGradient(stops, x1, y1, x2, y2) { + var type = LINEAR_GRADIENT; + + if (arguments.length < 5) { + var angle = (x1 == null ? 270 : x1) * Math.PI / 180; + + var x = Math.cos(angle); + var y = -Math.sin(angle); + var l = (Math.abs(x) + Math.abs(y)) / 2; + + x *= l;y *= l; + + x1 = 0.5 - x; + x2 = 0.5 + x; + y1 = 0.5 - y; + y2 = 0.5 + y; + this._bb = true; + } else { + this._bb = false; + } + + var brushData = [type, +x1, +y1, +x2, +y2]; + insertColorStopsIntoArray(stops, brushData, 5); + this._brush = brushData; +} + +function RadialGradient(stops, fx, fy, rx, ry, cx, cy) { + if (ry == null) { + ry = rx; + } + if (cx == null) { + cx = fx; + } + if (cy == null) { + cy = fy; + } + if (fx == null) { + fx = fy = rx = ry = cx = cy = 0.5; + this._bb = true; + } else { + this._bb = false; + } + + var brushData = [RADIAL_GRADIENT, +fx, +fy, +rx * 2, +ry * 2, +cx, +cy]; + insertDoubleColorStopsIntoArray(stops, brushData, 7); + this._brush = brushData; +} + +function Pattern(url, width, height, left, top) { + this._brush = [PATTERN, url, +left || 0, +top || 0, +width, +height]; +} + +var ReactART = { + LinearGradient: LinearGradient, + RadialGradient: RadialGradient, + Pattern: Pattern, + Transform: Transform, + Path: Path, + Surface: Surface, + Group: Group, + ClippingRectangle: ClippingRectangle, + Shape: Shape, + Text: Text +}; + +module.exports = ReactART; +}, 203, null, "ReactNativeART"); +__d(/* art/core/color.js */function(global, require, module, exports) {var colors = { + maroon: '#800000', red: '#ff0000', orange: '#ffA500', yellow: '#ffff00', olive: '#808000', + purple: '#800080', fuchsia: "#ff00ff", white: '#ffffff', lime: '#00ff00', green: '#008000', + navy: '#000080', blue: '#0000ff', aqua: '#00ffff', teal: '#008080', + black: '#000000', silver: '#c0c0c0', gray: '#808080' +}; + +var map = function map(array, fn) { + var results = []; + for (var i = 0, l = array.length; i < l; i++) { + results[i] = fn(array[i], i); + }return results; +}; + +var Color = function Color(color, type) { + + if (color.isColor) { + + this.red = color.red; + this.green = color.green; + this.blue = color.blue; + this.alpha = color.alpha; + } else { + + var namedColor = colors[color]; + if (namedColor) { + color = namedColor; + type = 'hex'; + } + + switch (typeof color) { + case 'string': + if (!type) type = (type = color.match(/^rgb|^hsb|^hsl/)) ? type[0] : 'hex';break; + case 'object': + type = type || 'rgb';color = color.toString();break; + case 'number': + type = 'hex';color = color.toString(16);break; + } + + color = Color['parse' + type.toUpperCase()](color); + this.red = color[0]; + this.green = color[1]; + this.blue = color[2]; + this.alpha = color[3]; + } + + this.isColor = true; +}; + +var limit = function limit(number, min, max) { + return Math.min(max, Math.max(min, number)); +}; + +var listMatch = /([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,?\s*([-.\d]*\%?)/; +var hexMatch = /^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{0,2})$/i; + +Color.parseRGB = function (color) { + return map(color.match(listMatch).slice(1), function (bit, i) { + if (bit) bit = parseFloat(bit) * (bit[bit.length - 1] == '%' ? 2.55 : 1); + return i < 3 ? Math.round((bit %= 256) < 0 ? bit + 256 : bit) : limit(bit === '' ? 1 : Number(bit), 0, 1); + }); +}; + +Color.parseHEX = function (color) { + if (color.length == 1) color = color + color + color; + return map(color.match(hexMatch).slice(1), function (bit, i) { + if (i == 3) return bit ? parseInt(bit, 16) / 255 : 1; + return parseInt(bit.length == 1 ? bit + bit : bit, 16); + }); +}; + +Color.parseHSB = function (color) { + var hsb = map(color.match(listMatch).slice(1), function (bit, i) { + if (bit) bit = parseFloat(bit); + if (i === 0) return Math.round((bit %= 360) < 0 ? bit + 360 : bit);else if (i < 3) return limit(Math.round(bit), 0, 100);else return limit(bit === '' ? 1 : Number(bit), 0, 1); + }); + + var a = hsb[3]; + var br = Math.round(hsb[2] / 100 * 255); + if (hsb[1] == 0) return [br, br, br, a]; + + var hue = hsb[0]; + var f = hue % 60; + var p = Math.round(hsb[2] * (100 - hsb[1]) / 10000 * 255); + var q = Math.round(hsb[2] * (6000 - hsb[1] * f) / 600000 * 255); + var t = Math.round(hsb[2] * (6000 - hsb[1] * (60 - f)) / 600000 * 255); + + switch (Math.floor(hue / 60)) { + case 0: + return [br, t, p, a]; + case 1: + return [q, br, p, a]; + case 2: + return [p, br, t, a]; + case 3: + return [p, q, br, a]; + case 4: + return [t, p, br, a]; + default: + return [br, p, q, a]; + } +}; + +Color.parseHSL = function (color) { + var hsb = map(color.match(listMatch).slice(1), function (bit, i) { + if (bit) bit = parseFloat(bit); + if (i === 0) return Math.round((bit %= 360) < 0 ? bit + 360 : bit);else if (i < 3) return limit(Math.round(bit), 0, 100);else return limit(bit === '' ? 1 : Number(bit), 0, 1); + }); + + var h = hsb[0] / 60; + var s = hsb[1] / 100; + var l = hsb[2] / 100; + var a = hsb[3]; + + var c = (1 - Math.abs(2 * l - 1)) * s; + var x = c * (1 - Math.abs(h % 2 - 1)); + var m = l - c / 2; + + var p = Math.round((c + m) * 255); + var q = Math.round((x + m) * 255); + var t = Math.round(m * 255); + + switch (Math.floor(h)) { + case 0: + return [p, q, t, a]; + case 1: + return [q, p, t, a]; + case 2: + return [t, p, q, a]; + case 3: + return [t, q, p, a]; + case 4: + return [q, t, p, a]; + default: + return [p, t, q, a]; + } +}; + +var toString = function toString(type, array) { + if (array[3] != 1) type += 'a';else array.pop(); + return type + '(' + array.join(', ') + ')'; +}; + +Color.prototype = { + + toHSB: function toHSB(array) { + var red = this.red, + green = this.green, + blue = this.blue, + alpha = this.alpha; + + var max = Math.max(red, green, blue), + min = Math.min(red, green, blue), + delta = max - min; + var hue = 0, + saturation = delta != 0 ? delta / max : 0, + brightness = max / 255; + if (saturation) { + var rr = (max - red) / delta, + gr = (max - green) / delta, + br = (max - blue) / delta; + hue = red == max ? br - gr : green == max ? 2 + rr - br : 4 + gr - rr; + if ((hue /= 6) < 0) hue++; + } + + var hsb = [Math.round(hue * 360), Math.round(saturation * 100), Math.round(brightness * 100), alpha]; + + return array ? hsb : toString('hsb', hsb); + }, + + toHSL: function toHSL(array) { + var red = this.red, + green = this.green, + blue = this.blue, + alpha = this.alpha; + + var max = Math.max(red, green, blue), + min = Math.min(red, green, blue), + delta = max - min; + var hue = 0, + saturation = delta != 0 ? delta / (255 - Math.abs(max + min - 255)) : 0, + lightness = (max + min) / 512; + if (saturation) { + var rr = (max - red) / delta, + gr = (max - green) / delta, + br = (max - blue) / delta; + hue = red == max ? br - gr : green == max ? 2 + rr - br : 4 + gr - rr; + if ((hue /= 6) < 0) hue++; + } + + var hsl = [Math.round(hue * 360), Math.round(saturation * 100), Math.round(lightness * 100), alpha]; + + return array ? hsl : toString('hsl', hsl); + }, + + toHEX: function toHEX(array) { + + var a = this.alpha; + var alpha = (a = Math.round(a * 255).toString(16)).length == 1 ? a + a : a; + + var hex = map([this.red, this.green, this.blue], function (bit) { + bit = bit.toString(16); + return bit.length == 1 ? '0' + bit : bit; + }); + + return array ? hex.concat(alpha) : '#' + hex.join('') + (alpha == 'ff' ? '' : alpha); + }, + + toRGB: function toRGB(array) { + var rgb = [this.red, this.green, this.blue, this.alpha]; + return array ? rgb : toString('rgb', rgb); + } + +}; + +Color.prototype.toString = Color.prototype.toRGB; + +Color.hex = function (hex) { + return new Color(hex, 'hex'); +}; + +if (this.hex == null) this.hex = Color.hex; + +Color.hsb = function (h, s, b, a) { + return new Color([h || 0, s || 0, b || 0, a == null ? 1 : a], 'hsb'); +}; + +if (this.hsb == null) this.hsb = Color.hsb; + +Color.hsl = function (h, s, l, a) { + return new Color([h || 0, s || 0, l || 0, a == null ? 1 : a], 'hsl'); +}; + +if (this.hsl == null) this.hsl = Color.hsl; + +Color.rgb = function (r, g, b, a) { + return new Color([r || 0, g || 0, b || 0, a == null ? 1 : a], 'rgb'); +}; + +if (this.rgb == null) this.rgb = Color.rgb; + +Color.detach = function (color) { + color = new Color(color); + return [Color.rgb(color.red, color.green, color.blue).toString(), color.alpha]; +}; + +module.exports = Color; +}, 204, null, "art/core/color.js"); +__d(/* ARTSerializablePath */function(global, require, module, exports) { +'use strict'; + +var Class = require(206 ); // 206 = art/core/class.js +var Path = require(207 ); // 207 = art/core/path.js + +var MOVE_TO = 0; +var CLOSE = 1; +var LINE_TO = 2; +var CURVE_TO = 3; +var ARC = 4; + +var SerializablePath = Class(Path, { + + initialize: function initialize(path) { + this.reset(); + if (path instanceof SerializablePath) { + this.path = path.path.slice(0); + } else if (path) { + if (path.applyToPath) { + path.applyToPath(this); + } else { + this.push(path); + } + } + }, + + onReset: function onReset() { + this.path = []; + }, + + onMove: function onMove(sx, sy, x, y) { + this.path.push(MOVE_TO, x, y); + }, + + onLine: function onLine(sx, sy, x, y) { + this.path.push(LINE_TO, x, y); + }, + + onBezierCurve: function onBezierCurve(sx, sy, p1x, p1y, p2x, p2y, x, y) { + this.path.push(CURVE_TO, p1x, p1y, p2x, p2y, x, y); + }, + + _arcToBezier: Path.prototype.onArc, + + onArc: function onArc(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation) { + if (rx !== ry || rotation) { + return this._arcToBezier(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation); + } + this.path.push(ARC, cx, cy, rx, sa, ea, ccw ? 0 : 1); + }, + + onClose: function onClose() { + this.path.push(CLOSE); + }, + + toJSON: function toJSON() { + return this.path; + } + +}); + +module.exports = SerializablePath; +}, 205, null, "ARTSerializablePath"); +__d(/* art/core/class.js */function(global, require, module, exports) {module.exports = function (mixins) { + var proto = {}; + for (var i = 0, l = arguments.length; i < l; i++) { + var mixin = arguments[i]; + if (typeof mixin == 'function') mixin = mixin.prototype; + for (var key in mixin) { + proto[key] = mixin[key]; + } + } + if (!proto.initialize) proto.initialize = function () {}; + proto.constructor = function (a, b, c, d, e, f, g, h) { + return new proto.initialize(a, b, c, d, e, f, g, h); + }; + proto.constructor.prototype = proto.initialize.prototype = proto; + return proto.constructor; +}; +}, 206, null, "art/core/class.js"); +__d(/* art/core/path.js */function(global, require, module, exports) {var Class = require(206 ); // 206 = ./class + +module.exports = Class({ + + initialize: function initialize(path) { + this.reset().push(path); + }, + + push: function push() { + var p = Array.prototype.join.call(arguments, ' ').match(/[a-df-z]|[\-+]?(?:[\d\.]e[\-+]?|[^\s\-+,a-z])+/ig); + if (!p) return this; + + var last, + cmd = p[0], + i = 1; + while (cmd) { + switch (cmd) { + case 'm': + this.move(p[i++], p[i++]);break; + case 'l': + this.line(p[i++], p[i++]);break; + case 'c': + this.curve(p[i++], p[i++], p[i++], p[i++], p[i++], p[i++]);break; + case 's': + this.curve(p[i++], p[i++], null, null, p[i++], p[i++]);break; + case 'q': + this.curve(p[i++], p[i++], p[i++], p[i++]);break; + case 't': + this.curve(p[i++], p[i++]);break; + case 'a': + this.arc(p[i + 5], p[i + 6], p[i], p[i + 1], p[i + 3], !+p[i + 4], p[i + 2]);i += 7;break; + case 'h': + this.line(p[i++], 0);break; + case 'v': + this.line(0, p[i++]);break; + + case 'M': + this.moveTo(p[i++], p[i++]);break; + case 'L': + this.lineTo(p[i++], p[i++]);break; + case 'C': + this.curveTo(p[i++], p[i++], p[i++], p[i++], p[i++], p[i++]);break; + case 'S': + this.curveTo(p[i++], p[i++], null, null, p[i++], p[i++]);break; + case 'Q': + this.curveTo(p[i++], p[i++], p[i++], p[i++]);break; + case 'T': + this.curveTo(p[i++], p[i++]);break; + case 'A': + this.arcTo(p[i + 5], p[i + 6], p[i], p[i + 1], p[i + 3], !+p[i + 4], p[i + 2]);i += 7;break; + case 'H': + this.lineTo(p[i++], this.penY);break; + case 'V': + this.lineTo(this.penX, p[i++]);break; + + case 'Z':case 'z': + this.close();break; + default: + cmd = last;i--;continue; + } + + last = cmd; + if (last == 'm') last = 'l';else if (last == 'M') last = 'L'; + cmd = p[i++]; + } + return this; + }, + + reset: function reset() { + this.penX = this.penY = 0; + this.penDownX = this.penDownY = null; + this._pivotX = this._pivotY = 0; + this.onReset(); + return this; + }, + + move: function move(x, y) { + this.onMove(this.penX, this.penY, this._pivotX = this.penX += +x, this._pivotY = this.penY += +y); + return this; + }, + moveTo: function moveTo(x, y) { + this.onMove(this.penX, this.penY, this._pivotX = this.penX = +x, this._pivotY = this.penY = +y); + return this; + }, + + line: function line(x, y) { + return this.lineTo(this.penX + +x, this.penY + +y); + }, + lineTo: function lineTo(x, y) { + if (this.penDownX == null) { + this.penDownX = this.penX;this.penDownY = this.penY; + } + this.onLine(this.penX, this.penY, this._pivotX = this.penX = +x, this._pivotY = this.penY = +y); + return this; + }, + + curve: function curve(c1x, c1y, c2x, c2y, ex, ey) { + var x = this.penX, + y = this.penY; + return this.curveTo(x + +c1x, y + +c1y, c2x == null ? null : x + +c2x, c2y == null ? null : y + +c2y, ex == null ? null : x + +ex, ey == null ? null : y + +ey); + }, + curveTo: function curveTo(c1x, c1y, c2x, c2y, ex, ey) { + var x = this.penX, + y = this.penY; + if (c2x == null) { + c2x = +c1x;c2y = +c1y; + c1x = x * 2 - (this._pivotX || 0);c1y = y * 2 - (this._pivotY || 0); + } + if (ex == null) { + this._pivotX = +c1x;this._pivotY = +c1y; + ex = +c2x;ey = +c2y; + c2x = (ex + +c1x * 2) / 3;c2y = (ey + +c1y * 2) / 3; + c1x = (x + +c1x * 2) / 3;c1y = (y + +c1y * 2) / 3; + } else { + this._pivotX = +c2x;this._pivotY = +c2y; + } + if (this.penDownX == null) { + this.penDownX = x;this.penDownY = y; + } + this.onBezierCurve(x, y, +c1x, +c1y, +c2x, +c2y, this.penX = +ex, this.penY = +ey); + return this; + }, + + arc: function arc(x, y, rx, ry, outer, counterClockwise, rotation) { + return this.arcTo(this.penX + +x, this.penY + +y, rx, ry, outer, counterClockwise, rotation); + }, + arcTo: function arcTo(x, y, rx, ry, outer, counterClockwise, rotation) { + ry = Math.abs(+ry || +rx || +y - this.penY); + rx = Math.abs(+rx || +x - this.penX); + + if (!rx || !ry || x == this.penX && y == this.penY) return this.lineTo(x, y); + + var tX = this.penX, + tY = this.penY, + clockwise = !+counterClockwise, + large = !!+outer; + + var rad = rotation ? rotation * Math.PI / 180 : 0, + cos = Math.cos(rad), + sin = Math.sin(rad); + x -= tX;y -= tY; + + var cx = cos * x / 2 + sin * y / 2, + cy = -sin * x / 2 + cos * y / 2, + rxry = rx * rx * ry * ry, + rycx = ry * ry * cx * cx, + rxcy = rx * rx * cy * cy, + a = rxry - rxcy - rycx; + + if (a < 0) { + a = Math.sqrt(1 - a / rxry); + rx *= a;ry *= a; + cx = x / 2;cy = y / 2; + } else { + a = Math.sqrt(a / (rxcy + rycx)); + if (large == clockwise) a = -a; + var cxd = -a * cy * rx / ry, + cyd = a * cx * ry / rx; + cx = cos * cxd - sin * cyd + x / 2; + cy = sin * cxd + cos * cyd + y / 2; + } + + var xx = cos / rx, + yx = sin / rx, + xy = -sin / ry, + yy = cos / ry; + + var sa = Math.atan2(xy * -cx + yy * -cy, xx * -cx + yx * -cy), + ea = Math.atan2(xy * (x - cx) + yy * (y - cy), xx * (x - cx) + yx * (y - cy)); + + cx += tX;cy += tY; + x += tX;y += tY; + + if (this.penDownX == null) { + this.penDownX = this.penX;this.penDownY = this.penY; + } + this.onArc(tX, tY, this._pivotX = this.penX = x, this._pivotY = this.penY = y, cx, cy, rx, ry, sa, ea, !clockwise, rotation); + return this; + }, + + counterArc: function counterArc(x, y, rx, ry, outer) { + return this.arc(x, y, rx, ry, outer, true); + }, + counterArcTo: function counterArcTo(x, y, rx, ry, outer) { + return this.arcTo(x, y, rx, ry, outer, true); + }, + + close: function close() { + if (this.penDownX != null) { + this.onClose(this.penX, this.penY, this.penX = this.penDownX, this.penY = this.penDownY); + this.penDownX = null; + } + return this; + }, + + onReset: function onReset() {}, + + onMove: function onMove(sx, sy, ex, ey) {}, + + onLine: function onLine(sx, sy, ex, ey) { + this.onBezierCurve(sx, sy, sx, sy, ex, ey, ex, ey); + }, + + onBezierCurve: function onBezierCurve(sx, sy, c1x, c1y, c2x, c2y, ex, ey) { + var gx = ex - sx, + gy = ey - sy, + g = gx * gx + gy * gy, + v1, + v2, + cx, + cy, + u; + + cx = c1x - sx;cy = c1y - sy; + u = cx * gx + cy * gy; + + if (u > g) { + cx -= gx; + cy -= gy; + } else if (u > 0 && g != 0) { + cx -= u / g * gx; + cy -= u / g * gy; + } + + v1 = cx * cx + cy * cy; + + cx = c2x - sx;cy = c2y - sy; + u = cx * gx + cy * gy; + + if (u > g) { + cx -= gx; + cy -= gy; + } else if (u > 0 && g != 0) { + cx -= u / g * gx; + cy -= u / g * gy; + } + + v2 = cx * cx + cy * cy; + + if (v1 < 0.01 && v2 < 0.01) { + this.onLine(sx, sy, ex, ey); + return; + } + + if (isNaN(v1) || isNaN(v2)) { + throw new Error('Bad input'); + } + + var s1x = (c1x + c2x) * 0.5, + s1y = (c1y + c2y) * 0.5, + l1x = (c1x + sx) * 0.5, + l1y = (c1y + sy) * 0.5, + l2x = (l1x + s1x) * 0.5, + l2y = (l1y + s1y) * 0.5, + r2x = (ex + c2x) * 0.5, + r2y = (ey + c2y) * 0.5, + r1x = (r2x + s1x) * 0.5, + r1y = (r2y + s1y) * 0.5, + l2r1x = (l2x + r1x) * 0.5, + l2r1y = (l2y + r1y) * 0.5; + + this.onBezierCurve(sx, sy, l1x, l1y, l2x, l2y, l2r1x, l2r1y); + this.onBezierCurve(l2r1x, l2r1y, r1x, r1y, r2x, r2y, ex, ey); + }, + + onArc: function onArc(sx, sy, ex, ey, cx, cy, rx, ry, sa, ea, ccw, rotation) { + var rad = rotation ? rotation * Math.PI / 180 : 0, + cos = Math.cos(rad), + sin = Math.sin(rad), + xx = cos * rx, + yx = -sin * ry, + xy = sin * rx, + yy = cos * ry; + + var arc = ea - sa; + if (arc < 0 && !ccw) arc += Math.PI * 2;else if (arc > 0 && ccw) arc -= Math.PI * 2; + + var n = Math.ceil(Math.abs(arc / (Math.PI / 2))), + step = arc / n, + k = 4 / 3 * Math.tan(step / 4); + + var x = Math.cos(sa), + y = Math.sin(sa); + + for (var i = 0; i < n; i++) { + var cp1x = x - k * y, + cp1y = y + k * x; + + sa += step; + x = Math.cos(sa);y = Math.sin(sa); + + var cp2x = x + k * y, + cp2y = y - k * x; + + this.onBezierCurve(sx, sy, cx + xx * cp1x + yx * cp1y, cy + xy * cp1x + yy * cp1y, cx + xx * cp2x + yx * cp2y, cy + xy * cp2x + yy * cp2y, sx = cx + xx * x + yx * y, sy = cy + xy * x + yy * y); + } + }, + + onClose: function onClose(sx, sy, ex, ey) { + this.onLine(sx, sy, ex, ey); + } + +}); +}, 207, null, "art/core/path.js"); +__d(/* art/core/transform.js */function(global, require, module, exports) {var Class = require(206 ); // 206 = ./class + +function Transform(xx, yx, xy, yy, x, y) { + if (xx && typeof xx == 'object') { + yx = xx.yx;yy = xx.yy;y = xx.y; + xy = xx.xy;x = xx.x;xx = xx.xx; + } + this.xx = xx == null ? 1 : xx; + this.yx = yx || 0; + this.xy = xy || 0; + this.yy = yy == null ? 1 : yy; + this.x = (x == null ? this.x : x) || 0; + this.y = (y == null ? this.y : y) || 0; + this._transform(); + return this; +}; + +module.exports = Class({ + + initialize: Transform, + + _transform: function _transform() {}, + + xx: 1, yx: 0, x: 0, + xy: 0, yy: 1, y: 0, + + transform: function transform(xx, yx, xy, yy, x, y) { + var m = this; + if (xx && typeof xx == 'object') { + yx = xx.yx;yy = xx.yy;y = xx.y; + xy = xx.xy;x = xx.x;xx = xx.xx; + } + if (!x) x = 0; + if (!y) y = 0; + return this.transformTo(m.xx * xx + m.xy * yx, m.yx * xx + m.yy * yx, m.xx * xy + m.xy * yy, m.yx * xy + m.yy * yy, m.xx * x + m.xy * y + m.x, m.yx * x + m.yy * y + m.y); + }, + + transformTo: Transform, + + translate: function translate(x, y) { + return this.transform(1, 0, 0, 1, x, y); + }, + + move: function move(x, y) { + this.x += x || 0; + this.y += y || 0; + this._transform(); + return this; + }, + + scale: function scale(x, y) { + if (y == null) y = x; + return this.transform(x, 0, 0, y, 0, 0); + }, + + rotate: function rotate(deg, x, y) { + if (x == null || y == null) { + x = (this.left || 0) + (this.width || 0) / 2; + y = (this.top || 0) + (this.height || 0) / 2; + } + + var rad = deg * Math.PI / 180, + sin = Math.sin(rad), + cos = Math.cos(rad); + + this.transform(1, 0, 0, 1, x, y); + var m = this; + + return this.transformTo(cos * m.xx - sin * m.yx, sin * m.xx + cos * m.yx, cos * m.xy - sin * m.yy, sin * m.xy + cos * m.yy, m.x, m.y).transform(1, 0, 0, 1, -x, -y); + }, + + moveTo: function moveTo(x, y) { + var m = this; + return this.transformTo(m.xx, m.yx, m.xy, m.yy, x, y); + }, + + rotateTo: function rotateTo(deg, x, y) { + var m = this; + var flip = m.yx / m.xx > m.yy / m.xy ? -1 : 1; + if (m.xx < 0 ? m.xy >= 0 : m.xy < 0) flip = -flip; + return this.rotate(deg - Math.atan2(flip * m.yx, flip * m.xx) * 180 / Math.PI, x, y); + }, + + scaleTo: function scaleTo(x, y) { + var m = this; + + var h = Math.sqrt(m.xx * m.xx + m.yx * m.yx); + m.xx /= h;m.yx /= h; + + h = Math.sqrt(m.yy * m.yy + m.xy * m.xy); + m.yy /= h;m.xy /= h; + + return this.scale(x, y); + }, + + resizeTo: function resizeTo(width, height) { + var w = this.width, + h = this.height; + if (!w || !h) return this; + return this.scaleTo(width / w, height / h); + }, + + inversePoint: function inversePoint(x, y) { + var a = this.xx, + b = this.yx, + c = this.xy, + d = this.yy, + e = this.x, + f = this.y; + var det = b * c - a * d; + if (det == 0) return null; + return { + x: (d * (e - x) + c * (y - f)) / det, + y: (a * (f - y) + b * (x - e)) / det + }; + }, + + point: function point(x, y) { + var m = this; + return { + x: m.xx * x + m.xy * y + m.x, + y: m.yx * x + m.yy * y + m.y + }; + } + +}); +}, 208, null, "art/core/transform.js"); +__d(/* Button */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Button.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var TouchableNativeFeedback = require(217 ); // 217 = TouchableNativeFeedback +var TouchableOpacity = require(218 ); // 218 = TouchableOpacity +var View = require(146 ); // 146 = View + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var Button = function (_React$Component) { + babelHelpers.inherits(Button, _React$Component); + + function Button() { + babelHelpers.classCallCheck(this, Button); + return babelHelpers.possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments)); + } + + babelHelpers.createClass(Button, [{ + key: 'render', + value: function render() { + var _props = this.props, + accessibilityLabel = _props.accessibilityLabel, + color = _props.color, + onPress = _props.onPress, + title = _props.title, + disabled = _props.disabled, + testID = _props.testID; + + var buttonStyles = [styles.button]; + var textStyles = [styles.text]; + var Touchable = Platform.OS === 'android' ? TouchableNativeFeedback : TouchableOpacity; + if (color && Platform.OS === 'ios') { + textStyles.push({ color: color }); + } else if (color) { + buttonStyles.push({ backgroundColor: color }); + } + if (disabled) { + buttonStyles.push(styles.buttonDisabled); + textStyles.push(styles.textDisabled); + } + invariant(typeof title === 'string', 'The title prop of a Button must be a string'); + var formattedTitle = Platform.OS === 'android' ? title.toUpperCase() : title; + return React.createElement( + Touchable, + { + accessibilityComponentType: 'button', + accessibilityLabel: accessibilityLabel, + accessibilityTraits: ['button'], + testID: testID, + disabled: disabled, + onPress: onPress, __source: { + fileName: _jsxFileName, + lineNumber: 115 + } + }, + React.createElement( + View, + { style: buttonStyles, __source: { + fileName: _jsxFileName, + lineNumber: 122 + } + }, + React.createElement( + Text, + { style: textStyles, __source: { + fileName: _jsxFileName, + lineNumber: 123 + } + }, + formattedTitle + ) + ) + ); + } + }]); + return Button; +}(React.Component); + +Button.propTypes = { + title: React.PropTypes.string.isRequired, + + accessibilityLabel: React.PropTypes.string, + + color: ColorPropType, + + disabled: React.PropTypes.bool, + + onPress: React.PropTypes.func.isRequired, + + testID: React.PropTypes.string +}; + +var defaultBlue = '#2196F3'; +if (Platform.OS === 'ios') { + defaultBlue = '#0C42FD'; +} + +var styles = StyleSheet.create({ + button: Platform.select({ + ios: {}, + android: { + elevation: 4, + backgroundColor: defaultBlue, + borderRadius: 2 + } + }), + text: Platform.select({ + ios: { + color: defaultBlue, + textAlign: 'center', + padding: 8, + fontSize: 18 + }, + android: { + textAlign: 'center', + color: 'white', + padding: 8, + fontWeight: '500' + } + }), + buttonDisabled: Platform.select({ + ios: {}, + android: { + elevation: 0, + backgroundColor: '#dfdfdf' + } + }), + textDisabled: Platform.select({ + ios: { + color: '#cdcdcd' + }, + android: { + color: '#a1a1a1' + } + }) +}); + +module.exports = Button; +}, 209, null, "Button"); +__d(/* Text */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Text/Text.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType +var TextStylePropTypes = require(139 ); // 139 = TextStylePropTypes +var Touchable = require(211 ); // 211 = Touchable + +var processColor = require(121 ); // 121 = processColor +var createReactNativeComponentClass = require(157 ); // 157 = createReactNativeComponentClass +var mergeFast = require(216 ); // 216 = mergeFast + +var PropTypes = React.PropTypes; + + +var stylePropType = StyleSheetPropType(TextStylePropTypes); + +var viewConfig = { + validAttributes: mergeFast(ReactNativeViewAttributes.UIView, { + isHighlighted: true, + numberOfLines: true, + ellipsizeMode: true, + allowFontScaling: true, + selectable: true, + selectionColor: true, + adjustsFontSizeToFit: true, + minimumFontScale: true, + textBreakStrategy: true + }), + uiViewClassName: 'RCTText' +}; + +var Text = React.createClass({ + displayName: 'Text', + + propTypes: { + ellipsizeMode: PropTypes.oneOf(['head', 'middle', 'tail', 'clip']), + + numberOfLines: PropTypes.number, + + textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']), + + onLayout: PropTypes.func, + + onPress: PropTypes.func, + + onLongPress: PropTypes.func, + + pressRetentionOffset: EdgeInsetsPropType, + + selectable: PropTypes.bool, + + selectionColor: ColorPropType, + + suppressHighlighting: PropTypes.bool, + style: stylePropType, + + testID: PropTypes.string, + + allowFontScaling: PropTypes.bool, + + accessible: PropTypes.bool, + + adjustsFontSizeToFit: PropTypes.bool, + + minimumFontScale: PropTypes.number + }, + getDefaultProps: function getDefaultProps() { + return { + accessible: true, + allowFontScaling: true, + ellipsizeMode: 'tail' + }; + }, + + getInitialState: function getInitialState() { + return mergeFast(Touchable.Mixin.touchableGetInitialState(), { + isHighlighted: false + }); + }, + mixins: [NativeMethodsMixin], + viewConfig: viewConfig, + getChildContext: function getChildContext() { + return { isInAParentText: true }; + }, + + childContextTypes: { + isInAParentText: PropTypes.bool + }, + contextTypes: { + isInAParentText: PropTypes.bool + }, + + _handlers: null, + _hasPressHandler: function _hasPressHandler() { + return !!this.props.onPress || !!this.props.onLongPress; + }, + + touchableHandleActivePressIn: null, + touchableHandleActivePressOut: null, + touchableHandlePress: null, + touchableHandleLongPress: null, + touchableGetPressRectOffset: null, + render: function render() { + var _this = this; + + var newProps = this.props; + if (this.props.onStartShouldSetResponder || this._hasPressHandler()) { + if (!this._handlers) { + this._handlers = { + onStartShouldSetResponder: function onStartShouldSetResponder() { + var shouldSetFromProps = _this.props.onStartShouldSetResponder && _this.props.onStartShouldSetResponder(); + var setResponder = shouldSetFromProps || _this._hasPressHandler(); + if (setResponder && !_this.touchableHandleActivePressIn) { + for (var key in Touchable.Mixin) { + if (typeof Touchable.Mixin[key] === 'function') { + _this[key] = Touchable.Mixin[key].bind(_this); + } + } + _this.touchableHandleActivePressIn = function () { + if (_this.props.suppressHighlighting || !_this._hasPressHandler()) { + return; + } + _this.setState({ + isHighlighted: true + }); + }; + + _this.touchableHandleActivePressOut = function () { + if (_this.props.suppressHighlighting || !_this._hasPressHandler()) { + return; + } + _this.setState({ + isHighlighted: false + }); + }; + + _this.touchableHandlePress = function (e) { + _this.props.onPress && _this.props.onPress(e); + }; + + _this.touchableHandleLongPress = function (e) { + _this.props.onLongPress && _this.props.onLongPress(e); + }; + + _this.touchableGetPressRectOffset = function () { + return this.props.pressRetentionOffset || PRESS_RECT_OFFSET; + }; + } + return setResponder; + }, + onResponderGrant: function (e, dispatchID) { + this.touchableHandleResponderGrant(e, dispatchID); + this.props.onResponderGrant && this.props.onResponderGrant.apply(this, arguments); + }.bind(this), + onResponderMove: function (e) { + this.touchableHandleResponderMove(e); + this.props.onResponderMove && this.props.onResponderMove.apply(this, arguments); + }.bind(this), + onResponderRelease: function (e) { + this.touchableHandleResponderRelease(e); + this.props.onResponderRelease && this.props.onResponderRelease.apply(this, arguments); + }.bind(this), + onResponderTerminate: function (e) { + this.touchableHandleResponderTerminate(e); + this.props.onResponderTerminate && this.props.onResponderTerminate.apply(this, arguments); + }.bind(this), + onResponderTerminationRequest: function () { + var allowTermination = this.touchableHandleResponderTerminationRequest(); + if (allowTermination && this.props.onResponderTerminationRequest) { + allowTermination = this.props.onResponderTerminationRequest.apply(this, arguments); + } + return allowTermination; + }.bind(this) + }; + } + newProps = babelHelpers.extends({}, this.props, this._handlers, { + isHighlighted: this.state.isHighlighted + }); + } + if (newProps.selectionColor != null) { + newProps = babelHelpers.extends({}, newProps, { + selectionColor: processColor(newProps.selectionColor) + }); + } + if (Touchable.TOUCH_TARGET_DEBUG && newProps.onPress) { + newProps = babelHelpers.extends({}, newProps, { + style: [this.props.style, { color: 'magenta' }] + }); + } + if (this.context.isInAParentText) { + return React.createElement(RCTVirtualText, babelHelpers.extends({}, newProps, { + __source: { + fileName: _jsxFileName, + lineNumber: 342 + } + })); + } else { + return React.createElement(RCTText, babelHelpers.extends({}, newProps, { + __source: { + fileName: _jsxFileName, + lineNumber: 344 + } + })); + } + } +}); + +var PRESS_RECT_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 }; + +var RCTText = createReactNativeComponentClass(viewConfig); +var RCTVirtualText = RCTText; + +if (Platform.OS === 'android') { + RCTVirtualText = createReactNativeComponentClass({ + validAttributes: mergeFast(ReactNativeViewAttributes.UIView, { + isHighlighted: true + }), + uiViewClassName: 'RCTVirtualText' + }); +} + +module.exports = Text; +}, 210, null, "Text"); +__d(/* Touchable */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Touchable/Touchable.js'; +var BoundingDimensions = require(212 ); // 212 = BoundingDimensions +var Platform = require(79 ); // 79 = Platform +var Position = require(213 ); // 213 = Position +var React = require(126 ); // 126 = React +var TVEventHandler = require(214 ); // 214 = TVEventHandler +var TouchEventUtils = require(215 ); // 215 = fbjs/lib/TouchEventUtils +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View + +var findNodeHandle = require(124 ); // 124 = findNodeHandle +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror +var normalizeColor = require(72 ); // 72 = normalizeColor + +var States = keyMirror({ + NOT_RESPONDER: null, + RESPONDER_INACTIVE_PRESS_IN: null, + RESPONDER_INACTIVE_PRESS_OUT: null, + RESPONDER_ACTIVE_PRESS_IN: null, + RESPONDER_ACTIVE_PRESS_OUT: null, + RESPONDER_ACTIVE_LONG_PRESS_IN: null, + RESPONDER_ACTIVE_LONG_PRESS_OUT: null, + ERROR: null +}); + +var IsActive = { + RESPONDER_ACTIVE_PRESS_OUT: true, + RESPONDER_ACTIVE_PRESS_IN: true +}; + +var IsPressingIn = { + RESPONDER_INACTIVE_PRESS_IN: true, + RESPONDER_ACTIVE_PRESS_IN: true, + RESPONDER_ACTIVE_LONG_PRESS_IN: true +}; + +var IsLongPressingIn = { + RESPONDER_ACTIVE_LONG_PRESS_IN: true +}; + +var Signals = keyMirror({ + DELAY: null, + RESPONDER_GRANT: null, + RESPONDER_RELEASE: null, + RESPONDER_TERMINATED: null, + ENTER_PRESS_RECT: null, + LEAVE_PRESS_RECT: null, + LONG_PRESS_DETECTED: null +}); + +var Transitions = { + NOT_RESPONDER: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, + RESPONDER_RELEASE: States.ERROR, + RESPONDER_TERMINATED: States.ERROR, + ENTER_PRESS_RECT: States.ERROR, + LEAVE_PRESS_RECT: States.ERROR, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_INACTIVE_PRESS_IN: { + DELAY: States.RESPONDER_ACTIVE_PRESS_IN, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_INACTIVE_PRESS_OUT: { + DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_ACTIVE_PRESS_IN: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN + }, + RESPONDER_ACTIVE_PRESS_OUT: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_ACTIVE_LONG_PRESS_IN: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, + LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN + }, + RESPONDER_ACTIVE_LONG_PRESS_OUT: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + error: { + DELAY: States.NOT_RESPONDER, + RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.NOT_RESPONDER, + LEAVE_PRESS_RECT: States.NOT_RESPONDER, + LONG_PRESS_DETECTED: States.NOT_RESPONDER + } +}; + +var HIGHLIGHT_DELAY_MS = 130; + +var PRESS_EXPAND_PX = 20; + +var LONG_PRESS_THRESHOLD = 500; + +var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS; + +var LONG_PRESS_ALLOWED_MOVEMENT = 10; + +var TouchableMixin = { + componentDidMount: function componentDidMount() { + if (!Platform.isTVOS) { + return; + } + + this._tvEventHandler = new TVEventHandler(); + this._tvEventHandler.enable(this, function (cmp, evt) { + var myTag = findNodeHandle(cmp); + evt.dispatchConfig = {}; + if (myTag === evt.tag) { + if (evt.eventType === 'focus') { + cmp.touchableHandleActivePressIn && cmp.touchableHandleActivePressIn(evt); + } else if (evt.eventType === 'blur') { + cmp.touchableHandleActivePressOut && cmp.touchableHandleActivePressOut(evt); + } else if (evt.eventType === 'select') { + cmp.touchableHandlePress && cmp.touchableHandlePress(evt); + } + } + }); + }, + + componentWillUnmount: function componentWillUnmount() { + if (this._tvEventHandler) { + this._tvEventHandler.disable(); + delete this._tvEventHandler; + } + this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); + this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); + this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); + }, + + touchableGetInitialState: function touchableGetInitialState() { + return { + touchable: { touchState: undefined, responderID: null } + }; + }, + + touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { + return !this.props.rejectResponderTermination; + }, + + touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { + return !this.props.disabled; + }, + + touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { + return true; + }, + + touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { + var dispatchID = e.currentTarget; + + e.persist(); + + this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); + this.pressOutDelayTimeout = null; + + this.state.touchable.touchState = States.NOT_RESPONDER; + this.state.touchable.responderID = dispatchID; + this._receiveSignal(Signals.RESPONDER_GRANT, e); + var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; + delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; + if (delayMS !== 0) { + this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); + } else { + this._handleDelay(e); + } + + var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; + longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; + this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); + }, + + touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { + this._receiveSignal(Signals.RESPONDER_RELEASE, e); + }, + + touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { + this._receiveSignal(Signals.RESPONDER_TERMINATED, e); + }, + + touchableHandleResponderMove: function touchableHandleResponderMove(e) { + if (this.state.touchable.touchState === States.RESPONDER_INACTIVE_PRESS_IN) { + return; + } + + if (!this.state.touchable.positionOnActivate) { + return; + } + + var positionOnActivate = this.state.touchable.positionOnActivate; + var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; + var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { + left: PRESS_EXPAND_PX, + right: PRESS_EXPAND_PX, + top: PRESS_EXPAND_PX, + bottom: PRESS_EXPAND_PX + }; + + var pressExpandLeft = pressRectOffset.left; + var pressExpandTop = pressRectOffset.top; + var pressExpandRight = pressRectOffset.right; + var pressExpandBottom = pressRectOffset.bottom; + + var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; + + if (hitSlop) { + pressExpandLeft += hitSlop.left; + pressExpandTop += hitSlop.top; + pressExpandRight += hitSlop.right; + pressExpandBottom += hitSlop.bottom; + } + + var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent); + var pageX = touch && touch.pageX; + var pageY = touch && touch.pageY; + + if (this.pressInLocation) { + var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); + if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { + this._cancelLongPressDelayTimeout(); + } + } + + var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; + if (isTouchWithinActive) { + this._receiveSignal(Signals.ENTER_PRESS_RECT, e); + var curState = this.state.touchable.touchState; + if (curState === States.RESPONDER_INACTIVE_PRESS_IN) { + this._cancelLongPressDelayTimeout(); + } + } else { + this._cancelLongPressDelayTimeout(); + this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); + } + }, + + _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { + var tag = this.state.touchable.responderID; + if (tag == null) { + return; + } + + UIManager.measure(tag, this._handleQueryLayout); + }, + + _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { + this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate); + this.state.touchable.dimensionsOnActivate && BoundingDimensions.release(this.state.touchable.dimensionsOnActivate); + this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); + this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h); + }, + + _handleDelay: function _handleDelay(e) { + this.touchableDelayTimeout = null; + this._receiveSignal(Signals.DELAY, e); + }, + + _handleLongDelay: function _handleLongDelay(e) { + this.longPressDelayTimeout = null; + var curState = this.state.touchable.touchState; + if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) { + console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'); + } else { + this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); + } + }, + + _receiveSignal: function _receiveSignal(signal, e) { + var responderID = this.state.touchable.responderID; + var curState = this.state.touchable.touchState; + var nextState = Transitions[curState] && Transitions[curState][signal]; + if (!responderID && signal === Signals.RESPONDER_RELEASE) { + return; + } + if (!nextState) { + throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`'); + } + if (nextState === States.ERROR) { + throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`'); + } + if (curState !== nextState) { + this._performSideEffectsForTransition(curState, nextState, signal, e); + this.state.touchable.touchState = nextState; + } + }, + + _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { + this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); + this.longPressDelayTimeout = null; + }, + + _isHighlight: function _isHighlight(state) { + return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; + }, + + _savePressInLocation: function _savePressInLocation(e) { + var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent); + var pageX = touch && touch.pageX; + var pageY = touch && touch.pageY; + var locationX = touch && touch.locationX; + var locationY = touch && touch.locationY; + this.pressInLocation = { pageX: pageX, pageY: pageY, locationX: locationX, locationY: locationY }; + }, + + _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { + var deltaX = aX - bX; + var deltaY = aY - bY; + return Math.sqrt(deltaX * deltaX + deltaY * deltaY); + }, + + _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { + var curIsHighlight = this._isHighlight(curState); + var newIsHighlight = this._isHighlight(nextState); + + var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; + + if (isFinalSignal) { + this._cancelLongPressDelayTimeout(); + } + + if (!IsActive[curState] && IsActive[nextState]) { + this._remeasureMetricsOnActivation(); + } + + if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { + this.touchableHandleLongPress && this.touchableHandleLongPress(e); + } + + if (newIsHighlight && !curIsHighlight) { + this._startHighlight(e); + } else if (!newIsHighlight && curIsHighlight) { + this._endHighlight(e); + } + + if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { + var hasLongPressHandler = !!this.props.onLongPress; + var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && (!hasLongPressHandler || !this.touchableLongPressCancelsPress()); + + var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; + if (shouldInvokePress && this.touchableHandlePress) { + if (!newIsHighlight && !curIsHighlight) { + this._startHighlight(e); + this._endHighlight(e); + } + this.touchableHandlePress(e); + } + } + + this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); + this.touchableDelayTimeout = null; + }, + + _startHighlight: function _startHighlight(e) { + this._savePressInLocation(e); + this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); + }, + + _endHighlight: function _endHighlight(e) { + var _this = this; + + if (this.touchableHandleActivePressOut) { + if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { + this.pressOutDelayTimeout = setTimeout(function () { + _this.touchableHandleActivePressOut(e); + }, this.touchableGetPressOutDelayMS()); + } else { + this.touchableHandleActivePressOut(e); + } + } + } + +}; + +var Touchable = { + Mixin: TouchableMixin, + TOUCH_TARGET_DEBUG: false, + renderDebugView: function renderDebugView(_ref) { + var color = _ref.color, + hitSlop = _ref.hitSlop; + + if (!Touchable.TOUCH_TARGET_DEBUG) { + return null; + } + if (!__DEV__) { + throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'); + } + var debugHitSlopStyle = {}; + hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 }; + for (var key in hitSlop) { + debugHitSlopStyle[key] = -hitSlop[key]; + } + var hexColor = '#' + ('00000000' + normalizeColor(color).toString(16)).substr(-8); + return React.createElement(View, { + pointerEvents: 'none', + style: babelHelpers.extends({ + position: 'absolute', + borderColor: hexColor.slice(0, -2) + '55', + borderWidth: 1, + borderStyle: 'dashed', + backgroundColor: hexColor.slice(0, -2) + '0F' }, debugHitSlopStyle), + __source: { + fileName: _jsxFileName, + lineNumber: 789 + } + }); + } +}; + +module.exports = Touchable; +}, 211, null, "Touchable"); +__d(/* BoundingDimensions */function(global, require, module, exports) { + +'use strict'; + +var PooledClass = require(47 ); // 47 = react/lib/PooledClass + +var twoArgumentPooler = PooledClass.twoArgumentPooler; + +function BoundingDimensions(width, height) { + this.width = width; + this.height = height; +} + +BoundingDimensions.prototype.destructor = function () { + this.width = null; + this.height = null; +}; + +BoundingDimensions.getPooledFromElement = function (element) { + return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight); +}; + +PooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler); + +module.exports = BoundingDimensions; +}, 212, null, "BoundingDimensions"); +__d(/* Position */function(global, require, module, exports) { + +'use strict'; + +var PooledClass = require(47 ); // 47 = react/lib/PooledClass + +var twoArgumentPooler = PooledClass.twoArgumentPooler; + +function Position(left, top) { + this.left = left; + this.top = top; +} + +Position.prototype.destructor = function () { + this.left = null; + this.top = null; +}; + +PooledClass.addPoolingTo(Position, twoArgumentPooler); + +module.exports = Position; +}, 213, null, "Position"); +__d(/* TVEventHandler */function(global, require, module, exports) { +'use strict'; + +var React = require(126 ); // 126 = React +var TVNavigationEventEmitter = require(80 ).TVNavigationEventEmitter; // 80 = NativeModules +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter + +function TVEventHandler() { + this.__nativeTVNavigationEventListener = null; + this.__nativeTVNavigationEventEmitter = null; +} + +TVEventHandler.prototype.enable = function (component, callback) { + if (!TVNavigationEventEmitter) { + return; + } + + this.__nativeTVNavigationEventEmitter = new NativeEventEmitter(TVNavigationEventEmitter); + this.__nativeTVNavigationEventListener = this.__nativeTVNavigationEventEmitter.addListener('onTVNavEvent', function (data) { + if (callback) { + callback(component, data); + } + }); +}; + +TVEventHandler.prototype.disable = function () { + if (this.__nativeTVNavigationEventListener) { + this.__nativeTVNavigationEventListener.remove(); + delete this.__nativeTVNavigationEventListener; + } + if (this.__nativeTVNavigationEventEmitter) { + delete this.__nativeTVNavigationEventEmitter; + } +}; + +module.exports = TVEventHandler; +}, 214, null, "TVEventHandler"); +__d(/* fbjs/lib/TouchEventUtils.js */function(global, require, module, exports) {"use strict"; + +var TouchEventUtils = { + extractSingleTouch: function extractSingleTouch(nativeEvent) { + var touches = nativeEvent.touches; + var changedTouches = nativeEvent.changedTouches; + var hasTouches = touches && touches.length > 0; + var hasChangedTouches = changedTouches && changedTouches.length > 0; + + return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; + } +}; + +module.exports = TouchEventUtils; +}, 215, null, "fbjs/lib/TouchEventUtils.js"); +__d(/* mergeFast */function(global, require, module, exports) { +'use strict'; + +var mergeFast = function mergeFast(one, two) { + var ret = {}; + for (var keyOne in one) { + ret[keyOne] = one[keyOne]; + } + for (var keyTwo in two) { + ret[keyTwo] = two[keyTwo]; + } + return ret; +}; + +module.exports = mergeFast; +}, 216, null, "mergeFast"); +__d(/* TouchableNativeFeedback */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js'; +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var View = require(146 ); // 146 = View + +var DummyTouchableNativeFeedback = function (_React$Component) { + babelHelpers.inherits(DummyTouchableNativeFeedback, _React$Component); + + function DummyTouchableNativeFeedback() { + babelHelpers.classCallCheck(this, DummyTouchableNativeFeedback); + return babelHelpers.possibleConstructorReturn(this, (DummyTouchableNativeFeedback.__proto__ || Object.getPrototypeOf(DummyTouchableNativeFeedback)).apply(this, arguments)); + } + + babelHelpers.createClass(DummyTouchableNativeFeedback, [{ + key: 'render', + value: function render() { + return React.createElement( + View, + { style: [styles.container, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 22 + } + }, + React.createElement( + Text, + { style: styles.info, __source: { + fileName: _jsxFileName, + lineNumber: 23 + } + }, + 'TouchableNativeFeedback is not supported on this platform!' + ) + ); + } + }]); + return DummyTouchableNativeFeedback; +}(React.Component); + +var styles = StyleSheet.create({ + container: { + height: 100, + width: 300, + backgroundColor: '#ffbcbc', + borderWidth: 1, + borderColor: 'red', + alignItems: 'center', + justifyContent: 'center', + margin: 10 + }, + info: { + color: '#333333', + margin: 20 + } +}); + +module.exports = DummyTouchableNativeFeedback; +}, 217, null, "TouchableNativeFeedback"); +__d(/* TouchableOpacity */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js'; + + +var Animated = require(219 ); // 219 = Animated +var Easing = require(235 ); // 235 = Easing +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var Touchable = require(211 ); // 211 = Touchable +var TouchableWithoutFeedback = require(295 ); // 295 = TouchableWithoutFeedback + +var ensurePositiveDelayProps = require(296 ); // 296 = ensurePositiveDelayProps +var flattenStyle = require(77 ); // 77 = flattenStyle + +var PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 }; + +var TouchableOpacity = React.createClass({ + displayName: 'TouchableOpacity', + + mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, TouchableWithoutFeedback.propTypes, { + activeOpacity: React.PropTypes.number, + focusedOpacity: React.PropTypes.number, + + tvParallaxProperties: React.PropTypes.object + }), + + getDefaultProps: function getDefaultProps() { + return { + activeOpacity: 0.2, + focusedOpacity: 0.7 + }; + }, + + getInitialState: function getInitialState() { + return babelHelpers.extends({}, this.touchableGetInitialState(), { + anim: new Animated.Value(1) + }); + }, + + componentDidMount: function componentDidMount() { + ensurePositiveDelayProps(this.props); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + ensurePositiveDelayProps(nextProps); + }, + + setOpacityTo: function setOpacityTo(value, duration) { + Animated.timing(this.state.anim, { + toValue: value, + duration: duration, + easing: Easing.inOut(Easing.quad), + useNativeDriver: true + }).start(); + }, + + touchableHandleActivePressIn: function touchableHandleActivePressIn(e) { + if (e.dispatchConfig.registrationName === 'onResponderGrant') { + this._opacityActive(0); + } else { + this._opacityActive(150); + } + this.props.onPressIn && this.props.onPressIn(e); + }, + + touchableHandleActivePressOut: function touchableHandleActivePressOut(e) { + this._opacityInactive(250); + this.props.onPressOut && this.props.onPressOut(e); + }, + + touchableHandlePress: function touchableHandlePress(e) { + this.props.onPress && this.props.onPress(e); + }, + + touchableHandleLongPress: function touchableHandleLongPress(e) { + this.props.onLongPress && this.props.onLongPress(e); + }, + + touchableGetPressRectOffset: function touchableGetPressRectOffset() { + return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET; + }, + + touchableGetHitSlop: function touchableGetHitSlop() { + return this.props.hitSlop; + }, + + touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() { + return this.props.delayPressIn || 0; + }, + + touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() { + return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500; + }, + + touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() { + return this.props.delayPressOut; + }, + + _opacityActive: function _opacityActive(duration) { + this.setOpacityTo(this.props.activeOpacity, duration); + }, + + _opacityInactive: function _opacityInactive(duration) { + var childStyle = flattenStyle(this.props.style) || {}; + this.setOpacityTo(childStyle.opacity === undefined ? 1 : childStyle.opacity, duration); + }, + + _opacityFocused: function _opacityFocused() { + this.setOpacityTo(this.props.focusedOpacity); + }, + + render: function render() { + return React.createElement( + Animated.View, + { + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityComponentType: this.props.accessibilityComponentType, + accessibilityTraits: this.props.accessibilityTraits, + style: [this.props.style, { opacity: this.state.anim }], + testID: this.props.testID, + onLayout: this.props.onLayout, + isTVSelectable: true, + tvParallaxProperties: this.props.tvParallaxProperties, + hitSlop: this.props.hitSlop, + onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, + onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest, + onResponderGrant: this.touchableHandleResponderGrant, + onResponderMove: this.touchableHandleResponderMove, + onResponderRelease: this.touchableHandleResponderRelease, + onResponderTerminate: this.touchableHandleResponderTerminate, __source: { + fileName: _jsxFileName, + lineNumber: 171 + } + }, + this.props.children, + Touchable.renderDebugView({ color: 'cyan', hitSlop: this.props.hitSlop }) + ); + } +}); + +module.exports = TouchableOpacity; +}, 218, null, "TouchableOpacity"); +__d(/* Animated */function(global, require, module, exports) { +'use strict'; + +var AnimatedImplementation = require(220 ); // 220 = AnimatedImplementation +var Image = require(237 ); // 237 = Image +var Text = require(210 ); // 210 = Text +var View = require(146 ); // 146 = View +var ScrollView = require(239 ); // 239 = ScrollView + +module.exports = babelHelpers.extends({}, AnimatedImplementation, { + View: AnimatedImplementation.createAnimatedComponent(View), + Text: AnimatedImplementation.createAnimatedComponent(Text), + Image: AnimatedImplementation.createAnimatedComponent(Image), + ScrollView: AnimatedImplementation.createAnimatedComponent(ScrollView) +}); +}, 219, null, "Animated"); +__d(/* AnimatedImplementation */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js'; +var InteractionManager = require(221 ); // 221 = InteractionManager +var Interpolation = require(230 ); // 230 = Interpolation +var NativeAnimatedHelper = require(231 ); // 231 = NativeAnimatedHelper +var React = require(126 ); // 126 = React +var Set = require(222 ); // 222 = Set +var SpringConfig = require(232 ); // 232 = SpringConfig +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var findNodeHandle = require(124 ); // 124 = findNodeHandle +var flattenStyle = require(77 ); // 77 = flattenStyle +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var requestAnimationFrame = require(233 ); // 233 = fbjs/lib/requestAnimationFrame + +var NativeAnimatedAPI = NativeAnimatedHelper.API; + +var warnedMissingNativeAnimated = false; + +function shouldUseNativeDriver(config) { + if (config.useNativeDriver && !NativeAnimatedHelper.isNativeAnimatedAvailable()) { + if (!warnedMissingNativeAnimated) { + console.warn('Animated: `useNativeDriver` is not supported because the native ' + 'animated module is missing. Falling back to JS-based animation. To ' + 'resolve this, add `RCTAnimation` module to this app, or remove ' + '`useNativeDriver`. ' + 'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420'); + warnedMissingNativeAnimated = true; + } + return false; + } + + return config.useNativeDriver || false; +} + +var Animated = function () { + function Animated() { + babelHelpers.classCallCheck(this, Animated); + } + + babelHelpers.createClass(Animated, [{ + key: '__attach', + value: function __attach() {} + }, { + key: '__detach', + value: function __detach() { + if (this.__isNative && this.__nativeTag != null) { + NativeAnimatedAPI.dropAnimatedNode(this.__nativeTag); + this.__nativeTag = undefined; + } + } + }, { + key: '__getValue', + value: function __getValue() {} + }, { + key: '__getAnimatedValue', + value: function __getAnimatedValue() { + return this.__getValue(); + } + }, { + key: '__addChild', + value: function __addChild(child) {} + }, { + key: '__removeChild', + value: function __removeChild(child) {} + }, { + key: '__getChildren', + value: function __getChildren() { + return []; + } + }, { + key: '__makeNative', + value: function __makeNative() { + if (!this.__isNative) { + throw new Error('This node cannot be made a "native" animated node'); + } + } + }, { + key: '__getNativeTag', + value: function __getNativeTag() { + NativeAnimatedHelper.assertNativeAnimatedModule(); + invariant(this.__isNative, 'Attempt to get native tag from node not marked as "native"'); + if (this.__nativeTag == null) { + var nativeTag = NativeAnimatedHelper.generateNewNodeTag(); + NativeAnimatedAPI.createAnimatedNode(nativeTag, this.__getNativeConfig()); + this.__nativeTag = nativeTag; + } + return this.__nativeTag; + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + throw new Error('This JS animated node type cannot be used as native animated node'); + } + }, { + key: 'toJSON', + value: function toJSON() { + return this.__getValue(); + } + }]); + return Animated; +}(); + +var Animation = function () { + function Animation() { + babelHelpers.classCallCheck(this, Animation); + } + + babelHelpers.createClass(Animation, [{ + key: 'start', + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {} + }, { + key: 'stop', + value: function stop() { + if (this.__nativeId) { + NativeAnimatedAPI.stopAnimation(this.__nativeId); + } + } + }, { + key: '__getNativeAnimationConfig', + value: function __getNativeAnimationConfig() { + throw new Error('This animation type cannot be offloaded to native'); + } + }, { + key: '__debouncedOnEnd', + value: function __debouncedOnEnd(result) { + var onEnd = this.__onEnd; + this.__onEnd = null; + onEnd && onEnd(result); + } + }, { + key: '__startNativeAnimation', + value: function __startNativeAnimation(animatedValue) { + animatedValue.__makeNative(); + this.__nativeId = NativeAnimatedHelper.generateNewAnimationId(); + NativeAnimatedAPI.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), this.__debouncedOnEnd.bind(this)); + } + }]); + return Animation; +}(); + +var AnimatedWithChildren = function (_Animated) { + babelHelpers.inherits(AnimatedWithChildren, _Animated); + + function AnimatedWithChildren() { + babelHelpers.classCallCheck(this, AnimatedWithChildren); + + var _this = babelHelpers.possibleConstructorReturn(this, (AnimatedWithChildren.__proto__ || Object.getPrototypeOf(AnimatedWithChildren)).call(this)); + + _this._children = []; + return _this; + } + + babelHelpers.createClass(AnimatedWithChildren, [{ + key: '__makeNative', + value: function __makeNative() { + if (!this.__isNative) { + this.__isNative = true; + for (var _iterator = this._children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var child = _ref; + + child.__makeNative(); + NativeAnimatedAPI.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + } + }, { + key: '__addChild', + value: function __addChild(child) { + if (this._children.length === 0) { + this.__attach(); + } + this._children.push(child); + if (this.__isNative) { + child.__makeNative(); + NativeAnimatedAPI.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + }, { + key: '__removeChild', + value: function __removeChild(child) { + var index = this._children.indexOf(child); + if (index === -1) { + console.warn('Trying to remove a child that doesn\'t exist'); + return; + } + if (this.__isNative && child.__isNative) { + NativeAnimatedAPI.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + this._children.splice(index, 1); + if (this._children.length === 0) { + this.__detach(); + } + } + }, { + key: '__getChildren', + value: function __getChildren() { + return this._children; + } + }]); + return AnimatedWithChildren; +}(Animated); + +function _flush(rootNode) { + var animatedStyles = new Set(); + function findAnimatedStyles(node) { + if (typeof node.update === 'function') { + animatedStyles.add(node); + } else { + node.__getChildren().forEach(findAnimatedStyles); + } + } + findAnimatedStyles(rootNode); + + animatedStyles.forEach(function (animatedStyle) { + return animatedStyle.update(); + }); +} + +var _easeInOut = void 0; +function easeInOut() { + if (!_easeInOut) { + var Easing = require(235 ); // 235 = Easing + _easeInOut = Easing.inOut(Easing.ease); + } + return _easeInOut; +} + +var TimingAnimation = function (_Animation) { + babelHelpers.inherits(TimingAnimation, _Animation); + + function TimingAnimation(config) { + babelHelpers.classCallCheck(this, TimingAnimation); + + var _this2 = babelHelpers.possibleConstructorReturn(this, (TimingAnimation.__proto__ || Object.getPrototypeOf(TimingAnimation)).call(this)); + + _this2._toValue = config.toValue; + _this2._easing = config.easing !== undefined ? config.easing : easeInOut(); + _this2._duration = config.duration !== undefined ? config.duration : 500; + _this2._delay = config.delay !== undefined ? config.delay : 0; + _this2.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; + _this2._useNativeDriver = shouldUseNativeDriver(config); + return _this2; + } + + babelHelpers.createClass(TimingAnimation, [{ + key: '__getNativeAnimationConfig', + value: function __getNativeAnimationConfig() { + var frameDuration = 1000.0 / 60.0; + var frames = []; + for (var dt = 0.0; dt < this._duration; dt += frameDuration) { + frames.push(this._easing(dt / this._duration)); + } + frames.push(this._easing(1)); + return { + type: 'frames', + frames: frames, + toValue: this._toValue, + delay: this._delay + }; + } + }, { + key: 'start', + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + var _this3 = this; + + this.__active = true; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + + var start = function start() { + if (_this3._duration === 0 && !_this3._useNativeDriver) { + _this3._onUpdate(_this3._toValue); + _this3.__debouncedOnEnd({ finished: true }); + } else { + _this3._startTime = Date.now(); + if (_this3._useNativeDriver) { + _this3.__startNativeAnimation(animatedValue); + } else { + _this3._animationFrame = requestAnimationFrame(_this3.onUpdate.bind(_this3)); + } + } + }; + if (this._delay) { + this._timeout = setTimeout(start, this._delay); + } else { + start(); + } + } + }, { + key: 'onUpdate', + value: function onUpdate() { + var now = Date.now(); + if (now >= this._startTime + this._duration) { + if (this._duration === 0) { + this._onUpdate(this._toValue); + } else { + this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue)); + } + this.__debouncedOnEnd({ finished: true }); + return; + } + + this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue)); + if (this.__active) { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: 'stop', + value: function stop() { + babelHelpers.get(TimingAnimation.prototype.__proto__ || Object.getPrototypeOf(TimingAnimation.prototype), 'stop', this).call(this); + this.__active = false; + clearTimeout(this._timeout); + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ finished: false }); + } + }]); + return TimingAnimation; +}(Animation); + +var DecayAnimation = function (_Animation2) { + babelHelpers.inherits(DecayAnimation, _Animation2); + + function DecayAnimation(config) { + babelHelpers.classCallCheck(this, DecayAnimation); + + var _this4 = babelHelpers.possibleConstructorReturn(this, (DecayAnimation.__proto__ || Object.getPrototypeOf(DecayAnimation)).call(this)); + + _this4._deceleration = config.deceleration !== undefined ? config.deceleration : 0.998; + _this4._velocity = config.velocity; + _this4._useNativeDriver = shouldUseNativeDriver(config); + _this4.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; + return _this4; + } + + babelHelpers.createClass(DecayAnimation, [{ + key: '__getNativeAnimationConfig', + value: function __getNativeAnimationConfig() { + return { + type: 'decay', + deceleration: this._deceleration, + velocity: this._velocity + }; + } + }, { + key: 'start', + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + this.__active = true; + this._lastValue = fromValue; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._startTime = Date.now(); + if (this._useNativeDriver) { + this.__startNativeAnimation(animatedValue); + } else { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: 'onUpdate', + value: function onUpdate() { + var now = Date.now(); + + var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime))); + + this._onUpdate(value); + + if (Math.abs(this._lastValue - value) < 0.1) { + this.__debouncedOnEnd({ finished: true }); + return; + } + + this._lastValue = value; + if (this.__active) { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: 'stop', + value: function stop() { + babelHelpers.get(DecayAnimation.prototype.__proto__ || Object.getPrototypeOf(DecayAnimation.prototype), 'stop', this).call(this); + this.__active = false; + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ finished: false }); + } + }]); + return DecayAnimation; +}(Animation); + +function withDefault(value, defaultValue) { + if (value === undefined || value === null) { + return defaultValue; + } + return value; +} + +var SpringAnimation = function (_Animation3) { + babelHelpers.inherits(SpringAnimation, _Animation3); + + function SpringAnimation(config) { + babelHelpers.classCallCheck(this, SpringAnimation); + + var _this5 = babelHelpers.possibleConstructorReturn(this, (SpringAnimation.__proto__ || Object.getPrototypeOf(SpringAnimation)).call(this)); + + _this5._overshootClamping = withDefault(config.overshootClamping, false); + _this5._restDisplacementThreshold = withDefault(config.restDisplacementThreshold, 0.001); + _this5._restSpeedThreshold = withDefault(config.restSpeedThreshold, 0.001); + _this5._initialVelocity = config.velocity; + _this5._lastVelocity = withDefault(config.velocity, 0); + _this5._toValue = config.toValue; + _this5._useNativeDriver = shouldUseNativeDriver(config); + _this5.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; + + var springConfig; + if (config.bounciness !== undefined || config.speed !== undefined) { + invariant(config.tension === undefined && config.friction === undefined, 'You can only define bounciness/speed or tension/friction but not both'); + springConfig = SpringConfig.fromBouncinessAndSpeed(withDefault(config.bounciness, 8), withDefault(config.speed, 12)); + } else { + springConfig = SpringConfig.fromOrigamiTensionAndFriction(withDefault(config.tension, 40), withDefault(config.friction, 7)); + } + _this5._tension = springConfig.tension; + _this5._friction = springConfig.friction; + return _this5; + } + + babelHelpers.createClass(SpringAnimation, [{ + key: '__getNativeAnimationConfig', + value: function __getNativeAnimationConfig() { + return { + type: 'spring', + overshootClamping: this._overshootClamping, + restDisplacementThreshold: this._restDisplacementThreshold, + restSpeedThreshold: this._restSpeedThreshold, + tension: this._tension, + friction: this._friction, + initialVelocity: withDefault(this._initialVelocity, this._lastVelocity), + toValue: this._toValue + }; + } + }, { + key: 'start', + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + this.__active = true; + this._startPosition = fromValue; + this._lastPosition = this._startPosition; + + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._lastTime = Date.now(); + + if (previousAnimation instanceof SpringAnimation) { + var internalState = previousAnimation.getInternalState(); + this._lastPosition = internalState.lastPosition; + this._lastVelocity = internalState.lastVelocity; + this._lastTime = internalState.lastTime; + } + if (this._initialVelocity !== undefined && this._initialVelocity !== null) { + this._lastVelocity = this._initialVelocity; + } + if (this._useNativeDriver) { + this.__startNativeAnimation(animatedValue); + } else { + this.onUpdate(); + } + } + }, { + key: 'getInternalState', + value: function getInternalState() { + return { + lastPosition: this._lastPosition, + lastVelocity: this._lastVelocity, + lastTime: this._lastTime + }; + } + }, { + key: 'onUpdate', + value: function onUpdate() { + var position = this._lastPosition; + var velocity = this._lastVelocity; + + var tempPosition = this._lastPosition; + var tempVelocity = this._lastVelocity; + + var MAX_STEPS = 64; + var now = Date.now(); + if (now > this._lastTime + MAX_STEPS) { + now = this._lastTime + MAX_STEPS; + } + + var TIMESTEP_MSEC = 1; + var numSteps = Math.floor((now - this._lastTime) / TIMESTEP_MSEC); + + for (var i = 0; i < numSteps; ++i) { + var step = TIMESTEP_MSEC / 1000; + + var aVelocity = velocity; + var aAcceleration = this._tension * (this._toValue - tempPosition) - this._friction * tempVelocity; + var tempPosition = position + aVelocity * step / 2; + var tempVelocity = velocity + aAcceleration * step / 2; + + var bVelocity = tempVelocity; + var bAcceleration = this._tension * (this._toValue - tempPosition) - this._friction * tempVelocity; + tempPosition = position + bVelocity * step / 2; + tempVelocity = velocity + bAcceleration * step / 2; + + var cVelocity = tempVelocity; + var cAcceleration = this._tension * (this._toValue - tempPosition) - this._friction * tempVelocity; + tempPosition = position + cVelocity * step / 2; + tempVelocity = velocity + cAcceleration * step / 2; + + var dVelocity = tempVelocity; + var dAcceleration = this._tension * (this._toValue - tempPosition) - this._friction * tempVelocity; + tempPosition = position + cVelocity * step / 2; + tempVelocity = velocity + cAcceleration * step / 2; + + var dxdt = (aVelocity + 2 * (bVelocity + cVelocity) + dVelocity) / 6; + var dvdt = (aAcceleration + 2 * (bAcceleration + cAcceleration) + dAcceleration) / 6; + + position += dxdt * step; + velocity += dvdt * step; + } + + this._lastTime = now; + this._lastPosition = position; + this._lastVelocity = velocity; + + this._onUpdate(position); + if (!this.__active) { + return; + } + + var isOvershooting = false; + if (this._overshootClamping && this._tension !== 0) { + if (this._startPosition < this._toValue) { + isOvershooting = position > this._toValue; + } else { + isOvershooting = position < this._toValue; + } + } + var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold; + var isDisplacement = true; + if (this._tension !== 0) { + isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold; + } + + if (isOvershooting || isVelocity && isDisplacement) { + if (this._tension !== 0) { + this._onUpdate(this._toValue); + } + + this.__debouncedOnEnd({ finished: true }); + return; + } + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + }, { + key: 'stop', + value: function stop() { + babelHelpers.get(SpringAnimation.prototype.__proto__ || Object.getPrototypeOf(SpringAnimation.prototype), 'stop', this).call(this); + this.__active = false; + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ finished: false }); + } + }]); + return SpringAnimation; +}(Animation); + +var _uniqueId = 1; + +var AnimatedValue = function (_AnimatedWithChildren) { + babelHelpers.inherits(AnimatedValue, _AnimatedWithChildren); + + function AnimatedValue(value) { + babelHelpers.classCallCheck(this, AnimatedValue); + + var _this6 = babelHelpers.possibleConstructorReturn(this, (AnimatedValue.__proto__ || Object.getPrototypeOf(AnimatedValue)).call(this)); + + _this6._value = value; + _this6._offset = 0; + _this6._animation = null; + _this6._listeners = {}; + return _this6; + } + + babelHelpers.createClass(AnimatedValue, [{ + key: '__detach', + value: function __detach() { + this.stopAnimation(); + babelHelpers.get(AnimatedValue.prototype.__proto__ || Object.getPrototypeOf(AnimatedValue.prototype), '__detach', this).call(this); + } + }, { + key: '__getValue', + value: function __getValue() { + return this._value + this._offset; + } + }, { + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedValue.prototype.__proto__ || Object.getPrototypeOf(AnimatedValue.prototype), '__makeNative', this).call(this); + + if (Object.keys(this._listeners).length) { + this._startListeningToNativeValueUpdates(); + } + } + }, { + key: 'setValue', + value: function setValue(value) { + if (this._animation) { + this._animation.stop(); + this._animation = null; + } + this._updateValue(value, !this.__isNative); + if (this.__isNative) { + NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value); + } + } + }, { + key: 'setOffset', + value: function setOffset(offset) { + this._offset = offset; + if (this.__isNative) { + NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset); + } + } + }, { + key: 'flattenOffset', + value: function flattenOffset() { + this._value += this._offset; + this._offset = 0; + if (this.__isNative) { + NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag()); + } + } + }, { + key: 'extractOffset', + value: function extractOffset() { + this._offset += this._value; + this._value = 0; + if (this.__isNative) { + NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag()); + } + } + }, { + key: 'addListener', + value: function addListener(callback) { + var id = String(_uniqueId++); + this._listeners[id] = callback; + if (this.__isNative) { + this._startListeningToNativeValueUpdates(); + } + return id; + } + }, { + key: 'removeListener', + value: function removeListener(id) { + delete this._listeners[id]; + if (this.__isNative && Object.keys(this._listeners).length === 0) { + this._stopListeningForNativeValueUpdates(); + } + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners() { + this._listeners = {}; + if (this.__isNative) { + this._stopListeningForNativeValueUpdates(); + } + } + }, { + key: '_startListeningToNativeValueUpdates', + value: function _startListeningToNativeValueUpdates() { + var _this7 = this; + + if (this.__nativeAnimatedValueListener) { + return; + } + + NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag()); + this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', function (data) { + if (data.tag !== _this7.__getNativeTag()) { + return; + } + _this7._updateValue(data.value, false); + }); + } + }, { + key: '_stopListeningForNativeValueUpdates', + value: function _stopListeningForNativeValueUpdates() { + if (!this.__nativeAnimatedValueListener) { + return; + } + + this.__nativeAnimatedValueListener.remove(); + this.__nativeAnimatedValueListener = null; + NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag()); + } + }, { + key: 'stopAnimation', + value: function stopAnimation(callback) { + this.stopTracking(); + this._animation && this._animation.stop(); + this._animation = null; + callback && callback(this.__getValue()); + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: 'animate', + value: function animate(animation, callback) { + var _this8 = this; + + var handle = null; + if (animation.__isInteraction) { + handle = InteractionManager.createInteractionHandle(); + } + var previousAnimation = this._animation; + this._animation && this._animation.stop(); + this._animation = animation; + animation.start(this._value, function (value) { + _this8._updateValue(value, true); + }, function (result) { + _this8._animation = null; + if (handle !== null) { + InteractionManager.clearInteractionHandle(handle); + } + callback && callback(result); + }, previousAnimation, this); + } + }, { + key: 'stopTracking', + value: function stopTracking() { + this._tracking && this._tracking.__detach(); + this._tracking = null; + } + }, { + key: 'track', + value: function track(tracking) { + this.stopTracking(); + this._tracking = tracking; + } + }, { + key: '_updateValue', + value: function _updateValue(value, flush) { + this._value = value; + if (flush) { + _flush(this); + } + for (var key in this._listeners) { + this._listeners[key]({ value: this.__getValue() }); + } + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'value', + value: this._value, + offset: this._offset + }; + } + }]); + return AnimatedValue; +}(AnimatedWithChildren); + +var AnimatedValueXY = function (_AnimatedWithChildren2) { + babelHelpers.inherits(AnimatedValueXY, _AnimatedWithChildren2); + + function AnimatedValueXY(valueIn) { + babelHelpers.classCallCheck(this, AnimatedValueXY); + + var _this9 = babelHelpers.possibleConstructorReturn(this, (AnimatedValueXY.__proto__ || Object.getPrototypeOf(AnimatedValueXY)).call(this)); + + var value = valueIn || { x: 0, y: 0 }; + if (typeof value.x === 'number' && typeof value.y === 'number') { + _this9.x = new AnimatedValue(value.x); + _this9.y = new AnimatedValue(value.y); + } else { + invariant(value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, 'AnimatedValueXY must be initalized with an object of numbers or ' + 'AnimatedValues.'); + _this9.x = value.x; + _this9.y = value.y; + } + _this9._listeners = {}; + return _this9; + } + + babelHelpers.createClass(AnimatedValueXY, [{ + key: 'setValue', + value: function setValue(value) { + this.x.setValue(value.x); + this.y.setValue(value.y); + } + }, { + key: 'setOffset', + value: function setOffset(offset) { + this.x.setOffset(offset.x); + this.y.setOffset(offset.y); + } + }, { + key: 'flattenOffset', + value: function flattenOffset() { + this.x.flattenOffset(); + this.y.flattenOffset(); + } + }, { + key: '__getValue', + value: function __getValue() { + return { + x: this.x.__getValue(), + y: this.y.__getValue() + }; + } + }, { + key: 'stopAnimation', + value: function stopAnimation(callback) { + this.x.stopAnimation(); + this.y.stopAnimation(); + callback && callback(this.__getValue()); + } + }, { + key: 'addListener', + value: function addListener(callback) { + var _this10 = this; + + var id = String(_uniqueId++); + var jointCallback = function jointCallback(_ref2) { + var number = _ref2.value; + + callback(_this10.__getValue()); + }; + this._listeners[id] = { + x: this.x.addListener(jointCallback), + y: this.y.addListener(jointCallback) + }; + return id; + } + }, { + key: 'removeListener', + value: function removeListener(id) { + this.x.removeListener(this._listeners[id].x); + this.y.removeListener(this._listeners[id].y); + delete this._listeners[id]; + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners() { + this.x.removeAllListeners(); + this.y.removeAllListeners(); + this._listeners = {}; + } + }, { + key: 'getLayout', + value: function getLayout() { + return { + left: this.x, + top: this.y + }; + } + }, { + key: 'getTranslateTransform', + value: function getTranslateTransform() { + return [{ translateX: this.x }, { translateY: this.y }]; + } + }]); + return AnimatedValueXY; +}(AnimatedWithChildren); + +var AnimatedInterpolation = function (_AnimatedWithChildren3) { + babelHelpers.inherits(AnimatedInterpolation, _AnimatedWithChildren3); + + function AnimatedInterpolation(parent, config) { + babelHelpers.classCallCheck(this, AnimatedInterpolation); + + var _this11 = babelHelpers.possibleConstructorReturn(this, (AnimatedInterpolation.__proto__ || Object.getPrototypeOf(AnimatedInterpolation)).call(this)); + + _this11._parent = parent; + _this11._config = config; + _this11._interpolation = Interpolation.create(config); + return _this11; + } + + babelHelpers.createClass(AnimatedInterpolation, [{ + key: '__getValue', + value: function __getValue() { + var parentValue = this._parent.__getValue(); + invariant(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.'); + + return this._interpolation(parentValue); + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__attach', + value: function __attach() { + this._parent.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._parent.__removeChild(this); + babelHelpers.get(AnimatedInterpolation.prototype.__proto__ || Object.getPrototypeOf(AnimatedInterpolation.prototype), '__detach', this).call(this); + } + }, { + key: '__transformDataType', + value: function __transformDataType(range) { + return range.map(function (value) { + if (typeof value !== 'string') { + return value; + } + if (/deg$/.test(value)) { + var degrees = parseFloat(value, 10) || 0; + var radians = degrees * Math.PI / 180.0; + return radians; + } else { + return parseFloat(value, 10) || 0; + } + }); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + if (__DEV__) { + NativeAnimatedHelper.validateInterpolation(this._config); + } + + return { + inputRange: this._config.inputRange, + + outputRange: this.__transformDataType(this._config.outputRange), + extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend', + extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend', + type: 'interpolation' + }; + } + }]); + return AnimatedInterpolation; +}(AnimatedWithChildren); + +var AnimatedAddition = function (_AnimatedWithChildren4) { + babelHelpers.inherits(AnimatedAddition, _AnimatedWithChildren4); + + function AnimatedAddition(a, b) { + babelHelpers.classCallCheck(this, AnimatedAddition); + + var _this12 = babelHelpers.possibleConstructorReturn(this, (AnimatedAddition.__proto__ || Object.getPrototypeOf(AnimatedAddition)).call(this)); + + _this12._a = typeof a === 'number' ? new AnimatedValue(a) : a; + _this12._b = typeof b === 'number' ? new AnimatedValue(b) : b; + return _this12; + } + + babelHelpers.createClass(AnimatedAddition, [{ + key: '__makeNative', + value: function __makeNative() { + this._a.__makeNative(); + this._b.__makeNative(); + babelHelpers.get(AnimatedAddition.prototype.__proto__ || Object.getPrototypeOf(AnimatedAddition.prototype), '__makeNative', this).call(this); + } + }, { + key: '__getValue', + value: function __getValue() { + return this._a.__getValue() + this._b.__getValue(); + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__attach', + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + babelHelpers.get(AnimatedAddition.prototype.__proto__ || Object.getPrototypeOf(AnimatedAddition.prototype), '__detach', this).call(this); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'addition', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + return AnimatedAddition; +}(AnimatedWithChildren); + +var AnimatedDivision = function (_AnimatedWithChildren5) { + babelHelpers.inherits(AnimatedDivision, _AnimatedWithChildren5); + + function AnimatedDivision(a, b) { + babelHelpers.classCallCheck(this, AnimatedDivision); + + var _this13 = babelHelpers.possibleConstructorReturn(this, (AnimatedDivision.__proto__ || Object.getPrototypeOf(AnimatedDivision)).call(this)); + + _this13._a = typeof a === 'number' ? new AnimatedValue(a) : a; + _this13._b = typeof b === 'number' ? new AnimatedValue(b) : b; + return _this13; + } + + babelHelpers.createClass(AnimatedDivision, [{ + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedDivision.prototype.__proto__ || Object.getPrototypeOf(AnimatedDivision.prototype), '__makeNative', this).call(this); + this._a.__makeNative(); + this._b.__makeNative(); + } + }, { + key: '__getValue', + value: function __getValue() { + var a = this._a.__getValue(); + var b = this._b.__getValue(); + if (b === 0) { + console.error('Detected division by zero in AnimatedDivision'); + } + return a / b; + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__attach', + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + babelHelpers.get(AnimatedDivision.prototype.__proto__ || Object.getPrototypeOf(AnimatedDivision.prototype), '__detach', this).call(this); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'division', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + return AnimatedDivision; +}(AnimatedWithChildren); + +var AnimatedMultiplication = function (_AnimatedWithChildren6) { + babelHelpers.inherits(AnimatedMultiplication, _AnimatedWithChildren6); + + function AnimatedMultiplication(a, b) { + babelHelpers.classCallCheck(this, AnimatedMultiplication); + + var _this14 = babelHelpers.possibleConstructorReturn(this, (AnimatedMultiplication.__proto__ || Object.getPrototypeOf(AnimatedMultiplication)).call(this)); + + _this14._a = typeof a === 'number' ? new AnimatedValue(a) : a; + _this14._b = typeof b === 'number' ? new AnimatedValue(b) : b; + return _this14; + } + + babelHelpers.createClass(AnimatedMultiplication, [{ + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedMultiplication.prototype.__proto__ || Object.getPrototypeOf(AnimatedMultiplication.prototype), '__makeNative', this).call(this); + this._a.__makeNative(); + this._b.__makeNative(); + } + }, { + key: '__getValue', + value: function __getValue() { + return this._a.__getValue() * this._b.__getValue(); + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__attach', + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + babelHelpers.get(AnimatedMultiplication.prototype.__proto__ || Object.getPrototypeOf(AnimatedMultiplication.prototype), '__detach', this).call(this); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'multiplication', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + return AnimatedMultiplication; +}(AnimatedWithChildren); + +var AnimatedModulo = function (_AnimatedWithChildren7) { + babelHelpers.inherits(AnimatedModulo, _AnimatedWithChildren7); + + function AnimatedModulo(a, modulus) { + babelHelpers.classCallCheck(this, AnimatedModulo); + + var _this15 = babelHelpers.possibleConstructorReturn(this, (AnimatedModulo.__proto__ || Object.getPrototypeOf(AnimatedModulo)).call(this)); + + _this15._a = a; + _this15._modulus = modulus; + return _this15; + } + + babelHelpers.createClass(AnimatedModulo, [{ + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedModulo.prototype.__proto__ || Object.getPrototypeOf(AnimatedModulo.prototype), '__makeNative', this).call(this); + this._a.__makeNative(); + } + }, { + key: '__getValue', + value: function __getValue() { + return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus; + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__attach', + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._a.__removeChild(this); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'modulus', + input: this._a.__getNativeTag(), + modulus: this._modulus + }; + } + }]); + return AnimatedModulo; +}(AnimatedWithChildren); + +var AnimatedDiffClamp = function (_AnimatedWithChildren8) { + babelHelpers.inherits(AnimatedDiffClamp, _AnimatedWithChildren8); + + function AnimatedDiffClamp(a, min, max) { + babelHelpers.classCallCheck(this, AnimatedDiffClamp); + + var _this16 = babelHelpers.possibleConstructorReturn(this, (AnimatedDiffClamp.__proto__ || Object.getPrototypeOf(AnimatedDiffClamp)).call(this)); + + _this16._a = a; + _this16._min = min; + _this16._max = max; + _this16._value = _this16._lastValue = _this16._a.__getValue(); + return _this16; + } + + babelHelpers.createClass(AnimatedDiffClamp, [{ + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedDiffClamp.prototype.__proto__ || Object.getPrototypeOf(AnimatedDiffClamp.prototype), '__makeNative', this).call(this); + this._a.__makeNative(); + } + }, { + key: 'interpolate', + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: '__getValue', + value: function __getValue() { + var value = this._a.__getValue(); + var diff = value - this._lastValue; + this._lastValue = value; + this._value = Math.min(Math.max(this._value + diff, this._min), this._max); + return this._value; + } + }, { + key: '__attach', + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._a.__removeChild(this); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + return { + type: 'diffclamp', + input: this._a.__getNativeTag(), + min: this._min, + max: this._max + }; + } + }]); + return AnimatedDiffClamp; +}(AnimatedWithChildren); + +var AnimatedTransform = function (_AnimatedWithChildren9) { + babelHelpers.inherits(AnimatedTransform, _AnimatedWithChildren9); + + function AnimatedTransform(transforms) { + babelHelpers.classCallCheck(this, AnimatedTransform); + + var _this17 = babelHelpers.possibleConstructorReturn(this, (AnimatedTransform.__proto__ || Object.getPrototypeOf(AnimatedTransform)).call(this)); + + _this17._transforms = transforms; + return _this17; + } + + babelHelpers.createClass(AnimatedTransform, [{ + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedTransform.prototype.__proto__ || Object.getPrototypeOf(AnimatedTransform.prototype), '__makeNative', this).call(this); + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + value.__makeNative(); + } + } + }); + } + }, { + key: '__getValue', + value: function __getValue() { + return this._transforms.map(function (transform) { + var result = {}; + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + result[key] = value.__getValue(); + } else { + result[key] = value; + } + } + return result; + }); + } + }, { + key: '__getAnimatedValue', + value: function __getAnimatedValue() { + return this._transforms.map(function (transform) { + var result = {}; + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + result[key] = value.__getAnimatedValue(); + } else { + result[key] = value; + } + } + return result; + }); + } + }, { + key: '__attach', + value: function __attach() { + var _this18 = this; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + value.__addChild(_this18); + } + } + }); + } + }, { + key: '__detach', + value: function __detach() { + var _this19 = this; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + value.__removeChild(_this19); + } + } + }); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + var transConfigs = []; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof Animated) { + transConfigs.push({ + type: 'animated', + property: key, + nodeTag: value.__getNativeTag() + }); + } else { + transConfigs.push({ + type: 'static', + property: key, + value: value + }); + } + } + }); + + NativeAnimatedHelper.validateTransform(transConfigs); + return { + type: 'transform', + transforms: transConfigs + }; + } + }]); + return AnimatedTransform; +}(AnimatedWithChildren); + +var AnimatedStyle = function (_AnimatedWithChildren10) { + babelHelpers.inherits(AnimatedStyle, _AnimatedWithChildren10); + + function AnimatedStyle(style) { + babelHelpers.classCallCheck(this, AnimatedStyle); + + var _this20 = babelHelpers.possibleConstructorReturn(this, (AnimatedStyle.__proto__ || Object.getPrototypeOf(AnimatedStyle)).call(this)); + + style = flattenStyle(style) || {}; + if (style.transform) { + style = babelHelpers.extends({}, style, { + transform: new AnimatedTransform(style.transform) + }); + } + _this20._style = style; + return _this20; + } + + babelHelpers.createClass(AnimatedStyle, [{ + key: '__getValue', + value: function __getValue() { + var style = {}; + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof Animated) { + if (!value.__isNative) { + style[key] = value.__getValue(); + } + } else { + style[key] = value; + } + } + return style; + } + }, { + key: '__getAnimatedValue', + value: function __getAnimatedValue() { + var style = {}; + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof Animated) { + style[key] = value.__getAnimatedValue(); + } + } + return style; + } + }, { + key: '__attach', + value: function __attach() { + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof Animated) { + value.__addChild(this); + } + } + } + }, { + key: '__detach', + value: function __detach() { + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof Animated) { + value.__removeChild(this); + } + } + } + }, { + key: '__makeNative', + value: function __makeNative() { + babelHelpers.get(AnimatedStyle.prototype.__proto__ || Object.getPrototypeOf(AnimatedStyle.prototype), '__makeNative', this).call(this); + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof Animated) { + value.__makeNative(); + } + } + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + var styleConfig = {}; + for (var styleKey in this._style) { + if (this._style[styleKey] instanceof Animated) { + styleConfig[styleKey] = this._style[styleKey].__getNativeTag(); + } + } + NativeAnimatedHelper.validateStyles(styleConfig); + return { + type: 'style', + style: styleConfig + }; + } + }]); + return AnimatedStyle; +}(AnimatedWithChildren); + +var AnimatedProps = function (_Animated2) { + babelHelpers.inherits(AnimatedProps, _Animated2); + + function AnimatedProps(props, callback) { + babelHelpers.classCallCheck(this, AnimatedProps); + + var _this21 = babelHelpers.possibleConstructorReturn(this, (AnimatedProps.__proto__ || Object.getPrototypeOf(AnimatedProps)).call(this)); + + if (props.style) { + props = babelHelpers.extends({}, props, { + style: new AnimatedStyle(props.style) + }); + } + _this21._props = props; + _this21._callback = callback; + _this21.__attach(); + return _this21; + } + + babelHelpers.createClass(AnimatedProps, [{ + key: '__getValue', + value: function __getValue() { + var props = {}; + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof Animated) { + if (!value.__isNative || value instanceof AnimatedStyle) { + props[key] = value.__getValue(); + } + } else if (value instanceof AnimatedEvent) { + props[key] = value.__getHandler(); + } else { + props[key] = value; + } + } + return props; + } + }, { + key: '__getAnimatedValue', + value: function __getAnimatedValue() { + var props = {}; + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof Animated) { + props[key] = value.__getAnimatedValue(); + } + } + return props; + } + }, { + key: '__attach', + value: function __attach() { + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof Animated) { + value.__addChild(this); + } + } + } + }, { + key: '__detach', + value: function __detach() { + if (this.__isNative && this._animatedView) { + this.__disconnectAnimatedView(); + } + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof Animated) { + value.__removeChild(this); + } + } + babelHelpers.get(AnimatedProps.prototype.__proto__ || Object.getPrototypeOf(AnimatedProps.prototype), '__detach', this).call(this); + } + }, { + key: 'update', + value: function update() { + this._callback(); + } + }, { + key: '__makeNative', + value: function __makeNative() { + if (!this.__isNative) { + this.__isNative = true; + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof Animated) { + value.__makeNative(); + } + } + if (this._animatedView) { + this.__connectAnimatedView(); + } + } + } + }, { + key: 'setNativeView', + value: function setNativeView(animatedView) { + invariant(this._animatedView === undefined, 'Animated view already set.'); + this._animatedView = animatedView; + if (this.__isNative) { + this.__connectAnimatedView(); + } + } + }, { + key: '__connectAnimatedView', + value: function __connectAnimatedView() { + invariant(this.__isNative, 'Expected node to be marked as "native"'); + var nativeViewTag = findNodeHandle(this._animatedView); + invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + NativeAnimatedAPI.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: '__disconnectAnimatedView', + value: function __disconnectAnimatedView() { + invariant(this.__isNative, 'Expected node to be marked as "native"'); + var nativeViewTag = findNodeHandle(this._animatedView); + invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + NativeAnimatedAPI.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: '__getNativeConfig', + value: function __getNativeConfig() { + var propsConfig = {}; + for (var propKey in this._props) { + var value = this._props[propKey]; + if (value instanceof Animated) { + propsConfig[propKey] = value.__getNativeTag(); + } + } + return { + type: 'props', + props: propsConfig + }; + } + }]); + return AnimatedProps; +}(Animated); + +function createAnimatedComponent(Component) { + var AnimatedComponent = function (_React$Component) { + babelHelpers.inherits(AnimatedComponent, _React$Component); + + function AnimatedComponent(props) { + babelHelpers.classCallCheck(this, AnimatedComponent); + + var _this22 = babelHelpers.possibleConstructorReturn(this, (AnimatedComponent.__proto__ || Object.getPrototypeOf(AnimatedComponent)).call(this, props)); + + _this22._setComponentRef = _this22._setComponentRef.bind(_this22); + return _this22; + } + + babelHelpers.createClass(AnimatedComponent, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this._propsAnimated && this._propsAnimated.__detach(); + this._detachNativeEvents(this.props); + } + }, { + key: 'setNativeProps', + value: function setNativeProps(props) { + this._component.setNativeProps(props); + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + this._attachProps(this.props); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this._propsAnimated.setNativeView(this._component); + + this._attachNativeEvents(this.props); + } + }, { + key: '_attachNativeEvents', + value: function _attachNativeEvents(newProps) { + if (newProps !== this.props) { + this._detachNativeEvents(this.props); + } + + var ref = this._component.getScrollableNode ? this._component.getScrollableNode() : this._component; + + for (var _key in newProps) { + var prop = newProps[_key]; + if (prop instanceof AnimatedEvent && prop.__isNative) { + prop.__attach(ref, _key); + } + } + } + }, { + key: '_detachNativeEvents', + value: function _detachNativeEvents(props) { + var ref = this._component.getScrollableNode ? this._component.getScrollableNode() : this._component; + + for (var _key2 in props) { + var prop = props[_key2]; + if (prop instanceof AnimatedEvent && prop.__isNative) { + prop.__detach(ref, _key2); + } + } + } + }, { + key: '_attachProps', + value: function _attachProps(nextProps) { + var _this23 = this; + + var oldPropsAnimated = this._propsAnimated; + + var callback = function callback() { + if (_this23._component.setNativeProps) { + if (!_this23._propsAnimated.__isNative) { + _this23._component.setNativeProps(_this23._propsAnimated.__getAnimatedValue()); + } else { + throw new Error('Attempting to run JS driven animation on animated ' + 'node that has been moved to "native" earlier by starting an ' + 'animation with `useNativeDriver: true`'); + } + } else { + _this23.forceUpdate(); + } + }; + + this._propsAnimated = new AnimatedProps(nextProps, callback); + + if (this._component) { + this._propsAnimated.setNativeView(this._component); + } + + oldPropsAnimated && oldPropsAnimated.__detach(); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + this._attachProps(nextProps); + this._attachNativeEvents(nextProps); + } + }, { + key: 'render', + value: function render() { + return React.createElement(Component, babelHelpers.extends({}, this._propsAnimated.__getValue(), { + ref: this._setComponentRef, + __source: { + fileName: _jsxFileName, + lineNumber: 1802 + } + })); + } + }, { + key: '_setComponentRef', + value: function _setComponentRef(c) { + this._component = c; + } + }, { + key: 'getNode', + value: function getNode() { + return this._component; + } + }]); + return AnimatedComponent; + }(React.Component); + + AnimatedComponent.propTypes = { + style: function style(props, propName, componentName) { + if (!Component.propTypes) { + return; + } + + for (var key in ViewStylePropTypes) { + if (!Component.propTypes[key] && props[key] !== undefined) { + console.warn('You are setting the style `{ ' + key + ': ... }` as a prop. You ' + 'should nest it in a style object. ' + 'E.g. `{ style: { ' + key + ': ... } }`'); + } + } + } + }; + + return AnimatedComponent; +} + +var AnimatedTracking = function (_Animated3) { + babelHelpers.inherits(AnimatedTracking, _Animated3); + + function AnimatedTracking(value, parent, animationClass, animationConfig, callback) { + babelHelpers.classCallCheck(this, AnimatedTracking); + + var _this24 = babelHelpers.possibleConstructorReturn(this, (AnimatedTracking.__proto__ || Object.getPrototypeOf(AnimatedTracking)).call(this)); + + _this24._value = value; + _this24._parent = parent; + _this24._animationClass = animationClass; + _this24._animationConfig = animationConfig; + _this24._callback = callback; + _this24.__attach(); + return _this24; + } + + babelHelpers.createClass(AnimatedTracking, [{ + key: '__getValue', + value: function __getValue() { + return this._parent.__getValue(); + } + }, { + key: '__attach', + value: function __attach() { + this._parent.__addChild(this); + } + }, { + key: '__detach', + value: function __detach() { + this._parent.__removeChild(this); + babelHelpers.get(AnimatedTracking.prototype.__proto__ || Object.getPrototypeOf(AnimatedTracking.prototype), '__detach', this).call(this); + } + }, { + key: 'update', + value: function update() { + this._value.animate(new this._animationClass(babelHelpers.extends({}, this._animationConfig, { + toValue: this._animationConfig.toValue.__getValue() + })), this._callback); + } + }]); + return AnimatedTracking; +}(Animated); + +var add = function add(a, b) { + return new AnimatedAddition(a, b); +}; + +var divide = function divide(a, b) { + return new AnimatedDivision(a, b); +}; + +var multiply = function multiply(a, b) { + return new AnimatedMultiplication(a, b); +}; + +var modulo = function modulo(a, modulus) { + return new AnimatedModulo(a, modulus); +}; + +var diffClamp = function diffClamp(a, min, max) { + return new AnimatedDiffClamp(a, min, max); +}; + +var _combineCallbacks = function _combineCallbacks(callback, config) { + if (callback && config.onComplete) { + return function () { + config.onComplete && config.onComplete.apply(config, arguments); + callback && callback.apply(undefined, arguments); + }; + } else { + return callback || config.onComplete; + } +}; + +var maybeVectorAnim = function maybeVectorAnim(value, config, anim) { + if (value instanceof AnimatedValueXY) { + var configX = babelHelpers.extends({}, config); + var configY = babelHelpers.extends({}, config); + for (var key in config) { + var _config$key = config[key], + x = _config$key.x, + y = _config$key.y; + + if (x !== undefined && y !== undefined) { + configX[key] = x; + configY[key] = y; + } + } + var aX = anim(value.x, configX); + var aY = anim(value.y, configY); + + return parallel([aX, aY], { stopTogether: false }); + } + return null; +}; + +var spring = function spring(value, config) { + return maybeVectorAnim(value, config, spring) || { + start: function start(callback) { + callback = _combineCallbacks(callback, config); + var singleValue = value; + var singleConfig = config; + singleValue.stopTracking(); + if (config.toValue instanceof Animated) { + singleValue.track(new AnimatedTracking(singleValue, config.toValue, SpringAnimation, singleConfig, callback)); + } else { + singleValue.animate(new SpringAnimation(singleConfig), callback); + } + }, + + stop: function stop() { + value.stopAnimation(); + } + }; +}; + +var timing = function timing(value, config) { + return maybeVectorAnim(value, config, timing) || { + start: function start(callback) { + callback = _combineCallbacks(callback, config); + var singleValue = value; + var singleConfig = config; + singleValue.stopTracking(); + if (config.toValue instanceof Animated) { + singleValue.track(new AnimatedTracking(singleValue, config.toValue, TimingAnimation, singleConfig, callback)); + } else { + singleValue.animate(new TimingAnimation(singleConfig), callback); + } + }, + + stop: function stop() { + value.stopAnimation(); + } + }; +}; + +var decay = function decay(value, config) { + return maybeVectorAnim(value, config, decay) || { + start: function start(callback) { + callback = _combineCallbacks(callback, config); + var singleValue = value; + var singleConfig = config; + singleValue.stopTracking(); + singleValue.animate(new DecayAnimation(singleConfig), callback); + }, + + stop: function stop() { + value.stopAnimation(); + } + }; +}; + +var sequence = function sequence(animations) { + var current = 0; + return { + start: function start(callback) { + var onComplete = function onComplete(result) { + if (!result.finished) { + callback && callback(result); + return; + } + + current++; + + if (current === animations.length) { + callback && callback(result); + return; + } + + animations[current].start(onComplete); + }; + + if (animations.length === 0) { + callback && callback({ finished: true }); + } else { + animations[current].start(onComplete); + } + }, + + stop: function stop() { + if (current < animations.length) { + animations[current].stop(); + } + } + }; +}; + +var parallel = function parallel(animations, config) { + var doneCount = 0; + + var hasEnded = {}; + var stopTogether = !(config && config.stopTogether === false); + + var result = { + start: function start(callback) { + if (doneCount === animations.length) { + callback && callback({ finished: true }); + return; + } + + animations.forEach(function (animation, idx) { + var cb = function cb(endResult) { + hasEnded[idx] = true; + doneCount++; + if (doneCount === animations.length) { + doneCount = 0; + callback && callback(endResult); + return; + } + + if (!endResult.finished && stopTogether) { + result.stop(); + } + }; + + if (!animation) { + cb({ finished: true }); + } else { + animation.start(cb); + } + }); + }, + + stop: function stop() { + animations.forEach(function (animation, idx) { + !hasEnded[idx] && animation.stop(); + hasEnded[idx] = true; + }); + } + }; + + return result; +}; + +var delay = function delay(time) { + return timing(new AnimatedValue(0), { toValue: 0, delay: time, duration: 0 }); +}; + +var stagger = function stagger(time, animations) { + return parallel(animations.map(function (animation, i) { + return sequence([delay(time * i), animation]); + })); +}; + +var AnimatedEvent = function () { + function AnimatedEvent(argMapping) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + babelHelpers.classCallCheck(this, AnimatedEvent); + + this._argMapping = argMapping; + this._listener = config.listener; + this.__isNative = shouldUseNativeDriver(config); + + if (this.__isNative) { + invariant(!this._listener, 'Listener is not supported for native driven events.'); + } + + if (__DEV__) { + this._validateMapping(); + } + } + + babelHelpers.createClass(AnimatedEvent, [{ + key: '__attach', + value: function __attach(viewRef, eventName) { + invariant(this.__isNative, 'Only native driven events need to be attached.'); + + var eventMappings = []; + + var traverse = function traverse(value, path) { + if (value instanceof AnimatedValue) { + value.__makeNative(); + + eventMappings.push({ + nativeEventPath: path, + animatedValueTag: value.__getNativeTag() + }); + } else if (typeof value === 'object') { + for (var _key3 in value) { + traverse(value[_key3], path.concat(_key3)); + } + } + }; + + invariant(this._argMapping[0] && this._argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.'); + + traverse(this._argMapping[0].nativeEvent, []); + + var viewTag = findNodeHandle(viewRef); + + eventMappings.forEach(function (mapping) { + NativeAnimatedAPI.addAnimatedEventToView(viewTag, eventName, mapping); + }); + } + }, { + key: '__detach', + value: function __detach(viewTag, eventName) { + invariant(this.__isNative, 'Only native driven events need to be detached.'); + + NativeAnimatedAPI.removeAnimatedEventFromView(viewTag, eventName); + } + }, { + key: '__getHandler', + value: function __getHandler() { + var _this25 = this; + + return function () { + for (var _len = arguments.length, args = Array(_len), _key4 = 0; _key4 < _len; _key4++) { + args[_key4] = arguments[_key4]; + } + + var traverse = function traverse(recMapping, recEvt, key) { + if (typeof recEvt === 'number' && recMapping instanceof AnimatedValue) { + recMapping.setValue(recEvt); + } else if (typeof recMapping === 'object') { + for (var mappingKey in recMapping) { + traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey); + } + } + }; + + if (!_this25.__isNative) { + _this25._argMapping.forEach(function (mapping, idx) { + traverse(mapping, args[idx], 'arg' + idx); + }); + } + + if (_this25._listener) { + _this25._listener.apply(null, args); + } + }; + } + }, { + key: '_validateMapping', + value: function _validateMapping() { + var traverse = function traverse(recMapping, recEvt, key) { + if (typeof recEvt === 'number') { + invariant(recMapping instanceof AnimatedValue, 'Bad mapping of type ' + typeof recMapping + ' for key ' + key + ', event value must map to AnimatedValue'); + return; + } + invariant(typeof recMapping === 'object', 'Bad mapping of type ' + typeof recMapping + ' for key ' + key); + invariant(typeof recEvt === 'object', 'Bad event of type ' + typeof recEvt + ' for key ' + key); + for (var mappingKey in recMapping) { + traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey); + } + }; + } + }]); + return AnimatedEvent; +}(); + +var event = function event(argMapping, config) { + var animatedEvent = new AnimatedEvent(argMapping, config); + if (animatedEvent.__isNative) { + return animatedEvent; + } else { + return animatedEvent.__getHandler(); + } +}; + +module.exports = { + Value: AnimatedValue, + + ValueXY: AnimatedValueXY, + + decay: decay, + + timing: timing, + + spring: spring, + + add: add, + + divide: divide, + + multiply: multiply, + + modulo: modulo, + + diffClamp: diffClamp, + + delay: delay, + + sequence: sequence, + + parallel: parallel, + + stagger: stagger, + + event: event, + + createAnimatedComponent: createAnimatedComponent, + + __PropsOnlyForTests: AnimatedProps +}; +}, 220, null, "AnimatedImplementation"); +__d(/* InteractionManager */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge +var EventEmitter = require(103 ); // 103 = EventEmitter +var Set = require(222 ); // 222 = Set +var TaskQueue = require(228 ); // 228 = TaskQueue + +var infoLog = require(229 ); // 229 = infoLog +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror + +var _emitter = new EventEmitter(); + +var DEBUG_DELAY = 0; +var DEBUG = false; + +var InteractionManager = { + Events: keyMirror({ + interactionStart: true, + interactionComplete: true + }), + + runAfterInteractions: function runAfterInteractions(task) { + var tasks = []; + var promise = new Promise(function (resolve) { + _scheduleUpdate(); + if (task) { + tasks.push(task); + } + tasks.push({ run: resolve, name: 'resolve ' + (task && task.name || '?') }); + _taskQueue.enqueueTasks(tasks); + }); + return { + then: promise.then.bind(promise), + done: function done() { + if (promise.done) { + return promise.done.apply(promise, arguments); + } else { + console.warn('Tried to call done when not supported by current Promise implementation.'); + } + }, + cancel: function cancel() { + _taskQueue.cancelTasks(tasks); + } + }; + }, + createInteractionHandle: function createInteractionHandle() { + DEBUG && infoLog('create interaction handle'); + _scheduleUpdate(); + var handle = ++_inc; + _addInteractionSet.add(handle); + return handle; + }, + clearInteractionHandle: function clearInteractionHandle(handle) { + DEBUG && infoLog('clear interaction handle'); + invariant(!!handle, 'Must provide a handle to clear.'); + _scheduleUpdate(); + _addInteractionSet.delete(handle); + _deleteInteractionSet.add(handle); + }, + + + addListener: _emitter.addListener.bind(_emitter), + + setDeadline: function setDeadline(deadline) { + _deadline = deadline; + } +}; + +var _interactionSet = new Set(); +var _addInteractionSet = new Set(); +var _deleteInteractionSet = new Set(); +var _taskQueue = new TaskQueue({ onMoreTasks: _scheduleUpdate }); +var _nextUpdateHandle = 0; +var _inc = 0; +var _deadline = -1; + +function _scheduleUpdate() { + if (!_nextUpdateHandle) { + if (_deadline > 0) { + _nextUpdateHandle = setTimeout(_processUpdate, 0 + DEBUG_DELAY); + } else { + _nextUpdateHandle = setImmediate(_processUpdate); + } + } +} + +function _processUpdate() { + _nextUpdateHandle = 0; + + var interactionCount = _interactionSet.size; + _addInteractionSet.forEach(function (handle) { + return _interactionSet.add(handle); + }); + _deleteInteractionSet.forEach(function (handle) { + return _interactionSet.delete(handle); + }); + var nextInteractionCount = _interactionSet.size; + + if (interactionCount !== 0 && nextInteractionCount === 0) { + _emitter.emit(InteractionManager.Events.interactionComplete); + } else if (interactionCount === 0 && nextInteractionCount !== 0) { + _emitter.emit(InteractionManager.Events.interactionStart); + } + + if (nextInteractionCount === 0) { + while (_taskQueue.hasTasksToProcess()) { + _taskQueue.processNext(); + if (_deadline > 0 && BatchedBridge.getEventLoopRunningTime() >= _deadline) { + _scheduleUpdate(); + break; + } + } + } + _addInteractionSet.clear(); + _deleteInteractionSet.clear(); +} + +module.exports = InteractionManager; +}, 221, null, "InteractionManager"); +__d(/* Set */function(global, require, module, exports) { + +'use strict'; + +var Map = require(223 ); // 223 = Map + +var _shouldPolyfillES6Collection = require(224 ); // 224 = _shouldPolyfillES6Collection +var toIterator = require(227 ); // 227 = toIterator + +module.exports = function (global) { + if (!_shouldPolyfillES6Collection('Set')) { + return global.Set; + } + + var Set = function () { + function Set(iterable) { + babelHelpers.classCallCheck(this, Set); + + if (this == null || typeof this !== 'object' && typeof this !== 'function') { + throw new TypeError('Wrong set object type.'); + } + + initSet(this); + + if (iterable != null) { + var it = toIterator(iterable); + var next; + while (!(next = it.next()).done) { + this.add(next.value); + } + } + } + + babelHelpers.createClass(Set, [{ + key: 'add', + value: function add(value) { + this._map.set(value, value); + this.size = this._map.size; + return this; + } + }, { + key: 'clear', + value: function clear() { + initSet(this); + } + }, { + key: 'delete', + value: function _delete(value) { + var ret = this._map.delete(value); + this.size = this._map.size; + return ret; + } + }, { + key: 'entries', + value: function entries() { + return this._map.entries(); + } + }, { + key: 'forEach', + value: function forEach(callback) { + var thisArg = arguments[1]; + var it = this._map.keys(); + var next; + while (!(next = it.next()).done) { + callback.call(thisArg, next.value, next.value, this); + } + } + }, { + key: 'has', + value: function has(value) { + return this._map.has(value); + } + }, { + key: 'values', + value: function values() { + return this._map.values(); + } + }]); + return Set; + }(); + + Set.prototype[toIterator.ITERATOR_SYMBOL] = Set.prototype.values; + + Set.prototype.keys = Set.prototype.values; + + function initSet(set) { + set._map = new Map(); + set.size = set._map.size; + } + + return Set; +}(Function('return this')()); +}, 222, null, "Set"); +__d(/* Map */function(global, require, module, exports) { + +'use strict'; + +var _shouldPolyfillES6Collection = require(224 ); // 224 = _shouldPolyfillES6Collection +var guid = require(225 ); // 225 = guid +var isNode = require(226 ); // 226 = fbjs/lib/isNode +var toIterator = require(227 ); // 227 = toIterator + +module.exports = function (global, undefined) { + if (!_shouldPolyfillES6Collection('Map')) { + return global.Map; + } + + var KIND_KEY = 'key'; + var KIND_VALUE = 'value'; + var KIND_KEY_VALUE = 'key+value'; + + var KEY_PREFIX = '$map_'; + + var SECRET_SIZE_PROP; + if (__DEV__) { + SECRET_SIZE_PROP = '$size' + guid(); + } + + var OLD_IE_HASH_PREFIX = 'IE_HASH_'; + + var Map = function () { + function Map(iterable) { + babelHelpers.classCallCheck(this, Map); + + if (!isObject(this)) { + throw new TypeError('Wrong map object type.'); + } + + initMap(this); + + if (iterable != null) { + var it = toIterator(iterable); + var next; + while (!(next = it.next()).done) { + if (!isObject(next.value)) { + throw new TypeError('Expected iterable items to be pair objects.'); + } + this.set(next.value[0], next.value[1]); + } + } + } + + babelHelpers.createClass(Map, [{ + key: 'clear', + value: function clear() { + initMap(this); + } + }, { + key: 'has', + value: function has(key) { + var index = getIndex(this, key); + return !!(index != null && this._mapData[index]); + } + }, { + key: 'set', + value: function set(key, value) { + var index = getIndex(this, key); + + if (index != null && this._mapData[index]) { + this._mapData[index][1] = value; + } else { + index = this._mapData.push([key, value]) - 1; + setIndex(this, key, index); + if (__DEV__) { + this[SECRET_SIZE_PROP] += 1; + } else { + this.size += 1; + } + } + + return this; + } + }, { + key: 'get', + value: function get(key) { + var index = getIndex(this, key); + if (index == null) { + return undefined; + } else { + return this._mapData[index][1]; + } + } + }, { + key: 'delete', + value: function _delete(key) { + var index = getIndex(this, key); + if (index != null && this._mapData[index]) { + setIndex(this, key, undefined); + this._mapData[index] = undefined; + if (__DEV__) { + this[SECRET_SIZE_PROP] -= 1; + } else { + this.size -= 1; + } + return true; + } else { + return false; + } + } + }, { + key: 'entries', + value: function entries() { + return new MapIterator(this, KIND_KEY_VALUE); + } + }, { + key: 'keys', + value: function keys() { + return new MapIterator(this, KIND_KEY); + } + }, { + key: 'values', + value: function values() { + return new MapIterator(this, KIND_VALUE); + } + }, { + key: 'forEach', + value: function forEach(callback, thisArg) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be callable.'); + } + + var boundCallback = callback.bind(thisArg || undefined); + var mapData = this._mapData; + + for (var i = 0; i < mapData.length; i++) { + var entry = mapData[i]; + if (entry != null) { + boundCallback(entry[1], entry[0], this); + } + } + } + }]); + return Map; + }(); + + Map.prototype[toIterator.ITERATOR_SYMBOL] = Map.prototype.entries; + + var MapIterator = function () { + function MapIterator(map, kind) { + babelHelpers.classCallCheck(this, MapIterator); + + if (!(isObject(map) && map._mapData)) { + throw new TypeError('Object is not a map.'); + } + + if ([KIND_KEY, KIND_KEY_VALUE, KIND_VALUE].indexOf(kind) === -1) { + throw new Error('Invalid iteration kind.'); + } + + this._map = map; + this._nextIndex = 0; + this._kind = kind; + } + + babelHelpers.createClass(MapIterator, [{ + key: 'next', + value: function next() { + if (!this instanceof Map) { + throw new TypeError('Expected to be called on a MapIterator.'); + } + + var map = this._map; + var index = this._nextIndex; + var kind = this._kind; + + if (map == null) { + return createIterResultObject(undefined, true); + } + + var entries = map._mapData; + + while (index < entries.length) { + var record = entries[index]; + + index += 1; + this._nextIndex = index; + + if (record) { + if (kind === KIND_KEY) { + return createIterResultObject(record[0], false); + } else if (kind === KIND_VALUE) { + return createIterResultObject(record[1], false); + } else if (kind) { + return createIterResultObject(record, false); + } + } + } + + this._map = undefined; + + return createIterResultObject(undefined, true); + } + }]); + return MapIterator; + }(); + + MapIterator.prototype[toIterator.ITERATOR_SYMBOL] = function () { + return this; + }; + + function getIndex(map, key) { + if (isObject(key)) { + var hash = getHash(key); + return map._objectIndex[hash]; + } else { + var prefixedKey = KEY_PREFIX + key; + if (typeof key === 'string') { + return map._stringIndex[prefixedKey]; + } else { + return map._otherIndex[prefixedKey]; + } + } + } + + function setIndex(map, key, index) { + var shouldDelete = index == null; + + if (isObject(key)) { + var hash = getHash(key); + if (shouldDelete) { + delete map._objectIndex[hash]; + } else { + map._objectIndex[hash] = index; + } + } else { + var prefixedKey = KEY_PREFIX + key; + if (typeof key === 'string') { + if (shouldDelete) { + delete map._stringIndex[prefixedKey]; + } else { + map._stringIndex[prefixedKey] = index; + } + } else { + if (shouldDelete) { + delete map._otherIndex[prefixedKey]; + } else { + map._otherIndex[prefixedKey] = index; + } + } + } + } + + function initMap(map) { + map._mapData = []; + + map._objectIndex = {}; + + map._stringIndex = {}; + + map._otherIndex = {}; + + if (__DEV__) { + if (isES5) { + if (map.hasOwnProperty(SECRET_SIZE_PROP)) { + map[SECRET_SIZE_PROP] = 0; + } else { + Object.defineProperty(map, SECRET_SIZE_PROP, { + value: 0, + writable: true + }); + Object.defineProperty(map, 'size', { + set: function set(v) { + console.error('PLEASE FIX ME: You are changing the map size property which ' + 'should not be writable and will break in production.'); + throw new Error('The map size property is not writable.'); + }, + get: function get() { + return map[SECRET_SIZE_PROP]; + } + }); + } + + return; + } + } + + map.size = 0; + } + + function isObject(o) { + return o != null && (typeof o === 'object' || typeof o === 'function'); + } + + function createIterResultObject(value, done) { + return { value: value, done: done }; + } + + var isES5 = function () { + try { + Object.defineProperty({}, 'x', {}); + return true; + } catch (e) { + return false; + } + }(); + + function isExtensible(o) { + if (!isES5) { + return true; + } else { + return Object.isExtensible(o); + } + } + + function getIENodeHash(node) { + var uniqueID; + switch (node.nodeType) { + case 1: + uniqueID = node.uniqueID; + break; + case 9: + uniqueID = node.documentElement.uniqueID; + break; + default: + return null; + } + + if (uniqueID) { + return OLD_IE_HASH_PREFIX + uniqueID; + } else { + return null; + } + } + + var getHash = function () { + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + var hashProperty = guid(); + var hashCounter = 0; + + return function getHash(o) { + if (o[hashProperty]) { + return o[hashProperty]; + } else if (!isES5 && o.propertyIsEnumerable && o.propertyIsEnumerable[hashProperty]) { + return o.propertyIsEnumerable[hashProperty]; + } else if (!isES5 && isNode(o) && getIENodeHash(o)) { + return getIENodeHash(o); + } else if (!isES5 && o[hashProperty]) { + return o[hashProperty]; + } + + if (isExtensible(o)) { + hashCounter += 1; + if (isES5) { + Object.defineProperty(o, hashProperty, { + enumerable: false, + writable: false, + configurable: false, + value: hashCounter + }); + } else if (o.propertyIsEnumerable) { + o.propertyIsEnumerable = function () { + return propIsEnumerable.apply(this, arguments); + }; + o.propertyIsEnumerable[hashProperty] = hashCounter; + } else if (isNode(o)) { + o[hashProperty] = hashCounter; + } else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + return hashCounter; + } else { + throw new Error('Non-extensible objects are not allowed as keys.'); + } + }; + }(); + + return Map; +}(Function('return this')()); +}, 223, null, "Map"); +__d(/* _shouldPolyfillES6Collection */function(global, require, module, exports) { +'use strict'; + +function shouldPolyfillES6Collection(collectionName) { + var Collection = global[collectionName]; + if (Collection == null) { + return true; + } + + if (typeof global.Symbol !== 'function') { + return true; + } + + var proto = Collection.prototype; + + return Collection == null || typeof Collection !== 'function' || typeof proto.clear !== 'function' || new Collection().size !== 0 || typeof proto.keys !== 'function' || typeof proto.forEach !== 'function'; +} + +module.exports = shouldPolyfillES6Collection; +}, 224, null, "_shouldPolyfillES6Collection"); +__d(/* guid */function(global, require, module, exports) { + +'use strict'; + +function guid() { + return 'f' + (Math.random() * (1 << 30)).toString(16).replace('.', ''); +} + +module.exports = guid; +}, 225, null, "guid"); +__d(/* fbjs/lib/isNode.js */function(global, require, module, exports) {'use strict'; + +function isNode(object) { + var doc = object ? object.ownerDocument || object : document; + var defaultView = doc.defaultView || window; + return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); +} + +module.exports = isNode; +}, 226, null, "fbjs/lib/isNode.js"); +__d(/* toIterator */function(global, require, module, exports) { +'use strict'; + +var KIND_KEY = 'key'; +var KIND_VALUE = 'value'; +var KIND_KEY_VAL = 'key+value'; + +var ITERATOR_SYMBOL = typeof Symbol === 'function' ? typeof Symbol === 'function' ? Symbol.iterator : '@@iterator' : '@@iterator'; + +var toIterator = function () { + if (!(Array.prototype[ITERATOR_SYMBOL] && String.prototype[ITERATOR_SYMBOL])) { + return function () { + var ArrayIterator = function () { + function ArrayIterator(array, kind) { + babelHelpers.classCallCheck(this, ArrayIterator); + + if (!Array.isArray(array)) { + throw new TypeError('Object is not an Array'); + } + this._iteratedObject = array; + this._kind = kind; + this._nextIndex = 0; + } + + babelHelpers.createClass(ArrayIterator, [{ + key: 'next', + value: function next() { + if (!this instanceof ArrayIterator) { + throw new TypeError('Object is not an ArrayIterator'); + } + + if (this._iteratedObject == null) { + return createIterResultObject(undefined, true); + } + + var array = this._iteratedObject; + var len = this._iteratedObject.length; + var index = this._nextIndex; + var kind = this._kind; + + if (index >= len) { + this._iteratedObject = undefined; + return createIterResultObject(undefined, true); + } + + this._nextIndex = index + 1; + + if (kind === KIND_KEY) { + return createIterResultObject(index, false); + } else if (kind === KIND_VALUE) { + return createIterResultObject(array[index], false); + } else if (kind === KIND_KEY_VAL) { + return createIterResultObject([index, array[index]], false); + } + } + }, { + key: '@@iterator', + value: function iterator() { + return this; + } + }]); + return ArrayIterator; + }(); + + var StringIterator = function () { + function StringIterator(string) { + babelHelpers.classCallCheck(this, StringIterator); + + if (typeof string !== 'string') { + throw new TypeError('Object is not a string'); + } + this._iteratedString = string; + this._nextIndex = 0; + } + + babelHelpers.createClass(StringIterator, [{ + key: 'next', + value: function next() { + if (!this instanceof StringIterator) { + throw new TypeError('Object is not a StringIterator'); + } + + if (this._iteratedString == null) { + return createIterResultObject(undefined, true); + } + + var index = this._nextIndex; + var s = this._iteratedString; + var len = s.length; + + if (index >= len) { + this._iteratedString = undefined; + return createIterResultObject(undefined, true); + } + + var ret; + var first = s.charCodeAt(index); + + if (first < 0xD800 || first > 0xDBFF || index + 1 === len) { + ret = s[index]; + } else { + var second = s.charCodeAt(index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + ret = s[index]; + } else { + ret = s[index] + s[index + 1]; + } + } + + this._nextIndex = index + ret.length; + + return createIterResultObject(ret, false); + } + }, { + key: '@@iterator', + value: function iterator() { + return this; + } + }]); + return StringIterator; + }(); + + function createIterResultObject(value, done) { + return { value: value, done: done }; + } + + return function (object, kind) { + if (typeof object === 'string') { + return new StringIterator(object); + } else if (Array.isArray(object)) { + return new ArrayIterator(object, kind || KIND_VALUE); + } else { + return object[ITERATOR_SYMBOL](); + } + }; + }(); + } else { + return function (object) { + return object[ITERATOR_SYMBOL](); + }; + } +}(); + +babelHelpers.extends(toIterator, { + KIND_KEY: KIND_KEY, + KIND_VALUE: KIND_VALUE, + KIND_KEY_VAL: KIND_KEY_VAL, + ITERATOR_SYMBOL: ITERATOR_SYMBOL +}); + +module.exports = toIterator; +}, 227, null, "toIterator"); +__d(/* TaskQueue */function(global, require, module, exports) { +'use strict'; + +var infoLog = require(229 ); // 229 = infoLog +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var DEBUG = false; + +var TaskQueue = function () { + function TaskQueue(_ref) { + var onMoreTasks = _ref.onMoreTasks; + babelHelpers.classCallCheck(this, TaskQueue); + + this._onMoreTasks = onMoreTasks; + this._queueStack = [{ tasks: [], popable: false }]; + } + + babelHelpers.createClass(TaskQueue, [{ + key: 'enqueue', + value: function enqueue(task) { + this._getCurrentQueue().push(task); + } + }, { + key: 'enqueueTasks', + value: function enqueueTasks(tasks) { + var _this = this; + + tasks.forEach(function (task) { + return _this.enqueue(task); + }); + } + }, { + key: 'cancelTasks', + value: function cancelTasks(tasksToCancel) { + this._queueStack = this._queueStack.map(function (queue) { + return babelHelpers.extends({}, queue, { + tasks: queue.tasks.filter(function (task) { + return tasksToCancel.indexOf(task) === -1; + }) + }); + }).filter(function (queue, idx) { + return queue.tasks.length > 0 || idx === 0; + }); + } + }, { + key: 'hasTasksToProcess', + value: function hasTasksToProcess() { + return this._getCurrentQueue().length > 0; + } + }, { + key: 'processNext', + value: function processNext() { + var queue = this._getCurrentQueue(); + if (queue.length) { + var task = queue.shift(); + try { + if (task.gen) { + DEBUG && infoLog('genPromise for task ' + task.name); + this._genPromise(task); + } else if (task.run) { + DEBUG && infoLog('run task ' + task.name); + task.run(); + } else { + invariant(typeof task === 'function', 'Expected Function, SimpleTask, or PromiseTask, but got:\n' + JSON.stringify(task, null, 2)); + DEBUG && infoLog('run anonymous task'); + task(); + } + } catch (e) { + e.message = 'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message; + throw e; + } + } + } + }, { + key: '_getCurrentQueue', + value: function _getCurrentQueue() { + var stackIdx = this._queueStack.length - 1; + var queue = this._queueStack[stackIdx]; + if (queue.popable && queue.tasks.length === 0 && this._queueStack.length > 1) { + this._queueStack.pop(); + DEBUG && infoLog('popped queue: ', { stackIdx: stackIdx, queueStackSize: this._queueStack.length }); + return this._getCurrentQueue(); + } else { + return queue.tasks; + } + } + }, { + key: '_genPromise', + value: function _genPromise(task) { + var _this2 = this; + + this._queueStack.push({ tasks: [], popable: false }); + var stackIdx = this._queueStack.length - 1; + DEBUG && infoLog('push new queue: ', { stackIdx: stackIdx }); + DEBUG && infoLog('exec gen task ' + task.name); + task.gen().then(function () { + DEBUG && infoLog('onThen for gen task ' + task.name, { stackIdx: stackIdx, queueStackSize: _this2._queueStack.length }); + _this2._queueStack[stackIdx].popable = true; + _this2.hasTasksToProcess() && _this2._onMoreTasks(); + }).catch(function (ex) { + ex.message = 'TaskQueue: Error resolving Promise in task ' + task.name + ': ' + ex.message; + throw ex; + }).done(); + } + }]); + return TaskQueue; +}(); + +module.exports = TaskQueue; +}, 228, null, "TaskQueue"); +__d(/* infoLog */function(global, require, module, exports) { +'use strict'; + +function infoLog() { + var _console; + + return (_console = console).log.apply(_console, arguments); +} + +module.exports = infoLog; +}, 229, null, "infoLog"); +__d(/* Interpolation */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var normalizeColor = require(72 ); // 72 = normalizeColor + +var linear = function linear(t) { + return t; +}; + +var Interpolation = function () { + function Interpolation() { + babelHelpers.classCallCheck(this, Interpolation); + } + + babelHelpers.createClass(Interpolation, null, [{ + key: 'create', + value: function create(config) { + + if (config.outputRange && typeof config.outputRange[0] === 'string') { + return createInterpolationFromStringOutputRange(config); + } + + var outputRange = config.outputRange; + checkInfiniteRange('outputRange', outputRange); + + var inputRange = config.inputRange; + checkInfiniteRange('inputRange', inputRange); + checkValidInputRange(inputRange); + + invariant(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length'); + + var easing = config.easing || linear; + + var extrapolateLeft = 'extend'; + if (config.extrapolateLeft !== undefined) { + extrapolateLeft = config.extrapolateLeft; + } else if (config.extrapolate !== undefined) { + extrapolateLeft = config.extrapolate; + } + + var extrapolateRight = 'extend'; + if (config.extrapolateRight !== undefined) { + extrapolateRight = config.extrapolateRight; + } else if (config.extrapolate !== undefined) { + extrapolateRight = config.extrapolate; + } + + return function (input) { + invariant(typeof input === 'number', 'Cannot interpolation an input which is not a number'); + + var range = findRange(input, inputRange); + return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight); + }; + } + }]); + return Interpolation; +}(); + +function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) { + var result = input; + + if (result < inputMin) { + if (extrapolateLeft === 'identity') { + return result; + } else if (extrapolateLeft === 'clamp') { + result = inputMin; + } else if (extrapolateLeft === 'extend') {} + } + + if (result > inputMax) { + if (extrapolateRight === 'identity') { + return result; + } else if (extrapolateRight === 'clamp') { + result = inputMax; + } else if (extrapolateRight === 'extend') {} + } + + if (outputMin === outputMax) { + return outputMin; + } + + if (inputMin === inputMax) { + if (input <= inputMin) { + return outputMin; + } + return outputMax; + } + + if (inputMin === -Infinity) { + result = -result; + } else if (inputMax === Infinity) { + result = result - inputMin; + } else { + result = (result - inputMin) / (inputMax - inputMin); + } + + result = easing(result); + + if (outputMin === -Infinity) { + result = -result; + } else if (outputMax === Infinity) { + result = result + outputMin; + } else { + result = result * (outputMax - outputMin) + outputMin; + } + + return result; +} + +function colorToRgba(input) { + var int32Color = normalizeColor(input); + if (int32Color === null) { + return input; + } + + int32Color = int32Color || 0; + + var r = (int32Color & 0xff000000) >>> 24; + var g = (int32Color & 0x00ff0000) >>> 16; + var b = (int32Color & 0x0000ff00) >>> 8; + var a = (int32Color & 0x000000ff) / 255; + + return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + a + ')'; +} + +var stringShapeRegex = /[0-9\.-]+/g; + +function createInterpolationFromStringOutputRange(config) { + var outputRange = config.outputRange; + invariant(outputRange.length >= 2, 'Bad output range'); + outputRange = outputRange.map(colorToRgba); + checkPattern(outputRange); + + var outputRanges = outputRange[0].match(stringShapeRegex).map(function () { + return []; + }); + outputRange.forEach(function (value) { + value.match(stringShapeRegex).forEach(function (number, i) { + outputRanges[i].push(+number); + }); + }); + + var interpolations = outputRange[0].match(stringShapeRegex).map(function (value, i) { + return Interpolation.create(babelHelpers.extends({}, config, { + outputRange: outputRanges[i] + })); + }); + + var shouldRound = isRgbOrRgba(outputRange[0]); + + return function (input) { + var i = 0; + + return outputRange[0].replace(stringShapeRegex, function () { + var val = +interpolations[i++](input); + var rounded = shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000; + return String(rounded); + }); + }; +} + +function isRgbOrRgba(range) { + return typeof range === 'string' && range.startsWith('rgb'); +} + +function checkPattern(arr) { + var pattern = arr[0].replace(stringShapeRegex, ''); + for (var i = 1; i < arr.length; ++i) { + invariant(pattern === arr[i].replace(stringShapeRegex, ''), 'invalid pattern ' + arr[0] + ' and ' + arr[i]); + } +} + +function findRange(input, inputRange) { + for (var i = 1; i < inputRange.length - 1; ++i) { + if (inputRange[i] >= input) { + break; + } + } + return i - 1; +} + +function checkValidInputRange(arr) { + invariant(arr.length >= 2, 'inputRange must have at least 2 elements'); + for (var i = 1; i < arr.length; ++i) { + invariant(arr[i] >= arr[i - 1], 'inputRange must be monotonically increasing ' + arr); + } +} + +function checkInfiniteRange(name, arr) { + invariant(arr.length >= 2, name + ' must have at least 2 elements'); + invariant(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity, name + 'cannot be ]-infinity;+infinity[ ' + arr); +} + +module.exports = Interpolation; +}, 230, null, "Interpolation"); +__d(/* NativeAnimatedHelper */function(global, require, module, exports) { +'use strict'; + +var NativeAnimatedModule = require(80 ).NativeAnimatedModule; // 80 = NativeModules +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var __nativeAnimatedNodeTagCount = 1; +var __nativeAnimationIdCount = 1; + +var nativeEventEmitter = void 0; + +var API = { + createAnimatedNode: function createAnimatedNode(tag, config) { + assertNativeAnimatedModule(); + NativeAnimatedModule.createAnimatedNode(tag, config); + }, + startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.startListeningToAnimatedNodeValue(tag); + }, + stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag); + }, + connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag); + }, + disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag); + }, + startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) { + assertNativeAnimatedModule(); + NativeAnimatedModule.startAnimatingNode(animationId, nodeTag, config, endCallback); + }, + stopAnimation: function stopAnimation(animationId) { + assertNativeAnimatedModule(); + NativeAnimatedModule.stopAnimation(animationId); + }, + setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) { + assertNativeAnimatedModule(); + NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value); + }, + setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) { + assertNativeAnimatedModule(); + NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset); + }, + flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag); + }, + extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag); + }, + connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag); + }, + disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag); + }, + dropAnimatedNode: function dropAnimatedNode(tag) { + assertNativeAnimatedModule(); + NativeAnimatedModule.dropAnimatedNode(tag); + }, + addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) { + assertNativeAnimatedModule(); + NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping); + }, + removeAnimatedEventFromView: function removeAnimatedEventFromView(viewTag, eventName) { + assertNativeAnimatedModule(); + NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName); + } +}; + +var STYLES_WHITELIST = { + opacity: true, + transform: true, + + scaleX: true, + scaleY: true, + translateX: true, + translateY: true +}; + +var TRANSFORM_WHITELIST = { + translateX: true, + translateY: true, + scale: true, + scaleX: true, + scaleY: true, + rotate: true, + rotateX: true, + rotateY: true, + perspective: true +}; + +function validateTransform(configs) { + configs.forEach(function (config) { + if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { + throw new Error('Property \'' + config.property + '\' is not supported by native animated module'); + } + }); +} + +function validateStyles(styles) { + for (var key in styles) { + if (!STYLES_WHITELIST.hasOwnProperty(key)) { + throw new Error('Style property \'' + key + '\' is not supported by native animated module'); + } + } +} + +function validateInterpolation(config) { + var SUPPORTED_INTERPOLATION_PARAMS = { + inputRange: true, + outputRange: true, + extrapolate: true, + extrapolateRight: true, + extrapolateLeft: true + }; + for (var key in config) { + if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)) { + throw new Error('Interpolation property \'' + key + '\' is not supported by native animated module'); + } + } +} + +function generateNewNodeTag() { + return __nativeAnimatedNodeTagCount++; +} + +function generateNewAnimationId() { + return __nativeAnimationIdCount++; +} + +function assertNativeAnimatedModule() { + invariant(NativeAnimatedModule, 'Native animated module is not available'); +} + +function isNativeAnimatedAvailable() { + return !!NativeAnimatedModule; +} + +module.exports = { + API: API, + validateStyles: validateStyles, + validateTransform: validateTransform, + validateInterpolation: validateInterpolation, + generateNewNodeTag: generateNewNodeTag, + generateNewAnimationId: generateNewAnimationId, + assertNativeAnimatedModule: assertNativeAnimatedModule, + isNativeAnimatedAvailable: isNativeAnimatedAvailable, + get nativeEventEmitter() { + if (!nativeEventEmitter) { + nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule); + } + return nativeEventEmitter; + } +}; +}, 231, null, "NativeAnimatedHelper"); +__d(/* SpringConfig */function(global, require, module, exports) { + +'use strict'; + +function tensionFromOrigamiValue(oValue) { + return (oValue - 30) * 3.62 + 194; +} + +function frictionFromOrigamiValue(oValue) { + return (oValue - 8) * 3 + 25; +} + +function fromOrigamiTensionAndFriction(tension, friction) { + return { + tension: tensionFromOrigamiValue(tension), + friction: frictionFromOrigamiValue(friction) + }; +} + +function fromBouncinessAndSpeed(bounciness, speed) { + function normalize(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + } + + function projectNormal(n, start, end) { + return start + n * (end - start); + } + + function linearInterpolation(t, start, end) { + return t * end + (1 - t) * start; + } + + function quadraticOutInterpolation(t, start, end) { + return linearInterpolation(2 * t - t * t, start, end); + } + + function b3Friction1(x) { + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; + } + + function b3Friction2(x) { + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2; + } + + function b3Friction3(x) { + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; + } + + function b3Nobounce(tension) { + if (tension <= 18) { + return b3Friction1(tension); + } else if (tension > 18 && tension <= 44) { + return b3Friction2(tension); + } else { + return b3Friction3(tension); + } + } + + var b = normalize(bounciness / 1.7, 0, 20); + b = projectNormal(b, 0, 0.8); + var s = normalize(speed / 1.7, 0, 20); + var bouncyTension = projectNormal(s, 0.5, 200); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); + + return { + tension: tensionFromOrigamiValue(bouncyTension), + friction: frictionFromOrigamiValue(bouncyFriction) + }; +} + +module.exports = { + fromOrigamiTensionAndFriction: fromOrigamiTensionAndFriction, + fromBouncinessAndSpeed: fromBouncinessAndSpeed +}; +}, 232, null, "SpringConfig"); +__d(/* fbjs/lib/requestAnimationFrame.js */function(global, require, module, exports) {'use strict'; + +var emptyFunction = require(41 ); // 41 = ./emptyFunction +var nativeRequestAnimationFrame = require(234 ); // 234 = ./nativeRequestAnimationFrame + +var lastTime = 0; + +var requestAnimationFrame = nativeRequestAnimationFrame || function (callback) { + var currTime = Date.now(); + var timeDelay = Math.max(0, 16 - (currTime - lastTime)); + lastTime = currTime + timeDelay; + return global.setTimeout(function () { + callback(Date.now()); + }, timeDelay); +}; + +requestAnimationFrame(emptyFunction); + +module.exports = requestAnimationFrame; +}, 233, null, "fbjs/lib/requestAnimationFrame.js"); +__d(/* fbjs/lib/nativeRequestAnimationFrame.js */function(global, require, module, exports) {"use strict"; + +var nativeRequestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame || global.msRequestAnimationFrame; + +module.exports = nativeRequestAnimationFrame; +}, 234, null, "fbjs/lib/nativeRequestAnimationFrame.js"); +__d(/* Easing */function(global, require, module, exports) { +'use strict'; + +var _ease = void 0; + +var Easing = function () { + function Easing() { + babelHelpers.classCallCheck(this, Easing); + } + + babelHelpers.createClass(Easing, null, [{ + key: 'step0', + value: function step0(n) { + return n > 0 ? 1 : 0; + } + }, { + key: 'step1', + value: function step1(n) { + return n >= 1 ? 1 : 0; + } + }, { + key: 'linear', + value: function linear(t) { + return t; + } + }, { + key: 'ease', + value: function ease(t) { + if (!_ease) { + _ease = Easing.bezier(0.42, 0, 1, 1); + } + return _ease(t); + } + }, { + key: 'quad', + value: function quad(t) { + return t * t; + } + }, { + key: 'cubic', + value: function cubic(t) { + return t * t * t; + } + }, { + key: 'poly', + value: function poly(n) { + return function (t) { + return Math.pow(t, n); + }; + } + }, { + key: 'sin', + value: function sin(t) { + return 1 - Math.cos(t * Math.PI / 2); + } + }, { + key: 'circle', + value: function circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + }, { + key: 'exp', + value: function exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + }, { + key: 'elastic', + value: function elastic() { + var bounciness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + + var p = bounciness * Math.PI; + return function (t) { + return 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); + }; + } + }, { + key: 'back', + value: function back(s) { + if (s === undefined) { + s = 1.70158; + } + return function (t) { + return t * t * ((s + 1) * t - s); + }; + } + }, { + key: 'bounce', + value: function bounce(t) { + if (t < 1 / 2.75) { + return 7.5625 * t * t; + } + + if (t < 2 / 2.75) { + t -= 1.5 / 2.75; + return 7.5625 * t * t + 0.75; + } + + if (t < 2.5 / 2.75) { + t -= 2.25 / 2.75; + return 7.5625 * t * t + 0.9375; + } + + t -= 2.625 / 2.75; + return 7.5625 * t * t + 0.984375; + } + }, { + key: 'bezier', + value: function bezier(x1, y1, x2, y2) { + var _bezier = require(236 ); // 236 = bezier + return _bezier(x1, y1, x2, y2); + } + }, { + key: 'in', + value: function _in(easing) { + return easing; + } + }, { + key: 'out', + value: function out(easing) { + return function (t) { + return 1 - easing(1 - t); + }; + } + }, { + key: 'inOut', + value: function inOut(easing) { + return function (t) { + if (t < 0.5) { + return easing(t * 2) / 2; + } + return 1 - easing((1 - t) * 2) / 2; + }; + } + }]); + return Easing; +}(); + +module.exports = Easing; +}, 235, null, "Easing"); +__d(/* bezier */function(global, require, module, exports) { +'use strict'; + +var NEWTON_ITERATIONS = 4; +var NEWTON_MIN_SLOPE = 0.001; +var SUBDIVISION_PRECISION = 0.0000001; +var SUBDIVISION_MAX_ITERATIONS = 10; + +var kSplineTableSize = 11; +var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); + +var float32ArraySupported = typeof Float32Array === 'function'; + +function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; +} +function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; +} +function C(aA1) { + return 3.0 * aA1; +} + +function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; +} + +function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); +} + +function binarySubdivide(aX, aA, aB, mX1, mX2) { + var currentX, + currentT, + i = 0; + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + return currentT; +} + +function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { + for (var i = 0; i < NEWTON_ITERATIONS; ++i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + if (currentSlope === 0.0) { + return aGuessT; + } + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + return aGuessT; +} + +module.exports = function bezier(mX1, mY1, mX2, mY2) { + if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { + throw new Error('bezier x values must be in [0, 1] range'); + } + + var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + if (mX1 !== mY1 || mX2 !== mY2) { + for (var i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + + function getTForX(aX) { + var intervalStart = 0.0; + var currentSample = 1; + var lastSample = kSplineTableSize - 1; + + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + --currentSample; + + var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + var guessForT = intervalStart + dist * kSampleStepSize; + + var initialSlope = getSlope(guessForT, mX1, mX2); + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + + return function BezierEasing(x) { + if (mX1 === mY1 && mX2 === mY2) { + return x; + } + + if (x === 0) { + return 0; + } + if (x === 1) { + return 1; + } + return calcBezier(getTForX(x), mY1, mY2); + }; +}; +}, 236, null, "bezier"); +__d(/* Image */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Image/Image.ios.js'; +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var ImageResizeMode = require(132 ); // 132 = ImageResizeMode +var ImageSourcePropType = require(238 ); // 238 = ImageSourcePropType +var ImageStylePropTypes = require(131 ); // 131 = ImageStylePropTypes +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var NativeModules = require(80 ); // 80 = NativeModules +var React = require(126 ); // 126 = React +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes +var StyleSheet = require(127 ); // 127 = StyleSheet +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType + +var flattenStyle = require(77 ); // 77 = flattenStyle +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent +var resolveAssetSource = require(198 ); // 198 = resolveAssetSource + +var PropTypes = React.PropTypes; + +var ImageViewManager = NativeModules.ImageViewManager; + +var Image = React.createClass({ + displayName: 'Image', + + propTypes: { + style: StyleSheetPropType(ImageStylePropTypes), + + source: ImageSourcePropType, + + defaultSource: PropTypes.oneOfType([PropTypes.shape({ + uri: PropTypes.string, + width: PropTypes.number, + height: PropTypes.number, + scale: PropTypes.number + }), PropTypes.number]), + + accessible: PropTypes.bool, + + accessibilityLabel: PropTypes.string, + + blurRadius: PropTypes.number, + + capInsets: EdgeInsetsPropType, + + resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']), + + resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']), + + testID: PropTypes.string, + + onLayout: PropTypes.func, + + onLoadStart: PropTypes.func, + + onProgress: PropTypes.func, + + onError: PropTypes.func, + + onPartialLoad: PropTypes.func, + + onLoad: PropTypes.func, + + onLoadEnd: PropTypes.func + }, + + statics: { + resizeMode: ImageResizeMode, + + getSize: function getSize(uri, success, failure) { + ImageViewManager.getSize(uri, success, failure || function () { + console.warn('Failed to get size for image: ' + uri); + }); + }, + prefetch: function prefetch(url) { + return ImageViewManager.prefetchImage(url); + }, + + resolveAssetSource: resolveAssetSource + }, + + mixins: [NativeMethodsMixin], + + viewConfig: { + uiViewClassName: 'UIView', + validAttributes: ReactNativeViewAttributes.UIView + }, + + render: function render() { + var source = resolveAssetSource(this.props.source) || { uri: undefined, width: undefined, height: undefined }; + + var sources = void 0; + var style = void 0; + if (Array.isArray(source)) { + style = flattenStyle([styles.base, this.props.style]) || {}; + sources = source; + } else { + var _width = source.width, + _height = source.height, + uri = source.uri; + + style = flattenStyle([{ width: _width, height: _height }, styles.base, this.props.style]) || {}; + sources = [source]; + + if (uri === '') { + console.warn('source.uri should not be an empty string'); + } + } + + var resizeMode = this.props.resizeMode || (style || {}).resizeMode || 'cover'; + var tintColor = (style || {}).tintColor; + + if (this.props.src) { + console.warn('The component requires a `source` property rather than `src`.'); + } + + return React.createElement(RCTImageView, babelHelpers.extends({}, this.props, { + style: style, + resizeMode: resizeMode, + tintColor: tintColor, + source: sources, + __source: { + fileName: _jsxFileName, + lineNumber: 366 + } + })); + } +}); + +var styles = StyleSheet.create({ + base: { + overflow: 'hidden' + } +}); + +var RCTImageView = requireNativeComponent('RCTImageView', Image); + +module.exports = Image; +}, 237, null, "Image"); +__d(/* ImageSourcePropType */function(global, require, module, exports) { +'use strict'; + +var _require = require(126 ), // 126 = React + PropTypes = _require.PropTypes; + +var ImageURISourcePropType = PropTypes.shape({ + uri: PropTypes.string, + + bundle: PropTypes.string, + + method: PropTypes.string, + + headers: PropTypes.objectOf(PropTypes.string), + + body: PropTypes.string, + + cache: PropTypes.oneOf(['default', 'reload', 'force-cache', 'only-if-cached']), + + width: PropTypes.number, + height: PropTypes.number, + + scale: PropTypes.number +}); + +var ImageSourcePropType = PropTypes.oneOfType([ImageURISourcePropType, PropTypes.number, PropTypes.arrayOf(ImageURISourcePropType)]); + +module.exports = ImageSourcePropType; +}, 238, null, "ImageSourcePropType"); +__d(/* ScrollView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var Platform = require(79 ); // 79 = Platform +var PointPropType = require(240 ); // 240 = PointPropType +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var ScrollResponder = require(291 ); // 291 = ScrollResponder +var StyleSheet = require(127 ); // 127 = StyleSheet +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType +var View = require(146 ); // 146 = View +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var dismissKeyboard = require(110 ); // 110 = dismissKeyboard +var flattenStyle = require(77 ); // 77 = flattenStyle +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var processDecelerationRate = require(293 ); // 293 = processDecelerationRate +var PropTypes = React.PropTypes; +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var ScrollView = React.createClass({ + displayName: 'ScrollView', + + propTypes: babelHelpers.extends({}, View.propTypes, { + automaticallyAdjustContentInsets: PropTypes.bool, + + contentInset: EdgeInsetsPropType, + + contentOffset: PointPropType, + + bounces: PropTypes.bool, + + bouncesZoom: PropTypes.bool, + + alwaysBounceHorizontal: PropTypes.bool, + + alwaysBounceVertical: PropTypes.bool, + + centerContent: PropTypes.bool, + + contentContainerStyle: StyleSheetPropType(ViewStylePropTypes), + + decelerationRate: PropTypes.oneOfType([PropTypes.oneOf(['fast', 'normal']), PropTypes.number]), + + horizontal: PropTypes.bool, + + indicatorStyle: PropTypes.oneOf(['default', 'black', 'white']), + + directionalLockEnabled: PropTypes.bool, + + canCancelContentTouches: PropTypes.bool, + + keyboardDismissMode: PropTypes.oneOf(['none', 'interactive', 'on-drag']), + + keyboardShouldPersistTaps: PropTypes.oneOf(['always', 'never', 'handled', false, true]), + + maximumZoomScale: PropTypes.number, + + minimumZoomScale: PropTypes.number, + + onScroll: PropTypes.func, + + onScrollAnimationEnd: PropTypes.func, + + onContentSizeChange: PropTypes.func, + + pagingEnabled: PropTypes.bool, + + scrollEnabled: PropTypes.bool, + + scrollEventThrottle: PropTypes.number, + + scrollIndicatorInsets: EdgeInsetsPropType, + + scrollsToTop: PropTypes.bool, + + showsHorizontalScrollIndicator: PropTypes.bool, + + showsVerticalScrollIndicator: PropTypes.bool, + + stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number), + style: StyleSheetPropType(ViewStylePropTypes), + + snapToInterval: PropTypes.number, + + snapToAlignment: PropTypes.oneOf(['start', 'center', 'end']), + + removeClippedSubviews: PropTypes.bool, + + zoomScale: PropTypes.number, + + refreshControl: PropTypes.element, + + endFillColor: ColorPropType, + + scrollPerfTag: PropTypes.string, + + overScrollMode: PropTypes.oneOf(['auto', 'always', 'never']) + }), + + mixins: [ScrollResponder.Mixin], + + getInitialState: function getInitialState() { + return this.scrollResponderMixinGetInitialState(); + }, + + setNativeProps: function setNativeProps(props) { + this._scrollViewRef && this._scrollViewRef.setNativeProps(props); + }, + + getScrollResponder: function getScrollResponder() { + return this; + }, + + getScrollableNode: function getScrollableNode() { + return ReactNative.findNodeHandle(this._scrollViewRef); + }, + + getInnerViewNode: function getInnerViewNode() { + return ReactNative.findNodeHandle(this._innerViewRef); + }, + + scrollTo: function scrollTo(y, x, animated) { + if (typeof y === 'number') { + console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.'); + } else { + var _ref = y || {}; + + x = _ref.x; + y = _ref.y; + animated = _ref.animated; + } + this.getScrollResponder().scrollResponderScrollTo({ x: x || 0, y: y || 0, animated: animated !== false }); + }, + + scrollToEnd: function scrollToEnd(options) { + var animated = (options && options.animated) !== false; + this.getScrollResponder().scrollResponderScrollToEnd({ + animated: animated + }); + }, + + scrollWithoutAnimationTo: function scrollWithoutAnimationTo() { + var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + console.warn('`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead'); + this.scrollTo({ x: x, y: y, animated: false }); + }, + + _handleScroll: function _handleScroll(e) { + if (__DEV__) { + if (this.props.onScroll && this.props.scrollEventThrottle == null && Platform.OS === 'ios') { + console.log('You specified `onScroll` on a but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + 'cause frame drops, use a bigger number if you don\'t need as ' + 'much precision.'); + } + } + if (Platform.OS === 'android') { + if (this.props.keyboardDismissMode === 'on-drag') { + dismissKeyboard(); + } + } + this.scrollResponderHandleScroll(e); + }, + + _handleContentOnLayout: function _handleContentOnLayout(e) { + var _e$nativeEvent$layout = e.nativeEvent.layout, + width = _e$nativeEvent$layout.width, + height = _e$nativeEvent$layout.height; + + this.props.onContentSizeChange && this.props.onContentSizeChange(width, height); + }, + + _scrollViewRef: null, + _setScrollViewRef: function _setScrollViewRef(ref) { + this._scrollViewRef = ref; + }, + + _innerViewRef: null, + _setInnerViewRef: function _setInnerViewRef(ref) { + this._innerViewRef = ref; + }, + + render: function render() { + var contentContainerStyle = [this.props.horizontal && styles.contentContainerHorizontal, this.props.contentContainerStyle]; + var style = void 0, + childLayoutProps = void 0; + if (__DEV__ && this.props.style) { + style = flattenStyle(this.props.style); + childLayoutProps = ['alignItems', 'justifyContent'].filter(function (prop) { + return style && style[prop] !== undefined; + }); + invariant(childLayoutProps.length === 0, 'ScrollView child layout (' + JSON.stringify(childLayoutProps) + ') must be applied through the contentContainerStyle prop.'); + } + + var contentSizeChangeProps = {}; + if (this.props.onContentSizeChange) { + contentSizeChangeProps = { + onLayout: this._handleContentOnLayout + }; + } + + var contentContainer = React.createElement( + View, + babelHelpers.extends({}, contentSizeChangeProps, { + ref: this._setInnerViewRef, + style: contentContainerStyle, + removeClippedSubviews: this.props.removeClippedSubviews, + collapsable: false, __source: { + fileName: _jsxFileName, + lineNumber: 510 + } + }), + this.props.children + ); + + var alwaysBounceHorizontal = this.props.alwaysBounceHorizontal !== undefined ? this.props.alwaysBounceHorizontal : this.props.horizontal; + + var alwaysBounceVertical = this.props.alwaysBounceVertical !== undefined ? this.props.alwaysBounceVertical : !this.props.horizontal; + + var baseStyle = this.props.horizontal ? styles.baseHorizontal : styles.baseVertical; + var props = babelHelpers.extends({}, this.props, { + alwaysBounceHorizontal: alwaysBounceHorizontal, + alwaysBounceVertical: alwaysBounceVertical, + style: [baseStyle, this.props.style], + + onContentSizeChange: null, + onTouchStart: this.scrollResponderHandleTouchStart, + onTouchMove: this.scrollResponderHandleTouchMove, + onTouchEnd: this.scrollResponderHandleTouchEnd, + onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, + onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, + onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, + onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, + onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, + onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, + onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, + onScroll: this._handleScroll, + onResponderGrant: this.scrollResponderHandleResponderGrant, + onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, + onResponderTerminate: this.scrollResponderHandleTerminate, + onResponderRelease: this.scrollResponderHandleResponderRelease, + onResponderReject: this.scrollResponderHandleResponderReject, + sendMomentumEvents: this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd ? true : false + }); + + var decelerationRate = this.props.decelerationRate; + + if (decelerationRate) { + props.decelerationRate = processDecelerationRate(decelerationRate); + } + + var ScrollViewClass = void 0; + if (Platform.OS === 'ios') { + ScrollViewClass = RCTScrollView; + } else if (Platform.OS === 'android') { + if (this.props.horizontal) { + ScrollViewClass = AndroidHorizontalScrollView; + } else { + ScrollViewClass = AndroidScrollView; + } + } + invariant(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined'); + + var refreshControl = this.props.refreshControl; + if (refreshControl) { + if (Platform.OS === 'ios') { + return React.createElement( + ScrollViewClass, + babelHelpers.extends({}, props, { ref: this._setScrollViewRef, __source: { + fileName: _jsxFileName, + lineNumber: 582 + } + }), + refreshControl, + contentContainer + ); + } else if (Platform.OS === 'android') { + + return React.cloneElement(refreshControl, { style: props.style }, React.createElement( + ScrollViewClass, + babelHelpers.extends({}, props, { style: baseStyle, ref: this._setScrollViewRef, __source: { + fileName: _jsxFileName, + lineNumber: 597 + } + }), + contentContainer + )); + } + } + return React.createElement( + ScrollViewClass, + babelHelpers.extends({}, props, { ref: this._setScrollViewRef, __source: { + fileName: _jsxFileName, + lineNumber: 604 + } + }), + contentContainer + ); + } +}); + +var styles = StyleSheet.create({ + baseVertical: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'column', + overflow: 'scroll' + }, + baseHorizontal: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'row', + overflow: 'scroll' + }, + contentContainerHorizontal: { + flexDirection: 'row' + } +}); + +var nativeOnlyProps = void 0, + AndroidScrollView = void 0, + AndroidHorizontalScrollView = void 0, + RCTScrollView = void 0; +if (Platform.OS === 'android') { + nativeOnlyProps = { + nativeOnly: { + sendMomentumEvents: true + } + }; + AndroidScrollView = requireNativeComponent('RCTScrollView', ScrollView, nativeOnlyProps); + AndroidHorizontalScrollView = requireNativeComponent('AndroidHorizontalScrollView', ScrollView, nativeOnlyProps); +} else if (Platform.OS === 'ios') { + nativeOnlyProps = { + nativeOnly: { + onMomentumScrollBegin: true, + onMomentumScrollEnd: true, + onScrollBeginDrag: true, + onScrollEndDrag: true + } + }; + RCTScrollView = requireNativeComponent('RCTScrollView', ScrollView, nativeOnlyProps); +} + +module.exports = ScrollView; +}, 239, null, "ScrollView"); +__d(/* PointPropType */function(global, require, module, exports) { +'use strict'; + +var PropTypes = require(126 ).PropTypes; // 126 = React + +var createStrictShapeTypeChecker = require(148 ); // 148 = createStrictShapeTypeChecker + +var PointPropType = createStrictShapeTypeChecker({ + x: PropTypes.number, + y: PropTypes.number +}); + +module.exports = PointPropType; +}, 240, null, "PointPropType"); +__d(/* ReactNative */function(global, require, module, exports) { +'use strict'; + +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var ReactNativeDefaultInjection = require(242 ); // 242 = ReactNativeDefaultInjection + +var ReactNativeMount = require(265 ); // 265 = ReactNativeMount +var ReactUpdates = require(169 ); // 169 = ReactUpdates + +var findNodeHandle = require(124 ); // 124 = findNodeHandle + +ReactNativeDefaultInjection.inject(); + +var render = function render(element, mountInto, callback) { + return ReactNativeMount.renderComponent(element, mountInto, callback); +}; + +var ReactNative = { + hasReactNativeInitialized: false, + findNodeHandle: findNodeHandle, + render: render, + unmountComponentAtNode: ReactNativeMount.unmountComponentAtNode, + + unstable_batchedUpdates: ReactUpdates.batchedUpdates, + + + unmountComponentAtNodeAndRemoveContainer: ReactNativeMount.unmountComponentAtNodeAndRemoveContainer +}; + +if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + ComponentTree: { + getClosestInstanceFromNode: function getClosestInstanceFromNode(node) { + return ReactNativeComponentTree.getClosestInstanceFromNode(node); + }, + getNodeFromInstance: function getNodeFromInstance(inst) { + while (inst._renderedComponent) { + inst = inst._renderedComponent; + } + if (inst) { + return ReactNativeComponentTree.getNodeFromInstance(inst); + } else { + return null; + } + } + }, + Mount: ReactNativeMount, + Reconciler: require(173 ) // 173 = ReactReconciler + }); +} + +module.exports = ReactNative; +}, 241, null, "ReactNative"); +__d(/* ReactNativeDefaultInjection */function(global, require, module, exports) { +'use strict'; + +require(243 ); // 243 = InitializeCore + +var EventPluginHub = require(161 ); // 161 = EventPluginHub +var EventPluginUtils = require(163 ); // 163 = EventPluginUtils +var RCTEventEmitter = require(274 ); // 274 = RCTEventEmitter +var React = require(126 ); // 126 = React +var ReactComponentEnvironment = require(179 ); // 179 = ReactComponentEnvironment +var ReactDefaultBatchingStrategy = require(275 ); // 275 = ReactDefaultBatchingStrategy +var ReactEmptyComponent = require(189 ); // 189 = ReactEmptyComponent +var ReactNativeBridgeEventPlugin = require(276 ); // 276 = ReactNativeBridgeEventPlugin +var ReactHostComponent = require(190 ); // 190 = ReactHostComponent +var ReactNativeComponentEnvironment = require(279 ); // 279 = ReactNativeComponentEnvironment +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var ReactNativeEventEmitter = require(160 ); // 160 = ReactNativeEventEmitter +var ReactNativeEventPluginOrder = require(282 ); // 282 = ReactNativeEventPluginOrder +var ReactNativeGlobalResponderHandler = require(283 ); // 283 = ReactNativeGlobalResponderHandler +var ReactNativeTextComponent = require(284 ); // 284 = ReactNativeTextComponent +var ReactNativeTreeTraversal = require(285 ); // 285 = ReactNativeTreeTraversal +var ReactSimpleEmptyComponent = require(286 ); // 286 = ReactSimpleEmptyComponent +var ReactUpdates = require(169 ); // 169 = ReactUpdates +var ResponderEventPlugin = require(287 ); // 287 = ResponderEventPlugin + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function inject() { + RCTEventEmitter.register(ReactNativeEventEmitter); + + EventPluginHub.injection.injectEventPluginOrder(ReactNativeEventPluginOrder); + EventPluginUtils.injection.injectComponentTree(ReactNativeComponentTree); + EventPluginUtils.injection.injectTreeTraversal(ReactNativeTreeTraversal); + + ResponderEventPlugin.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler); + + EventPluginHub.injection.injectEventPluginsByName({ + 'ResponderEventPlugin': ResponderEventPlugin, + 'ReactNativeBridgeEventPlugin': ReactNativeBridgeEventPlugin + }); + + ReactUpdates.injection.injectReconcileTransaction(ReactNativeComponentEnvironment.ReactReconcileTransaction); + + ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy); + + ReactComponentEnvironment.injection.injectEnvironment(ReactNativeComponentEnvironment); + + var EmptyComponent = function EmptyComponent(instantiate) { + var View = require(146 ); // 146 = View + return new ReactSimpleEmptyComponent(React.createElement(View, { + collapsable: true, + style: { position: 'absolute' } + }), instantiate); + }; + + ReactEmptyComponent.injection.injectEmptyComponentFactory(EmptyComponent); + + ReactHostComponent.injection.injectTextComponentClass(ReactNativeTextComponent); + ReactHostComponent.injection.injectGenericComponentClass(function (tag) { + var info = ''; + if (typeof tag === 'string' && /^[a-z]/.test(tag)) { + info += ' Each component name should start with an uppercase letter.'; + } + invariant(false, 'Expected a component class, got %s.%s', tag, info); + }); +} + +module.exports = { + inject: inject +}; +}, 242, null, "ReactNativeDefaultInjection"); +__d(/* InitializeCore */function(global, require, module, exports) { +'use strict'; + +if (global.GLOBAL === undefined) { + global.GLOBAL = global; +} + +if (global.window === undefined) { + global.window = global; +} + +var defineLazyObjectProperty = require(122 ); // 122 = defineLazyObjectProperty + +function defineProperty(object, name, getValue, eager) { + var descriptor = Object.getOwnPropertyDescriptor(object, name); + if (descriptor) { + var backupName = 'original' + name[0].toUpperCase() + name.substr(1); + Object.defineProperty(object, backupName, babelHelpers.extends({}, descriptor, { + value: object[name] + })); + } + + var _ref = descriptor || {}, + enumerable = _ref.enumerable, + writable = _ref.writable, + configurable = _ref.configurable; + + if (descriptor && !configurable) { + console.error('Failed to set polyfill. ' + name + ' is not configurable.'); + return; + } + + if (eager === true) { + Object.defineProperty(object, name, { + configurable: true, + enumerable: enumerable !== false, + writable: writable !== false, + value: getValue() + }); + } else { + defineLazyObjectProperty(object, name, { + get: getValue, + enumerable: enumerable !== false, + writable: writable !== false + }); + } +} + +global.process = global.process || {}; +global.process.env = global.process.env || {}; +if (!global.process.env.NODE_ENV) { + global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production'; +} + +var Systrace = require(85 ); // 85 = Systrace +Systrace.setEnabled(global.__RCTProfileIsProfiling || false); + +var ExceptionsManager = require(244 ); // 244 = ExceptionsManager +ExceptionsManager.installConsoleErrorReporter(); + +require(249 ); // 249 = RCTLog + +if (!global.__fbDisableExceptionsManager) { + var handleError = function handleError(e, isFatal) { + try { + ExceptionsManager.handleException(e, isFatal); + } catch (ee) { + console.log('Failed to print error: ', ee.message); + + throw e; + } + }; + + var ErrorUtils = require(83 ); // 83 = ErrorUtils + ErrorUtils.setGlobalHandler(handleError); +} + +var defineLazyTimer = function defineLazyTimer(name) { + defineProperty(global, name, function () { + return require(92 )[name]; // 92 = JSTimers + }); +}; +defineLazyTimer('setTimeout'); +defineLazyTimer('setInterval'); +defineLazyTimer('setImmediate'); +defineLazyTimer('clearTimeout'); +defineLazyTimer('clearInterval'); +defineLazyTimer('clearImmediate'); +defineLazyTimer('requestAnimationFrame'); +defineLazyTimer('cancelAnimationFrame'); +defineLazyTimer('requestIdleCallback'); +defineLazyTimer('cancelIdleCallback'); + +if (!global.alert) { + global.alert = function (text) { + require(250 ).alert('Alert', '' + text); // 250 = Alert + }; +} + +defineProperty(global, 'Promise', function () { + return require(252 ); // 252 = Promise +}); + +defineProperty(global, 'regeneratorRuntime', function () { + delete global.regeneratorRuntime; + require(258 ); // 258 = regenerator-runtime/runtime + return global.regeneratorRuntime; +}); + +defineProperty(global, 'XMLHttpRequest', function () { + return require(259 ); // 259 = XMLHttpRequest +}); +defineProperty(global, 'FormData', function () { + return require(261 ); // 261 = FormData +}); + +defineProperty(global, 'fetch', function () { + return require(247 ).fetch; // 247 = fetch +}); +defineProperty(global, 'Headers', function () { + return require(247 ).Headers; // 247 = fetch +}); +defineProperty(global, 'Request', function () { + return require(247 ).Request; // 247 = fetch +}); +defineProperty(global, 'Response', function () { + return require(247 ).Response; // 247 = fetch +}); +defineProperty(global, 'WebSocket', function () { + return require(101 ); // 101 = WebSocket +}); + +var navigator = global.navigator; +if (navigator === undefined) { + global.navigator = navigator = {}; +} + +defineProperty(navigator, 'product', function () { + return 'ReactNative'; +}, true); +defineProperty(navigator, 'geolocation', function () { + return require(263 ); // 263 = Geolocation +}); + +defineProperty(global, 'Map', function () { + return require(223 ); // 223 = Map +}, true); +defineProperty(global, 'Set', function () { + return require(222 ); // 222 = Set +}, true); + +if (__DEV__) { + if (!window.document) { + var setupDevtools = require(264 ); // 264 = setupDevtools + setupDevtools(); + } + + require(268 ); // 268 = RCTDebugComponentOwnership +} + +if (__DEV__) { + var JSInspector = require(269 ); // 269 = JSInspector + JSInspector.registerAgent(require(270 )); // 270 = NetworkAgent +} + +require(107 ); // 107 = RCTDeviceEventEmitter +require(272 ); // 272 = RCTNativeAppEventEmitter +require(273 ); // 273 = PerformanceLogger +}, 243, null, "InitializeCore"); +__d(/* ExceptionsManager */function(global, require, module, exports) { +'use strict'; + +var exceptionID = 0; +function reportException(e, isFatal) { + var _require = require(80 ), // 80 = NativeModules + ExceptionsManager = _require.ExceptionsManager; + + if (ExceptionsManager) { + var parseErrorStack = require(93 ); // 93 = parseErrorStack + var stack = parseErrorStack(e); + var currentExceptionID = ++exceptionID; + if (isFatal) { + ExceptionsManager.reportFatalException(e.message, stack, currentExceptionID); + } else { + ExceptionsManager.reportSoftException(e.message, stack, currentExceptionID); + } + if (__DEV__) { + var symbolicateStackTrace = require(245 ); // 245 = symbolicateStackTrace + symbolicateStackTrace(stack).then(function (prettyStack) { + if (prettyStack) { + ExceptionsManager.updateExceptionMessage(e.message, prettyStack, currentExceptionID); + } else { + throw new Error('The stack is null'); + } + }).catch(function (error) { + return console.warn('Unable to symbolicate stack trace: ' + error.message); + }); + } + } +} + +function handleException(e, isFatal) { + if (!e.message) { + e = new Error(e); + } + if (console._errorOriginal) { + console._errorOriginal(e.message); + } else { + console.error(e.message); + } + reportException(e, isFatal); +} + +function reactConsoleErrorHandler() { + console._errorOriginal.apply(console, arguments); + if (!console.reportErrorsAsExceptions) { + return; + } + + if (arguments[0] && arguments[0].stack) { + reportException(arguments[0], false); + } else { + var stringifySafe = require(97 ); // 97 = stringifySafe + var str = Array.prototype.map.call(arguments, stringifySafe).join(', '); + if (str.slice(0, 10) === '"Warning: ') { + return; + } + var error = new Error('console.error: ' + str); + error.framesToPop = 1; + reportException(error, false); + } +} + +function installConsoleErrorReporter() { + if (console._errorOriginal) { + return; + } + + console._errorOriginal = console.error.bind(console); + console.error = reactConsoleErrorHandler; + if (console.reportErrorsAsExceptions === undefined) { + console.reportErrorsAsExceptions = true; + } +} + +module.exports = { handleException: handleException, installConsoleErrorReporter: installConsoleErrorReporter }; +}, 244, null, "ExceptionsManager"); +__d(/* symbolicateStackTrace */function(global, require, module, exports) { +'use strict'; + +var getDevServer = require(246 ); // 246 = getDevServer + +var _require = require(80 ), // 80 = NativeModules + SourceCode = _require.SourceCode; + +var fetch = void 0; + +function isSourcedFromDisk(sourcePath) { + return !/^http/.test(sourcePath) && /[\\/]/.test(sourcePath); +} + +function symbolicateStackTrace(stack) { + var devServer, stackCopy, foundInternalSource, response, json; + return regeneratorRuntime.async(function symbolicateStackTrace$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!fetch) { + fetch = global.fetch || require(247 ).fetch; // 247 = fetch + } + + devServer = getDevServer(); + + if (devServer.bundleLoadedFromServer) { + _context.next = 4; + break; + } + + throw new Error('Bundle was not loaded from the packager'); + + case 4: + stackCopy = stack; + + + if (SourceCode.scriptURL) { + foundInternalSource = false; + + stackCopy = stack.map(function (frame) { + if (!foundInternalSource && isSourcedFromDisk(frame.file)) { + return babelHelpers.extends({}, frame, { file: SourceCode.scriptURL }); + } + + foundInternalSource = true; + return frame; + }); + } + + _context.next = 8; + return regeneratorRuntime.awrap(fetch(devServer.url + 'symbolicate', { + method: 'POST', + body: JSON.stringify({ stack: stackCopy }) + })); + + case 8: + response = _context.sent; + _context.next = 11; + return regeneratorRuntime.awrap(response.json()); + + case 11: + json = _context.sent; + return _context.abrupt('return', json.stack); + + case 13: + case 'end': + return _context.stop(); + } + } + }, null, this); +} + +module.exports = symbolicateStackTrace; +}, 245, null, "symbolicateStackTrace"); +__d(/* getDevServer */function(global, require, module, exports) { +'use strict'; + +var _require = require(80 ), // 80 = NativeModules + SourceCode = _require.SourceCode; + +var _cachedDevServerURL = void 0; +var FALLBACK = 'http://localhost:8081/'; + +function getDevServer() { + if (_cachedDevServerURL === undefined) { + var match = SourceCode.scriptURL && SourceCode.scriptURL.match(/^https?:\/\/.*?\//); + _cachedDevServerURL = match ? match[0] : null; + } + + return { + url: _cachedDevServerURL || FALLBACK, + bundleLoadedFromServer: _cachedDevServerURL !== null + }; +} + +module.exports = getDevServer; +}, 246, null, "getDevServer"); +__d(/* fetch */function(global, require, module, exports) { +'use strict'; + +require(248 ); // 248 = whatwg-fetch + +module.exports = { fetch: fetch, Headers: Headers, Request: Request, Response: Response }; +}, 247, null, "fetch"); +__d(/* whatwg-fetch/fetch.js */function(global, require, module, exports) {(function (self) { + 'use strict'; + + if (self.fetch) { + return; + } + + var support = { + searchParams: 'URLSearchParams' in self, + iterable: 'Symbol' in self && 'iterator' in Symbol, + blob: 'FileReader' in self && 'Blob' in self && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: 'FormData' in self, + arrayBuffer: 'ArrayBuffer' in self + }; + + if (support.arrayBuffer) { + var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]']; + + var isDataView = function isDataView(obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + }; + + var isArrayBufferView = ArrayBuffer.isView || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; + }; + } + + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { + throw new TypeError('Invalid character in header field name'); + } + return name.toLowerCase(); + } + + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value); + } + return value; + } + + function iteratorFor(items) { + var iterator = { + next: function next() { + var value = items.shift(); + return { done: value === undefined, value: value }; + } + }; + + if (support.iterable) { + iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'] = function () { + return iterator; + }; + } + + return iterator; + } + + function Headers(headers) { + this.map = {}; + + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var list = this.map[name]; + if (!list) { + list = []; + this.map[name] = list; + } + list.push(value); + }; + + Headers.prototype['delete'] = function (name) { + delete this.map[normalizeName(name)]; + }; + + Headers.prototype.get = function (name) { + var values = this.map[normalizeName(name)]; + return values ? values[0] : null; + }; + + Headers.prototype.getAll = function (name) { + return this.map[normalizeName(name)] || []; + }; + + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = [normalizeValue(value)]; + }; + + Headers.prototype.forEach = function (callback, thisArg) { + Object.getOwnPropertyNames(this.map).forEach(function (name) { + this.map[name].forEach(function (value) { + callback.call(thisArg, value, name, this); + }, this); + }, this); + }; + + Headers.prototype.keys = function () { + var items = []; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + + Headers.prototype.values = function () { + var items = []; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + + Headers.prototype.entries = function () { + var items = []; + this.forEach(function (value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + + if (support.iterable) { + Headers.prototype[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'] = Headers.prototype.entries; + } + + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')); + } + body.bodyUsed = true; + } + + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error); + }; + }); + } + + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsText(blob); + return promise; + } + + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + return chars.join(''); + } + + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + + function Body() { + this.bodyUsed = false; + + this._initBody = function (body) { + this._bodyInit = body; + if (!body) { + this._bodyText = ''; + } else if (typeof body === 'string') { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer); + + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body); + } else { + throw new Error('unsupported BodyInit type'); + } + + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8'); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + } + }; + + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob'); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + + this.arrayBuffer = function () { + if (this._bodyArrayBuffer) { + return consumed(this) || Promise.resolve(this._bodyArrayBuffer); + } else { + return this.blob().then(readBlobAsArrayBuffer); + } + }; + } + + this.text = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text'); + } else { + return Promise.resolve(this._bodyText); + } + }; + + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; + } + + this.json = function () { + return this.text().then(JSON.parse); + }; + + return this; + } + + var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; + + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } + + function Request(input, options) { + options = options || {}; + var body = options.body; + + if (typeof input === 'string') { + this.url = input; + } else { + if (input.bodyUsed) { + throw new TypeError('Already read'); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } + + this.credentials = options.credentials || this.credentials || 'omit'; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + this.method = normalizeMethod(options.method || this.method || 'GET'); + this.mode = options.mode || this.mode || null; + this.referrer = null; + + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests'); + } + this._initBody(body); + } + + Request.prototype.clone = function () { + return new Request(this, { body: this._bodyInit }); + }; + + function decode(body) { + var form = new FormData(); + body.trim().split('&').forEach(function (bytes) { + if (bytes) { + var split = bytes.split('='); + var name = split.shift().replace(/\+/g, ' '); + var value = split.join('=').replace(/\+/g, ' '); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + + function parseHeaders(rawHeaders) { + var headers = new Headers(); + rawHeaders.split('\r\n').forEach(function (line) { + var parts = line.split(':'); + var key = parts.shift().trim(); + if (key) { + var value = parts.join(':').trim(); + headers.append(key, value); + } + }); + return headers; + } + + Body.call(Request.prototype); + + function Response(bodyInit, options) { + if (!options) { + options = {}; + } + + this.type = 'default'; + this.status = 'status' in options ? options.status : 200; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = 'statusText' in options ? options.statusText : 'OK'; + this.headers = new Headers(options.headers); + this.url = options.url || ''; + this._initBody(bodyInit); + } + + Body.call(Response.prototype); + + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; + + Response.error = function () { + var response = new Response(null, { status: 0, statusText: '' }); + response.type = 'error'; + return response; + }; + + var redirectStatuses = [301, 302, 303, 307, 308]; + + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError('Invalid status code'); + } + + return new Response(null, { status: status, headers: { location: url } }); + }; + + self.Headers = Headers; + self.Request = Request; + self.Response = Response; + + self.fetch = function (input, init) { + return new Promise(function (resolve, reject) { + var request = new Request(input, init); + var xhr = new XMLHttpRequest(); + + xhr.onload = function () { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || '') + }; + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); + var body = 'response' in xhr ? xhr.response : xhr.responseText; + resolve(new Response(body, options)); + }; + + xhr.onerror = function () { + reject(new TypeError('Network request failed')); + }; + + xhr.ontimeout = function () { + reject(new TypeError('Network request failed')); + }; + + xhr.open(request.method, request.url, true); + + if (request.credentials === 'include') { + xhr.withCredentials = true; + } + + if ('responseType' in xhr && support.blob) { + xhr.responseType = 'blob'; + } + + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); + + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); + }); + }; + self.fetch.polyfill = true; +})(typeof self !== 'undefined' ? self : this); +}, 248, null, "whatwg-fetch/fetch.js"); +__d(/* RCTLog */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var levelsMap = { + log: 'log', + info: 'info', + warn: 'warn', + error: 'error', + fatal: 'error' +}; + +var RCTLog = function () { + function RCTLog() { + babelHelpers.classCallCheck(this, RCTLog); + } + + babelHelpers.createClass(RCTLog, null, [{ + key: 'logIfNoNativeHook', + value: function logIfNoNativeHook() { + var args = Array.prototype.slice.call(arguments); + var level = args.shift(); + var logFn = levelsMap[level]; + invariant(logFn, 'Level "' + level + '" not one of ' + Object.keys(levelsMap)); + if (typeof global.nativeLoggingHook === 'undefined') { + console[logFn].apply(console, args); + } + + return true; + } + }]); + return RCTLog; +}(); + +BatchedBridge.registerCallableModule('RCTLog', RCTLog); + +module.exports = RCTLog; +}, 249, null, "RCTLog"); +__d(/* Alert */function(global, require, module, exports) { +'use strict'; + +var AlertIOS = require(251 ); // 251 = AlertIOS +var Platform = require(79 ); // 79 = Platform +var DialogModuleAndroid = require(80 ).DialogManagerAndroid; // 80 = NativeModules + +var Alert = function () { + function Alert() { + babelHelpers.classCallCheck(this, Alert); + } + + babelHelpers.createClass(Alert, null, [{ + key: 'alert', + value: function alert(title, message, buttons, options, type) { + if (Platform.OS === 'ios') { + if (typeof type !== 'undefined') { + console.warn('Alert.alert() with a 5th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'); + AlertIOS.alert(title, message, buttons, type); + return; + } + AlertIOS.alert(title, message, buttons); + } else if (Platform.OS === 'android') { + AlertAndroid.alert(title, message, buttons, options); + } + } + }]); + return Alert; +}(); + +var AlertAndroid = function () { + function AlertAndroid() { + babelHelpers.classCallCheck(this, AlertAndroid); + } + + babelHelpers.createClass(AlertAndroid, null, [{ + key: 'alert', + value: function alert(title, message, buttons, options) { + var config = { + title: title || '', + message: message || '' + }; + + if (options) { + config = babelHelpers.extends({}, config, { cancelable: options.cancelable }); + } + + var validButtons = buttons ? buttons.slice(0, 3) : [{ text: 'OK' }]; + var buttonPositive = validButtons.pop(); + var buttonNegative = validButtons.pop(); + var buttonNeutral = validButtons.pop(); + if (buttonNeutral) { + config = babelHelpers.extends({}, config, { buttonNeutral: buttonNeutral.text || '' }); + } + if (buttonNegative) { + config = babelHelpers.extends({}, config, { buttonNegative: buttonNegative.text || '' }); + } + if (buttonPositive) { + config = babelHelpers.extends({}, config, { buttonPositive: buttonPositive.text || '' }); + } + DialogModuleAndroid.showAlert(config, function (errorMessage) { + return console.warn(errorMessage); + }, function (action, buttonKey) { + if (action !== DialogModuleAndroid.buttonClicked) { + return; + } + if (buttonKey === DialogModuleAndroid.buttonNeutral) { + buttonNeutral.onPress && buttonNeutral.onPress(); + } else if (buttonKey === DialogModuleAndroid.buttonNegative) { + buttonNegative.onPress && buttonNegative.onPress(); + } else if (buttonKey === DialogModuleAndroid.buttonPositive) { + buttonPositive.onPress && buttonPositive.onPress(); + } + }); + } + }]); + return AlertAndroid; +}(); + +module.exports = Alert; +}, 250, null, "Alert"); +__d(/* AlertIOS */function(global, require, module, exports) { +'use strict'; + +var RCTAlertManager = require(80 ).AlertManager; // 80 = NativeModules + +var AlertIOS = function () { + function AlertIOS() { + babelHelpers.classCallCheck(this, AlertIOS); + } + + babelHelpers.createClass(AlertIOS, null, [{ + key: 'alert', + value: function alert(title, message, callbackOrButtons, type) { + if (typeof type !== 'undefined') { + console.warn('AlertIOS.alert() with a 4th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'); + this.prompt(title, message, callbackOrButtons, type); + return; + } + this.prompt(title, message, callbackOrButtons, 'default'); + } + }, { + key: 'prompt', + value: function prompt(title, message, callbackOrButtons) { + var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'plain-text'; + var defaultValue = arguments[4]; + var keyboardType = arguments[5]; + + if (typeof type === 'function') { + console.warn('You passed a callback function as the "type" argument to AlertIOS.prompt(). React Native is ' + 'assuming you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) ' + 'signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue, ' + 'keyboardType) and the old syntax will be removed in a future version.'); + + var callback = type; + var defaultValue = message; + RCTAlertManager.alertWithArgs({ + title: title || undefined, + type: 'plain-text', + defaultValue: defaultValue + }, function (id, value) { + callback(value); + }); + return; + } + + var callbacks = []; + var buttons = []; + var cancelButtonKey; + var destructiveButtonKey; + if (typeof callbackOrButtons === 'function') { + callbacks = [callbackOrButtons]; + } else if (callbackOrButtons instanceof Array) { + callbackOrButtons.forEach(function (btn, index) { + callbacks[index] = btn.onPress; + if (btn.style === 'cancel') { + cancelButtonKey = String(index); + } else if (btn.style === 'destructive') { + destructiveButtonKey = String(index); + } + if (btn.text || index < (callbackOrButtons || []).length - 1) { + var btnDef = {}; + btnDef[index] = btn.text || ''; + buttons.push(btnDef); + } + }); + } + + RCTAlertManager.alertWithArgs({ + title: title || undefined, + message: message || undefined, + buttons: buttons, + type: type || undefined, + defaultValue: defaultValue, + cancelButtonKey: cancelButtonKey, + destructiveButtonKey: destructiveButtonKey, + keyboardType: keyboardType + }, function (id, value) { + var cb = callbacks[id]; + cb && cb(value); + }); + } + }]); + return AlertIOS; +}(); + +module.exports = AlertIOS; +}, 251, null, "AlertIOS"); +__d(/* Promise */function(global, require, module, exports) { +'use strict'; + +var Promise = require(253 ); // 253 = fbjs/lib/Promise.native + +if (__DEV__) { + require(257 ).enable({ // 257 = promise/setimmediate/rejection-tracking + allRejections: true, + onUnhandled: function onUnhandled(id) { + var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _error$message = error.message, + message = _error$message === undefined ? null : _error$message, + _error$stack = error.stack, + stack = _error$stack === undefined ? null : _error$stack; + + var warning = 'Possible Unhandled Promise Rejection (id: ' + id + '):\n' + (message == null ? '' : message + '\n') + (stack == null ? '' : stack); + console.warn(warning); + }, + onHandled: function onHandled(id) { + var warning = 'Promise Rejection Handled (id: ' + id + ')\n' + 'This means you can ignore any previous messages of the form ' + ('"Possible Unhandled Promise Rejection (id: ' + id + '):"'); + console.warn(warning); + } + }); +} + +module.exports = Promise; +}, 252, null, "Promise"); +__d(/* fbjs/lib/Promise.native.js */function(global, require, module, exports) { + +'use strict'; + +var Promise = require(254 ); // 254 = promise/setimmediate/es6-extensions +require(256 ); // 256 = promise/setimmediate/done + +Promise.prototype['finally'] = function (onSettled) { + return this.then(onSettled, onSettled); +}; + +module.exports = Promise; +}, 253, null, "fbjs/lib/Promise.native.js"); +__d(/* promise/setimmediate/es6-extensions.js */function(global, require, module, exports) {'use strict'; + +var Promise = require(255 ); // 255 = ./core.js + +module.exports = Promise; + +var TRUE = valuePromise(true); +var FALSE = valuePromise(false); +var NULL = valuePromise(null); +var UNDEFINED = valuePromise(undefined); +var ZERO = valuePromise(0); +var EMPTYSTRING = valuePromise(''); + +function valuePromise(value) { + var p = new Promise(Promise._61); + p._65 = 1; + p._55 = value; + return p; +} +Promise.resolve = function (value) { + if (value instanceof Promise) return value; + + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new Promise(then.bind(value)); + } + } catch (ex) { + return new Promise(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); +}; + +Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + + return new Promise(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof Promise && val.then === Promise.prototype.then) { + while (val._65 === 3) { + val = val._55; + } + if (val._65 === 1) return res(i, val._55); + if (val._65 === 2) reject(val._55); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new Promise(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); +}; + +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); +}; + +Promise.race = function (values) { + return new Promise(function (resolve, reject) { + values.forEach(function (value) { + Promise.resolve(value).then(resolve, reject); + }); + }); +}; + +Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); +}; +}, 254, null, "promise/setimmediate/es6-extensions.js"); +__d(/* promise/setimmediate/core.js */function(global, require, module, exports) {'use strict'; + +function noop() {} + +var LAST_ERROR = null; +var IS_ERROR = {}; +function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} +function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } +} + +module.exports = Promise; + +function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._40 = 0; + this._65 = 0; + this._55 = null; + this._72 = null; + if (fn === noop) return; + doResolve(fn, this); +} +Promise._37 = null; +Promise._87 = null; +Promise._61 = noop; + +Promise.prototype.then = function (onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; +}; + +function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); +} +function handle(self, deferred) { + while (self._65 === 3) { + self = self._55; + } + if (Promise._37) { + Promise._37(self); + } + if (self._65 === 0) { + if (self._40 === 0) { + self._40 = 1; + self._72 = deferred; + return; + } + if (self._40 === 1) { + self._40 = 2; + self._72 = [self._72, deferred]; + return; + } + self._72.push(deferred); + return; + } + handleResolved(self, deferred); +} + +function handleResolved(self, deferred) { + setImmediate(function () { + var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._65 === 1) { + resolve(deferred.promise, self._55); + } else { + reject(deferred.promise, self._55); + } + return; + } + var ret = tryCallOne(cb, self._55); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); +} +function resolve(self, newValue) { + if (newValue === self) { + return reject(self, new TypeError('A promise cannot be resolved with itself.')); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if (then === self.then && newValue instanceof Promise) { + self._65 = 3; + self._55 = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._65 = 1; + self._55 = newValue; + finale(self); +} + +function reject(self, newValue) { + self._65 = 2; + self._55 = newValue; + if (Promise._87) { + Promise._87(self, newValue); + } + finale(self); +} +function finale(self) { + if (self._40 === 1) { + handle(self, self._72); + self._72 = null; + } + if (self._40 === 2) { + for (var i = 0; i < self._72.length; i++) { + handle(self, self._72[i]); + } + self._72 = null; + } +} + +function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; +} + +function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } +} +}, 255, null, "promise/setimmediate/core.js"); +__d(/* promise/setimmediate/done.js */function(global, require, module, exports) {'use strict'; + +var Promise = require(255 ); // 255 = ./core.js + +module.exports = Promise; +Promise.prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); +}; +}, 256, null, "promise/setimmediate/done.js"); +__d(/* promise/setimmediate/rejection-tracking.js */function(global, require, module, exports) {'use strict'; + +var Promise = require(255 ); // 255 = ./core + +var DEFAULT_WHITELIST = [ReferenceError, TypeError, RangeError]; + +var enabled = false; +exports.disable = disable; +function disable() { + enabled = false; + Promise._37 = null; + Promise._87 = null; +} + +exports.enable = enable; +function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + Promise._37 = function (promise) { + if (promise._65 === 2 && rejections[promise._51]) { + if (rejections[promise._51].logged) { + onHandled(promise._51); + } else { + clearTimeout(rejections[promise._51].timeout); + } + delete rejections[promise._51]; + } + }; + Promise._87 = function (promise, err) { + if (promise._40 === 0) { + promise._51 = id++; + rejections[promise._51] = { + displayId: null, + error: err, + timeout: setTimeout(onUnhandled.bind(null, promise._51), matchWhitelist(err, DEFAULT_WHITELIST) ? 100 : 2000), + logged: false + }; + } + }; + function onUnhandled(id) { + if (options.allRejections || matchWhitelist(rejections[id].error, options.whitelist || DEFAULT_WHITELIST)) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled(rejections[id].displayId, rejections[id].error); + } else { + rejections[id].logged = true; + logError(rejections[id].displayId, rejections[id].error); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn('Promise Rejection Handled (id: ' + rejections[id].displayId + '):'); + console.warn(' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + rejections[id].displayId + '.'); + } + } + } +} + +function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); +} + +function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); +} +}, 257, null, "promise/setimmediate/rejection-tracking.js"); +__d(/* regenerator-runtime/runtime.js */function(global, require, module, exports) { + +!function (global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + module.exports = runtime; + } + + return; + } + + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + var ContinueSentinel = {}; + + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; + + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + prototype[method] = function (arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + }; + + runtime.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + runtime.awrap = function (arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value instanceof AwaitArgument) { + return Promise.resolve(value.arg).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function (unwrapped) { + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + runtime.async = function (innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); + + return runtime.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || method === "throw" && delegate.iterator[method] === undefined) { + context.delegate = null; + + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + continue; + } + } + + var record = tryCatch(delegate.iterator[method], delegate.iterator, arg); + + if (record.type === "throw") { + context.delegate = null; + + method = "throw"; + arg = record.arg; + continue; + } + + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context.sent = context._sent = arg; + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + method = "next"; + arg = undefined; + } + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + arg = undefined; + } + } else { + return info; + } + } else if (record.type === "throw") { + state = GenStateCompleted; + + method = "throw"; + arg = record.arg; + } + } + }; + } + + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function () { + return this; + }; + + Gp[toStringTagSymbol] = "Generator"; + + Gp.toString = function () { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function (object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function reset(skipTempReset) { + this.prev = 0; + this.next = 0; + + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function stop() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function dispatchException(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function abrupt(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function complete(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function finish(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function _catch(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + throw new Error("illegal catch attempt"); + }, + + delegateYield: function delegateYield(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +}(typeof global === "object" ? global : typeof window === "object" ? window : typeof self === "object" ? self : this); +}, 258, null, "regenerator-runtime/runtime.js"); +__d(/* XMLHttpRequest */function(global, require, module, exports) { +'use strict'; + +var EventTarget = require(116 ); // 116 = event-target-shim +var RCTNetworking = require(260 ); // 260 = RCTNetworking + +var base64 = require(115 ); // 115 = base64-js +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var UNSENT = 0; +var OPENED = 1; +var HEADERS_RECEIVED = 2; +var LOADING = 3; +var DONE = 4; + +var SUPPORTED_RESPONSE_TYPES = { + arraybuffer: typeof global.ArrayBuffer === 'function', + blob: typeof global.Blob === 'function', + document: false, + json: true, + text: true, + '': true +}; + +var REQUEST_EVENTS = ['abort', 'error', 'load', 'loadstart', 'progress', 'timeout', 'loadend']; + +var XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange'); + +var XMLHttpRequestEventTarget = function (_EventTarget) { + babelHelpers.inherits(XMLHttpRequestEventTarget, _EventTarget); + + function XMLHttpRequestEventTarget() { + babelHelpers.classCallCheck(this, XMLHttpRequestEventTarget); + return babelHelpers.possibleConstructorReturn(this, (XMLHttpRequestEventTarget.__proto__ || Object.getPrototypeOf(XMLHttpRequestEventTarget)).apply(this, arguments)); + } + + return XMLHttpRequestEventTarget; +}(EventTarget.apply(undefined, REQUEST_EVENTS)); + +var XMLHttpRequest = function (_EventTarget2) { + babelHelpers.inherits(XMLHttpRequest, _EventTarget2); + babelHelpers.createClass(XMLHttpRequest, null, [{ + key: 'setInterceptor', + value: function setInterceptor(interceptor) { + XMLHttpRequest._interceptor = interceptor; + } + }]); + + function XMLHttpRequest() { + babelHelpers.classCallCheck(this, XMLHttpRequest); + + var _this2 = babelHelpers.possibleConstructorReturn(this, (XMLHttpRequest.__proto__ || Object.getPrototypeOf(XMLHttpRequest)).call(this)); + + _this2.UNSENT = UNSENT; + _this2.OPENED = OPENED; + _this2.HEADERS_RECEIVED = HEADERS_RECEIVED; + _this2.LOADING = LOADING; + _this2.DONE = DONE; + _this2.readyState = UNSENT; + _this2.status = 0; + _this2.timeout = 0; + _this2.upload = new XMLHttpRequestEventTarget(); + _this2._aborted = false; + _this2._hasError = false; + _this2._method = null; + _this2._response = ''; + _this2._url = null; + _this2._timedOut = false; + _this2._trackingName = 'unknown'; + _this2._incrementalEvents = false; + + _this2._reset(); + return _this2; + } + + babelHelpers.createClass(XMLHttpRequest, [{ + key: '_reset', + value: function _reset() { + this.readyState = this.UNSENT; + this.responseHeaders = undefined; + this.status = 0; + delete this.responseURL; + + this._requestId = null; + + this._cachedResponse = undefined; + this._hasError = false; + this._headers = {}; + this._response = ''; + this._responseType = ''; + this._sent = false; + this._lowerCaseResponseHeaders = {}; + + this._clearSubscriptions(); + this._timedOut = false; + } + }, { + key: '__didCreateRequest', + value: function __didCreateRequest(requestId) { + this._requestId = requestId; + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.requestSent(requestId, this._url || '', this._method || 'GET', this._headers); + } + }, { + key: '__didUploadProgress', + value: function __didUploadProgress(requestId, progress, total) { + if (requestId === this._requestId) { + this.upload.dispatchEvent({ + type: 'progress', + lengthComputable: true, + loaded: progress, + total: total + }); + } + } + }, { + key: '__didReceiveResponse', + value: function __didReceiveResponse(requestId, status, responseHeaders, responseURL) { + if (requestId === this._requestId) { + this.status = status; + this.setResponseHeaders(responseHeaders); + this.setReadyState(this.HEADERS_RECEIVED); + if (responseURL || responseURL === '') { + this.responseURL = responseURL; + } else { + delete this.responseURL; + } + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.responseReceived(requestId, responseURL || this._url || '', status, responseHeaders || {}); + } + } + }, { + key: '__didReceiveData', + value: function __didReceiveData(requestId, response) { + if (requestId !== this._requestId) { + return; + } + this._response = response; + this._cachedResponse = undefined; + this.setReadyState(this.LOADING); + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, response); + } + }, { + key: '__didReceiveIncrementalData', + value: function __didReceiveIncrementalData(requestId, responseText, progress, total) { + if (requestId !== this._requestId) { + return; + } + if (!this._response) { + this._response = responseText; + } else { + this._response += responseText; + } + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, responseText); + + this.setReadyState(this.LOADING); + this.__didReceiveDataProgress(requestId, progress, total); + } + }, { + key: '__didReceiveDataProgress', + value: function __didReceiveDataProgress(requestId, loaded, total) { + if (requestId !== this._requestId) { + return; + } + this.dispatchEvent({ + type: 'progress', + lengthComputable: total >= 0, + loaded: loaded, + total: total + }); + } + }, { + key: '__didCompleteResponse', + value: function __didCompleteResponse(requestId, error, timeOutError) { + if (requestId === this._requestId) { + if (error) { + if (this._responseType === '' || this._responseType === 'text') { + this._response = error; + } + this._hasError = true; + if (timeOutError) { + this._timedOut = true; + } + } + this._clearSubscriptions(); + this._requestId = null; + this.setReadyState(this.DONE); + + if (error) { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFailed(requestId, error); + } else { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFinished(requestId, this._response.length); + } + } + } + }, { + key: '_clearSubscriptions', + value: function _clearSubscriptions() { + (this._subscriptions || []).forEach(function (sub) { + sub.remove(); + }); + this._subscriptions = []; + } + }, { + key: 'getAllResponseHeaders', + value: function getAllResponseHeaders() { + if (!this.responseHeaders) { + return null; + } + var headers = this.responseHeaders || {}; + return Object.keys(headers).map(function (headerName) { + return headerName + ': ' + headers[headerName]; + }).join('\r\n'); + } + }, { + key: 'getResponseHeader', + value: function getResponseHeader(header) { + var value = this._lowerCaseResponseHeaders[header.toLowerCase()]; + return value !== undefined ? value : null; + } + }, { + key: 'setRequestHeader', + value: function setRequestHeader(header, value) { + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + this._headers[header.toLowerCase()] = String(value); + } + }, { + key: 'setTrackingName', + value: function setTrackingName(trackingName) { + this._trackingName = trackingName; + return this; + } + }, { + key: 'open', + value: function open(method, url, async) { + if (this.readyState !== this.UNSENT) { + throw new Error('Cannot open, already sending'); + } + if (async !== undefined && !async) { + throw new Error('Synchronous http requests are not supported'); + } + if (!url) { + throw new Error('Cannot load an empty url'); + } + this._method = method.toUpperCase(); + this._url = url; + this._aborted = false; + this.setReadyState(this.OPENED); + } + }, { + key: 'send', + value: function send(data) { + var _this3 = this; + + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + if (this._sent) { + throw new Error('Request has already been sent'); + } + this._sent = true; + var incrementalEvents = this._incrementalEvents || !!this.onreadystatechange || !!this.onprogress; + + this._subscriptions.push(RCTNetworking.addListener('didSendNetworkData', function (args) { + return _this3.__didUploadProgress.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkResponse', function (args) { + return _this3.__didReceiveResponse.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkData', function (args) { + return _this3.__didReceiveData.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkIncrementalData', function (args) { + return _this3.__didReceiveIncrementalData.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + this._subscriptions.push(RCTNetworking.addListener('didReceiveNetworkDataProgress', function (args) { + return _this3.__didReceiveDataProgress.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + this._subscriptions.push(RCTNetworking.addListener('didCompleteNetworkResponse', function (args) { + return _this3.__didCompleteResponse.apply(_this3, babelHelpers.toConsumableArray(args)); + })); + + var nativeResponseType = 'text'; + if (this._responseType === 'arraybuffer' || this._responseType === 'blob') { + nativeResponseType = 'base64'; + } + + invariant(this._method, 'Request method needs to be defined.'); + invariant(this._url, 'Request URL needs to be defined.'); + RCTNetworking.sendRequest(this._method, this._trackingName, this._url, this._headers, data, nativeResponseType, incrementalEvents, this.timeout, this.__didCreateRequest.bind(this)); + } + }, { + key: 'abort', + value: function abort() { + this._aborted = true; + if (this._requestId) { + RCTNetworking.abortRequest(this._requestId); + } + + if (!(this.readyState === this.UNSENT || this.readyState === this.OPENED && !this._sent || this.readyState === this.DONE)) { + this._reset(); + this.setReadyState(this.DONE); + } + + this._reset(); + } + }, { + key: 'setResponseHeaders', + value: function setResponseHeaders(responseHeaders) { + this.responseHeaders = responseHeaders || null; + var headers = responseHeaders || {}; + this._lowerCaseResponseHeaders = Object.keys(headers).reduce(function (lcaseHeaders, headerName) { + lcaseHeaders[headerName.toLowerCase()] = headers[headerName]; + return lcaseHeaders; + }, {}); + } + }, { + key: 'setReadyState', + value: function setReadyState(newState) { + this.readyState = newState; + this.dispatchEvent({ type: 'readystatechange' }); + if (newState === this.DONE) { + if (this._aborted) { + this.dispatchEvent({ type: 'abort' }); + } else if (this._hasError) { + if (this._timedOut) { + this.dispatchEvent({ type: 'timeout' }); + } else { + this.dispatchEvent({ type: 'error' }); + } + } else { + this.dispatchEvent({ type: 'load' }); + } + this.dispatchEvent({ type: 'loadend' }); + } + } + }, { + key: 'addEventListener', + value: function addEventListener(type, listener) { + if (type === 'readystatechange' || type === 'progress') { + this._incrementalEvents = true; + } + babelHelpers.get(XMLHttpRequest.prototype.__proto__ || Object.getPrototypeOf(XMLHttpRequest.prototype), 'addEventListener', this).call(this, type, listener); + } + }, { + key: 'responseType', + get: function get() { + return this._responseType; + }, + set: function set(responseType) { + if (this._sent) { + throw new Error('Failed to set the \'responseType\' property on \'XMLHttpRequest\': The ' + 'response type cannot be set after the request has been sent.'); + } + if (!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)) { + warning(false, 'The provided value \'' + responseType + '\' is not a valid \'responseType\'.'); + return; + } + + invariant(SUPPORTED_RESPONSE_TYPES[responseType] || responseType === 'document', 'The provided value \'' + responseType + '\' is unsupported in this environment.'); + this._responseType = responseType; + } + }, { + key: 'responseText', + get: function get() { + if (this._responseType !== '' && this._responseType !== 'text') { + throw new Error("The 'responseText' property is only available if 'responseType' " + ('is set to \'\' or \'text\', but it is \'' + this._responseType + '\'.')); + } + if (this.readyState < LOADING) { + return ''; + } + return this._response; + } + }, { + key: 'response', + get: function get() { + var responseType = this.responseType; + + if (responseType === '' || responseType === 'text') { + return this.readyState < LOADING || this._hasError ? '' : this._response; + } + + if (this.readyState !== DONE) { + return null; + } + + if (this._cachedResponse !== undefined) { + return this._cachedResponse; + } + + switch (responseType) { + case 'document': + this._cachedResponse = null; + break; + + case 'arraybuffer': + this._cachedResponse = base64.toByteArray(this._response).buffer; + break; + + case 'blob': + this._cachedResponse = new global.Blob([base64.toByteArray(this._response).buffer], { type: this.getResponseHeader('content-type') || '' }); + break; + + case 'json': + try { + this._cachedResponse = JSON.parse(this._response); + } catch (_) { + this._cachedResponse = null; + } + break; + + default: + this._cachedResponse = null; + } + + return this._cachedResponse; + } + }]); + return XMLHttpRequest; +}(EventTarget.apply(undefined, babelHelpers.toConsumableArray(XHR_EVENTS))); + +XMLHttpRequest.UNSENT = UNSENT; +XMLHttpRequest.OPENED = OPENED; +XMLHttpRequest.HEADERS_RECEIVED = HEADERS_RECEIVED; +XMLHttpRequest.LOADING = LOADING; +XMLHttpRequest.DONE = DONE; +XMLHttpRequest._interceptor = null; + + +module.exports = XMLHttpRequest; +}, 259, null, "XMLHttpRequest"); +__d(/* RCTNetworking */function(global, require, module, exports) { +'use strict'; + +var FormData = require(261 ); // 261 = FormData +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var RCTNetworkingNative = require(80 ).Networking; // 80 = NativeModules +var convertRequestBody = require(262 ); // 262 = convertRequestBody + +var RCTNetworking = function (_NativeEventEmitter) { + babelHelpers.inherits(RCTNetworking, _NativeEventEmitter); + + function RCTNetworking() { + babelHelpers.classCallCheck(this, RCTNetworking); + return babelHelpers.possibleConstructorReturn(this, (RCTNetworking.__proto__ || Object.getPrototypeOf(RCTNetworking)).call(this, RCTNetworkingNative)); + } + + babelHelpers.createClass(RCTNetworking, [{ + key: 'sendRequest', + value: function sendRequest(method, trackingName, url, headers, data, responseType, incrementalUpdates, timeout, callback) { + var body = convertRequestBody(data); + RCTNetworkingNative.sendRequest({ + method: method, + url: url, + data: babelHelpers.extends({}, body, { trackingName: trackingName }), + headers: headers, + responseType: responseType, + incrementalUpdates: incrementalUpdates, + timeout: timeout + }, callback); + } + }, { + key: 'abortRequest', + value: function abortRequest(requestId) { + RCTNetworkingNative.abortRequest(requestId); + } + }, { + key: 'clearCookies', + value: function clearCookies(callback) { + RCTNetworkingNative.clearCookies(callback); + } + }]); + return RCTNetworking; +}(NativeEventEmitter); + +module.exports = new RCTNetworking(); +}, 260, null, "RCTNetworking"); +__d(/* FormData */function(global, require, module, exports) { +'use strict'; + +var FormData = function () { + function FormData() { + babelHelpers.classCallCheck(this, FormData); + + this._parts = []; + } + + babelHelpers.createClass(FormData, [{ + key: 'append', + value: function append(key, value) { + this._parts.push([key, value]); + } + }, { + key: 'getParts', + value: function getParts() { + return this._parts.map(function (_ref) { + var _ref2 = babelHelpers.slicedToArray(_ref, 2), + name = _ref2[0], + value = _ref2[1]; + + var contentDisposition = 'form-data; name="' + name + '"'; + + var headers = { 'content-disposition': contentDisposition }; + + if (typeof value === 'object') { + if (typeof value.name === 'string') { + headers['content-disposition'] += '; filename="' + value.name + '"'; + } + if (typeof value.type === 'string') { + headers['content-type'] = value.type; + } + return babelHelpers.extends({}, value, { headers: headers, fieldName: name }); + } + + return { string: String(value), headers: headers, fieldName: name }; + }); + } + }]); + return FormData; +}(); + +module.exports = FormData; +}, 261, null, "FormData"); +__d(/* convertRequestBody */function(global, require, module, exports) { +'use strict'; + +var binaryToBase64 = require(114 ); // 114 = binaryToBase64 + +var FormData = require(261 ); // 261 = FormData + +function convertRequestBody(body) { + if (typeof body === 'string') { + return { string: body }; + } + if (body instanceof FormData) { + return { formData: body.getParts() }; + } + if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) { + return { base64: binaryToBase64(body) }; + } + return body; +} + +module.exports = convertRequestBody; +}, 262, null, "convertRequestBody"); +__d(/* Geolocation */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var RCTLocationObserver = require(80 ).LocationObserver; // 80 = NativeModules + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var logError = require(112 ); // 112 = logError +var warning = require(40 ); // 40 = fbjs/lib/warning + +var LocationEventEmitter = new NativeEventEmitter(RCTLocationObserver); + +var subscriptions = []; +var updatesEnabled = false; + +var Geolocation = { + getCurrentPosition: function getCurrentPosition(geo_success, geo_error, geo_options) { + invariant(typeof geo_success === 'function', 'Must provide a valid geo_success callback.'); + RCTLocationObserver.getCurrentPosition(geo_options || {}, geo_success, geo_error || logError); + }, + + watchPosition: function watchPosition(success, error, options) { + if (!updatesEnabled) { + RCTLocationObserver.startObserving(options || {}); + updatesEnabled = true; + } + var watchID = subscriptions.length; + subscriptions.push([LocationEventEmitter.addListener('geolocationDidChange', success), error ? LocationEventEmitter.addListener('geolocationError', error) : null]); + return watchID; + }, + + clearWatch: function clearWatch(watchID) { + var sub = subscriptions[watchID]; + if (!sub) { + return; + } + + sub[0].remove(); + + var sub1 = sub[1];sub1 && sub1.remove(); + subscriptions[watchID] = undefined; + var noWatchers = true; + for (var ii = 0; ii < subscriptions.length; ii++) { + if (subscriptions[ii]) { + noWatchers = false; + } + } + if (noWatchers) { + Geolocation.stopObserving(); + } + }, + + stopObserving: function stopObserving() { + if (updatesEnabled) { + RCTLocationObserver.stopObserving(); + updatesEnabled = false; + for (var ii = 0; ii < subscriptions.length; ii++) { + var sub = subscriptions[ii]; + if (sub) { + warning('Called stopObserving with existing subscriptions.'); + sub[0].remove(); + + var sub1 = sub[1];sub1 && sub1.remove(); + } + } + subscriptions = []; + } + } +}; + +module.exports = Geolocation; +}, 263, null, "Geolocation"); +__d(/* setupDevtools */function(global, require, module, exports) { +'use strict'; + +var NativeModules = require(80 ); // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform + +function setupDevtools() { + var messageListeners = []; + var closeListeners = []; + var hostname = 'localhost'; + if (Platform.OS === 'android' && NativeModules.AndroidConstants) { + hostname = NativeModules.AndroidConstants.ServerHost.split(':')[0]; + } + var port = window.__REACT_DEVTOOLS_PORT__ || 8097; + var ws = new window.WebSocket('ws://' + hostname + ':' + port + '/devtools'); + + var FOR_BACKEND = { + resolveRNStyle: require(77 ), // 77 = flattenStyle + wall: { + listen: function listen(fn) { + messageListeners.push(fn); + }, + onClose: function onClose(fn) { + closeListeners.push(fn); + }, + send: function send(data) { + ws.send(JSON.stringify(data)); + } + } + }; + ws.onclose = handleClose; + ws.onerror = handleClose; + ws.onopen = function () { + tryToConnect(); + }; + + var hasClosed = false; + function handleClose() { + if (!hasClosed) { + hasClosed = true; + setTimeout(setupDevtools, 2000); + closeListeners.forEach(function (fn) { + return fn(); + }); + } + } + + function tryToConnect() { + ws.send('attach:agent'); + var _interval = setInterval(function () { + return ws.send('attach:agent'); + }, 500); + ws.onmessage = function (evt) { + if (evt.data.indexOf('eval:') === 0) { + clearInterval(_interval); + initialize(evt.data.slice('eval:'.length)); + } + }; + } + + function initialize(text) { + try { + eval(text); + } catch (e) { + console.error('Failed to eval: ' + e.message); + return; + } + + var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + ComponentTree: { + getClosestInstanceFromNode: function getClosestInstanceFromNode(node) { + return ReactNativeComponentTree.getClosestInstanceFromNode(node); + }, + getNodeFromInstance: function getNodeFromInstance(inst) { + while (inst._renderedComponent) { + inst = inst._renderedComponent; + } + if (inst) { + return ReactNativeComponentTree.getNodeFromInstance(inst); + } else { + return null; + } + } + }, + Mount: require(265 ), // 265 = ReactNativeMount + Reconciler: require(173 ) // 173 = ReactReconciler + }); + ws.onmessage = handleMessage; + } + + function handleMessage(evt) { + var data; + try { + data = JSON.parse(evt.data); + } catch (e) { + return console.error('failed to parse json: ' + evt.data); + } + + if (data.$close || data.$error) { + closeListeners.forEach(function (fn) { + return fn(); + }); + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.emit('shutdown'); + tryToConnect(); + return; + } + if (data.$open) { + return; + } + messageListeners.forEach(function (fn) { + try { + fn(data); + } catch (e) { + console.log(data); + throw e; + } + }); + } +} + +module.exports = setupDevtools; +}, 264, null, "setupDevtools"); +__d(/* ReactNativeMount */function(global, require, module, exports) { +'use strict'; + +var React = require(126 ); // 126 = React +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation +var ReactNativeContainerInfo = require(266 ); // 266 = ReactNativeContainerInfo +var ReactNativeTagHandles = require(168 ); // 168 = ReactNativeTagHandles +var ReactReconciler = require(173 ); // 173 = ReactReconciler +var ReactUpdateQueue = require(267 ); // 267 = ReactUpdateQueue +var ReactUpdates = require(169 ); // 169 = ReactUpdates +var UIManager = require(123 ); // 123 = UIManager + +var emptyObject = require(43 ); // 43 = fbjs/lib/emptyObject +var instantiateReactComponent = require(181 ); // 181 = instantiateReactComponent +var shouldUpdateReactComponent = require(188 ); // 188 = shouldUpdateReactComponent + +var TopLevelWrapper = function TopLevelWrapper() {}; +TopLevelWrapper.prototype.isReactComponent = {}; +if (__DEV__) { + TopLevelWrapper.displayName = 'TopLevelWrapper'; +} +TopLevelWrapper.prototype.render = function () { + return this.props.child; +}; +TopLevelWrapper.isReactTopLevelWrapper = true; + +function mountComponentIntoNode(componentInstance, containerTag, transaction) { + var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactNativeContainerInfo(containerTag), emptyObject, 0); + componentInstance._renderedComponent._topLevelWrapper = componentInstance; + ReactNativeMount._mountImageIntoNode(markup, containerTag); +} + +function batchedMountComponentIntoNode(componentInstance, containerTag) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(); + transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction); + ReactUpdates.ReactReconcileTransaction.release(transaction); +} + +var ReactNativeMount = { + _instancesByContainerID: {}, + + findNodeHandle: require(124 ), // 124 = findNodeHandle + + renderComponent: function renderComponent(nextElement, containerTag, callback) { + var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement }); + + var topRootNodeID = containerTag; + var prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID]; + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement; + var prevElement = prevWrappedElement.props.child; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + ReactUpdateQueue.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject); + if (callback) { + ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); + } + return prevComponent; + } else { + ReactNativeMount.unmountComponentAtNode(containerTag); + } + } + + if (!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)) { + console.error('You cannot render into anything but a top root'); + return null; + } + + ReactNativeTagHandles.assertRootTag(containerTag); + + var instance = instantiateReactComponent(nextWrappedElement, false); + ReactNativeMount._instancesByContainerID[containerTag] = instance; + + ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag); + var component = instance.getPublicInstance(); + if (callback) { + callback.call(component); + } + return component; + }, + + _mountImageIntoNode: function _mountImageIntoNode(mountImage, containerID) { + var childTag = mountImage; + UIManager.setChildren(containerID, [childTag]); + }, + + unmountComponentAtNodeAndRemoveContainer: function unmountComponentAtNodeAndRemoveContainer(containerTag) { + ReactNativeMount.unmountComponentAtNode(containerTag); + + UIManager.removeRootView(containerTag); + }, + + unmountComponentAtNode: function unmountComponentAtNode(containerTag) { + if (!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)) { + console.error('You cannot render into anything but a top root'); + return false; + } + + var instance = ReactNativeMount._instancesByContainerID[containerTag]; + if (!instance) { + return false; + } + if (__DEV__) { + ReactInstrumentation.debugTool.onBeginFlush(); + } + ReactNativeMount.unmountComponentFromNode(instance, containerTag); + delete ReactNativeMount._instancesByContainerID[containerTag]; + if (__DEV__) { + ReactInstrumentation.debugTool.onEndFlush(); + } + return true; + }, + + unmountComponentFromNode: function unmountComponentFromNode(instance, containerID) { + ReactReconciler.unmountComponent(instance); + UIManager.removeSubviewsFromContainerWithID(containerID); + } + +}; + +module.exports = ReactNativeMount; +}, 265, null, "ReactNativeMount"); +__d(/* ReactNativeContainerInfo */function(global, require, module, exports) { +'use strict'; + +function ReactNativeContainerInfo(tag) { + var info = { + _tag: tag + }; + return info; +} + +module.exports = ReactNativeContainerInfo; +}, 266, null, "ReactNativeContainerInfo"); +__d(/* ReactUpdateQueue */function(global, require, module, exports) { + +'use strict'; + +var ReactCurrentOwner = require(49 ); // 49 = react/lib/ReactCurrentOwner +var ReactInstanceMap = require(125 ); // 125 = ReactInstanceMap +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation +var ReactUpdates = require(169 ); // 169 = ReactUpdates + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +function enqueueUpdate(internalInstance) { + ReactUpdates.enqueueUpdate(internalInstance); +} + +function formatUnexpectedArgument(arg) { + var type = typeof arg; + if (type !== 'object') { + return type; + } + var displayName = arg.constructor && arg.constructor.name || type; + var keys = Object.keys(arg); + if (keys.length > 0 && keys.length < 20) { + return displayName + ' (keys: ' + keys.join(', ') + ')'; + } + return displayName; +} + +function getInternalInstanceReadyForUpdate(publicInstance, callerName) { + var internalInstance = ReactInstanceMap.get(publicInstance); + if (!internalInstance) { + if (__DEV__) { + var ctor = publicInstance.constructor; + + warning(!callerName, '%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, ctor && (ctor.displayName || ctor.name) || 'ReactClass'); + } + return null; + } + + if (__DEV__) { + 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); + } + + return internalInstance; +} + +var ReactUpdateQueue = { + isMounted: function isMounted(publicInstance) { + if (__DEV__) { + var owner = ReactCurrentOwner.current; + if (owner !== null) { + warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component'); + owner._warnedAboutRefsInRender = true; + } + } + var internalInstance = ReactInstanceMap.get(publicInstance); + if (internalInstance) { + return !!internalInstance._renderedComponent; + } else { + return false; + } + }, + + enqueueCallback: function enqueueCallback(publicInstance, callback, callerName) { + ReactUpdateQueue.validateCallback(callback, callerName); + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + + if (!internalInstance) { + return null; + } + + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + + enqueueUpdate(internalInstance); + }, + + enqueueCallbackInternal: function enqueueCallbackInternal(internalInstance, callback) { + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + enqueueUpdate(internalInstance); + }, + + enqueueForceUpdate: function enqueueForceUpdate(publicInstance) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingForceUpdate = true; + + enqueueUpdate(internalInstance); + }, + + enqueueReplaceState: function enqueueReplaceState(publicInstance, completeState) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); + + if (!internalInstance) { + return; + } + + internalInstance._pendingStateQueue = [completeState]; + internalInstance._pendingReplaceState = true; + + enqueueUpdate(internalInstance); + }, + + enqueueSetState: function enqueueSetState(publicInstance, partialState) { + if (__DEV__) { + ReactInstrumentation.debugTool.onSetState(); + warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().'); + } + + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState'); + + if (!internalInstance) { + return; + } + + var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []); + queue.push(partialState); + + enqueueUpdate(internalInstance); + }, + + enqueueElementInternal: function enqueueElementInternal(internalInstance, nextElement, nextContext) { + internalInstance._pendingElement = nextElement; + + internalInstance._context = nextContext; + enqueueUpdate(internalInstance); + }, + + validateCallback: function validateCallback(callback, callerName) { + invariant(!callback || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)); + } + +}; + +module.exports = ReactUpdateQueue; +}, 267, null, "ReactUpdateQueue"); +__d(/* RCTDebugComponentOwnership */function(global, require, module, exports) { + +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge + +var RCTDebugComponentOwnership = { + getOwnerHierarchy: function getOwnerHierarchy(requestID, tag) { + throw new Error('This seems to be unused. Will disable until it is needed again.'); + } +}; + +BatchedBridge.registerCallableModule('RCTDebugComponentOwnership', RCTDebugComponentOwnership); + +module.exports = RCTDebugComponentOwnership; +}, 268, null, "RCTDebugComponentOwnership"); +__d(/* JSInspector */function(global, require, module, exports) { +'use strict'; + +var JSInspector = { + registerAgent: function registerAgent(type) { + if (global.__registerInspectorAgent) { + global.__registerInspectorAgent(type); + } + }, + getTimestamp: function getTimestamp() { + return global.__inspectorTimestamp(); + } +}; + +module.exports = JSInspector; +}, 269, null, "JSInspector"); +__d(/* NetworkAgent */function(global, require, module, exports) { +'use strict'; + +var InspectorAgent = require(271 ); // 271 = InspectorAgent +var JSInspector = require(269 ); // 269 = JSInspector +var Map = require(223 ); // 223 = Map +var XMLHttpRequest = require(259 ); // 259 = XMLHttpRequest + +var Interceptor = function () { + function Interceptor(agent) { + babelHelpers.classCallCheck(this, Interceptor); + + this._agent = agent; + this._requests = new Map(); + } + + babelHelpers.createClass(Interceptor, [{ + key: 'getData', + value: function getData(requestId) { + return this._requests.get(requestId); + } + }, { + key: 'requestSent', + value: function requestSent(id, url, method, headers) { + var requestId = String(id); + this._requests.set(requestId, ''); + + var request = { + url: url, + method: method, + headers: headers, + initialPriority: 'Medium' + }; + var event = { + requestId: requestId, + documentURL: '', + frameId: '1', + loaderId: '1', + request: request, + timestamp: JSInspector.getTimestamp(), + initiator: { + type: 'other' + }, + type: 'Other' + }; + this._agent.sendEvent('requestWillBeSent', event); + } + }, { + key: 'responseReceived', + value: function responseReceived(id, url, status, headers) { + var requestId = String(id); + var response = { + url: url, + status: status, + statusText: String(status), + headers: headers, + + requestHeaders: {}, + mimeType: this._getMimeType(headers), + connectionReused: false, + connectionId: -1, + encodedDataLength: 0, + securityState: 'unknown' + }; + + var event = { + requestId: requestId, + frameId: '1', + loaderId: '1', + timestamp: JSInspector.getTimestamp(), + type: 'Other', + response: response + }; + this._agent.sendEvent('responseReceived', event); + } + }, { + key: 'dataReceived', + value: function dataReceived(id, data) { + var requestId = String(id); + var existingData = this._requests.get(requestId) || ''; + this._requests.set(requestId, existingData.concat(data)); + var event = { + requestId: requestId, + timestamp: JSInspector.getTimestamp(), + dataLength: data.length, + encodedDataLength: data.length + }; + this._agent.sendEvent('dataReceived', event); + } + }, { + key: 'loadingFinished', + value: function loadingFinished(id, encodedDataLength) { + var event = { + requestId: String(id), + timestamp: JSInspector.getTimestamp(), + encodedDataLength: encodedDataLength + }; + this._agent.sendEvent('loadingFinished', event); + } + }, { + key: 'loadingFailed', + value: function loadingFailed(id, error) { + var event = { + requestId: String(id), + timestamp: JSInspector.getTimestamp(), + type: 'Other', + errorText: error + }; + this._agent.sendEvent('loadingFailed', event); + } + }, { + key: '_getMimeType', + value: function _getMimeType(headers) { + var contentType = headers['Content-Type'] || ''; + return contentType.split(';')[0]; + } + }]); + return Interceptor; +}(); + +var NetworkAgent = function (_InspectorAgent) { + babelHelpers.inherits(NetworkAgent, _InspectorAgent); + + function NetworkAgent() { + babelHelpers.classCallCheck(this, NetworkAgent); + return babelHelpers.possibleConstructorReturn(this, (NetworkAgent.__proto__ || Object.getPrototypeOf(NetworkAgent)).apply(this, arguments)); + } + + babelHelpers.createClass(NetworkAgent, [{ + key: 'enable', + value: function enable(_ref) { + var maxResourceBufferSize = _ref.maxResourceBufferSize, + maxTotalBufferSize = _ref.maxTotalBufferSize; + + this._interceptor = new Interceptor(this); + XMLHttpRequest.setInterceptor(this._interceptor); + } + }, { + key: 'disable', + value: function disable() { + XMLHttpRequest.setInterceptor(null); + this._interceptor = null; + } + }, { + key: 'getResponseBody', + value: function getResponseBody(_ref2) { + var requestId = _ref2.requestId; + + return { body: this.interceptor().getData(requestId), base64Encoded: false }; + } + }, { + key: 'interceptor', + value: function interceptor() { + if (this._interceptor) { + return this._interceptor; + } else { + throw Error('_interceptor can not be null'); + } + } + }]); + return NetworkAgent; +}(InspectorAgent); + +NetworkAgent.DOMAIN = 'Network'; + + +module.exports = NetworkAgent; +}, 270, null, "NetworkAgent"); +__d(/* InspectorAgent */function(global, require, module, exports) { +'use strict'; + +var InspectorAgent = function () { + function InspectorAgent(eventSender) { + babelHelpers.classCallCheck(this, InspectorAgent); + + this._eventSender = eventSender; + } + + babelHelpers.createClass(InspectorAgent, [{ + key: 'sendEvent', + value: function sendEvent(name, params) { + this._eventSender(name, params); + } + }]); + return InspectorAgent; +}(); + +module.exports = InspectorAgent; +}, 271, null, "InspectorAgent"); +__d(/* RCTNativeAppEventEmitter */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter + +var RCTNativeAppEventEmitter = RCTDeviceEventEmitter; + +BatchedBridge.registerCallableModule('RCTNativeAppEventEmitter', RCTNativeAppEventEmitter); + +module.exports = RCTNativeAppEventEmitter; +}, 272, null, "RCTNativeAppEventEmitter"); +__d(/* PerformanceLogger */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge +var performanceNow = global.nativePerformanceNow || require(90 ); // 90 = fbjs/lib/performanceNow + +var timespans = {}; +var extras = {}; + +var PerformanceLogger = { + addTimespan: function addTimespan(key, lengthInMs, description) { + if (timespans[key]) { + if (__DEV__) { + console.log('PerformanceLogger: Attempting to add a timespan that already exists ', key); + } + return; + } + + timespans[key] = { + description: description, + totalTime: lengthInMs + }; + }, + startTimespan: function startTimespan(key, description) { + if (timespans[key]) { + if (__DEV__) { + console.log('PerformanceLogger: Attempting to start a timespan that already exists ', key); + } + return; + } + + timespans[key] = { + description: description, + startTime: performanceNow() + }; + }, + stopTimespan: function stopTimespan(key) { + if (!timespans[key] || !timespans[key].startTime) { + if (__DEV__) { + console.log('PerformanceLogger: Attempting to end a timespan that has not started ', key); + } + return; + } + if (timespans[key].endTime) { + if (__DEV__) { + console.log('PerformanceLogger: Attempting to end a timespan that has already ended ', key); + } + return; + } + + timespans[key].endTime = performanceNow(); + timespans[key].totalTime = timespans[key].endTime - timespans[key].startTime; + }, + clear: function clear() { + timespans = {}; + extras = {}; + }, + clearExceptTimespans: function clearExceptTimespans(keys) { + timespans = Object.keys(timespans).reduce(function (previous, key) { + if (keys.indexOf(key) !== -1) { + previous[key] = timespans[key]; + } + return previous; + }, {}); + extras = {}; + }, + getTimespans: function getTimespans() { + return timespans; + }, + hasTimespan: function hasTimespan(key) { + return !!timespans[key]; + }, + logTimespans: function logTimespans() { + for (var key in timespans) { + if (timespans[key].totalTime) { + console.log(key + ': ' + timespans[key].totalTime + 'ms'); + } + } + }, + addTimespans: function addTimespans(newTimespans, labels) { + for (var i = 0, l = newTimespans.length; i < l; i += 2) { + var label = labels[i / 2]; + PerformanceLogger.addTimespan(label, newTimespans[i + 1] - newTimespans[i], label); + } + }, + setExtra: function setExtra(key, value) { + if (extras[key]) { + if (__DEV__) { + console.log('PerformanceLogger: Attempting to set an extra that already exists ', key); + } + return; + } + extras[key] = value; + }, + getExtras: function getExtras() { + return extras; + } +}; + +BatchedBridge.registerCallableModule('PerformanceLogger', PerformanceLogger); + +module.exports = PerformanceLogger; +}, 273, null, "PerformanceLogger"); +__d(/* RCTEventEmitter */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge + +var RCTEventEmitter = { + register: function register(eventEmitter) { + BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter); + } +}; + +module.exports = RCTEventEmitter; +}, 274, null, "RCTEventEmitter"); +__d(/* ReactDefaultBatchingStrategy */function(global, require, module, exports) { + +'use strict'; + +var ReactUpdates = require(169 ); // 169 = ReactUpdates +var Transaction = require(177 ); // 177 = Transaction + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction + +var RESET_BATCHED_UPDATES = { + initialize: emptyFunction, + close: function close() { + ReactDefaultBatchingStrategy.isBatchingUpdates = false; + } +}; + +var FLUSH_BATCHED_UPDATES = { + initialize: emptyFunction, + close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) +}; + +var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; + +function ReactDefaultBatchingStrategyTransaction() { + this.reinitializeTransaction(); +} + +babelHelpers.extends(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, { + getTransactionWrappers: function getTransactionWrappers() { + return TRANSACTION_WRAPPERS; + } +}); + +var transaction = new ReactDefaultBatchingStrategyTransaction(); + +var ReactDefaultBatchingStrategy = { + isBatchingUpdates: false, + + batchedUpdates: function batchedUpdates(callback, a, b, c, d, e) { + var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; + + ReactDefaultBatchingStrategy.isBatchingUpdates = true; + + if (alreadyBatchingUpdates) { + return callback(a, b, c, d, e); + } else { + return transaction.perform(callback, null, a, b, c, d, e); + } + } +}; + +module.exports = ReactDefaultBatchingStrategy; +}, 275, null, "ReactDefaultBatchingStrategy"); +__d(/* ReactNativeBridgeEventPlugin */function(global, require, module, exports) { +'use strict'; + +var EventPropagators = require(277 ); // 277 = EventPropagators +var SyntheticEvent = require(278 ); // 278 = SyntheticEvent +var UIManager = require(123 ); // 123 = UIManager + +var warning = require(40 ); // 40 = fbjs/lib/warning + +var customBubblingEventTypes = UIManager.customBubblingEventTypes; +var customDirectEventTypes = UIManager.customDirectEventTypes; + +var allTypesByEventName = {}; + +for (var bubblingTypeName in customBubblingEventTypes) { + allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; +} + +for (var directTypeName in customDirectEventTypes) { + warning(!customBubblingEventTypes[directTypeName], 'Event cannot be both direct and bubbling: %s', directTypeName); + allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; +} + +var ReactNativeBridgeEventPlugin = { + + eventTypes: babelHelpers.extends({}, customBubblingEventTypes, customDirectEventTypes), + + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType]; + var directDispatchConfig = customDirectEventTypes[topLevelType]; + var event = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) { + EventPropagators.accumulateTwoPhaseDispatches(event); + } else if (directDispatchConfig) { + EventPropagators.accumulateDirectDispatches(event); + } else { + return null; + } + return event; + } +}; + +module.exports = ReactNativeBridgeEventPlugin; +}, 276, null, "ReactNativeBridgeEventPlugin"); +__d(/* EventPropagators */function(global, require, module, exports) { + +'use strict'; + +var EventPluginHub = require(161 ); // 161 = EventPluginHub +var EventPluginUtils = require(163 ); // 163 = EventPluginUtils + +var accumulateInto = require(165 ); // 165 = accumulateInto +var forEachAccumulated = require(166 ); // 166 = forEachAccumulated +var warning = require(40 ); // 40 = fbjs/lib/warning + +var getListener = EventPluginHub.getListener; + +function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); +} + +function accumulateDirectionalDispatches(inst, phase, event) { + if (__DEV__) { + warning(inst, 'Dispatching inst must not be null'); + } + var listener = listenerAtPhase(inst, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } +} + +function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } +} + +function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null; + EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + } +} + +function accumulateDispatches(inst, ignoredDirection, event) { + if (event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } +} + +function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } +} + +function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); +} + +function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); +} + +function accumulateEnterLeaveDispatches(leave, enter, from, to) { + EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); +} + +function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); +} + +var EventPropagators = { + accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, + accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, + accumulateDirectDispatches: accumulateDirectDispatches, + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches +}; + +module.exports = EventPropagators; +}, 277, null, "EventPropagators"); +__d(/* SyntheticEvent */function(global, require, module, exports) { + +'use strict'; + +var PooledClass = require(171 ); // 171 = PooledClass + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var warning = require(40 ); // 40 = fbjs/lib/warning + +var didWarnForAddedNewProperty = false; +var isProxySupported = typeof Proxy === 'function'; + +var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances']; + +var EventInterface = { + type: null, + target: null, + + currentTarget: emptyFunction.thatReturnsNull, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null +}; + +function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + if (__DEV__) { + delete this.nativeEvent; + delete this.preventDefault; + delete this.stopPropagation; + } + + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + if (__DEV__) { + delete this[propName]; + } + var normalize = Interface[propName]; + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + if (propName === 'target') { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } + } + } + + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + if (defaultPrevented) { + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; + } else { + this.isDefaultPrevented = emptyFunction.thatReturnsFalse; + } + this.isPropagationStopped = emptyFunction.thatReturnsFalse; + return this; +} + +babelHelpers.extends(SyntheticEvent.prototype, { + + preventDefault: function preventDefault() { + this.defaultPrevented = true; + var event = this.nativeEvent; + if (!event) { + return; + } + + if (event.preventDefault) { + event.preventDefault(); + } else if (typeof event.returnValue !== 'unknown') { + event.returnValue = false; + } + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; + }, + + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + if (!event) { + return; + } + + if (event.stopPropagation) { + event.stopPropagation(); + } else if (typeof event.cancelBubble !== 'unknown') { + event.cancelBubble = true; + } + + this.isPropagationStopped = emptyFunction.thatReturnsTrue; + }, + + persist: function persist() { + this.isPersistent = emptyFunction.thatReturnsTrue; + }, + + isPersistent: emptyFunction.thatReturnsFalse, + + destructor: function destructor() { + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (__DEV__) { + Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + } else { + this[propName] = null; + } + } + for (var i = 0; i < shouldBeReleasedProperties.length; i++) { + this[shouldBeReleasedProperties[i]] = null; + } + if (__DEV__) { + Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); + Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction)); + Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); + } + } + +}); + +SyntheticEvent.Interface = EventInterface; + +if (__DEV__) { + if (isProxySupported) { + SyntheticEvent = new Proxy(SyntheticEvent, { + construct: function construct(target, args) { + return this.apply(target, Object.create(target.prototype), args); + }, + apply: function apply(constructor, that, args) { + return new Proxy(constructor.apply(that, args), { + set: function set(target, prop, value) { + if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { + 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.'); + didWarnForAddedNewProperty = true; + } + target[prop] = value; + return true; + } + }); + } + }); + } +} + +SyntheticEvent.augmentClass = function (Class, Interface) { + var Super = this; + + var E = function E() {}; + E.prototype = Super.prototype; + var prototype = new E(); + + babelHelpers.extends(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + + Class.Interface = babelHelpers.extends({}, Super.Interface, Interface); + Class.augmentClass = Super.augmentClass; + + PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); +}; + +PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); + +module.exports = SyntheticEvent; + +function getPooledWarningPropertyDefinition(propName, getVal) { + var isFunction = typeof getVal === 'function'; + return { + configurable: true, + set: set, + get: get + }; + + function set(val) { + var action = isFunction ? 'setting the method' : 'setting the property'; + warn(action, 'This is effectively a no-op'); + return val; + } + + function get() { + var action = isFunction ? 'accessing the method' : 'accessing the property'; + var result = isFunction ? 'This is a no-op function' : 'This is set to null'; + warn(action, result); + return getVal; + } + + function warn(action, result) { + var warningCondition = false; + 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); + } +} +}, 278, null, "SyntheticEvent"); +__d(/* ReactNativeComponentEnvironment */function(global, require, module, exports) { +'use strict'; + +var ReactNativeDOMIDOperations = require(280 ); // 280 = ReactNativeDOMIDOperations +var ReactNativeReconcileTransaction = require(281 ); // 281 = ReactNativeReconcileTransaction + +var ReactNativeComponentEnvironment = { + + processChildrenUpdates: ReactNativeDOMIDOperations.dangerouslyProcessChildrenUpdates, + + replaceNodeWithMarkup: ReactNativeDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, + + clearNode: function clearNode() {}, + + ReactReconcileTransaction: ReactNativeReconcileTransaction +}; + +module.exports = ReactNativeComponentEnvironment; +}, 279, null, "ReactNativeComponentEnvironment"); +__d(/* ReactNativeDOMIDOperations */function(global, require, module, exports) { +'use strict'; + +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var UIManager = require(123 ); // 123 = UIManager + +var dangerouslyProcessChildrenUpdates = function dangerouslyProcessChildrenUpdates(inst, childrenUpdates) { + if (!childrenUpdates.length) { + return; + } + + var containerTag = ReactNativeComponentTree.getNodeFromInstance(inst); + + var moveFromIndices; + var moveToIndices; + var addChildTags; + var addAtIndices; + var removeAtIndices; + + for (var i = 0; i < childrenUpdates.length; i++) { + var update = childrenUpdates[i]; + if (update.type === 'MOVE_EXISTING') { + (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex); + (moveToIndices || (moveToIndices = [])).push(update.toIndex); + } else if (update.type === 'REMOVE_NODE') { + (removeAtIndices || (removeAtIndices = [])).push(update.fromIndex); + } else if (update.type === 'INSERT_MARKUP') { + var mountImage = update.content; + var tag = mountImage; + (addAtIndices || (addAtIndices = [])).push(update.toIndex); + (addChildTags || (addChildTags = [])).push(tag); + } + } + + UIManager.manageChildren(containerTag, moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices); +}; + +var ReactNativeDOMIDOperations = { + dangerouslyProcessChildrenUpdates: dangerouslyProcessChildrenUpdates, + + dangerouslyReplaceNodeWithMarkupByID: function dangerouslyReplaceNodeWithMarkupByID(id, mountImage) { + var oldTag = id; + UIManager.replaceExistingNonRootView(oldTag, mountImage); + } +}; + +module.exports = ReactNativeDOMIDOperations; +}, 280, null, "ReactNativeDOMIDOperations"); +__d(/* ReactNativeReconcileTransaction */function(global, require, module, exports) { +'use strict'; + +var CallbackQueue = require(170 ); // 170 = CallbackQueue +var PooledClass = require(171 ); // 171 = PooledClass +var Transaction = require(177 ); // 177 = Transaction +var ReactInstrumentation = require(176 ); // 176 = ReactInstrumentation +var ReactUpdateQueue = require(267 ); // 267 = ReactUpdateQueue + +var ON_DOM_READY_QUEUEING = { + initialize: function initialize() { + this.reactMountReady.reset(); + }, + + close: function close() { + this.reactMountReady.notifyAll(); + } +}; + +var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING]; + +if (__DEV__) { + TRANSACTION_WRAPPERS.push({ + initialize: ReactInstrumentation.debugTool.onBeginFlush, + close: ReactInstrumentation.debugTool.onEndFlush + }); +} + +function ReactNativeReconcileTransaction() { + this.reinitializeTransaction(); + this.reactMountReady = CallbackQueue.getPooled(null); +} + +var Mixin = { + getTransactionWrappers: function getTransactionWrappers() { + return TRANSACTION_WRAPPERS; + }, + + getReactMountReady: function getReactMountReady() { + return this.reactMountReady; + }, + + getUpdateQueue: function getUpdateQueue() { + return ReactUpdateQueue; + }, + + checkpoint: function checkpoint() { + return this.reactMountReady.checkpoint(); + }, + + rollback: function rollback(checkpoint) { + this.reactMountReady.rollback(checkpoint); + }, + + destructor: function destructor() { + CallbackQueue.release(this.reactMountReady); + this.reactMountReady = null; + } +}; + +babelHelpers.extends(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin); + +PooledClass.addPoolingTo(ReactNativeReconcileTransaction); + +module.exports = ReactNativeReconcileTransaction; +}, 281, null, "ReactNativeReconcileTransaction"); +__d(/* ReactNativeEventPluginOrder */function(global, require, module, exports) { +'use strict'; + +var ReactNativeEventPluginOrder = ['ResponderEventPlugin', 'ReactNativeBridgeEventPlugin']; + +module.exports = ReactNativeEventPluginOrder; +}, 282, null, "ReactNativeEventPluginOrder"); +__d(/* ReactNativeGlobalResponderHandler */function(global, require, module, exports) { +'use strict'; + +var UIManager = require(123 ); // 123 = UIManager + +var ReactNativeGlobalResponderHandler = { + onChange: function onChange(from, to, blockNativeResponder) { + if (to !== null) { + UIManager.setJSResponder(to._rootNodeID, blockNativeResponder); + } else { + UIManager.clearJSResponder(); + } + } +}; + +module.exports = ReactNativeGlobalResponderHandler; +}, 283, null, "ReactNativeGlobalResponderHandler"); +__d(/* ReactNativeTextComponent */function(global, require, module, exports) { + +'use strict'; + +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree +var ReactNativeTagHandles = require(168 ); // 168 = ReactNativeTagHandles +var UIManager = require(123 ); // 123 = UIManager + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var ReactNativeTextComponent = function ReactNativeTextComponent(text) { + this._currentElement = text; + this._stringText = '' + text; + this._hostParent = null; + this._rootNodeID = 0; +}; + +babelHelpers.extends(ReactNativeTextComponent.prototype, { + + mountComponent: function mountComponent(transaction, hostParent, hostContainerInfo, context) { + invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText); + this._hostParent = hostParent; + var tag = ReactNativeTagHandles.allocateTag(); + this._rootNodeID = tag; + var nativeTopRootTag = hostContainerInfo._tag; + UIManager.createView(tag, 'RCTRawText', nativeTopRootTag, { text: this._stringText }); + + ReactNativeComponentTree.precacheNode(this, tag); + + return tag; + }, + + getHostNode: function getHostNode() { + return this._rootNodeID; + }, + + receiveComponent: function receiveComponent(nextText, transaction, context) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = '' + nextText; + if (nextStringText !== this._stringText) { + this._stringText = nextStringText; + UIManager.updateView(this._rootNodeID, 'RCTRawText', { text: this._stringText }); + } + } + }, + + unmountComponent: function unmountComponent() { + ReactNativeComponentTree.uncacheNode(this); + this._currentElement = null; + this._stringText = null; + this._rootNodeID = 0; + } + +}); + +module.exports = ReactNativeTextComponent; +}, 284, null, "ReactNativeTextComponent"); +__d(/* ReactNativeTreeTraversal */function(global, require, module, exports) { + +'use strict'; + +function getLowestCommonAncestor(instA, instB) { + var depthA = 0; + for (var tempA = instA; tempA; tempA = tempA._hostParent) { + depthA++; + } + var depthB = 0; + for (var tempB = instB; tempB; tempB = tempB._hostParent) { + depthB++; + } + + while (depthA - depthB > 0) { + instA = instA._hostParent; + depthA--; + } + + while (depthB - depthA > 0) { + instB = instB._hostParent; + depthB--; + } + + var depth = depthA; + while (depth--) { + if (instA === instB) { + return instA; + } + instA = instA._hostParent; + instB = instB._hostParent; + } + return null; +} + +function isAncestor(instA, instB) { + while (instB) { + if (instB === instA) { + return true; + } + instB = instB._hostParent; + } + return false; +} + +function getParentInstance(inst) { + return inst._hostParent; +} + +function traverseTwoPhase(inst, fn, arg) { + var path = []; + while (inst) { + path.push(inst); + inst = inst._hostParent; + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], 'captured', arg); + } + for (i = 0; i < path.length; i++) { + fn(path[i], 'bubbled', arg); + } +} + +function traverseEnterLeave(from, to, fn, argFrom, argTo) { + var common = from && to ? getLowestCommonAncestor(from, to) : null; + var pathFrom = []; + while (from && from !== common) { + pathFrom.push(from); + from = from._hostParent; + } + var pathTo = []; + while (to && to !== common) { + pathTo.push(to); + to = to._hostParent; + } + var i; + for (i = 0; i < pathFrom.length; i++) { + fn(pathFrom[i], 'bubbled', argFrom); + } + for (i = pathTo.length; i-- > 0;) { + fn(pathTo[i], 'captured', argTo); + } +} + +module.exports = { + isAncestor: isAncestor, + getLowestCommonAncestor: getLowestCommonAncestor, + getParentInstance: getParentInstance, + traverseTwoPhase: traverseTwoPhase, + traverseEnterLeave: traverseEnterLeave +}; +}, 285, null, "ReactNativeTreeTraversal"); +__d(/* ReactSimpleEmptyComponent */function(global, require, module, exports) { + +'use strict'; + +var ReactReconciler = require(173 ); // 173 = ReactReconciler + +var ReactSimpleEmptyComponent = function ReactSimpleEmptyComponent(placeholderElement, instantiate) { + this._currentElement = null; + this._renderedComponent = instantiate(placeholderElement); +}; +babelHelpers.extends(ReactSimpleEmptyComponent.prototype, { + mountComponent: function mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID) { + return ReactReconciler.mountComponent(this._renderedComponent, transaction, hostParent, hostContainerInfo, context, parentDebugID); + }, + receiveComponent: function receiveComponent() {}, + getHostNode: function getHostNode() { + return ReactReconciler.getHostNode(this._renderedComponent); + }, + unmountComponent: function unmountComponent() { + ReactReconciler.unmountComponent(this._renderedComponent); + this._renderedComponent = null; + } +}); + +module.exports = ReactSimpleEmptyComponent; +}, 286, null, "ReactSimpleEmptyComponent"); +__d(/* ResponderEventPlugin */function(global, require, module, exports) { + +'use strict'; + +var EventPluginUtils = require(163 ); // 163 = EventPluginUtils +var EventPropagators = require(277 ); // 277 = EventPropagators +var ResponderSyntheticEvent = require(288 ); // 288 = ResponderSyntheticEvent +var ResponderTouchHistoryStore = require(289 ); // 289 = ResponderTouchHistoryStore + +var accumulate = require(290 ); // 290 = accumulate + +var isStartish = EventPluginUtils.isStartish; +var isMoveish = EventPluginUtils.isMoveish; +var isEndish = EventPluginUtils.isEndish; +var executeDirectDispatch = EventPluginUtils.executeDirectDispatch; +var hasDispatches = EventPluginUtils.hasDispatches; +var executeDispatchesInOrderStopAtTrue = EventPluginUtils.executeDispatchesInOrderStopAtTrue; + +var responderInst = null; + +var trackedTouchCount = 0; + +var previousActiveTouches = 0; + +var changeResponder = function changeResponder(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst; + if (ResponderEventPlugin.GlobalResponderHandler !== null) { + ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + } +}; + +var eventTypes = { + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: 'onStartShouldSetResponder', + captured: 'onStartShouldSetResponderCapture' + } + }, + + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: 'onScrollShouldSetResponder', + captured: 'onScrollShouldSetResponderCapture' + } + }, + + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: 'onSelectionChangeShouldSetResponder', + captured: 'onSelectionChangeShouldSetResponderCapture' + } + }, + + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: 'onMoveShouldSetResponder', + captured: 'onMoveShouldSetResponderCapture' + } + }, + + responderStart: { registrationName: 'onResponderStart' }, + responderMove: { registrationName: 'onResponderMove' }, + responderEnd: { registrationName: 'onResponderEnd' }, + responderRelease: { registrationName: 'onResponderRelease' }, + responderTerminationRequest: { + registrationName: 'onResponderTerminationRequest' + }, + responderGrant: { registrationName: 'onResponderGrant' }, + responderReject: { registrationName: 'onResponderReject' }, + responderTerminate: { registrationName: 'onResponderTerminate' } +}; + +function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === 'topSelectionChange' ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; + + var bubbleShouldSetFrom = !responderInst ? targetInst : EventPluginUtils.getLowestCommonAncestor(responderInst, targetInst); + + var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst; + var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); + shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + if (skipOverBubbleShouldSetFrom) { + EventPropagators.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent); + } else { + EventPropagators.accumulateTwoPhaseDispatches(shouldSetEvent); + } + var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent); + if (!shouldSetEvent.isPersistent()) { + shouldSetEvent.constructor.release(shouldSetEvent); + } + + if (!wantsResponderInst || wantsResponderInst === responderInst) { + return null; + } + var extracted; + var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); + grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + + EventPropagators.accumulateDirectDispatches(grantEvent); + var blockHostResponder = executeDirectDispatch(grantEvent) === true; + if (responderInst) { + + var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + EventPropagators.accumulateDirectDispatches(terminationRequestEvent); + var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent); + if (!terminationRequestEvent.isPersistent()) { + terminationRequestEvent.constructor.release(terminationRequestEvent); + } + + if (shouldSwitch) { + var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + EventPropagators.accumulateDirectDispatches(terminateEvent); + extracted = accumulate(extracted, [grantEvent, terminateEvent]); + changeResponder(wantsResponderInst, blockHostResponder); + } else { + var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); + rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + EventPropagators.accumulateDirectDispatches(rejectEvent); + extracted = accumulate(extracted, rejectEvent); + } + } else { + extracted = accumulate(extracted, grantEvent); + changeResponder(wantsResponderInst, blockHostResponder); + } + return extracted; +} + +function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { + return topLevelInst && (topLevelType === 'topScroll' && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === 'topSelectionChange' || isStartish(topLevelType) || isMoveish(topLevelType)); +} + +function noResponderTouches(nativeEvent) { + var touches = nativeEvent.touches; + if (!touches || touches.length === 0) { + return true; + } + for (var i = 0; i < touches.length; i++) { + var activeTouch = touches[i]; + var target = activeTouch.target; + if (target !== null && target !== undefined && target !== 0) { + var targetInst = EventPluginUtils.getInstanceFromNode(target); + if (EventPluginUtils.isAncestor(responderInst, targetInst)) { + return false; + } + } + } + return true; +} + +var ResponderEventPlugin = { + _getResponderID: function _getResponderID() { + return responderInst ? responderInst._rootNodeID : null; + }, + + eventTypes: eventTypes, + + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (isStartish(topLevelType)) { + trackedTouchCount += 1; + } else if (isEndish(topLevelType)) { + if (trackedTouchCount >= 0) { + trackedTouchCount -= 1; + } else { + console.error('Ended a touch event which was not counted in `trackedTouchCount`.'); + return null; + } + } + + ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); + + var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null; + + var isResponderTouchStart = responderInst && isStartish(topLevelType); + var isResponderTouchMove = responderInst && isMoveish(topLevelType); + var isResponderTouchEnd = responderInst && isEndish(topLevelType); + var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; + + if (incrementalTouch) { + var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); + gesture.touchHistory = ResponderTouchHistoryStore.touchHistory; + EventPropagators.accumulateDirectDispatches(gesture); + extracted = accumulate(extracted, gesture); + } + + var isResponderTerminate = responderInst && topLevelType === 'topTouchCancel'; + var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent); + var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; + if (finalTouch) { + var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); + finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + EventPropagators.accumulateDirectDispatches(finalEvent); + extracted = accumulate(extracted, finalEvent); + changeResponder(null); + } + + var numberActiveTouches = ResponderTouchHistoryStore.touchHistory.numberActiveTouches; + if (ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches) { + ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches); + } + previousActiveTouches = numberActiveTouches; + + return extracted; + }, + + GlobalResponderHandler: null, + GlobalInteractionHandler: null, + + injection: { + injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + }, + + injectGlobalInteractionHandler: function injectGlobalInteractionHandler(GlobalInteractionHandler) { + ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; + } + } +}; + +module.exports = ResponderEventPlugin; +}, 287, null, "ResponderEventPlugin"); +__d(/* ResponderSyntheticEvent */function(global, require, module, exports) { + +'use strict'; + +var SyntheticEvent = require(278 ); // 278 = SyntheticEvent + +var ResponderEventInterface = { + touchHistory: function touchHistory(nativeEvent) { + return null; + } +}; + +function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); +} + +SyntheticEvent.augmentClass(ResponderSyntheticEvent, ResponderEventInterface); + +module.exports = ResponderSyntheticEvent; +}, 288, null, "ResponderSyntheticEvent"); +__d(/* ResponderTouchHistoryStore */function(global, require, module, exports) { + +'use strict'; + +var EventPluginUtils = require(163 ); // 163 = EventPluginUtils + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var isEndish = EventPluginUtils.isEndish, + isMoveish = EventPluginUtils.isMoveish, + isStartish = EventPluginUtils.isStartish; + + +var MAX_TOUCH_BANK = 20; +var touchBank = []; +var touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 +}; + +function timestampForTouch(touch) { + return touch.timeStamp || touch.timestamp; +} + +function createTouchRecord(touch) { + return { + touchActive: true, + startPageX: touch.pageX, + startPageY: touch.pageY, + startTimeStamp: timestampForTouch(touch), + currentPageX: touch.pageX, + currentPageY: touch.pageY, + currentTimeStamp: timestampForTouch(touch), + previousPageX: touch.pageX, + previousPageY: touch.pageY, + previousTimeStamp: timestampForTouch(touch) + }; +} + +function resetTouchRecord(touchRecord, touch) { + touchRecord.touchActive = true; + touchRecord.startPageX = touch.pageX; + touchRecord.startPageY = touch.pageY; + touchRecord.startTimeStamp = timestampForTouch(touch); + touchRecord.currentPageX = touch.pageX; + touchRecord.currentPageY = touch.pageY; + touchRecord.currentTimeStamp = timestampForTouch(touch); + touchRecord.previousPageX = touch.pageX; + touchRecord.previousPageY = touch.pageY; + touchRecord.previousTimeStamp = timestampForTouch(touch); +} + +function getTouchIdentifier(_ref) { + var identifier = _ref.identifier; + + invariant(identifier != null, 'Touch object is missing identifier.'); + warning(identifier <= MAX_TOUCH_BANK, 'Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK); + return identifier; +} + +function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch); + var touchRecord = touchBank[identifier]; + if (touchRecord) { + resetTouchRecord(touchRecord, touch); + } else { + touchBank[identifier] = createTouchRecord(touch); + } + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); +} + +function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = true; + touchRecord.previousPageX = touchRecord.currentPageX; + touchRecord.previousPageY = touchRecord.currentPageY; + touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; + touchRecord.currentPageX = touch.pageX; + touchRecord.currentPageY = touch.pageY; + touchRecord.currentTimeStamp = timestampForTouch(touch); + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } else { + console.error('Cannot record touch move without a touch start.\n' + 'Touch Move: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); + } +} + +function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = false; + touchRecord.previousPageX = touchRecord.currentPageX; + touchRecord.previousPageY = touchRecord.currentPageY; + touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; + touchRecord.currentPageX = touch.pageX; + touchRecord.currentPageY = touch.pageY; + touchRecord.currentTimeStamp = timestampForTouch(touch); + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } else { + console.error('Cannot record touch end without a touch start.\n' + 'Touch End: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); + } +} + +function printTouch(touch) { + return JSON.stringify({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY, + timestamp: timestampForTouch(touch) + }); +} + +function printTouchBank() { + var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); + if (touchBank.length > MAX_TOUCH_BANK) { + printed += ' (original size: ' + touchBank.length + ')'; + } + return printed; +} + +var ResponderTouchHistoryStore = { + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + if (isMoveish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchMove); + } else if (isStartish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchStart); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier; + } + } else if (isEndish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchEnd); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + for (var i = 0; i < touchBank.length; i++) { + var touchTrackToCheck = touchBank[i]; + if (touchTrackToCheck != null && touchTrackToCheck.touchActive) { + touchHistory.indexOfSingleActiveTouch = i; + break; + } + } + if (__DEV__) { + var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; + warning(activeRecord != null && activeRecord.touchActive, 'Cannot find single active touch.'); + } + } + } + }, + + + touchHistory: touchHistory +}; + +module.exports = ResponderTouchHistoryStore; +}, 289, null, "ResponderTouchHistoryStore"); +__d(/* accumulate */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +function accumulate(current, next) { + invariant(next != null, 'accumulate(...): Accumulated items must be not be null or undefined.'); + + if (current == null) { + return next; + } + + if (Array.isArray(current)) { + return current.concat(next); + } + + if (Array.isArray(next)) { + return [current].concat(next); + } + + return [current, next]; +} + +module.exports = accumulate; +}, 290, null, "accumulate"); +__d(/* ScrollResponder */function(global, require, module, exports) { +'use strict'; + +var Dimensions = require(129 ); // 129 = Dimensions +var Platform = require(79 ); // 79 = Platform +var Keyboard = require(109 ); // 109 = Keyboard +var ReactNative = require(241 ); // 241 = ReactNative +var Subscribable = require(292 ); // 292 = Subscribable +var TextInputState = require(78 ); // 78 = TextInputState +var UIManager = require(123 ); // 123 = UIManager +var warning = require(40 ); // 40 = fbjs/lib/warning + +var _require = require(159 ), // 159 = ReactNativeComponentTree + getInstanceFromNode = _require.getInstanceFromNode; + +var _require2 = require(80 ), // 80 = NativeModules + ScrollViewManager = _require2.ScrollViewManager; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16; + +function isTagInstanceOfTextInput(tag) { + var instance = getInstanceFromNode(tag); + return instance && instance.viewConfig && (instance.viewConfig.uiViewClassName === 'AndroidTextInput' || instance.viewConfig.uiViewClassName === 'RCTTextView' || instance.viewConfig.uiViewClassName === 'RCTTextField'); +} + +var ScrollResponderMixin = { + mixins: [Subscribable.Mixin], + scrollResponderMixinGetInitialState: function scrollResponderMixinGetInitialState() { + return { + isTouching: false, + lastMomentumScrollBeginTime: 0, + lastMomentumScrollEndTime: 0, + + observedScrollSinceBecomingResponder: false, + becameResponderWhileAnimating: false + }; + }, + + scrollResponderHandleScrollShouldSetResponder: function scrollResponderHandleScrollShouldSetResponder() { + return this.state.isTouching; + }, + + scrollResponderHandleStartShouldSetResponder: function scrollResponderHandleStartShouldSetResponder(e) { + var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); + + if (this.props.keyboardShouldPersistTaps === 'handled' && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput) { + return true; + } + return false; + }, + + scrollResponderHandleStartShouldSetResponderCapture: function scrollResponderHandleStartShouldSetResponderCapture(e) { + var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); + var keyboardShouldPersistTaps = this.props.keyboardShouldPersistTaps; + + var keyboardNeverPersistTaps = !keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never'; + if (keyboardNeverPersistTaps && currentlyFocusedTextInput != null && !isTagInstanceOfTextInput(e.target)) { + return true; + } + return this.scrollResponderIsAnimating(); + }, + + scrollResponderHandleResponderReject: function scrollResponderHandleResponderReject() {}, + + scrollResponderHandleTerminationRequest: function scrollResponderHandleTerminationRequest() { + return !this.state.observedScrollSinceBecomingResponder; + }, + + scrollResponderHandleTouchEnd: function scrollResponderHandleTouchEnd(e) { + var nativeEvent = e.nativeEvent; + this.state.isTouching = nativeEvent.touches.length !== 0; + this.props.onTouchEnd && this.props.onTouchEnd(e); + }, + + scrollResponderHandleResponderRelease: function scrollResponderHandleResponderRelease(e) { + this.props.onResponderRelease && this.props.onResponderRelease(e); + + var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); + if (this.props.keyboardShouldPersistTaps !== true && this.props.keyboardShouldPersistTaps !== 'always' && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && !this.state.observedScrollSinceBecomingResponder && !this.state.becameResponderWhileAnimating) { + this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed(e); + TextInputState.blurTextInput(currentlyFocusedTextInput); + } + }, + + scrollResponderHandleScroll: function scrollResponderHandleScroll(e) { + this.state.observedScrollSinceBecomingResponder = true; + this.props.onScroll && this.props.onScroll(e); + }, + + scrollResponderHandleResponderGrant: function scrollResponderHandleResponderGrant(e) { + this.state.observedScrollSinceBecomingResponder = false; + this.props.onResponderGrant && this.props.onResponderGrant(e); + this.state.becameResponderWhileAnimating = this.scrollResponderIsAnimating(); + }, + + scrollResponderHandleScrollBeginDrag: function scrollResponderHandleScrollBeginDrag(e) { + this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e); + }, + + scrollResponderHandleScrollEndDrag: function scrollResponderHandleScrollEndDrag(e) { + this.props.onScrollEndDrag && this.props.onScrollEndDrag(e); + }, + + scrollResponderHandleMomentumScrollBegin: function scrollResponderHandleMomentumScrollBegin(e) { + this.state.lastMomentumScrollBeginTime = Date.now(); + this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e); + }, + + scrollResponderHandleMomentumScrollEnd: function scrollResponderHandleMomentumScrollEnd(e) { + this.state.lastMomentumScrollEndTime = Date.now(); + this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e); + }, + + scrollResponderHandleTouchStart: function scrollResponderHandleTouchStart(e) { + this.state.isTouching = true; + this.props.onTouchStart && this.props.onTouchStart(e); + }, + + scrollResponderHandleTouchMove: function scrollResponderHandleTouchMove(e) { + this.props.onTouchMove && this.props.onTouchMove(e); + }, + + scrollResponderIsAnimating: function scrollResponderIsAnimating() { + var now = Date.now(); + var timeSinceLastMomentumScrollEnd = now - this.state.lastMomentumScrollEndTime; + var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || this.state.lastMomentumScrollEndTime < this.state.lastMomentumScrollBeginTime; + return isAnimating; + }, + + scrollResponderGetScrollableNode: function scrollResponderGetScrollableNode() { + return this.getScrollableNode ? this.getScrollableNode() : ReactNative.findNodeHandle(this); + }, + + scrollResponderScrollTo: function scrollResponderScrollTo(x, y, animated) { + if (typeof x === 'number') { + console.warn('`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.'); + } else { + var _ref = x || {}; + + x = _ref.x; + y = _ref.y; + animated = _ref.animated; + } + UIManager.dispatchViewManagerCommand(this.scrollResponderGetScrollableNode(), UIManager.RCTScrollView.Commands.scrollTo, [x || 0, y || 0, animated !== false]); + }, + + scrollResponderScrollToEnd: function scrollResponderScrollToEnd(options) { + var animated = (options && options.animated) !== false; + UIManager.dispatchViewManagerCommand(this.scrollResponderGetScrollableNode(), UIManager.RCTScrollView.Commands.scrollToEnd, [animated]); + }, + + scrollResponderScrollWithoutAnimationTo: function scrollResponderScrollWithoutAnimationTo(offsetX, offsetY) { + console.warn('`scrollResponderScrollWithoutAnimationTo` is deprecated. Use `scrollResponderScrollTo` instead'); + this.scrollResponderScrollTo({ x: offsetX, y: offsetY, animated: false }); + }, + + scrollResponderZoomTo: function scrollResponderZoomTo(rect, animated) { + invariant(ScrollViewManager && ScrollViewManager.zoomToRect, 'zoomToRect is not implemented'); + if ('animated' in rect) { + var animated = rect.animated, + rect = babelHelpers.objectWithoutProperties(rect, ['animated']); + } else if (typeof animated !== 'undefined') { + console.warn('`scrollResponderZoomTo` `animated` argument is deprecated. Use `options.animated` instead'); + } + ScrollViewManager.zoomToRect(this.scrollResponderGetScrollableNode(), rect, animated !== false); + }, + + scrollResponderScrollNativeHandleToKeyboard: function scrollResponderScrollNativeHandleToKeyboard(nodeHandle, additionalOffset, preventNegativeScrollOffset) { + this.additionalScrollOffset = additionalOffset || 0; + this.preventNegativeScrollOffset = !!preventNegativeScrollOffset; + UIManager.measureLayout(nodeHandle, ReactNative.findNodeHandle(this.getInnerViewNode()), this.scrollResponderTextInputFocusError, this.scrollResponderInputMeasureAndScrollToKeyboard); + }, + + scrollResponderInputMeasureAndScrollToKeyboard: function scrollResponderInputMeasureAndScrollToKeyboard(left, top, width, height) { + var keyboardScreenY = Dimensions.get('window').height; + if (this.keyboardWillOpenTo) { + keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY; + } + var scrollOffsetY = top - keyboardScreenY + height + this.additionalScrollOffset; + + if (this.preventNegativeScrollOffset) { + scrollOffsetY = Math.max(0, scrollOffsetY); + } + this.scrollResponderScrollTo({ x: 0, y: scrollOffsetY, animated: true }); + + this.additionalOffset = 0; + this.preventNegativeScrollOffset = false; + }, + + scrollResponderTextInputFocusError: function scrollResponderTextInputFocusError(e) { + console.error('Error measuring text field: ', e); + }, + + componentWillMount: function componentWillMount() { + var keyboardShouldPersistTaps = this.props.keyboardShouldPersistTaps; + + warning(typeof keyboardShouldPersistTaps !== 'boolean', '\'keyboardShouldPersistTaps={' + keyboardShouldPersistTaps + '}\' is deprecated. ' + ('Use \'keyboardShouldPersistTaps="' + (keyboardShouldPersistTaps ? "always" : "never") + '"\' instead')); + + this.keyboardWillOpenTo = null; + this.additionalScrollOffset = 0; + this.addListenerOn(Keyboard, 'keyboardWillShow', this.scrollResponderKeyboardWillShow); + this.addListenerOn(Keyboard, 'keyboardWillHide', this.scrollResponderKeyboardWillHide); + this.addListenerOn(Keyboard, 'keyboardDidShow', this.scrollResponderKeyboardDidShow); + this.addListenerOn(Keyboard, 'keyboardDidHide', this.scrollResponderKeyboardDidHide); + }, + + scrollResponderKeyboardWillShow: function scrollResponderKeyboardWillShow(e) { + this.keyboardWillOpenTo = e; + this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e); + }, + + scrollResponderKeyboardWillHide: function scrollResponderKeyboardWillHide(e) { + this.keyboardWillOpenTo = null; + this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e); + }, + + scrollResponderKeyboardDidShow: function scrollResponderKeyboardDidShow(e) { + if (e) { + this.keyboardWillOpenTo = e; + } + this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e); + }, + + scrollResponderKeyboardDidHide: function scrollResponderKeyboardDidHide(e) { + this.keyboardWillOpenTo = null; + this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e); + } + +}; + +var ScrollResponder = { + Mixin: ScrollResponderMixin +}; + +module.exports = ScrollResponder; +}, 291, null, "ScrollResponder"); +__d(/* Subscribable */function(global, require, module, exports) { +'use strict'; + +var Subscribable = {}; + +Subscribable.Mixin = { + + componentWillMount: function componentWillMount() { + this._subscribableSubscriptions = []; + }, + + componentWillUnmount: function componentWillUnmount() { + this._subscribableSubscriptions.forEach(function (subscription) { + return subscription.remove(); + }); + this._subscribableSubscriptions = null; + }, + + addListenerOn: function addListenerOn(eventEmitter, eventType, listener, context) { + this._subscribableSubscriptions.push(eventEmitter.addListener(eventType, listener, context)); + } +}; + +module.exports = Subscribable; +}, 292, null, "Subscribable"); +__d(/* processDecelerationRate */function(global, require, module, exports) { +'use strict'; + +function processDecelerationRate(decelerationRate) { + if (decelerationRate === 'normal') { + decelerationRate = 0.998; + } else if (decelerationRate === 'fast') { + decelerationRate = 0.99; + } + return decelerationRate; +} + +module.exports = processDecelerationRate; +}, 293, null, "processDecelerationRate"); +__d(/* react-timer-mixin/TimerMixin.js */function(global, require, module, exports) { +'use strict'; + +var GLOBAL = typeof window === 'undefined' ? global : window; + +var setter = function setter(_setter, _clearer, array) { + return function (callback, delta) { + var id = _setter(function () { + _clearer.call(this, id); + callback.apply(this, arguments); + }.bind(this), delta); + + if (!this[array]) { + this[array] = [id]; + } else { + this[array].push(id); + } + return id; + }; +}; + +var clearer = function clearer(_clearer, array) { + return function (id) { + if (this[array]) { + var index = this[array].indexOf(id); + if (index !== -1) { + this[array].splice(index, 1); + } + } + _clearer(id); + }; +}; + +var _timeouts = 'TimerMixin_timeouts'; +var _clearTimeout = clearer(GLOBAL.clearTimeout, _timeouts); +var _setTimeout = setter(GLOBAL.setTimeout, _clearTimeout, _timeouts); + +var _intervals = 'TimerMixin_intervals'; +var _clearInterval = clearer(GLOBAL.clearInterval, _intervals); +var _setInterval = setter(GLOBAL.setInterval, function () {}, _intervals); + +var _immediates = 'TimerMixin_immediates'; +var _clearImmediate = clearer(GLOBAL.clearImmediate, _immediates); +var _setImmediate = setter(GLOBAL.setImmediate, _clearImmediate, _immediates); + +var _rafs = 'TimerMixin_rafs'; +var _cancelAnimationFrame = clearer(GLOBAL.cancelAnimationFrame, _rafs); +var _requestAnimationFrame = setter(GLOBAL.requestAnimationFrame, _cancelAnimationFrame, _rafs); + +var TimerMixin = { + componentWillUnmount: function componentWillUnmount() { + this[_timeouts] && this[_timeouts].forEach(function (id) { + GLOBAL.clearTimeout(id); + }); + this[_timeouts] = null; + this[_intervals] && this[_intervals].forEach(function (id) { + GLOBAL.clearInterval(id); + }); + this[_intervals] = null; + this[_immediates] && this[_immediates].forEach(function (id) { + GLOBAL.clearImmediate(id); + }); + this[_immediates] = null; + this[_rafs] && this[_rafs].forEach(function (id) { + GLOBAL.cancelAnimationFrame(id); + }); + this[_rafs] = null; + }, + + setTimeout: _setTimeout, + clearTimeout: _clearTimeout, + + setInterval: _setInterval, + clearInterval: _clearInterval, + + setImmediate: _setImmediate, + clearImmediate: _clearImmediate, + + requestAnimationFrame: _requestAnimationFrame, + cancelAnimationFrame: _cancelAnimationFrame +}; + +module.exports = TimerMixin; +}, 294, null, "react-timer-mixin/TimerMixin.js"); +__d(/* TouchableWithoutFeedback */function(global, require, module, exports) { +'use strict'; + +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var React = require(126 ); // 126 = React +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var Touchable = require(211 ); // 211 = Touchable +var View = require(146 ); // 146 = View + +var ensurePositiveDelayProps = require(296 ); // 296 = ensurePositiveDelayProps +var warning = require(40 ); // 40 = fbjs/lib/warning + +var PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 }; + +var TouchableWithoutFeedback = React.createClass({ + displayName: 'TouchableWithoutFeedback', + + mixins: [TimerMixin, Touchable.Mixin], + + propTypes: { + accessible: React.PropTypes.bool, + accessibilityComponentType: React.PropTypes.oneOf(View.AccessibilityComponentType), + accessibilityTraits: React.PropTypes.oneOfType([React.PropTypes.oneOf(View.AccessibilityTraits), React.PropTypes.arrayOf(React.PropTypes.oneOf(View.AccessibilityTraits))]), + + disabled: React.PropTypes.bool, + + onPress: React.PropTypes.func, + onPressIn: React.PropTypes.func, + onPressOut: React.PropTypes.func, + + onLayout: React.PropTypes.func, + + onLongPress: React.PropTypes.func, + + delayPressIn: React.PropTypes.number, + + delayPressOut: React.PropTypes.number, + + delayLongPress: React.PropTypes.number, + + pressRetentionOffset: EdgeInsetsPropType, + + hitSlop: EdgeInsetsPropType + }, + + getInitialState: function getInitialState() { + return this.touchableGetInitialState(); + }, + + componentDidMount: function componentDidMount() { + ensurePositiveDelayProps(this.props); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + ensurePositiveDelayProps(nextProps); + }, + + touchableHandlePress: function touchableHandlePress(e) { + this.props.onPress && this.props.onPress(e); + }, + + touchableHandleActivePressIn: function touchableHandleActivePressIn(e) { + this.props.onPressIn && this.props.onPressIn(e); + }, + + touchableHandleActivePressOut: function touchableHandleActivePressOut(e) { + this.props.onPressOut && this.props.onPressOut(e); + }, + + touchableHandleLongPress: function touchableHandleLongPress(e) { + this.props.onLongPress && this.props.onLongPress(e); + }, + + touchableGetPressRectOffset: function touchableGetPressRectOffset() { + return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET; + }, + + touchableGetHitSlop: function touchableGetHitSlop() { + return this.props.hitSlop; + }, + + touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() { + return this.props.delayPressIn || 0; + }, + + touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() { + return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500; + }, + + touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() { + return this.props.delayPressOut || 0; + }, + + render: function render() { + var child = React.Children.only(this.props.children); + var children = child.props.children; + warning(!child.type || child.type.displayName !== 'Text', 'TouchableWithoutFeedback does not work well with Text children. Wrap children in a View instead. See ' + (child._owner && child._owner.getName && child._owner.getName() || '')); + if (Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'View') { + children = React.Children.toArray(children); + children.push(Touchable.renderDebugView({ color: 'red', hitSlop: this.props.hitSlop })); + } + var style = Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text' ? [child.props.style, { color: 'red' }] : child.props.style; + return React.cloneElement(child, { + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityComponentType: this.props.accessibilityComponentType, + accessibilityTraits: this.props.accessibilityTraits, + testID: this.props.testID, + onLayout: this.props.onLayout, + hitSlop: this.props.hitSlop, + onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, + onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest, + onResponderGrant: this.touchableHandleResponderGrant, + onResponderMove: this.touchableHandleResponderMove, + onResponderRelease: this.touchableHandleResponderRelease, + onResponderTerminate: this.touchableHandleResponderTerminate, + style: style, + children: children + }); + } +}); + +module.exports = TouchableWithoutFeedback; +}, 295, null, "TouchableWithoutFeedback"); +__d(/* ensurePositiveDelayProps */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var ensurePositiveDelayProps = function ensurePositiveDelayProps(props) { + invariant(!(props.delayPressIn < 0 || props.delayPressOut < 0 || props.delayLongPress < 0), 'Touchable components cannot have negative delay properties'); +}; + +module.exports = ensurePositiveDelayProps; +}, 296, null, "ensurePositiveDelayProps"); +__d(/* DatePickerIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js'; +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var DatePickerIOS = React.createClass({ + displayName: 'DatePickerIOS', + + _picker: undefined, + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + date: PropTypes.instanceOf(Date).isRequired, + + onDateChange: PropTypes.func.isRequired, + + maximumDate: PropTypes.instanceOf(Date), + + minimumDate: PropTypes.instanceOf(Date), + + mode: PropTypes.oneOf(['date', 'time', 'datetime']), + + minuteInterval: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30]), + + timeZoneOffsetInMinutes: PropTypes.number + }), + + getDefaultProps: function getDefaultProps() { + return { + mode: 'datetime' + }; + }, + + _onChange: function _onChange(event) { + var nativeTimeStamp = event.nativeEvent.timestamp; + this.props.onDateChange && this.props.onDateChange(new Date(nativeTimeStamp)); + this.props.onChange && this.props.onChange(event); + + var propsTimeStamp = this.props.date.getTime(); + if (this._picker && nativeTimeStamp !== propsTimeStamp) { + this._picker.setNativeProps({ + date: propsTimeStamp + }); + } + }, + + render: function render() { + var _this = this; + + var props = this.props; + return React.createElement( + View, + { style: props.style, __source: { + fileName: _jsxFileName, + lineNumber: 122 + } + }, + React.createElement(RCTDatePickerIOS, { + ref: function ref(picker) { + _this._picker = picker; + }, + style: styles.datePickerIOS, + date: props.date.getTime(), + maximumDate: props.maximumDate ? props.maximumDate.getTime() : undefined, + minimumDate: props.minimumDate ? props.minimumDate.getTime() : undefined, + mode: props.mode, + minuteInterval: props.minuteInterval, + timeZoneOffsetInMinutes: props.timeZoneOffsetInMinutes, + onChange: this._onChange, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + __source: { + fileName: _jsxFileName, + lineNumber: 123 + } + }) + ); + } +}); + +var styles = StyleSheet.create({ + datePickerIOS: { + height: 216 + } +}); + +var RCTDatePickerIOS = requireNativeComponent('RCTDatePicker', { + propTypes: babelHelpers.extends({}, DatePickerIOS.propTypes, { + date: PropTypes.number, + minimumDate: PropTypes.number, + maximumDate: PropTypes.number, + onDateChange: function onDateChange() { + return null; + }, + onChange: PropTypes.func + }) +}); + +module.exports = DatePickerIOS; +}, 297, null, "DatePickerIOS"); +__d(/* DrawerLayoutAndroid */function(global, require, module, exports) { +'use strict'; + +module.exports = require(156 ); // 156 = UnimplementedView +}, 298, null, "DrawerLayoutAndroid"); +__d(/* ImageEditor */function(global, require, module, exports) { +'use strict'; + +var RCTImageEditingManager = require(80 ).ImageEditingManager; // 80 = NativeModules + +var ImageEditor = function () { + function ImageEditor() { + babelHelpers.classCallCheck(this, ImageEditor); + } + + babelHelpers.createClass(ImageEditor, null, [{ + key: 'cropImage', + value: function cropImage(uri, cropData, success, failure) { + RCTImageEditingManager.cropImage(uri, cropData, success, failure); + } + }]); + return ImageEditor; +}(); + +module.exports = ImageEditor; +}, 299, null, "ImageEditor"); +__d(/* ImageStore */function(global, require, module, exports) { +'use strict'; + +var RCTImageStoreManager = require(80 ).ImageStoreManager; // 80 = NativeModules + +var ImageStore = function () { + function ImageStore() { + babelHelpers.classCallCheck(this, ImageStore); + } + + babelHelpers.createClass(ImageStore, null, [{ + key: 'hasImageForTag', + value: function hasImageForTag(uri, callback) { + if (RCTImageStoreManager.hasImageForTag) { + RCTImageStoreManager.hasImageForTag(uri, callback); + } else { + console.warn('hasImageForTag() not implemented'); + } + } + }, { + key: 'removeImageForTag', + value: function removeImageForTag(uri) { + if (RCTImageStoreManager.removeImageForTag) { + RCTImageStoreManager.removeImageForTag(uri); + } else { + console.warn('removeImageForTag() not implemented'); + } + } + }, { + key: 'addImageFromBase64', + value: function addImageFromBase64(base64ImageData, success, failure) { + RCTImageStoreManager.addImageFromBase64(base64ImageData, success, failure); + } + }, { + key: 'getBase64ForTag', + value: function getBase64ForTag(uri, success, failure) { + RCTImageStoreManager.getBase64ForTag(uri, success, failure); + } + }]); + return ImageStore; +}(); + +module.exports = ImageStore; +}, 300, null, "ImageStore"); +__d(/* KeyboardAvoidingView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js'; +var Keyboard = require(109 ); // 109 = Keyboard +var LayoutAnimation = require(302 ); // 302 = LayoutAnimation +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var View = require(146 ); // 146 = View + +var PropTypes = React.PropTypes; + +var viewRef = 'VIEW'; + +var KeyboardAvoidingView = React.createClass({ + displayName: 'KeyboardAvoidingView', + + mixins: [TimerMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + behavior: PropTypes.oneOf(['height', 'position', 'padding']), + + contentContainerStyle: View.propTypes.style, + + keyboardVerticalOffset: PropTypes.number.isRequired + }), + + getDefaultProps: function getDefaultProps() { + return { + keyboardVerticalOffset: 0 + }; + }, + getInitialState: function getInitialState() { + return { + bottom: 0 + }; + }, + + + subscriptions: [], + frame: null, + + relativeKeyboardHeight: function relativeKeyboardHeight(keyboardFrame) { + var frame = this.frame; + if (!frame || !keyboardFrame) { + return 0; + } + + var y1 = Math.max(frame.y, keyboardFrame.screenY - this.props.keyboardVerticalOffset); + var y2 = Math.min(frame.y + frame.height, keyboardFrame.screenY + keyboardFrame.height - this.props.keyboardVerticalOffset); + if (frame.y > keyboardFrame.screenY) { + return frame.y + frame.height - keyboardFrame.screenY - this.props.keyboardVerticalOffset; + } + return Math.max(y2 - y1, 0); + }, + onKeyboardChange: function onKeyboardChange(event) { + if (!event) { + this.setState({ bottom: 0 }); + return; + } + + var duration = event.duration, + easing = event.easing, + endCoordinates = event.endCoordinates; + + var height = this.relativeKeyboardHeight(endCoordinates); + + if (duration && easing) { + LayoutAnimation.configureNext({ + duration: duration, + update: { + duration: duration, + type: LayoutAnimation.Types[easing] || 'keyboard' + } + }); + } + this.setState({ bottom: height }); + }, + onLayout: function onLayout(event) { + this.frame = event.nativeEvent.layout; + }, + componentWillUpdate: function componentWillUpdate(nextProps, nextState, nextContext) { + if (nextState.bottom === this.state.bottom && this.props.behavior === 'height' && nextProps.behavior === 'height') { + nextState.bottom = 0; + } + }, + componentWillMount: function componentWillMount() { + if (Platform.OS === 'ios') { + this.subscriptions = [Keyboard.addListener('keyboardWillChangeFrame', this.onKeyboardChange)]; + } else { + this.subscriptions = [Keyboard.addListener('keyboardDidHide', this.onKeyboardChange), Keyboard.addListener('keyboardDidShow', this.onKeyboardChange)]; + } + }, + componentWillUnmount: function componentWillUnmount() { + this.subscriptions.forEach(function (sub) { + return sub.remove(); + }); + }, + render: function render() { + var _props = this.props, + behavior = _props.behavior, + children = _props.children, + style = _props.style, + props = babelHelpers.objectWithoutProperties(_props, ['behavior', 'children', 'style']); + + + switch (behavior) { + case 'height': + var heightStyle = void 0; + if (this.frame) { + heightStyle = { height: this.frame.height - this.state.bottom, flex: 0 }; + } + return React.createElement( + View, + babelHelpers.extends({ ref: viewRef, style: [style, heightStyle], onLayout: this.onLayout }, props, { + __source: { + fileName: _jsxFileName, + lineNumber: 169 + } + }), + children + ); + + case 'position': + var positionStyle = { bottom: this.state.bottom }; + var contentContainerStyle = this.props.contentContainerStyle; + + + return React.createElement( + View, + babelHelpers.extends({ ref: viewRef, style: style, onLayout: this.onLayout }, props, { + __source: { + fileName: _jsxFileName, + lineNumber: 179 + } + }), + React.createElement( + View, + { style: [contentContainerStyle, positionStyle], __source: { + fileName: _jsxFileName, + lineNumber: 180 + } + }, + children + ) + ); + + case 'padding': + var paddingStyle = { paddingBottom: this.state.bottom }; + return React.createElement( + View, + babelHelpers.extends({ ref: viewRef, style: [style, paddingStyle], onLayout: this.onLayout }, props, { + __source: { + fileName: _jsxFileName, + lineNumber: 189 + } + }), + children + ); + + default: + return React.createElement( + View, + babelHelpers.extends({ ref: viewRef, onLayout: this.onLayout, style: style }, props, { + __source: { + fileName: _jsxFileName, + lineNumber: 196 + } + }), + children + ); + } + } +}); + +module.exports = KeyboardAvoidingView; +}, 301, null, "KeyboardAvoidingView"); +__d(/* LayoutAnimation */function(global, require, module, exports) { +'use strict'; + +var _require = require(126 ), // 126 = React + PropTypes = _require.PropTypes; + +var UIManager = require(123 ); // 123 = UIManager + +var createStrictShapeTypeChecker = require(148 ); // 148 = createStrictShapeTypeChecker +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror + +var TypesEnum = { + spring: true, + linear: true, + easeInEaseOut: true, + easeIn: true, + easeOut: true, + keyboard: true +}; +var Types = keyMirror(TypesEnum); + +var PropertiesEnum = { + opacity: true, + scaleXY: true +}; +var Properties = keyMirror(PropertiesEnum); + +var animChecker = createStrictShapeTypeChecker({ + duration: PropTypes.number, + delay: PropTypes.number, + springDamping: PropTypes.number, + initialVelocity: PropTypes.number, + type: PropTypes.oneOf(Object.keys(Types)).isRequired, + property: PropTypes.oneOf(Object.keys(Properties)) +}); + +var configChecker = createStrictShapeTypeChecker({ + duration: PropTypes.number.isRequired, + create: animChecker, + update: animChecker, + delete: animChecker +}); + +function configureNext(config, onAnimationDidEnd) { + configChecker({ config: config }, 'config', 'LayoutAnimation.configureNext'); + UIManager.configureNextLayoutAnimation(config, onAnimationDidEnd || function () {}, function () {}); +} + +function create(duration, type, creationProp) { + return { + duration: duration, + create: { + type: type, + property: creationProp + }, + update: { + type: type + }, + delete: { + type: type, + property: creationProp + } + }; +} + +var Presets = { + easeInEaseOut: create(300, Types.easeInEaseOut, Properties.opacity), + linear: create(500, Types.linear, Properties.opacity), + spring: { + duration: 700, + create: { + type: Types.linear, + property: Properties.opacity + }, + update: { + type: Types.spring, + springDamping: 0.4 + }, + delete: { + type: Types.linear, + property: Properties.opacity + } + } +}; + +var LayoutAnimation = { + configureNext: configureNext, + + create: create, + Types: Types, + Properties: Properties, + configChecker: configChecker, + Presets: Presets, + easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut), + linear: configureNext.bind(null, Presets.linear), + spring: configureNext.bind(null, Presets.spring) +}; + +module.exports = LayoutAnimation; +}, 302, null, "LayoutAnimation"); +__d(/* ListView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/ListView/ListView.js'; +var ListViewDataSource = require(304 ); // 304 = ListViewDataSource +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var RCTScrollViewManager = require(80 ).ScrollViewManager; // 80 = NativeModules +var ScrollView = require(239 ); // 239 = ScrollView +var ScrollResponder = require(291 ); // 291 = ScrollResponder +var StaticRenderer = require(306 ); // 306 = StaticRenderer +var TimerMixin = require(294 ); // 294 = react-timer-mixin + +var cloneReferencedElement = require(307 ); // 307 = react-clone-referenced-element +var isEmpty = require(305 ); // 305 = isEmpty +var merge = require(149 ); // 149 = merge + +var PropTypes = React.PropTypes; + +var DEFAULT_PAGE_SIZE = 1; +var DEFAULT_INITIAL_ROWS = 10; +var DEFAULT_SCROLL_RENDER_AHEAD = 1000; +var DEFAULT_END_REACHED_THRESHOLD = 1000; +var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50; + +var ListView = React.createClass({ + displayName: 'ListView', + + _childFrames: [], + _sentEndForContentLength: null, + _scrollComponent: null, + _prevRenderedRowsCount: 0, + _visibleRows: {}, + scrollProperties: {}, + + mixins: [ScrollResponder.Mixin, TimerMixin], + + statics: { + DataSource: ListViewDataSource + }, + + propTypes: babelHelpers.extends({}, ScrollView.propTypes, { + dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired, + + renderSeparator: PropTypes.func, + + renderRow: PropTypes.func.isRequired, + + initialListSize: PropTypes.number.isRequired, + + onEndReached: PropTypes.func, + + onEndReachedThreshold: PropTypes.number.isRequired, + + pageSize: PropTypes.number.isRequired, + + renderFooter: PropTypes.func, + renderHeader: PropTypes.func, + + renderSectionHeader: PropTypes.func, + + renderScrollComponent: React.PropTypes.func.isRequired, + + scrollRenderAheadDistance: React.PropTypes.number.isRequired, + + onChangeVisibleRows: React.PropTypes.func, + + removeClippedSubviews: React.PropTypes.bool, + + stickySectionHeadersEnabled: React.PropTypes.bool, + + stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number).isRequired, + + enableEmptySections: PropTypes.bool + }), + + getMetrics: function getMetrics() { + return { + contentLength: this.scrollProperties.contentLength, + totalRows: this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount(), + renderedRows: this.state.curRenderedRowsCount, + visibleRows: Object.keys(this._visibleRows).length + }; + }, + + getScrollResponder: function getScrollResponder() { + if (this._scrollComponent && this._scrollComponent.getScrollResponder) { + return this._scrollComponent.getScrollResponder(); + } + }, + + getScrollableNode: function getScrollableNode() { + if (this._scrollComponent && this._scrollComponent.getScrollableNode) { + return this._scrollComponent.getScrollableNode(); + } else { + return ReactNative.findNodeHandle(this._scrollComponent); + } + }, + + scrollTo: function scrollTo() { + if (this._scrollComponent && this._scrollComponent.scrollTo) { + var _scrollComponent; + + (_scrollComponent = this._scrollComponent).scrollTo.apply(_scrollComponent, arguments); + } + }, + + scrollToEnd: function scrollToEnd(options) { + if (this._scrollComponent) { + if (this._scrollComponent.scrollToEnd) { + this._scrollComponent.scrollToEnd(options); + } else { + console.warn('The scroll component used by the ListView does not support ' + 'scrollToEnd. Check the renderScrollComponent prop of your ListView.'); + } + } + }, + + setNativeProps: function setNativeProps(props) { + if (this._scrollComponent) { + this._scrollComponent.setNativeProps(props); + } + }, + + getDefaultProps: function getDefaultProps() { + return { + initialListSize: DEFAULT_INITIAL_ROWS, + pageSize: DEFAULT_PAGE_SIZE, + renderScrollComponent: function renderScrollComponent(props) { + return React.createElement(ScrollView, babelHelpers.extends({}, props, { + __source: { + fileName: _jsxFileName, + lineNumber: 329 + } + })); + }, + scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD, + onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD, + stickySectionHeadersEnabled: true, + stickyHeaderIndices: [] + }; + }, + + getInitialState: function getInitialState() { + return { + curRenderedRowsCount: this.props.initialListSize, + highlightedRow: {} + }; + }, + + getInnerViewNode: function getInnerViewNode() { + return this._scrollComponent.getInnerViewNode(); + }, + + componentWillMount: function componentWillMount() { + this.scrollProperties = { + visibleLength: null, + contentLength: null, + offset: 0 + }; + this._childFrames = []; + this._visibleRows = {}; + this._prevRenderedRowsCount = 0; + this._sentEndForContentLength = null; + }, + + componentDidMount: function componentDidMount() { + var _this = this; + + this.requestAnimationFrame(function () { + _this._measureAndUpdateScrollProps(); + }); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + var _this2 = this; + + if (this.props.dataSource !== nextProps.dataSource || this.props.initialListSize !== nextProps.initialListSize) { + this.setState(function (state, props) { + _this2._prevRenderedRowsCount = 0; + return { + curRenderedRowsCount: Math.min(Math.max(state.curRenderedRowsCount, props.initialListSize), props.enableEmptySections ? props.dataSource.getRowAndSectionCount() : props.dataSource.getRowCount()) + }; + }, function () { + return _this2._renderMoreRowsIfNeeded(); + }); + } + }, + + componentDidUpdate: function componentDidUpdate() { + var _this3 = this; + + this.requestAnimationFrame(function () { + _this3._measureAndUpdateScrollProps(); + }); + }, + + _onRowHighlighted: function _onRowHighlighted(sectionID, rowID) { + this.setState({ highlightedRow: { sectionID: sectionID, rowID: rowID } }); + }, + + render: function render() { + var bodyComponents = []; + + var dataSource = this.props.dataSource; + var allRowIDs = dataSource.rowIdentities; + var rowCount = 0; + var stickySectionHeaderIndices = []; + + var header = this.props.renderHeader && this.props.renderHeader(); + var footer = this.props.renderFooter && this.props.renderFooter(); + var totalIndex = header ? 1 : 0; + + for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) { + var sectionID = dataSource.sectionIdentities[sectionIdx]; + var rowIDs = allRowIDs[sectionIdx]; + if (rowIDs.length === 0) { + if (this.props.enableEmptySections === undefined) { + var warning = require(40 ); // 40 = fbjs/lib/warning + warning(false, 'In next release empty section headers will be rendered.' + ' In this release you can use \'enableEmptySections\' flag to render empty section headers.'); + continue; + } else { + var invariant = require(44 ); // 44 = fbjs/lib/invariant + invariant(this.props.enableEmptySections, 'In next release \'enableEmptySections\' flag will be deprecated, empty section headers will always be rendered.' + ' If empty section headers are not desirable their indices should be excluded from sectionIDs object.' + ' In this release \'enableEmptySections\' may only have value \'true\' to allow empty section headers rendering.'); + } + } + + if (this.props.renderSectionHeader) { + var shouldUpdateHeader = rowCount >= this._prevRenderedRowsCount && dataSource.sectionHeaderShouldUpdate(sectionIdx); + bodyComponents.push(React.createElement(StaticRenderer, { + key: 's_' + sectionID, + shouldUpdate: !!shouldUpdateHeader, + render: this.props.renderSectionHeader.bind(null, dataSource.getSectionHeaderData(sectionIdx), sectionID), + __source: { + fileName: _jsxFileName, + lineNumber: 432 + } + })); + if (this.props.stickySectionHeadersEnabled) { + stickySectionHeaderIndices.push(totalIndex++); + } + } + + for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) { + var rowID = rowIDs[rowIdx]; + var comboID = sectionID + '_' + rowID; + var shouldUpdateRow = rowCount >= this._prevRenderedRowsCount && dataSource.rowShouldUpdate(sectionIdx, rowIdx); + var row = React.createElement(StaticRenderer, { + key: 'r_' + comboID, + shouldUpdate: !!shouldUpdateRow, + render: this.props.renderRow.bind(null, dataSource.getRowData(sectionIdx, rowIdx), sectionID, rowID, this._onRowHighlighted), + __source: { + fileName: _jsxFileName, + lineNumber: 453 + } + }); + bodyComponents.push(row); + totalIndex++; + + if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) { + var adjacentRowHighlighted = this.state.highlightedRow.sectionID === sectionID && (this.state.highlightedRow.rowID === rowID || this.state.highlightedRow.rowID === rowIDs[rowIdx + 1]); + var separator = this.props.renderSeparator(sectionID, rowID, adjacentRowHighlighted); + if (separator) { + bodyComponents.push(separator); + totalIndex++; + } + } + if (++rowCount === this.state.curRenderedRowsCount) { + break; + } + } + if (rowCount >= this.state.curRenderedRowsCount) { + break; + } + } + + var _props = this.props, + renderScrollComponent = _props.renderScrollComponent, + props = babelHelpers.objectWithoutProperties(_props, ['renderScrollComponent']); + + if (!props.scrollEventThrottle) { + props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE; + } + if (props.removeClippedSubviews === undefined) { + props.removeClippedSubviews = true; + } + babelHelpers.extends(props, { + onScroll: this._onScroll, + stickyHeaderIndices: this.props.stickyHeaderIndices.concat(stickySectionHeaderIndices), + + onKeyboardWillShow: undefined, + onKeyboardWillHide: undefined, + onKeyboardDidShow: undefined, + onKeyboardDidHide: undefined + }); + + return cloneReferencedElement(renderScrollComponent(props), { + ref: this._setScrollComponentRef, + onContentSizeChange: this._onContentSizeChange, + onLayout: this._onLayout + }, header, bodyComponents, footer); + }, + + _measureAndUpdateScrollProps: function _measureAndUpdateScrollProps() { + var scrollComponent = this.getScrollResponder(); + if (!scrollComponent || !scrollComponent.getInnerViewNode) { + return; + } + + RCTScrollViewManager && RCTScrollViewManager.calculateChildFrames && RCTScrollViewManager.calculateChildFrames(ReactNative.findNodeHandle(scrollComponent), this._updateVisibleRows); + }, + + _setScrollComponentRef: function _setScrollComponentRef(scrollComponent) { + this._scrollComponent = scrollComponent; + }, + + _onContentSizeChange: function _onContentSizeChange(width, height) { + var contentLength = !this.props.horizontal ? height : width; + if (contentLength !== this.scrollProperties.contentLength) { + this.scrollProperties.contentLength = contentLength; + this._updateVisibleRows(); + this._renderMoreRowsIfNeeded(); + } + this.props.onContentSizeChange && this.props.onContentSizeChange(width, height); + }, + + _onLayout: function _onLayout(event) { + var _event$nativeEvent$la = event.nativeEvent.layout, + width = _event$nativeEvent$la.width, + height = _event$nativeEvent$la.height; + + var visibleLength = !this.props.horizontal ? height : width; + if (visibleLength !== this.scrollProperties.visibleLength) { + this.scrollProperties.visibleLength = visibleLength; + this._updateVisibleRows(); + this._renderMoreRowsIfNeeded(); + } + this.props.onLayout && this.props.onLayout(event); + }, + + _maybeCallOnEndReached: function _maybeCallOnEndReached(event) { + if (this.props.onEndReached && this.scrollProperties.contentLength !== this._sentEndForContentLength && this._getDistanceFromEnd(this.scrollProperties) < this.props.onEndReachedThreshold && this.state.curRenderedRowsCount === (this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount())) { + this._sentEndForContentLength = this.scrollProperties.contentLength; + this.props.onEndReached(event); + return true; + } + return false; + }, + + _renderMoreRowsIfNeeded: function _renderMoreRowsIfNeeded() { + if (this.scrollProperties.contentLength === null || this.scrollProperties.visibleLength === null || this.state.curRenderedRowsCount === (this.props.enableEmptySections ? this.props.dataSource.getRowAndSectionCount() : this.props.dataSource.getRowCount())) { + this._maybeCallOnEndReached(); + return; + } + + var distanceFromEnd = this._getDistanceFromEnd(this.scrollProperties); + if (distanceFromEnd < this.props.scrollRenderAheadDistance) { + this._pageInNewRows(); + } + }, + + _pageInNewRows: function _pageInNewRows() { + var _this4 = this; + + this.setState(function (state, props) { + var rowsToRender = Math.min(state.curRenderedRowsCount + props.pageSize, props.enableEmptySections ? props.dataSource.getRowAndSectionCount() : props.dataSource.getRowCount()); + _this4._prevRenderedRowsCount = state.curRenderedRowsCount; + return { + curRenderedRowsCount: rowsToRender + }; + }, function () { + _this4._measureAndUpdateScrollProps(); + _this4._prevRenderedRowsCount = _this4.state.curRenderedRowsCount; + }); + }, + + _getDistanceFromEnd: function _getDistanceFromEnd(scrollProperties) { + return scrollProperties.contentLength - scrollProperties.visibleLength - scrollProperties.offset; + }, + + _updateVisibleRows: function _updateVisibleRows(updatedFrames) { + var _this5 = this; + + if (!this.props.onChangeVisibleRows) { + return; + } + if (updatedFrames) { + updatedFrames.forEach(function (newFrame) { + _this5._childFrames[newFrame.index] = merge(newFrame); + }); + } + var isVertical = !this.props.horizontal; + var dataSource = this.props.dataSource; + var visibleMin = this.scrollProperties.offset; + var visibleMax = visibleMin + this.scrollProperties.visibleLength; + var allRowIDs = dataSource.rowIdentities; + + var header = this.props.renderHeader && this.props.renderHeader(); + var totalIndex = header ? 1 : 0; + var visibilityChanged = false; + var changedRows = {}; + for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) { + var rowIDs = allRowIDs[sectionIdx]; + if (rowIDs.length === 0) { + continue; + } + var sectionID = dataSource.sectionIdentities[sectionIdx]; + if (this.props.renderSectionHeader) { + totalIndex++; + } + var visibleSection = this._visibleRows[sectionID]; + if (!visibleSection) { + visibleSection = {}; + } + for (var rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) { + var rowID = rowIDs[rowIdx]; + var frame = this._childFrames[totalIndex]; + totalIndex++; + if (this.props.renderSeparator && (rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) { + totalIndex++; + } + if (!frame) { + break; + } + var rowVisible = visibleSection[rowID]; + var min = isVertical ? frame.y : frame.x; + var max = min + (isVertical ? frame.height : frame.width); + if (!min && !max || min === max) { + break; + } + if (min > visibleMax || max < visibleMin) { + if (rowVisible) { + visibilityChanged = true; + delete visibleSection[rowID]; + if (!changedRows[sectionID]) { + changedRows[sectionID] = {}; + } + changedRows[sectionID][rowID] = false; + } + } else if (!rowVisible) { + visibilityChanged = true; + visibleSection[rowID] = true; + if (!changedRows[sectionID]) { + changedRows[sectionID] = {}; + } + changedRows[sectionID][rowID] = true; + } + } + if (!isEmpty(visibleSection)) { + this._visibleRows[sectionID] = visibleSection; + } else if (this._visibleRows[sectionID]) { + delete this._visibleRows[sectionID]; + } + } + visibilityChanged && this.props.onChangeVisibleRows(this._visibleRows, changedRows); + }, + + _onScroll: function _onScroll(e) { + var isVertical = !this.props.horizontal; + this.scrollProperties.visibleLength = e.nativeEvent.layoutMeasurement[isVertical ? 'height' : 'width']; + this.scrollProperties.contentLength = e.nativeEvent.contentSize[isVertical ? 'height' : 'width']; + this.scrollProperties.offset = e.nativeEvent.contentOffset[isVertical ? 'y' : 'x']; + this._updateVisibleRows(e.nativeEvent.updatedChildFrames); + if (!this._maybeCallOnEndReached(e)) { + this._renderMoreRowsIfNeeded(); + } + + if (this.props.onEndReached && this._getDistanceFromEnd(this.scrollProperties) > this.props.onEndReachedThreshold) { + this._sentEndForContentLength = null; + } + + this.props.onScroll && this.props.onScroll(e); + } +}); + +module.exports = ListView; +}, 303, null, "ListView"); +__d(/* ListViewDataSource */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var isEmpty = require(305 ); // 305 = isEmpty +var warning = require(40 ); // 40 = fbjs/lib/warning + +function defaultGetRowData(dataBlob, sectionID, rowID) { + return dataBlob[sectionID][rowID]; +} + +function defaultGetSectionHeaderData(dataBlob, sectionID) { + return dataBlob[sectionID]; +} + +var ListViewDataSource = function () { + function ListViewDataSource(params) { + babelHelpers.classCallCheck(this, ListViewDataSource); + + invariant(params && typeof params.rowHasChanged === 'function', 'Must provide a rowHasChanged function.'); + this._rowHasChanged = params.rowHasChanged; + this._getRowData = params.getRowData || defaultGetRowData; + this._sectionHeaderHasChanged = params.sectionHeaderHasChanged; + this._getSectionHeaderData = params.getSectionHeaderData || defaultGetSectionHeaderData; + + this._dataBlob = null; + this._dirtyRows = []; + this._dirtySections = []; + this._cachedRowCount = 0; + + this.rowIdentities = []; + this.sectionIdentities = []; + } + + babelHelpers.createClass(ListViewDataSource, [{ + key: 'cloneWithRows', + value: function cloneWithRows(dataBlob, rowIdentities) { + var rowIds = rowIdentities ? [rowIdentities] : null; + if (!this._sectionHeaderHasChanged) { + this._sectionHeaderHasChanged = function () { + return false; + }; + } + return this.cloneWithRowsAndSections({ s1: dataBlob }, ['s1'], rowIds); + } + }, { + key: 'cloneWithRowsAndSections', + value: function cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) { + invariant(typeof this._sectionHeaderHasChanged === 'function', 'Must provide a sectionHeaderHasChanged function with section data.'); + invariant(!sectionIdentities || !rowIdentities || sectionIdentities.length === rowIdentities.length, 'row and section ids lengths must be the same'); + + var newSource = new ListViewDataSource({ + getRowData: this._getRowData, + getSectionHeaderData: this._getSectionHeaderData, + rowHasChanged: this._rowHasChanged, + sectionHeaderHasChanged: this._sectionHeaderHasChanged + }); + newSource._dataBlob = dataBlob; + if (sectionIdentities) { + newSource.sectionIdentities = sectionIdentities; + } else { + newSource.sectionIdentities = Object.keys(dataBlob); + } + if (rowIdentities) { + newSource.rowIdentities = rowIdentities; + } else { + newSource.rowIdentities = []; + newSource.sectionIdentities.forEach(function (sectionID) { + newSource.rowIdentities.push(Object.keys(dataBlob[sectionID])); + }); + } + newSource._cachedRowCount = countRows(newSource.rowIdentities); + + newSource._calculateDirtyArrays(this._dataBlob, this.sectionIdentities, this.rowIdentities); + + return newSource; + } + }, { + key: 'getRowCount', + value: function getRowCount() { + return this._cachedRowCount; + } + }, { + key: 'getRowAndSectionCount', + value: function getRowAndSectionCount() { + return this._cachedRowCount + this.sectionIdentities.length; + } + }, { + key: 'rowShouldUpdate', + value: function rowShouldUpdate(sectionIndex, rowIndex) { + var needsUpdate = this._dirtyRows[sectionIndex][rowIndex]; + warning(needsUpdate !== undefined, 'missing dirtyBit for section, row: ' + sectionIndex + ', ' + rowIndex); + return needsUpdate; + } + }, { + key: 'getRowData', + value: function getRowData(sectionIndex, rowIndex) { + var sectionID = this.sectionIdentities[sectionIndex]; + var rowID = this.rowIdentities[sectionIndex][rowIndex]; + warning(sectionID !== undefined && rowID !== undefined, 'rendering invalid section, row: ' + sectionIndex + ', ' + rowIndex); + return this._getRowData(this._dataBlob, sectionID, rowID); + } + }, { + key: 'getRowIDForFlatIndex', + value: function getRowIDForFlatIndex(index) { + var accessIndex = index; + for (var ii = 0; ii < this.sectionIdentities.length; ii++) { + if (accessIndex >= this.rowIdentities[ii].length) { + accessIndex -= this.rowIdentities[ii].length; + } else { + return this.rowIdentities[ii][accessIndex]; + } + } + return null; + } + }, { + key: 'getSectionIDForFlatIndex', + value: function getSectionIDForFlatIndex(index) { + var accessIndex = index; + for (var ii = 0; ii < this.sectionIdentities.length; ii++) { + if (accessIndex >= this.rowIdentities[ii].length) { + accessIndex -= this.rowIdentities[ii].length; + } else { + return this.sectionIdentities[ii]; + } + } + return null; + } + }, { + key: 'getSectionLengths', + value: function getSectionLengths() { + var results = []; + for (var ii = 0; ii < this.sectionIdentities.length; ii++) { + results.push(this.rowIdentities[ii].length); + } + return results; + } + }, { + key: 'sectionHeaderShouldUpdate', + value: function sectionHeaderShouldUpdate(sectionIndex) { + var needsUpdate = this._dirtySections[sectionIndex]; + warning(needsUpdate !== undefined, 'missing dirtyBit for section: ' + sectionIndex); + return needsUpdate; + } + }, { + key: 'getSectionHeaderData', + value: function getSectionHeaderData(sectionIndex) { + if (!this._getSectionHeaderData) { + return null; + } + var sectionID = this.sectionIdentities[sectionIndex]; + warning(sectionID !== undefined, 'renderSection called on invalid section: ' + sectionIndex); + return this._getSectionHeaderData(this._dataBlob, sectionID); + } + }, { + key: '_calculateDirtyArrays', + value: function _calculateDirtyArrays(prevDataBlob, prevSectionIDs, prevRowIDs) { + var prevSectionsHash = keyedDictionaryFromArray(prevSectionIDs); + var prevRowsHash = {}; + for (var ii = 0; ii < prevRowIDs.length; ii++) { + var sectionID = prevSectionIDs[ii]; + warning(!prevRowsHash[sectionID], 'SectionID appears more than once: ' + sectionID); + prevRowsHash[sectionID] = keyedDictionaryFromArray(prevRowIDs[ii]); + } + + this._dirtySections = []; + this._dirtyRows = []; + + var dirty; + for (var sIndex = 0; sIndex < this.sectionIdentities.length; sIndex++) { + var sectionID = this.sectionIdentities[sIndex]; + + dirty = !prevSectionsHash[sectionID]; + var sectionHeaderHasChanged = this._sectionHeaderHasChanged; + if (!dirty && sectionHeaderHasChanged) { + dirty = sectionHeaderHasChanged(this._getSectionHeaderData(prevDataBlob, sectionID), this._getSectionHeaderData(this._dataBlob, sectionID)); + } + this._dirtySections.push(!!dirty); + + this._dirtyRows[sIndex] = []; + for (var rIndex = 0; rIndex < this.rowIdentities[sIndex].length; rIndex++) { + var rowID = this.rowIdentities[sIndex][rIndex]; + + dirty = !prevSectionsHash[sectionID] || !prevRowsHash[sectionID][rowID] || this._rowHasChanged(this._getRowData(prevDataBlob, sectionID, rowID), this._getRowData(this._dataBlob, sectionID, rowID)); + this._dirtyRows[sIndex].push(!!dirty); + } + } + } + }]); + return ListViewDataSource; +}(); + +function countRows(allRowIDs) { + var totalRows = 0; + for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) { + var rowIDs = allRowIDs[sectionIdx]; + totalRows += rowIDs.length; + } + return totalRows; +} + +function keyedDictionaryFromArray(arr) { + if (isEmpty(arr)) { + return {}; + } + var result = {}; + for (var ii = 0; ii < arr.length; ii++) { + var key = arr[ii]; + warning(!result[key], 'Value appears more than once in array: ' + key); + result[key] = true; + } + return result; +} + +module.exports = ListViewDataSource; +}, 304, null, "ListViewDataSource"); +__d(/* isEmpty */function(global, require, module, exports) { +'use strict'; + +function isEmpty(obj) { + if (Array.isArray(obj)) { + return obj.length === 0; + } else if (typeof obj === 'object') { + for (var i in obj) { + return false; + } + return true; + } else { + return !obj; + } +} + +module.exports = isEmpty; +}, 305, null, "isEmpty"); +__d(/* StaticRenderer */function(global, require, module, exports) { +'use strict'; + +var React = require(126 ); // 126 = React + +var StaticRenderer = function (_React$Component) { + babelHelpers.inherits(StaticRenderer, _React$Component); + + function StaticRenderer() { + babelHelpers.classCallCheck(this, StaticRenderer); + return babelHelpers.possibleConstructorReturn(this, (StaticRenderer.__proto__ || Object.getPrototypeOf(StaticRenderer)).apply(this, arguments)); + } + + babelHelpers.createClass(StaticRenderer, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps) { + return nextProps.shouldUpdate; + } + }, { + key: 'render', + value: function render() { + return this.props.render(); + } + }]); + return StaticRenderer; +}(React.Component); + +StaticRenderer.propTypes = { + shouldUpdate: React.PropTypes.bool.isRequired, + render: React.PropTypes.func.isRequired +}; + + +module.exports = StaticRenderer; +}, 306, null, "StaticRenderer"); +__d(/* react-clone-referenced-element/cloneReferencedElement.js */function(global, require, module, exports) {'use strict'; + +var React = require(34 ); // 34 = react + +function cloneReferencedElement(element, config) { + var cloneRef = config.ref; + var originalRef = element.ref; + + for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + children[_key - 2] = arguments[_key]; + } + + if (originalRef == null || cloneRef == null) { + return React.cloneElement.apply(React, [element, config].concat(children)); + } + + if (typeof originalRef !== 'function') { + if (__DEV__) { + console.warn('Cloning an element with a ref that will be overwritten because it ' + 'is not a function. Use a composable callback-style ref instead. ' + 'Ignoring ref: ' + originalRef); + } + return React.cloneElement.apply(React, [element, config].concat(children)); + } + + return React.cloneElement.apply(React, [element, babelHelpers.extends({}, config, { + ref: function ref(component) { + cloneRef(component); + originalRef(component); + } + })].concat(children)); +} + +module.exports = cloneReferencedElement; +}, 307, null, "react-clone-referenced-element/cloneReferencedElement.js"); +__d(/* MapView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/MapView/MapView.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var Image = require(237 ); // 237 = Image +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var deprecatedPropType = require(137 ); // 137 = deprecatedPropType +var processColor = require(121 ); // 121 = processColor +var resolveAssetSource = require(198 ); // 198 = resolveAssetSource +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var MapView = React.createClass({ + displayName: 'MapView', + + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + style: View.propTypes.style, + + showsUserLocation: React.PropTypes.bool, + + followUserLocation: React.PropTypes.bool, + + showsPointsOfInterest: React.PropTypes.bool, + + showsCompass: React.PropTypes.bool, + + showsAnnotationCallouts: React.PropTypes.bool, + + zoomEnabled: React.PropTypes.bool, + + rotateEnabled: React.PropTypes.bool, + + pitchEnabled: React.PropTypes.bool, + + scrollEnabled: React.PropTypes.bool, + + mapType: React.PropTypes.oneOf(['standard', 'satellite', 'hybrid']), + + region: React.PropTypes.shape({ + latitude: React.PropTypes.number.isRequired, + longitude: React.PropTypes.number.isRequired, + + latitudeDelta: React.PropTypes.number, + longitudeDelta: React.PropTypes.number + }), + + annotations: React.PropTypes.arrayOf(React.PropTypes.shape({ + latitude: React.PropTypes.number.isRequired, + longitude: React.PropTypes.number.isRequired, + + animateDrop: React.PropTypes.bool, + + draggable: React.PropTypes.bool, + + onDragStateChange: React.PropTypes.func, + + onFocus: React.PropTypes.func, + + onBlur: React.PropTypes.func, + + title: React.PropTypes.string, + subtitle: React.PropTypes.string, + + leftCalloutView: React.PropTypes.element, + rightCalloutView: React.PropTypes.element, + detailCalloutView: React.PropTypes.element, + + tintColor: ColorPropType, + + image: Image.propTypes.source, + + view: React.PropTypes.element, + + id: React.PropTypes.string, + + hasLeftCallout: deprecatedPropType(React.PropTypes.bool, 'Use `leftCalloutView` instead.'), + hasRightCallout: deprecatedPropType(React.PropTypes.bool, 'Use `rightCalloutView` instead.'), + onLeftCalloutPress: deprecatedPropType(React.PropTypes.func, 'Use `leftCalloutView` instead.'), + onRightCalloutPress: deprecatedPropType(React.PropTypes.func, 'Use `rightCalloutView` instead.') + })), + + overlays: React.PropTypes.arrayOf(React.PropTypes.shape({ + coordinates: React.PropTypes.arrayOf(React.PropTypes.shape({ + latitude: React.PropTypes.number.isRequired, + longitude: React.PropTypes.number.isRequired + })), + + lineWidth: React.PropTypes.number, + strokeColor: ColorPropType, + fillColor: ColorPropType, + + id: React.PropTypes.string + })), + + maxDelta: React.PropTypes.number, + + minDelta: React.PropTypes.number, + + legalLabelInsets: EdgeInsetsPropType, + + onRegionChange: React.PropTypes.func, + + onRegionChangeComplete: React.PropTypes.func, + + onAnnotationPress: React.PropTypes.func, + + active: React.PropTypes.bool + }), + + statics: { + PinColors: { + RED: '#ff3b30', + GREEN: '#4cd964', + PURPLE: '#c969e0' + } + }, + + render: function render() { + var _this = this; + + var children = [], + _props = this.props, + annotations = _props.annotations, + overlays = _props.overlays, + followUserLocation = _props.followUserLocation; + annotations = annotations && annotations.map(function (annotation) { + var id = annotation.id, + image = annotation.image, + tintColor = annotation.tintColor, + view = annotation.view, + leftCalloutView = annotation.leftCalloutView, + rightCalloutView = annotation.rightCalloutView, + detailCalloutView = annotation.detailCalloutView; + + + if (!view && image && tintColor) { + view = React.createElement(Image, { + style: { + tintColor: processColor(tintColor) + }, + source: image, + __source: { + fileName: _jsxFileName, + lineNumber: 388 + } + }); + image = undefined; + } + if (view) { + if (image) { + console.warn('`image` and `view` both set on annotation. Image will be ignored.'); + } + var viewIndex = children.length; + children.push(React.cloneElement(view, { + style: [styles.annotationView, view.props.style || {}] + })); + } + if (leftCalloutView) { + var leftCalloutViewIndex = children.length; + children.push(React.cloneElement(leftCalloutView, { + style: [styles.calloutView, leftCalloutView.props.style || {}] + })); + } + if (rightCalloutView) { + var rightCalloutViewIndex = children.length; + children.push(React.cloneElement(rightCalloutView, { + style: [styles.calloutView, rightCalloutView.props.style || {}] + })); + } + if (detailCalloutView) { + var detailCalloutViewIndex = children.length; + children.push(React.cloneElement(detailCalloutView, { + style: [styles.calloutView, detailCalloutView.props.style || {}] + })); + } + + var result = babelHelpers.extends({}, annotation, { + tintColor: tintColor && processColor(tintColor), + image: image, + viewIndex: viewIndex, + leftCalloutViewIndex: leftCalloutViewIndex, + rightCalloutViewIndex: rightCalloutViewIndex, + detailCalloutViewIndex: detailCalloutViewIndex, + view: undefined, + leftCalloutView: undefined, + rightCalloutView: undefined, + detailCalloutView: undefined + }); + result.id = id || encodeURIComponent(JSON.stringify(result)); + result.image = image && resolveAssetSource(image); + return result; + }); + overlays = overlays && overlays.map(function (overlay) { + var id = overlay.id, + fillColor = overlay.fillColor, + strokeColor = overlay.strokeColor; + + var result = babelHelpers.extends({}, overlay, { + strokeColor: strokeColor && processColor(strokeColor), + fillColor: fillColor && processColor(fillColor) + }); + result.id = id || encodeURIComponent(JSON.stringify(result)); + return result; + }); + + var findByAnnotationId = function findByAnnotationId(annotationId) { + if (!annotations) { + return null; + } + for (var i = 0, l = annotations.length; i < l; i++) { + if (annotations[i].id === annotationId) { + return annotations[i]; + } + } + return null; + }; + + var onPress = void 0, + onAnnotationDragStateChange = void 0, + onAnnotationFocus = void 0, + onAnnotationBlur = void 0; + if (annotations) { + onPress = function onPress(event) { + if (event.nativeEvent.action === 'annotation-click') { + _this.props.onAnnotationPress && _this.props.onAnnotationPress(event.nativeEvent.annotation); + } else if (event.nativeEvent.action === 'callout-click') { + var annotation = findByAnnotationId(event.nativeEvent.annotationId); + if (annotation) { + if (event.nativeEvent.side === 'left' && annotation.onLeftCalloutPress) { + annotation.onLeftCalloutPress(event.nativeEvent); + } else if (event.nativeEvent.side === 'right' && annotation.onRightCalloutPress) { + annotation.onRightCalloutPress(event.nativeEvent); + } + } + } + }; + onAnnotationDragStateChange = function onAnnotationDragStateChange(event) { + var annotation = findByAnnotationId(event.nativeEvent.annotationId); + if (annotation) { + annotation.onDragStateChange && annotation.onDragStateChange(event.nativeEvent); + } + }; + onAnnotationFocus = function onAnnotationFocus(event) { + var annotation = findByAnnotationId(event.nativeEvent.annotationId); + if (annotation && annotation.onFocus) { + annotation.onFocus(event.nativeEvent); + } + }; + onAnnotationBlur = function onAnnotationBlur(event) { + var annotation = findByAnnotationId(event.nativeEvent.annotationId); + if (annotation && annotation.onBlur) { + annotation.onBlur(event.nativeEvent); + } + }; + } + + if (this.props.onRegionChange || this.props.onRegionChangeComplete) { + var onChange = function onChange(event) { + if (event.nativeEvent.continuous) { + _this.props.onRegionChange && _this.props.onRegionChange(event.nativeEvent.region); + } else { + _this.props.onRegionChangeComplete && _this.props.onRegionChangeComplete(event.nativeEvent.region); + } + }; + } + + if (followUserLocation === undefined) { + followUserLocation = this.props.showUserLocation; + } + + return React.createElement(RCTMap, babelHelpers.extends({}, this.props, { + annotations: annotations, + children: children, + followUserLocation: followUserLocation, + overlays: overlays, + onPress: onPress, + onChange: onChange, + onAnnotationDragStateChange: onAnnotationDragStateChange, + onAnnotationFocus: onAnnotationFocus, + onAnnotationBlur: onAnnotationBlur, + __source: { + fileName: _jsxFileName, + lineNumber: 526 + } + })); + } +}); + +var styles = StyleSheet.create({ + annotationView: { + position: 'absolute', + backgroundColor: 'transparent' + }, + calloutView: { + position: 'absolute', + backgroundColor: 'white' + } +}); + +var RCTMap = requireNativeComponent('RCTMap', MapView, { + nativeOnly: { + onAnnotationDragStateChange: true, + onAnnotationFocus: true, + onAnnotationBlur: true, + onChange: true, + onPress: true + } +}); + +module.exports = MapView; +}, 308, null, "MapView"); +__d(/* Modal */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Modal/Modal.js', + _container; + +var AppContainer = require(310 ); // 310 = AppContainer +var I18nManager = require(331 ); // 331 = I18nManager +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var deprecatedPropType = require(137 ); // 137 = deprecatedPropType +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent +var RCTModalHostView = requireNativeComponent('RCTModalHostView', null); + +var PropTypes = React.PropTypes; + +var Modal = function (_React$Component) { + babelHelpers.inherits(Modal, _React$Component); + + function Modal() { + babelHelpers.classCallCheck(this, Modal); + return babelHelpers.possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).apply(this, arguments)); + } + + babelHelpers.createClass(Modal, [{ + key: 'render', + value: function render() { + if (this.props.visible === false) { + return null; + } + + var containerStyles = { + backgroundColor: this.props.transparent ? 'transparent' : 'white' + }; + + var animationType = this.props.animationType; + if (!animationType) { + animationType = 'none'; + if (this.props.animated) { + animationType = 'slide'; + } + } + + var innerChildren = __DEV__ ? React.createElement( + AppContainer, + { rootTag: this.context.rootTag, __source: { + fileName: _jsxFileName, + lineNumber: 160 + } + }, + this.props.children + ) : this.props.children; + + return React.createElement( + RCTModalHostView, + { + animationType: animationType, + transparent: this.props.transparent, + hardwareAccelerated: this.props.hardwareAccelerated, + onRequestClose: this.props.onRequestClose, + onShow: this.props.onShow, + style: styles.modal, + onStartShouldSetResponder: this._shouldSetResponder, + supportedOrientations: this.props.supportedOrientations, + onOrientationChange: this.props.onOrientationChange, + __source: { + fileName: _jsxFileName, + lineNumber: 166 + } + }, + React.createElement( + View, + { style: [styles.container, containerStyles], __source: { + fileName: _jsxFileName, + lineNumber: 177 + } + }, + innerChildren + ) + ); + } + }, { + key: '_shouldSetResponder', + value: function _shouldSetResponder() { + return true; + } + }]); + return Modal; +}(React.Component); + +Modal.propTypes = { + animationType: PropTypes.oneOf(['none', 'slide', 'fade']), + + transparent: PropTypes.bool, + + hardwareAccelerated: PropTypes.bool, + + visible: PropTypes.bool, + + onRequestClose: Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func, + + onShow: PropTypes.func, + animated: deprecatedPropType(PropTypes.bool, 'Use the `animationType` prop instead.'), + + supportedOrientations: PropTypes.arrayOf(PropTypes.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'])), + + onOrientationChange: PropTypes.func +}; +Modal.defaultProps = { + visible: true, + hardwareAccelerated: false +}; +Modal.contextTypes = { + rootTag: React.PropTypes.number +}; + + +var side = I18nManager.isRTL ? 'right' : 'left'; +var styles = StyleSheet.create({ + modal: { + position: 'absolute' + }, + container: (_container = { + position: 'absolute' + }, babelHelpers.defineProperty(_container, side, 0), babelHelpers.defineProperty(_container, 'top', 0), _container) +}); + +module.exports = Modal; +}, 309, null, "Modal"); +__d(/* AppContainer */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/ReactNative/AppContainer.js'; +var EmitterSubscription = require(104 ); // 104 = EmitterSubscription +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var AppContainer = function (_React$Component) { + babelHelpers.inherits(AppContainer, _React$Component); + + function AppContainer() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, AppContainer); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = AppContainer.__proto__ || Object.getPrototypeOf(AppContainer)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + inspector: null, + mainKey: 1 + }, _this._subscription = null, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(AppContainer, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + rootTag: this.props.rootTag + }; + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; + + if (__DEV__) { + this._subscription = RCTDeviceEventEmitter.addListener('toggleElementInspector', function () { + var Inspector = require(311 ); // 311 = Inspector + var inspector = _this2.state.inspector ? null : React.createElement(Inspector, { + inspectedViewTag: ReactNative.findNodeHandle(_this2._mainRef), + onRequestRerenderApp: function onRequestRerenderApp(updateInspectedViewTag) { + _this2.setState(function (s) { + return { mainKey: s.mainKey + 1 }; + }, function () { + return updateInspectedViewTag(ReactNative.findNodeHandle(_this2._mainRef)); + }); + }, + __source: { + fileName: _jsxFileName, + lineNumber: 61 + } + }); + _this2.setState({ inspector: inspector }); + }); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this._subscription) { + this._subscription.remove(); + } + } + }, { + key: 'render', + value: function render() { + var _this3 = this; + + var yellowBox = null; + if (__DEV__) { + var YellowBox = require(330 ); // 330 = YellowBox + yellowBox = React.createElement(YellowBox, { + __source: { + fileName: _jsxFileName, + lineNumber: 88 + } + }); + } + + return React.createElement( + View, + { style: styles.appContainer, pointerEvents: 'box-none', __source: { + fileName: _jsxFileName, + lineNumber: 92 + } + }, + React.createElement( + View, + { + collapsable: !this.state.inspector, + key: this.state.mainKey, + pointerEvents: 'box-none', + style: styles.appContainer, ref: function ref(_ref2) { + _this3._mainRef = _ref2; + }, __source: { + fileName: _jsxFileName, + lineNumber: 93 + } + }, + this.props.children + ), + yellowBox, + this.state.inspector + ); + } + }]); + return AppContainer; +}(React.Component); + +AppContainer.childContextTypes = { + rootTag: React.PropTypes.number +}; + + +var styles = StyleSheet.create({ + appContainer: { + flex: 1 + } +}); + +module.exports = AppContainer; +}, 310, null, "AppContainer"); +__d(/* Inspector */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/Inspector.js'; +var Dimensions = require(129 ); // 129 = Dimensions +var InspectorOverlay = require(312 ); // 312 = InspectorOverlay +var InspectorPanel = require(317 ); // 317 = InspectorPanel +var InspectorUtils = require(313 ); // 313 = InspectorUtils +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Touchable = require(211 ); // 211 = Touchable +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View + +if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = require(77 ); // 77 = flattenStyle +} + +var Inspector = function (_React$Component) { + babelHelpers.inherits(Inspector, _React$Component); + + function Inspector(props) { + babelHelpers.classCallCheck(this, Inspector); + + var _this = babelHelpers.possibleConstructorReturn(this, (Inspector.__proto__ || Object.getPrototypeOf(Inspector)).call(this, props)); + + _initialiseProps.call(_this); + + _this.state = { + devtoolsAgent: null, + hierarchy: null, + panelPos: 'bottom', + inspecting: true, + perfing: false, + inspected: null, + selection: null, + inspectedViewTag: _this.props.inspectedViewTag, + networking: false + }; + return _this; + } + + babelHelpers.createClass(Inspector, [{ + key: 'componentDidMount', + value: function componentDidMount() { + if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { + this.attachToDevtools = this.attachToDevtools.bind(this); + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('react-devtools', this.attachToDevtools); + + if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent) { + this.attachToDevtools(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent); + } + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this._subs) { + this._subs.map(function (fn) { + return fn(); + }); + } + if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.off('react-devtools', this.attachToDevtools); + } + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(newProps) { + this.setState({ inspectedViewTag: newProps.inspectedViewTag }); + } + }, { + key: 'setSelection', + value: function setSelection(i) { + var _this2 = this; + + var instance = this.state.hierarchy[i]; + + var publicInstance = instance['_instance'] || {}; + var source = instance['_currentElement'] && instance['_currentElement']['_source']; + UIManager.measure(instance.getHostNode(), function (x, y, width, height, left, top) { + _this2.setState({ + inspected: { + frame: { left: left, top: top, width: width, height: height }, + style: publicInstance.props ? publicInstance.props.style : {}, + source: source + }, + selection: i + }); + }); + } + }, { + key: 'onTouchInstance', + value: function onTouchInstance(touched, frame, pointerY) { + var hierarchy = InspectorUtils.getOwnerHierarchy(touched); + var instance = InspectorUtils.lastNotNativeInstance(hierarchy); + + if (this.state.devtoolsAgent) { + this.state.devtoolsAgent.selectFromReactInstance(instance, true); + } + + var publicInstance = instance['_instance'] || {}; + var props = publicInstance.props || {}; + var source = instance['_currentElement'] && instance['_currentElement']['_source']; + this.setState({ + panelPos: pointerY > Dimensions.get('window').height / 2 ? 'top' : 'bottom', + selection: hierarchy.indexOf(instance), + hierarchy: hierarchy, + inspected: { + style: props.style || {}, + frame: frame, + source: source + } + }); + } + }, { + key: 'setPerfing', + value: function setPerfing(val) { + this.setState({ + perfing: val, + inspecting: false, + inspected: null, + networking: false + }); + } + }, { + key: 'setInspecting', + value: function setInspecting(val) { + this.setState({ + inspecting: val, + inspected: null + }); + } + }, { + key: 'setTouchTargetting', + value: function setTouchTargetting(val) { + var _this3 = this; + + Touchable.TOUCH_TARGET_DEBUG = val; + this.props.onRequestRerenderApp(function (inspectedViewTag) { + _this3.setState({ inspectedViewTag: inspectedViewTag }); + }); + } + }, { + key: 'setNetworking', + value: function setNetworking(val) { + this.setState({ + networking: val, + perfing: false, + inspecting: false, + inspected: null + }); + } + }, { + key: 'render', + value: function render() { + var panelContainerStyle = this.state.panelPos === 'bottom' ? { bottom: 0 } : { top: Platform.OS === 'ios' ? 20 : 0 }; + return React.createElement( + View, + { style: styles.container, pointerEvents: 'box-none', __source: { + fileName: _jsxFileName, + lineNumber: 212 + } + }, + this.state.inspecting && React.createElement(InspectorOverlay, { + inspected: this.state.inspected, + inspectedViewTag: this.state.inspectedViewTag, + onTouchInstance: this.onTouchInstance.bind(this), + __source: { + fileName: _jsxFileName, + lineNumber: 214 + } + }), + React.createElement( + View, + { style: [styles.panelContainer, panelContainerStyle], __source: { + fileName: _jsxFileName, + lineNumber: 219 + } + }, + React.createElement(InspectorPanel, { + devtoolsIsOpen: !!this.state.devtoolsAgent, + inspecting: this.state.inspecting, + perfing: this.state.perfing, + setPerfing: this.setPerfing.bind(this), + setInspecting: this.setInspecting.bind(this), + inspected: this.state.inspected, + hierarchy: this.state.hierarchy, + selection: this.state.selection, + setSelection: this.setSelection.bind(this), + touchTargetting: Touchable.TOUCH_TARGET_DEBUG, + setTouchTargetting: this.setTouchTargetting.bind(this), + networking: this.state.networking, + setNetworking: this.setNetworking.bind(this), + __source: { + fileName: _jsxFileName, + lineNumber: 220 + } + }) + ) + ); + } + }]); + return Inspector; +}(React.Component); + +var _initialiseProps = function _initialiseProps() { + var _this4 = this; + + this.attachToDevtools = function (agent) { + var _hideWait = null; + var hlSub = agent.sub('highlight', function (_ref) { + var node = _ref.node, + name = _ref.name, + props = _ref.props; + + clearTimeout(_hideWait); + UIManager.measure(node, function (x, y, width, height, left, top) { + _this4.setState({ + hierarchy: [], + inspected: { + frame: { left: left, top: top, width: width, height: height }, + style: props ? props.style : {} + } + }); + }); + }); + var hideSub = agent.sub('hideHighlight', function () { + if (_this4.state.inspected === null) { + return; + } + + _hideWait = setTimeout(function () { + _this4.setState({ + inspected: null + }); + }, 100); + }); + _this4._subs = [hlSub, hideSub]; + + agent.on('shutdown', function () { + _this4.setState({ devtoolsAgent: null }); + _this4._subs = null; + }); + _this4.setState({ + devtoolsAgent: agent + }); + }; +}; + +var styles = StyleSheet.create({ + container: { + position: 'absolute', + backgroundColor: 'transparent', + top: 0, + left: 0, + right: 0, + bottom: 0 + }, + panelContainer: { + position: 'absolute', + left: 0, + right: 0 + } +}); + +module.exports = Inspector; +}, 311, null, "Inspector"); +__d(/* InspectorOverlay */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/InspectorOverlay.js'; +var Dimensions = require(129 ); // 129 = Dimensions +var InspectorUtils = require(313 ); // 313 = InspectorUtils +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View +var ElementBox = require(314 ); // 314 = ElementBox + +var PropTypes = React.PropTypes; + +var InspectorOverlay = function (_React$Component) { + babelHelpers.inherits(InspectorOverlay, _React$Component); + + function InspectorOverlay() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, InspectorOverlay); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = InspectorOverlay.__proto__ || Object.getPrototypeOf(InspectorOverlay)).call.apply(_ref, [this].concat(args))), _this), _this.findViewForTouchEvent = function (e) { + var _e$nativeEvent$touche = e.nativeEvent.touches[0], + locationX = _e$nativeEvent$touche.locationX, + locationY = _e$nativeEvent$touche.locationY; + + UIManager.findSubviewIn(_this.props.inspectedViewTag, [locationX, locationY], function (nativeViewTag, left, top, width, height) { + var instance = InspectorUtils.findInstanceByNativeTag(nativeViewTag); + if (!instance) { + return; + } + _this.props.onTouchInstance(instance, { left: left, top: top, width: width, height: height }, locationY); + }); + }, _this.shouldSetResponser = function (e) { + _this.findViewForTouchEvent(e); + return true; + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(InspectorOverlay, [{ + key: 'render', + value: function render() { + var content = null; + if (this.props.inspected) { + content = React.createElement(ElementBox, { frame: this.props.inspected.frame, style: this.props.inspected.style, __source: { + fileName: _jsxFileName, + lineNumber: 70 + } + }); + } + + return React.createElement( + View, + { + onStartShouldSetResponder: this.shouldSetResponser, + onResponderMove: this.findViewForTouchEvent, + style: [styles.inspector, { height: Dimensions.get('window').height }], __source: { + fileName: _jsxFileName, + lineNumber: 74 + } + }, + content + ); + } + }]); + return InspectorOverlay; +}(React.Component); + +InspectorOverlay.propTypes = { + inspected: PropTypes.shape({ + frame: PropTypes.object, + style: PropTypes.any + }), + inspectedViewTag: PropTypes.number, + onTouchInstance: PropTypes.func.isRequired +}; + + +var styles = StyleSheet.create({ + inspector: { + backgroundColor: 'transparent', + position: 'absolute', + left: 0, + top: 0, + right: 0 + } +}); + +module.exports = InspectorOverlay; +}, 312, null, "InspectorOverlay"); +__d(/* InspectorUtils */function(global, require, module, exports) { +'use strict'; + +var ReactNativeComponentTree = require(159 ); // 159 = ReactNativeComponentTree + +function traverseOwnerTreeUp(hierarchy, instance) { + if (instance) { + hierarchy.unshift(instance); + traverseOwnerTreeUp(hierarchy, instance._currentElement._owner); + } +} + +function findInstanceByNativeTag(nativeTag) { + return ReactNativeComponentTree.getInstanceFromNode(nativeTag); +} + +function getOwnerHierarchy(instance) { + var hierarchy = []; + traverseOwnerTreeUp(hierarchy, instance); + return hierarchy; +} + +function lastNotNativeInstance(hierarchy) { + for (var i = hierarchy.length - 1; i > 1; i--) { + var instance = hierarchy[i]; + if (!instance.viewConfig) { + return instance; + } + } + return hierarchy[0]; +} + +module.exports = { findInstanceByNativeTag: findInstanceByNativeTag, getOwnerHierarchy: getOwnerHierarchy, lastNotNativeInstance: lastNotNativeInstance }; +}, 313, null, "InspectorUtils"); +__d(/* ElementBox */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/ElementBox.js'; +var React = require(126 ); // 126 = React +var View = require(146 ); // 146 = View +var StyleSheet = require(127 ); // 127 = StyleSheet +var BorderBox = require(315 ); // 315 = BorderBox +var resolveBoxStyle = require(316 ); // 316 = resolveBoxStyle + +var flattenStyle = require(77 ); // 77 = flattenStyle + +var ElementBox = function (_React$Component) { + babelHelpers.inherits(ElementBox, _React$Component); + + function ElementBox() { + babelHelpers.classCallCheck(this, ElementBox); + return babelHelpers.possibleConstructorReturn(this, (ElementBox.__proto__ || Object.getPrototypeOf(ElementBox)).apply(this, arguments)); + } + + babelHelpers.createClass(ElementBox, [{ + key: 'render', + value: function render() { + var style = flattenStyle(this.props.style) || {}; + var margin = resolveBoxStyle('margin', style); + var padding = resolveBoxStyle('padding', style); + var frameStyle = this.props.frame; + if (margin) { + frameStyle = { + top: frameStyle.top - margin.top, + left: frameStyle.left - margin.left, + height: frameStyle.height + margin.top + margin.bottom, + width: frameStyle.width + margin.left + margin.right + }; + } + var contentStyle = { + width: this.props.frame.width, + height: this.props.frame.height + }; + if (padding) { + contentStyle = { + width: contentStyle.width - padding.left - padding.right, + height: contentStyle.height - padding.top - padding.bottom + }; + } + return React.createElement( + View, + { style: [styles.frame, frameStyle], pointerEvents: 'none', __source: { + fileName: _jsxFileName, + lineNumber: 47 + } + }, + React.createElement( + BorderBox, + { box: margin, style: styles.margin, __source: { + fileName: _jsxFileName, + lineNumber: 48 + } + }, + React.createElement( + BorderBox, + { box: padding, style: styles.padding, __source: { + fileName: _jsxFileName, + lineNumber: 49 + } + }, + React.createElement(View, { style: [styles.content, contentStyle], __source: { + fileName: _jsxFileName, + lineNumber: 50 + } + }) + ) + ) + ); + } + }]); + return ElementBox; +}(React.Component); + +var styles = StyleSheet.create({ + frame: { + position: 'absolute' + }, + content: { + backgroundColor: 'rgba(200, 230, 255, 0.8)' + }, + padding: { + borderColor: 'rgba(77, 255, 0, 0.3)' + }, + margin: { + borderColor: 'rgba(255, 132, 0, 0.3)' + } +}); + +module.exports = ElementBox; +}, 314, null, "ElementBox"); +__d(/* BorderBox */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/BorderBox.js'; +var React = require(126 ); // 126 = React +var View = require(146 ); // 146 = View + +var BorderBox = function (_React$Component) { + babelHelpers.inherits(BorderBox, _React$Component); + + function BorderBox() { + babelHelpers.classCallCheck(this, BorderBox); + return babelHelpers.possibleConstructorReturn(this, (BorderBox.__proto__ || Object.getPrototypeOf(BorderBox)).apply(this, arguments)); + } + + babelHelpers.createClass(BorderBox, [{ + key: 'render', + value: function render() { + var box = this.props.box; + if (!box) { + return this.props.children; + } + var style = { + borderTopWidth: box.top, + borderBottomWidth: box.bottom, + borderLeftWidth: box.left, + borderRightWidth: box.right + }; + return React.createElement( + View, + { style: [style, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 30 + } + }, + this.props.children + ); + } + }]); + return BorderBox; +}(React.Component); + +module.exports = BorderBox; +}, 315, null, "BorderBox"); +__d(/* resolveBoxStyle */function(global, require, module, exports) { +'use strict'; + +function resolveBoxStyle(prefix, style) { + var res = {}; + var subs = ['top', 'left', 'bottom', 'right']; + var set = false; + subs.forEach(function (sub) { + res[sub] = style[prefix] || 0; + }); + if (style[prefix]) { + set = true; + } + if (style[prefix + 'Vertical']) { + res.top = res.bottom = style[prefix + 'Vertical']; + set = true; + } + if (style[prefix + 'Horizontal']) { + res.left = res.right = style[prefix + 'Horizontal']; + set = true; + } + subs.forEach(function (sub) { + var val = style[prefix + capFirst(sub)]; + if (val) { + res[sub] = val; + set = true; + } + }); + if (!set) { + return; + } + return res; +} + +function capFirst(text) { + return text[0].toUpperCase() + text.slice(1); +} + +module.exports = resolveBoxStyle; +}, 316, null, "resolveBoxStyle"); +__d(/* InspectorPanel */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/InspectorPanel.js'; +var ElementProperties = require(318 ); // 318 = ElementProperties +var NetworkOverlay = require(326 ); // 326 = NetworkOverlay +var PerformanceOverlay = require(329 ); // 329 = PerformanceOverlay +var React = require(126 ); // 126 = React +var ScrollView = require(239 ); // 239 = ScrollView +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var TouchableHighlight = require(321 ); // 321 = TouchableHighlight +var View = require(146 ); // 146 = View + +var PropTypes = React.PropTypes; + +var InspectorPanel = function (_React$Component) { + babelHelpers.inherits(InspectorPanel, _React$Component); + + function InspectorPanel() { + babelHelpers.classCallCheck(this, InspectorPanel); + return babelHelpers.possibleConstructorReturn(this, (InspectorPanel.__proto__ || Object.getPrototypeOf(InspectorPanel)).apply(this, arguments)); + } + + babelHelpers.createClass(InspectorPanel, [{ + key: 'renderWaiting', + value: function renderWaiting() { + if (this.props.inspecting) { + return React.createElement( + Text, + { style: styles.waitingText, __source: { + fileName: _jsxFileName, + lineNumber: 30 + } + }, + 'Tap something to inspect it' + ); + } + return React.createElement( + Text, + { style: styles.waitingText, __source: { + fileName: _jsxFileName, + lineNumber: 35 + } + }, + 'Nothing is inspected' + ); + } + }, { + key: 'render', + value: function render() { + var contents = void 0; + if (this.props.inspected) { + contents = React.createElement( + ScrollView, + { style: styles.properties, __source: { + fileName: _jsxFileName, + lineNumber: 42 + } + }, + React.createElement(ElementProperties, { + style: this.props.inspected.style, + frame: this.props.inspected.frame, + source: this.props.inspected.source, + hierarchy: this.props.hierarchy, + selection: this.props.selection, + setSelection: this.props.setSelection, + __source: { + fileName: _jsxFileName, + lineNumber: 43 + } + }) + ); + } else if (this.props.perfing) { + contents = React.createElement(PerformanceOverlay, { + __source: { + fileName: _jsxFileName, + lineNumber: 55 + } + }); + } else if (this.props.networking) { + contents = React.createElement(NetworkOverlay, { + __source: { + fileName: _jsxFileName, + lineNumber: 59 + } + }); + } else { + contents = React.createElement( + View, + { style: styles.waiting, __source: { + fileName: _jsxFileName, + lineNumber: 63 + } + }, + this.renderWaiting() + ); + } + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 69 + } + }, + !this.props.devtoolsIsOpen && contents, + React.createElement( + View, + { style: styles.buttonRow, __source: { + fileName: _jsxFileName, + lineNumber: 71 + } + }, + React.createElement(Button, { + title: 'Inspect', + pressed: this.props.inspecting, + onClick: this.props.setInspecting, + __source: { + fileName: _jsxFileName, + lineNumber: 72 + } + }), + React.createElement(Button, { title: 'Perf', + pressed: this.props.perfing, + onClick: this.props.setPerfing, + __source: { + fileName: _jsxFileName, + lineNumber: 77 + } + }), + React.createElement(Button, { title: 'Network', + pressed: this.props.networking, + onClick: this.props.setNetworking, + __source: { + fileName: _jsxFileName, + lineNumber: 81 + } + }), + React.createElement(Button, { title: 'Touchables', + pressed: this.props.touchTargetting, + onClick: this.props.setTouchTargetting, + __source: { + fileName: _jsxFileName, + lineNumber: 85 + } + }) + ) + ); + } + }]); + return InspectorPanel; +}(React.Component); + +InspectorPanel.propTypes = { + devtoolsIsOpen: PropTypes.bool, + inspecting: PropTypes.bool, + setInspecting: PropTypes.func, + inspected: PropTypes.object, + perfing: PropTypes.bool, + setPerfing: PropTypes.func, + touchTargetting: PropTypes.bool, + setTouchTargetting: PropTypes.func, + networking: PropTypes.bool, + setNetworking: PropTypes.func +}; + +var Button = function (_React$Component2) { + babelHelpers.inherits(Button, _React$Component2); + + function Button() { + babelHelpers.classCallCheck(this, Button); + return babelHelpers.possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments)); + } + + babelHelpers.createClass(Button, [{ + key: 'render', + value: function render() { + var _this3 = this; + + return React.createElement( + TouchableHighlight, + { onPress: function onPress() { + return _this3.props.onClick(!_this3.props.pressed); + }, style: [styles.button, this.props.pressed && styles.buttonPressed], __source: { + fileName: _jsxFileName, + lineNumber: 111 + } + }, + React.createElement( + Text, + { style: styles.buttonText, __source: { + fileName: _jsxFileName, + lineNumber: 115 + } + }, + this.props.title + ) + ); + } + }]); + return Button; +}(React.Component); + +var styles = StyleSheet.create({ + buttonRow: { + flexDirection: 'row' + }, + button: { + backgroundColor: 'rgba(0, 0, 0, 0.3)', + margin: 2, + height: 30, + justifyContent: 'center', + alignItems: 'center' + }, + buttonPressed: { + backgroundColor: 'rgba(255, 255, 255, 0.3)' + }, + buttonText: { + textAlign: 'center', + color: 'white', + margin: 5 + }, + container: { + backgroundColor: 'rgba(0, 0, 0, 0.7)' + }, + properties: { + height: 200 + }, + waiting: { + height: 100 + }, + waitingText: { + fontSize: 20, + textAlign: 'center', + marginVertical: 20, + color: 'white' + } +}); + +module.exports = InspectorPanel; +}, 317, null, "InspectorPanel"); +__d(/* ElementProperties */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/ElementProperties.js'; +var BoxInspector = require(319 ); // 319 = BoxInspector +var React = require(126 ); // 126 = React +var StyleInspector = require(320 ); // 320 = StyleInspector +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var TouchableHighlight = require(321 ); // 321 = TouchableHighlight +var TouchableWithoutFeedback = require(295 ); // 295 = TouchableWithoutFeedback +var View = require(146 ); // 146 = View + +var flattenStyle = require(77 ); // 77 = flattenStyle +var mapWithSeparator = require(324 ); // 324 = mapWithSeparator +var openFileInEditor = require(325 ); // 325 = openFileInEditor + +var PropTypes = React.PropTypes; + +var ElementProperties = function (_React$Component) { + babelHelpers.inherits(ElementProperties, _React$Component); + + function ElementProperties() { + babelHelpers.classCallCheck(this, ElementProperties); + return babelHelpers.possibleConstructorReturn(this, (ElementProperties.__proto__ || Object.getPrototypeOf(ElementProperties)).apply(this, arguments)); + } + + babelHelpers.createClass(ElementProperties, [{ + key: 'render', + value: function render() { + var _this2 = this; + + var style = flattenStyle(this.props.style); + + var selection = this.props.selection; + var openFileButton = void 0; + var source = this.props.source; + + var _ref = source || {}, + fileName = _ref.fileName, + lineNumber = _ref.lineNumber; + + if (fileName && lineNumber) { + var parts = fileName.split('/'); + var fileNameShort = parts[parts.length - 1]; + openFileButton = React.createElement( + TouchableHighlight, + { + style: styles.openButton, + onPress: openFileInEditor.bind(null, fileName, lineNumber), __source: { + fileName: _jsxFileName, + lineNumber: 63 + } + }, + React.createElement( + Text, + { style: styles.openButtonTitle, numberOfLines: 1, __source: { + fileName: _jsxFileName, + lineNumber: 66 + } + }, + fileNameShort, + ':', + lineNumber + ) + ); + } + + return React.createElement( + TouchableWithoutFeedback, + { + __source: { + fileName: _jsxFileName, + lineNumber: 75 + } + }, + React.createElement( + View, + { style: styles.info, __source: { + fileName: _jsxFileName, + lineNumber: 76 + } + }, + React.createElement( + View, + { style: styles.breadcrumb, __source: { + fileName: _jsxFileName, + lineNumber: 77 + } + }, + mapWithSeparator(this.props.hierarchy, function (item, i) { + return React.createElement( + TouchableHighlight, + { + key: 'item-' + i, + style: [styles.breadItem, i === selection && styles.selected], + + onPress: function onPress() { + return _this2.props.setSelection(i); + }, __source: { + fileName: _jsxFileName, + lineNumber: 81 + } + }, + React.createElement( + Text, + { style: styles.breadItemText, __source: { + fileName: _jsxFileName, + lineNumber: 86 + } + }, + getInstanceName(item) + ) + ); + }, function (i) { + return React.createElement( + Text, + { key: 'sep-' + i, style: styles.breadSep, __source: { + fileName: _jsxFileName, + lineNumber: 92 + } + }, + '\u25B8' + ); + }) + ), + React.createElement( + View, + { style: styles.row, __source: { + fileName: _jsxFileName, + lineNumber: 98 + } + }, + React.createElement( + View, + { style: styles.col, __source: { + fileName: _jsxFileName, + lineNumber: 99 + } + }, + React.createElement(StyleInspector, { style: style, __source: { + fileName: _jsxFileName, + lineNumber: 100 + } + }), + openFileButton + ), + React.createElement(BoxInspector, { style: style, frame: this.props.frame, __source: { + fileName: _jsxFileName, + lineNumber: 105 + } + }) + ) + ) + ); + } + }]); + return ElementProperties; +}(React.Component); + +ElementProperties.propTypes = { + hierarchy: PropTypes.array.isRequired, + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), + source: PropTypes.shape({ + fileName: PropTypes.string, + lineNumber: PropTypes.number + }) +}; + + +function getInstanceName(instance) { + if (instance.getName) { + return instance.getName(); + } + if (instance.constructor && instance.constructor.displayName) { + return instance.constructor.displayName; + } + return 'Unknown'; +} + +var styles = StyleSheet.create({ + breadSep: { + fontSize: 8, + color: 'white' + }, + breadcrumb: { + flexDirection: 'row', + flexWrap: 'wrap', + alignItems: 'flex-start', + marginBottom: 5 + }, + selected: { + borderColor: 'white', + borderRadius: 5 + }, + breadItem: { + borderWidth: 1, + borderColor: 'transparent', + marginHorizontal: 2 + }, + breadItemText: { + fontSize: 10, + color: 'white', + marginHorizontal: 5 + }, + row: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between' + }, + col: { + flex: 1 + }, + info: { + padding: 10 + }, + openButton: { + padding: 10, + backgroundColor: '#000', + marginVertical: 5, + marginRight: 5, + borderRadius: 2 + }, + openButtonTitle: { + color: 'white', + fontSize: 8 + } +}); + +module.exports = ElementProperties; +}, 318, null, "ElementProperties"); +__d(/* BoxInspector */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/BoxInspector.js'; +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var View = require(146 ); // 146 = View +var resolveBoxStyle = require(316 ); // 316 = resolveBoxStyle + +var blank = { + top: 0, + left: 0, + right: 0, + bottom: 0 +}; + +var BoxInspector = function (_React$Component) { + babelHelpers.inherits(BoxInspector, _React$Component); + + function BoxInspector() { + babelHelpers.classCallCheck(this, BoxInspector); + return babelHelpers.possibleConstructorReturn(this, (BoxInspector.__proto__ || Object.getPrototypeOf(BoxInspector)).apply(this, arguments)); + } + + babelHelpers.createClass(BoxInspector, [{ + key: 'render', + value: function render() { + var frame = this.props.frame; + var style = this.props.style; + var margin = style && resolveBoxStyle('margin', style) || blank; + var padding = style && resolveBoxStyle('padding', style) || blank; + return React.createElement( + BoxContainer, + { title: 'margin', titleStyle: styles.marginLabel, box: margin, __source: { + fileName: _jsxFileName, + lineNumber: 34 + } + }, + React.createElement( + BoxContainer, + { title: 'padding', box: padding, __source: { + fileName: _jsxFileName, + lineNumber: 35 + } + }, + React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 36 + } + }, + React.createElement( + Text, + { style: styles.innerText, __source: { + fileName: _jsxFileName, + lineNumber: 37 + } + }, + '(', + frame.left, + ', ', + frame.top, + ')' + ), + React.createElement( + Text, + { style: styles.innerText, __source: { + fileName: _jsxFileName, + lineNumber: 40 + } + }, + frame.width, + ' \xD7 ', + frame.height + ) + ) + ) + ); + } + }]); + return BoxInspector; +}(React.Component); + +var BoxContainer = function (_React$Component2) { + babelHelpers.inherits(BoxContainer, _React$Component2); + + function BoxContainer() { + babelHelpers.classCallCheck(this, BoxContainer); + return babelHelpers.possibleConstructorReturn(this, (BoxContainer.__proto__ || Object.getPrototypeOf(BoxContainer)).apply(this, arguments)); + } + + babelHelpers.createClass(BoxContainer, [{ + key: 'render', + value: function render() { + var box = this.props.box; + return React.createElement( + View, + { style: styles.box, __source: { + fileName: _jsxFileName, + lineNumber: 54 + } + }, + React.createElement( + View, + { style: styles.row, __source: { + fileName: _jsxFileName, + lineNumber: 55 + } + }, + React.createElement( + Text, + { style: [this.props.titleStyle, styles.label], __source: { + fileName: _jsxFileName, + lineNumber: 56 + } + }, + this.props.title + ), + React.createElement( + Text, + { style: styles.boxText, __source: { + fileName: _jsxFileName, + lineNumber: 57 + } + }, + box.top + ) + ), + React.createElement( + View, + { style: styles.row, __source: { + fileName: _jsxFileName, + lineNumber: 59 + } + }, + React.createElement( + Text, + { style: styles.boxText, __source: { + fileName: _jsxFileName, + lineNumber: 60 + } + }, + box.left + ), + this.props.children, + React.createElement( + Text, + { style: styles.boxText, __source: { + fileName: _jsxFileName, + lineNumber: 62 + } + }, + box.right + ) + ), + React.createElement( + Text, + { style: styles.boxText, __source: { + fileName: _jsxFileName, + lineNumber: 64 + } + }, + box.bottom + ) + ); + } + }]); + return BoxContainer; +}(React.Component); + +var styles = StyleSheet.create({ + row: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-around' + }, + marginLabel: { + width: 60 + }, + label: { + fontSize: 10, + color: 'rgb(255,100,0)', + marginLeft: 5, + flex: 1, + textAlign: 'left', + top: -3 + }, + buffer: { + fontSize: 10, + color: 'yellow', + flex: 1, + textAlign: 'center' + }, + innerText: { + color: 'yellow', + fontSize: 12, + textAlign: 'center', + width: 70 + }, + box: { + borderWidth: 1, + borderColor: 'grey' + }, + boxText: { + color: 'white', + fontSize: 12, + marginHorizontal: 3, + marginVertical: 2, + textAlign: 'center' + } +}); + +module.exports = BoxInspector; +}, 319, null, "BoxInspector"); +__d(/* StyleInspector */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/StyleInspector.js'; +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var View = require(146 ); // 146 = View + +var StyleInspector = function (_React$Component) { + babelHelpers.inherits(StyleInspector, _React$Component); + + function StyleInspector() { + babelHelpers.classCallCheck(this, StyleInspector); + return babelHelpers.possibleConstructorReturn(this, (StyleInspector.__proto__ || Object.getPrototypeOf(StyleInspector)).apply(this, arguments)); + } + + babelHelpers.createClass(StyleInspector, [{ + key: 'render', + value: function render() { + var _this2 = this; + + if (!this.props.style) { + return React.createElement( + Text, + { style: styles.noStyle, __source: { + fileName: _jsxFileName, + lineNumber: 22 + } + }, + 'No style' + ); + } + var names = Object.keys(this.props.style); + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 26 + } + }, + React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 27 + } + }, + names.map(function (name) { + return React.createElement( + Text, + { key: name, style: styles.attr, __source: { + fileName: _jsxFileName, + lineNumber: 28 + } + }, + name, + ':' + ); + }) + ), + React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 31 + } + }, + names.map(function (name) { + var value = typeof _this2.props.style[name] === 'object' ? JSON.stringify(_this2.props.style[name]) : _this2.props.style[name]; + return React.createElement( + Text, + { key: name, style: styles.value, __source: { + fileName: _jsxFileName, + lineNumber: 34 + } + }, + value + ); + }) + ) + ); + } + }]); + return StyleInspector; +}(React.Component); + +var styles = StyleSheet.create({ + container: { + flexDirection: 'row' + }, + row: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-around' + }, + attr: { + fontSize: 10, + color: '#ccc' + }, + value: { + fontSize: 10, + color: 'white', + marginLeft: 10 + }, + noStyle: { + color: 'white', + fontSize: 10 + } +}); + +module.exports = StyleInspector; +}, 320, null, "StyleInspector"); +__d(/* TouchableHighlight */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Touchable/TouchableHighlight.js'; + + +var ColorPropType = require(71 ); // 71 = ColorPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes +var StyleSheet = require(127 ); // 127 = StyleSheet +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var Touchable = require(211 ); // 211 = Touchable +var TouchableWithoutFeedback = require(295 ); // 295 = TouchableWithoutFeedback +var View = require(146 ); // 146 = View + +var ensureComponentIsNative = require(322 ); // 322 = ensureComponentIsNative +var ensurePositiveDelayProps = require(296 ); // 296 = ensurePositiveDelayProps +var keyOf = require(323 ); // 323 = fbjs/lib/keyOf +var merge = require(149 ); // 149 = merge + +var DEFAULT_PROPS = { + activeOpacity: 0.85, + underlayColor: 'black' +}; + +var PRESS_RETENTION_OFFSET = { top: 20, left: 20, right: 20, bottom: 30 }; + +var TouchableHighlight = React.createClass({ + displayName: 'TouchableHighlight', + + propTypes: babelHelpers.extends({}, TouchableWithoutFeedback.propTypes, { + activeOpacity: React.PropTypes.number, + + underlayColor: ColorPropType, + style: View.propTypes.style, + + onShowUnderlay: React.PropTypes.func, + + onHideUnderlay: React.PropTypes.func, + + hasTVPreferredFocus: React.PropTypes.bool, + + tvParallaxProperties: React.PropTypes.object + + }), + + mixins: [NativeMethodsMixin, TimerMixin, Touchable.Mixin], + + getDefaultProps: function getDefaultProps() { + return DEFAULT_PROPS; + }, + + _computeSyntheticState: function _computeSyntheticState(props) { + return { + activeProps: { + style: { + opacity: props.activeOpacity + } + }, + activeUnderlayProps: { + style: { + backgroundColor: props.underlayColor + } + }, + underlayStyle: [INACTIVE_UNDERLAY_PROPS.style, props.style], + hasTVPreferredFocus: props.hasTVPreferredFocus + }; + }, + + getInitialState: function getInitialState() { + return merge(this.touchableGetInitialState(), this._computeSyntheticState(this.props)); + }, + + componentDidMount: function componentDidMount() { + ensurePositiveDelayProps(this.props); + ensureComponentIsNative(this.refs[CHILD_REF]); + }, + + componentDidUpdate: function componentDidUpdate() { + ensureComponentIsNative(this.refs[CHILD_REF]); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + ensurePositiveDelayProps(nextProps); + if (nextProps.activeOpacity !== this.props.activeOpacity || nextProps.underlayColor !== this.props.underlayColor || nextProps.style !== this.props.style) { + this.setState(this._computeSyntheticState(nextProps)); + } + }, + + viewConfig: { + uiViewClassName: 'RCTView', + validAttributes: ReactNativeViewAttributes.RCTView + }, + + touchableHandleActivePressIn: function touchableHandleActivePressIn(e) { + this.clearTimeout(this._hideTimeout); + this._hideTimeout = null; + this._showUnderlay(); + this.props.onPressIn && this.props.onPressIn(e); + }, + + touchableHandleActivePressOut: function touchableHandleActivePressOut(e) { + if (!this._hideTimeout) { + this._hideUnderlay(); + } + this.props.onPressOut && this.props.onPressOut(e); + }, + + touchableHandlePress: function touchableHandlePress(e) { + this.clearTimeout(this._hideTimeout); + this._showUnderlay(); + this._hideTimeout = this.setTimeout(this._hideUnderlay, this.props.delayPressOut || 100); + this.props.onPress && this.props.onPress(e); + }, + + touchableHandleLongPress: function touchableHandleLongPress(e) { + this.props.onLongPress && this.props.onLongPress(e); + }, + + touchableGetPressRectOffset: function touchableGetPressRectOffset() { + return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET; + }, + + touchableGetHitSlop: function touchableGetHitSlop() { + return this.props.hitSlop; + }, + + touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() { + return this.props.delayPressIn; + }, + + touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() { + return this.props.delayLongPress; + }, + + touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() { + return this.props.delayPressOut; + }, + + _showUnderlay: function _showUnderlay() { + if (!this.isMounted() || !this._hasPressHandler()) { + return; + } + + this.refs[UNDERLAY_REF].setNativeProps(this.state.activeUnderlayProps); + this.refs[CHILD_REF].setNativeProps(this.state.activeProps); + this.props.onShowUnderlay && this.props.onShowUnderlay(); + }, + + _hideUnderlay: function _hideUnderlay() { + this.clearTimeout(this._hideTimeout); + this._hideTimeout = null; + if (this._hasPressHandler() && this.refs[UNDERLAY_REF]) { + this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS); + this.refs[UNDERLAY_REF].setNativeProps(babelHelpers.extends({}, INACTIVE_UNDERLAY_PROPS, { + style: this.state.underlayStyle + })); + this.props.onHideUnderlay && this.props.onHideUnderlay(); + } + }, + + _hasPressHandler: function _hasPressHandler() { + return !!(this.props.onPress || this.props.onPressIn || this.props.onPressOut || this.props.onLongPress); + }, + + render: function render() { + return React.createElement( + View, + { + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityComponentType: this.props.accessibilityComponentType, + accessibilityTraits: this.props.accessibilityTraits, + ref: UNDERLAY_REF, + style: this.state.underlayStyle, + onLayout: this.props.onLayout, + hitSlop: this.props.hitSlop, + isTVSelectable: true, + tvParallaxProperties: this.props.tvParallaxProperties, + hasTVPreferredFocus: this.state.hasTVPreferredFocus, + onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, + onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest, + onResponderGrant: this.touchableHandleResponderGrant, + onResponderMove: this.touchableHandleResponderMove, + onResponderRelease: this.touchableHandleResponderRelease, + onResponderTerminate: this.touchableHandleResponderTerminate, + testID: this.props.testID, __source: { + fileName: _jsxFileName, + lineNumber: 248 + } + }, + React.cloneElement(React.Children.only(this.props.children), { + ref: CHILD_REF + }), + Touchable.renderDebugView({ color: 'green', hitSlop: this.props.hitSlop }) + ); + } +}); + +var CHILD_REF = keyOf({ childRef: null }); +var UNDERLAY_REF = keyOf({ underlayRef: null }); +var INACTIVE_CHILD_PROPS = { + style: StyleSheet.create({ x: { opacity: 1.0 } }).x +}; +var INACTIVE_UNDERLAY_PROPS = { + style: StyleSheet.create({ x: { backgroundColor: 'transparent' } }).x +}; + +module.exports = TouchableHighlight; +}, 321, null, "TouchableHighlight"); +__d(/* ensureComponentIsNative */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var ensureComponentIsNative = function ensureComponentIsNative(component) { + invariant(component && typeof component.setNativeProps === 'function', 'Touchable child must either be native or forward setNativeProps to a ' + 'native component'); +}; + +module.exports = ensureComponentIsNative; +}, 322, null, "ensureComponentIsNative"); +__d(/* fbjs/lib/keyOf.js */function(global, require, module, exports) {"use strict"; + +var keyOf = function keyOf(oneKeyObj) { + var key; + for (key in oneKeyObj) { + if (!oneKeyObj.hasOwnProperty(key)) { + continue; + } + return key; + } + return null; +}; + +module.exports = keyOf; +}, 323, null, "fbjs/lib/keyOf.js"); +__d(/* mapWithSeparator */function(global, require, module, exports) { +'use strict'; + +function mapWithSeparator(items, itemRenderer, spacerRenderer) { + var mapped = []; + if (items.length > 0) { + mapped.push(itemRenderer(items[0], 0, items)); + for (var ii = 1; ii < items.length; ii++) { + mapped.push(spacerRenderer(ii - 1), itemRenderer(items[ii], ii, items)); + } + } + return mapped; +} + +module.exports = mapWithSeparator; +}, 324, null, "mapWithSeparator"); +__d(/* openFileInEditor */function(global, require, module, exports) { +'use strict'; + +var getDevServer = require(246 ); // 246 = getDevServer + +function openFileInEditor(file, lineNumber) { + fetch(getDevServer().url + 'open-stack-frame', { + method: 'POST', + body: JSON.stringify({ file: file, lineNumber: lineNumber }) + }); +} + +module.exports = openFileInEditor; +}, 325, null, "openFileInEditor"); +__d(/* NetworkOverlay */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/NetworkOverlay.js'; +var ListView = require(303 ); // 303 = ListView +var React = require(126 ); // 126 = React +var ScrollView = require(239 ); // 239 = ScrollView +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var TouchableHighlight = require(321 ); // 321 = TouchableHighlight +var View = require(146 ); // 146 = View +var WebSocketInterceptor = require(327 ); // 327 = WebSocketInterceptor +var XHRInterceptor = require(328 ); // 328 = XHRInterceptor + +var LISTVIEW_CELL_HEIGHT = 15; +var SEPARATOR_THICKNESS = 2; + +var nextXHRId = 0; + +var NetworkOverlay = function (_React$Component) { + babelHelpers.inherits(NetworkOverlay, _React$Component); + + function NetworkOverlay(props) { + babelHelpers.classCallCheck(this, NetworkOverlay); + + var _this = babelHelpers.possibleConstructorReturn(this, (NetworkOverlay.__proto__ || Object.getPrototypeOf(NetworkOverlay)).call(this, props)); + + _this._requests = []; + _this._detailViewItems = []; + _this._listViewDataSource = new ListView.DataSource({ rowHasChanged: function rowHasChanged(r1, r2) { + return r1 !== r2; + } }); + _this.state = { + dataSource: _this._listViewDataSource.cloneWithRows([]), + newDetailInfo: false, + detailRowID: null + }; + _this._listViewHighlighted = false; + _this._listViewHeight = 0; + _this._captureRequestListView = _this._captureRequestListView.bind(_this); + _this._captureDetailScrollView = _this._captureDetailScrollView.bind(_this); + _this._listViewOnLayout = _this._listViewOnLayout.bind(_this); + _this._renderRow = _this._renderRow.bind(_this); + _this._renderScrollComponent = _this._renderScrollComponent.bind(_this); + _this._closeButtonClicked = _this._closeButtonClicked.bind(_this); + _this._socketIdMap = {}; + _this._xhrIdMap = {}; + return _this; + } + + babelHelpers.createClass(NetworkOverlay, [{ + key: '_enableXHRInterception', + value: function _enableXHRInterception() { + var _this2 = this; + + if (XHRInterceptor.isInterceptorEnabled()) { + return; + } + + XHRInterceptor.setOpenCallback(function (method, url, xhr) { + xhr._index = nextXHRId++; + var xhrIndex = _this2._requests.length; + _this2._xhrIdMap[xhr._index] = xhrIndex; + + var _xhr = { + 'type': 'XMLHttpRequest', + 'method': method, + 'url': url + }; + _this2._requests.push(_xhr); + _this2._detailViewItems.push([]); + _this2._genDetailViewItem(xhrIndex); + _this2.setState({ dataSource: _this2._listViewDataSource.cloneWithRows(_this2._requests) }, _this2._scrollToBottom()); + }); + + XHRInterceptor.setRequestHeaderCallback(function (header, value, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + var networkInfo = _this2._requests[xhrIndex]; + if (!networkInfo.requestHeaders) { + networkInfo.requestHeaders = {}; + } + networkInfo.requestHeaders[header] = value; + _this2._genDetailViewItem(xhrIndex); + }); + + XHRInterceptor.setSendCallback(function (data, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + _this2._requests[xhrIndex].dataSent = data; + _this2._genDetailViewItem(xhrIndex); + }); + + XHRInterceptor.setHeaderReceivedCallback(function (type, size, responseHeaders, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + var networkInfo = _this2._requests[xhrIndex]; + networkInfo.responseContentType = type; + networkInfo.responseSize = size; + networkInfo.responseHeaders = responseHeaders; + _this2._genDetailViewItem(xhrIndex); + }); + + XHRInterceptor.setResponseCallback(function (status, timeout, response, responseURL, responseType, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + var networkInfo = _this2._requests[xhrIndex]; + networkInfo.status = status; + networkInfo.timeout = timeout; + networkInfo.response = response; + networkInfo.responseURL = responseURL; + networkInfo.responseType = responseType; + _this2._genDetailViewItem(xhrIndex); + }); + + XHRInterceptor.enableInterception(); + } + }, { + key: '_enableWebSocketInterception', + value: function _enableWebSocketInterception() { + var _this3 = this; + + if (WebSocketInterceptor.isInterceptorEnabled()) { + return; + } + + WebSocketInterceptor.setConnectCallback(function (url, protocols, options, socketId) { + var socketIndex = _this3._requests.length; + _this3._socketIdMap[socketId] = socketIndex; + var _webSocket = { + 'type': 'WebSocket', + 'url': url, + 'protocols': protocols + }; + _this3._requests.push(_webSocket); + _this3._detailViewItems.push([]); + _this3._genDetailViewItem(socketIndex); + _this3.setState({ dataSource: _this3._listViewDataSource.cloneWithRows(_this3._requests) }, _this3._scrollToBottom()); + }); + + WebSocketInterceptor.setCloseCallback(function (statusCode, closeReason, socketId) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + if (statusCode !== null && closeReason !== null) { + _this3._requests[socketIndex].status = statusCode; + _this3._requests[socketIndex].closeReason = closeReason; + } + _this3._genDetailViewItem(socketIndex); + }); + + WebSocketInterceptor.setSendCallback(function (data, socketId) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + if (!_this3._requests[socketIndex].messages) { + _this3._requests[socketIndex].messages = ''; + } + _this3._requests[socketIndex].messages += 'Sent: ' + JSON.stringify(data) + '\n'; + _this3._genDetailViewItem(socketIndex); + }); + + WebSocketInterceptor.setOnMessageCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + if (!_this3._requests[socketIndex].messages) { + _this3._requests[socketIndex].messages = ''; + } + _this3._requests[socketIndex].messages += 'Received: ' + JSON.stringify(message) + '\n'; + _this3._genDetailViewItem(socketIndex); + }); + + WebSocketInterceptor.setOnCloseCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3._requests[socketIndex].serverClose = message; + _this3._genDetailViewItem(socketIndex); + }); + + WebSocketInterceptor.setOnErrorCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3._requests[socketIndex].serverError = message; + _this3._genDetailViewItem(socketIndex); + }); + + WebSocketInterceptor.enableInterception(); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this._enableXHRInterception(); + this._enableWebSocketInterception(); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + XHRInterceptor.disableInterception(); + WebSocketInterceptor.disableInterception(); + } + }, { + key: '_renderRow', + value: function _renderRow(rowData, sectionID, rowID, highlightRow) { + var _this4 = this; + + var urlCellViewStyle = styles.urlEvenCellView; + var methodCellViewStyle = styles.methodEvenCellView; + if (rowID % 2 === 1) { + urlCellViewStyle = styles.urlOddCellView; + methodCellViewStyle = styles.methodOddCellView; + } + return React.createElement( + TouchableHighlight, + { onPress: function onPress() { + _this4._pressRow(rowID); + highlightRow(sectionID, rowID); + }, __source: { + fileName: _jsxFileName, + lineNumber: 304 + } + }, + React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 308 + } + }, + React.createElement( + View, + { style: styles.tableRow, __source: { + fileName: _jsxFileName, + lineNumber: 309 + } + }, + React.createElement( + View, + { style: urlCellViewStyle, __source: { + fileName: _jsxFileName, + lineNumber: 310 + } + }, + React.createElement( + Text, + { style: styles.cellText, numberOfLines: 1, __source: { + fileName: _jsxFileName, + lineNumber: 311 + } + }, + rowData.url + ) + ), + React.createElement( + View, + { style: methodCellViewStyle, __source: { + fileName: _jsxFileName, + lineNumber: 315 + } + }, + React.createElement( + Text, + { style: styles.cellText, numberOfLines: 1, __source: { + fileName: _jsxFileName, + lineNumber: 316 + } + }, + this._getTypeShortName(rowData.type) + ) + ) + ) + ) + ); + } + }, { + key: '_renderSeperator', + value: function _renderSeperator(sectionID, rowID, adjacentRowHighlighted) { + return React.createElement(View, { + key: sectionID + '-' + rowID, + style: { + height: adjacentRowHighlighted ? SEPARATOR_THICKNESS : 0, + backgroundColor: adjacentRowHighlighted ? '#3B5998' : '#CCCCCC' + }, + __source: { + fileName: _jsxFileName, + lineNumber: 331 + } + }); + } + }, { + key: '_scrollToBottom', + value: function _scrollToBottom() { + if (this._listView) { + var scrollResponder = this._listView.getScrollResponder(); + if (scrollResponder) { + var scrollY = Math.max(this._requests.length * LISTVIEW_CELL_HEIGHT + (this._listViewHighlighted ? 2 * SEPARATOR_THICKNESS : 0) - this._listViewHeight, 0); + scrollResponder.scrollResponderScrollTo({ + x: 0, + y: scrollY, + animated: true + }); + } + } + } + }, { + key: '_captureRequestListView', + value: function _captureRequestListView(listRef) { + this._listView = listRef; + } + }, { + key: '_listViewOnLayout', + value: function _listViewOnLayout(event) { + var height = event.nativeEvent.layout.height; + + this._listViewHeight = height; + } + }, { + key: '_pressRow', + value: function _pressRow(rowID) { + this._listViewHighlighted = true; + this.setState({ detailRowID: rowID }, this._scrollToTop()); + } + }, { + key: '_scrollToTop', + value: function _scrollToTop() { + if (this._scrollView) { + this._scrollView.scrollTo({ + y: 0, + animated: false + }); + } + } + }, { + key: '_captureDetailScrollView', + value: function _captureDetailScrollView(scrollRef) { + this._scrollView = scrollRef; + } + }, { + key: '_closeButtonClicked', + value: function _closeButtonClicked() { + this.setState({ detailRowID: null }); + } + }, { + key: '_getStringByValue', + value: function _getStringByValue(value) { + if (value === undefined) { + return 'undefined'; + } + if (typeof value === 'object') { + return JSON.stringify(value); + } + if (typeof value === 'string' && value.length > 500) { + return String(value).substr(0, 500).concat('\n***TRUNCATED TO 500 CHARACTERS***'); + } + return value; + } + }, { + key: '_getRequestIndexByXHRID', + value: function _getRequestIndexByXHRID(index) { + if (index === undefined) { + return -1; + } + var xhrIndex = this._xhrIdMap[index]; + if (xhrIndex === undefined) { + return -1; + } else { + return xhrIndex; + } + } + }, { + key: '_getTypeShortName', + value: function _getTypeShortName(type) { + if (type === 'XMLHttpRequest') { + return 'XHR'; + } else if (type === 'WebSocket') { + return 'WS'; + } + + return ''; + } + }, { + key: '_genDetailViewItem', + value: function _genDetailViewItem(index) { + this._detailViewItems[index] = []; + var detailViewItem = this._detailViewItems[index]; + var requestItem = this._requests[index]; + for (var _key in requestItem) { + detailViewItem.push(React.createElement( + View, + { style: styles.detailViewRow, key: _key, __source: { + fileName: _jsxFileName, + lineNumber: 446 + } + }, + React.createElement( + Text, + { style: [styles.detailViewText, styles.detailKeyCellView], __source: { + fileName: _jsxFileName, + lineNumber: 447 + } + }, + _key + ), + React.createElement( + Text, + { style: [styles.detailViewText, styles.detailValueCellView], __source: { + fileName: _jsxFileName, + lineNumber: 450 + } + }, + this._getStringByValue(requestItem[_key]) + ) + )); + } + + if (this.state.detailRowID != null && Number(this.state.detailRowID) === index) { + this.setState({ newDetailInfo: true }); + } + } + }, { + key: 'render', + value: function render() { + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 465 + } + }, + this.state.detailRowID != null && React.createElement( + TouchableHighlight, + { + style: styles.closeButton, + onPress: this._closeButtonClicked, __source: { + fileName: _jsxFileName, + lineNumber: 467 + } + }, + React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 470 + } + }, + React.createElement( + Text, + { style: styles.clostButtonText, __source: { + fileName: _jsxFileName, + lineNumber: 471 + } + }, + 'v' + ) + ) + ), + this.state.detailRowID != null && React.createElement( + ScrollView, + { + style: styles.detailScrollView, + ref: this._captureDetailScrollView, __source: { + fileName: _jsxFileName, + lineNumber: 475 + } + }, + this._detailViewItems[this.state.detailRowID] + ), + React.createElement( + View, + { style: styles.listViewTitle, __source: { + fileName: _jsxFileName, + lineNumber: 480 + } + }, + this._requests.length > 0 && React.createElement( + View, + { style: styles.tableRow, __source: { + fileName: _jsxFileName, + lineNumber: 482 + } + }, + React.createElement( + View, + { style: styles.urlTitleCellView, __source: { + fileName: _jsxFileName, + lineNumber: 483 + } + }, + React.createElement( + Text, + { style: styles.cellText, numberOfLines: 1, __source: { + fileName: _jsxFileName, + lineNumber: 484 + } + }, + 'URL' + ) + ), + React.createElement( + View, + { style: styles.methodTitleCellView, __source: { + fileName: _jsxFileName, + lineNumber: 486 + } + }, + React.createElement( + Text, + { style: styles.cellText, numberOfLines: 1, __source: { + fileName: _jsxFileName, + lineNumber: 487 + } + }, + 'Type' + ) + ) + ) + ), + React.createElement(ListView, { + style: styles.listView, + ref: this._captureRequestListView, + dataSource: this.state.dataSource, + renderRow: this._renderRow, + enableEmptySections: true, + renderSeparator: this._renderSeperator, + onLayout: this._listViewOnLayout, + __source: { + fileName: _jsxFileName, + lineNumber: 491 + } + }) + ); + } + }]); + return NetworkOverlay; +}(React.Component); + +var styles = StyleSheet.create({ + container: { + paddingTop: 10, + paddingBottom: 10, + paddingLeft: 5, + paddingRight: 5 + }, + listViewTitle: { + height: 20 + }, + listView: { + flex: 1, + height: 60 + }, + tableRow: { + flexDirection: 'row', + flex: 1 + }, + cellText: { + color: 'white', + fontSize: 12 + }, + methodTitleCellView: { + height: 18, + borderColor: '#DCD7CD', + borderTopWidth: 1, + borderBottomWidth: 1, + borderRightWidth: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#444', + flex: 1 + }, + urlTitleCellView: { + height: 18, + borderColor: '#DCD7CD', + borderTopWidth: 1, + borderBottomWidth: 1, + borderLeftWidth: 1, + borderRightWidth: 1, + justifyContent: 'center', + backgroundColor: '#444', + flex: 5, + paddingLeft: 3 + }, + methodOddCellView: { + height: 15, + borderColor: '#DCD7CD', + borderRightWidth: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#000', + flex: 1 + }, + urlOddCellView: { + height: 15, + borderColor: '#DCD7CD', + borderLeftWidth: 1, + borderRightWidth: 1, + justifyContent: 'center', + backgroundColor: '#000', + flex: 5, + paddingLeft: 3 + }, + methodEvenCellView: { + height: 15, + borderColor: '#DCD7CD', + borderRightWidth: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#888', + flex: 1 + }, + urlEvenCellView: { + height: 15, + borderColor: '#DCD7CD', + borderLeftWidth: 1, + borderRightWidth: 1, + justifyContent: 'center', + backgroundColor: '#888', + flex: 5, + paddingLeft: 3 + }, + detailScrollView: { + flex: 1, + height: 180, + marginTop: 5, + marginBottom: 5 + }, + detailKeyCellView: { + flex: 1.3 + }, + detailValueCellView: { + flex: 2 + }, + detailViewRow: { + flexDirection: 'row', + paddingHorizontal: 3 + }, + detailViewText: { + color: 'white', + fontSize: 11 + }, + clostButtonText: { + color: 'white', + fontSize: 10 + }, + closeButton: { + marginTop: 5, + backgroundColor: '#888', + justifyContent: 'center', + alignItems: 'center' + } +}); + +module.exports = NetworkOverlay; +}, 326, null, "NetworkOverlay"); +__d(/* WebSocketInterceptor */function(global, require, module, exports) { +'use strict'; + +var RCTWebSocketModule = require(80 ).WebSocketModule; // 80 = NativeModules +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter + +var base64 = require(115 ); // 115 = base64-js + +var originalRCTWebSocketConnect = RCTWebSocketModule.connect; +var originalRCTWebSocketSend = RCTWebSocketModule.send; +var originalRCTWebSocketSendBinary = RCTWebSocketModule.sendBinary; +var originalRCTWebSocketClose = RCTWebSocketModule.close; + +var eventEmitter = void 0; +var subscriptions = void 0; + +var closeCallback = void 0; +var sendCallback = void 0; +var connectCallback = void 0; +var onOpenCallback = void 0; +var onMessageCallback = void 0; +var onErrorCallback = void 0; +var onCloseCallback = void 0; + +var _isInterceptorEnabled = false; + +var WebSocketInterceptor = { + setCloseCallback: function setCloseCallback(callback) { + closeCallback = callback; + }, + setSendCallback: function setSendCallback(callback) { + sendCallback = callback; + }, + setConnectCallback: function setConnectCallback(callback) { + connectCallback = callback; + }, + setOnOpenCallback: function setOnOpenCallback(callback) { + onOpenCallback = callback; + }, + setOnMessageCallback: function setOnMessageCallback(callback) { + onMessageCallback = callback; + }, + setOnErrorCallback: function setOnErrorCallback(callback) { + onErrorCallback = callback; + }, + setOnCloseCallback: function setOnCloseCallback(callback) { + onCloseCallback = callback; + }, + isInterceptorEnabled: function isInterceptorEnabled() { + return _isInterceptorEnabled; + }, + _unregisterEvents: function _unregisterEvents() { + subscriptions.forEach(function (e) { + return e.remove(); + }); + subscriptions = []; + }, + _registerEvents: function _registerEvents() { + subscriptions = [eventEmitter.addListener('websocketMessage', function (ev) { + if (onMessageCallback) { + onMessageCallback(ev.id, ev.type === 'binary' ? WebSocketInterceptor._arrayBufferToString(ev.data) : ev.data); + } + }), eventEmitter.addListener('websocketOpen', function (ev) { + if (onOpenCallback) { + onOpenCallback(ev.id); + } + }), eventEmitter.addListener('websocketClosed', function (ev) { + if (onCloseCallback) { + onCloseCallback(ev.id, { code: ev.code, reason: ev.reason }); + } + }), eventEmitter.addListener('websocketFailed', function (ev) { + if (onErrorCallback) { + onErrorCallback(ev.id, { message: ev.message }); + } + })]; + }, + enableInterception: function enableInterception() { + if (_isInterceptorEnabled) { + return; + } + eventEmitter = new NativeEventEmitter(RCTWebSocketModule); + WebSocketInterceptor._registerEvents(); + + RCTWebSocketModule.connect = function (url, protocols, options, socketId) { + if (connectCallback) { + connectCallback(url, protocols, options, socketId); + } + originalRCTWebSocketConnect.apply(this, arguments); + }; + + RCTWebSocketModule.send = function (data, socketId) { + if (sendCallback) { + sendCallback(data, socketId); + } + originalRCTWebSocketSend.apply(this, arguments); + }; + + RCTWebSocketModule.sendBinary = function (data, socketId) { + if (sendCallback) { + sendCallback(WebSocketInterceptor._arrayBufferToString(data), socketId); + } + originalRCTWebSocketSendBinary.apply(this, arguments); + }; + + RCTWebSocketModule.close = function () { + if (closeCallback) { + if (arguments.length === 3) { + closeCallback(arguments[0], arguments[1], arguments[2]); + } else { + closeCallback(null, null, arguments[0]); + } + } + originalRCTWebSocketClose.apply(this, arguments); + }; + + _isInterceptorEnabled = true; + }, + _arrayBufferToString: function _arrayBufferToString(data) { + var value = base64.toByteArray(data).buffer; + if (value === undefined || value === null) { + return '(no value)'; + } + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && value instanceof ArrayBuffer) { + return 'ArrayBuffer {' + String(Array.from(new Uint8Array(value))) + '}'; + } + return value; + }, + disableInterception: function disableInterception() { + if (!_isInterceptorEnabled) { + return; + } + _isInterceptorEnabled = false; + RCTWebSocketModule.send = originalRCTWebSocketSend; + RCTWebSocketModule.sendBinary = originalRCTWebSocketSendBinary; + RCTWebSocketModule.close = originalRCTWebSocketClose; + RCTWebSocketModule.connect = originalRCTWebSocketConnect; + + connectCallback = null; + closeCallback = null; + sendCallback = null; + onOpenCallback = null; + onMessageCallback = null; + onCloseCallback = null; + onErrorCallback = null; + + WebSocketInterceptor._unregisterEvents(); + } +}; + +module.exports = WebSocketInterceptor; +}, 327, null, "WebSocketInterceptor"); +__d(/* XHRInterceptor */function(global, require, module, exports) { +'use strict'; + +var XMLHttpRequest = require(259 ); // 259 = XMLHttpRequest +var originalXHROpen = XMLHttpRequest.prototype.open; +var originalXHRSend = XMLHttpRequest.prototype.send; +var originalXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader; + +var openCallback; +var sendCallback; +var requestHeaderCallback; +var headerReceivedCallback; +var responseCallback; + +var _isInterceptorEnabled = false; + +var XHRInterceptor = { + setOpenCallback: function setOpenCallback(callback) { + openCallback = callback; + }, + setSendCallback: function setSendCallback(callback) { + sendCallback = callback; + }, + setHeaderReceivedCallback: function setHeaderReceivedCallback(callback) { + headerReceivedCallback = callback; + }, + setResponseCallback: function setResponseCallback(callback) { + responseCallback = callback; + }, + setRequestHeaderCallback: function setRequestHeaderCallback(callback) { + requestHeaderCallback = callback; + }, + isInterceptorEnabled: function isInterceptorEnabled() { + return _isInterceptorEnabled; + }, + enableInterception: function enableInterception() { + if (_isInterceptorEnabled) { + return; + } + + XMLHttpRequest.prototype.open = function (method, url) { + if (openCallback) { + openCallback(method, url, this); + } + originalXHROpen.apply(this, arguments); + }; + + XMLHttpRequest.prototype.setRequestHeader = function (header, value) { + if (requestHeaderCallback) { + requestHeaderCallback(header, value, this); + } + originalXHRSetRequestHeader.apply(this, arguments); + }; + + XMLHttpRequest.prototype.send = function (data) { + var _this = this; + + if (sendCallback) { + sendCallback(data, this); + } + if (this.addEventListener) { + this.addEventListener('readystatechange', function () { + if (!_isInterceptorEnabled) { + return; + } + if (_this.readyState === _this.HEADERS_RECEIVED) { + var contentTypeString = _this.getResponseHeader('Content-Type'); + var contentLengthString = _this.getResponseHeader('Content-Length'); + var responseContentType = void 0, + responseSize = void 0; + if (contentTypeString) { + responseContentType = contentTypeString.split(';')[0]; + } + if (contentLengthString) { + responseSize = parseInt(contentLengthString, 10); + } + if (headerReceivedCallback) { + headerReceivedCallback(responseContentType, responseSize, _this.getAllResponseHeaders(), _this); + } + } + if (_this.readyState === _this.DONE) { + if (responseCallback) { + responseCallback(_this.status, _this.timeout, _this.response, _this.responseURL, _this.responseType, _this); + } + } + }, false); + } + originalXHRSend.apply(this, arguments); + }; + _isInterceptorEnabled = true; + }, + disableInterception: function disableInterception() { + if (!_isInterceptorEnabled) { + return; + } + _isInterceptorEnabled = false; + XMLHttpRequest.prototype.send = originalXHRSend; + XMLHttpRequest.prototype.open = originalXHROpen; + XMLHttpRequest.prototype.setRequestHeader = originalXHRSetRequestHeader; + responseCallback = null; + openCallback = null; + sendCallback = null; + headerReceivedCallback = null; + requestHeaderCallback = null; + } +}; + +module.exports = XHRInterceptor; +}, 328, null, "XHRInterceptor"); +__d(/* PerformanceOverlay */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Inspector/PerformanceOverlay.js'; +var PerformanceLogger = require(273 ); // 273 = PerformanceLogger +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var View = require(146 ); // 146 = View + +var PerformanceOverlay = function (_React$Component) { + babelHelpers.inherits(PerformanceOverlay, _React$Component); + + function PerformanceOverlay() { + babelHelpers.classCallCheck(this, PerformanceOverlay); + return babelHelpers.possibleConstructorReturn(this, (PerformanceOverlay.__proto__ || Object.getPrototypeOf(PerformanceOverlay)).apply(this, arguments)); + } + + babelHelpers.createClass(PerformanceOverlay, [{ + key: 'render', + value: function render() { + var perfLogs = PerformanceLogger.getTimespans(); + var items = []; + + for (var key in perfLogs) { + if (perfLogs[key].totalTime) { + var unit = key === 'BundleSize' ? 'b' : 'ms'; + items.push(React.createElement( + View, + { style: styles.row, key: key, __source: { + fileName: _jsxFileName, + lineNumber: 29 + } + }, + React.createElement( + Text, + { style: [styles.text, styles.label], __source: { + fileName: _jsxFileName, + lineNumber: 30 + } + }, + key + ), + React.createElement( + Text, + { style: [styles.text, styles.totalTime], __source: { + fileName: _jsxFileName, + lineNumber: 31 + } + }, + perfLogs[key].totalTime + unit + ) + )); + } + } + + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 40 + } + }, + items + ); + } + }]); + return PerformanceOverlay; +}(React.Component); + +var styles = StyleSheet.create({ + container: { + height: 100, + paddingTop: 10 + }, + label: { + flex: 1 + }, + row: { + flexDirection: 'row', + paddingHorizontal: 10 + }, + text: { + color: 'white', + fontSize: 12 + }, + totalTime: { + paddingRight: 100 + } +}); + +module.exports = PerformanceOverlay; +}, 329, null, "PerformanceOverlay"); +__d(/* YellowBox */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/ReactNative/YellowBox.js'; +var EventEmitter = require(103 ); // 103 = EventEmitter +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet + +var infoLog = require(229 ); // 229 = infoLog +var openFileInEditor = require(325 ); // 325 = openFileInEditor +var parseErrorStack = require(93 ); // 93 = parseErrorStack +var symbolicateStackTrace = require(245 ); // 245 = symbolicateStackTrace + +var _warningEmitter = new EventEmitter(); +var _warningMap = new Map(); + +if (__DEV__) { + var _console = console, + error = _console.error, + warn = _console.warn; + + + console.error = function () { + error.apply(console, arguments); + + if (typeof arguments[0] === 'string' && arguments[0].startsWith('Warning: ')) { + updateWarningMap.apply(null, arguments); + } + }; + + console.warn = function () { + warn.apply(console, arguments); + + if (typeof arguments[0] === 'string' && arguments[0].startsWith('(ADVICE)')) { + return; + } + + updateWarningMap.apply(null, arguments); + }; + + if (Platform.isTesting) { + console.disableYellowBox = true; + } +} + +function sprintf(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var index = 0; + return format.replace(/%s/g, function (match) { + return args[index++]; + }); +} + +function updateWarningMap(format) { + if (console.disableYellowBox) { + return; + } + var stringifySafe = require(97 ); // 97 = stringifySafe + + format = String(format); + var argCount = (format.match(/%s/g) || []).length; + + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + var warning = [sprintf.apply(undefined, [format].concat(babelHelpers.toConsumableArray(args.slice(0, argCount))))].concat(babelHelpers.toConsumableArray(args.slice(argCount).map(stringifySafe))).join(' '); + + var warningInfo = _warningMap.get(warning); + if (warningInfo) { + warningInfo.count += 1; + } else { + var _error = new Error(); + _error.framesToPop = 2; + + _warningMap.set(warning, { + count: 1, + stacktrace: parseErrorStack(_error), + symbolicated: false + }); + } + + _warningEmitter.emit('warning', _warningMap); +} + +function ensureSymbolicatedWarning(warning) { + var prevWarningInfo = _warningMap.get(warning); + if (!prevWarningInfo || prevWarningInfo.symbolicated) { + return; + } + prevWarningInfo.symbolicated = true; + + symbolicateStackTrace(prevWarningInfo.stacktrace).then(function (stack) { + var nextWarningInfo = _warningMap.get(warning); + if (nextWarningInfo) { + nextWarningInfo.stacktrace = stack; + _warningEmitter.emit('warning', _warningMap); + } + }, function (error) { + var nextWarningInfo = _warningMap.get(warning); + if (nextWarningInfo) { + infoLog('Failed to symbolicate warning, "%s":', warning, error); + _warningEmitter.emit('warning', _warningMap); + } + }); +} + +function isWarningIgnored(warning) { + return Array.isArray(console.ignoredYellowBox) && console.ignoredYellowBox.some(function (ignorePrefix) { + return warning.startsWith(String(ignorePrefix)); + }); +} + +var WarningRow = function WarningRow(_ref) { + var count = _ref.count, + warning = _ref.warning, + onPress = _ref.onPress; + + var Text = require(210 ); // 210 = Text + var TouchableHighlight = require(321 ); // 321 = TouchableHighlight + var View = require(146 ); // 146 = View + + var countText = count > 1 ? React.createElement( + Text, + { style: styles.listRowCount, __source: { + fileName: _jsxFileName, + lineNumber: 170 + } + }, + '(' + count + ') ' + ) : null; + + return React.createElement( + View, + { style: styles.listRow, __source: { + fileName: _jsxFileName, + lineNumber: 174 + } + }, + React.createElement( + TouchableHighlight, + { + activeOpacity: 0.5, + onPress: onPress, + style: styles.listRowContent, + underlayColor: 'transparent', __source: { + fileName: _jsxFileName, + lineNumber: 175 + } + }, + React.createElement( + Text, + { style: styles.listRowText, numberOfLines: 2, __source: { + fileName: _jsxFileName, + lineNumber: 180 + } + }, + countText, + warning + ) + ) + ); +}; + +var StackRow = function StackRow(_ref2) { + var frame = _ref2.frame; + + var Text = require(210 ); // 210 = Text + var TouchableHighlight = require(321 ); // 321 = TouchableHighlight + var file = frame.file, + lineNumber = frame.lineNumber; + + var fileParts = file.split('/'); + var fileName = fileParts[fileParts.length - 1]; + + return React.createElement( + TouchableHighlight, + { + activeOpacity: 0.5, + style: styles.openInEditorButton, + underlayColor: 'transparent', + onPress: openFileInEditor.bind(null, file, lineNumber), __source: { + fileName: _jsxFileName, + lineNumber: 198 + } + }, + React.createElement( + Text, + { style: styles.inspectorCountText, __source: { + fileName: _jsxFileName, + lineNumber: 203 + } + }, + fileName, + ':', + lineNumber + ) + ); +}; + +var WarningInspector = function WarningInspector(_ref3) { + var warningInfo = _ref3.warningInfo, + warning = _ref3.warning, + stacktraceVisible = _ref3.stacktraceVisible, + onDismiss = _ref3.onDismiss, + onDismissAll = _ref3.onDismissAll, + onMinimize = _ref3.onMinimize, + toggleStacktrace = _ref3.toggleStacktrace; + + var ScrollView = require(239 ); // 239 = ScrollView + var Text = require(210 ); // 210 = Text + var TouchableHighlight = require(321 ); // 321 = TouchableHighlight + var View = require(146 ); // 146 = View + + var _ref4 = warningInfo || {}, + count = _ref4.count, + stacktrace = _ref4.stacktrace; + + var countSentence = 'Warning encountered ' + count + ' time' + (count - 1 ? 's' : '') + '.'; + + var stacktraceList = void 0; + if (stacktraceVisible && stacktrace) { + stacktraceList = React.createElement( + View, + { style: styles.stacktraceList, __source: { + fileName: _jsxFileName, + lineNumber: 231 + } + }, + stacktrace.map(function (frame, ii) { + return React.createElement(StackRow, { frame: frame, key: ii, __source: { + fileName: _jsxFileName, + lineNumber: 232 + } + }); + }) + ); + } + + return React.createElement( + View, + { style: styles.inspector, __source: { + fileName: _jsxFileName, + lineNumber: 238 + } + }, + React.createElement( + View, + { style: styles.inspectorCount, __source: { + fileName: _jsxFileName, + lineNumber: 239 + } + }, + React.createElement( + Text, + { style: styles.inspectorCountText, __source: { + fileName: _jsxFileName, + lineNumber: 240 + } + }, + countSentence + ), + React.createElement( + TouchableHighlight, + { onPress: toggleStacktrace, underlayColor: 'transparent', __source: { + fileName: _jsxFileName, + lineNumber: 241 + } + }, + React.createElement( + Text, + { style: styles.inspectorButtonText, __source: { + fileName: _jsxFileName, + lineNumber: 242 + } + }, + stacktraceVisible ? '▼' : '▶', + ' Stacktrace' + ) + ) + ), + React.createElement( + ScrollView, + { style: styles.inspectorWarning, __source: { + fileName: _jsxFileName, + lineNumber: 247 + } + }, + stacktraceList, + React.createElement( + Text, + { style: styles.inspectorWarningText, __source: { + fileName: _jsxFileName, + lineNumber: 249 + } + }, + warning + ) + ), + React.createElement( + View, + { style: styles.inspectorButtons, __source: { + fileName: _jsxFileName, + lineNumber: 251 + } + }, + React.createElement( + TouchableHighlight, + { + activeOpacity: 0.5, + onPress: onMinimize, + style: styles.inspectorButton, + underlayColor: 'transparent', __source: { + fileName: _jsxFileName, + lineNumber: 252 + } + }, + React.createElement( + Text, + { style: styles.inspectorButtonText, __source: { + fileName: _jsxFileName, + lineNumber: 257 + } + }, + 'Minimize' + ) + ), + React.createElement( + TouchableHighlight, + { + activeOpacity: 0.5, + onPress: onDismiss, + style: styles.inspectorButton, + underlayColor: 'transparent', __source: { + fileName: _jsxFileName, + lineNumber: 261 + } + }, + React.createElement( + Text, + { style: styles.inspectorButtonText, __source: { + fileName: _jsxFileName, + lineNumber: 266 + } + }, + 'Dismiss' + ) + ), + React.createElement( + TouchableHighlight, + { + activeOpacity: 0.5, + onPress: onDismissAll, + style: styles.inspectorButton, + underlayColor: 'transparent', __source: { + fileName: _jsxFileName, + lineNumber: 270 + } + }, + React.createElement( + Text, + { style: styles.inspectorButtonText, __source: { + fileName: _jsxFileName, + lineNumber: 275 + } + }, + 'Dismiss All' + ) + ) + ) + ); +}; + +var YellowBox = function (_React$Component) { + babelHelpers.inherits(YellowBox, _React$Component); + + function YellowBox(props, context) { + babelHelpers.classCallCheck(this, YellowBox); + + var _this = babelHelpers.possibleConstructorReturn(this, (YellowBox.__proto__ || Object.getPrototypeOf(YellowBox)).call(this, props, context)); + + _this.state = { + inspecting: null, + stacktraceVisible: false, + warningMap: _warningMap + }; + _this.dismissWarning = function (warning) { + var _this$state = _this.state, + inspecting = _this$state.inspecting, + warningMap = _this$state.warningMap; + + if (warning) { + warningMap.delete(warning); + } else { + warningMap.clear(); + } + _this.setState({ + inspecting: warning && inspecting !== warning ? inspecting : null, + warningMap: warningMap + }); + }; + return _this; + } + + babelHelpers.createClass(YellowBox, [{ + key: 'componentDidMount', + value: function componentDidMount() { + var _this2 = this; + + var scheduled = null; + this._listener = _warningEmitter.addListener('warning', function (warningMap) { + scheduled = scheduled || setImmediate(function () { + scheduled = null; + _this2.setState({ + warningMap: warningMap + }); + }); + }); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var inspecting = this.state.inspecting; + + if (inspecting != null) { + ensureSymbolicatedWarning(inspecting); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this._listener) { + this._listener.remove(); + } + } + }, { + key: 'render', + value: function render() { + var _this3 = this; + + if (console.disableYellowBox || this.state.warningMap.size === 0) { + return null; + } + var ScrollView = require(239 ); // 239 = ScrollView + var View = require(146 ); // 146 = View + + var _state = this.state, + inspecting = _state.inspecting, + stacktraceVisible = _state.stacktraceVisible; + + var inspector = inspecting !== null ? React.createElement(WarningInspector, { + warningInfo: this.state.warningMap.get(inspecting), + warning: inspecting, + stacktraceVisible: stacktraceVisible, + onDismiss: function onDismiss() { + return _this3.dismissWarning(inspecting); + }, + onDismissAll: function onDismissAll() { + return _this3.dismissWarning(null); + }, + onMinimize: function onMinimize() { + return _this3.setState({ inspecting: null }); + }, + toggleStacktrace: function toggleStacktrace() { + return _this3.setState({ stacktraceVisible: !stacktraceVisible }); + }, + __source: { + fileName: _jsxFileName, + lineNumber: 350 + } + }) : null; + + var rows = []; + this.state.warningMap.forEach(function (warningInfo, warning) { + if (!isWarningIgnored(warning)) { + rows.push(React.createElement(WarningRow, { + key: warning, + count: warningInfo.count, + warning: warning, + onPress: function onPress() { + return _this3.setState({ inspecting: warning }); + }, + onDismiss: function onDismiss() { + return _this3.dismissWarning(warning); + }, + __source: { + fileName: _jsxFileName, + lineNumber: 365 + } + })); + } + }); + + var listStyle = [styles.list, { height: Math.min(rows.length, 4.4) * (rowGutter + rowHeight) }]; + return React.createElement( + View, + { style: inspector ? styles.fullScreen : listStyle, __source: { + fileName: _jsxFileName, + lineNumber: 382 + } + }, + React.createElement( + ScrollView, + { style: listStyle, scrollsToTop: false, __source: { + fileName: _jsxFileName, + lineNumber: 383 + } + }, + rows + ), + inspector + ); + } + }]); + return YellowBox; +}(React.Component); + +var backgroundColor = function backgroundColor(opacity) { + return 'rgba(250, 186, 48, ' + opacity + ')'; +}; +var textColor = 'white'; +var rowGutter = 1; +var rowHeight = 46; + +var elevation = Platform.OS === 'android' ? Number.MAX_SAFE_INTEGER : undefined; + +var styles = StyleSheet.create({ + fullScreen: { + backgroundColor: 'transparent', + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0, + elevation: elevation + }, + inspector: { + backgroundColor: backgroundColor(0.95), + flex: 1, + paddingTop: 5, + elevation: elevation + }, + inspectorButtons: { + flexDirection: 'row' + }, + inspectorButton: { + flex: 1, + paddingVertical: 22, + backgroundColor: backgroundColor(1) + }, + stacktraceList: { + paddingBottom: 5 + }, + inspectorButtonText: { + color: textColor, + fontSize: 14, + opacity: 0.8, + textAlign: 'center' + }, + openInEditorButton: { + paddingTop: 5, + paddingBottom: 5 + }, + inspectorCount: { + padding: 15, + paddingBottom: 0, + flexDirection: 'row', + justifyContent: 'space-between' + }, + inspectorCountText: { + color: textColor, + fontSize: 14 + }, + inspectorWarning: { + flex: 1, + paddingHorizontal: 15 + }, + inspectorWarningText: { + color: textColor, + fontSize: 16, + fontWeight: '600' + }, + list: { + backgroundColor: 'transparent', + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + elevation: elevation + }, + listRow: { + position: 'relative', + backgroundColor: backgroundColor(0.95), + flex: 1, + height: rowHeight, + marginTop: rowGutter + }, + listRowContent: { + flex: 1 + }, + listRowCount: { + color: 'rgba(255, 255, 255, 0.5)' + }, + listRowText: { + color: textColor, + position: 'absolute', + left: 0, + top: Platform.OS === 'android' ? 5 : 7, + marginLeft: 15, + marginRight: 15 + } +}); + +module.exports = YellowBox; +}, 330, null, "YellowBox"); +__d(/* I18nManager */function(global, require, module, exports) { +'use strict'; + +var I18nManager = require(80 ).I18nManager || { // 80 = NativeModules + isRTL: false, + allowRTL: function allowRTL() {}, + forceRTL: function forceRTL() {} +}; + +module.exports = I18nManager; +}, 331, null, "I18nManager"); +__d(/* Navigator */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/Navigator/Navigator.js'; +var AnimationsDebugModule = require(80 ).AnimationsDebugModule; // 80 = NativeModules +var Dimensions = require(129 ); // 129 = Dimensions +var InteractionMixin = require(333 ); // 333 = InteractionMixin +var NavigationContext = require(334 ); // 334 = NavigationContext +var NavigatorBreadcrumbNavigationBar = require(339 ); // 339 = NavigatorBreadcrumbNavigationBar +var NavigatorNavigationBar = require(344 ); // 344 = NavigatorNavigationBar +var NavigatorSceneConfigs = require(345 ); // 345 = NavigatorSceneConfigs +var PanResponder = require(346 ); // 346 = PanResponder +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var Subscribable = require(292 ); // 292 = Subscribable +var TVEventHandler = require(214 ); // 214 = TVEventHandler +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var View = require(146 ); // 146 = View + +var clamp = require(348 ); // 348 = clamp +var flattenStyle = require(77 ); // 77 = flattenStyle +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var rebound = require(349 ); // 349 = rebound + +var PropTypes = React.PropTypes; + +var SCREEN_WIDTH = Dimensions.get('window').width; +var SCREEN_HEIGHT = Dimensions.get('window').height; +var SCENE_DISABLED_NATIVE_PROPS = { + pointerEvents: 'none', + style: { + top: SCREEN_HEIGHT, + bottom: -SCREEN_HEIGHT, + opacity: 0 + } +}; + +var __uid = 0; +function getuid() { + return __uid++; +} + +function getRouteID(route) { + if (route === null || typeof route !== 'object') { + return String(route); + } + + var key = '__navigatorRouteID'; + + if (!route.hasOwnProperty(key)) { + Object.defineProperty(route, key, { + enumerable: false, + configurable: false, + writable: false, + value: getuid() + }); + } + return route[key]; +} + +var styles = StyleSheet.create({ + container: { + flex: 1, + overflow: 'hidden' + }, + defaultSceneStyle: { + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + top: 0, + transform: [{ translateX: 0 }, { translateY: 0 }, { scaleX: 1 }, { scaleY: 1 }, { rotate: '0deg' }, { skewX: '0deg' }, { skewY: '0deg' }] + }, + baseScene: { + position: 'absolute', + overflow: 'hidden', + left: 0, + right: 0, + bottom: 0, + top: 0 + }, + disabledScene: { + top: SCREEN_HEIGHT, + bottom: -SCREEN_HEIGHT + }, + transitioner: { + flex: 1, + backgroundColor: 'transparent', + overflow: 'hidden' + } +}); + +var GESTURE_ACTIONS = ['pop', 'jumpBack', 'jumpForward']; + +var Navigator = React.createClass({ + displayName: 'Navigator', + + + propTypes: { + configureScene: PropTypes.func, + + renderScene: PropTypes.func.isRequired, + + initialRoute: PropTypes.object, + + initialRouteStack: PropTypes.arrayOf(PropTypes.object), + + onWillFocus: PropTypes.func, + + onDidFocus: PropTypes.func, + + navigationBar: PropTypes.node, + + navigator: PropTypes.object, + + sceneStyle: View.propTypes.style + }, + + statics: { + BreadcrumbNavigationBar: NavigatorBreadcrumbNavigationBar, + NavigationBar: NavigatorNavigationBar, + SceneConfigs: NavigatorSceneConfigs + }, + + mixins: [TimerMixin, InteractionMixin, Subscribable.Mixin], + + getDefaultProps: function getDefaultProps() { + return { + configureScene: function configureScene() { + return NavigatorSceneConfigs.PushFromRight; + }, + sceneStyle: styles.defaultSceneStyle + }; + }, + + getInitialState: function getInitialState() { + var _this = this; + + this._navigationBarNavigator = this.props.navigationBarNavigator || this; + + this._renderedSceneMap = new Map(); + + this._sceneRefs = []; + + var routeStack = this.props.initialRouteStack || [this.props.initialRoute]; + invariant(routeStack.length >= 1, 'Navigator requires props.initialRoute or props.initialRouteStack.'); + var initialRouteIndex = routeStack.length - 1; + if (this.props.initialRoute) { + initialRouteIndex = routeStack.indexOf(this.props.initialRoute); + invariant(initialRouteIndex !== -1, 'initialRoute is not in initialRouteStack.'); + } + return { + sceneConfigStack: routeStack.map(function (route) { + return _this.props.configureScene(route, routeStack); + }), + routeStack: routeStack, + presentedIndex: initialRouteIndex, + transitionFromIndex: null, + activeGesture: null, + pendingGestureProgress: null, + transitionQueue: [] + }; + }, + + componentWillMount: function componentWillMount() { + var _this2 = this; + + this.__defineGetter__('navigationContext', this._getNavigationContext); + + this._subRouteFocus = []; + this.parentNavigator = this.props.navigator; + this._handlers = {}; + this.springSystem = new rebound.SpringSystem(); + this.spring = this.springSystem.createSpring(); + this.spring.setRestSpeedThreshold(0.05); + this.spring.setCurrentValue(0).setAtRest(); + this.spring.addListener({ + onSpringEndStateChange: function onSpringEndStateChange() { + if (!_this2._interactionHandle) { + _this2._interactionHandle = _this2.createInteractionHandle(); + } + }, + onSpringUpdate: function onSpringUpdate() { + _this2._handleSpringUpdate(); + }, + onSpringAtRest: function onSpringAtRest() { + _this2._completeTransition(); + } + }); + this.panGesture = PanResponder.create({ + onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder, + onPanResponderRelease: this._handlePanResponderRelease, + onPanResponderMove: this._handlePanResponderMove, + onPanResponderTerminate: this._handlePanResponderTerminate + }); + this._interactionHandle = null; + this._emitWillFocus(this.state.routeStack[this.state.presentedIndex]); + }, + + componentDidMount: function componentDidMount() { + this._handleSpringUpdate(); + this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]); + this._enableTVEventHandler(); + }, + + componentWillUnmount: function componentWillUnmount() { + if (this._navigationContext) { + this._navigationContext.dispose(); + this._navigationContext = null; + } + + this.spring.destroy(); + + if (this._interactionHandle) { + this.clearInteractionHandle(this._interactionHandle); + } + + this._disableTVEventHandler(); + }, + + immediatelyResetRouteStack: function immediatelyResetRouteStack(nextRouteStack) { + var _this3 = this; + + var destIndex = nextRouteStack.length - 1; + this._emitWillFocus(nextRouteStack[destIndex]); + this.setState({ + routeStack: nextRouteStack, + sceneConfigStack: nextRouteStack.map(function (route) { + return _this3.props.configureScene(route, nextRouteStack); + }), + presentedIndex: destIndex, + activeGesture: null, + transitionFromIndex: null, + transitionQueue: [] + }, function () { + _this3._handleSpringUpdate(); + var navBar = _this3._navBar; + if (navBar && navBar.immediatelyRefresh) { + navBar.immediatelyRefresh(); + } + _this3._emitDidFocus(_this3.state.routeStack[_this3.state.presentedIndex]); + }); + }, + + _transitionTo: function _transitionTo(destIndex, velocity, jumpSpringTo, cb) { + if (this.state.presentedIndex === destIndex) { + cb && cb(); + return; + } + + if (this.state.transitionFromIndex !== null) { + this.state.transitionQueue.push({ + destIndex: destIndex, + velocity: velocity, + cb: cb + }); + return; + } + + this.state.transitionFromIndex = this.state.presentedIndex; + this.state.presentedIndex = destIndex; + this.state.transitionCb = cb; + this._onAnimationStart(); + if (AnimationsDebugModule) { + AnimationsDebugModule.startRecordingFps(); + } + var sceneConfig = this.state.sceneConfigStack[this.state.transitionFromIndex] || this.state.sceneConfigStack[this.state.presentedIndex]; + invariant(sceneConfig, 'Cannot configure scene at index ' + this.state.transitionFromIndex); + if (jumpSpringTo != null) { + this.spring.setCurrentValue(jumpSpringTo); + } + this.spring.setOvershootClampingEnabled(true); + this.spring.getSpringConfig().friction = sceneConfig.springFriction; + this.spring.getSpringConfig().tension = sceneConfig.springTension; + this.spring.setVelocity(velocity || sceneConfig.defaultTransitionVelocity); + this.spring.setEndValue(1); + }, + + _handleSpringUpdate: function _handleSpringUpdate() { + if (!this.isMounted()) { + return; + } + + if (this.state.transitionFromIndex != null) { + this._transitionBetween(this.state.transitionFromIndex, this.state.presentedIndex, this.spring.getCurrentValue()); + } else if (this.state.activeGesture != null) { + var presentedToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._transitionBetween(this.state.presentedIndex, presentedToIndex, this.spring.getCurrentValue()); + } + }, + + _completeTransition: function _completeTransition() { + if (!this.isMounted()) { + return; + } + + if (this.spring.getCurrentValue() !== 1 && this.spring.getCurrentValue() !== 0) { + if (this.state.pendingGestureProgress) { + this.state.pendingGestureProgress = null; + } + return; + } + this._onAnimationEnd(); + var presentedIndex = this.state.presentedIndex; + var didFocusRoute = this._subRouteFocus[presentedIndex] || this.state.routeStack[presentedIndex]; + + if (AnimationsDebugModule) { + AnimationsDebugModule.stopRecordingFps(Date.now()); + } + this.state.transitionFromIndex = null; + this.spring.setCurrentValue(0).setAtRest(); + this._hideScenes(); + if (this.state.transitionCb) { + this.state.transitionCb(); + this.state.transitionCb = null; + } + + this._emitDidFocus(didFocusRoute); + + if (this._interactionHandle) { + this.clearInteractionHandle(this._interactionHandle); + this._interactionHandle = null; + } + if (this.state.pendingGestureProgress) { + var gestureToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._enableScene(gestureToIndex); + this.spring.setEndValue(this.state.pendingGestureProgress); + return; + } + if (this.state.transitionQueue.length) { + var queuedTransition = this.state.transitionQueue.shift(); + this._enableScene(queuedTransition.destIndex); + this._emitWillFocus(this.state.routeStack[queuedTransition.destIndex]); + this._transitionTo(queuedTransition.destIndex, queuedTransition.velocity, null, queuedTransition.cb); + } + }, + + _emitDidFocus: function _emitDidFocus(route) { + this.navigationContext.emit('didfocus', { route: route }); + + if (this.props.onDidFocus) { + this.props.onDidFocus(route); + } + }, + + _emitWillFocus: function _emitWillFocus(route) { + this.navigationContext.emit('willfocus', { route: route }); + + var navBar = this._navBar; + if (navBar && navBar.handleWillFocus) { + navBar.handleWillFocus(route); + } + if (this.props.onWillFocus) { + this.props.onWillFocus(route); + } + }, + + _hideScenes: function _hideScenes() { + var gesturingToIndex = null; + if (this.state.activeGesture) { + gesturingToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + } + for (var i = 0; i < this.state.routeStack.length; i++) { + if (i === this.state.presentedIndex || i === this.state.transitionFromIndex || i === gesturingToIndex) { + continue; + } + this._disableScene(i); + } + }, + + _disableScene: function _disableScene(sceneIndex) { + this._sceneRefs[sceneIndex] && this._sceneRefs[sceneIndex].setNativeProps(SCENE_DISABLED_NATIVE_PROPS); + }, + + _enableScene: function _enableScene(sceneIndex) { + var sceneStyle = flattenStyle([styles.baseScene, this.props.sceneStyle]); + + var enabledSceneNativeProps = { + pointerEvents: 'auto', + style: { + top: sceneStyle.top, + bottom: sceneStyle.bottom + } + }; + if (sceneIndex !== this.state.transitionFromIndex && sceneIndex !== this.state.presentedIndex) { + enabledSceneNativeProps.style.opacity = 0; + } + this._sceneRefs[sceneIndex] && this._sceneRefs[sceneIndex].setNativeProps(enabledSceneNativeProps); + }, + + _clearTransformations: function _clearTransformations(sceneIndex) { + var defaultStyle = flattenStyle([styles.defaultSceneStyle]); + this._sceneRefs[sceneIndex].setNativeProps({ style: defaultStyle }); + }, + + _onAnimationStart: function _onAnimationStart() { + var fromIndex = this.state.presentedIndex; + var toIndex = this.state.presentedIndex; + if (this.state.transitionFromIndex != null) { + fromIndex = this.state.transitionFromIndex; + } else if (this.state.activeGesture) { + toIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + } + this._setRenderSceneToHardwareTextureAndroid(fromIndex, true); + this._setRenderSceneToHardwareTextureAndroid(toIndex, true); + var navBar = this._navBar; + if (navBar && navBar.onAnimationStart) { + navBar.onAnimationStart(fromIndex, toIndex); + } + }, + + _onAnimationEnd: function _onAnimationEnd() { + var max = this.state.routeStack.length - 1; + for (var index = 0; index <= max; index++) { + this._setRenderSceneToHardwareTextureAndroid(index, false); + } + + var navBar = this._navBar; + if (navBar && navBar.onAnimationEnd) { + navBar.onAnimationEnd(); + } + }, + + _setRenderSceneToHardwareTextureAndroid: function _setRenderSceneToHardwareTextureAndroid(sceneIndex, shouldRenderToHardwareTexture) { + var viewAtIndex = this._sceneRefs[sceneIndex]; + if (viewAtIndex === null || viewAtIndex === undefined) { + return; + } + viewAtIndex.setNativeProps({ renderToHardwareTextureAndroid: shouldRenderToHardwareTexture }); + }, + + _handleTouchStart: function _handleTouchStart() { + this._eligibleGestures = GESTURE_ACTIONS; + }, + + _handleMoveShouldSetPanResponder: function _handleMoveShouldSetPanResponder(e, gestureState) { + var sceneConfig = this.state.sceneConfigStack[this.state.presentedIndex]; + if (!sceneConfig) { + return false; + } + this._expectingGestureGrant = this._matchGestureAction(this._eligibleGestures, sceneConfig.gestures, gestureState); + return !!this._expectingGestureGrant; + }, + + _doesGestureOverswipe: function _doesGestureOverswipe(gestureName) { + var wouldOverswipeBack = this.state.presentedIndex <= 0 && (gestureName === 'pop' || gestureName === 'jumpBack'); + var wouldOverswipeForward = this.state.presentedIndex >= this.state.routeStack.length - 1 && gestureName === 'jumpForward'; + return wouldOverswipeForward || wouldOverswipeBack; + }, + + _deltaForGestureAction: function _deltaForGestureAction(gestureAction) { + switch (gestureAction) { + case 'pop': + case 'jumpBack': + return -1; + case 'jumpForward': + return 1; + default: + invariant(false, 'Unsupported gesture action ' + gestureAction); + return; + } + }, + + _handlePanResponderRelease: function _handlePanResponderRelease(e, gestureState) { + var _this4 = this; + + var sceneConfig = this.state.sceneConfigStack[this.state.presentedIndex]; + var releaseGestureAction = this.state.activeGesture; + if (!releaseGestureAction) { + return; + } + var releaseGesture = sceneConfig.gestures[releaseGestureAction]; + var destIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + if (this.spring.getCurrentValue() === 0) { + this.spring.setCurrentValue(0).setAtRest(); + this._completeTransition(); + return; + } + var isTravelVertical = releaseGesture.direction === 'top-to-bottom' || releaseGesture.direction === 'bottom-to-top'; + var isTravelInverted = releaseGesture.direction === 'right-to-left' || releaseGesture.direction === 'bottom-to-top'; + var velocity, gestureDistance; + if (isTravelVertical) { + velocity = isTravelInverted ? -gestureState.vy : gestureState.vy; + gestureDistance = isTravelInverted ? -gestureState.dy : gestureState.dy; + } else { + velocity = isTravelInverted ? -gestureState.vx : gestureState.vx; + gestureDistance = isTravelInverted ? -gestureState.dx : gestureState.dx; + } + var transitionVelocity = clamp(-10, velocity, 10); + if (Math.abs(velocity) < releaseGesture.notMoving) { + var hasGesturedEnoughToComplete = gestureDistance > releaseGesture.fullDistance * releaseGesture.stillCompletionRatio; + transitionVelocity = hasGesturedEnoughToComplete ? releaseGesture.snapVelocity : -releaseGesture.snapVelocity; + } + if (transitionVelocity < 0 || this._doesGestureOverswipe(releaseGestureAction)) { + if (this.state.transitionFromIndex == null) { + var transitionBackToPresentedIndex = this.state.presentedIndex; + + this.state.presentedIndex = destIndex; + this._transitionTo(transitionBackToPresentedIndex, -transitionVelocity, 1 - this.spring.getCurrentValue()); + } + } else { + this._emitWillFocus(this.state.routeStack[destIndex]); + this._transitionTo(destIndex, transitionVelocity, null, function () { + if (releaseGestureAction === 'pop') { + _this4._cleanScenesPastIndex(destIndex); + } + }); + } + this._detachGesture(); + }, + + _handlePanResponderTerminate: function _handlePanResponderTerminate(e, gestureState) { + if (this.state.activeGesture == null) { + return; + } + var destIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._detachGesture(); + var transitionBackToPresentedIndex = this.state.presentedIndex; + + this.state.presentedIndex = destIndex; + this._transitionTo(transitionBackToPresentedIndex, null, 1 - this.spring.getCurrentValue()); + }, + + _attachGesture: function _attachGesture(gestureId) { + this.state.activeGesture = gestureId; + var gesturingToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._enableScene(gesturingToIndex); + }, + + _detachGesture: function _detachGesture() { + this.state.activeGesture = null; + this.state.pendingGestureProgress = null; + this._hideScenes(); + }, + + _handlePanResponderMove: function _handlePanResponderMove(e, gestureState) { + if (this._isMoveGestureAttached !== undefined) { + invariant(this._expectingGestureGrant, 'Responder granted unexpectedly.'); + this._attachGesture(this._expectingGestureGrant); + this._onAnimationStart(); + this._expectingGestureGrant = undefined; + } + + var sceneConfig = this.state.sceneConfigStack[this.state.presentedIndex]; + if (this.state.activeGesture) { + var gesture = sceneConfig.gestures[this.state.activeGesture]; + return this._moveAttachedGesture(gesture, gestureState); + } + var matchedGesture = this._matchGestureAction(GESTURE_ACTIONS, sceneConfig.gestures, gestureState); + if (matchedGesture) { + this._attachGesture(matchedGesture); + } + }, + + _moveAttachedGesture: function _moveAttachedGesture(gesture, gestureState) { + var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top'; + var isTravelInverted = gesture.direction === 'right-to-left' || gesture.direction === 'bottom-to-top'; + var distance = isTravelVertical ? gestureState.dy : gestureState.dx; + distance = isTravelInverted ? -distance : distance; + var gestureDetectMovement = gesture.gestureDetectMovement; + var nextProgress = (distance - gestureDetectMovement) / (gesture.fullDistance - gestureDetectMovement); + if (nextProgress < 0 && gesture.isDetachable) { + var gesturingToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._transitionBetween(this.state.presentedIndex, gesturingToIndex, 0); + this._detachGesture(); + if (this.state.pendingGestureProgress != null) { + this.spring.setCurrentValue(0); + } + return; + } + if (gesture.overswipe && this._doesGestureOverswipe(this.state.activeGesture)) { + var frictionConstant = gesture.overswipe.frictionConstant; + var frictionByDistance = gesture.overswipe.frictionByDistance; + var frictionRatio = 1 / (frictionConstant + Math.abs(nextProgress) * frictionByDistance); + nextProgress *= frictionRatio; + } + nextProgress = clamp(0, nextProgress, 1); + if (this.state.transitionFromIndex != null) { + this.state.pendingGestureProgress = nextProgress; + } else if (this.state.pendingGestureProgress) { + this.spring.setEndValue(nextProgress); + } else { + this.spring.setCurrentValue(nextProgress); + } + }, + + _matchGestureAction: function _matchGestureAction(eligibleGestures, gestures, gestureState) { + var _this5 = this; + + if (!gestures || !eligibleGestures || !eligibleGestures.some) { + return null; + } + var matchedGesture = null; + eligibleGestures.some(function (gestureName, gestureIndex) { + var gesture = gestures[gestureName]; + if (!gesture) { + return; + } + if (gesture.overswipe == null && _this5._doesGestureOverswipe(gestureName)) { + return false; + } + var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top'; + var isTravelInverted = gesture.direction === 'right-to-left' || gesture.direction === 'bottom-to-top'; + var startedLoc = isTravelVertical ? gestureState.y0 : gestureState.x0; + var currentLoc = isTravelVertical ? gestureState.moveY : gestureState.moveX; + var travelDist = isTravelVertical ? gestureState.dy : gestureState.dx; + var oppositeAxisTravelDist = isTravelVertical ? gestureState.dx : gestureState.dy; + var edgeHitWidth = gesture.edgeHitWidth; + if (isTravelInverted) { + startedLoc = -startedLoc; + currentLoc = -currentLoc; + travelDist = -travelDist; + oppositeAxisTravelDist = -oppositeAxisTravelDist; + edgeHitWidth = isTravelVertical ? -(SCREEN_HEIGHT - edgeHitWidth) : -(SCREEN_WIDTH - edgeHitWidth); + } + if (startedLoc === 0) { + startedLoc = currentLoc; + } + var moveStartedInRegion = gesture.edgeHitWidth == null || startedLoc < edgeHitWidth; + if (!moveStartedInRegion) { + return false; + } + var moveTravelledFarEnough = travelDist >= gesture.gestureDetectMovement; + if (!moveTravelledFarEnough) { + return false; + } + var directionIsCorrect = Math.abs(travelDist) > Math.abs(oppositeAxisTravelDist) * gesture.directionRatio; + if (directionIsCorrect) { + matchedGesture = gestureName; + return true; + } else { + _this5._eligibleGestures = _this5._eligibleGestures.slice().splice(gestureIndex, 1); + } + }); + return matchedGesture || null; + }, + + _transitionSceneStyle: function _transitionSceneStyle(fromIndex, toIndex, progress, index) { + var viewAtIndex = this._sceneRefs[index]; + if (viewAtIndex === null || viewAtIndex === undefined) { + return; + } + + var sceneConfigIndex = fromIndex < toIndex ? toIndex : fromIndex; + var sceneConfig = this.state.sceneConfigStack[sceneConfigIndex]; + + if (!sceneConfig) { + sceneConfig = this.state.sceneConfigStack[sceneConfigIndex - 1]; + } + var styleToUse = {}; + var useFn = index < fromIndex || index < toIndex ? sceneConfig.animationInterpolators.out : sceneConfig.animationInterpolators.into; + var directionAdjustedProgress = fromIndex < toIndex ? progress : 1 - progress; + var didChange = useFn(styleToUse, directionAdjustedProgress); + if (didChange) { + viewAtIndex.setNativeProps({ style: styleToUse }); + } + }, + + _transitionBetween: function _transitionBetween(fromIndex, toIndex, progress) { + this._transitionSceneStyle(fromIndex, toIndex, progress, fromIndex); + this._transitionSceneStyle(fromIndex, toIndex, progress, toIndex); + var navBar = this._navBar; + if (navBar && navBar.updateProgress && toIndex >= 0 && fromIndex >= 0) { + navBar.updateProgress(progress, fromIndex, toIndex); + } + }, + + _handleResponderTerminationRequest: function _handleResponderTerminationRequest() { + return false; + }, + + _getDestIndexWithinBounds: function _getDestIndexWithinBounds(n) { + var currentIndex = this.state.presentedIndex; + var destIndex = currentIndex + n; + invariant(destIndex >= 0, 'Cannot jump before the first route.'); + var maxIndex = this.state.routeStack.length - 1; + invariant(maxIndex >= destIndex, 'Cannot jump past the last route.'); + return destIndex; + }, + + _jumpN: function _jumpN(n) { + var destIndex = this._getDestIndexWithinBounds(n); + this._enableScene(destIndex); + this._emitWillFocus(this.state.routeStack[destIndex]); + this._transitionTo(destIndex); + }, + + jumpTo: function jumpTo(route) { + var destIndex = this.state.routeStack.indexOf(route); + invariant(destIndex !== -1, 'Cannot jump to route that is not in the route stack'); + this._jumpN(destIndex - this.state.presentedIndex); + }, + + jumpForward: function jumpForward() { + this._jumpN(1); + }, + + jumpBack: function jumpBack() { + this._jumpN(-1); + }, + + push: function push(route) { + var _this6 = this; + + invariant(!!route, 'Must supply route to push'); + var activeLength = this.state.presentedIndex + 1; + var activeStack = this.state.routeStack.slice(0, activeLength); + var activeAnimationConfigStack = this.state.sceneConfigStack.slice(0, activeLength); + var nextStack = activeStack.concat([route]); + var destIndex = nextStack.length - 1; + var nextSceneConfig = this.props.configureScene(route, nextStack); + var nextAnimationConfigStack = activeAnimationConfigStack.concat([nextSceneConfig]); + this._emitWillFocus(nextStack[destIndex]); + this.setState({ + routeStack: nextStack, + sceneConfigStack: nextAnimationConfigStack + }, function () { + _this6._enableScene(destIndex); + _this6._transitionTo(destIndex, nextSceneConfig.defaultTransitionVelocity); + }); + }, + + popN: function popN(n) { + var _this7 = this; + + invariant(typeof n === 'number', 'Must supply a number to popN'); + n = parseInt(n, 10); + if (n <= 0 || this.state.presentedIndex - n < 0) { + return; + } + var popIndex = this.state.presentedIndex - n; + var presentedRoute = this.state.routeStack[this.state.presentedIndex]; + var popSceneConfig = this.props.configureScene(presentedRoute); + this._enableScene(popIndex); + + this._clearTransformations(popIndex); + this._emitWillFocus(this.state.routeStack[popIndex]); + this._transitionTo(popIndex, popSceneConfig.defaultTransitionVelocity, null, function () { + _this7._cleanScenesPastIndex(popIndex); + }); + }, + + pop: function pop() { + if (this.state.transitionQueue.length) { + return; + } + + this.popN(1); + }, + + replaceAtIndex: function replaceAtIndex(route, index, cb) { + var _this8 = this; + + invariant(!!route, 'Must supply route to replace'); + if (index < 0) { + index += this.state.routeStack.length; + } + + if (this.state.routeStack.length <= index) { + return; + } + + var nextRouteStack = this.state.routeStack.slice(); + var nextAnimationModeStack = this.state.sceneConfigStack.slice(); + nextRouteStack[index] = route; + nextAnimationModeStack[index] = this.props.configureScene(route, nextRouteStack); + + if (index === this.state.presentedIndex) { + this._emitWillFocus(route); + } + this.setState({ + routeStack: nextRouteStack, + sceneConfigStack: nextAnimationModeStack + }, function () { + if (index === _this8.state.presentedIndex) { + _this8._emitDidFocus(route); + } + cb && cb(); + }); + }, + + replace: function replace(route) { + this.replaceAtIndex(route, this.state.presentedIndex); + }, + + replacePrevious: function replacePrevious(route) { + this.replaceAtIndex(route, this.state.presentedIndex - 1); + }, + + popToTop: function popToTop() { + this.popToRoute(this.state.routeStack[0]); + }, + + popToRoute: function popToRoute(route) { + var indexOfRoute = this.state.routeStack.indexOf(route); + invariant(indexOfRoute !== -1, 'Calling popToRoute for a route that doesn\'t exist!'); + var numToPop = this.state.presentedIndex - indexOfRoute; + this.popN(numToPop); + }, + + replacePreviousAndPop: function replacePreviousAndPop(route) { + if (this.state.routeStack.length < 2) { + return; + } + this.replacePrevious(route); + this.pop(); + }, + + resetTo: function resetTo(route) { + var _this9 = this; + + invariant(!!route, 'Must supply route to push'); + this.replaceAtIndex(route, 0, function () { + _this9.popN(_this9.state.presentedIndex); + }); + }, + + getCurrentRoutes: function getCurrentRoutes() { + return this.state.routeStack.slice(); + }, + + _cleanScenesPastIndex: function _cleanScenesPastIndex(index) { + var newStackLength = index + 1; + + if (newStackLength < this.state.routeStack.length) { + this.setState({ + sceneConfigStack: this.state.sceneConfigStack.slice(0, newStackLength), + routeStack: this.state.routeStack.slice(0, newStackLength) + }); + } + }, + + _renderScene: function _renderScene(route, i) { + var _this10 = this; + + var disabledSceneStyle = null; + var disabledScenePointerEvents = 'auto'; + if (i !== this.state.presentedIndex) { + disabledSceneStyle = styles.disabledScene; + disabledScenePointerEvents = 'none'; + } + return React.createElement( + View, + { + collapsable: false, + key: 'scene_' + getRouteID(route), + ref: function ref(scene) { + _this10._sceneRefs[i] = scene; + }, + onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture() { + return _this10.state.transitionFromIndex != null; + }, + pointerEvents: disabledScenePointerEvents, + style: [styles.baseScene, this.props.sceneStyle, disabledSceneStyle], __source: { + fileName: _jsxFileName, + lineNumber: 1274 + } + }, + this.props.renderScene(route, this) + ); + }, + + _renderNavigationBar: function _renderNavigationBar() { + var _this11 = this; + + var navigationBar = this.props.navigationBar; + + if (!navigationBar) { + return null; + } + return React.cloneElement(navigationBar, { + ref: function ref(navBar) { + _this11._navBar = navBar; + if (navigationBar && typeof navigationBar.ref === 'function') { + navigationBar.ref(navBar); + } + }, + navigator: this._navigationBarNavigator, + navState: this.state + }); + }, + + _tvEventHandler: TVEventHandler, + + _enableTVEventHandler: function _enableTVEventHandler() { + this._tvEventHandler = new TVEventHandler(); + this._tvEventHandler.enable(this, function (cmp, evt) { + if (evt && evt.eventType === 'menu') { + cmp.pop(); + } + }); + }, + + _disableTVEventHandler: function _disableTVEventHandler() { + if (this._tvEventHandler) { + this._tvEventHandler.disable(); + delete this._tvEventHandler; + } + }, + + render: function render() { + var _this12 = this; + + var newRenderedSceneMap = new Map(); + var scenes = this.state.routeStack.map(function (route, index) { + var renderedScene; + if (_this12._renderedSceneMap.has(route) && index !== _this12.state.presentedIndex) { + renderedScene = _this12._renderedSceneMap.get(route); + } else { + renderedScene = _this12._renderScene(route, index); + } + newRenderedSceneMap.set(route, renderedScene); + return renderedScene; + }); + this._renderedSceneMap = newRenderedSceneMap; + return React.createElement( + View, + { style: [styles.container, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 1343 + } + }, + React.createElement( + View, + babelHelpers.extends({ + style: styles.transitioner + }, this.panGesture.panHandlers, { + onTouchStart: this._handleTouchStart, + onResponderTerminationRequest: this._handleResponderTerminationRequest, __source: { + fileName: _jsxFileName, + lineNumber: 1344 + } + }), + scenes + ), + this._renderNavigationBar() + ); + }, + + _getNavigationContext: function _getNavigationContext() { + if (!this._navigationContext) { + this._navigationContext = new NavigationContext(); + } + return this._navigationContext; + } +}); + +module.exports = Navigator; +}, 332, null, "Navigator"); +__d(/* InteractionMixin */function(global, require, module, exports) { +'use strict'; + +var InteractionManager = require(221 ); // 221 = InteractionManager + +var InteractionMixin = { + componentWillUnmount: function componentWillUnmount() { + while (this._interactionMixinHandles.length) { + InteractionManager.clearInteractionHandle(this._interactionMixinHandles.pop()); + } + }, + + _interactionMixinHandles: [], + + createInteractionHandle: function createInteractionHandle() { + var handle = InteractionManager.createInteractionHandle(); + this._interactionMixinHandles.push(handle); + return handle; + }, + + clearInteractionHandle: function clearInteractionHandle(clearHandle) { + InteractionManager.clearInteractionHandle(clearHandle); + this._interactionMixinHandles = this._interactionMixinHandles.filter(function (handle) { + return handle !== clearHandle; + }); + }, + + runAfterInteractions: function runAfterInteractions(callback) { + InteractionManager.runAfterInteractions(callback); + } +}; + +module.exports = InteractionMixin; +}, 333, null, "InteractionMixin"); +__d(/* NavigationContext */function(global, require, module, exports) { +'use strict'; + +var NavigationEvent = require(335 ); // 335 = NavigationEvent +var NavigationEventEmitter = require(336 ); // 336 = NavigationEventEmitter +var NavigationTreeNode = require(337 ); // 337 = NavigationTreeNode + +var Set = require(222 ); // 222 = Set + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var AT_TARGET = NavigationEvent.AT_TARGET, + BUBBLING_PHASE = NavigationEvent.BUBBLING_PHASE, + CAPTURING_PHASE = NavigationEvent.CAPTURING_PHASE; + +var LegacyEventTypes = new Set(['willfocus', 'didfocus']); + +var NavigationContext = function () { + function NavigationContext() { + babelHelpers.classCallCheck(this, NavigationContext); + + this._bubbleEventEmitter = new NavigationEventEmitter(this); + this._captureEventEmitter = new NavigationEventEmitter(this); + this._currentRoute = null; + + this.__node = new NavigationTreeNode(this); + + this._emitCounter = 0; + this._emitQueue = []; + + this.addListener('willfocus', this._onFocus); + this.addListener('didfocus', this._onFocus); + } + + babelHelpers.createClass(NavigationContext, [{ + key: 'appendChild', + value: function appendChild(childContext) { + this.__node.appendChild(childContext.__node); + } + }, { + key: 'addListener', + value: function addListener(eventType, listener, useCapture) { + if (LegacyEventTypes.has(eventType)) { + useCapture = false; + } + + var emitter = useCapture ? this._captureEventEmitter : this._bubbleEventEmitter; + + if (emitter) { + return emitter.addListener(eventType, listener, this); + } else { + return { remove: emptyFunction }; + } + } + }, { + key: 'emit', + value: function emit(eventType, data, didEmitCallback) { + var _this = this; + + if (this._emitCounter > 0) { + var args = Array.prototype.slice.call(arguments); + this._emitQueue.push(args); + return; + } + + this._emitCounter++; + + if (LegacyEventTypes.has(eventType)) { + this.__emit(eventType, data, null, { + defaultPrevented: false, + eventPhase: AT_TARGET, + propagationStopped: true, + target: this + }); + } else { + var targets = [this]; + var parentTarget = this.parent; + while (parentTarget) { + targets.unshift(parentTarget); + parentTarget = parentTarget.parent; + } + + var propagationStopped = false; + var defaultPrevented = false; + var callback = function callback(event) { + propagationStopped = propagationStopped || event.isPropagationStopped(); + defaultPrevented = defaultPrevented || event.defaultPrevented; + }; + + targets.some(function (currentTarget) { + if (propagationStopped) { + return true; + } + + var extraInfo = { + defaultPrevented: defaultPrevented, + eventPhase: CAPTURING_PHASE, + propagationStopped: propagationStopped, + target: _this + }; + + currentTarget.__emit(eventType, data, callback, extraInfo); + }, this); + + targets.reverse().some(function (currentTarget) { + if (propagationStopped) { + return true; + } + var extraInfo = { + defaultPrevented: defaultPrevented, + eventPhase: BUBBLING_PHASE, + propagationStopped: propagationStopped, + target: _this + }; + currentTarget.__emit(eventType, data, callback, extraInfo); + }, this); + } + + if (didEmitCallback) { + var event = NavigationEvent.pool(eventType, this, data); + propagationStopped && event.stopPropagation(); + defaultPrevented && event.preventDefault(); + didEmitCallback.call(this, event); + event.dispose(); + } + + this._emitCounter--; + while (this._emitQueue.length) { + var args = this._emitQueue.shift(); + this.emit.apply(this, args); + } + } + }, { + key: 'dispose', + value: function dispose() { + this._bubbleEventEmitter && this._bubbleEventEmitter.removeAllListeners(); + this._captureEventEmitter && this._captureEventEmitter.removeAllListeners(); + this._bubbleEventEmitter = null; + this._captureEventEmitter = null; + this._currentRoute = null; + } + }, { + key: '__emit', + value: function __emit(eventType, data, didEmitCallback, extraInfo) { + var emitter; + switch (extraInfo.eventPhase) { + case CAPTURING_PHASE: + emitter = this._captureEventEmitter; + break; + + case AT_TARGET: + emitter = this._bubbleEventEmitter; + break; + + case BUBBLING_PHASE: + emitter = this._bubbleEventEmitter; + break; + + default: + invariant(false, 'invalid event phase %s', extraInfo.eventPhase); + } + + if (extraInfo.target === this) { + extraInfo.eventPhase = AT_TARGET; + } + + if (emitter) { + emitter.emit(eventType, data, didEmitCallback, extraInfo); + } + } + }, { + key: '_onFocus', + value: function _onFocus(event) { + invariant(event.data && event.data.hasOwnProperty('route'), 'event type "%s" should provide route', event.type); + + this._currentRoute = event.data.route; + } + }, { + key: 'parent', + get: function get() { + var parent = this.__node.getParent(); + return parent ? parent.getValue() : null; + } + }, { + key: 'top', + get: function get() { + var result = null; + var parentNode = this.__node.getParent(); + while (parentNode) { + result = parentNode.getValue(); + parentNode = parentNode.getParent(); + } + return result; + } + }, { + key: 'currentRoute', + get: function get() { + return this._currentRoute; + } + }]); + return NavigationContext; +}(); + +module.exports = NavigationContext; +}, 334, null, "NavigationContext"); +__d(/* NavigationEvent */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var NavigationEventPool = function () { + function NavigationEventPool() { + babelHelpers.classCallCheck(this, NavigationEventPool); + + this._list = []; + } + + babelHelpers.createClass(NavigationEventPool, [{ + key: 'get', + value: function get(type, currentTarget, data) { + var event = void 0; + if (this._list.length > 0) { + event = this._list.pop(); + event.constructor.call(event, type, currentTarget, data); + } else { + event = new NavigationEvent(type, currentTarget, data); + } + return event; + } + }, { + key: 'put', + value: function put(event) { + this._list.push(event); + } + }]); + return NavigationEventPool; +}(); + +var _navigationEventPool = new NavigationEventPool(); + +var NavigationEvent = function () { + babelHelpers.createClass(NavigationEvent, null, [{ + key: 'pool', + value: function pool(type, currentTarget, data) { + return _navigationEventPool.get(type, currentTarget, data); + } + }]); + + function NavigationEvent(type, currentTarget, data) { + babelHelpers.classCallCheck(this, NavigationEvent); + + this.target = currentTarget; + this.eventPhase = NavigationEvent.NONE; + + this._type = type; + this._currentTarget = currentTarget; + this._data = data; + this._defaultPrevented = false; + this._disposed = false; + this._propagationStopped = false; + } + + babelHelpers.createClass(NavigationEvent, [{ + key: 'preventDefault', + value: function preventDefault() { + this._defaultPrevented = true; + } + }, { + key: 'stopPropagation', + value: function stopPropagation() { + this._propagationStopped = true; + } + }, { + key: 'stop', + value: function stop() { + this.preventDefault(); + this.stopPropagation(); + } + }, { + key: 'isPropagationStopped', + value: function isPropagationStopped() { + return this._propagationStopped; + } + }, { + key: 'dispose', + value: function dispose() { + invariant(!this._disposed, 'NavigationEvent is already disposed'); + this._disposed = true; + + this.target = null; + this.eventPhase = NavigationEvent.NONE; + this._type = ''; + this._currentTarget = null; + this._data = null; + this._defaultPrevented = false; + + _navigationEventPool.put(this); + } + }, { + key: 'type', + get: function get() { + return this._type; + } + }, { + key: 'currentTarget', + get: function get() { + return this._currentTarget; + } + }, { + key: 'data', + get: function get() { + return this._data; + } + }, { + key: 'defaultPrevented', + get: function get() { + return this._defaultPrevented; + } + }]); + return NavigationEvent; +}(); + +NavigationEvent.NONE = 0; + +NavigationEvent.CAPTURING_PHASE = 1; + +NavigationEvent.AT_TARGET = 2; + +NavigationEvent.BUBBLING_PHASE = 3; + +module.exports = NavigationEvent; +}, 335, null, "NavigationEvent"); +__d(/* NavigationEventEmitter */function(global, require, module, exports) { +'use strict'; + +var EventEmitter = require(103 ); // 103 = EventEmitter +var NavigationEvent = require(335 ); // 335 = NavigationEvent + +var NavigationEventEmitter = function (_EventEmitter) { + babelHelpers.inherits(NavigationEventEmitter, _EventEmitter); + + function NavigationEventEmitter(target) { + babelHelpers.classCallCheck(this, NavigationEventEmitter); + + var _this = babelHelpers.possibleConstructorReturn(this, (NavigationEventEmitter.__proto__ || Object.getPrototypeOf(NavigationEventEmitter)).call(this)); + + _this._emitting = false; + _this._emitQueue = []; + _this._target = target; + return _this; + } + + babelHelpers.createClass(NavigationEventEmitter, [{ + key: 'emit', + value: function emit(eventType, data, didEmitCallback, extraInfo) { + if (this._emitting) { + var args = Array.prototype.slice.call(arguments); + this._emitQueue.push(args); + return; + } + + this._emitting = true; + + var event = NavigationEvent.pool(eventType, this._target, data); + + if (extraInfo) { + if (extraInfo.target) { + event.target = extraInfo.target; + } + + if (extraInfo.eventPhase) { + event.eventPhase = extraInfo.eventPhase; + } + + if (extraInfo.defaultPrevented) { + event.preventDefault(); + } + + if (extraInfo.propagationStopped) { + event.stopPropagation(); + } + } + + babelHelpers.get(NavigationEventEmitter.prototype.__proto__ || Object.getPrototypeOf(NavigationEventEmitter.prototype), 'emit', this).call(this, String(eventType), event); + + if (typeof didEmitCallback === 'function') { + didEmitCallback.call(this._target, event); + } + event.dispose(); + + this._emitting = false; + + while (this._emitQueue.length) { + var args = this._emitQueue.shift(); + this.emit.apply(this, args); + } + } + }]); + return NavigationEventEmitter; +}(EventEmitter); + +module.exports = NavigationEventEmitter; +}, 336, null, "NavigationEventEmitter"); +__d(/* NavigationTreeNode */function(global, require, module, exports) { + +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var immutable = require(338 ); // 338 = immutable + +var List = immutable.List; + +var NavigationTreeNode = function () { + function NavigationTreeNode(value) { + babelHelpers.classCallCheck(this, NavigationTreeNode); + + this.__parent = null; + this._children = new List(); + this._value = value; + } + + babelHelpers.createClass(NavigationTreeNode, [{ + key: 'getValue', + value: function getValue() { + return this._value; + } + }, { + key: 'getParent', + value: function getParent() { + return this.__parent; + } + }, { + key: 'getChildrenCount', + value: function getChildrenCount() { + return this._children.size; + } + }, { + key: 'getChildAt', + value: function getChildAt(index) { + return index > -1 && index < this._children.size ? this._children.get(index) : null; + } + }, { + key: 'appendChild', + value: function appendChild(child) { + if (child.__parent) { + child.__parent.removeChild(child); + } + child.__parent = this; + this._children = this._children.push(child); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + var index = this._children.indexOf(child); + + invariant(index > -1, 'The node to be removed is not a child of this node.'); + + child.__parent = null; + + this._children = this._children.splice(index, 1); + } + }, { + key: 'indexOf', + value: function indexOf(child) { + return this._children.indexOf(child); + } + }, { + key: 'forEach', + value: function forEach(callback, context) { + this._children.forEach(callback, context); + } + }, { + key: 'map', + value: function map(callback, context) { + return this._children.map(callback, context).toJS(); + } + }, { + key: 'some', + value: function some(callback, context) { + return this._children.some(callback, context); + } + }]); + return NavigationTreeNode; +}(); + +module.exports = NavigationTreeNode; +}, 337, null, "NavigationTreeNode"); +__d(/* immutable/dist/immutable.js */function(global, require, module, exports) { + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.Immutable = factory(); +})(this, function () { + 'use strict'; + var SLICE$0 = Array.prototype.slice; + + function createClass(ctor, superClass) { + if (superClass) { + ctor.prototype = Object.create(superClass.prototype); + } + ctor.prototype.constructor = ctor; + } + + function Iterable(value) { + return isIterable(value) ? value : Seq(value); + } + + createClass(KeyedIterable, Iterable); + function KeyedIterable(value) { + return isKeyed(value) ? value : KeyedSeq(value); + } + + createClass(IndexedIterable, Iterable); + function IndexedIterable(value) { + return isIndexed(value) ? value : IndexedSeq(value); + } + + createClass(SetIterable, Iterable); + function SetIterable(value) { + return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); + } + + function isIterable(maybeIterable) { + return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); + } + + function isKeyed(maybeKeyed) { + return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); + } + + function isIndexed(maybeIndexed) { + return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); + } + + function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); + } + + function isOrdered(maybeOrdered) { + return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); + } + + Iterable.isIterable = isIterable; + Iterable.isKeyed = isKeyed; + Iterable.isIndexed = isIndexed; + Iterable.isAssociative = isAssociative; + Iterable.isOrdered = isOrdered; + + Iterable.Keyed = KeyedIterable; + Iterable.Indexed = IndexedIterable; + Iterable.Set = SetIterable; + + var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; + var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; + var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; + var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; + + var DELETE = 'delete'; + + var SHIFT = 5; + var SIZE = 1 << SHIFT; + var MASK = SIZE - 1; + + var NOT_SET = {}; + + var CHANGE_LENGTH = { value: false }; + var DID_ALTER = { value: false }; + + function MakeRef(ref) { + ref.value = false; + return ref; + } + + function SetRef(ref) { + ref && (ref.value = true); + } + + function OwnerID() {} + + function arrCopy(arr, offset) { + offset = offset || 0; + var len = Math.max(0, arr.length - offset); + var newArr = new Array(len); + for (var ii = 0; ii < len; ii++) { + newArr[ii] = arr[ii + offset]; + } + return newArr; + } + + function ensureSize(iter) { + if (iter.size === undefined) { + iter.size = iter.__iterate(returnTrue); + } + return iter.size; + } + + function wrapIndex(iter, index) { + if (typeof index !== 'number') { + var uint32Index = index >>> 0; + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; + } + + function returnTrue() { + return true; + } + + function wholeSlice(begin, end, size) { + return (begin === 0 || size !== undefined && begin <= -size) && (end === undefined || size !== undefined && end >= size); + } + + function resolveBegin(begin, size) { + return resolveIndex(begin, size, 0); + } + + function resolveEnd(end, size) { + return resolveIndex(end, size, size); + } + + function resolveIndex(index, size, defaultIndex) { + return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index); + } + + var ITERATE_KEYS = 0; + var ITERATE_VALUES = 1; + var ITERATE_ENTRIES = 2; + + var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && (typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'); + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + + var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; + + function Iterator(next) { + this.next = next; + } + + Iterator.prototype.toString = function () { + return '[Iterator]'; + }; + + Iterator.KEYS = ITERATE_KEYS; + Iterator.VALUES = ITERATE_VALUES; + Iterator.ENTRIES = ITERATE_ENTRIES; + + Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); + }; + Iterator.prototype[ITERATOR_SYMBOL] = function () { + return this; + }; + + function iteratorValue(type, k, v, iteratorResult) { + var value = type === 0 ? k : type === 1 ? v : [k, v]; + iteratorResult ? iteratorResult.value = value : iteratorResult = { + value: value, done: false + }; + return iteratorResult; + } + + function iteratorDone() { + return { value: undefined, done: true }; + } + + function hasIterator(maybeIterable) { + return !!getIteratorFn(maybeIterable); + } + + function isIterator(maybeIterator) { + return maybeIterator && typeof maybeIterator.next === 'function'; + } + + function getIterator(iterable) { + var iteratorFn = getIteratorFn(iterable); + return iteratorFn && iteratorFn.call(iterable); + } + + function getIteratorFn(iterable) { + var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + function isArrayLike(value) { + return value && typeof value.length === 'number'; + } + + createClass(Seq, Iterable); + function Seq(value) { + return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value); + } + + Seq.of = function () { + return Seq(arguments); + }; + + Seq.prototype.toSeq = function () { + return this; + }; + + Seq.prototype.toString = function () { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function () { + if (!this._cache && this.__iterateUncached) { + this._cache = this.entrySeq().toArray(); + this.size = this._cache.length; + } + return this; + }; + + Seq.prototype.__iterate = function (fn, reverse) { + return seqIterate(this, fn, reverse, true); + }; + + Seq.prototype.__iterator = function (type, reverse) { + return seqIterator(this, type, reverse, true); + }; + + createClass(KeyedSeq, Seq); + function KeyedSeq(value) { + return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value); + } + + KeyedSeq.prototype.toKeyedSeq = function () { + return this; + }; + + createClass(IndexedSeq, Seq); + function IndexedSeq(value) { + return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); + } + + IndexedSeq.of = function () { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function () { + return this; + }; + + IndexedSeq.prototype.toString = function () { + return this.__toString('Seq [', ']'); + }; + + IndexedSeq.prototype.__iterate = function (fn, reverse) { + return seqIterate(this, fn, reverse, false); + }; + + IndexedSeq.prototype.__iterator = function (type, reverse) { + return seqIterator(this, type, reverse, false); + }; + + createClass(SetSeq, Seq); + function SetSeq(value) { + return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq(); + } + + SetSeq.of = function () { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function () { + return this; + }; + + Seq.isSeq = isSeq; + Seq.Keyed = KeyedSeq; + Seq.Set = SetSeq; + Seq.Indexed = IndexedSeq; + + var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; + + Seq.prototype[IS_SEQ_SENTINEL] = true; + + createClass(ArraySeq, IndexedSeq); + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + ArraySeq.prototype.get = function (index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function (fn, reverse) { + var array = this._array; + var maxIndex = array.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { + return ii + 1; + } + } + return ii; + }; + + ArraySeq.prototype.__iterator = function (type, reverse) { + var array = this._array; + var maxIndex = array.length - 1; + var ii = 0; + return new Iterator(function () { + return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]); + }); + }; + + createClass(ObjectSeq, KeyedSeq); + function ObjectSeq(object) { + var keys = Object.keys(object); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + ObjectSeq.prototype.get = function (key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function (key) { + return this._object.hasOwnProperty(key); + }; + + ObjectSeq.prototype.__iterate = function (fn, reverse) { + var object = this._object; + var keys = this._keys; + var maxIndex = keys.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + var key = keys[reverse ? maxIndex - ii : ii]; + if (fn(object[key], key, this) === false) { + return ii + 1; + } + } + return ii; + }; + + ObjectSeq.prototype.__iterator = function (type, reverse) { + var object = this._object; + var keys = this._keys; + var maxIndex = keys.length - 1; + var ii = 0; + return new Iterator(function () { + var key = keys[reverse ? maxIndex - ii : ii]; + return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]); + }); + }; + + ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; + + createClass(IterableSeq, IndexedSeq); + function IterableSeq(iterable) { + this._iterable = iterable; + this.size = iterable.length || iterable.size; + } + + IterableSeq.prototype.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterable = this._iterable; + var iterator = getIterator(iterable); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + IterableSeq.prototype.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterable = this._iterable; + var iterator = getIterator(iterable); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + createClass(IteratorSeq, IndexedSeq); + function IteratorSeq(iterator) { + this._iterator = iterator; + this._iteratorCache = []; + } + + IteratorSeq.prototype.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterator = this._iterator; + var cache = this._iteratorCache; + var iterations = 0; + while (iterations < cache.length) { + if (fn(cache[iterations], iterations++, this) === false) { + return iterations; + } + } + var step; + while (!(step = iterator.next()).done) { + var val = step.value; + cache[iterations] = val; + if (fn(val, iterations++, this) === false) { + break; + } + } + return iterations; + }; + + IteratorSeq.prototype.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = this._iterator; + var cache = this._iteratorCache; + var iterations = 0; + return new Iterator(function () { + if (iterations >= cache.length) { + var step = iterator.next(); + if (step.done) { + return step; + } + cache[iterations] = step.value; + } + return iteratorValue(type, iterations, cache[iterations++]); + }); + }; + + function isSeq(maybeSeq) { + return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); + } + + var EMPTY_SEQ; + + function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); + } + + function keyedSeqFromValue(value) { + var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined; + if (!seq) { + throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value); + } + return seq; + } + + function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (!seq) { + throw new TypeError('Expected Array or iterable object of values: ' + value); + } + return seq; + } + + function seqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value) || typeof value === 'object' && new ObjectSeq(value); + if (!seq) { + throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value); + } + return seq; + } + + function maybeIndexedSeqFromValue(value) { + return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined; + } + + function seqIterate(seq, fn, reverse, useKeys) { + var cache = seq._cache; + if (cache) { + var maxIndex = cache.length - 1; + for (var ii = 0; ii <= maxIndex; ii++) { + var entry = cache[reverse ? maxIndex - ii : ii]; + if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { + return ii + 1; + } + } + return ii; + } + return seq.__iterateUncached(fn, reverse); + } + + function seqIterator(seq, type, reverse, useKeys) { + var cache = seq._cache; + if (cache) { + var maxIndex = cache.length - 1; + var ii = 0; + return new Iterator(function () { + var entry = cache[reverse ? maxIndex - ii : ii]; + return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); + }); + } + return seq.__iteratorUncached(type, reverse); + } + + function fromJS(json, converter) { + return converter ? fromJSWith(converter, json, '', { '': json }) : fromJSDefault(json); + } + + function fromJSWith(converter, json, key, parentJSON) { + if (Array.isArray(json)) { + return converter.call(parentJSON, key, IndexedSeq(json).map(function (v, k) { + return fromJSWith(converter, v, k, json); + })); + } + if (isPlainObj(json)) { + return converter.call(parentJSON, key, KeyedSeq(json).map(function (v, k) { + return fromJSWith(converter, v, k, json); + })); + } + return json; + } + + function fromJSDefault(json) { + if (Array.isArray(json)) { + return IndexedSeq(json).map(fromJSDefault).toList(); + } + if (isPlainObj(json)) { + return KeyedSeq(json).map(fromJSDefault).toMap(); + } + return json; + } + + function isPlainObj(value) { + return value && (value.constructor === Object || value.constructor === undefined); + } + + function is(valueA, valueB) { + if (valueA === valueB || valueA !== valueA && valueB !== valueB) { + return true; + } + if (!valueA || !valueB) { + return false; + } + if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') { + valueA = valueA.valueOf(); + valueB = valueB.valueOf(); + if (valueA === valueB || valueA !== valueA && valueB !== valueB) { + return true; + } + if (!valueA || !valueB) { + return false; + } + } + if (typeof valueA.equals === 'function' && typeof valueB.equals === 'function' && valueA.equals(valueB)) { + return true; + } + return false; + } + + function deepEqual(a, b) { + if (a === b) { + return true; + } + + if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) { + return false; + } + + if (a.size === 0 && b.size === 0) { + return true; + } + + var notAssociative = !isAssociative(a); + + if (isOrdered(a)) { + var entries = a.entries(); + return b.every(function (v, k) { + var entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done; + } + + var flipped = false; + + if (a.size === undefined) { + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } else { + flipped = true; + var _ = a; + a = b; + b = _; + } + } + + var allEqual = true; + var bSize = b.__iterate(function (v, k) { + if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { + allEqual = false; + return false; + } + }); + + return allEqual && a.size === bSize; + } + + createClass(Repeat, IndexedSeq); + + function Repeat(value, times) { + if (!(this instanceof Repeat)) { + return new Repeat(value, times); + } + this._value = value; + this.size = times === undefined ? Infinity : Math.max(0, times); + if (this.size === 0) { + if (EMPTY_REPEAT) { + return EMPTY_REPEAT; + } + EMPTY_REPEAT = this; + } + } + + Repeat.prototype.toString = function () { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function (index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function (searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function (begin, end) { + var size = this.size; + return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); + }; + + Repeat.prototype.reverse = function () { + return this; + }; + + Repeat.prototype.indexOf = function (searchValue) { + if (is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function (searchValue) { + if (is(this._value, searchValue)) { + return this.size; + } + return -1; + }; + + Repeat.prototype.__iterate = function (fn, reverse) { + for (var ii = 0; ii < this.size; ii++) { + if (fn(this._value, ii, this) === false) { + return ii + 1; + } + } + return ii; + }; + + Repeat.prototype.__iterator = function (type, reverse) { + var this$0 = this; + var ii = 0; + return new Iterator(function () { + return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone(); + }); + }; + + Repeat.prototype.equals = function (other) { + return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other); + }; + + var EMPTY_REPEAT; + + function invariant(condition, error) { + if (!condition) throw new Error(error); + } + + createClass(Range, IndexedSeq); + + function Range(start, end, step) { + if (!(this instanceof Range)) { + return new Range(start, end, step); + } + invariant(step !== 0, 'Cannot step a Range by 0'); + start = start || 0; + if (end === undefined) { + end = Infinity; + } + step = step === undefined ? 1 : Math.abs(step); + if (end < start) { + step = -step; + } + this._start = start; + this._end = end; + this._step = step; + this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); + if (this.size === 0) { + if (EMPTY_RANGE) { + return EMPTY_RANGE; + } + EMPTY_RANGE = this; + } + } + + Range.prototype.toString = function () { + if (this.size === 0) { + return 'Range []'; + } + return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]'; + }; + + Range.prototype.get = function (index, notSetValue) { + return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue; + }; + + Range.prototype.includes = function (searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex); + }; + + Range.prototype.slice = function (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + begin = resolveBegin(begin, this.size); + end = resolveEnd(end, this.size); + if (end <= begin) { + return new Range(0, 0); + } + return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); + }; + + Range.prototype.indexOf = function (searchValue) { + var offsetValue = searchValue - this._start; + if (offsetValue % this._step === 0) { + var index = offsetValue / this._step; + if (index >= 0 && index < this.size) { + return index; + } + } + return -1; + }; + + Range.prototype.lastIndexOf = function (searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function (fn, reverse) { + var maxIndex = this.size - 1; + var step = this._step; + var value = reverse ? this._start + maxIndex * step : this._start; + for (var ii = 0; ii <= maxIndex; ii++) { + if (fn(value, ii, this) === false) { + return ii + 1; + } + value += reverse ? -step : step; + } + return ii; + }; + + Range.prototype.__iterator = function (type, reverse) { + var maxIndex = this.size - 1; + var step = this._step; + var value = reverse ? this._start + maxIndex * step : this._start; + var ii = 0; + return new Iterator(function () { + var v = value; + value += reverse ? -step : step; + return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); + }); + }; + + Range.prototype.equals = function (other) { + return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other); + }; + + var EMPTY_RANGE; + + createClass(Collection, Iterable); + function Collection() { + throw TypeError('Abstract'); + } + + createClass(KeyedCollection, Collection);function KeyedCollection() {} + + createClass(IndexedCollection, Collection);function IndexedCollection() {} + + createClass(SetCollection, Collection);function SetCollection() {} + + Collection.Keyed = KeyedCollection; + Collection.Indexed = IndexedCollection; + Collection.Set = SetCollection; + + var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) { + a = a | 0; + b = b | 0; + var c = a & 0xffff; + var d = b & 0xffff; + + return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0; + }; + + function smi(i32) { + return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF; + } + + function hash(o) { + if (o === false || o === null || o === undefined) { + return 0; + } + if (typeof o.valueOf === 'function') { + o = o.valueOf(); + if (o === false || o === null || o === undefined) { + return 0; + } + } + if (o === true) { + return 1; + } + var type = typeof o; + if (type === 'number') { + var h = o | 0; + if (h !== o) { + h ^= o * 0xFFFFFFFF; + } + while (o > 0xFFFFFFFF) { + o /= 0xFFFFFFFF; + h ^= o; + } + return smi(h); + } + if (type === 'string') { + return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); + } + if (typeof o.hashCode === 'function') { + return o.hashCode(); + } + if (type === 'object') { + return hashJSObj(o); + } + if (typeof o.toString === 'function') { + return hashString(o.toString()); + } + throw new Error('Value type ' + type + ' cannot be hashed.'); + } + + function cachedHashString(string) { + var hash = stringHashCache[string]; + if (hash === undefined) { + hash = hashString(string); + if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { + STRING_HASH_CACHE_SIZE = 0; + stringHashCache = {}; + } + STRING_HASH_CACHE_SIZE++; + stringHashCache[string] = hash; + } + return hash; + } + + function hashString(string) { + var hash = 0; + for (var ii = 0; ii < string.length; ii++) { + hash = 31 * hash + string.charCodeAt(ii) | 0; + } + return smi(hash); + } + + function hashJSObj(obj) { + var hash; + if (usingWeakMap) { + hash = weakMap.get(obj); + if (hash !== undefined) { + return hash; + } + } + + hash = obj[UID_HASH_KEY]; + if (hash !== undefined) { + return hash; + } + + if (!canDefineProperty) { + hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hash !== undefined) { + return hash; + } + + hash = getIENodeHash(obj); + if (hash !== undefined) { + return hash; + } + } + + hash = ++objHashUID; + if (objHashUID & 0x40000000) { + objHashUID = 0; + } + + if (usingWeakMap) { + weakMap.set(obj, hash); + } else if (isExtensible !== undefined && isExtensible(obj) === false) { + throw new Error('Non-extensible objects are not allowed as keys.'); + } else if (canDefineProperty) { + Object.defineProperty(obj, UID_HASH_KEY, { + 'enumerable': false, + 'configurable': false, + 'writable': false, + 'value': hash + }); + } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + obj.propertyIsEnumerable = function () { + return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); + }; + obj.propertyIsEnumerable[UID_HASH_KEY] = hash; + } else if (obj.nodeType !== undefined) { + obj[UID_HASH_KEY] = hash; + } else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + + return hash; + } + + var isExtensible = Object.isExtensible; + + var canDefineProperty = function () { + try { + Object.defineProperty({}, '@', {}); + return true; + } catch (e) { + return false; + } + }(); + + function getIENodeHash(node) { + if (node && node.nodeType > 0) { + switch (node.nodeType) { + case 1: + return node.uniqueID; + case 9: + return node.documentElement && node.documentElement.uniqueID; + } + } + } + + var usingWeakMap = typeof WeakMap === 'function'; + var weakMap; + if (usingWeakMap) { + weakMap = new WeakMap(); + } + + var objHashUID = 0; + + var UID_HASH_KEY = '__immutablehash__'; + if (typeof Symbol === 'function') { + UID_HASH_KEY = Symbol(UID_HASH_KEY); + } + + var STRING_HASH_CACHE_MIN_STRLEN = 16; + var STRING_HASH_CACHE_MAX_SIZE = 255; + var STRING_HASH_CACHE_SIZE = 0; + var stringHashCache = {}; + + function assertNotInfinite(size) { + invariant(size !== Infinity, 'Cannot perform this action with an infinite size.'); + } + + createClass(Map, KeyedCollection); + + function Map(value) { + return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function (map) { + var iter = KeyedIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { + return map.set(k, v); + }); + }); + } + + Map.prototype.toString = function () { + return this.__toString('Map {', '}'); + }; + + Map.prototype.get = function (k, notSetValue) { + return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue; + }; + + Map.prototype.set = function (k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.setIn = function (keyPath, v) { + return this.updateIn(keyPath, NOT_SET, function () { + return v; + }); + }; + + Map.prototype.remove = function (k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteIn = function (keyPath) { + return this.updateIn(keyPath, function () { + return NOT_SET; + }); + }; + + Map.prototype.update = function (k, notSetValue, updater) { + return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater); + }; + + Map.prototype.updateIn = function (keyPath, notSetValue, updater) { + if (!updater) { + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater); + return updatedValue === NOT_SET ? undefined : updatedValue; + }; + + Map.prototype.clear = function () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._root = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyMap(); + }; + + Map.prototype.merge = function () { + return mergeIntoMapWith(this, undefined, arguments); + }; + + Map.prototype.mergeWith = function (merger) { + var iters = SLICE$0.call(arguments, 1); + return mergeIntoMapWith(this, merger, iters); + }; + + Map.prototype.mergeIn = function (keyPath) { + var iters = SLICE$0.call(arguments, 1); + return this.updateIn(keyPath, emptyMap(), function (m) { + return typeof m.merge === 'function' ? m.merge.apply(m, iters) : iters[iters.length - 1]; + }); + }; + + Map.prototype.mergeDeep = function () { + return mergeIntoMapWith(this, deepMerger, arguments); + }; + + Map.prototype.mergeDeepWith = function (merger) { + var iters = SLICE$0.call(arguments, 1); + return mergeIntoMapWith(this, deepMergerWith(merger), iters); + }; + + Map.prototype.mergeDeepIn = function (keyPath) { + var iters = SLICE$0.call(arguments, 1); + return this.updateIn(keyPath, emptyMap(), function (m) { + return typeof m.mergeDeep === 'function' ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1]; + }); + }; + + Map.prototype.sort = function (comparator) { + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function (mapper, comparator) { + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + Map.prototype.withMutations = function (fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; + }; + + Map.prototype.asMutable = function () { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); + }; + + Map.prototype.asImmutable = function () { + return this.__ensureOwner(); + }; + + Map.prototype.wasAltered = function () { + return this.__altered; + }; + + Map.prototype.__iterator = function (type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + var iterations = 0; + this._root && this._root.iterate(function (entry) { + iterations++; + return fn(entry[1], entry[0], this$0); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + function isMap(maybeMap) { + return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); + } + + Map.isMap = isMap; + + var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; + + var MapPrototype = Map.prototype; + MapPrototype[IS_MAP_SENTINEL] = true; + MapPrototype[DELETE] = MapPrototype.remove; + MapPrototype.removeIn = MapPrototype.deleteIn; + + function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; + } + + ArrayMapNode.prototype.get = function (shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; + }; + + ArrayMapNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + for (var len = entries.length; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + (removed || !exists) && SetRef(didChangeSize); + + if (removed && entries.length === 1) { + return; + } + + if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { + return createNodes(ownerID, entries, key, value); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop(); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new ArrayMapNode(ownerID, newEntries); + }; + + function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; + } + + BitmapIndexedNode.prototype.get = function (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK); + var bitmap = this.bitmap; + return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue); + }; + + BitmapIndexedNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var bit = 1 << keyHashFrag; + var bitmap = this.bitmap; + var exists = (bitmap & bit) !== 0; + + if (!exists && value === NOT_SET) { + return this; + } + + var idx = popCount(bitmap & bit - 1); + var nodes = this.nodes; + var node = exists ? nodes[idx] : undefined; + var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + + if (newNode === node) { + return this; + } + + if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { + return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); + } + + if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { + return nodes[idx ^ 1]; + } + + if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { + return newNode; + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; + var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.bitmap = newBitmap; + this.nodes = newNodes; + return this; + } + + return new BitmapIndexedNode(ownerID, newBitmap, newNodes); + }; + + function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; + } + + HashArrayMapNode.prototype.get = function (shift, keyHash, key, notSetValue) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var node = this.nodes[idx]; + return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; + }; + + HashArrayMapNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + var removed = value === NOT_SET; + var nodes = this.nodes; + var node = nodes[idx]; + + if (removed && !node) { + return this; + } + + var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + if (newNode === node) { + return this; + } + + var newCount = this.count; + if (!node) { + newCount++; + } else if (!newNode) { + newCount--; + if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { + return packNodes(ownerID, nodes, newCount, idx); + } + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newNodes = setIn(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); + }; + + function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; + } + + HashCollisionNode.prototype.get = function (shift, keyHash, key, notSetValue) { + var entries = this.entries; + for (var ii = 0, len = entries.length; ii < len; ii++) { + if (is(key, entries[ii][0])) { + return entries[ii][1]; + } + } + return notSetValue; + }; + + HashCollisionNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (keyHash === undefined) { + keyHash = hash(key); + } + + var removed = value === NOT_SET; + + if (keyHash !== this.keyHash) { + if (removed) { + return this; + } + SetRef(didAlter); + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); + } + + var entries = this.entries; + var idx = 0; + for (var len = entries.length; idx < len; idx++) { + if (is(key, entries[idx][0])) { + break; + } + } + var exists = idx < len; + + if (exists ? entries[idx][1] === value : removed) { + return this; + } + + SetRef(didAlter); + (removed || !exists) && SetRef(didChangeSize); + + if (removed && len === 2) { + return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); + } + + var isEditable = ownerID && ownerID === this.ownerID; + var newEntries = isEditable ? entries : arrCopy(entries); + + if (exists) { + if (removed) { + idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop(); + } else { + newEntries[idx] = [key, value]; + } + } else { + newEntries.push([key, value]); + } + + if (isEditable) { + this.entries = newEntries; + return this; + } + + return new HashCollisionNode(ownerID, this.keyHash, newEntries); + }; + + function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; + } + + ValueNode.prototype.get = function (shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; + }; + + ValueNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + var keyMatch = is(key, this.entry[0]); + if (keyMatch ? value === this.entry[1] : removed) { + return this; + } + + SetRef(didAlter); + + if (removed) { + SetRef(didChangeSize); + return; + } + + if (keyMatch) { + if (ownerID && ownerID === this.ownerID) { + this.entry[1] = value; + return this; + } + return new ValueNode(ownerID, this.keyHash, [key, value]); + } + + SetRef(didChangeSize); + return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); + }; + + ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) { + var entries = this.entries; + for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } + } + }; + + BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) { + var nodes = this.nodes; + for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + var node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } + } + }; + + ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); + }; + + createClass(MapIterator, Iterator); + + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + MapIterator.prototype.next = function () { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex; + if (node.entry) { + if (index === 0) { + return mapIteratorValue(type, node.entry); + } + } else if (node.entries) { + maxIndex = node.entries.length - 1; + if (index <= maxIndex) { + return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); + } + } else { + maxIndex = node.nodes.length - 1; + if (index <= maxIndex) { + var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + if (subNode) { + if (subNode.entry) { + return mapIteratorValue(type, subNode.entry); + } + stack = this._stack = mapIteratorFrame(subNode, stack); + } + continue; + } + } + stack = this._stack = this._stack.__prev; + } + return iteratorDone(); + }; + + function mapIteratorValue(type, entry) { + return iteratorValue(type, entry[0], entry[1]); + } + + function mapIteratorFrame(node, prev) { + return { + node: node, + index: 0, + __prev: prev + }; + } + + function makeMap(size, root, ownerID, hash) { + var map = Object.create(MapPrototype); + map.size = size; + map._root = root; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_MAP; + function emptyMap() { + return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); + } + + function updateMap(map, k, v) { + var newRoot; + var newSize; + if (!map._root) { + if (v === NOT_SET) { + return map; + } + newSize = 1; + newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); + } else { + var didChangeSize = MakeRef(CHANGE_LENGTH); + var didAlter = MakeRef(DID_ALTER); + newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); + if (!didAlter.value) { + return map; + } + newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); + } + if (map.__ownerID) { + map.size = newSize; + map._root = newRoot; + map.__hash = undefined; + map.__altered = true; + return map; + } + return newRoot ? makeMap(newSize, newRoot) : emptyMap(); + } + + function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + if (!node) { + if (value === NOT_SET) { + return node; + } + SetRef(didAlter); + SetRef(didChangeSize); + return new ValueNode(ownerID, keyHash, [key, value]); + } + return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); + } + + function isLeafNode(node) { + return node.constructor === ValueNode || node.constructor === HashCollisionNode; + } + + function mergeIntoNode(node, ownerID, shift, keyHash, entry) { + if (node.keyHash === keyHash) { + return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); + } + + var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + + var newNode; + var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : (newNode = new ValueNode(ownerID, keyHash, entry), idx1 < idx2 ? [node, newNode] : [newNode, node]); + + return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes); + } + + function createNodes(ownerID, entries, key, value) { + if (!ownerID) { + ownerID = new OwnerID(); + } + var node = new ValueNode(ownerID, hash(key), [key, value]); + for (var ii = 0; ii < entries.length; ii++) { + var entry = entries[ii]; + node = node.update(ownerID, 0, undefined, entry[0], entry[1]); + } + return node; + } + + function packNodes(ownerID, nodes, count, excluding) { + var bitmap = 0; + var packedII = 0; + var packedNodes = new Array(count); + for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + var node = nodes[ii]; + if (node !== undefined && ii !== excluding) { + bitmap |= bit; + packedNodes[packedII++] = node; + } + } + return new BitmapIndexedNode(ownerID, bitmap, packedNodes); + } + + function expandNodes(ownerID, nodes, bitmap, including, node) { + var count = 0; + var expandedNodes = new Array(SIZE); + for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; + } + expandedNodes[including] = node; + return new HashArrayMapNode(ownerID, count + 1, expandedNodes); + } + + function mergeIntoMapWith(map, merger, iterables) { + var iters = []; + for (var ii = 0; ii < iterables.length; ii++) { + var value = iterables[ii]; + var iter = KeyedIterable(value); + if (!isIterable(value)) { + iter = iter.map(function (v) { + return fromJS(v); + }); + } + iters.push(iter); + } + return mergeIntoCollectionWith(map, merger, iters); + } + + function deepMerger(existing, value, key) { + return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value; + } + + function deepMergerWith(merger) { + return function (existing, value, key) { + if (existing && existing.mergeDeepWith && isIterable(value)) { + return existing.mergeDeepWith(merger, value); + } + var nextValue = merger(existing, value, key); + return is(existing, nextValue) ? existing : nextValue; + }; + } + + function mergeIntoCollectionWith(collection, merger, iters) { + iters = iters.filter(function (x) { + return x.size !== 0; + }); + if (iters.length === 0) { + return collection; + } + if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { + return collection.constructor(iters[0]); + } + return collection.withMutations(function (collection) { + var mergeIntoMap = merger ? function (value, key) { + collection.update(key, NOT_SET, function (existing) { + return existing === NOT_SET ? value : merger(existing, value, key); + }); + } : function (value, key) { + collection.set(key, value); + }; + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoMap); + } + }); + } + + function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { + var isNotSet = existing === NOT_SET; + var step = keyPathIter.next(); + if (step.done) { + var existingValue = isNotSet ? notSetValue : existing; + var newValue = updater(existingValue); + return newValue === existingValue ? existing : newValue; + } + invariant(isNotSet || existing && existing.set, 'invalid keyPath'); + var key = step.value; + var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); + var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater); + return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated); + } + + function popCount(x) { + x = x - (x >> 1 & 0x55555555); + x = (x & 0x33333333) + (x >> 2 & 0x33333333); + x = x + (x >> 4) & 0x0f0f0f0f; + x = x + (x >> 8); + x = x + (x >> 16); + return x & 0x7f; + } + + function setIn(array, idx, val, canEdit) { + var newArray = canEdit ? array : arrCopy(array); + newArray[idx] = val; + return newArray; + } + + function spliceIn(array, idx, val, canEdit) { + var newLen = array.length + 1; + if (canEdit && idx + 1 === newLen) { + array[idx] = val; + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + newArray[ii] = val; + after = -1; + } else { + newArray[ii] = array[ii + after]; + } + } + return newArray; + } + + function spliceOut(array, idx, canEdit) { + var newLen = array.length - 1; + if (canEdit && idx === newLen) { + array.pop(); + return array; + } + var newArray = new Array(newLen); + var after = 0; + for (var ii = 0; ii < newLen; ii++) { + if (ii === idx) { + after = 1; + } + newArray[ii] = array[ii + after]; + } + return newArray; + } + + var MAX_ARRAY_MAP_SIZE = SIZE / 4; + var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; + var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; + + createClass(List, IndexedCollection); + + function List(value) { + var empty = emptyList(); + if (value === null || value === undefined) { + return empty; + } + if (isList(value)) { + return value; + } + var iter = IndexedIterable(value); + var size = iter.size; + if (size === 0) { + return empty; + } + assertNotInfinite(size); + if (size > 0 && size < SIZE) { + return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); + } + return empty.withMutations(function (list) { + list.setSize(size); + iter.forEach(function (v, i) { + return list.set(i, v); + }); + }); + } + + List.of = function () { + return this(arguments); + }; + + List.prototype.toString = function () { + return this.__toString('List [', ']'); + }; + + List.prototype.get = function (index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + List.prototype.set = function (index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function (index) { + return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1); + }; + + List.prototype.insert = function (index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = null; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function () { + var values = arguments; + var oldSize = this.size; + return this.withMutations(function (list) { + setListBounds(list, 0, oldSize + values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(oldSize + ii, values[ii]); + } + }); + }; + + List.prototype.pop = function () { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function () { + var values = arguments; + return this.withMutations(function (list) { + setListBounds(list, -values.length); + for (var ii = 0; ii < values.length; ii++) { + list.set(ii, values[ii]); + } + }); + }; + + List.prototype.shift = function () { + return setListBounds(this, 1); + }; + + List.prototype.merge = function () { + return mergeIntoListWith(this, undefined, arguments); + }; + + List.prototype.mergeWith = function (merger) { + var iters = SLICE$0.call(arguments, 1); + return mergeIntoListWith(this, merger, iters); + }; + + List.prototype.mergeDeep = function () { + return mergeIntoListWith(this, deepMerger, arguments); + }; + + List.prototype.mergeDeepWith = function (merger) { + var iters = SLICE$0.call(arguments, 1); + return mergeIntoListWith(this, deepMergerWith(merger), iters); + }; + + List.prototype.setSize = function (size) { + return setListBounds(this, 0, size); + }; + + List.prototype.slice = function (begin, end) { + var size = this.size; + if (wholeSlice(begin, end, size)) { + return this; + } + return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size)); + }; + + List.prototype.__iterator = function (type, reverse) { + var index = 0; + var values = iterateList(this, reverse); + return new Iterator(function () { + var value = values(); + return value === DONE ? iteratorDone() : iteratorValue(type, index++, value); + }); + }; + + List.prototype.__iterate = function (fn, reverse) { + var index = 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + return this; + } + return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); + }; + + function isList(maybeList) { + return !!(maybeList && maybeList[IS_LIST_SENTINEL]); + } + + List.isList = isList; + + var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; + + var ListPrototype = List.prototype; + ListPrototype[IS_LIST_SENTINEL] = true; + ListPrototype[DELETE] = ListPrototype.remove; + ListPrototype.setIn = MapPrototype.setIn; + ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn; + ListPrototype.update = MapPrototype.update; + ListPrototype.updateIn = MapPrototype.updateIn; + ListPrototype.mergeIn = MapPrototype.mergeIn; + ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; + ListPrototype.withMutations = MapPrototype.withMutations; + ListPrototype.asMutable = MapPrototype.asMutable; + ListPrototype.asImmutable = MapPrototype.asImmutable; + ListPrototype.wasAltered = MapPrototype.wasAltered; + + function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; + } + + VNode.prototype.removeBefore = function (ownerID, level, index) { + if (index === level ? 1 << level : 0 || this.array.length === 0) { + return this; + } + var originIndex = index >>> level & MASK; + if (originIndex >= this.array.length) { + return new VNode([], ownerID); + } + var removingFirst = originIndex === 0; + var newChild; + if (level > 0) { + var oldChild = this.array[originIndex]; + newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + if (newChild === oldChild && removingFirst) { + return this; + } + } + if (removingFirst && !newChild) { + return this; + } + var editable = editableVNode(this, ownerID); + if (!removingFirst) { + for (var ii = 0; ii < originIndex; ii++) { + editable.array[ii] = undefined; + } + } + if (newChild) { + editable.array[originIndex] = newChild; + } + return editable; + }; + + VNode.prototype.removeAfter = function (ownerID, level, index) { + if (index === (level ? 1 << level : 0) || this.array.length === 0) { + return this; + } + var sizeIndex = index - 1 >>> level & MASK; + if (sizeIndex >= this.array.length) { + return this; + } + + var newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + if (newChild) { + editable.array[sizeIndex] = newChild; + } + return editable; + }; + + var DONE = {}; + + function iterateList(list, reverse) { + var left = list._origin; + var right = list._capacity; + var tailPos = getTailOffset(right); + var tail = list._tail; + + return iterateNodeOrLeaf(list._root, list._level, 0); + + function iterateNodeOrLeaf(node, level, offset) { + return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset); + } + + function iterateLeaf(node, offset) { + var array = offset === tailPos ? tail && tail.array : node && node.array; + var from = offset > left ? 0 : left - offset; + var to = right - offset; + if (to > SIZE) { + to = SIZE; + } + return function () { + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + return array && array[idx]; + }; + } + + function iterateNode(node, level, offset) { + var values; + var array = node && node.array; + var from = offset > left ? 0 : left - offset >> level; + var to = (right - offset >> level) + 1; + if (to > SIZE) { + to = SIZE; + } + return function () { + do { + if (values) { + var value = values(); + if (value !== DONE) { + return value; + } + values = null; + } + if (from === to) { + return DONE; + } + var idx = reverse ? --to : from++; + values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level)); + } while (true); + }; + } + } + + function makeList(origin, capacity, level, root, tail, ownerID, hash) { + var list = Object.create(ListPrototype); + list.size = capacity - origin; + list._origin = origin; + list._capacity = capacity; + list._level = level; + list._root = root; + list._tail = tail; + list.__ownerID = ownerID; + list.__hash = hash; + list.__altered = false; + return list; + } + + var EMPTY_LIST; + function emptyList() { + return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); + } + + function updateList(list, index, value) { + index = wrapIndex(list, index); + + if (index !== index) { + return list; + } + + if (index >= list.size || index < 0) { + return list.withMutations(function (list) { + index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value); + }); + } + + index += list._origin; + + var newTail = list._tail; + var newRoot = list._root; + var didAlter = MakeRef(DID_ALTER); + if (index >= getTailOffset(list._capacity)) { + newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); + } else { + newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); + } + + if (!didAlter.value) { + return list; + } + + if (list.__ownerID) { + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(list._origin, list._capacity, list._level, newRoot, newTail); + } + + function updateVNode(node, ownerID, level, index, value, didAlter) { + var idx = index >>> level & MASK; + var nodeHas = node && idx < node.array.length; + if (!nodeHas && value === undefined) { + return node; + } + + var newNode; + + if (level > 0) { + var lowerNode = node && node.array[idx]; + var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); + if (newLowerNode === lowerNode) { + return node; + } + newNode = editableVNode(node, ownerID); + newNode.array[idx] = newLowerNode; + return newNode; + } + + if (nodeHas && node.array[idx] === value) { + return node; + } + + SetRef(didAlter); + + newNode = editableVNode(node, ownerID); + if (value === undefined && idx === newNode.array.length - 1) { + newNode.array.pop(); + } else { + newNode.array[idx] = value; + } + return newNode; + } + + function editableVNode(node, ownerID) { + if (ownerID && node && ownerID === node.ownerID) { + return node; + } + return new VNode(node ? node.array.slice() : [], ownerID); + } + + function listNodeFor(list, rawIndex) { + if (rawIndex >= getTailOffset(list._capacity)) { + return list._tail; + } + if (rawIndex < 1 << list._level + SHIFT) { + var node = list._root; + var level = list._level; + while (node && level > 0) { + node = node.array[rawIndex >>> level & MASK]; + level -= SHIFT; + } + return node; + } + } + + function setListBounds(list, begin, end) { + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + end = end | 0; + } + var owner = list.__ownerID || new OwnerID(); + var oldOrigin = list._origin; + var oldCapacity = list._capacity; + var newOrigin = oldOrigin + begin; + var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; + if (newOrigin === oldOrigin && newCapacity === oldCapacity) { + return list; + } + + if (newOrigin >= newCapacity) { + return list.clear(); + } + + var newLevel = list._level; + var newRoot = list._root; + + var offsetShift = 0; + while (newOrigin + offsetShift < 0) { + newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); + newLevel += SHIFT; + offsetShift += 1 << newLevel; + } + if (offsetShift) { + newOrigin += offsetShift; + oldOrigin += offsetShift; + newCapacity += offsetShift; + oldCapacity += offsetShift; + } + + var oldTailOffset = getTailOffset(oldCapacity); + var newTailOffset = getTailOffset(newCapacity); + + while (newTailOffset >= 1 << newLevel + SHIFT) { + newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); + newLevel += SHIFT; + } + + var oldTail = list._tail; + var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; + + if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { + newRoot = editableVNode(newRoot, owner); + var node = newRoot; + for (var level = newLevel; level > SHIFT; level -= SHIFT) { + var idx = oldTailOffset >>> level & MASK; + node = node.array[idx] = editableVNode(node.array[idx], owner); + } + node.array[oldTailOffset >>> SHIFT & MASK] = oldTail; + } + + if (newCapacity < oldCapacity) { + newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); + } + + if (newOrigin >= newTailOffset) { + newOrigin -= newTailOffset; + newCapacity -= newTailOffset; + newLevel = SHIFT; + newRoot = null; + newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); + } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { + offsetShift = 0; + + while (newRoot) { + var beginIndex = newOrigin >>> newLevel & MASK; + if (beginIndex !== newTailOffset >>> newLevel & MASK) { + break; + } + if (beginIndex) { + offsetShift += (1 << newLevel) * beginIndex; + } + newLevel -= SHIFT; + newRoot = newRoot.array[beginIndex]; + } + + if (newRoot && newOrigin > oldOrigin) { + newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); + } + if (newRoot && newTailOffset < oldTailOffset) { + newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); + } + if (offsetShift) { + newOrigin -= offsetShift; + newCapacity -= offsetShift; + } + } + + if (list.__ownerID) { + list.size = newCapacity - newOrigin; + list._origin = newOrigin; + list._capacity = newCapacity; + list._level = newLevel; + list._root = newRoot; + list._tail = newTail; + list.__hash = undefined; + list.__altered = true; + return list; + } + return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); + } + + function mergeIntoListWith(list, merger, iterables) { + var iters = []; + var maxSize = 0; + for (var ii = 0; ii < iterables.length; ii++) { + var value = iterables[ii]; + var iter = IndexedIterable(value); + if (iter.size > maxSize) { + maxSize = iter.size; + } + if (!isIterable(value)) { + iter = iter.map(function (v) { + return fromJS(v); + }); + } + iters.push(iter); + } + if (maxSize > list.size) { + list = list.setSize(maxSize); + } + return mergeIntoCollectionWith(list, merger, iters); + } + + function getTailOffset(size) { + return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT; + } + + createClass(OrderedMap, Map); + + function OrderedMap(value) { + return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function (map) { + var iter = KeyedIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { + return map.set(k, v); + }); + }); + } + + OrderedMap.of = function () { + return this(arguments); + }; + + OrderedMap.prototype.toString = function () { + return this.__toString('OrderedMap {', '}'); + }; + + OrderedMap.prototype.get = function (k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + OrderedMap.prototype.clear = function () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function (k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function (k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.wasAltered = function () { + return this._map.wasAltered() || this._list.wasAltered(); + }; + + OrderedMap.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + return this._list.__iterate(function (entry) { + return entry && fn(entry[1], entry[0], this$0); + }, reverse); + }; + + OrderedMap.prototype.__iterator = function (type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var newList = this._list.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + this._list = newList; + return this; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); + } + + OrderedMap.isOrderedMap = isOrderedMap; + + OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; + OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; + + function makeOrderedMap(map, list, ownerID, hash) { + var omap = Object.create(OrderedMap.prototype); + omap.size = map ? map.size : 0; + omap._map = map; + omap._list = list; + omap.__ownerID = ownerID; + omap.__hash = hash; + return omap; + } + + var EMPTY_ORDERED_MAP; + function emptyOrderedMap() { + return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); + } + + function updateOrderedMap(omap, k, v) { + var map = omap._map; + var list = omap._list; + var i = map.get(k); + var has = i !== undefined; + var newMap; + var newList; + if (v === NOT_SET) { + if (!has) { + return omap; + } + if (list.size >= SIZE && list.size >= map.size * 2) { + newList = list.filter(function (entry, idx) { + return entry !== undefined && i !== idx; + }); + newMap = newList.toKeyedSeq().map(function (entry) { + return entry[0]; + }).flip().toMap(); + if (omap.__ownerID) { + newMap.__ownerID = newList.__ownerID = omap.__ownerID; + } + } else { + newMap = map.remove(k); + newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); + } + } else { + if (has) { + if (v === list.get(i)[1]) { + return omap; + } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); + } + } + if (omap.__ownerID) { + omap.size = newMap.size; + omap._map = newMap; + omap._list = newList; + omap.__hash = undefined; + return omap; + } + return makeOrderedMap(newMap, newList); + } + + createClass(ToKeyedSequence, KeyedSeq); + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + ToKeyedSequence.prototype.get = function (key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function (key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function () { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function () { + var this$0 = this; + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function () { + return this$0._iter.toSeq().reverse(); + }; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function (mapper, context) { + var this$0 = this; + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function () { + return this$0._iter.toSeq().map(mapper, context); + }; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + var ii; + return this._iter.__iterate(this._useKeys ? function (v, k) { + return fn(v, k, this$0); + } : (ii = reverse ? resolveSize(this) : 0, function (v) { + return fn(v, reverse ? --ii : ii++, this$0); + }), reverse); + }; + + ToKeyedSequence.prototype.__iterator = function (type, reverse) { + if (this._useKeys) { + return this._iter.__iterator(type, reverse); + } + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var ii = reverse ? resolveSize(this) : 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step); + }); + }; + + ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; + + createClass(ToIndexedSequence, IndexedSeq); + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + ToIndexedSequence.prototype.includes = function (value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + var iterations = 0; + return this._iter.__iterate(function (v) { + return fn(v, iterations++, this$0); + }, reverse); + }; + + ToIndexedSequence.prototype.__iterator = function (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value, step); + }); + }; + + createClass(ToSetSequence, SetSeq); + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + ToSetSequence.prototype.has = function (key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + return this._iter.__iterate(function (v) { + return fn(v, v, this$0); + }, reverse); + }; + + ToSetSequence.prototype.__iterator = function (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, step.value, step.value, step); + }); + }; + + createClass(FromEntriesSequence, KeyedSeq); + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + FromEntriesSequence.prototype.entrySeq = function () { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + return this._iter.__iterate(function (entry) { + if (entry) { + validateEntry(entry); + var indexedIterable = isIterable(entry); + return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + + if (entry) { + validateEntry(entry); + var indexedIterable = isIterable(entry); + return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step); + } + } + }); + }; + + ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough; + + function flipFactory(iterable) { + var flipSequence = makeSequence(iterable); + flipSequence._iter = iterable; + flipSequence.size = iterable.size; + flipSequence.flip = function () { + return iterable; + }; + flipSequence.reverse = function () { + var reversedSequence = iterable.reverse.apply(this); + reversedSequence.flip = function () { + return iterable.reverse(); + }; + return reversedSequence; + }; + flipSequence.has = function (key) { + return iterable.includes(key); + }; + flipSequence.includes = function (key) { + return iterable.has(key); + }; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + return iterable.__iterate(function (v, k) { + return fn(k, v, this$0) !== false; + }, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = iterable.__iterator(type, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (!step.done) { + var k = step.value[0]; + step.value[0] = step.value[1]; + step.value[1] = k; + } + return step; + }); + } + return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse); + }; + return flipSequence; + } + + function mapFactory(iterable, mapper, context) { + var mappedSequence = makeSequence(iterable); + mappedSequence.size = iterable.size; + mappedSequence.has = function (key) { + return iterable.has(key); + }; + mappedSequence.get = function (key, notSetValue) { + var v = iterable.get(key, NOT_SET); + return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable); + }; + mappedSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + return iterable.__iterate(function (v, k, c) { + return fn(mapper.call(context, v, k, c), k, this$0) !== false; + }, reverse); + }; + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step); + }); + }; + return mappedSequence; + } + + function reverseFactory(iterable, useKeys) { + var reversedSequence = makeSequence(iterable); + reversedSequence._iter = iterable; + reversedSequence.size = iterable.size; + reversedSequence.reverse = function () { + return iterable; + }; + if (iterable.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(iterable); + flipSequence.reverse = function () { + return iterable.flip(); + }; + return flipSequence; + }; + } + reversedSequence.get = function (key, notSetValue) { + return iterable.get(useKeys ? key : -1 - key, notSetValue); + }; + reversedSequence.has = function (key) { + return iterable.has(useKeys ? key : -1 - key); + }; + reversedSequence.includes = function (value) { + return iterable.includes(value); + }; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) { + var this$0 = this; + return iterable.__iterate(function (v, k) { + return fn(v, k, this$0); + }, !reverse); + }; + reversedSequence.__iterator = function (type, reverse) { + return iterable.__iterator(type, !reverse); + }; + return reversedSequence; + } + + function filterFactory(iterable, predicate, context, useKeys) { + var filterSequence = makeSequence(iterable); + if (useKeys) { + filterSequence.has = function (key) { + var v = iterable.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, iterable); + }; + filterSequence.get = function (key, notSetValue) { + var v = iterable.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + var iterations = 0; + iterable.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new Iterator(function () { + while (true) { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var key = entry[0]; + var value = entry[1]; + if (predicate.call(context, value, key, iterable)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + }; + return filterSequence; + } + + function countByFactory(iterable, grouper, context) { + var groups = Map().asMutable(); + iterable.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, iterable), 0, function (a) { + return a + 1; + }); + }); + return groups.asImmutable(); + } + + function groupByFactory(iterable, grouper, context) { + var isKeyedIter = isKeyed(iterable); + var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); + iterable.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, iterable), function (a) { + return a = a || [], a.push(isKeyedIter ? [k, v] : v), a; + }); + }); + var coerce = iterableClass(iterable); + return groups.map(function (arr) { + return reify(iterable, coerce(arr)); + }); + } + + function sliceFactory(iterable, begin, end, useKeys) { + var originalSize = iterable.size; + + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + end = end | 0; + } + + if (wholeSlice(begin, end, originalSize)) { + return iterable; + } + + var resolvedBegin = resolveBegin(begin, originalSize); + var resolvedEnd = resolveEnd(end, originalSize); + + if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { + return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); + } + + var resolvedSize = resolvedEnd - resolvedBegin; + var sliceSize; + if (resolvedSize === resolvedSize) { + sliceSize = resolvedSize < 0 ? 0 : resolvedSize; + } + + var sliceSeq = makeSequence(iterable); + + sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; + + if (!useKeys && isSeq(iterable) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue; + }; + } + + sliceSeq.__iterateUncached = function (fn, reverse) { + var this$0 = this; + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + iterable.__iterate(function (v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize; + } + }); + return iterations; + }; + + sliceSeq.__iteratorUncached = function (type, reverse) { + if (sliceSize !== 0 && reverse) { + return this.cacheResult().__iterator(type, reverse); + } + + var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function () { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES) { + return step; + } else if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } else { + return iteratorValue(type, iterations - 1, step.value[1], step); + } + }); + }; + + return sliceSeq; + } + + function takeWhileFactory(iterable, predicate, context) { + var takeSequence = makeSequence(iterable); + takeSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + iterable.__iterate(function (v, k, c) { + return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0); + }); + return iterations; + }; + takeSequence.__iteratorUncached = function (type, reverse) { + var this$0 = this; + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new Iterator(function () { + if (!iterating) { + return iteratorDone(); + } + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + var k = entry[0]; + var v = entry[1]; + if (!predicate.call(context, v, k, this$0)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return takeSequence; + } + + function skipWhileFactory(iterable, predicate, context, useKeys) { + var skipSequence = makeSequence(iterable); + skipSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + iterable.__iterate(function (v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$0); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function (type, reverse) { + var this$0 = this; + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function () { + var step, k, v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } else if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } else { + return iteratorValue(type, iterations++, step.value[1], step); + } + } + var entry = step.value; + k = entry[0]; + v = entry[1]; + skipping && (skipping = predicate.call(context, v, k, this$0)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return skipSequence; + } + + function concatFactory(iterable, values) { + var isKeyedIterable = isKeyed(iterable); + var iters = [iterable].concat(values).map(function (v) { + if (!isIterable(v)) { + v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedIterable) { + v = KeyedIterable(v); + } + return v; + }).filter(function (v) { + return v.size !== 0; + }); + + if (iters.length === 0) { + return iterable; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) { + return singleton; + } + } + + var concatSeq = new ArraySeq(iters); + if (isKeyedIterable) { + concatSeq = concatSeq.toKeyedSeq(); + } else if (!isIndexed(iterable)) { + concatSeq = concatSeq.toSetSeq(); + } + concatSeq = concatSeq.flatten(true); + concatSeq.size = iters.reduce(function (sum, seq) { + if (sum !== undefined) { + var size = seq.size; + if (size !== undefined) { + return sum + size; + } + } + }, 0); + return concatSeq; + } + + function flattenFactory(iterable, depth, useKeys) { + var flatSequence = makeSequence(iterable); + flatSequence.__iterateUncached = function (fn, reverse) { + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) { + var this$0 = this; + iter.__iterate(function (v, k) { + if ((!depth || currentDepth < depth) && isIterable(v)) { + flatDeep(v, currentDepth + 1); + } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { + stopped = true; + } + return !stopped; + }, reverse); + } + flatDeep(iterable, 0); + return iterations; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new Iterator(function () { + while (iterator) { + var step = iterator.next(); + if (step.done !== false) { + iterator = stack.pop(); + continue; + } + var v = step.value; + if (type === ITERATE_ENTRIES) { + v = v[1]; + } + if ((!depth || stack.length < depth) && isIterable(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + }; + return flatSequence; + } + + function flatMapFactory(iterable, mapper, context) { + var coerce = iterableClass(iterable); + return iterable.toSeq().map(function (v, k) { + return coerce(mapper.call(context, v, k, iterable)); + }).flatten(true); + } + + function interposeFactory(iterable, separator) { + var interposedSequence = makeSequence(iterable); + interposedSequence.size = iterable.size && iterable.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + var this$0 = this; + var iterations = 0; + iterable.__iterate(function (v, k) { + return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false; + }, reverse); + return iterations; + }; + interposedSequence.__iteratorUncached = function (type, reverse) { + var iterator = iterable.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new Iterator(function () { + if (!step || iterations % 2) { + step = iterator.next(); + if (step.done) { + return step; + } + } + return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step); + }); + }; + return interposedSequence; + } + + function sortFactory(iterable, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedIterable = isKeyed(iterable); + var index = 0; + var entries = iterable.toSeq().map(function (v, k) { + return [k, v, index++, mapper ? mapper(v, k, iterable) : v]; + }).toArray(); + entries.sort(function (a, b) { + return comparator(a[3], b[3]) || a[2] - b[2]; + }).forEach(isKeyedIterable ? function (v, i) { + entries[i].length = 2; + } : function (v, i) { + entries[i] = v[1]; + }); + return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries); + } + + function maxFactory(iterable, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = iterable.toSeq().map(function (v, k) { + return [v, mapper(v, k, iterable)]; + }).reduce(function (a, b) { + return maxCompare(comparator, a[1], b[1]) ? b : a; + }); + return entry && entry[0]; + } else { + return iterable.reduce(function (a, b) { + return maxCompare(comparator, a, b) ? b : a; + }); + } + } + + function maxCompare(comparator, a, b) { + var comp = comparator(b, a); + + return comp === 0 && b !== a && (b === undefined || b === null || b !== b) || comp > 0; + } + + function zipWithFactory(keyIter, zipper, iters) { + var zipSequence = makeSequence(keyIter); + zipSequence.size = new ArraySeq(iters).map(function (i) { + return i.size; + }).min(); + + zipSequence.__iterate = function (fn, reverse) { + var iterator = this.__iterator(ITERATE_VALUES, reverse); + var step; + var iterations = 0; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + return iterations; + }; + zipSequence.__iteratorUncached = function (type, reverse) { + var iterators = iters.map(function (i) { + return i = Iterable(i), getIterator(reverse ? i.reverse() : i); + }); + var iterations = 0; + var isDone = false; + return new Iterator(function () { + var steps; + if (!isDone) { + steps = iterators.map(function (i) { + return i.next(); + }); + isDone = steps.some(function (s) { + return s.done; + }); + } + if (isDone) { + return iteratorDone(); + } + return iteratorValue(type, iterations++, zipper.apply(null, steps.map(function (s) { + return s.value; + }))); + }); + }; + return zipSequence; + } + + function reify(iter, seq) { + return isSeq(iter) ? seq : iter.constructor(seq); + } + + function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } + } + + function resolveSize(iter) { + assertNotInfinite(iter.size); + return ensureSize(iter); + } + + function iterableClass(iterable) { + return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable; + } + + function makeSequence(iterable) { + return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype); + } + + function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return this; + } else { + return Seq.prototype.cacheResult.call(this); + } + } + + function defaultComparator(a, b) { + return a > b ? 1 : a < b ? -1 : 0; + } + + function forceIterator(keyPath) { + var iter = getIterator(keyPath); + if (!iter) { + if (!isArrayLike(keyPath)) { + throw new TypeError('Expected iterable or array-like: ' + keyPath); + } + iter = getIterator(Iterable(keyPath)); + } + return iter; + } + + createClass(Record, KeyedCollection); + + function Record(defaultValues, name) { + var hasInitialized; + + var RecordType = function Record(values) { + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + setProps(RecordTypePrototype, keys); + RecordTypePrototype.size = keys.length; + RecordTypePrototype._name = name; + RecordTypePrototype._keys = keys; + RecordTypePrototype._defaultValues = defaultValues; + } + this._map = Map(values); + }; + + var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); + RecordTypePrototype.constructor = RecordType; + + return RecordType; + } + + Record.prototype.toString = function () { + return this.__toString(recordName(this) + ' {', '}'); + }; + + Record.prototype.has = function (k) { + return this._defaultValues.hasOwnProperty(k); + }; + + Record.prototype.get = function (k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var defaultVal = this._defaultValues[k]; + return this._map ? this._map.get(k, defaultVal) : defaultVal; + }; + + Record.prototype.clear = function () { + if (this.__ownerID) { + this._map && this._map.clear(); + return this; + } + var RecordType = this.constructor; + return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); + }; + + Record.prototype.set = function (k, v) { + if (!this.has(k)) { + throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); + } + var newMap = this._map && this._map.set(k, v); + if (this.__ownerID || newMap === this._map) { + return this; + } + return makeRecord(this, newMap); + }; + + Record.prototype.remove = function (k) { + if (!this.has(k)) { + return this; + } + var newMap = this._map && this._map.remove(k); + if (this.__ownerID || newMap === this._map) { + return this; + } + return makeRecord(this, newMap); + }; + + Record.prototype.wasAltered = function () { + return this._map.wasAltered(); + }; + + Record.prototype.__iterator = function (type, reverse) { + var this$0 = this; + return KeyedIterable(this._defaultValues).map(function (_, k) { + return this$0.get(k); + }).__iterator(type, reverse); + }; + + Record.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + return KeyedIterable(this._defaultValues).map(function (_, k) { + return this$0.get(k); + }).__iterate(fn, reverse); + }; + + Record.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map && this._map.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return makeRecord(this, newMap, ownerID); + }; + + var RecordPrototype = Record.prototype; + RecordPrototype[DELETE] = RecordPrototype.remove; + RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn; + RecordPrototype.merge = MapPrototype.merge; + RecordPrototype.mergeWith = MapPrototype.mergeWith; + RecordPrototype.mergeIn = MapPrototype.mergeIn; + RecordPrototype.mergeDeep = MapPrototype.mergeDeep; + RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; + RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; + RecordPrototype.setIn = MapPrototype.setIn; + RecordPrototype.update = MapPrototype.update; + RecordPrototype.updateIn = MapPrototype.updateIn; + RecordPrototype.withMutations = MapPrototype.withMutations; + RecordPrototype.asMutable = MapPrototype.asMutable; + RecordPrototype.asImmutable = MapPrototype.asImmutable; + + function makeRecord(likeRecord, map, ownerID) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._map = map; + record.__ownerID = ownerID; + return record; + } + + function recordName(record) { + return record._name || record.constructor.name || 'Record'; + } + + function setProps(prototype, names) { + try { + names.forEach(setProp.bind(undefined, prototype)); + } catch (error) {} + } + + function setProp(prototype, name) { + Object.defineProperty(prototype, name, { + get: function get() { + return this.get(name); + }, + set: function set(value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + } + }); + } + + createClass(Set, SetCollection); + + function Set(value) { + return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function (set) { + var iter = SetIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { + return set.add(v); + }); + }); + } + + Set.of = function () { + return this(arguments); + }; + + Set.fromKeys = function (value) { + return this(KeyedIterable(value).keySeq()); + }; + + Set.prototype.toString = function () { + return this.__toString('Set {', '}'); + }; + + Set.prototype.has = function (value) { + return this._map.has(value); + }; + + Set.prototype.add = function (value) { + return updateSet(this, this._map.set(value, true)); + }; + + Set.prototype.remove = function (value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function () { + return updateSet(this, this._map.clear()); + }; + + Set.prototype.union = function () { + var iters = SLICE$0.call(arguments, 0); + iters = iters.filter(function (x) { + return x.size !== 0; + }); + if (iters.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && iters.length === 1) { + return this.constructor(iters[0]); + } + return this.withMutations(function (set) { + for (var ii = 0; ii < iters.length; ii++) { + SetIterable(iters[ii]).forEach(function (value) { + return set.add(value); + }); + } + }); + }; + + Set.prototype.intersect = function () { + var iters = SLICE$0.call(arguments, 0); + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { + return SetIterable(iter); + }); + var originalSet = this; + return this.withMutations(function (set) { + originalSet.forEach(function (value) { + if (!iters.every(function (iter) { + return iter.includes(value); + })) { + set.remove(value); + } + }); + }); + }; + + Set.prototype.subtract = function () { + var iters = SLICE$0.call(arguments, 0); + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { + return SetIterable(iter); + }); + var originalSet = this; + return this.withMutations(function (set) { + originalSet.forEach(function (value) { + if (iters.some(function (iter) { + return iter.includes(value); + })) { + set.remove(value); + } + }); + }); + }; + + Set.prototype.merge = function () { + return this.union.apply(this, arguments); + }; + + Set.prototype.mergeWith = function (merger) { + var iters = SLICE$0.call(arguments, 1); + return this.union.apply(this, iters); + }; + + Set.prototype.sort = function (comparator) { + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function (mapper, comparator) { + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function () { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function (fn, reverse) { + var this$0 = this; + return this._map.__iterate(function (_, k) { + return fn(k, k, this$0); + }, reverse); + }; + + Set.prototype.__iterator = function (type, reverse) { + return this._map.map(function (_, k) { + return k; + }).__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + function isSet(maybeSet) { + return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); + } + + Set.isSet = isSet; + + var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; + + var SetPrototype = Set.prototype; + SetPrototype[IS_SET_SENTINEL] = true; + SetPrototype[DELETE] = SetPrototype.remove; + SetPrototype.mergeDeep = SetPrototype.merge; + SetPrototype.mergeDeepWith = SetPrototype.mergeWith; + SetPrototype.withMutations = MapPrototype.withMutations; + SetPrototype.asMutable = MapPrototype.asMutable; + SetPrototype.asImmutable = MapPrototype.asImmutable; + + SetPrototype.__empty = emptySet; + SetPrototype.__make = makeSet; + + function updateSet(set, newMap) { + if (set.__ownerID) { + set.size = newMap.size; + set._map = newMap; + return set; + } + return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap); + } + + function makeSet(map, ownerID) { + var set = Object.create(SetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_SET; + function emptySet() { + return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); + } + + createClass(OrderedSet, Set); + + function OrderedSet(value) { + return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function (set) { + var iter = SetIterable(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { + return set.add(v); + }); + }); + } + + OrderedSet.of = function () { + return this(arguments); + }; + + OrderedSet.fromKeys = function (value) { + return this(KeyedIterable(value).keySeq()); + }; + + OrderedSet.prototype.toString = function () { + return this.__toString('OrderedSet {', '}'); + }; + + function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); + } + + OrderedSet.isOrderedSet = isOrderedSet; + + var OrderedSetPrototype = OrderedSet.prototype; + OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; + + OrderedSetPrototype.__empty = emptyOrderedSet; + OrderedSetPrototype.__make = makeOrderedSet; + + function makeOrderedSet(map, ownerID) { + var set = Object.create(OrderedSetPrototype); + set.size = map ? map.size : 0; + set._map = map; + set.__ownerID = ownerID; + return set; + } + + var EMPTY_ORDERED_SET; + function emptyOrderedSet() { + return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); + } + + createClass(Stack, IndexedCollection); + + function Stack(value) { + return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value); + } + + Stack.of = function () { + return this(arguments); + }; + + Stack.prototype.toString = function () { + return this.__toString('Stack [', ']'); + }; + + Stack.prototype.get = function (index, notSetValue) { + var head = this._head; + index = wrapIndex(this, index); + while (head && index--) { + head = head.next; + } + return head ? head.value : notSetValue; + }; + + Stack.prototype.peek = function () { + return this._head && this._head.value; + }; + + Stack.prototype.push = function () { + if (arguments.length === 0) { + return this; + } + var newSize = this.size + arguments.length; + var head = this._head; + for (var ii = arguments.length - 1; ii >= 0; ii--) { + head = { + value: arguments[ii], + next: head + }; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pushAll = function (iter) { + iter = IndexedIterable(iter); + if (iter.size === 0) { + return this; + } + assertNotInfinite(iter.size); + var newSize = this.size; + var head = this._head; + iter.reverse().forEach(function (value) { + newSize++; + head = { + value: value, + next: head + }; + }); + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.pop = function () { + return this.slice(1); + }; + + Stack.prototype.unshift = function () { + return this.push.apply(this, arguments); + }; + + Stack.prototype.unshiftAll = function (iter) { + return this.pushAll(iter); + }; + + Stack.prototype.shift = function () { + return this.pop.apply(this, arguments); + }; + + Stack.prototype.clear = function () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._head = undefined; + this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyStack(); + }; + + Stack.prototype.slice = function (begin, end) { + if (wholeSlice(begin, end, this.size)) { + return this; + } + var resolvedBegin = resolveBegin(begin, this.size); + var resolvedEnd = resolveEnd(end, this.size); + if (resolvedEnd !== this.size) { + return IndexedCollection.prototype.slice.call(this, begin, end); + } + var newSize = this.size - resolvedBegin; + var head = this._head; + while (resolvedBegin--) { + head = head.next; + } + if (this.__ownerID) { + this.size = newSize; + this._head = head; + this.__hash = undefined; + this.__altered = true; + return this; + } + return makeStack(newSize, head); + }; + + Stack.prototype.__ensureOwner = function (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + Stack.prototype.__iterate = function (fn, reverse) { + if (reverse) { + return this.reverse().__iterate(fn); + } + var iterations = 0; + var node = this._head; + while (node) { + if (fn(node.value, iterations++, this) === false) { + break; + } + node = node.next; + } + return iterations; + }; + + Stack.prototype.__iterator = function (type, reverse) { + if (reverse) { + return this.reverse().__iterator(type); + } + var iterations = 0; + var node = this._head; + return new Iterator(function () { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + function isStack(maybeStack) { + return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); + } + + Stack.isStack = isStack; + + var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; + + var StackPrototype = Stack.prototype; + StackPrototype[IS_STACK_SENTINEL] = true; + StackPrototype.withMutations = MapPrototype.withMutations; + StackPrototype.asMutable = MapPrototype.asMutable; + StackPrototype.asImmutable = MapPrototype.asImmutable; + StackPrototype.wasAltered = MapPrototype.wasAltered; + + function makeStack(size, head, ownerID, hash) { + var map = Object.create(StackPrototype); + map.size = size; + map._head = head; + map.__ownerID = ownerID; + map.__hash = hash; + map.__altered = false; + return map; + } + + var EMPTY_STACK; + function emptyStack() { + return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); + } + + function mixin(ctor, methods) { + var keyCopier = function keyCopier(key) { + ctor.prototype[key] = methods[key]; + }; + Object.keys(methods).forEach(keyCopier); + Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; + } + + Iterable.Iterator = Iterator; + + mixin(Iterable, { + + toArray: function toArray() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + this.valueSeq().__iterate(function (v, i) { + array[i] = v; + }); + return array; + }, + + toIndexedSeq: function toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS: function toJS() { + return this.toSeq().map(function (value) { + return value && typeof value.toJS === 'function' ? value.toJS() : value; + }).__toJS(); + }, + + toJSON: function toJSON() { + return this.toSeq().map(function (value) { + return value && typeof value.toJSON === 'function' ? value.toJSON() : value; + }).__toJS(); + }, + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap: function toMap() { + return Map(this.toKeyedSeq()); + }, + + toObject: function toObject() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function (v, k) { + object[k] = v; + }); + return object; + }, + + toOrderedMap: function toOrderedMap() { + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function toOrderedSet() { + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function toSet() { + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq: function toSeq() { + return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq(); + }, + + toStack: function toStack() { + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function toList() { + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + toString: function toString() { + return '[Iterable]'; + }, + + __toString: function __toString(head, tail) { + if (this.size === 0) { + return head + tail; + } + return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; + }, + + concat: function concat() { + var values = SLICE$0.call(arguments, 0); + return reify(this, concatFactory(this, values)); + }, + + includes: function includes(searchValue) { + return this.some(function (value) { + return is(value, searchValue); + }); + }, + + entries: function entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function every(predicate, context) { + assertNotInfinite(this.size); + var returnValue = true; + this.__iterate(function (v, k, c) { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + find: function find(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + findEntry: function findEntry(predicate, context) { + var found; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findLastEntry: function findLastEntry(predicate, context) { + return this.toSeq().reverse().findEntry(predicate, context); + }, + + forEach: function forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function join(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + var joined = ''; + var isFirst = true; + this.__iterate(function (v) { + isFirst ? isFirst = false : joined += separator; + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys: function keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function reduce(reducer, initialReduction, context) { + assertNotInfinite(this.size); + var reduction; + var useFirst; + if (arguments.length < 2) { + useFirst = true; + } else { + reduction = initialReduction; + } + this.__iterate(function (v, k, c) { + if (useFirst) { + useFirst = false; + reduction = v; + } else { + reduction = reducer.call(context, reduction, v, k, c); + } + }); + return reduction; + }, + + reduceRight: function reduceRight(reducer, initialReduction, context) { + var reversed = this.toKeyedSeq().reverse(); + return reversed.reduce.apply(reversed, arguments); + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function some(predicate, context) { + return !this.every(not(predicate), context); + }, + + sort: function sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function values() { + return this.__iterator(ITERATE_VALUES); + }, + + butLast: function butLast() { + return this.slice(0, -1); + }, + + isEmpty: function isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(function () { + return true; + }); + }, + + count: function count(predicate, context) { + return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this); + }, + + countBy: function countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function equals(other) { + return deepEqual(this, other); + }, + + entrySeq: function entrySeq() { + var iterable = this; + if (iterable._cache) { + return new ArraySeq(iterable._cache); + } + var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function () { + return iterable.toSeq(); + }; + return entriesSequence; + }, + + filterNot: function filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findLast: function findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + first: function first() { + return this.find(returnTrue); + }, + + flatMap: function flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get: function get(searchKey, notSetValue) { + return this.find(function (_, key) { + return is(key, searchKey); + }, undefined, notSetValue); + }, + + getIn: function getIn(searchKeyPath, notSetValue) { + var nested = this; + + var iter = forceIterator(searchKeyPath); + var step; + while (!(step = iter.next()).done) { + var key = step.value; + nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; + if (nested === NOT_SET) { + return notSetValue; + } + } + return nested; + }, + + groupBy: function groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: function hasIn(searchKeyPath) { + return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; + }, + + isSubset: function isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Iterable(iter); + return this.every(function (value) { + return iter.includes(value); + }); + }, + + isSuperset: function isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); + return iter.isSubset(this); + }, + + keySeq: function keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function last() { + return this.toSeq().reverse().first(); + }, + + max: function max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function min(comparator) { + return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); + }, + + minBy: function minBy(mapper, comparator) { + return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); + }, + + rest: function rest() { + return this.slice(1); + }, + + skip: function skip(amount) { + return this.slice(Math.max(0, amount)); + }, + + skipLast: function skipLast(amount) { + return reify(this, this.toSeq().reverse().skip(amount).reverse()); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function takeLast(amount) { + return reify(this, this.toSeq().reverse().take(amount).reverse()); + }, + + takeWhile: function takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + valueSeq: function valueSeq() { + return this.toIndexedSeq(); + }, + + hashCode: function hashCode() { + return this.__hash || (this.__hash = hashIterable(this)); + } + + }); + + var IterablePrototype = Iterable.prototype; + IterablePrototype[IS_ITERABLE_SENTINEL] = true; + IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; + IterablePrototype.__toJS = IterablePrototype.toArray; + IterablePrototype.__toStringMapper = quoteString; + IterablePrototype.inspect = IterablePrototype.toSource = function () { + return this.toString(); + }; + IterablePrototype.chain = IterablePrototype.flatMap; + IterablePrototype.contains = IterablePrototype.includes; + + (function () { + try { + Object.defineProperty(IterablePrototype, 'length', { + get: function get() { + if (!Iterable.noLengthWarning) { + var stack; + try { + throw new Error(); + } catch (error) { + stack = error.stack; + } + if (stack.indexOf('_wrapObject') === -1) { + console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack); + return this.size; + } + } + } + }); + } catch (e) {} + })(); + + mixin(KeyedIterable, { + + flip: function flip() { + return reify(this, flipFactory(this)); + }, + + findKey: function findKey(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLastKey: function findLastKey(predicate, context) { + return this.toSeq().reverse().findKey(predicate, context); + }, + + keyOf: function keyOf(searchValue) { + return this.findKey(function (value) { + return is(value, searchValue); + }); + }, + + lastKeyOf: function lastKeyOf(searchValue) { + return this.findLastKey(function (value) { + return is(value, searchValue); + }); + }, + + mapEntries: function mapEntries(mapper, context) { + var this$0 = this; + var iterations = 0; + return reify(this, this.toSeq().map(function (v, k) { + return mapper.call(context, [k, v], iterations++, this$0); + }).fromEntrySeq()); + }, + + mapKeys: function mapKeys(mapper, context) { + var this$0 = this; + return reify(this, this.toSeq().flip().map(function (k, v) { + return mapper.call(context, k, v, this$0); + }).flip()); + } + + }); + + var KeyedIterablePrototype = KeyedIterable.prototype; + KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; + KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; + KeyedIterablePrototype.__toJS = IterablePrototype.toObject; + KeyedIterablePrototype.__toStringMapper = function (v, k) { + return JSON.stringify(k) + ': ' + quoteString(v); + }; + + mixin(IndexedIterable, { + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function findIndex(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function indexOf(searchValue) { + var key = this.toKeyedSeq().keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function lastIndexOf(searchValue) { + var key = this.toKeyedSeq().reverse().keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function splice(index, removeNum) { + var numArgs = arguments.length; + removeNum = Math.max(removeNum | 0, 0); + if (numArgs === 0 || numArgs === 2 && !removeNum) { + return this; + } + + index = resolveBegin(index, index < 0 ? this.count() : this.size); + var spliced = this.slice(0, index); + return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))); + }, + + findLastIndex: function findLastIndex(predicate, context) { + var key = this.toKeyedSeq().findLastKey(predicate, context); + return key === undefined ? -1 : key; + }, + + first: function first() { + return this.get(0); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function get(index, notSetValue) { + index = wrapIndex(this, index); + return index < 0 || this.size === Infinity || this.size !== undefined && index > this.size ? notSetValue : this.find(function (_, key) { + return key === index; + }, undefined, notSetValue); + }, + + has: function has(index) { + index = wrapIndex(this, index); + return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1); + }, + + interpose: function interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function interleave() { + var iterables = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * iterables.length; + } + return reify(this, interleaved); + }, + + last: function last() { + return this.get(-1); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function zip() { + var iterables = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, iterables)); + }, + + zipWith: function zipWith(zipper) { + var iterables = arrCopy(arguments); + iterables[0] = this; + return reify(this, zipWithFactory(this, zipper, iterables)); + } + + }); + + IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; + IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; + + mixin(SetIterable, { + + get: function get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function includes(value) { + return this.has(value); + }, + + keySeq: function keySeq() { + return this.valueSeq(); + } + + }); + + SetIterable.prototype.has = IterablePrototype.includes; + + mixin(KeyedSeq, KeyedIterable.prototype); + mixin(IndexedSeq, IndexedIterable.prototype); + mixin(SetSeq, SetIterable.prototype); + + mixin(KeyedCollection, KeyedIterable.prototype); + mixin(IndexedCollection, IndexedIterable.prototype); + mixin(SetCollection, SetIterable.prototype); + + function keyMapper(v, k) { + return k; + } + + function entryMapper(v, k) { + return [k, v]; + } + + function not(predicate) { + return function () { + return !predicate.apply(this, arguments); + }; + } + + function neg(predicate) { + return function () { + return -predicate.apply(this, arguments); + }; + } + + function quoteString(value) { + return typeof value === 'string' ? JSON.stringify(value) : value; + } + + function defaultZipper() { + return arrCopy(arguments); + } + + function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; + } + + function hashIterable(iterable) { + if (iterable.size === Infinity) { + return 0; + } + var ordered = isOrdered(iterable); + var keyed = isKeyed(iterable); + var h = ordered ? 1 : 0; + var size = iterable.__iterate(keyed ? ordered ? function (v, k) { + h = 31 * h + hashMerge(hash(v), hash(k)) | 0; + } : function (v, k) { + h = h + hashMerge(hash(v), hash(k)) | 0; + } : ordered ? function (v) { + h = 31 * h + hash(v) | 0; + } : function (v) { + h = h + hash(v) | 0; + }); + return murmurHashOfSize(size, h); + } + + function murmurHashOfSize(size, h) { + h = imul(h, 0xCC9E2D51); + h = imul(h << 15 | h >>> -15, 0x1B873593); + h = imul(h << 13 | h >>> -13, 5); + h = (h + 0xE6546B64 | 0) ^ size; + h = imul(h ^ h >>> 16, 0x85EBCA6B); + h = imul(h ^ h >>> 13, 0xC2B2AE35); + h = smi(h ^ h >>> 16); + return h; + } + + function hashMerge(a, b) { + return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; + } + + var Immutable = { + + Iterable: Iterable, + + Seq: Seq, + Collection: Collection, + Map: Map, + OrderedMap: OrderedMap, + List: List, + Stack: Stack, + Set: Set, + OrderedSet: OrderedSet, + + Record: Record, + Range: Range, + Repeat: Repeat, + + is: is, + fromJS: fromJS + + }; + + return Immutable; +}); +}, 338, null, "immutable/dist/immutable.js"); +__d(/* NavigatorBreadcrumbNavigationBar */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js'; +var NavigatorBreadcrumbNavigationBarStyles = require(340 ); // 340 = NavigatorBreadcrumbNavigationBarStyles +var NavigatorNavigationBarStylesAndroid = require(343 ); // 343 = NavigatorNavigationBarStylesAndroid +var NavigatorNavigationBarStylesIOS = require(341 ); // 341 = NavigatorNavigationBarStylesIOS +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var guid = require(225 ); // 225 = guid +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var _require = require(338 ), // 338 = immutable + Map = _require.Map; + +var Interpolators = NavigatorBreadcrumbNavigationBarStyles.Interpolators; +var NavigatorNavigationBarStyles = Platform.OS === 'android' ? NavigatorNavigationBarStylesAndroid : NavigatorNavigationBarStylesIOS; +var PropTypes = React.PropTypes; + +var CRUMB_PROPS = Interpolators.map(function () { + return { style: {} }; +}); +var ICON_PROPS = Interpolators.map(function () { + return { style: {} }; +}); +var SEPARATOR_PROPS = Interpolators.map(function () { + return { style: {} }; +}); +var TITLE_PROPS = Interpolators.map(function () { + return { style: {} }; +}); +var RIGHT_BUTTON_PROPS = Interpolators.map(function () { + return { style: {} }; +}); + +function navStatePresentedIndex(navState) { + if (navState.presentedIndex !== undefined) { + return navState.presentedIndex; + } + + return navState.observedTopOfStack; +} + +function initStyle(index, presentedIndex) { + return index === presentedIndex ? NavigatorBreadcrumbNavigationBarStyles.Center[index] : index < presentedIndex ? NavigatorBreadcrumbNavigationBarStyles.Left[index] : NavigatorBreadcrumbNavigationBarStyles.Right[index]; +} + +var NavigatorBreadcrumbNavigationBar = function (_React$Component) { + babelHelpers.inherits(NavigatorBreadcrumbNavigationBar, _React$Component); + + function NavigatorBreadcrumbNavigationBar() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, NavigatorBreadcrumbNavigationBar); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = NavigatorBreadcrumbNavigationBar.__proto__ || Object.getPrototypeOf(NavigatorBreadcrumbNavigationBar)).call.apply(_ref, [this].concat(args))), _this), _this._getBreadcrumb = function (route, index) { + var pointerEvents = _this.props.navState.routeStack.length <= 1 && index === 0 ? 'none' : 'auto'; + var navBarRouteMapper = _this.props.routeMapper; + var firstStyles = initStyle(index, navStatePresentedIndex(_this.props.navState)); + + var breadcrumbDescriptor = React.createElement( + View, + { + key: 'crumb_' + index, + pointerEvents: pointerEvents, + ref: 'crumb_' + index, + style: firstStyles.Crumb, __source: { + fileName: _jsxFileName, + lineNumber: 234 + } + }, + React.createElement( + View, + { ref: 'icon_' + index, style: firstStyles.Icon, __source: { + fileName: _jsxFileName, + lineNumber: 239 + } + }, + navBarRouteMapper.iconForRoute(route, _this.props.navigator) + ), + React.createElement( + View, + { ref: 'separator_' + index, style: firstStyles.Separator, __source: { + fileName: _jsxFileName, + lineNumber: 242 + } + }, + navBarRouteMapper.separatorForRoute(route, _this.props.navigator) + ) + ); + + return breadcrumbDescriptor; + }, _this._getTitle = function (route, index) { + if (_this._descriptors.title.has(route)) { + return _this._descriptors.title.get(route); + } + + var titleContent = _this.props.routeMapper.titleContentForRoute(_this.props.navState.routeStack[index], _this.props.navigator); + var firstStyles = initStyle(index, navStatePresentedIndex(_this.props.navState)); + + var titleDescriptor = React.createElement( + View, + { + key: 'title_' + index, + ref: 'title_' + index, + style: firstStyles.Title, __source: { + fileName: _jsxFileName, + lineNumber: 263 + } + }, + titleContent + ); + _this._descriptors.title = _this._descriptors.title.set(route, titleDescriptor); + return titleDescriptor; + }, _this._getRightButton = function (route, index) { + if (_this._descriptors.right.has(route)) { + return _this._descriptors.right.get(route); + } + var rightContent = _this.props.routeMapper.rightContentForRoute(_this.props.navState.routeStack[index], _this.props.navigator); + if (!rightContent) { + _this._descriptors.right = _this._descriptors.right.set(route, null); + return null; + } + var firstStyles = initStyle(index, navStatePresentedIndex(_this.props.navState)); + var rightButtonDescriptor = React.createElement( + View, + { + key: 'right_' + index, + ref: 'right_' + index, + style: firstStyles.RightItem, __source: { + fileName: _jsxFileName, + lineNumber: 288 + } + }, + rightContent + ); + _this._descriptors.right = _this._descriptors.right.set(route, rightButtonDescriptor); + return rightButtonDescriptor; + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(NavigatorBreadcrumbNavigationBar, [{ + key: '_updateIndexProgress', + value: function _updateIndexProgress(progress, index, fromIndex, toIndex) { + var amount = toIndex > fromIndex ? progress : 1 - progress; + var oldDistToCenter = index - fromIndex; + var newDistToCenter = index - toIndex; + var interpolate; + invariant(Interpolators[index], 'Cannot find breadcrumb interpolators for ' + index); + if (oldDistToCenter > 0 && newDistToCenter === 0 || newDistToCenter > 0 && oldDistToCenter === 0) { + interpolate = Interpolators[index].RightToCenter; + } else if (oldDistToCenter < 0 && newDistToCenter === 0 || newDistToCenter < 0 && oldDistToCenter === 0) { + interpolate = Interpolators[index].CenterToLeft; + } else if (oldDistToCenter === newDistToCenter) { + interpolate = Interpolators[index].RightToCenter; + } else { + interpolate = Interpolators[index].RightToLeft; + } + + if (interpolate.Crumb(CRUMB_PROPS[index].style, amount)) { + this._setPropsIfExists('crumb_' + index, CRUMB_PROPS[index]); + } + if (interpolate.Icon(ICON_PROPS[index].style, amount)) { + this._setPropsIfExists('icon_' + index, ICON_PROPS[index]); + } + if (interpolate.Separator(SEPARATOR_PROPS[index].style, amount)) { + this._setPropsIfExists('separator_' + index, SEPARATOR_PROPS[index]); + } + if (interpolate.Title(TITLE_PROPS[index].style, amount)) { + this._setPropsIfExists('title_' + index, TITLE_PROPS[index]); + } + var right = this.refs['right_' + index]; + + var rightButtonStyle = RIGHT_BUTTON_PROPS[index].style; + if (right && interpolate.RightItem(rightButtonStyle, amount)) { + right.setNativeProps({ + style: rightButtonStyle, + pointerEvents: rightButtonStyle.opacity === 0 ? 'none' : 'auto' + }); + } + } + }, { + key: 'updateProgress', + value: function updateProgress(progress, fromIndex, toIndex) { + var max = Math.max(fromIndex, toIndex); + var min = Math.min(fromIndex, toIndex); + for (var index = min; index <= max; index++) { + this._updateIndexProgress(progress, index, fromIndex, toIndex); + } + } + }, { + key: 'onAnimationStart', + value: function onAnimationStart(fromIndex, toIndex) { + var max = Math.max(fromIndex, toIndex); + var min = Math.min(fromIndex, toIndex); + for (var index = min; index <= max; index++) { + this._setRenderViewsToHardwareTextureAndroid(index, true); + } + } + }, { + key: 'onAnimationEnd', + value: function onAnimationEnd() { + var max = this.props.navState.routeStack.length - 1; + for (var index = 0; index <= max; index++) { + this._setRenderViewsToHardwareTextureAndroid(index, false); + } + } + }, { + key: '_setRenderViewsToHardwareTextureAndroid', + value: function _setRenderViewsToHardwareTextureAndroid(index, renderToHardwareTexture) { + var props = { + renderToHardwareTextureAndroid: renderToHardwareTexture + }; + + this._setPropsIfExists('icon_' + index, props); + this._setPropsIfExists('separator_' + index, props); + this._setPropsIfExists('title_' + index, props); + this._setPropsIfExists('right_' + index, props); + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + this._reset(); + } + }, { + key: 'render', + value: function render() { + var navState = this.props.navState; + var icons = navState && navState.routeStack.map(this._getBreadcrumb); + var titles = navState.routeStack.map(this._getTitle); + var buttons = navState.routeStack.map(this._getRightButton); + + return React.createElement( + View, + { + key: this._key, + style: [styles.breadCrumbContainer, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 196 + } + }, + titles, + icons, + buttons + ); + } + }, { + key: 'immediatelyRefresh', + value: function immediatelyRefresh() { + this._reset(); + this.forceUpdate(); + } + }, { + key: '_reset', + value: function _reset() { + this._key = guid(); + this._descriptors = { + title: new Map(), + right: new Map() + }; + } + }, { + key: '_setPropsIfExists', + value: function _setPropsIfExists(ref, props) { + var ref = this.refs[ref]; + ref && ref.setNativeProps(props); + } + }]); + return NavigatorBreadcrumbNavigationBar; +}(React.Component); + +NavigatorBreadcrumbNavigationBar.propTypes = { + navigator: PropTypes.shape({ + push: PropTypes.func, + pop: PropTypes.func, + replace: PropTypes.func, + popToRoute: PropTypes.func, + popToTop: PropTypes.func + }), + routeMapper: PropTypes.shape({ + rightContentForRoute: PropTypes.func, + titleContentForRoute: PropTypes.func, + iconForRoute: PropTypes.func + }), + navState: React.PropTypes.shape({ + routeStack: React.PropTypes.arrayOf(React.PropTypes.object), + presentedIndex: React.PropTypes.number + }), + style: View.propTypes.style +}; +NavigatorBreadcrumbNavigationBar.Styles = NavigatorBreadcrumbNavigationBarStyles; + + +var styles = StyleSheet.create({ + breadCrumbContainer: { + overflow: 'hidden', + position: 'absolute', + height: NavigatorNavigationBarStyles.General.TotalNavHeight, + top: 0, + left: 0, + right: 0 + } +}); + +module.exports = NavigatorBreadcrumbNavigationBar; +}, 339, null, "NavigatorBreadcrumbNavigationBar"); +__d(/* NavigatorBreadcrumbNavigationBarStyles */function(global, require, module, exports) { +'use strict'; + +var Dimensions = require(129 ); // 129 = Dimensions +var NavigatorNavigationBarStylesIOS = require(341 ); // 341 = NavigatorNavigationBarStylesIOS + +var buildStyleInterpolator = require(342 ); // 342 = buildStyleInterpolator +var merge = require(149 ); // 149 = merge + +var SCREEN_WIDTH = Dimensions.get('window').width; +var STATUS_BAR_HEIGHT = NavigatorNavigationBarStylesIOS.General.StatusBarHeight; +var NAV_BAR_HEIGHT = NavigatorNavigationBarStylesIOS.General.NavBarHeight; + +var SPACING = 4; +var ICON_WIDTH = 40; +var SEPARATOR_WIDTH = 9; +var CRUMB_WIDTH = ICON_WIDTH + SEPARATOR_WIDTH; + +var OPACITY_RATIO = 100; +var ICON_INACTIVE_OPACITY = 0.6; +var MAX_BREADCRUMBS = 10; + +var CRUMB_BASE = { + position: 'absolute', + flexDirection: 'row', + top: STATUS_BAR_HEIGHT, + width: CRUMB_WIDTH, + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' +}; + +var ICON_BASE = { + width: ICON_WIDTH, + height: NAV_BAR_HEIGHT +}; + +var SEPARATOR_BASE = { + width: SEPARATOR_WIDTH, + height: NAV_BAR_HEIGHT +}; + +var TITLE_BASE = { + position: 'absolute', + top: STATUS_BAR_HEIGHT, + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' +}; + +var FIRST_TITLE_BASE = merge(TITLE_BASE, { + left: 0, + right: 0, + alignItems: 'center', + height: NAV_BAR_HEIGHT +}); + +var RIGHT_BUTTON_BASE = { + position: 'absolute', + top: STATUS_BAR_HEIGHT, + right: SPACING, + overflow: 'hidden', + opacity: 1, + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' +}; + +var LEFT = []; +var CENTER = []; +var RIGHT = []; +for (var i = 0; i < MAX_BREADCRUMBS; i++) { + var crumbLeft = CRUMB_WIDTH * i + SPACING; + LEFT[i] = { + Crumb: merge(CRUMB_BASE, { left: crumbLeft }), + Icon: merge(ICON_BASE, { opacity: ICON_INACTIVE_OPACITY }), + Separator: merge(SEPARATOR_BASE, { opacity: 1 }), + Title: merge(TITLE_BASE, { left: crumbLeft, opacity: 0 }), + RightItem: merge(RIGHT_BUTTON_BASE, { opacity: 0 }) + }; + CENTER[i] = { + Crumb: merge(CRUMB_BASE, { left: crumbLeft }), + Icon: merge(ICON_BASE, { opacity: 1 }), + Separator: merge(SEPARATOR_BASE, { opacity: 0 }), + Title: merge(TITLE_BASE, { + left: crumbLeft + ICON_WIDTH, + opacity: 1 + }), + RightItem: merge(RIGHT_BUTTON_BASE, { opacity: 1 }) + }; + var crumbRight = SCREEN_WIDTH - 100; + RIGHT[i] = { + Crumb: merge(CRUMB_BASE, { left: crumbRight }), + Icon: merge(ICON_BASE, { opacity: 0 }), + Separator: merge(SEPARATOR_BASE, { opacity: 0 }), + Title: merge(TITLE_BASE, { + left: crumbRight + ICON_WIDTH, + opacity: 0 + }), + RightItem: merge(RIGHT_BUTTON_BASE, { opacity: 0 }) + }; +} + +CENTER[0] = { + Crumb: merge(CRUMB_BASE, { left: SCREEN_WIDTH / 4 }), + Icon: merge(ICON_BASE, { opacity: 0 }), + Separator: merge(SEPARATOR_BASE, { opacity: 0 }), + Title: merge(FIRST_TITLE_BASE, { opacity: 1 }), + RightItem: CENTER[0].RightItem +}; +LEFT[0].Title = merge(FIRST_TITLE_BASE, { left: -SCREEN_WIDTH / 4, opacity: 0 }); +RIGHT[0].Title = merge(FIRST_TITLE_BASE, { opacity: 0 }); + +var buildIndexSceneInterpolator = function buildIndexSceneInterpolator(startStyles, endStyles) { + return { + Crumb: buildStyleInterpolator({ + left: { + type: 'linear', + from: startStyles.Crumb.left, + to: endStyles.Crumb.left, + min: 0, + max: 1, + extrapolate: true + } + }), + Icon: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.Icon.opacity, + to: endStyles.Icon.opacity, + min: 0, + max: 1 + } + }), + Separator: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.Separator.opacity, + to: endStyles.Separator.opacity, + min: 0, + max: 1 + } + }), + Title: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.Title.opacity, + to: endStyles.Title.opacity, + min: 0, + max: 1 + }, + left: { + type: 'linear', + from: startStyles.Title.left, + to: endStyles.Title.left, + min: 0, + max: 1, + extrapolate: true + } + }), + RightItem: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.RightItem.opacity, + to: endStyles.RightItem.opacity, + min: 0, + max: 1, + round: OPACITY_RATIO + } + }) + }; +}; + +var Interpolators = CENTER.map(function (_, ii) { + return { + RightToCenter: buildIndexSceneInterpolator(RIGHT[ii], CENTER[ii]), + + CenterToLeft: buildIndexSceneInterpolator(CENTER[ii], LEFT[ii]), + + RightToLeft: buildIndexSceneInterpolator(RIGHT[ii], LEFT[ii]) + }; +}); + +module.exports = { + Interpolators: Interpolators, + Left: LEFT, + Center: CENTER, + Right: RIGHT, + IconWidth: ICON_WIDTH, + IconHeight: NAV_BAR_HEIGHT, + SeparatorWidth: SEPARATOR_WIDTH, + SeparatorHeight: NAV_BAR_HEIGHT +}; +}, 340, null, "NavigatorBreadcrumbNavigationBarStyles"); +__d(/* NavigatorNavigationBarStylesIOS */function(global, require, module, exports) { +'use strict'; + +var Dimensions = require(129 ); // 129 = Dimensions + +var buildStyleInterpolator = require(342 ); // 342 = buildStyleInterpolator +var merge = require(149 ); // 149 = merge + +var SCREEN_WIDTH = Dimensions.get('window').width; +var NAV_BAR_HEIGHT = 44; +var STATUS_BAR_HEIGHT = 20; +var NAV_HEIGHT = NAV_BAR_HEIGHT + STATUS_BAR_HEIGHT; + +var BASE_STYLES = { + Title: { + position: 'absolute', + top: STATUS_BAR_HEIGHT, + left: 0, + right: 0, + alignItems: 'center', + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' + }, + LeftButton: { + position: 'absolute', + top: STATUS_BAR_HEIGHT, + left: 0, + overflow: 'hidden', + opacity: 1, + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' + }, + RightButton: { + position: 'absolute', + top: STATUS_BAR_HEIGHT, + right: 0, + overflow: 'hidden', + opacity: 1, + alignItems: 'flex-end', + height: NAV_BAR_HEIGHT, + backgroundColor: 'transparent' + } +}; + +var Stages = { + Left: { + Title: merge(BASE_STYLES.Title, { left: -SCREEN_WIDTH / 2, opacity: 0 }), + LeftButton: merge(BASE_STYLES.LeftButton, { left: 0, opacity: 0 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 0 }) + }, + Center: { + Title: merge(BASE_STYLES.Title, { left: 0, opacity: 1 }), + LeftButton: merge(BASE_STYLES.LeftButton, { left: 0, opacity: 1 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 1 }) + }, + Right: { + Title: merge(BASE_STYLES.Title, { left: SCREEN_WIDTH / 2, opacity: 0 }), + LeftButton: merge(BASE_STYLES.LeftButton, { left: 0, opacity: 0 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 0 }) + } +}; + +var opacityRatio = 100; + +function buildSceneInterpolators(startStyles, endStyles) { + return { + Title: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.Title.opacity, + to: endStyles.Title.opacity, + min: 0, + max: 1 + }, + left: { + type: 'linear', + from: startStyles.Title.left, + to: endStyles.Title.left, + min: 0, + max: 1, + extrapolate: true + } + }), + LeftButton: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.LeftButton.opacity, + to: endStyles.LeftButton.opacity, + min: 0, + max: 1, + round: opacityRatio + }, + left: { + type: 'linear', + from: startStyles.LeftButton.left, + to: endStyles.LeftButton.left, + min: 0, + max: 1 + } + }), + RightButton: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.RightButton.opacity, + to: endStyles.RightButton.opacity, + min: 0, + max: 1, + round: opacityRatio + }, + left: { + type: 'linear', + from: startStyles.RightButton.left, + to: endStyles.RightButton.left, + min: 0, + max: 1, + extrapolate: true + } + }) + }; +} + +var Interpolators = { + RightToCenter: buildSceneInterpolators(Stages.Right, Stages.Center), + + CenterToLeft: buildSceneInterpolators(Stages.Center, Stages.Left), + + RightToLeft: buildSceneInterpolators(Stages.Right, Stages.Left) +}; + +module.exports = { + General: { + NavBarHeight: NAV_BAR_HEIGHT, + StatusBarHeight: STATUS_BAR_HEIGHT, + TotalNavHeight: NAV_HEIGHT + }, + Interpolators: Interpolators, + Stages: Stages +}; +}, 341, null, "NavigatorNavigationBarStylesIOS"); +__d(/* buildStyleInterpolator */function(global, require, module, exports) { + +var keyOf = require(323 ); // 323 = fbjs/lib/keyOf + +var X_DIM = keyOf({ x: null }); +var Y_DIM = keyOf({ y: null }); +var Z_DIM = keyOf({ z: null }); +var W_DIM = keyOf({ w: null }); + +var TRANSFORM_ROTATE_NAME = keyOf({ transformRotateRadians: null }); + +var ShouldAllocateReusableOperationVars = { + transformRotateRadians: true, + transformScale: true, + transformTranslate: true +}; + +var InitialOperationField = { + transformRotateRadians: [0, 0, 0, 1], + transformTranslate: [0, 0, 0], + transformScale: [1, 1, 1] +}; + +var ARGUMENT_NAMES_RE = /([^\s,]+)/g; + +var inline = function inline(fnStr, replaceWithArgs) { + var parameterNames = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES_RE) || []; + var replaceRegexStr = parameterNames.map(function (paramName) { + return '\\b' + paramName + '\\b'; + }).join('|'); + var replaceRegex = new RegExp(replaceRegexStr, 'g'); + var fnBody = fnStr.substring(fnStr.indexOf('{') + 1, fnStr.lastIndexOf('}')); + var newFnBody = fnBody.replace(replaceRegex, function (parameterName) { + var indexInParameterNames = parameterNames.indexOf(parameterName); + var replacementName = replaceWithArgs[indexInParameterNames]; + return replacementName; + }); + return newFnBody.split('\n'); +}; + +var MatrixOps = { + unroll: 'function(matVar, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15) {\n m0 = matVar[0];\n m1 = matVar[1];\n m2 = matVar[2];\n m3 = matVar[3];\n m4 = matVar[4];\n m5 = matVar[5];\n m6 = matVar[6];\n m7 = matVar[7];\n m8 = matVar[8];\n m9 = matVar[9];\n m10 = matVar[10];\n m11 = matVar[11];\n m12 = matVar[12];\n m13 = matVar[13];\n m14 = matVar[14];\n m15 = matVar[15];\n }', + + matrixDiffers: 'function(retVar, matVar, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15) {\n retVar = retVar ||\n m0 !== matVar[0] ||\n m1 !== matVar[1] ||\n m2 !== matVar[2] ||\n m3 !== matVar[3] ||\n m4 !== matVar[4] ||\n m5 !== matVar[5] ||\n m6 !== matVar[6] ||\n m7 !== matVar[7] ||\n m8 !== matVar[8] ||\n m9 !== matVar[9] ||\n m10 !== matVar[10] ||\n m11 !== matVar[11] ||\n m12 !== matVar[12] ||\n m13 !== matVar[13] ||\n m14 !== matVar[14] ||\n m15 !== matVar[15];\n }', + + transformScale: 'function(matVar, opVar) {\n // Scaling matVar by opVar\n var x = opVar[0];\n var y = opVar[1];\n var z = opVar[2];\n matVar[0] = matVar[0] * x;\n matVar[1] = matVar[1] * x;\n matVar[2] = matVar[2] * x;\n matVar[3] = matVar[3] * x;\n matVar[4] = matVar[4] * y;\n matVar[5] = matVar[5] * y;\n matVar[6] = matVar[6] * y;\n matVar[7] = matVar[7] * y;\n matVar[8] = matVar[8] * z;\n matVar[9] = matVar[9] * z;\n matVar[10] = matVar[10] * z;\n matVar[11] = matVar[11] * z;\n matVar[12] = matVar[12];\n matVar[13] = matVar[13];\n matVar[14] = matVar[14];\n matVar[15] = matVar[15];\n }', + + transformTranslate: 'function(matVar, opVar) {\n // Translating matVar by opVar\n var x = opVar[0];\n var y = opVar[1];\n var z = opVar[2];\n matVar[12] = matVar[0] * x + matVar[4] * y + matVar[8] * z + matVar[12];\n matVar[13] = matVar[1] * x + matVar[5] * y + matVar[9] * z + matVar[13];\n matVar[14] = matVar[2] * x + matVar[6] * y + matVar[10] * z + matVar[14];\n matVar[15] = matVar[3] * x + matVar[7] * y + matVar[11] * z + matVar[15];\n }', + + transformRotateRadians: 'function(matVar, q) {\n // Rotating matVar by q\n var xQuat = q[0], yQuat = q[1], zQuat = q[2], wQuat = q[3];\n var x2Quat = xQuat + xQuat;\n var y2Quat = yQuat + yQuat;\n var z2Quat = zQuat + zQuat;\n var xxQuat = xQuat * x2Quat;\n var xyQuat = xQuat * y2Quat;\n var xzQuat = xQuat * z2Quat;\n var yyQuat = yQuat * y2Quat;\n var yzQuat = yQuat * z2Quat;\n var zzQuat = zQuat * z2Quat;\n var wxQuat = wQuat * x2Quat;\n var wyQuat = wQuat * y2Quat;\n var wzQuat = wQuat * z2Quat;\n // Step 1: Inlines the construction of a quaternion matrix (\'quatMat\')\n var quatMat0 = 1 - (yyQuat + zzQuat);\n var quatMat1 = xyQuat + wzQuat;\n var quatMat2 = xzQuat - wyQuat;\n var quatMat4 = xyQuat - wzQuat;\n var quatMat5 = 1 - (xxQuat + zzQuat);\n var quatMat6 = yzQuat + wxQuat;\n var quatMat8 = xzQuat + wyQuat;\n var quatMat9 = yzQuat - wxQuat;\n var quatMat10 = 1 - (xxQuat + yyQuat);\n // quatMat3/7/11/12/13/14 = 0, quatMat15 = 1\n\n // Step 2: Inlines multiplication, takes advantage of constant quatMat cells\n var a00 = matVar[0];\n var a01 = matVar[1];\n var a02 = matVar[2];\n var a03 = matVar[3];\n var a10 = matVar[4];\n var a11 = matVar[5];\n var a12 = matVar[6];\n var a13 = matVar[7];\n var a20 = matVar[8];\n var a21 = matVar[9];\n var a22 = matVar[10];\n var a23 = matVar[11];\n\n var b0 = quatMat0, b1 = quatMat1, b2 = quatMat2;\n matVar[0] = b0 * a00 + b1 * a10 + b2 * a20;\n matVar[1] = b0 * a01 + b1 * a11 + b2 * a21;\n matVar[2] = b0 * a02 + b1 * a12 + b2 * a22;\n matVar[3] = b0 * a03 + b1 * a13 + b2 * a23;\n b0 = quatMat4; b1 = quatMat5; b2 = quatMat6;\n matVar[4] = b0 * a00 + b1 * a10 + b2 * a20;\n matVar[5] = b0 * a01 + b1 * a11 + b2 * a21;\n matVar[6] = b0 * a02 + b1 * a12 + b2 * a22;\n matVar[7] = b0 * a03 + b1 * a13 + b2 * a23;\n b0 = quatMat8; b1 = quatMat9; b2 = quatMat10;\n matVar[8] = b0 * a00 + b1 * a10 + b2 * a20;\n matVar[9] = b0 * a01 + b1 * a11 + b2 * a21;\n matVar[10] = b0 * a02 + b1 * a12 + b2 * a22;\n matVar[11] = b0 * a03 + b1 * a13 + b2 * a23;\n }' +}; + +var MatrixOpsInitial = { + transformScale: 'function(matVar, opVar) {\n // Scaling matVar known to be identity by opVar\n matVar[0] = opVar[0];\n matVar[1] = 0;\n matVar[2] = 0;\n matVar[3] = 0;\n matVar[4] = 0;\n matVar[5] = opVar[1];\n matVar[6] = 0;\n matVar[7] = 0;\n matVar[8] = 0;\n matVar[9] = 0;\n matVar[10] = opVar[2];\n matVar[11] = 0;\n matVar[12] = 0;\n matVar[13] = 0;\n matVar[14] = 0;\n matVar[15] = 1;\n }', + + transformTranslate: 'function(matVar, opVar) {\n // Translating matVar known to be identity by opVar;\n matVar[0] = 1;\n matVar[1] = 0;\n matVar[2] = 0;\n matVar[3] = 0;\n matVar[4] = 0;\n matVar[5] = 1;\n matVar[6] = 0;\n matVar[7] = 0;\n matVar[8] = 0;\n matVar[9] = 0;\n matVar[10] = 1;\n matVar[11] = 0;\n matVar[12] = opVar[0];\n matVar[13] = opVar[1];\n matVar[14] = opVar[2];\n matVar[15] = 1;\n }', + + transformRotateRadians: 'function(matVar, q) {\n\n // Rotating matVar which is known to be identity by q\n var xQuat = q[0], yQuat = q[1], zQuat = q[2], wQuat = q[3];\n var x2Quat = xQuat + xQuat;\n var y2Quat = yQuat + yQuat;\n var z2Quat = zQuat + zQuat;\n var xxQuat = xQuat * x2Quat;\n var xyQuat = xQuat * y2Quat;\n var xzQuat = xQuat * z2Quat;\n var yyQuat = yQuat * y2Quat;\n var yzQuat = yQuat * z2Quat;\n var zzQuat = zQuat * z2Quat;\n var wxQuat = wQuat * x2Quat;\n var wyQuat = wQuat * y2Quat;\n var wzQuat = wQuat * z2Quat;\n // Step 1: Inlines the construction of a quaternion matrix (\'quatMat\')\n var quatMat0 = 1 - (yyQuat + zzQuat);\n var quatMat1 = xyQuat + wzQuat;\n var quatMat2 = xzQuat - wyQuat;\n var quatMat4 = xyQuat - wzQuat;\n var quatMat5 = 1 - (xxQuat + zzQuat);\n var quatMat6 = yzQuat + wxQuat;\n var quatMat8 = xzQuat + wyQuat;\n var quatMat9 = yzQuat - wxQuat;\n var quatMat10 = 1 - (xxQuat + yyQuat);\n // quatMat3/7/11/12/13/14 = 0, quatMat15 = 1\n\n // Step 2: Inlines the multiplication with identity matrix.\n var b0 = quatMat0, b1 = quatMat1, b2 = quatMat2;\n matVar[0] = b0;\n matVar[1] = b1;\n matVar[2] = b2;\n matVar[3] = 0;\n b0 = quatMat4; b1 = quatMat5; b2 = quatMat6;\n matVar[4] = b0;\n matVar[5] = b1;\n matVar[6] = b2;\n matVar[7] = 0;\n b0 = quatMat8; b1 = quatMat9; b2 = quatMat10;\n matVar[8] = b0;\n matVar[9] = b1;\n matVar[10] = b2;\n matVar[11] = 0;\n matVar[12] = 0;\n matVar[13] = 0;\n matVar[14] = 0;\n matVar[15] = 1;\n }' +}; + +var setNextValAndDetectChange = function setNextValAndDetectChange(name, tmpVarName) { + return ' if (!didChange) {\n' + ' var prevVal = result.' + name + ';\n' + ' result.' + name + ' = ' + tmpVarName + ';\n' + ' didChange = didChange || (' + tmpVarName + ' !== prevVal);\n' + ' } else {\n' + ' result.' + name + ' = ' + tmpVarName + ';\n' + ' }\n'; +}; + +var computeNextValLinear = function computeNextValLinear(anim, from, to, tmpVarName) { + var hasRoundRatio = 'round' in anim; + var roundRatio = anim.round; + var fn = ' ratio = (value - ' + anim.min + ') / ' + (anim.max - anim.min) + ';\n'; + if (!anim.extrapolate) { + fn += ' ratio = ratio > 1 ? 1 : (ratio < 0 ? 0 : ratio);\n'; + } + + var roundOpen = hasRoundRatio ? 'Math.round(' + roundRatio + ' * ' : ''; + var roundClose = hasRoundRatio ? ') / ' + roundRatio : ''; + fn += ' ' + tmpVarName + ' = ' + roundOpen + '(' + from + ' * (1 - ratio) + ' + to + ' * ratio)' + roundClose + ';\n'; + return fn; +}; + +var computeNextValLinearScalar = function computeNextValLinearScalar(anim) { + return computeNextValLinear(anim, anim.from, anim.to, 'nextScalarVal'); +}; + +var computeNextValConstant = function computeNextValConstant(anim) { + var constantExpression = JSON.stringify(anim.value); + return ' nextScalarVal = ' + constantExpression + ';\n'; +}; + +var computeNextValStep = function computeNextValStep(anim) { + return ' nextScalarVal = value >= ' + (anim.threshold + ' ? ' + anim.to + ' : ' + anim.from) + ';\n'; +}; + +var computeNextValIdentity = function computeNextValIdentity(anim) { + return ' nextScalarVal = value;\n'; +}; + +var operationVar = function operationVar(name) { + return name + 'ReuseOp'; +}; + +var createReusableOperationVars = function createReusableOperationVars(anims) { + var ret = ''; + for (var name in anims) { + if (ShouldAllocateReusableOperationVars[name]) { + ret += 'var ' + operationVar(name) + ' = [];\n'; + } + } + return ret; +}; + +var newlines = function newlines(statements) { + return '\n' + statements.join('\n') + '\n'; +}; + +var computeNextMatrixOperationField = function computeNextMatrixOperationField(anim, name, dimension, index) { + var fieldAccess = operationVar(name) + '[' + index + ']'; + if (anim.from[dimension] !== undefined && anim.to[dimension] !== undefined) { + return ' ' + anim.from[dimension] !== anim.to[dimension] ? computeNextValLinear(anim, anim.from[dimension], anim.to[dimension], fieldAccess) : fieldAccess + ' = ' + anim.from[dimension] + ';'; + } else { + return ' ' + fieldAccess + ' = ' + InitialOperationField[name][index] + ';'; + } +}; + +var unrolledVars = []; +for (var varIndex = 0; varIndex < 16; varIndex++) { + unrolledVars.push('m' + varIndex); +} +var setNextMatrixAndDetectChange = function setNextMatrixAndDetectChange(orderedMatrixOperations) { + var fn = [' var transform = result.transform !== undefined ? ' + 'result.transform : (result.transform = [{ matrix: [] }]);' + ' var transformMatrix = transform[0].matrix;']; + fn.push.apply(fn, inline(MatrixOps.unroll, ['transformMatrix'].concat(unrolledVars))); + for (var i = 0; i < orderedMatrixOperations.length; i++) { + var opName = orderedMatrixOperations[i]; + if (i === 0) { + fn.push.apply(fn, inline(MatrixOpsInitial[opName], ['transformMatrix', operationVar(opName)])); + } else { + fn.push.apply(fn, inline(MatrixOps[opName], ['transformMatrix', operationVar(opName)])); + } + } + fn.push.apply(fn, inline(MatrixOps.matrixDiffers, ['didChange', 'transformMatrix'].concat(unrolledVars))); + return fn; +}; + +var InterpolateMatrix = { + transformTranslate: true, + transformRotateRadians: true, + transformScale: true +}; + +var createFunctionString = function createFunctionString(anims) { + var orderedMatrixOperations = []; + + var fn = 'return (function() {\n'; + fn += createReusableOperationVars(anims); + fn += 'return function(result, value) {\n'; + fn += ' var didChange = false;\n'; + fn += ' var nextScalarVal;\n'; + fn += ' var ratio;\n'; + + for (var name in anims) { + var anim = anims[name]; + if (anim.type === 'linear') { + if (InterpolateMatrix[name]) { + orderedMatrixOperations.push(name); + var setOperations = [computeNextMatrixOperationField(anim, name, X_DIM, 0), computeNextMatrixOperationField(anim, name, Y_DIM, 1), computeNextMatrixOperationField(anim, name, Z_DIM, 2)]; + if (name === TRANSFORM_ROTATE_NAME) { + setOperations.push(computeNextMatrixOperationField(anim, name, W_DIM, 3)); + } + fn += newlines(setOperations); + } else { + fn += computeNextValLinearScalar(anim, 'nextScalarVal'); + fn += setNextValAndDetectChange(name, 'nextScalarVal'); + } + } else if (anim.type === 'constant') { + fn += computeNextValConstant(anim); + fn += setNextValAndDetectChange(name, 'nextScalarVal'); + } else if (anim.type === 'step') { + fn += computeNextValStep(anim); + fn += setNextValAndDetectChange(name, 'nextScalarVal'); + } else if (anim.type === 'identity') { + fn += computeNextValIdentity(anim); + fn += setNextValAndDetectChange(name, 'nextScalarVal'); + } + } + if (orderedMatrixOperations.length) { + fn += newlines(setNextMatrixAndDetectChange(orderedMatrixOperations)); + } + fn += ' return didChange;\n'; + fn += '};\n'; + fn += '})()'; + return fn; +}; + +var buildStyleInterpolator = function buildStyleInterpolator(anims) { + var interpolator = null; + function lazyStyleInterpolator(result, value) { + if (interpolator === null) { + interpolator = Function(createFunctionString(anims))(); + } + return interpolator(result, value); + } + return lazyStyleInterpolator; +}; + +module.exports = buildStyleInterpolator; +}, 342, null, "buildStyleInterpolator"); +__d(/* NavigatorNavigationBarStylesAndroid */function(global, require, module, exports) { +'use strict'; + +var buildStyleInterpolator = require(342 ); // 342 = buildStyleInterpolator +var merge = require(149 ); // 149 = merge + +var NAV_BAR_HEIGHT = 56; +var TITLE_LEFT = 72; +var BUTTON_SIZE = 24; +var TOUCH_TARGT_SIZE = 48; +var BUTTON_HORIZONTAL_MARGIN = 16; + +var BUTTON_EFFECTIVE_MARGIN = BUTTON_HORIZONTAL_MARGIN - (TOUCH_TARGT_SIZE - BUTTON_SIZE) / 2; +var NAV_ELEMENT_HEIGHT = NAV_BAR_HEIGHT; + +var BASE_STYLES = { + Title: { + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + alignItems: 'flex-start', + height: NAV_ELEMENT_HEIGHT, + backgroundColor: 'transparent', + marginLeft: TITLE_LEFT + }, + LeftButton: { + position: 'absolute', + top: 0, + left: BUTTON_EFFECTIVE_MARGIN, + overflow: 'hidden', + height: NAV_ELEMENT_HEIGHT, + backgroundColor: 'transparent' + }, + RightButton: { + position: 'absolute', + top: 0, + right: BUTTON_EFFECTIVE_MARGIN, + overflow: 'hidden', + alignItems: 'flex-end', + height: NAV_ELEMENT_HEIGHT, + backgroundColor: 'transparent' + } +}; + +var Stages = { + Left: { + Title: merge(BASE_STYLES.Title, { opacity: 0 }), + LeftButton: merge(BASE_STYLES.LeftButton, { opacity: 0 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 0 }) + }, + Center: { + Title: merge(BASE_STYLES.Title, { opacity: 1 }), + LeftButton: merge(BASE_STYLES.LeftButton, { opacity: 1 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 1 }) + }, + Right: { + Title: merge(BASE_STYLES.Title, { opacity: 0 }), + LeftButton: merge(BASE_STYLES.LeftButton, { opacity: 0 }), + RightButton: merge(BASE_STYLES.RightButton, { opacity: 0 }) + } +}; + +var opacityRatio = 100; + +function buildSceneInterpolators(startStyles, endStyles) { + return { + Title: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.Title.opacity, + to: endStyles.Title.opacity, + min: 0, + max: 1 + }, + left: { + type: 'linear', + from: startStyles.Title.left, + to: endStyles.Title.left, + min: 0, + max: 1, + extrapolate: true + } + }), + LeftButton: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.LeftButton.opacity, + to: endStyles.LeftButton.opacity, + min: 0, + max: 1, + round: opacityRatio + }, + left: { + type: 'linear', + from: startStyles.LeftButton.left, + to: endStyles.LeftButton.left, + min: 0, + max: 1 + } + }), + RightButton: buildStyleInterpolator({ + opacity: { + type: 'linear', + from: startStyles.RightButton.opacity, + to: endStyles.RightButton.opacity, + min: 0, + max: 1, + round: opacityRatio + }, + left: { + type: 'linear', + from: startStyles.RightButton.left, + to: endStyles.RightButton.left, + min: 0, + max: 1, + extrapolate: true + } + }) + }; +} + +var Interpolators = { + RightToCenter: buildSceneInterpolators(Stages.Right, Stages.Center), + + CenterToLeft: buildSceneInterpolators(Stages.Center, Stages.Left), + + RightToLeft: buildSceneInterpolators(Stages.Right, Stages.Left) +}; + +module.exports = { + General: { + NavBarHeight: NAV_BAR_HEIGHT, + StatusBarHeight: 0, + TotalNavHeight: NAV_BAR_HEIGHT + }, + Interpolators: Interpolators, + Stages: Stages +}; +}, 343, null, "NavigatorNavigationBarStylesAndroid"); +__d(/* NavigatorNavigationBar */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js'; +var React = require(126 ); // 126 = React +var NavigatorNavigationBarStylesAndroid = require(343 ); // 343 = NavigatorNavigationBarStylesAndroid +var NavigatorNavigationBarStylesIOS = require(341 ); // 341 = NavigatorNavigationBarStylesIOS +var Platform = require(79 ); // 79 = Platform +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var guid = require(225 ); // 225 = guid + +var _require = require(338 ), // 338 = immutable + Map = _require.Map; + +var COMPONENT_NAMES = ['Title', 'LeftButton', 'RightButton']; + +var NavigatorNavigationBarStyles = Platform.OS === 'android' ? NavigatorNavigationBarStylesAndroid : NavigatorNavigationBarStylesIOS; + +var navStatePresentedIndex = function navStatePresentedIndex(navState) { + if (navState.presentedIndex !== undefined) { + return navState.presentedIndex; + } + + return navState.observedTopOfStack; +}; + +var NavigatorNavigationBar = function (_React$Component) { + babelHelpers.inherits(NavigatorNavigationBar, _React$Component); + + function NavigatorNavigationBar() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, NavigatorNavigationBar); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = NavigatorNavigationBar.__proto__ || Object.getPrototypeOf(NavigatorNavigationBar)).call.apply(_ref, [this].concat(args))), _this), _this.immediatelyRefresh = function () { + _this._reset(); + _this.forceUpdate(); + }, _this._reset = function () { + _this._key = guid(); + _this._reusableProps = {}; + _this._components = {}; + _this._descriptors = {}; + + COMPONENT_NAMES.forEach(function (componentName) { + _this._components[componentName] = new Map(); + _this._descriptors[componentName] = new Map(); + }); + }, _this._getReusableProps = function (componentName, index) { + var propStack = _this._reusableProps[componentName]; + if (!propStack) { + propStack = _this._reusableProps[componentName] = []; + } + var props = propStack[index]; + if (!props) { + props = propStack[index] = { style: {} }; + } + return props; + }, _this._updateIndexProgress = function (progress, index, fromIndex, toIndex) { + var amount = toIndex > fromIndex ? progress : 1 - progress; + var oldDistToCenter = index - fromIndex; + var newDistToCenter = index - toIndex; + var interpolate; + if (oldDistToCenter > 0 && newDistToCenter === 0 || newDistToCenter > 0 && oldDistToCenter === 0) { + interpolate = _this.props.navigationStyles.Interpolators.RightToCenter; + } else if (oldDistToCenter < 0 && newDistToCenter === 0 || newDistToCenter < 0 && oldDistToCenter === 0) { + interpolate = _this.props.navigationStyles.Interpolators.CenterToLeft; + } else if (oldDistToCenter === newDistToCenter) { + interpolate = _this.props.navigationStyles.Interpolators.RightToCenter; + } else { + interpolate = _this.props.navigationStyles.Interpolators.RightToLeft; + } + + COMPONENT_NAMES.forEach(function (componentName) { + var component = this._components[componentName].get(this.props.navState.routeStack[index]); + var props = this._getReusableProps(componentName, index); + if (component && interpolate[componentName](props.style, amount)) { + props.pointerEvents = props.style.opacity === 0 ? 'none' : 'box-none'; + component.setNativeProps(props); + } + }, _this); + }, _this.updateProgress = function (progress, fromIndex, toIndex) { + var max = Math.max(fromIndex, toIndex); + var min = Math.min(fromIndex, toIndex); + for (var index = min; index <= max; index++) { + _this._updateIndexProgress(progress, index, fromIndex, toIndex); + } + }, _this._getComponent = function (componentName, route, index) { + if (_this._descriptors[componentName].includes(route)) { + return _this._descriptors[componentName].get(route); + } + + var rendered = null; + + var content = _this.props.routeMapper[componentName](_this.props.navState.routeStack[index], _this.props.navigator, index, _this.props.navState); + if (!content) { + return null; + } + + var componentIsActive = index === navStatePresentedIndex(_this.props.navState); + var initialStage = componentIsActive ? _this.props.navigationStyles.Stages.Center : _this.props.navigationStyles.Stages.Left; + rendered = React.createElement( + View, + { + ref: function ref(_ref2) { + _this._components[componentName] = _this._components[componentName].set(route, _ref2); + }, + pointerEvents: componentIsActive ? 'box-none' : 'none', + style: initialStage[componentName], __source: { + fileName: _jsxFileName, + lineNumber: 196 + } + }, + content + ); + + _this._descriptors[componentName] = _this._descriptors[componentName].set(route, rendered); + return rendered; + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(NavigatorNavigationBar, [{ + key: 'componentWillMount', + value: function componentWillMount() { + this._reset(); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var navBarStyle = { + height: this.props.navigationStyles.General.TotalNavHeight + }; + var navState = this.props.navState; + var components = navState.routeStack.map(function (route, index) { + return COMPONENT_NAMES.map(function (componentName) { + return _this2._getComponent(componentName, route, index); + }); + }); + + return React.createElement( + View, + { + key: this._key, + style: [styles.navBarContainer, navBarStyle, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 166 + } + }, + components + ); + } + }]); + return NavigatorNavigationBar; +}(React.Component); + +NavigatorNavigationBar.propTypes = { + navigator: React.PropTypes.object, + routeMapper: React.PropTypes.shape({ + Title: React.PropTypes.func.isRequired, + LeftButton: React.PropTypes.func.isRequired, + RightButton: React.PropTypes.func.isRequired + }).isRequired, + navState: React.PropTypes.shape({ + routeStack: React.PropTypes.arrayOf(React.PropTypes.object), + presentedIndex: React.PropTypes.number + }), + navigationStyles: React.PropTypes.object, + style: View.propTypes.style +}; +NavigatorNavigationBar.Styles = NavigatorNavigationBarStyles; +NavigatorNavigationBar.StylesAndroid = NavigatorNavigationBarStylesAndroid; +NavigatorNavigationBar.StylesIOS = NavigatorNavigationBarStylesIOS; +NavigatorNavigationBar.defaultProps = { + navigationStyles: NavigatorNavigationBarStyles +}; + + +var styles = StyleSheet.create({ + navBarContainer: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + backgroundColor: 'transparent' + } +}); + +module.exports = NavigatorNavigationBar; +}, 344, null, "NavigatorNavigationBar"); +__d(/* NavigatorSceneConfigs */function(global, require, module, exports) { +'use strict'; + +var Dimensions = require(129 ); // 129 = Dimensions +var I18nManager = require(331 ); // 331 = I18nManager +var PixelRatio = require(128 ); // 128 = PixelRatio + +var buildStyleInterpolator = require(342 ); // 342 = buildStyleInterpolator + +var IS_RTL = I18nManager.isRTL; + +var SCREEN_WIDTH = Dimensions.get('window').width; +var SCREEN_HEIGHT = Dimensions.get('window').height; +var PIXEL_RATIO = PixelRatio.get(); + +var ToTheLeftIOS = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: -SCREEN_WIDTH * 0.3, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + opacity: { + value: 1.0, + type: 'constant' + } +}; + +var ToTheRightIOS = babelHelpers.extends({}, ToTheLeftIOS, { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: SCREEN_WIDTH * 0.3, y: 0, z: 0 } + } +}); + +var FadeToTheLeft = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: -Math.round(SCREEN_WIDTH * 0.3), y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + + transformScale: { + from: { x: 1, y: 1, z: 1 }, + to: { x: 0.95, y: 0.95, z: 1 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + }, + opacity: { + from: 1, + to: 0.3, + min: 0, + max: 1, + type: 'linear', + extrapolate: false, + round: 100 + }, + translateX: { + from: 0, + to: -Math.round(SCREEN_WIDTH * 0.3), + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + scaleX: { + from: 1, + to: 0.95, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + }, + scaleY: { + from: 1, + to: 0.95, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + } +}; + +var FadeToTheRight = babelHelpers.extends({}, FadeToTheLeft, { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: Math.round(SCREEN_WIDTH * 0.3), y: 0, z: 0 } + }, + translateX: { + from: 0, + to: Math.round(SCREEN_WIDTH * 0.3) + } +}); + +var FadeIn = { + opacity: { + from: 0, + to: 1, + min: 0.5, + max: 1, + type: 'linear', + extrapolate: false, + round: 100 + } +}; + +var FadeOut = { + opacity: { + from: 1, + to: 0, + min: 0, + max: 0.5, + type: 'linear', + extrapolate: false, + round: 100 + } +}; + +var ToTheLeft = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: -SCREEN_WIDTH, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + opacity: { + value: 1.0, + type: 'constant' + }, + + translateX: { + from: 0, + to: -SCREEN_WIDTH, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}; + +var ToTheRight = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: SCREEN_WIDTH, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + opacity: { + value: 1.0, + type: 'constant' + }, + + translateX: { + from: 0, + to: SCREEN_WIDTH, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}; + +var ToTheUp = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: 0, y: -SCREEN_HEIGHT, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + opacity: { + value: 1.0, + type: 'constant' + }, + translateY: { + from: 0, + to: -SCREEN_HEIGHT, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}; + +var ToTheDown = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: 0, y: SCREEN_HEIGHT, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + opacity: { + value: 1.0, + type: 'constant' + }, + translateY: { + from: 0, + to: SCREEN_HEIGHT, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}; + +var FromTheRight = { + opacity: { + value: 1.0, + type: 'constant' + }, + + transformTranslate: { + from: { x: SCREEN_WIDTH, y: 0, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + + translateX: { + from: SCREEN_WIDTH, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + + scaleX: { + value: 1, + type: 'constant' + }, + scaleY: { + value: 1, + type: 'constant' + } +}; + +var FromTheLeft = babelHelpers.extends({}, FromTheRight, { + transformTranslate: { + from: { x: -SCREEN_WIDTH, y: 0, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + translateX: { + from: -SCREEN_WIDTH, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}); + +var FromTheDown = babelHelpers.extends({}, FromTheRight, { + transformTranslate: { + from: { y: SCREEN_HEIGHT, x: 0, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + translateY: { + from: SCREEN_HEIGHT, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}); + +var FromTheTop = babelHelpers.extends({}, FromTheRight, { + transformTranslate: { + from: { y: -SCREEN_HEIGHT, x: 0, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + translateY: { + from: -SCREEN_HEIGHT, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}); + +var ToTheBack = { + transformTranslate: { + from: { x: 0, y: 0, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + transformScale: { + from: { x: 1, y: 1, z: 1 }, + to: { x: 0.95, y: 0.95, z: 1 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + }, + opacity: { + from: 1, + to: 0.3, + min: 0, + max: 1, + type: 'linear', + extrapolate: false, + round: 100 + }, + scaleX: { + from: 1, + to: 0.95, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + }, + scaleY: { + from: 1, + to: 0.95, + min: 0, + max: 1, + type: 'linear', + extrapolate: true + } +}; + +var FromTheFront = { + opacity: { + value: 1.0, + type: 'constant' + }, + + transformTranslate: { + from: { x: 0, y: SCREEN_HEIGHT, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + translateY: { + from: SCREEN_HEIGHT, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + scaleX: { + value: 1, + type: 'constant' + }, + scaleY: { + value: 1, + type: 'constant' + } +}; + +var ToTheBackAndroid = { + opacity: { + value: 1, + type: 'constant' + } +}; + +var FromTheFrontAndroid = { + opacity: { + from: 0, + to: 1, + min: 0.5, + max: 1, + type: 'linear', + extrapolate: false, + round: 100 + }, + transformTranslate: { + from: { x: 0, y: 100, z: 0 }, + to: { x: 0, y: 0, z: 0 }, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + }, + translateY: { + from: 100, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PIXEL_RATIO + } +}; + +var BaseOverswipeConfig = { + frictionConstant: 1, + frictionByDistance: 1.5 +}; + +var BaseLeftToRightGesture = { + isDetachable: false, + + gestureDetectMovement: 2, + + notMoving: 0.3, + + directionRatio: 0.66, + + snapVelocity: 2, + + edgeHitWidth: 30, + + stillCompletionRatio: 3 / 5, + + fullDistance: SCREEN_WIDTH, + + direction: 'left-to-right' + +}; + +var BaseRightToLeftGesture = babelHelpers.extends({}, BaseLeftToRightGesture, { + direction: 'right-to-left' +}); + +var BaseDownUpGesture = babelHelpers.extends({}, BaseLeftToRightGesture, { + fullDistance: SCREEN_HEIGHT, + direction: 'bottom-to-top' +}); + +var BaseUpDownGesture = babelHelpers.extends({}, BaseLeftToRightGesture, { + fullDistance: SCREEN_HEIGHT, + direction: 'top-to-bottom' +}); + +var directionMapping = { + ToTheStartIOS: ToTheLeftIOS, + ToTheEndIOS: ToTheRightIOS, + FadeToTheStart: FadeToTheLeft, + FadeToTheEnd: FadeToTheRight, + ToTheStart: ToTheLeft, + ToTheEnd: ToTheRight, + FromTheStart: FromTheLeft, + FromTheEnd: FromTheRight, + BaseStartToEndGesture: BaseLeftToRightGesture, + BaseEndToStartGesture: BaseRightToLeftGesture +}; + +if (IS_RTL) { + directionMapping = { + ToTheStartIOS: ToTheRightIOS, + ToTheEndIOS: ToTheLeftIOS, + FadeToTheStart: FadeToTheRight, + FadeToTheEnd: FadeToTheLeft, + ToTheStart: ToTheRight, + ToTheEnd: ToTheLeft, + FromTheStart: FromTheRight, + FromTheEnd: FromTheLeft, + BaseStartToEndGesture: BaseRightToLeftGesture, + BaseEndToStartGesture: BaseLeftToRightGesture + }; +} + +var BaseConfig = { + gestures: { + pop: directionMapping.BaseStartToEndGesture + }, + + springFriction: 26, + springTension: 200, + + defaultTransitionVelocity: 1.5, + + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheEnd), + out: buildStyleInterpolator(directionMapping.FadeToTheStart) + } +}; + +var NavigatorSceneConfigs = { + PushFromRight: babelHelpers.extends({}, BaseConfig, { + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheEnd), + out: buildStyleInterpolator(directionMapping.ToTheStartIOS) + } + }), + PushFromLeft: babelHelpers.extends({}, BaseConfig, { + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheStart), + out: buildStyleInterpolator(directionMapping.ToTheEndIOS) + } + }), + FloatFromRight: babelHelpers.extends({}, BaseConfig), + FloatFromLeft: babelHelpers.extends({}, BaseConfig, { + gestures: { + pop: directionMapping.BaseEndToStartGesture + }, + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheStart), + out: buildStyleInterpolator(directionMapping.FadeToTheEnd) + } + }), + FloatFromBottom: babelHelpers.extends({}, BaseConfig, { + gestures: { + pop: babelHelpers.extends({}, directionMapping.BaseStartToEndGesture, { + edgeHitWidth: 150, + direction: 'top-to-bottom', + fullDistance: SCREEN_HEIGHT + }) + }, + animationInterpolators: { + into: buildStyleInterpolator(FromTheFront), + out: buildStyleInterpolator(ToTheBack) + } + }), + FloatFromBottomAndroid: babelHelpers.extends({}, BaseConfig, { + gestures: null, + defaultTransitionVelocity: 3, + springFriction: 20, + animationInterpolators: { + into: buildStyleInterpolator(FromTheFrontAndroid), + out: buildStyleInterpolator(ToTheBackAndroid) + } + }), + FadeAndroid: babelHelpers.extends({}, BaseConfig, { + gestures: null, + animationInterpolators: { + into: buildStyleInterpolator(FadeIn), + out: buildStyleInterpolator(FadeOut) + } + }), + SwipeFromLeft: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, directionMapping.BaseEndToStartGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, directionMapping.BaseStartToEndGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }) + }, + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheStart), + out: buildStyleInterpolator(directionMapping.ToTheEnd) + } + }), + HorizontalSwipeJump: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, directionMapping.BaseStartToEndGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, directionMapping.BaseEndToStartGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }) + }, + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheEnd), + out: buildStyleInterpolator(directionMapping.ToTheStart) + } + }), + HorizontalSwipeJumpFromRight: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, directionMapping.BaseEndToStartGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, directionMapping.BaseStartToEndGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + pop: directionMapping.BaseEndToStartGesture + }, + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheStart), + out: buildStyleInterpolator(directionMapping.FadeToTheEnd) + } + }), + HorizontalSwipeJumpFromLeft: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, directionMapping.BaseEndToStartGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, directionMapping.BaseStartToEndGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + pop: directionMapping.BaseEndToStartGesture + }, + animationInterpolators: { + into: buildStyleInterpolator(directionMapping.FromTheStart), + out: buildStyleInterpolator(directionMapping.ToTheEnd) + } + }), + VerticalUpSwipeJump: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, BaseUpDownGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, BaseDownUpGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }) + }, + animationInterpolators: { + into: buildStyleInterpolator(FromTheDown), + out: buildStyleInterpolator(ToTheUp) + } + }), + VerticalDownSwipeJump: babelHelpers.extends({}, BaseConfig, { + gestures: { + jumpBack: babelHelpers.extends({}, BaseDownUpGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }), + jumpForward: babelHelpers.extends({}, BaseUpDownGesture, { + overswipe: BaseOverswipeConfig, + edgeHitWidth: null, + isDetachable: true + }) + }, + animationInterpolators: { + into: buildStyleInterpolator(FromTheTop), + out: buildStyleInterpolator(ToTheDown) + } + }) +}; + +module.exports = NavigatorSceneConfigs; +}, 345, null, "NavigatorSceneConfigs"); +__d(/* PanResponder */function(global, require, module, exports) { + +'use strict'; + +var InteractionManager = require(221 ); // 221 = ./InteractionManager +var TouchHistoryMath = require(347 ); // 347 = TouchHistoryMath + +var currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; +var currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter; +var previousCentroidXOfTouchesChangedAfter = TouchHistoryMath.previousCentroidXOfTouchesChangedAfter; +var previousCentroidYOfTouchesChangedAfter = TouchHistoryMath.previousCentroidYOfTouchesChangedAfter; +var currentCentroidX = TouchHistoryMath.currentCentroidX; +var currentCentroidY = TouchHistoryMath.currentCentroidY; + +var PanResponder = { + + _initializeGestureState: function _initializeGestureState(gestureState) { + gestureState.moveX = 0; + gestureState.moveY = 0; + gestureState.x0 = 0; + gestureState.y0 = 0; + gestureState.dx = 0; + gestureState.dy = 0; + gestureState.vx = 0; + gestureState.vy = 0; + gestureState.numberActiveTouches = 0; + + gestureState._accountsForMovesUpTo = 0; + }, + + _updateGestureStateOnMove: function _updateGestureStateOnMove(gestureState, touchHistory) { + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); + gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); + var movedAfter = gestureState._accountsForMovesUpTo; + var prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); + var x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); + var prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter); + var y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter); + var nextDX = gestureState.dx + (x - prevX); + var nextDY = gestureState.dy + (y - prevY); + + var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo; + gestureState.vx = (nextDX - gestureState.dx) / dt; + gestureState.vy = (nextDY - gestureState.dy) / dt; + + gestureState.dx = nextDX; + gestureState.dy = nextDY; + gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp; + }, + + create: function create(config) { + var interactionState = { + handle: null + }; + var gestureState = { + stateID: Math.random() + }; + PanResponder._initializeGestureState(gestureState); + var panHandlers = { + onStartShouldSetResponder: function onStartShouldSetResponder(e) { + return config.onStartShouldSetPanResponder === undefined ? false : config.onStartShouldSetPanResponder(e, gestureState); + }, + onMoveShouldSetResponder: function onMoveShouldSetResponder(e) { + return config.onMoveShouldSetPanResponder === undefined ? false : config.onMoveShouldSetPanResponder(e, gestureState); + }, + onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture(e) { + if (e.nativeEvent.touches.length === 1) { + PanResponder._initializeGestureState(gestureState); + } + gestureState.numberActiveTouches = e.touchHistory.numberActiveTouches; + return config.onStartShouldSetPanResponderCapture !== undefined ? config.onStartShouldSetPanResponderCapture(e, gestureState) : false; + }, + + onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture(e) { + var touchHistory = e.touchHistory; + + if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) { + return false; + } + PanResponder._updateGestureStateOnMove(gestureState, touchHistory); + return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(e, gestureState) : false; + }, + + onResponderGrant: function onResponderGrant(e) { + if (!interactionState.handle) { + interactionState.handle = InteractionManager.createInteractionHandle(); + } + gestureState.x0 = currentCentroidX(e.touchHistory); + gestureState.y0 = currentCentroidY(e.touchHistory); + gestureState.dx = 0; + gestureState.dy = 0; + if (config.onPanResponderGrant) { + config.onPanResponderGrant(e, gestureState); + } + + return config.onShouldBlockNativeResponder === undefined ? true : config.onShouldBlockNativeResponder(); + }, + + onResponderReject: function onResponderReject(e) { + clearInteractionHandle(interactionState, config.onPanResponderReject, e, gestureState); + }, + + onResponderRelease: function onResponderRelease(e) { + clearInteractionHandle(interactionState, config.onPanResponderRelease, e, gestureState); + PanResponder._initializeGestureState(gestureState); + }, + + onResponderStart: function onResponderStart(e) { + var touchHistory = e.touchHistory; + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + if (config.onPanResponderStart) { + config.onPanResponderStart(e, gestureState); + } + }, + + onResponderMove: function onResponderMove(e) { + var touchHistory = e.touchHistory; + + if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) { + return; + } + + PanResponder._updateGestureStateOnMove(gestureState, touchHistory); + if (config.onPanResponderMove) { + config.onPanResponderMove(e, gestureState); + } + }, + + onResponderEnd: function onResponderEnd(e) { + var touchHistory = e.touchHistory; + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + clearInteractionHandle(interactionState, config.onPanResponderEnd, e, gestureState); + }, + + onResponderTerminate: function onResponderTerminate(e) { + clearInteractionHandle(interactionState, config.onPanResponderTerminate, e, gestureState); + PanResponder._initializeGestureState(gestureState); + }, + + onResponderTerminationRequest: function onResponderTerminationRequest(e) { + return config.onPanResponderTerminationRequest === undefined ? true : config.onPanResponderTerminationRequest(e, gestureState); + } + }; + return { + panHandlers: panHandlers, + getInteractionHandle: function getInteractionHandle() { + return interactionState.handle; + } + }; + } +}; + +function clearInteractionHandle(interactionState, callback, event, gestureState) { + if (interactionState.handle) { + InteractionManager.clearInteractionHandle(interactionState.handle); + interactionState.handle = null; + } + if (callback) { + callback(event, gestureState); + } +} + +module.exports = PanResponder; +}, 346, null, "PanResponder"); +__d(/* TouchHistoryMath */function(global, require, module, exports) { + +'use strict'; + +var TouchHistoryMath = { + centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { + var touchBank = touchHistory.touchBank; + var total = 0; + var count = 0; + + var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; + + if (oneTouchData !== null) { + if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) { + total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY; + count = 1; + } + } else { + for (var i = 0; i < touchBank.length; i++) { + var touchTrack = touchBank[i]; + if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { + var toAdd; + if (ofCurrent && isXAxis) { + toAdd = touchTrack.currentPageX; + } else if (ofCurrent && !isXAxis) { + toAdd = touchTrack.currentPageY; + } else if (!ofCurrent && isXAxis) { + toAdd = touchTrack.previousPageX; + } else { + toAdd = touchTrack.previousPageY; + } + total += toAdd; + count++; + } + } + } + return count > 0 ? total / count : TouchHistoryMath.noCentroid; + }, + + currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, true); + }, + + currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, true); + }, + + previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, false); + }, + + previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, false); + }, + + currentCentroidX: function currentCentroidX(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, true, true); + }, + + currentCentroidY: function currentCentroidY(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, false, true); + }, + + noCentroid: -1 +}; + +module.exports = TouchHistoryMath; +}, 347, null, "TouchHistoryMath"); +__d(/* clamp */function(global, require, module, exports) { +'use strict'; + +function clamp(min, value, max) { + if (value < min) { + return min; + } + if (value > max) { + return max; + } + return value; +} + +module.exports = clamp; +}, 348, null, "clamp"); +__d(/* rebound/rebound.js */function(global, require, module, exports) { + +(function () { + var rebound = {}; + var util = rebound.util = {}; + var concat = Array.prototype.concat; + var slice = Array.prototype.slice; + + util.bind = function bind(func, context) { + var args = slice.call(arguments, 2); + return function () { + func.apply(context, concat.call(args, slice.call(arguments))); + }; + }; + + util.extend = function extend(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key]; + } + } + }; + + 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, { + + _springRegistry: null, + + _isIdle: true, + + _lastTimeMillis: -1, + + _activeSprings: null, + + listeners: null, + + _idleSpringIndices: null, + + setLooper: function setLooper(looper) { + this.looper = looper; + looper.springSystem = this; + }, + + createSpring: function createSpring(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); + }, + + createSpringWithBouncinessAndSpeed: function createSpringWithBouncinessAndSpeed(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); + }, + + createSpringWithConfig: function createSpringWithConfig(springConfig) { + var spring = new Spring(this); + this.registerSpring(spring); + spring.setSpringConfig(springConfig); + return spring; + }, + + getIsIdle: function getIsIdle() { + return this._isIdle; + }, + + getSpringById: function getSpringById(id) { + return this._springRegistry[id]; + }, + + getAllSprings: function getAllSprings() { + var vals = []; + for (var id in this._springRegistry) { + if (this._springRegistry.hasOwnProperty(id)) { + vals.push(this._springRegistry[id]); + } + } + return vals; + }, + + registerSpring: function registerSpring(spring) { + this._springRegistry[spring.getId()] = spring; + }, + + deregisterSpring: function deregisterSpring(spring) { + removeFirst(this._activeSprings, spring); + delete this._springRegistry[spring.getId()]; + }, + + advance: function advance(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); + } + }, + + loop: function loop(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); + } + + this.advance(currentTimeMillis, ellapsedMillis); + if (this._activeSprings.length === 0) { + this._isIdle = true; + this._lastTimeMillis = -1; + } + + for (i = 0; i < len; i++) { + listener = this.listeners[i]; + listener.onAfterIntegrate && listener.onAfterIntegrate(this); + } + + if (!this._isIdle) { + this.looper.run(); + } + }, + + activateSpring: function activateSpring(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(); + } + }, + + addListener: function addListener(listener) { + this.listeners.push(listener); + }, + + removeListener: function removeListener(listener) { + removeFirst(this.listeners, listener); + }, + + removeAllListeners: function removeAllListeners() { + this.listeners = []; + } + + }); + + 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, + + MAX_DELTA_TIME_SEC: 0.064, + + SOLVER_TIMESTEP_SEC: 0.001 + + }); + + util.extend(Spring.prototype, { + + _id: 0, + + _springConfig: null, + + _overshootClampingEnabled: false, + + _currentState: null, + + _previousState: null, + + _tempState: null, + + _startValue: 0, + + _endValue: 0, + + _wasAtRest: true, + + _restSpeedThreshold: 0.001, + + _displacementFromRestThreshold: 0.001, + + listeners: null, + + _timeAccumulator: 0, + + _springSystem: null, + + destroy: function destroy() { + this.listeners = []; + this.frames = []; + this._springSystem.deregisterSpring(this); + }, + + getId: function getId() { + return this._id; + }, + + setSpringConfig: function setSpringConfig(springConfig) { + this._springConfig = springConfig; + return this; + }, + + getSpringConfig: function getSpringConfig() { + return this._springConfig; + }, + + setCurrentValue: function setCurrentValue(currentValue, skipSetAtRest) { + this._startValue = currentValue; + this._currentState.position = currentValue; + if (!skipSetAtRest) { + this.setAtRest(); + } + this.notifyPositionUpdated(false, false); + return this; + }, + + getStartValue: function getStartValue() { + return this._startValue; + }, + + getCurrentValue: function getCurrentValue() { + return this._currentState.position; + }, + + getCurrentDisplacementDistance: function getCurrentDisplacementDistance() { + return this.getDisplacementDistanceForState(this._currentState); + }, + + getDisplacementDistanceForState: function getDisplacementDistanceForState(state) { + return Math.abs(this._endValue - state.position); + }, + + setEndValue: function setEndValue(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; + }, + + getEndValue: function getEndValue() { + return this._endValue; + }, + + setVelocity: function setVelocity(velocity) { + if (velocity === this._currentState.velocity) { + return this; + } + this._currentState.velocity = velocity; + this._springSystem.activateSpring(this.getId()); + return this; + }, + + getVelocity: function getVelocity() { + return this._currentState.velocity; + }, + + setRestSpeedThreshold: function setRestSpeedThreshold(restSpeedThreshold) { + this._restSpeedThreshold = restSpeedThreshold; + return this; + }, + + getRestSpeedThreshold: function getRestSpeedThreshold() { + return this._restSpeedThreshold; + }, + + setRestDisplacementThreshold: function setRestDisplacementThreshold(displacementFromRestThreshold) { + this._displacementFromRestThreshold = displacementFromRestThreshold; + }, + + getRestDisplacementThreshold: function getRestDisplacementThreshold() { + return this._displacementFromRestThreshold; + }, + + setOvershootClampingEnabled: function setOvershootClampingEnabled(enabled) { + this._overshootClampingEnabled = enabled; + return this; + }, + + isOvershootClampingEnabled: function isOvershootClampingEnabled() { + return this._overshootClampingEnabled; + }, + + isOvershooting: function isOvershooting() { + var start = this._startValue; + var end = this._endValue; + return this._springConfig.tension > 0 && (start < end && this.getCurrentValue() > end || start > end && this.getCurrentValue() < end); + }, + + advance: function advance(time, realDeltaTime) { + var isAtRest = this.isAtRest(); + + if (isAtRest && this._wasAtRest) { + return; + } + + var adjustedDeltaTime = realDeltaTime; + if (realDeltaTime > Spring.MAX_DELTA_TIME_SEC) { + adjustedDeltaTime = Spring.MAX_DELTA_TIME_SEC; + } + + this._timeAccumulator += adjustedDeltaTime; + + var tension = this._springConfig.tension, + friction = this._springConfig.friction, + position = this._currentState.position, + velocity = this._currentState.velocity, + tempPosition = this._tempState.position, + tempVelocity = this._tempState.velocity, + aVelocity, + aAcceleration, + bVelocity, + bAcceleration, + cVelocity, + cAcceleration, + dVelocity, + dAcceleration, + dxdt, + dvdt; + + while (this._timeAccumulator >= Spring.SOLVER_TIMESTEP_SEC) { + + this._timeAccumulator -= Spring.SOLVER_TIMESTEP_SEC; + + if (this._timeAccumulator < Spring.SOLVER_TIMESTEP_SEC) { + this._previousState.position = position; + this._previousState.velocity = velocity; + } + + aVelocity = velocity; + aAcceleration = tension * (this._endValue - tempPosition) - friction * velocity; + + 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; + + 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; + + 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); + + position += dxdt * Spring.SOLVER_TIMESTEP_SEC; + velocity += dvdt * Spring.SOLVER_TIMESTEP_SEC; + } + + this._tempState.position = tempPosition; + this._tempState.velocity = tempVelocity; + + this._currentState.position = position; + this._currentState.velocity = velocity; + + if (this._timeAccumulator > 0) { + this._interpolate(this._timeAccumulator / Spring.SOLVER_TIMESTEP_SEC); + } + + if (this.isAtRest() || this._overshootClampingEnabled && this.isOvershooting()) { + + 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 notifyActivate = false; + if (this._wasAtRest) { + this._wasAtRest = false; + notifyActivate = true; + } + + var notifyAtRest = false; + if (isAtRest) { + this._wasAtRest = true; + notifyAtRest = true; + } + + this.notifyPositionUpdated(notifyActivate, notifyAtRest); + }, + + notifyPositionUpdated: function notifyPositionUpdated(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); + } + + if (listener.onSpringUpdate) { + listener.onSpringUpdate(this); + } + + if (notifyAtRest && listener.onSpringAtRest) { + listener.onSpringAtRest(this); + } + } + }, + + systemShouldAdvance: function systemShouldAdvance() { + return !this.isAtRest() || !this.wasAtRest(); + }, + + wasAtRest: function wasAtRest() { + return this._wasAtRest; + }, + + isAtRest: function isAtRest() { + return Math.abs(this._currentState.velocity) < this._restSpeedThreshold && (this.getDisplacementDistanceForState(this._currentState) <= this._displacementFromRestThreshold || this._springConfig.tension === 0); + }, + + setAtRest: function setAtRest() { + this._endValue = this._currentState.position; + this._tempState.position = this._currentState.position; + this._currentState.velocity = 0; + return this; + }, + + _interpolate: function _interpolate(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); + }, + + getListeners: function getListeners() { + return this.listeners; + }, + + addListener: function addListener(newListener) { + this.listeners.push(newListener); + return this; + }, + + removeListener: function removeListener(listenerToRemove) { + removeFirst(this.listeners, listenerToRemove); + return this; + }, + + removeAllListeners: function removeAllListeners() { + this.listeners = []; + return this; + }, + + currentValueIsApproximately: function currentValueIsApproximately(value) { + return Math.abs(this.getCurrentValue() - value) <= this.getRestDisplacementThreshold(); + } + + }); + + var PhysicsState = function PhysicsState() {}; + + util.extend(PhysicsState.prototype, { + position: 0, + velocity: 0 + }); + + var SpringConfig = rebound.SpringConfig = function SpringConfig(tension, friction) { + this.tension = tension; + this.friction = friction; + }; + + var AnimationLooper = rebound.AnimationLooper = function AnimationLooper() { + this.springSystem = null; + var _this = this; + var _run = function _run() { + _this.springSystem.loop(Date.now()); + }; + + this.run = function () { + util.onFrame(_run); + }; + }; + + 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; + }; + }; + + rebound.SteppingSimulationLooper = function (timestep) { + this.springSystem = null; + var time = 0; + + this.run = function () {}; + + this.step = function (timestep) { + this.springSystem.loop(time += timestep); + }; + }; + + var OrigamiValueConverter = rebound.OrigamiValueConverter = { + tensionFromOrigamiValue: function tensionFromOrigamiValue(oValue) { + return (oValue - 30.0) * 3.62 + 194.0; + }, + + origamiValueFromTension: function origamiValueFromTension(tension) { + return (tension - 194.0) / 3.62 + 30.0; + }, + + frictionFromOrigamiValue: function frictionFromOrigamiValue(oValue) { + return (oValue - 8.0) * 3.0 + 25.0; + }, + + origamiFromFriction: function origamiFromFriction(friction) { + return (friction - 25.0) / 3.0 + 8.0; + } + }; + + 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); + }; + + util.extend(BouncyConversion.prototype, { + + normalize: function normalize(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + }, + + projectNormal: function projectNormal(n, start, end) { + return start + n * (end - start); + }, + + linearInterpolation: function linearInterpolation(t, start, end) { + return t * end + (1.0 - t) * start; + }, + + quadraticOutInterpolation: function quadraticOutInterpolation(t, start, end) { + return this.linearInterpolation(2 * t - t * t, start, end); + }, + + b3Friction1: function b3Friction1(x) { + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; + }, + + b3Friction2: function b3Friction2(x) { + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2.; + }, + + b3Friction3: function b3Friction3(x) { + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; + }, + + b3Nobounce: function b3Nobounce(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; + } + }); + + util.extend(SpringConfig, { + fromOrigamiTensionAndFriction: function fromOrigamiTensionAndFriction(tension, friction) { + return new SpringConfig(OrigamiValueConverter.tensionFromOrigamiValue(tension), OrigamiValueConverter.frictionFromOrigamiValue(friction)); + }, + + fromBouncinessAndSpeed: function fromBouncinessAndSpeed(bounciness, speed) { + var bouncyConversion = new rebound.BouncyConversion(bounciness, speed); + return this.fromOrigamiTensionAndFriction(bouncyConversion.bouncyTension, bouncyConversion.bouncyFriction); + }, + + coastingConfigWithOrigamiFriction: function coastingConfigWithOrigamiFriction(friction) { + return new SpringConfig(0, OrigamiValueConverter.frictionFromOrigamiValue(friction)); + } + }); + + SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG = SpringConfig.fromOrigamiTensionAndFriction(40, 7); + + util.extend(SpringConfig.prototype, { friction: 0, tension: 0 }); + + var colorCache = {}; + util.hexToRGB = function (color) { + if (colorCache[color]) { + return colorCache[color]; + } + color = color.replace('#', ''); + if (color.length === 3) { + color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; + } + var parts = color.match(/.{2}/g); + + var ret = { + r: parseInt(parts[0], 16), + g: parseInt(parts[1], 16), + b: parseInt(parts[2], 16) + }; + + colorCache[color] = ret; + return ret; + }; + + 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 MathUtil = rebound.MathUtil = { + mapValueInRange: function mapValueInRange(value, fromLow, fromHigh, toLow, toHigh) { + var fromRangeSize = fromHigh - fromLow; + var toRangeSize = toHigh - toLow; + var valueScale = (value - fromLow) / fromRangeSize; + return toLow + valueScale * toRangeSize; + }, + + interpolateColor: function interpolateColor(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); + } + }, + + degreesToRadians: function degreesToRadians(deg) { + return deg * Math.PI / 180; + }, + + radiansToDegrees: function radiansToDegrees(rad) { + return rad * 180 / Math.PI; + } + + }; + + util.extend(util, MathUtil); + + 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; + } + + util.onFrame = function onFrame(func) { + return _onFrame(func); + }; + + if (typeof exports != 'undefined') { + util.extend(exports, rebound); + } else if (typeof window != 'undefined') { + window.rebound = rebound; + } +})(); +}, 349, null, "rebound/rebound.js"); +__d(/* NavigatorIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Navigation/NavigatorIOS.ios.js'; +var EventEmitter = require(103 ); // 103 = EventEmitter +var Image = require(237 ); // 237 = Image +var NavigationContext = require(334 ); // 334 = NavigationContext +var RCTNavigatorManager = require(80 ).NavigatorManager; // 80 = NativeModules +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var StaticContainer = require(351 ); // 351 = StaticContainer.react +var StyleSheet = require(127 ); // 127 = StyleSheet +var TVEventHandler = require(214 ); // 214 = TVEventHandler +var View = require(146 ); // 146 = View + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var logError = require(112 ); // 112 = logError +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror + +var TRANSITIONER_REF = 'transitionerRef'; + +var PropTypes = React.PropTypes; + +var __uid = 0; +function getuid() { + return __uid++; +} + +var NavigatorTransitionerIOS = function (_React$Component) { + babelHelpers.inherits(NavigatorTransitionerIOS, _React$Component); + + function NavigatorTransitionerIOS() { + babelHelpers.classCallCheck(this, NavigatorTransitionerIOS); + return babelHelpers.possibleConstructorReturn(this, (NavigatorTransitionerIOS.__proto__ || Object.getPrototypeOf(NavigatorTransitionerIOS)).apply(this, arguments)); + } + + babelHelpers.createClass(NavigatorTransitionerIOS, [{ + key: 'requestSchedulingNavigation', + value: function requestSchedulingNavigation(cb) { + RCTNavigatorManager.requestSchedulingJavaScriptNavigation(ReactNative.findNodeHandle(this), logError, cb); + } + }, { + key: 'render', + value: function render() { + return React.createElement(RCTNavigator, babelHelpers.extends({}, this.props, { + __source: { + fileName: _jsxFileName, + lineNumber: 51 + } + })); + } + }]); + return NavigatorTransitionerIOS; +}(React.Component); + +var SystemIconLabels = { + done: true, + cancel: true, + edit: true, + save: true, + add: true, + compose: true, + reply: true, + action: true, + organize: true, + bookmarks: true, + search: true, + refresh: true, + stop: true, + camera: true, + trash: true, + play: true, + pause: true, + rewind: true, + 'fast-forward': true, + undo: true, + redo: true, + 'page-curl': true +}; +var SystemIcons = keyMirror(SystemIconLabels); + +var NavigatorIOS = React.createClass({ + displayName: 'NavigatorIOS', + + + propTypes: { + initialRoute: PropTypes.shape({ + component: PropTypes.func.isRequired, + + title: PropTypes.string.isRequired, + + titleImage: Image.propTypes.source, + + passProps: PropTypes.object, + + backButtonIcon: Image.propTypes.source, + + backButtonTitle: PropTypes.string, + + leftButtonIcon: Image.propTypes.source, + + leftButtonTitle: PropTypes.string, + + leftButtonSystemIcon: PropTypes.oneOf(Object.keys(SystemIcons)), + + onLeftButtonPress: PropTypes.func, + + rightButtonIcon: Image.propTypes.source, + + rightButtonTitle: PropTypes.string, + + rightButtonSystemIcon: PropTypes.oneOf(Object.keys(SystemIcons)), + + onRightButtonPress: PropTypes.func, + + wrapperStyle: View.propTypes.style, + + navigationBarHidden: PropTypes.bool, + + shadowHidden: PropTypes.bool, + + tintColor: PropTypes.string, + + barTintColor: PropTypes.string, + + titleTextColor: PropTypes.string, + + translucent: PropTypes.bool + + }).isRequired, + + navigationBarHidden: PropTypes.bool, + + shadowHidden: PropTypes.bool, + + itemWrapperStyle: View.propTypes.style, + + tintColor: PropTypes.string, + + barTintColor: PropTypes.string, + + titleTextColor: PropTypes.string, + + translucent: PropTypes.bool, + + interactivePopGestureEnabled: PropTypes.bool + + }, + + navigator: undefined, + navigationContext: new NavigationContext(), + + componentWillMount: function componentWillMount() { + this.navigator = { + push: this.push, + pop: this.pop, + popN: this.popN, + replace: this.replace, + replaceAtIndex: this.replaceAtIndex, + replacePrevious: this.replacePrevious, + replacePreviousAndPop: this.replacePreviousAndPop, + resetTo: this.resetTo, + popToRoute: this.popToRoute, + popToTop: this.popToTop, + navigationContext: this.navigationContext + }; + this._emitWillFocus(this.state.routeStack[this.state.observedTopOfStack]); + }, + + componentDidMount: function componentDidMount() { + this._emitDidFocus(this.state.routeStack[this.state.observedTopOfStack]); + this._enableTVEventHandler(); + }, + + componentWillUnmount: function componentWillUnmount() { + this.navigationContext.dispose(); + this.navigationContext = new NavigationContext(); + this._disableTVEventHandler(); + }, + + getDefaultProps: function getDefaultProps() { + return { + translucent: true + }; + }, + + getInitialState: function getInitialState() { + return { + idStack: [getuid()], + routeStack: [this.props.initialRoute], + + requestedTopOfStack: 0, + + observedTopOfStack: 0, + progress: 1, + fromIndex: 0, + toIndex: 0, + + makingNavigatorRequest: false, + + updatingAllIndicesAtOrBeyond: 0 + }; + }, + + _toFocusOnNavigationComplete: undefined, + + _handleFocusRequest: function _handleFocusRequest(item) { + if (this.state.makingNavigatorRequest) { + this._toFocusOnNavigationComplete = item; + } else { + this._getFocusEmitter().emit('focus', item); + } + }, + + _focusEmitter: undefined, + + _getFocusEmitter: function _getFocusEmitter() { + var focusEmitter = this._focusEmitter; + if (!focusEmitter) { + focusEmitter = new EventEmitter(); + this._focusEmitter = focusEmitter; + } + return focusEmitter; + }, + + getChildContext: function getChildContext() { + return { + onFocusRequested: this._handleFocusRequest, + focusEmitter: this._getFocusEmitter() + }; + }, + + childContextTypes: { + onFocusRequested: React.PropTypes.func, + focusEmitter: React.PropTypes.instanceOf(EventEmitter) + }, + + _tryLockNavigator: function _tryLockNavigator(cb) { + this.refs[TRANSITIONER_REF].requestSchedulingNavigation(function (acquiredLock) { + return acquiredLock && cb(); + }); + }, + + _handleNavigatorStackChanged: function _handleNavigatorStackChanged(e) { + var newObservedTopOfStack = e.nativeEvent.stackLength - 1; + this._emitDidFocus(this.state.routeStack[newObservedTopOfStack]); + + invariant(newObservedTopOfStack <= this.state.requestedTopOfStack, 'No navigator item should be pushed without JS knowing about it %s %s', newObservedTopOfStack, this.state.requestedTopOfStack); + var wasWaitingForConfirmation = this.state.requestedTopOfStack !== this.state.observedTopOfStack; + if (wasWaitingForConfirmation) { + invariant(newObservedTopOfStack === this.state.requestedTopOfStack, 'If waiting for observedTopOfStack to reach requestedTopOfStack, ' + 'the only valid observedTopOfStack should be requestedTopOfStack.'); + } + + var nextState = { + observedTopOfStack: newObservedTopOfStack, + makingNavigatorRequest: false, + updatingAllIndicesAtOrBeyond: null, + progress: 1, + toIndex: newObservedTopOfStack, + fromIndex: newObservedTopOfStack + }; + this.setState(nextState, this._eliminateUnneededChildren); + }, + + _eliminateUnneededChildren: function _eliminateUnneededChildren() { + var updatingAllIndicesAtOrBeyond = this.state.routeStack.length > this.state.observedTopOfStack + 1 ? this.state.observedTopOfStack + 1 : null; + this.setState({ + idStack: this.state.idStack.slice(0, this.state.observedTopOfStack + 1), + routeStack: this.state.routeStack.slice(0, this.state.observedTopOfStack + 1), + + requestedTopOfStack: this.state.observedTopOfStack, + makingNavigatorRequest: true, + updatingAllIndicesAtOrBeyond: updatingAllIndicesAtOrBeyond + }); + }, + + _emitDidFocus: function _emitDidFocus(route) { + this.navigationContext.emit('didfocus', { route: route }); + }, + + _emitWillFocus: function _emitWillFocus(route) { + this.navigationContext.emit('willfocus', { route: route }); + }, + + push: function push(route) { + var _this2 = this; + + invariant(!!route, 'Must supply route to push'); + + if (this.state.requestedTopOfStack === this.state.observedTopOfStack) { + this._tryLockNavigator(function () { + _this2._emitWillFocus(route); + + var nextStack = _this2.state.routeStack.concat([route]); + var nextIDStack = _this2.state.idStack.concat([getuid()]); + _this2.setState({ + idStack: nextIDStack, + routeStack: nextStack, + requestedTopOfStack: nextStack.length - 1, + makingNavigatorRequest: true, + updatingAllIndicesAtOrBeyond: nextStack.length - 1 + }); + }); + } + }, + + popN: function popN(n) { + var _this3 = this; + + if (n === 0) { + return; + } + + if (this.state.requestedTopOfStack === this.state.observedTopOfStack) { + if (this.state.requestedTopOfStack > 0) { + this._tryLockNavigator(function () { + var newRequestedTopOfStack = _this3.state.requestedTopOfStack - n; + invariant(newRequestedTopOfStack >= 0, 'Cannot pop below 0'); + _this3._emitWillFocus(_this3.state.routeStack[newRequestedTopOfStack]); + _this3.setState({ + requestedTopOfStack: newRequestedTopOfStack, + makingNavigatorRequest: true, + updatingAllIndicesAtOrBeyond: _this3.state.requestedTopOfStack - n + }); + }); + } + } + }, + + pop: function pop() { + this.popN(1); + }, + + replaceAtIndex: function replaceAtIndex(route, index) { + invariant(!!route, 'Must supply route to replace'); + if (index < 0) { + index += this.state.routeStack.length; + } + + if (this.state.routeStack.length <= index) { + return; + } + + var nextIDStack = this.state.idStack.slice(); + var nextRouteStack = this.state.routeStack.slice(); + nextIDStack[index] = getuid(); + nextRouteStack[index] = route; + + this.setState({ + idStack: nextIDStack, + routeStack: nextRouteStack, + makingNavigatorRequest: false, + updatingAllIndicesAtOrBeyond: index + }); + + this._emitWillFocus(route); + this._emitDidFocus(route); + }, + + replace: function replace(route) { + this.replaceAtIndex(route, -1); + }, + + replacePrevious: function replacePrevious(route) { + this.replaceAtIndex(route, -2); + }, + + popToTop: function popToTop() { + this.popToRoute(this.state.routeStack[0]); + }, + + popToRoute: function popToRoute(route) { + var indexOfRoute = this.state.routeStack.indexOf(route); + invariant(indexOfRoute !== -1, 'Calling pop to route for a route that doesn\'t exist!'); + var numToPop = this.state.routeStack.length - indexOfRoute - 1; + this.popN(numToPop); + }, + + replacePreviousAndPop: function replacePreviousAndPop(route) { + var _this4 = this; + + if (this.state.requestedTopOfStack !== this.state.observedTopOfStack) { + return; + } + if (this.state.routeStack.length < 2) { + return; + } + this._tryLockNavigator(function () { + _this4.replacePrevious(route); + _this4.setState({ + requestedTopOfStack: _this4.state.requestedTopOfStack - 1, + makingNavigatorRequest: true + }); + }); + }, + + resetTo: function resetTo(route) { + invariant(!!route, 'Must supply route to push'); + + if (this.state.requestedTopOfStack !== this.state.observedTopOfStack) { + return; + } + this.replaceAtIndex(route, 0); + this.popToRoute(route); + }, + + _handleNavigationComplete: function _handleNavigationComplete(e) { + e.stopPropagation(); + + if (this._toFocusOnNavigationComplete) { + this._getFocusEmitter().emit('focus', this._toFocusOnNavigationComplete); + this._toFocusOnNavigationComplete = null; + } + this._handleNavigatorStackChanged(e); + }, + + _routeToStackItem: function _routeToStackItem(routeArg, i) { + var component = routeArg.component, + wrapperStyle = routeArg.wrapperStyle, + passProps = routeArg.passProps, + route = babelHelpers.objectWithoutProperties(routeArg, ['component', 'wrapperStyle', 'passProps']); + var _props = this.props, + itemWrapperStyle = _props.itemWrapperStyle, + props = babelHelpers.objectWithoutProperties(_props, ['itemWrapperStyle']); + + var shouldUpdateChild = this.state.updatingAllIndicesAtOrBeyond != null && this.state.updatingAllIndicesAtOrBeyond >= i; + var Component = component; + return React.createElement( + StaticContainer, + { key: 'nav' + i, shouldUpdate: shouldUpdateChild, __source: { + fileName: _jsxFileName, + lineNumber: 855 + } + }, + React.createElement( + RCTNavigatorItem, + babelHelpers.extends({}, props, route, { + style: [styles.stackItem, itemWrapperStyle, wrapperStyle], __source: { + fileName: _jsxFileName, + lineNumber: 856 + } + }), + React.createElement(Component, babelHelpers.extends({ + navigator: this.navigator, + route: route + }, passProps, { + __source: { + fileName: _jsxFileName, + lineNumber: 864 + } + })) + ) + ); + }, + + _renderNavigationStackItems: function _renderNavigationStackItems() { + var shouldRecurseToNavigator = this.state.makingNavigatorRequest || this.state.updatingAllIndicesAtOrBeyond !== null; + + var items = shouldRecurseToNavigator ? this.state.routeStack.map(this._routeToStackItem) : null; + return React.createElement( + StaticContainer, + { shouldUpdate: shouldRecurseToNavigator, __source: { + fileName: _jsxFileName, + lineNumber: 883 + } + }, + React.createElement( + NavigatorTransitionerIOS, + { + ref: TRANSITIONER_REF, + style: styles.transitioner, + vertical: this.props.vertical, + requestedTopOfStack: this.state.requestedTopOfStack, + onNavigationComplete: this._handleNavigationComplete, + interactivePopGestureEnabled: this.props.interactivePopGestureEnabled, __source: { + fileName: _jsxFileName, + lineNumber: 884 + } + }, + items + ) + ); + }, + + _tvEventHandler: undefined, + + _enableTVEventHandler: function _enableTVEventHandler() { + this._tvEventHandler = new TVEventHandler(); + this._tvEventHandler.enable(this, function (cmp, evt) { + if (evt && evt.eventType === 'menu') { + cmp.pop(); + } + }); + }, + + _disableTVEventHandler: function _disableTVEventHandler() { + if (this._tvEventHandler) { + this._tvEventHandler.disable(); + delete this._tvEventHandler; + } + }, + + render: function render() { + return React.createElement( + View, + { style: this.props.style, __source: { + fileName: _jsxFileName, + lineNumber: 917 + } + }, + this._renderNavigationStackItems() + ); + } +}); + +var styles = StyleSheet.create({ + stackItem: { + backgroundColor: 'white', + overflow: 'hidden', + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0 + }, + transitioner: { + flex: 1 + } +}); + +var RCTNavigator = requireNativeComponent('RCTNavigator'); +var RCTNavigatorItem = requireNativeComponent('RCTNavItem'); + +module.exports = NavigatorIOS; +}, 350, null, "NavigatorIOS"); +__d(/* StaticContainer.react */function(global, require, module, exports) { +'use strict'; + +var React = require(126 ); // 126 = React + +var StaticContainer = function (_React$Component) { + babelHelpers.inherits(StaticContainer, _React$Component); + + function StaticContainer() { + babelHelpers.classCallCheck(this, StaticContainer); + return babelHelpers.possibleConstructorReturn(this, (StaticContainer.__proto__ || Object.getPrototypeOf(StaticContainer)).apply(this, arguments)); + } + + babelHelpers.createClass(StaticContainer, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps) { + return !!nextProps.shouldUpdate; + } + }, { + key: 'render', + value: function render() { + var child = this.props.children; + return child === null || child === false ? null : React.Children.only(child); + } + }]); + return StaticContainer; +}(React.Component); + +module.exports = StaticContainer; +}, 351, null, "StaticContainer.react"); +__d(/* Picker */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Picker/Picker.js', + _class, + _temp; + +var ColorPropType = require(71 ); // 71 = ColorPropType +var PickerIOS = require(353 ); // 353 = PickerIOS +var PickerAndroid = require(354 ); // 354 = PickerAndroid +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType +var TextStylePropTypes = require(139 ); // 139 = TextStylePropTypes +var UnimplementedView = require(156 ); // 156 = UnimplementedView +var View = require(146 ); // 146 = View +var ViewStylePropTypes = require(140 ); // 140 = ViewStylePropTypes + +var itemStylePropType = StyleSheetPropType(TextStylePropTypes); + +var pickerStyleType = StyleSheetPropType(babelHelpers.extends({}, ViewStylePropTypes, { + color: ColorPropType +})); + +var MODE_DIALOG = 'dialog'; +var MODE_DROPDOWN = 'dropdown'; + +var Picker = function (_React$Component) { + babelHelpers.inherits(Picker, _React$Component); + + function Picker() { + babelHelpers.classCallCheck(this, Picker); + return babelHelpers.possibleConstructorReturn(this, (Picker.__proto__ || Object.getPrototypeOf(Picker)).apply(this, arguments)); + } + + babelHelpers.createClass(Picker, [{ + key: 'render', + value: function render() { + if (Platform.OS === 'ios') { + return React.createElement( + PickerIOS, + babelHelpers.extends({}, this.props, { + __source: { + fileName: _jsxFileName, + lineNumber: 119 + } + }), + this.props.children + ); + } else if (Platform.OS === 'android') { + return React.createElement( + PickerAndroid, + babelHelpers.extends({}, this.props, { + __source: { + fileName: _jsxFileName, + lineNumber: 122 + } + }), + this.props.children + ); + } else { + return React.createElement(UnimplementedView, { + __source: { + fileName: _jsxFileName, + lineNumber: 124 + } + }); + } + } + }]); + return Picker; +}(React.Component); + +Picker.MODE_DIALOG = MODE_DIALOG; +Picker.MODE_DROPDOWN = MODE_DROPDOWN; +Picker.defaultProps = { + mode: MODE_DIALOG +}; +Picker.propTypes = babelHelpers.extends({}, View.propTypes, { + style: pickerStyleType, + + selectedValue: React.PropTypes.any, + + onValueChange: React.PropTypes.func, + + enabled: React.PropTypes.bool, + + mode: React.PropTypes.oneOf(['dialog', 'dropdown']), + + itemStyle: itemStylePropType, + + prompt: React.PropTypes.string, + + testID: React.PropTypes.string +}); + +Picker.Item = (_temp = _class = function (_React$Component2) { + babelHelpers.inherits(_class, _React$Component2); + + function _class() { + babelHelpers.classCallCheck(this, _class); + return babelHelpers.possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + babelHelpers.createClass(_class, [{ + key: 'render', + value: function render() { + throw null; + } + }]); + return _class; +}(React.Component), _class.propTypes = { + label: React.PropTypes.string.isRequired, + + value: React.PropTypes.any, + + color: ColorPropType, + + testID: React.PropTypes.string +}, _temp); + +module.exports = Picker; +}, 352, null, "Picker"); +__d(/* PickerIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Picker/PickerIOS.ios.js', + _class, + _temp; + +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var StyleSheetPropType = require(153 ); // 153 = StyleSheetPropType +var TextStylePropTypes = require(139 ); // 139 = TextStylePropTypes +var View = require(146 ); // 146 = View +var processColor = require(121 ); // 121 = processColor + +var itemStylePropType = StyleSheetPropType(TextStylePropTypes); +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PickerIOS = React.createClass({ + displayName: 'PickerIOS', + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + itemStyle: itemStylePropType, + onValueChange: React.PropTypes.func, + selectedValue: React.PropTypes.any }), + + getInitialState: function getInitialState() { + return this._stateFromProps(this.props); + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + this.setState(this._stateFromProps(nextProps)); + }, + + _stateFromProps: function _stateFromProps(props) { + var selectedIndex = 0; + var items = []; + React.Children.toArray(props.children).forEach(function (child, index) { + if (child.props.value === props.selectedValue) { + selectedIndex = index; + } + items.push({ + value: child.props.value, + label: child.props.label, + textColor: processColor(child.props.color) + }); + }); + return { selectedIndex: selectedIndex, items: items }; + }, + + render: function render() { + var _this = this; + + return React.createElement( + View, + { style: this.props.style, __source: { + fileName: _jsxFileName, + lineNumber: 63 + } + }, + React.createElement(RCTPickerIOS, { + ref: function ref(picker) { + return _this._picker = picker; + }, + style: [styles.pickerIOS, this.props.itemStyle], + items: this.state.items, + selectedIndex: this.state.selectedIndex, + onChange: this._onChange, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + __source: { + fileName: _jsxFileName, + lineNumber: 64 + } + }) + ); + }, + + _onChange: function _onChange(event) { + if (this.props.onChange) { + this.props.onChange(event); + } + if (this.props.onValueChange) { + this.props.onValueChange(event.nativeEvent.newValue, event.nativeEvent.newIndex); + } + + if (this._picker && this.state.selectedIndex !== event.nativeEvent.newIndex) { + this._picker.setNativeProps({ + selectedIndex: this.state.selectedIndex + }); + } + } +}); + +PickerIOS.Item = (_temp = _class = function (_React$Component) { + babelHelpers.inherits(_class, _React$Component); + + function _class() { + babelHelpers.classCallCheck(this, _class); + return babelHelpers.possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + babelHelpers.createClass(_class, [{ + key: 'render', + value: function render() { + return null; + } + }]); + return _class; +}(React.Component), _class.propTypes = { + value: React.PropTypes.any, + label: React.PropTypes.string, + color: React.PropTypes.string +}, _temp); + +var styles = StyleSheet.create({ + pickerIOS: { + height: 216 + } +}); + +var RCTPickerIOS = requireNativeComponent('RCTPicker', { + propTypes: { + style: itemStylePropType + } +}, { + nativeOnly: { + items: true, + onChange: true, + selectedIndex: true + } +}); + +module.exports = PickerIOS; +}, 353, null, "PickerIOS"); +__d(/* PickerAndroid */function(global, require, module, exports) { +'use strict'; + +module.exports = require(156 ); // 156 = UnimplementedView +}, 354, null, "PickerAndroid"); +__d(/* ProgressBarAndroid */function(global, require, module, exports) { +'use strict'; + +module.exports = require(156 ); // 156 = UnimplementedView +}, 355, null, "ProgressBarAndroid"); +__d(/* ProgressViewIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js'; +var Image = require(237 ); // 237 = Image +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var ProgressViewIOS = React.createClass({ + displayName: 'ProgressViewIOS', + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + progressViewStyle: PropTypes.oneOf(['default', 'bar']), + + progress: PropTypes.number, + + progressTintColor: PropTypes.string, + + trackTintColor: PropTypes.string, + + progressImage: Image.propTypes.source, + + trackImage: Image.propTypes.source + }), + + render: function render() { + return React.createElement(RCTProgressView, babelHelpers.extends({}, this.props, { + style: [styles.progressView, this.props.style], + __source: { + fileName: _jsxFileName, + lineNumber: 65 + } + })); + } +}); + +var styles = StyleSheet.create({ + progressView: { + height: 2 + } +}); + +var RCTProgressView = requireNativeComponent('RCTProgressView', ProgressViewIOS); + +module.exports = ProgressViewIOS; +}, 356, null, "ProgressViewIOS"); +__d(/* SegmentedControlIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js'; +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var SEGMENTED_CONTROL_REFERENCE = 'segmentedcontrol'; + +var SegmentedControlIOS = React.createClass({ + displayName: 'SegmentedControlIOS', + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + values: PropTypes.arrayOf(PropTypes.string), + + selectedIndex: PropTypes.number, + + onValueChange: PropTypes.func, + + onChange: PropTypes.func, + + enabled: PropTypes.bool, + + tintColor: PropTypes.string, + + momentary: PropTypes.bool + }), + + getDefaultProps: function getDefaultProps() { + return { + values: [], + enabled: true + }; + }, + + _onChange: function _onChange(event) { + this.props.onChange && this.props.onChange(event); + this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value); + }, + + render: function render() { + return React.createElement(RCTSegmentedControl, babelHelpers.extends({}, this.props, { + ref: SEGMENTED_CONTROL_REFERENCE, + style: [styles.segmentedControl, this.props.style], + onChange: this._onChange, + __source: { + fileName: _jsxFileName, + lineNumber: 111 + } + })); + } +}); + +var styles = StyleSheet.create({ + segmentedControl: { + height: 28 + } +}); + +var RCTSegmentedControl = requireNativeComponent('RCTSegmentedControl', SegmentedControlIOS); + +module.exports = SegmentedControlIOS; +}, 357, null, "SegmentedControlIOS"); +__d(/* Slider */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Slider/Slider.js'; +var Image = require(237 ); // 237 = Image +var ColorPropType = require(71 ); // 71 = ColorPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var ReactNativeViewAttributes = require(152 ); // 152 = ReactNativeViewAttributes +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var Slider = React.createClass({ + displayName: 'Slider', + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + style: View.propTypes.style, + + value: PropTypes.number, + + step: PropTypes.number, + + minimumValue: PropTypes.number, + + maximumValue: PropTypes.number, + + minimumTrackTintColor: ColorPropType, + + maximumTrackTintColor: ColorPropType, + + disabled: PropTypes.bool, + + trackImage: Image.propTypes.source, + + minimumTrackImage: Image.propTypes.source, + + maximumTrackImage: Image.propTypes.source, + + thumbImage: Image.propTypes.source, + + thumbTintColor: ColorPropType, + + onValueChange: PropTypes.func, + + onSlidingComplete: PropTypes.func, + + testID: PropTypes.string + }), + + getDefaultProps: function getDefaultProps() { + return { + disabled: false, + value: 0, + minimumValue: 0, + maximumValue: 1, + step: 0 + }; + }, + + viewConfig: { + uiViewClassName: 'RCTSlider', + validAttributes: babelHelpers.extends({}, ReactNativeViewAttributes.RCTView, { + value: true + }) + }, + + render: function render() { + var _props = this.props, + style = _props.style, + onValueChange = _props.onValueChange, + onSlidingComplete = _props.onSlidingComplete, + props = babelHelpers.objectWithoutProperties(_props, ['style', 'onValueChange', 'onSlidingComplete']); + + props.style = [styles.slider, style]; + + props.onValueChange = onValueChange && function (event) { + var userEvent = true; + if (Platform.OS === 'android') { + userEvent = event.nativeEvent.fromUser; + } + onValueChange && userEvent && onValueChange(event.nativeEvent.value); + }; + + props.onChange = props.onValueChange; + + props.onSlidingComplete = onSlidingComplete && function (event) { + onSlidingComplete && onSlidingComplete(event.nativeEvent.value); + }; + + return React.createElement(RCTSlider, babelHelpers.extends({}, props, { + enabled: !this.props.disabled, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + __source: { + fileName: _jsxFileName, + lineNumber: 177 + } + })); + } +}); + +var styles = void 0; +if (Platform.OS === 'ios') { + styles = StyleSheet.create({ + slider: { + height: 40 + } + }); +} else { + styles = StyleSheet.create({ + slider: {} + }); +} + +var options = {}; +if (Platform.OS === 'android') { + options = { + nativeOnly: { + enabled: true + } + }; +} +var RCTSlider = requireNativeComponent('RCTSlider', Slider, options); + +module.exports = Slider; +}, 358, null, "Slider"); +__d(/* SnapshotViewIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/RCTTest/SnapshotViewIOS.ios.js'; +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet + +var _require = require(80 ), // 80 = NativeModules + TestModule = _require.TestModule; + +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var SnapshotViewIOS = function (_React$Component) { + babelHelpers.inherits(SnapshotViewIOS, _React$Component); + + function SnapshotViewIOS() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, SnapshotViewIOS); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = SnapshotViewIOS.__proto__ || Object.getPrototypeOf(SnapshotViewIOS)).call.apply(_ref, [this].concat(args))), _this), _this.onDefaultAction = function (event) { + TestModule.verifySnapshot(TestModule.markTestPassed); + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(SnapshotViewIOS, [{ + key: 'render', + value: function render() { + var testIdentifier = this.props.testIdentifier || 'test'; + var onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction; + return React.createElement(RCTSnapshot, babelHelpers.extends({ + style: style.snapshot + }, this.props, { + onSnapshotReady: onSnapshotReady, + testIdentifier: testIdentifier, + __source: { + fileName: _jsxFileName, + lineNumber: 44 + } + })); + } + }]); + return SnapshotViewIOS; +}(React.Component); + +SnapshotViewIOS.propTypes = babelHelpers.extends({}, View.propTypes, { + onSnapshotReady: React.PropTypes.func, + + testIdentifier: React.PropTypes.string +}); + + +var style = StyleSheet.create({ + snapshot: { + flex: 1 + } +}); + +var RCTSnapshot = UIManager.RCTSnapshot ? requireNativeComponent('RCTSnapshot', SnapshotViewIOS) : View; + +module.exports = SnapshotViewIOS; +}, 359, null, "SnapshotViewIOS"); +__d(/* Switch */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/Switch/Switch.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var Switch = React.createClass({ + displayName: 'Switch', + + propTypes: babelHelpers.extends({}, View.propTypes, { + value: PropTypes.bool, + + disabled: PropTypes.bool, + + onValueChange: PropTypes.func, + + testID: PropTypes.string, + + tintColor: ColorPropType, + + onTintColor: ColorPropType, + + thumbTintColor: ColorPropType + }), + + getDefaultProps: function getDefaultProps() { + return { + value: false, + disabled: false + }; + }, + + mixins: [NativeMethodsMixin], + + _rctSwitch: {}, + _onChange: function _onChange(event) { + if (Platform.OS === 'android') { + this._rctSwitch.setNativeProps({ on: this.props.value }); + } else { + this._rctSwitch.setNativeProps({ value: this.props.value }); + } + + this.props.onChange && this.props.onChange(event); + this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value); + }, + + render: function render() { + var _this = this; + + var props = babelHelpers.extends({}, this.props); + props.onStartShouldSetResponder = function () { + return true; + }; + props.onResponderTerminationRequest = function () { + return false; + }; + if (Platform.OS === 'android') { + props.enabled = !this.props.disabled; + props.on = this.props.value; + props.style = this.props.style; + props.trackTintColor = this.props.value ? this.props.onTintColor : this.props.tintColor; + } else if (Platform.OS === 'ios') { + props.style = [styles.rctSwitchIOS, this.props.style]; + } + return React.createElement(RCTSwitch, babelHelpers.extends({}, props, { + ref: function ref(_ref) { + _this._rctSwitch = _ref; + }, + onChange: this._onChange, + __source: { + fileName: _jsxFileName, + lineNumber: 111 + } + })); + } +}); + +var styles = StyleSheet.create({ + rctSwitchIOS: { + height: 31, + width: 51 + } +}); + +if (Platform.OS === 'android') { + var RCTSwitch = requireNativeComponent('AndroidSwitch', Switch, { + nativeOnly: { + onChange: true, + on: true, + enabled: true, + trackTintColor: true + } + }); +} else { + var RCTSwitch = requireNativeComponent('RCTSwitch', Switch, { + nativeOnly: { + onChange: true + } + }); +} + +module.exports = Switch; +}, 360, null, "Switch"); +__d(/* RefreshControl */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/RefreshControl/RefreshControl.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +if (Platform.OS === 'android') { + var RefreshLayoutConsts = require(123 ).AndroidSwipeRefreshLayout.Constants; // 123 = UIManager +} else { + var RefreshLayoutConsts = { SIZE: {} }; +} + +var RefreshControl = React.createClass({ + displayName: 'RefreshControl', + + statics: { + SIZE: RefreshLayoutConsts.SIZE + }, + + mixins: [NativeMethodsMixin], + + propTypes: babelHelpers.extends({}, View.propTypes, { + onRefresh: React.PropTypes.func, + + refreshing: React.PropTypes.bool.isRequired, + + tintColor: ColorPropType, + + titleColor: ColorPropType, + + title: React.PropTypes.string, + + enabled: React.PropTypes.bool, + + colors: React.PropTypes.arrayOf(ColorPropType), + + progressBackgroundColor: ColorPropType, + + size: React.PropTypes.oneOf([RefreshLayoutConsts.SIZE.DEFAULT, RefreshLayoutConsts.SIZE.LARGE]), + + progressViewOffset: React.PropTypes.number + }), + + _nativeRef: null, + _lastNativeRefreshing: false, + + componentDidMount: function componentDidMount() { + this._lastNativeRefreshing = this.props.refreshing; + }, + componentDidUpdate: function componentDidUpdate(prevProps) { + if (this.props.refreshing !== prevProps.refreshing) { + this._lastNativeRefreshing = this.props.refreshing; + } else if (this.props.refreshing !== this._lastNativeRefreshing) { + this._nativeRef.setNativeProps({ refreshing: this.props.refreshing }); + this._lastNativeRefreshing = this.props.refreshing; + } + }, + render: function render() { + var _this = this; + + return React.createElement(NativeRefreshControl, babelHelpers.extends({}, this.props, { + ref: function ref(_ref) { + _this._nativeRef = _ref; + }, + onRefresh: this._onRefresh, + __source: { + fileName: _jsxFileName, + lineNumber: 153 + } + })); + }, + _onRefresh: function _onRefresh() { + this._lastNativeRefreshing = true; + + this.props.onRefresh && this.props.onRefresh(); + + this.forceUpdate(); + } +}); + +if (Platform.OS === 'ios') { + var NativeRefreshControl = requireNativeComponent('RCTRefreshControl', RefreshControl); +} else if (Platform.OS === 'android') { + var NativeRefreshControl = requireNativeComponent('AndroidSwipeRefreshLayout', RefreshControl); +} + +module.exports = RefreshControl; +}, 361, null, "RefreshControl"); +__d(/* StatusBar */function(global, require, module, exports) { +'use strict'; + +var React = require(126 ); // 126 = React +var ColorPropType = require(71 ); // 71 = ColorPropType +var Platform = require(79 ); // 79 = Platform + +var processColor = require(121 ); // 121 = processColor + +var StatusBarManager = require(80 ).StatusBarManager; // 80 = NativeModules + +function mergePropsStack(propsStack, defaultValues) { + return propsStack.reduce(function (prev, cur) { + for (var prop in cur) { + if (cur[prop] != null) { + prev[prop] = cur[prop]; + } + } + return prev; + }, babelHelpers.extends({}, defaultValues)); +} + +function createStackEntry(props) { + return { + backgroundColor: props.backgroundColor != null ? { + value: props.backgroundColor, + animated: props.animated + } : null, + barStyle: props.barStyle != null ? { + value: props.barStyle, + animated: props.animated + } : null, + translucent: props.translucent, + hidden: props.hidden != null ? { + value: props.hidden, + animated: props.animated, + transition: props.showHideTransition + } : null, + networkActivityIndicatorVisible: props.networkActivityIndicatorVisible + }; +} + +var StatusBar = function (_React$Component) { + babelHelpers.inherits(StatusBar, _React$Component); + + function StatusBar() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, StatusBar); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = StatusBar.__proto__ || Object.getPrototypeOf(StatusBar)).call.apply(_ref, [this].concat(args))), _this), _this._stackEntry = null, _this._updatePropsStack = function () { + clearImmediate(StatusBar._updateImmediate); + StatusBar._updateImmediate = setImmediate(function () { + var oldProps = StatusBar._currentValues; + var mergedProps = mergePropsStack(StatusBar._propsStack, StatusBar._defaultProps); + + if (Platform.OS === 'ios') { + if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) { + StatusBarManager.setStyle(mergedProps.barStyle.value, mergedProps.barStyle.animated); + } + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + StatusBarManager.setHidden(mergedProps.hidden.value, mergedProps.hidden.animated ? mergedProps.hidden.transition : 'none'); + } + + if (!oldProps || oldProps.networkActivityIndicatorVisible !== mergedProps.networkActivityIndicatorVisible) { + StatusBarManager.setNetworkActivityIndicatorVisible(mergedProps.networkActivityIndicatorVisible); + } + } else if (Platform.OS === 'android') { + if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) { + StatusBarManager.setStyle(mergedProps.barStyle.value); + } + if (!oldProps || oldProps.backgroundColor.value !== mergedProps.backgroundColor.value) { + StatusBarManager.setColor(processColor(mergedProps.backgroundColor.value), mergedProps.backgroundColor.animated); + } + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + StatusBarManager.setHidden(mergedProps.hidden.value); + } + if (!oldProps || oldProps.translucent !== mergedProps.translucent) { + StatusBarManager.setTranslucent(mergedProps.translucent); + } + } + + StatusBar._currentValues = mergedProps; + }); + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(StatusBar, [{ + key: 'componentDidMount', + value: function componentDidMount() { + this._stackEntry = createStackEntry(this.props); + StatusBar._propsStack.push(this._stackEntry); + this._updatePropsStack(); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + var index = StatusBar._propsStack.indexOf(this._stackEntry); + StatusBar._propsStack.splice(index, 1); + + this._updatePropsStack(); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var index = StatusBar._propsStack.indexOf(this._stackEntry); + this._stackEntry = createStackEntry(this.props); + StatusBar._propsStack[index] = this._stackEntry; + + this._updatePropsStack(); + } + }, { + key: 'render', + value: function render() { + return null; + } + }], [{ + key: 'setHidden', + value: function setHidden(hidden, animation) { + animation = animation || 'none'; + StatusBar._defaultProps.hidden.value = hidden; + if (Platform.OS === 'ios') { + StatusBarManager.setHidden(hidden, animation); + } else if (Platform.OS === 'android') { + StatusBarManager.setHidden(hidden); + } + } + }, { + key: 'setBarStyle', + value: function setBarStyle(style, animated) { + animated = animated || false; + StatusBar._defaultProps.barStyle.value = style; + if (Platform.OS === 'ios') { + StatusBarManager.setStyle(style, animated); + } else if (Platform.OS === 'android') { + StatusBarManager.setStyle(style); + } + } + }, { + key: 'setNetworkActivityIndicatorVisible', + value: function setNetworkActivityIndicatorVisible(visible) { + if (Platform.OS !== 'ios') { + console.warn('`setNetworkActivityIndicatorVisible` is only available on iOS'); + return; + } + StatusBar._defaultProps.networkActivityIndicatorVisible = visible; + StatusBarManager.setNetworkActivityIndicatorVisible(visible); + } + }, { + key: 'setBackgroundColor', + value: function setBackgroundColor(color, animated) { + if (Platform.OS !== 'android') { + console.warn('`setBackgroundColor` is only available on Android'); + return; + } + animated = animated || false; + StatusBar._defaultProps.backgroundColor.value = color; + StatusBarManager.setColor(processColor(color), animated); + } + }, { + key: 'setTranslucent', + value: function setTranslucent(translucent) { + if (Platform.OS !== 'android') { + console.warn('`setTranslucent` is only available on Android'); + return; + } + StatusBar._defaultProps.translucent = translucent; + StatusBarManager.setTranslucent(translucent); + } + }]); + return StatusBar; +}(React.Component); + +StatusBar._propsStack = []; +StatusBar._defaultProps = createStackEntry({ + animated: false, + showHideTransition: 'fade', + backgroundColor: 'black', + barStyle: 'default', + translucent: false, + hidden: false, + networkActivityIndicatorVisible: false +}); +StatusBar._updateImmediate = null; +StatusBar._currentValues = null; +StatusBar.currentHeight = StatusBarManager.HEIGHT; +StatusBar.propTypes = { + hidden: React.PropTypes.bool, + + animated: React.PropTypes.bool, + + backgroundColor: ColorPropType, + + translucent: React.PropTypes.bool, + + barStyle: React.PropTypes.oneOf(['default', 'light-content', 'dark-content']), + + networkActivityIndicatorVisible: React.PropTypes.bool, + + showHideTransition: React.PropTypes.oneOf(['fade', 'slide']) +}; +StatusBar.defaultProps = { + animated: false, + showHideTransition: 'fade' +}; + + +module.exports = StatusBar; +}, 362, null, "StatusBar"); +__d(/* SwipeableListView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Experimental/SwipeableRow/SwipeableListView.js'; +var ListView = require(303 ); // 303 = ListView +var React = require(126 ); // 126 = React +var SwipeableListViewDataSource = require(364 ); // 364 = SwipeableListViewDataSource +var SwipeableRow = require(365 ); // 365 = SwipeableRow + +var PropTypes = React.PropTypes; + +var SwipeableListView = function (_React$Component) { + babelHelpers.inherits(SwipeableListView, _React$Component); + babelHelpers.createClass(SwipeableListView, null, [{ + key: 'getNewDataSource', + value: function getNewDataSource() { + return new SwipeableListViewDataSource({ + getRowData: function getRowData(data, sectionID, rowID) { + return data[sectionID][rowID]; + }, + getSectionHeaderData: function getSectionHeaderData(data, sectionID) { + return data[sectionID]; + }, + rowHasChanged: function rowHasChanged(row1, row2) { + return row1 !== row2; + }, + sectionHeaderHasChanged: function sectionHeaderHasChanged(s1, s2) { + return s1 !== s2; + } + }); + } + }]); + + function SwipeableListView(props, context) { + babelHelpers.classCallCheck(this, SwipeableListView); + + var _this = babelHelpers.possibleConstructorReturn(this, (SwipeableListView.__proto__ || Object.getPrototypeOf(SwipeableListView)).call(this, props, context)); + + _this._listViewRef = null; + _this._shouldBounceFirstRowOnMount = false; + + _this._onScroll = function (e) { + if (_this.props.dataSource.getOpenRowID()) { + _this.setState({ + dataSource: _this.state.dataSource.setOpenRowID(null) + }); + } + _this.props.onScroll && _this.props.onScroll(e); + }; + + _this._getMaxSwipeDistance = function (rowData, sectionID, rowID) { + if (typeof _this.props.maxSwipeDistance === 'function') { + return _this.props.maxSwipeDistance(rowData, sectionID, rowID); + } + + return _this.props.maxSwipeDistance; + }; + + _this._renderRow = function (rowData, sectionID, rowID) { + var slideoutView = _this.props.renderQuickActions(rowData, sectionID, rowID); + + if (!slideoutView) { + return _this.props.renderRow(rowData, sectionID, rowID); + } + + var shouldBounceOnMount = false; + if (_this._shouldBounceFirstRowOnMount) { + _this._shouldBounceFirstRowOnMount = false; + shouldBounceOnMount = rowID === _this.props.dataSource.getFirstRowID(); + } + + return React.createElement( + SwipeableRow, + { + slideoutView: slideoutView, + isOpen: rowData.id === _this.props.dataSource.getOpenRowID(), + maxSwipeDistance: _this._getMaxSwipeDistance(rowData, sectionID, rowID), + key: rowID, + onOpen: function onOpen() { + return _this._onOpen(rowData.id); + }, + onClose: function onClose() { + return _this._onClose(rowData.id); + }, + onSwipeEnd: function onSwipeEnd() { + return _this._setListViewScrollable(true); + }, + onSwipeStart: function onSwipeStart() { + return _this._setListViewScrollable(false); + }, + shouldBounceOnMount: shouldBounceOnMount, __source: { + fileName: _jsxFileName, + lineNumber: 193 + } + }, + _this.props.renderRow(rowData, sectionID, rowID) + ); + }; + + _this._shouldBounceFirstRowOnMount = _this.props.bounceFirstRowOnMount; + _this.state = { + dataSource: _this.props.dataSource + }; + return _this; + } + + babelHelpers.createClass(SwipeableListView, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (this.state.dataSource.getDataSource() !== nextProps.dataSource.getDataSource()) { + this.setState({ + dataSource: nextProps.dataSource + }); + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + return React.createElement(ListView, babelHelpers.extends({}, this.props, { + ref: function ref(_ref) { + _this2._listViewRef = _ref; + }, + dataSource: this.state.dataSource.getDataSource(), + onScroll: this._onScroll, + renderRow: this._renderRow, + __source: { + fileName: _jsxFileName, + lineNumber: 126 + } + })); + } + }, { + key: '_setListViewScrollable', + value: function _setListViewScrollable(value) { + if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') { + this._listViewRef.setNativeProps({ + scrollEnabled: value + }); + } + } + }, { + key: 'getScrollResponder', + value: function getScrollResponder() { + if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') { + return this._listViewRef.getScrollResponder(); + } + } + }, { + key: '_onOpen', + value: function _onOpen(rowID) { + this.setState({ + dataSource: this.state.dataSource.setOpenRowID(rowID) + }); + } + }, { + key: '_onClose', + value: function _onClose(rowID) { + this.setState({ + dataSource: this.state.dataSource.setOpenRowID(null) + }); + } + }]); + return SwipeableListView; +}(React.Component); + +SwipeableListView.propTypes = { + bounceFirstRowOnMount: PropTypes.bool.isRequired, + + dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired, + + maxSwipeDistance: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).isRequired, + + renderRow: PropTypes.func.isRequired, + + renderQuickActions: PropTypes.func.isRequired +}; +SwipeableListView.defaultProps = { + bounceFirstRowOnMount: false, + renderQuickActions: function renderQuickActions() { + return null; + } +}; + + +module.exports = SwipeableListView; +}, 363, null, "SwipeableListView"); +__d(/* SwipeableListViewDataSource */function(global, require, module, exports) { +'use strict'; + +var ListViewDataSource = require(304 ); // 304 = ListViewDataSource + +var SwipeableListViewDataSource = function () { + function SwipeableListViewDataSource(params) { + var _this = this; + + babelHelpers.classCallCheck(this, SwipeableListViewDataSource); + + this._dataSource = new ListViewDataSource({ + getRowData: params.getRowData, + getSectionHeaderData: params.getSectionHeaderData, + rowHasChanged: function rowHasChanged(row1, row2) { + return row1.id !== _this._previousOpenRowID && row2.id === _this._openRowID || row1.id === _this._previousOpenRowID && row2.id !== _this._openRowID || params.rowHasChanged(row1, row2); + }, + sectionHeaderHasChanged: params.sectionHeaderHasChanged + }); + } + + babelHelpers.createClass(SwipeableListViewDataSource, [{ + key: 'cloneWithRowsAndSections', + value: function cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) { + this._dataSource = this._dataSource.cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities); + + this._dataBlob = dataBlob; + this.rowIdentities = this._dataSource.rowIdentities; + this.sectionIdentities = this._dataSource.sectionIdentities; + + return this; + } + }, { + key: 'getDataSource', + value: function getDataSource() { + return this._dataSource; + } + }, { + key: 'getOpenRowID', + value: function getOpenRowID() { + return this._openRowID; + } + }, { + key: 'getFirstRowID', + value: function getFirstRowID() { + if (this.rowIdentities) { + return this.rowIdentities[0] && this.rowIdentities[0][0]; + } + return Object.keys(this._dataBlob)[0]; + } + }, { + key: 'setOpenRowID', + value: function setOpenRowID(rowID) { + this._previousOpenRowID = this._openRowID; + this._openRowID = rowID; + + this._dataSource = this._dataSource.cloneWithRowsAndSections(this._dataBlob, this.sectionIdentities, this.rowIdentities); + + return this; + } + }]); + return SwipeableListViewDataSource; +}(); + +module.exports = SwipeableListViewDataSource; +}, 364, null, "SwipeableListViewDataSource"); +__d(/* SwipeableRow */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Experimental/SwipeableRow/SwipeableRow.js'; +var Animated = require(219 ); // 219 = Animated +var PanResponder = require(346 ); // 346 = PanResponder +var I18nManager = require(331 ); // 331 = I18nManager +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var View = require(146 ); // 146 = View + +var PropTypes = React.PropTypes; + + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction + +var IS_RTL = I18nManager.isRTL; + +var CLOSED_LEFT_POSITION = 0; + +var HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 10; + +var HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD = 0.3; + +var SLOW_SPEED_SWIPE_FACTOR = 4; + +var SWIPE_DURATION = 300; + +var ON_MOUNT_BOUNCE_DELAY = 700; +var ON_MOUNT_BOUNCE_DURATION = 400; + +var RIGHT_SWIPE_BOUNCE_BACK_DISTANCE = 30; +var RIGHT_SWIPE_BOUNCE_BACK_DURATION = 300; + +var RIGHT_SWIPE_THRESHOLD = 30 * SLOW_SPEED_SWIPE_FACTOR; + +var SwipeableRow = React.createClass({ + displayName: 'SwipeableRow', + + _panResponder: {}, + _previousLeft: CLOSED_LEFT_POSITION, + + mixins: [TimerMixin], + + propTypes: { + children: PropTypes.any, + isOpen: PropTypes.bool, + maxSwipeDistance: PropTypes.number.isRequired, + onOpen: PropTypes.func.isRequired, + onClose: PropTypes.func.isRequired, + onSwipeEnd: PropTypes.func.isRequired, + onSwipeStart: PropTypes.func.isRequired, + + shouldBounceOnMount: PropTypes.bool, + + slideoutView: PropTypes.node.isRequired, + + swipeThreshold: PropTypes.number.isRequired + }, + + getInitialState: function getInitialState() { + return { + currentLeft: new Animated.Value(this._previousLeft), + + isSwipeableViewRendered: false, + rowHeight: null + }; + }, + getDefaultProps: function getDefaultProps() { + return { + isOpen: false, + maxSwipeDistance: 0, + onOpen: emptyFunction, + onClose: emptyFunction, + onSwipeEnd: emptyFunction, + onSwipeStart: emptyFunction, + swipeThreshold: 30 + }; + }, + componentWillMount: function componentWillMount() { + this._panResponder = PanResponder.create({ + onMoveShouldSetPanResponderCapture: this._handleMoveShouldSetPanResponderCapture, + onPanResponderGrant: this._handlePanResponderGrant, + onPanResponderMove: this._handlePanResponderMove, + onPanResponderRelease: this._handlePanResponderEnd, + onPanResponderTerminationRequest: this._onPanResponderTerminationRequest, + onPanResponderTerminate: this._handlePanResponderEnd, + onShouldBlockNativeResponder: function onShouldBlockNativeResponder(event, gestureState) { + return false; + } + }); + }, + componentDidMount: function componentDidMount() { + var _this = this; + + if (this.props.shouldBounceOnMount) { + this.setTimeout(function () { + _this._animateBounceBack(ON_MOUNT_BOUNCE_DURATION); + }, ON_MOUNT_BOUNCE_DELAY); + } + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + if (this.props.isOpen && !nextProps.isOpen) { + this._animateToClosedPosition(); + } + }, + shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { + if (this.props.shouldBounceOnMount && !nextProps.shouldBounceOnMount) { + return false; + } + + return true; + }, + render: function render() { + var slideOutView = void 0; + if (this.state.isSwipeableViewRendered) { + slideOutView = React.createElement( + View, + { style: [styles.slideOutContainer, { height: this.state.rowHeight }], __source: { + fileName: _jsxFileName, + lineNumber: 179 + } + }, + this.props.slideoutView + ); + } + + var swipeableView = React.createElement( + Animated.View, + { + onLayout: this._onSwipeableViewLayout, + style: [styles.swipeableContainer, { + transform: [{ translateX: this.state.currentLeft }] + }], __source: { + fileName: _jsxFileName, + lineNumber: 190 + } + }, + this.props.children + ); + + return React.createElement( + View, + babelHelpers.extends({}, this._panResponder.panHandlers, { + __source: { + fileName: _jsxFileName, + lineNumber: 203 + } + }), + slideOutView, + swipeableView + ); + }, + _onSwipeableViewLayout: function _onSwipeableViewLayout(event) { + this.setState({ + isSwipeableViewRendered: true, + rowHeight: event.nativeEvent.layout.height + }); + }, + _handleMoveShouldSetPanResponderCapture: function _handleMoveShouldSetPanResponderCapture(event, gestureState) { + return gestureState.dy < 10 && this._isValidSwipe(gestureState); + }, + _handlePanResponderGrant: function _handlePanResponderGrant(event, gestureState) {}, + _handlePanResponderMove: function _handlePanResponderMove(event, gestureState) { + if (this._isSwipingExcessivelyRightFromClosedPosition(gestureState)) { + return; + } + + this.props.onSwipeStart(); + + if (this._isSwipingRightFromClosed(gestureState)) { + this._swipeSlowSpeed(gestureState); + } else { + this._swipeFullSpeed(gestureState); + } + }, + _isSwipingRightFromClosed: function _isSwipingRightFromClosed(gestureState) { + var gestureStateDx = IS_RTL ? -gestureState.dx : gestureState.dx; + return this._previousLeft === CLOSED_LEFT_POSITION && gestureStateDx > 0; + }, + _swipeFullSpeed: function _swipeFullSpeed(gestureState) { + this.state.currentLeft.setValue(this._previousLeft + gestureState.dx); + }, + _swipeSlowSpeed: function _swipeSlowSpeed(gestureState) { + this.state.currentLeft.setValue(this._previousLeft + gestureState.dx / SLOW_SPEED_SWIPE_FACTOR); + }, + _isSwipingExcessivelyRightFromClosedPosition: function _isSwipingExcessivelyRightFromClosedPosition(gestureState) { + var gestureStateDx = IS_RTL ? -gestureState.dx : gestureState.dx; + return this._isSwipingRightFromClosed(gestureState) && gestureStateDx > RIGHT_SWIPE_THRESHOLD; + }, + _onPanResponderTerminationRequest: function _onPanResponderTerminationRequest(event, gestureState) { + return false; + }, + _animateTo: function _animateTo(toValue) { + var _this2 = this; + + var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SWIPE_DURATION; + var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : emptyFunction; + + Animated.timing(this.state.currentLeft, { + duration: duration, + toValue: toValue + }).start(function () { + _this2._previousLeft = toValue; + callback(); + }); + }, + _animateToOpenPosition: function _animateToOpenPosition() { + var maxSwipeDistance = IS_RTL ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance; + this._animateTo(-maxSwipeDistance); + }, + _animateToOpenPositionWith: function _animateToOpenPositionWith(speed, distMoved) { + speed = speed > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD ? speed : HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD; + + var duration = Math.abs((this.props.maxSwipeDistance - Math.abs(distMoved)) / speed); + var maxSwipeDistance = IS_RTL ? -this.props.maxSwipeDistance : this.props.maxSwipeDistance; + this._animateTo(-maxSwipeDistance, duration); + }, + _animateToClosedPosition: function _animateToClosedPosition() { + var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SWIPE_DURATION; + + this._animateTo(CLOSED_LEFT_POSITION, duration); + }, + _animateToClosedPositionDuringBounce: function _animateToClosedPositionDuringBounce() { + this._animateToClosedPosition(RIGHT_SWIPE_BOUNCE_BACK_DURATION); + }, + _animateBounceBack: function _animateBounceBack(duration) { + var swipeBounceBackDistance = IS_RTL ? -RIGHT_SWIPE_BOUNCE_BACK_DISTANCE : RIGHT_SWIPE_BOUNCE_BACK_DISTANCE; + this._animateTo(-swipeBounceBackDistance, duration, this._animateToClosedPositionDuringBounce); + }, + _isValidSwipe: function _isValidSwipe(gestureState) { + return Math.abs(gestureState.dx) > HORIZONTAL_SWIPE_DISTANCE_THRESHOLD; + }, + _shouldAnimateRemainder: function _shouldAnimateRemainder(gestureState) { + return Math.abs(gestureState.dx) > this.props.swipeThreshold || gestureState.vx > HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD; + }, + _handlePanResponderEnd: function _handlePanResponderEnd(event, gestureState) { + var horizontalDistance = IS_RTL ? -gestureState.dx : gestureState.dx; + if (this._isSwipingRightFromClosed(gestureState)) { + this.props.onOpen(); + this._animateBounceBack(RIGHT_SWIPE_BOUNCE_BACK_DURATION); + } else if (this._shouldAnimateRemainder(gestureState)) { + if (horizontalDistance < 0) { + this.props.onOpen(); + this._animateToOpenPositionWith(gestureState.vx, horizontalDistance); + } else { + this.props.onClose(); + this._animateToClosedPosition(); + } + } else { + if (this._previousLeft === CLOSED_LEFT_POSITION) { + this._animateToClosedPosition(); + } else { + this._animateToOpenPosition(); + } + } + + this.props.onSwipeEnd(); + } +}); + +var styles = StyleSheet.create({ + slideOutContainer: { + bottom: 0, + left: 0, + position: 'absolute', + right: 0, + top: 0 + }, + swipeableContainer: { + flex: 1 + } +}); + +module.exports = SwipeableRow; +}, 365, null, "SwipeableRow"); +__d(/* TabBarIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/TabBarIOS/TabBarIOS.ios.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var TabBarItemIOS = require(367 ); // 367 = TabBarItemIOS +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var TabBarIOS = function (_React$Component) { + babelHelpers.inherits(TabBarIOS, _React$Component); + + function TabBarIOS() { + babelHelpers.classCallCheck(this, TabBarIOS); + return babelHelpers.possibleConstructorReturn(this, (TabBarIOS.__proto__ || Object.getPrototypeOf(TabBarIOS)).apply(this, arguments)); + } + + babelHelpers.createClass(TabBarIOS, [{ + key: 'render', + value: function render() { + return React.createElement( + RCTTabBar, + { + style: [styles.tabGroup, this.props.style], + unselectedTintColor: this.props.unselectedTintColor, + unselectedItemTintColor: this.props.unselectedItemTintColor, + tintColor: this.props.tintColor, + barTintColor: this.props.barTintColor, + itemPositioning: this.props.itemPositioning, + translucent: this.props.translucent !== false, __source: { + fileName: _jsxFileName, + lineNumber: 72 + } + }, + this.props.children + ); + } + }]); + return TabBarIOS; +}(React.Component); + +TabBarIOS.Item = TabBarItemIOS; +TabBarIOS.propTypes = babelHelpers.extends({}, View.propTypes, { + style: View.propTypes.style, + + unselectedTintColor: ColorPropType, + + tintColor: ColorPropType, + + unselectedItemTintColor: ColorPropType, + + barTintColor: ColorPropType, + + translucent: React.PropTypes.bool, + + itemPositioning: React.PropTypes.oneOf(['fill', 'center', 'auto']) +}); + + +var styles = StyleSheet.create({ + tabGroup: { + flex: 1 + } +}); + +var RCTTabBar = requireNativeComponent('RCTTabBar', TabBarIOS); + +module.exports = TabBarIOS; +}, 366, null, "TabBarIOS"); +__d(/* TabBarItemIOS */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var Image = require(237 ); // 237 = Image +var React = require(126 ); // 126 = React +var StaticContainer = require(351 ); // 351 = StaticContainer.react +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var TabBarItemIOS = function (_React$Component) { + babelHelpers.inherits(TabBarItemIOS, _React$Component); + + function TabBarItemIOS() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, TabBarItemIOS); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = TabBarItemIOS.__proto__ || Object.getPrototypeOf(TabBarItemIOS)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + hasBeenSelected: false + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(TabBarItemIOS, [{ + key: 'componentWillMount', + value: function componentWillMount() { + if (this.props.selected) { + this.setState({ hasBeenSelected: true }); + } + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (this.state.hasBeenSelected || nextProps.selected) { + this.setState({ hasBeenSelected: true }); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + style = _props.style, + children = _props.children, + props = babelHelpers.objectWithoutProperties(_props, ['style', 'children']); + + if (this.state.hasBeenSelected) { + var tabContents = React.createElement( + StaticContainer, + { shouldUpdate: this.props.selected, __source: { + fileName: _jsxFileName, + lineNumber: 121 + } + }, + children + ); + } else { + var tabContents = React.createElement(View, { + __source: { + fileName: _jsxFileName, + lineNumber: 125 + } + }); + } + + return React.createElement( + RCTTabBarItem, + babelHelpers.extends({}, props, { + style: [styles.tab, style], __source: { + fileName: _jsxFileName, + lineNumber: 129 + } + }), + tabContents + ); + } + }]); + return TabBarItemIOS; +}(React.Component); + +TabBarItemIOS.propTypes = babelHelpers.extends({}, View.propTypes, { + badge: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), + + badgeColor: ColorPropType, + + systemIcon: React.PropTypes.oneOf(['bookmarks', 'contacts', 'downloads', 'favorites', 'featured', 'history', 'more', 'most-recent', 'most-viewed', 'recents', 'search', 'top-rated']), + + icon: Image.propTypes.source, + + selectedIcon: Image.propTypes.source, + + onPress: React.PropTypes.func, + + renderAsOriginal: React.PropTypes.bool, + + selected: React.PropTypes.bool, + + style: View.propTypes.style, + + title: React.PropTypes.string, + + isTVSelectable: React.PropTypes.bool +}); + + +var styles = StyleSheet.create({ + tab: { + position: 'absolute', + top: 0, + right: 0, + bottom: 0, + left: 0 + } +}); + +var RCTTabBarItem = requireNativeComponent('RCTTabBarItem', TabBarItemIOS); + +module.exports = TabBarItemIOS; +}, 367, null, "TabBarItemIOS"); +__d(/* TextInput */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/TextInput/TextInput.js'; +var ColorPropType = require(71 ); // 71 = ColorPropType +var DocumentSelectionState = require(369 ); // 369 = DocumentSelectionState +var EventEmitter = require(103 ); // 103 = EventEmitter +var NativeMethodsMixin = require(73 ); // 73 = NativeMethodsMixin +var Platform = require(79 ); // 79 = Platform +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var TextInputState = require(78 ); // 78 = TextInputState +var TimerMixin = require(294 ); // 294 = react-timer-mixin +var TouchableWithoutFeedback = require(295 ); // 295 = TouchableWithoutFeedback +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View +var warning = require(40 ); // 40 = fbjs/lib/warning + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent + +var PropTypes = React.PropTypes; + +var onlyMultiline = { + onTextInput: true, + children: true +}; + +if (Platform.OS === 'android') { + var AndroidTextInput = requireNativeComponent('AndroidTextInput', null); +} else if (Platform.OS === 'ios') { + var RCTTextView = requireNativeComponent('RCTTextView', null); + var RCTTextField = requireNativeComponent('RCTTextField', null); +} + +var DataDetectorTypes = ['phoneNumber', 'link', 'address', 'calendarEvent', 'none', 'all']; + +var TextInput = React.createClass({ + displayName: 'TextInput', + + statics: { + State: TextInputState + }, + + propTypes: babelHelpers.extends({}, View.propTypes, { + autoCapitalize: PropTypes.oneOf(['none', 'sentences', 'words', 'characters']), + + autoCorrect: PropTypes.bool, + + spellCheck: PropTypes.bool, + + autoFocus: PropTypes.bool, + + editable: PropTypes.bool, + + keyboardType: PropTypes.oneOf(['default', 'email-address', 'numeric', 'phone-pad', 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search']), + + keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']), + + returnKeyType: PropTypes.oneOf(['done', 'go', 'next', 'search', 'send', 'none', 'previous', 'default', 'emergency-call', 'google', 'join', 'route', 'yahoo']), + + returnKeyLabel: PropTypes.string, + + maxLength: PropTypes.number, + + numberOfLines: PropTypes.number, + + disableFullscreenUI: PropTypes.bool, + + enablesReturnKeyAutomatically: PropTypes.bool, + + multiline: PropTypes.bool, + + textBreakStrategy: React.PropTypes.oneOf(['simple', 'highQuality', 'balanced']), + + onBlur: PropTypes.func, + + onFocus: PropTypes.func, + + onChange: PropTypes.func, + + onChangeText: PropTypes.func, + + onContentSizeChange: PropTypes.func, + + onEndEditing: PropTypes.func, + + onSelectionChange: PropTypes.func, + + onSubmitEditing: PropTypes.func, + + onKeyPress: PropTypes.func, + + onLayout: PropTypes.func, + + onScroll: PropTypes.func, + + placeholder: PropTypes.node, + + placeholderTextColor: ColorPropType, + + secureTextEntry: PropTypes.bool, + + selectionColor: ColorPropType, + + selectionState: PropTypes.instanceOf(DocumentSelectionState), + + selection: PropTypes.shape({ + start: PropTypes.number.isRequired, + end: PropTypes.number + }), + + value: PropTypes.string, + + defaultValue: PropTypes.node, + + clearButtonMode: PropTypes.oneOf(['never', 'while-editing', 'unless-editing', 'always']), + + clearTextOnFocus: PropTypes.bool, + + selectTextOnFocus: PropTypes.bool, + + blurOnSubmit: PropTypes.bool, + + style: Text.propTypes.style, + + underlineColorAndroid: ColorPropType, + + inlineImageLeft: PropTypes.string, + + inlineImagePadding: PropTypes.number, + + dataDetectorTypes: PropTypes.oneOfType([PropTypes.oneOf(DataDetectorTypes), PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes))]) + }), + + mixins: [NativeMethodsMixin, TimerMixin], + + viewConfig: Platform.OS === 'ios' && RCTTextField ? RCTTextField.viewConfig : Platform.OS === 'android' && AndroidTextInput ? AndroidTextInput.viewConfig : {}, + + isFocused: function isFocused() { + return TextInputState.currentlyFocusedField() === ReactNative.findNodeHandle(this._inputRef); + }, + + contextTypes: { + onFocusRequested: React.PropTypes.func, + focusEmitter: React.PropTypes.instanceOf(EventEmitter) + }, + + _inputRef: undefined, + _focusSubscription: undefined, + _lastNativeText: undefined, + _lastNativeSelection: undefined, + + componentDidMount: function componentDidMount() { + var _this = this; + + this._lastNativeText = this.props.value; + if (!this.context.focusEmitter) { + if (this.props.autoFocus) { + this.requestAnimationFrame(this.focus); + } + return; + } + this._focusSubscription = this.context.focusEmitter.addListener('focus', function (el) { + if (_this === el) { + _this.requestAnimationFrame(_this.focus); + } else if (_this.isFocused()) { + _this.blur(); + } + }); + if (this.props.autoFocus) { + this.context.onFocusRequested(this); + } + }, + + componentWillUnmount: function componentWillUnmount() { + this._focusSubscription && this._focusSubscription.remove(); + if (this.isFocused()) { + this.blur(); + } + }, + + getChildContext: function getChildContext() { + return { isInAParentText: true }; + }, + + childContextTypes: { + isInAParentText: React.PropTypes.bool + }, + + clear: function clear() { + this.setNativeProps({ text: '' }); + }, + + render: function render() { + if (Platform.OS === 'ios') { + return this._renderIOS(); + } else if (Platform.OS === 'android') { + return this._renderAndroid(); + } + }, + + _getText: function _getText() { + return typeof this.props.value === 'string' ? this.props.value : typeof this.props.defaultValue === 'string' ? this.props.defaultValue : ''; + }, + + _setNativeRef: function _setNativeRef(ref) { + this._inputRef = ref; + }, + + _renderIOS: function _renderIOS() { + var textContainer; + + var props = babelHelpers.extends({}, this.props); + props.style = [styles.input, this.props.style]; + + if (props.selection && props.selection.end == null) { + props.selection = { start: props.selection.start, end: props.selection.start }; + } + + if (!props.multiline) { + if (__DEV__) { + for (var propKey in onlyMultiline) { + if (props[propKey]) { + var error = new Error('TextInput prop `' + propKey + '` is only supported with multiline.'); + warning(false, '%s', error.stack); + } + } + } + textContainer = React.createElement(RCTTextField, babelHelpers.extends({ + ref: this._setNativeRef + }, props, { + onFocus: this._onFocus, + onBlur: this._onBlur, + onChange: this._onChange, + onSelectionChange: this._onSelectionChange, + onSelectionChangeShouldSetResponder: emptyFunction.thatReturnsTrue, + text: this._getText(), + __source: { + fileName: _jsxFileName, + lineNumber: 652 + } + })); + } else { + var children = props.children; + var childCount = 0; + React.Children.forEach(children, function () { + return ++childCount; + }); + invariant(!(props.value && childCount), 'Cannot specify both value and children.'); + if (childCount >= 1) { + children = React.createElement( + Text, + { style: props.style, __source: { + fileName: _jsxFileName, + lineNumber: 671 + } + }, + children + ); + } + if (props.inputView) { + children = [children, props.inputView]; + } + textContainer = React.createElement(RCTTextView, babelHelpers.extends({ + ref: this._setNativeRef + }, props, { + children: children, + onFocus: this._onFocus, + onBlur: this._onBlur, + onChange: this._onChange, + onContentSizeChange: this.props.onContentSizeChange, + onSelectionChange: this._onSelectionChange, + onTextInput: this._onTextInput, + onSelectionChangeShouldSetResponder: emptyFunction.thatReturnsTrue, + text: this._getText(), + dataDetectorTypes: this.props.dataDetectorTypes, + onScroll: this._onScroll, + __source: { + fileName: _jsxFileName, + lineNumber: 677 + } + })); + } + + return React.createElement( + TouchableWithoutFeedback, + { + onLayout: props.onLayout, + onPress: this._onPress, + rejectResponderTermination: true, + accessible: props.accessible, + accessibilityLabel: props.accessibilityLabel, + accessibilityTraits: props.accessibilityTraits, + testID: props.testID, __source: { + fileName: _jsxFileName, + lineNumber: 695 + } + }, + textContainer + ); + }, + + _renderAndroid: function _renderAndroid() { + var props = babelHelpers.extends({}, this.props); + props.style = [this.props.style]; + props.autoCapitalize = UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize]; + var children = this.props.children; + var childCount = 0; + React.Children.forEach(children, function () { + return ++childCount; + }); + invariant(!(this.props.value && childCount), 'Cannot specify both value and children.'); + if (childCount > 1) { + children = React.createElement( + Text, + { + __source: { + fileName: _jsxFileName, + lineNumber: 721 + } + }, + children + ); + } + + if (props.selection && props.selection.end == null) { + props.selection = { start: props.selection.start, end: props.selection.start }; + } + + var textContainer = React.createElement(AndroidTextInput, babelHelpers.extends({ + ref: this._setNativeRef + }, props, { + mostRecentEventCount: 0, + onFocus: this._onFocus, + onBlur: this._onBlur, + onChange: this._onChange, + onSelectionChange: this._onSelectionChange, + onTextInput: this._onTextInput, + text: this._getText(), + children: children, + disableFullscreenUI: this.props.disableFullscreenUI, + textBreakStrategy: this.props.textBreakStrategy, + __source: { + fileName: _jsxFileName, + lineNumber: 729 + } + })); + + return React.createElement( + TouchableWithoutFeedback, + { + onLayout: this.props.onLayout, + onPress: this._onPress, + accessible: this.props.accessible, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityComponentType: this.props.accessibilityComponentType, + testID: this.props.testID, __source: { + fileName: _jsxFileName, + lineNumber: 745 + } + }, + textContainer + ); + }, + + _onFocus: function _onFocus(event) { + if (this.props.onFocus) { + this.props.onFocus(event); + } + + if (this.props.selectionState) { + this.props.selectionState.focus(); + } + }, + + _onPress: function _onPress(event) { + if (this.props.editable || this.props.editable === undefined) { + this.focus(); + } + }, + + _onChange: function _onChange(event) { + if (this._inputRef) { + this._inputRef.setNativeProps({ + mostRecentEventCount: event.nativeEvent.eventCount + }); + } + + var text = event.nativeEvent.text; + this.props.onChange && this.props.onChange(event); + this.props.onChangeText && this.props.onChangeText(text); + + if (!this._inputRef) { + return; + } + + this._lastNativeText = text; + this.forceUpdate(); + }, + + _onSelectionChange: function _onSelectionChange(event) { + this.props.onSelectionChange && this.props.onSelectionChange(event); + + if (!this._inputRef) { + return; + } + + this._lastNativeSelection = event.nativeEvent.selection; + + if (this.props.selection || this.props.selectionState) { + this.forceUpdate(); + } + }, + + componentDidUpdate: function componentDidUpdate() { + var nativeProps = {}; + + if (this._lastNativeText !== this.props.value && typeof this.props.value === 'string') { + nativeProps.text = this.props.value; + } + + var selection = this.props.selection; + + if (this._lastNativeSelection && selection && (this._lastNativeSelection.start !== selection.start || this._lastNativeSelection.end !== selection.end)) { + nativeProps.selection = this.props.selection; + } + + if (Object.keys(nativeProps).length > 0 && this._inputRef) { + this._inputRef.setNativeProps(nativeProps); + } + + if (this.props.selectionState && selection) { + this.props.selectionState.update(selection.start, selection.end); + } + }, + + _onBlur: function _onBlur(event) { + this.blur(); + if (this.props.onBlur) { + this.props.onBlur(event); + } + + if (this.props.selectionState) { + this.props.selectionState.blur(); + } + }, + + _onTextInput: function _onTextInput(event) { + this.props.onTextInput && this.props.onTextInput(event); + }, + + _onScroll: function _onScroll(event) { + this.props.onScroll && this.props.onScroll(event); + } +}); + +var styles = StyleSheet.create({ + input: { + alignSelf: 'stretch' + } +}); + +module.exports = TextInput; +}, 368, null, "TextInput"); +__d(/* DocumentSelectionState */function(global, require, module, exports) { + +'use strict'; + +var mixInEventEmitter = require(370 ); // 370 = mixInEventEmitter + +var DocumentSelectionState = function () { + function DocumentSelectionState(anchor, focus) { + babelHelpers.classCallCheck(this, DocumentSelectionState); + + this._anchorOffset = anchor; + this._focusOffset = focus; + this._hasFocus = false; + } + + babelHelpers.createClass(DocumentSelectionState, [{ + key: 'update', + value: function update(anchor, focus) { + if (this._anchorOffset !== anchor || this._focusOffset !== focus) { + this._anchorOffset = anchor; + this._focusOffset = focus; + this.emit('update'); + } + } + }, { + key: 'constrainLength', + value: function constrainLength(maxLength) { + this.update(Math.min(this._anchorOffset, maxLength), Math.min(this._focusOffset, maxLength)); + } + }, { + key: 'focus', + value: function focus() { + if (!this._hasFocus) { + this._hasFocus = true; + this.emit('focus'); + } + } + }, { + key: 'blur', + value: function blur() { + if (this._hasFocus) { + this._hasFocus = false; + this.emit('blur'); + } + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this._hasFocus; + } + }, { + key: 'isCollapsed', + value: function isCollapsed() { + return this._anchorOffset === this._focusOffset; + } + }, { + key: 'isBackward', + value: function isBackward() { + return this._anchorOffset > this._focusOffset; + } + }, { + key: 'getAnchorOffset', + value: function getAnchorOffset() { + return this._hasFocus ? this._anchorOffset : null; + } + }, { + key: 'getFocusOffset', + value: function getFocusOffset() { + return this._hasFocus ? this._focusOffset : null; + } + }, { + key: 'getStartOffset', + value: function getStartOffset() { + return this._hasFocus ? Math.min(this._anchorOffset, this._focusOffset) : null; + } + }, { + key: 'getEndOffset', + value: function getEndOffset() { + return this._hasFocus ? Math.max(this._anchorOffset, this._focusOffset) : null; + } + }, { + key: 'overlaps', + value: function overlaps(start, end) { + return this.hasFocus() && this.getStartOffset() <= end && start <= this.getEndOffset(); + } + }]); + return DocumentSelectionState; +}(); + +mixInEventEmitter(DocumentSelectionState, { + 'blur': true, + 'focus': true, + 'update': true +}); + +module.exports = DocumentSelectionState; +}, 369, null, "DocumentSelectionState"); +__d(/* mixInEventEmitter */function(global, require, module, exports) { +'use strict'; + +var EventEmitter = require(103 ); // 103 = EventEmitter +var EventEmitterWithHolding = require(371 ); // 371 = EventEmitterWithHolding +var EventHolder = require(372 ); // 372 = EventHolder +var EventValidator = require(373 ); // 373 = EventValidator + +var copyProperties = require(374 ); // 374 = copyProperties +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var keyOf = require(323 ); // 323 = fbjs/lib/keyOf + +var TYPES_KEY = keyOf({ __types: true }); + +function mixInEventEmitter(cls, types) { + invariant(types, 'Must supply set of valid event types'); + + var target = cls.prototype || cls; + + invariant(!target.__eventEmitter, 'An active emitter is already mixed in'); + + var ctor = cls.constructor; + if (ctor) { + invariant(ctor === Object || ctor === Function, 'Mix EventEmitter into a class, not an instance'); + } + + if (target.hasOwnProperty(TYPES_KEY)) { + copyProperties(target.__types, types); + } else if (target.__types) { + target.__types = copyProperties({}, target.__types, types); + } else { + target.__types = types; + } + copyProperties(target, EventEmitterMixin); +} + +var EventEmitterMixin = { + emit: function emit(eventType, a, b, c, d, e, _) { + return this.__getEventEmitter().emit(eventType, a, b, c, d, e, _); + }, + + emitAndHold: function emitAndHold(eventType, a, b, c, d, e, _) { + return this.__getEventEmitter().emitAndHold(eventType, a, b, c, d, e, _); + }, + + addListener: function addListener(eventType, listener, context) { + return this.__getEventEmitter().addListener(eventType, listener, context); + }, + + once: function once(eventType, listener, context) { + return this.__getEventEmitter().once(eventType, listener, context); + }, + + addRetroactiveListener: function addRetroactiveListener(eventType, listener, context) { + return this.__getEventEmitter().addRetroactiveListener(eventType, listener, context); + }, + + addListenerMap: function addListenerMap(listenerMap, context) { + return this.__getEventEmitter().addListenerMap(listenerMap, context); + }, + + addRetroactiveListenerMap: function addRetroactiveListenerMap(listenerMap, context) { + return this.__getEventEmitter().addListenerMap(listenerMap, context); + }, + + removeAllListeners: function removeAllListeners() { + this.__getEventEmitter().removeAllListeners(); + }, + + removeCurrentListener: function removeCurrentListener() { + this.__getEventEmitter().removeCurrentListener(); + }, + + releaseHeldEventType: function releaseHeldEventType(eventType) { + this.__getEventEmitter().releaseHeldEventType(eventType); + }, + + __getEventEmitter: function __getEventEmitter() { + if (!this.__eventEmitter) { + var emitter = new EventEmitter(); + emitter = EventValidator.addValidation(emitter, this.__types); + + var holder = new EventHolder(); + this.__eventEmitter = new EventEmitterWithHolding(emitter, holder); + } + return this.__eventEmitter; + } +}; + +module.exports = mixInEventEmitter; +}, 370, null, "mixInEventEmitter"); +__d(/* EventEmitterWithHolding */function(global, require, module, exports) { +'use strict'; + +var EventEmitterWithHolding = function () { + function EventEmitterWithHolding(emitter, holder) { + babelHelpers.classCallCheck(this, EventEmitterWithHolding); + + this._emitter = emitter; + this._eventHolder = holder; + this._currentEventToken = null; + this._emittingHeldEvents = false; + } + + babelHelpers.createClass(EventEmitterWithHolding, [{ + key: 'addListener', + value: function addListener(eventType, listener, context) { + return this._emitter.addListener(eventType, listener, context); + } + }, { + key: 'once', + value: function once(eventType, listener, context) { + return this._emitter.once(eventType, listener, context); + } + }, { + key: 'addRetroactiveListener', + value: function addRetroactiveListener(eventType, listener, context) { + var subscription = this._emitter.addListener(eventType, listener, context); + + this._emittingHeldEvents = true; + this._eventHolder.emitToListener(eventType, listener, context); + this._emittingHeldEvents = false; + + return subscription; + } + }, { + key: 'removeAllListeners', + value: function removeAllListeners(eventType) { + this._emitter.removeAllListeners(eventType); + } + }, { + key: 'removeCurrentListener', + value: function removeCurrentListener() { + this._emitter.removeCurrentListener(); + } + }, { + key: 'listeners', + value: function listeners(eventType) { + return this._emitter.listeners(eventType); + } + }, { + key: 'emit', + value: function emit(eventType) { + var _emitter; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_emitter = this._emitter).emit.apply(_emitter, [eventType].concat(babelHelpers.toConsumableArray(args))); + } + }, { + key: 'emitAndHold', + value: function emitAndHold(eventType) { + var _eventHolder, _emitter2; + + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + this._currentEventToken = (_eventHolder = this._eventHolder).holdEvent.apply(_eventHolder, [eventType].concat(babelHelpers.toConsumableArray(args))); + (_emitter2 = this._emitter).emit.apply(_emitter2, [eventType].concat(babelHelpers.toConsumableArray(args))); + this._currentEventToken = null; + } + }, { + key: 'releaseCurrentEvent', + value: function releaseCurrentEvent() { + if (this._currentEventToken) { + this._eventHolder.releaseEvent(this._currentEventToken); + } else if (this._emittingHeldEvents) { + this._eventHolder.releaseCurrentEvent(); + } + } + }, { + key: 'releaseHeldEventType', + value: function releaseHeldEventType(eventType) { + this._eventHolder.releaseEventType(eventType); + } + }]); + return EventEmitterWithHolding; +}(); + +module.exports = EventEmitterWithHolding; +}, 371, null, "EventEmitterWithHolding"); +__d(/* EventHolder */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var EventHolder = function () { + function EventHolder() { + babelHelpers.classCallCheck(this, EventHolder); + + this._heldEvents = {}; + this._currentEventKey = null; + } + + babelHelpers.createClass(EventHolder, [{ + key: 'holdEvent', + value: function holdEvent(eventType) { + this._heldEvents[eventType] = this._heldEvents[eventType] || []; + var eventsOfType = this._heldEvents[eventType]; + var key = { + eventType: eventType, + index: eventsOfType.length + }; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + eventsOfType.push(args); + return key; + } + }, { + key: 'emitToListener', + value: function emitToListener(eventType, listener, context) { + var _this = this; + + var eventsOfType = this._heldEvents[eventType]; + if (!eventsOfType) { + return; + } + var origEventKey = this._currentEventKey; + eventsOfType.forEach(function (eventHeld, index) { + if (!eventHeld) { + return; + } + _this._currentEventKey = { + eventType: eventType, + index: index + }; + listener.apply(context, eventHeld); + }); + this._currentEventKey = origEventKey; + } + }, { + key: 'releaseCurrentEvent', + value: function releaseCurrentEvent() { + invariant(this._currentEventKey !== null, 'Not in an emitting cycle; there is no current event'); + this._currentEventKey && this.releaseEvent(this._currentEventKey); + } + }, { + key: 'releaseEvent', + value: function releaseEvent(token) { + delete this._heldEvents[token.eventType][token.index]; + } + }, { + key: 'releaseEventType', + value: function releaseEventType(type) { + this._heldEvents[type] = []; + } + }]); + return EventHolder; +}(); + +module.exports = EventHolder; +}, 372, null, "EventHolder"); +__d(/* EventValidator */function(global, require, module, exports) { +'use strict'; + +var copyProperties = require(374 ); // 374 = copyProperties + +var EventValidator = { + addValidation: function addValidation(emitter, types) { + var eventTypes = Object.keys(types); + var emitterWithValidation = Object.create(emitter); + + copyProperties(emitterWithValidation, { + emit: function emit(type, a, b, c, d, e, _) { + assertAllowsEventType(type, eventTypes); + return emitter.emit.call(this, type, a, b, c, d, e, _); + } + }); + + return emitterWithValidation; + } +}; + +function assertAllowsEventType(type, allowedTypes) { + if (allowedTypes.indexOf(type) === -1) { + throw new TypeError(errorMessageFor(type, allowedTypes)); + } +} + +function errorMessageFor(type, allowedTypes) { + var message = 'Unknown event type "' + type + '". '; + if (__DEV__) { + message += recommendationFor(type, allowedTypes); + } + message += 'Known event types: ' + allowedTypes.join(', ') + '.'; + return message; +} + +if (__DEV__) { + var recommendationFor = function recommendationFor(type, allowedTypes) { + var closestTypeRecommendation = closestTypeFor(type, allowedTypes); + if (isCloseEnough(closestTypeRecommendation, type)) { + return 'Did you mean "' + closestTypeRecommendation.type + '"? '; + } else { + return ''; + } + }; + + var closestTypeFor = function closestTypeFor(type, allowedTypes) { + var typeRecommendations = allowedTypes.map(typeRecommendationFor.bind(this, type)); + return typeRecommendations.sort(recommendationSort)[0]; + }; + + var typeRecommendationFor = function typeRecommendationFor(type, recomendedType) { + return { + type: recomendedType, + distance: damerauLevenshteinDistance(type, recomendedType) + }; + }; + + var recommendationSort = function recommendationSort(recommendationA, recommendationB) { + if (recommendationA.distance < recommendationB.distance) { + return -1; + } else if (recommendationA.distance > recommendationB.distance) { + return 1; + } else { + return 0; + } + }; + + var isCloseEnough = function isCloseEnough(closestType, actualType) { + return closestType.distance / actualType.length < 0.334; + }; + + var damerauLevenshteinDistance = function damerauLevenshteinDistance(a, b) { + var i = void 0, + j = void 0; + var d = []; + + for (i = 0; i <= a.length; i++) { + d[i] = [i]; + } + + for (j = 1; j <= b.length; j++) { + d[0][j] = j; + } + + for (i = 1; i <= a.length; i++) { + for (j = 1; j <= b.length; j++) { + var cost = a.charAt(i - 1) === b.charAt(j - 1) ? 0 : 1; + + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + + if (i > 1 && j > 1 && a.charAt(i - 1) === b.charAt(j - 2) && a.charAt(i - 2) === b.charAt(j - 1)) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); + } + } + } + + return d[a.length][b.length]; + }; +} + +module.exports = EventValidator; +}, 373, null, "EventValidator"); +__d(/* copyProperties */function(global, require, module, exports) { +'use strict'; + +function copyProperties(obj, a, b, c, d, e, f) { + obj = obj || {}; + + if (__DEV__) { + if (f) { + throw new Error('Too many arguments passed to copyProperties'); + } + } + + var args = [a, b, c, d, e]; + var ii = 0, + v; + while (args[ii]) { + v = args[ii++]; + for (var k in v) { + obj[k] = v[k]; + } + + if (v.hasOwnProperty && v.hasOwnProperty('toString') && typeof v.toString !== 'undefined' && obj.toString !== v.toString) { + obj.toString = v.toString; + } + } + + return obj; +} + +module.exports = copyProperties; +}, 374, null, "copyProperties"); +__d(/* ToastAndroid */function(global, require, module, exports) { +'use strict'; + +var warning = require(40 ); // 40 = fbjs/lib/warning + +var ToastAndroid = { + + show: function show(message, duration) { + warning(false, 'ToastAndroid is not supported on this platform.'); + } + +}; + +module.exports = ToastAndroid; +}, 375, null, "ToastAndroid"); +__d(/* ToolbarAndroid */function(global, require, module, exports) { +'use strict'; + +module.exports = require(156 ); // 156 = UnimplementedView +}, 376, null, "ToolbarAndroid"); +__d(/* ViewPagerAndroid */function(global, require, module, exports) { +'use strict'; + +module.exports = require(156 ); // 156 = UnimplementedView +}, 377, null, "ViewPagerAndroid"); +__d(/* WebView */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/Components/WebView/WebView.ios.js'; +var ActivityIndicator = require(70 ); // 70 = ActivityIndicator +var EdgeInsetsPropType = require(147 ); // 147 = EdgeInsetsPropType +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative +var StyleSheet = require(127 ); // 127 = StyleSheet +var Text = require(210 ); // 210 = Text +var UIManager = require(123 ); // 123 = UIManager +var View = require(146 ); // 146 = View +var ScrollView = require(239 ); // 239 = ScrollView + +var deprecatedPropType = require(137 ); // 137 = deprecatedPropType +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var keyMirror = require(133 ); // 133 = fbjs/lib/keyMirror +var processDecelerationRate = require(293 ); // 293 = processDecelerationRate +var requireNativeComponent = require(155 ); // 155 = requireNativeComponent +var resolveAssetSource = require(198 ); // 198 = resolveAssetSource + +var PropTypes = React.PropTypes; +var RCTWebViewManager = require(80 ).WebViewManager; // 80 = NativeModules + +var BGWASH = 'rgba(255,255,255,0.8)'; +var RCT_WEBVIEW_REF = 'webview'; + +var WebViewState = keyMirror({ + IDLE: null, + LOADING: null, + ERROR: null +}); + +var NavigationType = keyMirror({ + click: true, + formsubmit: true, + backforward: true, + reload: true, + formresubmit: true, + other: true +}); + +var JSNavigationScheme = 'react-js-navigation'; + +var DataDetectorTypes = ['phoneNumber', 'link', 'address', 'calendarEvent', 'none', 'all']; + +var defaultRenderLoading = function defaultRenderLoading() { + return React.createElement( + View, + { style: styles.loadingView, __source: { + fileName: _jsxFileName, + lineNumber: 72 + } + }, + React.createElement(ActivityIndicator, { + __source: { + fileName: _jsxFileName, + lineNumber: 73 + } + }) + ); +}; +var defaultRenderError = function defaultRenderError(errorDomain, errorCode, errorDesc) { + return React.createElement( + View, + { style: styles.errorContainer, __source: { + fileName: _jsxFileName, + lineNumber: 77 + } + }, + React.createElement( + Text, + { style: styles.errorTextTitle, __source: { + fileName: _jsxFileName, + lineNumber: 78 + } + }, + 'Error loading page' + ), + React.createElement( + Text, + { style: styles.errorText, __source: { + fileName: _jsxFileName, + lineNumber: 81 + } + }, + 'Domain: ' + errorDomain + ), + React.createElement( + Text, + { style: styles.errorText, __source: { + fileName: _jsxFileName, + lineNumber: 84 + } + }, + 'Error Code: ' + errorCode + ), + React.createElement( + Text, + { style: styles.errorText, __source: { + fileName: _jsxFileName, + lineNumber: 87 + } + }, + 'Description: ' + errorDesc + ) + ); +}; + +var WebView = function (_React$Component) { + babelHelpers.inherits(WebView, _React$Component); + + function WebView() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, WebView); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = WebView.__proto__ || Object.getPrototypeOf(WebView)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + viewState: WebViewState.IDLE, + lastErrorEvent: null, + startInLoadingState: true + }, _this.goForward = function () { + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.goForward, null); + }, _this.goBack = function () { + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.goBack, null); + }, _this.reload = function () { + _this.setState({ viewState: WebViewState.LOADING }); + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.reload, null); + }, _this.stopLoading = function () { + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.stopLoading, null); + }, _this.postMessage = function (data) { + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.postMessage, [String(data)]); + }, _this.injectJavaScript = function (data) { + UIManager.dispatchViewManagerCommand(_this.getWebViewHandle(), UIManager.RCTWebView.Commands.injectJavaScript, [data]); + }, _this._updateNavigationState = function (event) { + if (_this.props.onNavigationStateChange) { + _this.props.onNavigationStateChange(event.nativeEvent); + } + }, _this.getWebViewHandle = function () { + return ReactNative.findNodeHandle(_this.refs[RCT_WEBVIEW_REF]); + }, _this._onLoadingStart = function (event) { + var onLoadStart = _this.props.onLoadStart; + onLoadStart && onLoadStart(event); + _this._updateNavigationState(event); + }, _this._onLoadingError = function (event) { + event.persist();var _this$props = _this.props, + onError = _this$props.onError, + onLoadEnd = _this$props.onLoadEnd; + + onError && onError(event); + onLoadEnd && onLoadEnd(event); + console.warn('Encountered an error loading page', event.nativeEvent); + + _this.setState({ + lastErrorEvent: event.nativeEvent, + viewState: WebViewState.ERROR + }); + }, _this._onLoadingFinish = function (event) { + var _this$props2 = _this.props, + onLoad = _this$props2.onLoad, + onLoadEnd = _this$props2.onLoadEnd; + + onLoad && onLoad(event); + onLoadEnd && onLoadEnd(event); + _this.setState({ + viewState: WebViewState.IDLE + }); + _this._updateNavigationState(event); + }, _this._onMessage = function (event) { + var onMessage = _this.props.onMessage; + + onMessage && onMessage(event); + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(WebView, [{ + key: 'componentWillMount', + value: function componentWillMount() { + if (this.props.startInLoadingState) { + this.setState({ viewState: WebViewState.LOADING }); + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var otherView = null; + + if (this.state.viewState === WebViewState.LOADING) { + otherView = (this.props.renderLoading || defaultRenderLoading)(); + } else if (this.state.viewState === WebViewState.ERROR) { + var errorEvent = this.state.lastErrorEvent; + invariant(errorEvent != null, 'lastErrorEvent expected to be non-null'); + otherView = (this.props.renderError || defaultRenderError)(errorEvent.domain, errorEvent.code, errorEvent.description); + } else if (this.state.viewState !== WebViewState.IDLE) { + console.error('RCTWebView invalid state encountered: ' + this.state.loading); + } + + var webViewStyles = [styles.container, styles.webView, this.props.style]; + if (this.state.viewState === WebViewState.LOADING || this.state.viewState === WebViewState.ERROR) { + webViewStyles.push(styles.hidden); + } + + var onShouldStartLoadWithRequest = this.props.onShouldStartLoadWithRequest && function (event) { + var shouldStart = _this2.props.onShouldStartLoadWithRequest && _this2.props.onShouldStartLoadWithRequest(event.nativeEvent); + RCTWebViewManager.startLoadWithResult(!!shouldStart, event.nativeEvent.lockIdentifier); + }; + + var decelerationRate = processDecelerationRate(this.props.decelerationRate); + + var source = this.props.source || {}; + if (this.props.html) { + source.html = this.props.html; + } else if (this.props.url) { + source.uri = this.props.url; + } + + var messagingEnabled = typeof this.props.onMessage === 'function'; + + var webView = React.createElement(RCTWebView, { + ref: RCT_WEBVIEW_REF, + key: 'webViewKey', + style: webViewStyles, + source: resolveAssetSource(source), + injectedJavaScript: this.props.injectedJavaScript, + bounces: this.props.bounces, + scrollEnabled: this.props.scrollEnabled, + decelerationRate: decelerationRate, + contentInset: this.props.contentInset, + automaticallyAdjustContentInsets: this.props.automaticallyAdjustContentInsets, + onLoadingStart: this._onLoadingStart, + onLoadingFinish: this._onLoadingFinish, + onLoadingError: this._onLoadingError, + messagingEnabled: messagingEnabled, + onMessage: this._onMessage, + onShouldStartLoadWithRequest: onShouldStartLoadWithRequest, + scalesPageToFit: this.props.scalesPageToFit, + allowsInlineMediaPlayback: this.props.allowsInlineMediaPlayback, + mediaPlaybackRequiresUserAction: this.props.mediaPlaybackRequiresUserAction, + dataDetectorTypes: this.props.dataDetectorTypes, + __source: { + fileName: _jsxFileName, + lineNumber: 398 + } + }); + + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 422 + } + }, + webView, + otherView + ); + } + }]); + return WebView; +}(React.Component); + +WebView.JSNavigationScheme = JSNavigationScheme; +WebView.NavigationType = NavigationType; +WebView.propTypes = babelHelpers.extends({}, View.propTypes, { + + html: deprecatedPropType(PropTypes.string, 'Use the `source` prop instead.'), + + url: deprecatedPropType(PropTypes.string, 'Use the `source` prop instead.'), + + source: PropTypes.oneOfType([PropTypes.shape({ + uri: PropTypes.string, + + method: PropTypes.string, + + headers: PropTypes.object, + + body: PropTypes.string + }), PropTypes.shape({ + html: PropTypes.string, + + baseUrl: PropTypes.string + }), PropTypes.number]), + + renderError: PropTypes.func, + renderLoading: PropTypes.func, + + onLoad: PropTypes.func, + + onLoadEnd: PropTypes.func, + + onLoadStart: PropTypes.func, + + onError: PropTypes.func, + + bounces: PropTypes.bool, + + decelerationRate: ScrollView.propTypes.decelerationRate, + + scrollEnabled: PropTypes.bool, + + automaticallyAdjustContentInsets: PropTypes.bool, + + contentInset: EdgeInsetsPropType, + + onNavigationStateChange: PropTypes.func, + + onMessage: PropTypes.func, + + startInLoadingState: PropTypes.bool, + + style: View.propTypes.style, + + dataDetectorTypes: PropTypes.oneOfType([PropTypes.oneOf(DataDetectorTypes), PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes))]), + + javaScriptEnabled: PropTypes.bool, + + domStorageEnabled: PropTypes.bool, + + injectedJavaScript: PropTypes.string, + + userAgent: PropTypes.string, + + scalesPageToFit: PropTypes.bool, + + onShouldStartLoadWithRequest: PropTypes.func, + + allowsInlineMediaPlayback: PropTypes.bool, + + mediaPlaybackRequiresUserAction: PropTypes.bool +}); + + +var RCTWebView = requireNativeComponent('RCTWebView', WebView, { + nativeOnly: { + onLoadingStart: true, + onLoadingError: true, + onLoadingFinish: true, + onMessage: true, + messagingEnabled: PropTypes.bool + } +}); + +var styles = StyleSheet.create({ + container: { + flex: 1 + }, + errorContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: BGWASH + }, + errorText: { + fontSize: 14, + textAlign: 'center', + marginBottom: 2 + }, + errorTextTitle: { + fontSize: 15, + fontWeight: '500', + marginBottom: 10 + }, + hidden: { + height: 0, + flex: 0 }, + loadingView: { + backgroundColor: BGWASH, + flex: 1, + justifyContent: 'center', + alignItems: 'center', + height: 100 + }, + webView: { + backgroundColor: '#ffffff' + } +}); + +module.exports = WebView; +}, 378, null, "WebView"); +__d(/* ActionSheetIOS */function(global, require, module, exports) { +'use strict'; + +var RCTActionSheetManager = require(80 ).ActionSheetManager; // 80 = NativeModules + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var processColor = require(121 ); // 121 = processColor + +var ActionSheetIOS = { + showActionSheetWithOptions: function showActionSheetWithOptions(options, callback) { + invariant(typeof options === 'object' && options !== null, 'Options must be a valid object'); + invariant(typeof callback === 'function', 'Must provide a valid callback'); + RCTActionSheetManager.showActionSheetWithOptions(babelHelpers.extends({}, options, { tintColor: processColor(options.tintColor) }), callback); + }, + showShareActionSheetWithOptions: function showShareActionSheetWithOptions(options, failureCallback, successCallback) { + invariant(typeof options === 'object' && options !== null, 'Options must be a valid object'); + invariant(typeof failureCallback === 'function', 'Must provide a valid failureCallback'); + invariant(typeof successCallback === 'function', 'Must provide a valid successCallback'); + RCTActionSheetManager.showShareActionSheetWithOptions(babelHelpers.extends({}, options, { tintColor: processColor(options.tintColor) }), failureCallback, successCallback); + } +}; + +module.exports = ActionSheetIOS; +}, 379, null, "ActionSheetIOS"); +__d(/* AdSupportIOS */function(global, require, module, exports) { +'use strict'; + +var AdSupport = require(80 ).AdSupport; // 80 = NativeModules + +module.exports = { + getAdvertisingId: function getAdvertisingId(onSuccess, onFailure) { + AdSupport.getAdvertisingId(onSuccess, onFailure); + }, + + getAdvertisingTrackingEnabled: function getAdvertisingTrackingEnabled(onSuccess, onFailure) { + AdSupport.getAdvertisingTrackingEnabled(onSuccess, onFailure); + } +}; +}, 380, null, "AdSupportIOS"); +__d(/* AppRegistry */function(global, require, module, exports) { +'use strict'; + +var BatchedBridge = require(81 ); // 81 = BatchedBridge +var BugReporting = require(382 ); // 382 = BugReporting +var ReactNative = require(241 ); // 241 = ReactNative + +var infoLog = require(229 ); // 229 = infoLog +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var renderApplication = require(385 ); // 385 = renderApplication + +var _require = require(80 ), // 80 = NativeModules + HeadlessJsTaskSupport = _require.HeadlessJsTaskSupport; + +if (__DEV__) { + require(387 ); // 387 = RCTRenderingPerf +} + +var runnables = {}; +var runCount = 1; +var tasks = new Map(); + +var AppRegistry = { + registerConfig: function registerConfig(config) { + for (var i = 0; i < config.length; ++i) { + var appConfig = config[i]; + if (appConfig.run) { + AppRegistry.registerRunnable(appConfig.appKey, appConfig.run); + } else { + invariant(appConfig.component, 'No component provider passed in'); + AppRegistry.registerComponent(appConfig.appKey, appConfig.component); + } + } + }, + + registerComponent: function registerComponent(appKey, getComponentFunc) { + runnables[appKey] = { + run: function run(appParameters) { + return renderApplication(getComponentFunc(), appParameters.initialProps, appParameters.rootTag); + } + }; + return appKey; + }, + + registerRunnable: function registerRunnable(appKey, func) { + runnables[appKey] = { run: func }; + return appKey; + }, + + getAppKeys: function getAppKeys() { + return Object.keys(runnables); + }, + + runApplication: function runApplication(appKey, appParameters) { + var msg = 'Running application "' + appKey + '" with appParams: ' + JSON.stringify(appParameters) + '. ' + '__DEV__ === ' + String(__DEV__) + ', development-level warning are ' + (__DEV__ ? 'ON' : 'OFF') + ', performance optimizations are ' + (__DEV__ ? 'OFF' : 'ON'); + infoLog(msg); + BugReporting.addSource('AppRegistry.runApplication' + runCount++, function () { + return msg; + }); + invariant(runnables[appKey] && runnables[appKey].run, 'Application ' + appKey + ' has not been registered. This ' + 'is either due to a require() error during initialization ' + 'or failure to call AppRegistry.registerComponent.'); + runnables[appKey].run(appParameters); + }, + + unmountApplicationComponentAtRootTag: function unmountApplicationComponentAtRootTag(rootTag) { + ReactNative.unmountComponentAtNodeAndRemoveContainer(rootTag); + }, + + registerHeadlessTask: function registerHeadlessTask(taskKey, task) { + if (tasks.has(taskKey)) { + console.warn('registerHeadlessTask called multiple times for same key \'' + taskKey + '\''); + } + tasks.set(taskKey, task); + }, + + startHeadlessTask: function startHeadlessTask(taskId, taskKey, data) { + var taskProvider = tasks.get(taskKey); + if (!taskProvider) { + throw new Error('No task registered for key ' + taskKey); + } + taskProvider()(data).then(function () { + return HeadlessJsTaskSupport.notifyTaskFinished(taskId); + }).catch(function (reason) { + console.error(reason); + HeadlessJsTaskSupport.notifyTaskFinished(taskId); + }); + } + +}; + +BatchedBridge.registerCallableModule('AppRegistry', AppRegistry); + +module.exports = AppRegistry; +}, 381, null, "AppRegistry"); +__d(/* BugReporting */function(global, require, module, exports) { +'use strict'; + +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter +var Map = require(223 ); // 223 = Map +var infoLog = require(229 ); // 229 = infoLog + +function defaultExtras() { + BugReporting.addFileSource('react_hierarchy.txt', function () { + return require(383 )(); // 383 = dumpReactTree + }); +} + +var BugReporting = function () { + function BugReporting() { + babelHelpers.classCallCheck(this, BugReporting); + } + + babelHelpers.createClass(BugReporting, null, [{ + key: '_maybeInit', + value: function _maybeInit() { + if (!BugReporting._subscription) { + BugReporting._subscription = RCTDeviceEventEmitter.addListener('collectBugExtraData', BugReporting.collectExtraData, null); + defaultExtras(); + } + } + }, { + key: 'addSource', + value: function addSource(key, callback) { + return this._addSource(key, callback, BugReporting._extraSources); + } + }, { + key: 'addFileSource', + value: function addFileSource(key, callback) { + return this._addSource(key, callback, BugReporting._fileSources); + } + }, { + key: '_addSource', + value: function _addSource(key, callback, source) { + BugReporting._maybeInit(); + if (source.has(key)) { + console.warn('BugReporting.add* called multiple times for same key \'' + key + '\''); + } + source.set(key, callback); + return { remove: function remove() { + source.delete(key); + } }; + } + }, { + key: 'collectExtraData', + value: function collectExtraData() { + var extraData = {}; + for (var _iterator = BugReporting._extraSources, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref3; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + var _ref = _ref3; + + var _ref2 = babelHelpers.slicedToArray(_ref, 2); + + var _key = _ref2[0]; + var callback = _ref2[1]; + + extraData[_key] = callback(); + } + var fileData = {}; + for (var _iterator2 = BugReporting._fileSources, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + var _ref4 = _ref6; + + var _ref5 = babelHelpers.slicedToArray(_ref4, 2); + + var _key2 = _ref5[0]; + var _callback = _ref5[1]; + + fileData[_key2] = _callback(); + } + infoLog('BugReporting extraData:', extraData); + var BugReportingNativeModule = require(80 ).BugReporting; // 80 = NativeModules + BugReportingNativeModule && BugReportingNativeModule.setExtraData && BugReportingNativeModule.setExtraData(extraData, fileData); + + return { extras: extraData, files: fileData }; + } + }]); + return BugReporting; +}(); + +BugReporting._extraSources = new Map(); +BugReporting._fileSources = new Map(); +BugReporting._subscription = null; + + +module.exports = BugReporting; +}, 382, null, "BugReporting"); +__d(/* dumpReactTree */function(global, require, module, exports) { +'use strict'; + +var ReactNativeMount = require(265 ); // 265 = ReactNativeMount +var getReactData = require(384 ); // 384 = getReactData + +var INDENTATION_SIZE = 2; +var MAX_DEPTH = 2; +var MAX_STRING_LENGTH = 50; + +function dumpReactTree() { + try { + return getReactTree(); + } catch (e) { + return 'Failed to dump react tree: ' + e; + } +} + +function getReactTree() { + var output = ''; + var rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID); + for (var _iterator = rootIds, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var rootId = _ref; + + var instance = ReactNativeMount._instancesByContainerID[rootId]; + output += '============ Root ID: ' + rootId + ' ============\n'; + output += dumpNode(instance, 0); + output += '============ End root ID: ' + rootId + ' ============\n'; + } + return output; +} + +function dumpNode(node, identation) { + var data = getReactData(node); + if (data.nodeType === 'Text') { + return indent(identation) + data.text + '\n'; + } else if (data.nodeType === 'Empty') { + return ''; + } + var output = indent(identation) + ('<' + data.name); + if (data.nodeType === 'Composite') { + for (var _iterator2 = Object.getOwnPropertyNames(data.props || {}), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var propName = _ref2; + + if (isNormalProp(propName)) { + try { + var value = convertValue(data.props[propName]); + if (value) { + output += ' ' + propName + '=' + value; + } + } catch (e) { + var message = '[Failed to get property: ' + e + ']'; + output += ' ' + propName + '=' + message; + } + } + } + } + var childOutput = ''; + for (var _iterator3 = data.children || [], _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var child = _ref3; + + childOutput += dumpNode(child, identation + 1); + } + + if (childOutput) { + output += '>\n' + childOutput + indent(identation) + ('\n'); + } else { + output += ' />\n'; + } + + return output; +} + +function isNormalProp(name) { + switch (name) { + case 'children': + case 'key': + case 'ref': + return false; + default: + return true; + } +} + +function convertObject(object, depth) { + if (depth >= MAX_DEPTH) { + return '[...omitted]'; + } + var output = '{'; + var first = true; + for (var _iterator4 = Object.getOwnPropertyNames(object), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var key = _ref4; + + if (!first) { + output += ', '; + } + + output += key + ': ' + convertValue(object[key], depth + 1); + first = false; + } + return output + '}'; +} + +function convertValue(value) { + var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (!value) { + return null; + } + + switch (typeof value) { + case 'string': + return JSON.stringify(possiblyEllipsis(value).replace('\n', '\\n')); + case 'boolean': + case 'number': + return JSON.stringify(value); + case 'function': + return '[function]'; + case 'object': + return convertObject(value, depth); + default: + return null; + } +} + +function possiblyEllipsis(value) { + if (value.length > MAX_STRING_LENGTH) { + return value.slice(0, MAX_STRING_LENGTH) + '...'; + } else { + return value; + } +} + +function indent(size) { + return ' '.repeat(size * INDENTATION_SIZE); +} + +module.exports = dumpReactTree; +}, 383, null, "dumpReactTree"); +__d(/* getReactData */function(global, require, module, exports) { +'use strict'; + +function getData(element) { + var children = null; + var props = null; + var state = null; + var context = null; + var updater = null; + var name = null; + var type = null; + var text = null; + var publicInstance = null; + var nodeType = 'Native'; + + if (typeof element !== 'object') { + nodeType = 'Text'; + text = element + ''; + } else if (element._currentElement === null || element._currentElement === false) { + nodeType = 'Empty'; + } else if (element._renderedComponent) { + nodeType = 'NativeWrapper'; + children = [element._renderedComponent]; + props = element._instance.props; + state = element._instance.state; + context = element._instance.context; + if (context && Object.keys(context).length === 0) { + context = null; + } + } else if (element._renderedChildren) { + children = childrenList(element._renderedChildren); + } else if (element._currentElement && element._currentElement.props) { + children = element._currentElement.props.children; + } + + if (!props && element._currentElement && element._currentElement.props) { + props = element._currentElement.props; + } + + if (element._currentElement != null) { + type = element._currentElement.type; + if (typeof type === 'string') { + name = type; + } else if (element.getName) { + nodeType = 'Composite'; + name = element.getName(); + + if (element._renderedComponent && element._currentElement.props === element._renderedComponent._currentElement) { + nodeType = 'Wrapper'; + } + if (name === null) { + name = 'No display name'; + } + } else if (element._stringText) { + nodeType = 'Text'; + text = element._stringText; + } else { + name = type.displayName || type.name || 'Unknown'; + } + } + + if (element._instance) { + var inst = element._instance; + updater = { + setState: inst.setState && inst.setState.bind(inst), + forceUpdate: inst.forceUpdate && inst.forceUpdate.bind(inst), + setInProps: inst.forceUpdate && setInProps.bind(null, element), + setInState: inst.forceUpdate && setInState.bind(null, inst), + setInContext: inst.forceUpdate && setInContext.bind(null, inst) + }; + publicInstance = inst; + + if (inst._renderedChildren) { + children = childrenList(inst._renderedChildren); + } + } + + return { + nodeType: nodeType, + type: type, + name: name, + props: props, + state: state, + context: context, + children: children, + text: text, + updater: updater, + publicInstance: publicInstance + }; +} + +function setInProps(internalInst, path, value) { + var element = internalInst._currentElement; + internalInst._currentElement = babelHelpers.extends({}, element, { + props: copyWithSet(element.props, path, value) + }); + internalInst._instance.forceUpdate(); +} + +function setInState(inst, path, value) { + setIn(inst.state, path, value); + inst.forceUpdate(); +} + +function setInContext(inst, path, value) { + setIn(inst.context, path, value); + inst.forceUpdate(); +} + +function setIn(obj, path, value) { + var last = path.pop(); + var parent = path.reduce(function (obj_, attr) { + return obj_ ? obj_[attr] : null; + }, obj); + if (parent) { + parent[last] = value; + } +} + +function childrenList(children) { + var res = []; + for (var name in children) { + res.push(children[name]); + } + return res; +} + +function copyWithSetImpl(obj, path, idx, value) { + if (idx >= path.length) { + return value; + } + var key = path[idx]; + var updated = Array.isArray(obj) ? obj.slice() : babelHelpers.extends({}, obj); + + updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value); + return updated; +} + +function copyWithSet(obj, path, value) { + return copyWithSetImpl(obj, path, 0, value); +} + +module.exports = getData; +}, 384, null, "getReactData"); +__d(/* renderApplication */function(global, require, module, exports) { + +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/ReactNative/renderApplication.js'; +var AppContainer = require(310 ); // 310 = AppContainer +var React = require(126 ); // 126 = React +var ReactNative = require(241 ); // 241 = ReactNative + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +require(386 ); // 386 = BackAndroid + +function renderApplication(RootComponent, initialProps, rootTag) { + invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); + ReactNative.render(React.createElement( + AppContainer, + { rootTag: rootTag, __source: { + fileName: _jsxFileName, + lineNumber: 34 + } + }, + React.createElement(RootComponent, babelHelpers.extends({}, initialProps, { + rootTag: rootTag, + __source: { + fileName: _jsxFileName, + lineNumber: 35 + } + })) + ), rootTag); +} + +module.exports = renderApplication; +}, 385, null, "renderApplication"); +__d(/* BackAndroid */function(global, require, module, exports) { + +'use strict'; + +function emptyFunction() {} + +var BackAndroid = { + exitApp: emptyFunction, + addEventListener: function addEventListener() { + return { + remove: emptyFunction + }; + }, + + removeEventListener: emptyFunction +}; + +module.exports = BackAndroid; +}, 386, null, "BackAndroid"); +__d(/* RCTRenderingPerf */function(global, require, module, exports) { +'use strict'; + +var ReactDebugTool = require(86 ); // 86 = ReactDebugTool +var ReactPerf = require(388 ); // 388 = ReactPerf + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var performanceNow = require(90 ); // 90 = fbjs/lib/performanceNow + +var perfModules = []; +var enabled = false; +var lastRenderStartTime = 0; +var totalRenderDuration = 0; + +var RCTRenderingPerfDevtool = { + onBeginLifeCycleTimer: function onBeginLifeCycleTimer(debugID, timerType) { + if (timerType === 'render') { + lastRenderStartTime = performanceNow(); + } + }, + onEndLifeCycleTimer: function onEndLifeCycleTimer(debugID, timerType) { + if (timerType === 'render') { + var lastRenderDuration = performanceNow() - lastRenderStartTime; + totalRenderDuration += lastRenderDuration; + } + } +}; + +var RCTRenderingPerf = { + toggle: function toggle() { + console.log('Render perfomance measurements enabled'); + enabled = true; + }, + + start: function start() { + if (!enabled) { + return; + } + + ReactPerf.start(); + ReactDebugTool.addHook(RCTRenderingPerfDevtool); + perfModules.forEach(function (module) { + return module.start(); + }); + }, + + stop: function stop() { + if (!enabled) { + return; + } + + ReactPerf.stop(); + ReactPerf.printInclusive(); + ReactPerf.printWasted(); + ReactDebugTool.removeHook(RCTRenderingPerfDevtool); + + console.log('Total time spent in render(): ' + totalRenderDuration.toFixed(2) + ' ms'); + lastRenderStartTime = 0; + totalRenderDuration = 0; + + perfModules.forEach(function (module) { + return module.stop(); + }); + }, + + register: function register(module) { + invariant(typeof module.start === 'function', 'Perf module should have start() function'); + invariant(typeof module.stop === 'function', 'Perf module should have stop() function'); + perfModules.push(module); + } +}; + +module.exports = RCTRenderingPerf; +}, 387, null, "RCTRenderingPerf"); +__d(/* ReactPerf */function(global, require, module, exports) { + +'use strict'; + +var ReactDebugTool = require(86 ); // 86 = ReactDebugTool +var warning = require(40 ); // 40 = fbjs/lib/warning +var alreadyWarned = false; + +function roundFloat(val) { + var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; + + var n = Math.pow(10, base); + return Math.floor(val * n) / n; +} + +function consoleTable(table) { + console.table(table); +} + +function warnInProduction() { + if (alreadyWarned) { + return; + } + alreadyWarned = true; + if (typeof console !== 'undefined') { + console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.'); + } +} + +function getLastMeasurements() { + if (!__DEV__) { + warnInProduction(); + return []; + } + + return ReactDebugTool.getFlushHistory(); +} + +function getExclusive() { + var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements(); + + if (!__DEV__) { + warnInProduction(); + return []; + } + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { + var displayName = treeSnapshot[instanceID].displayName; + + var key = displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + counts: {}, + durations: {}, + totalDuration: 0 + }; + } + if (!stats.durations[timerType]) { + stats.durations[timerType] = 0; + } + if (!stats.counts[timerType]) { + stats.counts[timerType] = 0; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements, + treeSnapshot = flush.treeSnapshot; + + measurements.forEach(function (measurement) { + var duration = measurement.duration, + instanceID = measurement.instanceID, + timerType = measurement.timerType; + + updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) { + stats.totalDuration += duration; + stats.durations[timerType] += duration; + stats.counts[timerType]++; + }); + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return babelHelpers.extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.totalDuration - a.totalDuration; + }); +} + +function getInclusive() { + var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements(); + + if (!__DEV__) { + warnInProduction(); + return []; + } + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc = treeSnapshot[instanceID], + displayName = _treeSnapshot$instanc.displayName, + ownerID = _treeSnapshot$instanc.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + var isCompositeByID = {}; + flushHistory.forEach(function (flush) { + var measurements = flush.measurements; + + measurements.forEach(function (measurement) { + var instanceID = measurement.instanceID, + timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + isCompositeByID[instanceID] = true; + }); + }); + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements, + treeSnapshot = flush.treeSnapshot; + + measurements.forEach(function (measurement) { + var duration = measurement.duration, + instanceID = measurement.instanceID, + timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + updateAggregatedStats(treeSnapshot, instanceID, function (stats) { + stats.renderCount++; + }); + var nextParentID = instanceID; + while (nextParentID) { + if (isCompositeByID[nextParentID]) { + updateAggregatedStats(treeSnapshot, nextParentID, function (stats) { + stats.inclusiveRenderDuration += duration; + }); + } + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return babelHelpers.extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); +} + +function getWasted() { + var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements(); + + if (!__DEV__) { + warnInProduction(); + return []; + } + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc2 = treeSnapshot[instanceID], + displayName = _treeSnapshot$instanc2.displayName, + ownerID = _treeSnapshot$instanc2.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements, + treeSnapshot = flush.treeSnapshot, + operations = flush.operations; + + var isDefinitelyNotWastedByID = {}; + + operations.forEach(function (operation) { + var instanceID = operation.instanceID; + + var nextParentID = instanceID; + while (nextParentID) { + isDefinitelyNotWastedByID[nextParentID] = true; + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + + var renderedCompositeIDs = {}; + measurements.forEach(function (measurement) { + var instanceID = measurement.instanceID, + timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + renderedCompositeIDs[instanceID] = true; + }); + + measurements.forEach(function (measurement) { + var duration = measurement.duration, + instanceID = measurement.instanceID, + timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + + var updateCount = treeSnapshot[instanceID].updateCount; + + if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) { + return; + } + + updateAggregatedStats(treeSnapshot, instanceID, function (stats) { + stats.renderCount++; + }); + + var nextParentID = instanceID; + while (nextParentID) { + var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID]; + if (isWasted) { + updateAggregatedStats(treeSnapshot, nextParentID, function (stats) { + stats.inclusiveRenderDuration += duration; + }); + } + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return babelHelpers.extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); +} + +function getOperations() { + var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements(); + + if (!__DEV__) { + warnInProduction(); + return []; + } + + var stats = []; + flushHistory.forEach(function (flush, flushIndex) { + var operations = flush.operations, + treeSnapshot = flush.treeSnapshot; + + operations.forEach(function (operation) { + var instanceID = operation.instanceID, + type = operation.type, + payload = operation.payload; + var _treeSnapshot$instanc3 = treeSnapshot[instanceID], + displayName = _treeSnapshot$instanc3.displayName, + ownerID = _treeSnapshot$instanc3.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + + stats.push({ + flushIndex: flushIndex, + instanceID: instanceID, + key: key, + type: type, + ownerID: ownerID, + payload: payload + }); + }); + }); + return stats; +} + +function printExclusive(flushHistory) { + if (!__DEV__) { + warnInProduction(); + return; + } + + var stats = getExclusive(flushHistory); + var table = stats.map(function (item) { + var key = item.key, + instanceCount = item.instanceCount, + totalDuration = item.totalDuration; + + var renderCount = item.counts.render || 0; + var renderDuration = item.durations.render || 0; + return { + 'Component': key, + 'Total time (ms)': roundFloat(totalDuration), + 'Instance count': instanceCount, + 'Total render time (ms)': roundFloat(renderDuration), + 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined, + 'Render count': renderCount, + 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration) + }; + }); + consoleTable(table); +} + +function printInclusive(flushHistory) { + if (!__DEV__) { + warnInProduction(); + return; + } + + var stats = getInclusive(flushHistory); + var table = stats.map(function (item) { + var key = item.key, + instanceCount = item.instanceCount, + inclusiveRenderDuration = item.inclusiveRenderDuration, + renderCount = item.renderCount; + + return { + 'Owner > Component': key, + 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration), + 'Instance count': instanceCount, + 'Render count': renderCount + }; + }); + consoleTable(table); +} + +function printWasted(flushHistory) { + if (!__DEV__) { + warnInProduction(); + return; + } + + var stats = getWasted(flushHistory); + var table = stats.map(function (item) { + var key = item.key, + instanceCount = item.instanceCount, + inclusiveRenderDuration = item.inclusiveRenderDuration, + renderCount = item.renderCount; + + return { + 'Owner > Component': key, + 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration), + 'Instance count': instanceCount, + 'Render count': renderCount + }; + }); + consoleTable(table); +} + +function printOperations(flushHistory) { + if (!__DEV__) { + warnInProduction(); + return; + } + + var stats = getOperations(flushHistory); + var table = stats.map(function (stat) { + return { + 'Owner > Node': stat.key, + 'Operation': stat.type, + 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload, + 'Flush index': stat.flushIndex, + 'Owner Component ID': stat.ownerID, + 'DOM Component ID': stat.instanceID + }; + }); + consoleTable(table); +} + +var warnedAboutPrintDOM = false; +function printDOM(measurements) { + warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.'); + warnedAboutPrintDOM = true; + return printOperations(measurements); +} + +var warnedAboutGetMeasurementsSummaryMap = false; +function getMeasurementsSummaryMap(measurements) { + warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.'); + warnedAboutGetMeasurementsSummaryMap = true; + return getWasted(measurements); +} + +function start() { + if (!__DEV__) { + warnInProduction(); + return; + } + + ReactDebugTool.beginProfiling(); +} + +function stop() { + if (!__DEV__) { + warnInProduction(); + return; + } + + ReactDebugTool.endProfiling(); +} + +function isRunning() { + if (!__DEV__) { + warnInProduction(); + return false; + } + + return ReactDebugTool.isProfiling(); +} + +var ReactPerfAnalysis = { + getLastMeasurements: getLastMeasurements, + getExclusive: getExclusive, + getInclusive: getInclusive, + getWasted: getWasted, + getOperations: getOperations, + printExclusive: printExclusive, + printInclusive: printInclusive, + printWasted: printWasted, + printOperations: printOperations, + start: start, + stop: stop, + isRunning: isRunning, + + printDOM: printDOM, + getMeasurementsSummaryMap: getMeasurementsSummaryMap +}; + +module.exports = ReactPerfAnalysis; +}, 388, null, "ReactPerf"); +__d(/* AsyncStorage */function(global, require, module, exports) { +'use strict'; + +var NativeModules = require(80 ); // 80 = NativeModules +var RCTAsyncSQLiteStorage = NativeModules.AsyncSQLiteDBStorage; +var RCTAsyncRocksDBStorage = NativeModules.AsyncRocksDBStorage; +var RCTAsyncFileStorage = NativeModules.AsyncLocalStorage; + +var RCTAsyncStorage = RCTAsyncRocksDBStorage || RCTAsyncSQLiteStorage || RCTAsyncFileStorage; + +var AsyncStorage = { + _getRequests: [], + _getKeys: [], + _immediate: null, + + getItem: function getItem(key, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiGet([key], function (errors, result) { + var value = result && result[0] && result[0][1] ? result[0][1] : null; + var errs = convertErrors(errors); + callback && callback(errs && errs[0], value); + if (errs) { + reject(errs[0]); + } else { + resolve(value); + } + }); + }); + }, + + setItem: function setItem(key, value, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiSet([[key, value]], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + if (errs) { + reject(errs[0]); + } else { + resolve(null); + } + }); + }); + }, + + removeItem: function removeItem(key, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiRemove([key], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + if (errs) { + reject(errs[0]); + } else { + resolve(null); + } + }); + }); + }, + + mergeItem: function mergeItem(key, value, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiMerge([[key, value]], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + if (errs) { + reject(errs[0]); + } else { + resolve(null); + } + }); + }); + }, + + clear: function clear(callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.clear(function (error) { + callback && callback(convertError(error)); + if (error && convertError(error)) { + reject(convertError(error)); + } else { + resolve(null); + } + }); + }); + }, + + getAllKeys: function getAllKeys(callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.getAllKeys(function (error, keys) { + callback && callback(convertError(error), keys); + if (error) { + reject(convertError(error)); + } else { + resolve(keys); + } + }); + }); + }, + + flushGetRequests: function flushGetRequests() { + var getRequests = this._getRequests; + var getKeys = this._getKeys; + + this._getRequests = []; + this._getKeys = []; + + RCTAsyncStorage.multiGet(getKeys, function (errors, result) { + var map = {}; + result && result.forEach(function (_ref) { + var _ref2 = babelHelpers.slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + map[key] = value;return value; + }); + var reqLength = getRequests.length; + for (var i = 0; i < reqLength; i++) { + var request = getRequests[i]; + var requestKeys = request.keys; + var requestResult = requestKeys.map(function (key) { + return [key, map[key]]; + }); + request.callback && request.callback(null, requestResult); + request.resolve && request.resolve(requestResult); + } + }); + }, + + multiGet: function multiGet(keys, callback) { + var _this = this; + + if (!this._immediate) { + this._immediate = setImmediate(function () { + _this._immediate = null; + _this.flushGetRequests(); + }); + } + + var getRequest = { + keys: keys, + callback: callback, + + keyIndex: this._getKeys.length, + resolve: null, + reject: null + }; + + var promiseResult = new Promise(function (resolve, reject) { + getRequest.resolve = resolve; + getRequest.reject = reject; + }); + + this._getRequests.push(getRequest); + + keys.forEach(function (key) { + if (_this._getKeys.indexOf(key) === -1) { + _this._getKeys.push(key); + } + }); + + return promiseResult; + }, + + multiSet: function multiSet(keyValuePairs, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiSet(keyValuePairs, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + if (error) { + reject(error); + } else { + resolve(null); + } + }); + }); + }, + + multiRemove: function multiRemove(keys, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiRemove(keys, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + if (error) { + reject(error); + } else { + resolve(null); + } + }); + }); + }, + + multiMerge: function multiMerge(keyValuePairs, callback) { + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiMerge(keyValuePairs, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + if (error) { + reject(error); + } else { + resolve(null); + } + }); + }); + } +}; + +if (!RCTAsyncStorage.multiMerge) { + delete AsyncStorage.mergeItem; + delete AsyncStorage.multiMerge; +} + +function convertErrors(errs) { + if (!errs) { + return null; + } + return (Array.isArray(errs) ? errs : [errs]).map(function (e) { + return convertError(e); + }); +} + +function convertError(error) { + if (!error) { + return null; + } + var out = new Error(error.message); + out.key = error.key; + return out; +} + +module.exports = AsyncStorage; +}, 389, null, "AsyncStorage"); +__d(/* CameraRoll */function(global, require, module, exports) { +'use strict'; + +var ReactPropTypes = require(126 ).PropTypes; // 126 = React +var RCTCameraRollManager = require(80 ).CameraRollManager; // 80 = NativeModules + +var createStrictShapeTypeChecker = require(148 ); // 148 = createStrictShapeTypeChecker +var deepFreezeAndThrowOnMutationInDev = require(96 ); // 96 = deepFreezeAndThrowOnMutationInDev +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var GROUP_TYPES_OPTIONS = ['Album', 'All', 'Event', 'Faces', 'Library', 'PhotoStream', 'SavedPhotos']; + +var ASSET_TYPE_OPTIONS = ['All', 'Videos', 'Photos']; + +deepFreezeAndThrowOnMutationInDev(GROUP_TYPES_OPTIONS); +deepFreezeAndThrowOnMutationInDev(ASSET_TYPE_OPTIONS); + +var getPhotosParamChecker = createStrictShapeTypeChecker({ + first: ReactPropTypes.number.isRequired, + + after: ReactPropTypes.string, + + groupTypes: ReactPropTypes.oneOf(GROUP_TYPES_OPTIONS), + + groupName: ReactPropTypes.string, + + assetType: ReactPropTypes.oneOf(ASSET_TYPE_OPTIONS), + + mimeTypes: ReactPropTypes.arrayOf(ReactPropTypes.string) +}); + +var getPhotosReturnChecker = createStrictShapeTypeChecker({ + edges: ReactPropTypes.arrayOf(createStrictShapeTypeChecker({ + node: createStrictShapeTypeChecker({ + type: ReactPropTypes.string.isRequired, + group_name: ReactPropTypes.string.isRequired, + image: createStrictShapeTypeChecker({ + uri: ReactPropTypes.string.isRequired, + height: ReactPropTypes.number.isRequired, + width: ReactPropTypes.number.isRequired, + isStored: ReactPropTypes.bool + }).isRequired, + timestamp: ReactPropTypes.number.isRequired, + location: createStrictShapeTypeChecker({ + latitude: ReactPropTypes.number, + longitude: ReactPropTypes.number, + altitude: ReactPropTypes.number, + heading: ReactPropTypes.number, + speed: ReactPropTypes.number + }) + }).isRequired + })).isRequired, + page_info: createStrictShapeTypeChecker({ + has_next_page: ReactPropTypes.bool.isRequired, + start_cursor: ReactPropTypes.string, + end_cursor: ReactPropTypes.string + }).isRequired +}); + +var CameraRoll = function () { + function CameraRoll() { + babelHelpers.classCallCheck(this, CameraRoll); + } + + babelHelpers.createClass(CameraRoll, null, [{ + key: 'saveImageWithTag', + value: function saveImageWithTag(tag) { + console.warn('CameraRoll.saveImageWithTag is deprecated. Use CameraRoll.saveToCameraRoll instead'); + return this.saveToCameraRoll(tag, 'photo'); + } + }, { + key: 'saveToCameraRoll', + value: function saveToCameraRoll(tag, type) { + invariant(typeof tag === 'string', 'CameraRoll.saveToCameraRoll must be a valid string.'); + + invariant(type === 'photo' || type === 'video' || type === undefined, 'The second argument to saveToCameraRoll must be \'photo\' or \'video\'. You passed ' + type); + + var mediaType = 'photo'; + if (type) { + mediaType = type; + } else if (['mov', 'mp4'].indexOf(tag.split('.').slice(-1)[0]) >= 0) { + mediaType = 'video'; + } + + return RCTCameraRollManager.saveToCameraRoll(tag, mediaType); + } + }, { + key: 'getPhotos', + value: function getPhotos(params) { + if (__DEV__) { + getPhotosParamChecker({ params: params }, 'params', 'CameraRoll.getPhotos'); + } + if (arguments.length > 1) { + console.warn('CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead'); + var successCallback = arguments[1]; + if (__DEV__) { + var callback = arguments[1]; + successCallback = function successCallback(response) { + getPhotosReturnChecker({ response: response }, 'response', 'CameraRoll.getPhotos callback'); + callback(response); + }; + } + var errorCallback = arguments[2] || function () {}; + RCTCameraRollManager.getPhotos(params).then(successCallback, errorCallback); + } + + return RCTCameraRollManager.getPhotos(params); + } + }]); + return CameraRoll; +}(); + +CameraRoll.GroupTypesOptions = GROUP_TYPES_OPTIONS; +CameraRoll.AssetTypeOptions = ASSET_TYPE_OPTIONS; + +module.exports = CameraRoll; +}, 390, null, "CameraRoll"); +__d(/* Clipboard */function(global, require, module, exports) { +'use strict'; + +var Clipboard = require(80 ).Clipboard; // 80 = NativeModules + +module.exports = { + getString: function getString() { + return Clipboard.getString(); + }, + setString: function setString(content) { + Clipboard.setString(content); + } +}; +}, 391, null, "Clipboard"); +__d(/* DatePickerAndroid */function(global, require, module, exports) { +'use strict'; + +var DatePickerAndroid = { + open: function open(options) { + return regeneratorRuntime.async(function open$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt('return', Promise.reject({ + message: 'DatePickerAndroid is not supported on this platform.' + })); + + case 1: + case 'end': + return _context.stop(); + } + } + }, null, this); + } +}; + +module.exports = DatePickerAndroid; +}, 392, null, "DatePickerAndroid"); +__d(/* ImagePickerIOS */function(global, require, module, exports) { +'use strict'; + +var RCTImagePicker = require(80 ).ImagePickerIOS; // 80 = NativeModules + +var ImagePickerIOS = { + canRecordVideos: function canRecordVideos(callback) { + return RCTImagePicker.canRecordVideos(callback); + }, + canUseCamera: function canUseCamera(callback) { + return RCTImagePicker.canUseCamera(callback); + }, + openCameraDialog: function openCameraDialog(config, successCallback, cancelCallback) { + config = babelHelpers.extends({ + videoMode: false + }, config); + return RCTImagePicker.openCameraDialog(config, successCallback, cancelCallback); + }, + openSelectDialog: function openSelectDialog(config, successCallback, cancelCallback) { + config = babelHelpers.extends({ + showImages: true, + showVideos: false + }, config); + return RCTImagePicker.openSelectDialog(config, successCallback, cancelCallback); + } +}; + +module.exports = ImagePickerIOS; +}, 393, null, "ImagePickerIOS"); +__d(/* Linking */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var NativeModules = require(80 ); // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var LinkingManager = Platform.OS === 'android' ? NativeModules.IntentAndroid : NativeModules.LinkingManager; + +var Linking = function (_NativeEventEmitter) { + babelHelpers.inherits(Linking, _NativeEventEmitter); + + function Linking() { + babelHelpers.classCallCheck(this, Linking); + return babelHelpers.possibleConstructorReturn(this, (Linking.__proto__ || Object.getPrototypeOf(Linking)).call(this, LinkingManager)); + } + + babelHelpers.createClass(Linking, [{ + key: 'addEventListener', + value: function addEventListener(type, handler) { + this.addListener(type, handler); + } + }, { + key: 'removeEventListener', + value: function removeEventListener(type, handler) { + this.removeListener(type, handler); + } + }, { + key: 'openURL', + value: function openURL(url) { + this._validateURL(url); + return LinkingManager.openURL(url); + } + }, { + key: 'canOpenURL', + value: function canOpenURL(url) { + this._validateURL(url); + return LinkingManager.canOpenURL(url); + } + }, { + key: 'getInitialURL', + value: function getInitialURL() { + return LinkingManager.getInitialURL(); + } + }, { + key: '_validateURL', + value: function _validateURL(url) { + invariant(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url); + invariant(url, 'Invalid URL: cannot be empty'); + } + }]); + return Linking; +}(NativeEventEmitter); + +module.exports = new Linking(); +}, 394, null, "Linking"); +__d(/* NavigationExperimental */function(global, require, module, exports) { +'use strict'; + +var NavigationCard = require(396 ); // 396 = NavigationCard +var NavigationCardStack = require(405 ); // 405 = NavigationCardStack +var NavigationHeader = require(408 ); // 408 = NavigationHeader +var NavigationPropTypes = require(404 ); // 404 = NavigationPropTypes +var NavigationStateUtils = require(415 ); // 415 = NavigationStateUtils +var NavigationTransitioner = require(406 ); // 406 = NavigationTransitioner + +var NavigationExperimental = { + StateUtils: NavigationStateUtils, + + Transitioner: NavigationTransitioner, + + Card: NavigationCard, + CardStack: NavigationCardStack, + Header: NavigationHeader, + + PropTypes: NavigationPropTypes +}; + +module.exports = NavigationExperimental; +}, 395, null, "NavigationExperimental"); +__d(/* NavigationCard */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCard.js'; +var Animated = require(219 ); // 219 = Animated +var NavigationCardStackPanResponder = require(397 ); // 397 = NavigationCardStackPanResponder +var NavigationCardStackStyleInterpolator = require(399 ); // 399 = NavigationCardStackStyleInterpolator +var NavigationPagerPanResponder = require(400 ); // 400 = NavigationPagerPanResponder +var NavigationPagerStyleInterpolator = require(401 ); // 401 = NavigationPagerStyleInterpolator +var NavigationPointerEventsContainer = require(402 ); // 402 = NavigationPointerEventsContainer +var NavigationPropTypes = require(404 ); // 404 = NavigationPropTypes +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet + +var PropTypes = React.PropTypes; + +var NavigationCard = function (_React$Component) { + babelHelpers.inherits(NavigationCard, _React$Component); + + function NavigationCard() { + babelHelpers.classCallCheck(this, NavigationCard); + return babelHelpers.possibleConstructorReturn(this, (NavigationCard.__proto__ || Object.getPrototypeOf(NavigationCard)).apply(this, arguments)); + } + + babelHelpers.createClass(NavigationCard, [{ + key: 'render', + value: function render() { + var _props = this.props, + panHandlers = _props.panHandlers, + pointerEvents = _props.pointerEvents, + renderScene = _props.renderScene, + style = _props.style, + props = babelHelpers.objectWithoutProperties(_props, ['panHandlers', 'pointerEvents', 'renderScene', 'style']); + + + var viewStyle = style === undefined ? NavigationCardStackStyleInterpolator.forHorizontal(props) : style; + + var viewPanHandlers = panHandlers === undefined ? NavigationCardStackPanResponder.forHorizontal(babelHelpers.extends({}, props, { + onNavigateBack: this.props.onNavigateBack + })) : panHandlers; + + return React.createElement( + Animated.View, + babelHelpers.extends({}, viewPanHandlers, { + pointerEvents: pointerEvents, + ref: this.props.onComponentRef, + style: [styles.main, viewStyle], __source: { + fileName: _jsxFileName, + lineNumber: 99 + } + }), + renderScene(props) + ); + } + }]); + return NavigationCard; +}(React.Component); + +NavigationCard.propTypes = babelHelpers.extends({}, NavigationPropTypes.SceneRendererProps, { + onComponentRef: PropTypes.func.isRequired, + onNavigateBack: PropTypes.func, + panHandlers: NavigationPropTypes.panHandlers, + pointerEvents: PropTypes.string.isRequired, + renderScene: PropTypes.func.isRequired, + style: PropTypes.any +}); + + +var styles = StyleSheet.create({ + main: { + backgroundColor: '#E9E9EF', + bottom: 0, + left: 0, + position: 'absolute', + right: 0, + shadowColor: 'black', + shadowOffset: { width: 0, height: 0 }, + shadowOpacity: 0.4, + shadowRadius: 10, + top: 0 + } +}); + +NavigationCard = NavigationPointerEventsContainer.create(NavigationCard); + +NavigationCard.CardStackPanResponder = NavigationCardStackPanResponder; +NavigationCard.CardStackStyleInterpolator = NavigationCardStackStyleInterpolator; +NavigationCard.PagerPanResponder = NavigationPagerPanResponder; +NavigationCard.PagerStyleInterpolator = NavigationPagerStyleInterpolator; + +module.exports = NavigationCard; +}, 396, null, "NavigationCard"); +__d(/* NavigationCardStackPanResponder */function(global, require, module, exports) { +'use strict'; + +var Animated = require(219 ); // 219 = Animated +var I18nManager = require(331 ); // 331 = I18nManager +var NavigationAbstractPanResponder = require(398 ); // 398 = NavigationAbstractPanResponder + +var clamp = require(348 ); // 348 = clamp + +var emptyFunction = function emptyFunction() {}; + +var ANIMATION_DURATION = 250; + +var POSITION_THRESHOLD = 1 / 3; + +var RESPOND_THRESHOLD = 15; + +var DISTANCE_THRESHOLD = 100; + +var Directions = { + 'HORIZONTAL': 'horizontal', + 'VERTICAL': 'vertical' +}; + +var NavigationCardStackPanResponder = function (_NavigationAbstractPa) { + babelHelpers.inherits(NavigationCardStackPanResponder, _NavigationAbstractPa); + + function NavigationCardStackPanResponder(direction, props) { + babelHelpers.classCallCheck(this, NavigationCardStackPanResponder); + + var _this = babelHelpers.possibleConstructorReturn(this, (NavigationCardStackPanResponder.__proto__ || Object.getPrototypeOf(NavigationCardStackPanResponder)).call(this)); + + _this._isResponding = false; + _this._isVertical = direction === Directions.VERTICAL; + _this._props = props; + _this._startValue = 0; + + _this._addNativeListener(_this._props.layout.width); + _this._addNativeListener(_this._props.layout.height); + _this._addNativeListener(_this._props.position); + return _this; + } + + babelHelpers.createClass(NavigationCardStackPanResponder, [{ + key: 'onMoveShouldSetPanResponder', + value: function onMoveShouldSetPanResponder(event, gesture) { + var props = this._props; + + if (props.navigationState.index !== props.scene.index) { + return false; + } + + var layout = props.layout; + var isVertical = this._isVertical; + var index = props.navigationState.index; + var currentDragDistance = gesture[isVertical ? 'dy' : 'dx']; + var currentDragPosition = gesture[isVertical ? 'moveY' : 'moveX']; + var maxDragDistance = isVertical ? layout.height.__getValue() : layout.width.__getValue(); + + var positionMax = isVertical ? props.gestureResponseDistance : props.gestureResponseDistance || 30; + + if (positionMax != null && currentDragPosition > positionMax) { + return false; + } + + return Math.abs(currentDragDistance) > RESPOND_THRESHOLD && maxDragDistance > 0 && index > 0; + } + }, { + key: 'onPanResponderGrant', + value: function onPanResponderGrant() { + var _this2 = this; + + this._isResponding = false; + this._props.position.stopAnimation(function (value) { + _this2._isResponding = true; + _this2._startValue = value; + }); + } + }, { + key: 'onPanResponderMove', + value: function onPanResponderMove(event, gesture) { + if (!this._isResponding) { + return; + } + + var props = this._props; + var layout = props.layout; + var isVertical = this._isVertical; + var axis = isVertical ? 'dy' : 'dx'; + var index = props.navigationState.index; + var distance = isVertical ? layout.height.__getValue() : layout.width.__getValue(); + var currentValue = I18nManager.isRTL && axis === 'dx' ? this._startValue + gesture[axis] / distance : this._startValue - gesture[axis] / distance; + + var value = clamp(index - 1, currentValue, index); + + props.position.setValue(value); + } + }, { + key: 'onPanResponderRelease', + value: function onPanResponderRelease(event, gesture) { + var _this3 = this; + + if (!this._isResponding) { + return; + } + + this._isResponding = false; + + var props = this._props; + var isVertical = this._isVertical; + var axis = isVertical ? 'dy' : 'dx'; + var index = props.navigationState.index; + var distance = I18nManager.isRTL && axis === 'dx' ? -gesture[axis] : gesture[axis]; + + props.position.stopAnimation(function (value) { + _this3._reset(); + + if (!props.onNavigateBack) { + return; + } + + if (distance > DISTANCE_THRESHOLD || value <= index - POSITION_THRESHOLD) { + props.onNavigateBack(); + } + }); + } + }, { + key: 'onPanResponderTerminate', + value: function onPanResponderTerminate() { + this._isResponding = false; + this._reset(); + } + }, { + key: '_reset', + value: function _reset() { + var props = this._props; + Animated.timing(props.position, { + toValue: props.navigationState.index, + duration: ANIMATION_DURATION, + useNativeDriver: props.position.__isNative + }).start(); + } + }, { + key: '_addNativeListener', + value: function _addNativeListener(animatedValue) { + if (!animatedValue.__isNative) { + return; + } + + if (Object.keys(animatedValue._listeners).length === 0) { + animatedValue.addListener(emptyFunction); + } + } + }]); + return NavigationCardStackPanResponder; +}(NavigationAbstractPanResponder); + +function createPanHandlers(direction, props) { + var responder = new NavigationCardStackPanResponder(direction, props); + return responder.panHandlers; +} + +function forHorizontal(props) { + return createPanHandlers(Directions.HORIZONTAL, props); +} + +function forVertical(props) { + return createPanHandlers(Directions.VERTICAL, props); +} + +module.exports = { + ANIMATION_DURATION: ANIMATION_DURATION, + DISTANCE_THRESHOLD: DISTANCE_THRESHOLD, + POSITION_THRESHOLD: POSITION_THRESHOLD, + RESPOND_THRESHOLD: RESPOND_THRESHOLD, + + Directions: Directions, + + forHorizontal: forHorizontal, + forVertical: forVertical +}; +}, 397, null, "NavigationCardStackPanResponder"); +__d(/* NavigationAbstractPanResponder */function(global, require, module, exports) { +'use strict'; + +var PanResponder = require(346 ); // 346 = PanResponder + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var EmptyPanHandlers = { + onMoveShouldSetPanResponder: null, + onPanResponderGrant: null, + onPanResponderMove: null, + onPanResponderRelease: null, + onPanResponderTerminate: null +}; + +var NavigationAbstractPanResponder = function NavigationAbstractPanResponder() { + var _this = this; + + babelHelpers.classCallCheck(this, NavigationAbstractPanResponder); + + var config = {}; + Object.keys(EmptyPanHandlers).forEach(function (name) { + var fn = _this[name]; + + invariant(typeof fn === 'function', 'subclass of `NavigationAbstractPanResponder` must implement method %s', name); + + config[name] = fn.bind(_this); + }, this); + + this.panHandlers = PanResponder.create(config).panHandlers; +}; + +module.exports = NavigationAbstractPanResponder; +}, 398, null, "NavigationAbstractPanResponder"); +__d(/* NavigationCardStackStyleInterpolator */function(global, require, module, exports) { +'use strict'; + +var I18nManager = require(331 ); // 331 = I18nManager + +function forInitial(props) { + var navigationState = props.navigationState, + scene = props.scene; + + + var focused = navigationState.index === scene.index; + var opacity = focused ? 1 : 0; + + var translate = focused ? 0 : 1000000; + return { + opacity: opacity, + transform: [{ translateX: translate }, { translateY: translate }] + }; +} + +function forHorizontal(props) { + var layout = props.layout, + position = props.position, + scene = props.scene; + + + if (!layout.isMeasured) { + return forInitial(props); + } + + var index = scene.index; + var inputRange = [index - 1, index, index + 0.99, index + 1]; + var width = layout.initWidth; + var outputRange = I18nManager.isRTL ? [-width, 0, 10, 10] : [width, 0, -10, -10]; + + var opacity = position.interpolate({ + inputRange: inputRange, + outputRange: [1, 1, 0.3, 0] + }); + + var scale = position.interpolate({ + inputRange: inputRange, + outputRange: [1, 1, 0.95, 0.95] + }); + + var translateY = 0; + var translateX = position.interpolate({ + inputRange: inputRange, + outputRange: outputRange + }); + + return { + opacity: opacity, + transform: [{ scale: scale }, { translateX: translateX }, { translateY: translateY }] + }; +} + +function forVertical(props) { + var layout = props.layout, + position = props.position, + scene = props.scene; + + + if (!layout.isMeasured) { + return forInitial(props); + } + + var index = scene.index; + var inputRange = [index - 1, index, index + 0.99, index + 1]; + var height = layout.initHeight; + + var opacity = position.interpolate({ + inputRange: inputRange, + outputRange: [1, 1, 0.3, 0] + }); + + var scale = position.interpolate({ + inputRange: inputRange, + outputRange: [1, 1, 0.95, 0.95] + }); + + var translateX = 0; + var translateY = position.interpolate({ + inputRange: inputRange, + outputRange: [height, 0, -10, -10] + }); + + return { + opacity: opacity, + transform: [{ scale: scale }, { translateX: translateX }, { translateY: translateY }] + }; +} + +function canUseNativeDriver(isVertical) { + + return true; +} + +module.exports = { + forHorizontal: forHorizontal, + forVertical: forVertical, + canUseNativeDriver: canUseNativeDriver +}; +}, 399, null, "NavigationCardStackStyleInterpolator"); +__d(/* NavigationPagerPanResponder */function(global, require, module, exports) { +'use strict'; + +var Animated = require(219 ); // 219 = Animated +var NavigationAbstractPanResponder = require(398 ); // 398 = NavigationAbstractPanResponder +var NavigationCardStackPanResponder = require(397 ); // 397 = NavigationCardStackPanResponder +var I18nManager = require(331 ); // 331 = I18nManager + +var clamp = require(348 ); // 348 = clamp + +var ANIMATION_DURATION = NavigationCardStackPanResponder.ANIMATION_DURATION, + POSITION_THRESHOLD = NavigationCardStackPanResponder.POSITION_THRESHOLD, + RESPOND_THRESHOLD = NavigationCardStackPanResponder.RESPOND_THRESHOLD, + Directions = NavigationCardStackPanResponder.Directions; + +var DISTANCE_THRESHOLD = 50; + +var VELOCITY_THRESHOLD = 1.5; + +var NavigationPagerPanResponder = function (_NavigationAbstractPa) { + babelHelpers.inherits(NavigationPagerPanResponder, _NavigationAbstractPa); + + function NavigationPagerPanResponder(direction, props) { + babelHelpers.classCallCheck(this, NavigationPagerPanResponder); + + var _this = babelHelpers.possibleConstructorReturn(this, (NavigationPagerPanResponder.__proto__ || Object.getPrototypeOf(NavigationPagerPanResponder)).call(this)); + + _this._isResponding = false; + _this._isVertical = direction === Directions.VERTICAL; + _this._props = props; + _this._startValue = 0; + return _this; + } + + babelHelpers.createClass(NavigationPagerPanResponder, [{ + key: 'onMoveShouldSetPanResponder', + value: function onMoveShouldSetPanResponder(event, gesture) { + var props = this._props; + + if (props.navigationState.index !== props.scene.index) { + return false; + } + + var layout = props.layout; + var isVertical = this._isVertical; + var axis = isVertical ? 'dy' : 'dx'; + var index = props.navigationState.index; + var distance = isVertical ? layout.height.__getValue() : layout.width.__getValue(); + + return Math.abs(gesture[axis]) > RESPOND_THRESHOLD && distance > 0 && index >= 0; + } + }, { + key: 'onPanResponderGrant', + value: function onPanResponderGrant() { + var _this2 = this; + + this._isResponding = false; + this._props.position.stopAnimation(function (value) { + _this2._isResponding = true; + _this2._startValue = value; + }); + } + }, { + key: 'onPanResponderMove', + value: function onPanResponderMove(event, gesture) { + if (!this._isResponding) { + return; + } + + var _props = this._props, + layout = _props.layout, + navigationState = _props.navigationState, + position = _props.position, + scenes = _props.scenes; + + + var isVertical = this._isVertical; + var axis = isVertical ? 'dy' : 'dx'; + var index = navigationState.index; + var distance = isVertical ? layout.height.__getValue() : layout.width.__getValue(); + var currentValue = I18nManager.isRTL && axis === 'dx' ? this._startValue + gesture[axis] / distance : this._startValue - gesture[axis] / distance; + + var prevIndex = Math.max(0, index - 1); + + var nextIndex = Math.min(index + 1, scenes.length - 1); + + var value = clamp(prevIndex, currentValue, nextIndex); + + position.setValue(value); + } + }, { + key: 'onPanResponderRelease', + value: function onPanResponderRelease(event, gesture) { + var _this3 = this; + + if (!this._isResponding) { + return; + } + + this._isResponding = false; + + var _props2 = this._props, + navigationState = _props2.navigationState, + onNavigateBack = _props2.onNavigateBack, + onNavigateForward = _props2.onNavigateForward, + position = _props2.position; + + + var isVertical = this._isVertical; + var axis = isVertical ? 'dy' : 'dx'; + var velocityAxis = isVertical ? 'vy' : 'vx'; + var index = navigationState.index; + var distance = I18nManager.isRTL && axis === 'dx' ? -gesture[axis] : gesture[axis]; + var moveSpeed = I18nManager.isRTL && velocityAxis === 'vx' ? -gesture[velocityAxis] : gesture[velocityAxis]; + + position.stopAnimation(function (value) { + _this3._reset(); + if (distance > DISTANCE_THRESHOLD || value <= index - POSITION_THRESHOLD || moveSpeed > VELOCITY_THRESHOLD) { + onNavigateBack && onNavigateBack(); + return; + } + + if (distance < -DISTANCE_THRESHOLD || value >= index + POSITION_THRESHOLD || moveSpeed < -VELOCITY_THRESHOLD) { + onNavigateForward && onNavigateForward(); + } + }); + } + }, { + key: 'onPanResponderTerminate', + value: function onPanResponderTerminate() { + this._isResponding = false; + this._reset(); + } + }, { + key: '_reset', + value: function _reset() { + var props = this._props; + Animated.timing(props.position, { + toValue: props.navigationState.index, + duration: ANIMATION_DURATION + }).start(); + } + }]); + return NavigationPagerPanResponder; +}(NavigationAbstractPanResponder); + +function createPanHandlers(direction, props) { + var responder = new NavigationPagerPanResponder(direction, props); + return responder.panHandlers; +} + +function forHorizontal(props) { + return createPanHandlers(Directions.HORIZONTAL, props); +} + +module.exports = { + forHorizontal: forHorizontal +}; +}, 400, null, "NavigationPagerPanResponder"); +__d(/* NavigationPagerStyleInterpolator */function(global, require, module, exports) { +'use strict'; + +var I18nManager = require(331 ); // 331 = I18nManager + +function forInitial(props) { + var navigationState = props.navigationState, + scene = props.scene; + + + var focused = navigationState.index === scene.index; + var opacity = focused ? 1 : 0; + + var dir = scene.index > navigationState.index ? 1 : -1; + var translate = focused ? 0 : 1000000 * dir; + return { + opacity: opacity, + transform: [{ translateX: translate }, { translateY: translate }] + }; +} + +function forHorizontal(props) { + var layout = props.layout, + position = props.position, + scene = props.scene; + + + if (!layout.isMeasured) { + return forInitial(props); + } + + var index = scene.index; + var inputRange = [index - 1, index, index + 1]; + var width = layout.initWidth; + var outputRange = I18nManager.isRTL ? [-width, 0, width] : [width, 0, -width]; + + var translateX = position.interpolate({ + inputRange: inputRange, + outputRange: outputRange + }); + + return { + opacity: 1, + shadowColor: 'transparent', + shadowRadius: 0, + transform: [{ scale: 1 }, { translateX: translateX }, { translateY: 0 }] + }; +} + +module.exports = { + forHorizontal: forHorizontal +}; +}, 401, null, "NavigationPagerStyleInterpolator"); +__d(/* NavigationPointerEventsContainer */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPointerEventsContainer.js'; +var React = require(126 ); // 126 = React +var NavigationAnimatedValueSubscription = require(403 ); // 403 = NavigationAnimatedValueSubscription + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var MIN_POSITION_OFFSET = 0.01; + +function create(Component) { + var Container = function (_React$Component) { + babelHelpers.inherits(Container, _React$Component); + + function Container(props, context) { + babelHelpers.classCallCheck(this, Container); + + var _this = babelHelpers.possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props, context)); + + _this._pointerEvents = _this._computePointerEvents(); + return _this; + } + + babelHelpers.createClass(Container, [{ + key: 'componentWillMount', + value: function componentWillMount() { + this._onPositionChange = this._onPositionChange.bind(this); + this._onComponentRef = this._onComponentRef.bind(this); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this._bindPosition(this.props); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this._positionListener && this._positionListener.remove(); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + this._bindPosition(nextProps); + } + }, { + key: 'render', + value: function render() { + this._pointerEvents = this._computePointerEvents(); + return React.createElement(Component, babelHelpers.extends({}, this.props, { + pointerEvents: this._pointerEvents, + onComponentRef: this._onComponentRef, + __source: { + fileName: _jsxFileName, + lineNumber: 92 + } + })); + } + }, { + key: '_onComponentRef', + value: function _onComponentRef(component) { + this._component = component; + if (component) { + invariant(typeof component.setNativeProps === 'function', 'component must implement method `setNativeProps`'); + } + } + }, { + key: '_bindPosition', + value: function _bindPosition(props) { + this._positionListener && this._positionListener.remove(); + this._positionListener = new NavigationAnimatedValueSubscription(props.position, this._onPositionChange); + } + }, { + key: '_onPositionChange', + value: function _onPositionChange() { + if (this._component) { + var pointerEvents = this._computePointerEvents(); + if (this._pointerEvents !== pointerEvents) { + this._pointerEvents = pointerEvents; + this._component.setNativeProps({ pointerEvents: pointerEvents }); + } + } + } + }, { + key: '_computePointerEvents', + value: function _computePointerEvents() { + var _props = this.props, + navigationState = _props.navigationState, + position = _props.position, + scene = _props.scene; + + + if (scene.isStale || navigationState.index !== scene.index) { + return scene.index > navigationState.index ? 'box-only' : 'none'; + } + + var offset = position.__getAnimatedValue() - navigationState.index; + if (Math.abs(offset) > MIN_POSITION_OFFSET) { + return 'box-only'; + } + + return 'auto'; + } + }]); + return Container; + }(React.Component); + + return Container; +} + +module.exports = { + create: create +}; +}, 402, null, "NavigationPointerEventsContainer"); +__d(/* NavigationAnimatedValueSubscription */function(global, require, module, exports) { +'use strict'; + +var NavigationAnimatedValueSubscription = function () { + function NavigationAnimatedValueSubscription(value, callback) { + babelHelpers.classCallCheck(this, NavigationAnimatedValueSubscription); + + this._value = value; + this._token = value.addListener(callback); + } + + babelHelpers.createClass(NavigationAnimatedValueSubscription, [{ + key: 'remove', + value: function remove() { + this._value.removeListener(this._token); + } + }]); + return NavigationAnimatedValueSubscription; +}(); + +module.exports = NavigationAnimatedValueSubscription; +}, 403, null, "NavigationAnimatedValueSubscription"); +__d(/* NavigationPropTypes */function(global, require, module, exports) { +'use strict'; + +var Animated = require(219 ); // 219 = Animated +var React = require(126 ); // 126 = React + +var PropTypes = React.PropTypes; + +var action = PropTypes.shape({ + type: PropTypes.string.isRequired +}); + +var animatedValue = PropTypes.instanceOf(Animated.Value); + +var navigationRoute = PropTypes.shape({ + key: PropTypes.string.isRequired +}); + +var navigationState = PropTypes.shape({ + index: PropTypes.number.isRequired, + routes: PropTypes.arrayOf(navigationRoute) +}); + +var layout = PropTypes.shape({ + height: animatedValue, + initHeight: PropTypes.number.isRequired, + initWidth: PropTypes.number.isRequired, + isMeasured: PropTypes.bool.isRequired, + width: animatedValue +}); + +var scene = PropTypes.shape({ + index: PropTypes.number.isRequired, + isActive: PropTypes.bool.isRequired, + isStale: PropTypes.bool.isRequired, + key: PropTypes.string.isRequired, + route: navigationRoute.isRequired +}); + +var SceneRendererProps = { + layout: layout.isRequired, + navigationState: navigationState.isRequired, + position: animatedValue.isRequired, + progress: animatedValue.isRequired, + scene: scene.isRequired, + scenes: PropTypes.arrayOf(scene).isRequired +}; + +var SceneRenderer = PropTypes.shape(SceneRendererProps); + +var panHandlers = PropTypes.shape({ + onMoveShouldSetResponder: PropTypes.func.isRequired, + onMoveShouldSetResponderCapture: PropTypes.func.isRequired, + onResponderEnd: PropTypes.func.isRequired, + onResponderGrant: PropTypes.func.isRequired, + onResponderMove: PropTypes.func.isRequired, + onResponderReject: PropTypes.func.isRequired, + onResponderRelease: PropTypes.func.isRequired, + onResponderStart: PropTypes.func.isRequired, + onResponderTerminate: PropTypes.func.isRequired, + onResponderTerminationRequest: PropTypes.func.isRequired, + onStartShouldSetResponder: PropTypes.func.isRequired, + onStartShouldSetResponderCapture: PropTypes.func.isRequired +}); + +function extractSceneRendererProps(props) { + return { + layout: props.layout, + navigationState: props.navigationState, + position: props.position, + progress: props.progress, + scene: props.scene, + scenes: props.scenes + }; +} + +module.exports = { + extractSceneRendererProps: extractSceneRendererProps, + + SceneRendererProps: SceneRendererProps, + + SceneRenderer: SceneRenderer, + action: action, + navigationState: navigationState, + navigationRoute: navigationRoute, + panHandlers: panHandlers +}; +}, 404, null, "NavigationPropTypes"); +__d(/* NavigationCardStack */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js'; +var NativeAnimatedModule = require(80 ).NativeAnimatedModule; // 80 = NativeModules +var NavigationCard = require(396 ); // 396 = NavigationCard +var NavigationCardStackPanResponder = require(397 ); // 397 = NavigationCardStackPanResponder +var NavigationCardStackStyleInterpolator = require(399 ); // 399 = NavigationCardStackStyleInterpolator +var NavigationPropTypes = require(404 ); // 404 = NavigationPropTypes +var NavigationTransitioner = require(406 ); // 406 = NavigationTransitioner +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var PropTypes = React.PropTypes; +var Directions = NavigationCardStackPanResponder.Directions; + +var NavigationCardStack = function (_React$Component) { + babelHelpers.inherits(NavigationCardStack, _React$Component); + + function NavigationCardStack(props, context) { + babelHelpers.classCallCheck(this, NavigationCardStack); + + var _this = babelHelpers.possibleConstructorReturn(this, (NavigationCardStack.__proto__ || Object.getPrototypeOf(NavigationCardStack)).call(this, props, context)); + + _this._configureTransition = function () { + var isVertical = _this.props.direction === 'vertical'; + var animationConfig = {}; + if (!!NativeAnimatedModule && !_this.props.enableGestures && NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical)) { + animationConfig.useNativeDriver = true; + } + return animationConfig; + }; + + return _this; + } + + babelHelpers.createClass(NavigationCardStack, [{ + key: 'componentWillMount', + value: function componentWillMount() { + this._render = this._render.bind(this); + this._renderScene = this._renderScene.bind(this); + } + }, { + key: 'render', + value: function render() { + return React.createElement(NavigationTransitioner, { + configureTransition: this._configureTransition, + navigationState: this.props.navigationState, + render: this._render, + style: this.props.style, + __source: { + fileName: _jsxFileName, + lineNumber: 229 + } + }); + } + }, { + key: '_render', + value: function _render(props) { + var _this2 = this; + + var renderHeader = this.props.renderHeader; + + + var header = renderHeader ? React.createElement( + View, + { + __source: { + fileName: _jsxFileName, + lineNumber: 261 + } + }, + renderHeader(props) + ) : null; + + var scenes = props.scenes.map(function (scene) { + return _this2._renderScene(babelHelpers.extends({}, props, { + scene: scene + })); + }); + + return React.createElement( + View, + { style: styles.container, __source: { + fileName: _jsxFileName, + lineNumber: 271 + } + }, + React.createElement( + View, + { + style: [styles.scenes, this.props.scenesStyle], __source: { + fileName: _jsxFileName, + lineNumber: 272 + } + }, + scenes + ), + header + ); + } + }, { + key: '_renderScene', + value: function _renderScene(props) { + var isVertical = this.props.direction === 'vertical'; + + var interpolator = this.props.cardStyleInterpolator || (isVertical ? NavigationCardStackStyleInterpolator.forVertical : NavigationCardStackStyleInterpolator.forHorizontal); + + var style = interpolator(props); + + var panHandlers = null; + + if (this.props.enableGestures) { + var panHandlersProps = babelHelpers.extends({}, props, { + onNavigateBack: this.props.onNavigateBack, + gestureResponseDistance: this.props.gestureResponseDistance + }); + panHandlers = isVertical ? NavigationCardStackPanResponder.forVertical(panHandlersProps) : NavigationCardStackPanResponder.forHorizontal(panHandlersProps); + } + + return React.createElement(NavigationCard, babelHelpers.extends({}, props, { + key: 'card_' + props.scene.key, + panHandlers: panHandlers, + renderScene: this.props.renderScene, + style: [style, this.props.cardStyle], + __source: { + fileName: _jsxFileName, + lineNumber: 304 + } + })); + } + }]); + return NavigationCardStack; +}(React.Component); + +NavigationCardStack.propTypes = { + cardStyle: PropTypes.any, + + direction: PropTypes.oneOf([Directions.HORIZONTAL, Directions.VERTICAL]), + + gestureResponseDistance: PropTypes.number, + + cardStyleInterpolator: PropTypes.func, + + enableGestures: PropTypes.bool, + + navigationState: NavigationPropTypes.navigationState.isRequired, + + onNavigateBack: PropTypes.func, + + renderHeader: PropTypes.func, + + renderScene: PropTypes.func.isRequired, + + style: View.propTypes.style, + + scenesStyle: View.propTypes.style +}; +NavigationCardStack.defaultProps = { + direction: Directions.HORIZONTAL, + enableGestures: true +}; + + +var styles = StyleSheet.create({ + container: { + flex: 1, + + flexDirection: 'column-reverse' + }, + scenes: { + flex: 1 + } +}); + +module.exports = NavigationCardStack; +}, 405, null, "NavigationCardStack"); +__d(/* NavigationTransitioner */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/NavigationExperimental/NavigationTransitioner.js'; +var Animated = require(219 ); // 219 = Animated +var Easing = require(235 ); // 235 = Easing +var NavigationPropTypes = require(404 ); // 404 = NavigationPropTypes +var NavigationScenesReducer = require(407 ); // 407 = NavigationScenesReducer +var React = require(126 ); // 126 = React +var StyleSheet = require(127 ); // 127 = StyleSheet +var View = require(146 ); // 146 = View + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var PropTypes = React.PropTypes; + + +var DefaultTransitionSpec = { + duration: 250, + easing: Easing.inOut(Easing.ease), + timing: Animated.timing +}; + +var NavigationTransitioner = function (_React$Component) { + babelHelpers.inherits(NavigationTransitioner, _React$Component); + + function NavigationTransitioner(props, context) { + babelHelpers.classCallCheck(this, NavigationTransitioner); + + var _this = babelHelpers.possibleConstructorReturn(this, (NavigationTransitioner.__proto__ || Object.getPrototypeOf(NavigationTransitioner)).call(this, props, context)); + + var layout = { + height: new Animated.Value(0), + initHeight: 0, + initWidth: 0, + isMeasured: false, + width: new Animated.Value(0) + }; + + _this.state = { + layout: layout, + position: new Animated.Value(_this.props.navigationState.index), + progress: new Animated.Value(1), + scenes: NavigationScenesReducer([], _this.props.navigationState) + }; + + _this._prevTransitionProps = null; + _this._transitionProps = buildTransitionProps(props, _this.state); + _this._isMounted = false; + return _this; + } + + babelHelpers.createClass(NavigationTransitioner, [{ + key: 'componentWillMount', + value: function componentWillMount() { + this._onLayout = this._onLayout.bind(this); + this._onTransitionEnd = this._onTransitionEnd.bind(this); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this._isMounted = true; + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this._isMounted = false; + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var _this2 = this; + + var nextScenes = NavigationScenesReducer(this.state.scenes, nextProps.navigationState, this.props.navigationState); + + if (nextScenes === this.state.scenes) { + return; + } + + var nextState = babelHelpers.extends({}, this.state, { + scenes: nextScenes + }); + + var position = nextState.position, + progress = nextState.progress; + + + progress.setValue(0); + + this._prevTransitionProps = this._transitionProps; + this._transitionProps = buildTransitionProps(nextProps, nextState); + + var transitionUserSpec = nextProps.configureTransition ? nextProps.configureTransition(this._transitionProps, this._prevTransitionProps) : null; + + var transitionSpec = babelHelpers.extends({}, DefaultTransitionSpec, transitionUserSpec); + + var timing = transitionSpec.timing; + + delete transitionSpec.timing; + + var animations = [timing(progress, babelHelpers.extends({}, transitionSpec, { + toValue: 1 + }))]; + + if (nextProps.navigationState.index !== this.props.navigationState.index) { + animations.push(timing(position, babelHelpers.extends({}, transitionSpec, { + toValue: nextProps.navigationState.index + }))); + } + + this.setState(nextState, function () { + nextProps.onTransitionStart && nextProps.onTransitionStart(_this2._transitionProps, _this2._prevTransitionProps); + Animated.parallel(animations).start(_this2._onTransitionEnd); + }); + } + }, { + key: 'render', + value: function render() { + return React.createElement( + View, + { + onLayout: this._onLayout, + style: [styles.main, this.props.style], __source: { + fileName: _jsxFileName, + lineNumber: 192 + } + }, + this.props.render(this._transitionProps, this._prevTransitionProps) + ); + } + }, { + key: '_onLayout', + value: function _onLayout(event) { + var _event$nativeEvent$la = event.nativeEvent.layout, + height = _event$nativeEvent$la.height, + width = _event$nativeEvent$la.width; + + if (this.state.layout.initWidth === width && this.state.layout.initHeight === height) { + return; + } + var layout = babelHelpers.extends({}, this.state.layout, { + initHeight: height, + initWidth: width, + isMeasured: true + }); + + layout.height.setValue(height); + layout.width.setValue(width); + + var nextState = babelHelpers.extends({}, this.state, { + layout: layout + }); + + this._transitionProps = buildTransitionProps(this.props, nextState); + this.setState(nextState); + } + }, { + key: '_onTransitionEnd', + value: function _onTransitionEnd() { + var _this3 = this; + + if (!this._isMounted) { + return; + } + + var prevTransitionProps = this._prevTransitionProps; + this._prevTransitionProps = null; + + var nextState = babelHelpers.extends({}, this.state, { + scenes: this.state.scenes.filter(isSceneNotStale) + }); + + this._transitionProps = buildTransitionProps(this.props, nextState); + + this.setState(nextState, function () { + _this3.props.onTransitionEnd && _this3.props.onTransitionEnd(_this3._transitionProps, prevTransitionProps); + }); + } + }]); + return NavigationTransitioner; +}(React.Component); + +NavigationTransitioner.propTypes = { + configureTransition: PropTypes.func, + navigationState: NavigationPropTypes.navigationState.isRequired, + onTransitionEnd: PropTypes.func, + onTransitionStart: PropTypes.func, + render: PropTypes.func.isRequired +}; + + +function buildTransitionProps(props, state) { + var navigationState = props.navigationState; + var layout = state.layout, + position = state.position, + progress = state.progress, + scenes = state.scenes; + + + var scene = scenes.find(isSceneActive); + + invariant(scene, 'No active scene when building navigation transition props.'); + + return { + layout: layout, + navigationState: navigationState, + position: position, + progress: progress, + scenes: scenes, + scene: scene + }; +} + +function isSceneNotStale(scene) { + return !scene.isStale; +} + +function isSceneActive(scene) { + return scene.isActive; +} + +var styles = StyleSheet.create({ + main: { + flex: 1 + } +}); + +module.exports = NavigationTransitioner; +}, 406, null, "NavigationTransitioner"); +__d(/* NavigationScenesReducer */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var shallowEqual = require(187 ); // 187 = fbjs/lib/shallowEqual + +var SCENE_KEY_PREFIX = 'scene_'; + +function compareKey(one, two) { + var delta = one.length - two.length; + if (delta > 0) { + return 1; + } + if (delta < 0) { + return -1; + } + return one > two ? 1 : -1; +} + +function compareScenes(one, two) { + if (one.index > two.index) { + return 1; + } + if (one.index < two.index) { + return -1; + } + + return compareKey(one.key, two.key); +} + +function areScenesShallowEqual(one, two) { + return one.key === two.key && one.index === two.index && one.isStale === two.isStale && one.isActive === two.isActive && areRoutesShallowEqual(one.route, two.route); +} + +function areRoutesShallowEqual(one, two) { + if (!one || !two) { + return one === two; + } + + if (one.key !== two.key) { + return false; + } + + return shallowEqual(one, two); +} + +function NavigationScenesReducer(scenes, nextState, prevState) { + if (prevState === nextState) { + return scenes; + } + + var prevScenes = new Map(); + var freshScenes = new Map(); + var staleScenes = new Map(); + + scenes.forEach(function (scene) { + var key = scene.key; + + if (scene.isStale) { + staleScenes.set(key, scene); + } + prevScenes.set(key, scene); + }); + + var nextKeys = new Set(); + nextState.routes.forEach(function (route, index) { + var key = SCENE_KEY_PREFIX + route.key; + var scene = { + index: index, + isActive: false, + isStale: false, + key: key, + route: route + }; + invariant(!nextKeys.has(key), 'navigationState.routes[' + index + '].key "' + key + '" conflicts with ' + 'another route!'); + nextKeys.add(key); + + if (staleScenes.has(key)) { + staleScenes.delete(key); + } + freshScenes.set(key, scene); + }); + + if (prevState) { + prevState.routes.forEach(function (route, index) { + var key = SCENE_KEY_PREFIX + route.key; + if (freshScenes.has(key)) { + return; + } + staleScenes.set(key, { + index: index, + isActive: false, + isStale: true, + key: key, + route: route + }); + }); + } + + var nextScenes = []; + + var mergeScene = function mergeScene(nextScene) { + var key = nextScene.key; + + var prevScene = prevScenes.has(key) ? prevScenes.get(key) : null; + if (prevScene && areScenesShallowEqual(prevScene, nextScene)) { + nextScenes.push(prevScene); + } else { + nextScenes.push(nextScene); + } + }; + + staleScenes.forEach(mergeScene); + freshScenes.forEach(mergeScene); + + nextScenes.sort(compareScenes); + + var activeScenesCount = 0; + nextScenes.forEach(function (scene, ii) { + var isActive = !scene.isStale && scene.index === nextState.index; + if (isActive !== scene.isActive) { + nextScenes[ii] = babelHelpers.extends({}, scene, { + isActive: isActive + }); + } + if (isActive) { + activeScenesCount++; + } + }); + + invariant(activeScenesCount === 1, 'there should always be only one scene active, not %s.', activeScenesCount); + + if (nextScenes.length !== scenes.length) { + return nextScenes; + } + + if (nextScenes.some(function (scene, index) { + return !areScenesShallowEqual(scenes[index], scene); + })) { + return nextScenes; + } + + return scenes; +} + +module.exports = NavigationScenesReducer; +}, 407, null, "NavigationScenesReducer"); +__d(/* NavigationHeader */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js'; +var NavigationHeaderBackButton = require(409 ); // 409 = NavigationHeaderBackButton +var NavigationHeaderStyleInterpolator = require(411 ); // 411 = NavigationHeaderStyleInterpolator +var NavigationHeaderTitle = require(412 ); // 412 = NavigationHeaderTitle +var NavigationPropTypes = require(404 ); // 404 = NavigationPropTypes +var React = require(126 ); // 126 = React +var ReactComponentWithPureRenderMixin = require(413 ); // 413 = react/lib/ReactComponentWithPureRenderMixin +var ReactNative = require(69 ); // 69 = react-native +var TVEventHandler = require(214 ); // 214 = TVEventHandler + +var Animated = ReactNative.Animated, + Platform = ReactNative.Platform, + StyleSheet = ReactNative.StyleSheet, + View = ReactNative.View; + + +var APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56; +var STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0; +var PropTypes = React.PropTypes; + +var NavigationHeader = function (_React$Component) { + babelHelpers.inherits(NavigationHeader, _React$Component); + + function NavigationHeader() { + var _ref; + + var _temp, _this, _ret; + + babelHelpers.classCallCheck(this, NavigationHeader); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = babelHelpers.possibleConstructorReturn(this, (_ref = NavigationHeader.__proto__ || Object.getPrototypeOf(NavigationHeader)).call.apply(_ref, [this].concat(args))), _this), _this._renderLeft = function (props) { + return _this._renderSubView(props, 'left', _this.props.renderLeftComponent, NavigationHeaderStyleInterpolator.forLeft); + }, _this._renderTitle = function (props) { + return _this._renderSubView(props, 'title', _this.props.renderTitleComponent, NavigationHeaderStyleInterpolator.forCenter); + }, _this._renderRight = function (props) { + return _this._renderSubView(props, 'right', _this.props.renderRightComponent, NavigationHeaderStyleInterpolator.forRight); + }, _temp), babelHelpers.possibleConstructorReturn(_this, _ret); + } + + babelHelpers.createClass(NavigationHeader, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps, nextState) { + return ReactComponentWithPureRenderMixin.shouldComponentUpdate.call(this, nextProps, nextState); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this._tvEventHandler = new TVEventHandler(); + this._tvEventHandler.enable(this, function (cmp, evt) { + if (evt && evt.eventType === 'menu') { + cmp.props.onNavigateBack && cmp.props.onNavigateBack(); + } + }); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this._tvEventHandler) { + this._tvEventHandler.disable(); + delete this._tvEventHandler; + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props = this.props, + scenes = _props.scenes, + style = _props.style, + viewProps = _props.viewProps; + + + var scenesProps = scenes.map(function (scene) { + var props = NavigationPropTypes.extractSceneRendererProps(_this2.props); + props.scene = scene; + return props; + }); + + var barHeight = this.props.statusBarHeight instanceof Animated.Value ? Animated.add(this.props.statusBarHeight, new Animated.Value(APPBAR_HEIGHT)) : APPBAR_HEIGHT + this.props.statusBarHeight; + + return React.createElement( + Animated.View, + babelHelpers.extends({ style: [styles.appbar, { height: barHeight }, style] + }, viewProps, { + __source: { + fileName: _jsxFileName, + lineNumber: 164 + } + }), + scenesProps.map(this._renderLeft, this), + scenesProps.map(this._renderTitle, this), + scenesProps.map(this._renderRight, this) + ); + } + }, { + key: '_renderSubView', + value: function _renderSubView(props, name, renderer, styleInterpolator) { + var scene = props.scene, + navigationState = props.navigationState; + var index = scene.index, + isStale = scene.isStale, + key = scene.key; + + + var offset = navigationState.index - index; + + if (Math.abs(offset) > 2) { + return null; + } + + var subViewProps = babelHelpers.extends({}, props, { onNavigateBack: this.props.onNavigateBack }); + var subView = renderer(subViewProps); + if (subView === null) { + return null; + } + + var pointerEvents = offset !== 0 || isStale ? 'none' : 'box-none'; + return React.createElement( + Animated.View, + { + pointerEvents: pointerEvents, + key: name + '_' + key, + style: [styles[name], { marginTop: this.props.statusBarHeight }, styleInterpolator(props)], __source: { + fileName: _jsxFileName, + lineNumber: 238 + } + }, + subView + ); + } + }]); + return NavigationHeader; +}(React.Component); + +NavigationHeader.defaultProps = { + + renderTitleComponent: function renderTitleComponent(props) { + var title = String(props.scene.route.title || ''); + return React.createElement( + NavigationHeaderTitle, + { + __source: { + fileName: _jsxFileName, + lineNumber: 92 + } + }, + title + ); + }, + + renderLeftComponent: function renderLeftComponent(props) { + if (props.scene.index === 0 || !props.onNavigateBack) { + return null; + } + return React.createElement(NavigationHeaderBackButton, { + onPress: props.onNavigateBack, + __source: { + fileName: _jsxFileName, + lineNumber: 100 + } + }); + }, + + renderRightComponent: function renderRightComponent(props) { + return null; + }, + + statusBarHeight: STATUSBAR_HEIGHT +}; +NavigationHeader.propTypes = babelHelpers.extends({}, NavigationPropTypes.SceneRendererProps, { + onNavigateBack: PropTypes.func, + renderLeftComponent: PropTypes.func, + renderRightComponent: PropTypes.func, + renderTitleComponent: PropTypes.func, + style: View.propTypes.style, + statusBarHeight: PropTypes.number, + viewProps: PropTypes.shape(View.propTypes) +}); +NavigationHeader.HEIGHT = APPBAR_HEIGHT + STATUSBAR_HEIGHT; +NavigationHeader.Title = NavigationHeaderTitle; +NavigationHeader.BackButton = NavigationHeaderBackButton; + + +var styles = StyleSheet.create({ + appbar: { + alignItems: 'center', + backgroundColor: Platform.OS === 'ios' ? '#EFEFF2' : '#FFF', + borderBottomColor: 'rgba(0, 0, 0, .15)', + borderBottomWidth: Platform.OS === 'ios' ? StyleSheet.hairlineWidth : 0, + elevation: 4, + flexDirection: 'row', + justifyContent: 'flex-start' + }, + + title: { + bottom: 0, + left: APPBAR_HEIGHT, + position: 'absolute', + right: APPBAR_HEIGHT, + top: 0 + }, + + left: { + bottom: 0, + left: 0, + position: 'absolute', + top: 0 + }, + + right: { + bottom: 0, + position: 'absolute', + right: 0, + top: 0 + } +}); + +module.exports = NavigationHeader; +}, 408, null, "NavigationHeader"); +__d(/* NavigationHeaderBackButton */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js'; +var React = require(34 ); // 34 = react +var ReactNative = require(69 ); // 69 = react-native + +var I18nManager = ReactNative.I18nManager, + Image = ReactNative.Image, + Platform = ReactNative.Platform, + StyleSheet = ReactNative.StyleSheet, + TouchableOpacity = ReactNative.TouchableOpacity; + + +var NavigationHeaderBackButton = function NavigationHeaderBackButton(props) { + return React.createElement( + TouchableOpacity, + { style: [styles.buttonContainer, props.style], onPress: props.onPress, __source: { + fileName: _jsxFileName, + lineNumber: 44 + } + }, + React.createElement(Image, { style: [styles.button, props.imageStyle], source: require(410 ), __source: { // 410 = ./assets/back-icon.png + fileName: _jsxFileName, + lineNumber: 45 + } + }) + ); +}; + +NavigationHeaderBackButton.propTypes = { + onPress: React.PropTypes.func.isRequired +}; + +var styles = StyleSheet.create({ + buttonContainer: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center' + }, + button: { + height: 24, + width: 24, + margin: Platform.OS === 'ios' ? 10 : 16, + resizeMode: 'contain', + transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }] + } +}); + +module.exports = NavigationHeaderBackButton; +}, 409, null, "NavigationHeaderBackButton"); +__d(/* react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png */function(global, require, module, exports) {module.exports = require(199 ).registerAsset({"__packager_asset":true,"httpServerLocation":"/assets/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets","width":24,"height":24,"scales":[1,1.5,2,3,4],"hash":"40cb2e3978cf9a18d3566dab9deded67","name":"back-icon","type":"png"}); // 199 = react-native/Libraries/Image/AssetRegistry +}, 410, null, "react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png"); +__d(/* NavigationHeaderStyleInterpolator */function(global, require, module, exports) { +'use strict'; + +var I18nManager = require(331 ); // 331 = I18nManager + +function forLeft(props) { + var position = props.position, + scene = props.scene; + var index = scene.index; + + return { + opacity: position.interpolate({ + inputRange: [index - 1, index, index + 1], + outputRange: [0, 1, 0] + }) + }; +} + +function forCenter(props) { + var position = props.position, + scene = props.scene; + var index = scene.index; + + return { + opacity: position.interpolate({ + inputRange: [index - 1, index, index + 1], + outputRange: [0, 1, 0] + }), + transform: [{ + translateX: position.interpolate({ + inputRange: [index - 1, index + 1], + outputRange: I18nManager.isRTL ? [-200, 200] : [200, -200] + }) + }] + }; +} + +function forRight(props) { + var position = props.position, + scene = props.scene; + var index = scene.index; + + return { + opacity: position.interpolate({ + inputRange: [index - 1, index, index + 1], + outputRange: [0, 1, 0] + }) + }; +} + +module.exports = { + forCenter: forCenter, + forLeft: forLeft, + forRight: forRight +}; +}, 411, null, "NavigationHeaderStyleInterpolator"); +__d(/* NavigationHeaderTitle */function(global, require, module, exports) { +'use strict'; + +var _jsxFileName = '/Users/manu/UC/matrix/github/others/jitsi-meet/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js'; +var React = require(34 ); // 34 = react +var ReactNative = require(69 ); // 69 = react-native + +var Platform = ReactNative.Platform, + StyleSheet = ReactNative.StyleSheet, + View = ReactNative.View, + Text = ReactNative.Text; + + +var NavigationHeaderTitle = function NavigationHeaderTitle(_ref) { + var children = _ref.children, + style = _ref.style, + textStyle = _ref.textStyle, + viewProps = _ref.viewProps; + return React.createElement( + View, + babelHelpers.extends({ style: [styles.title, style] }, viewProps, { + __source: { + fileName: _jsxFileName, + lineNumber: 53 + } + }), + React.createElement( + Text, + { style: [styles.titleText, textStyle], __source: { + fileName: _jsxFileName, + lineNumber: 54 + } + }, + children + ) + ); +}; + +var styles = StyleSheet.create({ + title: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + marginHorizontal: 16 + }, + + titleText: { + flex: 1, + fontSize: 18, + fontWeight: '500', + color: 'rgba(0, 0, 0, .9)', + textAlign: Platform.OS === 'ios' ? 'center' : 'left' + } +}); + +NavigationHeaderTitle.propTypes = { + children: React.PropTypes.node.isRequired, + style: View.propTypes.style, + textStyle: Text.propTypes.style +}; + +module.exports = NavigationHeaderTitle; +}, 412, null, "NavigationHeaderTitle"); +__d(/* react/lib/ReactComponentWithPureRenderMixin.js */function(global, require, module, exports) { + +'use strict'; + +var shallowCompare = require(414 ); // 414 = ./shallowCompare + +var ReactComponentWithPureRenderMixin = { + shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { + return shallowCompare(this, nextProps, nextState); + } +}; + +module.exports = ReactComponentWithPureRenderMixin; +}, 413, null, "react/lib/ReactComponentWithPureRenderMixin.js"); +__d(/* react/lib/shallowCompare.js */function(global, require, module, exports) { + +'use strict'; + +var shallowEqual = require(187 ); // 187 = fbjs/lib/shallowEqual + +function shallowCompare(instance, nextProps, nextState) { + return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState); +} + +module.exports = shallowCompare; +}, 414, null, "react/lib/shallowCompare.js"); +__d(/* NavigationStateUtils */function(global, require, module, exports) { +'use strict'; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var NavigationStateUtils = { + get: function get(state, key) { + return state.routes.find(function (route) { + return route.key === key; + }) || null; + }, + indexOf: function indexOf(state, key) { + return state.routes.map(function (route) { + return route.key; + }).indexOf(key); + }, + has: function has(state, key) { + return !!state.routes.some(function (route) { + return route.key === key; + }); + }, + push: function push(state, route) { + invariant(NavigationStateUtils.indexOf(state, route.key) === -1, 'should not push route with duplicated key %s', route.key); + + var routes = state.routes.slice(); + routes.push(route); + + return babelHelpers.extends({}, state, { + index: routes.length - 1, + routes: routes + }); + }, + pop: function pop(state) { + if (state.index <= 0) { + return state; + } + var routes = state.routes.slice(0, -1); + return babelHelpers.extends({}, state, { + index: routes.length - 1, + routes: routes + }); + }, + jumpToIndex: function jumpToIndex(state, index) { + if (index === state.index) { + return state; + } + + invariant(!!state.routes[index], 'invalid index %s to jump to', index); + + return babelHelpers.extends({}, state, { + index: index + }); + }, + jumpTo: function jumpTo(state, key) { + var index = NavigationStateUtils.indexOf(state, key); + return NavigationStateUtils.jumpToIndex(state, index); + }, + back: function back(state) { + var index = state.index - 1; + var route = state.routes[index]; + return route ? NavigationStateUtils.jumpToIndex(state, index) : state; + }, + forward: function forward(state) { + var index = state.index + 1; + var route = state.routes[index]; + return route ? NavigationStateUtils.jumpToIndex(state, index) : state; + }, + replaceAt: function replaceAt(state, key, route) { + var index = NavigationStateUtils.indexOf(state, key); + return NavigationStateUtils.replaceAtIndex(state, index, route); + }, + replaceAtIndex: function replaceAtIndex(state, index, route) { + invariant(!!state.routes[index], 'invalid index %s for replacing route %s', index, route.key); + + if (state.routes[index] === route) { + return state; + } + + var routes = state.routes.slice(); + routes[index] = route; + + return babelHelpers.extends({}, state, { + index: index, + routes: routes + }); + }, + reset: function reset(state, routes, index) { + invariant(routes.length && Array.isArray(routes), 'invalid routes to replace'); + + var nextIndex = index === undefined ? routes.length - 1 : index; + + if (state.routes.length === routes.length && state.index === nextIndex) { + var compare = function compare(route, ii) { + return routes[ii] === route; + }; + if (state.routes.every(compare)) { + return state; + } + } + + invariant(!!routes[nextIndex], 'invalid index %s to reset', nextIndex); + + return babelHelpers.extends({}, state, { + index: nextIndex, + routes: routes + }); + } +}; + +module.exports = NavigationStateUtils; +}, 415, null, "NavigationStateUtils"); +__d(/* NetInfo */function(global, require, module, exports) { +'use strict'; + +var Map = require(223 ); // 223 = Map +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var NativeModules = require(80 ); // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform +var RCTNetInfo = NativeModules.NetInfo; + +var NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo); + +var DEVICE_CONNECTIVITY_EVENT = 'networkStatusDidChange'; + +var _subscriptions = new Map(); + +var _isConnected = void 0; +if (Platform.OS === 'ios') { + _isConnected = function _isConnected(reachability) { + return reachability !== 'none' && reachability !== 'unknown'; + }; +} else if (Platform.OS === 'android') { + _isConnected = function _isConnected(connectionType) { + return connectionType !== 'NONE' && connectionType !== 'UNKNOWN'; + }; +} + +var _isConnectedSubscriptions = new Map(); + +var NetInfo = { + addEventListener: function addEventListener(eventName, handler) { + var listener = NetInfoEventEmitter.addListener(DEVICE_CONNECTIVITY_EVENT, function (appStateData) { + handler(appStateData.network_info); + }); + _subscriptions.set(handler, listener); + return { + remove: function remove() { + return NetInfo.removeEventListener(eventName, handler); + } + }; + }, + removeEventListener: function removeEventListener(eventName, handler) { + var listener = _subscriptions.get(handler); + if (!listener) { + return; + } + listener.remove(); + _subscriptions.delete(handler); + }, + fetch: function fetch() { + return RCTNetInfo.getCurrentConnectivity().then(function (resp) { + return resp.network_info; + }); + }, + + isConnected: { + addEventListener: function addEventListener(eventName, handler) { + var listener = function listener(connection) { + handler(_isConnected(connection)); + }; + _isConnectedSubscriptions.set(handler, listener); + NetInfo.addEventListener(eventName, listener); + return { + remove: function remove() { + return NetInfo.isConnected.removeEventListener(eventName, handler); + } + }; + }, + removeEventListener: function removeEventListener(eventName, handler) { + var listener = _isConnectedSubscriptions.get(handler); + NetInfo.removeEventListener(eventName, listener); + _isConnectedSubscriptions.delete(handler); + }, + fetch: function fetch() { + return NetInfo.fetch().then(function (connection) { + return _isConnected(connection); + }); + } + }, + + isConnectionExpensive: function isConnectionExpensive() { + return Platform.OS === 'android' ? RCTNetInfo.isConnectionMetered() : Promise.reject(new Error('Currently not supported on iOS')); + } +}; + +module.exports = NetInfo; +}, 416, null, "NetInfo"); +__d(/* PermissionsAndroid */function(global, require, module, exports) { +'use strict'; + +var DialogManagerAndroid = require(80 ).DialogManagerAndroid; // 80 = NativeModules +var Permissions = require(80 ).PermissionsAndroid; // 80 = NativeModules + +var PermissionsAndroid = function () { + function PermissionsAndroid() { + babelHelpers.classCallCheck(this, PermissionsAndroid); + + this.PERMISSIONS = { + READ_CALENDAR: 'android.permission.READ_CALENDAR', + WRITE_CALENDAR: 'android.permission.WRITE_CALENDAR', + CAMERA: 'android.permission.CAMERA', + READ_CONTACTS: 'android.permission.READ_CONTACTS', + WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS', + GET_ACCOUNTS: 'android.permission.GET_ACCOUNTS', + ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION', + ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION', + RECORD_AUDIO: 'android.permission.RECORD_AUDIO', + READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE', + CALL_PHONE: 'android.permission.CALL_PHONE', + READ_CALL_LOG: 'android.permission.READ_CALL_LOG', + WRITE_CALL_LOG: 'android.permission.WRITE_CALL_LOG', + ADD_VOICEMAIL: 'com.android.voicemail.permission.ADD_VOICEMAIL', + USE_SIP: 'android.permission.USE_SIP', + PROCESS_OUTGOING_CALLS: 'android.permission.PROCESS_OUTGOING_CALLS', + BODY_SENSORS: 'android.permission.BODY_SENSORS', + SEND_SMS: 'android.permission.SEND_SMS', + RECEIVE_SMS: 'android.permission.RECEIVE_SMS', + READ_SMS: 'android.permission.READ_SMS', + RECEIVE_WAP_PUSH: 'android.permission.RECEIVE_WAP_PUSH', + RECEIVE_MMS: 'android.permission.RECEIVE_MMS', + READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE', + WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE' + }; + + this.RESULTS = { + GRANTED: 'granted', + DENIED: 'denied', + NEVER_ASK_AGAIN: 'never_ask_again' + }; + } + + babelHelpers.createClass(PermissionsAndroid, [{ + key: 'checkPermission', + value: function checkPermission(permission) { + console.warn('"PermissionsAndroid.checkPermission" is deprecated. Use "PermissionsAndroid.check" instead'); + return Permissions.checkPermission(permission); + } + }, { + key: 'check', + value: function check(permission) { + return Permissions.checkPermission(permission); + } + }, { + key: 'requestPermission', + value: function requestPermission(permission, rationale) { + var response; + return regeneratorRuntime.async(function requestPermission$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + console.warn('"PermissionsAndroid.requestPermission" is deprecated. Use "PermissionsAndroid.request" instead'); + _context.next = 3; + return regeneratorRuntime.awrap(this.request(permission, rationale)); + + case 3: + response = _context.sent; + return _context.abrupt('return', response === this.RESULTS.GRANTED); + + case 5: + case 'end': + return _context.stop(); + } + } + }, null, this); + } + }, { + key: 'request', + value: function request(permission, rationale) { + var shouldShowRationale; + return regeneratorRuntime.async(function request$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!rationale) { + _context2.next = 6; + break; + } + + _context2.next = 3; + return regeneratorRuntime.awrap(Permissions.shouldShowRequestPermissionRationale(permission)); + + case 3: + shouldShowRationale = _context2.sent; + + if (!shouldShowRationale) { + _context2.next = 6; + break; + } + + return _context2.abrupt('return', new Promise(function (resolve, reject) { + DialogManagerAndroid.showAlert(rationale, function () { + return reject(new Error('Error showing rationale')); + }, function () { + return resolve(Permissions.requestPermission(permission)); + }); + })); + + case 6: + return _context2.abrupt('return', Permissions.requestPermission(permission)); + + case 7: + case 'end': + return _context2.stop(); + } + } + }, null, this); + } + }, { + key: 'requestMultiple', + value: function requestMultiple(permissions) { + return Permissions.requestMultiplePermissions(permissions); + } + }]); + return PermissionsAndroid; +}(); + +PermissionsAndroid = new PermissionsAndroid(); + +module.exports = PermissionsAndroid; +}, 417, null, "PermissionsAndroid"); +__d(/* PushNotificationIOS */function(global, require, module, exports) { +'use strict'; + +var NativeEventEmitter = require(102 ); // 102 = NativeEventEmitter +var RCTPushNotificationManager = require(80 ).PushNotificationManager; // 80 = NativeModules +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var PushNotificationEmitter = new NativeEventEmitter(RCTPushNotificationManager); + +var _notifHandlers = new Map(); + +var DEVICE_NOTIF_EVENT = 'remoteNotificationReceived'; +var NOTIF_REGISTER_EVENT = 'remoteNotificationsRegistered'; +var NOTIF_REGISTRATION_ERROR_EVENT = 'remoteNotificationRegistrationError'; +var DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived'; + +var PushNotificationIOS = function () { + babelHelpers.createClass(PushNotificationIOS, null, [{ + key: 'presentLocalNotification', + value: function presentLocalNotification(details) { + RCTPushNotificationManager.presentLocalNotification(details); + } + }, { + key: 'scheduleLocalNotification', + value: function scheduleLocalNotification(details) { + RCTPushNotificationManager.scheduleLocalNotification(details); + } + }, { + key: 'cancelAllLocalNotifications', + value: function cancelAllLocalNotifications() { + RCTPushNotificationManager.cancelAllLocalNotifications(); + } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(number) { + RCTPushNotificationManager.setApplicationIconBadgeNumber(number); + } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(callback) { + RCTPushNotificationManager.getApplicationIconBadgeNumber(callback); + } + }, { + key: 'cancelLocalNotifications', + value: function cancelLocalNotifications(userInfo) { + RCTPushNotificationManager.cancelLocalNotifications(userInfo); + } + }, { + key: 'getScheduledLocalNotifications', + value: function getScheduledLocalNotifications(callback) { + RCTPushNotificationManager.getScheduledLocalNotifications(callback); + } + }, { + key: 'addEventListener', + value: function addEventListener(type, handler) { + invariant(type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification', 'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'); + var listener; + if (type === 'notification') { + listener = PushNotificationEmitter.addListener(DEVICE_NOTIF_EVENT, function (notifData) { + handler(new PushNotificationIOS(notifData)); + }); + } else if (type === 'localNotification') { + listener = PushNotificationEmitter.addListener(DEVICE_LOCAL_NOTIF_EVENT, function (notifData) { + handler(new PushNotificationIOS(notifData)); + }); + } else if (type === 'register') { + listener = PushNotificationEmitter.addListener(NOTIF_REGISTER_EVENT, function (registrationInfo) { + handler(registrationInfo.deviceToken); + }); + } else if (type === 'registrationError') { + listener = PushNotificationEmitter.addListener(NOTIF_REGISTRATION_ERROR_EVENT, function (errorInfo) { + handler(errorInfo); + }); + } + _notifHandlers.set(type, listener); + } + }, { + key: 'removeEventListener', + value: function removeEventListener(type, handler) { + invariant(type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification', 'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'); + var listener = _notifHandlers.get(type); + if (!listener) { + return; + } + listener.remove(); + _notifHandlers.delete(type); + } + }, { + key: 'requestPermissions', + value: function requestPermissions(permissions) { + var requestedPermissions = {}; + if (permissions) { + requestedPermissions = { + alert: !!permissions.alert, + badge: !!permissions.badge, + sound: !!permissions.sound + }; + } else { + requestedPermissions = { + alert: true, + badge: true, + sound: true + }; + } + return RCTPushNotificationManager.requestPermissions(requestedPermissions); + } + }, { + key: 'abandonPermissions', + value: function abandonPermissions() { + RCTPushNotificationManager.abandonPermissions(); + } + }, { + key: 'checkPermissions', + value: function checkPermissions(callback) { + invariant(typeof callback === 'function', 'Must provide a valid callback'); + RCTPushNotificationManager.checkPermissions(callback); + } + }, { + key: 'getInitialNotification', + value: function getInitialNotification() { + return RCTPushNotificationManager.getInitialNotification().then(function (notification) { + return notification && new PushNotificationIOS(notification); + }); + } + }]); + + function PushNotificationIOS(nativeNotif) { + var _this = this; + + babelHelpers.classCallCheck(this, PushNotificationIOS); + + this._data = {}; + this._remoteNotificationCompleteCalllbackCalled = false; + this._isRemote = nativeNotif.remote; + if (this._isRemote) { + this._notificationId = nativeNotif.notificationId; + } + + if (nativeNotif.remote) { + Object.keys(nativeNotif).forEach(function (notifKey) { + var notifVal = nativeNotif[notifKey]; + if (notifKey === 'aps') { + _this._alert = notifVal.alert; + _this._sound = notifVal.sound; + _this._badgeCount = notifVal.badge; + } else { + _this._data[notifKey] = notifVal; + } + }); + } else { + this._badgeCount = nativeNotif.applicationIconBadgeNumber; + this._sound = nativeNotif.soundName; + this._alert = nativeNotif.alertBody; + this._data = nativeNotif.userInfo; + } + } + + babelHelpers.createClass(PushNotificationIOS, [{ + key: 'finish', + value: function finish(fetchResult) { + if (!this._isRemote || !this._notificationId || this._remoteNotificationCompleteCalllbackCalled) { + return; + } + this._remoteNotificationCompleteCalllbackCalled = true; + + RCTPushNotificationManager.onFinishRemoteNotification(this._notificationId, fetchResult); + } + }, { + key: 'getMessage', + value: function getMessage() { + return this._alert; + } + }, { + key: 'getSound', + value: function getSound() { + return this._sound; + } + }, { + key: 'getAlert', + value: function getAlert() { + return this._alert; + } + }, { + key: 'getBadgeCount', + value: function getBadgeCount() { + return this._badgeCount; + } + }, { + key: 'getData', + value: function getData() { + return this._data; + } + }]); + return PushNotificationIOS; +}(); + +PushNotificationIOS.FetchResult = { + NewData: 'UIBackgroundFetchResultNewData', + NoData: 'UIBackgroundFetchResultNoData', + ResultFailed: 'UIBackgroundFetchResultFailed' +}; + + +module.exports = PushNotificationIOS; +}, 418, null, "PushNotificationIOS"); +__d(/* Settings */function(global, require, module, exports) { +'use strict'; + +var RCTDeviceEventEmitter = require(107 ); // 107 = RCTDeviceEventEmitter +var RCTSettingsManager = require(80 ).SettingsManager; // 80 = NativeModules + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var subscriptions = []; + +var Settings = { + _settings: RCTSettingsManager && RCTSettingsManager.settings, + + get: function get(key) { + return this._settings[key]; + }, + set: function set(settings) { + this._settings = babelHelpers.extends(this._settings, settings); + RCTSettingsManager.setValues(settings); + }, + watchKeys: function watchKeys(keys, callback) { + if (typeof keys === 'string') { + keys = [keys]; + } + + invariant(Array.isArray(keys), 'keys should be a string or array of strings'); + + var sid = subscriptions.length; + subscriptions.push({ keys: keys, callback: callback }); + return sid; + }, + clearWatch: function clearWatch(watchId) { + if (watchId < subscriptions.length) { + subscriptions[watchId] = { keys: [], callback: null }; + } + }, + _sendObservations: function _sendObservations(body) { + var _this = this; + + Object.keys(body).forEach(function (key) { + var newValue = body[key]; + var didChange = _this._settings[key] !== newValue; + _this._settings[key] = newValue; + + if (didChange) { + subscriptions.forEach(function (sub) { + if (sub.keys.indexOf(key) !== -1 && sub.callback) { + sub.callback(); + } + }); + } + }); + } +}; + +RCTDeviceEventEmitter.addListener('settingsUpdated', Settings._sendObservations.bind(Settings)); + +module.exports = Settings; +}, 419, null, "Settings"); +__d(/* Share */function(global, require, module, exports) { +'use strict'; + +var Platform = require(79 ); // 79 = Platform + +var _require = require(80 ), // 80 = NativeModules + ActionSheetManager = _require.ActionSheetManager, + ShareModule = _require.ShareModule; + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var processColor = require(121 ); // 121 = processColor + +var Share = function () { + function Share() { + babelHelpers.classCallCheck(this, Share); + } + + babelHelpers.createClass(Share, null, [{ + key: 'share', + value: function share(content) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + invariant(typeof content === 'object' && content !== null, 'Content to share must be a valid object'); + invariant(typeof content.url === 'string' || typeof content.message === 'string', 'At least one of URL and message is required'); + invariant(typeof options === 'object' && options !== null, 'Options must be a valid object'); + + if (Platform.OS === 'android') { + invariant(!content.title || typeof content.title === 'string', 'Invalid title: title should be a string.'); + return ShareModule.share(content, options.dialogTitle); + } else if (Platform.OS === 'ios') { + return new Promise(function (resolve, reject) { + ActionSheetManager.showShareActionSheetWithOptions(babelHelpers.extends({}, content, options, { tintColor: processColor(options.tintColor) }), function (error) { + return reject(error); + }, function (success, activityType) { + if (success) { + resolve({ + 'action': 'sharedAction', + 'activityType': activityType + }); + } else { + resolve({ + 'action': 'dismissedAction' + }); + } + }); + }); + } else { + return Promise.reject(new Error('Unsupported platform')); + } + } + }, { + key: 'sharedAction', + get: function get() { + return 'sharedAction'; + } + }, { + key: 'dismissedAction', + get: function get() { + return 'dismissedAction'; + } + }]); + return Share; +}(); + +module.exports = Share; +}, 420, null, "Share"); +__d(/* TimePickerAndroid */function(global, require, module, exports) { +'use strict'; + +var TimePickerAndroid = { + open: function open(options) { + return regeneratorRuntime.async(function open$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt('return', Promise.reject({ + message: 'TimePickerAndroid is not supported on this platform.' + })); + + case 1: + case 'end': + return _context.stop(); + } + } + }, null, this); + } +}; + +module.exports = TimePickerAndroid; +}, 421, null, "TimePickerAndroid"); +__d(/* Vibration */function(global, require, module, exports) { +'use strict'; + +var RCTVibration = require(80 ).Vibration; // 80 = NativeModules +var Platform = require(79 ); // 79 = Platform + +var _vibrating = false; +var _id = 0; + +function vibrateByPattern(pattern) { + var repeat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (_vibrating) { + return; + } + _vibrating = true; + if (pattern[0] === 0) { + RCTVibration.vibrate(); + pattern = pattern.slice(1); + } + if (pattern.length === 0) { + _vibrating = false; + return; + } + setTimeout(function () { + return vibrateScheduler(++_id, pattern, repeat, 1); + }, pattern[0]); +} + +function vibrateScheduler(id, pattern, repeat, nextIndex) { + if (!_vibrating || id !== _id) { + return; + } + RCTVibration.vibrate(); + if (nextIndex >= pattern.length) { + if (repeat) { + nextIndex = 0; + } else { + _vibrating = false; + return; + } + } + setTimeout(function () { + return vibrateScheduler(id, pattern, repeat, nextIndex + 1); + }, pattern[nextIndex]); +} + +var Vibration = { + vibrate: function vibrate() { + var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 400; + var repeat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (Platform.OS === 'android') { + if (typeof pattern === 'number') { + RCTVibration.vibrate(pattern); + } else if (Array.isArray(pattern)) { + RCTVibration.vibrateByPattern(pattern, repeat ? 0 : -1); + } else { + throw new Error('Vibration pattern should be a number or array'); + } + } else { + if (_vibrating) { + return; + } + if (typeof pattern === 'number') { + RCTVibration.vibrate(); + } else if (Array.isArray(pattern)) { + vibrateByPattern(pattern, repeat); + } else { + throw new Error('Vibration pattern should be a number or array'); + } + } + }, + + cancel: function cancel() { + if (Platform.OS === 'ios') { + _vibrating = false; + } else { + RCTVibration.cancel(); + } + } +}; + +module.exports = Vibration; +}, 422, null, "Vibration"); +__d(/* VibrationIOS */function(global, require, module, exports) { +'use strict'; + +var RCTVibration = require(80 ).Vibration; // 80 = NativeModules + +var invariant = require(44 ); // 44 = fbjs/lib/invariant + +var VibrationIOS = { + vibrate: function vibrate() { + invariant(arguments[0] === undefined, 'Vibration patterns not supported.'); + RCTVibration.vibrate(); + } +}; + +module.exports = VibrationIOS; +}, 423, null, "VibrationIOS"); +__d(/* react/lib/LinkedStateMixin.js */function(global, require, module, exports) { + +'use strict'; + +var ReactLink = require(425 ); // 425 = ./ReactLink +var ReactStateSetters = require(426 ); // 426 = ./ReactStateSetters + +var LinkedStateMixin = { + linkState: function linkState(key) { + return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key)); + } +}; + +module.exports = LinkedStateMixin; +}, 424, null, "react/lib/LinkedStateMixin.js"); +__d(/* react/lib/ReactLink.js */function(global, require, module, exports) { + +'use strict'; + +function ReactLink(value, requestChange) { + this.value = value; + this.requestChange = requestChange; +} + +module.exports = ReactLink; +}, 425, null, "react/lib/ReactLink.js"); +__d(/* react/lib/ReactStateSetters.js */function(global, require, module, exports) { + +'use strict'; + +var ReactStateSetters = { + createStateSetter: function createStateSetter(component, funcReturningState) { + return function (a, b, c, d, e, f) { + var partialState = funcReturningState.call(component, a, b, c, d, e, f); + if (partialState) { + component.setState(partialState); + } + }; + }, + + createStateKeySetter: function createStateKeySetter(component, key) { + var cache = component.__keySetters || (component.__keySetters = {}); + return cache[key] || (cache[key] = _createStateKeySetter(component, key)); + } +}; + +function _createStateKeySetter(component, key) { + var partialState = {}; + return function stateKeySetter(value) { + partialState[key] = value; + component.setState(partialState); + }; +} + +ReactStateSetters.Mixin = { + createStateSetter: function createStateSetter(funcReturningState) { + return ReactStateSetters.createStateSetter(this, funcReturningState); + }, + + createStateKeySetter: function createStateKeySetter(key) { + return ReactStateSetters.createStateKeySetter(this, key); + } +}; + +module.exports = ReactStateSetters; +}, 426, null, "react/lib/ReactStateSetters.js"); +__d(/* react/lib/ReactFragment.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ); // 38 = ./reactProdInvariant + +var ReactChildren = require(46 ); // 46 = ./ReactChildren +var ReactElement = require(48 ); // 48 = ./ReactElement + +var emptyFunction = require(41 ); // 41 = fbjs/lib/emptyFunction +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var warning = require(40 ); // 40 = fbjs/lib/warning + +var numericPropertyRegex = /^\d+$/; + +var warnedAboutNumeric = false; + +var ReactFragment = { + create: function create(object) { + if (typeof object !== 'object' || !object || Array.isArray(object)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0; + return object; + } + if (ReactElement.isValidElement(object)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0; + return object; + } + + !(object.nodeType !== 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.') : _prodInvariant('0') : void 0; + + var result = []; + + for (var key in object) { + if (process.env.NODE_ENV !== 'production') { + if (!warnedAboutNumeric && numericPropertyRegex.test(key)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0; + warnedAboutNumeric = true; + } + } + ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument); + } + + return result; + } +}; + +module.exports = ReactFragment; +}, 427, null, "react/lib/ReactFragment.js"); +__d(/* react/lib/update.js */function(global, require, module, exports) { + +'use strict'; + +var _prodInvariant = require(38 ), // 38 = ./reactProdInvariant + _assign = require(36 ); // 36 = object-assign + +var invariant = require(44 ); // 44 = fbjs/lib/invariant +var hasOwnProperty = {}.hasOwnProperty; + +function shallowCopy(x) { + if (Array.isArray(x)) { + return x.concat(); + } else if (x && typeof x === 'object') { + return _assign(new x.constructor(), x); + } else { + return x; + } +} + +var COMMAND_PUSH = '$push'; +var COMMAND_UNSHIFT = '$unshift'; +var COMMAND_SPLICE = '$splice'; +var COMMAND_SET = '$set'; +var COMMAND_MERGE = '$merge'; +var COMMAND_APPLY = '$apply'; + +var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY]; + +var ALL_COMMANDS_SET = {}; + +ALL_COMMANDS_LIST.forEach(function (command) { + ALL_COMMANDS_SET[command] = true; +}); + +function invariantArrayCase(value, spec, command) { + !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0; + var specValue = spec[command]; + !Array.isArray(specValue) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0; +} + +function update(value, spec) { + !(typeof spec === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0; + + if (hasOwnProperty.call(spec, COMMAND_SET)) { + !(Object.keys(spec).length === 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0; + + return spec[COMMAND_SET]; + } + + var nextValue = shallowCopy(value); + + if (hasOwnProperty.call(spec, COMMAND_MERGE)) { + var mergeObj = spec[COMMAND_MERGE]; + !(mergeObj && typeof mergeObj === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0; + !(nextValue && typeof nextValue === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0; + _assign(nextValue, spec[COMMAND_MERGE]); + } + + if (hasOwnProperty.call(spec, COMMAND_PUSH)) { + invariantArrayCase(value, spec, COMMAND_PUSH); + spec[COMMAND_PUSH].forEach(function (item) { + nextValue.push(item); + }); + } + + if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) { + invariantArrayCase(value, spec, COMMAND_UNSHIFT); + spec[COMMAND_UNSHIFT].forEach(function (item) { + nextValue.unshift(item); + }); + } + + if (hasOwnProperty.call(spec, COMMAND_SPLICE)) { + !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0; + !Array.isArray(spec[COMMAND_SPLICE]) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0; + spec[COMMAND_SPLICE].forEach(function (args) { + !Array.isArray(args) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0; + nextValue.splice.apply(nextValue, args); + }); + } + + if (hasOwnProperty.call(spec, COMMAND_APPLY)) { + !(typeof spec[COMMAND_APPLY] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0; + nextValue = spec[COMMAND_APPLY](nextValue); + } + + for (var k in spec) { + if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) { + nextValue[k] = update(value[k], spec[k]); + } + } + + return nextValue; +} + +module.exports = update; +}, 428, null, "react/lib/update.js"); +__d(/* throwOnWrongReactAPI */function(global, require, module, exports) { + +'use strict'; + +function throwOnWrongReactAPI(key) { + throw new Error('Seems you\'re trying to access \'ReactNative.' + key + '\' from the \'react-native\' package. Perhaps you meant to access \'React.' + key + '\' from the \'react\' package instead?\n\nFor example, instead of:\n\n import React, { Component, View } from \'react-native\';\n\nYou should now do:\n\n import React, { Component } from \'react\';\n import { View } from \'react-native\';\n\nCheck the release notes on how to upgrade your code - https://github.com/facebook/react-native/releases/tag/v0.25.1\n'); +} + +module.exports = throwOnWrongReactAPI; +}, 429, null, "throwOnWrongReactAPI"); +__d(/* jitsi-meet/react/features/app/index.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _actions = require(431 ); // 431 = ./actions + +Object.keys(_actions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actions[key]; + } + }); +}); + +var _actionTypes = require(675 ); // 675 = ./actionTypes + +Object.keys(_actionTypes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actionTypes[key]; + } + }); +}); + +var _components = require(676 ); // 676 = ./components + +Object.keys(_components).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _components[key]; + } + }); +}); + +var _functions = require(697 ); // 697 = ./functions + +Object.keys(_functions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _functions[key]; + } + }); +}); + +require(987 ); // 987 = ./middleware + +require(988 ); // 988 = ./reducer +}, 430, null, "jitsi-meet/react/features/app/index.js"); +__d(/* jitsi-meet/react/features/app/actions.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.appNavigate = appNavigate; +exports.appWillMount = appWillMount; +exports.appWillUnmount = appWillUnmount; + +var _conference = require(432 ); // 432 = ../base/conference + +var _connection = require(615 ); // 615 = ../base/connection + +var _config = require(496 ); // 496 = ../base/config + +var _libJitsiMeet = require(434 ); // 434 = ../base/lib-jitsi-meet + +var _util = require(529 ); // 529 = ../base/util + +var _actionTypes = require(675 ); // 675 = ./actionTypes + +function appNavigate(uri) { + return function (dispatch, getState) { + return _appNavigateToOptionalLocation(dispatch, getState, (0, _util.parseURIString)(uri)); + }; +} + +function _appNavigateToMandatoryLocation(dispatch, getState, newLocation) { + + var oldLocationURL = getState()['features/base/connection'].locationURL; + var oldHost = oldLocationURL ? oldLocationURL.host : undefined; + var newHost = newLocation.host; + + if (oldHost === newHost) { + dispatchSetLocationURL().then(dispatchSetRoom); + } else { + _loadConfig(newLocation).then(function (config) { + return configLoaded(undefined, config); + }, function (err) { + return configLoaded(err, undefined); + }).then(dispatchSetRoom); + } + + function configLoaded(err, config) { + if (err) { + return; + } + + return dispatchSetLocationURL().then(function () { + return dispatch((0, _config.setConfig)(config)); + }); + } + + function dispatchSetLocationURL() { + return dispatch((0, _connection.setLocationURL)(new URL(newLocation.toString()))); + } + + function dispatchSetRoom() { + return dispatch((0, _conference.setRoom)(newLocation.room)); + } +} + +function _appNavigateToOptionalLocation(dispatch, getState, location) { + if (!location || !location.host) { + var defaultLocation = (0, _util.parseURIString)(getState()['features/app'].app._getDefaultURL()); + + if (location) { + location.host = defaultLocation.host; + + location.hostname = defaultLocation.hostname; + location.port = defaultLocation.port; + location.protocol = defaultLocation.protocol; + } else { + location = defaultLocation; + } + } + + location.protocol || (location.protocol = 'https:'); + + _appNavigateToMandatoryLocation(dispatch, getState, location); +} + +function appWillMount(app) { + return function (dispatch) { + dispatch({ + type: _actionTypes.APP_WILL_MOUNT, + app: app + }); + + typeof APP === 'object' && APP.API.init(); + }; +} + +function appWillUnmount(app) { + return { + type: _actionTypes.APP_WILL_UNMOUNT, + app: app + }; +} + +function _loadConfig(location) { + var protocol = location.protocol.toLowerCase(); + + protocol !== 'http:' && protocol !== 'https:' && (protocol = 'https:'); + + return (0, _libJitsiMeet.loadConfig)(protocol + '//' + location.host + (location.contextRoot || '/')); +} +}, 431, null, "jitsi-meet/react/features/app/actions.js"); +__d(/* jitsi-meet/react/features/base/conference/index.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _actions = require(433 ); // 433 = ./actions + +Object.keys(_actions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actions[key]; + } + }); +}); + +var _actionTypes = require(611 ); // 611 = ./actionTypes + +Object.keys(_actionTypes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actionTypes[key]; + } + }); +}); + +var _constants = require(612 ); // 612 = ./constants + +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _constants[key]; + } + }); +}); + +var _functions = require(613 ); // 613 = ./functions + +Object.keys(_functions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _functions[key]; + } + }); +}); + +require(614 ); // 614 = ./middleware + +require(620 ); // 620 = ./reducer +}, 432, null, "jitsi-meet/react/features/base/conference/index.js"); +__d(/* jitsi-meet/react/features/base/conference/actions.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.conferenceFailed = conferenceFailed; +exports.conferenceJoined = conferenceJoined; +exports.conferenceLeft = conferenceLeft; +exports.conferenceWillLeave = conferenceWillLeave; +exports.createConference = createConference; +exports.lockStateChanged = lockStateChanged; +exports._setAudioOnlyVideoMuted = _setAudioOnlyVideoMuted; +exports.setLargeVideoHDStatus = setLargeVideoHDStatus; +exports.setLastN = setLastN; +exports.setPassword = setPassword; +exports.setRoom = setRoom; +exports.toggleAudioOnly = toggleAudioOnly; + +var _libJitsiMeet = require(434 ); // 434 = ../lib-jitsi-meet + +var _media = require(567 ); // 567 = ../media + +var _participants = require(540 ); // 540 = ../participants + +var _tracks = require(580 ); // 580 = ../tracks + +var _actionTypes = require(611 ); // 611 = ./actionTypes + +var _constants = require(612 ); // 612 = ./constants + +var _functions = require(613 ); // 613 = ./functions + +function _addConferenceListeners(conference, dispatch) { + + conference.on(_libJitsiMeet.JitsiConferenceEvents.CONFERENCE_FAILED, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return dispatch(conferenceFailed.apply(undefined, [conference].concat(args))); + }); + conference.on(_libJitsiMeet.JitsiConferenceEvents.CONFERENCE_JOINED, function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return dispatch(conferenceJoined.apply(undefined, [conference].concat(args))); + }); + conference.on(_libJitsiMeet.JitsiConferenceEvents.CONFERENCE_LEFT, function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return dispatch(conferenceLeft.apply(undefined, [conference].concat(args))); + }); + + conference.on(_libJitsiMeet.JitsiConferenceEvents.LOCK_STATE_CHANGED, function () { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + return dispatch(lockStateChanged.apply(undefined, [conference].concat(args))); + }); + + conference.on(_libJitsiMeet.JitsiConferenceEvents.TRACK_ADDED, function (t) { + return t && !t.isLocal() && dispatch((0, _tracks.trackAdded)(t)); + }); + conference.on(_libJitsiMeet.JitsiConferenceEvents.TRACK_REMOVED, function (t) { + return t && !t.isLocal() && dispatch((0, _tracks.trackRemoved)(t)); + }); + + conference.on(_libJitsiMeet.JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, function () { + return dispatch(_participants.dominantSpeakerChanged.apply(undefined, arguments)); + }); + + conference.on(_libJitsiMeet.JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED, function () { + return dispatch(_participants.participantConnectionStatusChanged.apply(undefined, arguments)); + }); + + conference.on(_libJitsiMeet.JitsiConferenceEvents.USER_JOINED, function (id, user) { + return dispatch((0, _participants.participantJoined)({ + id: id, + name: user.getDisplayName(), + role: user.getRole() + })); + }); + conference.on(_libJitsiMeet.JitsiConferenceEvents.USER_LEFT, function () { + return dispatch(_participants.participantLeft.apply(undefined, arguments)); + }); + conference.on(_libJitsiMeet.JitsiConferenceEvents.USER_ROLE_CHANGED, function () { + return dispatch(_participants.participantRoleChanged.apply(undefined, arguments)); + }); + + conference.addCommandListener(_constants.AVATAR_ID_COMMAND, function (data, id) { + return dispatch((0, _participants.participantUpdated)({ + id: id, + avatarID: data.value + })); + }); + conference.addCommandListener(_constants.AVATAR_URL_COMMAND, function (data, id) { + return dispatch((0, _participants.participantUpdated)({ + id: id, + avatarURL: data.value + })); + }); + conference.addCommandListener(_constants.EMAIL_COMMAND, function (data, id) { + return dispatch((0, _participants.participantUpdated)({ + id: id, + email: data.value + })); + }); +} + +function _setLocalParticipantData(conference, state) { + var _getLocalParticipant = (0, _participants.getLocalParticipant)(state), + avatarID = _getLocalParticipant.avatarID; + + conference.removeCommand(_constants.AVATAR_ID_COMMAND); + conference.sendCommand(_constants.AVATAR_ID_COMMAND, { + value: avatarID + }); +} + +function conferenceFailed(conference, error) { + return { + type: _actionTypes.CONFERENCE_FAILED, + conference: conference, + error: error + }; +} + +function conferenceJoined(conference) { + return function (dispatch, getState) { + var localTracks = getState()['features/base/tracks'].filter(function (t) { + return t.local; + }).map(function (t) { + return t.jitsiTrack; + }); + + if (localTracks.length) { + (0, _functions._addLocalTracksToConference)(conference, localTracks); + } + + dispatch({ + type: _actionTypes.CONFERENCE_JOINED, + conference: conference + }); + }; +} + +function conferenceLeft(conference) { + return { + type: _actionTypes.CONFERENCE_LEFT, + conference: conference + }; +} + +function _conferenceWillJoin(conference) { + return { + type: _actionTypes.CONFERENCE_WILL_JOIN, + conference: conference + }; +} + +function conferenceWillLeave(conference) { + return { + type: _actionTypes.CONFERENCE_WILL_LEAVE, + conference: conference + }; +} + +function createConference() { + return function (dispatch, getState) { + var state = getState(); + var _state$featuresBase = state['features/base/connection'], + connection = _state$featuresBase.connection, + locationURL = _state$featuresBase.locationURL; + + + if (!connection) { + throw new Error('Cannot create a conference without a connection!'); + } + + var _state$featuresBase2 = state['features/base/conference'], + password = _state$featuresBase2.password, + room = _state$featuresBase2.room; + + + if (!room) { + throw new Error('Cannot join a conference without a room name!'); + } + + var conference = connection.initJitsiConference(room.toLowerCase(), state['features/base/config']); + + conference[_constants.JITSI_CONFERENCE_URL_KEY] = locationURL; + dispatch(_conferenceWillJoin(conference)); + + _addConferenceListeners(conference, dispatch); + + _setLocalParticipantData(conference, state); + + conference.join(password); + }; +} + +function lockStateChanged(conference, locked) { + return { + type: _actionTypes.LOCK_STATE_CHANGED, + conference: conference, + locked: locked + }; +} + +function _setAudioOnly(audioOnly) { + return { + type: _actionTypes.SET_AUDIO_ONLY, + audioOnly: audioOnly + }; +} + +function _setAudioOnlyVideoMuted(muted) { + return function (dispatch, getState) { + if (muted) { + var video = getState()['features/base/media'].video; + + + if (video.muted) { + return; + } + } else { + var audioOnlyVideoMuted = getState()['features/base/conference'].audioOnlyVideoMuted; + + + if (!audioOnlyVideoMuted) { + return; + } + } + + dispatch({ + type: _actionTypes._SET_AUDIO_ONLY_VIDEO_MUTED, + muted: muted + }); + dispatch((0, _media.setVideoMuted)(muted)); + }; +} + +function setLargeVideoHDStatus(isLargeVideoHD) { + return { + type: _actionTypes.SET_LARGE_VIDEO_HD_STATUS, + isLargeVideoHD: isLargeVideoHD + }; +} + +function setLastN(lastN) { + return function (dispatch, getState) { + if (typeof lastN === 'undefined') { + var config = getState()['features/base/config']; + + lastN = config.channelLastN; + if (typeof lastN === 'undefined') { + lastN = -1; + } + } + + dispatch({ + type: _actionTypes.SET_LASTN, + lastN: lastN + }); + }; +} + +function setPassword(conference, method, password) { + return function (dispatch, getState) { + switch (method) { + case conference.join: + { + var state = getState()['features/base/conference']; + + if (state.passwordRequired === conference) { + dispatch({ + type: _actionTypes.SET_PASSWORD, + conference: conference, + method: method, + password: password + }); + + state = getState()['features/base/conference']; + if (state.password === password && !state.passwordRequired && !state.conference) { + method.call(conference, password); + } + } + break; + } + + case conference.lock: + { + var _state = getState()['features/base/conference']; + + if (_state.conference === conference) { + return method.call(conference, password).then(function () { + return dispatch({ + type: _actionTypes.SET_PASSWORD, + conference: conference, + method: method, + password: password + }); + }).catch(function (error) { + return dispatch({ + type: _actionTypes.SET_PASSWORD_FAILED, + error: error + }); + }); + } + + return Promise.reject(); + } + } + }; +} + +function setRoom(room) { + return { + type: _actionTypes.SET_ROOM, + room: room + }; +} + +function toggleAudioOnly() { + return function (dispatch, getState) { + var audioOnly = getState()['features/base/conference'].audioOnly; + + + return dispatch(_setAudioOnly(!audioOnly)); + }; +} +}, 433, null, "jitsi-meet/react/features/base/conference/actions.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/index.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.JitsiTrackEvents = exports.JitsiTrackErrors = exports.JitsiParticipantConnectionStatus = exports.JitsiConnectionEvents = exports.JitsiConnectionErrors = exports.JitsiConferenceEvents = exports.JitsiConferenceErrors = exports.default = undefined; + +var _actions = require(435 ); // 435 = ./actions + +Object.keys(_actions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actions[key]; + } + }); +}); + +var _actionTypes = require(493 ); // 493 = ./actionTypes + +Object.keys(_actionTypes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actionTypes[key]; + } + }); +}); + +var _constants = require(494 ); // 494 = ./constants + +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _constants[key]; + } + }); +}); + +var _functions = require(495 ); // 495 = ./functions + +Object.keys(_functions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _functions[key]; + } + }); +}); + +var _ = require(436 ); // 436 = ./_ + +var _2 = babelHelpers.interopRequireDefault(_); + +require(533 ); // 533 = ./middleware + +require(610 ); // 610 = ./reducer + +exports.default = _2.default; +var JitsiConferenceErrors = exports.JitsiConferenceErrors = _2.default.errors.conference; +var JitsiConferenceEvents = exports.JitsiConferenceEvents = _2.default.events.conference; +var JitsiConnectionErrors = exports.JitsiConnectionErrors = _2.default.errors.connection; +var JitsiConnectionEvents = exports.JitsiConnectionEvents = _2.default.events.connection; +var JitsiParticipantConnectionStatus = exports.JitsiParticipantConnectionStatus = _2.default.constants.participantConnectionStatus; +var JitsiTrackErrors = exports.JitsiTrackErrors = _2.default.errors.track; +var JitsiTrackEvents = exports.JitsiTrackEvents = _2.default.events.track; +}, 434, null, "jitsi-meet/react/features/base/lib-jitsi-meet/index.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/actions.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.disposeLib = disposeLib; +exports.initLib = initLib; +exports.libInitError = libInitError; +exports.setWebRTCReady = setWebRTCReady; + +var _ = require(436 ); // 436 = ./_ + +var _2 = babelHelpers.interopRequireDefault(_); + +var _actionTypes = require(493 ); // 493 = ./actionTypes + +function disposeLib() { + return function (dispatch) { + dispatch({ type: _actionTypes.LIB_WILL_DISPOSE }); + + dispatch({ type: _actionTypes.LIB_DID_DISPOSE }); + }; +} + +function initLib() { + return function (dispatch, getState) { + var config = getState()['features/base/config']; + + if (!config) { + throw new Error('Cannot init lib-jitsi-meet without config'); + } + + if (typeof APP !== 'undefined') { + return Promise.resolve(); + } + + dispatch({ type: _actionTypes.LIB_WILL_INIT }); + + return _2.default.init(config).then(function () { + return dispatch({ type: _actionTypes.LIB_DID_INIT }); + }).catch(function (error) { + dispatch(libInitError(error)); + + console.error('lib-jitsi-meet failed to init:', error); + throw error; + }); + }; +} + +function libInitError(error) { + return { + type: _actionTypes.LIB_INIT_ERROR, + error: error + }; +} + +function setWebRTCReady(webRTCReady) { + return function (dispatch, getState) { + if (getState()['features/base/lib-jitsi-meet'].webRTCReady !== webRTCReady) { + dispatch({ + type: _actionTypes.SET_WEBRTC_READY, + webRTCReady: webRTCReady + }); + + switch (typeof webRTCReady) { + case 'function': + case 'object': + { + var then = webRTCReady.then; + + + if (typeof then === 'function') { + var onFulfilled = function onFulfilled(value) { + if (getState()['features/base/lib-jitsi-meet'].webRTCReady === webRTCReady) { + dispatch(setWebRTCReady(value)); + } + }; + + then.call(webRTCReady, function () { + return onFulfilled(true); + }, function () { + return onFulfilled(false); + }); + } + break; + } + } + } + }; +} +}, 435, null, "jitsi-meet/react/features/base/lib-jitsi-meet/actions.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/_.native.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +require(437 ); // 437 = ./native + +var _libJitsiMeet = require(488 ); // 488 = lib-jitsi-meet/lib-jitsi-meet.min + +var _libJitsiMeet2 = babelHelpers.interopRequireDefault(_libJitsiMeet); + +(function (global) { + if (typeof global.$ === 'undefined') { + var jQuery = require(489 ); // 489 = jquery + + jQuery(global); + global.$ = jQuery; + } + + if (typeof global.Strophe === 'undefined') { + require(490 ); // 490 = strophe + require(491 ); // 491 = strophejs-plugins/disco/strophe.disco + require(492 ); // 492 = strophejs-plugins/caps/strophe.caps.jsonly + } +})(global || window || this);exports.default = _libJitsiMeet2.default; +}, 436, null, "jitsi-meet/react/features/base/lib-jitsi-meet/_.native.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/native/index.js */function(global, require, module, exports) {require(438 ); // 438 = ./polyfills-browser + +require(487 ); // 487 = ./polyfills-browserify +}, 437, null, "jitsi-meet/react/features/base/lib-jitsi-meet/native/index.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-browser.js */function(global, require, module, exports) {var _es6Iterator = require(439 ); // 439 = es6-iterator + +var _es6Iterator2 = babelHelpers.interopRequireDefault(_es6Iterator); + +var _reactNativeBackgroundTimer = require(459 ); // 459 = react-native-background-timer + +var _reactNativeBackgroundTimer2 = babelHelpers.interopRequireDefault(_reactNativeBackgroundTimer); + +require(460 ); // 460 = url-polyfill + +function _getCommonPrototype(a, b) { + if (a === b) { + return a; + } + + var p = void 0; + + if ((p = Object.getPrototypeOf(a)) && (p = _getCommonPrototype(b, p))) { + return p; + } + if ((p = Object.getPrototypeOf(b)) && (p = _getCommonPrototype(a, p))) { + return p; + } + + return undefined; +} + +function _querySelector(node, selectors) { + var element = null; + + node && _visitNode(node, function (n) { + if (n.nodeType === 1 && n.nodeName === selectors) { + element = n; + + return true; + } + + return false; + }); + + return element; +} + +function _visitNode(node, callback) { + if (callback(node)) { + return true; + } + + if (node = node.firstChild) { + do { + if (_visitNode(node, callback)) { + return true; + } + } while (node = node.nextSibling); + } + + return false; +} + +(function (global) { + var DOMParser = require(461 ).DOMParser; // 461 = xmldom + + if (typeof global.addEventListener === 'undefined') { + global.addEventListener = function () {}; + } + + var arrayPrototype = Array.prototype; + + if (typeof arrayPrototype['@@iterator'] === 'undefined') { + arrayPrototype['@@iterator'] = function () { + return new _es6Iterator2.default(this); + }; + } + + if (typeof global.document === 'undefined') { + var document = new DOMParser().parseFromString('', 'text/xml'); + + if (typeof document.addEventListener === 'undefined') { + document.addEventListener = function () {}; + } + + var documentPrototype = Object.getPrototypeOf(document); + + if (documentPrototype) { + if (typeof documentPrototype.querySelector === 'undefined') { + documentPrototype.querySelector = function (selectors) { + return _querySelector(this.elementNode, selectors); + }; + } + } + + var elementPrototype = Object.getPrototypeOf(document.documentElement); + + if (elementPrototype) { + if (typeof elementPrototype.querySelector === 'undefined') { + elementPrototype.querySelector = function (selectors) { + return _querySelector(this, selectors); + }; + } + + if (!elementPrototype.hasOwnProperty('innerHTML')) { + Object.defineProperty(elementPrototype, 'innerHTML', { + get: function get() { + return this.childNodes.toString(); + }, + set: function set(innerHTML) { + this.textContent = ''; + + var d = new DOMParser().parseFromString('
' + innerHTML + '
', 'text/xml'); + + var documentElement = d.documentElement; + var child = void 0; + + while (child = documentElement.firstChild) { + this.appendChild(child); + } + } + }); + } + } + + var nodePrototype = _getCommonPrototype(documentPrototype, elementPrototype); + + if (nodePrototype && nodePrototype !== Object.getPrototypeOf({})) { + var console = global.console; + + if (console) { + var loggerLevels = require(464 ).levels; // 464 = jitsi-meet-logger + + Object.keys(loggerLevels).forEach(function (key) { + var level = loggerLevels[key]; + var consoleLog = console[level]; + + if (typeof consoleLog === 'function') { + console[level] = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var length = args.length; + + for (var i = 0; i < length; ++i) { + var arg = args[i]; + + if (arg && typeof arg !== 'string' && nodePrototype.isPrototypeOf(arg)) { + var _toString = arg.toString; + + if (_toString) { + arg = _toString.call(arg); + } + } + args[i] = arg; + } + + consoleLog.apply(this, args); + }; + } + }); + } + } + + global.document = document; + } + + if (typeof global.location === 'undefined') { + global.location = { + href: '' + }; + } + + var navigator = global.navigator; + + + if (navigator) { + if (typeof navigator.platform === 'undefined') { + navigator.platform = ''; + } + + if (typeof navigator.plugins === 'undefined') { + navigator.plugins = []; + } + + (function () { + var reactNativePackageJSON = require(467 ); // 467 = react-native/package.json + var userAgent = reactNativePackageJSON.name || 'react-native'; + + var version = reactNativePackageJSON.version; + + if (version) { + userAgent += '/' + version; + } + + if (typeof navigator.userAgent !== 'undefined') { + var s = navigator.userAgent.toString(); + + if (s.length > 0 && s.indexOf(userAgent) === -1) { + userAgent = s + ' ' + userAgent; + } + } + + navigator.userAgent = userAgent; + })(); + } + + if (typeof global.performance === 'undefined') { + global.performance = { + now: function now() { + return 0; + } + }; + } + + if (typeof global.sessionStorage === 'undefined') { + global.sessionStorage = { + getItem: function getItem() {}, + removeItem: function removeItem() {}, + setItem: function setItem() {} + }; + } + + require(468 ); // 468 = ./polyfills-webrtc + + if (global.XMLHttpRequest) { + var prototype = global.XMLHttpRequest.prototype; + + if (prototype && !prototype.hasOwnProperty('responseXML')) { + Object.defineProperty(prototype, 'responseXML', { + get: function get() { + var responseText = this.responseText; + var responseXML = void 0; + + if (responseText) { + responseXML = new DOMParser().parseFromString(responseText, 'text/xml'); + } + + return responseXML; + } + }); + } + } + + global.clearTimeout = window.clearTimeout = _reactNativeBackgroundTimer2.default.clearTimeout.bind(_reactNativeBackgroundTimer2.default); + global.clearInterval = window.clearInterval = _reactNativeBackgroundTimer2.default.clearInterval.bind(_reactNativeBackgroundTimer2.default); + global.setInterval = window.setInterval = _reactNativeBackgroundTimer2.default.setInterval.bind(_reactNativeBackgroundTimer2.default); + global.setTimeout = window.setTimeout = _reactNativeBackgroundTimer2.default.setTimeout.bind(_reactNativeBackgroundTimer2.default); +})(global || window || this); +}, 438, null, "jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-browser.js"); +__d(/* es6-iterator/index.js */function(global, require, module, exports) {'use strict'; + +var clear = require(440 ), // 440 = es5-ext/array/#/clear + assign = require(18 ), // 18 = es5-ext/object/assign + callable = require(441 ), // 441 = es5-ext/object/valid-callable + value = require(26 ), // 26 = es5-ext/object/valid-value + d = require(17 ), // 17 = d + autoBind = require(442 ), // 442 = d/auto-bind + Symbol = require(447 ), // 447 = es6-symbol + defineProperty = Object.defineProperty, + defineProperties = Object.defineProperties, + _Iterator; + +module.exports = _Iterator = function Iterator(list, context) { + if (!(this instanceof _Iterator)) return new _Iterator(list, context); + defineProperties(this, { + __list__: d('w', value(list)), + __context__: d('w', context), + __nextIndex__: d('w', 0) + }); + if (!context) return; + callable(context.on); + context.on('_add', this._onAdd); + context.on('_delete', this._onDelete); + context.on('_clear', this._onClear); +}; + +defineProperties(_Iterator.prototype, assign({ + constructor: d(_Iterator), + _next: d(function () { + var i; + if (!this.__list__) return; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + }), + next: d(function () { + return this._createResult(this._next()); + }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { + return this.__list__[i]; + }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off('_add', this._onAdd); + this.__context__.off('_delete', this._onDelete); + this.__context__.off('_clear', this._onClear); + this.__context__ = null; + }), + toString: d(function () { + return '[object Iterator]'; + }) +}, autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, '__redo__', d('c', [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, i) { + if (redo > index) this.__redo__[i] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) +}))); + +defineProperty(_Iterator.prototype, typeof Symbol === 'function' ? Symbol.iterator : '@@iterator', d(function () { + return this; +})); +defineProperty(_Iterator.prototype, typeof Symbol === 'function' ? Symbol.toStringTag : '@@toStringTag', d('', 'Iterator')); +}, 439, null, "es6-iterator/index.js"); +__d(/* es5-ext/array/#/clear.js */function(global, require, module, exports) { + +"use strict"; + +var value = require(26 ); // 26 = ../../object/valid-value + +module.exports = function () { + value(this).length = 0; + return this; +}; +}, 440, null, "es5-ext/array/#/clear.js"); +__d(/* es5-ext/object/valid-callable.js */function(global, require, module, exports) {"use strict"; + +module.exports = function (fn) { + if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); + return fn; +}; +}, 441, null, "es5-ext/object/valid-callable.js"); +__d(/* d/auto-bind.js */function(global, require, module, exports) {'use strict'; + +var copy = require(443 ), // 443 = es5-ext/object/copy + normalizeOptions = require(27 ), // 27 = es5-ext/object/normalize-options + ensureCallable = require(441 ), // 441 = es5-ext/object/valid-callable + map = require(456 ), // 456 = es5-ext/object/map + callable = require(441 ), // 441 = es5-ext/object/valid-callable + validValue = require(26 ), // 26 = es5-ext/object/valid-value + bind = Function.prototype.bind, + defineProperty = Object.defineProperty, + hasOwnProperty = Object.prototype.hasOwnProperty, + define; + +define = function define(name, desc, options) { + var value = validValue(desc) && callable(desc.value), + dgs; + dgs = copy(desc); + delete dgs.writable; + delete dgs.value; + dgs.get = function () { + if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value; + desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this); + defineProperty(this, name, desc); + return this[name]; + }; + return dgs; +}; + +module.exports = function (props) { + var options = normalizeOptions(arguments[1]); + if (options.resolveContext != null) ensureCallable(options.resolveContext); + return map(props, function (desc, name) { + return define(name, desc, options); + }); +}; +}, 442, null, "d/auto-bind.js"); +__d(/* es5-ext/object/copy.js */function(global, require, module, exports) {"use strict"; + +var aFrom = require(444 ), // 444 = ../array/from + assign = require(18 ), // 18 = ./assign + value = require(26 ); // 26 = ./valid-value + +module.exports = function (obj) { + var copy = Object(value(obj)), + propertyNames = arguments[1], + options = Object(arguments[2]); + if (copy !== obj && !propertyNames) return copy; + var result = {}; + if (propertyNames) { + aFrom(propertyNames, function (propertyName) { + if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; + }); + } else { + assign(result, obj); + } + return result; +}; +}, 443, null, "es5-ext/object/copy.js"); +__d(/* es5-ext/array/from/index.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(445 )() ? Array.from : require(446 ); // 446 = ./shim // 445 = ./is-implemented +}, 444, null, "es5-ext/array/from/index.js"); +__d(/* es5-ext/array/from/is-implemented.js */function(global, require, module, exports) {"use strict"; + +module.exports = function () { + var from = Array.from, + arr, + result; + if (typeof from !== "function") return false; + arr = ["raz", "dwa"]; + result = from(arr); + return Boolean(result && result !== arr && result[1] === "dwa"); +}; +}, 445, null, "es5-ext/array/from/is-implemented.js"); +__d(/* es5-ext/array/from/shim.js */function(global, require, module, exports) {"use strict"; + +var iteratorSymbol = require(447 ).iterator, // 447 = es6-symbol + isArguments = require(448 ), // 448 = ../../function/is-arguments + isFunction = require(449 ), // 449 = ../../function/is-function + toPosInt = require(450 ), // 450 = ../../number/to-pos-integer + callable = require(441 ), // 441 = ../../object/valid-callable + validValue = require(26 ), // 26 = ../../object/valid-value + isValue = require(24 ), // 24 = ../../object/is-value + isString = require(455 ), // 455 = ../../string/is-string + isArray = Array.isArray, + call = Function.prototype.call, + desc = { configurable: true, enumerable: true, writable: true, value: null }, + defineProperty = Object.defineProperty; + +module.exports = function (arrayLike) { + var mapFn = arguments[1], + thisArg = arguments[2], + Context, + i, + j, + arr, + length, + code, + iterator, + result, + getIterator, + value; + + arrayLike = Object(validValue(arrayLike)); + + if (isValue(mapFn)) callable(mapFn); + if (!this || this === Array || !isFunction(this)) { + if (!mapFn) { + if (isArguments(arrayLike)) { + length = arrayLike.length; + if (length !== 1) return Array.apply(null, arrayLike); + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray(arrayLike)) { + arr = new Array(length = arrayLike.length); + for (i = 0; i < length; ++i) { + arr[i] = arrayLike[i]; + }return arr; + } + } + arr = []; + } else { + Context = this; + } + + if (!isArray(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { + iterator = callable(getIterator).call(arrayLike); + if (Context) arr = new Context(); + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + result = iterator.next(); + ++i; + } + length = i; + } else if (isString(arrayLike)) { + length = arrayLike.length; + if (Context) arr = new Context(); + for (i = 0, j = 0; i < length; ++i) { + value = arrayLike[i]; + if (i + 1 < length) { + code = value.charCodeAt(0); + + if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; + } + value = mapFn ? call.call(mapFn, thisArg, value, j) : value; + if (Context) { + desc.value = value; + defineProperty(arr, j, desc); + } else { + arr[j] = value; + } + ++j; + } + length = j; + } + } + if (length === undefined) { + length = toPosInt(arrayLike.length); + if (Context) arr = new Context(length); + for (i = 0; i < length; ++i) { + value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + } + } + if (Context) { + desc.value = null; + arr.length = length; + } + return arr; +}; +}, 446, null, "es5-ext/array/from/shim.js"); +__d(/* es6-symbol/index.js */function(global, require, module, exports) {'use strict'; + +module.exports = require(14 )() ? Symbol : require(16 ); // 16 = ./polyfill // 14 = ./is-implemented +}, 447, null, "es6-symbol/index.js"); +__d(/* es5-ext/function/is-arguments.js */function(global, require, module, exports) {"use strict"; + +var objToString = Object.prototype.toString, + id = objToString.call(function () { + return arguments; +}()); + +module.exports = function (value) { + return objToString.call(value) === id; +}; +}, 448, null, "es5-ext/function/is-arguments.js"); +__d(/* es5-ext/function/is-function.js */function(global, require, module, exports) {"use strict"; + +var objToString = Object.prototype.toString, + id = objToString.call(require(25 )); // 25 = ./noop + +module.exports = function (value) { + return typeof value === "function" && objToString.call(value) === id; +}; +}, 449, null, "es5-ext/function/is-function.js"); +__d(/* es5-ext/number/to-pos-integer.js */function(global, require, module, exports) {"use strict"; + +var toInteger = require(451 ), // 451 = ./to-integer + max = Math.max; + +module.exports = function (value) { + return max(0, toInteger(value)); +}; +}, 450, null, "es5-ext/number/to-pos-integer.js"); +__d(/* es5-ext/number/to-integer.js */function(global, require, module, exports) {"use strict"; + +var sign = require(452 ), // 452 = ../math/sign + abs = Math.abs, + floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if (value === 0 || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); +}; +}, 451, null, "es5-ext/number/to-integer.js"); +__d(/* es5-ext/math/sign/index.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(453 )() ? Math.sign : require(454 ); // 454 = ./shim // 453 = ./is-implemented +}, 452, null, "es5-ext/math/sign/index.js"); +__d(/* es5-ext/math/sign/is-implemented.js */function(global, require, module, exports) {"use strict"; + +module.exports = function () { + var sign = Math.sign; + if (typeof sign !== "function") return false; + return sign(10) === 1 && sign(-20) === -1; +}; +}, 453, null, "es5-ext/math/sign/is-implemented.js"); +__d(/* es5-ext/math/sign/shim.js */function(global, require, module, exports) {"use strict"; + +module.exports = function (value) { + value = Number(value); + if (isNaN(value) || value === 0) return value; + return value > 0 ? 1 : -1; +}; +}, 454, null, "es5-ext/math/sign/shim.js"); +__d(/* es5-ext/string/is-string.js */function(global, require, module, exports) {"use strict"; + +var objToString = Object.prototype.toString, + id = objToString.call(""); + +module.exports = function (value) { + return typeof value === "string" || value && typeof value === "object" && (value instanceof String || objToString.call(value) === id) || false; +}; +}, 455, null, "es5-ext/string/is-string.js"); +__d(/* es5-ext/object/map.js */function(global, require, module, exports) {"use strict"; + +var callable = require(441 ), // 441 = ./valid-callable + forEach = require(457 ), // 457 = ./for-each + call = Function.prototype.call; + +module.exports = function (obj, cb) { + var result = {}, + thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + result[key] = call.call(cb, thisArg, value, key, targetObj, index); + }); + return result; +}; +}, 456, null, "es5-ext/object/map.js"); +__d(/* es5-ext/object/for-each.js */function(global, require, module, exports) {"use strict"; + +module.exports = require(458 )("forEach"); // 458 = ./_iterate +}, 457, null, "es5-ext/object/for-each.js"); +__d(/* es5-ext/object/_iterate.js */function(global, require, module, exports) { + +"use strict"; + +var callable = require(441 ), // 441 = ./valid-callable + value = require(26 ), // 26 = ./valid-value + bind = Function.prototype.bind, + call = Function.prototype.call, + keys = Object.keys, + objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb) { + var list, + thisArg = arguments[2], + compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== "function") method = list[method]; + return call.call(method, list, function (key, index) { + if (!objPropertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; +}, 458, null, "es5-ext/object/_iterate.js"); +__d(/* react-native-background-timer/index.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactNative = require(69 ); // 69 = react-native + +var RNBackgroundTimer = _reactNative.NativeModules.RNBackgroundTimer; + +var Emitter = new _reactNative.NativeEventEmitter(RNBackgroundTimer); + +var BackgroundTimer = function () { + function BackgroundTimer() { + var _this = this; + + babelHelpers.classCallCheck(this, BackgroundTimer); + + this.uniqueId = 0; + this.callbacks = {}; + + Emitter.addListener('backgroundTimer.timeout', function (id) { + if (_this.callbacks[id]) { + var callback = _this.callbacks[id].callback; + if (!_this.callbacks[id].interval) { + delete _this.callbacks[id]; + } else { + RNBackgroundTimer.setTimeout(id, _this.callbacks[id].timeout); + } + callback(); + } + }); + } + + babelHelpers.createClass(BackgroundTimer, [{ + key: 'start', + value: function start(delay) { + return RNBackgroundTimer.start(delay); + } + }, { + key: 'stop', + value: function stop() { + return RNBackgroundTimer.stop(); + } + }, { + key: 'setTimeout', + value: function setTimeout(callback, timeout) { + var timeoutId = ++this.uniqueId; + this.callbacks[timeoutId] = { + callback: callback, + interval: false, + timeout: timeout + }; + RNBackgroundTimer.setTimeout(timeoutId, timeout); + return timeoutId; + } + }, { + key: 'clearTimeout', + value: function clearTimeout(timeoutId) { + if (this.callbacks[timeoutId]) { + delete this.callbacks[timeoutId]; + } + } + }, { + key: 'setInterval', + value: function setInterval(callback, timeout) { + var intervalId = ++this.uniqueId; + this.callbacks[intervalId] = { + callback: callback, + interval: true, + timeout: timeout + }; + RNBackgroundTimer.setTimeout(intervalId, timeout); + return intervalId; + } + }, { + key: 'clearInterval', + value: function clearInterval(intervalId) { + if (this.callbacks[intervalId]) { + delete this.callbacks[intervalId]; + } + } + }]); + return BackgroundTimer; +}(); + +; + +exports.default = new BackgroundTimer(); +}, 459, null, "react-native-background-timer/index.js"); +__d(/* url-polyfill/url.js */function(global, require, module, exports) { + +(function (scope) { + 'use strict'; + + var hasWorkingUrl = false; + if (!scope.forceJURL) { + try { + var u = new URL('b', 'http://a'); + u.pathname = 'c%20d'; + hasWorkingUrl = u.href === 'http://a/c%20d'; + } catch (e) {} + } + + if (hasWorkingUrl) return; + + var relative = Object.create(null); + relative['ftp'] = 21; + relative['file'] = 0; + relative['gopher'] = 70; + relative['http'] = 80; + relative['https'] = 443; + relative['ws'] = 80; + relative['wss'] = 443; + + var relativePathDotMapping = Object.create(null); + relativePathDotMapping['%2e'] = '.'; + relativePathDotMapping['.%2e'] = '..'; + relativePathDotMapping['%2e.'] = '..'; + relativePathDotMapping['%2e%2e'] = '..'; + + function isRelativeScheme(scheme) { + return relative[scheme] !== undefined; + } + + function invalid() { + clear.call(this); + this._isInvalid = true; + } + + function IDNAToASCII(h) { + if ('' == h) { + invalid.call(this); + } + + return h.toLowerCase(); + } + + function percentEscape(c) { + var unicode = c.charCodeAt(0); + if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1) { + return c; + } + return encodeURIComponent(c); + } + + function percentEscapeQuery(c) { + + var unicode = c.charCodeAt(0); + if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1) { + return c; + } + return encodeURIComponent(c); + } + + var EOF = undefined, + ALPHA = /[a-zA-Z]/, + ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; + + function parse(input, stateOverride, base) { + function err(message) { + errors.push(message); + } + + var state = stateOverride || 'scheme start', + cursor = 0, + buffer = '', + seenAt = false, + seenBracket = false, + errors = []; + + loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { + var c = input[cursor]; + switch (state) { + case 'scheme start': + if (c && ALPHA.test(c)) { + buffer += c.toLowerCase(); + state = 'scheme'; + } else if (!stateOverride) { + buffer = ''; + state = 'no scheme'; + continue; + } else { + err('Invalid scheme.'); + break loop; + } + break; + + case 'scheme': + if (c && ALPHANUMERIC.test(c)) { + buffer += c.toLowerCase(); + } else if (':' == c) { + this._scheme = buffer; + buffer = ''; + if (stateOverride) { + break loop; + } + if (isRelativeScheme(this._scheme)) { + this._isRelative = true; + } + if ('file' == this._scheme) { + state = 'relative'; + } else if (this._isRelative && base && base._scheme == this._scheme) { + state = 'relative or authority'; + } else if (this._isRelative) { + state = 'authority first slash'; + } else { + state = 'scheme data'; + } + } else if (!stateOverride) { + buffer = ''; + cursor = 0; + state = 'no scheme'; + continue; + } else if (EOF == c) { + break loop; + } else { + err('Code point not allowed in scheme: ' + c); + break loop; + } + break; + + case 'scheme data': + if ('?' == c) { + query = '?'; + state = 'query'; + } else if ('#' == c) { + this._fragment = '#'; + state = 'fragment'; + } else { + if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { + this._schemeData += percentEscape(c); + } + } + break; + + case 'no scheme': + if (!base || !isRelativeScheme(base._scheme)) { + err('Missing scheme.'); + invalid.call(this); + } else { + state = 'relative'; + continue; + } + break; + + case 'relative or authority': + if ('/' == c && '/' == input[cursor + 1]) { + state = 'authority ignore slashes'; + } else { + err('Expected /, got: ' + c); + state = 'relative'; + continue; + } + break; + + case 'relative': + this._isRelative = true; + if ('file' != this._scheme) this._scheme = base._scheme; + if (EOF == c) { + this._host = base._host; + this._port = base._port; + this._path = base._path.slice(); + this._query = base._query; + this._username = base._username; + this._password = base._password; + break loop; + } else if ('/' == c || '\\' == c) { + if ('\\' == c) err('\\ is an invalid code point.'); + state = 'relative slash'; + } else if ('?' == c) { + this._host = base._host; + this._port = base._port; + this._path = base._path.slice(); + this._query = '?'; + this._username = base._username; + this._password = base._password; + state = 'query'; + } else if ('#' == c) { + this._host = base._host; + this._port = base._port; + this._path = base._path.slice(); + this._query = base._query; + this._fragment = '#'; + this._username = base._username; + this._password = base._password; + state = 'fragment'; + } else { + var nextC = input[cursor + 1]; + var nextNextC = input[cursor + 2]; + if ('file' != this._scheme || !ALPHA.test(c) || nextC != ':' && nextC != '|' || EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC) { + this._host = base._host; + this._port = base._port; + this._username = base._username; + this._password = base._password; + this._path = base._path.slice(); + this._path.pop(); + } + state = 'relative path'; + continue; + } + break; + + case 'relative slash': + if ('/' == c || '\\' == c) { + if ('\\' == c) { + err('\\ is an invalid code point.'); + } + if ('file' == this._scheme) { + state = 'file host'; + } else { + state = 'authority ignore slashes'; + } + } else { + if ('file' != this._scheme) { + this._host = base._host; + this._port = base._port; + this._username = base._username; + this._password = base._password; + } + state = 'relative path'; + continue; + } + break; + + case 'authority first slash': + if ('/' == c) { + state = 'authority second slash'; + } else { + err("Expected '/', got: " + c); + state = 'authority ignore slashes'; + continue; + } + break; + + case 'authority second slash': + state = 'authority ignore slashes'; + if ('/' != c) { + err("Expected '/', got: " + c); + continue; + } + break; + + case 'authority ignore slashes': + if ('/' != c && '\\' != c) { + state = 'authority'; + continue; + } else { + err('Expected authority, got: ' + c); + } + break; + + case 'authority': + if ('@' == c) { + if (seenAt) { + err('@ already seen.'); + buffer += '%40'; + } + seenAt = true; + for (var i = 0; i < buffer.length; i++) { + var cp = buffer[i]; + if ('\t' == cp || '\n' == cp || '\r' == cp) { + err('Invalid whitespace in authority.'); + continue; + } + + if (':' == cp && null === this._password) { + this._password = ''; + continue; + } + var tempC = percentEscape(cp); + null !== this._password ? this._password += tempC : this._username += tempC; + } + buffer = ''; + } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { + cursor -= buffer.length; + buffer = ''; + state = 'host'; + continue; + } else { + buffer += c; + } + break; + + case 'file host': + if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { + if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { + state = 'relative path'; + } else if (buffer.length == 0) { + state = 'relative path start'; + } else { + this._host = IDNAToASCII.call(this, buffer); + buffer = ''; + state = 'relative path start'; + } + continue; + } else if ('\t' == c || '\n' == c || '\r' == c) { + err('Invalid whitespace in file host.'); + } else { + buffer += c; + } + break; + + case 'host': + case 'hostname': + if (':' == c && !seenBracket) { + this._host = IDNAToASCII.call(this, buffer); + buffer = ''; + state = 'port'; + if ('hostname' == stateOverride) { + break loop; + } + } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { + this._host = IDNAToASCII.call(this, buffer); + buffer = ''; + state = 'relative path start'; + if (stateOverride) { + break loop; + } + continue; + } else if ('\t' != c && '\n' != c && '\r' != c) { + if ('[' == c) { + seenBracket = true; + } else if (']' == c) { + seenBracket = false; + } + buffer += c; + } else { + err('Invalid code point in host/hostname: ' + c); + } + break; + + case 'port': + if (/[0-9]/.test(c)) { + buffer += c; + } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { + if ('' != buffer) { + var temp = parseInt(buffer, 10); + if (temp != relative[this._scheme]) { + this._port = temp + ''; + } + buffer = ''; + } + if (stateOverride) { + break loop; + } + state = 'relative path start'; + continue; + } else if ('\t' == c || '\n' == c || '\r' == c) { + err('Invalid code point in port: ' + c); + } else { + invalid.call(this); + } + break; + + case 'relative path start': + if ('\\' == c) err("'\\' not allowed in path."); + state = 'relative path'; + if ('/' != c && '\\' != c) { + continue; + } + break; + + case 'relative path': + if (EOF == c || '/' == c || '\\' == c || !stateOverride && ('?' == c || '#' == c)) { + if ('\\' == c) { + err('\\ not allowed in relative path.'); + } + var tmp; + if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { + buffer = tmp; + } + if ('..' == buffer) { + this._path.pop(); + if ('/' != c && '\\' != c) { + this._path.push(''); + } + } else if ('.' == buffer && '/' != c && '\\' != c) { + this._path.push(''); + } else if ('.' != buffer) { + if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { + buffer = buffer[0] + ':'; + } + this._path.push(buffer); + } + buffer = ''; + if ('?' == c) { + this._query = '?'; + state = 'query'; + } else if ('#' == c) { + this._fragment = '#'; + state = 'fragment'; + } + } else if ('\t' != c && '\n' != c && '\r' != c) { + buffer += percentEscape(c); + } + break; + + case 'query': + if (!stateOverride && '#' == c) { + this._fragment = '#'; + state = 'fragment'; + } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { + this._query += percentEscapeQuery(c); + } + break; + + case 'fragment': + if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { + this._fragment += c; + } + break; + } + + cursor++; + } + } + + function clear() { + this._scheme = ''; + this._schemeData = ''; + this._username = ''; + this._password = null; + this._host = ''; + this._port = ''; + this._path = []; + this._query = ''; + this._fragment = ''; + this._isInvalid = false; + this._isRelative = false; + } + + function jURL(url, base) { + if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base)); + + url = String(url); + + this._url = url; + clear.call(this); + + var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); + + + parse.call(this, input, null, base); + } + + jURL.prototype = { + toString: function toString() { + return this.href; + }, + get href() { + if (this._isInvalid) return this._url; + + var authority = ''; + if ('' != this._username || null != this._password) { + authority = this._username + (null != this._password ? ':' + this._password : '') + '@'; + } + + return this.protocol + (this._isRelative ? '//' + authority + this.host : '') + this.pathname + this._query + this._fragment; + }, + set href(href) { + clear.call(this); + parse.call(this, href); + }, + + get protocol() { + return this._scheme + ':'; + }, + set protocol(protocol) { + if (this._isInvalid) return; + parse.call(this, protocol + ':', 'scheme start'); + }, + + get host() { + return this._isInvalid ? '' : this._port ? this._host + ':' + this._port : this._host; + }, + set host(host) { + if (this._isInvalid || !this._isRelative) return; + parse.call(this, host, 'host'); + }, + + get hostname() { + return this._host; + }, + set hostname(hostname) { + if (this._isInvalid || !this._isRelative) return; + parse.call(this, hostname, 'hostname'); + }, + + get port() { + return this._port; + }, + set port(port) { + if (this._isInvalid || !this._isRelative) return; + parse.call(this, port, 'port'); + }, + + get pathname() { + return this._isInvalid ? '' : this._isRelative ? '/' + this._path.join('/') : this._schemeData; + }, + set pathname(pathname) { + if (this._isInvalid || !this._isRelative) return; + this._path = []; + parse.call(this, pathname, 'relative path start'); + }, + + get search() { + return this._isInvalid || !this._query || '?' == this._query ? '' : this._query; + }, + set search(search) { + if (this._isInvalid || !this._isRelative) return; + this._query = '?'; + if ('?' == search[0]) search = search.slice(1); + parse.call(this, search, 'query'); + }, + + get hash() { + return this._isInvalid || !this._fragment || '#' == this._fragment ? '' : this._fragment; + }, + set hash(hash) { + if (this._isInvalid) return; + this._fragment = '#'; + if ('#' == hash[0]) hash = hash.slice(1); + parse.call(this, hash, 'fragment'); + }, + + get origin() { + var host; + if (this._isInvalid || !this._scheme) { + return ''; + } + + switch (this._scheme) { + case 'data': + case 'file': + case 'javascript': + case 'mailto': + return 'null'; + } + host = this.host; + if (!host) { + return ''; + } + return this._scheme + '://' + host; + } + }; + + var OriginalURL = scope.URL; + if (OriginalURL) { + jURL.createObjectURL = function (blob) { + return OriginalURL.createObjectURL.apply(OriginalURL, arguments); + }; + jURL.revokeObjectURL = function (url) { + OriginalURL.revokeObjectURL(url); + }; + } + + scope.URL = jURL; +})(this); +}, 460, null, "url-polyfill/url.js"); +__d(/* xmldom/dom-parser.js */function(global, require, module, exports) {function DOMParser(options) { + this.options = options || { locator: {} }; +} +DOMParser.prototype.parseFromString = function (source, mimeType) { + var options = this.options; + var sax = new XMLReader(); + var domBuilder = options.domBuilder || new DOMHandler(); + var errorHandler = options.errorHandler; + var locator = options.locator; + var defaultNSMap = options.xmlns || {}; + var entityMap = { 'lt': '<', 'gt': '>', 'amp': '&', 'quot': '"', 'apos': "'" }; + if (locator) { + domBuilder.setDocumentLocator(locator); + } + + sax.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator); + sax.domBuilder = options.domBuilder || domBuilder; + if (/\/x?html?$/.test(mimeType)) { + entityMap.nbsp = '\xa0'; + entityMap.copy = '\xa9'; + defaultNSMap[''] = 'http://www.w3.org/1999/xhtml'; + } + defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace'; + if (source) { + sax.parse(source, defaultNSMap, entityMap); + } else { + sax.errorHandler.error("invalid doc source"); + } + return domBuilder.doc; +}; +function buildErrorHandler(errorImpl, domBuilder, locator) { + if (!errorImpl) { + if (domBuilder instanceof DOMHandler) { + return domBuilder; + } + errorImpl = domBuilder; + } + var errorHandler = {}; + var isCallback = errorImpl instanceof Function; + locator = locator || {}; + function build(key) { + var fn = errorImpl[key]; + if (!fn && isCallback) { + fn = errorImpl.length == 2 ? function (msg) { + errorImpl(key, msg); + } : errorImpl; + } + errorHandler[key] = fn && function (msg) { + fn('[xmldom ' + key + ']\t' + msg + _locator(locator)); + } || function () {}; + } + build('warning'); + build('error'); + build('fatalError'); + return errorHandler; +} + +function DOMHandler() { + this.cdata = false; +} +function position(locator, node) { + node.lineNumber = locator.lineNumber; + node.columnNumber = locator.columnNumber; +} + +DOMHandler.prototype = { + startDocument: function startDocument() { + this.doc = new DOMImplementation().createDocument(null, null, null); + if (this.locator) { + this.doc.documentURI = this.locator.systemId; + } + }, + startElement: function startElement(namespaceURI, localName, qName, attrs) { + var doc = this.doc; + var el = doc.createElementNS(namespaceURI, qName || localName); + var len = attrs.length; + appendElement(this, el); + this.currentElement = el; + + this.locator && position(this.locator, el); + for (var i = 0; i < len; i++) { + var namespaceURI = attrs.getURI(i); + var value = attrs.getValue(i); + var qName = attrs.getQName(i); + var attr = doc.createAttributeNS(namespaceURI, qName); + this.locator && position(attrs.getLocator(i), attr); + attr.value = attr.nodeValue = value; + el.setAttributeNode(attr); + } + }, + endElement: function endElement(namespaceURI, localName, qName) { + var current = this.currentElement; + var tagName = current.tagName; + this.currentElement = current.parentNode; + }, + startPrefixMapping: function startPrefixMapping(prefix, uri) {}, + endPrefixMapping: function endPrefixMapping(prefix) {}, + processingInstruction: function processingInstruction(target, data) { + var ins = this.doc.createProcessingInstruction(target, data); + this.locator && position(this.locator, ins); + appendElement(this, ins); + }, + ignorableWhitespace: function ignorableWhitespace(ch, start, length) {}, + characters: function characters(chars, start, length) { + chars = _toString.apply(this, arguments); + + if (chars) { + if (this.cdata) { + var charNode = this.doc.createCDATASection(chars); + } else { + var charNode = this.doc.createTextNode(chars); + } + if (this.currentElement) { + this.currentElement.appendChild(charNode); + } else if (/^\s*$/.test(chars)) { + this.doc.appendChild(charNode); + } + this.locator && position(this.locator, charNode); + } + }, + skippedEntity: function skippedEntity(name) {}, + endDocument: function endDocument() { + this.doc.normalize(); + }, + setDocumentLocator: function setDocumentLocator(locator) { + if (this.locator = locator) { + locator.lineNumber = 0; + } + }, + + comment: function comment(chars, start, length) { + chars = _toString.apply(this, arguments); + var comm = this.doc.createComment(chars); + this.locator && position(this.locator, comm); + appendElement(this, comm); + }, + + startCDATA: function startCDATA() { + this.cdata = true; + }, + endCDATA: function endCDATA() { + this.cdata = false; + }, + + startDTD: function startDTD(name, publicId, systemId) { + var impl = this.doc.implementation; + if (impl && impl.createDocumentType) { + var dt = impl.createDocumentType(name, publicId, systemId); + this.locator && position(this.locator, dt); + appendElement(this, dt); + } + }, + + warning: function warning(error) { + console.warn('[xmldom warning]\t' + error, _locator(this.locator)); + }, + error: function error(_error) { + console.error('[xmldom error]\t' + _error, _locator(this.locator)); + }, + fatalError: function fatalError(error) { + console.error('[xmldom fatalError]\t' + error, _locator(this.locator)); + throw error; + } +}; +function _locator(l) { + if (l) { + return '\n@' + (l.systemId || '') + '#[line:' + l.lineNumber + ',col:' + l.columnNumber + ']'; + } +} +function _toString(chars, start, length) { + if (typeof chars == 'string') { + return chars.substr(start, length); + } else { + if (chars.length >= start + length || start) { + return new java.lang.String(chars, start, length) + ''; + } + return chars; + } +} + +"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function (key) { + DOMHandler.prototype[key] = function () { + return null; + }; +}); + +function appendElement(hander, node) { + if (!hander.currentElement) { + hander.doc.appendChild(node); + } else { + hander.currentElement.appendChild(node); + } +} +var XMLReader = require(462 ).XMLReader; // 462 = ./sax +var DOMImplementation = exports.DOMImplementation = require(463 ).DOMImplementation; // 463 = ./dom +exports.XMLSerializer = require(463 ).XMLSerializer; // 463 = ./dom +exports.DOMParser = DOMParser; +}, 461, null, "xmldom/dom-parser.js"); +__d(/* xmldom/sax.js */function(global, require, module, exports) { +var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; +var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"); +var tagNamePattern = new RegExp('^' + nameStartChar.source + nameChar.source + '*(?:\:' + nameStartChar.source + nameChar.source + '*)?$'); + +var S_TAG = 0; +var S_ATTR = 1; +var S_ATTR_SPACE = 2; +var S_EQ = 3; +var S_ATTR_NOQUOT_VALUE = 4; +var S_ATTR_END = 5; +var S_TAG_SPACE = 6; +var S_TAG_CLOSE = 7; + +function XMLReader() {} + +XMLReader.prototype = { + parse: function parse(source, defaultNSMap, entityMap) { + var domBuilder = this.domBuilder; + domBuilder.startDocument(); + _copy(defaultNSMap, defaultNSMap = {}); + _parse(source, defaultNSMap, entityMap, domBuilder, this.errorHandler); + domBuilder.endDocument(); + } +}; +function _parse(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) { + function fixedFromCharCode(code) { + if (code > 0xffff) { + code -= 0x10000; + var surrogate1 = 0xd800 + (code >> 10), + surrogate2 = 0xdc00 + (code & 0x3ff); + + return String.fromCharCode(surrogate1, surrogate2); + } else { + return String.fromCharCode(code); + } + } + function entityReplacer(a) { + var k = a.slice(1, -1); + if (k in entityMap) { + return entityMap[k]; + } else if (k.charAt(0) === '#') { + return fixedFromCharCode(parseInt(k.substr(1).replace('x', '0x'))); + } else { + errorHandler.error('entity not found:' + a); + return a; + } + } + function appendText(end) { + if (end > start) { + var xt = source.substring(start, end).replace(/&#?\w+;/g, entityReplacer); + locator && position(start); + domBuilder.characters(xt, 0, end - start); + start = end; + } + } + function position(p, m) { + while (p >= lineEnd && (m = linePattern.exec(source))) { + lineStart = m.index; + lineEnd = lineStart + m[0].length; + locator.lineNumber++; + } + locator.columnNumber = p - lineStart + 1; + } + var lineStart = 0; + var lineEnd = 0; + var linePattern = /.*(?:\r\n?|\n)|.*$/g; + var locator = domBuilder.locator; + + var parseStack = [{ currentNSMap: defaultNSMapCopy }]; + var closeMap = {}; + var start = 0; + while (true) { + try { + var tagStart = source.indexOf('<', start); + if (tagStart < 0) { + if (!source.substr(start).match(/^\s*$/)) { + var doc = domBuilder.doc; + var text = doc.createTextNode(source.substr(start)); + doc.appendChild(text); + domBuilder.currentElement = text; + } + return; + } + if (tagStart > start) { + appendText(tagStart); + } + switch (source.charAt(tagStart + 1)) { + case '/': + var end = source.indexOf('>', tagStart + 3); + var tagName = source.substring(tagStart + 2, end); + var config = parseStack.pop(); + if (end < 0) { + + tagName = source.substring(tagStart + 2).replace(/[\s<].*/, ''); + + errorHandler.error("end tag name: " + tagName + ' is not complete:' + config.tagName); + end = tagStart + 1 + tagName.length; + } else if (tagName.match(/\s start) { + start = end; + } else { + appendText(Math.max(tagStart, start) + 1); + } + } +} +function copyLocator(f, t) { + t.lineNumber = f.lineNumber; + t.columnNumber = f.columnNumber; + return t; +} + +function parseElementStartPart(source, start, el, currentNSMap, entityReplacer, errorHandler) { + var attrName; + var value; + var p = ++start; + var s = S_TAG; + while (true) { + var c = source.charAt(p); + switch (c) { + case '=': + if (s === S_ATTR) { + attrName = source.slice(start, p); + s = S_EQ; + } else if (s === S_ATTR_SPACE) { + s = S_EQ; + } else { + throw new Error('attribute equal must after attrName'); + } + break; + case '\'': + case '"': + if (s === S_EQ || s === S_ATTR) { + if (s === S_ATTR) { + errorHandler.warning('attribute value must after "="'); + attrName = source.slice(start, p); + } + start = p + 1; + p = source.indexOf(c, start); + if (p > 0) { + value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + el.add(attrName, value, start - 1); + s = S_ATTR_END; + } else { + throw new Error('attribute value no end \'' + c + '\' match'); + } + } else if (s == S_ATTR_NOQUOT_VALUE) { + value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + + el.add(attrName, value, start); + + errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ')!!'); + start = p + 1; + s = S_ATTR_END; + } else { + throw new Error('attribute value must after "="'); + } + break; + case '/': + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + case S_ATTR_END: + case S_TAG_SPACE: + case S_TAG_CLOSE: + s = S_TAG_CLOSE; + el.closed = true; + case S_ATTR_NOQUOT_VALUE: + case S_ATTR: + case S_ATTR_SPACE: + break; + + default: + throw new Error("attribute invalid close char('/')"); + } + break; + case '': + errorHandler.error('unexpected end of input'); + if (s == S_TAG) { + el.setTagName(source.slice(start, p)); + } + return p; + case '>': + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + case S_ATTR_END: + case S_TAG_SPACE: + case S_TAG_CLOSE: + break; + case S_ATTR_NOQUOT_VALUE: + case S_ATTR: + value = source.slice(start, p); + if (value.slice(-1) === '/') { + el.closed = true; + value = value.slice(0, -1); + } + case S_ATTR_SPACE: + if (s === S_ATTR_SPACE) { + value = attrName; + } + if (s == S_ATTR_NOQUOT_VALUE) { + errorHandler.warning('attribute "' + value + '" missed quot(")!!'); + el.add(attrName, value.replace(/&#?\w+;/g, entityReplacer), start); + } else { + if (currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)) { + errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!'); + } + el.add(value, value, start); + } + break; + case S_EQ: + throw new Error('attribute value missed!!'); + } + + return p; + + case "\x80": + c = ' '; + default: + if (c <= ' ') { + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + s = S_TAG_SPACE; + break; + case S_ATTR: + attrName = source.slice(start, p); + s = S_ATTR_SPACE; + break; + case S_ATTR_NOQUOT_VALUE: + var value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + errorHandler.warning('attribute "' + value + '" missed quot(")!!'); + el.add(attrName, value, start); + case S_ATTR_END: + s = S_TAG_SPACE; + break; + } + } else { + switch (s) { + case S_ATTR_SPACE: + var tagName = el.tagName; + if (currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)) { + errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!'); + } + el.add(attrName, attrName, start); + start = p; + s = S_ATTR; + break; + case S_ATTR_END: + errorHandler.warning('attribute space is required"' + attrName + '"!!'); + case S_TAG_SPACE: + s = S_ATTR; + start = p; + break; + case S_EQ: + s = S_ATTR_NOQUOT_VALUE; + start = p; + break; + case S_TAG_CLOSE: + throw new Error("elements closed character '/' and '>' must be connected to"); + } + } + } + p++; + } +} + +function appendElement(el, domBuilder, currentNSMap) { + var tagName = el.tagName; + var localNSMap = null; + + var i = el.length; + while (i--) { + var a = el[i]; + var qName = a.qName; + var value = a.value; + var nsp = qName.indexOf(':'); + if (nsp > 0) { + var prefix = a.prefix = qName.slice(0, nsp); + var localName = qName.slice(nsp + 1); + var nsPrefix = prefix === 'xmlns' && localName; + } else { + localName = qName; + prefix = null; + nsPrefix = qName === 'xmlns' && ''; + } + + a.localName = localName; + + if (nsPrefix !== false) { + if (localNSMap == null) { + localNSMap = {}; + + _copy(currentNSMap, currentNSMap = {}); + } + currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; + a.uri = 'http://www.w3.org/2000/xmlns/'; + domBuilder.startPrefixMapping(nsPrefix, value); + } + } + var i = el.length; + while (i--) { + a = el[i]; + var prefix = a.prefix; + if (prefix) { + if (prefix === 'xml') { + a.uri = 'http://www.w3.org/XML/1998/namespace'; + }if (prefix !== 'xmlns') { + a.uri = currentNSMap[prefix || '']; + } + } + } + var nsp = tagName.indexOf(':'); + if (nsp > 0) { + prefix = el.prefix = tagName.slice(0, nsp); + localName = el.localName = tagName.slice(nsp + 1); + } else { + prefix = null; + localName = el.localName = tagName; + } + + var ns = el.uri = currentNSMap[prefix || '']; + domBuilder.startElement(ns, localName, tagName, el); + + if (el.closed) { + domBuilder.endElement(ns, localName, tagName); + if (localNSMap) { + for (prefix in localNSMap) { + domBuilder.endPrefixMapping(prefix); + } + } + } else { + el.currentNSMap = currentNSMap; + el.localNSMap = localNSMap; + + return true; + } +} +function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) { + if (/^(?:script|textarea)$/i.test(tagName)) { + var elEndStart = source.indexOf('', elStartEnd); + var text = source.substring(elStartEnd + 1, elEndStart); + if (/[&<]/.test(text)) { + if (/^script$/i.test(tagName)) { + domBuilder.characters(text, 0, text.length); + + return elEndStart; + } + text = text.replace(/&#?\w+;/g, entityReplacer); + domBuilder.characters(text, 0, text.length); + return elEndStart; + } + } + return elStartEnd + 1; +} +function fixSelfClosed(source, elStartEnd, tagName, closeMap) { + var pos = closeMap[tagName]; + if (pos == null) { + pos = source.lastIndexOf(''); + if (pos < elStartEnd) { + pos = source.lastIndexOf('', start + 4); + + if (end > start) { + domBuilder.comment(source, start + 4, end - start - 4); + return end + 3; + } else { + errorHandler.error("Unclosed comment"); + return -1; + } + } else { + return -1; + } + default: + if (source.substr(start + 3, 6) == 'CDATA[') { + var end = source.indexOf(']]>', start + 9); + domBuilder.startCDATA(); + domBuilder.characters(source, start + 9, end - start - 9); + domBuilder.endCDATA(); + return end + 3; + } + + var matchs = split(source, start); + var len = matchs.length; + if (len > 1 && /!doctype/i.test(matchs[0][0])) { + var name = matchs[1][0]; + var pubid = len > 3 && /^public$/i.test(matchs[2][0]) && matchs[3][0]; + var sysid = len > 4 && matchs[4][0]; + var lastMatch = matchs[len - 1]; + domBuilder.startDTD(name, pubid && pubid.replace(/^(['"])(.*?)\1$/, '$2'), sysid && sysid.replace(/^(['"])(.*?)\1$/, '$2')); + domBuilder.endDTD(); + + return lastMatch.index + lastMatch[0].length; + } + } + return -1; +} + +function parseInstruction(source, start, domBuilder) { + var end = source.indexOf('?>', start); + if (end) { + var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); + if (match) { + var len = match[0].length; + domBuilder.processingInstruction(match[1], match[2]); + return end + 2; + } else { + return -1; + } + } + return -1; +} + +function ElementAttributes(source) {} +ElementAttributes.prototype = { + setTagName: function setTagName(tagName) { + if (!tagNamePattern.test(tagName)) { + throw new Error('invalid tagName:' + tagName); + } + this.tagName = tagName; + }, + add: function add(qName, value, offset) { + if (!tagNamePattern.test(qName)) { + throw new Error('invalid attribute:' + qName); + } + this[this.length++] = { qName: qName, value: value, offset: offset }; + }, + length: 0, + getLocalName: function getLocalName(i) { + return this[i].localName; + }, + getLocator: function getLocator(i) { + return this[i].locator; + }, + getQName: function getQName(i) { + return this[i].qName; + }, + getURI: function getURI(i) { + return this[i].uri; + }, + getValue: function getValue(i) { + return this[i].value; + } +}; + +function _set_proto_(thiz, parent) { + thiz.__proto__ = parent; + return thiz; +} +if (!(_set_proto_({}, _set_proto_.prototype) instanceof _set_proto_)) { + _set_proto_ = function _set_proto_(thiz, parent) { + function p() {}; + p.prototype = parent; + p = new p(); + for (parent in thiz) { + p[parent] = thiz[parent]; + } + return p; + }; +} + +function split(source, start) { + var match; + var buf = []; + var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; + reg.lastIndex = start; + reg.exec(source); + while (match = reg.exec(source)) { + buf.push(match); + if (match[1]) return buf; + } +} + +exports.XMLReader = XMLReader; +}, 462, null, "xmldom/sax.js"); +__d(/* xmldom/dom.js */function(global, require, module, exports) { + +function copy(src, dest) { + for (var p in src) { + dest[p] = src[p]; + } +} + +function _extends(Class, Super) { + var pt = Class.prototype; + if (Object.create) { + var ppt = Object.create(Super.prototype); + pt.__proto__ = ppt; + } + if (!(pt instanceof Super)) { + function t() {}; + t.prototype = Super.prototype; + t = new t(); + copy(pt, t); + Class.prototype = pt = t; + } + if (pt.constructor != Class) { + if (typeof Class != 'function') { + console.error("unknow Class:" + Class); + } + pt.constructor = Class; + } +} +var htmlns = 'http://www.w3.org/1999/xhtml'; + +var NodeType = {}; +var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1; +var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2; +var TEXT_NODE = NodeType.TEXT_NODE = 3; +var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4; +var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5; +var ENTITY_NODE = NodeType.ENTITY_NODE = 6; +var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7; +var COMMENT_NODE = NodeType.COMMENT_NODE = 8; +var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9; +var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10; +var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11; +var NOTATION_NODE = NodeType.NOTATION_NODE = 12; + +var ExceptionCode = {}; +var ExceptionMessage = {}; +var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1); +var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2); +var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3); +var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4); +var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5); +var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6); +var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7); +var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8); +var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9); +var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10); + +var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11); +var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12); +var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13); +var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14); +var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15); + +function DOMException(code, message) { + if (message instanceof Error) { + var error = message; + } else { + error = this; + Error.call(this, ExceptionMessage[code]); + this.message = ExceptionMessage[code]; + if (Error.captureStackTrace) Error.captureStackTrace(this, DOMException); + } + error.code = code; + if (message) this.message = this.message + ": " + message; + return error; +}; +DOMException.prototype = Error.prototype; +copy(ExceptionCode, DOMException); + +function NodeList() {}; +NodeList.prototype = { + length: 0, + + item: function item(index) { + return this[index] || null; + }, + toString: function toString(isHTML, nodeFilter) { + for (var buf = [], i = 0; i < this.length; i++) { + serializeToString(this[i], buf, isHTML, nodeFilter); + } + return buf.join(''); + } +}; +function LiveNodeList(node, refresh) { + this._node = node; + this._refresh = refresh; + _updateLiveList(this); +} +function _updateLiveList(list) { + var inc = list._node._inc || list._node.ownerDocument._inc; + if (list._inc != inc) { + var ls = list._refresh(list._node); + + __set__(list, 'length', ls.length); + copy(ls, list); + list._inc = inc; + } +} +LiveNodeList.prototype.item = function (i) { + _updateLiveList(this); + return this[i]; +}; + +_extends(LiveNodeList, NodeList); + +function NamedNodeMap() {}; + +function _findNodeIndex(list, node) { + var i = list.length; + while (i--) { + if (list[i] === node) { + return i; + } + } +} + +function _addNamedNode(el, list, newAttr, oldAttr) { + if (oldAttr) { + list[_findNodeIndex(list, oldAttr)] = newAttr; + } else { + list[list.length++] = newAttr; + } + if (el) { + newAttr.ownerElement = el; + var doc = el.ownerDocument; + if (doc) { + oldAttr && _onRemoveAttribute(doc, el, oldAttr); + _onAddAttribute(doc, el, newAttr); + } + } +} +function _removeNamedNode(el, list, attr) { + var i = _findNodeIndex(list, attr); + if (i >= 0) { + var lastIndex = list.length - 1; + while (i < lastIndex) { + list[i] = list[++i]; + } + list.length = lastIndex; + if (el) { + var doc = el.ownerDocument; + if (doc) { + _onRemoveAttribute(doc, el, attr); + attr.ownerElement = null; + } + } + } else { + throw DOMException(NOT_FOUND_ERR, new Error(el.tagName + '@' + attr)); + } +} +NamedNodeMap.prototype = { + length: 0, + item: NodeList.prototype.item, + getNamedItem: function getNamedItem(key) { + var i = this.length; + while (i--) { + var attr = this[i]; + + if (attr.nodeName == key) { + return attr; + } + } + }, + setNamedItem: function setNamedItem(attr) { + var el = attr.ownerElement; + if (el && el != this._ownerElement) { + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + var oldAttr = this.getNamedItem(attr.nodeName); + _addNamedNode(this._ownerElement, this, attr, oldAttr); + return oldAttr; + }, + + setNamedItemNS: function setNamedItemNS(attr) { + var el = attr.ownerElement, + oldAttr; + if (el && el != this._ownerElement) { + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName); + _addNamedNode(this._ownerElement, this, attr, oldAttr); + return oldAttr; + }, + + removeNamedItem: function removeNamedItem(key) { + var attr = this.getNamedItem(key); + _removeNamedNode(this._ownerElement, this, attr); + return attr; + }, + removeNamedItemNS: function removeNamedItemNS(namespaceURI, localName) { + var attr = this.getNamedItemNS(namespaceURI, localName); + _removeNamedNode(this._ownerElement, this, attr); + return attr; + }, + getNamedItemNS: function getNamedItemNS(namespaceURI, localName) { + var i = this.length; + while (i--) { + var node = this[i]; + if (node.localName == localName && node.namespaceURI == namespaceURI) { + return node; + } + } + return null; + } +}; + +function DOMImplementation(features) { + this._features = {}; + if (features) { + for (var feature in features) { + this._features = features[feature]; + } + } +}; + +DOMImplementation.prototype = { + hasFeature: function hasFeature(feature, version) { + var versions = this._features[feature.toLowerCase()]; + if (versions && (!version || version in versions)) { + return true; + } else { + return false; + } + }, + + createDocument: function createDocument(namespaceURI, qualifiedName, doctype) { + var doc = new Document(); + doc.implementation = this; + doc.childNodes = new NodeList(); + doc.doctype = doctype; + if (doctype) { + doc.appendChild(doctype); + } + if (qualifiedName) { + var root = doc.createElementNS(namespaceURI, qualifiedName); + doc.appendChild(root); + } + return doc; + }, + + createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { + var node = new DocumentType(); + node.name = qualifiedName; + node.nodeName = qualifiedName; + node.publicId = publicId; + node.systemId = systemId; + + return node; + } +}; + +function Node() {}; + +Node.prototype = { + firstChild: null, + lastChild: null, + previousSibling: null, + nextSibling: null, + attributes: null, + parentNode: null, + childNodes: null, + ownerDocument: null, + nodeValue: null, + namespaceURI: null, + prefix: null, + localName: null, + + insertBefore: function insertBefore(newChild, refChild) { + return _insertBefore(this, newChild, refChild); + }, + replaceChild: function replaceChild(newChild, oldChild) { + this.insertBefore(newChild, oldChild); + if (oldChild) { + this.removeChild(oldChild); + } + }, + removeChild: function removeChild(oldChild) { + return _removeChild(this, oldChild); + }, + appendChild: function appendChild(newChild) { + return this.insertBefore(newChild, null); + }, + hasChildNodes: function hasChildNodes() { + return this.firstChild != null; + }, + cloneNode: function cloneNode(deep) { + return _cloneNode(this.ownerDocument || this, this, deep); + }, + + normalize: function normalize() { + var child = this.firstChild; + while (child) { + var next = child.nextSibling; + if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) { + this.removeChild(next); + child.appendData(next.data); + } else { + child.normalize(); + child = next; + } + } + }, + + isSupported: function isSupported(feature, version) { + return this.ownerDocument.implementation.hasFeature(feature, version); + }, + + hasAttributes: function hasAttributes() { + return this.attributes.length > 0; + }, + lookupPrefix: function lookupPrefix(namespaceURI) { + var el = this; + while (el) { + var map = el._nsMap; + + if (map) { + for (var n in map) { + if (map[n] == namespaceURI) { + return n; + } + } + } + el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode; + } + return null; + }, + + lookupNamespaceURI: function lookupNamespaceURI(prefix) { + var el = this; + while (el) { + var map = el._nsMap; + + if (map) { + if (prefix in map) { + return map[prefix]; + } + } + el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode; + } + return null; + }, + + isDefaultNamespace: function isDefaultNamespace(namespaceURI) { + var prefix = this.lookupPrefix(namespaceURI); + return prefix == null; + } +}; + +function _xmlEncoder(c) { + return c == '<' && '<' || c == '>' && '>' || c == '&' && '&' || c == '"' && '"' || '&#' + c.charCodeAt() + ';'; +} + +copy(NodeType, Node); +copy(NodeType, Node.prototype); + +function _visitNode(node, callback) { + if (callback(node)) { + return true; + } + if (node = node.firstChild) { + do { + if (_visitNode(node, callback)) { + return true; + } + } while (node = node.nextSibling); + } +} + +function Document() {} +function _onAddAttribute(doc, el, newAttr) { + doc && doc._inc++; + var ns = newAttr.namespaceURI; + if (ns == 'http://www.w3.org/2000/xmlns/') { + el._nsMap[newAttr.prefix ? newAttr.localName : ''] = newAttr.value; + } +} +function _onRemoveAttribute(doc, el, newAttr, remove) { + doc && doc._inc++; + var ns = newAttr.namespaceURI; + if (ns == 'http://www.w3.org/2000/xmlns/') { + delete el._nsMap[newAttr.prefix ? newAttr.localName : '']; + } +} +function _onUpdateChild(doc, el, newChild) { + if (doc && doc._inc) { + doc._inc++; + + var cs = el.childNodes; + if (newChild) { + cs[cs.length++] = newChild; + } else { + var child = el.firstChild; + var i = 0; + while (child) { + cs[i++] = child; + child = child.nextSibling; + } + cs.length = i; + } + } +} + +function _removeChild(parentNode, child) { + var previous = child.previousSibling; + var next = child.nextSibling; + if (previous) { + previous.nextSibling = next; + } else { + parentNode.firstChild = next; + } + if (next) { + next.previousSibling = previous; + } else { + parentNode.lastChild = previous; + } + _onUpdateChild(parentNode.ownerDocument, parentNode); + return child; +} + +function _insertBefore(parentNode, newChild, nextChild) { + var cp = newChild.parentNode; + if (cp) { + cp.removeChild(newChild); + } + if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) { + var newFirst = newChild.firstChild; + if (newFirst == null) { + return newChild; + } + var newLast = newChild.lastChild; + } else { + newFirst = newLast = newChild; + } + var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild; + + newFirst.previousSibling = pre; + newLast.nextSibling = nextChild; + + if (pre) { + pre.nextSibling = newFirst; + } else { + parentNode.firstChild = newFirst; + } + if (nextChild == null) { + parentNode.lastChild = newLast; + } else { + nextChild.previousSibling = newLast; + } + do { + newFirst.parentNode = parentNode; + } while (newFirst !== newLast && (newFirst = newFirst.nextSibling)); + _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode); + + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + newChild.firstChild = newChild.lastChild = null; + } + return newChild; +} +function _appendSingleChild(parentNode, newChild) { + var cp = newChild.parentNode; + if (cp) { + var pre = parentNode.lastChild; + cp.removeChild(newChild); + var pre = parentNode.lastChild; + } + var pre = parentNode.lastChild; + newChild.parentNode = parentNode; + newChild.previousSibling = pre; + newChild.nextSibling = null; + if (pre) { + pre.nextSibling = newChild; + } else { + parentNode.firstChild = newChild; + } + parentNode.lastChild = newChild; + _onUpdateChild(parentNode.ownerDocument, parentNode, newChild); + return newChild; +} +Document.prototype = { + nodeName: '#document', + nodeType: DOCUMENT_NODE, + doctype: null, + documentElement: null, + _inc: 1, + + insertBefore: function insertBefore(newChild, refChild) { + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + var child = newChild.firstChild; + while (child) { + var next = child.nextSibling; + this.insertBefore(child, refChild); + child = next; + } + return newChild; + } + if (this.documentElement == null && newChild.nodeType == ELEMENT_NODE) { + this.documentElement = newChild; + } + + return _insertBefore(this, newChild, refChild), newChild.ownerDocument = this, newChild; + }, + removeChild: function removeChild(oldChild) { + if (this.documentElement == oldChild) { + this.documentElement = null; + } + return _removeChild(this, oldChild); + }, + + importNode: function importNode(importedNode, deep) { + return _importNode(this, importedNode, deep); + }, + + getElementById: function getElementById(id) { + var rtv = null; + _visitNode(this.documentElement, function (node) { + if (node.nodeType == ELEMENT_NODE) { + if (node.getAttribute('id') == id) { + rtv = node; + return true; + } + } + }); + return rtv; + }, + + createElement: function createElement(tagName) { + var node = new Element(); + node.ownerDocument = this; + node.nodeName = tagName; + node.tagName = tagName; + node.childNodes = new NodeList(); + var attrs = node.attributes = new NamedNodeMap(); + attrs._ownerElement = node; + return node; + }, + createDocumentFragment: function createDocumentFragment() { + var node = new DocumentFragment(); + node.ownerDocument = this; + node.childNodes = new NodeList(); + return node; + }, + createTextNode: function createTextNode(data) { + var node = new Text(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createComment: function createComment(data) { + var node = new Comment(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createCDATASection: function createCDATASection(data) { + var node = new CDATASection(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createProcessingInstruction: function createProcessingInstruction(target, data) { + var node = new ProcessingInstruction(); + node.ownerDocument = this; + node.tagName = node.target = target; + node.nodeValue = node.data = data; + return node; + }, + createAttribute: function createAttribute(name) { + var node = new Attr(); + node.ownerDocument = this; + node.name = name; + node.nodeName = name; + node.localName = name; + node.specified = true; + return node; + }, + createEntityReference: function createEntityReference(name) { + var node = new EntityReference(); + node.ownerDocument = this; + node.nodeName = name; + return node; + }, + + createElementNS: function createElementNS(namespaceURI, qualifiedName) { + var node = new Element(); + var pl = qualifiedName.split(':'); + var attrs = node.attributes = new NamedNodeMap(); + node.childNodes = new NodeList(); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.tagName = qualifiedName; + node.namespaceURI = namespaceURI; + if (pl.length == 2) { + node.prefix = pl[0]; + node.localName = pl[1]; + } else { + node.localName = qualifiedName; + } + attrs._ownerElement = node; + return node; + }, + + createAttributeNS: function createAttributeNS(namespaceURI, qualifiedName) { + var node = new Attr(); + var pl = qualifiedName.split(':'); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.name = qualifiedName; + node.namespaceURI = namespaceURI; + node.specified = true; + if (pl.length == 2) { + node.prefix = pl[0]; + node.localName = pl[1]; + } else { + node.localName = qualifiedName; + } + return node; + } +}; +_extends(Document, Node); + +function Element() { + this._nsMap = {}; +}; +Element.prototype = { + nodeType: ELEMENT_NODE, + hasAttribute: function hasAttribute(name) { + return this.getAttributeNode(name) != null; + }, + getAttribute: function getAttribute(name) { + var attr = this.getAttributeNode(name); + return attr && attr.value || ''; + }, + getAttributeNode: function getAttributeNode(name) { + return this.attributes.getNamedItem(name); + }, + setAttribute: function setAttribute(name, value) { + var attr = this.ownerDocument.createAttribute(name); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr); + }, + removeAttribute: function removeAttribute(name) { + var attr = this.getAttributeNode(name); + attr && this.removeAttributeNode(attr); + }, + + appendChild: function appendChild(newChild) { + if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) { + return this.insertBefore(newChild, null); + } else { + return _appendSingleChild(this, newChild); + } + }, + setAttributeNode: function setAttributeNode(newAttr) { + return this.attributes.setNamedItem(newAttr); + }, + setAttributeNodeNS: function setAttributeNodeNS(newAttr) { + return this.attributes.setNamedItemNS(newAttr); + }, + removeAttributeNode: function removeAttributeNode(oldAttr) { + return this.attributes.removeNamedItem(oldAttr.nodeName); + }, + + removeAttributeNS: function removeAttributeNS(namespaceURI, localName) { + var old = this.getAttributeNodeNS(namespaceURI, localName); + old && this.removeAttributeNode(old); + }, + + hasAttributeNS: function hasAttributeNS(namespaceURI, localName) { + return this.getAttributeNodeNS(namespaceURI, localName) != null; + }, + getAttributeNS: function getAttributeNS(namespaceURI, localName) { + var attr = this.getAttributeNodeNS(namespaceURI, localName); + return attr && attr.value || ''; + }, + setAttributeNS: function setAttributeNS(namespaceURI, qualifiedName, value) { + var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr); + }, + getAttributeNodeNS: function getAttributeNodeNS(namespaceURI, localName) { + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + + getElementsByTagName: function getElementsByTagName(tagName) { + return new LiveNodeList(this, function (base) { + var ls = []; + _visitNode(base, function (node) { + if (node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)) { + ls.push(node); + } + }); + return ls; + }); + }, + getElementsByTagNameNS: function getElementsByTagNameNS(namespaceURI, localName) { + return new LiveNodeList(this, function (base) { + var ls = []; + _visitNode(base, function (node) { + if (node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)) { + ls.push(node); + } + }); + return ls; + }); + } +}; +Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName; +Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS; + +_extends(Element, Node); +function Attr() {}; +Attr.prototype.nodeType = ATTRIBUTE_NODE; +_extends(Attr, Node); + +function CharacterData() {}; +CharacterData.prototype = { + data: '', + substringData: function substringData(offset, count) { + return this.data.substring(offset, offset + count); + }, + appendData: function appendData(text) { + text = this.data + text; + this.nodeValue = this.data = text; + this.length = text.length; + }, + insertData: function insertData(offset, text) { + this.replaceData(offset, 0, text); + }, + appendChild: function appendChild(newChild) { + throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]); + }, + deleteData: function deleteData(offset, count) { + this.replaceData(offset, count, ""); + }, + replaceData: function replaceData(offset, count, text) { + var start = this.data.substring(0, offset); + var end = this.data.substring(offset + count); + text = start + text + end; + this.nodeValue = this.data = text; + this.length = text.length; + } +}; +_extends(CharacterData, Node); +function Text() {}; +Text.prototype = { + nodeName: "#text", + nodeType: TEXT_NODE, + splitText: function splitText(offset) { + var text = this.data; + var newText = text.substring(offset); + text = text.substring(0, offset); + this.data = this.nodeValue = text; + this.length = text.length; + var newNode = this.ownerDocument.createTextNode(newText); + if (this.parentNode) { + this.parentNode.insertBefore(newNode, this.nextSibling); + } + return newNode; + } +}; +_extends(Text, CharacterData); +function Comment() {}; +Comment.prototype = { + nodeName: "#comment", + nodeType: COMMENT_NODE +}; +_extends(Comment, CharacterData); + +function CDATASection() {}; +CDATASection.prototype = { + nodeName: "#cdata-section", + nodeType: CDATA_SECTION_NODE +}; +_extends(CDATASection, CharacterData); + +function DocumentType() {}; +DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE; +_extends(DocumentType, Node); + +function Notation() {}; +Notation.prototype.nodeType = NOTATION_NODE; +_extends(Notation, Node); + +function Entity() {}; +Entity.prototype.nodeType = ENTITY_NODE; +_extends(Entity, Node); + +function EntityReference() {}; +EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE; +_extends(EntityReference, Node); + +function DocumentFragment() {}; +DocumentFragment.prototype.nodeName = "#document-fragment"; +DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE; +_extends(DocumentFragment, Node); + +function ProcessingInstruction() {} +ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; +_extends(ProcessingInstruction, Node); +function XMLSerializer() {} +XMLSerializer.prototype.serializeToString = function (node, isHtml, nodeFilter) { + return nodeSerializeToString.call(node, isHtml, nodeFilter); +}; +Node.prototype.toString = nodeSerializeToString; +function nodeSerializeToString(isHtml, nodeFilter) { + var buf = []; + var refNode = this.nodeType == 9 ? this.documentElement : this; + var prefix = refNode.prefix; + var uri = refNode.namespaceURI; + + if (uri && prefix == null) { + var prefix = refNode.lookupPrefix(uri); + if (prefix == null) { + var visibleNamespaces = [{ namespace: uri, prefix: null }]; + } + } + serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces); + + return buf.join(''); +} +function needNamespaceDefine(node, isHTML, visibleNamespaces) { + var prefix = node.prefix || ''; + var uri = node.namespaceURI; + if (!prefix && !uri) { + return false; + } + if (prefix === "xml" && uri === "http://www.w3.org/XML/1998/namespace" || uri == 'http://www.w3.org/2000/xmlns/') { + return false; + } + + var i = visibleNamespaces.length; + + while (i--) { + var ns = visibleNamespaces[i]; + + if (ns.prefix == prefix) { + return ns.namespace != uri; + } + } + + return true; +} +function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) { + if (nodeFilter) { + node = nodeFilter(node); + if (node) { + if (typeof node == 'string') { + buf.push(node); + return; + } + } else { + return; + } + } + switch (node.nodeType) { + case ELEMENT_NODE: + if (!visibleNamespaces) visibleNamespaces = []; + var startVisibleNamespaces = visibleNamespaces.length; + var attrs = node.attributes; + var len = attrs.length; + var child = node.firstChild; + var nodeName = node.tagName; + + isHTML = htmlns === node.namespaceURI || isHTML; + buf.push('<', nodeName); + + for (var i = 0; i < len; i++) { + var attr = attrs.item(i); + if (attr.prefix == 'xmlns') { + visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value }); + } else if (attr.nodeName == 'xmlns') { + visibleNamespaces.push({ prefix: '', namespace: attr.value }); + } + } + for (var i = 0; i < len; i++) { + var attr = attrs.item(i); + if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) { + var prefix = attr.prefix || ''; + var uri = attr.namespaceURI; + var ns = prefix ? ' xmlns:' + prefix : " xmlns"; + buf.push(ns, '="', uri, '"'); + visibleNamespaces.push({ prefix: prefix, namespace: uri }); + } + serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces); + } + + if (needNamespaceDefine(node, isHTML, visibleNamespaces)) { + var prefix = node.prefix || ''; + var uri = node.namespaceURI; + var ns = prefix ? ' xmlns:' + prefix : " xmlns"; + buf.push(ns, '="', uri, '"'); + visibleNamespaces.push({ prefix: prefix, namespace: uri }); + } + + if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) { + buf.push('>'); + + if (isHTML && /^script$/i.test(nodeName)) { + while (child) { + if (child.data) { + buf.push(child.data); + } else { + serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces); + } + child = child.nextSibling; + } + } else { + while (child) { + serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces); + child = child.nextSibling; + } + } + buf.push(''); + } else { + buf.push('/>'); + } + + return; + case DOCUMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + var child = node.firstChild; + while (child) { + serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces); + child = child.nextSibling; + } + return; + case ATTRIBUTE_NODE: + return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g, _xmlEncoder), '"'); + case TEXT_NODE: + return buf.push(node.data.replace(/[<&]/g, _xmlEncoder)); + case CDATA_SECTION_NODE: + return buf.push(''); + case COMMENT_NODE: + return buf.push(""); + case DOCUMENT_TYPE_NODE: + var pubid = node.publicId; + var sysid = node.systemId; + buf.push(''); + } else if (sysid && sysid != '.') { + buf.push(' SYSTEM "', sysid, '">'); + } else { + var sub = node.internalSubset; + if (sub) { + buf.push(" [", sub, "]"); + } + buf.push(">"); + } + return; + case PROCESSING_INSTRUCTION_NODE: + return buf.push(""); + case ENTITY_REFERENCE_NODE: + return buf.push('&', node.nodeName, ';'); + + default: + buf.push('??', node.nodeName); + } +} +function _importNode(doc, node, deep) { + var node2; + switch (node.nodeType) { + case ELEMENT_NODE: + node2 = node.cloneNode(false); + node2.ownerDocument = doc; + + case DOCUMENT_FRAGMENT_NODE: + break; + case ATTRIBUTE_NODE: + deep = true; + break; + } + if (!node2) { + node2 = node.cloneNode(false); + } + node2.ownerDocument = doc; + node2.parentNode = null; + if (deep) { + var child = node.firstChild; + while (child) { + node2.appendChild(_importNode(doc, child, deep)); + child = child.nextSibling; + } + } + return node2; +} + +function _cloneNode(doc, node, deep) { + var node2 = new node.constructor(); + for (var n in node) { + var v = node[n]; + if (typeof v != 'object') { + if (v != node2[n]) { + node2[n] = v; + } + } + } + if (node.childNodes) { + node2.childNodes = new NodeList(); + } + node2.ownerDocument = doc; + switch (node2.nodeType) { + case ELEMENT_NODE: + var attrs = node.attributes; + var attrs2 = node2.attributes = new NamedNodeMap(); + var len = attrs.length; + attrs2._ownerElement = node2; + for (var i = 0; i < len; i++) { + node2.setAttributeNode(_cloneNode(doc, attrs.item(i), true)); + } + break;; + case ATTRIBUTE_NODE: + deep = true; + } + if (deep) { + var child = node.firstChild; + while (child) { + node2.appendChild(_cloneNode(doc, child, deep)); + child = child.nextSibling; + } + } + return node2; +} + +function __set__(object, key, value) { + object[key] = value; +} + +try { + if (Object.defineProperty) { + Object.defineProperty(LiveNodeList.prototype, 'length', { + get: function get() { + _updateLiveList(this); + return this.$$length; + } + }); + Object.defineProperty(Node.prototype, 'textContent', { + get: function get() { + return getTextContent(this); + }, + set: function set(data) { + switch (this.nodeType) { + case ELEMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + while (this.firstChild) { + this.removeChild(this.firstChild); + } + if (data || String(data)) { + this.appendChild(this.ownerDocument.createTextNode(data)); + } + break; + default: + this.data = data; + this.value = data; + this.nodeValue = data; + } + } + }); + + function getTextContent(node) { + switch (node.nodeType) { + case ELEMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + var buf = []; + node = node.firstChild; + while (node) { + if (node.nodeType !== 7 && node.nodeType !== 8) { + buf.push(getTextContent(node)); + } + node = node.nextSibling; + } + return buf.join(''); + default: + return node.nodeValue; + } + } + __set__ = function __set__(object, key, value) { + object['$$' + key] = value; + }; + } +} catch (e) {} + +exports.DOMImplementation = DOMImplementation; +exports.XMLSerializer = XMLSerializer; +}, 463, null, "xmldom/dom.js"); +__d(/* jitsi-meet-logger/lib/index.js */function(global, require, module, exports) { +var Logger = require(465 ); // 465 = ./Logger +var LogCollector = require(466 ); // 466 = ./LogCollector + +var idLoggers = {}; + +var loggers = []; + +var curLevel = Logger.levels.TRACE; + +module.exports = { + addGlobalTransport: function addGlobalTransport(transport) { + Logger.addGlobalTransport(transport); + }, + + removeGlobalTransport: function removeGlobalTransport(transport) { + Logger.removeGlobalTransport(transport); + }, + + getLogger: function getLogger(id, transports, format) { + var logger = new Logger(curLevel, id, transports, format); + if (id) { + idLoggers[id] = idLoggers[id] || []; + idLoggers[id].push(logger); + } else { + loggers.push(logger); + } + return logger; + }, + + setLogLevelById: function setLogLevelById(level, id) { + var l = id ? idLoggers[id] || [] : loggers; + for (var i = 0; i < l.length; i++) { + l[i].setLevel(level); + } + }, + + setLogLevel: function setLogLevel(level) { + curLevel = level; + var i = 0; + for (; i < loggers.length; i++) { + loggers[i].setLevel(level); + } + + for (var id in idLoggers) { + var l = idLoggers[id] || []; + for (i = 0; i < l.length; i++) { + l[i].setLevel(level); + } + } + }, + + levels: Logger.levels, + + LogCollector: LogCollector +}; +}, 464, null, "jitsi-meet-logger/lib/index.js"); +__d(/* jitsi-meet-logger/lib/Logger.js */function(global, require, module, exports) { +var levels = { + "trace": 0, + "debug": 1, + "info": 2, + "log": 3, + "warn": 4, + "error": 5 +}; + +Logger.consoleTransport = console; + +var globalTransports = [Logger.consoleTransport]; + +Logger.addGlobalTransport = function (transport) { + if (globalTransports.indexOf(transport) === -1) { + globalTransports.push(transport); + } +}; + +Logger.removeGlobalTransport = function (transport) { + var transportIdx = globalTransports.indexOf(transport); + if (transportIdx !== -1) { + globalTransports.splice(transportIdx, 1); + } +}; + +function getCallerInfo() { + var callerInfo = { + methodName: "", + fileLocation: "", + line: null, + column: null + }; + + var error = new Error(); + var stack = error.stack ? error.stack.split("\n") : []; + if (!stack || stack.length < 1) { + return callerInfo; + } + var m = null; + if (stack[3]) { + m = stack[3].match(/\s*at\s*(.+?)\s*\((\S*)\s*:(\d*)\s*:(\d*)\)/); + } + if (!m || m.length <= 4) { + if (stack[2].indexOf("log@") === 0) { + callerInfo.methodName = stack[3].substr(0, stack[3].indexOf("@")); + } else { + callerInfo.methodName = stack[2].substr(0, stack[2].indexOf("@")); + } + return callerInfo; + } + + callerInfo.methodName = m[1]; + callerInfo.fileLocation = m[2]; + callerInfo.line = m[3]; + callerInfo.column = m[4]; + return callerInfo; +} + +function log() { + var logger = arguments[0], + level = arguments[1], + args = Array.prototype.slice.call(arguments, 2); + if (levels[level] < logger.level) { + return; + } + + var callerInfo = getCallerInfo(); + var transports = globalTransports.concat(logger.transports); + for (var i = 0; i < transports.length; i++) { + var t = transports[i]; + var l = t[level]; + if (l && typeof l === "function") { + l.bind(t, logger.id ? "[" + logger.id + "]" : "", "<" + callerInfo.methodName + ">: ").apply(t, args); + } + } +} + +function Logger(level, id, transports, format) { + this.id = id; + this.format = format; + this.transports = transports; + if (!this.transports) { + this.transports = []; + } + this.level = levels[level]; + var methods = Object.keys(levels); + for (var i = 0; i < methods.length; i++) { + this[methods[i]] = log.bind(null, this, methods[i]); + } +} + +Logger.prototype.setLevel = function (level) { + this.level = levels[level]; +}; +module.exports = Logger; + +Logger.levels = { + TRACE: "trace", + DEBUG: "debug", + INFO: "info", + LOG: "log", + WARN: "warn", + ERROR: "error" +}; +}, 465, null, "jitsi-meet-logger/lib/Logger.js"); +__d(/* jitsi-meet-logger/lib/LogCollector.js */function(global, require, module, exports) { +var Logger = require(465 ); // 465 = ./Logger.js + +function LogCollector(logStorage, options) { + this.logStorage = logStorage; + this.stringifyObjects = options && options.stringifyObjects ? options.stringifyObjects : false; + this.storeInterval = options && options.storeInterval ? options.storeInterval : 30000; + this.maxEntryLength = options && options.maxEntryLength ? options.maxEntryLength : 10000; + + Object.keys(Logger.levels).forEach(function (logLevel) { + var methodName = Logger.levels[logLevel]; + this[methodName] = function (logLevel) { + this._log.apply(this, arguments); + }.bind(this, logLevel); + }.bind(this)); + + this.storeLogsIntervalID = null; + + this.queue = []; + + this.totalLen = 0; + + this.outputCache = []; +} + +LogCollector.prototype.stringify = function (someObject) { + try { + return JSON.stringify(someObject); + } catch (error) { + return "[object with circular refs?]"; + } +}; + +LogCollector.prototype.formatLogMessage = function (logLevel) { + var msg = ''; + for (var i = 1, len = arguments.length; i < len; i++) { + var arg = arguments[i]; + + if ((this.stringifyObjects || logLevel === Logger.levels.ERROR) && typeof arg === 'object') { + arg = this.stringify(arg); + } + msg += arg; + if (i != len - 1) { + msg += ' '; + } + } + return msg.length ? msg : null; +}; + +LogCollector.prototype._log = function () { + var msg = this.formatLogMessage.apply(this, arguments); + if (msg) { + var prevMessage = this.queue.length ? this.queue[this.queue.length - 1] : undefined; + + var prevMessageText = typeof prevMessage === 'object' ? prevMessage.text : prevMessage; + + if (prevMessageText == msg) { + if (typeof prevMessage === 'object') { + prevMessage.count += 1; + } else { + this.queue[this.queue.length - 1] = { + text: msg, + count: 2 + }; + } + } else { + this.queue.push(msg); + this.totalLen += msg.length; + } + } + + if (this.totalLen >= this.maxEntryLength) { + this._flush(true, true); + } +}; + +LogCollector.prototype.start = function () { + this._reschedulePublishInterval(); +}; + +LogCollector.prototype._reschedulePublishInterval = function () { + if (this.storeLogsIntervalID) { + window.clearTimeout(this.storeLogsIntervalID); + this.storeLogsIntervalID = null; + } + + this.storeLogsIntervalID = window.setTimeout(this._flush.bind(this, false, true), this.storeInterval); +}; + +LogCollector.prototype.flush = function () { + this._flush(false, true); +}; + +LogCollector.prototype._flush = function (force, reschedule) { + if (this.totalLen > 0 && (this.logStorage.isReady() || force)) { + if (this.logStorage.isReady()) { + if (this.outputCache.length) { + this.outputCache.forEach(function (cachedQueue) { + this.logStorage.storeLogs(cachedQueue); + }.bind(this)); + + this.outputCache = []; + } + + this.logStorage.storeLogs(this.queue); + } else { + this.outputCache.push(this.queue); + } + + this.queue = []; + this.totalLen = 0; + } + + if (reschedule) { + this._reschedulePublishInterval(); + } +}; + +LogCollector.prototype.stop = function () { + this._flush(false, false); +}; + +module.exports = LogCollector; +}, 466, null, "jitsi-meet-logger/lib/LogCollector.js"); +__d(/* react-native/package.json */function(global, require, module, exports) {module.exports = module.exports = { + "_from": "react-native@0.42.3", + "_id": "react-native@0.42.3", + "_inBundle": false, + "_integrity": "sha1-RQyKA6Xj6ZGgikJvIndt2P64CyY=", + "_location": "/react-native", + "_phantomChildren": { + "ansi": "0.3.1", + "ansi-regex": "2.1.1", + "are-we-there-yet": "1.1.4", + "basic-auth-connect": "1.0.0", + "chalk": "1.1.3", + "cli-width": "2.1.0", + "cliui": "3.2.0", + "code-point-at": "1.1.0", + "compression": "1.5.2", + "connect-timeout": "1.6.2", + "content-type": "1.0.2", + "cookie-parser": "1.3.5", + "cookie-signature": "1.0.6", + "csurf": "1.8.3", + "decamelize": "1.2.0", + "destroy": "1.0.4", + "errorhandler": "1.4.3", + "escape-string-regexp": "1.0.5", + "exit-hook": "1.1.1", + "express-session": "1.11.3", + "get-caller-file": "1.0.2", + "has-unicode": "2.0.1", + "inflight": "1.0.6", + "inherits": "2.0.3", + "lodash": "4.17.4", + "lodash.pad": "4.5.1", + "lodash.padend": "4.6.1", + "lodash.padstart": "4.6.1", + "media-typer": "0.3.0", + "method-override": "2.3.9", + "mime-db": "1.29.0", + "minimatch": "3.0.0", + "morgan": "1.6.1", + "multiparty": "3.3.2", + "number-is-nan": "1.0.1", + "object-assign": "4.1.1", + "on-finished": "2.3.0", + "on-headers": "1.0.1", + "once": "1.4.0", + "os-locale": "1.4.0", + "parseurl": "1.3.1", + "path-is-absolute": "1.0.1", + "pause": "0.1.0", + "read-pkg-up": "1.0.1", + "readline2": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "response-time": "2.3.2", + "serve-favicon": "2.3.2", + "set-blocking": "2.0.0", + "statuses": "1.3.1", + "strip-ansi": "3.0.1", + "through": "2.3.8", + "unpipe": "1.0.0", + "utils-merge": "1.0.0", + "vhost": "3.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "4.2.1" + }, + "_requested": { + "type": "version", + "registry": true, + "raw": "react-native@0.42.3", + "name": "react-native", + "escapedName": "react-native", + "rawSpec": "0.42.3", + "saveSpec": null, + "fetchSpec": "0.42.3" + }, + "_requiredBy": ["/"], + "_resolved": "https://registry.npmjs.org/react-native/-/react-native-0.42.3.tgz", + "_shasum": "450c8a03a5e3e991a08a426f22776dd8feb80b26", + "_spec": "react-native@0.42.3", + "_where": "/Users/manu/UC/matrix/github/others/jitsi-meet", + "bin": { + "react-native": "local-cli/wrong-react-native.js" + }, + "bugs": { + "url": "https://github.com/facebook/react-native/issues" + }, + "bundleDependencies": false, + "dependencies": { + "absolute-path": "^0.0.0", + "art": "^0.10.0", + "async": "^2.0.1", + "babel-core": "^6.21.0", + "babel-generator": "^6.21.0", + "babel-plugin-external-helpers": "^6.18.0", + "babel-plugin-syntax-trailing-function-commas": "^6.20.0", + "babel-plugin-transform-flow-strip-types": "^6.21.0", + "babel-plugin-transform-object-rest-spread": "^6.20.2", + "babel-polyfill": "^6.20.0", + "babel-preset-es2015-node": "^6.1.1", + "babel-preset-fbjs": "^2.1.0", + "babel-preset-react-native": "^1.9.1", + "babel-register": "^6.18.0", + "babel-runtime": "^6.20.0", + "babel-traverse": "^6.21.0", + "babel-types": "^6.21.0", + "babylon": "^6.14.1", + "base64-js": "^1.1.2", + "bser": "^1.0.2", + "chalk": "^1.1.1", + "commander": "^2.9.0", + "connect": "^2.8.3", + "core-js": "^2.2.2", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "event-target-shim": "^1.0.5", + "fbjs": "^0.8.5", + "fbjs-scripts": "^0.7.0", + "fs-extra": "^0.26.2", + "glob": "^5.0.15", + "graceful-fs": "^4.1.3", + "image-size": "^0.3.5", + "immutable": "~3.7.6", + "imurmurhash": "^0.1.4", + "inquirer": "^0.12.0", + "jest-haste-map": "18.0.0", + "joi": "^6.6.1", + "json-stable-stringify": "^1.0.1", + "json5": "^0.4.0", + "left-pad": "^1.1.3", + "lodash": "^4.16.6", + "mime": "^1.3.4", + "mime-types": "2.1.11", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "node-fetch": "^1.3.3", + "npmlog": "^2.0.4", + "opn": "^3.0.2", + "optimist": "^0.6.1", + "plist": "^1.2.0", + "promise": "^7.1.1", + "react-clone-referenced-element": "^1.0.1", + "react-timer-mixin": "^0.13.2", + "react-transform-hmr": "^1.0.4", + "rebound": "^0.0.13", + "regenerator-runtime": "^0.9.5", + "request": "^2.79.0", + "rimraf": "^2.5.4", + "sane": "~1.4.1", + "semver": "^5.0.3", + "shell-quote": "1.6.1", + "source-map": "^0.5.6", + "stacktrace-parser": "^0.1.3", + "temp": "0.8.3", + "throat": "^3.0.0", + "uglify-js": "^2.6.2", + "whatwg-fetch": "^1.0.0", + "wordwrap": "^1.0.0", + "worker-farm": "^1.3.1", + "write-file-atomic": "^1.2.0", + "ws": "^1.1.0", + "xcode": "^0.8.9", + "xmldoc": "^0.4.0", + "yargs": "^6.4.0" + }, + "deprecated": false, + "description": "A framework for building native apps using React", + "devDependencies": { + "babel-eslint": "^7.1.1", + "eslint": "^3.8.1", + "eslint-plugin-babel": "^3.3.0", + "eslint-plugin-flowtype": "^2.20.0", + "eslint-plugin-react": "^6.4.1", + "flow-bin": "^0.38.0", + "jest": "18.0.0", + "jest-repl": "18.0.0", + "jest-runtime": "18.0.0", + "mock-fs": "^3.11.0", + "react": "~15.4.1", + "react-dom": "~15.4.1", + "react-test-renderer": "~15.4.1", + "shelljs": "0.6.0", + "sinon": "^2.0.0-pre.2" + }, + "engines": { + "node": ">=4" + }, + "files": [".flowconfig", "android", "cli.js", "flow", "init.sh", "ios-install-third-party.sh", "jest-preset.json", "jest", "lib", "setupBabel.js", "Libraries", "LICENSE", "local-cli", "packager", "PATENTS", "react.gradle", "React.podspec", "React", "ReactAndroid", "ReactCommon", "README.md"], + "homepage": "https://github.com/facebook/react-native#readme", + "jest": { + "automock": true, + "transform": { + ".*": "./jest/preprocessor.js" + }, + "setupFiles": ["./jest/setup.js"], + "timers": "fake", + "moduleNameMapper": { + "^React$": "/Libraries/react-native/React.js", + "^[./a-zA-Z0-9$_-]+\\.png$": "RelativeImageStub" + }, + "testPathIgnorePatterns": ["/node_modules/", "/website/", "local-cli/templates/"], + "haste": { + "defaultPlatform": "ios", + "providesModuleNodeModules": ["react-native"], + "platforms": ["ios", "android"] + }, + "modulePathIgnorePatterns": ["Libraries/react-native/", "/node_modules/(?!react|fbjs|react-native|react-transform-hmr|core-js|promise)/", "node_modules/react/node_modules/fbjs/", "node_modules/react/lib/ReactDOM.js", "node_modules/fbjs/lib/Map.js", "node_modules/fbjs/lib/Promise.js", "node_modules/fbjs/lib/fetch.js", "node_modules/fbjs/lib/ErrorUtils.js", "node_modules/fbjs/lib/URI.js", "node_modules/fbjs/lib/Deferred.js", "node_modules/fbjs/lib/PromiseMap.js", "node_modules/fbjs/lib/UserAgent.js", "node_modules/fbjs/lib/areEqual.js", "node_modules/fbjs/lib/base62.js", "node_modules/fbjs/lib/crc32.js", "node_modules/fbjs/lib/everyObject.js", "node_modules/fbjs/lib/fetchWithRetries.js", "node_modules/fbjs/lib/filterObject.js", "node_modules/fbjs/lib/flattenArray.js", "node_modules/fbjs/lib/forEachObject.js", "node_modules/fbjs/lib/isEmpty.js", "node_modules/fbjs/lib/nullthrows.js", "node_modules/fbjs/lib/removeFromArray.js", "node_modules/fbjs/lib/resolveImmediate.js", "node_modules/fbjs/lib/someObject.js", "node_modules/fbjs/lib/sprintf.js", "node_modules/fbjs/lib/xhrSimpleDataSerializer.js", "node_modules/jest-cli", "node_modules/react/dist", "node_modules/fbjs/.*/__mocks__/", "node_modules/fbjs/node_modules/", "/website/"], + "unmockedModulePathPatterns": ["promise", "source-map", "fastpath", "denodeify", "fbjs", "sinon"] + }, + "license": "BSD-3-Clause", + "main": "Libraries/react-native/react-native.js", + "name": "react-native", + "peerDependencies": { + "react": "~15.4.1" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/facebook/react-native.git" + }, + "scripts": { + "flow": "flow", + "lint": "eslint Examples/ Libraries/", + "start": "/usr/bin/env bash -c './packager/packager.sh \"$@\" || true' --", + "test": "jest" + }, + "version": "0.42.3" +}; +}, 467, null, "react-native/package.json"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js */function(global, require, module, exports) {var _reactNativeWebrtc = require(469 ); // 469 = react-native-webrtc + +var _RTCPeerConnection = require(486 ); // 486 = ./RTCPeerConnection + +var _RTCPeerConnection2 = babelHelpers.interopRequireDefault(_RTCPeerConnection); + +(function (global) { + if (typeof global.webkitMediaStream === 'undefined') { + global.webkitMediaStream = _reactNativeWebrtc.MediaStream; + } + if (typeof global.MediaStreamTrack === 'undefined') { + global.MediaStreamTrack = _reactNativeWebrtc.MediaStreamTrack; + } + if (typeof global.webkitRTCPeerConnection === 'undefined') { + global.webkitRTCPeerConnection = _RTCPeerConnection2.default; + } + if (typeof global.RTCSessionDescription === 'undefined') { + global.RTCSessionDescription = _reactNativeWebrtc.RTCSessionDescription; + } + if (typeof global.RTCIceCandidate === 'undefined') { + global.RTCIceCandidate = _reactNativeWebrtc.RTCIceCandidate; + } + + var navigator = global.navigator; + + if (navigator) { + if (typeof navigator.webkitGetUserMedia === 'undefined') { + navigator.webkitGetUserMedia = _reactNativeWebrtc.getUserMedia; + } + } +})(global || window || this); +}, 468, null, "jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-webrtc.js"); +__d(/* react-native-webrtc/index.js */function(global, require, module, exports) {'use strict'; + +var _RTCPeerConnection = require(470 ); // 470 = ./RTCPeerConnection + +var _RTCPeerConnection2 = babelHelpers.interopRequireDefault(_RTCPeerConnection); + +var _RTCIceCandidate = require(480 ); // 480 = ./RTCIceCandidate + +var _RTCIceCandidate2 = babelHelpers.interopRequireDefault(_RTCIceCandidate); + +var _RTCSessionDescription = require(479 ); // 479 = ./RTCSessionDescription + +var _RTCSessionDescription2 = babelHelpers.interopRequireDefault(_RTCSessionDescription); + +var _RTCView = require(483 ); // 483 = ./RTCView + +var _RTCView2 = babelHelpers.interopRequireDefault(_RTCView); + +var _MediaStream = require(471 ); // 471 = ./MediaStream + +var _MediaStream2 = babelHelpers.interopRequireDefault(_MediaStream); + +var _MediaStreamTrack = require(474 ); // 474 = ./MediaStreamTrack + +var _MediaStreamTrack2 = babelHelpers.interopRequireDefault(_MediaStreamTrack); + +var _getUserMedia = require(484 ); // 484 = ./getUserMedia + +var _getUserMedia2 = babelHelpers.interopRequireDefault(_getUserMedia); + +module.exports = { + RTCPeerConnection: _RTCPeerConnection2.default, + RTCIceCandidate: _RTCIceCandidate2.default, + RTCSessionDescription: _RTCSessionDescription2.default, + RTCView: _RTCView2.default, + MediaStream: _MediaStream2.default, + MediaStreamTrack: _MediaStreamTrack2.default, + getUserMedia: _getUserMedia2.default +}; +}, 469, null, "react-native-webrtc/index.js"); +__d(/* react-native-webrtc/RTCPeerConnection.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eventTargetShim = require(116 ); // 116 = event-target-shim + +var _eventTargetShim2 = babelHelpers.interopRequireDefault(_eventTargetShim); + +var _reactNative = require(69 ); // 69 = react-native + +var _MediaStream = require(471 ); // 471 = ./MediaStream + +var _MediaStream2 = babelHelpers.interopRequireDefault(_MediaStream); + +var _MediaStreamEvent = require(473 ); // 473 = ./MediaStreamEvent + +var _MediaStreamEvent2 = babelHelpers.interopRequireDefault(_MediaStreamEvent); + +var _MediaStreamTrack = require(474 ); // 474 = ./MediaStreamTrack + +var _MediaStreamTrack2 = babelHelpers.interopRequireDefault(_MediaStreamTrack); + +var _RTCDataChannel = require(476 ); // 476 = ./RTCDataChannel + +var _RTCDataChannel2 = babelHelpers.interopRequireDefault(_RTCDataChannel); + +var _RTCDataChannelEvent = require(478 ); // 478 = ./RTCDataChannelEvent + +var _RTCDataChannelEvent2 = babelHelpers.interopRequireDefault(_RTCDataChannelEvent); + +var _RTCSessionDescription = require(479 ); // 479 = ./RTCSessionDescription + +var _RTCSessionDescription2 = babelHelpers.interopRequireDefault(_RTCSessionDescription); + +var _RTCIceCandidate = require(480 ); // 480 = ./RTCIceCandidate + +var _RTCIceCandidate2 = babelHelpers.interopRequireDefault(_RTCIceCandidate); + +var _RTCIceCandidateEvent = require(481 ); // 481 = ./RTCIceCandidateEvent + +var _RTCIceCandidateEvent2 = babelHelpers.interopRequireDefault(_RTCIceCandidateEvent); + +var _RTCEvent = require(482 ); // 482 = ./RTCEvent + +var _RTCEvent2 = babelHelpers.interopRequireDefault(_RTCEvent); + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; + +var DEFAULT_SDP_CONSTRAINTS = { + mandatory: { + OfferToReceiveAudio: true, + OfferToReceiveVideo: true + }, + optional: [] +}; + +var DEFAULT_PC_CONSTRAINTS = { + mandatory: {}, + optional: [{ DtlsSrtpKeyAgreement: true }] +}; + +var PEER_CONNECTION_EVENTS = ['connectionstatechange', 'icecandidate', 'icecandidateerror', 'iceconnectionstatechange', 'icegatheringstatechange', 'negotiationneeded', 'signalingstatechange', 'datachannel', 'addstream', 'removestream']; + +var nextPeerConnectionId = 0; + +var RTCPeerConnection = function (_EventTarget) { + babelHelpers.inherits(RTCPeerConnection, _EventTarget); + + function RTCPeerConnection(configuration) { + babelHelpers.classCallCheck(this, RTCPeerConnection); + + var _this = babelHelpers.possibleConstructorReturn(this, (RTCPeerConnection.__proto__ || Object.getPrototypeOf(RTCPeerConnection)).call(this)); + + _this.signalingState = 'stable'; + _this.iceGatheringState = 'new'; + _this.iceConnectionState = 'new'; + _this._remoteStreams = []; + _this._dataChannelIds = new Set(); + + _this._peerConnectionId = nextPeerConnectionId++; + WebRTCModule.peerConnectionInit(configuration, DEFAULT_PC_CONSTRAINTS, _this._peerConnectionId); + _this._registerEvents(); + return _this; + } + + babelHelpers.createClass(RTCPeerConnection, [{ + key: 'addStream', + value: function addStream(stream) { + WebRTCModule.peerConnectionAddStream(stream.reactTag, this._peerConnectionId); + } + }, { + key: 'removeStream', + value: function removeStream(stream) { + WebRTCModule.peerConnectionRemoveStream(stream.reactTag, this._peerConnectionId); + } + }, { + key: '_mergeMediaConstraints', + value: function _mergeMediaConstraints(options) { + var constraints = babelHelpers.extends({}, DEFAULT_SDP_CONSTRAINTS); + if (options) { + if (options.mandatory) { + constraints.mandatory = babelHelpers.extends({}, constraints.mandatory, options.mandatory); + } + if (options.optional && Array.isArray(options.optional)) { + constraints.optional = options.optional.concat(constraints.optional); + } + } + return constraints; + } + }, { + key: 'createOffer', + value: function createOffer(successCallback, failureCallback, options) { + WebRTCModule.peerConnectionCreateOffer(this._peerConnectionId, this._mergeMediaConstraints(options), function (successful, data) { + if (successful) { + successCallback(new _RTCSessionDescription2.default(data)); + } else { + failureCallback(data); + } + }); + } + }, { + key: 'createAnswer', + value: function createAnswer(successCallback, failureCallback, options) { + WebRTCModule.peerConnectionCreateAnswer(this._peerConnectionId, this._mergeMediaConstraints(options), function (successful, data) { + if (successful) { + successCallback(new _RTCSessionDescription2.default(data)); + } else { + failureCallback(data); + } + }); + } + }, { + key: 'setConfiguration', + value: function setConfiguration(configuration) { + WebRTCModule.peerConnectionSetConfiguration(configuration, this._peerConnectionId); + } + }, { + key: 'setLocalDescription', + value: function setLocalDescription(sessionDescription, success, failure, constraints) { + var _this2 = this; + + WebRTCModule.peerConnectionSetLocalDescription(sessionDescription.toJSON(), this._peerConnectionId, function (successful, data) { + if (successful) { + _this2.localDescription = sessionDescription; + success(); + } else { + failure(data); + } + }); + } + }, { + key: 'setRemoteDescription', + value: function setRemoteDescription(sessionDescription, success, failure) { + var _this3 = this; + + WebRTCModule.peerConnectionSetRemoteDescription(sessionDescription.toJSON(), this._peerConnectionId, function (successful, data) { + if (successful) { + _this3.remoteDescription = sessionDescription; + success(); + } else { + failure(data); + } + }); + } + }, { + key: 'addIceCandidate', + value: function addIceCandidate(candidate, success, failure) { + WebRTCModule.peerConnectionAddICECandidate(candidate.toJSON(), this._peerConnectionId, function (successful) { + if (successful) { + success && success(); + } else { + failure && failure(); + } + }); + } + }, { + key: 'getStats', + value: function getStats(track, success, failure) { + if (WebRTCModule.peerConnectionGetStats) { + WebRTCModule.peerConnectionGetStats(track && track.id || '', this._peerConnectionId, function (stats) { + if (success) { + if (typeof stats === 'string') { + try { + stats = JSON.parse(stats); + } catch (e) { + failure(e); + return; + } + } + success(stats); + } + }); + } else { + console.warn('RTCPeerConnection getStats not supported'); + } + } + }, { + key: 'getRemoteStreams', + value: function getRemoteStreams() { + return this._remoteStreams.slice(); + } + }, { + key: 'close', + value: function close() { + WebRTCModule.peerConnectionClose(this._peerConnectionId); + } + }, { + key: '_unregisterEvents', + value: function _unregisterEvents() { + this._subscriptions.forEach(function (e) { + return e.remove(); + }); + this._subscriptions = []; + } + }, { + key: '_registerEvents', + value: function _registerEvents() { + var _this4 = this; + + this._subscriptions = [_reactNative.DeviceEventEmitter.addListener('peerConnectionOnRenegotiationNeeded', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + _this4.dispatchEvent(new _RTCEvent2.default('negotiationneeded')); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionIceConnectionChanged', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + _this4.iceConnectionState = ev.iceConnectionState; + _this4.dispatchEvent(new _RTCEvent2.default('iceconnectionstatechange')); + if (ev.iceConnectionState === 'closed') { + _this4._unregisterEvents(); + } + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionSignalingStateChanged', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + _this4.signalingState = ev.signalingState; + _this4.dispatchEvent(new _RTCEvent2.default('signalingstatechange')); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionAddedStream', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + var stream = new _MediaStream2.default(ev.streamId, ev.streamReactTag); + var tracks = ev.tracks; + for (var i = 0; i < tracks.length; i++) { + stream.addTrack(new _MediaStreamTrack2.default(tracks[i])); + } + _this4._remoteStreams.push(stream); + _this4.dispatchEvent(new _MediaStreamEvent2.default('addstream', { stream: stream })); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionRemovedStream', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + var stream = _this4._remoteStreams.find(function (s) { + return s.reactTag === ev.streamId; + }); + if (stream) { + var index = _this4._remoteStreams.indexOf(stream); + if (index > -1) { + _this4._remoteStreams.splice(index, 1); + } + } + _this4.dispatchEvent(new _MediaStreamEvent2.default('removestream', { stream: stream })); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionGotICECandidate', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + var candidate = new _RTCIceCandidate2.default(ev.candidate); + var event = new _RTCIceCandidateEvent2.default('icecandidate', { candidate: candidate }); + _this4.dispatchEvent(event); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionIceGatheringChanged', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + _this4.iceGatheringState = ev.iceGatheringState; + + if (_this4.iceGatheringState === 'complete') { + _this4.dispatchEvent(new _RTCIceCandidateEvent2.default('icecandidate', null)); + } + + _this4.dispatchEvent(new _RTCEvent2.default('icegatheringstatechange')); + }), _reactNative.DeviceEventEmitter.addListener('peerConnectionDidOpenDataChannel', function (ev) { + if (ev.id !== _this4._peerConnectionId) { + return; + } + var evDataChannel = ev.dataChannel; + var id = evDataChannel.id; + + if (typeof id !== 'number' || id === -1) { + return; + } + var channel = new _RTCDataChannel2.default(_this4._peerConnectionId, evDataChannel.label, evDataChannel); + + _this4._dataChannelIds.add(id); + _this4.dispatchEvent(new _RTCDataChannelEvent2.default('datachannel', { channel: channel })); + })]; + } + }, { + key: 'createDataChannel', + value: function createDataChannel(label, dataChannelDict) { + var id = void 0; + var dataChannelIds = this._dataChannelIds; + if (dataChannelDict && 'id' in dataChannelDict) { + id = dataChannelDict.id; + if (typeof id !== 'number') { + throw new TypeError('DataChannel id must be a number: ' + id); + } + if (dataChannelIds.has(id)) { + throw new ResourceInUse('DataChannel id already in use: ' + id); + } + } else { + for (id = 0; id < 65535 && dataChannelIds.has(id); ++id) {} + + dataChannelDict = babelHelpers.extends({ id: id }, dataChannelDict); + } + WebRTCModule.createDataChannel(this._peerConnectionId, label, dataChannelDict); + dataChannelIds.add(id); + return new _RTCDataChannel2.default(this._peerConnectionId, label, dataChannelDict); + } + }]); + return RTCPeerConnection; +}((0, _eventTargetShim2.default)(PEER_CONNECTION_EVENTS)); + +exports.default = RTCPeerConnection; +}, 470, null, "react-native-webrtc/RTCPeerConnection.js"); +__d(/* react-native-webrtc/MediaStream.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactNative = require(69 ); // 69 = react-native + +var _eventTargetShim = require(116 ); // 116 = event-target-shim + +var _eventTargetShim2 = babelHelpers.interopRequireDefault(_eventTargetShim); + +var _MediaStreamTrackEvent = require(472 ); // 472 = ./MediaStreamTrackEvent + +var _MediaStreamTrackEvent2 = babelHelpers.interopRequireDefault(_MediaStreamTrackEvent); + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; + + +var MEDIA_STREAM_EVENTS = ['active', 'inactive', 'addtrack', 'removetrack']; + +var MediaStream = function (_EventTarget) { + babelHelpers.inherits(MediaStream, _EventTarget); + + function MediaStream(id, reactTag) { + babelHelpers.classCallCheck(this, MediaStream); + + var _this = babelHelpers.possibleConstructorReturn(this, (MediaStream.__proto__ || Object.getPrototypeOf(MediaStream)).call(this)); + + _this.active = true; + _this._tracks = []; + + _this.id = id; + + _this.reactTag = typeof reactTag === 'undefined' ? id : reactTag; + return _this; + } + + babelHelpers.createClass(MediaStream, [{ + key: 'addTrack', + value: function addTrack(track) { + this._tracks.push(track); + this.dispatchEvent(new _MediaStreamTrackEvent2.default('addtrack', { track: track })); + } + }, { + key: 'removeTrack', + value: function removeTrack(track) { + var index = this._tracks.indexOf(track); + if (index === -1) { + return; + } + WebRTCModule.mediaStreamTrackRelease(this.reactTag, track.id); + this._tracks.splice(index, 1); + this.dispatchEvent(new _MediaStreamTrackEvent2.default('removetrack', { track: track })); + } + }, { + key: 'getTracks', + value: function getTracks() { + return this._tracks.slice(); + } + }, { + key: 'getTrackById', + value: function getTrackById(trackId) { + return this._tracks.find(function (track) { + return track.id === trackId; + }); + } + }, { + key: 'getAudioTracks', + value: function getAudioTracks() { + return this._tracks.filter(function (track) { + return track.kind === 'audio'; + }); + } + }, { + key: 'getVideoTracks', + value: function getVideoTracks() { + return this._tracks.filter(function (track) { + return track.kind === 'video'; + }); + } + }, { + key: 'clone', + value: function clone() { + throw new Error('Not implemented.'); + } + }, { + key: 'toURL', + value: function toURL() { + return this.reactTag; + } + }, { + key: 'release', + value: function release() { + WebRTCModule.mediaStreamRelease(this.reactTag); + } + }]); + return MediaStream; +}((0, _eventTargetShim2.default)(MEDIA_STREAM_EVENTS)); + +exports.default = MediaStream; +}, 471, null, "react-native-webrtc/MediaStream.js"); +__d(/* react-native-webrtc/MediaStreamTrackEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var MediaStreamTrackEvent = function MediaStreamTrackEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, MediaStreamTrackEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = MediaStreamTrackEvent; +}, 472, null, "react-native-webrtc/MediaStreamTrackEvent.js"); +__d(/* react-native-webrtc/MediaStreamEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var MediaStreamEvent = function MediaStreamEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, MediaStreamEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = MediaStreamEvent; +}, 473, null, "react-native-webrtc/MediaStreamEvent.js"); +__d(/* react-native-webrtc/MediaStreamTrack.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactNative = require(69 ); // 69 = react-native + +var _eventTargetShim = require(116 ); // 116 = event-target-shim + +var _eventTargetShim2 = babelHelpers.interopRequireDefault(_eventTargetShim); + +var _MediaStreamErrorEvent = require(475 ); // 475 = ./MediaStreamErrorEvent + +var _MediaStreamErrorEvent2 = babelHelpers.interopRequireDefault(_MediaStreamErrorEvent); + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; + + +var MEDIA_STREAM_TRACK_EVENTS = ['ended', 'mute', 'unmute', 'overconstrained']; + +var MediaStreamTrack = function (_EventTarget) { + babelHelpers.inherits(MediaStreamTrack, _EventTarget); + babelHelpers.createClass(MediaStreamTrack, null, [{ + key: 'getSources', + value: function getSources(success) { + WebRTCModule.mediaStreamTrackGetSources(success); + } + }]); + + function MediaStreamTrack(info) { + babelHelpers.classCallCheck(this, MediaStreamTrack); + + var _this = babelHelpers.possibleConstructorReturn(this, (MediaStreamTrack.__proto__ || Object.getPrototypeOf(MediaStreamTrack)).call(this)); + + var _readyState = info.readyState.toLowerCase(); + _this._enabled = info.enabled; + _this.id = info.id; + _this.kind = info.kind; + _this.label = info.label; + _this.muted = false; + _this.readonly = true; + _this.remote = info.remote; + _this.readyState = _readyState === "initializing" || _readyState === "live" ? "live" : "ended"; + return _this; + } + + babelHelpers.createClass(MediaStreamTrack, [{ + key: 'stop', + value: function stop() { + if (this.remote) { + return; + } + WebRTCModule.mediaStreamTrackStop(this.id); + this._enabled = false; + this.readyState = 'ended'; + this.muted = !this._enabled; + } + }, { + key: '_switchCamera', + value: function _switchCamera() { + if (this.remote) { + throw new Error('Not implemented for remote tracks'); + } + if (this.kind !== 'video') { + throw new Error('Only implemented for video tracks'); + } + WebRTCModule.mediaStreamTrackSwitchCamera(this.id); + } + }, { + key: 'applyConstraints', + value: function applyConstraints() { + throw new Error('Not implemented.'); + } + }, { + key: 'clone', + value: function clone() { + throw new Error('Not implemented.'); + } + }, { + key: 'getCapabilities', + value: function getCapabilities() { + throw new Error('Not implemented.'); + } + }, { + key: 'getConstraints', + value: function getConstraints() { + throw new Error('Not implemented.'); + } + }, { + key: 'getSettings', + value: function getSettings() { + throw new Error('Not implemented.'); + } + }, { + key: 'enabled', + get: function get() { + return this._enabled; + }, + set: function set(enabled) { + if (enabled === this._enabled) { + return; + } + WebRTCModule.mediaStreamTrackSetEnabled(this.id, !this._enabled); + this._enabled = !this._enabled; + this.muted = !this._enabled; + } + }]); + return MediaStreamTrack; +}((0, _eventTargetShim2.default)(MEDIA_STREAM_TRACK_EVENTS)); + +exports.default = MediaStreamTrack; +}, 474, null, "react-native-webrtc/MediaStreamTrack.js"); +__d(/* react-native-webrtc/MediaStreamErrorEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var MediaStreamErrorEvent = function MediaStreamErrorEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, MediaStreamErrorEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = MediaStreamErrorEvent; +}, 475, null, "react-native-webrtc/MediaStreamErrorEvent.js"); +__d(/* react-native-webrtc/RTCDataChannel.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactNative = require(69 ); // 69 = react-native + +var _base64Js = require(115 ); // 115 = base64-js + +var _base64Js2 = babelHelpers.interopRequireDefault(_base64Js); + +var _eventTargetShim = require(116 ); // 116 = event-target-shim + +var _eventTargetShim2 = babelHelpers.interopRequireDefault(_eventTargetShim); + +var _MessageEvent = require(477 ); // 477 = ./MessageEvent + +var _MessageEvent2 = babelHelpers.interopRequireDefault(_MessageEvent); + +var _RTCDataChannelEvent = require(478 ); // 478 = ./RTCDataChannelEvent + +var _RTCDataChannelEvent2 = babelHelpers.interopRequireDefault(_RTCDataChannelEvent); + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; + + +var DATA_CHANNEL_EVENTS = ['open', 'message', 'bufferedamountlow', 'close', 'error']; + +var ResourceInUse = function (_Error) { + babelHelpers.inherits(ResourceInUse, _Error); + + function ResourceInUse() { + babelHelpers.classCallCheck(this, ResourceInUse); + return babelHelpers.possibleConstructorReturn(this, (ResourceInUse.__proto__ || Object.getPrototypeOf(ResourceInUse)).apply(this, arguments)); + } + + return ResourceInUse; +}(Error); + +var RTCDataChannel = function (_EventTarget) { + babelHelpers.inherits(RTCDataChannel, _EventTarget); + + function RTCDataChannel(peerConnectionId, label, dataChannelDict) { + babelHelpers.classCallCheck(this, RTCDataChannel); + + var _this2 = babelHelpers.possibleConstructorReturn(this, (RTCDataChannel.__proto__ || Object.getPrototypeOf(RTCDataChannel)).call(this)); + + _this2.binaryType = 'arraybuffer'; + _this2.bufferedAmount = 0; + _this2.bufferedAmountLowThreshold = 0; + _this2.maxPacketLifeTime = null; + _this2.maxRetransmits = null; + _this2.negotiated = false; + _this2.ordered = true; + _this2.protocol = ''; + _this2.readyState = 'connecting'; + + + _this2._peerConnectionId = peerConnectionId; + + _this2.label = label; + + _this2.id = 'id' in dataChannelDict ? dataChannelDict.id : -1; + _this2.ordered = !!dataChannelDict.ordered; + _this2.maxPacketLifeTime = dataChannelDict.maxPacketLifeTime; + _this2.maxRetransmits = dataChannelDict.maxRetransmits; + _this2.protocol = dataChannelDict.protocol || ''; + _this2.negotiated = !!dataChannelDict.negotiated; + + _this2._registerEvents(); + return _this2; + } + + babelHelpers.createClass(RTCDataChannel, [{ + key: 'send', + value: function send(data) { + if (typeof data === 'string') { + WebRTCModule.dataChannelSend(this._peerConnectionId, this.id, data, 'text'); + return; + } + + if (ArrayBuffer.isView(data)) { + data = data.buffer; + } + if (!(data instanceof ArrayBuffer)) { + throw new TypeError('Data must be either string, ArrayBuffer, or ArrayBufferView'); + } + WebRTCModule.dataChannelSend(this._peerConnectionId, this.id, _base64Js2.default.fromByteArray(new Uint8Array(data)), 'binary'); + } + }, { + key: 'close', + value: function close() { + if (this.readyState === 'closing' || this.readyState === 'closed') { + return; + } + this.readyState = 'closing'; + WebRTCModule.dataChannelClose(this._peerConnectionId, this.id); + } + }, { + key: '_unregisterEvents', + value: function _unregisterEvents() { + this._subscriptions.forEach(function (e) { + return e.remove(); + }); + this._subscriptions = []; + } + }, { + key: '_registerEvents', + value: function _registerEvents() { + var _this3 = this; + + this._subscriptions = [_reactNative.DeviceEventEmitter.addListener('dataChannelStateChanged', function (ev) { + if (ev.peerConnectionId !== _this3._peerConnectionId || ev.id !== _this3.id) { + return; + } + _this3.readyState = ev.state; + if (_this3.readyState === 'open') { + _this3.dispatchEvent(new _RTCDataChannelEvent2.default('open', { channel: _this3 })); + } else if (_this3.readyState === 'close') { + _this3.dispatchEvent(new _RTCDataChannelEvent2.default('close', { channel: _this3 })); + _this3._unregisterEvents(); + } + }), _reactNative.DeviceEventEmitter.addListener('dataChannelReceiveMessage', function (ev) { + if (ev.peerConnectionId !== _this3._peerConnectionId || ev.id !== _this3.id) { + return; + } + var data = ev.data; + if (ev.type === 'binary') { + data = _base64Js2.default.toByteArray(ev.data).buffer; + } + _this3.dispatchEvent(new _MessageEvent2.default('message', { data: data })); + })]; + } + }]); + return RTCDataChannel; +}((0, _eventTargetShim2.default)(DATA_CHANNEL_EVENTS)); + +exports.default = RTCDataChannel; +}, 476, null, "react-native-webrtc/RTCDataChannel.js"); +__d(/* react-native-webrtc/MessageEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var MessageEvent = function MessageEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, MessageEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = MessageEvent; +}, 477, null, "react-native-webrtc/MessageEvent.js"); +__d(/* react-native-webrtc/RTCDataChannelEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var RTCDataChannelEvent = function RTCDataChannelEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, RTCDataChannelEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = RTCDataChannelEvent; +}, 478, null, "react-native-webrtc/RTCDataChannelEvent.js"); +__d(/* react-native-webrtc/RTCSessionDescription.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var RTCSessionDescription = function () { + function RTCSessionDescription(info) { + babelHelpers.classCallCheck(this, RTCSessionDescription); + + this.sdp = info.sdp; + this.type = info.type; + } + + babelHelpers.createClass(RTCSessionDescription, [{ + key: 'toJSON', + value: function toJSON() { + return { sdp: this.sdp, type: this.type }; + } + }]); + return RTCSessionDescription; +}(); + +exports.default = RTCSessionDescription; +}, 479, null, "react-native-webrtc/RTCSessionDescription.js"); +__d(/* react-native-webrtc/RTCIceCandidate.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var RTCIceCandidate = function () { + function RTCIceCandidate(info) { + babelHelpers.classCallCheck(this, RTCIceCandidate); + + this.candidate = info.candidate; + this.sdpMLineIndex = info.sdpMLineIndex; + this.sdpMid = info.sdpMid; + } + + babelHelpers.createClass(RTCIceCandidate, [{ + key: 'toJSON', + value: function toJSON() { + return { + candidate: this.candidate, + sdpMLineIndex: this.sdpMLineIndex, + sdpMid: this.sdpMid + }; + } + }]); + return RTCIceCandidate; +}(); + +exports.default = RTCIceCandidate; +}, 480, null, "react-native-webrtc/RTCIceCandidate.js"); +__d(/* react-native-webrtc/RTCIceCandidateEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var RTCIceCandidateEvent = function RTCIceCandidateEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, RTCIceCandidateEvent); + + this.type = type.toString(); + + this.candidate = null; + if (eventInitDict && eventInitDict.candidate) { + this.candidate = eventInitDict.candidate; + } +}; + +exports.default = RTCIceCandidateEvent; +}, 481, null, "react-native-webrtc/RTCIceCandidateEvent.js"); +__d(/* react-native-webrtc/RTCEvent.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var RTCEvent = function RTCEvent(type, eventInitDict) { + babelHelpers.classCallCheck(this, RTCEvent); + + this.type = type.toString(); + babelHelpers.extends(this, eventInitDict); +}; + +exports.default = RTCEvent; +}, 482, null, "react-native-webrtc/RTCEvent.js"); +__d(/* react-native-webrtc/RTCView.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reactNative = require(69 ); // 69 = react-native + +var _react = require(34 ); // 34 = react + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; + + +var RTCView = { + name: 'RTCVideoView', + propTypes: { + mirror: _react.PropTypes.bool, + + objectFit: _react.PropTypes.oneOf(['contain', 'cover']), + + streamURL: _react.PropTypes.string, + + zOrder: _react.PropTypes.number + } +}; + +var View = (0, _reactNative.requireNativeComponent)('RTCVideoView', RTCView, { nativeOnly: { + testID: true, + accessibilityComponentType: true, + renderToHardwareTextureAndroid: true, + accessibilityLabel: true, + accessibilityLiveRegion: true, + importantForAccessibility: true, + onLayout: true, + nativeID: true + } }); + +exports.default = View; +}, 483, null, "react-native-webrtc/RTCView.js"); +__d(/* react-native-webrtc/getUserMedia.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getUserMedia; + +var _reactNative = require(69 ); // 69 = react-native + +var _MediaStream = require(471 ); // 471 = ./MediaStream + +var _MediaStream2 = babelHelpers.interopRequireDefault(_MediaStream); + +var _MediaStreamError = require(485 ); // 485 = ./MediaStreamError + +var _MediaStreamError2 = babelHelpers.interopRequireDefault(_MediaStreamError); + +var _MediaStreamTrack = require(474 ); // 474 = ./MediaStreamTrack + +var _MediaStreamTrack2 = babelHelpers.interopRequireDefault(_MediaStreamTrack); + +var WebRTCModule = _reactNative.NativeModules.WebRTCModule; +function getUserMedia(constraints, successCallback, errorCallback) { + if (typeof successCallback !== 'function') { + throw new TypeError('successCallback is non-nullable and required'); + } + if (typeof errorCallback !== 'function') { + throw new TypeError('errorCallback is non-nullable and required'); + } + + if (typeof constraints === 'object') { + var requestedMediaTypes = 0; + var _arr = ['audio', 'video']; + for (var _i = 0; _i < _arr.length; _i++) { + var mediaType = _arr[_i]; + var mediaTypeConstraints = constraints[mediaType]; + var typeofMediaTypeConstraints = typeof mediaTypeConstraints; + if (typeofMediaTypeConstraints !== 'undefined') { + if (typeofMediaTypeConstraints === 'boolean') { + mediaTypeConstraints && ++requestedMediaTypes; + } else if (typeofMediaTypeConstraints == 'object') { + ++requestedMediaTypes; + } else { + errorCallback(new TypeError('constraints.' + mediaType + ' is neither a boolean nor a dictionary')); + return; + } + } + } + + if (requestedMediaTypes === 0) { + errorCallback(new TypeError('constraints requests no media types')); + return; + } + } else { + errorCallback(new TypeError('constraints is not a dictionary')); + return; + } + + WebRTCModule.getUserMedia(constraints, function (id, tracks) { + var stream = new _MediaStream2.default(id); + for (var _iterator = tracks, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref; + + if (_isArray) { + if (_i2 >= _iterator.length) break; + _ref = _iterator[_i2++]; + } else { + _i2 = _iterator.next(); + if (_i2.done) break; + _ref = _i2.value; + } + + var track = _ref; + + stream.addTrack(new _MediaStreamTrack2.default(track)); + } + + successCallback(stream); + }, function (type, message) { + var error = void 0; + switch (type) { + case 'DOMException': + if (typeof DOMException === 'function') { + error = new DOMException(undefined, message); + } + break; + case 'OverconstrainedError': + if (typeof OverconstrainedError === 'function') { + error = new OverconstrainedError(undefined, message); + } + break; + case 'TypeError': + error = new TypeError(message); + break; + } + if (!error) { + error = new _MediaStreamError2.default({ message: message, name: type }); + } + + errorCallback(error); + }); +} +}, 484, null, "react-native-webrtc/getUserMedia.js"); +__d(/* react-native-webrtc/MediaStreamError.js */function(global, require, module, exports) {'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var MediaStreamError = function MediaStreamError(error) { + babelHelpers.classCallCheck(this, MediaStreamError); + + this.name = error.name; + this.message = error.message; + this.constraintName = error.constraintName; +}; + +exports.default = MediaStreamError; +}, 485, null, "react-native-webrtc/MediaStreamError.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js */function(global, require, module, exports) {Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _RTCPeerConnection; + +var _reactNative = require(69 ); // 69 = react-native + +var _reactNativeWebrtc = require(469 ); // 469 = react-native-webrtc + +function _RTCPeerConnection() { + var _this = this; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _reactNativeWebrtc.RTCPeerConnection.apply(this, args); + + this.onaddstream = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return (_this._onaddstreamQueue ? _this._queueOnaddstream : _this._invokeOnaddstream).apply(_this, args); + }; + + Object.defineProperty(this, 'onaddstream', { + configurable: true, + enumerable: true, + get: function get() { + return this._onaddstream; + }, + set: function set(value) { + this._onaddstream = value; + } + }); +} + +_RTCPeerConnection.prototype = Object.create(_reactNativeWebrtc.RTCPeerConnection.prototype); +_RTCPeerConnection.prototype.constructor = _RTCPeerConnection; + +_RTCPeerConnection.prototype._invokeOnaddstream = function () { + var onaddstream = this._onaddstream; + + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return onaddstream && onaddstream.apply(this, args); +}; + +_RTCPeerConnection.prototype._invokeQueuedOnaddstream = function (q) { + var _this2 = this; + + q && q.forEach(function (args) { + try { + _this2._invokeOnaddstream.apply(_this2, babelHelpers.toConsumableArray(args)); + } catch (e) { + _LOGE(e); + } + }); +}; + +_RTCPeerConnection.prototype._queueOnaddstream = function () { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + this._onaddstreamQueue.push(Array.from(args)); +}; + +_RTCPeerConnection.prototype.setRemoteDescription = function (sessionDescription, successCallback, errorCallback) { + var _this3 = this; + + if (typeof successCallback !== 'undefined' || typeof errorCallback !== 'undefined') { + return _RTCPeerConnection.prototype.setRemoteDescription.call(this, sessionDescription).then(successCallback, errorCallback); + } + + return _synthesizeIPv6Addresses(sessionDescription).catch(function (reason) { + reason && _LOGE(reason); + + return sessionDescription; + }).then(function (value) { + return _setRemoteDescription.bind(_this3)(value); + }); +}; + +function _LOGE() { + var _console; + + console && console.error && (_console = console).error.apply(_console, arguments); +} + +function _setRemoteDescription(sessionDescription) { + var _this4 = this; + + return new Promise(function (resolve, reject) { + _this4._onaddstreamQueue = []; + + _reactNativeWebrtc.RTCPeerConnection.prototype.setRemoteDescription.call(_this4, sessionDescription, function () { + var q = void 0; + + try { + resolve.apply(undefined, arguments); + } finally { + q = _this4._onaddstreamQueue; + _this4._onaddstreamQueue = undefined; + } + + _this4._invokeQueuedOnaddstream(q); + }, function () { + _this4._onaddstreamQueue = undefined; + + reject.apply(undefined, arguments); + }); + }); +} + +function _synthesizeIPv6Addresses(sdp) { + if (!_reactNative.NativeModules.POSIX) { + return Promise.resolve(sdp); + } + + return new Promise(function (resolve) { + return resolve(_synthesizeIPv6Addresses0(sdp)); + }).then(function (_ref) { + var ips = _ref.ips, + lines = _ref.lines; + return Promise.all(Array.from(ips.values())).then(function () { + return _synthesizeIPv6Addresses1(sdp, ips, lines); + }); + }); +} + +function _synthesizeIPv6Addresses0(sessionDescription) { + var sdp = sessionDescription.sdp; + var start = 0; + var lines = []; + var ips = new Map(); + var getaddrinfo = _reactNative.NativeModules.POSIX.getaddrinfo; + + do { + var end = sdp.indexOf('\r\n', start); + var line = void 0; + + if (end === -1) { + line = sdp.substring(start); + + start = undefined; + } else { + line = sdp.substring(start, end); + start = end + 2; + } + + if (line.startsWith('a=candidate:')) { + var candidate = line.split(' '); + + if (candidate.length >= 10 && candidate[6] === 'typ') { + var ip4s = [candidate[4]]; + var abort = false; + + for (var i = 8; i < candidate.length; ++i) { + if (candidate[i] === 'raddr') { + ip4s.push(candidate[++i]); + break; + } + } + + var _loop = function _loop(ip) { + if (ip.indexOf(':') === -1) { + ips.has(ip) || ips.set(ip, new Promise(function (resolve, reject) { + var v = ips.get(ip); + + if (v && typeof v === 'string') { + resolve(v); + } else { + getaddrinfo(ip).then(function (value) { + if (value.indexOf(':') === -1 || value === ips.get(ip)) { + ips.delete(ip); + } else { + ips.set(ip, value); + } + resolve(value); + }, reject); + } + })); + } else { + abort = true; + return 'break'; + } + }; + + for (var _iterator = ip4s, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator']();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var ip = _ref2; + + var _ret = _loop(ip); + + if (_ret === 'break') break; + } + if (abort) { + ips.clear(); + break; + } + + line = candidate; + } + } + + lines.push(line); + } while (start); + + return { + ips: ips, + lines: lines + }; +} + +function _synthesizeIPv6Addresses1(sessionDescription, ips, lines) { + if (ips.size === 0) { + return sessionDescription; + } + + for (var l = 0; l < lines.length; ++l) { + var candidate = lines[l]; + + if (typeof candidate !== 'string') { + var ip4 = candidate[4]; + var ip6 = ips.get(ip4); + + ip6 && (candidate[4] = ip6); + + for (var i = 8; i < candidate.length; ++i) { + if (candidate[i] === 'raddr') { + ip4 = candidate[++i]; + (ip6 = ips.get(ip4)) && (candidate[i] = ip6); + break; + } + } + + lines[l] = candidate.join(' '); + } + } + + return new _reactNativeWebrtc.RTCSessionDescription({ + sdp: lines.join('\r\n'), + type: sessionDescription.type + }); +} +}, 486, null, "jitsi-meet/react/features/base/lib-jitsi-meet/native/RTCPeerConnection.js"); +__d(/* jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-browserify.js */function(global, require, module, exports) {(function (global) { + if (typeof global.__filename === 'undefined') { + global.__filename = '__filename'; + } +})(global || window || this); +}, 487, null, "jitsi-meet/react/features/base/lib-jitsi-meet/native/polyfills-browserify.js"); +__d(/* lib-jitsi-meet/lib-jitsi-meet.min.js */function(global, require, module, exports) { +!function (e, t) { + "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.JitsiMeetJS = t() : e.JitsiMeetJS = t(); +}(this, function () { + return function (e) { + function t(r) { + if (n[r]) return n[r].exports;var i = n[r] = { i: r, l: !1, exports: {} };return e[r].call(i.exports, i, i.exports, t), i.l = !0, i.exports; + }var n = {};return t.m = e, t.c = n, t.i = function (e) { + return e; + }, t.d = function (e, n, r) { + t.o(e, n) || Object.defineProperty(e, n, { configurable: !1, enumerable: !0, get: r }); + }, t.n = function (e) { + var n = e && e.__esModule ? function () { + return e.default; + } : function () { + return e; + };return t.d(n, "a", n), n; + }, t.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }, t.p = "", t(t.s = 86); + }([function (e, t, n) { + var r = n(42), + i = n(78), + o = {}, + a = [], + s = r.levels.TRACE;e.exports = { addGlobalTransport: function addGlobalTransport(e) { + r.addGlobalTransport(e); + }, removeGlobalTransport: function removeGlobalTransport(e) { + r.removeGlobalTransport(e); + }, getLogger: function getLogger(e, t, n) { + var i = new r(s, e, t, n);return e ? (o[e] = o[e] || [], o[e].push(i)) : a.push(i), i; + }, setLogLevelById: function setLogLevelById(e, t) { + for (var n = t ? o[t] || [] : a, r = 0; r < n.length; r++) { + n[r].setLevel(e); + } + }, setLogLevel: function setLogLevel(e) { + s = e;for (var t = 0; t < a.length; t++) { + a[t].setLevel(e); + }for (var n in o) { + var r = o[n] || [];for (t = 0; t < r.length; t++) { + r[t].setLevel(e); + } + } + }, levels: r.levels, LogCollector: i }; + }, function (e, t) { + var n, + r = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + };n = function () { + return this; + }();try { + n = n || Function("return this")() || (0, eval)("this"); + } catch (e) { + "object" === ("undefined" == typeof window ? "undefined" : r(window)) && (n = window); + }e.exports = n; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r() { + if (navigator.webkitGetUserMedia) { + h = v.RTC_BROWSER_CHROME;var e = navigator.userAgent.toLowerCase(), + t = parseInt(e.match(/chrome\/(\d+)\./)[1], 10);return m.log("This appears to be Chrome, ver: " + t), t; + }return null; + }function i() { + var e = navigator.userAgent;if (e.match(/Opera|OPR/)) { + h = v.RTC_BROWSER_OPERA;var t = e.match(/(Opera|OPR) ?\/?(\d+)\.?/)[2];return m.info("This appears to be Opera, ver: " + t), t; + }return null; + }function o() { + if (navigator.mozGetUserMedia) { + h = v.RTC_BROWSER_FIREFOX;var e = parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1], 10);return m.log("This appears to be Firefox, ver: " + e), e; + }return null; + }function a() { + return (/^((?!chrome).)*safari/i.test(navigator.userAgent) ? (h = v.RTC_BROWSER_SAFARI, m.info("This appears to be Safari"), 1) : null + ); + }function s() { + var e = void 0, + t = window.navigator.userAgent, + n = t.indexOf("MSIE ");n > 0 && (e = parseInt(t.substring(n + 5, t.indexOf(".", n)), 10));var r = t.indexOf("Trident/");if (!e && r > 0) { + var i = t.indexOf("rv:");e = parseInt(t.substring(i + 3, t.indexOf(".", i)), 10); + }return e && (h = v.RTC_BROWSER_IEXPLORER, m.info("This appears to be IExplorer, ver: " + e)), e; + }function c() { + var e = void 0, + t = window.navigator.userAgent, + n = t.indexOf("Edge/");return !e && n > 0 && (e = parseInt(t.substring(n + 5, t.indexOf(".", n)), 10)), e && (h = v.RTC_BROWSER_EDGE, m.info("This appears to be Edge, ver: " + e)), e; + }function u() { + var e = navigator.userAgent;if (e.match(/Electron/)) { + h = v.RTC_BROWSER_ELECTRON;var t = e.match(/Electron\/([\d.]+)/)[1];return m.info("This appears to be Electron, ver: " + t), t; + }return null; + }function l() { + var e = navigator.userAgent;if (e.match(/JitsiMeetNW/)) { + h = v.RTC_BROWSER_NWJS;var t = e.match(/JitsiMeetNW\/([\d.]+)/)[1];return m.info("This appears to be JitsiMeetNW, ver: " + t), t; + }return null; + }function d() { + var e = navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i), + t = void 0;if (e || "ReactNative" === navigator.product) { + h = v.RTC_BROWSER_REACT_NATIVE;var n = void 0;e && e.length > 2 && (n = e[1], t = e[2]), n || (n = "react-native"), t || (t = "unknown"), console.info("This appears to be " + n + ", ver: " + t); + } else t = null;return t; + }var p = n(0), + f = void n.n(p), + h = void 0, + m = n.i(p.getLogger)(e), + v = { RTC_BROWSER_CHROME: "rtc_browser.chrome", RTC_BROWSER_OPERA: "rtc_browser.opera", RTC_BROWSER_FIREFOX: "rtc_browser.firefox", RTC_BROWSER_IEXPLORER: "rtc_browser.iexplorer", RTC_BROWSER_EDGE: "rtc_browser.edge", RTC_BROWSER_SAFARI: "rtc_browser.safari", RTC_BROWSER_NWJS: "rtc_browser.nwjs", RTC_BROWSER_ELECTRON: "rtc_browser.electron", RTC_BROWSER_REACT_NATIVE: "rtc_browser.react-native", doesVideoMuteByStreamRemove: function doesVideoMuteByStreamRemove() { + return !(v.isFirefox() || v.isEdge()); + }, getBrowserType: function getBrowserType() { + return h; + }, getBrowserName: function getBrowserName() { + return -1 !== navigator.userAgent.indexOf("Android") ? "android" : h.split("rtc_browser.")[1]; + }, isChrome: function isChrome() { + return h === v.RTC_BROWSER_CHROME; + }, isOpera: function isOpera() { + return h === v.RTC_BROWSER_OPERA; + }, isFirefox: function isFirefox() { + return h === v.RTC_BROWSER_FIREFOX; + }, isIExplorer: function isIExplorer() { + return h === v.RTC_BROWSER_IEXPLORER; + }, isEdge: function isEdge() { + return h === v.RTC_BROWSER_EDGE; + }, isSafari: function isSafari() { + return h === v.RTC_BROWSER_SAFARI; + }, isNWJS: function isNWJS() { + return h === v.RTC_BROWSER_NWJS; + }, isElectron: function isElectron() { + return h === v.RTC_BROWSER_ELECTRON; + }, isP2PSupported: function isP2PSupported() { + return !v.isEdge(); + }, isReactNative: function isReactNative() { + return h === v.RTC_BROWSER_REACT_NATIVE; + }, isTemasysPluginUsed: function isTemasysPluginUsed() { + return v.isSafari() || v.isIExplorer() && v.getIExplorerVersion() < 12; + }, isVideoMuteOnConnInterruptedSupported: function isVideoMuteOnConnInterruptedSupported() { + return v.isChrome(); + }, getFirefoxVersion: function getFirefoxVersion() { + return v.isFirefox() ? f : null; + }, getChromeVersion: function getChromeVersion() { + return v.isChrome() ? f : null; + }, getIExplorerVersion: function getIExplorerVersion() { + return v.isIExplorer() ? f : null; + }, getEdgeVersion: function getEdgeVersion() { + return v.isEdge() ? f : null; + }, usesPlanB: function usesPlanB() { + return !v.usesUnifiedPlan(); + }, usesUnifiedPlan: function usesUnifiedPlan() { + return v.isFirefox(); + }, supportsBandwidthStatistics: function supportsBandwidthStatistics() { + return !v.isFirefox() && !v.isEdge(); + }, supportsDataChannels: function supportsDataChannels() { + return !v.isEdge(); + }, supportsRTTStatistics: function supportsRTTStatistics() { + return !v.isFirefox() && !v.isEdge(); + }, supportsSimulcast: function supportsSimulcast() { + return v.isChrome() || v.isFirefox() || v.isElectron() || v.isNWJS(); + }, supportsRtx: function supportsRtx() { + return !v.isFirefox(); + }, supportsRtpSender: function supportsRtpSender() { + return v.isFirefox(); + } };f = function () { + for (var e = void 0, t = [d, u, l, i, r, o, c, s, a], n = 0; n < t.length; n++) { + if (e = t[n]()) return e; + }return m.warn("Browser type defaults to Safari ver 1"), h = v.RTC_BROWSER_SAFARI, 1; + }(), t.a = v; + }).call(t, "modules/RTC/RTCBrowserType.js"); + }, function (e, t) { + function n() { + for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) { + t[n] = arguments[n]; + }i.forEach(function (e) { + return e.apply(void 0, t); + }), o && o.apply(void 0, t); + }function r(e) { + i.forEach(function (t) { + return t(null, null, null, null, e.reason); + }), a && a(e); + }var i = [], + o = window.onerror, + a = window.onunhandledrejection;window.onerror = n, window.onunhandledrejection = r;var s = { addHandler: function addHandler(e) { + i.push(e); + }, callErrorHandler: function callErrorHandler(e) { + var t = window.onerror;t && t(null, null, null, null, e); + }, callUnhandledRejectionHandler: function callUnhandledRejectionHandler(e) { + var t = window.onunhandledrejection;t && t(e); + } };e.exports = s; + }, function (e, t, n) { + "use strict"; + n.d(t, "a", function () { + return r; + }), n.d(t, "b", function () { + return i; + });var r = "audio", + i = "video"; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "AUTH_STATUS_CHANGED", function () { + return r; + }), n.d(t, "AVAILABLE_DEVICES_CHANGED", function () { + return i; + }), n.d(t, "AVATAR_CHANGED", function () { + return o; + }), n.d(t, "BEFORE_STATISTICS_DISPOSED", function () { + return a; + }), n.d(t, "CONFERENCE_ERROR", function () { + return s; + }), n.d(t, "CONFERENCE_FAILED", function () { + return c; + }), n.d(t, "CONFERENCE_JOINED", function () { + return u; + }), n.d(t, "CONFERENCE_LEFT", function () { + return l; + }), n.d(t, "CONNECTION_INTERRUPTED", function () { + return d; + }), n.d(t, "CONNECTION_RESTORED", function () { + return p; + }), n.d(t, "DISPLAY_NAME_CHANGED", function () { + return f; + }), n.d(t, "DOMINANT_SPEAKER_CHANGED", function () { + return h; + }), n.d(t, "DTMF_SUPPORT_CHANGED", function () { + return m; + }), n.d(t, "ENDPOINT_MESSAGE_RECEIVED", function () { + return v; + }), n.d(t, "JVB121_STATUS", function () { + return g; + }), n.d(t, "KICKED", function () { + return y; + }), n.d(t, "LAST_N_ENDPOINTS_CHANGED", function () { + return b; + }), n.d(t, "LOCK_STATE_CHANGED", function () { + return S; + }), n.d(t, "MESSAGE_RECEIVED", function () { + return E; + }), n.d(t, "PARTICIPANT_CONN_STATUS_CHANGED", function () { + return T; + }), n.d(t, "PARTCIPANT_FEATURES_CHANGED", function () { + return _; + }), n.d(t, "PARTICIPANT_PROPERTY_CHANGED", function () { + return C; + }), n.d(t, "P2P_STATUS", function () { + return w; + }), n.d(t, "PHONE_NUMBER_CHANGED", function () { + return R; + }), n.d(t, "RECORDER_STATE_CHANGED", function () { + return k; + }), n.d(t, "VIDEO_SIP_GW_AVAILABILITY_CHANGED", function () { + return A; + }), n.d(t, "START_MUTED_POLICY_CHANGED", function () { + return I; + }), n.d(t, "STARTED_MUTED", function () { + return P; + }), n.d(t, "SUBJECT_CHANGED", function () { + return O; + }), n.d(t, "SUSPEND_DETECTED", function () { + return D; + }), n.d(t, "TALK_WHILE_MUTED", function () { + return L; + }), n.d(t, "TRACK_ADDED", function () { + return N; + }), n.d(t, "TRACK_AUDIO_LEVEL_CHANGED", function () { + return M; + }), n.d(t, "TRACK_MUTE_CHANGED", function () { + return x; + }), n.d(t, "TRACK_REMOVED", function () { + return j; + }), n.d(t, "USER_JOINED", function () { + return F; + }), n.d(t, "USER_LEFT", function () { + return U; + }), n.d(t, "USER_ROLE_CHANGED", function () { + return B; + }), n.d(t, "USER_STATUS_CHANGED", function () { + return J; + });var r = "conference.auth_status_changed", + i = "conference.availableDevicesChanged", + o = "conference.avatarChanged", + a = "conference.beforeStatisticsDisposed", + s = "conference.error", + c = "conference.failed", + u = "conference.joined", + l = "conference.left", + d = "conference.connectionInterrupted", + p = "conference.connectionRestored", + f = "conference.displayNameChanged", + h = "conference.dominantSpeaker", + m = "conference.dtmfSupportChanged", + v = "conference.endpoint_message_received", + g = "conference.jvb121Status", + y = "conferenece.kicked", + b = "conference.lastNEndpointsChanged", + S = "conference.lock_state_changed", + E = "conference.messageReceived", + T = "conference.participant_conn_status_changed", + _ = "conference.partcipant_features_changed", + C = "conference.participant_property_changed", + w = "conference.p2pStatus", + R = "conference.phoneNumberChanged", + k = "conference.recorderStateChanged", + A = "conference.videoSIPGWAvailabilityChanged", + I = "conference.start_muted_policy_changed", + P = "conference.started_muted", + O = "conference.subjectChanged", + D = "conference.suspendDetected", + L = "conference.talk_while_muted", + N = "conference.trackAdded", + M = "conference.audioLevelsChanged", + x = "conference.trackMuteChanged", + j = "conference.trackRemoved", + F = "conference.userJoined", + U = "conference.userLeft", + B = "conference.roleChanged", + J = "conference.statusChanged"; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e) { + g || (m.loadScript(e || "https://api.callstats.io/static/callstats-ws.min.js", !0, !0), g = !0); + }function i(e) { + var t = new Error();return t.stack = e.stack, t.name = (e.name || "Unknown error") + (e.gum && e.gum.error && e.gum.error.name ? " - " + e.gum.error.name : ""), t.constraintName = e.gum && e.gum.constraints ? JSON.stringify(e.gum.constraints) : "", t.message = e.message, t; + }function o(e, t) { + this.rtpStatsMap = new Map(), this.eventEmitter = new f(), this.xmpp = e, this.options = t || {}, this.callStatsIntegrationEnabled = this.options.callStatsID && this.options.callStatsSecret && !0 !== o.disableThirdPartyRequests, this.callStatsIntegrationEnabled && (r(this.options.callStatsCustomScriptUrl), this.options.callStatsConfIDNamespace || h.warn('"callStatsConfIDNamespace" is not defined')), this.callsStatsInstances = new Map(), o.instances.add(this); + }t.a = o;var a = n(103), + s = n(105), + c = n(11), + u = n(47), + l = n(106), + d = n(55), + p = n(29), + f = n(14), + h = n(0).getLogger(e), + m = n(49), + v = void 0, + g = !1;o.init = function (e) { + o.audioLevelsEnabled = !e.disableAudioLevels, "number" == typeof e.audioLevelsInterval && (o.audioLevelsInterval = e.audioLevelsInterval), o.disableThirdPartyRequests = e.disableThirdPartyRequests; + }, o.audioLevelsEnabled = !1, o.audioLevelsInterval = 200, o.disableThirdPartyRequests = !1, o.analytics = a.a, Object.defineProperty(o, "instances", { get: function get() { + return v || (v = new Set()), v; + } }), o.prototype.startRemoteStats = function (e) { + this.stopRemoteStats(e);try { + var t = new l.a(e, o.audioLevelsInterval, 2e3, this.eventEmitter);t.start(o.audioLevelsEnabled), this.rtpStatsMap.set(e.id, t); + } catch (e) { + h.error("Failed to start collecting remote statistics: " + e); + } + }, o.localStats = [], o.startLocalStats = function (e, t) { + if (o.audioLevelsEnabled) { + var n = new u.a(e, o.audioLevelsInterval, t);this.localStats.push(n), n.start(); + } + }, o.prototype.addAudioLevelListener = function (e) { + o.audioLevelsEnabled && this.eventEmitter.on(d.a, e); + }, o.prototype.removeAudioLevelListener = function (e) { + o.audioLevelsEnabled && this.eventEmitter.removeListener(d.a, e); + }, o.prototype.addBeforeDisposedListener = function (e) { + this.eventEmitter.on(d.b, e); + }, o.prototype.removeBeforeDisposedListener = function (e) { + this.eventEmitter.removeListener(d.b, e); + }, o.prototype.addConnectionStatsListener = function (e) { + this.eventEmitter.on(d.c, e); + }, o.prototype.removeConnectionStatsListener = function (e) { + this.eventEmitter.removeListener(d.c, e); + }, o.prototype.addByteSentStatsListener = function (e) { + this.eventEmitter.on(d.d, e); + }, o.prototype.removeByteSentStatsListener = function (e) { + this.eventEmitter.removeListener(d.d, e); + }, o.prototype.dispose = function () { + try { + this.callsStatsInstances.size || this.eventEmitter.emit(d.b);var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this.callsStatsInstances.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + var a = r.value;this.stopCallStats(a.tpc); + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + }var s = !0, + c = !1, + u = void 0;try { + for (var l, p = this.rtpStatsMap.keys()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(s = (l = p.next()).done); s = !0) { + var f = l.value;this._stopRemoteStats(f); + } + } catch (e) { + c = !0, u = e; + } finally { + try { + !s && p.return && p.return(); + } finally { + if (c) throw u; + } + }this.eventEmitter && this.eventEmitter.removeAllListeners(); + } finally { + o.instances.delete(this); + } + }, o.stopLocalStats = function (e) { + if (o.audioLevelsEnabled) for (var t = 0; t < o.localStats.length; t++) { + if (o.localStats[t].stream === e) { + var n = o.localStats.splice(t, 1);n[0].stop();break; + } + } + }, o.prototype._stopRemoteStats = function (e) { + var t = this.rtpStatsMap.get(e);t && (t.stop(), this.rtpStatsMap.delete(e)); + }, o.prototype.stopRemoteStats = function (e) { + this._stopRemoteStats(e.id); + }, o.prototype.startCallStats = function (e, t) { + if (this.callStatsIntegrationEnabled) { + if (this.callsStatsInstances.has(e.id)) return void h.error("CallStats instance for ${tpc} exists already");if (!s.a.isBackendInitialized()) { + var n = p.a.getCallStatsUserName();if (!s.a.initBackend({ callStatsID: this.options.callStatsID, callStatsSecret: this.options.callStatsSecret, userName: n, aliasName: this.options.callStatsAliasName })) return; + }h.info("Starting CallStats for " + e + "...");var r = new s.a(e, { confID: this._getCallStatsConfID(), remoteUserID: t });this.callsStatsInstances.set(e.id, r); + } + }, o._getAllCallStatsInstances = function () { + var e = new Set(), + t = !0, + n = !1, + r = void 0;try { + for (var i, a = o.instances[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = a.next()).done); t = !0) { + var s = i.value, + c = !0, + u = !1, + l = void 0;try { + for (var d, p = s.callsStatsInstances.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (d = p.next()).done); c = !0) { + var f = d.value;e.add(f); + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && p.return && p.return(); + } finally { + if (u) throw l; + } + } + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && a.return && a.return(); + } finally { + if (n) throw r; + } + }return e; + }, o.prototype._getCallStatsConfID = function () { + return this.options.callStatsConfIDNamespace ? this.options.callStatsConfIDNamespace + "/" + this.options.roomName : this.options.roomName; + }, o.prototype.stopCallStats = function (e) { + var t = this.callsStatsInstances.get(e.id);t && (1 === this.callsStatsInstances.size && this.eventEmitter.emit(d.b), this.callsStatsInstances.delete(e.id), t.sendTerminateEvent()); + }, o.prototype.isCallstatsEnabled = function () { + return this.callStatsIntegrationEnabled; + }, o.prototype.sendConnectionResumeOrHoldEvent = function (e, t) { + var n = this.callsStatsInstances.get(e.id);n && n.sendResumeOrHoldEvent(t); + }, o.prototype.sendIceConnectionFailedEvent = function (e) { + var t = this.callsStatsInstances.get(e.id);t && t.sendIceConnectionFailedEvent(), o.analytics.sendEvent("connection.ice_failed"); + }, o.prototype.sendMuteEvent = function (e, t, n) { + var r = e && this.callsStatsInstances.get(e.id);s.a.sendMuteEvent(t, n, r); + }, o.prototype.sendScreenSharingEvent = function (e) { + var t = !0, + n = !1, + r = void 0;try { + for (var i, o = this.callsStatsInstances.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + i.value.sendScreenSharingEvent(e); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + } + }, o.prototype.sendDominantSpeakerEvent = function () { + var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this.callsStatsInstances.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + r.value.sendDominantSpeakerEvent(); + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + } + }, o.sendActiveDeviceListEvent = function (e) { + var t = o._getAllCallStatsInstances();if (t.size) { + var n = !0, + r = !1, + i = void 0;try { + for (var a, c = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (a = c.next()).done); n = !0) { + var u = a.value;s.a.sendActiveDeviceListEvent(e, u); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && c.return && c.return(); + } finally { + if (r) throw i; + } + } + } else s.a.sendActiveDeviceListEvent(e, null); + }, o.prototype.associateStreamWithVideoTag = function (e, t, n, r, i, o) { + var a = this.callsStatsInstances.get(e.id);a && a.associateStreamWithVideoTag(t, n, r, i, o); + }, o.sendGetUserMediaFailed = function (e) { + var t = e instanceof c.a ? i(e) : e, + n = o._getAllCallStatsInstances();if (n.size) { + var r = !0, + a = !1, + u = void 0;try { + for (var l, d = n[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (l = d.next()).done); r = !0) { + var p = l.value;s.a.sendGetUserMediaFailed(t, p); + } + } catch (e) { + a = !0, u = e; + } finally { + try { + !r && d.return && d.return(); + } finally { + if (a) throw u; + } + } + } else s.a.sendGetUserMediaFailed(t, null); + }, o.prototype.sendCreateOfferFailed = function (e, t) { + var n = this.callsStatsInstances.get(t.id);n && n.sendCreateOfferFailed(e); + }, o.prototype.sendCreateAnswerFailed = function (e, t) { + var n = this.callsStatsInstances.get(t.id);n && n.sendCreateAnswerFailed(e); + }, o.prototype.sendSetLocalDescFailed = function (e, t) { + var n = this.callsStatsInstances.get(t.id);n && n.sendSetLocalDescFailed(e); + }, o.prototype.sendSetRemoteDescFailed = function (e, t) { + var n = this.callsStatsInstances.get(t.id);n && n.sendSetRemoteDescFailed(e); + }, o.prototype.sendAddIceCandidateFailed = function (e, t) { + var n = this.callsStatsInstances.get(t.id);n && n.sendAddIceCandidateFailed(e); + }, o.sendLog = function (e) { + var t = new Set(), + n = !0, + r = !1, + i = void 0;try { + for (var a, c = o.instances[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (a = c.next()).done); n = !0) { + var u = a.value;u.callsStatsInstances.size && t.add(u.callsStatsInstances.values().next().value); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && c.return && c.return(); + } finally { + if (r) throw i; + } + }if (t.size) { + var l = !0, + d = !1, + p = void 0;try { + for (var f, h = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(l = (f = h.next()).done); l = !0) { + var m = f.value;s.a.sendApplicationLog(e, m); + } + } catch (e) { + d = !0, p = e; + } finally { + try { + !l && h.return && h.return(); + } finally { + if (d) throw p; + } + } + } else s.a.sendApplicationLog(e, null); + }, o.prototype.sendFeedback = function (e, t) { + s.a.sendFeedback(this._getCallStatsConfID(), e, t), o.analytics.sendEvent("feedback.rating", { value: e, detailed: t }); + }, o.LOCAL_JID = n(138).LOCAL_JID, o.reportGlobalError = function (e) { + e instanceof c.a && e.gum ? o.sendGetUserMediaFailed(e) : o.sendLog(e); + }, o.sendEventToAll = function (e, t) { + this.analytics.sendEvent(e, t), o.sendLog(JSON.stringify({ name: e, data: t })); + }; + }).call(t, "modules/statistics/statistics.js"); + }, function (e, t) { + var n = { ADD_ICE_CANDIDATE_FAILED: "xmpp.add_ice_candidate_failed", AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus", AUTHENTICATION_REQUIRED: "xmpp.authentication_required", BRIDGE_DOWN: "xmpp.bridge_down", CALL_ACCEPTED: "xmpp.callaccepted.jingle", CALL_INCOMING: "xmpp.callincoming.jingle", CALL_ENDED: "xmpp.callended.jingle", CHAT_ERROR_RECEIVED: "xmpp.chat_error_received", CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed", CONNECTION_ESTABLISHED: "xmpp.connection.connected", CONNECTION_FAILED: "xmpp.connection.failed", CONNECTION_INTERRUPTED: "xmpp.connection.interrupted", CONNECTION_RESTORED: "xmpp.connection.restored", CONNECTION_ICE_FAILED: "xmpp.connection.ice.failed", DISPLAY_NAME_CHANGED: "xmpp.display_name_changed", EMUC_ROOM_ADDED: "xmpp.emuc_room_added", EMUC_ROOM_REMOVED: "xmpp.emuc_room_removed", ETHERPAD: "xmpp.etherpad", FOCUS_DISCONNECTED: "xmpp.focus_disconnected", FOCUS_LEFT: "xmpp.focus_left", GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown", ICE_RESTARTING: "rtc.ice_restarting", JINGLE_ERROR: "xmpp.jingle_error", JINGLE_FATAL_ERROR: "xmpp.jingle_fatal_error", KICKED: "xmpp.kicked", LOCAL_ROLE_CHANGED: "xmpp.localrole_changed", MESSAGE_RECEIVED: "xmpp.message_received", MUC_DESTROYED: "xmpp.muc_destroyed", MUC_JOINED: "xmpp.muc_joined", MUC_MEMBER_JOINED: "xmpp.muc_member_joined", MUC_MEMBER_LEFT: "xmpp.muc_member_left", MUC_LEFT: "xmpp.muc_left", MUC_ROLE_CHANGED: "xmpp.muc_role_changed", MUC_LOCK_CHANGED: "xmpp.muc_lock_changed", PARTICIPANT_AUDIO_MUTED: "xmpp.audio_muted", PARTICIPANT_VIDEO_MUTED: "xmpp.video_muted", PARTICIPANT_VIDEO_TYPE_CHANGED: "xmpp.video_type", PARTCIPANT_FEATURES_CHANGED: "xmpp.partcipant_features_changed", PASSWORD_REQUIRED: "xmpp.password_required", PEERCONNECTION_READY: "xmpp.peerconnection_ready", PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged", PRESENCE_STATUS: "xmpp.presence_status", PROMPT_FOR_LOGIN: "xmpp.prompt_for_login", READY_TO_JOIN: "xmpp.ready_to_join", RECORDER_STATE_CHANGED: "xmpp.recorderStateChanged", REMOTE_STATS: "xmpp.remote_stats", RESERVATION_ERROR: "xmpp.room_reservation_error", ROOM_CONNECT_ERROR: "xmpp.room_connect_error", ROOM_CONNECT_NOT_ALLOWED_ERROR: "xmpp.room_connect_error.not_allowed", ROOM_JOIN_ERROR: "xmpp.room_join_error", ROOM_MAX_USERS_ERROR: "xmpp.room_max_users_error", SENDING_CHAT_MESSAGE: "xmpp.sending_chat_message", SESSION_ACCEPT_TIMEOUT: "xmpp.session_accept_timeout", START_MUTED_FROM_FOCUS: "xmpp.start_muted_from_focus", SUBJECT_CHANGED: "xmpp.subject_changed", SUSPEND_DETECTED: "xmpp.suspend_detected", TRANSPORT_INFO: "xmpp.transportinfo.jingle", VIDEO_SIP_GW_AVAILABILITY_CHANGED: "xmpp.videoSIPGWAvailabilityChanged", ICE_CONNECTION_STATE_CHANGED: "xmpp.ice_connection_state_changed" };e.exports = n; + }, function (e, t) { + var n = { CREATE_ANSWER_FAILED: "rtc.create_answer_failed", CREATE_OFFER_FAILED: "rtc.create_offer_failed", RTC_READY: "rtc.ready", DATA_CHANNEL_OPEN: "rtc.data_channel_open", ENDPOINT_CONN_STATUS_CHANGED: "rtc.endpoint_conn_status_changed", DOMINANT_SPEAKER_CHANGED: "rtc.dominant_speaker_changed", LASTN_ENDPOINT_CHANGED: "rtc.lastn_endpoint_changed", LASTN_VALUE_CHANGED: "rtc.lastn_value_changed", AVAILABLE_DEVICES_CHANGED: "rtc.available_devices_changed", TRACK_ATTACHED: "rtc.track_attached", REMOTE_TRACK_ADDED: "rtc.remote_track_added", REMOTE_TRACK_MUTE: "rtc.remote_track_mute", REMOTE_TRACK_REMOVED: "rtc.remote_track_removed", REMOTE_TRACK_UNMUTE: "rtc.remote_track_unmute", SET_LOCAL_DESCRIPTION_FAILED: "rtc.set_local_description_failed", SET_REMOTE_DESCRIPTION_FAILED: "rtc.set_remote_description_failed", AUDIO_OUTPUT_DEVICE_CHANGED: "rtc.audio_output_device_changed", DEVICE_LIST_CHANGED: "rtc.device_list_changed", DEVICE_LIST_AVAILABLE: "rtc.device_list_available", ENDPOINT_MESSAGE_RECEIVED: "rtc.endpoint_message_received", LOCAL_UFRAG_CHANGED: "rtc.local_ufrag_changed", REMOTE_UFRAG_CHANGED: "rtc.remote_ufrag_changed" };e.exports = n; + }, function (e, t, n) { + function r() { + return "WebkitAppearance" in document.documentElement.style || window.console && (console.firebug || console.exception && console.table) || navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31; + }function i() { + var e = arguments, + n = this.useColors;if (e[0] = (n ? "%c" : "") + this.namespace + (n ? " %c" : " ") + e[0] + (n ? "%c " : " ") + "+" + t.humanize(this.diff), !n) return e;var r = "color: " + this.color;e = [e[0], r, "color: inherit"].concat(Array.prototype.slice.call(e, 1));var i = 0, + o = 0;return e[0].replace(/%[a-z%]/g, function (e) { + "%%" !== e && (i++, "%c" === e && (o = i)); + }), e.splice(o, 0, r), e; + }function o() { + return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); + }function a(e) { + try { + null == e ? t.storage.removeItem("debug") : t.storage.debug = e; + } catch (e) {} + }function s() { + var e;try { + e = t.storage.debug; + } catch (e) {}return e; + }t = e.exports = n(156), t.log = o, t.formatArgs = i, t.save = a, t.load = s, t.useColors = r, t.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function () { + try { + return window.localStorage; + } catch (e) {} + }(), t.colors = ["lightseagreen", "forestgreen", "goldenrod", "dodgerblue", "darkorchid", "crimson"], t.formatters.j = function (e) { + return JSON.stringify(e); + }, t.enable(s()); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(14), + o = n.n(i), + a = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + s = function () { + function e() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new o.a();r(this, e), this.eventEmitter = t, this.addEventListener = this.on = this.addListener, this.removeEventListener = this.off = this.removeListener; + }return a(e, [{ key: "addListener", value: function value(e, t) { + this.eventEmitter.addListener(e, t); + } }, { key: "removeListener", value: function value(e, t) { + this.eventEmitter.removeListener(e, t); + } }]), e; + }();t.a = s; + }, function (e, t, n) { + "use strict"; + function r(e, t, n) { + if ("object" === (void 0 === e ? "undefined" : a(e)) && void 0 !== e.name) switch (this.gum = { error: e, constraints: t, devices: n && Array.isArray(n) ? n.slice(0) : void 0 }, e.name) {case "PermissionDeniedError":case "SecurityError": + this.name = o.PERMISSION_DENIED, this.message = s[this.name] + (this.gum.devices || []).join(", ");break;case "DevicesNotFoundError":case "NotFoundError": + this.name = o.NOT_FOUND, this.message = s[this.name] + (this.gum.devices || []).join(", ");break;case "ConstraintNotSatisfiedError":case "OverconstrainedError": + var r = e.constraintName || e.constraint;t && t.video && (!n || n.indexOf("video") > -1) && ("minWidth" === r || "maxWidth" === r || "minHeight" === r || "maxHeight" === r || "width" === r || "height" === r) ? (this.name = o.UNSUPPORTED_RESOLUTION, this.message = s[this.name] + i(r, t)) : (this.name = o.CONSTRAINT_FAILED, this.message = s[this.name] + e.constraintName);break;default: + this.name = o.GENERAL, this.message = e.message || s[this.name];} else { + if ("string" != typeof e) throw new Error("Invalid arguments");s[e] ? (this.name = e, this.message = t || s[e]) : this.message = e; + }this.stack = e.stack || new Error().stack; + }function i(e, t) { + if (t && t.video && t.video.mandatory) switch (e) {case "width": + return t.video.mandatory.minWidth;case "height": + return t.video.mandatory.minHeight;default: + return t.video.mandatory[e] || "";}return ""; + }var o = n(15), + a = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + s = {};s[o.UNSUPPORTED_RESOLUTION] = "Video resolution is not supported: ", s[o.FIREFOX_EXTENSION_NEEDED] = "Firefox extension is not installed", s[o.CHROME_EXTENSION_INSTALLATION_ERROR] = "Failed to install Chrome extension", s[o.CHROME_EXTENSION_USER_GESTURE_REQUIRED] = "Failed to install Chrome extension - installations can only be initiated by a user gesture.", s[o.CHROME_EXTENSION_USER_CANCELED] = "User canceled Chrome's screen sharing prompt", s[o.CHROME_EXTENSION_GENERIC_ERROR] = "Unknown error from Chrome extension", s[o.ELECTRON_DESKTOP_PICKER_ERROR] = "Unkown error from desktop picker", s[o.ELECTRON_DESKTOP_PICKER_NOT_FOUND] = "Failed to detect desktop picker", s[o.GENERAL] = "Generic getUserMedia error", s[o.PERMISSION_DENIED] = "User denied permission to use device(s): ", s[o.NOT_FOUND] = "Requested device(s) was/were not found: ", s[o.CONSTRAINT_FAILED] = "Constraint could not be satisfied: ", s[o.TRACK_IS_DISPOSED] = "Track has been already disposed", s[o.TRACK_NO_STREAM_FOUND] = "Track does not have an associated Media Stream", s[o.TRACK_MUTE_UNMUTE_IN_PROGRESS] = "Track mute/unmute process is currently in progress", s[o.NO_DATA_FROM_SOURCE] = "The track has stopped receiving data from it's source", r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, t.a = r; + }, function (e, t, n) { + "use strict"; + (function (e) { + var r = n(0), + i = (n.n(r), n(19)), + o = n.n(i), + a = n(2), + s = n.i(r.getLogger)(e), + c = { filterSpecialChars: function filterSpecialChars(e) { + return e ? e.replace(/[\\\/\{,\}\+]/g, "") : e; + }, iceparams: function iceparams(e, t) { + var n = null, + r = void 0, + i = void 0;return (i = c.findLine(e, "a=ice-ufrag:", t)) && (r = c.findLine(e, "a=ice-pwd:", t)) && (n = { ufrag: c.parseICEUfrag(i), pwd: c.parseICEPwd(r) }), n; + }, parseICEUfrag: function parseICEUfrag(e) { + return e.substring(12); + }, buildICEUfrag: function buildICEUfrag(e) { + return "a=ice-ufrag:" + e; + }, parseICEPwd: function parseICEPwd(e) { + return e.substring(10); + }, buildICEPwd: function buildICEPwd(e) { + return "a=ice-pwd:" + e; + }, parseMID: function parseMID(e) { + return e.substring(6); + }, parseMLine: function parseMLine(e) { + var t = {}, + n = e.substring(2).split(" ");return t.media = n.shift(), t.port = n.shift(), t.proto = n.shift(), "" === n[n.length - 1] && n.pop(), t.fmt = n, t; + }, buildMLine: function buildMLine(e) { + return "m=" + e.media + " " + e.port + " " + e.proto + " " + e.fmt.join(" "); + }, parseRTPMap: function parseRTPMap(e) { + var t = {}, + n = e.substring(9).split(" ");return t.id = n.shift(), n = n[0].split("/"), t.name = n.shift(), t.clockrate = n.shift(), t.channels = n.length ? n.shift() : "1", t; + }, parseSCTPMap: function parseSCTPMap(e) { + var t = e.substring(10).split(" ");return [t[0], t[1], t.length > 2 ? t[2] : null]; + }, buildRTPMap: function buildRTPMap(e) { + var t = "a=rtpmap:" + e.getAttribute("id") + " " + e.getAttribute("name") + "/" + e.getAttribute("clockrate");return e.getAttribute("channels") && "1" !== e.getAttribute("channels") && (t += "/" + e.getAttribute("channels")), t; + }, parseCrypto: function parseCrypto(e) { + var t = {}, + n = e.substring(9).split(" ");return t.tag = n.shift(), t["crypto-suite"] = n.shift(), t["key-params"] = n.shift(), n.length && (t["session-params"] = n.join(" ")), t; + }, parseFingerprint: function parseFingerprint(e) { + var t = {}, + n = e.substring(14).split(" ");return t.hash = n.shift(), t.fingerprint = n.shift(), t; + }, parseFmtp: function parseFmtp(e) { + var t = [], + n = e.split(" ");n.shift(), n = n.join(" ").split(";");for (var r = 0; r < n.length; r++) { + for (var i = n[r].split("=")[0]; i.length && " " === i[0];) { + i = i.substring(1); + }var o = n[r].split("=")[1];i && o ? t.push({ name: i, value: o }) : i && t.push({ name: "", value: i }); + }return t; + }, parseICECandidate: function parseICECandidate(e) { + var t = {}, + n = e.split(" ");t.foundation = n[0].substring(12), t.component = n[1], t.protocol = n[2].toLowerCase(), t.priority = n[3], t.ip = n[4], t.port = n[5], t.type = n[7], t.generation = 0;for (var r = 8; r < n.length; r += 2) { + switch (n[r]) {case "raddr": + t["rel-addr"] = n[r + 1];break;case "rport": + t["rel-port"] = n[r + 1];break;case "generation": + t.generation = n[r + 1];break;case "tcptype": + t.tcptype = n[r + 1];break;default: + s.log('parseICECandidate not translating "' + n[r] + '" = "' + n[r + 1] + '"');} + }return t.network = "1", t.id = Math.random().toString(36).substr(2, 10), t; + }, buildICECandidate: function buildICECandidate(e) { + var t = ["a=candidate:" + e.foundation, e.component, e.protocol, e.priority, e.ip, e.port, "typ", e.type].join(" ");switch (t += " ", e.type) {case "srflx":case "prflx":case "relay": + e.hasOwnAttribute("rel-addr") && e.hasOwnAttribute("rel-port") && (t += "raddr", t += " ", t += e["rel-addr"], t += " ", t += "rport", t += " ", t += e["rel-port"], t += " ");}return e.hasOwnAttribute("tcptype") && (t += "tcptype", t += " ", t += e.tcptype, t += " "), t += "generation", t += " ", t += e.hasOwnAttribute("generation") ? e.generation : "0"; + }, parseSSRC: function parseSSRC(e) { + for (var t = {}, n = e.split("\r\n"), r = 0; r < n.length; r++) { + if ("a=ssrc:" === n[r].substring(0, 7)) { + var i = n[r].indexOf(" ");t[n[r].substr(i + 1).split(":", 2)[0]] = n[r].substr(i + 1).split(":", 2)[1]; + } + }return t; + }, parseRTCPFB: function parseRTCPFB(e) { + var t = e.substr(10).split(" "), + n = {};return n.pt = t.shift(), n.type = t.shift(), n.params = t, n; + }, parseExtmap: function parseExtmap(e) { + var t = e.substr(9).split(" "), + n = {};return n.value = t.shift(), -1 === n.value.indexOf("/") ? n.direction = "both" : (n.direction = n.value.substr(n.value.indexOf("/") + 1), n.value = n.value.substr(0, n.value.indexOf("/"))), n.uri = t.shift(), n.params = t, n; + }, findLine: function findLine(e, t, n) { + for (var r = e.split("\r\n"), i = 0; i < r.length; i++) { + if (r[i].substring(0, t.length) === t) return r[i]; + }if (!n) return !1;r = n.split("\r\n");for (var o = 0; o < r.length; o++) { + if (r[o].substring(0, t.length) === t) return r[o]; + }return !1; + }, findLines: function findLines(e, t, n) { + for (var r = e.split("\r\n"), i = [], o = 0; o < r.length; o++) { + r[o].substring(0, t.length) === t && i.push(r[o]); + }if (i.length || !n) return i;r = n.split("\r\n");for (var a = 0; a < r.length; a++) { + r[a].substring(0, t.length) === t && i.push(r[a]); + }return i; + }, candidateToJingle: function candidateToJingle(e) { + if (0 === e.indexOf("candidate:")) e = "a=" + e;else if ("a=candidate:" !== e.substring(0, 12)) return s.log("parseCandidate called with a line that is not a candidate line"), s.log(e), null;"\r\n" === e.substring(e.length - 2) && (e = e.substring(0, e.length - 2));var t = {}, + n = e.split(" ");if ("typ" !== n[6]) return s.log("did not find typ in the right place"), s.log(e), null;t.foundation = n[0].substring(12), t.component = n[1], t.protocol = n[2].toLowerCase(), t.priority = n[3], t.ip = n[4], t.port = n[5], t.type = n[7], t.generation = "0";for (var r = 8; r < n.length; r += 2) { + switch (n[r]) {case "raddr": + t["rel-addr"] = n[r + 1];break;case "rport": + t["rel-port"] = n[r + 1];break;case "generation": + t.generation = n[r + 1];break;case "tcptype": + t.tcptype = n[r + 1];break;default: + s.log('not translating "' + n[r] + '" = "' + n[r + 1] + '"');} + }return t.network = "1", t.id = Math.random().toString(36).substr(2, 10), t; + }, candidateFromJingle: function candidateFromJingle(e) { + var t = "a=candidate:";t += e.getAttribute("foundation"), t += " ", t += e.getAttribute("component"), t += " ";var n = e.getAttribute("protocol");switch (a.a.isFirefox() && "ssltcp" === n.toLowerCase() && (n = "tcp"), t += n, t += " ", t += e.getAttribute("priority"), t += " ", t += e.getAttribute("ip"), t += " ", t += e.getAttribute("port"), t += " ", t += "typ", t += " " + e.getAttribute("type"), t += " ", e.getAttribute("type")) {case "srflx":case "prflx":case "relay": + e.getAttribute("rel-addr") && e.getAttribute("rel-port") && (t += "raddr", t += " ", t += e.getAttribute("rel-addr"), t += " ", t += "rport", t += " ", t += e.getAttribute("rel-port"), t += " ");}return "tcp" === n.toLowerCase() && (t += "tcptype", t += " ", t += e.getAttribute("tcptype"), t += " "), t += "generation", t += " ", (t += e.getAttribute("generation") || "0") + "\r\n"; + }, parsePrimaryVideoSsrc: function parsePrimaryVideoSsrc(e) { + var t = e.ssrcs.map(function (e) { + return e.id; + }).filter(function (e, t, n) { + return n.indexOf(e) === t; + }).length, + n = e.ssrcGroups && e.ssrcGroups.length || 0;if (!(t > 1 && 0 === n)) { + var r = null;if (1 === t) r = e.ssrcs[0].id;else if (2 === t) { + var i = e.ssrcGroups.find(function (e) { + return "FID" === e.semantics; + });i && (r = i.ssrcs.split(" ")[0]); + } else if (t >= 3) { + var o = e.ssrcGroups.find(function (e) { + return "SIM" === e.semantics; + });o && (r = o.ssrcs.split(" ")[0]); + }return r; + } + }, generateSsrc: function generateSsrc() { + return o.a.randomInt(1, 4294967295); + }, getSsrcAttribute: function getSsrcAttribute(e, t, n) { + for (var r = 0; r < e.ssrcs.length; ++r) { + var i = e.ssrcs[r];if (i.id === t && i.attribute === n) return i.value; + } + }, parseGroupSsrcs: function parseGroupSsrcs(e) { + return e.ssrcs.split(" ").map(function (e) { + return parseInt(e, 10); + }); + }, getMedia: function getMedia(e, t) { + return e.media.find(function (e) { + return e.type === t; + }); + }, getUfrag: function getUfrag(e) { + var t = e.split("\n").filter(function (e) { + return e.startsWith("a=ice-ufrag:"); + });if (t.length > 0) return t[0].substr("a=ice-ufrag:".length); + }, preferVideoCodec: function preferVideoCodec(e, t) { + var n = null;if (t) { + for (var r = 0; r < e.rtp.length; ++r) { + var i = e.rtp[r];if (i.codec && i.codec.toLowerCase() === t.toLowerCase()) { + n = i.payload;break; + } + }if (n) { + var o = e.payloads.split(" ").map(function (e) { + return parseInt(e, 10); + }), + a = o.indexOf(n);o.splice(a, 1), o.unshift(n), e.payloads = o.join(" "); + } + } + } };t.a = c; + }).call(t, "modules/xmpp/SDPUtil.js"); + }, function (e, t, n) { + var r = n(145), + i = n(146);t.write = i, t.parse = r.parse, t.parseFmtpConfig = r.parseFmtpConfig, t.parseParams = r.parseParams, t.parsePayloads = r.parsePayloads, t.parseRemoteCandidates = r.parseRemoteCandidates, t.parseImageAttributes = r.parseImageAttributes, t.parseSimulcastStreamList = r.parseSimulcastStreamList; + }, function (e, t) { + function n() { + this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0; + }function r(e) { + return "function" == typeof e; + }function i(e) { + return "number" == typeof e; + }function o(e) { + return "object" === (void 0 === e ? "undefined" : s(e)) && null !== e; + }function a(e) { + return void 0 === e; + }var s = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + };e.exports = n, n.EventEmitter = n, n.prototype._events = void 0, n.prototype._maxListeners = void 0, n.defaultMaxListeners = 10, n.prototype.setMaxListeners = function (e) { + if (!i(e) || e < 0 || isNaN(e)) throw TypeError("n must be a positive number");return this._maxListeners = e, this; + }, n.prototype.emit = function (e) { + var t, n, i, s, c, u;if (this._events || (this._events = {}), "error" === e && (!this._events.error || o(this._events.error) && !this._events.error.length)) { + if ((t = arguments[1]) instanceof Error) throw t;var l = new Error('Uncaught, unspecified "error" event. (' + t + ")");throw l.context = t, l; + }if (n = this._events[e], a(n)) return !1;if (r(n)) switch (arguments.length) {case 1: + n.call(this);break;case 2: + n.call(this, arguments[1]);break;case 3: + n.call(this, arguments[1], arguments[2]);break;default: + s = Array.prototype.slice.call(arguments, 1), n.apply(this, s);} else if (o(n)) for (s = Array.prototype.slice.call(arguments, 1), u = n.slice(), i = u.length, c = 0; c < i; c++) { + u[c].apply(this, s); + }return !0; + }, n.prototype.addListener = function (e, t) { + var i;if (!r(t)) throw TypeError("listener must be a function");return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t), this._events[e] ? o(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t, o(this._events[e]) && !this._events[e].warned && (i = a(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && i > 0 && this._events[e].length > i && (this._events[e].warned = !0, console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length), "function" == typeof console.trace && console.trace()), this; + }, n.prototype.on = n.prototype.addListener, n.prototype.once = function (e, t) { + function n() { + this.removeListener(e, n), i || (i = !0, t.apply(this, arguments)); + }if (!r(t)) throw TypeError("listener must be a function");var i = !1;return n.listener = t, this.on(e, n), this; + }, n.prototype.removeListener = function (e, t) { + var n, i, a, s;if (!r(t)) throw TypeError("listener must be a function");if (!this._events || !this._events[e]) return this;if (n = this._events[e], a = n.length, i = -1, n === t || r(n.listener) && n.listener === t) delete this._events[e], this._events.removeListener && this.emit("removeListener", e, t);else if (o(n)) { + for (s = a; s-- > 0;) { + if (n[s] === t || n[s].listener && n[s].listener === t) { + i = s;break; + } + }if (i < 0) return this;1 === n.length ? (n.length = 0, delete this._events[e]) : n.splice(i, 1), this._events.removeListener && this.emit("removeListener", e, t); + }return this; + }, n.prototype.removeAllListeners = function (e) { + var t, n;if (!this._events) return this;if (!this._events.removeListener) return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e], this;if (0 === arguments.length) { + for (t in this._events) { + "removeListener" !== t && this.removeAllListeners(t); + }return this.removeAllListeners("removeListener"), this._events = {}, this; + }if (n = this._events[e], r(n)) this.removeListener(e, n);else if (n) for (; n.length;) { + this.removeListener(e, n[n.length - 1]); + }return delete this._events[e], this; + }, n.prototype.listeners = function (e) { + return this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []; + }, n.prototype.listenerCount = function (e) { + if (this._events) { + var t = this._events[e];if (r(t)) return 1;if (t) return t.length; + }return 0; + }, n.listenerCount = function (e, t) { + return e.listenerCount(t); + }; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "CHROME_EXTENSION_GENERIC_ERROR", function () { + return r; + }), n.d(t, "CHROME_EXTENSION_INSTALLATION_ERROR", function () { + return i; + }), n.d(t, "CHROME_EXTENSION_USER_GESTURE_REQUIRED", function () { + return o; + }), n.d(t, "CHROME_EXTENSION_USER_CANCELED", function () { + return a; + }), n.d(t, "CONSTRAINT_FAILED", function () { + return s; + }), n.d(t, "ELECTRON_DESKTOP_PICKER_ERROR", function () { + return c; + }), n.d(t, "ELECTRON_DESKTOP_PICKER_NOT_FOUND", function () { + return u; + }), n.d(t, "FIREFOX_EXTENSION_NEEDED", function () { + return l; + }), n.d(t, "GENERAL", function () { + return d; + }), n.d(t, "NOT_FOUND", function () { + return p; + }), n.d(t, "PERMISSION_DENIED", function () { + return f; + }), n.d(t, "TRACK_IS_DISPOSED", function () { + return h; + }), n.d(t, "TRACK_MUTE_UNMUTE_IN_PROGRESS", function () { + return m; + }), n.d(t, "TRACK_NO_STREAM_FOUND", function () { + return v; + }), n.d(t, "UNSUPPORTED_RESOLUTION", function () { + return g; + }), n.d(t, "NO_DATA_FROM_SOURCE", function () { + return y; + });var r = "gum.chrome_extension_generic_error", + i = "gum.chrome_extension_installation_error", + o = "gum.chrome_extension_user_gesture_required", + a = "gum.chrome_extension_user_canceled", + s = "gum.constraint_failed", + c = "gum.electron_desktop_picker_error", + u = "gum.electron_desktop_picker_not_found", + l = "gum.firefox_extension_needed", + d = "gum.general", + p = "gum.not_found", + f = "gum.permission_denied", + h = "track.track_is_disposed", + m = "track.mute_unmute_inprogress", + v = "track.no_stream_found", + g = "gum.unsupported_resolution", + y = "track.no_data_from_source"; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "LOCAL_TRACK_STOPPED", function () { + return r; + }), n.d(t, "TRACK_AUDIO_LEVEL_CHANGED", function () { + return i; + }), n.d(t, "TRACK_AUDIO_OUTPUT_CHANGED", function () { + return o; + }), n.d(t, "TRACK_MUTE_CHANGED", function () { + return a; + }), n.d(t, "TRACK_VIDEOTYPE_CHANGED", function () { + return s; + }), n.d(t, "NO_DATA_FROM_SOURCE", function () { + return c; + });var r = "track.stopped", + i = "track.audioLevelsChanged", + o = "track.audioOutputChanged", + a = "track.trackMuteChanged", + s = "track.videoTypeChanged", + c = "track.no_data_from_source"; + }, function (e, t) { + var n = { CAMERA: "camera", DESKTOP: "desktop" };e.exports = n; + }, function (e, t, n) { + (function (e) { + function r(e, n) { + return n("b" + t.packets[e.type] + e.data.data); + }function i(e, n, r) { + if (!n) return t.encodeBase64Packet(e, r);var i = e.data, + o = new Uint8Array(i), + a = new Uint8Array(1 + i.byteLength);a[0] = g[e.type];for (var s = 0; s < o.length; s++) { + a[s + 1] = o[s]; + }return r(a.buffer); + }function o(e, n, r) { + if (!n) return t.encodeBase64Packet(e, r);var i = new FileReader();return i.onload = function () { + e.data = i.result, t.encodePacket(e, n, !0, r); + }, i.readAsArrayBuffer(e.data); + }function a(e, n, r) { + if (!n) return t.encodeBase64Packet(e, r);if (v) return o(e, n, r);var i = new Uint8Array(1);return i[0] = g[e.type], r(new S([i.buffer, e.data])); + }function s(e, t, n) { + for (var r = new Array(e.length), i = p(e.length, n), o = 0; o < e.length; o++) { + !function (e, n, i) { + t(n, function (t, n) { + r[e] = n, i(t, r); + }); + }(o, e[o], i); + } + }var c = n(163), + u = n(164), + l = n(69), + d = n(155), + p = n(154), + f = n(150), + h = navigator.userAgent.match(/Android/i), + m = /PhantomJS/i.test(navigator.userAgent), + v = h || m;t.protocol = 3;var g = t.packets = { open: 0, close: 1, ping: 2, pong: 3, message: 4, upgrade: 5, noop: 6 }, + y = c(g), + b = { type: "error", data: "parser error" }, + S = n(72);t.encodePacket = function (t, n, o, s) { + "function" == typeof n && (s = n, n = !1), "function" == typeof o && (s = o, o = null);var c = void 0 === t.data ? void 0 : t.data.buffer || t.data;if (e.ArrayBuffer && c instanceof ArrayBuffer) return i(t, n, s);if (S && c instanceof e.Blob) return a(t, n, s);if (c && c.base64) return r(t, s);var u = g[t.type];return void 0 !== t.data && (u += o ? f.encode(String(t.data)) : String(t.data)), s("" + u); + }, t.encodeBase64Packet = function (n, r) { + var i = "b" + t.packets[n.type];if (S && n.data instanceof e.Blob) { + var o = new FileReader();return o.onload = function () { + var e = o.result.split(",")[1];r(i + e); + }, o.readAsDataURL(n.data); + }var a;try { + a = String.fromCharCode.apply(null, new Uint8Array(n.data)); + } catch (e) { + for (var s = new Uint8Array(n.data), c = new Array(s.length), u = 0; u < s.length; u++) { + c[u] = s[u]; + }a = String.fromCharCode.apply(null, c); + }return i += e.btoa(a), r(i); + }, t.decodePacket = function (e, n, r) { + if ("string" == typeof e || void 0 === e) { + if ("b" == e.charAt(0)) return t.decodeBase64Packet(e.substr(1), n);if (r) try { + e = f.decode(e); + } catch (e) { + return b; + }var i = e.charAt(0);return Number(i) == i && y[i] ? e.length > 1 ? { type: y[i], data: e.substring(1) } : { type: y[i] } : b; + }var o = new Uint8Array(e), + i = o[0], + a = l(e, 1);return S && "blob" === n && (a = new S([a])), { type: y[i], data: a }; + }, t.decodeBase64Packet = function (t, n) { + var r = y[t.charAt(0)];if (!e.ArrayBuffer) return { type: r, data: { base64: !0, data: t.substr(1) } };var i = d.decode(t.substr(1));return "blob" === n && S && (i = new S([i])), { type: r, data: i }; + }, t.encodePayload = function (e, n, r) { + function i(e) { + return e.length + ":" + e; + }function o(e, r) { + t.encodePacket(e, !!a && n, !0, function (e) { + r(null, i(e)); + }); + }"function" == typeof n && (r = n, n = null);var a = u(e);return n && a ? S && !v ? t.encodePayloadAsBlob(e, r) : t.encodePayloadAsArrayBuffer(e, r) : e.length ? void s(e, o, function (e, t) { + return r(t.join("")); + }) : r("0:"); + }, t.decodePayload = function (e, n, r) { + if ("string" != typeof e) return t.decodePayloadAsBinary(e, n, r);"function" == typeof n && (r = n, n = null);var i;if ("" == e) return r(b, 0, 1);for (var o, a, s = "", c = 0, u = e.length; c < u; c++) { + var l = e.charAt(c);if (":" != l) s += l;else { + if ("" == s || s != (o = Number(s))) return r(b, 0, 1);if (a = e.substr(c + 1, o), s != a.length) return r(b, 0, 1);if (a.length) { + if (i = t.decodePacket(a, n, !0), b.type == i.type && b.data == i.data) return r(b, 0, 1);if (!1 === r(i, c + o, u)) return; + }c += o, s = ""; + } + }return "" != s ? r(b, 0, 1) : void 0; + }, t.encodePayloadAsArrayBuffer = function (e, n) { + function r(e, n) { + t.encodePacket(e, !0, !0, function (e) { + return n(null, e); + }); + }if (!e.length) return n(new ArrayBuffer(0));s(e, r, function (e, t) { + var r = t.reduce(function (e, t) { + var n;return n = "string" == typeof t ? t.length : t.byteLength, e + n.toString().length + n + 2; + }, 0), + i = new Uint8Array(r), + o = 0;return t.forEach(function (e) { + var t = "string" == typeof e, + n = e;if (t) { + for (var r = new Uint8Array(e.length), a = 0; a < e.length; a++) { + r[a] = e.charCodeAt(a); + }n = r.buffer; + }i[o++] = t ? 0 : 1;for (var s = n.byteLength.toString(), a = 0; a < s.length; a++) { + i[o++] = parseInt(s[a]); + }i[o++] = 255;for (var r = new Uint8Array(n), a = 0; a < r.length; a++) { + i[o++] = r[a]; + } + }), n(i.buffer); + }); + }, t.encodePayloadAsBlob = function (e, n) { + function r(e, n) { + t.encodePacket(e, !0, !0, function (e) { + var t = new Uint8Array(1);if (t[0] = 1, "string" == typeof e) { + for (var r = new Uint8Array(e.length), i = 0; i < e.length; i++) { + r[i] = e.charCodeAt(i); + }e = r.buffer, t[0] = 0; + }for (var o = e instanceof ArrayBuffer ? e.byteLength : e.size, a = o.toString(), s = new Uint8Array(a.length + 1), i = 0; i < a.length; i++) { + s[i] = parseInt(a[i]); + }if (s[a.length] = 255, S) { + var c = new S([t.buffer, s.buffer, e]);n(null, c); + } + }); + }s(e, r, function (e, t) { + return n(new S(t)); + }); + }, t.decodePayloadAsBinary = function (e, n, r) { + "function" == typeof n && (r = n, n = null);for (var i = e, o = [], a = !1; i.byteLength > 0;) { + for (var s = new Uint8Array(i), c = 0 === s[0], u = "", d = 1; 255 != s[d]; d++) { + if (u.length > 310) { + a = !0;break; + }u += s[d]; + }if (a) return r(b, 0, 1);i = l(i, 2 + u.length), u = parseInt(u);var p = l(i, 0, u);if (c) try { + p = String.fromCharCode.apply(null, new Uint8Array(p)); + } catch (e) { + var f = new Uint8Array(p);p = "";for (var d = 0; d < f.length; d++) { + p += String.fromCharCode(f[d]); + } + }o.push(p), i = l(i, u); + }var h = o.length;o.forEach(function (e, i) { + r(t.decodePacket(e, n, !0), i, h); + }); + }; + }).call(t, n(1)); + }, function (e, t) { + function n(e, t) { + return Math.floor(Math.random() * (t - e + 1)) + e; + }function r(e) { + return e[n(0, e.length - 1)]; + }function i(e) { + for (var t = "", n = 0; n < e; n += 1) { + t += r(o); + }return t; + }var o = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + a = { randomHexDigit: function randomHexDigit() { + return r("0123456789abcdef"); + }, randomHexString: function randomHexString(e) { + for (var t = ""; e--;) { + t += this.randomHexDigit(); + }return t; + }, randomElement: r, randomAlphanumStr: i, randomInt: n };e.exports = a; + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function i(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function o(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function a() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function () { + function e() { + o(this, e); + }return e; + }();return function (e) { + function t() { + var e;o(this, t);for (var n = arguments.length, i = Array(n), a = 0; a < n; a++) { + i[a] = arguments[a]; + }var s = r(this, (e = t.__proto__ || Object.getPrototypeOf(t)).call.apply(e, [this].concat(i)));return s.connection = null, s; + }return i(t, e), c(t, [{ key: "init", value: function value(e) { + this.connection = e; + } }]), t; + }(e); + }n.d(t, "b", function () { + return u; + });var s = n(10), + c = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }();t.a = a();var u = a(s.a); + }, function (e, t) { + e.exports = function (e, t) { + var n = function n() {};n.prototype = t.prototype, e.prototype = new n(), e.prototype.constructor = e; + }; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e, t) { + var n = [], + r = null;return e.forEach(function (e) { + e.mediaType === v.a ? r = t.micDeviceId : e.videoType === T.a.CAMERA && (r = t.cameraDeviceId), R += 1;var i = new p.a(C({}, e, { deviceId: r, facingMode: t.facingMode, rtcId: R }));n.push(i); + }), n; + }var s = n(0), + c = (n.n(s), n(89)), + u = n(3), + l = n.n(u), + d = n(5), + p = n(90), + f = n(11), + h = n(15), + m = n(10), + v = n(4), + g = n(8), + y = n.n(g), + b = n(23), + S = n(95), + E = n(17), + T = n.n(E), + _ = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + C = Object.assign || function (e) { + for (var t = 1; t < arguments.length; t++) { + var n = arguments[t];for (var r in n) { + Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]); + } + }return e; + }, + w = n.i(s.getLogger)(e), + R = 0, + k = function (e) { + function t(e) { + var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};r(this, t);var o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return o.conference = e, o.peerConnections = new Map(), o.peerConnectionIdCounter = 1, o.localTracks = [], o.options = n, o._channel = null, o._channelOpen = !1, o._lastN = -1, o._lastNEndpoints = null, o._pinnedEndpoint = null, o._selectedEndpoint = null, o._lastNChangeListener = o._onLastNChanged.bind(o), b.a.isDeviceChangeAvailable("output") && b.a.addListener(y.a.AUDIO_OUTPUT_DEVICE_CHANGED, function (e) { + var t = o.getRemoteTracks(v.a), + n = !0, + r = !1, + i = void 0;try { + for (var a, s = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (a = s.next()).done); n = !0) { + a.value.setAudioOutput(e); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && s.return && s.return(); + } finally { + if (r) throw i; + } + } + }), o; + }return o(t, e), _(t, [{ key: "initializeBridgeChannel", value: function value(e, t) { + var n = this;this._channel = new c.a(e, t, this.eventEmitter), this._channelOpenListener = function () { + n._channelOpen = !0;try { + n._channel.sendPinnedEndpointMessage(n._pinnedEndpoint), n._channel.sendSelectedEndpointMessage(n._selectedEndpoint); + } catch (e) { + l.a.callErrorHandler(e), w.error("Cannot send selected(" + n._selectedEndpoint + ")pinned(" + n._pinnedEndpoint + ") endpoint message.", e); + }n.removeListener(y.a.DATA_CHANNEL_OPEN, n._channelOpenListener), n._channelOpenListener = null, -1 !== n._lastN && n._channel.sendSetLastNMessage(n._lastN); + }, this.addListener(y.a.DATA_CHANNEL_OPEN, this._channelOpenListener), this.addListener(y.a.LASTN_ENDPOINT_CHANGED, this._lastNChangeListener); + } }, { key: "_onLastNChanged", value: function value() { + var e = this, + t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], + n = this._lastNEndpoints || [], + r = [], + i = [];this._lastNEndpoints = t, r = n.filter(function (t) { + return !e.isInLastN(t); + }), i = t.filter(function (e) { + return -1 === n.indexOf(e); + }), this.conference.eventEmitter.emit(d.LAST_N_ENDPOINTS_CHANGED, r, i); + } }, { key: "onCallEnded", value: function value() { + this._channel && (this._channel && "websocket" === this._channel.mode && this._channel.close(), this._channel = null, this._channelOpen = !1); + } }, { key: "selectEndpoint", value: function value(e) { + this._selectedEndpoint = e, this._channel && this._channelOpen && this._channel.sendSelectedEndpointMessage(e); + } }, { key: "pinEndpoint", value: function value(e) { + this._pinnedEndpoint = e, this._channel && this._channelOpen && this._channel.sendPinnedEndpointMessage(e); + } }, { key: "createPeerConnection", value: function value(e, n, r, i) { + var o = new S.a(this, this.peerConnectionIdCounter, e, n, t.getPCConstraints(r), r, i);return this.peerConnections.set(o.id, o), this.peerConnectionIdCounter += 1, o; + } }, { key: "_removePeerConnection", value: function value(e) { + var t = e.id;return !!this.peerConnections.has(t) && (this.peerConnections.delete(t), !0); + } }, { key: "addLocalTrack", value: function value(e) { + if (!e) throw new Error("track must not be null nor undefined");this.localTracks.push(e), e.conference = this.conference; + } }, { key: "getLastN", value: function value() { + return this._lastN; + } }, { key: "getLocalVideoTrack", value: function value() { + var e = this.getLocalTracks(v.b);return e.length ? e[0] : void 0; + } }, { key: "getLocalAudioTrack", value: function value() { + var e = this.getLocalTracks(v.a);return e.length ? e[0] : void 0; + } }, { key: "getLocalTracks", value: function value(e) { + var t = this.localTracks.slice();return void 0 !== e && (t = t.filter(function (t) { + return t.getType() === e; + })), t; + } }, { key: "getRemoteTracks", value: function value(e) { + var t = [], + n = !0, + r = !1, + i = void 0;try { + for (var o, a = this.peerConnections.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = s.getRemoteTracks(void 0, e);c && (t = t.concat(c)); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + }return t; + } }, { key: "setAudioMute", value: function value(e) { + var t = [];return this.getLocalTracks(v.a).forEach(function (n) { + t.push(e ? n.mute() : n.unmute()); + }), Promise.all(t); + } }, { key: "removeLocalTrack", value: function value(e) { + var t = this.localTracks.indexOf(e);-1 !== t && this.localTracks.splice(t, 1); + } }, { key: "removeRemoteTracks", value: function value(e) { + var t = [], + n = !0, + r = !1, + i = void 0;try { + for (var o, a = this.peerConnections.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = s.removeRemoteTracks(e);t = t.concat(c); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + }return w.debug("Removed remote tracks for " + e + " count: " + t.length), t; + } }, { key: "closeBridgeChannel", value: function value() { + this._channel && (this._channel.close(), this._channelOpen = !1, this.removeListener(y.a.LASTN_ENDPOINT_CHANGED, this._lastNChangeListener)); + } }, { key: "setAudioLevel", value: function value(e, t, n, r) { + var i = e.getTrackBySSRC(t);if (i) { + if (!i.isAudioTrack()) return void w.warn("Received audio level for non-audio track: " + t);i.isLocal() !== r && w.error(i + " was expected to " + (r ? "be" : "not be") + " local"), i.setAudioLevel(n, e); + } + } }, { key: "sendChannelMessage", value: function value(e, t) { + if (!this._channel) throw new Error("Channel support is disabled!");this._channel.sendMessage(e, t); + } }, { key: "setLastN", value: function value(e) { + this._lastN !== e && (this._lastN = e, this._channel && this._channelOpen && this._channel.sendSetLastNMessage(e), this.eventEmitter.emit(y.a.LASTN_VALUE_CHANGED, e)); + } }, { key: "isInLastN", value: function value(e) { + return !this._lastNEndpoints || this._lastNEndpoints.indexOf(e) > -1; + } }], [{ key: "obtainAudioAndVideoPermissions", value: function value(e) { + return b.a.obtainAudioAndVideoPermissions(e).then(function (t) { + var n = a(t, e);return n.some(function (e) { + return !e._isReceivingData(); + }) ? Promise.reject(new f.a(h.NO_DATA_FROM_SOURCE)) : n; + }); + } }, { key: "addListener", value: function value(e, t) { + b.a.addListener(e, t); + } }, { key: "removeListener", value: function value(e, t) { + b.a.removeListener(e, t); + } }, { key: "isRTCReady", value: function value() { + return b.a.isRTCReady(); + } }, { key: "init", value: function value() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};return this.options = e, b.a.init(this.options); + } }, { key: "getDeviceAvailability", value: function value() { + return b.a.getDeviceAvailability(); + } }, { key: "getPCConstraints", value: function value(e) { + return e ? b.a.p2pPcConstraints : b.a.pcConstraints; + } }, { key: "attachMediaStream", value: function value(e, t) { + return b.a.attachMediaStream(e, t); + } }, { key: "getStreamID", value: function value(e) { + return b.a.getStreamID(e); + } }, { key: "getTrackID", value: function value(e) { + return b.a.getTrackID(e); + } }, { key: "isDeviceListAvailable", value: function value() { + return b.a.isDeviceListAvailable(); + } }, { key: "isDeviceChangeAvailable", value: function value(e) { + return b.a.isDeviceChangeAvailable(e); + } }, { key: "getAudioOutputDevice", value: function value() { + return b.a.getAudioOutputDevice(); + } }, { key: "getCurrentlyAvailableMediaDevices", value: function value() { + return b.a.getCurrentlyAvailableMediaDevices(); + } }, { key: "getEventDataForActiveDevice", value: function value(e) { + return b.a.getEventDataForActiveDevice(e); + } }, { key: "setAudioOutputDevice", value: function value(e) { + return b.a.setAudioOutputDevice(e); + } }, { key: "isUserStream", value: function value(e) { + return t.isUserStreamById(b.a.getStreamID(e)); + } }, { key: "isUserStreamById", value: function value(e) { + return e && "mixedmslabel" !== e && "default" !== e; + } }, { key: "enumerateDevices", value: function value(e) { + b.a.enumerateDevices(e); + } }, { key: "stopMediaStream", value: function value(e) { + b.a.stopMediaStream(e); + } }, { key: "isDesktopSharingEnabled", value: function value() { + return b.a.isDesktopSharingEnabled(); + } }]), t; + }(m.a);t.a = k; + }).call(t, "modules/RTC/RTC.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e) { + if (Array.isArray(e)) { + for (var t = 0, n = Array(e.length); t < e.length; t++) { + n[t] = e[t]; + }return n; + }return Array.from(e); + }function s() { + ce = navigator.mediaDevices && navigator.mediaDevices.enumerateDevices ? function (e) { + navigator.mediaDevices.enumerateDevices().then(e, function () { + return e([]); + }); + } : MediaStreamTrack && MediaStreamTrack.getSources ? function (e) { + MediaStreamTrack.getSources(function (t) { + return e(t.map(g)); + }); + } : void 0; + }function c(e, t, n) { + M.a[n] && (t && (e.video.width = { ideal: M.a[n].width }, e.video.height = { ideal: M.a[n].height }), e.video.mandatory.minWidth = M.a[n].width, e.video.mandatory.minHeight = M.a[n].height), e.video.mandatory.minWidth && (e.video.mandatory.maxWidth = e.video.mandatory.minWidth), e.video.mandatory.minHeight && (e.video.mandatory.maxHeight = e.video.mandatory.minHeight); + }function u(e, t) { + var n = { audio: !1, video: !1 }, + r = x.a.isFirefox() || x.a.isEdge() || x.a.isReactNative() || x.a.isTemasysPluginUsed();if (e.indexOf("video") >= 0) { + if (n.video = { mandatory: {}, optional: [] }, t.cameraDeviceId) r && (n.video.deviceId = t.cameraDeviceId), n.video.optional.push({ sourceId: t.cameraDeviceId });else { + var i = t.facingMode || w.a.USER;r && (n.video.facingMode = i), n.video.optional.push({ facingMode: i }); + }(t.minFps || t.maxFps || t.fps) && ((t.minFps || t.fps) && (t.minFps = t.minFps || t.fps, n.video.mandatory.minFrameRate = t.minFps), t.maxFps && (n.video.mandatory.maxFrameRate = t.maxFps)), c(n, r, t.resolution); + }if (e.indexOf("audio") >= 0 && (x.a.isReactNative() ? n.audio = !0 : x.a.isFirefox() ? t.micDeviceId ? n.audio = { mandatory: {}, deviceId: t.micDeviceId, optional: [{ sourceId: t.micDeviceId }] } : n.audio = !0 : (n.audio = { mandatory: {}, optional: [] }, t.micDeviceId && (r && (n.audio.deviceId = t.micDeviceId), n.audio.optional.push({ sourceId: t.micDeviceId })), n.audio.optional.push({ echoCancellation: !ee }, { googEchoCancellation: !te }, { googAutoGainControl: !re }, { googNoiseSupression: !ne }, { googHighpassFilter: !ie }, { googNoiseSuppression2: !ne }, { googEchoCancellation2: !te }, { googAutoGainControl2: !re }))), e.indexOf("screen") >= 0) if (x.a.isChrome()) n.video = { mandatory: { chromeMediaSource: "screen", maxWidth: window.screen.width, maxHeight: window.screen.height, maxFrameRate: 3 }, optional: [] };else if (x.a.isTemasysPluginUsed()) n.video = { optional: [{ sourceId: q.WebRTCPlugin.plugin.screensharingKey }] };else if (x.a.isFirefox()) n.video = { mozMediaSource: "window", mediaSource: "window" };else { + var o = "'screen' WebRTC media source is supported only in Chrome and with Temasys plugin";P.a.callErrorHandler(new Error(o)), K.error(o); + }return e.indexOf("desktop") >= 0 && (n.video = { mandatory: { chromeMediaSource: "desktop", chromeMediaSourceId: t.desktopStream, maxWidth: window.screen.width, maxHeight: window.screen.height, maxFrameRate: 3 }, optional: [] }), t.bandwidth && (n.video || (n.video = { mandatory: {}, optional: [] }), n.video.optional.push({ bandwidth: t.bandwidth })), x.a.isFirefox() && t.firefox_fake_device && (n.fake = !0), n; + }function l(e, t) { + var n = t && t.getAudioTracks().length > 0, + r = t && t.getVideoTracks().length > 0;-1 !== e.indexOf("video") && (Q.video = r), -1 !== e.indexOf("audio") && (Q.audio = n), z.emit(F.a.AVAILABLE_DEVICES_CHANGED, Q); + }function d(e) { + function t(e) { + return JSON.stringify({ kind: e.kind, deviceId: e.deviceId, groupId: e.groupId, label: e.label, facing: e.facing }); + }return e.length !== se.length || e.map(t).sort().join("") !== se.map(t).sort().join(""); + }function p() { + ce && ce(function (e) { + void 0 === se ? se = e.slice(0) : d(e) && f(e), window.setTimeout(p, X); + }); + }function f(e) { + se = e.slice(0), K.info("list of media devices has changed:", se);var t = se.filter(function (e) { + return "videoinput" === e.kind; + }), + n = se.filter(function (e) { + return "audioinput" === e.kind; + }), + r = t.filter(function (e) { + return "" === e.label; + }), + i = n.filter(function (e) { + return "" === e.label; + });t.length && t.length === r.length && (Q.video = !1), n.length && n.length === i.length && (Q.audio = !1), z.emit(F.a.DEVICE_LIST_CHANGED, e); + }function h(e, t) { + e && e.apply(void 0, a(t)); + }function m(e) { + return arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ? function (t, n, r) { + return e(t).then(function (e) { + return h(n, [e]), e; + }).catch(function (e) { + throw h(r, [e]), e; + }); + } : function (t, n, r) { + e(t, function (e) { + h(n, [e]); + }, function (e) { + h(r, [e]); + }); + }; + }function v(e) { + MediaStreamTrack.getSources(function (t) { + return e(t.map(g)); + }); + }function g(e) { + var t = (e.kind || "").toLowerCase();return { facing: e.facing || null, label: e.label, kind: t ? "audiooutput" === t ? t : t + "input" : null, deviceId: e.id, groupId: e.groupId || null }; + }function y(e, t) { + var n = void 0, + r = void 0, + i = void 0, + o = [];if (e) { + var a = e.audioVideo;if (a) { + var s = window.webkitMediaStream || window.MediaStream, + c = a.getAudioTracks();if (c.length) { + n = new s();for (var u = 0; u < c.length; u++) { + n.addTrack(c[u]); + } + }var l = a.getVideoTracks();if (l.length) { + i = new s();for (var d = 0; d < l.length; d++) { + i.addTrack(l[d]); + } + } + } else n = e.audio, i = e.video;r = e.desktop; + }if (r) { + var p = r, + f = p.stream, + h = p.sourceId, + m = p.sourceType;o.push({ stream: f, sourceId: h, sourceType: m, track: f.getVideoTracks()[0], mediaType: L.b, videoType: H.a.DESKTOP }); + }return n && o.push({ stream: n, track: n.getAudioTracks()[0], mediaType: L.a, videoType: null }), i && o.push({ stream: i, track: i.getVideoTracks()[0], mediaType: L.b, videoType: H.a.CAMERA, resolution: t }), o; + }function b(e, t) { + var n = "srcObject";if (n in e || (n = "mozSrcObject") in e || (n = null), n) return void (e[n] = t);var r = void 0;t && ((r = t.jitsiObjectURL) || (t.jitsiObjectURL = r = (URL || webkitURL).createObjectURL(t))), e.src = r || ""; + }function S(e, t) { + var n = new Error(e);n.name = "WEBRTC_NOT_SUPPORTED", K.error(e), t(n); + }function E(e) { + if (!e.devices || 0 === e.devices.length) return e.successCallback(e.streams || {});var t = e.devices.splice(0, 1);e.deviceGUM[t](function (n) { + e.streams = e.streams || {}, e.streams[t] = n, E(e); + }, function (n) { + Object.keys(e.streams).forEach(function (t) { + return pe.stopMediaStream(e.streams[t]); + }), K.error("failed to obtain " + t + " stream - stop", n), e.errorCallback(n); + }); + }function T(e, t) { + le = !0, z.emit(F.a.RTC_READY, !0), B.a.init(e, t), pe.isDeviceListAvailable() && ce && ce(function (e) { + se = e.splice(0), z.emit(F.a.DEVICE_LIST_AVAILABLE, se), ue ? navigator.mediaDevices.addEventListener("devicechange", function () { + return pe.enumerateDevices(f); + }) : p(); + }); + }function _(e) { + return function (t, n) { + var r = e.apply(pe, arguments);return n && pe.isDeviceChangeAvailable("output") && n.getAudioTracks && n.getAudioTracks().length && Z && t.setSinkId(pe.getAudioOutputDevice()).catch(function (e) { + var n = new O.a(e, null, ["audiooutput"]);P.a.callUnhandledRejectionHandler({ promise: this, reason: n }), K.warn("Failed to set audio output device for the element. Default audio output device will be used instead", t, n); + }), r; + }; + }var C = n(52), + w = n.n(C), + R = n(14), + k = n.n(R), + A = n(0), + I = (n.n(A), n(3)), + P = n.n(I), + O = n(11), + D = n(10), + L = n(4), + N = n(31), + M = n.n(N), + x = n(2), + j = n(8), + F = n.n(j), + U = n(96), + B = n(94), + J = n(12), + G = n(17), + H = n.n(G), + V = Object.assign || function (e) { + for (var t = 1; t < arguments.length; t++) { + var n = arguments[t];for (var r in n) { + Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]); + } + }return e; + }, + W = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + K = n.i(A.getLogger)(e), + q = x.a.isTemasysPluginUsed() ? n(33) : void 0, + z = new k.a(), + X = 3e3, + Q = { audio: !1, video: !1 }, + Y = "default", + Z = !1, + ee = !1, + te = !1, + ne = !1, + re = !1, + ie = !1, + oe = document.createElement("audio"), + ae = void 0 !== oe.setSinkId, + se = void 0, + ce = void 0, + ue = !1, + le = !1, + de = function (e) { + function t() { + return r(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, z)); + }return o(t, e), W(t, [{ key: "init", value: function value(e) { + var t = this;return "boolean" == typeof e.disableAEC && (te = e.disableAEC, K.info("Disable AEC: " + te)), "boolean" == typeof e.disableNS && (ne = e.disableNS, K.info("Disable NS: " + ne)), "boolean" == typeof e.disableAP && (ee = e.disableAP, K.info("Disable AP: " + ee)), "boolean" == typeof e.disableAGC && (re = e.disableAGC, K.info("Disable AGC: " + re)), "boolean" == typeof e.disableHPF && (ie = e.disableHPF, K.info("Disable HPF: " + ie)), s(), new Promise(function (n, r) { + if (x.a.isFirefox()) { + var i = x.a.getFirefoxVersion();if (i < 40) return void S("Firefox version too old: " + i + ". Required >= 40.", r);t.RTCPeerConnectionType = mozRTCPeerConnection, t.getUserMedia = m(navigator.mozGetUserMedia.bind(navigator)), t.enumerateDevices = ce, t.pcConstraints = {}, t.attachMediaStream = _(function (e, t) { + return e && (b(e, t), t && e.play()), e; + }), t.getStreamID = function (e) { + var t = e.id;if (!t) { + var n = e.getVideoTracks();n && 0 !== n.length || (n = e.getAudioTracks()), t = n[0].id; + }return J.a.filterSpecialChars(t); + }, t.getTrackID = function (e) { + return e.id; + }, RTCSessionDescription = mozRTCSessionDescription, RTCIceCandidate = mozRTCIceCandidate; + } else if (x.a.isChrome() || x.a.isOpera() || x.a.isNWJS() || x.a.isElectron() || x.a.isReactNative()) { + t.RTCPeerConnectionType = webkitRTCPeerConnection;var o = navigator.webkitGetUserMedia.bind(navigator);t.getUserMedia = m(o), t.enumerateDevices = ce, t.attachMediaStream = _(function (e, t) { + return b(e, t), e; + }), t.getStreamID = function (e) { + var t = e.id;return "number" == typeof t ? t : J.a.filterSpecialChars(t); + }, t.getTrackID = function (e) { + return e.id; + }, t.pcConstraints = { optional: [] }, e.useIPv6 && t.pcConstraints.optional.push({ googIPv6: !0 }), webkitMediaStream.prototype.getVideoTracks || (webkitMediaStream.prototype.getVideoTracks = function () { + return this.videoTracks; + }), webkitMediaStream.prototype.getAudioTracks || (webkitMediaStream.prototype.getAudioTracks = function () { + return this.audioTracks; + }), t.p2pPcConstraints = JSON.parse(JSON.stringify(t.pcConstraints)), e.disableSuspendVideo || t.pcConstraints.optional.push({ googSuspendBelowMinBitrate: !0 }), t.p2pPcConstraints.optional.push({ googSuspendBelowMinBitrate: !0 }); + } else if (x.a.isEdge()) t.RTCPeerConnectionType = U.a, t.getUserMedia = m(navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices), !0), t.enumerateDevices = ce, t.attachMediaStream = _(function (e, t) { + return b(e, t), e; + }), t.getStreamID = function (e) { + var t = e.jitsiRemoteId || e.id;return J.a.filterSpecialChars(t); + }, t.getTrackID = function (e) { + return e.jitsiRemoteId || e.id; + };else { + if (!x.a.isTemasysPluginUsed()) return void S("Browser does not appear to be WebRTC-capable", r);var a = function a() { + t.RTCPeerConnectionType = RTCPeerConnection, t.getUserMedia = window.getUserMedia, t.enumerateDevices = v, t.attachMediaStream = _(function (e, t) { + if (t) { + if ("dummyAudio" === t.id || "dummyVideo" === t.id) return;var n = $(e);if (x.a.isTemasysPluginUsed() && !n.is(":visible") && n.show(), t.getVideoTracks().length > 0 && !$(e).is(":visible")) throw new Error("video element must be visible to attach video stream"); + }return attachMediaStream(e, t); + }), t.getStreamID = function (e) { + return J.a.filterSpecialChars(e.label); + }, t.getTrackID = function (e) { + return e.id; + }, T(e, t.getUserMediaWithConstraints.bind(t)); + }, + s = new Promise(function (e) { + return q.webRTCReady(e); + });q.WebRTCPlugin.isPluginInstalled(q.WebRTCPlugin.pluginInfo.prefix, q.WebRTCPlugin.pluginInfo.plugName, q.WebRTCPlugin.pluginInfo.type, function () { + s.then(function () { + a(), n(); + }); + }, function () { + var e = new Error("Temasys plugin is not installed");e.name = "WEBRTC_NOT_READY", e.webRTCReadyPromise = s, r(e); + }); + }t.p2pPcConstraints = t.p2pPcConstraints || t.pcConstraints, x.a.isTemasysPluginUsed() || (T(e, t.getUserMediaWithConstraints.bind(t)), n()); + }); + } }, { key: "getUserMediaWithConstraints", value: function value(e, t, n) { + var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, + i = u(e, r);K.info("Get media constraints", i);try { + this.getUserMedia(i, function (n) { + K.log("onUserMediaSuccess"), l(e, n), t(n); + }, function (t) { + l(e, void 0), K.warn("Failed to get access to local media. Error ", t, i), n && n(new O.a(t, i, e)); + }); + } catch (t) { + K.error("GUM failed: ", t), n && n(new O.a(t, i, e)); + } + } }, { key: "obtainAudioAndVideoPermissions", value: function value() { + var e = this, + t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = this, + r = V({}, t.desktopSharingExtensionExternalInstallation, { desktopSharingSources: t.desktopSharingSources });return new Promise(function (i, o) { + var a = function a(e) { + i(y(e, t.resolution)); + };if (t.devices = t.devices || ["audio", "video"], B.a.isSupported() || -1 === t.devices.indexOf("desktop") || o(new Error("Desktop sharing is not supported!")), x.a.isFirefox() || x.a.isReactNative() || x.a.isTemasysPluginUsed()) { + var s = function s(e, n, r) { + this.getUserMediaWithConstraints(e, n, r, t); + }, + c = { audio: s.bind(n, ["audio"]), video: s.bind(n, ["video"]) };B.a.isSupported() && (c.desktop = B.a.obtainStream.bind(B.a, r)), E({ devices: t.devices, streams: [], successCallback: a, errorCallback: o, deviceGUM: c }); + } else { + var l = t.devices.indexOf("desktop") > -1;l && t.devices.splice(t.devices.indexOf("desktop"), 1), t.resolution = t.resolution || "360", t.devices.length ? e.getUserMediaWithConstraints(t.devices, function (e) { + var i = -1 !== t.devices.indexOf("audio"), + s = -1 !== t.devices.indexOf("video"), + c = e.getAudioTracks().length > 0, + d = e.getVideoTracks().length > 0;if (i && !c || s && !d) { + n.stopMediaStream(e);var p = [];return i && !c && p.push("audio"), s && !d && p.push("video"), void n.getUserMediaWithConstraints(p, function () { + o(new O.a({ name: "UnknownError" }, u(t.devices, t), p)); + }, function (e) { + o(e); + }, t); + }l ? B.a.obtainStream(r, function (t) { + a({ audioVideo: e, desktop: t }); + }, function (t) { + n.stopMediaStream(e), o(t); + }) : a({ audioVideo: e }); + }, function (e) { + return o(e); + }, t) : l && B.a.obtainStream(r, function (e) { + return a({ desktop: e }); + }, function (e) { + return o(e); + }); + } + }); + } }, { key: "getDeviceAvailability", value: function value() { + return Q; + } }, { key: "isRTCReady", value: function value() { + return le; + } }, { key: "_isDeviceListAvailable", value: function value() { + if (!le) throw new Error("WebRTC not ready yet");return Boolean(navigator.mediaDevices && navigator.mediaDevices.enumerateDevices || "undefined" != typeof MediaStreamTrack && MediaStreamTrack.getSources); + } }, { key: "onRTCReady", value: function value() { + return le ? Promise.resolve() : new Promise(function (e) { + var t = function t() { + z.removeListener(F.a.RTC_READY, t), e(); + };z.addListener(F.a.RTC_READY, t); + }); + } }, { key: "isDeviceListAvailable", value: function value() { + return this.onRTCReady().then(this._isDeviceListAvailable.bind(this)); + } }, { key: "isDeviceChangeAvailable", value: function value(e) { + return "output" === e || "audiooutput" === e ? ae : x.a.isChrome() || x.a.isFirefox() || x.a.isOpera() || x.a.isTemasysPluginUsed() || x.a.isNWJS() || x.a.isElectron() || x.a.isEdge(); + } }, { key: "stopMediaStream", value: function value(e) { + e.getTracks().forEach(function (e) { + !x.a.isTemasysPluginUsed() && e.stop && e.stop(); + }), e.stop && e.stop(), e.release && e.release();var t = e.jitsiObjectURL;t && (delete e.jitsiObjectURL, (URL || webkitURL).revokeObjectURL(t)); + } }, { key: "isDesktopSharingEnabled", value: function value() { + return B.a.isSupported(); + } }, { key: "setAudioOutputDevice", value: function value(e) { + return this.isDeviceChangeAvailable("output") || Promise.reject(new Error("Audio output device change is not supported")), oe.setSinkId(e).then(function () { + Y = e, Z = !0, K.log("Audio output device set to " + e), z.emit(F.a.AUDIO_OUTPUT_DEVICE_CHANGED, e); + }); + } }, { key: "getAudioOutputDevice", value: function value() { + return Y; + } }, { key: "getCurrentlyAvailableMediaDevices", value: function value() { + return se; + } }, { key: "getEventDataForActiveDevice", value: function value(e) { + var t = [], + n = { deviceId: e.deviceId, kind: e.kind, label: e.label, groupId: e.groupId };return t.push(n), { deviceList: t }; + } }]), t; + }(D.a), + pe = new de();t.a = pe; + }).call(t, "modules/RTC/RTCUtils.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e) { + return parseInt(e.ssrcs.split(" ")[0], 10); + }function o(e) { + return parseInt(e.ssrcs.split(" ")[1], 10); + }function a(e) { + return e.ssrcs ? e.ssrcs.map(function (e) { + return e.id; + }).filter(function (e, t, n) { + return n.indexOf(e) === t; + }).length : 0; + }t.c = i, t.b = o, n.d(t, "a", function () { + return l; + });var s = n(13), + c = (n.n(s), function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }()), + u = function () { + function e(t) { + if (r(this, e), !t) throw new Error("mLine is undefined");this.mLine = t; + }return c(e, [{ key: "getSSRCAttrValue", value: function value(e, t) { + var n = this.ssrcs.find(function (n) { + return n.id === e && n.attribute === t; + });return n && n.value; + } }, { key: "removeSSRC", value: function value(e) { + this.mLine.ssrcs && this.mLine.ssrcs.length && (this.mLine.ssrcs = this.mLine.ssrcs.filter(function (t) { + return t.id !== e; + })); + } }, { key: "addSSRCAttribute", value: function value(e) { + this.ssrcs.push(e); + } }, { key: "findGroup", value: function value(e, t) { + return this.ssrcGroups.find(function (n) { + return n.semantics === e && (!t || t === n.ssrcs); + }); + } }, { key: "findGroups", value: function value(e) { + return this.ssrcGroups.filter(function (t) { + return t.semantics === e; + }); + } }, { key: "findGroupByPrimarySSRC", value: function value(e, t) { + return this.ssrcGroups.find(function (n) { + return n.semantics === e && i(n) === t; + }); + } }, { key: "findSSRCByMSID", value: function value(e) { + return this.ssrcs.find(function (t) { + return "msid" === t.attribute && (null === e || t.value === e); + }); + } }, { key: "getSSRCCount", value: function value() { + return a(this.mLine); + } }, { key: "containsAnySSRCGroups", value: function value() { + return void 0 !== this.mLine.ssrcGroups; + } }, { key: "getPrimaryVideoSsrc", value: function value() { + var e = this.mLine.type;if ("video" !== e) throw new Error("getPrimarySsrc doesn't work with '" + e + "'");if (1 === a(this.mLine)) return this.mLine.ssrcs[0].id;if (this.mLine.ssrcGroups) { + var t = this.findGroup("SIM");if (t) return i(t);var n = this.findGroup("FID");if (n) return i(n); + } + } }, { key: "getRtxSSRC", value: function value(e) { + var t = this.findGroupByPrimarySSRC("FID", e);return t && o(t); + } }, { key: "getSSRCs", value: function value() { + return this.ssrcs.map(function (e) { + return e.id; + }).filter(function (e, t, n) { + return n.indexOf(e) === t; + }); + } }, { key: "getPrimaryVideoSSRCs", value: function value() { + var e = this.mLine.type;if ("video" !== e) throw new Error("getPrimaryVideoSSRCs doesn't work with " + e);var t = this.getSSRCs(), + n = !0, + r = !1, + i = void 0;try { + for (var a, s = this.ssrcGroups[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (a = s.next()).done); n = !0) { + var c = a.value;if ("FID" === c.semantics) { + var u = o(c);t.splice(t.indexOf(u), 1); + } + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && s.return && s.return(); + } finally { + if (r) throw i; + } + }return t; + } }, { key: "dumpSSRCGroups", value: function value() { + return JSON.stringify(this.mLine.ssrcGroups); + } }, { key: "removeGroupsWithSSRC", value: function value(e) { + this.mLine.ssrcGroups && (this.mLine.ssrcGroups = this.mLine.ssrcGroups.filter(function (t) { + return -1 === t.ssrcs.indexOf("" + e); + })); + } }, { key: "removeGroupsBySemantics", value: function value(e) { + this.mLine.ssrcGroups && (this.mLine.ssrcGroups = this.mLine.ssrcGroups.filter(function (t) { + return t.semantics !== e; + })); + } }, { key: "replaceSSRC", value: function value(e, t) { + this.mLine.ssrcs && this.mLine.ssrcs.forEach(function (n) { + n.id === e && (n.id = t); + }); + } }, { key: "addSSRCGroup", value: function value(e) { + this.ssrcGroups.push(e); + } }, { key: "ssrcs", get: function get() { + return this.mLine.ssrcs || (this.mLine.ssrcs = []), this.mLine.ssrcs; + }, set: function set(e) { + this.mLine.ssrcs = e; + } }, { key: "direction", get: function get() { + return this.mLine.direction; + }, set: function set(e) { + this.mLine.direction = e; + } }, { key: "ssrcGroups", get: function get() { + return this.mLine.ssrcGroups || (this.mLine.ssrcGroups = []), this.mLine.ssrcGroups; + }, set: function set(e) { + this.mLine.ssrcGroups = e; + } }]), e; + }(), + l = function () { + function e(t) { + r(this, e), this.parsedSDP = s.parse(t); + }return c(e, [{ key: "selectMedia", value: function value(e) { + var t = this.parsedSDP.media.find(function (t) { + return t.type === e; + });return t ? new u(t) : null; + } }, { key: "toRawSDP", value: function value() { + return s.write(this.parsedSDP); + } }]), e; + }(); + }, function (e, t) { + (function (t) { + e.exports = t; + }).call(t, {}); + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "AUTHENTICATION_REQUIRED", function () { + return r; + }), n.d(t, "CHAT_ERROR", function () { + return i; + }), n.d(t, "CONFERENCE_DESTROYED", function () { + return o; + }), n.d(t, "CONFERENCE_MAX_USERS", function () { + return a; + }), n.d(t, "CONNECTION_ERROR", function () { + return s; + }), n.d(t, "NOT_ALLOWED_ERROR", function () { + return c; + }), n.d(t, "FOCUS_DISCONNECTED", function () { + return u; + }), n.d(t, "FOCUS_LEFT", function () { + return l; + }), n.d(t, "GRACEFUL_SHUTDOWN", function () { + return d; + }), n.d(t, "INCOMPATIBLE_SERVER_VERSIONS", function () { + return p; + }), n.d(t, "JINGLE_FATAL_ERROR", function () { + return f; + }), n.d(t, "PASSWORD_NOT_SUPPORTED", function () { + return h; + }), n.d(t, "PASSWORD_REQUIRED", function () { + return m; + }), n.d(t, "RESERVATION_ERROR", function () { + return v; + }), n.d(t, "SETUP_FAILED", function () { + return g; + }), n.d(t, "VIDEOBRIDGE_NOT_AVAILABLE", function () { + return y; + });var r = "conference.authenticationRequired", + i = "conference.chatError", + o = "conference.destroyed", + a = "conference.max_users", + s = "conference.connectionError", + c = "conference.connectionError.notAllowed", + u = "conference.focusDisconnected", + l = "conference.focusLeft", + d = "conference.gracefulShutdown", + p = "conference.incompatible_server_versions", + f = "conference.jingleFatalError", + h = "conference.passwordNotSupported", + m = "conference.passwordRequired", + v = "conference.reservationError", + g = "conference.setup_failed", + y = "conference.videobridgeNotAvailable"; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "CONNECTION_DISCONNECTED", function () { + return r; + }), n.d(t, "CONNECTION_ESTABLISHED", function () { + return i; + }), n.d(t, "CONNECTION_FAILED", function () { + return o; + }), n.d(t, "WRONG_STATE", function () { + return a; + });var r = "connection.connectionDisconnected", + i = "connection.connectionEstablished", + o = "connection.connectionFailed", + a = "connection.wrongState"; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }n.d(t, "a", function () { + return v; + });var i = n(0), + o = (n.n(i), n(5)), + a = n(16), + s = n(4), + c = n(2), + u = n(8), + l = n.n(u), + d = n(6), + p = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + f = n.i(i.getLogger)(e), + h = 500, + m = 2e3, + v = { ACTIVE: "active", INACTIVE: "inactive", INTERRUPTED: "interrupted", RESTORING: "restoring" }, + g = function () { + function e(t, n, i) { + r(this, e), this.rtc = t, this.conference = n, this.trackTimers = {}, this.connStatusFromJvb = {}, this.outOfLastNTimeout = "number" == typeof i.outOfLastNTimeout ? i.outOfLastNTimeout : h, this.rtcMuteTimeout = "number" == typeof i.rtcMuteTimeout ? i.rtcMuteTimeout : m, this.rtcMutedTimestamp = {}, f.info("RtcMuteTimeout set to: " + this.rtcMuteTimeout), this.enteredLastNTimestamp = new Map(), this.restoringTimers = new Map(); + }return p(e, null, [{ key: "_getNewStateForJvbMode", value: function value(e, t, n, r, i) { + return e ? r ? v.ACTIVE : c.a.isVideoMuteOnConnInterruptedSupported() ? i ? t ? n ? v.INTERRUPTED : v.RESTORING : v.INACTIVE : v.ACTIVE : t ? v.ACTIVE : v.INACTIVE : v.INTERRUPTED; + } }, { key: "_getNewStateForP2PMode", value: function value(e, t) { + return c.a.isVideoMuteOnConnInterruptedSupported() ? e || !t ? v.ACTIVE : v.INTERRUPTED : v.ACTIVE; + } }]), p(e, [{ key: "_getVideoFrozenTimeout", value: function value(e) { + return this.rtc.isInLastN(e) ? this.rtcMuteTimeout : this.outOfLastNTimeout; + } }, { key: "init", value: function value() { + this._onEndpointConnStatusChanged = this.onEndpointConnStatusChanged.bind(this), this.rtc.addListener(l.a.ENDPOINT_CONN_STATUS_CHANGED, this._onEndpointConnStatusChanged), this._onP2PStatus = this.refreshConnectionStatusForAll.bind(this), this.conference.on(o.P2P_STATUS, this._onP2PStatus), c.a.isVideoMuteOnConnInterruptedSupported() && (this._onTrackRtcMuted = this.onTrackRtcMuted.bind(this), this.rtc.addListener(l.a.REMOTE_TRACK_MUTE, this._onTrackRtcMuted), this._onTrackRtcUnmuted = this.onTrackRtcUnmuted.bind(this), this.rtc.addListener(l.a.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted), this._onRemoteTrackAdded = this.onRemoteTrackAdded.bind(this), this.conference.on(o.TRACK_ADDED, this._onRemoteTrackAdded), this._onRemoteTrackRemoved = this.onRemoteTrackRemoved.bind(this), this.conference.on(o.TRACK_REMOVED, this._onRemoteTrackRemoved), this._onSignallingMuteChanged = this.onSignallingMuteChanged.bind(this)), this._onLastNChanged = this._onLastNChanged.bind(this), this.conference.on(o.LAST_N_ENDPOINTS_CHANGED, this._onLastNChanged), this._onLastNValueChanged = this.refreshConnectionStatusForAll.bind(this), this.rtc.on(l.a.LASTN_VALUE_CHANGED, this._onLastNValueChanged); + } }, { key: "dispose", value: function value() { + this.rtc.removeListener(l.a.ENDPOINT_CONN_STATUS_CHANGED, this._onEndpointConnStatusChanged), c.a.isVideoMuteOnConnInterruptedSupported() && (this.rtc.removeListener(l.a.REMOTE_TRACK_MUTE, this._onTrackRtcMuted), this.rtc.removeListener(l.a.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted), this.conference.off(o.TRACK_ADDED, this._onRemoteTrackAdded), this.conference.off(o.TRACK_REMOVED, this._onRemoteTrackRemoved)), this.conference.off(o.LAST_N_ENDPOINTS_CHANGED, this._onLastNChanged), this.rtc.removeListener(l.a.LASTN_VALUE_CHANGED, this._onLastNValueChanged), this.conference.off(o.P2P_STATUS, this._onP2PStatus);var e = Object.keys(this.trackTimers), + t = !0, + n = !1, + r = void 0;try { + for (var i, a = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = a.next()).done); t = !0) { + var s = i.value;this.clearTimeout(s), this.clearRtcMutedTimestamp(s); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && a.return && a.return(); + } finally { + if (n) throw r; + } + }this.connStatusFromJvb = {}; + } }, { key: "onEndpointConnStatusChanged", value: function value(e, t) { + f.debug("Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED(" + Date.now() + "): " + e + ": " + t), e !== this.conference.myUserId() && (this.connStatusFromJvb[e] = t, this.figureOutConnectionStatus(e)); + } }, { key: "_changeConnectionStatus", value: function value(e, t) { + if (e.getConnectionStatus() !== t) { + var n = e.getId();e._setConnectionStatus(t), f.debug("Emit endpoint conn status(" + Date.now() + ") " + n + ": " + t), d.a.sendLog(JSON.stringify({ id: "peer.conn.status", participant: n, status: t })), this.conference.eventEmitter.emit(o.PARTICIPANT_CONN_STATUS_CHANGED, n, t); + } + } }, { key: "clearTimeout", value: function value(e) { + this.trackTimers[e] && (window.clearTimeout(this.trackTimers[e]), this.trackTimers[e] = null); + } }, { key: "clearRtcMutedTimestamp", value: function value(e) { + this.rtcMutedTimestamp[e] = null; + } }, { key: "onRemoteTrackAdded", value: function value(e) { + e.isLocal() || e.getType() !== s.b || (f.debug("Detector on remote track added for: " + e.getParticipantId()), e.on(a.TRACK_MUTE_CHANGED, this._onSignallingMuteChanged)); + } }, { key: "onRemoteTrackRemoved", value: function value(e) { + if (!e.isLocal() && e.getType() === s.b) { + var t = e.getParticipantId();f.debug("Detector on remote track removed: " + t), e.off(a.TRACK_MUTE_CHANGED, this._onSignallingMuteChanged), this.clearTimeout(t), this.clearRtcMutedTimestamp(t), this.figureOutConnectionStatus(t); + } + } }, { key: "isVideoTrackFrozen", value: function value(e) { + if (!c.a.isVideoMuteOnConnInterruptedSupported()) return !1;var t = e.getId(), + n = e.hasAnyVideoTrackWebRTCMuted(), + r = this.rtcMutedTimestamp[t], + i = this._getVideoFrozenTimeout(t);return n && "number" == typeof r && Date.now() - r >= i; + } }, { key: "refreshConnectionStatusForAll", value: function value() { + var e = this.conference.getParticipants(), + t = !0, + n = !1, + r = void 0;try { + for (var i, o = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + var a = i.value;this.figureOutConnectionStatus(a.getId()); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + } + } }, { key: "figureOutConnectionStatus", value: function value(t) { + var n = this.conference.getParticipantById(t);if (!n) return void f.warn("figure out conn status - no participant for: " + t);var r = this.conference.isP2PActive(), + i = this._isRestoringTimedout(t), + o = 0 === this.rtc.getLastN(), + a = n.isVideoMuted() || o, + s = this.isVideoTrackFrozen(n), + c = this.rtc.isInLastN(t), + u = this.connStatusFromJvb[t];"boolean" != typeof u && (f.debug("Assuming connection active by JVB - no notification"), u = !0);var l = r ? e._getNewStateForP2PMode(a, s) : e._getNewStateForJvbMode(u, c, i, a, s);l !== v.RESTORING && this._clearRestoringTimer(t), f.debug("Figure out conn status for " + t + ", is video muted: " + a + " is active(jvb): " + u + " video track frozen: " + s + " p2p mode: " + r + " is in last N: " + c + " currentStatus => newStatus: \n " + n.getConnectionStatus() + " => " + l), this._changeConnectionStatus(n, l); + } }, { key: "_onLastNChanged", value: function value() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], + t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], + n = Date.now();f.debug("leaving/entering lastN", e, t, n);var r = !0, + i = !1, + o = void 0;try { + for (var a, s = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value;this.enteredLastNTimestamp.delete(c), this._clearRestoringTimer(c), this.figureOutConnectionStatus(c); + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }var u = !0, + l = !1, + d = void 0;try { + for (var p, h = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(u = (p = h.next()).done); u = !0) { + var m = p.value;this.enteredLastNTimestamp.set(m, n), this.figureOutConnectionStatus(m); + } + } catch (e) { + l = !0, d = e; + } finally { + try { + !u && h.return && h.return(); + } finally { + if (l) throw d; + } + } + } }, { key: "_clearRestoringTimer", value: function value(e) { + var t = this.restoringTimers.get(e);t && (clearTimeout(t), this.restoringTimers.delete(e)); + } }, { key: "_isRestoringTimedout", value: function value(e) { + var t = this, + n = this.enteredLastNTimestamp.get(e);return !!(n && Date.now() - n >= 5e3) || (this.restoringTimers.get(e) || this.restoringTimers.set(e, setTimeout(function () { + return t.figureOutConnectionStatus(e); + }, 5e3)), !1); + } }, { key: "onTrackRtcMuted", value: function value(e) { + var t = this, + n = e.getParticipantId(), + r = this.conference.getParticipantById(n);if (f.debug("Detector track RTC muted: " + n, Date.now()), !r) return void f.error("No participant for id: " + n);if (this.rtcMutedTimestamp[n] = Date.now(), !r.isVideoMuted()) { + this.clearTimeout(n);var i = this._getVideoFrozenTimeout(n);this.trackTimers[n] = window.setTimeout(function () { + f.debug("Set RTC mute timeout for: " + n + " of " + i + " ms"), t.clearTimeout(n), t.figureOutConnectionStatus(n); + }, i); + } + } }, { key: "onTrackRtcUnmuted", value: function value(e) { + var t = e.getParticipantId();f.debug("Detector track RTC unmuted: " + t, Date.now()), this.clearTimeout(t), this.clearRtcMutedTimestamp(t), this.figureOutConnectionStatus(t); + } }, { key: "onSignallingMuteChanged", value: function value(e) { + var t = e.getParticipantId();f.debug("Detector on track signalling mute changed: " + t, e.isMuted()), this.figureOutConnectionStatus(t); + } }]), e; + }();t.b = g; + }).call(t, "modules/connectivity/ParticipantConnectionStatus.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i() { + var e = "undefined" == typeof window ? this : window, + t = void 0;try { + t = e.localStorage; + } catch (e) { + f.error(e); + }return t; + }function o() { + return (Math.random().toString(16) + "000000000").substr(2, 8); + }function a() { + return o() + o() + o() + o(); + }function s() { + var e = a();return f.log("generated id", e), e; + }function c() { + var e = d.a.generateUsername();return f.log("generated callstats uid", e), e; + }var u = n(0), + l = (n.n(u), n(116)), + d = n.n(l), + p = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + f = n.i(u.getLogger)(e), + h = function () { + function e() { + r(this, e);var t = i();t ? (this.userId = t.getItem("jitsiMeetId") || s(), this.callStatsUserName = t.getItem("callStatsUserName") || c(), this.save()) : (f.log("localStorage is not supported"), this.userId = s(), this.callStatsUserName = c()); + }return p(e, [{ key: "save", value: function value() { + var e = i();e && (e.setItem("jitsiMeetId", this.userId), e.setItem("callStatsUserName", this.callStatsUserName)); + } }, { key: "getMachineId", value: function value() { + return this.userId; + } }, { key: "getCallStatsUserName", value: function value() { + return this.callStatsUserName; + } }, { key: "setSessionId", value: function value(e) { + var t = i();t && (e ? t.setItem("sessionId", e) : t.removeItem("sessionId")); + } }, { key: "clearSessionId", value: function value() { + this.setSessionId(void 0); + } }, { key: "getSessionId", value: function value() { + var e = i();return e ? e.getItem("sessionId") : void 0; + } }]), e; + }();t.a = new h(); + }).call(t, "modules/settings/Settings.js"); + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "STATUS_AVAILABLE", function () { + return r; + }), n.d(t, "STATUS_UNDEFINED", function () { + return i; + }), n.d(t, "STATUS_BUSY", function () { + return o; + }), n.d(t, "STATE_ON", function () { + return a; + }), n.d(t, "STATE_OFF", function () { + return s; + }), n.d(t, "STATE_PENDING", function () { + return c; + }), n.d(t, "STATE_RETRYING", function () { + return u; + }), n.d(t, "STATE_FAILED", function () { + return l; + });var r = "available", + i = "undefined", + o = "busy", + a = "on", + s = "off", + c = "pending", + u = "retrying", + l = "failed"; + }, function (e, t) { + var n = { 1080: { width: 1920, height: 1080, order: 7 }, fullhd: { width: 1920, height: 1080, order: 7 }, 720: { width: 1280, height: 720, order: 6 }, hd: { width: 1280, height: 720, order: 6 }, 960: { width: 960, height: 720, order: 5 }, 360: { width: 640, height: 360, order: 4 }, 640: { width: 640, height: 480, order: 3 }, vga: { width: 640, height: 480, order: 3 }, 180: { width: 320, height: 180, order: 2 }, 320: { width: 320, height: 240, order: 1 } };e.exports = n; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "LOCAL_STATS_UPDATED", function () { + return r; + }), n.d(t, "REMOTE_STATS_UPDATED", function () { + return i; + });var r = "cq.local_stats_updated", + i = "cq.remote_stats_updated"; + }, function (e, t, n) { + (function (t) { + var r, + r, + o = n(0).getLogger(t), + a = a || {};e.exports = a, a.options = a.options || {}, a.VERSION = "0.14.0", a.onwebrtcready = a.onwebrtcready || function (e) {}, a._onwebrtcreadies = [], a.webRTCReady = function (e) { + if ("function" != typeof e) throw new Error("Callback provided is not a function");!0 === a.onwebrtcreadyDone ? e(null !== a.WebRTCPlugin.plugin) : a._onwebrtcreadies.push(e); + }, a.WebRTCPlugin = a.WebRTCPlugin || {}, a.WebRTCPlugin.pluginInfo = a.WebRTCPlugin.pluginInfo || { prefix: "Tem", plugName: "TemWebRTCPlugin", pluginId: "plugin0", type: "application/x-temwebrtcplugin", onload: "__TemWebRTCReady0", portalLink: "http://skylink.io/plugin/", downloadLink: null, companyName: "Temasys", downloadLinks: { mac: "http://bit.ly/webrtcpluginpkg", win: "http://bit.ly/webrtcpluginmsi" } }, void 0 !== a.WebRTCPlugin.pluginInfo.downloadLinks && null !== a.WebRTCPlugin.pluginInfo.downloadLinks && (navigator.platform.match(/^Mac/i) ? a.WebRTCPlugin.pluginInfo.downloadLink = a.WebRTCPlugin.pluginInfo.downloadLinks.mac : navigator.platform.match(/^Win/i) && (a.WebRTCPlugin.pluginInfo.downloadLink = a.WebRTCPlugin.pluginInfo.downloadLinks.win)), a.WebRTCPlugin.TAGS = { NONE: "none", AUDIO: "audio", VIDEO: "video" }, a.WebRTCPlugin.pageId = Math.random().toString(36).slice(2), a.WebRTCPlugin.plugin = null, a.WebRTCPlugin.setLogLevel = null, a.WebRTCPlugin.defineWebRTCInterface = null, a.WebRTCPlugin.isPluginInstalled = null, a.WebRTCPlugin.pluginInjectionInterval = null, a.WebRTCPlugin.injectPlugin = null, a.WebRTCPlugin.PLUGIN_STATES = { NONE: 0, INITIALIZING: 1, INJECTING: 2, INJECTED: 3, READY: 4 }, a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.NONE, a.onwebrtcreadyDone = !1, a.WebRTCPlugin.PLUGIN_LOG_LEVELS = { NONE: "NONE", ERROR: "ERROR", WARNING: "WARNING", INFO: "INFO", VERBOSE: "VERBOSE", SENSITIVE: "SENSITIVE" }, a.WebRTCPlugin.WaitForPluginReady = null, a.WebRTCPlugin.callWhenPluginReady = null, __TemWebRTCReady0 = function __TemWebRTCReady0() { + if ("complete" === document.readyState) a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.READY, a.maybeThroughWebRTCReady();else var e = setInterval(function () { + "complete" === document.readyState && (clearInterval(e), a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.READY, a.maybeThroughWebRTCReady()); + }, 100); + }, a.maybeThroughWebRTCReady = function () { + a.onwebrtcreadyDone || (a.onwebrtcreadyDone = !0, a._onwebrtcreadies.length ? a._onwebrtcreadies.forEach(function (e) { + "function" == typeof e && e(null !== a.WebRTCPlugin.plugin); + }) : "function" == typeof a.onwebrtcready && a.onwebrtcready(null !== a.WebRTCPlugin.plugin)); + }, a.TEXT = { PLUGIN: { REQUIRE_INSTALLATION: "This website requires you to install a WebRTC-enabling plugin to work on this browser.", NOT_SUPPORTED: "Your browser does not support WebRTC.", BUTTON: "Install Now" }, REFRESH: { REQUIRE_REFRESH: "Please refresh page", BUTTON: "Refresh Page" } }, a._iceConnectionStates = { starting: "starting", checking: "checking", connected: "connected", completed: "connected", done: "completed", disconnected: "disconnected", failed: "failed", closed: "closed" }, a._iceConnectionFiredStates = [], a.isDefined = null, a.parseWebrtcDetectedBrowser = function () { + var e = null;if (window.opr && opr.addons || window.opera || navigator.userAgent.indexOf(" OPR/") >= 0) e = navigator.userAgent.match(/OPR\/(\d+)/i) || [], webrtcDetectedBrowser = "opera", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 26, webrtcDetectedType = "webkit", webrtcDetectedDCSupport = "SCTP";else if (navigator.userAgent.match(/Bowser\/[0-9.]*/g)) { + e = navigator.userAgent.match(/Bowser\/[0-9.]*/g) || [];var t = parseInt((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./i) || [])[2] || "0", 10);webrtcDetectedBrowser = "bowser", webrtcDetectedVersion = parseFloat((e[0] || "0/0").split("/")[1], 10), webrtcMinimumVersion = 0, webrtcDetectedType = "webkit", webrtcDetectedDCSupport = t > 30 ? "SCTP" : "RTP"; + } else if (navigator.userAgent.indexOf("OPiOS") > 0) e = navigator.userAgent.match(/OPiOS\/([0-9]+)\./), webrtcDetectedBrowser = "opera", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 0, webrtcDetectedType = null, webrtcDetectedDCSupport = null;else if (navigator.userAgent.indexOf("CriOS") > 0) e = navigator.userAgent.match(/CriOS\/([0-9]+)\./) || [], webrtcDetectedBrowser = "chrome", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 0, webrtcDetectedType = null, webrtcDetectedDCSupport = null;else if (navigator.userAgent.indexOf("FxiOS") > 0) e = navigator.userAgent.match(/FxiOS\/([0-9]+)\./) || [], webrtcDetectedBrowser = "firefox", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 0, webrtcDetectedType = null, webrtcDetectedDCSupport = null;else if (document.documentMode) e = /\brv[ :]+(\d+)/g.exec(navigator.userAgent) || [], webrtcDetectedBrowser = "IE", webrtcDetectedVersion = parseInt(e[1], 10), webrtcMinimumVersion = 9, webrtcDetectedType = "plugin", webrtcDetectedDCSupport = "SCTP", webrtcDetectedVersion || (e = /\bMSIE[ :]+(\d+)/g.exec(navigator.userAgent) || [], webrtcDetectedVersion = parseInt(e[1] || "0", 10));else if (window.StyleMedia || navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) e = navigator.userAgent.match(/Edge\/(\d+).(\d+)$/) || [], webrtcDetectedBrowser = "edge", webrtcDetectedVersion = parseFloat((e[0] || "0/0").split("/")[1], 10), webrtcMinimumVersion = 13.10547, webrtcDetectedType = "ms", webrtcDetectedDCSupport = null;else if ("undefined" != typeof InstallTrigger || navigator.userAgent.indexOf("irefox") > 0) e = navigator.userAgent.match(/Firefox\/([0-9]+)\./) || [], webrtcDetectedBrowser = "firefox", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 31, webrtcDetectedType = "moz", webrtcDetectedDCSupport = "SCTP";else if (window.chrome && window.chrome.webstore || navigator.userAgent.indexOf("Chrom") > 0) e = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./i) || [], webrtcDetectedBrowser = "chrome", webrtcDetectedVersion = parseInt(e[2] || "0", 10), webrtcMinimumVersion = 38, webrtcDetectedType = "webkit", webrtcDetectedDCSupport = webrtcDetectedVersion > 30 ? "SCTP" : "RTP";else if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { + e = navigator.userAgent.match(/version\/(\d+)/i) || [];var n = navigator.userAgent.match(/(iPhone|iPad)/gi) || [];webrtcDetectedBrowser = "safari", webrtcDetectedVersion = parseInt(e[1] || "0", 10), webrtcMinimumVersion = 7, webrtcDetectedType = 0 === n.length ? "plugin" : null, webrtcDetectedDCSupport = 0 === n.length ? "SCTP" : null; + }window.webrtcDetectedBrowser = webrtcDetectedBrowser, window.webrtcDetectedVersion = webrtcDetectedVersion, window.webrtcMinimumVersion = webrtcMinimumVersion, window.webrtcDetectedType = webrtcDetectedType, window.webrtcDetectedDCSupport = webrtcDetectedDCSupport; + }, a.addEvent = function (e, t, n) { + e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent ? e.attachEvent("on" + t, n) : e[t] = n; + }, a.renderNotificationBar = function (e, t, n, r, i) { + if ("complete" === document.readyState) { + var o = window, + s = document.createElement("iframe");s.name = "adapterjs-alert", s.style.position = "fixed", s.style.top = "-41px", s.style.left = 0, s.style.right = 0, s.style.width = "100%", s.style.height = "40px", s.style.backgroundColor = "#ffffe1", s.style.border = "none", s.style.borderBottom = "1px solid #888888", s.style.zIndex = "9999999", "string" == typeof s.style.webkitTransition ? s.style.webkitTransition = "all .5s ease-out" : "string" == typeof s.style.transition && (s.style.transition = "all .5s ease-out"), document.body.appendChild(s);var c = s.contentWindow ? s.contentWindow : s.contentDocument.document ? s.contentDocument.document : s.contentDocument;c.document.open(), c.document.write('' + e + ""), t && n ? (c.document.write(''), c.document.close(), a.addEvent(c.document.getElementById("okay"), "click", function (e) { + i && a.renderNotificationBar(a.TEXT.EXTENSION ? a.TEXT.EXTENSION.REQUIRE_REFRESH : a.TEXT.REFRESH.REQUIRE_REFRESH, a.TEXT.REFRESH.BUTTON, "javascript:location.reload()"), window.open(n, r ? "_blank" : "_top"), e.preventDefault();try { + e.cancelBubble = !0; + } catch (e) {}var t = setInterval(function () { + isIE || navigator.plugins.refresh(!1), a.WebRTCPlugin.isPluginInstalled(a.WebRTCPlugin.pluginInfo.prefix, a.WebRTCPlugin.pluginInfo.plugName, a.WebRTCPlugin.pluginInfo.type, function () { + clearInterval(t), a.WebRTCPlugin.defineWebRTCInterface(); + }, function () {}); + }, 500); + }), a.addEvent(c.document.getElementById("cancel"), "click", function (e) { + o.document.body.removeChild(s); + })) : c.document.close(), setTimeout(function () { + "string" == typeof s.style.webkitTransform ? s.style.webkitTransform = "translateY(40px)" : "string" == typeof s.style.transform ? s.style.transform = "translateY(40px)" : s.style.top = "0px"; + }, 300); + } + }, webrtcDetectedType = null, checkMediaDataChannelSettings = function checkMediaDataChannelSettings(e, t, n, r) { + if ("function" == typeof n) { + var i = !0, + a = "firefox" === webrtcDetectedBrowser, + s = "moz" === webrtcDetectedType && webrtcDetectedVersion > 30, + c = "firefox" === e;if (a && c || s) try { + delete r.mandatory.MozDontOfferDataChannel; + } catch (e) { + o.error("Failed deleting MozDontOfferDataChannel"), o.error(e); + } else a && !c && (r.mandatory.MozDontOfferDataChannel = !0);if (!a) for (var u in r.mandatory) { + r.mandatory.hasOwnProperty(u) && -1 !== u.indexOf("Moz") && delete r.mandatory[u]; + }!a || c || s || (i = !1), n(i, r); + } + }, checkIceConnectionState = function checkIceConnectionState(e, t, n) { + if ("function" != typeof n) return void o.warn("No callback specified in checkIceConnectionState. Aborted.");e = e || "peer", a._iceConnectionFiredStates[e] && t !== a._iceConnectionStates.disconnected && t !== a._iceConnectionStates.failed && t !== a._iceConnectionStates.closed || (a._iceConnectionFiredStates[e] = []), t = a._iceConnectionStates[t], a._iceConnectionFiredStates[e].indexOf(t) < 0 && (a._iceConnectionFiredStates[e].push(t), t === a._iceConnectionStates.connected && setTimeout(function () { + a._iceConnectionFiredStates[e].push(a._iceConnectionStates.done), n(a._iceConnectionStates.done); + }, 1e3), n(t)); + }, createIceServer = null, createIceServers = null, RTCPeerConnection = null, RTCSessionDescription = "function" == typeof RTCSessionDescription ? RTCSessionDescription : null, RTCIceCandidate = "function" == typeof RTCIceCandidate ? RTCIceCandidate : null, getUserMedia = null, attachMediaStream = null, reattachMediaStream = null, webrtcDetectedBrowser = null, webrtcDetectedVersion = null, webrtcMinimumVersion = null, !(navigator.mozGetUserMedia || navigator.webkitGetUserMedia || navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) || 0 === (navigator.userAgent.match(/android/gi) || []).length && 0 === (navigator.userAgent.match(/chrome/gi) || []).length && navigator.userAgent.indexOf("Safari/") > 0 ? ("object" == typeof o && "function" == typeof o.log || (o = {} || o, o.log = function (e) {}, o.info = function (e) {}, o.error = function (e) {}, o.dir = function (e) {}, o.exception = function (e) {}, o.trace = function (e) {}, o.warn = function (e) {}, o.count = function (e) {}, o.debug = function (e) {}, o.count = function (e) {}, o.time = function (e) {}, o.timeEnd = function (e) {}, o.group = function (e) {}, o.groupCollapsed = function (e) {}, o.groupEnd = function (e) {}), a.parseWebrtcDetectedBrowser(), isIE = "IE" === webrtcDetectedBrowser, a.WebRTCPlugin.WaitForPluginReady = function () { + for (; a.WebRTCPlugin.pluginState !== a.WebRTCPlugin.PLUGIN_STATES.READY;) {} + }, a.WebRTCPlugin.callWhenPluginReady = function (e) { + if (a.WebRTCPlugin.pluginState === a.WebRTCPlugin.PLUGIN_STATES.READY) e();else var t = setInterval(function () { + a.WebRTCPlugin.pluginState === a.WebRTCPlugin.PLUGIN_STATES.READY && (clearInterval(t), e()); + }, 100); + }, a.WebRTCPlugin.setLogLevel = function (e) { + a.WebRTCPlugin.callWhenPluginReady(function () { + a.WebRTCPlugin.plugin.setLogLevel(e); + }); + }, a.WebRTCPlugin.injectPlugin = function () { + if ("complete" === document.readyState && a.WebRTCPlugin.pluginState === a.WebRTCPlugin.PLUGIN_STATES.INITIALIZING) { + if (a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.INJECTING, "IE" === webrtcDetectedBrowser && webrtcDetectedVersion <= 10) { + var e = document.createDocumentFragment();for (a.WebRTCPlugin.plugin = document.createElement("div"), a.WebRTCPlugin.plugin.innerHTML = ' ' + (a.options.getAllCams ? '' : "") + ""; a.WebRTCPlugin.plugin.firstChild;) { + e.appendChild(a.WebRTCPlugin.plugin.firstChild); + }document.body.appendChild(e), a.WebRTCPlugin.plugin = document.getElementById(a.WebRTCPlugin.pluginInfo.pluginId); + } else a.WebRTCPlugin.plugin = document.createElement("object"), a.WebRTCPlugin.plugin.id = a.WebRTCPlugin.pluginInfo.pluginId, isIE ? (a.WebRTCPlugin.plugin.width = "1px", a.WebRTCPlugin.plugin.height = "1px") : (a.WebRTCPlugin.plugin.width = "0px", a.WebRTCPlugin.plugin.height = "0px"), a.WebRTCPlugin.plugin.type = a.WebRTCPlugin.pluginInfo.type, a.WebRTCPlugin.plugin.innerHTML = ' ' + (a.options.getAllCams ? '' : "") + '', document.body.appendChild(a.WebRTCPlugin.plugin);a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.INJECTED; + } + }, a.WebRTCPlugin.isPluginInstalled = function (e, t, n, r, i) { + if (isIE) { + try { + new ActiveXObject(e + "." + t); + } catch (e) { + return void i(); + }r(); + } else { + for (var o = navigator.mimeTypes, a = 0; a < o.length; a++) { + if (o[a].type.indexOf(n) >= 0) return void r(); + }i(); + } + }, a.WebRTCPlugin.defineWebRTCInterface = function () { + if (a.WebRTCPlugin.pluginState === a.WebRTCPlugin.PLUGIN_STATES.READY) return void o.error("AdapterJS - WebRTC interface has already been defined");a.WebRTCPlugin.pluginState = a.WebRTCPlugin.PLUGIN_STATES.INITIALIZING, a.isDefined = function (e) { + return null !== e && void 0 !== e; + }, createIceServer = function createIceServer(e, t, n) { + var r = null, + i = e.split(":");return 0 === i[0].indexOf("stun") ? r = { url: e, hasCredentials: !1 } : 0 === i[0].indexOf("turn") && (r = { url: e, hasCredentials: !0, credential: n, username: t }), r; + }, createIceServers = function createIceServers(e, t, n) { + for (var r = [], i = 0; i < e.length; ++i) { + r.push(createIceServer(e[i], t, n)); + }return r; + }, RTCSessionDescription = function RTCSessionDescription(e) { + return a.WebRTCPlugin.WaitForPluginReady(), a.WebRTCPlugin.plugin.ConstructSessionDescription(e.type, e.sdp); + }, RTCPeerConnection = function RTCPeerConnection(e, t) { + if (void 0 !== e && null !== e && !Array.isArray(e.iceServers)) throw new Error("Failed to construct 'RTCPeerConnection': Malformed RTCConfiguration");if (void 0 !== t && null !== t) { + var n = !1;if (n |= "object" != typeof t, n |= t.hasOwnProperty("mandatory") && void 0 !== t.mandatory && null !== t.mandatory && t.mandatory.constructor !== Object, n |= t.hasOwnProperty("optional") && void 0 !== t.optional && null !== t.optional && !Array.isArray(t.optional)) throw new Error("Failed to construct 'RTCPeerConnection': Malformed constraints object"); + }a.WebRTCPlugin.WaitForPluginReady();var r = null;if (e && Array.isArray(e.iceServers)) { + r = e.iceServers;for (var i = 0; i < r.length; i++) { + r[i].urls && !r[i].url && (r[i].url = r[i].urls), r[i].hasCredentials = a.isDefined(r[i].username) && a.isDefined(r[i].credential); + } + }if (a.WebRTCPlugin.plugin.PEER_CONNECTION_VERSION && a.WebRTCPlugin.plugin.PEER_CONNECTION_VERSION > 1) return r && (e.iceServers = r), a.WebRTCPlugin.plugin.PeerConnection(e);var o = t && t.mandatory ? t.mandatory : null, + s = t && t.optional ? t.optional : null;return a.WebRTCPlugin.plugin.PeerConnection(a.WebRTCPlugin.pageId, r, o, s); + }, MediaStreamTrack = function MediaStreamTrack() {}, MediaStreamTrack.getSources = function (e) { + a.WebRTCPlugin.callWhenPluginReady(function () { + a.WebRTCPlugin.plugin.GetSources(e); + }); + };var e = function e(_e) { + if ("object" != typeof _e || _e.mandatory || _e.optional) return _e;var t = {};return Object.keys(_e).forEach(function (n) { + if ("require" !== n && "advanced" !== n && "mediaSource" !== n) { + var r = "object" == typeof _e[n] ? _e[n] : { ideal: _e[n] };void 0 !== r.exact && "number" == typeof r.exact && (r.min = r.max = r.exact);var i = function i(e, t) { + return e ? e + t.charAt(0).toUpperCase() + t.slice(1) : "deviceId" === t ? "sourceId" : t; + };if (void 0 !== r.ideal) { + t.optional = t.optional || [];var o = {};"number" == typeof r.ideal ? (o[i("min", n)] = r.ideal, t.optional.push(o), o = {}, o[i("max", n)] = r.ideal, t.optional.push(o)) : (o[i("", n)] = r.ideal, t.optional.push(o)); + }void 0 !== r.exact && "number" != typeof r.exact ? (t.mandatory = t.mandatory || {}, t.mandatory[i("", n)] = r.exact) : ["min", "max"].forEach(function (e) { + void 0 !== r[e] && (t.mandatory = t.mandatory || {}, t.mandatory[i(e, n)] = r[e]); + }); + } + }), _e.advanced && (t.optional = (t.optional || []).concat(_e.advanced)), t; + };getUserMedia = function getUserMedia(t, n, r) { + var i = {};i.audio = !!t.audio && e(t.audio), i.video = !!t.video && e(t.video), a.WebRTCPlugin.callWhenPluginReady(function () { + a.WebRTCPlugin.plugin.getUserMedia(i, n, r); + }); + }, window.navigator.getUserMedia = getUserMedia, navigator.mediaDevices || "undefined" == typeof Promise || (requestUserMedia = function requestUserMedia(e) { + return new Promise(function (t, n) { + getUserMedia(e, t, n); + }); + }, navigator.mediaDevices = { getUserMedia: requestUserMedia, enumerateDevices: function enumerateDevices() { + return new Promise(function (e) { + var t = { audio: "audioinput", video: "videoinput" };return MediaStreamTrack.getSources(function (n) { + e(n.map(function (e) { + return { label: e.label, kind: t[e.kind], id: e.id, deviceId: e.id, groupId: "" }; + })); + }); + }); + } }), attachMediaStream = function attachMediaStream(e, t) { + if (e && e.parentNode) { + var n;null === t ? n = "" : (void 0 !== t.enableSoundTracks && t.enableSoundTracks(!0), n = t.id);var r = 0 === e.id.length ? Math.random().toString(36).slice(2) : e.id, + i = e.nodeName.toLowerCase();if ("object" !== i) { + var o;switch (i) {case "audio": + o = a.WebRTCPlugin.TAGS.AUDIO;break;case "video": + o = a.WebRTCPlugin.TAGS.VIDEO;break;default: + o = a.WebRTCPlugin.TAGS.NONE;}var s = document.createDocumentFragment(), + c = document.createElement("div"), + u = "";for (e.className ? u = 'class="' + e.className + '" ' : e.attributes && e.attributes.class && (u = 'class="' + e.attributes.class.value + '" '), c.innerHTML = ' '; c.firstChild;) { + s.appendChild(c.firstChild); + }var l = "", + d = "";e.clientWidth || e.clientHeight ? (d = e.clientWidth, l = e.clientHeight) : (e.width || e.height) && (d = e.width, l = e.height), e.parentNode.insertBefore(s, e), s = document.getElementById(r), s.width = d, s.height = l, e.parentNode.removeChild(e); + } else { + for (var p = e.children, f = 0; f !== p.length; ++f) { + if ("streamId" === p[f].name) { + p[f].value = n;break; + } + }e.setStreamId(n); + }var h = document.getElementById(r);return a.forwardEventHandlers(h, e, Object.getPrototypeOf(e)), h; + } + }, reattachMediaStream = function reattachMediaStream(e, t) { + for (var n = null, r = t.children, i = 0; i !== r.length; ++i) { + if ("streamId" === r[i].name) { + a.WebRTCPlugin.WaitForPluginReady(), n = a.WebRTCPlugin.plugin.getStreamWithId(a.WebRTCPlugin.pageId, r[i].value);break; + } + }if (null !== n) return attachMediaStream(e, n);o.log("Could not find the stream associated with this element"); + }, window.attachMediaStream = attachMediaStream, window.reattachMediaStream = reattachMediaStream, window.getUserMedia = getUserMedia, a.attachMediaStream = attachMediaStream, a.reattachMediaStream = reattachMediaStream, a.getUserMedia = getUserMedia, a.forwardEventHandlers = function (e, t, n) { + properties = Object.getOwnPropertyNames(n);for (var r in properties) { + r && (propName = properties[r], "function" == typeof propName.slice && "on" === propName.slice(0, 2) && "function" == typeof t[propName] && a.addEvent(e, propName.slice(2), t[propName])); + }var i = Object.getPrototypeOf(n);i && a.forwardEventHandlers(e, t, i); + }, RTCIceCandidate = function RTCIceCandidate(e) { + return e.sdpMid || (e.sdpMid = ""), a.WebRTCPlugin.WaitForPluginReady(), a.WebRTCPlugin.plugin.ConstructIceCandidate(e.sdpMid, e.sdpMLineIndex, e.candidate); + }, a.addEvent(document, "readystatechange", a.WebRTCPlugin.injectPlugin), a.WebRTCPlugin.injectPlugin(); + }, a.WebRTCPlugin.pluginNeededButNotInstalledCb = a.WebRTCPlugin.pluginNeededButNotInstalledCb || function () { + a.addEvent(document, "readystatechange", a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv), a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv(); + }, a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv = function () { + if (!a.options.hidePluginInstallPrompt) { + var e = a.WebRTCPlugin.pluginInfo.downloadLink;if (e) { + var t;t = a.WebRTCPlugin.pluginInfo.portalLink ? 'This website requires you to install the ' + a.WebRTCPlugin.pluginInfo.companyName + " WebRTC Plugin to work on this browser." : a.TEXT.PLUGIN.REQUIRE_INSTALLATION, a.renderNotificationBar(t, a.TEXT.PLUGIN.BUTTON, e); + } else a.renderNotificationBar(a.TEXT.PLUGIN.NOT_SUPPORTED); + } + }, a.WebRTCPlugin.isPluginInstalled(a.WebRTCPlugin.pluginInfo.prefix, a.WebRTCPlugin.pluginInfo.plugName, a.WebRTCPlugin.pluginInfo.type, a.WebRTCPlugin.defineWebRTCInterface, a.WebRTCPlugin.pluginNeededButNotInstalledCb)) : (function (t) { + e.exports = function () { + return function e(t, n, i) { + function o(s, c) { + if (!n[s]) { + if (!t[s]) { + var u = "function" == typeof r && r;if (!c && u) return r(s, !0);if (a) return a(s, !0);var l = new Error("Cannot find module '" + s + "'");throw l.code = "MODULE_NOT_FOUND", l; + }var d = n[s] = { exports: {} };t[s][0].call(d.exports, function (e) { + return o(t[s][1][e] || e); + }, d, d.exports, e, t, n, i); + }return n[s].exports; + }for (var a = "function" == typeof r && r, s = 0; s < i.length; s++) { + o(i[s]); + }return o; + }({ 1: [function (e, t, n) { + "use strict"; + var r = {};r.generateIdentifier = function () { + return Math.random().toString(36).substr(2, 10); + }, r.localCName = r.generateIdentifier(), r.splitLines = function (e) { + return e.trim().split("\n").map(function (e) { + return e.trim(); + }); + }, r.splitSections = function (e) { + return e.split("\nm=").map(function (e, t) { + return (t > 0 ? "m=" + e : e).trim() + "\r\n"; + }); + }, r.matchPrefix = function (e, t) { + return r.splitLines(e).filter(function (e) { + return 0 === e.indexOf(t); + }); + }, r.parseCandidate = function (e) { + var t;t = 0 === e.indexOf("a=candidate:") ? e.substring(12).split(" ") : e.substring(10).split(" ");for (var n = { foundation: t[0], component: t[1], protocol: t[2].toLowerCase(), priority: parseInt(t[3], 10), ip: t[4], port: parseInt(t[5], 10), type: t[7] }, r = 8; r < t.length; r += 2) { + switch (t[r]) {case "raddr": + n.relatedAddress = t[r + 1];break;case "rport": + n.relatedPort = parseInt(t[r + 1], 10);break;case "tcptype": + n.tcpType = t[r + 1];} + }return n; + }, r.writeCandidate = function (e) { + var t = [];t.push(e.foundation), t.push(e.component), t.push(e.protocol.toUpperCase()), t.push(e.priority), t.push(e.ip), t.push(e.port);var n = e.type;return t.push("typ"), t.push(n), "host" !== n && e.relatedAddress && e.relatedPort && (t.push("raddr"), t.push(e.relatedAddress), t.push("rport"), t.push(e.relatedPort)), e.tcpType && "tcp" === e.protocol.toLowerCase() && (t.push("tcptype"), t.push(e.tcpType)), "candidate:" + t.join(" "); + }, r.parseRtpMap = function (e) { + var t = e.substr(9).split(" "), + n = { payloadType: parseInt(t.shift(), 10) };return t = t[0].split("/"), n.name = t[0], n.clockRate = parseInt(t[1], 10), n.numChannels = 3 === t.length ? parseInt(t[2], 10) : 1, n; + }, r.writeRtpMap = function (e) { + var t = e.payloadType;return void 0 !== e.preferredPayloadType && (t = e.preferredPayloadType), "a=rtpmap:" + t + " " + e.name + "/" + e.clockRate + (1 !== e.numChannels ? "/" + e.numChannels : "") + "\r\n"; + }, r.parseExtmap = function (e) { + var t = e.substr(9).split(" ");return { id: parseInt(t[0], 10), uri: t[1] }; + }, r.writeExtmap = function (e) { + return "a=extmap:" + (e.id || e.preferredId) + " " + e.uri + "\r\n"; + }, r.parseFmtp = function (e) { + for (var t, n = {}, r = e.substr(e.indexOf(" ") + 1).split(";"), i = 0; i < r.length; i++) { + t = r[i].trim().split("="), n[t[0].trim()] = t[1]; + }return n; + }, r.writeFmtp = function (e) { + var t = "", + n = e.payloadType;if (void 0 !== e.preferredPayloadType && (n = e.preferredPayloadType), e.parameters && Object.keys(e.parameters).length) { + var r = [];Object.keys(e.parameters).forEach(function (t) { + r.push(t + "=" + e.parameters[t]); + }), t += "a=fmtp:" + n + " " + r.join(";") + "\r\n"; + }return t; + }, r.parseRtcpFb = function (e) { + var t = e.substr(e.indexOf(" ") + 1).split(" ");return { type: t.shift(), parameter: t.join(" ") }; + }, r.writeRtcpFb = function (e) { + var t = "", + n = e.payloadType;return void 0 !== e.preferredPayloadType && (n = e.preferredPayloadType), e.rtcpFeedback && e.rtcpFeedback.length && e.rtcpFeedback.forEach(function (e) { + t += "a=rtcp-fb:" + n + " " + e.type + (e.parameter && e.parameter.length ? " " + e.parameter : "") + "\r\n"; + }), t; + }, r.parseSsrcMedia = function (e) { + var t = e.indexOf(" "), + n = { ssrc: parseInt(e.substr(7, t - 7), 10) }, + r = e.indexOf(":", t);return r > -1 ? (n.attribute = e.substr(t + 1, r - t - 1), n.value = e.substr(r + 1)) : n.attribute = e.substr(t + 1), n; + }, r.getDtlsParameters = function (e, t) { + var n = r.splitLines(e);n = n.concat(r.splitLines(t));var i = n.filter(function (e) { + return 0 === e.indexOf("a=fingerprint:"); + })[0].substr(14);return { role: "auto", fingerprints: [{ algorithm: i.split(" ")[0], value: i.split(" ")[1] }] }; + }, r.writeDtlsParameters = function (e, t) { + var n = "a=setup:" + t + "\r\n";return e.fingerprints.forEach(function (e) { + n += "a=fingerprint:" + e.algorithm + " " + e.value + "\r\n"; + }), n; + }, r.getIceParameters = function (e, t) { + var n = r.splitLines(e);return n = n.concat(r.splitLines(t)), { usernameFragment: n.filter(function (e) { + return 0 === e.indexOf("a=ice-ufrag:"); + })[0].substr(12), password: n.filter(function (e) { + return 0 === e.indexOf("a=ice-pwd:"); + })[0].substr(10) }; + }, r.writeIceParameters = function (e) { + return "a=ice-ufrag:" + e.usernameFragment + "\r\na=ice-pwd:" + e.password + "\r\n"; + }, r.parseRtpParameters = function (e) { + for (var t = { codecs: [], headerExtensions: [], fecMechanisms: [], rtcp: [] }, n = r.splitLines(e), i = n[0].split(" "), o = 3; o < i.length; o++) { + var a = i[o], + s = r.matchPrefix(e, "a=rtpmap:" + a + " ")[0];if (s) { + var c = r.parseRtpMap(s), + u = r.matchPrefix(e, "a=fmtp:" + a + " ");switch (c.parameters = u.length ? r.parseFmtp(u[0]) : {}, c.rtcpFeedback = r.matchPrefix(e, "a=rtcp-fb:" + a + " ").map(r.parseRtcpFb), t.codecs.push(c), c.name.toUpperCase()) {case "RED":case "ULPFEC": + t.fecMechanisms.push(c.name.toUpperCase());} + } + }return r.matchPrefix(e, "a=extmap:").forEach(function (e) { + t.headerExtensions.push(r.parseExtmap(e)); + }), t; + }, r.writeRtpDescription = function (e, t) { + var n = "";return n += "m=" + e + " ", n += t.codecs.length > 0 ? "9" : "0", n += " UDP/TLS/RTP/SAVPF ", n += t.codecs.map(function (e) { + return void 0 !== e.preferredPayloadType ? e.preferredPayloadType : e.payloadType; + }).join(" ") + "\r\n", n += "c=IN IP4 0.0.0.0\r\n", n += "a=rtcp:9 IN IP4 0.0.0.0\r\n", t.codecs.forEach(function (e) { + n += r.writeRtpMap(e), n += r.writeFmtp(e), n += r.writeRtcpFb(e); + }), n += "a=rtcp-mux\r\n"; + }, r.parseRtpEncodingParameters = function (e) { + var t, + n = [], + i = r.parseRtpParameters(e), + o = -1 !== i.fecMechanisms.indexOf("RED"), + a = -1 !== i.fecMechanisms.indexOf("ULPFEC"), + s = r.matchPrefix(e, "a=ssrc:").map(function (e) { + return r.parseSsrcMedia(e); + }).filter(function (e) { + return "cname" === e.attribute; + }), + c = s.length > 0 && s[0].ssrc, + u = r.matchPrefix(e, "a=ssrc-group:FID").map(function (e) { + var t = e.split(" ");return t.shift(), t.map(function (e) { + return parseInt(e, 10); + }); + });u.length > 0 && u[0].length > 1 && u[0][0] === c && (t = u[0][1]), i.codecs.forEach(function (e) { + if ("RTX" === e.name.toUpperCase() && e.parameters.apt) { + var r = { ssrc: c, codecPayloadType: parseInt(e.parameters.apt, 10), rtx: { payloadType: e.payloadType, ssrc: t } };n.push(r), o && (r = JSON.parse(JSON.stringify(r)), r.fec = { ssrc: t, mechanism: a ? "red+ulpfec" : "red" }, n.push(r)); + } + }), 0 === n.length && c && n.push({ ssrc: c });var l = r.matchPrefix(e, "b=");return l.length && (0 === l[0].indexOf("b=TIAS:") ? l = parseInt(l[0].substr(7), 10) : 0 === l[0].indexOf("b=AS:") && (l = parseInt(l[0].substr(5), 10)), n.forEach(function (e) { + e.maxBitrate = l; + })), n; + }, r.writeSessionBoilerplate = function () { + return "v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"; + }, r.writeMediaSection = function (e, t, n, i) { + var o = r.writeRtpDescription(e.kind, t);if (o += r.writeIceParameters(e.iceGatherer.getLocalParameters()), o += r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(), "offer" === n ? "actpass" : "active"), o += "a=mid:" + e.mid + "\r\n", e.rtpSender && e.rtpReceiver ? o += "a=sendrecv\r\n" : e.rtpSender ? o += "a=sendonly\r\n" : e.rtpReceiver ? o += "a=recvonly\r\n" : o += "a=inactive\r\n", e.rtpSender) { + var a = "msid:" + i.id + " " + e.rtpSender.track.id + "\r\n";o += "a=" + a, o += "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " " + a; + }return o += "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " cname:" + r.localCName + "\r\n"; + }, r.getDirection = function (e, t) { + for (var n = r.splitLines(e), i = 0; i < n.length; i++) { + switch (n[i]) {case "a=sendrecv":case "a=sendonly":case "a=recvonly":case "a=inactive": + return n[i].substr(2);} + }return t ? r.getDirection(t) : "sendrecv"; + }, t.exports = r; + }, {}], 2: [function (e, t, n) { + "use strict"; + !function () { + var n = e("./utils").log, + r = e("./utils").browserDetails;t.exports.browserDetails = r, t.exports.extractVersion = e("./utils").extractVersion, t.exports.disableLog = e("./utils").disableLog;var i = e("./chrome/chrome_shim") || null, + o = e("./edge/edge_shim") || null, + a = e("./firefox/firefox_shim") || null, + s = e("./safari/safari_shim") || null;switch (r.browser) {case "opera":case "chrome": + if (!i || !i.shimPeerConnection) return void n("Chrome shim is not included in this adapter release.");n("adapter.js shimming chrome."), t.exports.browserShim = i, i.shimGetUserMedia(), i.shimMediaStream(), i.shimSourceObject(), i.shimPeerConnection(), i.shimOnTrack();break;case "firefox": + if (!a || !a.shimPeerConnection) return void n("Firefox shim is not included in this adapter release.");n("adapter.js shimming firefox."), t.exports.browserShim = a, a.shimGetUserMedia(), a.shimSourceObject(), a.shimPeerConnection(), a.shimOnTrack();break;case "edge": + if (!o || !o.shimPeerConnection) return void n("MS edge shim is not included in this adapter release.");n("adapter.js shimming edge."), t.exports.browserShim = o, o.shimGetUserMedia(), o.shimPeerConnection();break;case "safari": + if (!s) return void n("Safari shim is not included in this adapter release.");n("adapter.js shimming safari."), t.exports.browserShim = s, s.shimGetUserMedia();break;default: + n("Unsupported browser!");} + }(); + }, { "./chrome/chrome_shim": 3, "./edge/edge_shim": 5, "./firefox/firefox_shim": 7, "./safari/safari_shim": 9, "./utils": 10 }], 3: [function (e, t, n) { + "use strict"; + var r = e("../utils.js").log, + i = e("../utils.js").browserDetails, + o = { shimMediaStream: function shimMediaStream() { + window.MediaStream = window.MediaStream || window.webkitMediaStream; + }, shimOnTrack: function shimOnTrack() { + "object" != typeof window || !window.RTCPeerConnection || "ontrack" in window.RTCPeerConnection.prototype || Object.defineProperty(window.RTCPeerConnection.prototype, "ontrack", { get: function get() { + return this._ontrack; + }, set: function set(e) { + var t = this;this._ontrack && (this.removeEventListener("track", this._ontrack), this.removeEventListener("addstream", this._ontrackpoly)), this.addEventListener("track", this._ontrack = e), this.addEventListener("addstream", this._ontrackpoly = function (e) { + e.stream.addEventListener("addtrack", function (n) { + var r = new Event("track");r.track = n.track, r.receiver = { track: n.track }, r.streams = [e.stream], t.dispatchEvent(r); + }), e.stream.getTracks().forEach(function (t) { + var n = new Event("track");n.track = t, n.receiver = { track: t }, n.streams = [e.stream], this.dispatchEvent(n); + }.bind(this)); + }.bind(this)); + } }); + }, shimSourceObject: function shimSourceObject() { + "object" == typeof window && (!window.HTMLMediaElement || "srcObject" in window.HTMLMediaElement.prototype || Object.defineProperty(window.HTMLMediaElement.prototype, "srcObject", { get: function get() { + return this._srcObject; + }, set: function set(e) { + var t = this;if (this._srcObject = e, this.src && URL.revokeObjectURL(this.src), !e) return void (this.src = "");this.src = URL.createObjectURL(e), e.addEventListener("addtrack", function () { + t.src && URL.revokeObjectURL(t.src), t.src = URL.createObjectURL(e); + }), e.addEventListener("removetrack", function () { + t.src && URL.revokeObjectURL(t.src), t.src = URL.createObjectURL(e); + }); + } })); + }, shimPeerConnection: function shimPeerConnection() { + window.RTCPeerConnection = function (e, t) { + r("PeerConnection"), e && e.iceTransportPolicy && (e.iceTransports = e.iceTransportPolicy);var n = new webkitRTCPeerConnection(e, t), + i = n.getStats.bind(n);return n.getStats = function (e, t, n) { + var r = this, + o = arguments;if (arguments.length > 0 && "function" == typeof e) return i(e, t);var a = function a(e) { + var t = {};return e.result().forEach(function (e) { + var n = { id: e.id, timestamp: e.timestamp, type: e.type };e.names().forEach(function (t) { + n[t] = e.stat(t); + }), t[n.id] = n; + }), t; + }, + s = function s(e, t) { + var n = new Map(Object.keys(e).map(function (t) { + return [t, e[t]]; + }));return t = t || e, Object.keys(t).forEach(function (e) { + n[e] = t[e]; + }), n; + };if (arguments.length >= 2) { + var c = function c(e) { + o[1](s(a(e))); + };return i.apply(this, [c, arguments[0]]); + }return new Promise(function (t, n) { + 1 === o.length && "object" == typeof e ? i.apply(r, [function (e) { + t(s(a(e))); + }, n]) : i.apply(r, [function (e) { + t(s(a(e), e.result())); + }, n]); + }).then(t, n); + }, n; + }, window.RTCPeerConnection.prototype = webkitRTCPeerConnection.prototype, webkitRTCPeerConnection.generateCertificate && Object.defineProperty(window.RTCPeerConnection, "generateCertificate", { get: function get() { + return webkitRTCPeerConnection.generateCertificate; + } }), ["createOffer", "createAnswer"].forEach(function (e) { + var t = webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e] = function () { + var e = this;if (arguments.length < 1 || 1 === arguments.length && "object" == typeof arguments[0]) { + var n = 1 === arguments.length ? arguments[0] : void 0;return new Promise(function (r, i) { + t.apply(e, [r, i, n]); + }); + }return t.apply(this, arguments); + }; + }), i.version < 51 && ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function (e) { + var t = webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e] = function () { + var e = arguments, + n = this, + r = new Promise(function (r, i) { + t.apply(n, [e[0], r, i]); + });return e.length < 2 ? r : r.then(function () { + e[1].apply(null, []); + }, function (t) { + e.length >= 3 && e[2].apply(null, [t]); + }); + }; + }), ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function (e) { + var t = webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e] = function () { + return arguments[0] = new ("addIceCandidate" === e ? RTCIceCandidate : RTCSessionDescription)(arguments[0]), t.apply(this, arguments); + }; + });var e = RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate = function () { + return null === arguments[0] ? Promise.resolve() : e.apply(this, arguments); + }; + } };t.exports = { shimMediaStream: o.shimMediaStream, shimOnTrack: o.shimOnTrack, shimSourceObject: o.shimSourceObject, shimPeerConnection: o.shimPeerConnection, shimGetUserMedia: e("./getusermedia") }; + }, { "../utils.js": 10, "./getusermedia": 4 }], 4: [function (e, t, n) { + "use strict"; + var r = e("../utils.js").log;t.exports = function () { + var e = function e(_e2) { + if ("object" != typeof _e2 || _e2.mandatory || _e2.optional) return _e2;var t = {};return Object.keys(_e2).forEach(function (n) { + if ("require" !== n && "advanced" !== n && "mediaSource" !== n) { + var r = "object" == typeof _e2[n] ? _e2[n] : { ideal: _e2[n] };void 0 !== r.exact && "number" == typeof r.exact && (r.min = r.max = r.exact);var i = function i(e, t) { + return e ? e + t.charAt(0).toUpperCase() + t.slice(1) : "deviceId" === t ? "sourceId" : t; + };if (void 0 !== r.ideal) { + t.optional = t.optional || [];var o = {};"number" == typeof r.ideal ? (o[i("min", n)] = r.ideal, t.optional.push(o), o = {}, o[i("max", n)] = r.ideal, t.optional.push(o)) : (o[i("", n)] = r.ideal, t.optional.push(o)); + }void 0 !== r.exact && "number" != typeof r.exact ? (t.mandatory = t.mandatory || {}, t.mandatory[i("", n)] = r.exact) : ["min", "max"].forEach(function (e) { + void 0 !== r[e] && (t.mandatory = t.mandatory || {}, t.mandatory[i(e, n)] = r[e]); + }); + } + }), _e2.advanced && (t.optional = (t.optional || []).concat(_e2.advanced)), t; + }, + t = function t(_t, n) { + if (_t = JSON.parse(JSON.stringify(_t)), _t && _t.audio && (_t.audio = e(_t.audio)), _t && "object" == typeof _t.video) { + var i = _t.video.facingMode;if ((i = i && ("object" == typeof i ? i : { ideal: i })) && ("user" === i.exact || "environment" === i.exact || "user" === i.ideal || "environment" === i.ideal) && (!navigator.mediaDevices.getSupportedConstraints || !navigator.mediaDevices.getSupportedConstraints().facingMode) && (delete _t.video.facingMode, "environment" === i.exact || "environment" === i.ideal)) return navigator.mediaDevices.enumerateDevices().then(function (o) { + o = o.filter(function (e) { + return "videoinput" === e.kind; + });var a = o.find(function (e) { + return -1 !== e.label.toLowerCase().indexOf("back"); + }) || o.length && o[o.length - 1];return a && (_t.video.deviceId = i.exact ? { exact: a.deviceId } : { ideal: a.deviceId }), _t.video = e(_t.video), r("chrome: " + JSON.stringify(_t)), n(_t); + });_t.video = e(_t.video); + }return r("chrome: " + JSON.stringify(_t)), n(_t); + }, + n = function n(e) { + return { name: { PermissionDeniedError: "NotAllowedError", ConstraintNotSatisfiedError: "OverconstrainedError" }[e.name] || e.name, message: e.message, constraint: e.constraintName, toString: function toString() { + return this.name + (this.message && ": ") + this.message; + } }; + }, + i = function (_i) { + function i(_x, _x2, _x3) { + return _i.apply(this, arguments); + } + + i.toString = function () { + return _i.toString(); + }; + + return i; + }(function (e, r, i) { + t(e, function (e) { + navigator.webkitGetUserMedia(e, r, function (e) { + i(n(e)); + }); + }); + });navigator.getUserMedia = i;var o = function o(e) { + return new Promise(function (t, n) { + navigator.getUserMedia(e, t, n); + }); + };if (navigator.mediaDevices || (navigator.mediaDevices = { getUserMedia: o, enumerateDevices: function enumerateDevices() { + return new Promise(function (e) { + var t = { audio: "audioinput", video: "videoinput" };return MediaStreamTrack.getSources(function (n) { + e(n.map(function (e) { + return { label: e.label, kind: t[e.kind], deviceId: e.id, groupId: "" }; + })); + }); + }); + } }), navigator.mediaDevices.getUserMedia) { + var a = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia = function (e) { + return t(e, function (e) { + return a(e).catch(function (e) { + return Promise.reject(n(e)); + }); + }); + }; + } else navigator.mediaDevices.getUserMedia = function (e) { + return o(e); + };void 0 === navigator.mediaDevices.addEventListener && (navigator.mediaDevices.addEventListener = function () { + r("Dummy mediaDevices.addEventListener called."); + }), void 0 === navigator.mediaDevices.removeEventListener && (navigator.mediaDevices.removeEventListener = function () { + r("Dummy mediaDevices.removeEventListener called."); + }); + }; + }, { "../utils.js": 10 }], 5: [function (e, t, n) { + "use strict"; + var r = e("sdp"), + i = e("../utils").browserDetails, + o = { shimPeerConnection: function shimPeerConnection() { + window.RTCIceGatherer && (window.RTCIceCandidate || (window.RTCIceCandidate = function (e) { + return e; + }), window.RTCSessionDescription || (window.RTCSessionDescription = function (e) { + return e; + })), window.RTCPeerConnection = function (e) { + var t = this, + n = document.createDocumentFragment();if (["addEventListener", "removeEventListener", "dispatchEvent"].forEach(function (e) { + t[e] = n[e].bind(n); + }), this.onicecandidate = null, this.onaddstream = null, this.ontrack = null, this.onremovestream = null, this.onsignalingstatechange = null, this.oniceconnectionstatechange = null, this.onnegotiationneeded = null, this.ondatachannel = null, this.localStreams = [], this.remoteStreams = [], this.getLocalStreams = function () { + return t.localStreams; + }, this.getRemoteStreams = function () { + return t.remoteStreams; + }, this.localDescription = new RTCSessionDescription({ type: "", sdp: "" }), this.remoteDescription = new RTCSessionDescription({ type: "", sdp: "" }), this.signalingState = "stable", this.iceConnectionState = "new", this.iceGatheringState = "new", this.iceOptions = { gatherPolicy: "all", iceServers: [] }, e && e.iceTransportPolicy) switch (e.iceTransportPolicy) {case "all":case "relay": + this.iceOptions.gatherPolicy = e.iceTransportPolicy;break;case "none": + throw new TypeError('iceTransportPolicy "none" not supported');}if (this.usingBundle = e && "max-bundle" === e.bundlePolicy, e && e.iceServers) { + var r = JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers = r.filter(function (e) { + if (e && e.urls) { + var t = e.urls;return "string" == typeof t && (t = [t]), !!(t = t.filter(function (e) { + return 0 === e.indexOf("turn:") && -1 !== e.indexOf("transport=udp") && -1 === e.indexOf("turn:[") || 0 === e.indexOf("stun:") && i.version >= 14393; + })[0]); + }return !1; + }); + }this.transceivers = [], this._localIceCandidatesBuffer = []; + }, window.RTCPeerConnection.prototype._emitBufferedCandidates = function () { + var e = this, + t = r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function (n) { + if (n.candidate && 0 !== Object.keys(n.candidate).length) -1 === n.candidate.candidate.indexOf("typ endOfCandidates") && (t[n.candidate.sdpMLineIndex + 1] += "a=" + n.candidate.candidate + "\r\n");else for (var r = 1; r < t.length; r++) { + -1 === t[r].indexOf("\r\na=end-of-candidates\r\n") && (t[r] += "a=end-of-candidates\r\n"); + }e.localDescription.sdp = t.join(""), e.dispatchEvent(n), null !== e.onicecandidate && e.onicecandidate(n), n.candidate || "complete" === e.iceGatheringState || e.transceivers.every(function (e) { + return e.iceGatherer && "completed" === e.iceGatherer.state; + }) && (e.iceGatheringState = "complete"); + }), this._localIceCandidatesBuffer = []; + }, window.RTCPeerConnection.prototype.addStream = function (e) { + this.localStreams.push(e.clone()), this._maybeFireNegotiationNeeded(); + }, window.RTCPeerConnection.prototype.removeStream = function (e) { + var t = this.localStreams.indexOf(e);t > -1 && (this.localStreams.splice(t, 1), this._maybeFireNegotiationNeeded()); + }, window.RTCPeerConnection.prototype.getSenders = function () { + return this.transceivers.filter(function (e) { + return !!e.rtpSender; + }).map(function (e) { + return e.rtpSender; + }); + }, window.RTCPeerConnection.prototype.getReceivers = function () { + return this.transceivers.filter(function (e) { + return !!e.rtpReceiver; + }).map(function (e) { + return e.rtpReceiver; + }); + }, window.RTCPeerConnection.prototype._getCommonCapabilities = function (e, t) { + var n = { codecs: [], headerExtensions: [], fecMechanisms: [] };return e.codecs.forEach(function (e) { + for (var r = 0; r < t.codecs.length; r++) { + var i = t.codecs[r];if (e.name.toLowerCase() === i.name.toLowerCase() && e.clockRate === i.clockRate && e.numChannels === i.numChannels) { + n.codecs.push(i), i.rtcpFeedback = i.rtcpFeedback.filter(function (t) { + for (var n = 0; n < e.rtcpFeedback.length; n++) { + if (e.rtcpFeedback[n].type === t.type && e.rtcpFeedback[n].parameter === t.parameter) return !0; + }return !1; + });break; + } + } + }), e.headerExtensions.forEach(function (e) { + for (var r = 0; r < t.headerExtensions.length; r++) { + var i = t.headerExtensions[r];if (e.uri === i.uri) { + n.headerExtensions.push(i);break; + } + } + }), n; + }, window.RTCPeerConnection.prototype._createIceAndDtlsTransports = function (e, t) { + var n = this, + i = new RTCIceGatherer(n.iceOptions), + o = new RTCIceTransport(i);i.onlocalcandidate = function (a) { + var s = new Event("icecandidate");s.candidate = { sdpMid: e, sdpMLineIndex: t };var c = a.candidate, + u = !c || 0 === Object.keys(c).length;u ? (void 0 === i.state && (i.state = "completed"), s.candidate.candidate = "candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates") : (c.component = "RTCP" === o.component ? 2 : 1, s.candidate.candidate = r.writeCandidate(c));var l = r.splitSections(n.localDescription.sdp);-1 === s.candidate.candidate.indexOf("typ endOfCandidates") ? l[s.candidate.sdpMLineIndex + 1] += "a=" + s.candidate.candidate + "\r\n" : l[s.candidate.sdpMLineIndex + 1] += "a=end-of-candidates\r\n", n.localDescription.sdp = l.join("");var d = n.transceivers.every(function (e) { + return e.iceGatherer && "completed" === e.iceGatherer.state; + });switch (n.iceGatheringState) {case "new": + n._localIceCandidatesBuffer.push(s), u && d && n._localIceCandidatesBuffer.push(new Event("icecandidate"));break;case "gathering": + n._emitBufferedCandidates(), n.dispatchEvent(s), null !== n.onicecandidate && n.onicecandidate(s), d && (n.dispatchEvent(new Event("icecandidate")), null !== n.onicecandidate && n.onicecandidate(new Event("icecandidate")), n.iceGatheringState = "complete");} + }, o.onicestatechange = function () { + n._updateConnectionState(); + };var a = new RTCDtlsTransport(o);return a.ondtlsstatechange = function () { + n._updateConnectionState(); + }, a.onerror = function () { + a.state = "failed", n._updateConnectionState(); + }, { iceGatherer: i, iceTransport: o, dtlsTransport: a }; + }, window.RTCPeerConnection.prototype._transceive = function (e, t, n) { + var i = this._getCommonCapabilities(e.localCapabilities, e.remoteCapabilities);t && e.rtpSender && (i.encodings = e.sendEncodingParameters, i.rtcp = { cname: r.localCName }, e.recvEncodingParameters.length && (i.rtcp.ssrc = e.recvEncodingParameters[0].ssrc), e.rtpSender.send(i)), n && e.rtpReceiver && (i.encodings = e.recvEncodingParameters, i.rtcp = { cname: e.cname }, e.sendEncodingParameters.length && (i.rtcp.ssrc = e.sendEncodingParameters[0].ssrc), e.rtpReceiver.receive(i)); + }, window.RTCPeerConnection.prototype.setLocalDescription = function (e) { + var t, + n, + i = this;if ("offer" === e.type) this._pendingOffer && (t = r.splitSections(e.sdp), n = t.shift(), t.forEach(function (e, t) { + var n = r.parseRtpParameters(e);i._pendingOffer[t].localCapabilities = n; + }), this.transceivers = this._pendingOffer, delete this._pendingOffer);else if ("answer" === e.type) { + t = r.splitSections(i.remoteDescription.sdp), n = t.shift();var o = r.matchPrefix(n, "a=ice-lite").length > 0;t.forEach(function (e, t) { + var a = i.transceivers[t], + s = a.iceGatherer, + c = a.iceTransport, + u = a.dtlsTransport, + l = a.localCapabilities, + d = a.remoteCapabilities;if ("0" !== e.split("\n", 1)[0].split(" ", 2)[1] && !a.isDatachannel) { + var p = r.getIceParameters(e, n);if (o) { + var f = r.matchPrefix(e, "a=candidate:").map(function (e) { + return r.parseCandidate(e); + }).filter(function (e) { + return "1" === e.component; + });f.length && c.setRemoteCandidates(f); + }var h = r.getDtlsParameters(e, n);o && (h.role = "server"), i.usingBundle && 0 !== t || (c.start(s, p, o ? "controlling" : "controlled"), u.start(h));var m = i._getCommonCapabilities(l, d);i._transceive(a, m.codecs.length > 0, !1); + } + }); + }switch (this.localDescription = { type: e.type, sdp: e.sdp }, e.type) {case "offer": + this._updateSignalingState("have-local-offer");break;case "answer": + this._updateSignalingState("stable");break;default: + throw new TypeError('unsupported type "' + e.type + '"');}var a = arguments.length > 1 && "function" == typeof arguments[1];if (a) { + var s = arguments[1];window.setTimeout(function () { + s(), "new" === i.iceGatheringState && (i.iceGatheringState = "gathering"), i._emitBufferedCandidates(); + }, 0); + }var c = Promise.resolve();return c.then(function () { + a || ("new" === i.iceGatheringState && (i.iceGatheringState = "gathering"), window.setTimeout(i._emitBufferedCandidates.bind(i), 500)); + }), c; + }, window.RTCPeerConnection.prototype.setRemoteDescription = function (e) { + var t = this, + n = new MediaStream(), + i = [], + o = r.splitSections(e.sdp), + a = o.shift(), + s = r.matchPrefix(a, "a=ice-lite").length > 0;switch (this.usingBundle = r.matchPrefix(a, "a=group:BUNDLE ").length > 0, o.forEach(function (o, c) { + var u = r.splitLines(o), + l = u[0].substr(2).split(" "), + d = l[0], + p = "0" === l[1], + f = r.getDirection(o, a), + h = r.matchPrefix(o, "a=mid:");if (h = h.length ? h[0].substr(6) : r.generateIdentifier(), "application" === d && "DTLS/SCTP" === l[2]) return void (t.transceivers[c] = { mid: h, isDatachannel: !0 });var m, + v, + g, + y, + b, + S, + E, + T, + _, + C, + w, + R, + k = r.parseRtpParameters(o);p || (w = r.getIceParameters(o, a), R = r.getDtlsParameters(o, a), R.role = "client"), T = r.parseRtpEncodingParameters(o);var A, + I = r.matchPrefix(o, "a=ssrc:").map(function (e) { + return r.parseSsrcMedia(e); + }).filter(function (e) { + return "cname" === e.attribute; + })[0];I && (A = I.value);var P = r.matchPrefix(o, "a=end-of-candidates", a).length > 0, + O = r.matchPrefix(o, "a=candidate:").map(function (e) { + return r.parseCandidate(e); + }).filter(function (e) { + return "1" === e.component; + });if ("offer" !== e.type || p) "answer" !== e.type || p || (m = t.transceivers[c], v = m.iceGatherer, g = m.iceTransport, y = m.dtlsTransport, b = m.rtpSender, S = m.rtpReceiver, E = m.sendEncodingParameters, _ = m.localCapabilities, t.transceivers[c].recvEncodingParameters = T, t.transceivers[c].remoteCapabilities = k, t.transceivers[c].cname = A, (s || P) && O.length && g.setRemoteCandidates(O), t.usingBundle && 0 !== c || (g.start(v, w, "controlling"), y.start(R)), t._transceive(m, "sendrecv" === f || "recvonly" === f, "sendrecv" === f || "sendonly" === f), !S || "sendrecv" !== f && "sendonly" !== f ? delete m.rtpReceiver : (C = S.track, i.push([C, S]), n.addTrack(C)));else { + var D = t.usingBundle && c > 0 ? { iceGatherer: t.transceivers[0].iceGatherer, iceTransport: t.transceivers[0].iceTransport, dtlsTransport: t.transceivers[0].dtlsTransport } : t._createIceAndDtlsTransports(h, c);if (P && D.iceTransport.setRemoteCandidates(O), _ = RTCRtpReceiver.getCapabilities(d), E = [{ ssrc: 1001 * (2 * c + 2) }], S = new RTCRtpReceiver(D.dtlsTransport, d), C = S.track, i.push([C, S]), n.addTrack(C), t.localStreams.length > 0 && t.localStreams[0].getTracks().length >= c) { + var L;"audio" === d ? L = t.localStreams[0].getAudioTracks()[0] : "video" === d && (L = t.localStreams[0].getVideoTracks()[0]), L && (b = new RTCRtpSender(L, D.dtlsTransport)); + }t.transceivers[c] = { iceGatherer: D.iceGatherer, iceTransport: D.iceTransport, dtlsTransport: D.dtlsTransport, localCapabilities: _, remoteCapabilities: k, rtpSender: b, rtpReceiver: S, kind: d, mid: h, cname: A, sendEncodingParameters: E, recvEncodingParameters: T }, t._transceive(t.transceivers[c], !1, "sendrecv" === f || "sendonly" === f); + } + }), this.remoteDescription = { type: e.type, sdp: e.sdp }, e.type) {case "offer": + this._updateSignalingState("have-remote-offer");break;case "answer": + this._updateSignalingState("stable");break;default: + throw new TypeError('unsupported type "' + e.type + '"');}return n.getTracks().length && (t.remoteStreams.push(n), window.setTimeout(function () { + var e = new Event("addstream");e.stream = n, t.dispatchEvent(e), null !== t.onaddstream && window.setTimeout(function () { + t.onaddstream(e); + }, 0), i.forEach(function (r) { + var i = r[0], + o = r[1], + a = new Event("track");a.track = i, a.receiver = o, a.streams = [n], t.dispatchEvent(e), null !== t.ontrack && window.setTimeout(function () { + t.ontrack(a); + }, 0); + }); + }, 0)), arguments.length > 1 && "function" == typeof arguments[1] && window.setTimeout(arguments[1], 0), Promise.resolve(); + }, window.RTCPeerConnection.prototype.close = function () { + this.transceivers.forEach(function (e) { + e.iceTransport && e.iceTransport.stop(), e.dtlsTransport && e.dtlsTransport.stop(), e.rtpSender && e.rtpSender.stop(), e.rtpReceiver && e.rtpReceiver.stop(); + }), this._updateSignalingState("closed"); + }, window.RTCPeerConnection.prototype._updateSignalingState = function (e) { + this.signalingState = e;var t = new Event("signalingstatechange");this.dispatchEvent(t), null !== this.onsignalingstatechange && this.onsignalingstatechange(t); + }, window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function () { + var e = new Event("negotiationneeded");this.dispatchEvent(e), null !== this.onnegotiationneeded && this.onnegotiationneeded(e); + }, window.RTCPeerConnection.prototype._updateConnectionState = function () { + var e, + t = this, + n = { new: 0, closed: 0, connecting: 0, checking: 0, connected: 0, completed: 0, failed: 0 };if (this.transceivers.forEach(function (e) { + n[e.iceTransport.state]++, n[e.dtlsTransport.state]++; + }), n.connected += n.completed, e = "new", n.failed > 0 ? e = "failed" : n.connecting > 0 || n.checking > 0 ? e = "connecting" : n.disconnected > 0 ? e = "disconnected" : n.new > 0 ? e = "new" : (n.connected > 0 || n.completed > 0) && (e = "connected"), e !== t.iceConnectionState) { + t.iceConnectionState = e;var r = new Event("iceconnectionstatechange");this.dispatchEvent(r), null !== this.oniceconnectionstatechange && this.oniceconnectionstatechange(r); + } + }, window.RTCPeerConnection.prototype.createOffer = function () { + var e = this;if (this._pendingOffer) throw new Error("createOffer called while there is a pending offer.");var t;1 === arguments.length && "function" != typeof arguments[0] ? t = arguments[0] : 3 === arguments.length && (t = arguments[2]);var n = [], + i = 0, + o = 0;if (this.localStreams.length && (i = this.localStreams[0].getAudioTracks().length, o = this.localStreams[0].getVideoTracks().length), t) { + if (t.mandatory || t.optional) throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0 !== t.offerToReceiveAudio && (i = t.offerToReceiveAudio), void 0 !== t.offerToReceiveVideo && (o = t.offerToReceiveVideo); + }for (this.localStreams.length && this.localStreams[0].getTracks().forEach(function (e) { + n.push({ kind: e.kind, track: e, wantReceive: "audio" === e.kind ? i > 0 : o > 0 }), "audio" === e.kind ? i-- : "video" === e.kind && o--; + }); i > 0 || o > 0;) { + i > 0 && (n.push({ kind: "audio", wantReceive: !0 }), i--), o > 0 && (n.push({ kind: "video", wantReceive: !0 }), o--); + }var a = r.writeSessionBoilerplate(), + s = [];n.forEach(function (t, n) { + var i, + o, + a = t.track, + c = t.kind, + u = r.generateIdentifier(), + l = e.usingBundle && n > 0 ? { iceGatherer: s[0].iceGatherer, iceTransport: s[0].iceTransport, dtlsTransport: s[0].dtlsTransport } : e._createIceAndDtlsTransports(u, n), + d = RTCRtpSender.getCapabilities(c), + p = [{ ssrc: 1001 * (2 * n + 1) }];a && (i = new RTCRtpSender(a, l.dtlsTransport)), t.wantReceive && (o = new RTCRtpReceiver(l.dtlsTransport, c)), s[n] = { iceGatherer: l.iceGatherer, iceTransport: l.iceTransport, dtlsTransport: l.dtlsTransport, localCapabilities: d, remoteCapabilities: null, rtpSender: i, rtpReceiver: o, kind: c, mid: u, sendEncodingParameters: p, recvEncodingParameters: null }; + }), this.usingBundle && (a += "a=group:BUNDLE " + s.map(function (e) { + return e.mid; + }).join(" ") + "\r\n"), n.forEach(function (t, n) { + var i = s[n];a += r.writeMediaSection(i, i.localCapabilities, "offer", e.localStreams[0]); + }), this._pendingOffer = s;var c = new RTCSessionDescription({ type: "offer", sdp: a });return arguments.length && "function" == typeof arguments[0] && window.setTimeout(arguments[0], 0, c), Promise.resolve(c); + }, window.RTCPeerConnection.prototype.createAnswer = function () { + var e = this, + t = r.writeSessionBoilerplate();this.usingBundle && (t += "a=group:BUNDLE " + this.transceivers.map(function (e) { + return e.mid; + }).join(" ") + "\r\n"), this.transceivers.forEach(function (n) { + if (n.isDatachannel) return void (t += "m=application 0 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:" + n.mid + "\r\n");var i = e._getCommonCapabilities(n.localCapabilities, n.remoteCapabilities);t += r.writeMediaSection(n, i, "answer", e.localStreams[0]); + });var n = new RTCSessionDescription({ type: "answer", sdp: t });return arguments.length && "function" == typeof arguments[0] && window.setTimeout(arguments[0], 0, n), Promise.resolve(n); + }, window.RTCPeerConnection.prototype.addIceCandidate = function (e) { + if (null === e) this.transceivers.forEach(function (e) { + e.iceTransport.addRemoteCandidate({}); + });else { + var t = e.sdpMLineIndex;if (e.sdpMid) for (var n = 0; n < this.transceivers.length; n++) { + if (this.transceivers[n].mid === e.sdpMid) { + t = n;break; + } + }var i = this.transceivers[t];if (i) { + var o = Object.keys(e.candidate).length > 0 ? r.parseCandidate(e.candidate) : {};if ("tcp" === o.protocol && (0 === o.port || 9 === o.port)) return;if ("1" !== o.component) return;"endOfCandidates" === o.type && (o = {}), i.iceTransport.addRemoteCandidate(o);var a = r.splitSections(this.remoteDescription.sdp);a[t + 1] += (o.type ? e.candidate.trim() : "a=end-of-candidates") + "\r\n", this.remoteDescription.sdp = a.join(""); + } + }return arguments.length > 1 && "function" == typeof arguments[1] && window.setTimeout(arguments[1], 0), Promise.resolve(); + }, window.RTCPeerConnection.prototype.getStats = function () { + var e = [];this.transceivers.forEach(function (t) { + ["rtpSender", "rtpReceiver", "iceGatherer", "iceTransport", "dtlsTransport"].forEach(function (n) { + t[n] && e.push(t[n].getStats()); + }); + });var t = arguments.length > 1 && "function" == typeof arguments[1] && arguments[1];return new Promise(function (n) { + var r = new Map();Promise.all(e).then(function (e) { + e.forEach(function (e) { + Object.keys(e).forEach(function (t) { + r.set(t, e[t]), r[t] = e[t]; + }); + }), t && window.setTimeout(t, 0, r), n(r); + }); + }); + }; + } };t.exports = { shimPeerConnection: o.shimPeerConnection, shimGetUserMedia: e("./getusermedia") }; + }, { "../utils": 10, "./getusermedia": 6, sdp: 1 }], 6: [function (e, t, n) { + "use strict"; + t.exports = function () { + var e = function e(_e3) { + return { name: { PermissionDeniedError: "NotAllowedError" }[_e3.name] || _e3.name, message: _e3.message, constraint: _e3.constraint, toString: function toString() { + return this.name; + } }; + }, + t = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia = function (n) { + return t(n).catch(function (t) { + return Promise.reject(e(t)); + }); + }; + }; + }, {}], 7: [function (e, t, n) { + "use strict"; + var r = e("../utils").browserDetails, + i = { shimOnTrack: function shimOnTrack() { + "object" != typeof window || !window.RTCPeerConnection || "ontrack" in window.RTCPeerConnection.prototype || Object.defineProperty(window.RTCPeerConnection.prototype, "ontrack", { get: function get() { + return this._ontrack; + }, set: function set(e) { + this._ontrack && (this.removeEventListener("track", this._ontrack), this.removeEventListener("addstream", this._ontrackpoly)), this.addEventListener("track", this._ontrack = e), this.addEventListener("addstream", this._ontrackpoly = function (e) { + e.stream.getTracks().forEach(function (t) { + var n = new Event("track");n.track = t, n.receiver = { track: t }, n.streams = [e.stream], this.dispatchEvent(n); + }.bind(this)); + }.bind(this)); + } }); + }, shimSourceObject: function shimSourceObject() { + "object" == typeof window && (!window.HTMLMediaElement || "srcObject" in window.HTMLMediaElement.prototype || Object.defineProperty(window.HTMLMediaElement.prototype, "srcObject", { get: function get() { + return this.mozSrcObject; + }, set: function set(e) { + this.mozSrcObject = e; + } })); + }, shimPeerConnection: function shimPeerConnection() { + if ("object" == typeof window && (window.RTCPeerConnection || window.mozRTCPeerConnection)) { + window.RTCPeerConnection || (window.RTCPeerConnection = function (e, t) { + if (r.version < 38 && e && e.iceServers) { + for (var n = [], i = 0; i < e.iceServers.length; i++) { + var o = e.iceServers[i];if (o.hasOwnProperty("urls")) for (var a = 0; a < o.urls.length; a++) { + var s = { url: o.urls[a] };0 === o.urls[a].indexOf("turn") && (s.username = o.username, s.credential = o.credential), n.push(s); + } else n.push(e.iceServers[i]); + }e.iceServers = n; + }return new mozRTCPeerConnection(e, t); + }, window.RTCPeerConnection.prototype = mozRTCPeerConnection.prototype, mozRTCPeerConnection.generateCertificate && Object.defineProperty(window.RTCPeerConnection, "generateCertificate", { get: function get() { + return mozRTCPeerConnection.generateCertificate; + } }), window.RTCSessionDescription = mozRTCSessionDescription, window.RTCIceCandidate = mozRTCIceCandidate), ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function (e) { + var t = RTCPeerConnection.prototype[e];RTCPeerConnection.prototype[e] = function () { + return arguments[0] = new ("addIceCandidate" === e ? RTCIceCandidate : RTCSessionDescription)(arguments[0]), t.apply(this, arguments); + }; + });var e = RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate = function () { + return null === arguments[0] ? Promise.resolve() : e.apply(this, arguments); + };var t = function t(e) { + var t = new Map();return Object.keys(e).forEach(function (n) { + t.set(n, e[n]), t[n] = e[n]; + }), t; + }, + n = RTCPeerConnection.prototype.getStats;RTCPeerConnection.prototype.getStats = function (e, r, i) { + return n.apply(this, [e || null]).then(function (e) { + return t(e); + }).then(r, i); + }; + } + } };t.exports = { shimOnTrack: i.shimOnTrack, shimSourceObject: i.shimSourceObject, shimPeerConnection: i.shimPeerConnection, shimGetUserMedia: e("./getusermedia") }; + }, { "../utils": 10, "./getusermedia": 8 }], 8: [function (e, t, n) { + "use strict"; + var r = e("../utils").log, + i = e("../utils").browserDetails;t.exports = function () { + var e = function e(_e4) { + return { name: { SecurityError: "NotAllowedError", PermissionDeniedError: "NotAllowedError" }[_e4.name] || _e4.name, message: { "The operation is insecure.": "The request is not allowed by the user agent or the platform in the current context." }[_e4.message] || _e4.message, constraint: _e4.constraint, toString: function toString() { + return this.name + (this.message && ": ") + this.message; + } }; + }, + t = function t(_t2, n, o) { + var a = function a(e) { + if ("object" != typeof e || e.require) return e;var t = [];return Object.keys(e).forEach(function (n) { + if ("require" !== n && "advanced" !== n && "mediaSource" !== n) { + var r = e[n] = "object" == typeof e[n] ? e[n] : { ideal: e[n] };if (void 0 === r.min && void 0 === r.max && void 0 === r.exact || t.push(n), void 0 !== r.exact && ("number" == typeof r.exact ? r.min = r.max = r.exact : e[n] = r.exact, delete r.exact), void 0 !== r.ideal) { + e.advanced = e.advanced || [];var i = {};"number" == typeof r.ideal ? i[n] = { min: r.ideal, max: r.ideal } : i[n] = r.ideal, e.advanced.push(i), delete r.ideal, Object.keys(r).length || delete e[n]; + } + } + }), t.length && (e.require = t), e; + };return _t2 = JSON.parse(JSON.stringify(_t2)), i.version < 38 && (r("spec: " + JSON.stringify(_t2)), _t2.audio && (_t2.audio = a(_t2.audio)), _t2.video && (_t2.video = a(_t2.video)), r("ff37: " + JSON.stringify(_t2))), navigator.mozGetUserMedia(_t2, n, function (t) { + o(e(t)); + }); + }, + n = function n(e) { + return new Promise(function (n, r) { + t(e, n, r); + }); + };if (navigator.mediaDevices || (navigator.mediaDevices = { getUserMedia: n, addEventListener: function addEventListener() {}, removeEventListener: function removeEventListener() {} }), navigator.mediaDevices.enumerateDevices = navigator.mediaDevices.enumerateDevices || function () { + return new Promise(function (e) { + e([{ kind: "audioinput", deviceId: "default", label: "", groupId: "" }, { kind: "videoinput", deviceId: "default", label: "", groupId: "" }]); + }); + }, i.version < 41) { + var a = navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);navigator.mediaDevices.enumerateDevices = function () { + return a().then(void 0, function (e) { + if ("NotFoundError" === e.name) return [];throw e; + }); + }; + }if (i.version < 49) { + var s = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia = function (t) { + return s(t).catch(function (t) { + return Promise.reject(e(t)); + }); + }; + }navigator.getUserMedia = function (e, n, r) { + if (i.version < 44) return t(e, n, r);o.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"), navigator.mediaDevices.getUserMedia(e).then(n, r); + }; + }; + }, { "../utils": 10 }], 9: [function (e, t, n) { + "use strict"; + var r = { shimGetUserMedia: function shimGetUserMedia() { + navigator.getUserMedia = navigator.webkitGetUserMedia; + } };t.exports = { shimGetUserMedia: r.shimGetUserMedia }; + }, {}], 10: [function (e, t, n) { + "use strict"; + var r = !0, + i = { disableLog: function disableLog(e) { + return "boolean" != typeof e ? new Error("Argument type: " + typeof e + ". Please use a boolean.") : (r = e, e ? "adapter.js logging disabled" : "adapter.js logging enabled"); + }, log: function log() { + if ("object" == typeof window) { + if (r) return;void 0 !== o && "function" == typeof o.log && o.log.apply(o, arguments); + } + }, extractVersion: function extractVersion(e, t, n) { + var r = e.match(t);return r && r.length >= n && parseInt(r[n], 10); + }, detectBrowser: function detectBrowser() { + var e = {};if (e.browser = null, e.version = null, "undefined" == typeof window || !window.navigator) return e.browser = "Not a browser.", e;if (navigator.mozGetUserMedia) e.browser = "firefox", e.version = this.extractVersion(navigator.userAgent, /Firefox\/([0-9]+)\./, 1);else if (navigator.webkitGetUserMedia) { + if (window.webkitRTCPeerConnection) e.browser = "chrome", e.version = this.extractVersion(navigator.userAgent, /Chrom(e|ium)\/([0-9]+)\./, 2);else { + if (!navigator.userAgent.match(/Version\/(\d+).(\d+)/)) return e.browser = "Unsupported webkit-based browser with GUM support but no WebRTC support.", e;e.browser = "safari", e.version = this.extractVersion(navigator.userAgent, /AppleWebKit\/([0-9]+)\./, 1); + } + } else { + if (!navigator.mediaDevices || !navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) return e.browser = "Not a supported browser.", e;e.browser = "edge", e.version = this.extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2); + }return e; + } };t.exports = { log: i.log, disableLog: i.disableLog, browserDetails: i.detectBrowser(), extractVersion: i.extractVersion }; + }, {}] }, {}, [2])(2); + }(); + }(), a.parseWebrtcDetectedBrowser(), navigator.mozGetUserMedia ? (MediaStreamTrack.getSources = function (e) { + setTimeout(function () { + e([{ kind: "audio", id: "default", label: "", facing: "" }, { kind: "video", id: "default", label: "", facing: "" }]); + }, 0); + }, attachMediaStream = function attachMediaStream(e, t) { + return e.srcObject = t, e; + }, reattachMediaStream = function reattachMediaStream(e, t) { + return e.srcObject = t.srcObject, e; + }, createIceServer = function createIceServer(e, t, n) { + o.warn("createIceServer is deprecated. It should be replaced with an application level implementation.");var r = null, + i = e.split(":");if (0 === i[0].indexOf("stun")) r = { urls: [e] };else if (0 === i[0].indexOf("turn")) if (webrtcDetectedVersion < 27) { + var a = e.split("?");1 !== a.length && 0 !== a[1].indexOf("transport=udp") || (r = { urls: [a[0]], credential: n, username: t }); + } else r = { urls: [e], credential: n, username: t };return r; + }, createIceServers = function createIceServers(e, t, n) { + o.warn("createIceServers is deprecated. It should be replaced with an application level implementation.");var r = [];for (i = 0; i < e.length; i++) { + var a = createIceServer(e[i], t, n);null !== a && r.push(a); + }return r; + }) : navigator.webkitGetUserMedia ? (attachMediaStream = function attachMediaStream(e, t) { + return webrtcDetectedVersion >= 43 ? e.srcObject = t : void 0 !== e.src ? e.src = URL.createObjectURL(t) : o.error("Error attaching stream to element."), e; + }, reattachMediaStream = function reattachMediaStream(e, t) { + return webrtcDetectedVersion >= 43 ? e.srcObject = t.srcObject : e.src = t.src, e; + }, createIceServer = function createIceServer(e, t, n) { + o.warn("createIceServer is deprecated. It should be replaced with an application level implementation.");var r = null, + i = e.split(":");return 0 === i[0].indexOf("stun") ? r = { url: e } : 0 === i[0].indexOf("turn") && (r = { url: e, credential: n, username: t }), r; + }, createIceServers = function createIceServers(e, t, n) { + o.warn("createIceServers is deprecated. It should be replaced with an application level implementation.");var r = [];if (webrtcDetectedVersion >= 34) r = { urls: e, credential: n, username: t };else for (i = 0; i < e.length; i++) { + var a = createIceServer(e[i], t, n);null !== a && r.push(a); + }return r; + }) : navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/) && (attachMediaStream = function attachMediaStream(e, t) { + return e.srcObject = t, e; + }, reattachMediaStream = function reattachMediaStream(e, t) { + return e.srcObject = t.srcObject, e; + }), attachMediaStream_base = attachMediaStream, "opera" === webrtcDetectedBrowser && (attachMediaStream_base = function attachMediaStream_base(e, t) { + webrtcDetectedVersion > 38 ? e.srcObject = t : void 0 !== e.src && (e.src = URL.createObjectURL(t)); + }), attachMediaStream = function attachMediaStream(e, t) { + return "chrome" !== webrtcDetectedBrowser && "opera" !== webrtcDetectedBrowser || t ? attachMediaStream_base(e, t) : e.src = "", e; + }, reattachMediaStream_base = reattachMediaStream, reattachMediaStream = function reattachMediaStream(e, t) { + return reattachMediaStream_base(e, t), e; + }, window.attachMediaStream = attachMediaStream, window.reattachMediaStream = reattachMediaStream, window.getUserMedia = function (e, t, n) { + navigator.getUserMedia(e, t, n); + }, a.attachMediaStream = attachMediaStream, a.reattachMediaStream = reattachMediaStream, a.getUserMedia = getUserMedia, "undefined" == typeof Promise && (requestUserMedia = null), a.maybeThroughWebRTCReady()), function () { + "use strict"; + var e = null;a.TEXT.EXTENSION = { REQUIRE_INSTALLATION_FF: "To enable screensharing you need to install the Skylink WebRTC tools Firefox Add-on.", REQUIRE_INSTALLATION_CHROME: "To enable screensharing you need to install the Skylink WebRTC tools Chrome Extension.", REQUIRE_REFRESH: "Please refresh this page after the Skylink WebRTC tools extension has been installed.", BUTTON_FF: "Install Now", BUTTON_CHROME: "Go to Chrome Web Store" };var t = function t(e) { + if (null === e || "object" != typeof e) return e;var t = e.constructor();for (var n in e) { + e.hasOwnProperty(n) && (t[n] = e[n]); + }return t; + };if (window.navigator.mozGetUserMedia ? (e = window.navigator.getUserMedia, navigator.getUserMedia = function (n, r, i) { + if (n && n.video && n.video.mediaSource) { + if ("screen" !== n.video.mediaSource && "window" !== n.video.mediaSource) return void i(new Error('GetUserMedia: Only "screen" and "window" are supported as mediaSource constraints'));var o = t(n);o.video.mozMediaSource = o.video.mediaSource;var s = setInterval(function () { + "complete" === document.readyState && (clearInterval(s), e(o, r, function (e) { + ["PermissionDeniedError", "SecurityError"].indexOf(e.name) > -1 && "https:" === window.parent.location.protocol ? a.renderNotificationBar(a.TEXT.EXTENSION.REQUIRE_INSTALLATION_FF, a.TEXT.EXTENSION.BUTTON_FF, "https://addons.mozilla.org/en-US/firefox/addon/skylink-webrtc-tools/", !0, !0) : i(e); + })); + }, 1); + } else e(n, r, i); + }, a.getUserMedia = window.getUserMedia = navigator.getUserMedia) : window.navigator.webkitGetUserMedia && "safari" !== window.webrtcDetectedBrowser ? (e = window.navigator.getUserMedia, navigator.getUserMedia = function (n, i, o) { + if (n && n.video && n.video.mediaSource) { + if ("chrome" !== window.webrtcDetectedBrowser) return void o(new Error("Current browser does not support screensharing"));var s = t(n), + c = function c(t, n) { + t ? o("permission-denied" === t ? new Error("Permission denied for screen retrieval") : new Error("Failed retrieving selected screen")) : (s.video.mandatory = s.video.mandatory || {}, s.video.mandatory.chromeMediaSource = "desktop", s.video.mandatory.maxWidth = window.screen.width > 1920 ? window.screen.width : 1920, s.video.mandatory.maxHeight = window.screen.height > 1080 ? window.screen.height : 1080, n && (s.video.mandatory.chromeMediaSourceId = n), delete s.video.mediaSource, e(s, i, o)); + }, + u = function u(e) { + e.data && (e.data.chromeMediaSourceId && ("PermissionDeniedError" === e.data.chromeMediaSourceId ? c("permission-denied") : c(null, e.data.chromeMediaSourceId)), e.data.chromeExtensionStatus && ("not-installed" === e.data.chromeExtensionStatus ? a.renderNotificationBar(a.TEXT.EXTENSION.REQUIRE_INSTALLATION_CHROME, a.TEXT.EXTENSION.BUTTON_CHROME, e.data.data, !0, !0) : c(e.data.chromeExtensionStatus, null)), window.removeEventListener("message", u)); + };window.addEventListener("message", u), r({ captureSourceId: !0 }); + } else e(n, i, o); + }, a.getUserMedia = window.getUserMedia = navigator.getUserMedia, navigator.mediaDevices.getUserMedia = function (e) { + return new Promise(function (t, n) { + window.getUserMedia(e, t, n); + }); + }) : navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/) ? o.warn("Edge does not support screensharing feature in getUserMedia") : (e = window.navigator.getUserMedia, navigator.getUserMedia = function (n, r, i) { + if (n && n.video && n.video.mediaSource) { + var o = t(n);a.WebRTCPlugin.callWhenPluginReady(function () { + if (!a.WebRTCPlugin.plugin.HasScreensharingFeature || !a.WebRTCPlugin.plugin.isScreensharingAvailable) return void i(new Error("Your version of the WebRTC plugin does not support screensharing"));o.video.optional = o.video.optional || [], o.video.optional.push({ sourceId: a.WebRTCPlugin.plugin.screensharingKey || "Screensharing" }), delete o.video.mediaSource, e(o, r, i); + }); + } else e(n, r, i); + }, a.getUserMedia = getUserMedia = window.getUserMedia = navigator.getUserMedia, navigator.mediaDevices && "undefined" != typeof Promise && (navigator.mediaDevices.getUserMedia = requestUserMedia)), "chrome" === window.webrtcDetectedBrowser) { + var n = document.createElement("iframe");n.onload = function () { + n.isLoaded = !0; + }, n.src = "https://cdn.temasys.com.sg/skylink/extensions/detectRTC.html", n.style.display = "none", (document.body || document.documentElement).appendChild(n);var r = function r(e) { + if (e = e || {}, !n.isLoaded) return void setTimeout(function () { + n.contentWindow.postMessage(e, "*"); + }, 100);n.contentWindow.postMessage(e, "*"); + }; + } else "opera" === window.webrtcDetectedBrowser && o.warn("Opera does not support screensharing feature in getUserMedia"); + }(); + }).call(t, "modules/RTC/adapter.screenshare.js"); + }, function (e, t, n) { + function r(e) { + this.path = e.path, this.hostname = e.hostname, this.port = e.port, this.secure = e.secure, this.query = e.query, this.timestampParam = e.timestampParam, this.timestampRequests = e.timestampRequests, this.readyState = "", this.agent = e.agent || !1, this.socket = e.socket, this.enablesXDR = e.enablesXDR, this.pfx = e.pfx, this.key = e.key, this.passphrase = e.passphrase, this.cert = e.cert, this.ca = e.ca, this.ciphers = e.ciphers, this.rejectUnauthorized = e.rejectUnauthorized, this.extraHeaders = e.extraHeaders; + }var i = n(18), + o = n(36);e.exports = r, o(r.prototype), r.prototype.onError = function (e, t) { + var n = new Error(e);return n.type = "TransportError", n.description = t, this.emit("error", n), this; + }, r.prototype.open = function () { + return "closed" != this.readyState && "" != this.readyState || (this.readyState = "opening", this.doOpen()), this; + }, r.prototype.close = function () { + return "opening" != this.readyState && "open" != this.readyState || (this.doClose(), this.onClose()), this; + }, r.prototype.send = function (e) { + if ("open" != this.readyState) throw new Error("Transport not open");this.write(e); + }, r.prototype.onOpen = function () { + this.readyState = "open", this.writable = !0, this.emit("open"); + }, r.prototype.onData = function (e) { + var t = i.decodePacket(e, this.socket.binaryType);this.onPacket(t); + }, r.prototype.onPacket = function (e) { + this.emit("packet", e); + }, r.prototype.onClose = function () { + this.readyState = "closed", this.emit("close"); + }; + }, function (e, t, n) { + var r = n(77);e.exports = function (e) { + var t = e.xdomain, + n = e.xscheme, + i = e.enablesXDR;try { + if ("undefined" != typeof XMLHttpRequest && (!t || r)) return new XMLHttpRequest(); + } catch (e) {}try { + if ("undefined" != typeof XDomainRequest && !n && i) return new XDomainRequest(); + } catch (e) {}if (!t) try { + return new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) {} + }; + }, function (e, t) { + function n(e) { + if (e) return r(e); + }function r(e) { + for (var t in n.prototype) { + e[t] = n.prototype[t]; + }return e; + }e.exports = n, n.prototype.on = n.prototype.addEventListener = function (e, t) { + return this._callbacks = this._callbacks || {}, (this._callbacks[e] = this._callbacks[e] || []).push(t), this; + }, n.prototype.once = function (e, t) { + function n() { + r.off(e, n), t.apply(this, arguments); + }var r = this;return this._callbacks = this._callbacks || {}, n.fn = t, this.on(e, n), this; + }, n.prototype.off = n.prototype.removeListener = n.prototype.removeAllListeners = n.prototype.removeEventListener = function (e, t) { + if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this;var n = this._callbacks[e];if (!n) return this;if (1 == arguments.length) return delete this._callbacks[e], this;for (var r, i = 0; i < n.length; i++) { + if ((r = n[i]) === t || r.fn === t) { + n.splice(i, 1);break; + } + }return this; + }, n.prototype.emit = function (e) { + this._callbacks = this._callbacks || {};var t = [].slice.call(arguments, 1), + n = this._callbacks[e];if (n) { + n = n.slice(0);for (var r = 0, i = n.length; r < i; ++r) { + n[r].apply(this, t); + } + }return this; + }, n.prototype.listeners = function (e) { + return this._callbacks = this._callbacks || {}, this._callbacks[e] || []; + }, n.prototype.hasListeners = function (e) { + return !!this.listeners(e).length; + }; + }, function (e, t) { + e.exports = Array.isArray || function (e) { + return "[object Array]" == Object.prototype.toString.call(e); + }; + }, function (e, t) { + t.encode = function (e) { + var t = "";for (var n in e) { + e.hasOwnProperty(n) && (t.length && (t += "&"), t += encodeURIComponent(n) + "=" + encodeURIComponent(e[n])); + }return t; + }, t.decode = function (e) { + for (var t = {}, n = e.split("&"), r = 0, i = n.length; r < i; r++) { + var o = n[r].split("=");t[decodeURIComponent(o[0])] = decodeURIComponent(o[1]); + }return t; + }; + }, function (e, t, n) { + function r() {}function i(e) { + var n = "", + r = !1;return n += e.type, t.BINARY_EVENT != e.type && t.BINARY_ACK != e.type || (n += e.attachments, n += "-"), e.nsp && "/" != e.nsp && (r = !0, n += e.nsp), null != e.id && (r && (n += ",", r = !1), n += e.id), null != e.data && (r && (n += ","), n += d.stringify(e.data)), l("encoded %j as %s", e, n), n; + }function o(e, t) { + function n(e) { + var n = f.deconstructPacket(e), + r = i(n.packet), + o = n.buffers;o.unshift(r), t(o); + }f.removeBlobs(e, n); + }function a() { + this.reconstructor = null; + }function s(e) { + var n = {}, + r = 0;if (n.type = Number(e.charAt(0)), null == t.types[n.type]) return u();if (t.BINARY_EVENT == n.type || t.BINARY_ACK == n.type) { + for (var i = ""; "-" != e.charAt(++r) && (i += e.charAt(r), r != e.length);) {}if (i != Number(i) || "-" != e.charAt(r)) throw new Error("Illegal attachments");n.attachments = Number(i); + }if ("/" == e.charAt(r + 1)) for (n.nsp = ""; ++r;) { + var o = e.charAt(r);if ("," == o) break;if (n.nsp += o, r == e.length) break; + } else n.nsp = "/";var a = e.charAt(r + 1);if ("" !== a && Number(a) == a) { + for (n.id = ""; ++r;) { + var o = e.charAt(r);if (null == o || Number(o) != o) { + --r;break; + }if (n.id += e.charAt(r), r == e.length) break; + }n.id = Number(n.id); + }if (e.charAt(++r)) try { + n.data = d.parse(e.substr(r)); + } catch (e) { + return u(); + }return l("decoded %s as %j", e, n), n; + }function c(e) { + this.reconPack = e, this.buffers = []; + }function u(e) { + return { type: t.ERROR, data: "parser error" }; + }var l = n(9)("socket.io-parser"), + d = n(79), + p = (n(37), n(170)), + f = n(169), + h = n(67);t.protocol = 4, t.types = ["CONNECT", "DISCONNECT", "EVENT", "ACK", "ERROR", "BINARY_EVENT", "BINARY_ACK"], t.CONNECT = 0, t.DISCONNECT = 1, t.EVENT = 2, t.ACK = 3, t.ERROR = 4, t.BINARY_EVENT = 5, t.BINARY_ACK = 6, t.Encoder = r, t.Decoder = a, r.prototype.encode = function (e, n) { + l("encoding packet %j", e), t.BINARY_EVENT == e.type || t.BINARY_ACK == e.type ? o(e, n) : n([i(e)]); + }, p(a.prototype), a.prototype.add = function (e) { + var n;if ("string" == typeof e) n = s(e), t.BINARY_EVENT == n.type || t.BINARY_ACK == n.type ? (this.reconstructor = new c(n), 0 === this.reconstructor.reconPack.attachments && this.emit("decoded", n)) : this.emit("decoded", n);else { + if (!h(e) && !e.base64) throw new Error("Unknown type: " + e);if (!this.reconstructor) throw new Error("got binary data when not reconstructing a packet");(n = this.reconstructor.takeBinaryData(e)) && (this.reconstructor = null, this.emit("decoded", n)); + } + }, a.prototype.destroy = function () { + this.reconstructor && this.reconstructor.finishedReconstruction(); + }, c.prototype.takeBinaryData = function (e) { + if (this.buffers.push(e), this.buffers.length == this.reconPack.attachments) { + var t = f.reconstructPacket(this.reconPack, this.buffers);return this.finishedReconstruction(), t; + }return null; + }, c.prototype.finishedReconstruction = function () { + this.reconPack = null, this.buffers = []; + }; + }, function (e, t) { + var n = [].slice;e.exports = function (e, t) { + if ("string" == typeof t && (t = e[t]), "function" != typeof t) throw new Error("bind() requires a function");var r = n.call(arguments, 2);return function () { + return t.apply(e, r.concat(n.call(arguments))); + }; + }; + }, function (e, t) { + var n = [].indexOf;e.exports = function (e, t) { + if (n) return e.indexOf(t);for (var r = 0; r < e.length; ++r) { + if (e[r] === t) return r; + }return -1; + }; + }, function (e, t) { + function n() { + var e = { methodName: "", fileLocation: "", line: null, column: null }, + t = new Error(), + n = t.stack ? t.stack.split("\n") : [];if (!n || n.length < 1) return e;var r = null;return n[3] && (r = n[3].match(/\s*at\s*(.+?)\s*\((\S*)\s*:(\d*)\s*:(\d*)\)/)), !r || r.length <= 4 ? (0 === n[2].indexOf("log@") ? e.methodName = n[3].substr(0, n[3].indexOf("@")) : e.methodName = n[2].substr(0, n[2].indexOf("@")), e) : (e.methodName = r[1], e.fileLocation = r[2], e.line = r[3], e.column = r[4], e); + }function r() { + var e = arguments[0], + t = arguments[1], + r = Array.prototype.slice.call(arguments, 2);if (!(o[t] < e.level)) for (var i = n(), s = a.concat(e.transports), c = 0; c < s.length; c++) { + var u = s[c], + l = u[t];l && "function" == typeof l && l.bind(u, e.id ? "[" + e.id + "]" : "", "<" + i.methodName + ">: ").apply(u, r); + } + }function i(e, t, n, i) { + this.id = t, this.format = i, this.transports = n, this.transports || (this.transports = []), this.level = o[e];for (var a = Object.keys(o), s = 0; s < a.length; s++) { + this[a[s]] = r.bind(null, this, a[s]); + } + }var o = { trace: 0, debug: 1, info: 2, log: 3, warn: 4, error: 5 };i.consoleTransport = console;var a = [i.consoleTransport];i.addGlobalTransport = function (e) { + -1 === a.indexOf(e) && a.push(e); + }, i.removeGlobalTransport = function (e) { + var t = a.indexOf(e);-1 !== t && a.splice(t, 1); + }, i.prototype.setLevel = function (e) { + this.level = o[e]; + }, e.exports = i, i.levels = { TRACE: "trace", DEBUG: "debug", INFO: "info", LOG: "log", WARN: "warn", ERROR: "error" }; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "CONNECTION_DROPPED_ERROR", function () { + return r; + }), n.d(t, "CONNECTION_ERROR", function () { + return i; + }), n.d(t, "OTHER_ERROR", function () { + return o; + }), n.d(t, "PASSWORD_REQUIRED", function () { + return a; + }), n.d(t, "SERVER_ERROR", function () { + return s; + });var r = "connection.droppedError", + i = "connection.connectionError", + o = "connection.otherError", + a = "connection.passwordRequired", + s = "connection.serverError"; + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), n.d(t, "DEVICE_LIST_CHANGED", function () { + return r; + }), n.d(t, "PERMISSION_PROMPT_IS_SHOWN", function () { + return i; + });var r = "mediaDevices.devicechange", + i = "mediaDevices.permissionPromptIsShown"; + }, function (e, t) { + var n = { RECORDER_UNAVAILABLE: "recorder.unavailable", RECORDER_BUSY: "recorder.busy", NO_TOKEN: "recorder.noToken", STATE_CHANGE_FAILED: "recorder.stateChangeFailed", INVALID_STATE: "recorder.invalidState" };e.exports = n; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e) { + var t = e.getOriginalStream();if (t) { + var n = t.stop;t.stop = function () { + n.apply(t), e.isActive() && t.onended(); + }; + } + }function s(e, t) { + void 0 === e.active ? e.onended = t : e.oninactive = t; + }var c = n(14), + u = n.n(c), + l = n(0), + d = (n.n(l), n(16)), + p = n(4), + f = n(2), + h = n(23), + m = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + v = n.i(l.getLogger)(e), + g = { track_mute: "onmute", track_unmute: "onunmute", track_ended: "onended" }, + y = function (e) { + function t(e, n, o, a, s, c) { + r(this, t);var u = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return u.addEventListener = u.addListener, u.removeEventListener = u.off = u.removeListener, u.containers = [], u.conference = e, u.stream = n, u.audioLevel = -1, u.type = s, u.track = o, u.videoType = c, u.handlers = {}, u.disposed = !1, u._setHandler("inactive", a), u; + }return o(t, e), m(t, [{ key: "_setHandler", value: function value(e, t) { + this.handlers[e] = t, this.stream && ("inactive" === e ? (f.a.isFirefox() && a(this), s(this.stream, t)) : g.hasOwnProperty(e) && this.stream.getVideoTracks().forEach(function (n) { + n[g[e]] = t; + }, this)); + } }, { key: "_setStream", value: function value(e) { + var t = this;this.stream = e, Object.keys(this.handlers).forEach(function (e) { + "function" == typeof t.handlers[e] && t._setHandler(e, t.handlers[e]); + }, this); + } }, { key: "getType", value: function value() { + return this.type; + } }, { key: "isAudioTrack", value: function value() { + return this.getType() === p.a; + } }, { key: "isWebRTCTrackMuted", value: function value() { + return this.track && this.track.muted; + } }, { key: "isVideoTrack", value: function value() { + return this.getType() === p.b; + } }, { key: "isLocal", value: function value() { + throw new Error("Not implemented by subclass"); + } }, { key: "getOriginalStream", value: function value() { + return this.stream; + } }, { key: "getStreamId", value: function value() { + return this.stream ? this.stream.id : null; + } }, { key: "getTrack", value: function value() { + return this.track; + } }, { key: "getTrackId", value: function value() { + return this.track ? this.track.id : null; + } }, { key: "getUsageLabel", value: function value() { + return this.isAudioTrack() ? "mic" : this.videoType ? this.videoType : "default"; + } }, { key: "_maybeFireTrackAttached", value: function value(e) { + this.conference && e && this.conference._onTrackAttach(this, e); + } }, { key: "attach", value: function value(e) { + var t = e;return this.stream && (t = h.a.attachMediaStream(e, this.stream)), this.containers.push(t), this._maybeFireTrackAttached(t), this._attachTTFMTracker(t), t; + } }, { key: "detach", value: function value(e) { + for (var t = this.containers, n = t.length - 1; n >= 0; --n) { + var r = t[n];e || h.a.attachMediaStream(r, null), e && r !== e || t.splice(n, 1); + }e && h.a.attachMediaStream(e, null); + } }, { key: "_attachTTFMTracker", value: function value(e) {} }, { key: "dispose", value: function value() { + return this.removeAllListeners(), this.disposed = !0, Promise.resolve(); + } }, { key: "isScreenSharing", value: function value() {} }, { key: "getId", value: function value() { + return this.stream ? h.a.getStreamID(this.stream) : null; + } }, { key: "isActive", value: function value() { + return void 0 === this.stream.active || this.stream.active; + } }, { key: "setAudioLevel", value: function value(e, t) { + this.audioLevel !== e && (this.audioLevel = e, this.emit(d.TRACK_AUDIO_LEVEL_CHANGED, e, t)); + } }, { key: "getMSID", value: function value() { + var e = this.getStreamId(), + t = this.getTrackId();return e && t ? e + " " + t : null; + } }, { key: "setAudioOutput", value: function value(e) { + var t = this;return h.a.isDeviceChangeAvailable("output") ? this.isVideoTrack() ? Promise.resolve() : Promise.all(this.containers.map(function (t) { + return t.setSinkId(e).catch(function (e) { + throw v.warn("Failed to change audio output device on element. Default or previously set audio output device will be used.", t, e), e; + }); + })).then(function () { + t.emit(d.TRACK_AUDIO_OUTPUT_CHANGED, e); + }) : Promise.reject(new Error("Audio output device change is not supported")); + } }]), t; + }(u.a);t.a = y; + }).call(t, "modules/RTC/JitsiTrack.js"); + }, function (e, t, n) { + "use strict"; + function r(e) { + for (var t = 0, n = e.length, r = 0; r < n; r++) { + t < e[r] && (t = e[r]); + }return parseFloat(((t - 127) / 128).toFixed(3)); + }function i(e, t) { + var n = 0, + r = t - e;return n = r > .2 ? t - .2 : r < -.4 ? t + .4 : e, parseFloat(n.toFixed(3)); + }function o(e, t, n) { + this.stream = e, this.intervalId = null, this.intervalMilis = t, this.audioLevel = 0, this.callback = n; + }t.a = o;var a = n(2);window.AudioContext = window.AudioContext || window.webkitAudioContext;var s = null;window.AudioContext && (s = new AudioContext(), s.suspend && s.suspend()), o.prototype.start = function () { + if (o.isLocalStatsSupported()) { + s.resume();var e = s.createAnalyser();e.smoothingTimeConstant = .8, e.fftSize = 2048, s.createMediaStreamSource(this.stream).connect(e);var t = this;this.intervalId = setInterval(function () { + var n = new Uint8Array(e.frequencyBinCount);e.getByteTimeDomainData(n);var o = r(n);o !== t.audioLevel && (t.audioLevel = i(o, t.audioLevel), t.callback(t.audioLevel)); + }, this.intervalMilis); + } + }, o.prototype.stop = function () { + this.intervalId && (clearInterval(this.intervalId), this.intervalId = null); + }, o.isLocalStatsSupported = function () { + return Boolean(s && !a.a.isTemasysPluginUsed()); + }; + }, function (e, t, n) { + function r(e) { + if (void 0 === e.recorder) throw new Error("Passed an object to startRecorder which is not a TrackRecorder object");e.recorder.start(), e.startTime = new Date(); + }function i(e) { + if (void 0 === e.recorder) throw new Error("Passed an object to stopRecorder which is not a TrackRecorder object");e.recorder.stop(); + }function o() { + if (MediaRecorder.isTypeSupported(u)) return u;if (MediaRecorder.isTypeSupported(l)) return l;throw new Error("unable to create a MediaRecorder with the right mimetype!"); + }function a(e) { + this.recorders = [], this.fileType = o(), this.isRecording = !1, this.jitsiConference = e; + }function s() { + if ("undefined" != typeof MediaStream) return new MediaStream();if ("undefined" != typeof webkitMediaStream) return new webkitMediaStream();throw new Error("cannot create a clean mediaStream"); + }var c = n(109), + u = "audio/webm", + l = "audio/ogg", + d = function d(e) { + this.track = e, this.recorder = null, this.data = null, this.name = null, this.startTime = null; + };a.determineCorrectFileType = o, a.prototype.addTrack = function (e) { + if (e.isAudioTrack()) { + var t = this.instantiateTrackRecorder(e);this.recorders.push(t), this.updateNames(), this.isRecording && r(t); + } + }, a.prototype.instantiateTrackRecorder = function (e) { + var t = new d(e), + n = t.track.getOriginalStream(), + r = s();return n.getAudioTracks().forEach(function (e) { + return r.addTrack(e); + }), t.recorder = new MediaRecorder(r, { mimeType: this.fileType }), t.data = [], t.recorder.ondataavailable = function (e) { + e.data.size > 0 && t.data.push(e.data); + }, t; + }, a.prototype.removeTrack = function (e) { + if (!e.isVideoTrack()) { + var t = this.recorders, + n = void 0;for (n = 0; n < t.length; n++) { + if (t[n].track.getParticipantId() === e.getParticipantId()) { + var r = t[n];this.isRecording ? i(r) : t.splice(n, 1); + } + }this.updateNames(); + } + }, a.prototype.updateNames = function () { + var e = this.jitsiConference;this.recorders.forEach(function (t) { + if (t.track.isLocal()) t.name = "the transcriber";else { + var n = t.track.getParticipantId(), + r = e.getParticipantById(n), + i = r.getDisplayName();"undefined" !== i && (t.name = i); + } + }); + }, a.prototype.start = function () { + if (this.isRecording) throw new Error("audiorecorder is already recording");this.isRecording = !0, this.recorders.forEach(function (e) { + return r(e); + }), console.log("Started the recording of the audio. There are currently " + this.recorders.length + " recorders active."); + }, a.prototype.stop = function () { + this.isRecording = !1, this.recorders.forEach(function (e) { + return i(e); + }), console.log("stopped recording"); + }, a.prototype.download = function () { + var e = this;this.recorders.forEach(function (t) { + var n = new Blob(t.data, { type: e.fileType }), + r = URL.createObjectURL(n), + i = document.createElement("a");document.body.appendChild(i), i.style = "display: none", i.href = r, i.download = "test." + e.fileType.split("/")[1], i.click(), window.URL.revokeObjectURL(r); + }); + }, a.prototype.getRecordingResults = function () { + var e = this;if (this.isRecording) throw new Error("cannot get blobs because the AudioRecorder is still recording!");this.updateNames();var t = [];return this.recorders.forEach(function (n) { + return t.push(new c(new Blob(n.data, { type: e.fileType }), n.name, n.startTime)); + }), t; + }, a.prototype.getFileType = function () { + return this.fileType; + }, e.exports = a; + }, function (e, t, n) { + var r = n(73), + i = { loadScript: function loadScript(e, t, n, i, o, a) { + var s = document, + c = s.createElement("script"), + u = s.getElementsByTagName("script")[0];if (c.async = t, i) { + var l = r();if (l) { + var d = l.src, + p = d.substring(0, d.lastIndexOf("/") + 1);d && p && (e = p + e); + } + }o && (c.onload = o), a && (c.onerror = a), c.src = e, n ? u.parentNode.insertBefore(c, u) : u.parentNode.appendChild(c); + } };e.exports = i; + }, function (e, t, n) { + "use strict"; + n.d(t, "b", function () { + return r; + }), n.d(t, "c", function () { + return i; + }), n.d(t, "a", function () { + return o; + });var r = "pending", + i = "active", + o = "ended"; + }, function (e, t, n) { + "use strict"; + function r(e) { + for (var t = e.split("\r\nm="), n = 1, r = t.length; n < r; n++) { + var i = "m=" + t[n];n !== r - 1 && (i += "\r\n"), t[n] = i; + }var o = t.shift() + "\r\n";this.media = t, this.raw = o + t.join(""), this.session = o; + }t.a = r;var i = n(12);r.prototype.failICE = !1, r.prototype.removeTcpCandidates = !1, r.prototype.removeUdpCandidates = !1, r.prototype.getMediaSsrcMap = function () { + for (var e = this, t = {}, n = void 0, r = 0; r < e.media.length; r++) { + !function (r) { + n = i.a.findLines(e.media[r], "a=ssrc:");var o = i.a.parseMID(i.a.findLine(e.media[r], "a=mid:")), + a = { mediaindex: r, mid: o, ssrcs: {}, ssrcGroups: [] };t[r] = a, n.forEach(function (e) { + var t = e.substring(7).split(" ")[0];a.ssrcs[t] || (a.ssrcs[t] = { ssrc: t, lines: [] }), a.ssrcs[t].lines.push(e); + }), n = i.a.findLines(e.media[r], "a=ssrc-group:"), n.forEach(function (e) { + var t = e.indexOf(" "), + n = e.substr(0, t).substr(13), + r = e.substr(14 + n.length).split(" ");r.length && a.ssrcGroups.push({ semantics: n, ssrcs: r }); + }); + }(r); + }return t; + }, r.prototype.containsSSRC = function (e) { + var t = this.getMediaSsrcMap(), + n = !1;return Object.keys(t).forEach(function (r) { + n || t[r].ssrcs[e] && (n = !0); + }), n; + }, r.prototype.mangle = function () { + var e = void 0, + t = void 0, + n = void 0, + r = void 0, + o = void 0, + a = void 0;for (e = 0; e < this.media.length; e++) { + if (n = this.media[e].split("\r\n"), n.pop(), r = i.a.parseMLine(n.shift()), "audio" === r.media) { + for (o = "", r.fmt.length = 0, t = 0; t < n.length; t++) { + if ("a=rtpmap:" === n[t].substr(0, 9)) { + if (a = i.a.parseRTPMap(n[t]), "CN" === a.name || "ISAC" === a.name) continue;r.fmt.push(a.id); + }o += n[t] + "\r\n"; + }this.media[e] = i.a.buildMLine(r) + "\r\n" + o; + } + }this.raw = this.session + this.media.join(""); + }, r.prototype.removeSessionLines = function (e) { + var t = this, + n = i.a.findLines(this.session, e);return n.forEach(function (e) { + t.session = t.session.replace(e + "\r\n", ""); + }), this.raw = this.session + this.media.join(""), n; + }, r.prototype.removeMediaLines = function (e, t) { + var n = this, + r = i.a.findLines(this.media[e], t);return r.forEach(function (t) { + n.media[e] = n.media[e].replace(t + "\r\n", ""); + }), this.raw = this.session + this.media.join(""), r; + }, r.prototype.toJingle = function (e, t) { + var n = void 0, + r = void 0, + o = void 0, + a = void 0, + s = void 0, + c = void 0, + u = void 0, + l = void 0;if (a = i.a.findLines(this.session, "a=group:"), a.length) for (n = 0; n < a.length; n++) { + l = a[n].split(" ");var d = l.shift().substr(8);for (e.c("group", { xmlns: "urn:xmpp:jingle:apps:grouping:0", semantics: d }), r = 0; r < l.length; r++) { + e.c("content", { name: l[r] }).up(); + }e.up(); + }for (n = 0; n < this.media.length; n++) { + if (s = i.a.parseMLine(this.media[n].split("\r\n")[0]), "audio" === s.media || "video" === s.media || "application" === s.media) { + var p = i.a.findLine(this.media[n], "a=ssrc:");u = !!p && p.substring(7).split(" ")[0], e.c("content", { creator: t, name: s.media });var f = i.a.findLine(this.media[n], "a=mid:");if (f) { + var h = i.a.parseMID(f);e.attrs({ name: h }); + }if (i.a.findLine(this.media[n], "a=rtpmap:").length) { + for (e.c("description", { xmlns: "urn:xmpp:jingle:apps:rtp:1", media: s.media }), u && e.attrs({ ssrc: u }), r = 0; r < s.fmt.length; r++) { + c = i.a.findLine(this.media[n], "a=rtpmap:" + s.fmt[r]), e.c("payload-type", i.a.parseRTPMap(c));var m = i.a.findLine(this.media[n], "a=fmtp:" + s.fmt[r]);if (m) for (l = i.a.parseFmtp(m), o = 0; o < l.length; o++) { + e.c("parameter", l[o]).up(); + }this.rtcpFbToJingle(n, e, s.fmt[r]), e.up(); + }var v = i.a.findLines(this.media[n], "a=crypto:", this.session);if (v.length && (e.c("encryption", { required: 1 }), v.forEach(function (t) { + return e.c("crypto", i.a.parseCrypto(t)).up(); + }), e.up()), u) { + e.c("source", { ssrc: u, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" });var g = i.a.findLines(this.media[n], "a=ssrc:");if (g.length > 0) g.forEach(function (t) { + var n = t.indexOf(" "), + r = t.substr(0, n).substr(7);r !== u && (e.up(), u = r, e.c("source", { ssrc: u, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }));var o = t.substr(n + 1);if (e.c("parameter"), -1 === o.indexOf(":")) e.attrs({ name: o });else { + var a = o.split(":", 2)[0];e.attrs({ name: a });var s = o.split(":", 2)[1];s = i.a.filterSpecialChars(s), e.attrs({ value: s }); + }e.up(); + });else { + e.up(), e.c("source", { ssrc: u, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), e.c("parameter"), e.attrs({ name: "cname", value: Math.random().toString(36).substring(7) }), e.up();var y = null, + b = APP.RTC.getLocalTracks(s.media);b && (y = b.getTrackId()), null !== y && (y = i.a.filterSpecialChars(y), e.c("parameter"), e.attrs({ name: "msid", value: y }), e.up(), e.c("parameter"), e.attrs({ name: "mslabel", value: y }), e.up(), e.c("parameter"), e.attrs({ name: "label", value: y }), e.up()); + }e.up();var S = i.a.findLines(this.media[n], "a=ssrc-group:");S.forEach(function (t) { + var n = t.indexOf(" "), + r = t.substr(0, n).substr(13), + i = t.substr(14 + r.length).split(" ");i.length && (e.c("ssrc-group", { semantics: r, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), i.forEach(function (t) { + return e.c("source", { ssrc: t }).up(); + }), e.up()); + }); + }var E = i.a.findLines(this.media[n], "a=rid");if (E.length) { + var T = E.map(function (e) { + return e.split(":")[1]; + }).map(function (e) { + return e.split(" ")[0]; + });T.forEach(function (t) { + e.c("source", { rid: t, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), e.up(); + });var _ = i.a.findLine(this.media[n], "a=simulcast");_ && (e.c("rid-group", { semantics: "SIM", xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), T.forEach(function (t) { + e.c("source", { rid: t }).up(); + }), e.up()); + }if (i.a.findLine(this.media[n], "a=rtcp-mux") && e.c("rtcp-mux").up(), this.rtcpFbToJingle(n, e, "*"), a = i.a.findLines(this.media[n], "a=extmap:"), a.length) for (r = 0; r < a.length; r++) { + if (l = i.a.parseExtmap(a[r]), e.c("rtp-hdrext", { xmlns: "urn:xmpp:jingle:apps:rtp:rtp-hdrext:0", uri: l.uri, id: l.value }), l.hasOwnProperty("direction")) switch (l.direction) {case "sendonly": + e.attrs({ senders: "responder" });break;case "recvonly": + e.attrs({ senders: "initiator" });break;case "sendrecv": + e.attrs({ senders: "both" });break;case "inactive": + e.attrs({ senders: "none" });}e.up(); + }e.up(); + }this.transportToJingle(n, e);var C = this.media[n];i.a.findLine(C, "a=sendrecv", this.session) ? e.attrs({ senders: "both" }) : i.a.findLine(C, "a=sendonly", this.session) ? e.attrs({ senders: "initiator" }) : i.a.findLine(C, "a=recvonly", this.session) ? e.attrs({ senders: "responder" }) : i.a.findLine(C, "a=inactive", this.session) && e.attrs({ senders: "none" }), "0" === s.port && e.attrs({ senders: "rejected" }), e.up(); + } + }return e.up(), e; + }, r.prototype.transportToJingle = function (e, t) { + var n = void 0, + r = this;t.c("transport");var o = i.a.findLine(this.media[e], "a=sctpmap:", r.session);if (o) { + var a = i.a.parseSCTPMap(o);t.c("sctpmap", { xmlns: "urn:xmpp:jingle:transports:dtls-sctp:1", number: a[0], protocol: a[1] }), a.length > 2 && t.attrs({ streams: a[2] }), t.up(); + }if (i.a.findLines(this.media[e], "a=fingerprint:", this.session).forEach(function (o) { + n = i.a.parseFingerprint(o), n.xmlns = "urn:xmpp:jingle:apps:dtls:0", t.c("fingerprint").t(n.fingerprint), delete n.fingerprint, o = i.a.findLine(r.media[e], "a=setup:", r.session), o && (n.setup = o.substr(8)), t.attrs(n), t.up(); + }), n = i.a.iceparams(this.media[e], this.session)) { + n.xmlns = "urn:xmpp:jingle:transports:ice-udp:1", t.attrs(n);var s = i.a.findLines(this.media[e], "a=candidate:", this.session);s.length && s.forEach(function (e) { + var n = i.a.candidateToJingle(e);r.failICE && (n.ip = "1.1.1.1");var o = n && "string" == typeof n.protocol ? n.protocol.toLowerCase() : "";r.removeTcpCandidates && ("tcp" === o || "ssltcp" === o) || r.removeUdpCandidates && "udp" === o || t.c("candidate", n).up(); + }); + }t.up(); + }, r.prototype.rtcpFbToJingle = function (e, t, n) { + i.a.findLines(this.media[e], "a=rtcp-fb:" + n).forEach(function (e) { + var n = i.a.parseRTCPFB(e);"trr-int" === n.type ? (t.c("rtcp-fb-trr-int", { xmlns: "urn:xmpp:jingle:apps:rtp:rtcp-fb:0", value: n.params[0] }), t.up()) : (t.c("rtcp-fb", { xmlns: "urn:xmpp:jingle:apps:rtp:rtcp-fb:0", type: n.type }), n.params.length > 0 && t.attrs({ subtype: n.params[0] }), t.up()); + }); + }, r.prototype.rtcpFbFromJingle = function (e, t) { + var n = "", + r = e.find('>rtcp-fb-trr-int[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');return r.length && (n += "a=rtcp-fb:* trr-int ", r.attr("value") ? n += r.attr("value") : n += "0", n += "\r\n"), r = e.find('>rtcp-fb[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]'), r.each(function () { + n += "a=rtcp-fb:" + t + " " + $(this).attr("type"), $(this).attr("subtype") && (n += " " + $(this).attr("subtype")), n += "\r\n"; + }), n; + }, r.prototype.fromJingle = function (e) { + var t = this;this.raw = "v=0\r\no=- 1923518516 2 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\n";var n = $(e).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]');n.length && n.each(function (e, n) { + var r = $(n).find(">content").map(function (e, t) { + return t.getAttribute("name"); + }).get();r.length > 0 && (t.raw += "a=group:" + (n.getAttribute("semantics") || n.getAttribute("type")) + " " + r.join(" ") + "\r\n"); + }), this.session = this.raw, e.find(">content").each(function () { + var e = t.jingle2media($(this));t.media.push(e); + }), this.raw = this.session + this.media.join(""); + }, r.prototype.jingle2media = function (e) { + var t = e.find("description"), + n = "", + r = this, + o = e.find('>transport>sctpmap[xmlns="urn:xmpp:jingle:transports:dtls-sctp:1"]'), + a = { media: t.attr("media") };if (a.port = "1", "rejected" === e.attr("senders") && (a.port = "0"), e.find(">transport>fingerprint").length || t.find("encryption").length ? a.proto = o.length ? "DTLS/SCTP" : "RTP/SAVPF" : a.proto = "RTP/AVPF", o.length) { + n += "m=application 1 DTLS/SCTP " + o.attr("number") + "\r\n", n += "a=sctpmap:" + o.attr("number") + " " + o.attr("protocol");var s = o.attr("streams");n += s ? " " + s + "\r\n" : "\r\n"; + } else a.fmt = t.find("payload-type").map(function () { + return this.getAttribute("id"); + }).get(), n += i.a.buildMLine(a) + "\r\n";switch (n += "c=IN IP4 0.0.0.0\r\n", o.length || (n += "a=rtcp:1 IN IP4 0.0.0.0\r\n"), a = e.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]'), a.length && (a.attr("ufrag") && (n += i.a.buildICEUfrag(a.attr("ufrag")) + "\r\n"), a.attr("pwd") && (n += i.a.buildICEPwd(a.attr("pwd")) + "\r\n"), a.find(">fingerprint").each(function () { + n += "a=fingerprint:" + this.getAttribute("hash"), n += " " + $(this).text(), n += "\r\n", this.getAttribute("setup") && (n += "a=setup:" + this.getAttribute("setup") + "\r\n"); + })), e.attr("senders")) {case "initiator": + n += "a=sendonly\r\n";break;case "responder": + n += "a=recvonly\r\n";break;case "none": + n += "a=inactive\r\n";break;case "both": + n += "a=sendrecv\r\n";}return n += "a=mid:" + e.attr("name") + "\r\n", t.find("rtcp-mux").length && (n += "a=rtcp-mux\r\n"), t.find("encryption").length && t.find("encryption>crypto").each(function () { + n += "a=crypto:" + this.getAttribute("tag"), n += " " + this.getAttribute("crypto-suite"), n += " " + this.getAttribute("key-params"), this.getAttribute("session-params") && (n += " " + this.getAttribute("session-params")), n += "\r\n"; + }), t.find("payload-type").each(function () { + n += i.a.buildRTPMap(this) + "\r\n", $(this).find(">parameter").length && (n += "a=fmtp:" + this.getAttribute("id") + " ", n += $(this).find("parameter").map(function () { + return (this.getAttribute("name") ? this.getAttribute("name") + "=" : "") + this.getAttribute("value"); + }).get().join("; "), n += "\r\n"), n += r.rtcpFbFromJingle($(this), this.getAttribute("id")); + }), n += r.rtcpFbFromJingle(t, "*"), a = t.find('>rtp-hdrext[xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"]'), a.each(function () { + n += "a=extmap:" + this.getAttribute("id") + " " + this.getAttribute("uri") + "\r\n"; + }), e.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function () { + var e = this.getAttribute("protocol");e = "string" == typeof e ? e.toLowerCase() : "", r.removeTcpCandidates && ("tcp" === e || "ssltcp" === e) || r.removeUdpCandidates && "udp" === e || (r.failICE && this.setAttribute("ip", "1.1.1.1"), n += i.a.candidateFromJingle(this)); + }), e.find('description>ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function () { + var e = this.getAttribute("semantics"), + t = $(this).find(">source").map(function () { + return this.getAttribute("ssrc"); + }).get();t.length && (n += "a=ssrc-group:" + e + " " + t.join(" ") + "\r\n"); + }), a = e.find('description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'), a.each(function () { + var e = this.getAttribute("ssrc");$(this).find(">parameter").each(function () { + var t = this.getAttribute("name"), + r = this.getAttribute("value");r = i.a.filterSpecialChars(r), n += "a=ssrc:" + e + " " + t, r && r.length && (n += ":" + r), n += "\r\n"; + }); + }), n; + }; + }, function (e, t) { + var n = { ENVIRONMENT: "environment", USER: "user" };e.exports = n; + }, function (e, t, n) { + "use strict"; + n.d(t, "b", function () { + return r; + }), n.d(t, "a", function () { + return i; + });var r = "signaling.peerMuted", + i = "signaling.peerVideoType"; + }, function (e, t) { + var n = { IDENTITY_UPDATED: "authentication.identity_updated" };e.exports = n; + }, function (e, t, n) { + "use strict"; + n.d(t, "a", function () { + return r; + }), n.d(t, "b", function () { + return i; + }), n.d(t, "d", function () { + return o; + }), n.d(t, "c", function () { + return a; + });var r = "statistics.audioLevel", + i = "statistics.before_disposed", + o = "statistics.byte_sent_stats", + a = "statistics.connectionstats"; + }, function (e, t) { + function n() { + throw new Error("setTimeout has not been defined"); + }function r() { + throw new Error("clearTimeout has not been defined"); + }function i(e) { + if (l === setTimeout) return setTimeout(e, 0);if ((l === n || !l) && setTimeout) return l = setTimeout, setTimeout(e, 0);try { + return l(e, 0); + } catch (t) { + try { + return l.call(null, e, 0); + } catch (t) { + return l.call(this, e, 0); + } + } + }function o(e) { + if (d === clearTimeout) return clearTimeout(e);if ((d === r || !d) && clearTimeout) return d = clearTimeout, clearTimeout(e);try { + return d(e); + } catch (t) { + try { + return d.call(null, e); + } catch (t) { + return d.call(this, e); + } + } + }function a() { + m && f && (m = !1, f.length ? h = f.concat(h) : v = -1, h.length && s()); + }function s() { + if (!m) { + var e = i(a);m = !0;for (var t = h.length; t;) { + for (f = h, h = []; ++v < t;) { + f && f[v].run(); + }v = -1, t = h.length; + }f = null, m = !1, o(e); + } + }function c(e, t) { + this.fun = e, this.array = t; + }function u() {}var l, + d, + p = e.exports = {};!function () { + try { + l = "function" == typeof setTimeout ? setTimeout : n; + } catch (e) { + l = n; + }try { + d = "function" == typeof clearTimeout ? clearTimeout : r; + } catch (e) { + d = r; + } + }();var f, + h = [], + m = !1, + v = -1;p.nextTick = function (e) { + var t = new Array(arguments.length - 1);if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) { + t[n - 1] = arguments[n]; + }h.push(new c(e, t)), 1 !== h.length || m || i(s); + }, c.prototype.run = function () { + this.fun.apply(null, this.array); + }, p.title = "browser", p.browser = !0, p.env = {}, p.argv = [], p.version = "", p.versions = {}, p.on = u, p.addListener = u, p.once = u, p.off = u, p.removeListener = u, p.removeAllListeners = u, p.emit = u, p.prependListener = u, p.prependOnceListener = u, p.listeners = function (e) { + return []; + }, p.binding = function (e) { + throw new Error("process.binding is not supported"); + }, p.cwd = function () { + return "/"; + }, p.chdir = function (e) { + throw new Error("process.chdir is not supported"); + }, p.umask = function () { + return 0; + }; + }, function (e, t) { + var n = e.exports = { v: [{ name: "version", reg: /^(\d*)$/ }], o: [{ name: "origin", reg: /^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/, names: ["username", "sessionId", "sessionVersion", "netType", "ipVer", "address"], format: "%s %s %d %s IP%d %s" }], s: [{ name: "name" }], i: [{ name: "description" }], u: [{ name: "uri" }], e: [{ name: "email" }], p: [{ name: "phone" }], z: [{ name: "timezones" }], r: [{ name: "repeats" }], t: [{ name: "timing", reg: /^(\d*) (\d*)/, names: ["start", "stop"], format: "%d %d" }], c: [{ name: "connection", reg: /^IN IP(\d) (\S*)/, names: ["version", "ip"], format: "IN IP%d %s" }], b: [{ push: "bandwidth", reg: /^(TIAS|AS|CT|RR|RS):(\d*)/, names: ["type", "limit"], format: "%s:%s" }], m: [{ reg: /^(\w*) (\d*) ([\w\/]*)(?: (.*))?/, names: ["type", "port", "protocol", "payloads"], format: "%s %d %s %s" }], a: [{ push: "rtp", reg: /^rtpmap:(\d*) ([\w\-\.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/, names: ["payload", "codec", "rate", "encoding"], format: function format(e) { + return e.encoding ? "rtpmap:%d %s/%s/%s" : e.rate ? "rtpmap:%d %s/%s" : "rtpmap:%d %s"; + } }, { push: "fmtp", reg: /^fmtp:(\d*) ([\S| ]*)/, names: ["payload", "config"], format: "fmtp:%d %s" }, { name: "control", reg: /^control:(.*)/, format: "control:%s" }, { name: "rtcp", reg: /^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/, names: ["port", "netType", "ipVer", "address"], format: function format(e) { + return null != e.address ? "rtcp:%d %s IP%d %s" : "rtcp:%d"; + } }, { push: "rtcpFbTrrInt", reg: /^rtcp-fb:(\*|\d*) trr-int (\d*)/, names: ["payload", "value"], format: "rtcp-fb:%d trr-int %d" }, { push: "rtcpFb", reg: /^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/, names: ["payload", "type", "subtype"], format: function format(e) { + return null != e.subtype ? "rtcp-fb:%s %s %s" : "rtcp-fb:%s %s"; + } }, { push: "ext", reg: /^extmap:(\d+)(?:\/(\w+))? (\S*)(?: (\S*))?/, names: ["value", "direction", "uri", "config"], format: function format(e) { + return "extmap:%d" + (e.direction ? "/%s" : "%v") + " %s" + (e.config ? " %s" : ""); + } }, { push: "crypto", reg: /^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/, names: ["id", "suite", "config", "sessionConfig"], format: function format(e) { + return null != e.sessionConfig ? "crypto:%d %s %s %s" : "crypto:%d %s %s"; + } }, { name: "setup", reg: /^setup:(\w*)/, format: "setup:%s" }, { name: "mid", reg: /^mid:([^\s]*)/, format: "mid:%s" }, { name: "msid", reg: /^msid:(.*)/, format: "msid:%s" }, { name: "ptime", reg: /^ptime:(\d*)/, format: "ptime:%d" }, { name: "maxptime", reg: /^maxptime:(\d*)/, format: "maxptime:%d" }, { name: "direction", reg: /^(sendrecv|recvonly|sendonly|inactive)/ }, { name: "icelite", reg: /^(ice-lite)/ }, { name: "iceUfrag", reg: /^ice-ufrag:(\S*)/, format: "ice-ufrag:%s" }, { name: "icePwd", reg: /^ice-pwd:(\S*)/, format: "ice-pwd:%s" }, { name: "fingerprint", reg: /^fingerprint:(\S*) (\S*)/, names: ["type", "hash"], format: "fingerprint:%s %s" }, { push: "candidates", reg: /^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/, names: ["foundation", "component", "transport", "priority", "ip", "port", "type", "raddr", "rport", "tcptype", "generation", "network-id", "network-cost"], format: function format(e) { + var t = "candidate:%s %d %s %d %s %d typ %s";return t += null != e.raddr ? " raddr %s rport %d" : "%v%v", t += null != e.tcptype ? " tcptype %s" : "%v", null != e.generation && (t += " generation %d"), t += null != e["network-id"] ? " network-id %d" : "%v", t += null != e["network-cost"] ? " network-cost %d" : "%v"; + } }, { name: "endOfCandidates", reg: /^(end-of-candidates)/ }, { name: "remoteCandidates", reg: /^remote-candidates:(.*)/, format: "remote-candidates:%s" }, { name: "iceOptions", reg: /^ice-options:(\S*)/, format: "ice-options:%s" }, { push: "ssrcs", reg: /^ssrc:(\d*) ([\w_]*)(?::(.*))?/, names: ["id", "attribute", "value"], format: function format(e) { + var t = "ssrc:%d";return null != e.attribute && (t += " %s", null != e.value && (t += ":%s")), t; + } }, { push: "ssrcGroups", reg: /^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/, names: ["semantics", "ssrcs"], format: "ssrc-group:%s %s" }, { name: "msidSemantic", reg: /^msid-semantic:\s?(\w*) (\S*)/, names: ["semantic", "token"], format: "msid-semantic: %s %s" }, { push: "groups", reg: /^group:(\w*) (.*)/, names: ["type", "mids"], format: "group:%s %s" }, { name: "rtcpMux", reg: /^(rtcp-mux)/ }, { name: "rtcpRsize", reg: /^(rtcp-rsize)/ }, { name: "sctpmap", reg: /^sctpmap:([\w_\/]*) (\S*)(?: (\S*))?/, names: ["sctpmapNumber", "app", "maxMessageSize"], format: function format(e) { + return null != e.maxMessageSize ? "sctpmap:%s %s %s" : "sctpmap:%s %s"; + } }, { name: "xGoogleFlag", reg: /^x-google-flag:([^\s]*)/, format: "x-google-flag:%s" }, { push: "rids", reg: /^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/, names: ["id", "direction", "params"], format: function format(e) { + return e.params ? "rid:%s %s %s" : "rid:%s %s"; + } }, { push: "imageattrs", reg: new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"), names: ["pt", "dir1", "attrs1", "dir2", "attrs2"], format: function format(e) { + return "imageattr:%s %s %s" + (e.dir2 ? " %s %s" : ""); + } }, { name: "simulcast", reg: new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"), names: ["dir1", "list1", "dir2", "list2"], format: function format(e) { + return "simulcast:%s %s" + (e.dir2 ? " %s %s" : ""); + } }, { name: "simulcast_03", reg: /^simulcast:[\s\t]+([\S+\s\t]+)$/, names: ["value"], format: "simulcast: %s" }, { name: "framerate", reg: /^framerate:(\d+(?:$|\.\d+))/, format: "framerate:%s" }, { push: "invalid", names: ["value"] }] };Object.keys(n).forEach(function (e) { + n[e].forEach(function (e) { + e.reg || (e.reg = /(.*)/), e.format || (e.format = "%s"); + }); + }); + }, function (e, t) { + e.exports = function (e) { + return e.webpackPolyfill || (e.deprecate = function () {}, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", { enumerable: !0, get: function get() { + return e.l; + } }), Object.defineProperty(e, "id", { enumerable: !0, get: function get() { + return e.i; + } }), e.webpackPolyfill = 1), e; + }; + }, function (e, t, n) { + "use strict"; + function r(e) { + var t = "";do { + t = s[e % c] + t, e = Math.floor(e / c); + } while (e > 0);return t; + }function i(e) { + var t = 0;for (d = 0; d < e.length; d++) { + t = t * c + u[e.charAt(d)]; + }return t; + }function o() { + var e = r(+new Date());return e !== a ? (l = 0, a = e) : e + "." + r(l++); + }for (var a, s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), c = 64, u = {}, l = 0, d = 0; d < c; d++) { + u[s[d]] = d; + }o.encode = r, o.decode = i, e.exports = o; + }, function (e, t) { + function n(e) { + if (e) return r(e); + }function r(e) { + for (var t in n.prototype) { + e[t] = n.prototype[t]; + }return e; + }e.exports = n, n.prototype.on = n.prototype.addEventListener = function (e, t) { + return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this; + }, n.prototype.once = function (e, t) { + function n() { + this.off(e, n), t.apply(this, arguments); + }return n.fn = t, this.on(e, n), this; + }, n.prototype.off = n.prototype.removeListener = n.prototype.removeAllListeners = n.prototype.removeEventListener = function (e, t) { + if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this;var n = this._callbacks["$" + e];if (!n) return this;if (1 == arguments.length) return delete this._callbacks["$" + e], this;for (var r, i = 0; i < n.length; i++) { + if ((r = n[i]) === t || r.fn === t) { + n.splice(i, 1);break; + } + }return this; + }, n.prototype.emit = function (e) { + this._callbacks = this._callbacks || {};var t = [].slice.call(arguments, 1), + n = this._callbacks["$" + e];if (n) { + n = n.slice(0);for (var r = 0, i = n.length; r < i; ++r) { + n[r].apply(this, t); + } + }return this; + }, n.prototype.listeners = function (e) { + return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || []; + }, n.prototype.hasListeners = function (e) { + return !!this.listeners(e).length; + }; + }, function (e, t, n) { + (function (e) { + function r(t) { + var n = !1, + r = !1, + s = !1 !== t.jsonp;if (e.location) { + var c = "https:" == location.protocol, + u = location.port;u || (u = c ? 443 : 80), n = t.hostname != location.hostname || u != t.port, r = t.secure != c; + }if (t.xdomain = n, t.xscheme = r, "open" in new i(t) && !t.forceJSONP) return new o(t);if (!s) throw new Error("JSONP disabled");return new a(t); + }var i = n(35), + o = n(161), + a = n(160), + s = n(162);t.polling = r, t.websocket = s; + }).call(t, n(1)); + }, function (e, t, n) { + function r(e) { + var t = e && e.forceBase64;l && !t || (this.supportsBinary = !1), i.call(this, e); + }var i = n(34), + o = n(38), + a = n(18), + s = n(21), + c = n(59), + u = n(9)("engine.io-client:polling");e.exports = r;var l = function () { + return null != new (n(35))({ xdomain: !1 }).responseType; + }();s(r, i), r.prototype.name = "polling", r.prototype.doOpen = function () { + this.poll(); + }, r.prototype.pause = function (e) { + function t() { + u("paused"), n.readyState = "paused", e(); + }var n = this;if (this.readyState = "pausing", this.polling || !this.writable) { + var r = 0;this.polling && (u("we are currently polling - waiting to pause"), r++, this.once("pollComplete", function () { + u("pre-pause polling complete"), --r || t(); + })), this.writable || (u("we are currently writing - waiting to pause"), r++, this.once("drain", function () { + u("pre-pause writing complete"), --r || t(); + })); + } else t(); + }, r.prototype.poll = function () { + u("polling"), this.polling = !0, this.doPoll(), this.emit("poll"); + }, r.prototype.onData = function (e) { + var t = this;u("polling got data %s", e);var n = function n(e, _n, r) { + if ("opening" == t.readyState && t.onOpen(), "close" == e.type) return t.onClose(), !1;t.onPacket(e); + };a.decodePayload(e, this.socket.binaryType, n), "closed" != this.readyState && (this.polling = !1, this.emit("pollComplete"), "open" == this.readyState ? this.poll() : u('ignoring poll - transport state "%s"', this.readyState)); + }, r.prototype.doClose = function () { + function e() { + u("writing close packet"), t.write([{ type: "close" }]); + }var t = this;"open" == this.readyState ? (u("transport open - closing"), e()) : (u("transport not open - deferring close"), this.once("open", e)); + }, r.prototype.write = function (e) { + var t = this;this.writable = !1;var n = function n() { + t.writable = !0, t.emit("drain"); + }, + t = this;a.encodePayload(e, this.supportsBinary, function (e) { + t.doWrite(e, n); + }); + }, r.prototype.uri = function () { + var e = this.query || {}, + t = this.secure ? "https" : "http", + n = "";return !1 !== this.timestampRequests && (e[this.timestampParam] = c()), this.supportsBinary || e.sid || (e.b64 = 1), e = o.encode(e), this.port && ("https" == t && 443 != this.port || "http" == t && 80 != this.port) && (n = ":" + this.port), e.length && (e = "?" + e), t + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + n + this.path + e; + }; + }, function (e, t) { + var n = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, + r = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"];e.exports = function (e) { + var t = e, + i = e.indexOf("["), + o = e.indexOf("]");-1 != i && -1 != o && (e = e.substring(0, i) + e.substring(i, o).replace(/:/g, ";") + e.substring(o, e.length));for (var a = n.exec(e || ""), s = {}, c = 14; c--;) { + s[r[c]] = a[c] || ""; + }return -1 != i && -1 != o && (s.source = t, s.host = s.host.substring(1, s.host.length - 1).replace(/;/g, ":"), s.authority = s.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), s.ipv6uri = !0), s; + }; + }, function (e, t, n) { + function r(e, t) { + if (!(this instanceof r)) return new r(e, t);e && "object" == typeof e && (t = e, e = void 0), t = t || {}, t.path = t.path || "/socket.io", this.nsps = {}, this.subs = [], this.opts = t, this.reconnection(!1 !== t.reconnection), this.reconnectionAttempts(t.reconnectionAttempts || 1 / 0), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor || .5), this.backoff = new p({ min: this.reconnectionDelay(), max: this.reconnectionDelayMax(), jitter: this.randomizationFactor() }), this.timeout(null == t.timeout ? 2e4 : t.timeout), this.readyState = "closed", this.uri = e, this.connecting = [], this.lastPing = null, this.encoding = !1, this.packetBuffer = [], this.encoder = new s.Encoder(), this.decoder = new s.Decoder(), this.autoConnect = !1 !== t.autoConnect, this.autoConnect && this.open(); + }var i = n(157), + o = n(66), + a = n(60), + s = n(39), + c = n(65), + u = n(40), + l = n(9)("socket.io-client:manager"), + d = n(41), + p = n(71), + f = Object.prototype.hasOwnProperty;e.exports = r, r.prototype.emitAll = function () { + this.emit.apply(this, arguments);for (var e in this.nsps) { + f.call(this.nsps, e) && this.nsps[e].emit.apply(this.nsps[e], arguments); + } + }, r.prototype.updateSocketIds = function () { + for (var e in this.nsps) { + f.call(this.nsps, e) && (this.nsps[e].id = this.engine.id); + } + }, a(r.prototype), r.prototype.reconnection = function (e) { + return arguments.length ? (this._reconnection = !!e, this) : this._reconnection; + }, r.prototype.reconnectionAttempts = function (e) { + return arguments.length ? (this._reconnectionAttempts = e, this) : this._reconnectionAttempts; + }, r.prototype.reconnectionDelay = function (e) { + return arguments.length ? (this._reconnectionDelay = e, this.backoff && this.backoff.setMin(e), this) : this._reconnectionDelay; + }, r.prototype.randomizationFactor = function (e) { + return arguments.length ? (this._randomizationFactor = e, this.backoff && this.backoff.setJitter(e), this) : this._randomizationFactor; + }, r.prototype.reconnectionDelayMax = function (e) { + return arguments.length ? (this._reconnectionDelayMax = e, this.backoff && this.backoff.setMax(e), this) : this._reconnectionDelayMax; + }, r.prototype.timeout = function (e) { + return arguments.length ? (this._timeout = e, this) : this._timeout; + }, r.prototype.maybeReconnectOnOpen = function () { + !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect(); + }, r.prototype.open = r.prototype.connect = function (e) { + if (l("readyState %s", this.readyState), ~this.readyState.indexOf("open")) return this;l("opening %s", this.uri), this.engine = i(this.uri, this.opts);var t = this.engine, + n = this;this.readyState = "opening", this.skipReconnect = !1;var r = c(t, "open", function () { + n.onopen(), e && e(); + }), + o = c(t, "error", function (t) { + if (l("connect_error"), n.cleanup(), n.readyState = "closed", n.emitAll("connect_error", t), e) { + var r = new Error("Connection error");r.data = t, e(r); + } else n.maybeReconnectOnOpen(); + });if (!1 !== this._timeout) { + var a = this._timeout;l("connect attempt will timeout after %d", a);var s = setTimeout(function () { + l("connect attempt timed out after %d", a), r.destroy(), t.close(), t.emit("error", "timeout"), n.emitAll("connect_timeout", a); + }, a);this.subs.push({ destroy: function destroy() { + clearTimeout(s); + } }); + }return this.subs.push(r), this.subs.push(o), this; + }, r.prototype.onopen = function () { + l("open"), this.cleanup(), this.readyState = "open", this.emit("open");var e = this.engine;this.subs.push(c(e, "data", u(this, "ondata"))), this.subs.push(c(e, "ping", u(this, "onping"))), this.subs.push(c(e, "pong", u(this, "onpong"))), this.subs.push(c(e, "error", u(this, "onerror"))), this.subs.push(c(e, "close", u(this, "onclose"))), this.subs.push(c(this.decoder, "decoded", u(this, "ondecoded"))); + }, r.prototype.onping = function () { + this.lastPing = new Date(), this.emitAll("ping"); + }, r.prototype.onpong = function () { + this.emitAll("pong", new Date() - this.lastPing); + }, r.prototype.ondata = function (e) { + this.decoder.add(e); + }, r.prototype.ondecoded = function (e) { + this.emit("packet", e); + }, r.prototype.onerror = function (e) { + l("error", e), this.emitAll("error", e); + }, r.prototype.socket = function (e) { + function t() { + ~d(r.connecting, n) || r.connecting.push(n); + }var n = this.nsps[e];if (!n) { + n = new o(this, e), this.nsps[e] = n;var r = this;n.on("connecting", t), n.on("connect", function () { + n.id = r.engine.id; + }), this.autoConnect && t(); + }return n; + }, r.prototype.destroy = function (e) { + var t = d(this.connecting, e);~t && this.connecting.splice(t, 1), this.connecting.length || this.close(); + }, r.prototype.packet = function (e) { + l("writing packet %j", e);var t = this;t.encoding ? t.packetBuffer.push(e) : (t.encoding = !0, this.encoder.encode(e, function (n) { + for (var r = 0; r < n.length; r++) { + t.engine.write(n[r], e.options); + }t.encoding = !1, t.processPacketQueue(); + })); + }, r.prototype.processPacketQueue = function () { + if (this.packetBuffer.length > 0 && !this.encoding) { + var e = this.packetBuffer.shift();this.packet(e); + } + }, r.prototype.cleanup = function () { + l("cleanup");for (var e; e = this.subs.shift();) { + e.destroy(); + }this.packetBuffer = [], this.encoding = !1, this.lastPing = null, this.decoder.destroy(); + }, r.prototype.close = r.prototype.disconnect = function () { + l("disconnect"), this.skipReconnect = !0, this.reconnecting = !1, "opening" == this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close(); + }, r.prototype.onclose = function (e) { + l("onclose"), this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", e), this._reconnection && !this.skipReconnect && this.reconnect(); + }, r.prototype.reconnect = function () { + if (this.reconnecting || this.skipReconnect) return this;var e = this;if (this.backoff.attempts >= this._reconnectionAttempts) l("reconnect failed"), this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = !1;else { + var t = this.backoff.duration();l("will wait %dms before reconnect attempt", t), this.reconnecting = !0;var n = setTimeout(function () { + e.skipReconnect || (l("attempting reconnect"), e.emitAll("reconnect_attempt", e.backoff.attempts), e.emitAll("reconnecting", e.backoff.attempts), e.skipReconnect || e.open(function (t) { + t ? (l("reconnect attempt error"), e.reconnecting = !1, e.reconnect(), e.emitAll("reconnect_error", t.data)) : (l("reconnect success"), e.onreconnect()); + })); + }, t);this.subs.push({ destroy: function destroy() { + clearTimeout(n); + } }); + } + }, r.prototype.onreconnect = function () { + var e = this.backoff.attempts;this.reconnecting = !1, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", e); + }; + }, function (e, t) { + function n(e, t, n) { + return e.on(t, n), { destroy: function destroy() { + e.removeListener(t, n); + } }; + }e.exports = n; + }, function (e, t, n) { + function r(e, t) { + this.io = e, this.nsp = t, this.json = this, this.ids = 0, this.acks = {}, this.receiveBuffer = [], this.sendBuffer = [], this.connected = !1, this.disconnected = !0, this.io.autoConnect && this.open(); + }var i = n(39), + o = n(60), + a = n(149), + s = n(65), + c = n(40), + u = n(9)("socket.io-client:socket"), + l = n(75);e.exports = r;var d = { connect: 1, connect_error: 1, connect_timeout: 1, connecting: 1, disconnect: 1, error: 1, reconnect: 1, reconnect_attempt: 1, reconnect_failed: 1, reconnect_error: 1, reconnecting: 1, ping: 1, pong: 1 }, + p = o.prototype.emit;o(r.prototype), r.prototype.subEvents = function () { + if (!this.subs) { + var e = this.io;this.subs = [s(e, "open", c(this, "onopen")), s(e, "packet", c(this, "onpacket")), s(e, "close", c(this, "onclose"))]; + } + }, r.prototype.open = r.prototype.connect = function () { + return this.connected ? this : (this.subEvents(), this.io.open(), "open" == this.io.readyState && this.onopen(), this.emit("connecting"), this); + }, r.prototype.send = function () { + var e = a(arguments);return e.unshift("message"), this.emit.apply(this, e), this; + }, r.prototype.emit = function (e) { + if (d.hasOwnProperty(e)) return p.apply(this, arguments), this;var t = a(arguments), + n = i.EVENT;l(t) && (n = i.BINARY_EVENT);var r = { type: n, data: t };return r.options = {}, r.options.compress = !this.flags || !1 !== this.flags.compress, "function" == typeof t[t.length - 1] && (u("emitting packet with ack id %d", this.ids), this.acks[this.ids] = t.pop(), r.id = this.ids++), this.connected ? this.packet(r) : this.sendBuffer.push(r), delete this.flags, this; + }, r.prototype.packet = function (e) { + e.nsp = this.nsp, this.io.packet(e); + }, r.prototype.onopen = function () { + u("transport is open - connecting"), "/" != this.nsp && this.packet({ type: i.CONNECT }); + }, r.prototype.onclose = function (e) { + u("close (%s)", e), this.connected = !1, this.disconnected = !0, delete this.id, this.emit("disconnect", e); + }, r.prototype.onpacket = function (e) { + if (e.nsp == this.nsp) switch (e.type) {case i.CONNECT: + this.onconnect();break;case i.EVENT:case i.BINARY_EVENT: + this.onevent(e);break;case i.ACK:case i.BINARY_ACK: + this.onack(e);break;case i.DISCONNECT: + this.ondisconnect();break;case i.ERROR: + this.emit("error", e.data);} + }, r.prototype.onevent = function (e) { + var t = e.data || [];u("emitting event %j", t), null != e.id && (u("attaching ack callback to event"), t.push(this.ack(e.id))), this.connected ? p.apply(this, t) : this.receiveBuffer.push(t); + }, r.prototype.ack = function (e) { + var t = this, + n = !1;return function () { + if (!n) { + n = !0;var r = a(arguments);u("sending ack %j", r);var o = l(r) ? i.BINARY_ACK : i.ACK;t.packet({ type: o, id: e, data: r }); + } + }; + }, r.prototype.onack = function (e) { + var t = this.acks[e.id];"function" == typeof t ? (u("calling ack %s with %j", e.id, e.data), t.apply(this, e.data), delete this.acks[e.id]) : u("bad ack %s", e.id); + }, r.prototype.onconnect = function () { + this.connected = !0, this.disconnected = !1, this.emit("connect"), this.emitBuffered(); + }, r.prototype.emitBuffered = function () { + var e;for (e = 0; e < this.receiveBuffer.length; e++) { + p.apply(this, this.receiveBuffer[e]); + }for (this.receiveBuffer = [], e = 0; e < this.sendBuffer.length; e++) { + this.packet(this.sendBuffer[e]); + }this.sendBuffer = []; + }, r.prototype.ondisconnect = function () { + u("server disconnect (%s)", this.nsp), this.destroy(), this.onclose("io server disconnect"); + }, r.prototype.destroy = function () { + if (this.subs) { + for (var e = 0; e < this.subs.length; e++) { + this.subs[e].destroy(); + }this.subs = null; + }this.io.destroy(this); + }, r.prototype.close = r.prototype.disconnect = function () { + return this.connected && (u("performing disconnect (%s)", this.nsp), this.packet({ type: i.DISCONNECT })), this.destroy(), this.connected && this.onclose("io client disconnect"), this; + }, r.prototype.compress = function (e) { + return this.flags = this.flags || {}, this.flags.compress = e, this; + }; + }, function (e, t, n) { + (function (t) { + function n(e) { + return t.Buffer && t.Buffer.isBuffer(e) || t.ArrayBuffer && e instanceof ArrayBuffer; + }e.exports = n; + }).call(t, n(1)); + }, function (e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }), function (e) { + function r(e) { + if (!k.a[e]) return null;var t = k.a[e].order, + n = null, + r = null;return Object.keys(k.a).forEach(function (e) { + var i = k.a[e];(!n || n.order < i.order && i.order < t) && (r = e, n = i); + }), r; + }function i(e, t) { + var n = e;return -1 !== t.devices.indexOf("audio") && (n += ".audio"), -1 !== t.devices.indexOf("desktop") && (n += ".desktop"), -1 !== t.devices.indexOf("video") && (n += ".video." + t.resolution), n; + }var o = n(114), + a = n.n(o), + s = n(32), + c = n(3), + u = n.n(c), + l = n(26), + d = n(5), + p = n(83), + f = n(43), + h = n(27), + m = n(84), + v = n(44), + g = n(45), + y = n.n(g), + b = n(11), + S = n(15), + E = n(16), + T = n(47), + _ = n(0), + C = n.n(_), + w = n(4), + R = n(31), + k = n.n(R), + A = n(28), + I = n(22), + P = n(2), + O = n(93), + D = n(49), + L = n.n(D), + N = n(29), + M = n(6), + x = n(30), + j = C.a.getLogger(e);t.default = { version: "development", JitsiConnection: p.a, constants: { participantConnectionStatus: A.a, sipVideoGW: x }, events: { conference: d, connection: h, track: E, mediaDevices: v, connectionQuality: s }, errors: { conference: l, connection: f, recorder: y.a, track: S }, errorTypes: { JitsiTrackError: b.a }, logLevels: C.a.levels, mediaDevices: m.a, analytics: null, init: function init(e) { + M.a.init(e), window.connectionTimes || (window.connectionTimes = {}), this.analytics = M.a.analytics, !0 === e.enableAnalyticsLogging && this.analytics.init(P.a.getBrowserName()), e.enableWindowOnErrorHandler && u.a.addHandler(this.getGlobalOnErrorHandler.bind(this));var t = e.deploymentInfo;if (t && Object.keys(t).length > 0) { + var n = {};for (var r in t) { + t.hasOwnProperty(r) && (n[r] = t[r]); + }n.id = "deployment_info", M.a.sendLog(JSON.stringify(n)); + }if (this.version) { + var i = { id: "component_version", component: "lib-jitsi-meet", version: this.version };M.a.sendLog(JSON.stringify(i)); + }return I.a.init(e || {}); + }, isDesktopSharingEnabled: function isDesktopSharingEnabled() { + return I.a.isDesktopSharingEnabled(); + }, setLogLevel: function setLogLevel(e) { + C.a.setLogLevel(e); + }, setLogLevelById: function setLogLevelById(e, t) { + C.a.setLogLevelById(e, t); + }, addGlobalLogTransport: function addGlobalLogTransport(e) { + C.a.addGlobalTransport(e); + }, removeGlobalLogTransport: function removeGlobalLogTransport(e) { + C.a.removeGlobalTransport(e); + }, createLocalTracks: function createLocalTracks(e, t) { + var n = this, + o = !1;return !0 === t && window.setTimeout(function () { + o || m.a.emitEvent(v.PERMISSION_PROMPT_IS_SHOWN, P.a.getBrowserName()); + }, 1e3), window.connectionTimes || (window.connectionTimes = {}), window.connectionTimes["obtainPermissions.start"] = window.performance.now(), I.a.obtainAudioAndVideoPermissions(e || {}).then(function (t) { + if (o = !0, window.connectionTimes["obtainPermissions.end"] = window.performance.now(), M.a.analytics.sendEvent(i("getUserMedia.success", e), { value: e }), !I.a.options.disableAudioLevels) for (var n = 0; n < t.length; n++) { + !function (e) { + var n = t[e], + r = n.getOriginalStream();n.getType() === w.a && (M.a.startLocalStats(r, n.setAudioLevel.bind(n)), n.addEventListener(E.LOCAL_TRACK_STOPPED, function () { + M.a.stopLocalStats(r); + })); + }(n); + }var r = I.a.getCurrentlyAvailableMediaDevices();if (r) for (var n = 0; n < t.length; n++) { + var a = t[n];a._setRealDeviceIdFromDeviceList(r); + }return t; + }).catch(function (t) { + if (o = !0, t.name === S.UNSUPPORTED_RESOLUTION) { + var a = e.resolution || "720", + s = r(a);if (null !== s) return e.resolution = s, j.debug("Retry createLocalTracks with resolution", s), M.a.analytics.sendEvent("getUserMedia.fail.resolution." + a), n.createLocalTracks(e); + }if (S.CHROME_EXTENSION_USER_CANCELED === t.name) { + var c = { id: "chrome_extension_user_canceled", message: t.message };M.a.sendLog(JSON.stringify(c)), M.a.analytics.sendEvent("getUserMedia.userCancel.extensionInstall"); + } else if (S.NOT_FOUND === t.name) { + var u = { id: "usermedia_missing_device", status: t.gum.devices };M.a.sendLog(JSON.stringify(u)), M.a.analytics.sendEvent("getUserMedia.deviceNotFound." + t.gum.devices.join(".")); + } else { + M.a.sendGetUserMediaFailed(t);var l = i("getUserMedia.failed", e);M.a.analytics.sendEvent(l + "." + t.name, { value: e }); + }return window.connectionTimes["obtainPermissions.end"] = window.performance.now(), Promise.reject(t); + }); + }, isDeviceListAvailable: function isDeviceListAvailable() { + return j.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.isDeviceListAvailable instead"), this.mediaDevices.isDeviceListAvailable(); + }, isDeviceChangeAvailable: function isDeviceChangeAvailable(e) { + return j.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead"), this.mediaDevices.isDeviceChangeAvailable(e); + }, isMultipleAudioInputSupported: function isMultipleAudioInputSupported() { + return this.mediaDevices.isMultipleAudioInputSupported(); + }, isCollectingLocalStats: function isCollectingLocalStats() { + return M.a.audioLevelsEnabled && T.a.isLocalStatsSupported(); + }, enumerateDevices: function enumerateDevices(e) { + j.warn("This method is deprecated, use JitsiMeetJS.mediaDevices.enumerateDevices instead"), this.mediaDevices.enumerateDevices(e); + }, getGlobalOnErrorHandler: function getGlobalOnErrorHandler(e, t, n, r, i) { + j.error("UnhandledError: " + e, "Script: " + t, "Line: " + n, "Column: " + r, "StackTrace: ", i), M.a.reportGlobalError(i); + }, getMachineId: function getMachineId() { + return N.a.getMachineId(); + }, util: { AuthUtil: a.a, RTCUIHelper: O.a, ScriptUtil: L.a } }; + }.call(t, "JitsiMeetJS.js"); + }, function (e, t) { + e.exports = function (e, t, n) { + var r = e.byteLength;if (t = t || 0, n = n || r, e.slice) return e.slice(t, n);if (t < 0 && (t += r), n < 0 && (n += r), n > r && (n = r), t >= r || t >= n || 0 === r) return new ArrayBuffer(0);for (var i = new Uint8Array(e), o = new Uint8Array(n - t), a = t, s = 0; a < n; a++, s++) { + o[s] = i[a]; + }return o.buffer; + }; + }, function (e, t, n) { + (function (n, r) { + var i, o;!function () { + function a(e) { + var t = !1;return function () { + if (t) throw new Error("Callback was already called.");t = !0, e.apply(s, arguments); + }; + }var s, + c, + u = {};s = this, null != s && (c = s.async), u.noConflict = function () { + return s.async = c, u; + };var l = Object.prototype.toString, + d = Array.isArray || function (e) { + return "[object Array]" === l.call(e); + }, + p = function p(e, t) { + if (e.forEach) return e.forEach(t);for (var n = 0; n < e.length; n += 1) { + t(e[n], n, e); + } + }, + f = function f(e, t) { + if (e.map) return e.map(t);var n = [];return p(e, function (e, r, i) { + n.push(t(e, r, i)); + }), n; + }, + h = function h(e, t, n) { + return e.reduce ? e.reduce(t, n) : (p(e, function (e, r, i) { + n = t(n, e, r, i); + }), n); + }, + m = function m(e) { + if (Object.keys) return Object.keys(e);var t = [];for (var n in e) { + e.hasOwnProperty(n) && t.push(n); + }return t; + };void 0 !== n && n.nextTick ? (u.nextTick = n.nextTick, u.setImmediate = void 0 !== r ? function (e) { + r(e); + } : u.nextTick) : "function" == typeof r ? (u.nextTick = function (e) { + r(e); + }, u.setImmediate = u.nextTick) : (u.nextTick = function (e) { + setTimeout(e, 0); + }, u.setImmediate = u.nextTick), u.each = function (e, t, n) { + function r(t) { + t ? (n(t), n = function n() {}) : (i += 1) >= e.length && n(); + }if (n = n || function () {}, !e.length) return n();var i = 0;p(e, function (e) { + t(e, a(r)); + }); + }, u.forEach = u.each, u.eachSeries = function (e, t, n) { + if (n = n || function () {}, !e.length) return n();var r = 0;!function i() { + t(e[r], function (t) { + t ? (n(t), n = function n() {}) : (r += 1, r >= e.length ? n() : i()); + }); + }(); + }, u.forEachSeries = u.eachSeries, u.eachLimit = function (e, t, n, r) { + v(t).apply(null, [e, n, r]); + }, u.forEachLimit = u.eachLimit;var v = function v(e) { + return function (t, n, r) { + if (r = r || function () {}, !t.length || e <= 0) return r();var i = 0, + o = 0, + a = 0;!function s() { + if (i >= t.length) return r();for (; a < e && o < t.length;) { + o += 1, a += 1, n(t[o - 1], function (e) { + e ? (r(e), r = function r() {}) : (i += 1, a -= 1, i >= t.length ? r() : s()); + }); + } + }(); + }; + }, + g = function g(e) { + return function () { + var t = Array.prototype.slice.call(arguments);return e.apply(null, [u.each].concat(t)); + }; + }, + y = function y(e, t) { + return function () { + var n = Array.prototype.slice.call(arguments);return t.apply(null, [v(e)].concat(n)); + }; + }, + b = function b(e) { + return function () { + var t = Array.prototype.slice.call(arguments);return e.apply(null, [u.eachSeries].concat(t)); + }; + }, + S = function S(e, t, n, r) { + if (t = f(t, function (e, t) { + return { index: t, value: e }; + }), r) { + var i = [];e(t, function (e, t) { + n(e.value, function (n, r) { + i[e.index] = r, t(n); + }); + }, function (e) { + r(e, i); + }); + } else e(t, function (e, t) { + n(e.value, function (e) { + t(e); + }); + }); + };u.map = g(S), u.mapSeries = b(S), u.mapLimit = function (e, t, n, r) { + return E(t)(e, n, r); + };var E = function E(e) { + return y(e, S); + };u.reduce = function (e, t, n, r) { + u.eachSeries(e, function (e, r) { + n(t, e, function (e, n) { + t = n, r(e); + }); + }, function (e) { + r(e, t); + }); + }, u.inject = u.reduce, u.foldl = u.reduce, u.reduceRight = function (e, t, n, r) { + var i = f(e, function (e) { + return e; + }).reverse();u.reduce(i, t, n, r); + }, u.foldr = u.reduceRight;var T = function T(e, t, n, r) { + var i = [];t = f(t, function (e, t) { + return { index: t, value: e }; + }), e(t, function (e, t) { + n(e.value, function (n) { + n && i.push(e), t(); + }); + }, function (e) { + r(f(i.sort(function (e, t) { + return e.index - t.index; + }), function (e) { + return e.value; + })); + }); + };u.filter = g(T), u.filterSeries = b(T), u.select = u.filter, u.selectSeries = u.filterSeries;var _ = function _(e, t, n, r) { + var i = [];t = f(t, function (e, t) { + return { index: t, value: e }; + }), e(t, function (e, t) { + n(e.value, function (n) { + n || i.push(e), t(); + }); + }, function (e) { + r(f(i.sort(function (e, t) { + return e.index - t.index; + }), function (e) { + return e.value; + })); + }); + };u.reject = g(_), u.rejectSeries = b(_);var C = function C(e, t, n, r) { + e(t, function (e, t) { + n(e, function (n) { + n ? (r(e), r = function r() {}) : t(); + }); + }, function (e) { + r(); + }); + };u.detect = g(C), u.detectSeries = b(C), u.some = function (e, t, n) { + u.each(e, function (e, r) { + t(e, function (e) { + e && (n(!0), n = function n() {}), r(); + }); + }, function (e) { + n(!1); + }); + }, u.any = u.some, u.every = function (e, t, n) { + u.each(e, function (e, r) { + t(e, function (e) { + e || (n(!1), n = function n() {}), r(); + }); + }, function (e) { + n(!0); + }); + }, u.all = u.every, u.sortBy = function (e, t, n) { + u.map(e, function (e, n) { + t(e, function (t, r) { + t ? n(t) : n(null, { value: e, criteria: r }); + }); + }, function (e, t) { + if (e) return n(e);var r = function r(e, t) { + var n = e.criteria, + r = t.criteria;return n < r ? -1 : n > r ? 1 : 0; + };n(null, f(t.sort(r), function (e) { + return e.value; + })); + }); + }, u.auto = function (e, t) { + t = t || function () {};var n = m(e), + r = n.length;if (!r) return t();var i = {}, + o = [], + a = function a(e) { + o.unshift(e); + }, + s = function s(e) { + for (var t = 0; t < o.length; t += 1) { + if (o[t] === e) return void o.splice(t, 1); + } + }, + c = function c() { + r--, p(o.slice(0), function (e) { + e(); + }); + };a(function () { + if (!r) { + var e = t;t = function t() {}, e(null, i); + } + }), p(n, function (n) { + var r = d(e[n]) ? e[n] : [e[n]], + o = function o(e) { + var r = Array.prototype.slice.call(arguments, 1);if (r.length <= 1 && (r = r[0]), e) { + var o = {};p(m(i), function (e) { + o[e] = i[e]; + }), o[n] = r, t(e, o), t = function t() {}; + } else i[n] = r, u.setImmediate(c); + }, + l = r.slice(0, Math.abs(r.length - 1)) || [], + f = function f() { + return h(l, function (e, t) { + return e && i.hasOwnProperty(t); + }, !0) && !i.hasOwnProperty(n); + };f() ? r[r.length - 1](o, i) : a(function e() { + f() && (s(e), r[r.length - 1](o, i)); + }); + }); + }, u.retry = function (e, t, n) { + var r = [];"function" == typeof e && (n = t, t = e, e = 5), e = parseInt(e, 10) || 5;var i = function (_i2) { + function i(_x4, _x5) { + return _i2.apply(this, arguments); + } + + i.toString = function () { + return _i2.toString(); + }; + + return i; + }(function (i, o) { + for (; e;) { + r.push(function (e, t) { + return function (n) { + e(function (e, r) { + n(!e || t, { err: e, result: r }); + }, o); + }; + }(t, !(e -= 1))); + }u.series(r, function (e, t) { + t = t[t.length - 1], (i || n)(t.err, t.result); + }); + });return n ? i() : i; + }, u.waterfall = function (e, t) { + if (t = t || function () {}, !d(e)) { + var n = new Error("First argument to waterfall must be an array of functions");return t(n); + }if (!e.length) return t();!function e(n) { + return function (r) { + if (r) t.apply(null, arguments), t = function t() {};else { + var i = Array.prototype.slice.call(arguments, 1), + o = n.next();o ? i.push(e(o)) : i.push(t), u.setImmediate(function () { + n.apply(null, i); + }); + } + }; + }(u.iterator(e))(); + };var w = function w(e, t, n) { + if (n = n || function () {}, d(t)) e.map(t, function (e, t) { + e && e(function (e) { + var n = Array.prototype.slice.call(arguments, 1);n.length <= 1 && (n = n[0]), t.call(null, e, n); + }); + }, n);else { + var r = {};e.each(m(t), function (e, n) { + t[e](function (t) { + var i = Array.prototype.slice.call(arguments, 1);i.length <= 1 && (i = i[0]), r[e] = i, n(t); + }); + }, function (e) { + n(e, r); + }); + } + };u.parallel = function (e, t) { + w({ map: u.map, each: u.each }, e, t); + }, u.parallelLimit = function (e, t, n) { + w({ map: E(t), each: v(t) }, e, n); + }, u.series = function (e, t) { + if (t = t || function () {}, d(e)) u.mapSeries(e, function (e, t) { + e && e(function (e) { + var n = Array.prototype.slice.call(arguments, 1);n.length <= 1 && (n = n[0]), t.call(null, e, n); + }); + }, t);else { + var n = {};u.eachSeries(m(e), function (t, r) { + e[t](function (e) { + var i = Array.prototype.slice.call(arguments, 1);i.length <= 1 && (i = i[0]), n[t] = i, r(e); + }); + }, function (e) { + t(e, n); + }); + } + }, u.iterator = function (e) { + return function t(n) { + var r = function t() { + return e.length && e[n].apply(null, arguments), t.next(); + };return r.next = function () { + return n < e.length - 1 ? t(n + 1) : null; + }, r; + }(0); + }, u.apply = function (e) { + var t = Array.prototype.slice.call(arguments, 1);return function () { + return e.apply(null, t.concat(Array.prototype.slice.call(arguments))); + }; + };var R = function R(e, t, n, r) { + var i = [];e(t, function (e, t) { + n(e, function (e, n) { + i = i.concat(n || []), t(e); + }); + }, function (e) { + r(e, i); + }); + };u.concat = g(R), u.concatSeries = b(R), u.whilst = function (e, t, n) { + e() ? t(function (r) { + if (r) return n(r);u.whilst(e, t, n); + }) : n(); + }, u.doWhilst = function (e, t, n) { + e(function (r) { + if (r) return n(r);var i = Array.prototype.slice.call(arguments, 1);t.apply(null, i) ? u.doWhilst(e, t, n) : n(); + }); + }, u.until = function (e, t, n) { + e() ? n() : t(function (r) { + if (r) return n(r);u.until(e, t, n); + }); + }, u.doUntil = function (e, t, n) { + e(function (r) { + if (r) return n(r);var i = Array.prototype.slice.call(arguments, 1);t.apply(null, i) ? n() : u.doUntil(e, t, n); + }); + }, u.queue = function (e, t) { + function n(e, t, n, r) { + if (e.started || (e.started = !0), d(t) || (t = [t]), 0 == t.length) return u.setImmediate(function () { + e.drain && e.drain(); + });p(t, function (t) { + var i = { data: t, callback: "function" == typeof r ? r : null };n ? e.tasks.unshift(i) : e.tasks.push(i), e.saturated && e.tasks.length === e.concurrency && e.saturated(), u.setImmediate(e.process); + }); + }void 0 === t && (t = 1);var r = 0, + i = { tasks: [], concurrency: t, saturated: null, empty: null, drain: null, started: !1, paused: !1, push: function push(e, t) { + n(i, e, !1, t); + }, kill: function kill() { + i.drain = null, i.tasks = []; + }, unshift: function unshift(e, t) { + n(i, e, !0, t); + }, process: function process() { + if (!i.paused && r < i.concurrency && i.tasks.length) { + var t = i.tasks.shift();i.empty && 0 === i.tasks.length && i.empty(), r += 1;var n = function n() { + r -= 1, t.callback && t.callback.apply(t, arguments), i.drain && i.tasks.length + r === 0 && i.drain(), i.process(); + }, + o = a(n);e(t.data, o); + } + }, length: function length() { + return i.tasks.length; + }, running: function running() { + return r; + }, idle: function idle() { + return i.tasks.length + r === 0; + }, pause: function pause() { + !0 !== i.paused && (i.paused = !0, i.process()); + }, resume: function resume() { + !1 !== i.paused && (i.paused = !1, i.process()); + } };return i; + }, u.priorityQueue = function (e, t) { + function n(e, t) { + return e.priority - t.priority; + }function r(e, t, n) { + for (var r = -1, i = e.length - 1; r < i;) { + var o = r + (i - r + 1 >>> 1);n(t, e[o]) >= 0 ? r = o : i = o - 1; + }return r; + }function i(e, t, i, o) { + if (e.started || (e.started = !0), d(t) || (t = [t]), 0 == t.length) return u.setImmediate(function () { + e.drain && e.drain(); + });p(t, function (t) { + var a = { data: t, priority: i, callback: "function" == typeof o ? o : null };e.tasks.splice(r(e.tasks, a, n) + 1, 0, a), e.saturated && e.tasks.length === e.concurrency && e.saturated(), u.setImmediate(e.process); + }); + }var o = u.queue(e, t);return o.push = function (e, t, n) { + i(o, e, t, n); + }, delete o.unshift, o; + }, u.cargo = function (e, t) { + var n = !1, + r = [], + i = { tasks: r, payload: t, saturated: null, empty: null, drain: null, drained: !0, push: function push(e, n) { + d(e) || (e = [e]), p(e, function (e) { + r.push({ data: e, callback: "function" == typeof n ? n : null }), i.drained = !1, i.saturated && r.length === t && i.saturated(); + }), u.setImmediate(i.process); + }, process: function o() { + if (!n) { + if (0 === r.length) return i.drain && !i.drained && i.drain(), void (i.drained = !0);var a = "number" == typeof t ? r.splice(0, t) : r.splice(0, r.length), + s = f(a, function (e) { + return e.data; + });i.empty && i.empty(), n = !0, e(s, function () { + n = !1;var e = arguments;p(a, function (t) { + t.callback && t.callback.apply(null, e); + }), o(); + }); + } + }, length: function length() { + return r.length; + }, running: function running() { + return n; + } };return i; + };var k = function k(e) { + return function (t) { + var n = Array.prototype.slice.call(arguments, 1);t.apply(null, n.concat([function (t) { + var n = Array.prototype.slice.call(arguments, 1);"undefined" != typeof console && (t ? console.error && console.error(t) : console[e] && p(n, function (t) { + console[e](t); + })); + }])); + }; + };u.log = k("log"), u.dir = k("dir"), u.memoize = function (e, t) { + var n = {}, + r = {};t = t || function (e) { + return e; + };var i = function i() { + var i = Array.prototype.slice.call(arguments), + o = i.pop(), + a = t.apply(null, i);a in n ? u.nextTick(function () { + o.apply(null, n[a]); + }) : a in r ? r[a].push(o) : (r[a] = [o], e.apply(null, i.concat([function () { + n[a] = arguments;var e = r[a];delete r[a];for (var t = 0, i = e.length; t < i; t++) { + e[t].apply(null, arguments); + } + }]))); + };return i.memo = n, i.unmemoized = e, i; + }, u.unmemoize = function (e) { + return function () { + return (e.unmemoized || e).apply(null, arguments); + }; + }, u.times = function (e, t, n) { + for (var r = [], i = 0; i < e; i++) { + r.push(i); + }return u.map(r, t, n); + }, u.timesSeries = function (e, t, n) { + for (var r = [], i = 0; i < e; i++) { + r.push(i); + }return u.mapSeries(r, t, n); + }, u.seq = function () { + var e = arguments;return function () { + var t = this, + n = Array.prototype.slice.call(arguments), + r = n.pop();u.reduce(e, n, function (e, n, r) { + n.apply(t, e.concat([function () { + var e = arguments[0], + t = Array.prototype.slice.call(arguments, 1);r(e, t); + }])); + }, function (e, n) { + r.apply(t, [e].concat(n)); + }); + }; + }, u.compose = function () { + return u.seq.apply(null, Array.prototype.reverse.call(arguments)); + };var A = function A(e, t) { + var n = function n() { + var n = this, + r = Array.prototype.slice.call(arguments), + i = r.pop();return e(t, function (e, t) { + e.apply(n, r.concat([t])); + }, i); + };return arguments.length > 2 ? n.apply(this, Array.prototype.slice.call(arguments, 2)) : n; + };u.applyEach = g(A), u.applyEachSeries = b(A), u.forever = function (e, t) { + function n(r) { + if (r) { + if (t) return t(r);throw r; + }e(n); + }n(); + }, void 0 !== e && e.exports ? e.exports = u : (i = [], void 0 !== (o = function () { + return u; + }.apply(t, i)) && (e.exports = o)); + }(); + }).call(t, n(56), n(148).setImmediate); + }, function (e, t) { + function n(e) { + e = e || {}, this.ms = e.min || 100, this.max = e.max || 1e4, this.factor = e.factor || 2, this.jitter = e.jitter > 0 && e.jitter <= 1 ? e.jitter : 0, this.attempts = 0; + }e.exports = n, n.prototype.duration = function () { + var e = this.ms * Math.pow(this.factor, this.attempts++);if (this.jitter) { + var t = Math.random(), + n = Math.floor(t * this.jitter * e);e = 0 == (1 & Math.floor(10 * t)) ? e - n : e + n; + }return 0 | Math.min(e, this.max); + }, n.prototype.reset = function () { + this.attempts = 0; + }, n.prototype.setMin = function (e) { + this.ms = e; + }, n.prototype.setMax = function (e) { + this.max = e; + }, n.prototype.setJitter = function (e) { + this.jitter = e; + }; + }, function (e, t, n) { + (function (t) { + function n(e) { + for (var t = 0; t < e.length; t++) { + var n = e[t];if (n.buffer instanceof ArrayBuffer) { + var r = n.buffer;if (n.byteLength !== r.byteLength) { + var i = new Uint8Array(n.byteLength);i.set(new Uint8Array(r, n.byteOffset, n.byteLength)), r = i.buffer; + }e[t] = r; + } + } + }function r(e, t) { + t = t || {};var r = new o();n(e);for (var i = 0; i < e.length; i++) { + r.append(e[i]); + }return t.type ? r.getBlob(t.type) : r.getBlob(); + }function i(e, t) { + return n(e), new Blob(e, t || {}); + }var o = t.BlobBuilder || t.WebKitBlobBuilder || t.MSBlobBuilder || t.MozBlobBuilder, + a = function () { + try { + return 2 === new Blob(["hi"]).size; + } catch (e) { + return !1; + } + }(), + s = a && function () { + try { + return 2 === new Blob([new Uint8Array([1, 2])]).size; + } catch (e) { + return !1; + } + }(), + c = o && o.prototype.append && o.prototype.getBlob;e.exports = function () { + return a ? s ? t.Blob : i : c ? r : void 0; + }(); + }).call(t, n(1)); + }, function (e, t, n) { + var r, i, o;"function" == typeof Symbol && (typeof Symbol === "function" ? Symbol.iterator : "@@iterator"), function (n, a) { + i = [], r = a, void 0 !== (o = "function" == typeof r ? r.apply(t, i) : r) && (e.exports = o); + }(this || window, function () { + function e(e, t) { + var n, + r = null;if (t = t || u, "string" == typeof e && e) for (n = t.length; n--;) { + if (t[n].src === e) { + r = t[n];break; + } + }return r; + }function t(e) { + var t, + n, + r = null;for (e = e || u, t = 0, n = e.length; t < n; t++) { + if (!e[t].hasAttribute("src")) { + if (r) { + r = null;break; + }r = e[t]; + } + }return r; + }function n(e, t) { + var r, + i, + o = null, + a = "number" == typeof t;return t = a ? Math.round(t) : 0, "string" == typeof e && e && (a ? r = e.match(/(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/) : (r = e.match(/^(?:|[^:@]*@|.+\)@(?=data:text\/javascript|blob|http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/)) && r[1] || (r = e.match(/\)@(data:text\/javascript(?:;[^,]+)?,.+?|(?:|blob:)(?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/)), r && r[1] && (t > 0 ? (i = e.slice(e.indexOf(r[0]) + r[0].length), o = n(i, t - 1)) : o = r[1])), o; + }function r() { + return null; + }function i() { + return null; + }function o() { + if (0 === u.length) return null;var r, + i, + s, + m, + v, + g = [], + y = o.skipStackDepth || 1;for (r = 0; r < u.length; r++) { + d && l ? a.test(u[r].readyState) && g.push(u[r]) : g.push(u[r]); + }if (i = new Error(), f && (s = i.stack), !s && h) try { + throw i; + } catch (e) { + s = e.stack; + }if (s && (m = n(s, y), !(v = e(m, g)) && c && m === c && (v = t(g))), v || 1 === g.length && (v = g[0]), v || p && (v = document.currentScript), !v && d && l) for (r = g.length; r--;) { + if ("interactive" === g[r].readyState) { + v = g[r];break; + } + }return v || (v = g[g.length - 1] || null), v; + }var a = /^(interactive|loaded|complete)$/, + s = window.location ? window.location.href : null, + c = s ? s.replace(/#.*$/, "").replace(/\?.*$/, "") || null : null, + u = document.getElementsByTagName("script"), + l = "readyState" in (u[0] || document.createElement("script")), + d = !window.opera || "[object Opera]" !== window.opera.toString(), + p = "currentScript" in document;"stackTraceLimit" in Error && Error.stackTraceLimit !== 1 / 0 && (Error.stackTraceLimit, Error.stackTraceLimit = 1 / 0);var f = !1, + h = !1;!function () { + try { + var e = new Error();throw f = "string" == typeof e.stack && !!e.stack, e; + } catch (e) { + h = "string" == typeof e.stack && !!e.stack; + } + }(), o.skipStackDepth = 1;var m = o;return m.near = o, m.far = r, m.origin = i, m; + }); + }, function (e, t, n) { + (function (t) { + var n;n = "undefined" != typeof window ? window : void 0 !== t ? t : "undefined" != typeof self ? self : {}, e.exports = n; + }).call(t, n(1)); + }, function (e, t, n) { + (function (t) { + function r(e) { + function n(e) { + if (!e) return !1;if (t.Buffer && t.Buffer.isBuffer && t.Buffer.isBuffer(e) || t.ArrayBuffer && e instanceof ArrayBuffer || t.Blob && e instanceof Blob || t.File && e instanceof File) return !0;if (o(e)) { + for (var r = 0; r < e.length; r++) { + if (n(e[r])) return !0; + } + } else if (e && "object" == (void 0 === e ? "undefined" : i(e))) { + e.toJSON && "function" == typeof e.toJSON && (e = e.toJSON());for (var a in e) { + if (Object.prototype.hasOwnProperty.call(e, a) && n(e[a])) return !0; + } + }return !1; + }return n(e); + }var i = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + o = n(76);e.exports = r; + }).call(t, n(1)); + }, function (e, t) { + e.exports = Array.isArray || function (e) { + return "[object Array]" == Object.prototype.toString.call(e); + }; + }, function (e, t) { + try { + e.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest(); + } catch (t) { + e.exports = !1; + } + }, function (e, t, n) { + function r(e, t) { + this.logStorage = e, this.stringifyObjects = !(!t || !t.stringifyObjects) && t.stringifyObjects, this.storeInterval = t && t.storeInterval ? t.storeInterval : 3e4, this.maxEntryLength = t && t.maxEntryLength ? t.maxEntryLength : 1e4, Object.keys(o.levels).forEach(function (e) { + this[o.levels[e]] = function (e) { + this._log.apply(this, arguments); + }.bind(this, e); + }.bind(this)), this.storeLogsIntervalID = null, this.queue = [], this.totalLen = 0, this.outputCache = []; + }var i = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + o = n(42);r.prototype.stringify = function (e) { + try { + return JSON.stringify(e); + } catch (e) { + return "[object with circular refs?]"; + } + }, r.prototype.formatLogMessage = function (e) { + for (var t = "", n = 1, r = arguments.length; n < r; n++) { + var a = arguments[n];!this.stringifyObjects && e !== o.levels.ERROR || "object" !== (void 0 === a ? "undefined" : i(a)) || (a = this.stringify(a)), t += a, n != r - 1 && (t += " "); + }return t.length ? t : null; + }, r.prototype._log = function () { + var e = this.formatLogMessage.apply(this, arguments);if (e) { + var t = this.queue.length ? this.queue[this.queue.length - 1] : void 0;("object" === (void 0 === t ? "undefined" : i(t)) ? t.text : t) == e ? "object" === (void 0 === t ? "undefined" : i(t)) ? t.count += 1 : this.queue[this.queue.length - 1] = { text: e, count: 2 } : (this.queue.push(e), this.totalLen += e.length); + }this.totalLen >= this.maxEntryLength && this._flush(!0, !0); + }, r.prototype.start = function () { + this._reschedulePublishInterval(); + }, r.prototype._reschedulePublishInterval = function () { + this.storeLogsIntervalID && (window.clearTimeout(this.storeLogsIntervalID), this.storeLogsIntervalID = null), this.storeLogsIntervalID = window.setTimeout(this._flush.bind(this, !1, !0), this.storeInterval); + }, r.prototype.flush = function () { + this._flush(!1, !0); + }, r.prototype._flush = function (e, t) { + this.totalLen > 0 && (this.logStorage.isReady() || e) && (this.logStorage.isReady() ? (this.outputCache.length && (this.outputCache.forEach(function (e) { + this.logStorage.storeLogs(e); + }.bind(this)), this.outputCache = []), this.logStorage.storeLogs(this.queue)) : this.outputCache.push(this.queue), this.queue = [], this.totalLen = 0), t && this._reschedulePublishInterval(); + }, r.prototype.stop = function () { + this._flush(!1, !1); + }, e.exports = r; + }, function (e, t, n) { + (function (e, r) { + var i, + o = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + };(function () { + function a(e, t) { + function n(e) { + if (n[e] !== g) return n[e];var o;if ("bug-string-char-index" == e) o = "a" != "a"[0];else if ("json" == e) o = n("json-stringify") && n("json-parse");else { + var a, + s = "{\"a\":[1,true,false,null,\"\\u0000\\b\\n\\f\\r\\t\"]}";if ("json-stringify" == e) { + var c = t.stringify, + l = "function" == typeof c && S;if (l) { + (a = function a() { + return 1; + }).toJSON = a;try { + l = "0" === c(0) && "0" === c(new r()) && '""' == c(new i()) && c(b) === g && c(g) === g && c() === g && "1" === c(a) && "[1]" == c([a]) && "[null]" == c([g]) && "null" == c(null) && "[null,null,null]" == c([g, b, null]) && c({ a: [a, !0, !1, null, "\0\b\n\f\r\t"] }) == s && "1" === c(null, a) && "[\n 1,\n 2\n]" == c([1, 2], null, 1) && '"-271821-04-20T00:00:00.000Z"' == c(new u(-864e13)) && '"+275760-09-13T00:00:00.000Z"' == c(new u(864e13)) && '"-000001-01-01T00:00:00.000Z"' == c(new u(-621987552e5)) && '"1969-12-31T23:59:59.999Z"' == c(new u(-1)); + } catch (e) { + l = !1; + } + }o = l; + }if ("json-parse" == e) { + var d = t.parse;if ("function" == typeof d) try { + if (0 === d("0") && !d(!1)) { + a = d(s);var p = 5 == a.a.length && 1 === a.a[0];if (p) { + try { + p = !d('"\t"'); + } catch (e) {}if (p) try { + p = 1 !== d("01"); + } catch (e) {}if (p) try { + p = 1 !== d("1."); + } catch (e) {} + } + } + } catch (e) { + p = !1; + }o = p; + } + }return n[e] = !!o; + }e || (e = l.Object()), t || (t = l.Object());var r = e.Number || l.Number, + i = e.String || l.String, + s = e.Object || l.Object, + u = e.Date || l.Date, + d = e.SyntaxError || l.SyntaxError, + p = e.TypeError || l.TypeError, + f = e.Math || l.Math, + h = e.JSON || l.JSON;"object" == (void 0 === h ? "undefined" : o(h)) && h && (t.stringify = h.stringify, t.parse = h.parse);var _m, + _v, + g, + y = s.prototype, + b = y.toString, + S = new u(-0xc782b5b800cec);try { + S = -109252 == S.getUTCFullYear() && 0 === S.getUTCMonth() && 1 === S.getUTCDate() && 10 == S.getUTCHours() && 37 == S.getUTCMinutes() && 6 == S.getUTCSeconds() && 708 == S.getUTCMilliseconds(); + } catch (e) {}if (!n("json")) { + var E = n("bug-string-char-index");if (!S) var T = f.floor, + _ = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + C = function C(e, t) { + return _[t] + 365 * (e - 1970) + T((e - 1969 + (t = +(t > 1))) / 4) - T((e - 1901 + t) / 100) + T((e - 1601 + t) / 400); + };if ((_m = y.hasOwnProperty) || (_m = function m(e) { + var t, + n = {};return (n.__proto__ = null, n.__proto__ = { toString: 1 }, n).toString != b ? _m = function m(e) { + var t = this.__proto__, + n = e in (this.__proto__ = null, this);return this.__proto__ = t, n; + } : (t = n.constructor, _m = function m(e) { + var n = (this.constructor || t).prototype;return e in this && !(e in n && this[e] === n[e]); + }), n = null, _m.call(this, e); + }), _v = function v(e, t) { + var n, + r, + i, + a = 0;(n = function n() { + this.valueOf = 0; + }).prototype.valueOf = 0, r = new n();for (i in r) { + _m.call(r, i) && a++; + }return n = r = null, a ? _v = 2 == a ? function (e, t) { + var n, + r = {}, + i = "[object Function]" == b.call(e);for (n in e) { + i && "prototype" == n || _m.call(r, n) || !(r[n] = 1) || !_m.call(e, n) || t(n); + } + } : function (e, t) { + var n, + r, + i = "[object Function]" == b.call(e);for (n in e) { + i && "prototype" == n || !_m.call(e, n) || (r = "constructor" === n) || t(n); + }(r || _m.call(e, n = "constructor")) && t(n); + } : (r = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"], _v = function v(e, t) { + var n, + i, + a = "[object Function]" == b.call(e), + s = !a && "function" != typeof e.constructor && c[o(e.hasOwnProperty)] && e.hasOwnProperty || _m;for (n in e) { + a && "prototype" == n || !s.call(e, n) || t(n); + }for (i = r.length; n = r[--i]; s.call(e, n) && t(n)) {} + }), _v(e, t); + }, !n("json-stringify")) { + var w = { 92: "\\\\", 34: '\\"', 8: "\\b", 12: "\\f", 10: "\\n", 13: "\\r", 9: "\\t" }, + R = function R(e, t) { + return ("000000" + (t || 0)).slice(-e); + }, + k = function k(e) { + for (var t = '"', n = 0, r = e.length, i = !E || r > 10, o = i && (E ? e.split("") : e); n < r; n++) { + var a = e.charCodeAt(n);switch (a) {case 8:case 9:case 10:case 12:case 13:case 34:case 92: + t += w[a];break;default: + if (a < 32) { + t += "\\u00" + R(2, a.toString(16));break; + }t += i ? o[n] : e.charAt(n);} + }return t + '"'; + }, + A = function e(t, n, r, i, a, s, c) { + var u, l, d, f, h, y, S, E, _, w, A, I, P, O, D, L;try { + u = n[t]; + } catch (e) {}if ("object" == (void 0 === u ? "undefined" : o(u)) && u) if ("[object Date]" != (l = b.call(u)) || _m.call(u, "toJSON")) "function" == typeof u.toJSON && ("[object Number]" != l && "[object String]" != l && "[object Array]" != l || _m.call(u, "toJSON")) && (u = u.toJSON(t));else if (u > -1 / 0 && u < 1 / 0) { + if (C) { + for (h = T(u / 864e5), d = T(h / 365.2425) + 1970 - 1; C(d + 1, 0) <= h; d++) {}for (f = T((h - C(d, 0)) / 30.42); C(d, f + 1) <= h; f++) {}h = 1 + h - C(d, f), y = (u % 864e5 + 864e5) % 864e5, S = T(y / 36e5) % 24, E = T(y / 6e4) % 60, _ = T(y / 1e3) % 60, w = y % 1e3; + } else d = u.getUTCFullYear(), f = u.getUTCMonth(), h = u.getUTCDate(), S = u.getUTCHours(), E = u.getUTCMinutes(), _ = u.getUTCSeconds(), w = u.getUTCMilliseconds();u = (d <= 0 || d >= 1e4 ? (d < 0 ? "-" : "+") + R(6, d < 0 ? -d : d) : R(4, d)) + "-" + R(2, f + 1) + "-" + R(2, h) + "T" + R(2, S) + ":" + R(2, E) + ":" + R(2, _) + "." + R(3, w) + "Z"; + } else u = null;if (r && (u = r.call(n, t, u)), null === u) return "null";if ("[object Boolean]" == (l = b.call(u))) return "" + u;if ("[object Number]" == l) return u > -1 / 0 && u < 1 / 0 ? "" + u : "null";if ("[object String]" == l) return k("" + u);if ("object" == (void 0 === u ? "undefined" : o(u))) { + for (O = c.length; O--;) { + if (c[O] === u) throw p(); + }if (c.push(u), A = [], D = s, s += a, "[object Array]" == l) { + for (P = 0, O = u.length; P < O; P++) { + I = e(P, u, r, i, a, s, c), A.push(I === g ? "null" : I); + }L = A.length ? a ? "[\n" + s + A.join(",\n" + s) + "\n" + D + "]" : "[" + A.join(",") + "]" : "[]"; + } else _v(i || u, function (t) { + var n = e(t, u, r, i, a, s, c);n !== g && A.push(k(t) + ":" + (a ? " " : "") + n); + }), L = A.length ? a ? "{\n" + s + A.join(",\n" + s) + "\n" + D + "}" : "{" + A.join(",") + "}" : "{}";return c.pop(), L; + } + };t.stringify = function (e, t, n) { + var r, i, a, s;if (c[void 0 === t ? "undefined" : o(t)] && t) if ("[object Function]" == (s = b.call(t))) i = t;else if ("[object Array]" == s) { + a = {};for (var u, l = 0, d = t.length; l < d; u = t[l++], ("[object String]" == (s = b.call(u)) || "[object Number]" == s) && (a[u] = 1)) {} + }if (n) if ("[object Number]" == (s = b.call(n))) { + if ((n -= n % 1) > 0) for (r = "", n > 10 && (n = 10); r.length < n; r += " ") {} + } else "[object String]" == s && (r = n.length <= 10 ? n : n.slice(0, 10));return A("", (u = {}, u[""] = e, u), i, a, r, "", []); + }; + }if (!n("json-parse")) { + var I, + P, + O = i.fromCharCode, + D = { 92: "\\", 34: '"', 47: "/", 98: "\b", 116: "\t", 110: "\n", 102: "\f", 114: "\r" }, + L = function L() { + throw I = P = null, d(); + }, + N = function N() { + for (var e, t, n, r, i, o = P, a = o.length; I < a;) { + switch (i = o.charCodeAt(I)) {case 9:case 10:case 13:case 32: + I++;break;case 123:case 125:case 91:case 93:case 58:case 44: + return e = E ? o.charAt(I) : o[I], I++, e;case 34: + for (e = "@", I++; I < a;) { + if ((i = o.charCodeAt(I)) < 32) L();else if (92 == i) switch (i = o.charCodeAt(++I)) {case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114: + e += D[i], I++;break;case 117: + for (t = ++I, n = I + 4; I < n; I++) { + (i = o.charCodeAt(I)) >= 48 && i <= 57 || i >= 97 && i <= 102 || i >= 65 && i <= 70 || L(); + }e += O("0x" + o.slice(t, I));break;default: + L();} else { + if (34 == i) break;for (i = o.charCodeAt(I), t = I; i >= 32 && 92 != i && 34 != i;) { + i = o.charCodeAt(++I); + }e += o.slice(t, I); + } + }if (34 == o.charCodeAt(I)) return I++, e;L();default: + if (t = I, 45 == i && (r = !0, i = o.charCodeAt(++I)), i >= 48 && i <= 57) { + for (48 == i && (i = o.charCodeAt(I + 1)) >= 48 && i <= 57 && L(), r = !1; I < a && (i = o.charCodeAt(I)) >= 48 && i <= 57; I++) {}if (46 == o.charCodeAt(I)) { + for (n = ++I; n < a && (i = o.charCodeAt(n)) >= 48 && i <= 57; n++) {}n == I && L(), I = n; + }if (101 == (i = o.charCodeAt(I)) || 69 == i) { + for (i = o.charCodeAt(++I), 43 != i && 45 != i || I++, n = I; n < a && (i = o.charCodeAt(n)) >= 48 && i <= 57; n++) {}n == I && L(), I = n; + }return +o.slice(t, I); + }if (r && L(), "true" == o.slice(I, I + 4)) return I += 4, !0;if ("false" == o.slice(I, I + 5)) return I += 5, !1;if ("null" == o.slice(I, I + 4)) return I += 4, null;L();} + }return "$"; + }, + M = function e(t) { + var n, r;if ("$" == t && L(), "string" == typeof t) { + if ("@" == (E ? t.charAt(0) : t[0])) return t.slice(1);if ("[" == t) { + for (n = []; "]" != (t = N()); r || (r = !0)) { + r && ("," == t ? "]" == (t = N()) && L() : L()), "," == t && L(), n.push(e(t)); + }return n; + }if ("{" == t) { + for (n = {}; "}" != (t = N()); r || (r = !0)) { + r && ("," == t ? "}" == (t = N()) && L() : L()), "," != t && "string" == typeof t && "@" == (E ? t.charAt(0) : t[0]) && ":" == N() || L(), n[t.slice(1)] = e(N()); + }return n; + }L(); + }return t; + }, + x = function x(e, t, n) { + var r = j(e, t, n);r === g ? delete e[t] : e[t] = r; + }, + j = function j(e, t, n) { + var r, + i = e[t];if ("object" == (void 0 === i ? "undefined" : o(i)) && i) if ("[object Array]" == b.call(i)) for (r = i.length; r--;) { + x(i, r, n); + } else _v(i, function (e) { + x(i, e, n); + });return n.call(e, t, i); + };t.parse = function (e, t) { + var n, r;return I = 0, P = "" + e, n = M(N()), "$" != N() && L(), I = P = null, t && "[object Function]" == b.call(t) ? j((r = {}, r[""] = n, r), "", t) : n; + }; + } + }return t.runInContext = a, t; + }var s = n(25), + c = { function: !0, object: !0 }, + u = c[o(t)] && t && !t.nodeType && t, + l = c["undefined" == typeof window ? "undefined" : o(window)] && window || this, + d = u && c[o(e)] && e && !e.nodeType && "object" == (void 0 === r ? "undefined" : o(r)) && r;if (!d || d.global !== d && d.window !== d && d.self !== d || (l = d), u && !s) a(l, u);else { + var p = l.JSON, + f = l.JSON3, + h = !1, + m = a(l, l.JSON3 = { noConflict: function noConflict() { + return h || (h = !0, l.JSON = p, l.JSON3 = f, p = f = null), m; + } });l.JSON = { parse: m.parse, stringify: m.stringify }; + }s && void 0 !== (i = function () { + return m; + }.call(t, n, t, e)) && (e.exports = i); + }).call(this); + }).call(t, n(58)(e), n(1)); + }, function (e, t, n) { + var r, + i = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + };!function (o) { + function a(e, t, n) { + var r = 0, + i = [0], + o = "", + a = null, + o = n || "UTF8";if ("UTF8" !== o && "UTF16" !== o) throw "encoding must be UTF8 or UTF16";if ("HEX" === t) { + if (0 != e.length % 2) throw "srcString of HEX type must be in byte increments";a = u(e), r = a.binLen, i = a.value; + } else if ("ASCII" === t || "TEXT" === t) a = c(e, o), r = a.binLen, i = a.value;else { + if ("B64" !== t) throw "inputFormat must be HEX, TEXT, ASCII, or B64";a = l(e), r = a.binLen, i = a.value; + }this.getHash = function (e, t, n, o) { + var a, + s = null, + c = i.slice(), + u = r;if (3 === arguments.length ? "number" != typeof n && (o = n, n = 1) : 2 === arguments.length && (n = 1), n !== parseInt(n, 10) || 1 > n) throw "numRounds must a integer >= 1";switch (t) {case "HEX": + s = d;break;case "B64": + s = p;break;default: + throw "format must be HEX or B64";}if ("SHA-1" === e) for (a = 0; a < n; a++) { + c = j(c, u), u = 160; + } else if ("SHA-224" === e) for (a = 0; a < n; a++) { + c = F(c, u, e), u = 224; + } else if ("SHA-256" === e) for (a = 0; a < n; a++) { + c = F(c, u, e), u = 256; + } else if ("SHA-384" === e) for (a = 0; a < n; a++) { + c = F(c, u, e), u = 384; + } else { + if ("SHA-512" !== e) throw "Chosen SHA variant is not supported";for (a = 0; a < n; a++) { + c = F(c, u, e), u = 512; + } + }return s(c, f(o)); + }, this.getHMAC = function (e, t, n, a, s) { + var h, + m, + v, + g, + y = [], + b = [];switch (h = null, a) {case "HEX": + a = d;break;case "B64": + a = p;break;default: + throw "outputFormat must be HEX or B64";}if ("SHA-1" === n) m = 64, g = 160;else if ("SHA-224" === n) m = 64, g = 224;else if ("SHA-256" === n) m = 64, g = 256;else if ("SHA-384" === n) m = 128, g = 384;else { + if ("SHA-512" !== n) throw "Chosen SHA variant is not supported";m = 128, g = 512; + }if ("HEX" === t) h = u(e), v = h.binLen, h = h.value;else if ("ASCII" === t || "TEXT" === t) h = c(e, o), v = h.binLen, h = h.value;else { + if ("B64" !== t) throw "inputFormat must be HEX, TEXT, ASCII, or B64";h = l(e), v = h.binLen, h = h.value; + }for (e = 8 * m, t = m / 4 - 1, m < v / 8 ? (h = "SHA-1" === n ? j(h, v) : F(h, v, n), h[t] &= 4294967040) : m > v / 8 && (h[t] &= 4294967040), m = 0; m <= t; m += 1) { + y[m] = 909522486 ^ h[m], b[m] = 1549556828 ^ h[m]; + }return n = "SHA-1" === n ? j(b.concat(j(y.concat(i), e + r)), e + g) : F(b.concat(F(y.concat(i), e + r, n)), e + g, n), a(n, f(s)); + }; + }function s(e, t) { + this.a = e, this.b = t; + }function c(e, t) { + var n, + r, + i = [], + o = [], + a = 0;if ("UTF8" === t) for (r = 0; r < e.length; r += 1) { + for (n = e.charCodeAt(r), o = [], 2048 < n ? (o[0] = 224 | (61440 & n) >>> 12, o[1] = 128 | (4032 & n) >>> 6, o[2] = 128 | 63 & n) : 128 < n ? (o[0] = 192 | (1984 & n) >>> 6, o[1] = 128 | 63 & n) : o[0] = n, n = 0; n < o.length; n += 1) { + i[a >>> 2] |= o[n] << 24 - a % 4 * 8, a += 1; + } + } else if ("UTF16" === t) for (r = 0; r < e.length; r += 1) { + i[a >>> 2] |= e.charCodeAt(r) << 16 - a % 4 * 8, a += 2; + }return { value: i, binLen: 8 * a }; + }function u(e) { + var t, + n, + r = [], + i = e.length;if (0 != i % 2) throw "String of HEX type must be in byte increments";for (t = 0; t < i; t += 2) { + if (n = parseInt(e.substr(t, 2), 16), isNaN(n)) throw "String of HEX type contains invalid characters";r[t >>> 3] |= n << 24 - t % 8 * 4; + }return { value: r, binLen: 4 * i }; + }function l(e) { + var t, + n, + r, + i, + o, + a = [], + s = 0;if (-1 === e.search(/^[a-zA-Z0-9=+\/]+$/)) throw "Invalid character in base-64 string";if (t = e.indexOf("="), e = e.replace(/\=/g, ""), -1 !== t && t < e.length) throw "Invalid '=' found in base-64 string";for (n = 0; n < e.length; n += 4) { + for (o = e.substr(n, 4), r = i = 0; r < o.length; r += 1) { + t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(o[r]), i |= t << 18 - 6 * r; + }for (r = 0; r < o.length - 1; r += 1) { + a[s >> 2] |= (i >>> 16 - 8 * r & 255) << 24 - s % 4 * 8, s += 1; + } + }return { value: a, binLen: 8 * s }; + }function d(e, t) { + var n, + r, + i = "", + o = 4 * e.length;for (n = 0; n < o; n += 1) { + r = e[n >>> 2] >>> 8 * (3 - n % 4), i += "0123456789abcdef".charAt(r >>> 4 & 15) + "0123456789abcdef".charAt(15 & r); + }return t.outputUpper ? i.toUpperCase() : i; + }function p(e, t) { + var n, + r, + i, + o = "", + a = 4 * e.length;for (n = 0; n < a; n += 3) { + for (i = (e[n >>> 2] >>> 8 * (3 - n % 4) & 255) << 16 | (e[n + 1 >>> 2] >>> 8 * (3 - (n + 1) % 4) & 255) << 8 | e[n + 2 >>> 2] >>> 8 * (3 - (n + 2) % 4) & 255, r = 0; 4 > r; r += 1) { + o = 8 * n + 6 * r <= 32 * e.length ? o + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i >>> 6 * (3 - r) & 63) : o + t.b64Pad; + } + }return o; + }function f(e) { + var t = { outputUpper: !1, b64Pad: "=" };try { + e.hasOwnProperty("outputUpper") && (t.outputUpper = e.outputUpper), e.hasOwnProperty("b64Pad") && (t.b64Pad = e.b64Pad); + } catch (e) {}if ("boolean" != typeof t.outputUpper) throw "Invalid outputUpper formatting option";if ("string" != typeof t.b64Pad) throw "Invalid b64Pad formatting option";return t; + }function h(e, t) { + return e << t | e >>> 32 - t; + }function m(e, t) { + return e >>> t | e << 32 - t; + }function v(e, t) { + var n = null, + n = new s(e.a, e.b);return n = 32 >= t ? new s(n.a >>> t | n.b << 32 - t & 4294967295, n.b >>> t | n.a << 32 - t & 4294967295) : new s(n.b >>> t - 32 | n.a << 64 - t & 4294967295, n.a >>> t - 32 | n.b << 64 - t & 4294967295); + }function g(e, t) { + return 32 >= t ? new s(e.a >>> t, e.b >>> t | e.a << 32 - t & 4294967295) : new s(0, e.a >>> t - 32); + }function y(e, t, n) { + return e ^ t ^ n; + }function b(e, t, n) { + return e & t ^ ~e & n; + }function S(e, t, n) { + return new s(e.a & t.a ^ ~e.a & n.a, e.b & t.b ^ ~e.b & n.b); + }function E(e, t, n) { + return e & t ^ e & n ^ t & n; + }function T(e, t, n) { + return new s(e.a & t.a ^ e.a & n.a ^ t.a & n.a, e.b & t.b ^ e.b & n.b ^ t.b & n.b); + }function _(e) { + return m(e, 2) ^ m(e, 13) ^ m(e, 22); + }function C(e) { + var t = v(e, 28), + n = v(e, 34);return e = v(e, 39), new s(t.a ^ n.a ^ e.a, t.b ^ n.b ^ e.b); + }function w(e) { + return m(e, 6) ^ m(e, 11) ^ m(e, 25); + }function R(e) { + var t = v(e, 14), + n = v(e, 18);return e = v(e, 41), new s(t.a ^ n.a ^ e.a, t.b ^ n.b ^ e.b); + }function k(e) { + return m(e, 7) ^ m(e, 18) ^ e >>> 3; + }function A(e) { + var t = v(e, 1), + n = v(e, 8);return e = g(e, 7), new s(t.a ^ n.a ^ e.a, t.b ^ n.b ^ e.b); + }function I(e) { + return m(e, 17) ^ m(e, 19) ^ e >>> 10; + }function P(e) { + var t = v(e, 19), + n = v(e, 61);return e = g(e, 6), new s(t.a ^ n.a ^ e.a, t.b ^ n.b ^ e.b); + }function O(e, t) { + var n = (65535 & e) + (65535 & t);return ((e >>> 16) + (t >>> 16) + (n >>> 16) & 65535) << 16 | 65535 & n; + }function D(e, t, n, r) { + var i = (65535 & e) + (65535 & t) + (65535 & n) + (65535 & r);return ((e >>> 16) + (t >>> 16) + (n >>> 16) + (r >>> 16) + (i >>> 16) & 65535) << 16 | 65535 & i; + }function L(e, t, n, r, i) { + var o = (65535 & e) + (65535 & t) + (65535 & n) + (65535 & r) + (65535 & i);return ((e >>> 16) + (t >>> 16) + (n >>> 16) + (r >>> 16) + (i >>> 16) + (o >>> 16) & 65535) << 16 | 65535 & o; + }function N(e, t) { + var n, r, i;return n = (65535 & e.b) + (65535 & t.b), r = (e.b >>> 16) + (t.b >>> 16) + (n >>> 16), i = (65535 & r) << 16 | 65535 & n, n = (65535 & e.a) + (65535 & t.a) + (r >>> 16), r = (e.a >>> 16) + (t.a >>> 16) + (n >>> 16), new s((65535 & r) << 16 | 65535 & n, i); + }function M(e, t, n, r) { + var i, o, a;return i = (65535 & e.b) + (65535 & t.b) + (65535 & n.b) + (65535 & r.b), o = (e.b >>> 16) + (t.b >>> 16) + (n.b >>> 16) + (r.b >>> 16) + (i >>> 16), a = (65535 & o) << 16 | 65535 & i, i = (65535 & e.a) + (65535 & t.a) + (65535 & n.a) + (65535 & r.a) + (o >>> 16), o = (e.a >>> 16) + (t.a >>> 16) + (n.a >>> 16) + (r.a >>> 16) + (i >>> 16), new s((65535 & o) << 16 | 65535 & i, a); + }function x(e, t, n, r, i) { + var o, a, c;return o = (65535 & e.b) + (65535 & t.b) + (65535 & n.b) + (65535 & r.b) + (65535 & i.b), a = (e.b >>> 16) + (t.b >>> 16) + (n.b >>> 16) + (r.b >>> 16) + (i.b >>> 16) + (o >>> 16), c = (65535 & a) << 16 | 65535 & o, o = (65535 & e.a) + (65535 & t.a) + (65535 & n.a) + (65535 & r.a) + (65535 & i.a) + (a >>> 16), a = (e.a >>> 16) + (t.a >>> 16) + (n.a >>> 16) + (r.a >>> 16) + (i.a >>> 16) + (o >>> 16), new s((65535 & a) << 16 | 65535 & o, c); + }function j(e, t) { + var n, + r, + i, + o, + a, + s, + c, + u, + l, + d = [], + p = b, + f = y, + m = E, + v = h, + g = O, + S = L, + T = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];for (e[t >>> 5] |= 128 << 24 - t % 32, e[15 + (t + 65 >>> 9 << 4)] = t, l = e.length, c = 0; c < l; c += 16) { + for (n = T[0], r = T[1], i = T[2], o = T[3], a = T[4], u = 0; 80 > u; u += 1) { + d[u] = 16 > u ? e[u + c] : v(d[u - 3] ^ d[u - 8] ^ d[u - 14] ^ d[u - 16], 1), s = 20 > u ? S(v(n, 5), p(r, i, o), a, 1518500249, d[u]) : 40 > u ? S(v(n, 5), f(r, i, o), a, 1859775393, d[u]) : 60 > u ? S(v(n, 5), m(r, i, o), a, 2400959708, d[u]) : S(v(n, 5), f(r, i, o), a, 3395469782, d[u]), a = o, o = i, i = v(r, 30), r = n, n = s; + }T[0] = g(n, T[0]), T[1] = g(r, T[1]), T[2] = g(i, T[2]), T[3] = g(o, T[3]), T[4] = g(a, T[4]); + }return T; + }function F(e, t, n) { + var r, + i, + o, + a, + c, + u, + l, + d, + p, + f, + h, + m, + v, + g, + y, + j, + F, + U, + B, + J, + G, + H, + V, + W, + K, + q, + z = [], + $ = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298];if (f = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428], i = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], "SHA-224" === n || "SHA-256" === n) h = 64, r = 15 + (t + 65 >>> 9 << 4), g = 16, y = 1, K = Number, j = O, F = D, U = L, B = k, J = I, G = _, H = w, W = E, V = b, f = "SHA-224" === n ? f : i;else { + if ("SHA-384" !== n && "SHA-512" !== n) throw "Unexpected error in SHA-2 implementation";h = 80, r = 31 + (t + 128 >>> 10 << 5), g = 32, y = 2, K = s, j = N, F = M, U = x, B = A, J = P, G = C, H = R, W = T, V = S, $ = [new K($[0], 3609767458), new K($[1], 602891725), new K($[2], 3964484399), new K($[3], 2173295548), new K($[4], 4081628472), new K($[5], 3053834265), new K($[6], 2937671579), new K($[7], 3664609560), new K($[8], 2734883394), new K($[9], 1164996542), new K($[10], 1323610764), new K($[11], 3590304994), new K($[12], 4068182383), new K($[13], 991336113), new K($[14], 633803317), new K($[15], 3479774868), new K($[16], 2666613458), new K($[17], 944711139), new K($[18], 2341262773), new K($[19], 2007800933), new K($[20], 1495990901), new K($[21], 1856431235), new K($[22], 3175218132), new K($[23], 2198950837), new K($[24], 3999719339), new K($[25], 766784016), new K($[26], 2566594879), new K($[27], 3203337956), new K($[28], 1034457026), new K($[29], 2466948901), new K($[30], 3758326383), new K($[31], 168717936), new K($[32], 1188179964), new K($[33], 1546045734), new K($[34], 1522805485), new K($[35], 2643833823), new K($[36], 2343527390), new K($[37], 1014477480), new K($[38], 1206759142), new K($[39], 344077627), new K($[40], 1290863460), new K($[41], 3158454273), new K($[42], 3505952657), new K($[43], 106217008), new K($[44], 3606008344), new K($[45], 1432725776), new K($[46], 1467031594), new K($[47], 851169720), new K($[48], 3100823752), new K($[49], 1363258195), new K($[50], 3750685593), new K($[51], 3785050280), new K($[52], 3318307427), new K($[53], 3812723403), new K($[54], 2003034995), new K($[55], 3602036899), new K($[56], 1575990012), new K($[57], 1125592928), new K($[58], 2716904306), new K($[59], 442776044), new K($[60], 593698344), new K($[61], 3733110249), new K($[62], 2999351573), new K($[63], 3815920427), new K(3391569614, 3928383900), new K(3515267271, 566280711), new K(3940187606, 3454069534), new K(4118630271, 4000239992), new K(116418474, 1914138554), new K(174292421, 2731055270), new K(289380356, 3203993006), new K(460393269, 320620315), new K(685471733, 587496836), new K(852142971, 1086792851), new K(1017036298, 365543100), new K(1126000580, 2618297676), new K(1288033470, 3409855158), new K(1501505948, 4234509866), new K(1607167915, 987167468), new K(1816402316, 1246189591)], f = "SHA-384" === n ? [new K(3418070365, f[0]), new K(1654270250, f[1]), new K(2438529370, f[2]), new K(355462360, f[3]), new K(1731405415, f[4]), new K(41048885895, f[5]), new K(3675008525, f[6]), new K(1203062813, f[7])] : [new K(i[0], 4089235720), new K(i[1], 2227873595), new K(i[2], 4271175723), new K(i[3], 1595750129), new K(i[4], 2917565137), new K(i[5], 725511199), new K(i[6], 4215389547), new K(i[7], 327033209)]; + }for (e[t >>> 5] |= 128 << 24 - t % 32, e[r] = t, q = e.length, m = 0; m < q; m += g) { + for (t = f[0], r = f[1], i = f[2], o = f[3], a = f[4], c = f[5], u = f[6], l = f[7], v = 0; v < h; v += 1) { + z[v] = 16 > v ? new K(e[v * y + m], e[v * y + m + 1]) : F(J(z[v - 2]), z[v - 7], B(z[v - 15]), z[v - 16]), d = U(l, H(a), V(a, c, u), $[v], z[v]), p = j(G(t), W(t, r, i)), l = u, u = c, c = a, a = j(o, d), o = i, i = r, r = t, t = j(d, p); + }f[0] = j(t, f[0]), f[1] = j(r, f[1]), f[2] = j(i, f[2]), f[3] = j(o, f[3]), f[4] = j(a, f[4]), f[5] = j(c, f[5]), f[6] = j(u, f[6]), f[7] = j(l, f[7]); + }if ("SHA-224" === n) e = [f[0], f[1], f[2], f[3], f[4], f[5], f[6]];else if ("SHA-256" === n) e = f;else if ("SHA-384" === n) e = [f[0].a, f[0].b, f[1].a, f[1].b, f[2].a, f[2].b, f[3].a, f[3].b, f[4].a, f[4].b, f[5].a, f[5].b];else { + if ("SHA-512" !== n) throw "Unexpected error in SHA-2 implementation";e = [f[0].a, f[0].b, f[1].a, f[1].b, f[2].a, f[2].b, f[3].a, f[3].b, f[4].a, f[4].b, f[5].a, f[5].b, f[6].a, f[6].b, f[7].a, f[7].b]; + }return e; + }i(n(25)) ? void 0 !== (r = function () { + return a; + }.call(t, n, t, e)) && (e.exports = r) : void 0 !== e && e.exports ? e.exports = t = a : t = a; + }(); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e) { + if (!e.name || e.name.toLowerCase() !== e.name) { + var t = "Invalid conference name (no conference name passed or it contains invalid characters like capital letters)!";throw j.error(t), new Error(t); + }this.eventEmitter = new d.a(), this.options = e, this.eventManager = new f.a(this), this.participants = {}, this._init(e), this.componentsVersions = new o.a(this), this.jvbJingleSession = null, this.lastDominantSpeaker = null, this.dtmfManager = null, this.somebodySupportsDTMF = !1, this.authEnabled = !1, this.startAudioMuted = !1, this.startVideoMuted = !1, this.startMutedPolicy = { audio: !1, video: !1 }, this.availableDevices = { audio: void 0, video: void 0 }, this.isMutedByFocus = !1, this.wasStopped = !1, this.connectionQuality = new a.a(this, this.eventEmitter, e), this.avgRtpStatsReporter = new i.a(this, e.config.avgRtpStatsN || 15), this.isJvbConnectionInterrupted = !1, this.speakerStatsCollector = new x.a(this), this.deferredStartP2PTask = null;var n = parseInt(e.config.p2p && e.config.p2p.backToP2PDelay, 10);this.backToP2PDelay = isNaN(n) ? 5 : n, j.info("backToP2PDelay: " + this.backToP2PDelay), this.isP2PConnectionInterrupted = !1, this.p2p = !1, this.p2pJingleSession = null; + }t.a = r;var i = n(104), + o = n(117), + a = n(101), + s = n(0), + c = (n.n(s), n(3)), + u = n.n(c), + l = n(14), + d = n.n(l), + p = n(26), + f = n(82), + h = n(5), + m = n(87), + v = n.n(m), + g = n(85), + y = n(11), + b = n(15), + S = n(16), + E = n(102), + T = n(4), + _ = n(28), + C = n(88), + w = n(22), + R = n(2), + k = n(8), + A = (n.n(k), n(6)), + I = n(100), + P = n(110), + O = n.n(P), + D = n(17), + L = n.n(D), + N = n(119), + M = n(7), + x = (n.n(M), n(108)), + j = n.i(s.getLogger)(e);r.prototype.constructor = r, r.prototype._init = function () { + var e = this, + t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};t.connection && (this.connection = t.connection, this.xmpp = this.connection.xmpp, this.eventManager.setupXMPPListeners()), this.room = this.xmpp.createRoom(this.options.name, this.options.config), this._onIceConnectionInterrupted = this._onIceConnectionInterrupted.bind(this), this.room.addListener(M.CONNECTION_INTERRUPTED, this._onIceConnectionInterrupted), this._onIceConnectionRestored = this._onIceConnectionRestored.bind(this), this.room.addListener(M.CONNECTION_RESTORED, this._onIceConnectionRestored), this._onIceConnectionEstablished = this._onIceConnectionEstablished.bind(this), this.room.addListener(M.CONNECTION_ESTABLISHED, this._onIceConnectionEstablished), this.room.updateDeviceAvailability(w.a.getDeviceAvailability()), this.rtc || (this.rtc = new w.a(this, t), this.eventManager.setupRTCListeners()), this.participantConnectionStatus = new _.b(this.rtc, this, { rtcMuteTimeout: this.options.config._peerConnStatusRtcMuteTimeout, outOfLastNTimeout: this.options.config._peerConnStatusOutOfLastNTimeout }), this.participantConnectionStatus.init(), this.statistics || (this.statistics = new A.a(this.xmpp, { callStatsID: this.options.config.callStatsID, callStatsSecret: this.options.config.callStatsSecret, callStatsConfIDNamespace: this.options.config.callStatsConfIDNamespace || window.location.hostname, callStatsCustomScriptUrl: this.options.config.callStatsCustomScriptUrl, callStatsAliasName: this.myUserId(), roomName: this.options.name })), this.eventManager.setupChatRoomListeners(), this.eventManager.setupStatisticsListeners(), this.options.config.enableTalkWhileMuted && new I.a(this, function () { + return e.eventEmitter.emit(h.TALK_WHILE_MUTED); + }), "channelLastN" in t.config && this.setLastN(t.config.channelLastN), this.jvb121Status = new E.a(this), this.p2pDominantSpeakerDetection = new C.a(this); + }, r.prototype.join = function (e) { + this.room && this.room.join(e); + }, r.prototype.isJoined = function () { + return this.room && this.room.joined; + }, r.prototype.isP2PEnabled = function () { + return Boolean(this.options.config.p2p && this.options.config.p2p.enabled) || void 0 === this.options.config.p2p; + }, r.prototype.isP2PTestModeEnabled = function () { + return Boolean(this.options.config.testing && this.options.config.testing.p2pTestMode); + }, r.prototype.leave = function () { + var e = this;if (this.participantConnectionStatus && (this.participantConnectionStatus.dispose(), this.participantConnectionStatus = null), this.avgRtpStatsReporter && (this.avgRtpStatsReporter.dispose(), this.avgRtpStatsReporter = null), this.getLocalTracks().forEach(function (t) { + return e.onLocalTrackRemoved(t); + }), this.rtc.closeBridgeChannel(), this.statistics && this.statistics.dispose(), this.jvbJingleSession && (this.jvbJingleSession.close(), this.jvbJingleSession = null), this.p2pJingleSession && (this.p2pJingleSession.close(), this.p2pJingleSession = null), this.room) { + var t = this.room;return t.removeListener(M.CONNECTION_INTERRUPTED, this._onIceConnectionInterrupted), t.removeListener(M.CONNECTION_RESTORED, this._onIceConnectionRestored), t.removeListener(M.CONNECTION_ESTABLISHED, this._onIceConnectionEstablished), this.room = null, t.leave().catch(function () { + e.getParticipants().forEach(function (t) { + return e.onMemberLeft(t.getJid()); + }); + }); + }return Promise.reject(new Error("The conference is has been already left")); + }, r.prototype.getName = function () { + return this.options.name; + }, r.prototype.isAuthEnabled = function () { + return this.authEnabled; + }, r.prototype.isLoggedIn = function () { + return Boolean(this.authIdentity); + }, r.prototype.getAuthLogin = function () { + return this.authIdentity; + }, r.prototype.isExternalAuthEnabled = function () { + return this.room && this.room.moderator.isExternalAuthEnabled(); + }, r.prototype.getExternalAuthUrl = function (e) { + var t = this;return new Promise(function (n, r) { + if (!t.isExternalAuthEnabled()) return void r();e ? t.room.moderator.getPopupLoginUrl(n, r) : t.room.moderator.getLoginUrl(n, r); + }); + }, r.prototype.getLocalTracks = function (e) { + var t = [];return this.rtc && (t = this.rtc.getLocalTracks(e)), t; + }, r.prototype.getLocalAudioTrack = function () { + return this.rtc ? this.rtc.getLocalAudioTrack() : null; + }, r.prototype.getLocalVideoTrack = function () { + return this.rtc ? this.rtc.getLocalVideoTrack() : null; + }, r.prototype.on = function (e, t) { + this.eventEmitter && this.eventEmitter.on(e, t); + }, r.prototype.off = function (e, t) { + this.eventEmitter && this.eventEmitter.removeListener(e, t); + }, r.prototype.addEventListener = r.prototype.on, r.prototype.removeEventListener = r.prototype.off, r.prototype.addCommandListener = function (e, t) { + this.room && this.room.addPresenceListener(e, t); + }, r.prototype.removeCommandListener = function (e) { + this.room && this.room.removePresenceListener(e); + }, r.prototype.sendTextMessage = function (e) { + this.room && this.room.sendMessage(e); + }, r.prototype.sendCommand = function (e, t) { + this.room && (this.room.addToPresence(e, t), this.room.sendPresence()); + }, r.prototype.sendCommandOnce = function (e, t) { + this.sendCommand(e, t), this.removeCommand(e); + }, r.prototype.removeCommand = function (e) { + this.room && this.room.removeFromPresence(e); + }, r.prototype.setDisplayName = function (e) { + this.room && (this.room.removeFromPresence("nick"), this.room.addToPresence("nick", { attributes: { xmlns: "http://jabber.org/protocol/nick" }, value: e }), this.room.sendPresence()); + }, r.prototype.setSubject = function (e) { + this.room && this.isModerator() && this.room.setSubject(e); + }, r.prototype.getTranscriber = function () { + if (void 0 === this.transcriber) { + this.transcriber = new O.a();var e = this.getLocalTracks(T.a), + t = !0, + n = !1, + r = void 0;try { + for (var i, o = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + var a = i.value;this.transcriber.addTrack(a); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + }var s = this.rtc.getRemoteTracks(T.a), + c = !0, + u = !1, + l = void 0;try { + for (var d, p = s[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (d = p.next()).done); c = !0) { + var f = d.value;this.transcriber.addTrack(f); + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && p.return && p.return(); + } finally { + if (u) throw l; + } + } + }return this.transcriber; + }, r.prototype.addTrack = function (e) { + if (e.isVideoTrack()) { + var t = this.rtc.getLocalVideoTrack();if (t) return e === t ? Promise.resolve(e) : Promise.reject(new Error("cannot add second video track to the conference")); + }return this.replaceTrack(null, e); + }, r.prototype._fireAudioLevelChangeEvent = function (e, t) { + var n = this.getActivePeerConnection();t && n !== t || this.eventEmitter.emit(h.TRACK_AUDIO_LEVEL_CHANGED, this.myUserId(), e); + }, r.prototype._fireMuteChangeEvent = function (e) { + this.isMutedByFocus && e.isAudioTrack() && !e.isMuted() && (this.isMutedByFocus = !1, this.room.muteParticipant(this.room.myroomjid, !1)), this.eventEmitter.emit(h.TRACK_MUTE_CHANGED, e); + }, r.prototype.onLocalTrackRemoved = function (e) { + e._setConference(null), this.rtc.removeLocalTrack(e), e.removeEventListener(S.TRACK_MUTE_CHANGED, e.muteHandler), e.removeEventListener(S.TRACK_AUDIO_LEVEL_CHANGED, e.audioLevelHandler), e.isVideoTrack() && e.videoType === L.a.DESKTOP && this.statistics.sendScreenSharingEvent(!1), this.eventEmitter.emit(h.TRACK_REMOVED, e); + }, r.prototype.removeTrack = function (e) { + return this.replaceTrack(e, null); + }, r.prototype.replaceTrack = function (e, t) { + var n = this;return e && e.disposed ? Promise.reject(new y.a(b.TRACK_IS_DISPOSED)) : t && t.disposed ? Promise.reject(new y.a(b.TRACK_IS_DISPOSED)) : this._doReplaceTrack(e, t).then(function () { + return e && n.onLocalTrackRemoved(e), t && n._setupNewTrack(t), Promise.resolve(); + }, function (e) { + return Promise.reject(new Error(e)); + }); + }, r.prototype._doReplaceTrack = function (e, t) { + var n = [];return this.jvbJingleSession ? n.push(this.jvbJingleSession.replaceTrack(e, t)) : j.info("_doReplaceTrack - no JVB JingleSession"), this.p2pJingleSession ? n.push(this.p2pJingleSession.replaceTrack(e, t)) : j.info("_doReplaceTrack - no P2P JingleSession"), Promise.all(n); + }, r.prototype._setupNewTrack = function (e) { + if (e.isAudioTrack() || e.isVideoTrack() && e.videoType !== L.a.DESKTOP) { + var t = w.a.getCurrentlyAvailableMediaDevices(), + n = t.find(function (t) { + return t.kind === e.getTrack().kind + "input" && t.label === e.getTrack().label; + });n && A.a.sendActiveDeviceListEvent(w.a.getEventDataForActiveDevice(n)); + }e.isVideoTrack() && (this.removeCommand("videoType"), this.sendCommand("videoType", { value: e.videoType, attributes: { xmlns: "http://jitsi.org/jitmeet/video" } })), this.rtc.addLocalTrack(e), e.isAudioTrack() ? this.room.setAudioMute(e.isMuted()) : this.room.setVideoMute(e.isMuted()), e.muteHandler = this._fireMuteChangeEvent.bind(this, e), e.audioLevelHandler = this._fireAudioLevelChangeEvent.bind(this), e.addEventListener(S.TRACK_MUTE_CHANGED, e.muteHandler), e.addEventListener(S.TRACK_AUDIO_LEVEL_CHANGED, e.audioLevelHandler), e._setConference(this), e.isVideoTrack() && e.videoType === L.a.DESKTOP && this.statistics.sendScreenSharingEvent(!0), this.eventEmitter.emit(h.TRACK_ADDED, e); + }, r.prototype._addLocalTrackAsUnmute = function (e) { + var t = [];return this.jvbJingleSession ? t.push(this.jvbJingleSession.addTrackAsUnmute(e)) : j.info("Add local MediaStream as unmute - no JVB Jingle session started yet"), this.p2pJingleSession ? t.push(this.p2pJingleSession.addTrackAsUnmute(e)) : j.info("Add local MediaStream as unmute - no P2P Jingle session started yet"), Promise.all(t); + }, r.prototype._removeLocalTrackAsMute = function (e) { + var t = [];return this.jvbJingleSession ? t.push(this.jvbJingleSession.removeTrackAsMute(e)) : j.info("Remove local MediaStream - no JVB JingleSession started yet"), this.p2pJingleSession ? t.push(this.p2pJingleSession.removeTrackAsMute(e)) : j.info("Remove local MediaStream - no P2P JingleSession started yet"), Promise.all(t); + }, r.prototype.getRole = function () { + return this.room.role; + }, r.prototype.isModerator = function () { + return this.room ? this.room.isModerator() : null; + }, r.prototype.lock = function (e) { + var t = this;return this.isModerator() ? new Promise(function (n, r) { + t.room.lockRoom(e || "", function () { + return n(); + }, function (e) { + return r(e); + }, function () { + return r(p.PASSWORD_NOT_SUPPORTED); + }); + }) : Promise.reject(); + }, r.prototype.unlock = function () { + return this.lock(); + }, r.prototype.selectParticipant = function (e) { + this.rtc.selectEndpoint(e); + }, r.prototype.pinParticipant = function (e) { + this.rtc.pinEndpoint(e); + }, r.prototype.getLastN = function () { + return this.rtc.getLastN(); + }, r.prototype.setLastN = function (e) { + if (!Number.isInteger(e) && !Number.parseInt(e, 10)) throw new Error("Invalid value for lastN: " + e);var t = Number(e);if (t < -1) throw new RangeError("lastN cannot be smaller than -1");if (this.rtc.setLastN(t), this.p2pJingleSession) { + var n = 0 !== t;this.p2pJingleSession.setMediaTransferActive(!0, n).catch(function (e) { + j.error("Failed to adjust video transfer status (" + n + ")", e); + }); + } + }, r.prototype.isInLastN = function (e) { + return this.rtc.isInLastN(e); + }, r.prototype.getParticipants = function () { + return Object.keys(this.participants).map(function (e) { + return this.participants[e]; + }, this); + }, r.prototype.getParticipantCount = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], + t = this.getParticipants();return e || (t = t.filter(function (e) { + return !e.isHidden(); + })), t.length + 1; + }, r.prototype.getParticipantById = function (e) { + return this.participants[e]; + }, r.prototype.kickParticipant = function (e) { + var t = this.getParticipantById(e);t && this.room.kick(t.getJid()); + }, r.prototype.muteParticipant = function (e) { + var t = this.getParticipantById(e);t && this.room.muteParticipant(t.getJid(), !0); + }, r.prototype.onMemberJoined = function (e, t, n, r) { + var i = this, + o = Strophe.getResourceFromJid(e);if ("focus" !== o && this.myUserId() !== o) { + var a = new g.a(e, this, t, r);a._role = n, this.participants[o] = a, this.eventEmitter.emit(h.USER_JOINED, o, a), this.xmpp.caps.getFeatures(e).then(function (e) { + a._supportsDTMF = e.has("urn:xmpp:jingle:dtmf:0"), i.updateDTMFSupport(); + }, function (t) { + return j.error("Failed to discover features of " + e, t); + }), this._maybeStartOrStopP2P(); + } + }, r.prototype.onMemberLeft = function (e) { + var t = this, + n = Strophe.getResourceFromJid(e);if ("focus" !== n && this.myUserId() !== n) { + var r = this.participants[n];delete this.participants[n], this.rtc.removeRemoteTracks(n).forEach(function (e) { + return t.eventEmitter.emit(h.TRACK_REMOVED, e); + }), r && this.eventEmitter.emit(h.USER_LEFT, n, r), this._maybeStartOrStopP2P(!0); + } + }, r.prototype.onLocalRoleChanged = function (e) { + this.eventEmitter.emit(h.USER_ROLE_CHANGED, this.myUserId(), e), this._maybeStartOrStopP2P(); + }, r.prototype.onUserRoleChanged = function (e, t) { + var n = Strophe.getResourceFromJid(e), + r = this.getParticipantById(n);r && (r._role = t, this.eventEmitter.emit(h.USER_ROLE_CHANGED, n, t)); + }, r.prototype.onDisplayNameChanged = function (e, t) { + var n = Strophe.getResourceFromJid(e), + r = this.getParticipantById(n);r && r._displayName !== t && (r._displayName = t, this.eventEmitter.emit(h.DISPLAY_NAME_CHANGED, n, t)); + }, r.prototype.onRemoteTrackAdded = function (e) { + var t = this;if (e.isP2P && !this.isP2PActive()) return void j.info("Trying to add remote P2P track, when not in P2P - IGNORED");if (!e.isP2P && this.isP2PActive()) return void j.info("Trying to add remote JVB track, when in P2P - IGNORED");var n = e.getParticipantId(), + r = this.getParticipantById(n);if (!r) return void j.error("No participant found for id: " + n);r._tracks.push(e), this.transcriber && this.transcriber.addTrack(e);var i = this.eventEmitter;e.addEventListener(S.TRACK_MUTE_CHANGED, function () { + return i.emit(h.TRACK_MUTE_CHANGED, e); + }), e.addEventListener(S.TRACK_AUDIO_LEVEL_CHANGED, function (e, r) { + t.getActivePeerConnection() === r && i.emit(h.TRACK_AUDIO_LEVEL_CHANGED, n, e); + }), i.emit(h.TRACK_ADDED, e); + }, r.prototype.onCallAccepted = function (e, t) { + this.p2pJingleSession === e && (j.info("P2P setAnswer"), this.p2pJingleSession.setAnswer(t)); + }, r.prototype.onTransportInfo = function (e, t) { + this.p2pJingleSession === e && (j.info("P2P addIceCandidates"), this.p2pJingleSession.addIceCandidates(t)); + }, r.prototype.onRemoteTrackRemoved = function (e) { + var t = this;this.getParticipants().forEach(function (n) { + for (var r = n.getTracks(), i = 0; i < r.length; i++) { + if (r[i] === e) { + n._tracks.splice(i, 1), t.eventEmitter.emit(h.TRACK_REMOVED, e), t.transcriber && t.transcriber.removeTrack(e);break; + } + } + }, this); + }, r.prototype.onIncomingCall = function (e, t, n) { + var r = this;if (e.isP2P) return void ("moderator" !== this.room.getMemberRole(e.peerjid) ? this._rejectIncomingCallNonModerator(e) : R.a.isP2PSupported() ? this.isP2PEnabled() || this.isP2PTestModeEnabled() ? this.p2pJingleSession ? this._rejectIncomingCall(e, { reasonTag: "busy", reasonMsg: "P2P already in progress", errorMsg: 'Duplicated P2P "session-initiate"' }) : this._acceptP2PIncomingCall(e, t) : this._rejectIncomingCall(e, { reasonTag: "decline", reasonMsg: "P2P disabled", errorMsg: "P2P mode disabled in the configuration" }) : this._rejectIncomingCall(e, { reasonTag: "unsupported-applications", reasonMsg: "P2P not supported", errorMsg: "This client does not support P2P connections" }));if (!this.room.isFocus(e.peerjid)) return void this._rejectIncomingCall(e);this.jvbJingleSession = e, this.room.connectionTimes["session.initiate"] = n, this.wasStopped && A.a.sendEventToAll("session.restart");var i = null;this.options.config && this.options.config.deploymentInfo && void 0 !== this.options.config.deploymentInfo.crossRegion && (i = this.options.config.deploymentInfo.crossRegion), A.a.analytics.sendEvent("session.initiate", { value: n - this.room.connectionTimes["muc.joined"], label: i });try { + e.initialize(!1, this.room, this.rtc); + } catch (e) { + u.a.callErrorHandler(e); + }try { + e.acceptOffer(t, function () { + r.isP2PActive() && r.jvbJingleSession && r._suspendMediaTransferForJvbConnection(), r._setBridgeChannel(); + }, function (e) { + u.a.callErrorHandler(e), j.error("Failed to accept incoming Jingle session", e); + }, this.getLocalTracks()), j.info("Starting CallStats for JVB connection..."), this.statistics.startCallStats(this.jvbJingleSession.peerconnection, "jitsi"), this.statistics.startRemoteStats(this.jvbJingleSession.peerconnection); + } catch (e) { + u.a.callErrorHandler(e), j.error(e); + } + }, r.prototype._setBridgeChannel = function () { + var e = this.jvbJingleSession, + t = e.bridgeWebSocketUrl, + n = void 0;switch (this.options.config.openBridgeChannel) {case "datachannel":case !0:case void 0: + n = "datachannel";break;case "websocket": + n = "websocket";}"datachannel" !== n || R.a.supportsDataChannels() || (n = "websocket"), "datachannel" === n ? this.rtc.initializeBridgeChannel(e.peerconnection, null) : "websocket" === n && t && this.rtc.initializeBridgeChannel(null, t); + }, r.prototype._rejectIncomingCallNonModerator = function (e) { + this._rejectIncomingCall(e, { reasonTag: "security-error", reasonMsg: "Only focus can start new sessions", errorMsg: "Rejecting session-initiate from non-focus andnon-moderator user: " + e.peerjid }); + }, r.prototype._rejectIncomingCall = function (e, t) { + t && t.errorMsg && u.a.callErrorHandler(new Error(t.errorMsg)), e.terminate(null, function (e) { + j.warn("An error occurred while trying to terminate invalid Jingle session", e); + }, { reason: t && t.reasonTag, reasonDescription: t && t.reasonMsg, sendSessionTerminate: !0 }); + }, r.prototype.onCallEnded = function (e, t, n) { + j.info("Call ended: " + t + " - " + n + " P2P ?" + e.isP2P), e === this.jvbJingleSession ? (this.wasStopped = !0, A.a.sendEventToAll("session.terminate"), this.statistics && (this.statistics.stopRemoteStats(this.jvbJingleSession.peerconnection), j.info("Stopping JVB CallStats"), this.statistics.stopCallStats(this.jvbJingleSession.peerconnection)), this.jvbJingleSession = null, this.rtc.onCallEnded()) : e === this.p2pJingleSession ? ("decline" === t && "force JVB121" === n ? (j.info("In forced JVB 121 mode..."), A.a.analytics.addPermanentProperties({ forceJvb121: !0 })) : "connectivity-error" === t && "ICE FAILED" === n && A.a.analytics.addPermanentProperties({ p2pFailed: !0 }), this._stopP2PSession()) : j.error("Received onCallEnded for invalid session", e.sid, e.peerjid, t, n); + }, r.prototype.onSuspendDetected = function (e) { + e.isP2P || (this.leave(), this.eventEmitter.emit(h.SUSPEND_DETECTED)); + }, r.prototype.updateDTMFSupport = function () { + for (var e = !1, t = this.getParticipants(), n = 0; n < t.length; n += 1) { + if (t[n].supportsDTMF()) { + e = !0;break; + } + }e !== this.somebodySupportsDTMF && (this.somebodySupportsDTMF = e, this.eventEmitter.emit(h.DTMF_SUPPORT_CHANGED, e)); + }, r.prototype.isDTMFSupported = function () { + return this.somebodySupportsDTMF; + }, r.prototype.myUserId = function () { + return this.room && this.room.myroomjid ? Strophe.getResourceFromJid(this.room.myroomjid) : null; + }, r.prototype.sendTones = function (e, t, n) { + if (!this.dtmfManager) { + var r = this.getActivePeerConnection();if (!r) return void j.warn("cannot sendTones: no peer connection");var i = this.getLocalAudioTrack();if (!i) return void j.warn("cannot sendTones: no local audio stream");this.dtmfManager = new v.a(i, r); + }this.dtmfManager.sendTones(e, t, n); + }, r.prototype.isRecordingSupported = function () { + return !!this.room && this.room.isRecordingSupported(); + }, r.prototype.getRecordingState = function () { + return this.room ? this.room.getRecordingState() : void 0; + }, r.prototype.getRecordingURL = function () { + return this.room ? this.room.getRecordingURL() : null; + }, r.prototype.toggleRecording = function (e) { + var t = this;if (this.room) return this.room.toggleRecording(e, function (e, n) { + t.eventEmitter.emit(h.RECORDER_STATE_CHANGED, e, n); + });this.eventEmitter.emit(h.RECORDER_STATE_CHANGED, "error", new Error("The conference is not created yet!")); + }, r.prototype.isSIPCallingSupported = function () { + return !!this.room && this.room.isSIPCallingSupported(); + }, r.prototype.dial = function (e) { + return this.room ? this.room.dial(e) : new Promise(function (e, t) { + t(new Error("The conference is not created yet!")); + }); + }, r.prototype.hangup = function () { + return this.room ? this.room.hangup() : new Promise(function (e, t) { + t(new Error("The conference is not created yet!")); + }); + }, r.prototype.getPhoneNumber = function () { + return this.room ? this.room.getPhoneNumber() : null; + }, r.prototype.getPhonePin = function () { + return this.room ? this.room.getPhonePin() : null; + }, r.prototype.getActivePeerConnection = function () { + return this.isP2PActive() ? this.p2pJingleSession.peerconnection : this.jvbJingleSession ? this.jvbJingleSession.peerconnection : null; + }, r.prototype.getConnectionState = function () { + var e = this.getActivePeerConnection();return e ? e.getConnectionState() : null; + }, r.prototype.setStartMutedPolicy = function (e) { + this.isModerator() && (this.startMutedPolicy = e, this.room.removeFromPresence("startmuted"), this.room.addToPresence("startmuted", { attributes: { audio: e.audio, video: e.video, xmlns: "http://jitsi.org/jitmeet/start-muted" } }), this.room.sendPresence()); + }, r.prototype.getStartMutedPolicy = function () { + return this.startMutedPolicy; + }, r.prototype.isStartAudioMuted = function () { + return this.startAudioMuted; + }, r.prototype.isStartVideoMuted = function () { + return this.startVideoMuted; + }, r.prototype.getLogs = function () { + var e = this.xmpp.getJingleLog(), + t = {};t.time = new Date(), t.url = window.location.href, t.ua = navigator.userAgent;var n = this.xmpp.getXmppLog();return n && (t.xmpp = n), e.metadata = t, e; + }, r.prototype.getConnectionTimes = function () { + return this.room.connectionTimes; + }, r.prototype.setLocalParticipantProperty = function (e, t) { + this.sendCommand("jitsi_participant_" + e, { value: t }); + }, r.prototype.sendFeedback = function (e, t) { + this.statistics.sendFeedback(e, t); + }, r.prototype.isCallstatsEnabled = function () { + return this.statistics.isCallstatsEnabled(); + }, r.prototype._onTrackAttach = function (e, t) { + var n = e.isLocal(), + r = null, + i = e.isP2P, + o = i ? e.getParticipantId() : "jitsi", + a = i ? this.p2pJingleSession && this.p2pJingleSession.peerconnection : this.jvbJingleSession && this.jvbJingleSession.peerconnection;n ? a && (r = a.getLocalSSRC(e)) : r = e.getSSRC(), t.id && r && a && this.statistics.associateStreamWithVideoTag(a, r, n, o, e.getUsageLabel(), t.id); + }, r.prototype.sendApplicationLog = function (e) { + A.a.sendLog(e); + }, r.prototype._isFocus = function (e) { + return this.room ? this.room.isFocus(e) : null; + }, r.prototype._fireIncompatibleVersionsEvent = function () { + this.eventEmitter.emit(h.CONFERENCE_FAILED, p.INCOMPATIBLE_SERVER_VERSIONS); + }, r.prototype.sendEndpointMessage = function (e, t) { + this.rtc.sendChannelMessage(e, t); + }, r.prototype.broadcastEndpointMessage = function (e) { + this.sendEndpointMessage("", e); + }, r.prototype.isConnectionInterrupted = function () { + return this.isP2PActive() ? this.isP2PConnectionInterrupted : this.isJvbConnectionInterrupted; + }, r.prototype._onIceConnectionInterrupted = function (e) { + e.isP2P ? this.isP2PConnectionInterrupted = !0 : this.isJvbConnectionInterrupted = !0, e.isP2P === this.isP2PActive() && this.eventEmitter.emit(h.CONNECTION_INTERRUPTED); + }, r.prototype._onIceConnectionFailed = function (e) { + e.isP2P && (A.a.analytics.addPermanentProperties({ p2pFailed: !0 }), this.p2pJingleSession && this.p2pJingleSession.isInitiator && A.a.sendEventToAll("p2p.failed"), this._stopP2PSession("connectivity-error", "ICE FAILED")); + }, r.prototype._onIceConnectionRestored = function (e) { + e.isP2P ? this.isP2PConnectionInterrupted = !1 : this.isJvbConnectionInterrupted = !1, e.isP2P === this.isP2PActive() && this.eventEmitter.emit(h.CONNECTION_RESTORED); + }, r.prototype._acceptP2PIncomingCall = function (e, t) { + this.isP2PConnectionInterrupted = !1, this.p2pJingleSession = e, this.p2pJingleSession.initialize(!1, this.room, this.rtc), j.info("Starting CallStats for P2P connection..."), this.statistics.startCallStats(this.p2pJingleSession.peerconnection, Strophe.getResourceFromJid(this.p2pJingleSession.peerjid));var n = this.getLocalTracks();this.p2pJingleSession.acceptOffer(t, function () { + j.debug('Got RESULT for P2P "session-accept"'); + }, function (e) { + j.error("Failed to accept incoming P2P Jingle session", e); + }, n); + }, r.prototype._addRemoteJVBTracks = function () { + this._addRemoteTracks("JVB", this.jvbJingleSession.peerconnection.getRemoteTracks()); + }, r.prototype._addRemoteP2PTracks = function () { + this._addRemoteTracks("P2P", this.p2pJingleSession.peerconnection.getRemoteTracks()); + }, r.prototype._addRemoteTracks = function (e, t) { + var n = !0, + r = !1, + i = void 0;try { + for (var o, a = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value;j.info("Adding remote " + e + " track: " + s), this.rtc.eventEmitter.emit(k.REMOTE_TRACK_ADDED, s); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + } + }, r.prototype._onIceConnectionEstablished = function (e) { + null !== this.p2pJingleSession && (this.p2pEstablishmentDuration = this.p2pJingleSession.establishmentDuration), null !== this.jvbJingleSession && (this.jvbEstablishmentDuration = this.jvbJingleSession.establishmentDuration);var t = !1, + n = this.options.config.forceJVB121Ratio;if (e.isP2P ? this.p2pJingleSession !== e ? (j.error("CONNECTION_ESTABLISHED - wrong P2P session instance ?!"), t = !0) : !e.isInitiator && "number" == typeof n && Math.random() < n && (j.info("Forcing JVB 121 mode (ratio=" + n + ")..."), A.a.analytics.addPermanentProperties({ forceJvb121: !0 }), this._stopP2PSession("decline", "force JVB121"), t = !0) : t = !0, !isNaN(this.p2pEstablishmentDuration) && !isNaN(this.jvbEstablishmentDuration)) { + var r = this.p2pEstablishmentDuration - this.jvbEstablishmentDuration;A.a.analytics.sendEvent("ice.establishmentDurationDiff", { value: r }); + }t || (this._setP2PStatus(!0), this.jvbJingleSession ? this._removeRemoteJVBTracks() : j.info("Not removing remote JVB tracks - no session yet"), this._addRemoteP2PTracks(), this.jvbJingleSession && this._suspendMediaTransferForJvbConnection(), j.info("Starting remote stats with p2p connection"), this.statistics.startRemoteStats(this.p2pJingleSession.peerconnection), this.p2pJingleSession.isInitiator && A.a.sendEventToAll("p2p.established")); + }, r.prototype._maybeClearDeferredStartP2P = function () { + this.deferredStartP2PTask && (j.info("Cleared deferred start P2P task"), clearTimeout(this.deferredStartP2PTask), this.deferredStartP2PTask = null); + }, r.prototype._removeRemoteJVBTracks = function () { + this._removeRemoteTracks("JVB", this.jvbJingleSession.peerconnection.getRemoteTracks()); + }, r.prototype._removeRemoteP2PTracks = function () { + this._removeRemoteTracks("P2P", this.p2pJingleSession.peerconnection.getRemoteTracks()); + }, r.prototype._removeRemoteTracks = function (e, t) { + var n = !0, + r = !1, + i = void 0;try { + for (var o, a = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value;j.info("Removing remote " + e + " track: " + s), this.rtc.eventEmitter.emit(k.REMOTE_TRACK_REMOVED, s); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + } + }, r.prototype._resumeMediaTransferForJvbConnection = function () { + j.info("Resuming media transfer over the JVB connection..."), this.jvbJingleSession.setMediaTransferActive(!0, !0).then(function () { + j.info("Resumed media transfer over the JVB connection!"); + }, function (e) { + j.error("Failed to resume media transfer over the JVB connection:", e); + }); + }, r.prototype._setP2PStatus = function (e) { + if (this.p2p === e) return void j.error("Called _setP2PStatus with the same status: " + e);if (this.p2p = e, e) { + j.info("Peer to peer connection established!"), A.a.analytics.addPermanentProperties({ p2pFailed: !1, forceJvb121: !1 });var t = 0 !== this.rtc.getLastN();this.p2pJingleSession.setMediaTransferActive(!0, t).catch(function (e) { + j.error("Failed to sync up P2P video transfer status(" + t + ")", e); + }); + } else j.info("Peer to peer connection closed!");this.jvbJingleSession && this.statistics.sendConnectionResumeOrHoldEvent(this.jvbJingleSession.peerconnection, !e), this.dtmfManager = null, this.eventEmitter.emit(h.P2P_STATUS, this, this.p2p), this.eventEmitter.emit(this.isConnectionInterrupted() ? h.CONNECTION_INTERRUPTED : h.CONNECTION_RESTORED); + }, r.prototype._startP2PSession = function (e) { + if (this._maybeClearDeferredStartP2P(), this.p2pJingleSession) return void j.error("P2P session already started!");this.isP2PConnectionInterrupted = !1, this.p2pJingleSession = this.xmpp.connection.jingle.newP2PJingleSession(this.room.myroomjid, e), j.info("Created new P2P JingleSession", this.room.myroomjid, e), this.p2pJingleSession.initialize(!0, this.room, this.rtc), j.info("Starting CallStats for P2P connection..."), this.statistics.startCallStats(this.p2pJingleSession.peerconnection, Strophe.getResourceFromJid(this.p2pJingleSession.peerjid));var t = this.getLocalTracks();this.p2pJingleSession.invite(t); + }, r.prototype._suspendMediaTransferForJvbConnection = function () { + j.info("Suspending media transfer over the JVB connection..."), this.jvbJingleSession.setMediaTransferActive(!1, !1).then(function () { + j.info("Suspended media transfer over the JVB connection !"); + }, function (e) { + j.error("Failed to suspend media transfer over the JVB connection:", e); + }); + }, r.prototype._maybeStartOrStopP2P = function (e) { + if (!R.a.isP2PSupported() || !this.isP2PEnabled() || this.isP2PTestModeEnabled()) return void j.info("Auto P2P disabled");var t = this.getParticipants(), + n = t.length, + r = this.isModerator(), + i = 1 === n;if (j.debug("P2P? isModerator: " + r + ", peerCount: " + n + " => " + i), !i && this.deferredStartP2PTask && this._maybeClearDeferredStartP2P(), r && !this.p2pJingleSession && i) { + var o = n && t[0];if (r && "moderator" === o.getRole()) { + var a = this.myUserId(), + s = o.getId();if (a > s) return void j.debug("Everyone's a moderator - the other peer should start P2P", a, s);if (a === s) return void j.error("The same IDs ? ", a, s); + }var c = o.getJid();if (e) { + if (this.deferredStartP2PTask) return void j.error("Deferred start P2P task's been set already!");j.info("Will start P2P with: " + c + " after " + this.backToP2PDelay + " seconds..."), this.deferredStartP2PTask = setTimeout(this._startP2PSession.bind(this, c), 1e3 * this.backToP2PDelay); + } else j.info("Will start P2P with: " + c), this._startP2PSession(c); + } else this.p2pJingleSession && !i && (j.info("Will stop P2P with: " + this.p2pJingleSession.peerjid), this.p2pJingleSession.isInitiator && n > 1 && A.a.sendEventToAll("p2p.switch_to_jvb"), this._stopP2PSession()); + }, r.prototype._stopP2PSession = function (e, t) { + if (!this.p2pJingleSession) return void j.error("No P2P session to be stopped!");var n = this.isP2PActive();n && (this.jvbJingleSession && this._resumeMediaTransferForJvbConnection(), this._removeRemoteP2PTracks()), j.info("Stopping remote stats for P2P connection"), this.statistics.stopRemoteStats(this.p2pJingleSession.peerconnection), j.info("Stopping CallStats for P2P connection"), this.statistics.stopCallStats(this.p2pJingleSession.peerconnection), this.p2pJingleSession.terminate(function () { + j.info("P2P session terminate RESULT"); + }, function (t) { + e && j.error("An error occurred while trying to terminate P2P Jingle session", t); + }, { reason: e || "success", reasonDescription: t || "Turing off P2P session", sendSessionTerminate: this.room && this.getParticipantById(Strophe.getResourceFromJid(this.p2pJingleSession.peerjid)) }), this.p2pJingleSession = null, this._setP2PStatus(!1), n && (this.jvbJingleSession ? this._addRemoteJVBTracks() : j.info("Not adding remote JVB tracks - no session yet")); + }, r.prototype.isP2PActive = function () { + return this.p2p; + }, r.prototype.getP2PConnectionState = function () { + return this.isP2PActive() ? this.p2pJingleSession.peerconnection.getConnectionState() : null; + }, r.prototype.startP2PSession = function () { + var e = this.getParticipants();if (1 !== e.length) throw new Error("There must be exactly 1 participant to start the P2P session !");var t = e[0].getJid();this._startP2PSession(t); + }, r.prototype.stopP2PSession = function () { + this._stopP2PSession(); + }, r.prototype.getSpeakerStats = function () { + return this.speakerStatsCollector.getStats(); + }, r.prototype._getVideoSIPGWHandle = function () { + return this.videoSIPGWHandler || (this.videoSIPGWHandler = new N.a(this.room), j.info("Created VideoSIPGW")), this.videoSIPGWHandler; + }, r.prototype.isVideoSIPGWAvailable = function () { + return this._getVideoSIPGWHandle().isVideoSIPGWAvailable(); + }, r.prototype.createVideoSIPGWSession = function (e, t) { + return this.room ? this._getVideoSIPGWHandle().createVideoSIPGWSession(e, t) : null; + }; + }).call(t, "JitsiConference.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e) { + this.conference = e, e.on(l.TRACK_MUTE_CHANGED, function (t) { + if (t.isLocal() && e.statistics) { + var n = t.isP2P ? e.p2pJingleSession : e.jvbJingleSession, + r = n && n.peerconnection || null;e.statistics.sendMuteEvent(r, t.isMuted(), t.getType()); + } + }), e.on(l.CONNECTION_INTERRUPTED, h.a.sendEventToAll.bind(h.a, "connection.interrupted")), e.on(l.CONNECTION_RESTORED, h.a.sendEventToAll.bind(h.a, "connection.restored")); + }t.a = r;var i = n(54), + o = n.n(i), + a = n(115), + s = n.n(a), + c = n(0), + u = (n.n(c), n(26)), + l = n(5), + d = n(4), + p = n(8), + f = n.n(p), + h = n(6), + m = n(7), + v = n.n(m), + g = n.i(c.getLogger)(e);r.prototype.setupChatRoomListeners = function () { + var e = this, + t = this.conference, + n = t.room;this.chatRoomForwarder = new s.a(n, this.conference.eventEmitter), n.addListener(v.a.ICE_RESTARTING, function (e) { + e.isP2P || t.rtc.closeBridgeChannel(); + }), n.addListener(v.a.AUDIO_MUTED_BY_FOCUS, function (e) { + t.rtc.setAudioMute(e).then(function () { + t.isMutedByFocus = !0; + }, function () { + return g.warn("Error while audio muting due to focus request"); + }); + }), this.chatRoomForwarder.forward(v.a.SUBJECT_CHANGED, l.SUBJECT_CHANGED), this.chatRoomForwarder.forward(v.a.MUC_JOINED, l.CONFERENCE_JOINED), n.addListener(v.a.MUC_JOINED, function () { + e.conference.isJvbConnectionInterrupted = !1, Object.keys(n.connectionTimes).forEach(function (e) { + var t = n.connectionTimes[e];h.a.analytics.sendEvent("conference." + e, { value: t }); + }), Object.keys(n.xmpp.connectionTimes).forEach(function (e) { + var t = n.xmpp.connectionTimes[e];h.a.analytics.sendEvent("xmpp." + e, { value: t }); + }); + }), this.chatRoomForwarder.forward(v.a.ROOM_JOIN_ERROR, l.CONFERENCE_FAILED, u.CONNECTION_ERROR), this.chatRoomForwarder.forward(v.a.ROOM_CONNECT_ERROR, l.CONFERENCE_FAILED, u.CONNECTION_ERROR), this.chatRoomForwarder.forward(v.a.ROOM_CONNECT_NOT_ALLOWED_ERROR, l.CONFERENCE_FAILED, u.NOT_ALLOWED_ERROR), this.chatRoomForwarder.forward(v.a.ROOM_MAX_USERS_ERROR, l.CONFERENCE_FAILED, u.CONFERENCE_MAX_USERS), this.chatRoomForwarder.forward(v.a.PASSWORD_REQUIRED, l.CONFERENCE_FAILED, u.PASSWORD_REQUIRED), this.chatRoomForwarder.forward(v.a.AUTHENTICATION_REQUIRED, l.CONFERENCE_FAILED, u.AUTHENTICATION_REQUIRED), this.chatRoomForwarder.forward(v.a.BRIDGE_DOWN, l.CONFERENCE_FAILED, u.VIDEOBRIDGE_NOT_AVAILABLE), n.addListener(v.a.BRIDGE_DOWN, function () { + return h.a.analytics.sendEvent("conference.bridgeDown"); + }), this.chatRoomForwarder.forward(v.a.RESERVATION_ERROR, l.CONFERENCE_FAILED, u.RESERVATION_ERROR), this.chatRoomForwarder.forward(v.a.GRACEFUL_SHUTDOWN, l.CONFERENCE_FAILED, u.GRACEFUL_SHUTDOWN), n.addListener(v.a.JINGLE_FATAL_ERROR, function (e, n) { + e.isP2P || t.eventEmitter.emit(l.CONFERENCE_FAILED, u.JINGLE_FATAL_ERROR, n); + }), n.addListener(v.a.CONNECTION_ICE_FAILED, function (e) { + t._onIceConnectionFailed(e); + }), this.chatRoomForwarder.forward(v.a.MUC_DESTROYED, l.CONFERENCE_FAILED, u.CONFERENCE_DESTROYED), this.chatRoomForwarder.forward(v.a.CHAT_ERROR_RECEIVED, l.CONFERENCE_ERROR, u.CHAT_ERROR), this.chatRoomForwarder.forward(v.a.FOCUS_DISCONNECTED, l.CONFERENCE_FAILED, u.FOCUS_DISCONNECTED), n.addListener(v.a.FOCUS_LEFT, function () { + h.a.analytics.sendEvent("conference.focusLeft"), t.eventEmitter.emit(l.CONFERENCE_FAILED, u.FOCUS_LEFT); + });var r = function r(e) { + return h.a.sendEventToAll("conference.error." + e); + };n.addListener(v.a.SESSION_ACCEPT_TIMEOUT, function (e) { + r(e.isP2P ? "p2pSessionAcceptTimeout" : "sessionAcceptTimeout"); + }), this.chatRoomForwarder.forward(v.a.RECORDER_STATE_CHANGED, l.RECORDER_STATE_CHANGED), this.chatRoomForwarder.forward(v.a.VIDEO_SIP_GW_AVAILABILITY_CHANGED, l.VIDEO_SIP_GW_AVAILABILITY_CHANGED), this.chatRoomForwarder.forward(v.a.PHONE_NUMBER_CHANGED, l.PHONE_NUMBER_CHANGED), n.addListener(v.a.CONFERENCE_SETUP_FAILED, function (e, n) { + e.isP2P || t.eventEmitter.emit(l.CONFERENCE_FAILED, u.SETUP_FAILED, n); + }), n.setParticipantPropertyListener(function (e, n) { + var r = t.getParticipantById(n);r && r.setProperty(e.tagName.substring("jitsi_participant_".length), e.value); + }), this.chatRoomForwarder.forward(v.a.KICKED, l.KICKED), n.addListener(v.a.KICKED, function () { + t.room = null, t.leave(); + }), n.addListener(v.a.SUSPEND_DETECTED, t.onSuspendDetected.bind(t)), this.chatRoomForwarder.forward(v.a.MUC_LOCK_CHANGED, l.LOCK_STATE_CHANGED), n.addListener(v.a.MUC_MEMBER_JOINED, t.onMemberJoined.bind(t)), n.addListener(v.a.MUC_MEMBER_LEFT, t.onMemberLeft.bind(t)), this.chatRoomForwarder.forward(v.a.MUC_LEFT, l.CONFERENCE_LEFT), n.addListener(v.a.DISPLAY_NAME_CHANGED, t.onDisplayNameChanged.bind(t)), n.addListener(v.a.LOCAL_ROLE_CHANGED, function (e) { + t.onLocalRoleChanged(e), t.statistics && t.isModerator() && t.on(l.RECORDER_STATE_CHANGED, function (e, t) { + var n = { id: "recorder_status", status: e };t && (n.error = t), h.a.sendLog(JSON.stringify(n)); + }); + }), n.addListener(v.a.MUC_ROLE_CHANGED, t.onUserRoleChanged.bind(t)), n.addListener(o.a.IDENTITY_UPDATED, function (e, n) { + t.authEnabled = e, t.authIdentity = n, t.eventEmitter.emit(l.AUTH_STATUS_CHANGED, e, n); + }), n.addListener(v.a.MESSAGE_RECEIVED, function (e, n, r, i, o) { + var a = Strophe.getResourceFromJid(e);t.eventEmitter.emit(l.MESSAGE_RECEIVED, a, r, o); + }), n.addListener(v.a.PRESENCE_STATUS, function (e, n) { + var r = Strophe.getResourceFromJid(e), + i = t.getParticipantById(r);i && i._status !== n && (i._status = n, t.eventEmitter.emit(l.USER_STATUS_CHANGED, r, n)); + }), n.addPresenceListener("startmuted", function (e, n) { + var r = !1;if (t.myUserId() === n && t.isModerator()) r = !0;else { + var i = t.getParticipantById(n);i && i.isModerator() && (r = !0); + }if (r) { + var o = "true" === e.attributes.audio, + a = "true" === e.attributes.video, + s = !1;o !== t.startMutedPolicy.audio && (t.startMutedPolicy.audio = o, s = !0), a !== t.startMutedPolicy.video && (t.startMutedPolicy.video = a, s = !0), s && t.eventEmitter.emit(l.START_MUTED_POLICY_CHANGED, t.startMutedPolicy); + } + }), n.addPresenceListener("devices", function (e, n) { + var r = !1, + i = !1;e.children.forEach(function (e) { + "audio" === e.tagName && (r = "true" === e.value), "video" === e.tagName && (i = "true" === e.value); + });var o = void 0;if (t.myUserId() === n) o = t.availableDevices;else { + var a = t.getParticipantById(n);if (!a) return;o = a._availableDevices; + }var s = !1;o.audio !== r && (s = !0, o.audio = r), o.video !== i && (s = !0, o.video = i), s && t.eventEmitter.emit(l.AVAILABLE_DEVICES_CHANGED, n, o); + }), t.statistics && (n.addListener(v.a.CONNECTION_ICE_FAILED, function (e) { + t.statistics.sendIceConnectionFailedEvent(e.peerconnection); + }), n.addListener(v.a.ADD_ICE_CANDIDATE_FAILED, function (e, n) { + t.statistics.sendAddIceCandidateFailed(e, n); + })); + }, r.prototype.setupRTCListeners = function () { + var e = this.conference, + t = e.rtc;t.addListener(f.a.REMOTE_TRACK_ADDED, e.onRemoteTrackAdded.bind(e)), t.addListener(f.a.REMOTE_TRACK_REMOVED, e.onRemoteTrackRemoved.bind(e)), t.addListener(f.a.DOMINANT_SPEAKER_CHANGED, function (t) { + e.lastDominantSpeaker !== t && e.room && (e.lastDominantSpeaker = t, e.eventEmitter.emit(l.DOMINANT_SPEAKER_CHANGED, t)), e.statistics && e.myUserId() === t && e.statistics.sendDominantSpeakerEvent(); + }), t.addListener(f.a.DATA_CHANNEL_OPEN, function () { + var t = window.performance.now();g.log("(TIME) data channel opened ", t), e.room.connectionTimes["data.channel.opened"] = t, h.a.analytics.sendEvent("conference.dataChannel.open", { value: t }); + }), t.addListener(f.a.AVAILABLE_DEVICES_CHANGED, function (t) { + return e.room.updateDeviceAvailability(t); + }), t.addListener(f.a.ENDPOINT_MESSAGE_RECEIVED, function (t, n) { + var r = e.getParticipantById(t);r ? e.eventEmitter.emit(l.ENDPOINT_MESSAGE_RECEIVED, r, n) : g.warn("Ignored ENDPOINT_MESSAGE_RECEIVED for not existing participant: " + t, n); + }), t.addListener(f.a.LOCAL_UFRAG_CHANGED, function (e, t) { + e.isP2P || h.a.sendLog(JSON.stringify({ id: "local_ufrag", value: t })); + }), t.addListener(f.a.REMOTE_UFRAG_CHANGED, function (e, t) { + e.isP2P || h.a.sendLog(JSON.stringify({ id: "remote_ufrag", value: t })); + }), e.statistics && (t.addListener(f.a.CREATE_ANSWER_FAILED, function (t, n) { + e.statistics.sendCreateAnswerFailed(t, n); + }), t.addListener(f.a.CREATE_OFFER_FAILED, function (t, n) { + e.statistics.sendCreateOfferFailed(t, n); + }), t.addListener(f.a.SET_LOCAL_DESCRIPTION_FAILED, function (t, n) { + e.statistics.sendSetLocalDescFailed(t, n); + }), t.addListener(f.a.SET_REMOTE_DESCRIPTION_FAILED, function (t, n) { + e.statistics.sendSetRemoteDescFailed(t, n); + })); + }, r.prototype.setupXMPPListeners = function () { + var e = this.conference;e.xmpp.caps.addListener(v.a.PARTCIPANT_FEATURES_CHANGED, function (t) { + var n = e.getParticipantId(Strophe.getResourceFromJid(t));n && e.eventEmitter.emit(l.PARTCIPANT_FEATURES_CHANGED, n); + }), e.xmpp.addListener(v.a.CALL_INCOMING, e.onIncomingCall.bind(e)), e.xmpp.addListener(v.a.CALL_ACCEPTED, e.onCallAccepted.bind(e)), e.xmpp.addListener(v.a.TRANSPORT_INFO, e.onTransportInfo.bind(e)), e.xmpp.addListener(v.a.CALL_ENDED, e.onCallEnded.bind(e)), e.xmpp.addListener(v.a.START_MUTED_FROM_FOCUS, function (t, n) { + e.options.config.ignoreStartMuted || (e.startAudioMuted = t, e.startVideoMuted = n, e.getLocalTracks().forEach(function (t) { + switch (t.getType()) {case d.a: + e.startAudioMuted && t.mute();break;case d.b: + e.startVideoMuted && t.mute();} + }), e.eventEmitter.emit(l.STARTED_MUTED)); + }); + }, r.prototype.setupStatisticsListeners = function () { + var e = this.conference;e.statistics && (e.statistics.addAudioLevelListener(function (t, n, r, i) { + e.rtc.setAudioLevel(t, n, r, i); + }), e.statistics.addBeforeDisposedListener(function () { + e.eventEmitter.emit(l.BEFORE_STATISTICS_DISPOSED); + }), e.statistics.addByteSentStatsListener(function (t, n) { + e.getLocalTracks(d.a).forEach(function (e) { + var r = t.getLocalSSRC(e);r && n.hasOwnProperty(r) && e._setByteSent(t, n[r]); + }); + })); + }; + }).call(t, "JitsiConferenceEventManager.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t, n) { + this.appID = e, this.token = t, this.options = n, this.xmpp = new s.a(n, t), this.addEventListener(o.CONNECTION_FAILED, function (e, t) { + a.a.sendEventToAll("connection.failed." + e, { label: t }); + }), this.addEventListener(o.CONNECTION_DISCONNECTED, function (e) { + e && a.a.analytics.sendEvent("connection.disconnected." + e), a.a.sendLog(JSON.stringify({ id: "connection.disconnected", msg: e })); + }); + }t.a = r;var i = n(81), + o = n(27), + a = n(6), + s = n(136);r.prototype.connect = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};this.xmpp.connect(e.id, e.password); + }, r.prototype.attach = function (e) { + this.xmpp.attach(e); + }, r.prototype.disconnect = function () { + var e;(e = this.xmpp).disconnect.apply(e, arguments); + }, r.prototype.setToken = function (e) { + this.token = e; + }, r.prototype.initJitsiConference = function (e, t) { + return new i.a({ name: e, config: t, connection: this }); + }, r.prototype.addEventListener = function (e, t) { + this.xmpp.addListener(e, t); + }, r.prototype.removeEventListener = function (e, t) { + this.xmpp.removeListener(e, t); + }, r.prototype.getConnectionTimes = function () { + return this.xmpp.connectionTimes; + }, r.prototype.addFeature = function (e) { + var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];return this.xmpp.caps.addFeature(e, t); + }, r.prototype.removeFeature = function (e) { + var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];return this.xmpp.caps.removeFeature(e, t); + }; + }, function (e, t, n) { + "use strict"; + function r(e, t) { + var n = t.find(function (t) { + return "audiooutput" === t.kind && t.deviceId === e; + });n && p.a.sendActiveDeviceListEvent(c.a.getEventDataForActiveDevice(n)); + }var i = n(14), + o = n.n(i), + a = n(44), + s = n(4), + c = n(22), + u = n(2), + l = n(8), + d = n.n(l), + p = n(6), + f = new o.a(), + h = { enumerateDevices: function enumerateDevices(e) { + c.a.enumerateDevices(e); + }, isDeviceListAvailable: function isDeviceListAvailable() { + return c.a.isDeviceListAvailable(); + }, isDeviceChangeAvailable: function isDeviceChangeAvailable(e) { + return c.a.isDeviceChangeAvailable(e); + }, isDevicePermissionGranted: function isDevicePermissionGranted(e) { + var t = c.a.getDeviceAvailability();switch (e) {case s.b: + return !0 === t.video;case s.a: + return !0 === t.audio;default: + return !0 === t.video && !0 === t.audio;} + }, isMultipleAudioInputSupported: function isMultipleAudioInputSupported() { + return !u.a.isFirefox(); + }, getAudioOutputDevice: function getAudioOutputDevice() { + return c.a.getAudioOutputDevice(); + }, setAudioOutputDevice: function setAudioOutputDevice(e) { + var t = c.a.getCurrentlyAvailableMediaDevices();return t && t.length > 0 && r(e, c.a.getCurrentlyAvailableMediaDevices()), c.a.setAudioOutputDevice(e); + }, addEventListener: function addEventListener(e, t) { + f.addListener(e, t); + }, removeEventListener: function removeEventListener(e, t) { + f.removeListener(e, t); + }, emitEvent: function emitEvent(e) { + for (var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) { + n[r - 1] = arguments[r]; + }f.emit.apply(f, [e].concat(n)); + } };c.a.addListener(d.a.DEVICE_LIST_CHANGED, function (e) { + return f.emit(a.DEVICE_LIST_CHANGED, e); + }), c.a.addListener(d.a.DEVICE_LIST_AVAILABLE, function (e) { + return r(h.getAudioOutputDevice(), e); + }), t.a = h; + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(5), + o = n(28), + a = n(4), + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = function () { + function e(t, n, i, a) { + r(this, e), this._jid = t, this._id = Strophe.getResourceFromJid(t), this._conference = n, this._displayName = i, this._supportsDTMF = !1, this._tracks = [], this._role = "none", this._status = null, this._availableDevices = { audio: void 0, video: void 0 }, this._hidden = a, this._connectionStatus = o.a.ACTIVE, this._properties = {}; + }return s(e, [{ key: "getConference", value: function value() { + return this._conference; + } }, { key: "getProperty", value: function value(e) { + return this._properties[e]; + } }, { key: "hasAnyVideoTrackWebRTCMuted", value: function value() { + return this.getTracks().some(function (e) { + return e.getType() === a.b && e.isWebRTCTrackMuted(); + }); + } }, { key: "_setConnectionStatus", value: function value(e) { + this._connectionStatus = e; + } }, { key: "getConnectionStatus", value: function value() { + return this._connectionStatus; + } }, { key: "setProperty", value: function value(e, t) { + var n = this._properties[e];t !== n && (this._properties[e] = t, this._conference.eventEmitter.emit(i.PARTICIPANT_PROPERTY_CHANGED, this, e, n, t)); + } }, { key: "getTracks", value: function value() { + return this._tracks.slice(); + } }, { key: "getTracksByMediaType", value: function value(e) { + return this.getTracks().filter(function (t) { + return t.getType() === e; + }); + } }, { key: "getId", value: function value() { + return this._id; + } }, { key: "getJid", value: function value() { + return this._jid; + } }, { key: "getDisplayName", value: function value() { + return this._displayName; + } }, { key: "getStatus", value: function value() { + return this._status; + } }, { key: "isModerator", value: function value() { + return "moderator" === this._role; + } }, { key: "isHidden", value: function value() { + return this._hidden; + } }, { key: "isAudioMuted", value: function value() { + return this._isMediaTypeMuted(a.a); + } }, { key: "_isMediaTypeMuted", value: function value(e) { + return this.getTracks().reduce(function (t, n) { + return t && (n.getType() !== e || n.isMuted()); + }, !0); + } }, { key: "isVideoMuted", value: function value() { + return this._isMediaTypeMuted(a.b); + } }, { key: "getRole", value: function value() { + return this._role; + } }, { key: "supportsDTMF", value: function value() { + return this._supportsDTMF; + } }, { key: "getFeatures", value: function value() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 5e3;return this._conference.xmpp.caps.getFeatures(this._jid, e); + } }]), e; + }();t.a = c; + }, function (e, t, n) { + e.exports = n(68).default; + }, function (e, t, n) { + (function (e) { + function t(e, t) { + var n = e.getTrack();if (!n) throw new Error("Failed to initialize DTMFSender: no audio track.");this.dtmfSender = t.peerconnection.createDTMFSender(n), r.debug("Initialized DTMFSender"); + }var r = n(0).getLogger(e);t.prototype.sendTones = function (e, t, n) { + this.dtmfSender.insertDTMF(e, t || 200, n || 200); + }; + }).call(t, "modules/DTMF/JitsiDTMFManager.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(5), + o = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + a = function () { + function e(t) { + r(this, e), this.conference = t, t.addEventListener(i.TRACK_AUDIO_LEVEL_CHANGED, this._audioLevel.bind(this)), this.myUserID = this.conference.myUserId(); + }return o(e, [{ key: "_audioLevel", value: function value(e, t) { + !this.conference.isP2PActive() || t <= .6 || e === this.myUserID && this.conference.getLocalAudioTrack().isMuted() || this.conference.eventEmitter.emit(i.DOMINANT_SPEAKER_CHANGED, e); + } }]), e; + }();t.a = a; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(8)), + a = n.n(o), + s = n(3), + c = n.n(s), + u = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + l = n.i(i.getLogger)(e), + d = function () { + function e(t, n, i) { + var o = this;if (r(this, e), !t && !n) throw new TypeError("At least peerconnection or wsUrl must be given");if (t && n) throw new TypeError("Just one of peerconnection or wsUrl must be given");if (t ? l.debug("constructor() with peerconnection") : l.debug('constructor() with wsUrl:"' + n + '"'), this._channel = null, this._eventEmitter = i, this._mode = null, t) t.ondatachannel = function (e) { + var t = e.channel;o._handleChannel(t), o._mode = "datachannel"; + };else if (n) { + var a = new WebSocket(n);this._handleChannel(a), this._mode = "websocket"; + } + }return u(e, [{ key: "close", value: function value() { + if (this._channel) { + try { + this._channel.close(); + } catch (e) {}this._channel = null; + } + } }, { key: "isOpen", value: function value() { + return this._channel && ("open" === this._channel.readyState || this._channel.readyState === WebSocket.OPEN); + } }, { key: "sendMessage", value: function value(e, t) { + this._send({ colibriClass: "EndpointMessage", msgPayload: t, to: e }); + } }, { key: "sendSetLastNMessage", value: function value(e) { + var t = { colibriClass: "LastNChangedEvent", lastN: e };this._send(t), l.log("Channel lastN set to: " + e); + } }, { key: "sendPinnedEndpointMessage", value: function value(e) { + l.log("sending pinned changed notification to the bridge for endpoint ", e), this._send({ colibriClass: "PinnedEndpointChangedEvent", pinnedEndpoint: e || null }); + } }, { key: "sendSelectedEndpointMessage", value: function value(e) { + l.log("sending selected changed notification to the bridge for endpoint ", e), this._send({ colibriClass: "SelectedEndpointChangedEvent", selectedEndpoint: e || null }); + } }, { key: "sendReceiverVideoConstraintMessage", value: function value(e) { + l.log("sending a ReceiverVideoConstraint message with a maxFrameHeight of " + e + " pixels"), this._send({ colibriClass: "ReceiverVideoConstraint", maxFrameHeight: e }); + } }, { key: "_handleChannel", value: function value(e) { + var t = this, + n = this._eventEmitter;e.onopen = function () { + l.info(t._mode + " channel opened"), n.emit(a.a.DATA_CHANNEL_OPEN); + }, e.onerror = function (e) { + l.error("Channel error:", e); + }, e.onmessage = function (e) { + var t = e.data, + r = void 0;try { + r = JSON.parse(t); + } catch (e) { + return c.a.callErrorHandler(e), void l.error("Failed to parse channel message as JSON: ", t, e); + }var i = r.colibriClass;switch (i) {case "DominantSpeakerEndpointChangeEvent": + var o = r.dominantSpeakerEndpoint;l.info("Channel new dominant speaker event: ", o), n.emit(a.a.DOMINANT_SPEAKER_CHANGED, o);break;case "EndpointConnectivityStatusChangeEvent": + var s = r.endpoint, + u = "true" === r.active;l.info("Endpoint connection status changed: " + s + " active ? " + u), n.emit(a.a.ENDPOINT_CONN_STATUS_CHANGED, s, u);break;case "EndpointMessage": + n.emit(a.a.ENDPOINT_MESSAGE_RECEIVED, r.from, r.msgPayload);break;case "LastNEndpointsChangeEvent": + var d = r.lastNEndpoints;l.info("Channel new last-n event: ", d, r), n.emit(a.a.LASTN_ENDPOINT_CHANGED, d, r);break;default: + l.debug("Channel JSON-formatted message: ", r), n.emit("rtc.datachannel." + i, r);} + }, e.onclose = function () { + l.info("Channel closed"), t._channel = null; + }, this._channel = e; + } }, { key: "_send", value: function value(e) { + var t = this._channel;if (!this.isOpen()) throw new Error("No opened channel");t.send(JSON.stringify(e)); + } }, { key: "mode", get: function get() { + return this._mode; + } }]), e; + }();t.a = d; + }).call(t, "modules/RTC/BridgeChannel.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e, t) { + return e.inMuteOrUnmuteProgress ? Promise.reject(new d.a(p.TRACK_MUTE_UNMUTE_IN_PROGRESS)) : (e.inMuteOrUnmuteProgress = !0, e._setMute(t).then(function () { + e.inMuteOrUnmuteProgress = !1; + }).catch(function (t) { + throw e.inMuteOrUnmuteProgress = !1, t; + })); + }var s = n(52), + c = n.n(s), + u = n(0), + l = (n.n(u), n(46)), + d = n(11), + p = n(15), + f = n(16), + h = n(4), + m = n(2), + v = n(8), + g = n.n(v), + y = n(23), + b = n(6), + S = n(17), + E = n.n(S), + T = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + _ = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + C = n.i(u.getLogger)(e), + w = function (e) { + function t(e) { + r(this, t);var n = e.rtcId, + o = e.stream, + a = e.track, + s = e.mediaType, + c = e.videoType, + u = e.resolution, + l = e.deviceId, + d = e.facingMode, + p = e.sourceId, + h = e.sourceType, + v = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, null, o, a, function () { + v.dontFireRemoveEvent || v.emit(f.LOCAL_TRACK_STOPPED), v.dontFireRemoveEvent = !1; + }, s, c));return v.rtcId = n, v.dontFireRemoveEvent = !1, v.resolution = u, v.sourceId = p, v.sourceType = h, m.a.isFirefox() && (v.resolution = null), v.deviceId = l, v.storedMSID = v.getMSID(), v.inMuteOrUnmuteProgress = !1, v._facingMode = d, v._trackEnded = !1, v._bytesSent = null, v._testByteSent = !0, v._realDeviceId = "" === v.deviceId ? void 0 : v.deviceId, v.stopStreamInProgress = !1, v._noDataFromSourceTimeout = null, v._onDeviceListChanged = function (e) { + v._setRealDeviceIdFromDeviceList(e), void 0 !== v.getTrack().readyState || void 0 === v._realDeviceId || e.find(function (e) { + return e.deviceId === v._realDeviceId; + }) || (v._trackEnded = !0); + }, v.isAudioTrack() && y.a.isDeviceChangeAvailable("output") && (v._onAudioOutputDeviceChanged = v.setAudioOutput.bind(v), y.a.addListener(g.a.AUDIO_OUTPUT_DEVICE_CHANGED, v._onAudioOutputDeviceChanged)), y.a.addListener(g.a.DEVICE_LIST_CHANGED, v._onDeviceListChanged), v._initNoDataFromSourceHandlers(), v; + }return o(t, e), T(t, [{ key: "isEnded", value: function value() { + return "ended" === this.getTrack().readyState || this._trackEnded; + } }, { key: "_initNoDataFromSourceHandlers", value: function value() { + var e = this;if (this.isVideoTrack() && this.videoType === E.a.CAMERA) { + var t = this._onNoDataFromSourceError.bind(this);this._setHandler("track_mute", function () { + if (e._checkForCameraIssues()) { + var n = window.performance.now();e._noDataFromSourceTimeout = setTimeout(t, 3e3), e._setHandler("track_unmute", function () { + e._clearNoDataFromSourceMuteResources(), b.a.sendEventToAll(e.getType() + ".track_unmute", { value: window.performance.now() - n }); + }); + } + }), this._setHandler("track_ended", t); + } + } }, { key: "_clearNoDataFromSourceMuteResources", value: function value() { + this._noDataFromSourceTimeout && (clearTimeout(this._noDataFromSourceTimeout), this._noDataFromSourceTimeout = null), this._setHandler("track_unmute", void 0); + } }, { key: "_onNoDataFromSourceError", value: function value() { + this._clearNoDataFromSourceMuteResources(), this._checkForCameraIssues() && this._fireNoDataFromSourceEvent(); + } }, { key: "_fireNoDataFromSourceEvent", value: function value() { + this.emit(f.NO_DATA_FROM_SOURCE);var e = this.getType() + ".no_data_from_source";b.a.analytics.sendEvent(e);var t = { name: e };this.isAudioTrack() && (t.isReceivingData = this._isReceivingData()), b.a.sendLog(JSON.stringify(t)); + } }, { key: "_setRealDeviceIdFromDeviceList", value: function value(e) { + var t = this.getTrack(), + n = e.find(function (e) { + return e.kind === t.kind + "input" && e.label === t.label; + });n && (this._realDeviceId = n.deviceId); + } }, { key: "_setStream", value: function value(e) { + _(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_setStream", this).call(this, e), e ? (this.storedMSID = this.getMSID(), C.debug("Setting new MSID: " + this.storedMSID + " on " + this)) : C.debug("Setting 'null' stream on " + this); + } }, { key: "mute", value: function value() { + return a(this, !0); + } }, { key: "unmute", value: function value() { + return a(this, !1); + } }, { key: "_setMute", value: function value(e) { + var t = this;if (this.isMuted() === e) return Promise.resolve();var n = Promise.resolve();this.dontFireRemoveEvent = !1;var r = function r() { + return C.info("Mute " + t + ": " + e); + };if (this.isAudioTrack() || this.videoType === E.a.DESKTOP || !m.a.doesVideoMuteByStreamRemove()) r(), this.track && (this.track.enabled = !e);else if (e) this.dontFireRemoveEvent = !0, n = new Promise(function (e, n) { + r(), t._removeStreamFromConferenceAsMute(function () { + t._stopMediaStream(), t._setStream(null), e(); + }, function (e) { + n(e); + }); + });else { + r();var i = { cameraDeviceId: this.getDeviceId(), devices: [h.b], facingMode: this.getCameraFacingMode() };this.resolution && (i.resolution = this.resolution), n = y.a.obtainAudioAndVideoPermissions(i).then(function (e) { + var n = t.getType(), + r = e.find(function (e) { + return e.mediaType === n; + });if (!r) throw new d.a(p.TRACK_NO_STREAM_FOUND);return t._setStream(r.stream), t.track = r.track, t.videoType !== r.videoType && (C.warn(t + ": video type has changed after unmute!", t.videoType, r.videoType), t.videoType = r.videoType), t.containers = t.containers.map(function (e) { + return y.a.attachMediaStream(e, t.stream); + }), t._addStreamToConferenceAsUnmute(); + }); + }return n.then(function () { + return t._sendMuteStatus(e); + }).then(function () { + t.emit(f.TRACK_MUTE_CHANGED, t); + }); + } }, { key: "_addStreamToConferenceAsUnmute", value: function value() { + var e = this;return this.conference ? new Promise(function (t, n) { + e.conference._addLocalTrackAsUnmute(e).then(t, function (e) { + return n(new Error(e)); + }); + }) : Promise.resolve(); + } }, { key: "_removeStreamFromConferenceAsMute", value: function value(e, t) { + if (!this.conference) return void e();this.conference._removeLocalTrackAsMute(this).then(e, function (e) { + return t(new Error(e)); + }); + } }, { key: "_sendMuteStatus", value: function value(e) { + var t = this;return this.conference && this.conference.room ? new Promise(function (n) { + t.conference.room[t.isAudioTrack() ? "setAudioMute" : "setVideoMute"](e, n); + }) : Promise.resolve(); + } }, { key: "dispose", value: function value() { + var e = this, + n = Promise.resolve();return this.conference && (n = this.conference.removeTrack(this)), this.stream && (this._stopMediaStream(), this.detach()), y.a.removeListener(g.a.DEVICE_LIST_CHANGED, this._onDeviceListChanged), this._onAudioOutputDeviceChanged && y.a.removeListener(g.a.AUDIO_OUTPUT_DEVICE_CHANGED, this._onAudioOutputDeviceChanged), n.then(function () { + return _(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "dispose", e).call(e); + }); + } }, { key: "isMuted", value: function value() { + return !(this.stream && (!this.isVideoTrack() || this.isActive()) && this.track && this.track.enabled); + } }, { key: "_setConference", value: function value(e) { + this.conference = e;for (var t = 0; t < this.containers.length; t++) { + this._maybeFireTrackAttached(this.containers[t]); + } + } }, { key: "isLocal", value: function value() { + return !0; + } }, { key: "getDeviceId", value: function value() { + return this._realDeviceId || this.deviceId; + } }, { key: "getParticipantId", value: function value() { + return this.conference && this.conference.myUserId(); + } }, { key: "_setByteSent", value: function value(e, t) { + var n = this;this._bytesSent = t;var r = e.getConnectionState();this._testByteSent && "connected" === r && (setTimeout(function () { + n._bytesSent <= 0 && (C.warn(n + " 'bytes sent' <= 0: " + n._bytesSent), n._fireNoDataFromSourceEvent()); + }, 3e3), this._testByteSent = !1); + } }, { key: "getCameraFacingMode", value: function value() { + if (this.isVideoTrack() && this.videoType === E.a.CAMERA) { + var e = void 0;try { + e = this.track.getSettings(); + } catch (e) {}return e && "facingMode" in e ? e.facingMode : void 0 !== this._facingMode ? this._facingMode : c.a.USER; + } + } }, { key: "_stopMediaStream", value: function value() { + this.stopStreamInProgress = !0, y.a.stopMediaStream(this.stream), this.stopStreamInProgress = !1; + } }, { key: "_switchCamera", value: function value() { + this.isVideoTrack() && this.videoType === E.a.CAMERA && "function" == typeof this.track._switchCamera && (this.track._switchCamera(), this._facingMode = this._facingMode === c.a.ENVIRONMENT ? c.a.USER : c.a.ENVIRONMENT); + } }, { key: "_checkForCameraIssues", value: function value() { + return !(!this.isVideoTrack() || this.stopStreamInProgress || this.videoType === E.a.DESKTOP || this._isReceivingData()); + } }, { key: "_isReceivingData", value: function value() { + return !!this.stream && this.stream.getTracks().some(function (e) { + return !("readyState" in e && "live" !== e.readyState || "muted" in e && !0 === e.muted); + }); + } }, { key: "toString", value: function value() { + return "LocalTrack[" + this.rtcId + "," + this.getType() + "]"; + } }]), t; + }(l.a);t.a = w; + }).call(t, "modules/RTC/JitsiLocalTrack.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(46), + s = n(16), + c = n(2), + u = n(6), + l = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + d = n(0).getLogger(e), + p = n(8), + f = !1, + h = !1, + m = function (e) { + function t(e, n, o, a, s, c, u, l, d, p) { + r(this, t);var f = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, n, a, s, function () {}, c, u));if (f.rtc = e, "number" != typeof l) throw new TypeError("SSRC " + l + " is not a number");return f.ssrc = l, f.ownerEndpointId = o, f.muted = d, f.isP2P = p, f.hasBeenMuted = d, f.rtc && f.track && f._bindMuteHandlers(), f; + }return o(t, e), l(t, [{ key: "_bindMuteHandlers", value: function value() { + var e = this;this.track.addEventListener ? (this.track.addEventListener("mute", function () { + return e._onTrackMute(); + }), this.track.addEventListener("unmute", function () { + return e._onTrackUnmute(); + })) : this.track.attachEvent && (this.track.attachEvent("onmute", function () { + return e._onTrackMute(); + }), this.track.attachEvent("onunmute", function () { + return e._onTrackUnmute(); + })); + } }, { key: "_onTrackMute", value: function value() { + d.debug('"onmute" event(' + Date.now() + "): ", this.getParticipantId(), this.getType(), this.getSSRC()), this.rtc.eventEmitter.emit(p.REMOTE_TRACK_MUTE, this); + } }, { key: "_onTrackUnmute", value: function value() { + d.debug('"onunmute" event(' + Date.now() + "): ", this.getParticipantId(), this.getType(), this.getSSRC()), this.rtc.eventEmitter.emit(p.REMOTE_TRACK_UNMUTE, this); + } }, { key: "setMute", value: function value(e) { + this.muted !== e && (e && (this.hasBeenMuted = !0), this.stream && (this.stream.muted = e), this.muted = e, this.emit(s.TRACK_MUTE_CHANGED, this)); + } }, { key: "isMuted", value: function value() { + return this.muted; + } }, { key: "getParticipantId", value: function value() { + return this.ownerEndpointId; + } }, { key: "isLocal", value: function value() { + return !1; + } }, { key: "getSSRC", value: function value() { + return this.ssrc; + } }, { key: "_setVideoType", value: function value(e) { + this.videoType !== e && (this.videoType = e, this.emit(s.TRACK_VIDEOTYPE_CHANGED, e)); + } }, { key: "_playCallback", value: function value() { + var e = this.isVideoTrack() ? "video" : "audio", + t = window.performance.now();console.log("(TIME) Render " + e + ":\t", t), this.conference.getConnectionTimes()[e + ".render"] = t;var n = window.connectionTimes["obtainPermissions.start"], + r = window.connectionTimes["obtainPermissions.end"], + i = isNaN(r) || isNaN(n) ? 0 : r - n, + o = t - (this.conference.getConnectionTimes()["session.initiate"] - this.conference.getConnectionTimes()["muc.joined"]) - i;this.conference.getConnectionTimes()[e + ".ttfm"] = o, console.log("(TIME) TTFM " + e + ":\t", o);var a = e + ".ttfm";this.hasBeenMuted && (a += ".muted"), u.a.analytics.sendEvent(a, { value: o }); + } }, { key: "_attachTTFMTracker", value: function value(e) { + if (!(f && this.isAudioTrack() || h && this.isVideoTrack())) if (this.isAudioTrack() && (f = !0), this.isVideoTrack() && (h = !0), c.a.isTemasysPluginUsed()) { + var t = n(33);t.addEvent(e, "play", this._playCallback.bind(this)); + } else e.addEventListener("canplay", this._playCallback.bind(this)); + } }, { key: "toString", value: function value() { + return "RemoteTrack[" + this.ownerEndpointId + ", " + this.getType() + ", p2p: " + this.isP2P + "]"; + } }]), t; + }(a.a);t.a = m; + }).call(t, "modules/RTC/JitsiRemoteTrack.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(4)), + a = n(24), + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = n.i(i.getLogger)(e), + u = function () { + function e(t) { + r(this, e), this.tpc = t; + }return s(e, [{ key: "_addMutedLocalVideoTracksToSDP", value: function value(e) { + var t = this.tpc.getLocalTracks(o.b);if (!t.length) return !1;1 !== t.length && c.error(this.tpc + " there is more than 1 video track ! Strange things may happen !", t);var n = e.selectMedia("video");if (!n) return c.error(this.tpc + ' unable to hack local video track SDP- no "video" media'), !1;var r = !1, + i = !0, + a = !1, + s = void 0;try { + for (var u, l = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (u = l.next()).done); i = !0) { + var d = u.value, + p = d.isMuted(), + f = d.inMuteOrUnmuteProgress, + h = p || f;if (c.debug(this.tpc + " " + d + " isMuted: " + p + ", is mute in progress: " + f + " => should fake sdp ? : " + h), h) { + var m = this.tpc.isSimulcastOn() ? this.tpc.simulcast.ssrcCache : [this.tpc.sdpConsistency.cachedPrimarySsrc];if (m.length) { + r = !0, n.direction = "sendrecv";var v = m[0], + g = "injected-" + v, + y = !0, + b = !1, + S = void 0;try { + for (var E, T = m[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(y = (E = T.next()).done); y = !0) { + var _ = E.value;n.removeSSRC(_), c.debug(this.tpc + " injecting video SSRC: " + _ + " for " + d), n.addSSRCAttribute({ id: _, attribute: "cname", value: g }), n.addSSRCAttribute({ id: _, attribute: "msid", value: d.storedMSID }); + } + } catch (e) { + b = !0, S = e; + } finally { + try { + !y && T.return && T.return(); + } finally { + if (b) throw S; + } + }if (m.length > 1) { + var C = { ssrcs: m.join(" "), semantics: "SIM" };n.findGroup(C.semantics, C.ssrcs) || (c.debug(this.tpc + " injecting SIM group for " + d, C), n.addSSRCGroup(C)); + }this.tpc.options.disableRtx || this.tpc.rtxModifier.modifyRtxSsrcs2(n); + } else c.error("No SSRCs stored for: " + d + " in " + this.tpc); + } + } + } catch (e) { + a = !0, s = e; + } finally { + try { + !i && l.return && l.return(); + } finally { + if (a) throw s; + } + }return r; + } }, { key: "maybeMungeLocalSdp", value: function value(e) { + if (e && e.sdp) { + var t = new a.a(e.sdp);this._addMutedLocalVideoTracksToSDP(t) && (e.sdp = t.toRawSDP()); + } + } }]), e; + }();t.a = u; + }).call(t, "modules/RTC/LocalSdpMunger.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + var r = n(2), + i = n(0).getLogger(e), + o = { getVideoElementName: function getVideoElementName() { + return r.a.isTemasysPluginUsed() ? "object" : "video"; + }, findVideoElement: function findVideoElement(e) { + var t = o.getVideoElementName();if (!r.a.isTemasysPluginUsed()) return $(e).find(t)[0];var n = $(e).find(" " + t + '>param[value="video"]');return n.length ? (n.length > 1 && i.warn("Container with more than one video elements: ", e), n.parent()[0]) : void 0; + }, isResizeEventSupported: function isResizeEventSupported() { + return !r.a.isTemasysPluginUsed(); + }, setVolume: function setVolume(e, t) { + r.a.isIExplorer() || (e.volume = t); + }, setAutoPlay: function setAutoPlay(e, t) { + r.a.isIExplorer() || (e.autoplay = t); + } };t.a = o; + }).call(t, "modules/RTC/RTCUIHelper.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t, n) { + T(["screen"], function (e) { + return t({ stream: e }); + }, n); + }function i(e) { + return "https://chrome.google.com/webstore/detail/" + e.desktopSharingChromeExtId; + }function o(e, t) { + try { + for (var n = e.split("."), r = t.split("."), i = Math.max(n.length, r.length), o = 0; o < i; o++) { + var a = 0, + s = 0;if (o < n.length && (a = parseInt(n[o], 10)), o < r.length && (s = parseInt(r[o], 10)), isNaN(a) || isNaN(s)) return !0;if (a !== s) return a > s; + }return !1; + } catch (e) { + return g.callErrorHandler(e), v.error("Failed to parse extension version", e), !0; + } + }function a(e, t) { + if ("undefined" == typeof chrome || !chrome || !chrome.runtime) return void e(!1, !1);chrome.runtime.sendMessage(t.desktopSharingChromeExtId, { getVersion: !0 }, function (n) { + if (!n || !n.version) return v.warn("Extension not installed?: ", chrome.runtime.lastError), void e(!1, !1);var r = n.version;v.log("Extension version is: " + r);var i = o(t.desktopSharingChromeMinExtVersion, r);e(!i, i); + }); + }function s(e, t, n) { + chrome.runtime.sendMessage(e.desktopSharingChromeExtId, { getStream: !0, sources: e.desktopSharingChromeSources }, function (e) { + if (!e) { + var r = chrome.runtime.lastError;return void n(r instanceof Error ? r : new f.a(h.CHROME_EXTENSION_GENERIC_ERROR, r)); + }v.log("Response from extension: ", e), d(e, t, n); + }); + }function c(e) { + 0 === $("link[rel=chrome-webstore-item]").length && $("head").append(''), $("link[rel=chrome-webstore-item]").attr("href", i(e)); + }function u(e) { + return c(e), new Promise(function (t) { + a(function (e, n) { + y = e, b = n, v.info("Chrome extension installed: " + y + " updateRequired: " + b), t(); + }, e); + }); + }function l(e, t, n) { + return 0 === n ? Promise.reject() : new Promise(function (r, i) { + var o = n, + s = window.setInterval(function () { + a(function (e) { + e ? (window.clearInterval(s), r()) : 0 == --o && (i(), window.clearInterval(s)); + }, e); + }, t); + }); + }function d(e, t, n) { + var r = e.streamId, + i = e.streamType, + o = e.error;if (r) T(["desktop"], function (e) { + return t({ stream: e, sourceId: r, sourceType: i }); + }, n, { desktopStream: r });else { + if ("" === r) return void n(new f.a(h.CHROME_EXTENSION_USER_CANCELED));n(new f.a(h.CHROME_EXTENSION_GENERIC_ERROR, o)); + } + }function p(e) { + if (!e.desktopSharingFirefoxDisabled && !1 !== S && !0 !== S) { + if (!e.desktopSharingFirefoxExtId) return void (S = !1);var t = document.createElement("img");t.onload = function () { + v.log("Detected firefox screen sharing extension."), S = !0; + }, t.onerror = function () { + v.log("Detected lack of firefox screen sharing extension."), S = !1; + };var n = "chrome://" + e.desktopSharingFirefoxExtId.replace("@", ".") + "/content/" + document.location.hostname + ".png";t.setAttribute("src", n); + } + }var f = n(11), + h = n(15), + m = n(2), + v = n(0).getLogger(e), + g = n(3), + y = !1, + b = !1, + S = null, + E = !1, + T = null, + _ = { intChromeExtPromise: null, obtainStream: null, init: function init() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { disableDesktopSharing: !1, desktopSharingChromeDisabled: !1, desktopSharingChromeExtId: null, desktopSharingFirefoxDisabled: !1, desktopSharingFirefoxExtId: null }, + t = arguments[1];this.options = e = e || {}, T = t, this.obtainStream = this.options.disableDesktopSharing ? null : this._createObtainStreamMethod(e), this.obtainStream || v.info("Desktop sharing disabled"); + }, _createObtainStreamMethod: function _createObtainStreamMethod(e) { + var t = this;if (m.a.isNWJS()) return function (e, t, n) { + window.JitsiMeetNW.obtainDesktopStream(t, function (e, t) { + var r = void 0;r = e && "InvalidStateError" === e.name ? new f.a(h.CHROME_EXTENSION_USER_CANCELED) : new f.a(e, t, ["desktop"]), "function" == typeof n && n(r); + }); + };if (m.a.isElectron()) return this.obtainScreenOnElectron;if (m.a.isTemasysPluginUsed()) { + var i = n(33).WebRTCPlugin.plugin;return i.HasScreensharingFeature ? i.isScreensharingAvailable ? (v.info("Using Temasys plugin for desktop sharing"), r) : (v.warn("Screensharing not available with Temasys plugin on this site"), null) : (v.warn("Screensharing not supported by this plugin version"), null); + }return m.a.isChrome() ? m.a.getChromeVersion() < 34 ? (v.info("Chrome extension not supported until ver 34"), null) : e.desktopSharingChromeDisabled || !1 === e.desktopSharingChromeMethod || !e.desktopSharingChromeExtId ? null : (v.info("Using Chrome extension for desktop sharing"), this.intChromeExtPromise = u(e).then(function () { + t.intChromeExtPromise = null; + }), this.obtainScreenFromExtension) : m.a.isFirefox() ? e.desktopSharingFirefoxDisabled ? null : "http:" === window.location.protocol ? (v.log("Screen sharing is not supported over HTTP. Use of HTTPS is required."), null) : (p(e), this.obtainScreenOnFirefox) : (v.log("Screen sharing not supported by the current browser: ", m.a.getBrowserType(), m.a.getBrowserName()), null); + }, isSupported: function isSupported() { + return null !== this.obtainStream; + }, obtainScreenOnFirefox: function obtainScreenOnFirefox(e, t, n) { + var i = this, + o = !1, + a = this.options.desktopSharingFirefoxMaxVersionExtRequired;return (-1 === a || a >= 0 && m.a.getFirefoxVersion() <= a) && (o = !0, v.log("Jidesha extension required on firefox version " + m.a.getFirefoxVersion())), o && !0 !== S ? (E && (E = !1, p(this.options)), null === S ? (window.setTimeout(function () { + null === S && (S = !1), i.obtainScreenOnFirefox(t, n); + }, 300), void v.log("Waiting for detection of jidesha on firefox to finish.")) : (S = null, E = !0, void n(new f.a(h.FIREFOX_EXTENSION_NEEDED)))) : void r(e, t, n); + }, obtainScreenOnElectron: function obtainScreenOnElectron() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + t = arguments[1], + n = arguments[2];window.JitsiMeetScreenObtainer && window.JitsiMeetScreenObtainer.openDesktopPicker ? window.JitsiMeetScreenObtainer.openDesktopPicker({ desktopSharingSources: e.desktopSharingSources || this.options.desktopSharingChromeSources }, function (e, r) { + return d({ streamId: e, streamType: r }, t, n); + }, function (e) { + return n(new f.a(h.ELECTRON_DESKTOP_PICKER_ERROR, e)); + }) : n(new f.a(h.ELECTRON_DESKTOP_PICKER_NOT_FOUND)); + }, obtainScreenFromExtension: function obtainScreenFromExtension(e, t, n) { + var r = this;if (null !== this.intChromeExtPromise) return void this.intChromeExtPromise.then(function () { + r.obtainScreenFromExtension(e, t, n); + });var o = this.options, + a = o.desktopSharingChromeExtId, + c = o.desktopSharingChromeSources, + u = { desktopSharingChromeExtId: a, desktopSharingChromeSources: e.desktopSharingSources || c };if (y) s(u, t, n);else { + b && alert("Jitsi Desktop Streamer requires update. Changes will take effect after next Chrome restart.");try { + chrome.webstore.install(i(this.options), function (i) { + v.log("Extension installed successfully", i), y = !0, l(r.options, 200, 10).then(function () { + s(u, t, n); + }).catch(function () { + r.handleExtensionInstallationError(e, t, n); + }); + }, this.handleExtensionInstallationError.bind(this, e, t, n)); + } catch (r) { + this.handleExtensionInstallationError(e, t, n, r); + } + } + }, handleExtensionInstallationError: function handleExtensionInstallationError(e, t, n, r) { + var o = i(this.options);if (("Inline installs can not be initiated from pop-up windows." === r || "Chrome Web Store installations can only be started by the top frame." === r || "Installs can only be initiated by one of the Chrome Web Store item's verified sites." === r) && e.interval > 0 && "function" == typeof e.checkAgain && "function" == typeof e.listener) return e.listener("waitingForExtension", o), void this.checkForChromeExtensionOnInterval(e, t, n, r);var a = "Failed to install the extension from " + o;v.log(a, r);var s = "Chrome Web Store installations can only be initated by a user gesture." === r ? h.CHROME_EXTENSION_USER_GESTURE_REQUIRED : h.CHROME_EXTENSION_INSTALLATION_ERROR;n(new f.a(s, a)); + }, checkForChromeExtensionOnInterval: function checkForChromeExtensionOnInterval(e, t, n) { + var r = this;if (!1 === e.checkAgain()) return void n(new f.a(h.CHROME_EXTENSION_INSTALLATION_ERROR));l(this.options, e.interval, 1).then(function () { + y = !0, e.listener("extensionFound"), r.obtainScreenFromExtension(e, t, n); + }).catch(function () { + r.checkForChromeExtensionOnInterval(e, t, n); + }); + } };t.a = _; + }).call(t, "modules/RTC/ScreenObtainer.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t, r, i, o, a, s) { + var c = this;this.audioTransferActive = !0, this.videoTransferActive = !0, this.rtc = e, this.id = t, this.isP2P = a, this.remoteTracks = new Map(), this.localTracks = new Map(), this.localSSRCs = new Map(), this.localUfrag = null, this.remoteUfrag = null, this.signalingLayer = r, this._peerVideoTypeChanged = this._peerVideoTypeChanged.bind(this), this.signalingLayer.on(_.a, this._peerVideoTypeChanged), this._peerMutedChanged = this._peerMutedChanged.bind(this), this.signalingLayer.on(_.b, this._peerMutedChanged), this.options = s, this.peerconnection = new h.a.RTCPeerConnectionType(i, o), this.updateLog = [], this.stats = {}, this.statsinterval = null, this.maxstats = 0;var u = n(140).Interop;this.interop = new u();var l = n(143);this.simulcast = new l({ numOfLayers: R, explodeRemoteSimulcast: !1 }), this.sdpConsistency = new S.a(this.toString()), this.localSdpMunger = new p.a(this), this.eventEmitter = e.eventEmitter, this.rtxModifier = new y.a(), this.trace = function (e, t) { + c.updateLog.push({ time: new Date(), type: e, value: t || "" }); + }, this.onicecandidate = null, this.peerconnection.onicecandidate = function (e) { + m.a.isTemasysPluginUsed() || c.trace("onicecandidate", JSON.stringify(e.candidate, null, " ")), null !== c.onicecandidate && c.onicecandidate(e); + }, this.peerconnection.onaddstream = function (e) { + return c._remoteStreamAdded(e.stream); + }, this.peerconnection.onremovestream = function (e) { + return c._remoteStreamRemoved(e.stream); + }, this.onsignalingstatechange = null, this.peerconnection.onsignalingstatechange = function (e) { + c.trace("onsignalingstatechange", c.signalingState), null !== c.onsignalingstatechange && c.onsignalingstatechange(e); + }, this.oniceconnectionstatechange = null, this.peerconnection.oniceconnectionstatechange = function (e) { + c.trace("oniceconnectionstatechange", c.iceConnectionState), null !== c.oniceconnectionstatechange && c.oniceconnectionstatechange(e); + }, this.onnegotiationneeded = null, this.peerconnection.onnegotiationneeded = function (e) { + c.trace("onnegotiationneeded"), null !== c.onnegotiationneeded && c.onnegotiationneeded(e); + }, this.ondatachannel = null, this.peerconnection.ondatachannel = function (e) { + c.trace("ondatachannel", e), null !== c.ondatachannel && c.ondatachannel(e); + }, !m.a.isFirefox() && this.maxstats && (this.statsinterval = window.setInterval(function () { + c.peerconnection.getStats(function (e) { + for (var t = e.result(), n = new Date(), r = 0; r < t.length; ++r) { + !function (e) { + t[e].names().forEach(function (r) { + var i = t[e].id + "-" + r, + o = c.stats[i];o || (c.stats[i] = o = { startTime: n, endTime: n, values: [], times: [] }), o.values.push(t[e].stat(r)), o.times.push(n.getTime()), o.values.length > c.maxstats && (o.values.shift(), o.times.shift()), o.endTime = n; + }); + }(r); + } + }); + }, 1e3)), w.info("Create new " + this); + }function i(e) { + var t = new Map(), + n = new Map();if ("object" !== (void 0 === e ? "undefined" : C(e)) || null === e || "string" != typeof e.sdp) return w.warn("An empty description was passed as an argument."), t;var r = c.a.parse(e.sdp);if (!Array.isArray(r.media)) return t;var i = !0, + o = !1, + a = void 0;try { + for (var s, u = r.media[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (s = u.next()).done); i = !0) { + var l = s.value;if (Array.isArray(l.ssrcs)) { + if (Array.isArray(l.ssrcGroups)) { + var d = !0, + p = !1, + f = void 0;try { + for (var h, m = l.ssrcGroups[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (h = m.next()).done); d = !0) { + var v = h.value;if (void 0 !== v.semantics && void 0 !== v.ssrcs) { + var g = v.ssrcs.split(" ").map(function (e) { + return parseInt(e, 10); + }), + y = g[0];v.ssrcs = g, n.has(y) || n.set(y, []), n.get(y).push(v); + } + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && m.return && m.return(); + } finally { + if (p) throw f; + } + } + }var b = !0, + S = !1, + E = void 0;try { + for (var T, _ = l.ssrcs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(b = (T = _.next()).done); b = !0) { + var R = T.value;if ("msid" === R.attribute) { + var k = R.value, + A = t.get(k);A || (A = { ssrcs: [], groups: [], msid: k }, t.set(k, A));var I = R.id;if (A.ssrcs.push(I), n.has(I)) { + var P = n.get(I), + O = !0, + D = !1, + L = void 0;try { + for (var N, M = P[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(O = (N = M.next()).done); O = !0) { + var x = N.value;A.groups.push(x); + } + } catch (e) { + D = !0, L = e; + } finally { + try { + !O && M.return && M.return(); + } finally { + if (D) throw L; + } + } + } + } + } + } catch (e) { + S = !0, E = e; + } finally { + try { + !b && _.return && _.return(); + } finally { + if (S) throw E; + } + } + } + } + } catch (e) { + o = !0, a = e; + } finally { + try { + !i && u.return && u.return(); + } finally { + if (o) throw a; + } + }return t; + }function o(e) { + return e && e.groups && e.groups.length ? e.groups[0].ssrcs[0] : e && e.ssrcs && e.ssrcs.length ? e.ssrcs[0] : null; + }t.a = r;var a = n(0), + s = (n.n(a), n(13)), + c = n.n(s), + u = n(3), + l = (n.n(u), n(91)), + d = n(4), + p = n(92), + f = n(22), + h = n(23), + m = n(2), + v = n(8), + g = n.n(v), + y = n(124), + b = n(51), + S = n(126), + E = n(24), + T = n(12), + _ = n(53), + C = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + w = n.i(a.getLogger)(e), + R = 3, + k = ["1", "2", "3"], + A = function A(e) { + return void 0 === e || null === e ? "" : "type: " + e.type + "\r\n" + e.sdp; + };r.prototype.getConnectionState = function () { + var e = this.peerconnection.iceConnectionState;return "completed" === e ? "connected" : e; + }, r.prototype._getDesiredMediaDirection = function (e) { + var t = !0;return e === d.a ? t = this.audioTransferActive : e === d.b && (t = this.videoTransferActive), t ? this.hasAnyTracksOfType(e) ? "sendrecv" : "recvonly" : "inactive"; + }, r.prototype.isSimulcastOn = function () { + return !this.options.disableSimulcast && m.a.supportsSimulcast() && (!m.a.isFirefox() || this.options.enableFirefoxSimulcast); + }, r.prototype._peerVideoTypeChanged = function (e, t) { + if (!e) return void w.error("No endpointID on peerVideoTypeChanged " + this);var n = this.getRemoteTracks(e, d.b);n.length && n[0]._setVideoType(t); + }, r.prototype._peerMutedChanged = function (e, t, n) { + if (!e) return void w.error("On peerMuteChanged - no endpoint ID");var r = this.getRemoteTracks(e, t);r.length && r[0].setMute(n); + }, r.prototype.getLocalTracks = function (e) { + var t = Array.from(this.localTracks.values());return void 0 !== e && (t = t.filter(function (t) { + return t.getType() === e; + })), t; + }, r.prototype.hasAnyTracksOfType = function (e) { + if (!e) throw new Error('"mediaType" is required');return this.getLocalTracks(e).length > 0; + }, r.prototype.getRemoteTracks = function (e, t) { + var n = [], + r = e ? [e] : this.remoteTracks.keys(), + i = !0, + o = !1, + a = void 0;try { + for (var s, c = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (s = c.next()).done); i = !0) { + var u = s.value, + l = this.remoteTracks.get(u);if (l) { + var d = !0, + p = !1, + f = void 0;try { + for (var h, m = l.keys()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (h = m.next()).done); d = !0) { + var v = h.value;if (!t || t === v) { + var g = l.get(v);g && n.push(g); + } + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && m.return && m.return(); + } finally { + if (p) throw f; + } + } + } + } + } catch (e) { + o = !0, a = e; + } finally { + try { + !i && c.return && c.return(); + } finally { + if (o) throw a; + } + }return n; + }, r.prototype.getTrackBySSRC = function (e) { + if ("number" != typeof e) throw new Error("SSRC " + e + " is not a number");var t = !0, + n = !1, + r = void 0;try { + for (var i, o = this.localTracks.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + var a = i.value;if (this.getLocalSSRC(a) === e) return a; + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + }var s = !0, + c = !1, + u = void 0;try { + for (var l, d = this.getRemoteTracks()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(s = (l = d.next()).done); s = !0) { + var p = l.value;if (p.getSSRC() === e) return p; + } + } catch (e) { + c = !0, u = e; + } finally { + try { + !s && d.return && d.return(); + } finally { + if (c) throw u; + } + }return null; + }, r.prototype._remoteStreamAdded = function (e) { + var t = this, + n = f.a.getStreamID(e);if (!f.a.isUserStreamById(n)) return void w.info(this + " ignored remote 'stream added' event for non-user streamid: " + n);(m.a.isChrome() || m.a.isNWJS() || m.a.isElectron() || m.a.isEdge()) && (e.onaddtrack = function (n) { + t._remoteTrackAdded(e, n.track); + }, e.onremovetrack = function (n) { + t._remoteTrackRemoved(e, n.track); + });var r = e.getAudioTracks(), + i = !0, + o = !1, + a = void 0;try { + for (var s, c = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (s = c.next()).done); i = !0) { + var u = s.value;this._remoteTrackAdded(e, u); + } + } catch (e) { + o = !0, a = e; + } finally { + try { + !i && c.return && c.return(); + } finally { + if (o) throw a; + } + }var l = e.getVideoTracks(), + d = !0, + p = !1, + h = void 0;try { + for (var v, g = l[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (v = g.next()).done); d = !0) { + var y = v.value;this._remoteTrackAdded(e, y); + } + } catch (e) { + p = !0, h = e; + } finally { + try { + !d && g.return && g.return(); + } finally { + if (p) throw h; + } + } + }, r.prototype._remoteTrackAdded = function (e, t) { + var n = f.a.getStreamID(e), + r = t.kind;if (w.info(this + " remote track added:", n, r), !r) return void u.callErrorHandler(new Error("MediaType undefined for remote track, stream id: " + n));var i = new b.a(this.remoteDescription.sdp), + o = i.media.filter(function (e) { + return e.startsWith("m=" + r); + });if (!o.length) return void u.callErrorHandler(new Error("No media lines for type " + r + " found in remote SDP for remote track: " + n));var a = T.a.findLines(o[0], "a=ssrc:");if (a = a.filter(function (e) { + var t = m.a.isTemasysPluginUsed() ? "mslabel" : "msid";return -1 !== e.indexOf(t + ":" + n); + }), !a.length) return void u.callErrorHandler(new Error("No SSRC lines for streamId " + n + " for remote track, media type: " + r));var s = a[0].substring(7).split(" ")[0], + c = Number(s), + l = this.signalingLayer.getSSRCOwner(c);if (isNaN(c) || c < 0) return void u.callErrorHandler(new Error("Invalid SSRC: " + s + " for remote track, msid: " + n + " media type: " + r));if (!l) return void u.callErrorHandler(new Error("No SSRC owner known for: " + c + " for remote track, msid: " + n + " media type: " + r));w.log(this + " associated ssrc", l, c);var d = this.signalingLayer.getPeerMediaInfo(l, r);if (!d) return void u.callErrorHandler(new Error(this + ": no peer media info available for " + l));var p = d.muted, + h = d.videoType;this._createRemoteTrack(l, e, t, r, h, c, p); + }, r.prototype._createRemoteTrack = function (e, t, n, r, i, o, a) { + var s = new l.a(this.rtc, this.rtc.conference, e, t, n, r, i, o, a, this.isP2P), + c = this.remoteTracks.get(e);c || (c = new Map(), this.remoteTracks.set(e, c)), c.has(r) && w.error(this + " overwriting remote track! " + s, e, r), c.set(r, s), this.eventEmitter.emit(g.a.REMOTE_TRACK_ADDED, s); + }, r.prototype._remoteStreamRemoved = function (e) { + if (!f.a.isUserStream(e)) { + var t = f.a.getStreamID(e);return void w.info("Ignored remote 'stream removed' event for non-user stream " + t); + }var n = e.getVideoTracks(), + r = !0, + i = !1, + o = void 0;try { + for (var a, s = n[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value;this._remoteTrackRemoved(e, c); + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }var u = e.getAudioTracks(), + l = !0, + d = !1, + p = void 0;try { + for (var h, m = u[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(l = (h = m.next()).done); l = !0) { + var v = h.value;this._remoteTrackRemoved(e, v); + } + } catch (e) { + d = !0, p = e; + } finally { + try { + !l && m.return && m.return(); + } finally { + if (d) throw p; + } + } + }, r.prototype._remoteTrackRemoved = function (e, t) { + var n = f.a.getStreamID(e), + r = t && f.a.getTrackID(t);return w.info(this + " - remote track removed: " + n + ", " + r), n ? r ? void (this._removeRemoteTrackById(n, r) || w.warn(this + " Removed track not found for msid: " + n + ",\n track id: " + r)) : void u.callErrorHandler(new Error(this + " remote track removal failed - no track ID")) : void u.callErrorHandler(new Error(this + " remote track removal failed - no stream ID")); + }, r.prototype._getRemoteTrackById = function (e, t) { + var n = !0, + r = !1, + i = void 0;try { + for (var o, a = this.remoteTracks.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = !0, + u = !1, + l = void 0;try { + for (var d, p = s.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (d = p.next()).done); c = !0) { + var f = d.value;if (f.getStreamId() == e && f.getTrackId() == t) return f; + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && p.return && p.return(); + } finally { + if (u) throw l; + } + } + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + } + }, r.prototype.removeRemoteTracks = function (e) { + var t = [], + n = this.remoteTracks.get(e);if (n) { + var r = n.get(d.a), + i = n.get(d.b);r && t.push(r), i && t.push(i), this.remoteTracks.delete(e); + }return w.debug(this + " removed remote tracks for " + e + " count: " + t.length), t; + }, r.prototype._removeRemoteTrack = function (e) { + e.dispose();var t = e.getParticipantId(), + n = this.remoteTracks.get(t);n ? n.delete(e.getType()) || w.error("Failed to remove " + e + " - type mapping messed up ?") : w.error("removeRemoteTrack: no remote tracks map for " + t), this.eventEmitter.emit(g.a.REMOTE_TRACK_REMOVED, e); + }, r.prototype._removeRemoteTrackById = function (e, t) { + var n = this._getRemoteTrackById(e, t);return n && this._removeRemoteTrack(n), n; + };var I = function I(e) { + if ("object" !== (void 0 === e ? "undefined" : C(e)) || null === e || "string" != typeof e.sdp) return w.warn("An empty description was passed as an argument."), e;var t = n(13), + r = t.parse(e.sdp);void 0 !== r && void 0 !== r.media && Array.isArray(r.media) && r.media.forEach(function (e) { + var t = [], + n = [];if (void 0 !== e.ssrcGroups && Array.isArray(e.ssrcGroups) && e.ssrcGroups.forEach(function (e) { + void 0 !== e.semantics && "FID" === e.semantics && void 0 !== e.ssrcs && t.push(Number(e.ssrcs.split(" ")[0])); + }), Array.isArray(e.ssrcs)) { + var r = void 0;for (r = 0; r < e.ssrcs.length; r++) { + "object" === C(e.ssrcs[r]) && void 0 !== e.ssrcs[r].id && t.indexOf(e.ssrcs[r].id) >= 0 && (n.push(e.ssrcs[r]), delete e.ssrcs[r]); + }for (r = 0; r < e.ssrcs.length; r++) { + void 0 !== e.ssrcs[r] && n.push(e.ssrcs[r]); + }e.ssrcs = n; + } + });var i = t.write(r);return new RTCSessionDescription({ type: e.type, sdp: i }); + }, + P = function P(e) { + if (e && e.sdp) { + var t = new E.a(e.sdp), + n = t.selectMedia("audio"), + r = !1;n && "sendrecv" !== n.direction && (n.direction = "sendrecv", r = !0);var i = t.selectMedia("video");i && "sendrecv" !== i.direction && (i.direction = "sendrecv", r = !0), r && (e.sdp = t.toRawSDP()); + } + };r.prototype.getLocalSSRC = function (e) { + var t = this._getSSRC(e.rtcId);return t && t.ssrcs[0]; + }, r.prototype._injectSsrcGroupForUnifiedSimulcast = function (e) { + var t = c.a.parse(e.sdp), + n = t.media.find(function (e) { + return "video" === e.type; + });if (n.simulcast_03) { + var r = [];if (n.ssrcs.forEach(function (e) { + "msid" === e.attribute && r.push(e.id); + }), n.ssrcGroups = n.ssrcGroups || [], n.ssrcGroups.find(function (e) { + return "SIM" === e.semantics; + })) return e;n.ssrcGroups.push({ semantics: "SIM", ssrcs: r.join(" ") }); + }return e.sdp = c.a.write(t), e; + };var O = { signalingState: function signalingState() { + return this.peerconnection.signalingState; + }, iceConnectionState: function iceConnectionState() { + return this.peerconnection.iceConnectionState; + }, localDescription: function localDescription() { + var e = this.peerconnection.localDescription;return this.trace("getLocalDescription::preTransform", A(e)), e && m.a.usesUnifiedPlan() && (e = this.interop.toPlanB(e), this.trace("getLocalDescription::postTransform (Plan B)", A(e)), e = this._injectSsrcGroupForUnifiedSimulcast(e), this.trace("getLocalDescription::postTransform (inject ssrc group)", A(e))), m.a.doesVideoMuteByStreamRemove() && (this.localSdpMunger.maybeMungeLocalSdp(e), w.debug("getLocalDescription::postTransform (munge local SDP)", e)), P(e), e || {}; + }, remoteDescription: function remoteDescription() { + var e = this.peerconnection.remoteDescription;return this.trace("getRemoteDescription::preTransform", A(e)), m.a.usesUnifiedPlan() && (e = this.interop.toPlanB(e), this.trace("getRemoteDescription::postTransform (Plan B)", A(e))), e || {}; + } };Object.keys(O).forEach(function (e) { + Object.defineProperty(r.prototype, e, { get: O[e] }); + }), r.prototype._getSSRC = function (e) { + return this.localSSRCs.get(e); + }, r.prototype.addTrack = function (e) { + var t = e.rtcId;if (w.info("add " + e + " to: " + this), this.localTracks.has(t)) return void w.error(e + " is already in " + this);this.localTracks.set(t, e);var n = e.getOriginalStream();if (n ? this._addStream(n) : (!m.a.doesVideoMuteByStreamRemove() || e.isAudioTrack() || e.isVideoTrack() && !e.isMuted()) && w.error(this + " no WebRTC stream for: " + e), m.a.doesVideoMuteByStreamRemove() && e.isVideoTrack() && e.isMuted()) { + var r = this.generateNewStreamSSRCInfo(e);this.sdpConsistency.setPrimarySsrc(r.ssrcs[0]);var i = r.groups.find(function (e) { + return "SIM" === e.semantics; + });i && this.simulcast.setSsrcCache(i.ssrcs);var o = r.groups.filter(function (e) { + return "FID" === e.semantics; + });if (o) { + var a = new Map();o.forEach(function (e) { + var t = e.ssrcs[0], + n = e.ssrcs[1];a.set(t, n); + }), this.rtxModifier.setSsrcCache(a); + } + } + }, r.prototype.addTrackUnmute = function (e) { + if (!this._assertTrackBelongs("addTrackUnmute", e)) return !1;w.info("Adding " + e + " as unmute to " + this);var t = e.getOriginalStream();return t ? (this._addStream(t), !0) : (w.error("Unable to add " + e + " as unmute to " + this + " - no WebRTC stream"), !1); + }, r.prototype._addStream = function (e) { + this.peerconnection.addStream(e); + }, r.prototype._removeStream = function (e) { + m.a.isFirefox() ? this._handleFirefoxRemoveStream(e) : this.peerconnection.removeStream(e); + }, r.prototype._assertTrackBelongs = function (e, t) { + var n = this.localTracks.has(t.rtcId);return n || w.error(e + ": " + t + " does not belong to " + this), n; + }, r.prototype.removeTrack = function (e) { + var t = e.getOriginalStream();this.trace("removeStream", e.rtcId, t ? t.id : void 0), this._assertTrackBelongs("removeStream", e) && (this.localTracks.delete(e.rtcId), this.localSSRCs.delete(e.rtcId), t && (m.a.isFirefox() ? this._handleFirefoxRemoveStream(t) : this.peerconnection.removeStream(t))); + }, r.prototype.removeTrackMute = function (e) { + var t = e.getOriginalStream();return this.trace("removeStreamMute", e.rtcId, t ? t.id : null), !!this._assertTrackBelongs("removeStreamMute", e) && (t ? (w.info("Removing " + e + " as mute from " + this), this._removeStream(t), !0) : (w.error("removeStreamMute - no WebRTC stream for " + e), !1)); + }, r.prototype._handleFirefoxRemoveStream = function (e) { + if (e) { + var t = null, + n = null;if (e.getAudioTracks() && e.getAudioTracks().length ? n = e.getAudioTracks()[0] : e.getVideoTracks() && e.getVideoTracks().length && (n = e.getVideoTracks()[0]), !n) return void w.error("Cannot remove tracks: no tracks.");this.peerconnection.getSenders().some(function (e) { + return e.track === n && (t = e, !0); + }), t ? this.peerconnection.removeTrack(t) : w.log("Cannot remove tracks: no RTPSender."); + } + }, r.prototype.createDataChannel = function (e, t) { + return this.trace("createDataChannel", e, t), this.peerconnection.createDataChannel(e, t); + }, r.prototype._ensureSimulcastGroupIsLast = function (e) { + var t = e.sdp, + n = t.indexOf("m=video"), + r = t.indexOf("a=ssrc-group:SIM", n), + i = t.lastIndexOf("a=ssrc-group");if (-1 !== r && -1 !== i && i !== r) { + var o = t.indexOf("\r\n", r), + a = t.substring(r, o + 2);t = t.replace(a, ""), i = t.lastIndexOf("a=ssrc-group");var s = t.indexOf("\r\n", i);t = t.slice(0, s) + "\r\n" + a.trim() + t.slice(s), e.sdp = t; + } + }, r.prototype._adjustLocalMediaDirection = function (e) { + var t = new E.a(e.sdp), + n = !1, + r = t.selectMedia("audio");if (r) { + var i = this._getDesiredMediaDirection(d.a);r.direction !== i && (r.direction = i, w.info("Adjusted local audio direction to " + i), n = !0); + } else w.warn('No "audio" media found int the local description');var o = t.selectMedia("video");if (o) { + var a = this._getDesiredMediaDirection(d.b);o.direction !== a && (o.direction = a, w.info("Adjusted local video direction to " + a), n = !0); + } else w.warn('No "video" media found in the local description');n && (e.sdp = t.toRawSDP()); + }, r.prototype.setLocalDescription = function (e, t, n) { + var r = this, + i = e;this.trace("setLocalDescription::preTransform", A(i)), this._adjustLocalMediaDirection(i), this._ensureSimulcastGroupIsLast(i), m.a.usesUnifiedPlan() && (i = this.interop.toUnifiedPlan(i), this.trace("setLocalDescription::postTransform (Unified Plan)", A(i))), this.peerconnection.setLocalDescription(i, function () { + r.trace("setLocalDescriptionOnSuccess");var e = T.a.getUfrag(i.sdp);e !== r.localUfrag && (r.localUfrag = e, r.eventEmitter.emit(g.a.LOCAL_UFRAG_CHANGED, r, e)), t(); + }, function (e) { + r.trace("setLocalDescriptionOnFailure", e), r.eventEmitter.emit(g.a.SET_LOCAL_DESCRIPTION_FAILED, e, r), n(e); + }); + }, r.prototype.setAudioTransferActive = function (e) { + w.debug(this + " audio transfer active: " + e);var t = this.audioTransferActive !== e;return this.audioTransferActive = e, t; + }, r.prototype._insertUnifiedPlanSimulcastReceive = function (e) { + var t = c.a.parse(e.sdp), + n = t.media.find(function (e) { + return "video" === e.type; + });return n.rids = [{ id: "1", direction: "recv" }, { id: "2", direction: "recv" }, { id: "3", direction: "recv" }], n.simulcast_03 = { value: "recv rid=" + k.join(";") }, e.sdp = c.a.write(t), e; + }, r.prototype.setRemoteDescription = function (e, t, n) { + var r = this;if (this.trace("setRemoteDescription::preTransform", A(e)), e = this.simulcast.mungeRemoteDescription(e), this.trace("setRemoteDescription::postTransform (simulcast)", A(e)), this.options.preferH264) { + var i = c.a.parse(e.sdp), + o = i.media.find(function (e) { + return "video" === e.type; + });T.a.preferVideoCodec(o, "h264"), e.sdp = c.a.write(i); + }m.a.usesUnifiedPlan() ? (e.sdp = this.rtxModifier.stripRtx(e.sdp), this.trace("setRemoteDescription::postTransform (stripRtx)", A(e)), e = this.interop.toUnifiedPlan(e), this.trace("setRemoteDescription::postTransform (Plan A)", A(e)), this.isSimulcastOn() && (e = this._insertUnifiedPlanSimulcastReceive(e), this.trace("setRemoteDescription::postTransform (sim receive)", A(e)))) : e = I(e), this.peerconnection.setRemoteDescription(e, function () { + r.trace("setRemoteDescriptionOnSuccess");var n = T.a.getUfrag(e.sdp);n !== r.remoteUfrag && (r.remoteUfrag = n, r.eventEmitter.emit(g.a.REMOTE_UFRAG_CHANGED, r, n)), t(); + }, function (e) { + r.trace("setRemoteDescriptionOnFailure", e), r.eventEmitter.emit(g.a.SET_REMOTE_DESCRIPTION_FAILED, e, r), n(e); + }); + }, r.prototype.setVideoTransferActive = function (e) { + w.debug(this + " video transfer active: " + e);var t = this.videoTransferActive !== e;return this.videoTransferActive = e, t; + }, r.prototype.generateRecvonlySsrc = function () { + var e = T.a.generateSsrc();w.info(this + " generated new recvonly SSRC: " + e), this.sdpConsistency.setPrimarySsrc(e); + }, r.prototype.clearRecvonlySsrc = function () { + w.info("Clearing primary video SSRC!"), this.sdpConsistency.clearVideoSsrcCache(); + }, r.prototype.close = function () { + this.trace("stop"), this.signalingLayer.off(_.b, this._peerMutedChanged), this.signalingLayer.off(_.a, this._peerVideoTypeChanged);var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this.remoteTracks.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + var o = r.value, + a = !0, + s = !1, + c = void 0;try { + for (var u, l = o.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(a = (u = l.next()).done); a = !0) { + var d = u.value;this._removeRemoteTrack(d); + } + } catch (e) { + s = !0, c = e; + } finally { + try { + !a && l.return && l.return(); + } finally { + if (s) throw c; + } + } + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + }this.remoteTracks.clear(), this.rtc._removePeerConnection(this) || w.error("RTC._removePeerConnection returned false"), null !== this.statsinterval && (window.clearInterval(this.statsinterval), this.statsinterval = null), w.info("Closing " + this + "..."), this.peerconnection.close(); + };var D = function D(e, t) { + m.a.isChrome() && e && t && e.media && t.media && e.media.length === t.media.length && (t.media.forEach(function (n, r) { + T.a.findLine(e.media[r], "a=setup:actpass", e.session) && (t.media[r] = n.replace(/a=setup:active/g, "a=setup:passive")); + }), t.raw = t.session + t.media.join("")); + };r.prototype.createAnswer = function (e, t, n) { + if (m.a.supportsRtpSender() && this.isSimulcastOn()) { + var r = this.peerconnection.getSenders().find(function (e) { + return "video" === e.track.kind; + }), + i = { encodings: [{ rid: "1", scaleResolutionDownBy: 4 }, { rid: "2", scaleResolutionDownBy: 2 }, { rid: "3" }] };r.setParameters(i); + }this._createOfferOrAnswer(!1, e, t, n); + }, r.prototype.createOffer = function (e, t, n) { + this._createOfferOrAnswer(!0, e, t, n); + }, r.prototype._createOfferOrAnswer = function (e, t, n, r) { + var o = this, + a = e ? "Offer" : "Answer";this.trace("create" + a, JSON.stringify(r, null, " "));var s = function s(r) { + try { + if (o.trace("create" + a + "OnSuccess::preTransform", A(r)), m.a.usesUnifiedPlan() && (r = o.interop.toPlanB(r), o.trace("create" + a + "OnSuccess::postTransform (Plan B)", A(r)), o.isSimulcastOn() && (r = o._injectSsrcGroupForUnifiedSimulcast(r), o.trace("create" + a + "OnSuccess::postTransform(inject ssrc group)", A(r)))), m.a.isFirefox() || (o.hasAnyTracksOfType(d.b) || o.sdpConsistency.hasPrimarySsrcCached() || o.generateRecvonlySsrc(), r.sdp = o.sdpConsistency.makeVideoPrimarySsrcsConsistent(r.sdp), o.trace("create" + a + "OnSuccess::postTransform (make primary audio/video ssrcs consistent)", A(r))), o.isSimulcastOn() && (r = o.simulcast.mungeLocalDescription(r), o.trace("create" + a + "OnSuccess::postTransform (simulcast)", A(r))), !o.options.disableRtx && m.a.supportsRtx() && (r.sdp = o.rtxModifier.modifyRtxSsrcs(r.sdp), o.trace("create" + a + "OnSuccess::postTransform (rtx modifier)", A(r))), !e) { + var s = new b.a(o.remoteDescription.sdp), + c = new b.a(r.sdp);D(s, c), r.sdp = c.raw; + }var u = i(r);w.debug("Got local SSRCs MAP: ", u), o._processLocalSSRCsMap(u), t(r); + } catch (e) { + o.trace("create" + a + "OnError", e), o.trace("create" + a + "OnError", A(r)), w.error("create" + a + "OnError", e, A(r)), n(e); + } + }, + c = function c(t) { + o.trace("create" + a + "OnFailure", t);var r = e ? g.a.CREATE_OFFER_FAILED : g.a.CREATE_ANSWER_FAILED;o.eventEmitter.emit(r, t, o), n(t); + };e ? this.peerconnection.createOffer(s, c, r) : this.peerconnection.createAnswer(s, c, r); + }, r.prototype._processLocalSSRCsMap = function (e) { + var t = !0, + n = !1, + r = void 0;try { + for (var i, a = this.localTracks.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = a.next()).done); t = !0) { + var s = i.value, + c = s.getMSID();if (e.has(c)) { + var u = e.get(c);if (!u) return void w.error("No SSRC found for: " + c + " in " + this);var l = this.localSSRCs.get(s.rtcId), + d = o(u), + p = o(l);d !== p ? (null === p ? w.info("Storing new local SSRC for " + s + " in " + this, u) : w.error("Overwriting SSRC for " + s + " " + c + " in " + this + " with: ", u), this.localSSRCs.set(s.rtcId, u)) : w.debug("The local SSRC(" + d + ") for " + s + " " + c + "is still up to date in " + this); + } else w.warn("No local track matched with: " + c + " in " + this); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && a.return && a.return(); + } finally { + if (n) throw r; + } + } + }, r.prototype.addIceCandidate = function (e, t, n) { + this.trace("addIceCandidate", JSON.stringify(e, null, " ")), this.peerconnection.addIceCandidate(e, t, n); + }, r.prototype.getStats = function (e, t) { + m.a.isFirefox() || m.a.isTemasysPluginUsed() || m.a.isReactNative() ? this.peerconnection.getStats(null, e, t || function () {}) : this.peerconnection.getStats(e); + }, r.prototype.generateNewStreamSSRCInfo = function (e) { + var t = e.rtcId, + n = this._getSSRC(t);if (n && w.error("Will overwrite local SSRCs for track ID: " + t), this.isSimulcastOn()) { + n = { ssrcs: [], groups: [] };for (var r = 0; r < R; r++) { + n.ssrcs.push(T.a.generateSsrc()); + }n.groups.push({ ssrcs: n.ssrcs.slice(), semantics: "SIM" }); + } else n = { ssrcs: [T.a.generateSsrc()], groups: [] };if (!this.options.disableRtx && m.a.supportsRtx()) for (var i = n.ssrcs.length, o = 0; o < i; ++o) { + var a = n.ssrcs[o], + s = T.a.generateSsrc();n.ssrcs.push(s), n.groups.push({ ssrcs: [a, s], semantics: "FID" }); + }return n.msid = e.storedMSID, this.localSSRCs.set(t, n), n; + }, r.prototype.toString = function () { + return "TPC[" + this.id + ",p2p:" + this.isP2P + "]"; + }; + }).call(t, "modules/RTC/TraceablePeerConnection.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(151)), + c = n.n(s), + u = n(97), + l = n(99), + d = n(98), + p = n(19), + f = n.n(p), + h = n(12), + m = function () { + function e(e, t) { + var n = [], + r = !0, + i = !1, + o = void 0;try { + for (var a, s = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t); r = !0) {} + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }return n; + }return function (t, n) { + if (Array.isArray(t)) return t;if ((typeof Symbol === "function" ? Symbol.iterator : "@@iterator") in Object(t)) return e(t, n);throw new TypeError("Invalid attempt to destructure non-iterable instance"); + }; + }(), + v = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + g = n.i(a.getLogger)(e), + y = { stable: "stable", haveLocalOffer: "have-local-offer", haveRemoteOffer: "have-remote-offer", closed: "closed" }, + b = { new: "new", gathering: "gathering", complete: "complete" }, + S = "jitsi-ortc-cname-" + f.a.randomInt(1e4, 99999), + E = function (e) { + function t(e) { + r(this, t);var n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return g.debug("constructor() pcConfig:", e), n._bufferedIceCandidates = [], n._closed = !1, n._dtlsTransport = null, n._iceGatherer = null, n._iceGatheringState = b.new, n._iceTransport = null, n._localCapabilities = null, n._localDescription = null, n._localTrackInfos = new Map(), n._mids = new Map(), n._remoteDescription = null, n._remoteStreams = new Map(), n._remoteTrackInfos = new Map(), n._sdpGlobalFields = { id: h.a.generateSsrc(), version: 0 }, n._signalingState = y.stable, n._setIceGatherer(e), n._setIceTransport(n._iceGatherer), n._setDtlsTransport(n._iceTransport), n; + }return o(t, e), v(t, [{ key: "addIceCandidate", value: function value(e) { + var t = void 0, + n = void 0, + r = void 0;if (!e) throw new TypeError("candidate missing");if (0 == (arguments.length <= 1 ? 0 : arguments.length - 1)) t = !0;else { + if (t = !1, n = arguments.length <= 1 ? void 0 : arguments[1], r = arguments.length <= 2 ? void 0 : arguments[2], "function" != typeof n) throw new TypeError("callback missing");if ("function" != typeof r) throw new TypeError("errback missing"); + }if (g.debug("addIceCandidate() candidate:", e), t) return this._addIceCandidate(e);this._addIceCandidate(e).then(function () { + return n(); + }).catch(function (e) { + return r(e); + }); + } }, { key: "addStream", value: function value(e) { + g.debug("addStream()"), this._addStream(e); + } }, { key: "close", value: function value() { + if (!this._closed) { + this._closed = !0, g.debug("close()"), this._updateAndEmitSignalingStateChange(y.closed);try { + this._iceGatherer.close(); + } catch (e) { + g.warn("iceGatherer.close() failed:" + e); + }try { + this._iceTransport.stop(); + } catch (e) { + g.warn("iceTransport.stop() failed:" + e); + }try { + this._dtlsTransport.stop(); + } catch (e) { + g.warn("dtlsTransport.stop() failed:" + e); + }var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this._localTrackInfos.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + var o = r.value, + a = o.rtpSender;try { + a.stop(); + } catch (e) { + g.warn("rtpSender.stop() failed:" + e); + } + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + }this._localTrackInfos.clear();var s = !0, + c = !1, + u = void 0;try { + for (var l, d = this._remoteTrackInfos.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(s = (l = d.next()).done); s = !0) { + var p = l.value, + f = p.rtpReceiver;try { + f.stop(); + } catch (e) { + g.warn("rtpReceiver.stop() failed:" + e); + } + } + } catch (e) { + c = !0, u = e; + } finally { + try { + !s && d.return && d.return(); + } finally { + if (c) throw u; + } + }this._remoteTrackInfos.clear(), this._remoteStreams.clear(); + } + } }, { key: "createAnswer", value: function value() { + var e = void 0, + t = void 0, + n = void 0, + r = void 0;if (arguments.length <= 1) e = !0, t = arguments.length <= 0 ? void 0 : arguments[0];else { + if (e = !1, n = arguments.length <= 0 ? void 0 : arguments[0], r = arguments.length <= 1 ? void 0 : arguments[1], t = arguments.length <= 2 ? void 0 : arguments[2], "function" != typeof n) throw new TypeError("callback missing");if ("function" != typeof r) throw new TypeError("errback missing"); + }if (g.debug("createAnswer() options:", t), e) return this._createAnswer(t);this._createAnswer(t).then(function (e) { + return n(e); + }).catch(function (e) { + return r(e); + }); + } }, { key: "createDataChannel", value: function value() { + throw g.debug("createDataChannel()"), new Error("createDataChannel() not supported in Edge"); + } }, { key: "createOffer", value: function value() { + var e = void 0, + t = void 0, + n = void 0, + r = void 0;if (arguments.length <= 1) e = !0, t = arguments.length <= 0 ? void 0 : arguments[0];else { + if (e = !1, n = arguments.length <= 0 ? void 0 : arguments[0], r = arguments.length <= 1 ? void 0 : arguments[1], t = arguments.length <= 2 ? void 0 : arguments[2], "function" != typeof n) throw new TypeError("callback missing");if ("function" != typeof r) throw new TypeError("errback missing"); + }if (g.debug("createOffer() options:", t), e) return this._createOffer(t);this._createOffer(t).then(function (e) { + return n(e); + }).catch(function (e) { + return r(e); + }); + } }, { key: "getLocalStreams", value: function value() { + return Array.from(this._localTrackInfos.values()).map(function (e) { + return e.stream; + }).filter(function (e, t, n) { + return n.indexOf(e) === t; + }); + } }, { key: "getRemoteStreams", value: function value() { + return Array.from(this._remoteStreams.values()); + } }, { key: "getStats", value: function value() { + var e = void 0, + t = void 0, + n = void 0, + r = void 0;if ("function" == typeof (arguments.length <= 0 ? void 0 : arguments[0]) ? (e = !1, n = arguments.length <= 0 ? void 0 : arguments[0], r = arguments.length <= 1 ? void 0 : arguments[1]) : "function" == typeof (arguments.length <= 1 ? void 0 : arguments[1]) ? (e = !1, t = arguments.length <= 0 ? void 0 : arguments[0], n = arguments.length <= 1 ? void 0 : arguments[1], r = arguments.length <= 2 ? void 0 : arguments[2]) : (e = !0, t = arguments.length <= 0 ? void 0 : arguments[0]), e || r || (r = function r(e) { + g.error("getStats() failed: " + e), g.error(e.stack); + }), e) return this._getStats(t);this._getStats(t).then(function (e) { + return n(e); + }).catch(function (e) { + return r(e); + }); + } }, { key: "removeStream", value: function value(e) { + g.debug("removeStream()"), this._removeStream(e); + } }, { key: "setLocalDescription", value: function value(e) { + var t = void 0, + n = void 0, + r = void 0;if (!e) throw new TypeError("description missing");if (0 == (arguments.length <= 1 ? 0 : arguments.length - 1)) t = !0;else { + if (t = !1, n = arguments.length <= 1 ? void 0 : arguments[1], r = arguments.length <= 2 ? void 0 : arguments[2], "function" != typeof n) throw new TypeError("callback missing");if ("function" != typeof r) throw new TypeError("errback missing"); + }if (g.debug("setLocalDescription() desc:", e), t) return this._setLocalDescription(e);this._setLocalDescription(e).then(function () { + return n(); + }).catch(function (e) { + return r(e); + }); + } }, { key: "setRemoteDescription", value: function value(e) { + var t = void 0, + n = void 0, + r = void 0;if (!e) throw new TypeError("description missing");if (0 == (arguments.length <= 1 ? 0 : arguments.length - 1)) t = !0;else { + if (t = !1, n = arguments.length <= 1 ? void 0 : arguments[1], r = arguments.length <= 2 ? void 0 : arguments[2], "function" != typeof n) throw new TypeError("callback missing");if ("function" != typeof r) throw new TypeError("errback missing"); + }if (g.debug("setRemoteDescription() desc:", e), t) return this._setRemoteDescription(e);this._setRemoteDescription(e).then(function () { + return n(); + }).catch(function (e) { + return r(e); + }); + } }, { key: "_addIceCandidate", value: function value(e) { + return this._closed ? Promise.reject(new d.a("RTCPeerConnection closed")) : Promise.reject(new Error("addIceCandidate() not supported")); + } }, { key: "_addStream", value: function value(e) { + if (this._closed) throw new d.a("RTCPeerConnection closed");var t = !0, + n = !1, + r = void 0;try { + for (var i, o = e.getTracks()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + var a = i.value;if ("ended" !== a.readyState) { + if (this._localTrackInfos.has(a.id)) g.warn("ignoring already handled MediaStreamTrack");else { + var s = new RTCRtpSender(a, this._dtlsTransport);this._localTrackInfos.set(a.id, { rtpSender: s, stream: e }); + } + } else g.warn("ignoring ended MediaStreamTrack"); + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + }var c = !0, + u = !1, + l = void 0;try { + for (var p, f = this._localTrackInfos[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (p = f.next()).done); c = !0) { + var h = m(p.value, 2), + v = h[0], + y = h[1], + b = y.rtpSender.track;if ("ended" === b.readyState) { + g.warn("_addStream() an already handled track was stopped, track.id:" + b.id);try { + y.rtpSender.stop(); + } catch (e) { + g.warn("rtpSender.stop() failed:" + e); + }this._localTrackInfos.delete(b.id); + } else if (y.stream === e && !e.getTrackById(v)) { + g.warn("_addStream() a track in this stream was removed, track.id:" + v);try { + y.rtpSender.stop(); + } catch (e) { + g.warn("rtpSender.stop() failed:" + e); + }this._localTrackInfos.delete(b.id); + } + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && f.return && f.return(); + } finally { + if (u) throw l; + } + }this._emitNegotiationNeeded(); + } }, { key: "_createAnswer", value: function value(e) { + if (this._closed) return Promise.reject(new d.a("RTCPeerConnection closed"));if (this.signalingState !== y.haveRemoteOffer) return Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"'));var t = this._createLocalDescription("answer");return Promise.resolve(t); + } }, { key: "_createLocalDescription", value: function value(e) { + function t(t, o) { + var u = {};switch (u.type = o, o) {case "audio":case "video": + u.protocol = "RTP/SAVPF", u.port = 9, u.direction = "sendrecv";break;case "application": + u.protocol = "DTLS/SCTP", u.port = 0, u.payloads = "0", u.direction = "inactive";}u.connection = { ip: "127.0.0.1", version: 4 }, u.mid = t, u.iceUfrag = r.usernameFragment, u.icePwd = r.password, u.candidates = [];var d = !0, + p = !1, + f = void 0;try { + for (var m, v = i[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (m = v.next()).done); d = !0) { + var g = m.value, + y = {};y.component = 1, y.foundation = g.foundation, y.ip = g.ip, y.port = g.port, y.priority = g.priority, y.transport = g.protocol.toLowerCase(), y.type = g.type, "tcp" === y.transport && (y.tcptype = g.tcpType), u.candidates.push(y); + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && v.return && v.return(); + } finally { + if (p) throw f; + } + }if (u.endOfCandidates = "end-of-candidates", u.setup = "offer" === e ? "actpass" : "server" === a.role ? "active" : "passive", "audio" === o || "video" === o) { + u.rtp = [], u.rtcpFb = [], u.fmtp = [];var b = [], + E = !0, + T = !1, + _ = void 0;try { + for (var C, w = s.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(E = (C = w.next()).done); E = !0) { + var R = C.value;if (!R.kind || R.kind === o) { + b.push(R.preferredPayloadType);var k = { codec: R.name, payload: R.preferredPayloadType, rate: R.clockRate };if (R.numChannels > 1 && (k.encoding = R.numChannels), u.rtp.push(k), R.parameters) { + var A = { config: "", payload: R.preferredPayloadType }, + I = !0, + P = !1, + O = void 0;try { + for (var D, L = Object.keys(R.parameters)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(I = (D = L.next()).done); I = !0) { + var N = D.value;A.config && (A.config += ";"), A.config += N + "=" + R.parameters[N]; + } + } catch (e) { + P = !0, O = e; + } finally { + try { + !I && L.return && L.return(); + } finally { + if (P) throw O; + } + }A.config && u.fmtp.push(A); + }var M = !0, + x = !1, + j = void 0;try { + for (var F, U = (R.rtcpFeedback || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(M = (F = U.next()).done); M = !0) { + var B = F.value;u.rtcpFb.push({ payload: R.preferredPayloadType, subtype: B.parameter || void 0, type: B.type }); + } + } catch (e) { + x = !0, j = e; + } finally { + try { + !M && U.return && U.return(); + } finally { + if (x) throw j; + } + } + } + } + } catch (e) { + T = !0, _ = e; + } finally { + try { + !E && w.return && w.return(); + } finally { + if (T) throw _; + } + }0 === b.length ? (u.payloads = "9", u.port = 0, u.direction = "inactive") : u.payloads = b.join(" "), u.ssrcs = [], u.ssrcGroups = [];var J = !0, + G = !1, + H = void 0;try { + for (var V, W = c.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(J = (V = W.next()).done); J = !0) { + var K = V.value, + q = K.rtpSender, + z = K.stream.id, + $ = q.track;if ("ended" !== $.readyState && $.kind === o) { + K.ssrc || (K.ssrc = h.a.generateSsrc());var X = l && "video" === $.kind;X && !K.rtxSsrc && (K.rtxSsrc = K.ssrc + 1), u.ssrcs.push({ attribute: "cname", id: K.ssrc, value: S }), u.ssrcs.push({ attribute: "msid", id: K.ssrc, value: z + " " + $.id }), u.ssrcs.push({ attribute: "mslabel", id: K.ssrc, value: z }), u.ssrcs.push({ attribute: "label", id: K.ssrc, value: $.id }), X && (u.ssrcs.push({ attribute: "cname", id: K.rtxSsrc, value: S }), u.ssrcs.push({ attribute: "msid", id: K.rtxSsrc, value: z + " " + $.id }), u.ssrcs.push({ attribute: "mslabel", id: K.rtxSsrc, value: z }), u.ssrcs.push({ attribute: "label", id: K.rtxSsrc, value: $.id }), u.ssrcGroups.push({ semantics: "FID", ssrcs: K.ssrc + " " + K.rtxSsrc })); + } + } + } catch (e) { + G = !0, H = e; + } finally { + try { + !J && W.return && W.return(); + } finally { + if (G) throw H; + } + }u.ext = [];var Q = !0, + Y = !1, + Z = void 0;try { + for (var ee, te = s.headerExtensions[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(Q = (ee = te.next()).done); Q = !0) { + var ne = ee.value;ne.kind && ne.kind !== o || u.ext.push({ value: ne.preferredId, uri: ne.uri }); + } + } catch (e) { + Y = !0, Z = e; + } finally { + try { + !Q && te.return && te.return(); + } finally { + if (Y) throw Z; + } + }u.rtcpMux = "rtcp-mux", u.rtcpRsize = "rtcp-rsize"; + }n.media.push(u); + }var n = {}, + r = this._iceGatherer.getLocalParameters(), + i = this._iceGatherer.getLocalCandidates(), + o = this._dtlsTransport.getLocalParameters(), + a = this._dtlsTransport.getRemoteParameters(), + s = this._localCapabilities, + c = this._localTrackInfos;"offer" === e && this._sdpGlobalFields.version++, n.version = 0, n.origin = { address: "127.0.0.1", ipVer: 4, netType: "IN", sessionId: this._sdpGlobalFields.id, sessionVersion: this._sdpGlobalFields.version, username: "jitsi-ortc-webrtc-shim" }, n.name = "-", n.timing = { start: 0, stop: 0 }, n.msidSemantic = { semantic: "WMS", token: "*" }, n.groups = [{ mids: Array.from(this._mids.keys()).join(" "), type: "BUNDLE" }], n.media = [], n.fingerprint = { hash: o.fingerprints[0].value, type: o.fingerprints[0].algorithm };var l = !1, + d = !0, + p = !1, + f = void 0;try { + for (var v, y = s.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (v = y.next()).done); d = !0) { + var b = v.value;if ("video" === b.kind && "rtx" === b.name) { + l = !0;break; + } + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && y.return && y.return(); + } finally { + if (p) throw f; + } + }var E = !0, + T = !1, + _ = void 0;try { + for (var C, w = this._mids[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(E = (C = w.next()).done); E = !0) { + var R = m(C.value, 2), + k = R[0], + A = R[1];t.call(this, k, A); + } + } catch (e) { + T = !0, _ = e; + } finally { + try { + !E && w.return && w.return(); + } finally { + if (T) throw _; + } + }var I = new u.a({ type: e, _sdpObject: n });return g.debug("_createLocalDescription():", I), I; + } }, { key: "_createOffer", value: function value(e) { + return this._closed ? Promise.reject(new d.a("RTCPeerConnection closed")) : this.signalingState !== y.stable ? Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"')) : Promise.reject(new Error("createoOffer() not yet supported")); + } }, { key: "_emitAddStream", value: function value(e) { + if (!this._closed) { + g.debug('emitting "addstream"');var t = new c.a.Event("addstream");t.stream = e, this.dispatchEvent(t); + } + } }, { key: "_emitBufferedIceCandidates", value: function value() { + if (!this._closed) { + var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this._bufferedIceCandidates[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + var o = r.value;if (o) { + o.sdpMIndex = this._mids.keys().next().value, g.debug('emitting buffered "icecandidate", candidate:', o);var a = new c.a.Event("icecandidate");a.candidate = o, this.dispatchEvent(a); + } + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + }this._bufferedIceCandidates = []; + } + } }, { key: "_emitConnectionStateChange", value: function value() { + if (!this._closed || "closed" === this.connectionState) { + g.debug('emitting "connectionstatechange", connectionState:', this.connectionState);var e = new c.a.Event("connectionstatechange");this.dispatchEvent(e); + } + } }, { key: "_emitIceCandidate", value: function value(e) { + if (!this._closed) { + var t = null;if (e) { + var n = this._mids.keys().next().value, + r = "candidate:" + e.foundation + " 1 " + e.protocol + " " + e.priority + " " + e.ip + " " + e.port + " typ " + e.type;e.relatedAddress && (r += " raddr " + e.relatedAddress), e.relatedPort && (r += " rport " + e.relatedPort), "tcp" === e.protocol && (r += " tcptype " + e.tcpType), t = { candidate: r, component: 1, foundation: e.foundation, ip: e.ip, port: e.port, priority: e.priority, protocol: e.protocol, type: e.type, sdpMIndex: n, sdpMLineIndex: 0 }, "tcp" === e.protocol && (t.tcptype = e.tcpType), e.relatedAddress && (t.relatedAddress = e.relatedAddress), e.relatedPort && (t.relatedPort = e.relatedPort); + }if (this._localDescription) { + g.debug('emitting "icecandidate", candidate:', t);var i = new c.a.Event("icecandidate");i.candidate = t, this.dispatchEvent(i); + } else g.debug("buffering gathered ICE candidate:", t), this._bufferedIceCandidates.push(t); + } + } }, { key: "_emitIceConnectionStateChange", value: function value() { + if (!this._closed || "closed" === this.iceConnectionState) { + g.debug('emitting "iceconnectionstatechange", iceConnectionState:', this.iceConnectionState);var e = new c.a.Event("iceconnectionstatechange");this.dispatchEvent(e); + } + } }, { key: "_emitNegotiationNeeded", value: function value() { + if (this.signalingState === y.stable) { + g.debug('emitting "negotiationneeded"');var e = new c.a.Event("negotiationneeded");this.dispatchEvent(e); + } + } }, { key: "_emitRemoveStream", value: function value(e) { + if (!this._closed) { + g.debug('emitting "removestream"');var t = new c.a.Event("removestream");t.stream = e, this.dispatchEvent(t); + } + } }, { key: "_getParametersForRtpReceiver", value: function value(e, t) { + var n = t.ssrc, + r = t.rtxSsrc, + i = t.cname, + o = this._localCapabilities, + a = { codecs: [], degradationPreference: "balanced", encodings: [], headerExtensions: [], muxId: "", rtcp: { cname: i, compound: !0, mux: !0, reducedSize: !0 } }, + s = [], + c = void 0, + u = !0, + l = !1, + d = void 0;try { + for (var p, f = o.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(u = (p = f.next()).done); u = !0) { + var h = p.value;if (h.kind === e && "rtx" !== h.name) { + c = h.preferredPayloadType, s.push({ clockRate: h.clockRate, maxptime: h.maxptime, mimeType: h.mimeType, name: h.name, numChannels: h.numChannels, parameters: h.parameters, payloadType: h.preferredPayloadType, ptime: h.ptime, rtcpFeedback: h.rtcpFeedback });break; + } + } + } catch (e) { + l = !0, d = e; + } finally { + try { + !u && f.return && f.return(); + } finally { + if (l) throw d; + } + }if (r) { + var m = !0, + v = !1, + g = void 0;try { + for (var y, b = o.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(m = (y = b.next()).done); m = !0) { + var S = y.value;if (S.kind === e && "rtx" === S.name) { + s.push({ clockRate: S.clockRate, mimeType: S.mimeType, name: "rtx", parameters: S.parameters, payloadType: S.preferredPayloadType, rtcpFeedback: S.rtcpFeedback });break; + } + } + } catch (e) { + v = !0, g = e; + } finally { + try { + !m && b.return && b.return(); + } finally { + if (v) throw g; + } + } + }a.codecs = s;var E = { active: !0, codecPayloadType: c, ssrc: n };r && (E.rtx = { ssrc: r }), a.encodings.push(E);var T = !0, + _ = !1, + C = void 0;try { + for (var w, R = o.headerExtensions[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(T = (w = R.next()).done); T = !0) { + var k = w.value;k.kind === e && a.headerExtensions.push({ encrypt: k.preferredEncrypt, id: k.preferredId, uri: k.uri }); + } + } catch (e) { + _ = !0, C = e; + } finally { + try { + !T && R.return && R.return(); + } finally { + if (_) throw C; + } + }return a; + } }, { key: "_getParametersForRtpSender", value: function value(e, t) { + var n = t.ssrc, + r = t.rtxSsrc, + i = S, + o = this._localCapabilities, + a = { codecs: [], degradationPreference: "balanced", encodings: [], headerExtensions: [], muxId: "", rtcp: { cname: i, compound: !0, mux: !0, reducedSize: !0 } }, + s = [], + c = void 0, + u = !0, + l = !1, + d = void 0;try { + for (var p, f = o.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(u = (p = f.next()).done); u = !0) { + var h = p.value;if (h.kind === e && "rtx" !== h.name) { + c = h.preferredPayloadType, s.push({ clockRate: h.clockRate, maxptime: h.maxptime, mimeType: h.mimeType, name: h.name, numChannels: h.numChannels, parameters: h.parameters, payloadType: h.preferredPayloadType, ptime: h.ptime, rtcpFeedback: h.rtcpFeedback });break; + } + } + } catch (e) { + l = !0, d = e; + } finally { + try { + !u && f.return && f.return(); + } finally { + if (l) throw d; + } + }if (r) { + var m = !0, + v = !1, + g = void 0;try { + for (var y, b = o.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(m = (y = b.next()).done); m = !0) { + var E = y.value;if (E.kind === e && "rtx" === E.name) { + s.push({ clockRate: E.clockRate, mimeType: E.mimeType, name: "rtx", parameters: E.parameters, payloadType: E.preferredPayloadType, rtcpFeedback: E.rtcpFeedback });break; + } + } + } catch (e) { + v = !0, g = e; + } finally { + try { + !m && b.return && b.return(); + } finally { + if (v) throw g; + } + } + }a.codecs = s;var T = { active: !0, codecPayloadType: c, ssrc: n };r && (T.rtx = { ssrc: r }), a.encodings.push(T);var _ = !0, + C = !1, + w = void 0;try { + for (var R, k = o.headerExtensions[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(_ = (R = k.next()).done); _ = !0) { + var A = R.value;A.kind === e && a.headerExtensions.push({ encrypt: A.preferredEncrypt, id: A.preferredId, uri: A.uri }); + } + } catch (e) { + C = !0, w = e; + } finally { + try { + !_ && k.return && k.return(); + } finally { + if (C) throw w; + } + }return a; + } }, { key: "_getStats", value: function value(e) { + if (this._closed) return Promise.reject(new d.a("RTCPeerConnection closed"));var t = this._iceGatherer, + n = this._iceTransport, + r = [], + i = [], + o = [], + a = !0, + s = !1, + c = void 0;try { + for (var u, l = this._localTrackInfos.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(a = (u = l.next()).done); a = !0) { + var p = u.value, + f = p.rtpSender;p.sending && r.push(f); + } + } catch (e) { + s = !0, c = e; + } finally { + try { + !a && l.return && l.return(); + } finally { + if (s) throw c; + } + }var h = !0, + m = !1, + v = void 0;try { + for (var g, y = this._remoteTrackInfos.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(h = (g = y.next()).done); h = !0) { + var b = g.value, + S = b.rtpReceiver;i.push(S); + } + } catch (e) { + m = !0, v = e; + } finally { + try { + !h && y.return && y.return(); + } finally { + if (m) throw v; + } + }t && o.push(t.getStats().catch(function () { + return null; + })), n && (o.push(n.getStats().catch(function () { + return null; + })), "function" == typeof n.msGetStats && o.push(n.msGetStats().catch(function () { + return null; + })));var E = !0, + T = !1, + _ = void 0;try { + for (var C, w = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(E = (C = w.next()).done); E = !0) { + !function () { + var e = C.value, + t = "audio" === e.track.kind;o.push(e.getStats().then(function (e) { + if (!t) { + var n = !0, + r = !1, + i = void 0;try { + for (var o, a = Object.keys(e)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = e[s];"track" === c.type && delete c.audioLevel; + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + } + }return e; + }).catch(function () { + return null; + })); + }(); + } + } catch (e) { + T = !0, _ = e; + } finally { + try { + !E && w.return && w.return(); + } finally { + if (T) throw _; + } + }var R = !0, + k = !1, + A = void 0;try { + for (var I, P = i[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(R = (I = P.next()).done); R = !0) { + !function () { + var e = I.value, + t = "audio" === e.track.kind;o.push(e.getStats().then(function (e) { + if (!t) { + var n = !0, + r = !1, + i = void 0;try { + for (var o, a = Object.keys(e)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = e[s];"track" === c.type && delete c.audioLevel; + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + } + }return e; + }).catch(function () { + return null; + })); + }(); + } + } catch (e) { + k = !0, A = e; + } finally { + try { + !R && P.return && P.return(); + } finally { + if (k) throw A; + } + }return Promise.all(o).then(function (e) { + var t = {}, + n = !0, + r = !1, + i = void 0;try { + for (var o, a = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value;if (s) { + var c = !0, + u = !1, + l = void 0;try { + for (var d, p = Object.keys(s)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (d = p.next()).done); c = !0) { + var f = d.value;t[f] = s[f]; + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && p.return && p.return(); + } finally { + if (u) throw l; + } + } + } + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + }return t; + }); + } }, { key: "_handleLocalInitialAnswer", value: function value(e) { + g.debug("_handleLocalInitialAnswer(), desc:", e);var t = e.sdpObject;this._localCapabilities = l.a(t), g.debug("local capabilities:", this._localCapabilities); + } }, { key: "_handleLocalReAnswer", value: function value(e) { + g.debug("_handleLocalReAnswer(), desc:", e);var t = e.sdpObject;this._localCapabilities = l.a(t), g.debug("local capabilities:", this._localCapabilities); + } }, { key: "_handleRemoteInitialOffer", value: function value(e) { + g.debug("_handleRemoteInitialOffer(), desc:", e);var t = e.sdpObject;this._mids = l.b(t);var n = l.a(t);g.debug("remote capabilities:", n), this._localCapabilities = l.c(n), this._startIceAndDtls(e); + } }, { key: "_handleRemoteReOffer", value: function value(e) { + g.debug("_handleRemoteReOffer(), desc:", e);var t = e.sdpObject;this._mids = l.b(t);var n = l.a(t);g.debug("remote capabilities:", n), this._localCapabilities = l.c(n); + } }, { key: "_receiveMedia", value: function value() { + g.debug("_receiveMedia()");var e = new Set(this._remoteTrackInfos.keys()), + t = l.d(this._remoteDescription.sdpObject), + n = new Map(), + r = new Map(), + i = new Map();g.debug("_receiveMedia() remote track infos:", t);var o = !0, + a = !1, + s = void 0;try { + for (var c, u = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(o = (c = u.next()).done); o = !0) { + var d = m(c.value, 2), + p = d[0], + f = d[1];if (!e.has(p)) { + g.debug("_receiveMedia() new remote track, ssrc:" + p), this._remoteTrackInfos.set(p, f);var h = f.kind, + v = f.rtxSsrc, + y = f.streamId, + b = f.trackId, + S = f.cname, + E = !this._remoteStreams.has(y), + T = void 0;E ? (g.debug("_receiveMedia() new remote stream, id:" + y), T = new MediaStream(), T.jitsiRemoteId = y, n.set(y, T), this._remoteStreams.set(y, T)) : T = this._remoteStreams.get(y);var _ = new RTCRtpReceiver(this._dtlsTransport, h), + C = this._getParametersForRtpReceiver(h, { ssrc: p, rtxSsrc: v, cname: S });f.track = _.track, _.onerror = function (e) { + g.error('rtpReceiver "error" event, event:'), g.error(e); + }, f.stream = T, f.rtpReceiver = _, g.debug("calling rtpReceiver.receive(), parameters:", C);try { + _.receive(C);var w = f.track;w.jitsiRemoteId = b, T.addTrack(w), n.has(y) || r.set(w, T); + } catch (e) { + g.error("rtpReceiver.receive() failed:" + e.message), g.error(e); + } + } + } + } catch (e) { + a = !0, s = e; + } finally { + try { + !o && u.return && u.return(); + } finally { + if (a) throw s; + } + }var R = !0, + k = !1, + A = void 0;try { + for (var I, P = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(R = (I = P.next()).done); R = !0) { + var p = I.value;if (!t.has(p)) { + g.debug("_receiveMedia() remote track removed, ssrc:" + p);var f = this._remoteTrackInfos.get(p), + O = f.stream, + D = f.track, + L = f.rtpReceiver;try { + L.stop(); + } catch (e) { + g.warn("rtpReceiver.stop() failed:" + e); + }i.set(D, O), O.removeTrack(D), this._remoteTrackInfos.delete(p); + } + } + } catch (e) { + k = !0, A = e; + } finally { + try { + !R && P.return && P.return(); + } finally { + if (k) throw A; + } + }var N = !0, + M = !1, + x = void 0;try { + for (var j, F = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(N = (j = F.next()).done); N = !0) { + var U = m(j.value, 2), + B = U[0], + J = U[1], + G = new Event("addtrack");G.track = B, J.dispatchEvent(G); + } + } catch (e) { + M = !0, x = e; + } finally { + try { + !N && F.return && F.return(); + } finally { + if (M) throw x; + } + }var H = !0, + V = !1, + W = void 0;try { + for (var K, q = i[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(H = (K = q.next()).done); H = !0) { + var z = m(K.value, 2), + $ = z[0], + X = z[1], + Q = new Event("removetrack");Q.track = $, X.dispatchEvent(Q); + } + } catch (e) { + V = !0, W = e; + } finally { + try { + !H && q.return && q.return(); + } finally { + if (V) throw W; + } + }var Y = !0, + Z = !1, + ee = void 0;try { + for (var te, ne = n.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(Y = (te = ne.next()).done); Y = !0) { + var re = te.value;0 === re.getTracks().length ? (g.warn("ignoring new stream for which no track could be added"), n.delete(re.jitsiRemoteId), this._remoteStreams.delete(re.jitsiRemoteId)) : this._emitAddStream(re); + } + } catch (e) { + Z = !0, ee = e; + } finally { + try { + !Y && ne.return && ne.return(); + } finally { + if (Z) throw ee; + } + }var ie = !0, + oe = !1, + ae = void 0;try { + for (var se, ce = this._remoteStreams[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(ie = (se = ce.next()).done); ie = !0) { + var ue = m(se.value, 2), + le = ue[0], + de = ue[1];de.getTracks().length > 0 || (this._remoteStreams.delete(le), this._emitRemoveStream(de)); + } + } catch (e) { + oe = !0, ae = e; + } finally { + try { + !ie && ce.return && ce.return(); + } finally { + if (oe) throw ae; + } + } + } }, { key: "_removeStream", value: function value(e) { + if (this._closed) throw new d.a("RTCPeerConnection closed");var t = !0, + n = !1, + r = void 0;try { + for (var i, o = e.getTracks()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(t = (i = o.next()).done); t = !0) { + var a = i.value;if (this._localTrackInfos.has(a.id)) { + var s = this._localTrackInfos.get(a.id).rtpSender;try { + s.stop(); + } catch (e) { + g.warn("rtpSender.stop() failed:" + e); + }this._localTrackInfos.delete(a.id); + } + } + } catch (e) { + n = !0, r = e; + } finally { + try { + !t && o.return && o.return(); + } finally { + if (n) throw r; + } + }this._emitNegotiationNeeded(); + } }, { key: "_sendMedia", value: function value() { + g.debug("_sendMedia()");var e = !0, + t = !1, + n = void 0;try { + for (var r, i = this._localTrackInfos.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(e = (r = i.next()).done); e = !0) { + var o = r.value;if (!o.sending) { + var a = o.rtpSender, + s = o.ssrc, + c = o.rtxSsrc, + u = a.track, + l = u.kind, + d = this._getParametersForRtpSender(l, { ssrc: s, rtxSsrc: c });g.debug("calling rtpSender.send(), parameters:", d);try { + a.send(d), o.sending = !0; + } catch (e) { + g.error("rtpSender.send() failed:" + e.message), g.error(e); + } + } + } + } catch (e) { + t = !0, n = e; + } finally { + try { + !e && i.return && i.return(); + } finally { + if (t) throw n; + } + } + } }, { key: "_setDtlsTransport", value: function value(e) { + var t = this, + n = new RTCDtlsTransport(e);n.onstatechange = function () { + g.debug('dtlsTransport "statechange" event, state:' + n.state), t._emitConnectionStateChange(); + }, n.ondtlsstatechange = function () { + g.debug('dtlsTransport "dtlsstatechange" event, state:' + n.state), t._emitConnectionStateChange(); + }, n.onerror = function (e) { + var n = void 0;e.message ? n = e.message : e.error && (n = e.error.message), g.error('dtlsTransport "error" event, message:' + n), t._emitConnectionStateChange(); + }, this._dtlsTransport = n; + } }, { key: "_setIceGatherer", value: function value(e) { + var t = this, + n = { gatherPolicy: e.iceTransportPolicy || "all", iceServers: e.iceServers || [] }, + r = new RTCIceGatherer(n);r.onstatechange = function () { + g.debug('iceGatherer "statechange" event, state:' + r.state), t._updateAndEmitIceGatheringStateChange(r.state); + }, r.onlocalcandidate = function (e) { + var n = e.candidate, + r = e.complete;g.debug('iceGatherer "localcandidate" event, candidate:', n), r || !n || 0 === Object.keys(n).length ? (n = null, t._updateAndEmitIceGatheringStateChange(b.complete), t._emitIceCandidate(null)) : t._emitIceCandidate(n); + }, r.onerror = function (e) { + var t = e.errorCode, + n = e.errorText;g.error('iceGatherer "error" event, errorCode:' + t + ", errorText:" + n); + };try { + r.gather(); + } catch (e) { + g.warn("iceGatherer.gather() failed:" + e); + }this._iceGatherer = r; + } }, { key: "_setIceTransport", value: function value(e) { + var t = this, + n = new RTCIceTransport(e);n.onstatechange = function () { + g.debug('iceTransport "statechange" event, state:' + n.state), t._emitIceConnectionStateChange(); + }, n.onicestatechange = function () { + g.debug('iceTransport "icestatechange" event, state:' + n.state), "completed" === n.state && g.debug("nominated candidate pair:", n.getNominatedCandidatePair()), t._emitIceConnectionStateChange(); + }, n.oncandidatepairchange = function (e) { + g.debug('iceTransport "candidatepairchange" event, pair:' + e.pair); + }, this._iceTransport = n; + } }, { key: "_setLocalDescription", value: function value(e) { + var t = this;if (this._closed) return Promise.reject(new d.a("RTCPeerConnection closed"));var n = void 0;try { + n = new u.a(e); + } catch (e) { + return Promise.reject(new TypeError("invalid RTCSessionDescriptionInit: " + e)); + }switch (e.type) {case "offer": + return this.signalingState !== y.stable ? Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"')) : Promise.reject(new TypeError('setLocalDescription() with type "offer" not supported'));case "answer": + if (this.signalingState !== y.haveRemoteOffer) return Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"'));var r = Boolean(!this._localDescription);return Promise.resolve().then(function () { + return r ? t._handleLocalInitialAnswer(n) : t._handleLocalReAnswer(n); + }).then(function () { + g.debug("setLocalDescription() succeed"), t._localDescription = n, t._updateAndEmitSignalingStateChange(y.stable), r && t._emitBufferedIceCandidates(), t._sendMedia(), t._receiveMedia(); + }).catch(function (e) { + throw g.error("setLocalDescription() failed: " + e.message), g.error(e), e; + });default: + return Promise.reject(new TypeError('unsupported description.type "' + e.type + '"'));} + } }, { key: "_setRemoteDescription", value: function value(e) { + var t = this;if (this._closed) return Promise.reject(new d.a("RTCPeerConnection closed"));var n = void 0;try { + n = new u.a(e); + } catch (e) { + return Promise.reject(new TypeError("invalid RTCSessionDescriptionInit: " + e)); + }switch (e.type) {case "offer": + if (this.signalingState !== y.stable) return Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"'));var r = Boolean(!this._remoteDescription);return Promise.resolve().then(function () { + return r ? t._handleRemoteInitialOffer(n) : t._handleRemoteReOffer(n); + }).then(function () { + g.debug("setRemoteDescription() succeed"), t._remoteDescription = n, t._updateAndEmitSignalingStateChange(y.haveRemoteOffer); + }).catch(function (e) { + throw g.error("setRemoteDescription() failed: " + e), e; + });case "answer": + return this.signalingState !== y.haveLocalOffer ? Promise.reject(new d.a('invalid signalingState "' + this.signalingState + '"')) : Promise.reject(new TypeError('setRemoteDescription() with type "answer" not supported'));default: + return Promise.reject(new TypeError('unsupported description.type "' + e.type + '"'));} + } }, { key: "_startIceAndDtls", value: function value(e) { + var t = e.sdpObject, + n = l.e(t), + r = l.f(t), + i = l.g(t);switch (e.type) {case "offer": + this._iceTransport.start(this._iceGatherer, n, "controlled");break;case "answer": + this._iceTransport.start(this._iceGatherer, n, "controlling");}var o = !0, + a = !1, + s = void 0;try { + for (var c, u = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(o = (c = u.next()).done); o = !0) { + var d = c.value;0 !== d.port && 9 !== d.port && this._iceTransport.addRemoteCandidate(d); + } + } catch (e) { + a = !0, s = e; + } finally { + try { + !o && u.return && u.return(); + } finally { + if (a) throw s; + } + }switch (this._iceTransport.addRemoteCandidate({}), e.type) {case "offer": + i.role = "server";break;case "answer": + i.role = "client";}this._dtlsTransport.start(i); + } }, { key: "_updateAndEmitIceGatheringStateChange", value: function value(e) { + if (!this._closed && e !== this.iceGatheringState) { + this._iceGatheringState = e, g.debug('emitting "icegatheringstatechange", iceGatheringState:', this.iceGatheringState);var t = new c.a.Event("icegatheringstatechange");this.dispatchEvent(t); + } + } }, { key: "_updateAndEmitSignalingStateChange", value: function value(e) { + if (e !== this.signalingState) { + this._signalingState = e, g.debug('emitting "signalingstatechange", signalingState:', this.signalingState);var t = new c.a.Event("signalingstatechange");this.dispatchEvent(t); + } + } }, { key: "connectionState", get: function get() { + return this._dtlsTransport.state; + } }, { key: "iceConnectionState", get: function get() { + return this._iceTransport.state; + } }, { key: "iceGatheringState", get: function get() { + return this._iceGatheringState; + } }, { key: "localDescription", get: function get() { + return this._localDescription; + } }, { key: "remoteDescription", get: function get() { + return this._remoteDescription; + } }, { key: "signalingState", get: function get() { + return this._signalingState; + } }]), t; + }(c.a.EventTarget);t.a = E; + }).call(t, "modules/RTC/ortc/RTCPeerConnection.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(13), + o = n.n(i), + a = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = function () { + function e(t) { + switch (r(this, e), this._sdp = null, this._sdpObject = null, this._type = null, t.type) {case "offer":case "answer": + break;default: + throw new TypeError('invalid type "' + t.type + '"');}if (this._type = t.type, "string" == typeof t.sdp) { + this._sdp = t.sdp;try { + this._sdpObject = o.a.parse(t.sdp); + } catch (e) { + throw new Error("invalid sdp: " + e); + } + } else { + if ("object" !== a(t._sdpObject)) throw new TypeError("invalid sdp or _sdpObject");this._sdpObject = t._sdpObject;try { + this._sdp = o.a.write(t._sdpObject); + } catch (e) { + throw new Error("invalid sdp object: " + e); + } + } + }return s(e, [{ key: "toJSON", value: function value() { + return { sdp: this._sdp, type: this._type }; + } }, { key: "sdp", get: function get() { + return this._sdp; + }, set: function set(e) { + try { + this._sdpObject = o.a.parse(e); + } catch (e) { + throw new Error("invalid sdp: " + e); + }this._sdp = e; + } }, { key: "sdpObject", get: function get() { + return this._sdpObject; + } }, { key: "type", get: function get() { + return this._type; + } }]), e; + }();t.a = c; + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }n.d(t, "a", function () { + return a; + });var a = function (e) { + return function (t) { + function n(t) { + r(this, n);var o = i(this, (n.__proto__ || Object.getPrototypeOf(n)).call(this, t));return Object.defineProperty(o, "name", { value: e }), o; + }return o(n, t), n; + }(Error); + }("InvalidStateError"); + }, function (e, t, n) { + "use strict"; + function r(e) { + var t = new Map(), + n = [], + r = !0, + i = !1, + o = void 0;try { + for (var a, s = e.media[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value, + u = c.type;if ("audio" === u || "video" === u) { + var l = !0, + d = !1, + f = void 0;try { + for (var h, m = c.rtp[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(l = (h = m.next()).done); l = !0) { + var v = h.value, + g = { clockRate: v.rate, kind: u, mimeType: u + "/" + v.codec, name: v.codec, numChannels: v.encoding || 1, parameters: {}, preferredPayloadType: v.payload, rtcpFeedback: [] };t.set(g.preferredPayloadType, g); + } + } catch (e) { + d = !0, f = e; + } finally { + try { + !l && m.return && m.return(); + } finally { + if (d) throw f; + } + }var y = !0, + b = !1, + S = void 0;try { + for (var E, T = (c.fmtp || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(y = (E = T.next()).done); y = !0) { + var _ = E.value, + C = p.a.parseFmtpConfig(_.config), + w = t.get(_.payload);w && (w.parameters = C); + } + } catch (e) { + b = !0, S = e; + } finally { + try { + !y && T.return && T.return(); + } finally { + if (b) throw S; + } + }var R = !0, + k = !1, + A = void 0;try { + for (var I, P = (c.rtcpFb || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(R = (I = P.next()).done); R = !0) { + var O = I.value, + D = t.get(O.payload);D && D.rtcpFeedback.push({ parameter: O.subtype || "", type: O.type }); + } + } catch (e) { + k = !0, A = e; + } finally { + try { + !R && P.return && P.return(); + } finally { + if (k) throw A; + } + }var L = !0, + N = !1, + M = void 0;try { + for (var x, j = (c.ext || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(L = (x = j.next()).done); L = !0) { + !function () { + var e = x.value, + t = e.value, + r = e.uri, + i = { kind: u, uri: r, preferredId: t };n.find(function (e) { + return i.kind === e.kind && i.uri === e.uri; + }) || n.push(i); + }(); + } + } catch (e) { + N = !0, M = e; + } finally { + try { + !L && j.return && j.return(); + } finally { + if (N) throw M; + } + } + } + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }return { codecs: Array.from(t.values()), fecMechanisms: [], headerExtensions: n }; + }function i(e) { + var t = l(e), + n = t.fingerprint || e.fingerprint, + r = void 0;switch (t.setup) {case "active": + r = "client";break;case "passive": + r = "server";break;case "actpass": + r = "auto";}return { role: r, fingerprints: [{ algorithm: n.type, value: n.hash }] }; + }function o(e) { + var t = l(e), + n = [], + r = !0, + i = !1, + o = void 0;try { + for (var a, s = t.candidates[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value;if (1 === c.component) { + var u = { foundation: c.foundation, ip: c.ip, port: c.port, priority: c.priority, protocol: c.transport.toLowerCase(), type: c.type };n.push(u); + } + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }return n; + }function a(e) { + var t = l(e), + n = t.iceUfrag, + r = t.icePwd;return { icelite: "ice-lite" === e.icelite, password: r, usernameFragment: n }; + }function s(e) { + var t = new Map(), + n = !0, + r = !1, + i = void 0;try { + for (var o, a = e.media[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value;t.set(s.mid, s.type); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + }return t; + }function c(e) { + var t = new Map(), + n = new Map(), + r = new Set(), + i = !0, + o = !1, + a = void 0;try { + for (var s, c = e.media[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (s = c.next()).done); i = !0) { + var u = s.value, + l = u.type;if ("audio" === l || "video" === l) { + var d = !0, + p = !1, + f = void 0;try { + for (var h, m = (u.ssrcGroups || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (h = m.next()).done); d = !0) { + var v = h.value;if ("FID" === v.semantics) { + var g = v.ssrcs.split(" ").map(function (e) { + return Number(e); + }), + y = g[0], + b = g[1];n.set(y, b), r.add(b); + } + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && m.return && m.return(); + } finally { + if (p) throw f; + } + }var S = !0, + E = !1, + T = void 0;try { + for (var _, C = (u.ssrcs || [])[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(S = (_ = C.next()).done); S = !0) { + var w = _.value, + R = w.id;if (!r.has(R)) { + var k = t.get(R);switch (k || (k = { kind: l, rtxSsrc: n.get(R), ssrc: R }, t.set(R, k)), w.attribute) {case "cname": + k.cname = w.value;break;case "msid": + var A = w.value.split(" "), + I = A[0], + P = A[1];k.streamId = I, k.trackId = P;break;case "mslabel": + var O = w.value;k.streamId = O;break;case "label": + var D = w.value;k.trackId = D;} + } + } + } catch (e) { + E = !0, T = e; + } finally { + try { + !S && C.return && C.return(); + } finally { + if (E) throw T; + } + } + } + } + } catch (e) { + o = !0, a = e; + } finally { + try { + !i && c.return && c.return(); + } finally { + if (o) throw a; + } + }return t; + }function u(e) { + var t = RTCRtpReceiver.getCapabilities(), + n = { codecs: [], fecMechanisms: [], headerExtensions: [] }, + r = new Map(), + i = !0, + o = !1, + a = void 0;try { + for (var s, c = e.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(i = (s = c.next()).done); i = !0) { + !function () { + var e = s.value, + i = e.name.toLowerCase();if ("rtx" === i) return r.set(e.parameters.apt, e.preferredPayloadType), "continue";var o = t.codecs.find(function (t) { + return t.name.toLowerCase() === i && t.kind === e.kind && t.clockRate === e.clockRate; + });if (!o) return "continue";var a = { clockRate: o.clockRate, kind: o.kind, mimeType: o.kind + "/" + o.name, name: o.name, numChannels: o.numChannels || 1, parameters: {}, preferredPayloadType: e.preferredPayloadType, rtcpFeedback: [] }, + c = !0, + u = !1, + l = void 0;try { + for (var d, p = Object.keys(e.parameters)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(c = (d = p.next()).done); c = !0) { + var f = d.value, + h = e.parameters[f], + m = !0, + v = !1, + g = void 0;try { + for (var y, b = Object.keys(o.parameters)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(m = (y = b.next()).done); m = !0) { + var S = y.value, + E = o.parameters[S];if (S === f && E === h) { + a.parameters[S] = E;break; + } + } + } catch (e) { + v = !0, g = e; + } finally { + try { + !m && b.return && b.return(); + } finally { + if (v) throw g; + } + } + } + } catch (e) { + u = !0, l = e; + } finally { + try { + !c && p.return && p.return(); + } finally { + if (u) throw l; + } + }var T = !0, + _ = !1, + C = void 0;try { + for (var w, R = e.rtcpFeedback[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(T = (w = R.next()).done); T = !0) { + !function () { + var e = w.value, + t = o.rtcpFeedback.find(function (t) { + return t.type === e.type && t.parameter === e.parameter; + });t && a.rtcpFeedback.push(t); + }(); + } + } catch (e) { + _ = !0, C = e; + } finally { + try { + !T && R.return && R.return(); + } finally { + if (_) throw C; + } + }n.codecs.push(a); + }(); + } + } catch (e) { + o = !0, a = e; + } finally { + try { + !i && c.return && c.return(); + } finally { + if (o) throw a; + } + }var u = !0, + l = !1, + d = void 0;try { + for (var p, f = n.codecs[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(u = (p = f.next()).done); u = !0) { + var h = p.value, + m = h.preferredPayloadType;if (r.has(m)) { + var v = { clockRate: h.clockRate, kind: h.kind, mimeType: h.kind + "/rtx", name: "rtx", parameters: { apt: m }, preferredPayloadType: r.get(m), rtcpFeedback: [] };n.codecs.push(v); + } + } + } catch (e) { + l = !0, d = e; + } finally { + try { + !u && f.return && f.return(); + } finally { + if (l) throw d; + } + }var g = !0, + y = !1, + b = void 0;try { + for (var S, E = e.headerExtensions[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(g = (S = E.next()).done); g = !0) { + !function () { + var e = S.value, + r = t.headerExtensions.find(function (t) { + return t.kind === e.kind && t.uri === e.uri; + });if (r) { + var i = { kind: r.kind, preferredEncrypt: Boolean(e.preferredEncrypt), preferredId: e.preferredId, uri: r.uri };n.headerExtensions.push(i); + } + }(); + } + } catch (e) { + y = !0, b = e; + } finally { + try { + !g && E.return && E.return(); + } finally { + if (y) throw b; + } + }var T = !0, + _ = !1, + C = void 0;try { + for (var w, R = e.fecMechanisms[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(T = (w = R.next()).done); T = !0) { + !function () { + var e = w.value, + r = t.fecMechanisms.find(function (t) { + return t === e; + });r && n.fecMechanisms.push(r); + }(); + } + } catch (e) { + _ = !0, C = e; + } finally { + try { + !T && R.return && R.return(); + } finally { + if (_) throw C; + } + }return n; + }function l(e) { + return e.media.find(function (e) { + return e.iceUfrag && 0 !== e.port; + }); + }t.a = r, t.g = i, t.f = o, t.e = a, t.b = s, t.d = c, t.c = u;var d = n(13), + p = n.n(d); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(5), + o = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + a = function () { + function e(t, n) { + r(this, e), this._callback = n, this._eventFired = !1, t.statistics.addAudioLevelListener(this._audioLevel.bind(this)), t.on(i.TRACK_MUTE_CHANGED, this._trackMuteChanged.bind(this)), t.on(i.TRACK_ADDED, this._trackAdded.bind(this)); + }return o(e, [{ key: "_audioLevel", value: function value(e, t, n, r) { + r && this.audioTrack && !this._eventFired && this.audioTrack.isMuted() && n > .6 && (this._eventFired = !0, this._callback()); + } }, { key: "_isLocalAudioTrack", value: function value(e) { + return e.isAudioTrack() && e.isLocal(); + } }, { key: "_trackAdded", value: function value(e) { + this._isLocalAudioTrack(e) && (this.audioTrack = e); + } }, { key: "_trackMuteChanged", value: function value(e) { + this._isLocalAudioTrack(e) && e.isMuted() && (this._eventFired = !1); + } }]), e; + }();t.a = a; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t, n) { + if (n < 5e3) return 1;var r = 0, + i = Math.min(t.height, t.width);if (e) { + var a = m.find(function (e) { + return e.height <= i; + });if (a) for (i = a.height; i >= 180 && "break" !== function () { + var e = i;if (!(a = m.find(function (t) { + return t.height === e; + }))) return "break";r += a.target; + }(); i /= 2) {} + } else { + var s = t.width * t.height;r = s <= 76800 ? 600 : s <= 307200 ? 1700 : s <= 518400 ? 2e3 : 2500; + }return Math.min(r, o(Math.max(0, n - 1e3))); + }function o(e) { + return e > 6e4 ? Number.MAX_SAFE_INTEGER : v * Math.pow(1.08, e / 1e3); + }var a = n(32), + s = n(5), + c = n(0), + u = (n.n(c), function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }()), + l = n(7), + d = n(17), + p = n(31), + f = n.i(c.getLogger)(e), + h = "stats", + m = [{ width: 1920, height: 1080, layers: 3, max: 5e3, target: 4e3, min: 800 }, { width: 1280, height: 720, layers: 3, max: 2500, target: 2500, min: 600 }, { width: 960, height: 540, layers: 3, max: 900, target: 900, min: 450 }, { width: 640, height: 360, layers: 2, max: 700, target: 500, min: 150 }, { width: 480, height: 270, layers: 2, max: 450, target: 350, min: 150 }, { width: 320, height: 180, layers: 1, max: 200, target: 150, min: 30 }], + v = 800, + g = function () { + function e(t, n, i) { + var o = this;r(this, e), this.eventEmitter = n, this._conference = t, this._localStats = { connectionQuality: 100, jvbRTT: void 0 }, this._lastConnectionQualityUpdate = -1, this._remoteStats = {}, this._timeIceConnected = -1, this._timeVideoUnmuted = -1, i.startBitrate && i.startBitrate > 0 && (v = i.startBitrate), t.on(s.CONNECTION_INTERRUPTED, function () { + o._updateLocalConnectionQuality(0), o.eventEmitter.emit(a.LOCAL_STATS_UPDATED, o._localStats), o._broadcastLocalStats(); + }), t.room.addListener(l.ICE_CONNECTION_STATE_CHANGED, function (e, t) { + e.isP2P || "connected" !== t || (o._timeIceConnected = window.performance.now()); + }), t.on(s.ENDPOINT_MESSAGE_RECEIVED, function (e, t) { + t.type === h && o._updateRemoteStats(e.getId(), t.values); + }), t.statistics.addConnectionStatsListener(this._updateLocalStats.bind(this)), t.on(s.TRACK_MUTE_CHANGED, function (e) { + e.isVideoTrack() && (e.isMuted() ? o._timeVideoUnmuted = -1 : o._maybeUpdateUnmuteTime()); + }), t.on(s.TRACK_ADDED, function (e) { + e.isVideoTrack() && !e.isMuted() && o._maybeUpdateUnmuteTime(); + }); + }return u(e, [{ key: "_maybeUpdateUnmuteTime", value: function value() { + this._timeVideoUnmuted < 0 && (this._timeVideoUnmuted = window.performance.now()); + } }, { key: "_calculateConnectionQuality", value: function value(e, t, n) { + var r = p[n], + o = 100, + a = void 0;if (this._localStats.packetLoss && (a = this._localStats.packetLoss.upload, t && (a *= .5)), t || !r || e === d.DESKTOP || this._timeIceConnected < 0 || this._timeVideoUnmuted < 0) void 0 === a ? (f.error("Cannot calculate connection quality, unknown packet loss."), o = 100) : o = a <= 2 ? 100 : a <= 4 ? 70 : a <= 6 ? 50 : a <= 8 ? 30 : a <= 12 ? 10 : 0;else { + var s = window.performance.now() - Math.max(this._timeVideoUnmuted, this._timeIceConnected), + c = this._conference.getActivePeerConnection(), + u = Boolean(c && c.isSimulcastOn()), + l = i(u, r, s);l *= .9, o = 100 * this._localStats.bitrate.upload / l, a && a >= 10 && (o = Math.min(o, 30)); + }if (this._lastConnectionQualityUpdate > 0) { + var h = this._localStats.connectionQuality, + m = (window.performance.now() - this._lastConnectionQualityUpdate) / 1e3;o = Math.min(o, h + 2 * m); + }return Math.min(100, o); + } }, { key: "_updateLocalConnectionQuality", value: function value(e) { + this._localStats.connectionQuality = e, this._lastConnectionQualityUpdate = window.performance.now(); + } }, { key: "_broadcastLocalStats", value: function value() { + var e = { bitrate: this._localStats.bitrate, packetLoss: this._localStats.packetLoss, connectionQuality: this._localStats.connectionQuality, jvbRTT: this._localStats.jvbRTT }, + t = this._conference.getLocalVideoTrack();t && t.resolution && (e.resolution = t.resolution);try { + this._conference.broadcastEndpointMessage({ type: h, values: e }); + } catch (e) {} + } }, { key: "_updateLocalStats", value: function value(e, t) { + if (!e.isP2P) { + var n = t.transport && t.transport.length && t.transport[0].rtt;this._localStats.jvbRTT = n || void 0; + }if (e === this._conference.getActivePeerConnection()) { + var r = void 0, + i = !this._conference.isConnectionInterrupted(), + o = this._conference.getLocalVideoTrack(), + s = o ? o.videoType : void 0, + c = !o || o.isMuted(), + u = o ? o.resolution : null;c || this._maybeUpdateUnmuteTime();for (r in t) { + t.hasOwnProperty(r) && (this._localStats[r] = t[r]); + }i && this._updateLocalConnectionQuality(this._calculateConnectionQuality(s, c, u)), this.eventEmitter.emit(a.LOCAL_STATS_UPDATED, this._localStats), this._broadcastLocalStats(); + } + } }, { key: "_updateRemoteStats", value: function value(e, t) { + this._remoteStats[e] = { bitrate: t.bitrate, packetLoss: t.packetLoss, connectionQuality: t.connectionQuality, jvbRTT: t.jvbRTT }, this.eventEmitter.emit(a.REMOTE_STATS_UPDATED, e, this._remoteStats[e]); + } }, { key: "getStats", value: function value() { + return this._localStats; + } }]), e; + }();t.a = g; + }).call(t, "modules/connectivity/ConnectionQuality.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(5)), + a = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + s = n.i(i.getLogger)(e), + c = function () { + function e(t) { + var n = this;r(this, e), this._conference = t, this._jvb121 = !0, this._conference.addEventListener(o.USER_JOINED, function () { + return n.evaluateStatus(); + }), this._conference.addEventListener(o.USER_LEFT, function () { + return n.evaluateStatus(); + }), this._conference.addEventListener(o.P2P_STATUS, function () { + return n.evaluateStatus(); + }); + }return a(e, [{ key: "evaluateStatus", value: function value() { + var e = this._jvb121, + t = !this._conference.isP2PActive() && this._conference.getParticipantCount() <= 2;e !== t && (this._jvb121 = t, s.debug("JVB121 status " + e + " => " + t), this._conference.eventEmitter.emit(o.JVB121_STATUS, e, t)); + } }]), e; + }();t.a = c; + }).call(t, "modules/event/Jvb121EventGenerator.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function i(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function o(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var a = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + s = function () { + function e() { + o(this, e); + }return a(e, [{ key: "sendEvent", value: function value() {} }]), e; + }(), + c = function (e) { + function t() { + o(this, t);var e = r(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return e.eventCache = [], e; + }return i(t, e), a(t, [{ key: "sendEvent", value: function value(e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};this.eventCache.push({ action: e, data: t }); + } }, { key: "drainCachedEvents", value: function value() { + var e = this.eventCache.slice();return this.eventCache = [], e; + } }]), t; + }(s), + u = new c(), + l = function () { + function e() { + o(this, e), this.analyticsHandlers = new Set(), this.permanentProperties = Object.create(null); + }return a(e, [{ key: "init", value: function value(e) { + this.browserName = e, this.analyticsHandlers.add(u); + } }, { key: "sendEvent", value: function value(e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + n = babelHelpers.extends({ browserName: this.browserName }, this.permanentProperties, t);this.analyticsHandlers.forEach(function (t) { + return t.sendEvent(e, n); + }); + } }, { key: "dispose", value: function value() { + u.drainCachedEvents(), this.analyticsHandlers.clear(); + } }, { key: "setAnalyticsHandlers", value: function value(e) { + var t = this;this.analyticsHandlers = new Set(e), u.drainCachedEvents().forEach(function (e) { + return t.sendEvent(e.action, e.data); + }); + } }, { key: "addPermanentProperties", value: function value(e) { + this.permanentProperties = babelHelpers.extends(this.permanentProperties, e); + } }]), e; + }();t.a = new l(); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(32)), + a = n(5), + s = n(4), + c = n(2), + u = n(6), + l = n(17), + d = (n.n(l), function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }()), + p = n.i(i.getLogger)(e), + f = function () { + function e(t) { + r(this, e), this.name = t, this.count = 0, this.sum = 0, this.samples = []; + }return d(e, [{ key: "addNext", value: function value(e) { + "number" != typeof e ? p.error(this.name + " - invalid value for idx: " + this.count, e) : isNaN(e) || (this.sum += e, this.samples.push(e), this.count += 1); + } }, { key: "calculate", value: function value() { + return this.sum / this.count; + } }, { key: "appendReport", value: function value(e) { + e[this.name] = { value: this.calculate(), samples: this.samples }; + } }, { key: "reset", value: function value() { + this.samples = [], this.sum = 0, this.count = 0; + } }]), e; + }(), + h = function () { + function e(t, n, i) { + var s = this;r(this, e), this.isP2P = n, this._n = i, this._sampleIdx = 0, this._avgRTT = new f("stat_avg_rtt"), this._avgRemoteRTTMap = new Map(), this._avgRtpStatsReporter = t, this._avgEnd2EndRTT = void 0, this._onConnectionStats = function (e, t) { + s.isP2P === e.isP2P && s._calculateAvgStats(t); + };var c = t._conference;c.statistics.addConnectionStatsListener(this._onConnectionStats), this.isP2P || (this._onUserLeft = function (e) { + return s._avgRemoteRTTMap.delete(e); + }, c.on(a.USER_LEFT, this._onUserLeft), this._onRemoteStatsUpdated = function (e, t) { + return s._processRemoteStats(e, t); + }, c.on(o.REMOTE_STATS_UPDATED, this._onRemoteStatsUpdated)); + }return d(e, [{ key: "_calculateAvgStats", value: function value(e) { + if (!e) return void p.error("No stats");if (c.a.supportsRTTStatistics() && e.transport && e.transport.length && this._avgRTT.addNext(e.transport[0].rtt), this._sampleIdx += 1, this._sampleIdx >= this._n) { + if (c.a.supportsRTTStatistics()) { + var t = this._avgRtpStatsReporter._conference, + n = { p2p: this.isP2P, size: t.getParticipantCount() };if (e.transport && e.transport.length && babelHelpers.extends(n, { localCandidateType: e.transport[0].localCandidateType, remoteCandidateType: e.transport[0].remoteCandidateType, transportType: e.transport[0].type }), this._avgRTT.appendReport(n), this.isP2P) { + var r = this._avgRtpStatsReporter.jvbStatsMonitor._avgEnd2EndRTT;if (!isNaN(r)) { + var i = this._avgRTT.calculate() - r;n.stat_avg_rtt_diff = { value: i }; + } + } else { + var o = this._calculateAvgRemoteRTT(), + a = this._avgRTT.calculate();this._avgEnd2EndRTT = a + o, isNaN(a) || isNaN(o) || (n.stat_avg_end2endrtt = { value: this._avgEnd2EndRTT }); + }u.a.analytics.sendEvent("avg.rtp.stats", n); + }this._resetAvgStats(); + } + } }, { key: "_calculateAvgRemoteRTT", value: function value() { + var e = 0, + t = 0, + n = !0, + r = !1, + i = void 0;try { + for (var o, a = this._avgRemoteRTTMap.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (o = a.next()).done); n = !0) { + var s = o.value, + c = s.calculate();isNaN(c) || (t += c, e += 1, s.reset()); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && a.return && a.return(); + } finally { + if (r) throw i; + } + }return t / e; + } }, { key: "_processRemoteStats", value: function value(e, t) { + var n = "number" == typeof t.jvbRTT, + r = this._avgRemoteRTTMap.get(e);!r && n && (r = new f(e + "_stat_rtt"), this._avgRemoteRTTMap.set(e, r)), n ? r.addNext(t.jvbRTT) : r && this._avgRemoteRTTMap.delete(e); + } }, { key: "_resetAvgStats", value: function value() { + this._avgRTT.reset(), this._avgRemoteRTTMap && this._avgRemoteRTTMap.clear(), this._sampleIdx = 0; + } }, { key: "dispose", value: function value() { + var e = this._avgRtpStatsReporter._conference;e.statistics.removeConnectionStatsListener(this._onConnectionStats), this.isP2P || (e.off(o.REMOTE_STATS_UPDATED, this._onRemoteStatsUpdated), e.off(a.USER_LEFT, this._onUserLeft)); + } }]), e; + }(), + m = function () { + function e(t, n) { + var i = this;if (r(this, e), this._n = n, !(n > 0)) return void p.info("Avg RTP stats reports are disabled.");p.info("Avg RTP stats will be calculated every " + n + " samples"), this._sampleIdx = 0, this._conference = t, this._avgAudioBitrateUp = new f("stat_avg_bitrate_audio_upload"), this._avgAudioBitrateDown = new f("stat_avg_bitrate_audio_download"), this._avgVideoBitrateUp = new f("stat_avg_bitrate_video_upload"), this._avgVideoBitrateDown = new f("stat_avg_bitrate_video_download"), this._avgBandwidthUp = new f("stat_avg_bandwidth_upload"), this._avgBandwidthDown = new f("stat_avg_bandwidth_download"), this._avgPacketLossTotal = new f("stat_avg_packetloss_total"), this._avgPacketLossUp = new f("stat_avg_packetloss_upload"), this._avgPacketLossDown = new f("stat_avg_packetloss_download"), this._avgRemoteFPS = new f("stat_avg_framerate_remote"), this._avgRemoteScreenFPS = new f("stat_avg_framerate_screen_remote"), this._avgLocalFPS = new f("stat_avg_framerate_local"), this._avgLocalScreenFPS = new f("stat_avg_framerate_screen_local"), this._avgCQ = new f("stat_avg_cq"), this._onLocalStatsUpdated = function (e) { + return i._calculateAvgStats(e); + }, t.on(o.LOCAL_STATS_UPDATED, this._onLocalStatsUpdated), this._onP2PStatusChanged = function () { + p.debug("Resetting average stats calculation"), i._resetAvgStats(), i.jvbStatsMonitor._resetAvgStats(), i.p2pStatsMonitor._resetAvgStats(); + }, t.on(a.P2P_STATUS, this._onP2PStatusChanged), this._onJvb121StatusChanged = function (e, t) { + !0 === t && (p.info("Resetting JVB avg RTP stats"), i._resetAvgJvbStats()); + }, t.on(a.JVB121_STATUS, this._onJvb121StatusChanged), this.jvbStatsMonitor = new h(this, !1, n), this.p2pStatsMonitor = new h(this, !0, n); + }return d(e, [{ key: "_calculateAvgStats", value: function value(e) { + if (!e) return void p.error("No stats");var t = this._conference.isP2PActive(), + n = this._conference.getParticipantCount();if (t || !(n < 2)) { + var r = e.bitrate, + i = e.bandwidth, + o = e.packetLoss, + a = e.framerate;if (!r) return void p.error('No "bitrate"');if (!i) return void p.error('No "bandwidth"');if (!o) return void p.error('No "packetloss"');if (!a) return void p.error('No "framerate"');if (this._avgAudioBitrateUp.addNext(r.audio.upload), this._avgAudioBitrateDown.addNext(r.audio.download), this._avgVideoBitrateUp.addNext(r.video.upload), this._avgVideoBitrateDown.addNext(r.video.download), c.a.supportsBandwidthStatistics() && (this._avgBandwidthUp.addNext(i.upload), this._avgBandwidthDown.addNext(i.download)), this._avgPacketLossUp.addNext(o.upload), this._avgPacketLossDown.addNext(o.download), this._avgPacketLossTotal.addNext(o.total), this._avgCQ.addNext(e.connectionQuality), a && (this._avgRemoteFPS.addNext(this._calculateAvgVideoFps(a, !1, l.CAMERA)), this._avgRemoteScreenFPS.addNext(this._calculateAvgVideoFps(a, !1, l.DESKTOP)), this._avgLocalFPS.addNext(this._calculateAvgVideoFps(a, !0, l.CAMERA)), this._avgLocalScreenFPS.addNext(this._calculateAvgVideoFps(a, !0, l.DESKTOP))), this._sampleIdx += 1, this._sampleIdx >= this._n) { + var s = { p2p: t, size: n };e.transport && e.transport.length && babelHelpers.extends(s, { localCandidateType: e.transport[0].localCandidateType, remoteCandidateType: e.transport[0].remoteCandidateType, transportType: e.transport[0].type }), this._avgAudioBitrateUp.appendReport(s), this._avgAudioBitrateDown.appendReport(s), this._avgVideoBitrateUp.appendReport(s), this._avgVideoBitrateDown.appendReport(s), c.a.supportsBandwidthStatistics() && (this._avgBandwidthUp.appendReport(s), this._avgBandwidthDown.appendReport(s)), this._avgPacketLossUp.appendReport(s), this._avgPacketLossDown.appendReport(s), this._avgPacketLossTotal.appendReport(s), this._avgRemoteFPS.appendReport(s), isNaN(this._avgRemoteScreenFPS.calculate()) || this._avgRemoteScreenFPS.appendReport(s), this._avgLocalFPS.appendReport(s), isNaN(this._avgLocalScreenFPS.calculate()) || this._avgLocalScreenFPS.appendReport(s), this._avgCQ.appendReport(s), u.a.analytics.sendEvent("avg.rtp.stats", s), this._resetAvgStats(); + } + } + } }, { key: "_calculateAvgVideoFps", value: function value(e, t, n) { + var r = 0, + i = 0, + o = this._conference.myUserId(), + a = !0, + s = !1, + c = void 0;try { + for (var u, l = Object.keys(e)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(a = (u = l.next()).done); a = !0) { + var d = u.value;if (t ? d === o : d !== o) { + var p = t ? null : this._conference.getParticipantById(d), + f = e[d];if ((t || p) && f) { + var h = this._calculatePeerAvgVideoFps(f, p, n);isNaN(h) || (r += h, i += 1); + } + } + } + } catch (e) { + s = !0, c = e; + } finally { + try { + !a && l.return && l.return(); + } finally { + if (s) throw c; + } + }return r / i; + } }, { key: "_calculatePeerAvgVideoFps", value: function value(e, t, n) { + var r = Object.keys(e).map(function (e) { + return Number(e); + }), + i = null, + o = this._conference.getActivePeerConnection();t ? (i = t.getTracksByMediaType(s.b)) && (r = r.filter(function (e) { + return i.find(function (t) { + return !t.isMuted() && t.getSSRC() === e && t.videoType === n; + }); + })) : (i = this._conference.getLocalTracks(s.b), r = r.filter(function (e) { + return i.find(function (t) { + return !t.isMuted() && o.getLocalSSRC(t) === e && t.videoType === n; + }); + }));var a = 0, + c = 0, + u = !0, + l = !1, + d = void 0;try { + for (var p, f = r[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(u = (p = f.next()).done); u = !0) { + var h = p.value, + m = Number(e[h]);!isNaN(m) && m > 0 && (a += m, c += 1); + } + } catch (e) { + l = !0, d = e; + } finally { + try { + !u && f.return && f.return(); + } finally { + if (l) throw d; + } + }return a / c; + } }, { key: "_resetAvgJvbStats", value: function value() { + this._resetAvgStats(), this.jvbStatsMonitor._resetAvgStats(); + } }, { key: "_resetAvgStats", value: function value() { + this._avgAudioBitrateUp.reset(), this._avgAudioBitrateDown.reset(), this._avgVideoBitrateUp.reset(), this._avgVideoBitrateDown.reset(), this._avgBandwidthUp.reset(), this._avgBandwidthDown.reset(), this._avgPacketLossUp.reset(), this._avgPacketLossDown.reset(), this._avgPacketLossTotal.reset(), this._avgRemoteFPS.reset(), this._avgRemoteScreenFPS.reset(), this._avgLocalFPS.reset(), this._avgLocalScreenFPS.reset(), this._avgCQ.reset(), this._sampleIdx = 0; + } }, { key: "dispose", value: function value() { + this._conference.off(a.P2P_STATUS, this._onP2PStatusChanged), this._conference.off(o.LOCAL_STATS_UPDATED, this._onLocalStatsUpdated), this._conference.off(a.JVB121_STATUS, this._onJvb121StatusChanged), this.jvbStatsMonitor.dispose(), this.p2pStatsMonitor.dispose(); + } }]), e; + }();t.a = m; + }).call(t, "modules/statistics/AvgRTPStatsReporter.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + o = n(0).getLogger(e), + a = n(3), + s = n(80), + c = n(167), + u = { createOffer: "createOffer", createAnswer: "createAnswer", setLocalDescription: "setLocalDescription", setRemoteDescription: "setRemoteDescription", addIceCandidate: "addIceCandidate", getUserMedia: "getUserMedia", iceConnectionFailure: "iceConnectionFailure", signalingError: "signalingError", applicationLog: "applicationLog" }, + l = { fabricHold: "fabricHold", fabricResume: "fabricResume", audioMute: "audioMute", audioUnmute: "audioUnmute", videoPause: "videoPause", videoResume: "videoResume", fabricUsageEvent: "fabricUsageEvent", fabricStats: "fabricStats", fabricTerminated: "fabricTerminated", screenShareStart: "screenShareStart", screenShareStop: "screenShareStop", dominantSpeaker: "dominantSpeaker", activeDeviceList: "activeDeviceList" }, + d = "jitsi", + p = { ERROR: "error", EVENT: "event", MST_WITH_USERID: "mstWithUserID" }, + f = void 0, + h = function () { + function e(t, n) { + if (r(this, e), !e.backend) throw new Error("CallStats backend not intiialized!");this.confID = n.confID, this.tpc = t, this.peerconnection = t.peerconnection, this.remoteUserID = n.remoteUserID || d, this.hasFabric = !1, e.fabrics.add(this), e.initialized && this._addNewFabric(); + }return i(e, null, [{ key: "_addNewFabricCallback", value: function value(t, n) { + e.backend && "success" !== t && o.error("Monitoring status: " + t + " msg: " + n); + } }, { key: "_initCallback", value: function value(t, n) { + if (o.log("CallStats Status: err=" + t + " msg=" + n), "success" === t) { + var r = !1, + i = null, + a = !0, + s = !1, + c = void 0;try { + for (var u, l = e.fabrics.values()[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(a = (u = l.next()).done); a = !0) { + var d = u.value;d.hasFabric || (o.debug("addNewFabric - initCallback"), d._addNewFabric() && (r = !0, i || (i = d))); + } + } catch (e) { + s = !0, c = e; + } finally { + try { + !a && l.return && l.return(); + } finally { + if (s) throw c; + } + }if (r) { + e.initialized = !0;var f = i.confID, + h = i.peerconnection, + m = !0, + v = !1, + g = void 0;try { + for (var y, b = e.reportsQueue[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(m = (y = b.next()).done); m = !0) { + var S = y.value;if (S.type === p.ERROR) { + var E = S.data;e._reportError(i, E.type, E.error, E.pc || h); + } else if (S.type === p.EVENT) { + var T = S.data;e.backend.sendFabricEvent(S.pc || h, T.event, f, T.eventData); + } else if (S.type === p.MST_WITH_USERID) { + var _ = S.data;e.backend.associateMstWithUserID(S.pc || h, _.callStatsId, f, _.ssrc, _.usageLabel, _.containerId); + } + } + } catch (e) { + v = !0, g = e; + } finally { + try { + !m && b.return && b.return(); + } finally { + if (v) throw g; + } + }e.reportsQueue.length = 0; + } + } + } }, { key: "_reportError", value: function value(t, n, r, i) { + var a = r;a || (o.warn("No error is passed!"), a = new Error("Unknown error")), e.initialized && t ? e.backend.reportError(i, t.confID, n, a) : e.reportsQueue.push({ type: p.ERROR, data: { error: a, pc: i, type: n } }); + } }, { key: "_reportEvent", value: function value(t, n, r) { + var i = t && t.peerconnection, + o = t && t.confID;e.initialized && t ? e.backend.sendFabricEvent(i, n, o, r) : e.reportsQueue.push({ confID: o, pc: i, type: p.EVENT, data: { event: n, eventData: r } }); + } }, { key: "_traceAndCatchBackendCalls", value: function value(e) { + var t = ["associateMstWithUserID", "sendFabricEvent", "sendUserFeedback"], + n = !0, + r = !1, + i = void 0;try { + for (var s, c = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (s = c.next()).done); n = !0) { + !function () { + var t = s.value, + n = e[t];e[t] = function () { + try { + for (var t = arguments.length, r = Array(t), i = 0; i < t; i++) { + r[i] = arguments[i]; + }return n.apply(e, r); + } catch (e) { + a.callErrorHandler(e); + } + }; + }(); + } + } catch (e) { + r = !0, i = e; + } finally { + try { + !n && c.return && c.return(); + } finally { + if (r) throw i; + } + }var l = ["associateMstWithUserID", "sendFabricEvent", "sendUserFeedback"], + d = !0, + p = !1, + f = void 0;try { + for (var h, m = l[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(d = (h = m.next()).done); d = !0) { + !function () { + var t = h.value, + n = e[t];e[t] = function () { + for (var r = arguments.length, i = Array(r), a = 0; a < r; a++) { + i[a] = arguments[a]; + }o.debug(t, i), n.apply(e, i); + }; + }(); + } + } catch (e) { + p = !0, f = e; + } finally { + try { + !d && m.return && m.return(); + } finally { + if (p) throw f; + } + }var v = e.reportError;e.reportError = function (t, n, r) { + for (var i = arguments.length, s = Array(i > 3 ? i - 3 : 0), c = 3; c < i; c++) { + s[c - 3] = arguments[c]; + }r === u.applicationLog ? console && console.debug("reportError", t, n, r) : o.debug.apply(o, ["reportError", t, n, r].concat(s));try { + v.call.apply(v, [e, t, n, r].concat(s)); + } catch (e) { + r === u.applicationLog ? console && console.error("reportError", e) : a.callErrorHandler(e); + } + }; + } }, { key: "initBackend", value: function value(t) { + if (e.backend) throw new Error("CallStats backend has been initialized already!");try { + return e.backend = new callstats($, c, s), e._traceAndCatchBackendCalls(e.backend), e.userID = { aliasName: t.aliasName, userName: t.userName }, e.callStatsID = t.callStatsID, e.callStatsSecret = t.callStatsSecret, e.backend.initialize(e.callStatsID, e.callStatsSecret, e.userID, e._initCallback), !0; + } catch (t) { + return a.callErrorHandler(t), e.backend = null, o.error(t), !1; + } + } }, { key: "isBackendInitialized", value: function value() { + return Boolean(e.backend); + } }, { key: "sendActiveDeviceListEvent", value: function value(t, n) { + e._reportEvent(n, l.activeDeviceList, t); + } }, { key: "sendApplicationLog", value: function value(t, n) { + try { + e._reportError(n, u.applicationLog, t, n && n.peerconnection); + } catch (e) { + console && "function" == typeof console.error && console.error("sendApplicationLog failed", e); + } + } }, { key: "sendFeedback", value: function value(t, n, r) { + e.backend ? e.backend.sendUserFeedback(t, { userID: e.userID, overall: n, comment: r }) : o.error("Failed to submit feedback to CallStats - no backend"); + } }, { key: "sendGetUserMediaFailed", value: function value(t, n) { + e._reportError(n, u.getUserMedia, t, null); + } }, { key: "sendMuteEvent", value: function value(t, n, r) { + var i = void 0;i = "video" === n ? t ? l.videoPause : l.videoResume : t ? l.audioMute : l.audioUnmute, e._reportEvent(r, i); + } }, { key: "fabrics", get: function get() { + return f || (f = new Set()), f; + } }]), i(e, [{ key: "_addNewFabric", value: function value() { + o.info("addNewFabric", this.remoteUserID, this);try { + var t = e.backend.addNewFabric(this.peerconnection, this.remoteUserID, e.backend.fabricUsage.multiplex, this.confID, e._addNewFabricCallback);this.hasFabric = !0;var n = "success" === t.status;return n || o.error("callstats fabric not initilized", t.message), n; + } catch (e) { + return a.callErrorHandler(e), !1; + } + } }, { key: "associateStreamWithVideoTag", value: function value(t, n, r, i, o) { + if (e.backend) { + var a = n ? e.userID : r;e.initialized ? e.backend.associateMstWithUserID(this.peerconnection, a, this.confID, t, i, o) : e.reportsQueue.push({ type: p.MST_WITH_USERID, pc: this.peerconnection, data: { callStatsId: a, containerId: o, ssrc: t, usageLabel: i } }); + } + } }, { key: "sendDominantSpeakerEvent", value: function value() { + e._reportEvent(this, l.dominantSpeaker); + } }, { key: "sendTerminateEvent", value: function value() { + e.initialized && e.backend.sendFabricEvent(this.peerconnection, e.backend.fabricEvent.fabricTerminated, this.confID), e.fabrics.delete(this); + } }, { key: "sendIceConnectionFailedEvent", value: function value() { + e._reportError(this, u.iceConnectionFailure, null, this.peerconnection); + } }, { key: "sendCreateOfferFailed", value: function value(t) { + e._reportError(this, u.createOffer, t, this.peerconnection); + } }, { key: "sendCreateAnswerFailed", value: function value(t) { + e._reportError(this, u.createAnswer, t, this.peerconnection); + } }, { key: "sendResumeOrHoldEvent", value: function value(t) { + e._reportEvent(this, t ? l.fabricResume : l.fabricHold); + } }, { key: "sendScreenSharingEvent", value: function value(t) { + e._reportEvent(this, t ? l.screenShareStart : l.screenShareStop); + } }, { key: "sendSetLocalDescFailed", value: function value(t) { + e._reportError(this, u.setLocalDescription, t, this.peerconnection); + } }, { key: "sendSetRemoteDescFailed", value: function value(t) { + e._reportError(this, u.setRemoteDescription, t, this.peerconnection); + } }, { key: "sendAddIceCandidateFailed", value: function value(t) { + e._reportError(this, u.addIceCandidate, t, this.peerconnection); + } }]), e; + }();t.a = h, h.backend = null, h.reportsQueue = [], h.initialized = !1, h.callStatsID = null, h.callStatsSecret = null, h.userID = null; + }).call(t, "modules/statistics/CallStats.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + return !t || t <= 0 || !e || e <= 0 ? 0 : Math.round(e / t * 100); + }function i() { + this.loss = {}, this.bitrate = { download: 0, upload: 0 }, this.resolution = {}, this.framerate = 0; + }function o() { + this.bandwidth = {}, this.bitrate = {}, this.packetLoss = null, this.transport = []; + }function a(e, t, n, r) { + this._browserType = s.a.getBrowserType();var i = f[this._browserType];if (!i) throw "The browser type '" + this._browserType + "' isn't supported!";this._getStatValue = this._defineGetStatValueMethod(i), this.peerconnection = e, this.baselineAudioLevelsReport = null, this.currentAudioLevelsReport = null, this.currentStatsReport = null, this.previousStatsReport = null, this.audioLevelsIntervalId = null, this.eventEmitter = r, this.conferenceStats = new o(), this.audioLevelsIntervalMilis = t, this.statsIntervalId = null, this.statsIntervalMilis = n, this.ssrc2stats = new Map(); + }t.a = a;var s = n(2), + c = n(55), + u = function () { + function e(e, t) { + var n = [], + r = !0, + i = !1, + o = void 0;try { + for (var a, s = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t); r = !0) {} + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }return n; + }return function (t, n) { + if (Array.isArray(t)) return t;if ((typeof Symbol === "function" ? Symbol.iterator : "@@iterator") in Object(t)) return e(t, n);throw new TypeError("Invalid attempt to destructure non-iterable instance"); + }; + }(), + l = n(3), + d = n(0).getLogger(e), + p = s.a.isChrome() || s.a.isOpera() || s.a.isFirefox() || s.a.isNWJS() || s.a.isElectron() || s.a.isTemasysPluginUsed() || s.a.isEdge(), + f = {};f[s.a.RTC_BROWSER_FIREFOX] = { ssrc: "ssrc", packetsReceived: "packetsReceived", packetsLost: "packetsLost", packetsSent: "packetsSent", bytesReceived: "bytesReceived", bytesSent: "bytesSent", framerateMean: "framerateMean" }, f[s.a.RTC_BROWSER_CHROME] = { receiveBandwidth: "googAvailableReceiveBandwidth", sendBandwidth: "googAvailableSendBandwidth", remoteAddress: "googRemoteAddress", transportType: "googTransportType", localAddress: "googLocalAddress", activeConnection: "googActiveConnection", ssrc: "ssrc", packetsReceived: "packetsReceived", packetsSent: "packetsSent", packetsLost: "packetsLost", bytesReceived: "bytesReceived", bytesSent: "bytesSent", googFrameHeightReceived: "googFrameHeightReceived", googFrameWidthReceived: "googFrameWidthReceived", googFrameHeightSent: "googFrameHeightSent", googFrameWidthSent: "googFrameWidthSent", googFrameRateReceived: "googFrameRateReceived", googFrameRateSent: "googFrameRateSent", audioInputLevel: "audioInputLevel", audioOutputLevel: "audioOutputLevel", currentRoundTripTime: "googRtt", remoteCandidateType: "googRemoteCandidateType", localCandidateType: "googLocalCandidateType" }, f[s.a.RTC_BROWSER_EDGE] = { sendBandwidth: "googAvailableSendBandwidth", remoteAddress: "remoteAddress", transportType: "protocol", localAddress: "localAddress", activeConnection: "activeConnection", ssrc: "ssrc", packetsReceived: "packetsReceived", packetsSent: "packetsSent", packetsLost: "packetsLost", bytesReceived: "bytesReceived", bytesSent: "bytesSent", googFrameHeightReceived: "frameHeight", googFrameWidthReceived: "frameWidth", googFrameHeightSent: "frameHeight", googFrameWidthSent: "frameWidth", googFrameRateReceived: "framesPerSecond", googFrameRateSent: "framesPerSecond", audioInputLevel: "audioLevel", audioOutputLevel: "audioLevel", currentRoundTripTime: "roundTripTime" }, f[s.a.RTC_BROWSER_OPERA] = f[s.a.RTC_BROWSER_CHROME], f[s.a.RTC_BROWSER_NWJS] = f[s.a.RTC_BROWSER_CHROME], f[s.a.RTC_BROWSER_ELECTRON] = f[s.a.RTC_BROWSER_CHROME], f[s.a.RTC_BROWSER_IEXPLORER] = f[s.a.RTC_BROWSER_CHROME], f[s.a.RTC_BROWSER_SAFARI] = f[s.a.RTC_BROWSER_CHROME], f[s.a.RTC_BROWSER_REACT_NATIVE] = f[s.a.RTC_BROWSER_CHROME], i.prototype.setLoss = function (e) { + this.loss = e || {}; + }, i.prototype.setResolution = function (e) { + this.resolution = e || {}; + }, i.prototype.addBitrate = function (e) { + this.bitrate.download += e.download, this.bitrate.upload += e.upload; + }, i.prototype.resetBitrate = function () { + this.bitrate.download = 0, this.bitrate.upload = 0; + }, i.prototype.setFramerate = function (e) { + this.framerate = e || 0; + }, a.prototype.stop = function () { + this.audioLevelsIntervalId && (clearInterval(this.audioLevelsIntervalId), this.audioLevelsIntervalId = null), this.statsIntervalId && (clearInterval(this.statsIntervalId), this.statsIntervalId = null); + }, a.prototype.errorCallback = function (e) { + l.callErrorHandler(e), d.error("Get stats error", e), this.stop(); + }, a.prototype.start = function (e) { + var t = this;e && (this.audioLevelsIntervalId = setInterval(function () { + t.peerconnection.getStats(function (e) { + var n = null;n = e && e.result && "function" == typeof e.result ? e.result() : e, t.currentAudioLevelsReport = n, t.processAudioLevelReport(), t.baselineAudioLevelsReport = t.currentAudioLevelsReport; + }, t.errorCallback); + }, t.audioLevelsIntervalMilis)), p && (this.statsIntervalId = setInterval(function () { + t.peerconnection.getStats(function (e) { + var n = null;n = e && e.result && "function" == typeof e.result ? e.result() : e, t.currentStatsReport = n;try { + t.processStatsReport(); + } catch (e) { + l.callErrorHandler(e), d.error("Unsupported key:" + e, e); + }t.previousStatsReport = t.currentStatsReport; + }, t.errorCallback); + }, t.statsIntervalMilis)); + }, a.prototype._defineGetStatValueMethod = function (e) { + var t = function t(_t3) { + var n = e[_t3];if (n) return n;throw "The property '" + _t3 + "' isn't supported!"; + }, + n = void 0;switch (this._browserType) {case s.a.RTC_BROWSER_CHROME:case s.a.RTC_BROWSER_OPERA:case s.a.RTC_BROWSER_NWJS:case s.a.RTC_BROWSER_ELECTRON: + n = function n(e, t) { + return e.stat(t); + };break;case s.a.RTC_BROWSER_REACT_NATIVE: + n = function n(e, t) { + var n = void 0;return e.values.some(function (e) { + return !!e.hasOwnProperty(t) && (n = e[t], !0); + }), n; + };break;case s.a.RTC_BROWSER_EDGE: + n = function n(e, t) { + return e[t]; + };break;default: + n = function n(e, t) { + return e[t]; + };}return function (e, r) { + return n(e, t(r)); + }; + }, a.prototype.getNonNegativeStat = function (e, t) { + var n = this._getStatValue(e, t);return "number" != typeof n && (n = Number(n)), isNaN(n) ? 0 : Math.max(0, n); + }, a.prototype.processStatsReport = function () { + var e = this;if (this.previousStatsReport) { + var t = this._getStatValue, + n = {};for (var o in this.currentStatsReport) { + if (this.currentStatsReport.hasOwnProperty(o)) { + var a = this.currentStatsReport[o];if (a) { + try { + var l = t(a, "receiveBandwidth"), + p = t(a, "sendBandwidth");(l || p) && (this.conferenceStats.bandwidth = { download: Math.round(l / 1e3), upload: Math.round(p / 1e3) }); + } catch (e) {}if ("googCandidatePair" === a.type) { + var f = function () { + var n = void 0, + r = void 0, + i = void 0, + o = void 0, + s = void 0, + c = void 0, + u = void 0;try { + if (!(n = t(a, "activeConnection"))) return "continue";r = t(a, "remoteAddress"), u = t(a, "transportType"), o = t(a, "localAddress"), i = t(a, "localCandidateType"), s = t(a, "remoteCandidateType"), c = e.getNonNegativeStat(a, "currentRoundTripTime"); + } catch (e) {}if (!r || !u || !o || "true" !== n) return "continue";var l = e.conferenceStats.transport;return l.some(function (e) { + return e.ip === r && e.type === u && e.localip === o; + }) || l.push({ ip: r, type: u, localip: o, p2p: e.peerconnection.isP2P, localCandidateType: i, remoteCandidateType: s, rtt: c }), "continue"; + }();if ("continue" === f) continue; + }if ("candidatepair" === a.type) { + if ("succeeded" !== a.state) continue;var h = this.currentStatsReport[a.localCandidateId], + m = this.currentStatsReport[a.remoteCandidateId];this.conferenceStats.transport.push({ ip: m.ipAddress + ":" + m.portNumber, type: h.transport, localip: h.ipAddress + ":" + h.portNumber, p2p: this.peerconnection.isP2P, localCandidateType: h.candidateType, remoteCandidateType: m.candidateType }); + }if ("transportdiagnostics" === a.msType && this.conferenceStats.transport.push({ ip: a.remoteAddress, type: a.protocol, localip: a.localAddress, p2p: this.peerconnection.isP2P }), ("ssrc" === a.type || "outboundrtp" === a.type || "inboundrtp" === a.type || "track" === a.type) && (!s.a.isEdge() || "inboundrtp" !== a.type && "outboundrtp" !== a.type)) { + var v = this.previousStatsReport[o], + g = this.getNonNegativeStat(a, "ssrc");if ("track" === a.type && Array.isArray(a.ssrcIds) && (g = Number(a.ssrcIds[0])), v && g && (s.a.isEdge() || !0 !== a.isRemote && !0 !== a.remoteSource)) { + var y = this.ssrc2stats.get(g);y || (y = new i(), this.ssrc2stats.set(g, y));var b = !0, + S = "packetsReceived", + E = t(a, S);void 0 !== E && null !== E && "" !== E || (b = !1, S = "packetsSent", void 0 !== (E = t(a, S)) && null !== E || d.warn("No packetsReceived nor packetsSent stat found")), (!E || E < 0) && (E = 0);var T = this.getNonNegativeStat(v, S), + _ = Math.max(0, E - T), + C = this.getNonNegativeStat(a, "packetsLost"), + w = this.getNonNegativeStat(v, "packetsLost"), + R = Math.max(0, C - w);y.setLoss({ packetsTotal: _ + R, packetsLost: R, isDownloadStream: b });var k = this.getNonNegativeStat(a, "bytesReceived"), + A = this.getNonNegativeStat(v, "bytesReceived"), + I = Math.max(0, k - A), + P = 0, + O = t(a, "bytesSent");"number" != typeof O && "string" != typeof O || (O = Number(O), isNaN(O) || (n[g] = O, O > 0 && (P = O - t(v, "bytesSent")))), P = Math.max(0, P);var D = a.timestamp - v.timestamp, + L = 0, + N = 0;D > 0 && (L = Math.round(8 * I / D), N = Math.round(8 * P / D)), y.addBitrate({ download: L, upload: N });var M = { height: null, width: null };try { + var x = void 0, + j = void 0;(x = t(a, "googFrameHeightReceived")) && (j = t(a, "googFrameWidthReceived")) ? (M.height = x, M.width = j) : (x = t(a, "googFrameHeightSent")) && (j = t(a, "googFrameWidthSent")) && (M.height = x, M.width = j); + } catch (e) {}var F = void 0;try { + F = t(a, "googFrameRateReceived") || t(a, "googFrameRateSent") || 0; + } catch (e) { + try { + F = this.getNonNegativeStat(a, "framerateMean"); + } catch (e) {} + }y.setFramerate(Math.round(F || 0)), M.height && M.width ? y.setResolution(M) : y.setResolution(null); + } + } + } + } + }var U = { download: 0, upload: 0 }, + B = { download: 0, upload: 0 }, + J = 0, + G = 0, + H = {}, + V = {}, + W = 0, + K = 0, + q = 0, + z = 0, + $ = !0, + X = !1, + Q = void 0;try { + for (var Y, Z = this.ssrc2stats[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !($ = (Y = Z.next()).done); $ = !0) { + var ee = u(Y.value, 2), + te = ee[0], + ne = ee[1], + re = ne.loss, + ie = re.isDownloadStream ? "download" : "upload";U[ie] += re.packetsTotal, B[ie] += re.packetsLost, J += ne.bitrate.download, G += ne.bitrate.upload;var oe = this.peerconnection.getTrackBySSRC(te);if (oe) { + oe.isAudioTrack() ? (W += ne.bitrate.download, K += ne.bitrate.upload) : (q += ne.bitrate.download, z += ne.bitrate.upload);var ae = oe.getParticipantId();if (ae) { + var se = ne.resolution;if (se.width && se.height && -1 !== se.width && -1 !== se.height) { + var ce = H[ae] || {};ce[te] = se, H[ae] = ce; + }if (0 !== ne.framerate) { + var ue = V[ae] || {};ue[te] = ne.framerate, V[ae] = ue; + } + } else d.error("No participant ID returned by " + oe); + } else this.peerconnection.isP2P && d.error("JitsiTrack not found for SSRC " + te + " in " + this.peerconnection);ne.resetBitrate(); + } + } catch (e) { + X = !0, Q = e; + } finally { + try { + !$ && Z.return && Z.return(); + } finally { + if (X) throw Q; + } + }this.eventEmitter.emit(c.d, this.peerconnection, n), this.conferenceStats.bitrate = { upload: G, download: J }, this.conferenceStats.bitrate.audio = { upload: K, download: W }, this.conferenceStats.bitrate.video = { upload: z, download: q }, this.conferenceStats.packetLoss = { total: r(B.download + B.upload, U.download + U.upload), download: r(B.download, U.download), upload: r(B.upload, U.upload) }, this.eventEmitter.emit(c.c, this.peerconnection, { bandwidth: this.conferenceStats.bandwidth, bitrate: this.conferenceStats.bitrate, packetLoss: this.conferenceStats.packetLoss, resolution: H, framerate: V, transport: this.conferenceStats.transport }), this.conferenceStats.transport = []; + } + }, a.prototype.processAudioLevelReport = function () { + if (this.baselineAudioLevelsReport) { + var e = this._getStatValue;for (var t in this.currentAudioLevelsReport) { + if (this.currentAudioLevelsReport.hasOwnProperty(t)) { + var n = this.currentAudioLevelsReport[t];if ("ssrc" === n.type || "track" === n.type) { + var r = this.baselineAudioLevelsReport[t], + i = this.getNonNegativeStat(n, "ssrc");if (!i && Array.isArray(n.ssrcIds) && (i = Number(n.ssrcIds[0])), r) { + if (i) { + var o = void 0;try { + o = e(n, "audioInputLevel") || e(n, "audioOutputLevel"); + } catch (e) { + return d.warn("Audio Levels are not available in the statistics."), void clearInterval(this.audioLevelsIntervalId); + }if (o) { + var a = void 0;a = "ssrc" === n.type ? !e(n, "packetsReceived") : !n.remoteSource, s.a.isEdge() ? o = o < 0 ? Math.pow(10, o / 20) : 0 : o /= 32767, this.eventEmitter.emit(c.a, this.peerconnection, i, o, a); + } + } else Date.now() - n.timestamp < 3e3 && d.warn("No ssrc: "); + } else d.warn(i + " not enough data"); + } + } + } + } + }; + }).call(t, "modules/statistics/RTPStatsCollector.js"); + }, function (e, t) { + function n(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var r = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + i = function () { + function e(t, r, i) { + n(this, e), this._userId = t, this.setDisplayName(r), this._isLocalStats = i || !1, this.setIsDominantSpeaker(!1), this.totalDominantSpeakerTime = 0, this._dominantSpeakerStart = null, this._hasLeft = !1; + }return r(e, [{ key: "getUserId", value: function value() { + return this._userId; + } }, { key: "getDisplayName", value: function value() { + return this.displayName; + } }, { key: "setDisplayName", value: function value(e) { + this.displayName = e; + } }, { key: "isLocalStats", value: function value() { + return this._isLocalStats; + } }, { key: "isDominantSpeaker", value: function value() { + return this._isDominantSpeaker; + } }, { key: "setIsDominantSpeaker", value: function value(e) { + if (!this._isDominantSpeaker && e) this._dominantSpeakerStart = Date.now();else if (this._isDominantSpeaker && !e) { + var t = Date.now(), + n = t - (this._dominantSpeakerStart || 0);this.totalDominantSpeakerTime += n, this._dominantSpeakerStart = null; + }this._isDominantSpeaker = e; + } }, { key: "getTotalDominantSpeakerTime", value: function value() { + var e = this.totalDominantSpeakerTime;return this._isDominantSpeaker && (e += Date.now() - this._dominantSpeakerStart), e; + } }, { key: "hasLeft", value: function value() { + return this._hasLeft; + } }, { key: "markAsHasLeft", value: function value() { + this._hasLeft = !0, this.setIsDominantSpeaker(!1); + } }]), e; + }();e.exports = i; + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(5), + o = n(107), + a = n.n(o), + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = function () { + function e(t) { + r(this, e), this.stats = { users: {}, dominantSpeakerId: null };var n = t.myUserId();this.stats.users[n] = new a.a(n, null, !0), t.addEventListener(i.DOMINANT_SPEAKER_CHANGED, this._onDominantSpeaker.bind(this)), t.addEventListener(i.USER_JOINED, this._onUserJoin.bind(this)), t.addEventListener(i.USER_LEFT, this._onUserLeave.bind(this)), t.addEventListener(i.DISPLAY_NAME_CHANGED, this._onDisplayNameChange.bind(this)); + }return s(e, [{ key: "_onDominantSpeaker", value: function value(e) { + var t = this.stats.users[this.stats.dominantSpeakerId], + n = this.stats.users[e];t && t.setIsDominantSpeaker(!1), n && n.setIsDominantSpeaker(!0), this.stats.dominantSpeakerId = e; + } }, { key: "_onUserJoin", value: function value(e, t) { + var n = this.stats.users[e];n || (n = this.stats.users[e] = new a.a(e, t.getDisplayName())); + } }, { key: "_onUserLeave", value: function value(e) { + var t = this.stats.users[e];t && t.markAsHasLeft(); + } }, { key: "_onDisplayNameChange", value: function value(e, t) { + var n = this.stats.users[e];n && n.setDisplayName(t); + } }, { key: "getStats", value: function value() { + return this.stats.users; + } }]), e; + }();t.a = c; + }, function (e, t) { + var n = function n(e, t, _n2, r) { + this.blob = e, this.name = t, this.startTime = _n2, this.wordArray = r; + };e.exports = n; + }, function (e, t, n) { + function r() { + this.audioRecorder = new s(), this.transcriptionService = new c(), this.counter = null, this.startTime = null, this.transcription = null, this.callback = null, this.results = [], this.state = u, this.lineLength = 0; + }function i(e, t) { + if (console.log("retrieved an answer from the transcription service. The answer has an array of length: " + t.wordArray.length), t.wordArray.length > 0) { + var n = t.startTime.getUTCMilliseconds() - e.startTime.getUTCMilliseconds();n < 0 && (n = 0);var r = "[";t.wordArray.forEach(function (e) { + e.begin += n, e.end += n, r += e.word + ","; + }), r += "]", console.log(r), t.wordArray.name = t.name; + }e.results.push(t.wordArray), e.counter--, console.log("current counter: " + e.counter), e.maybeMerge(); + }function o(e) { + for (var t = 0; t < e.length; t++) { + 0 === e[t].length && e.splice(t, 1); + }return e.length > 0; + }function a(e, t) { + if (0 === e.length) e.push(t);else { + if (e[e.length - 1].begin <= t.begin) return void e.push(t);for (var n = 0; n < e.length; n++) { + if (t.begin < e[n].begin) return void e.splice(n, 0, t); + }e.push(t); + } + }var s = n(48), + c = n(112), + u = "before";r.prototype.start = function () { + if (this.state !== u) throw new Error("The transcription can only start when it's in the \"" + u + '" state. It\'s currently in the "' + this.state + '" state');this.state = "recording", this.audioRecorder.start(), this.startTime = new Date(); + }, r.prototype.stop = function (e) { + var t = this;if ("recording" !== this.state) throw new Error('The transcription can only stop when it\'s in the "recording" state. It\'s currently in the "' + this.state + '" state');console.log("stopping recording and sending audio files"), this.audioRecorder.stop();var n = i.bind(null, this);this.audioRecorder.getRecordingResults().forEach(function (e) { + t.transcriptionService.send(e, n), t.counter++; + }), this.state = "transcribing", this.callback = e; + }, r.prototype.maybeMerge = function () { + "transcribing" === this.state && 0 === this.counter && this.merge(); + }, r.prototype.merge = function () { + var e = this;console.log("starting merge process!\n The length of the array: " + this.results.length), this.transcription = "";var t = this.results, + n = [];for (o(t), t.forEach(function (e) { + return a(n, e); + }); o(t);) { + !function () { + var n = t[0];t.forEach(function (e) { + e[0].begin < n[0].begin && (n = e); + });var r = n.shift();for (e.updateTranscription(r, n.name); n.length > 0 && "break" !== function () { + var i = !1, + o = n[0].begin;if (t.forEach(function (e) { + e[0].begin < o && (i = !0); + }), i) return "break";r = n.shift(), e.updateTranscription(r, null); + }();) {} + }(); + }this.state = "finished", this.callback && this.callback(this.transcription); + }, r.prototype.updateTranscription = function (e, t) { + void 0 !== t && null !== t && (this.transcription += "\n" + t + ":", this.lineLength = t.length + 1), this.lineLength + e.word.length > 80 && (this.transcription += "\n ", this.lineLength = 4), this.transcription += " " + e.word, this.lineLength += e.word.length + 1; + }, r.prototype.addTrack = function (e) { + this.audioRecorder.addTrack(e); + }, r.prototype.removeTrack = function (e) { + this.audioRecorder.removeTrack(e); + }, r.prototype.getTranscription = function () { + if ("finished" !== this.state) throw new Error('The transcription can only be retrieved when it\'s in the "finished" state. It\'s currently in the "' + this.state + '" state');return this.transcription; + }, r.prototype.getState = function () { + return this.state; + }, r.prototype.reset = function () { + this.state = u, this.counter = null, this.transcription = null, this.startTime = null, this.callback = null, this.results = [], this.lineLength = 0; + }, e.exports = r; + }, function (e, t) { + var n = function n() { + throw new Error("TranscriptionService is abstract and cannot becreated"); + };n.prototype.send = function (e, t) { + var n = this;this.sendRequest(e.blob, function (r) { + n.verify(r) ? e.wordArray = n.formatResponse(r) : (console.log("the retrieved response from the server is not valid!"), e.wordArray = []), t(e); + }); + }, n.prototype.sendRequest = function (e, t) { + throw new Error("TranscriptionService.sendRequest is abstract"); + }, n.prototype.formatResponse = function (e) { + throw new Error("TranscriptionService.format is abstract"); + }, n.prototype.verify = function (e) { + throw new Error("TranscriptionService.verify is abstract"); + }, e.exports = n; + }, function (e, t, n) { + function r() { + var e = "config does not contain an url to a Sphinx4 https server";if (void 0 === config.sphinxURL) console.log(e);else { + var t = config.sphinxURL;if (void 0 !== t.includes && t.includes("https://")) return t;console.log(e); + } + }var i = n(111), + o = n(113), + a = n(48), + s = function s() { + this.url = r(); + };s.prototype = Object.create(i.prototype), s.constructor = s, s.prototype.sendRequest = function (e, t) { + console.log("sending an audio file to " + this.url), console.log("the audio file being sent: " + e);var n = new XMLHttpRequest();n.onreadystatechange = function () { + if (n.readyState === XMLHttpRequest.DONE && 200 === n.status) t(n.responseText);else if (n.readyState === XMLHttpRequest.DONE) throw new Error("unable to accept response from sphinx server. status: " + n.status); + }, n.open("POST", this.url), n.setRequestHeader("Content-Type", a.determineCorrectFileType()), n.send(e), console.log("send " + e); + }, s.prototype.formatResponse = function (e) { + var t = JSON.parse(e).objects;t.shift();var n = [];return t.forEach(function (e) { + return e.filler || n.push(new o(e.word, e.start, e.end)); + }), n; + }, s.prototype.verify = function (e) { + if (console.log("response from server:" + e.toString()), "string" != typeof e) return !1;var t = void 0;try { + t = JSON.parse(e); + } catch (e) { + return console.log(e), !1; + }if (void 0 === t.objects) return !1;var n = t.objects;return !(!n[0] || !n[0]["session-id"]); + }, e.exports = s; + }, function (e, t) { + var n = function n(e, t, _n3) { + this.word = e, this.begin = t, this.end = _n3; + };n.prototype.getWord = function () { + return this.word; + }, n.prototype.getBeginTime = function () { + return this.begin; + }, n.prototype.getEndTime = function () { + return this.end; + }, e.exports = n; + }, function (e, t) { + var n = { getTokenAuthUrl: function getTokenAuthUrl(e, t, n) { + var r = e;return "string" != typeof r ? null : r.replace("{room}", t).replace("{roleUpgrade}", !0 === n); + } };e.exports = n; + }, function (e, t) { + function n(e, t) { + if (!e || !t || "function" != typeof e.addListener || "function" != typeof t.emit) throw new Error("Invalid arguments passed to EventEmitterForwarder");this.src = e, this.dest = t; + }n.prototype.forward = function () { + for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) { + t[n] = arguments[n]; + }var r = t[0];t[0] = this.dest, this.src.addListener(r, Function.prototype.bind.apply(this.dest.emit, t)); + }, e.exports = n; + }, function (e, t, n) { + function r() { + return i.randomElement(o) + "-" + i.randomAlphanumStr(3); + }var i = n(19), + o = ["Aaliyah", "Aaron", "Abagail", "Abbey", "Abbie", "Abbigail", "Abby", "Abdiel", "Abdul", "Abdullah", "Abe", "Abel", "Abelardo", "Abigail", "Abigale", "Abigayle", "Abner", "Abraham", "Ada", "Adah", "Adalberto", "Adaline", "Adam", "Adan", "Addie", "Addison", "Adela", "Adelbert", "Adele", "Adelia", "Adeline", "Adell", "Adella", "Adelle", "Aditya", "Adolf", "Adolfo", "Adolph", "Adolphus", "Adonis", "Adrain", "Adrian", "Adriana", "Adrianna", "Adriel", "Adrien", "Adrienne", "Afton", "Aglae", "Agnes", "Agustin", "Agustina", "Ahmad", "Ahmed", "Aida", "Aidan", "Aiden", "Aileen", "Aisha", "Aiyana", "Akeem", "Al", "Alaina", "Alan", "Alana", "Alanis", "Alanna", "Alayna", "Alba", "Albert", "Alberta", "Albertha", "Alberto", "Albin", "Albina", "Alda", "Alden", "Alec", "Aleen", "Alejandra", "Alejandrin", "Alek", "Alena", "Alene", "Alessandra", "Alessandro", "Alessia", "Aletha", "Alex", "Alexa", "Alexander", "Alexandra", "Alexandre", "Alexandrea", "Alexandria", "Alexandrine", "Alexandro", "Alexane", "Alexanne", "Alexie", "Alexis", "Alexys", "Alexzander", "Alf", "Alfonso", "Alfonzo", "Alford", "Alfred", "Alfreda", "Alfredo", "Ali", "Alia", "Alice", "Alicia", "Alisa", "Alisha", "Alison", "Alivia", "Aliya", "Aliyah", "Aliza", "Alize", "Allan", "Allen", "Allene", "Allie", "Allison", "Ally", "Alphonso", "Alta", "Althea", "Alva", "Alvah", "Alvena", "Alvera", "Alverta", "Alvina", "Alvis", "Alyce", "Alycia", "Alysa", "Alysha", "Alyson", "Alysson", "Amalia", "Amanda", "Amani", "Amara", "Amari", "Amaya", "Amber", "Ambrose", "Amelia", "Amelie", "Amely", "America", "Americo", "Amie", "Amina", "Amir", "Amira", "Amiya", "Amos", "Amparo", "Amy", "Amya", "Ana", "Anabel", "Anabelle", "Anahi", "Anais", "Anastacio", "Anastasia", "Anderson", "Andre", "Andreane", "Andreanne", "Andres", "Andrew", "Andy", "Angel", "Angela", "Angelica", "Angelina", "Angeline", "Angelita", "Angelo", "Angie", "Angus", "Anibal", "Anika", "Anissa", "Anita", "Aniya", "Aniyah", "Anjali", "Anna", "Annabel", "Annabell", "Annabelle", "Annalise", "Annamae", "Annamarie", "Anne", "Annetta", "Annette", "Annie", "Ansel", "Ansley", "Anthony", "Antoinette", "Antone", "Antonetta", "Antonette", "Antonia", "Antonietta", "Antonina", "Antonio", "Antwan", "Antwon", "Anya", "April", "Ara", "Araceli", "Aracely", "Arch", "Archibald", "Ardella", "Arden", "Ardith", "Arely", "Ari", "Ariane", "Arianna", "Aric", "Ariel", "Arielle", "Arjun", "Arlene", "Arlie", "Arlo", "Armand", "Armando", "Armani", "Arnaldo", "Arne", "Arno", "Arnold", "Arnoldo", "Arnulfo", "Aron", "Art", "Arthur", "Arturo", "Arvel", "Arvid", "Arvilla", "Aryanna", "Asa", "Asha", "Ashlee", "Ashleigh", "Ashley", "Ashly", "Ashlynn", "Ashton", "Ashtyn", "Asia", "Assunta", "Astrid", "Athena", "Aubree", "Aubrey", "Audie", "Audra", "Audreanne", "Audrey", "August", "Augusta", "Augustine", "Augustus", "Aurelia", "Aurelie", "Aurelio", "Aurore", "Austen", "Austin", "Austyn", "Autumn", "Ava", "Avery", "Avis", "Axel", "Ayana", "Ayden", "Ayla", "Aylin", "Baby", "Bailee", "Bailey", "Barbara", "Barney", "Baron", "Barrett", "Barry", "Bart", "Bartholome", "Barton", "Baylee", "Beatrice", "Beau", "Beaulah", "Bell", "Bella", "Belle", "Ben", "Benedict", "Benjamin", "Bennett", "Bennie", "Benny", "Benton", "Berenice", "Bernadette", "Bernadine", "Bernard", "Bernardo", "Berneice", "Bernhard", "Bernice", "Bernie", "Berniece", "Bernita", "Berry", "Bert", "Berta", "Bertha", "Bertram", "Bertrand", "Beryl", "Bessie", "Beth", "Bethany", "Bethel", "Betsy", "Bette", "Bettie", "Betty", "Bettye", "Beulah", "Beverly", "Bianka", "Bill", "Billie", "Billy", "Birdie", "Blair", "Blaise", "Blake", "Blanca", "Blanche", "Blaze", "Bo", "Bobbie", "Bobby", "Bonita", "Bonnie", "Boris", "Boyd", "Brad", "Braden", "Bradford", "Bradley", "Bradly", "Brady", "Braeden", "Brain", "Brandi", "Brando", "Brandon", "Brandt", "Brandy", "Brandyn", "Brannon", "Branson", "Brant", "Braulio", "Braxton", "Brayan", "Breana", "Breanna", "Breanne", "Brenda", "Brendan", "Brenden", "Brendon", "Brenna", "Brennan", "Brennon", "Brent", "Bret", "Brett", "Bria", "Brian", "Briana", "Brianne", "Brice", "Bridget", "Bridgette", "Bridie", "Brielle", "Brigitte", "Brionna", "Brisa", "Britney", "Brittany", "Brock", "Broderick", "Brody", "Brook", "Brooke", "Brooklyn", "Brooks", "Brown", "Bruce", "Bryana", "Bryce", "Brycen", "Bryon", "Buck", "Bud", "Buddy", "Buford", "Bulah", "Burdette", "Burley", "Burnice", "Buster", "Cade", "Caden", "Caesar", "Caitlyn", "Cale", "Caleb", "Caleigh", "Cali", "Calista", "Callie", "Camden", "Cameron", "Camila", "Camilla", "Camille", "Camren", "Camron", "Camryn", "Camylle", "Candace", "Candelario", "Candice", "Candida", "Candido", "Cara", "Carey", "Carissa", "Carlee", "Carleton", "Carley", "Carli", "Carlie", "Carlo", "Carlos", "Carlotta", "Carmel", "Carmela", "Carmella", "Carmelo", "Carmen", "Carmine", "Carol", "Carolanne", "Carole", "Carolina", "Caroline", "Carolyn", "Carolyne", "Carrie", "Carroll", "Carson", "Carter", "Cary", "Casandra", "Casey", "Casimer", "Casimir", "Casper", "Cassandra", "Cassandre", "Cassidy", "Cassie", "Catalina", "Caterina", "Catharine", "Catherine", "Cathrine", "Cathryn", "Cathy", "Cayla", "Ceasar", "Cecelia", "Cecil", "Cecile", "Cecilia", "Cedrick", "Celestine", "Celestino", "Celia", "Celine", "Cesar", "Chad", "Chadd", "Chadrick", "Chaim", "Chance", "Chandler", "Chanel", "Chanelle", "Charity", "Charlene", "Charles", "Charley", "Charlie", "Charlotte", "Chase", "Chasity", "Chauncey", "Chaya", "Chaz", "Chelsea", "Chelsey", "Chelsie", "Chesley", "Chester", "Chet", "Cheyanne", "Cheyenne", "Chloe", "Chris", "Christ", "Christa", "Christelle", "Christian", "Christiana", "Christina", "Christine", "Christop", "Christophe", "Christopher", "Christy", "Chyna", "Ciara", "Cicero", "Cielo", "Cierra", "Cindy", "Citlalli", "Clair", "Claire", "Clara", "Clarabelle", "Clare", "Clarissa", "Clark", "Claud", "Claude", "Claudia", "Claudie", "Claudine", "Clay", "Clemens", "Clement", "Clementina", "Clementine", "Clemmie", "Cleo", "Cleora", "Cleta", "Cletus", "Cleve", "Cleveland", "Clifford", "Clifton", "Clint", "Clinton", "Clotilde", "Clovis", "Cloyd", "Clyde", "Coby", "Cody", "Colby", "Cole", "Coleman", "Colin", "Colleen", "Collin", "Colt", "Colten", "Colton", "Columbus", "Concepcion", "Conner", "Connie", "Connor", "Conor", "Conrad", "Constance", "Constantin", "Consuelo", "Cooper", "Cora", "Coralie", "Corbin", "Cordelia", "Cordell", "Cordia", "Cordie", "Corene", "Corine", "Cornelius", "Cornell", "Corrine", "Cortez", "Cortney", "Cory", "Coty", "Courtney", "Coy", "Craig", "Crawford", "Creola", "Cristal", "Cristian", "Cristina", "Cristobal", "Cristopher", "Cruz", "Crystal", "Crystel", "Cullen", "Curt", "Curtis", "Cydney", "Cynthia", "Cyril", "Cyrus", "Dagmar", "Dahlia", "Daija", "Daisha", "Daisy", "Dakota", "Dale", "Dallas", "Dallin", "Dalton", "Damaris", "Dameon", "Damian", "Damien", "Damion", "Damon", "Dan", "Dana", "Dandre", "Dane", "D'angelo", "Dangelo", "Danial", "Daniela", "Daniella", "Danielle", "Danika", "Dannie", "Danny", "Dante", "Danyka", "Daphne", "Daphnee", "Daphney", "Darby", "Daren", "Darian", "Dariana", "Darien", "Dario", "Darion", "Darius", "Darlene", "Daron", "Darrel", "Darrell", "Darren", "Darrick", "Darrin", "Darrion", "Darron", "Darryl", "Darwin", "Daryl", "Dashawn", "Dasia", "Dave", "David", "Davin", "Davion", "Davon", "Davonte", "Dawn", "Dawson", "Dax", "Dayana", "Dayna", "Dayne", "Dayton", "Dean", "Deangelo", "Deanna", "Deborah", "Declan", "Dedric", "Dedrick", "Dee", "Deion", "Deja", "Dejah", "Dejon", "Dejuan", "Delaney", "Delbert", "Delfina", "Delia", "Delilah", "Dell", "Della", "Delmer", "Delores", "Delpha", "Delphia", "Delphine", "Delta", "Demarco", "Demarcus", "Demario", "Demetris", "Demetrius", "Demond", "Dena", "Denis", "Dennis", "Deon", "Deondre", "Deontae", "Deonte", "Dereck", "Derek", "Derick", "Deron", "Derrick", "Deshaun", "Deshawn", "Desiree", "Desmond", "Dessie", "Destany", "Destin", "Destinee", "Destiney", "Destini", "Destiny", "Devan", "Devante", "Deven", "Devin", "Devon", "Devonte", "Devyn", "Dewayne", "Dewitt", "Dexter", "Diamond", "Diana", "Dianna", "Diego", "Dillan", "Dillon", "Dimitri", "Dina", "Dino", "Dion", "Dixie", "Dock", "Dolly", "Dolores", "Domenic", "Domenica", "Domenick", "Domenico", "Domingo", "Dominic", "Dominique", "Don", "Donald", "Donato", "Donavon", "Donna", "Donnell", "Donnie", "Donny", "Dora", "Dorcas", "Dorian", "Doris", "Dorothea", "Dorothy", "Dorris", "Dortha", "Dorthy", "Doug", "Douglas", "Dovie", "Doyle", "Drake", "Drew", "Duane", "Dudley", "Dulce", "Duncan", "Durward", "Dustin", "Dusty", "Dwight", "Dylan", "Earl", "Earlene", "Earline", "Earnest", "Earnestine", "Easter", "Easton", "Ebba", "Ebony", "Ed", "Eda", "Edd", "Eddie", "Eden", "Edgar", "Edgardo", "Edison", "Edmond", "Edmund", "Edna", "Eduardo", "Edward", "Edwardo", "Edwin", "Edwina", "Edyth", "Edythe", "Effie", "Efrain", "Efren", "Eileen", "Einar", "Eino", "Eladio", "Elaina", "Elbert", "Elda", "Eldon", "Eldora", "Eldred", "Eldridge", "Eleanora", "Eleanore", "Eleazar", "Electa", "Elena", "Elenor", "Elenora", "Eleonore", "Elfrieda", "Eli", "Elian", "Eliane", "Elias", "Eliezer", "Elijah", "Elinor", "Elinore", "Elisa", "Elisabeth", "Elise", "Eliseo", "Elisha", "Elissa", "Eliza", "Elizabeth", "Ella", "Ellen", "Ellie", "Elliot", "Elliott", "Ellis", "Ellsworth", "Elmer", "Elmira", "Elmo", "Elmore", "Elna", "Elnora", "Elody", "Eloisa", "Eloise", "Elouise", "Eloy", "Elroy", "Elsa", "Else", "Elsie", "Elta", "Elton", "Elva", "Elvera", "Elvie", "Elvis", "Elwin", "Elwyn", "Elyse", "Elyssa", "Elza", "Emanuel", "Emelia", "Emelie", "Emely", "Emerald", "Emerson", "Emery", "Emie", "Emil", "Emile", "Emilia", "Emiliano", "Emilie", "Emilio", "Emily", "Emma", "Emmalee", "Emmanuel", "Emmanuelle", "Emmet", "Emmett", "Emmie", "Emmitt", "Emmy", "Emory", "Ena", "Enid", "Enoch", "Enola", "Enos", "Enrico", "Enrique", "Ephraim", "Era", "Eriberto", "Eric", "Erica", "Erich", "Erick", "Ericka", "Erik", "Erika", "Erin", "Erling", "Erna", "Ernest", "Ernestina", "Ernestine", "Ernesto", "Ernie", "Ervin", "Erwin", "Eryn", "Esmeralda", "Esperanza", "Esta", "Esteban", "Estefania", "Estel", "Estell", "Estella", "Estelle", "Estevan", "Esther", "Estrella", "Etha", "Ethan", "Ethel", "Ethelyn", "Ethyl", "Ettie", "Eudora", "Eugene", "Eugenia", "Eula", "Eulah", "Eulalia", "Euna", "Eunice", "Eusebio", "Eva", "Evalyn", "Evan", "Evangeline", "Evans", "Eve", "Eveline", "Evelyn", "Everardo", "Everett", "Everette", "Evert", "Evie", "Ewald", "Ewell", "Ezekiel", "Ezequiel", "Ezra", "Fabian", "Fabiola", "Fae", "Fannie", "Fanny", "Fatima", "Faustino", "Fausto", "Favian", "Fay", "Faye", "Federico", "Felicia", "Felicita", "Felicity", "Felipa", "Felipe", "Felix", "Felton", "Fermin", "Fern", "Fernando", "Ferne", "Fidel", "Filiberto", "Filomena", "Finn", "Fiona", "Flavie", "Flavio", "Fleta", "Fletcher", "Flo", "Florence", "Florencio", "Florian", "Florida", "Florine", "Flossie", "Floy", "Floyd", "Ford", "Forest", "Forrest", "Foster", "Frances", "Francesca", "Francesco", "Francis", "Francisca", "Francisco", "Franco", "Frank", "Frankie", "Franz", "Fred", "Freda", "Freddie", "Freddy", "Frederic", "Frederick", "Frederik", "Frederique", "Fredrick", "Fredy", "Freeda", "Freeman", "Freida", "Frida", "Frieda", "Friedrich", "Fritz", "Furman", "Gabe", "Gabriel", "Gabriella", "Gabrielle", "Gaetano", "Gage", "Gail", "Gardner", "Garett", "Garfield", "Garland", "Garnet", "Garnett", "Garret", "Garrett", "Garrick", "Garrison", "Garry", "Garth", "Gaston", "Gavin", "Gay", "Gayle", "Gaylord", "Gene", "General", "Genesis", "Genevieve", "Gennaro", "Genoveva", "Geo", "Geoffrey", "George", "Georgette", "Georgiana", "Georgianna", "Geovanni", "Geovanny", "Geovany", "Gerald", "Geraldine", "Gerard", "Gerardo", "Gerda", "Gerhard", "Germaine", "German", "Gerry", "Gerson", "Gertrude", "Gia", "Gianni", "Gideon", "Gilbert", "Gilberto", "Gilda", "Giles", "Gillian", "Gina", "Gino", "Giovani", "Giovanna", "Giovanni", "Giovanny", "Gisselle", "Giuseppe", "Gladyce", "Gladys", "Glen", "Glenda", "Glenna", "Glennie", "Gloria", "Godfrey", "Golda", "Golden", "Gonzalo", "Gordon", "Grace", "Gracie", "Graciela", "Grady", "Graham", "Grant", "Granville", "Grayce", "Grayson", "Green", "Greg", "Gregg", "Gregoria", "Gregorio", "Gregory", "Greta", "Gretchen", "Greyson", "Griffin", "Grover", "Guadalupe", "Gudrun", "Guido", "Guillermo", "Guiseppe", "Gunnar", "Gunner", "Gus", "Gussie", "Gust", "Gustave", "Guy", "Gwen", "Gwendolyn", "Hadley", "Hailee", "Hailey", "Hailie", "Hal", "Haleigh", "Haley", "Halie", "Halle", "Hallie", "Hank", "Hanna", "Hannah", "Hans", "Hardy", "Harley", "Harmon", "Harmony", "Harold", "Harrison", "Harry", "Harvey", "Haskell", "Hassan", "Hassie", "Hattie", "Haven", "Hayden", "Haylee", "Hayley", "Haylie", "Hazel", "Hazle", "Heath", "Heather", "Heaven", "Heber", "Hector", "Heidi", "Helen", "Helena", "Helene", "Helga", "Hellen", "Helmer", "Heloise", "Henderson", "Henri", "Henriette", "Henry", "Herbert", "Herman", "Hermann", "Hermina", "Herminia", "Herminio", "Hershel", "Herta", "Hertha", "Hester", "Hettie", "Hilario", "Hilbert", "Hilda", "Hildegard", "Hillard", "Hillary", "Hilma", "Hilton", "Hipolito", "Hiram", "Hobart", "Holden", "Hollie", "Hollis", "Holly", "Hope", "Horace", "Horacio", "Hortense", "Hosea", "Houston", "Howard", "Howell", "Hoyt", "Hubert", "Hudson", "Hugh", "Hulda", "Humberto", "Hunter", "Hyman", "Ian", "Ibrahim", "Icie", "Ida", "Idell", "Idella", "Ignacio", "Ignatius", "Ike", "Ila", "Ilene", "Iliana", "Ima", "Imani", "Imelda", "Immanuel", "Imogene", "Ines", "Irma", "Irving", "Irwin", "Isaac", "Isabel", "Isabell", "Isabella", "Isabelle", "Isac", "Isadore", "Isai", "Isaiah", "Isaias", "Isidro", "Ismael", "Isobel", "Isom", "Israel", "Issac", "Itzel", "Iva", "Ivah", "Ivory", "Ivy", "Izabella", "Izaiah", "Jabari", "Jace", "Jacey", "Jacinthe", "Jacinto", "Jack", "Jackeline", "Jackie", "Jacklyn", "Jackson", "Jacky", "Jaclyn", "Jacquelyn", "Jacques", "Jacynthe", "Jada", "Jade", "Jaden", "Jadon", "Jadyn", "Jaeden", "Jaida", "Jaiden", "Jailyn", "Jaime", "Jairo", "Jakayla", "Jake", "Jakob", "Jaleel", "Jalen", "Jalon", "Jalyn", "Jamaal", "Jamal", "Jamar", "Jamarcus", "Jamel", "Jameson", "Jamey", "Jamie", "Jamil", "Jamir", "Jamison", "Jammie", "Jan", "Jana", "Janae", "Jane", "Janelle", "Janessa", "Janet", "Janice", "Janick", "Janie", "Janis", "Janiya", "Jannie", "Jany", "Jaquan", "Jaquelin", "Jaqueline", "Jared", "Jaren", "Jarod", "Jaron", "Jarred", "Jarrell", "Jarret", "Jarrett", "Jarrod", "Jarvis", "Jasen", "Jasmin", "Jason", "Jasper", "Jaunita", "Javier", "Javon", "Javonte", "Jay", "Jayce", "Jaycee", "Jayda", "Jayde", "Jayden", "Jaydon", "Jaylan", "Jaylen", "Jaylin", "Jaylon", "Jayme", "Jayne", "Jayson", "Jazlyn", "Jazmin", "Jazmyn", "Jazmyne", "Jean", "Jeanette", "Jeanie", "Jeanne", "Jed", "Jedediah", "Jedidiah", "Jeff", "Jefferey", "Jeffery", "Jeffrey", "Jeffry", "Jena", "Jenifer", "Jennie", "Jennifer", "Jennings", "Jennyfer", "Jensen", "Jerad", "Jerald", "Jeramie", "Jeramy", "Jerel", "Jeremie", "Jeremy", "Jermain", "Jermaine", "Jermey", "Jerod", "Jerome", "Jeromy", "Jerrell", "Jerrod", "Jerrold", "Jerry", "Jess", "Jesse", "Jessica", "Jessie", "Jessika", "Jessy", "Jessyca", "Jesus", "Jett", "Jettie", "Jevon", "Jewel", "Jewell", "Jillian", "Jimmie", "Jimmy", "Jo", "Joan", "Joana", "Joanie", "Joanne", "Joannie", "Joanny", "Joany", "Joaquin", "Jocelyn", "Jodie", "Jody", "Joe", "Joel", "Joelle", "Joesph", "Joey", "Johan", "Johann", "Johanna", "Johathan", "John", "Johnathan", "Johnathon", "Johnnie", "Johnny", "Johnpaul", "Johnson", "Jolie", "Jon", "Jonas", "Jonatan", "Jonathan", "Jonathon", "Jordan", "Jordane", "Jordi", "Jordon", "Jordy", "Jordyn", "Jorge", "Jose", "Josefa", "Josefina", "Joseph", "Josephine", "Josh", "Joshua", "Joshuah", "Josiah", "Josiane", "Josianne", "Josie", "Josue", "Jovan", "Jovani", "Jovanny", "Jovany", "Joy", "Joyce", "Juana", "Juanita", "Judah", "Judd", "Jude", "Judge", "Judson", "Judy", "Jules", "Julia", "Julian", "Juliana", "Julianne", "Julie", "Julien", "Juliet", "Julio", "Julius", "June", "Junior", "Junius", "Justen", "Justice", "Justina", "Justine", "Juston", "Justus", "Justyn", "Juvenal", "Juwan", "Kacey", "Kaci", "Kacie", "Kade", "Kaden", "Kadin", "Kaela", "Kaelyn", "Kaia", "Kailee", "Kailey", "Kailyn", "Kaitlin", "Kaitlyn", "Kale", "Kaleb", "Kaleigh", "Kaley", "Kali", "Kallie", "Kameron", "Kamille", "Kamren", "Kamron", "Kamryn", "Kane", "Kara", "Kareem", "Karelle", "Karen", "Kari", "Kariane", "Karianne", "Karina", "Karine", "Karl", "Karlee", "Karley", "Karli", "Karlie", "Karolann", "Karson", "Kasandra", "Kasey", "Kassandra", "Katarina", "Katelin", "Katelyn", "Katelynn", "Katharina", "Katherine", "Katheryn", "Kathleen", "Kathlyn", "Kathryn", "Kathryne", "Katlyn", "Katlynn", "Katrina", "Katrine", "Kattie", "Kavon", "Kay", "Kaya", "Kaycee", "Kayden", "Kayla", "Kaylah", "Kaylee", "Kayleigh", "Kayley", "Kayli", "Kaylie", "Kaylin", "Keagan", "Keanu", "Keara", "Keaton", "Keegan", "Keeley", "Keely", "Keenan", "Keira", "Keith", "Kellen", "Kelley", "Kelli", "Kellie", "Kelly", "Kelsi", "Kelsie", "Kelton", "Kelvin", "Ken", "Kendall", "Kendra", "Kendrick", "Kenna", "Kennedi", "Kennedy", "Kenneth", "Kennith", "Kenny", "Kenton", "Kenya", "Kenyatta", "Kenyon", "Keon", "Keshaun", "Keshawn", "Keven", "Kevin", "Kevon", "Keyon", "Keyshawn", "Khalid", "Khalil", "Kian", "Kiana", "Kianna", "Kiara", "Kiarra", "Kiel", "Kiera", "Kieran", "Kiley", "Kim", "Kimberly", "King", "Kip", "Kira", "Kirk", "Kirsten", "Kirstin", "Kitty", "Kobe", "Koby", "Kody", "Kolby", "Kole", "Korbin", "Korey", "Kory", "Kraig", "Kris", "Krista", "Kristian", "Kristin", "Kristina", "Kristofer", "Kristoffer", "Kristopher", "Kristy", "Krystal", "Krystel", "Krystina", "Kurt", "Kurtis", "Kyla", "Kyle", "Kylee", "Kyleigh", "Kyler", "Kylie", "Kyra", "Lacey", "Lacy", "Ladarius", "Lafayette", "Laila", "Laisha", "Lamar", "Lambert", "Lamont", "Lance", "Landen", "Lane", "Laney", "Larissa", "Laron", "Larry", "Larue", "Laura", "Laurel", "Lauren", "Laurence", "Lauretta", "Lauriane", "Laurianne", "Laurie", "Laurine", "Laury", "Lauryn", "Lavada", "Lavern", "Laverna", "Laverne", "Lavina", "Lavinia", "Lavon", "Lavonne", "Lawrence", "Lawson", "Layla", "Layne", "Lazaro", "Lea", "Leann", "Leanna", "Leanne", "Leatha", "Leda", "Lee", "Leif", "Leila", "Leilani", "Lela", "Lelah", "Leland", "Lelia", "Lempi", "Lemuel", "Lenna", "Lennie", "Lenny", "Lenora", "Lenore", "Leo", "Leola", "Leon", "Leonard", "Leonardo", "Leone", "Leonel", "Leonie", "Leonor", "Leonora", "Leopold", "Leopoldo", "Leora", "Lera", "Lesley", "Leslie", "Lesly", "Lessie", "Lester", "Leta", "Letha", "Letitia", "Levi", "Lew", "Lewis", "Lexi", "Lexie", "Lexus", "Lia", "Liam", "Liana", "Libbie", "Libby", "Lila", "Lilian", "Liliana", "Liliane", "Lilla", "Lillian", "Lilliana", "Lillie", "Lilly", "Lily", "Lilyan", "Lina", "Lincoln", "Linda", "Lindsay", "Lindsey", "Linnea", "Linnie", "Linwood", "Lionel", "Lisa", "Lisandro", "Lisette", "Litzy", "Liza", "Lizeth", "Lizzie", "Llewellyn", "Lloyd", "Logan", "Lois", "Lola", "Lolita", "Loma", "Lon", "London", "Lonie", "Lonnie", "Lonny", "Lonzo", "Lora", "Loraine", "Loren", "Lorena", "Lorenz", "Lorenza", "Lorenzo", "Lori", "Lorine", "Lorna", "Lottie", "Lou", "Louie", "Louisa", "Lourdes", "Louvenia", "Lowell", "Loy", "Loyal", "Loyce", "Lucas", "Luciano", "Lucie", "Lucienne", "Lucile", "Lucinda", "Lucio", "Lucious", "Lucius", "Lucy", "Ludie", "Ludwig", "Lue", "Luella", "Luigi", "Luis", "Luisa", "Lukas", "Lula", "Lulu", "Luna", "Lupe", "Lura", "Lurline", "Luther", "Luz", "Lyda", "Lydia", "Lyla", "Lynn", "Lyric", "Lysanne", "Mabel", "Mabelle", "Mable", "Mac", "Macey", "Maci", "Macie", "Mack", "Mackenzie", "Macy", "Madaline", "Madalyn", "Maddison", "Madeline", "Madelyn", "Madelynn", "Madge", "Madie", "Madilyn", "Madisen", "Madison", "Madisyn", "Madonna", "Madyson", "Mae", "Maegan", "Maeve", "Mafalda", "Magali", "Magdalen", "Magdalena", "Maggie", "Magnolia", "Magnus", "Maia", "Maida", "Maiya", "Major", "Makayla", "Makenna", "Makenzie", "Malachi", "Malcolm", "Malika", "Malinda", "Mallie", "Mallory", "Malvina", "Mandy", "Manley", "Manuel", "Manuela", "Mara", "Marc", "Marcel", "Marcelina", "Marcelino", "Marcella", "Marcelle", "Marcellus", "Marcelo", "Marcia", "Marco", "Marcos", "Marcus", "Margaret", "Margarete", "Margarett", "Margaretta", "Margarette", "Margarita", "Marge", "Margie", "Margot", "Margret", "Marguerite", "Maria", "Mariah", "Mariam", "Marian", "Mariana", "Mariane", "Marianna", "Marianne", "Mariano", "Maribel", "Marie", "Mariela", "Marielle", "Marietta", "Marilie", "Marilou", "Marilyne", "Marina", "Mario", "Marion", "Marisa", "Marisol", "Maritza", "Marjolaine", "Marjorie", "Marjory", "Mark", "Markus", "Marlee", "Marlen", "Marlene", "Marley", "Marlin", "Marlon", "Marques", "Marquis", "Marquise", "Marshall", "Marta", "Martin", "Martina", "Martine", "Marty", "Marvin", "Mary", "Maryam", "Maryjane", "Maryse", "Mason", "Mateo", "Mathew", "Mathias", "Mathilde", "Matilda", "Matilde", "Matt", "Matteo", "Mattie", "Maud", "Maude", "Maudie", "Maureen", "Maurice", "Mauricio", "Maurine", "Maverick", "Mavis", "Max", "Maxie", "Maxime", "Maximilian", "Maximillia", "Maximillian", "Maximo", "Maximus", "Maxine", "Maxwell", "May", "Maya", "Maybell", "Maybelle", "Maye", "Maymie", "Maynard", "Mayra", "Mazie", "Mckayla", "Mckenna", "Mckenzie", "Meagan", "Meaghan", "Meda", "Megane", "Meggie", "Meghan", "Mekhi", "Melany", "Melba", "Melisa", "Melissa", "Mellie", "Melody", "Melvin", "Melvina", "Melyna", "Melyssa", "Mercedes", "Meredith", "Merl", "Merle", "Merlin", "Merritt", "Mertie", "Mervin", "Meta", "Mia", "Micaela", "Micah", "Michael", "Michaela", "Michale", "Micheal", "Michel", "Michele", "Michelle", "Miguel", "Mikayla", "Mike", "Mikel", "Milan", "Miles", "Milford", "Miller", "Millie", "Milo", "Milton", "Mina", "Minerva", "Minnie", "Miracle", "Mireille", "Mireya", "Misael", "Missouri", "Misty", "Mitchel", "Mitchell", "Mittie", "Modesta", "Modesto", "Mohamed", "Mohammad", "Mohammed", "Moises", "Mollie", "Molly", "Mona", "Monica", "Monique", "Monroe", "Monserrat", "Monserrate", "Montana", "Monte", "Monty", "Morgan", "Moriah", "Morris", "Mortimer", "Morton", "Mose", "Moses", "Moshe", "Mossie", "Mozell", "Mozelle", "Muhammad", "Muriel", "Murl", "Murphy", "Murray", "Mustafa", "Mya", "Myah", "Mylene", "Myles", "Myra", "Myriam", "Myrl", "Myrna", "Myron", "Myrtice", "Myrtie", "Myrtis", "Myrtle", "Nadia", "Nakia", "Name", "Nannie", "Naomi", "Naomie", "Napoleon", "Narciso", "Nash", "Nasir", "Nat", "Natalia", "Natalie", "Natasha", "Nathan", "Nathanael", "Nathanial", "Nathaniel", "Nathen", "Nayeli", "Neal", "Ned", "Nedra", "Neha", "Neil", "Nelda", "Nella", "Nelle", "Nellie", "Nels", "Nelson", "Neoma", "Nestor", "Nettie", "Neva", "Newell", "Newton", "Nia", "Nicholas", "Nicholaus", "Nichole", "Nick", "Nicklaus", "Nickolas", "Nico", "Nicola", "Nicolas", "Nicole", "Nicolette", "Nigel", "Nikita", "Nikki", "Nikko", "Niko", "Nikolas", "Nils", "Nina", "Noah", "Noble", "Noe", "Noel", "Noelia", "Noemi", "Noemie", "Noemy", "Nola", "Nolan", "Nona", "Nora", "Norbert", "Norberto", "Norene", "Norma", "Norris", "Norval", "Norwood", "Nova", "Novella", "Nya", "Nyah", "Nyasia", "Obie", "Oceane", "Ocie", "Octavia", "Oda", "Odell", "Odessa", "Odie", "Ofelia", "Okey", "Ola", "Olaf", "Ole", "Olen", "Oleta", "Olga", "Olin", "Oliver", "Ollie", "Oma", "Omari", "Omer", "Ona", "Onie", "Opal", "Ophelia", "Ora", "Oral", "Oran", "Oren", "Orie", "Orin", "Orion", "Orland", "Orlando", "Orlo", "Orpha", "Orrin", "Orval", "Orville", "Osbaldo", "Osborne", "Oscar", "Osvaldo", "Oswald", "Oswaldo", "Otha", "Otho", "Otilia", "Otis", "Ottilie", "Ottis", "Otto", "Ova", "Owen", "Ozella", "Pablo", "Paige", "Palma", "Pamela", "Pansy", "Paolo", "Paris", "Parker", "Pascale", "Pasquale", "Pat", "Patience", "Patricia", "Patrick", "Patsy", "Pattie", "Paul", "Paula", "Pauline", "Paxton", "Payton", "Pearl", "Pearlie", "Pearline", "Pedro", "Peggie", "Penelope", "Percival", "Percy", "Perry", "Pete", "Peter", "Petra", "Peyton", "Philip", "Phoebe", "Phyllis", "Pierce", "Pierre", "Pietro", "Pink", "Pinkie", "Piper", "Polly", "Porter", "Precious", "Presley", "Preston", "Price", "Prince", "Princess", "Priscilla", "Providenci", "Prudence", "Queen", "Queenie", "Quentin", "Quincy", "Quinn", "Quinten", "Quinton", "Rachael", "Rachel", "Rachelle", "Rae", "Raegan", "Rafael", "Rafaela", "Raheem", "Rahsaan", "Rahul", "Raina", "Raleigh", "Ralph", "Ramiro", "Ramon", "Ramona", "Randal", "Randall", "Randi", "Randy", "Ransom", "Raoul", "Raphael", "Raphaelle", "Raquel", "Rashad", "Rashawn", "Rasheed", "Raul", "Raven", "Ray", "Raymond", "Raymundo", "Reagan", "Reanna", "Reba", "Rebeca", "Rebecca", "Rebeka", "Rebekah", "Reece", "Reed", "Reese", "Regan", "Reggie", "Reginald", "Reid", "Reilly", "Reina", "Reinhold", "Remington", "Rene", "Renee", "Ressie", "Reta", "Retha", "Retta", "Reuben", "Reva", "Rex", "Rey", "Reyes", "Reymundo", "Reyna", "Reynold", "Rhea", "Rhett", "Rhianna", "Rhiannon", "Rhoda", "Ricardo", "Richard", "Richie", "Richmond", "Rick", "Rickey", "Rickie", "Ricky", "Rico", "Rigoberto", "Riley", "Rita", "River", "Robb", "Robbie", "Robert", "Roberta", "Roberto", "Robin", "Robyn", "Rocio", "Rocky", "Rod", "Roderick", "Rodger", "Rodolfo", "Rodrick", "Rodrigo", "Roel", "Rogelio", "Roger", "Rogers", "Rolando", "Rollin", "Roma", "Romaine", "Roman", "Ron", "Ronaldo", "Ronny", "Roosevelt", "Rory", "Rosa", "Rosalee", "Rosalia", "Rosalind", "Rosalinda", "Rosalyn", "Rosamond", "Rosanna", "Rosario", "Roscoe", "Rose", "Rosella", "Roselyn", "Rosemarie", "Rosemary", "Rosendo", "Rosetta", "Rosie", "Rosina", "Roslyn", "Ross", "Rossie", "Rowan", "Rowena", "Rowland", "Roxane", "Roxanne", "Roy", "Royal", "Royce", "Rozella", "Ruben", "Rubie", "Ruby", "Rubye", "Rudolph", "Rudy", "Rupert", "Russ", "Russel", "Russell", "Rusty", "Ruth", "Ruthe", "Ruthie", "Ryan", "Ryann", "Ryder", "Rylan", "Rylee", "Ryleigh", "Ryley", "Sabina", "Sabrina", "Sabryna", "Sadie", "Sadye", "Sage", "Saige", "Sallie", "Sally", "Salma", "Salvador", "Salvatore", "Sam", "Samanta", "Samantha", "Samara", "Samir", "Sammie", "Sammy", "Samson", "Sandra", "Sandrine", "Sandy", "Sanford", "Santa", "Santiago", "Santina", "Santino", "Santos", "Sarah", "Sarai", "Sarina", "Sasha", "Saul", "Savanah", "Savanna", "Savannah", "Savion", "Scarlett", "Schuyler", "Scot", "Scottie", "Scotty", "Seamus", "Sean", "Sebastian", "Sedrick", "Selena", "Selina", "Selmer", "Serena", "Serenity", "Seth", "Shad", "Shaina", "Shakira", "Shana", "Shane", "Shanel", "Shanelle", "Shania", "Shanie", "Shaniya", "Shanna", "Shannon", "Shanny", "Shanon", "Shany", "Sharon", "Shaun", "Shawn", "Shawna", "Shaylee", "Shayna", "Shayne", "Shea", "Sheila", "Sheldon", "Shemar", "Sheridan", "Sherman", "Sherwood", "Shirley", "Shyann", "Shyanne", "Sibyl", "Sid", "Sidney", "Sienna", "Sierra", "Sigmund", "Sigrid", "Sigurd", "Silas", "Sim", "Simeon", "Simone", "Sincere", "Sister", "Skye", "Skyla", "Skylar", "Sofia", "Soledad", "Solon", "Sonia", "Sonny", "Sonya", "Sophia", "Sophie", "Spencer", "Stacey", "Stacy", "Stan", "Stanford", "Stanley", "Stanton", "Stefan", "Stefanie", "Stella", "Stephan", "Stephania", "Stephanie", "Stephany", "Stephen", "Stephon", "Sterling", "Steve", "Stevie", "Stewart", "Stone", "Stuart", "Summer", "Sunny", "Susan", "Susana", "Susanna", "Susie", "Suzanne", "Sven", "Syble", "Sydnee", "Sydney", "Sydni", "Sydnie", "Sylvan", "Sylvester", "Sylvia", "Tabitha", "Tad", "Talia", "Talon", "Tamara", "Tamia", "Tania", "Tanner", "Tanya", "Tara", "Taryn", "Tate", "Tatum", "Tatyana", "Taurean", "Tavares", "Taya", "Taylor", "Teagan", "Ted", "Telly", "Terence", "Teresa", "Terrance", "Terrell", "Terrence", "Terrill", "Terry", "Tess", "Tessie", "Tevin", "Thad", "Thaddeus", "Thalia", "Thea", "Thelma", "Theo", "Theodora", "Theodore", "Theresa", "Therese", "Theresia", "Theron", "Thomas", "Thora", "Thurman", "Tia", "Tiana", "Tianna", "Tiara", "Tierra", "Tiffany", "Tillman", "Timmothy", "Timmy", "Timothy", "Tina", "Tito", "Titus", "Tobin", "Toby", "Tod", "Tom", "Tomas", "Tomasa", "Tommie", "Toney", "Toni", "Tony", "Torey", "Torrance", "Torrey", "Toy", "Trace", "Tracey", "Tracy", "Travis", "Travon", "Tre", "Tremaine", "Tremayne", "Trent", "Trenton", "Tressa", "Tressie", "Treva", "Trever", "Trevion", "Trevor", "Trey", "Trinity", "Trisha", "Tristian", "Tristin", "Triston", "Troy", "Trudie", "Trycia", "Trystan", "Turner", "Twila", "Tyler", "Tyra", "Tyree", "Tyreek", "Tyrel", "Tyrell", "Tyrese", "Tyrique", "Tyshawn", "Tyson", "Ubaldo", "Ulices", "Ulises", "Una", "Unique", "Urban", "Uriah", "Uriel", "Ursula", "Vada", "Valentin", "Valentina", "Valentine", "Valerie", "Vallie", "Van", "Vance", "Vanessa", "Vaughn", "Veda", "Velda", "Vella", "Velma", "Velva", "Vena", "Verda", "Verdie", "Vergie", "Verla", "Verlie", "Vern", "Verna", "Verner", "Vernice", "Vernie", "Vernon", "Verona", "Veronica", "Vesta", "Vicenta", "Vicente", "Vickie", "Vicky", "Victor", "Victoria", "Vida", "Vidal", "Vilma", "Vince", "Vincent", "Vincenza", "Vincenzo", "Vinnie", "Viola", "Violet", "Violette", "Virgie", "Virgil", "Virginia", "Virginie", "Vita", "Vito", "Viva", "Vivian", "Viviane", "Vivianne", "Vivien", "Vivienne", "Vladimir", "Wade", "Waino", "Waldo", "Walker", "Wallace", "Walter", "Walton", "Wanda", "Ward", "Warren", "Watson", "Wava", "Waylon", "Wayne", "Webster", "Weldon", "Wellington", "Wendell", "Wendy", "Werner", "Westley", "Weston", "Whitney", "Wilber", "Wilbert", "Wilburn", "Wiley", "Wilford", "Wilfred", "Wilfredo", "Wilfrid", "Wilhelm", "Wilhelmine", "Will", "Willa", "Willard", "William", "Willie", "Willis", "Willow", "Willy", "Wilma", "Wilmer", "Wilson", "Wilton", "Winfield", "Winifred", "Winnifred", "Winona", "Winston", "Woodrow", "Wyatt", "Wyman", "Xander", "Xavier", "Xzavier", "Yadira", "Yasmeen", "Yasmin", "Yasmine", "Yazmin", "Yesenia", "Yessenia", "Yolanda", "Yoshiko", "Yvette", "Yvonne", "Zachariah", "Zachary", "Zachery", "Zack", "Zackary", "Zackery", "Zakary", "Zander", "Zane", "Zaria", "Zechariah", "Zelda", "Zella", "Zelma", "Zena", "Zetta", "Zion", "Zita", "Zoe", "Zoey", "Zoie", "Zoila", "Zola", "Zora", "Zula"];e.exports = { generateUsername: r }; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e) { + this.versions = {}, this.conference = e, this.conference.addCommandListener("versions", this.processPresence.bind(this)); + }t.a = r;var i = n(6), + o = n(0).getLogger(e);r.FOCUS_COMPONENT = "focus", r.VIDEOBRIDGE_COMPONENT = "videobridge", r.XMPP_SERVER_COMPONENT = "xmpp", r.prototype.processPresence = function (e, t, n) { + var a = this;if ("http://jitsi.org/jitmeet" !== e.attributes.xmlns) return void o.warn("Ignored presence versions node - invalid xmlns", e);if (!this.conference._isFocus(n)) return void o.warn("Received versions not from the focus user: " + e, n);var s = [];e.children.forEach(function (e) { + var t = e.attributes.name;if (t !== r.FOCUS_COMPONENT && t !== r.XMPP_SERVER_COMPONENT && t !== r.VIDEOBRIDGE_COMPONENT) return void o.warn("Received version for not supported component name: " + t);var n = e.value;a.versions[t] !== n && (a.versions[t] = n, o.info("Got " + t + " version: " + n), s.push({ id: "component_version", component: t, version: n })); + }), s.length > 0 && i.a.sendLog(JSON.stringify(s)); + }, r.prototype.getComponentVersion = function (e) { + return this.versions[e]; + }; + }).call(t, "modules/version/ComponentsVersions.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(10)), + c = n(30), + u = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + l = n.i(a.getLogger)(e), + d = function (e) { + function t(e, n, o) { + r(this, t);var a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return a.sipAddress = e, a.displayName = n, a.chatRoom = o, a.state = void 0, a; + }return o(t, e), u(t, [{ key: "stop", value: function value() { + if (this.state === c.STATE_OFF || this.state === c.STATE_FAILED) return void l.warn("Video SIP GW session already stopped or failed!");this._sendJibriIQ("stop"); + } }, { key: "start", value: function value() { + if (this.state === c.STATE_ON || this.state === c.STATE_OFF || this.state === c.STATE_PENDING || this.state === c.STATE_RETRYING) return void l.warn("Video SIP GW session already started!");this._sendJibriIQ("start"); + } }, { key: "setState", value: function value(e) { + if (e !== this.state) { + var t = this.state;this.state = e, this.eventEmitter.emit(this.sipAddress, { name: "STATE_CHANGED", oldState: t, newState: this.state }); + } + } }, { key: "addStateListener", value: function value(e) { + this.addListener("STATE_CHANGED", e); + } }, { key: "removeStateListener", value: function value(e) { + this.removeListener("STATE_CHANGED", e); + } }, { key: "_sendJibriIQ", value: function value(e) { + var t = this, + n = { xmlns: "http://jitsi.org/protocol/jibri", action: e, sipaddress: this.sipAddress };n.displayname = this.displayName;var r = $iq({ to: this.chatRoom.focusMucJid, type: "set" }).c("jibri", n).up();l.log("Stop video SIP GW session", r.nodeTree), this.chatRoom.connection.sendIQ(r, function (e) { + l.log("Result", e);var n = $(e).find("jibri").attr("state");t.setState(n); + }, function (e) { + l.log("Failed to start video SIP GW session, error: ", e), t.setState(c.STATE_FAILED); + }); + } }]), t; + }(s.a);t.a = d; + }).call(t, "modules/videosipgw/JitsiVideoSIPGWSession.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(118)), + a = n(30), + s = n(7), + c = n.n(s), + u = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + l = n.i(i.getLogger)(e), + d = function () { + function e(t) { + r(this, e), this.chatRoom = t, this.eventEmitter = t.eventEmitter, l.info("creating VideoSIPGW"), this.sessions = {}, this.sessionStateChangeListener = this.sessionStateChanged.bind(this), t.addPresenceListener("jibri-sip-status", this.handleJibriSIPStatus.bind(this)), t.addPresenceListener("jibri-sip-call-state", this.handleJibriSIPState.bind(this)); + }return u(e, [{ key: "handleJibriSIPStatus", value: function value(e) { + var t = e.attributes;if (t) { + l.log("Handle video sip gw status : ", t);var n = t.status;n === this.status || n !== a.STATUS_UNDEFINED && n !== a.STATUS_AVAILABLE && n !== a.STATUS_BUSY || (this.status = n, this.eventEmitter.emit(c.a.VIDEO_SIP_GW_AVAILABILITY_CHANGED, this.status)); + } + } }, { key: "handleJibriSIPState", value: function value(e) { + var t = e.attributes;if (t) { + l.log("Handle video sip gw state : ", t);var n = t.state;if (n !== this.state) switch (n) {case a.STATE_ON:case a.STATE_OFF:case a.STATE_PENDING:case a.STATE_RETRYING:case a.STATE_FAILED: + var r = t.sipaddress;if (!r) return;var i = this.sessions[r];i ? i.setState(n) : l.warn("Video SIP GW session not found:", r);} + } + } }, { key: "createVideoSIPGWSession", value: function value(e, t) { + var n = new o.a(e, t, this.chatRoom);return n.addStateListener(this.sessionStateChangeListener), this.sessions[e] && l.warn("There was already a Video SIP GW session for address", e), this.sessions[e] = n, n; + } }, { key: "isVideoSIPGWAvailable", value: function value() { + return this.status === a.STATUS_AVAILABLE; + } }, { key: "sessionStateChanged", value: function value(e, t) { + if (t.newState === a.STATE_OFF || t.newState === a.STATE_FAILED) { + var n = this.sessions[e];if (!n) return void l.error("Missing Video SIP GW session with address:", e);n.removeStateListener(this.sessionStateChangeListener), delete this.sessions[e]; + } + } }]), e; + }();t.a = d; + }).call(t, "modules/videosipgw/VideoSIPGW.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e, t) { + var n = 0;return p.some(function (r) { + return 0 !== (n = e[r] > t[r] && 1 || e[r] < t[r] && -1); + }), n; + }var s = n(7), + c = n.n(s), + u = n(10), + l = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + d = ["category", "type", "lang", "name"], + p = ["category", "type", "lang"], + f = function (e) { + function t() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "http://jitsi.org/jitsimeet";r(this, t);var o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));if (o.node = n, o.disco = e.disco, !o.disco) throw new Error("Missing strophe-plugins (disco and caps plugins are required)!");o.versionToCapabilities = Object.create(null), o.jidToVersion = Object.create(null), o.version = "", o.rooms = new Set();var a = e.emuc;return a.addListener(c.a.EMUC_ROOM_ADDED, function (e) { + return o._addChatRoom(e); + }), a.addListener(c.a.EMUC_ROOM_REMOVED, function (e) { + return o._removeChatRoom(e); + }), Object.keys(a.rooms).forEach(function (e) { + o._addChatRoom(a.rooms[e]); + }), Strophe.addNamespace("CAPS", "http://jabber.org/protocol/caps"), o.disco.addFeature(Strophe.NS.CAPS), e.addHandler(o._handleCaps.bind(o), Strophe.NS.CAPS), o._onMucMemberLeft = o._removeJidToVersionEntry.bind(o), o; + }return o(t, e), l(t, [{ key: "addFeature", value: function value(e) { + var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];this.disco.addFeature(e), this._generateVersion(), t && this.submit(); + } }, { key: "removeFeature", value: function value(e) { + var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];this.disco.removeFeature(e), this._generateVersion(), t && this.submit(); + } }, { key: "submit", value: function value() { + this.rooms.forEach(function (e) { + return e.sendPresence(); + }); + } }, { key: "getFeatures", value: function value(e) { + var t = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 5e3, + r = e in this.jidToVersion ? this.jidToVersion[e] : null;if (!(r && r.version in this.versionToCapabilities)) { + var i = r ? r.node + "#" + r.version : null;return new Promise(function (o, a) { + return t.disco.info(e, i, function (e) { + var n = new Set();$(e).find(">query>feature").each(function (e, t) { + return n.add(t.getAttribute("var")); + }), r && (t.versionToCapabilities[r.version] = n), o(n); + }, a, n); + }); + }return Promise.resolve(this.versionToCapabilities[r.version]); + } }, { key: "_addChatRoom", value: function value(e) { + this.rooms.add(e), e.addListener(c.a.MUC_MEMBER_LEFT, this._onMucMemberLeft), this._fixChatRoomPresenceMap(e); + } }, { key: "_removeChatRoom", value: function value(e) { + this.rooms.delete(e), e.removeListener(c.a.MUC_MEMBER_LEFT, this._onMucMemberLeft); + } }, { key: "_fixChatRoomPresenceMap", value: function value(e) { + e.addToPresence("c", { attributes: { xmlns: Strophe.NS.CAPS, hash: "sha-1", node: this.node, ver: this.version } }); + } }, { key: "_notifyVersionChanged", value: function value() { + var e = this;this.rooms.forEach(function (t) { + return e._fixChatRoomPresenceMap(t); + }), this.submit(); + } }, { key: "_generateVersion", value: function value() { + var e = this.disco._identities.sort(a), + t = this.disco._features.sort();this.version = b64_sha1(e.reduce(function (e, t) { + return d.reduce(function (e, n, r) { + return e + (0 === r ? "" : "/") + t[n]; + }, "") + "<"; + }, "") + t.reduce(function (e, t) { + return e + t + "<"; + }, "")), this._notifyVersionChanged(); + } }, { key: "_handleCaps", value: function value(e) { + var t = e.getAttribute("from"), + n = e.querySelector("c"), + r = n.getAttribute("ver"), + i = n.getAttribute("node"), + o = this.jidToVersion[t];return this.jidToVersion[t] = { version: r, node: i }, o && o.version !== r && this.eventEmitter.emit(c.a.PARTCIPANT_FEATURES_CHANGED, t), !0; + } }, { key: "_removeJidToVersionEntry", value: function value(e) { + e in this.jidToVersion && delete this.jidToVersion[e]; + } }]), t; + }(u.a);t.a = f; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e, t) { + for (var n = [], r = 0; r < e.length; r++) { + e[r].tagName === t && n.push(e[r]); + }return n; + }var s = n(0), + c = (n.n(s), n(3)), + u = n.n(c), + l = n(10), + d = n(4), + p = n(128), + f = n(129), + h = n(7), + m = n.n(h), + v = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + g = n.i(s.getLogger)(e), + y = { packet2JSON: function packet2JSON(e, t) { + var n = this;$(e).children().each(function () { + var e = $(this).prop("tagName"), + r = { tagName: e };r.attributes = {}, $($(this)[0].attributes).each(function (e, t) { + r.attributes[t.name] = t.value; + });var i = Strophe.getText($(this)[0]);i && (r.value = i), r.children = [], t.push(r), n.packet2JSON($(this), r.children); + }); + }, json2packet: function json2packet(e, t) { + for (var n = 0; n < e.length; n++) { + var r = e[n];r && (t.c(r.tagName, r.attributes), r.value && t.t(r.value), r.children && this.json2packet(r.children, t), t.up()); + } + } }, + b = function (e) { + function t(e, n, o, a, s) { + r(this, t);var c = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return c.xmpp = a, c.connection = e, c.roomjid = Strophe.getBareJidFromJid(n), c.myroomjid = n, c.password = o, g.info("Joined MUC as " + c.myroomjid), c.members = {}, c.presMap = {}, c.presHandlers = {}, c.joined = !1, c.role = null, c.focusMucJid = null, c.noBridgeAvailable = !1, c.options = s || {}, c.moderator = new p.a(c.roomjid, c.xmpp, c.eventEmitter, { connection: c.xmpp.options, conference: c.options }), c.initPresenceMap(s), c.lastPresences = {}, c.phoneNumber = null, c.phonePin = null, c.connectionTimes = {}, c.participantPropertyListener = null, c.locked = !1, c; + }return o(t, e), v(t, [{ key: "initPresenceMap", value: function value() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};this.presMap.to = this.myroomjid, this.presMap.xns = "http://jabber.org/protocol/muc", this.presMap.nodes = [], this.presMap.nodes.push({ tagName: "user-agent", value: navigator.userAgent, attributes: { xmlns: "http://jitsi.org/jitmeet/user-agent" } }), this.addVideoInfoToPresence(!1), e.deploymentInfo && e.deploymentInfo.userRegion && this.presMap.nodes.push({ tagName: "region", attributes: { id: e.deploymentInfo.userRegion, xmlns: "http://jitsi.org/jitsi-meet" } }); + } }, { key: "updateDeviceAvailability", value: function value(e) { + this.presMap.nodes.push({ tagName: "devices", children: [{ tagName: "audio", value: e.audio }, { tagName: "video", value: e.video }] }); + } }, { key: "join", value: function value(e) { + var t = this;this.password = e, this.moderator.allocateConferenceFocus(function () { + return t.sendPresence(!0); + }); + } }, { key: "sendPresence", value: function value(e) { + var t = this.presMap.to;if (t && (this.joined || e)) { + var n = $pres({ to: t });e && (n.c("x", { xmlns: this.presMap.xns }), this.password && n.c("password").t(this.password).up(), n.up()), y.json2packet(this.presMap.nodes, n), this.connection.send(n), e && this.connection.flush(); + } + } }, { key: "doLeave", value: function value() { + g.log("do leave", this.myroomjid);var e = $pres({ to: this.myroomjid, type: "unavailable" });this.presMap.length = 0, this.connection.flush(), this.connection.send(e), this.connection.flush(); + } }, { key: "discoRoomInfo", value: function value() { + var e = this, + t = $iq({ type: "get", to: this.roomjid }).c("query", { xmlns: Strophe.NS.DISCO_INFO });this.connection.sendIQ(t, function (t) { + var n = 1 === $(t).find('>query>feature[var="muc_passwordprotected"]').length;n !== e.locked && (e.eventEmitter.emit(m.a.MUC_LOCK_CHANGED, n), e.locked = n); + }, function (e) { + u.a.callErrorHandler(e), g.error("Error getting room info: ", e); + }); + } }, { key: "createNonAnonymousRoom", value: function value() { + var e = $iq({ type: "get", to: this.roomjid }).c("query", { xmlns: "http://jabber.org/protocol/muc#owner" }).c("x", { xmlns: "jabber:x:data", type: "submit" }), + t = this;this.connection.sendIQ(e, function (e) { + if (!$(e).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_whois"]').length) { + var n = "non-anonymous rooms not supported";return u.a.callErrorHandler(new Error(n)), void g.error(n); + }var r = $iq({ to: t.roomjid, type: "set" }).c("query", { xmlns: "http://jabber.org/protocol/muc#owner" });r.c("x", { xmlns: "jabber:x:data", type: "submit" }), r.c("field", { var: "FORM_TYPE" }).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(), r.c("field", { var: "muc#roomconfig_whois" }).c("value").t("anyone").up().up(), t.connection.sendIQ(r); + }, function (e) { + u.a.callErrorHandler(e), g.error("Error getting room configuration form: ", e); + }); + } }, { key: "onPresence", value: function value(e) { + var t = e.getAttribute("from"), + n = {};n.show = $(e).find(">show").text(), n.status = $(e).find(">status").text();var r = $(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item');n.affiliation = r.attr("affiliation"), n.role = r.attr("role");var i = r.attr("jid");n.jid = i, n.isFocus = i && 0 === i.indexOf(this.moderator.getFocusUserJid() + "/"), n.isHiddenDomain = i && i.indexOf("@") > 0 && this.options.hiddenDomain === i.substring(i.indexOf("@") + 1, i.indexOf("/")), $(e).find(">x").remove();var o = [];y.packet2JSON(e, o), this.lastPresences[t] = o;for (var a = null, s = 0; s < o.length; s++) { + var c = o[s];switch (c.tagName) {case "nick": + n.nick = c.value;break;case "userId": + n.id = c.value;} + }if (t === this.myroomjid) { + var u = "owner" === n.affiliation ? n.role : "none";if (this.role !== u && (this.role = u, this.eventEmitter.emit(m.a.LOCAL_ROLE_CHANGED, this.role)), !this.joined) { + this.joined = !0;var l = this.connectionTimes["muc.joined"] = window.performance.now();g.log("(TIME) MUC joined:\t", l), this.password && (this.locked = !0), this.eventEmitter.emit(m.a.MUC_JOINED); + } + } else if (void 0 === this.members[t]) this.members[t] = n, g.log("entered", t, n), n.isFocus ? this._initFocus(t, i) : this.eventEmitter.emit(m.a.MUC_MEMBER_JOINED, t, n.nick, n.role, n.isHiddenDomain);else { + var d = this.members[t];d.role !== n.role && (d.role = n.role, this.eventEmitter.emit(m.a.MUC_ROLE_CHANGED, t, n.role)), n.isFocus && (d.isFocus = !0, this._initFocus(t, i)), n.displayName && (d.displayName = n.displayName); + }for (var p = 0; p < o.length; p++) { + var f = o[p];switch (f.tagName) {case "nick": + if (!n.isFocus) { + var h = this.xmpp.options.displayJids ? Strophe.getResourceFromJid(t) : n.nick;h && h.length > 0 && this.eventEmitter.emit(m.a.DISPLAY_NAME_CHANGED, t, h); + }break;case "bridgeNotAvailable": + n.isFocus && !this.noBridgeAvailable && (this.noBridgeAvailable = !0, this.eventEmitter.emit(m.a.BRIDGE_DOWN));break;case "jibri-recording-status": + a = f;break;case "call-control": + var v = f.attributes;if (!v) break;this.phoneNumber = v.phone || null, this.phonePin = v.pin || null, this.eventEmitter.emit(m.a.PHONE_NUMBER_CHANGED);break;default: + this.processNode(f, t);} + }n.status && this.eventEmitter.emit(m.a.PRESENCE_STATUS, t, n.status), a && (this.lastJibri = a, this.recording && this.recording.handleJibriPresence(a)); + } }, { key: "_initFocus", value: function value(e, t) { + this.focusMucJid = e, this.recording || (this.recording = new f.a(this.options.recordingType, this.eventEmitter, this.connection, this.focusMucJid, this.options.jirecon, this.roomjid), this.lastJibri && this.recording.handleJibriPresence(this.lastJibri)), g.info("Ignore focus: " + e + ", real JID: " + t); + } }, { key: "setParticipantPropertyListener", value: function value(e) { + this.participantPropertyListener = e; + } }, { key: "processNode", value: function value(e, t) { + try { + var n = this.presHandlers[e.tagName];e.tagName.startsWith("jitsi_participant_") && (n = [this.participantPropertyListener]), n && n.forEach(function (n) { + n(e, Strophe.getResourceFromJid(t), t); + }); + } catch (t) { + u.a.callErrorHandler(t), g.error("Error processing:" + e.tagName + " node.", t); + } + } }, { key: "sendMessage", value: function value(e, t) { + var n = $msg({ to: this.roomjid, type: "groupchat" });n.c("body", e).up(), t && n.c("nick", { xmlns: "http://jabber.org/protocol/nick" }).t(t).up().up(), this.connection.send(n), this.eventEmitter.emit(m.a.SENDING_CHAT_MESSAGE, e); + } }, { key: "setSubject", value: function value(e) { + var t = $msg({ to: this.roomjid, type: "groupchat" });t.c("subject", e), this.connection.send(t); + } }, { key: "onParticipantLeft", value: function value(e, t) { + delete this.lastPresences[e], t || (this.eventEmitter.emit(m.a.MUC_MEMBER_LEFT, e), this.moderator.onMucMemberLeft(e)); + } }, { key: "onPresenceUnavailable", value: function value(e, t) { + var n = this;if ($(e).find('>ignore[xmlns="http://jitsi.org/jitmeet/"]').length) return !0;if ($(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy').length) { + var r = void 0, + i = $(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy>reason');return i.length && (r = i.text()), this.eventEmitter.emit(m.a.MUC_DESTROYED, r), this.connection.emuc.doLeave(this.roomjid), !0; + }var o = 0 !== $(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length, + a = 0 !== $(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length, + s = Object.keys(this.members);o ? s.length > 0 && (s.forEach(function (e) { + var t = n.members[e];delete n.members[e], n.onParticipantLeft(e, t.isFocus); + }), this.connection.emuc.doLeave(this.roomjid), a || this.eventEmitter.emit(m.a.MUC_LEFT)) : (delete this.members[t], this.onParticipantLeft(t, !1)), a && this.myroomjid === t && this.eventEmitter.emit(m.a.KICKED); + } }, { key: "onMessage", value: function value(e, t) { + var n = $(e).find('>nick[xmlns="http://jabber.org/protocol/nick"]').text() || Strophe.getResourceFromJid(t), + r = $(e).find(">body").text();if ("error" === e.getAttribute("type")) return this.eventEmitter.emit(m.a.CHAT_ERROR_RECEIVED, $(e).find(">text").text(), r), !0;var i = $(e).find(">subject");if (i.length) { + var o = i.text();(o || "" === o) && (this.eventEmitter.emit(m.a.SUBJECT_CHANGED, o), g.log("Subject is changed to " + o)); + }var a = $(e).find(">delay").attr("stamp");if (!a && (a = $(e).find('>[xmlns="jabber:x:delay"]').attr("stamp"))) { + var s = a.match(/(\d{4})(\d{2})(\d{2}T\d{2}:\d{2}:\d{2})/);a = s[1] + "-" + s[2] + "-" + s[3] + "Z"; + }t === this.roomjid && $(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length && this.discoRoomInfo(), r && (g.log("chat", n, r), this.eventEmitter.emit(m.a.MESSAGE_RECEIVED, t, n, r, this.myroomjid, a)); + } }, { key: "onPresenceError", value: function value(e, t) { + if ($(e).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) g.log("on password required", t), this.eventEmitter.emit(m.a.PASSWORD_REQUIRED);else if ($(e).find('>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) { + var n = Strophe.getDomainFromJid(e.getAttribute("to"));n === this.xmpp.options.hosts.anonymousdomain ? this.eventEmitter.emit(m.a.ROOM_JOIN_ERROR) : (g.warn("onPresError ", e), this.eventEmitter.emit(m.a.ROOM_CONNECT_NOT_ALLOWED_ERROR)); + } else $(e).find(">error>service-unavailable").length ? (g.warn("Maximum users limit for the room has been reached", e), this.eventEmitter.emit(m.a.ROOM_MAX_USERS_ERROR)) : (g.warn("onPresError ", e), this.eventEmitter.emit(m.a.ROOM_CONNECT_ERROR)); + } }, { key: "kick", value: function value(e) { + var t = $iq({ to: this.roomjid, type: "set" }).c("query", { xmlns: "http://jabber.org/protocol/muc#admin" }).c("item", { nick: Strophe.getResourceFromJid(e), role: "none" }).c("reason").t("You have been kicked.").up().up().up();this.connection.sendIQ(t, function (t) { + return g.log("Kick participant with jid: ", e, t); + }, function (e) { + return g.log("Kick participant error: ", e); + }); + } }, { key: "lockRoom", value: function value(e, t, n, r) { + var i = this;this.connection.sendIQ($iq({ to: this.roomjid, type: "get" }).c("query", { xmlns: "http://jabber.org/protocol/muc#owner" }), function (o) { + if ($(o).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length) { + var a = $iq({ to: i.roomjid, type: "set" }).c("query", { xmlns: "http://jabber.org/protocol/muc#owner" });a.c("x", { xmlns: "jabber:x:data", type: "submit" }), a.c("field", { var: "FORM_TYPE" }).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(), a.c("field", { var: "muc#roomconfig_roomsecret" }).c("value").t(e).up().up(), a.c("field", { var: "muc#roomconfig_whois" }).c("value").t("anyone").up().up(), i.connection.sendIQ(a, t, n); + } else r(); + }, n); + } }, { key: "addToPresence", value: function value(e, t) { + t.tagName = e, this.removeFromPresence(e), this.presMap.nodes.push(t); + } }, { key: "removeFromPresence", value: function value(e) { + var t = this.presMap.nodes.filter(function (t) { + return e !== t.tagName; + });this.presMap.nodes = t; + } }, { key: "addPresenceListener", value: function value(e, t) { + if ("function" != typeof t) throw new Error('"handler" is not a function');var n = this.presHandlers[e];n || (this.presHandlers[e] = n = []), -1 === n.indexOf(t) ? n.push(t) : g.warn("Trying to add the same handler more than once for: " + e); + } }, { key: "removePresenceListener", value: function value(e, t) { + var n = this.presHandlers[e], + r = n ? n.indexOf(t) : -1;-1 !== r ? n.splice(r, 1) : g.warn("Handler for: " + e + " was not registered"); + } }, { key: "isFocus", value: function value(e) { + var t = this.members[e];return t ? t.isFocus : null; + } }, { key: "isModerator", value: function value() { + return "moderator" === this.role; + } }, { key: "getMemberRole", value: function value(e) { + return this.members[e] ? this.members[e].role : null; + } }, { key: "setVideoMute", value: function value(e, t) { + this.sendVideoInfoPresence(e), t && t(e); + } }, { key: "setAudioMute", value: function value(e, t) { + return this.sendAudioInfoPresence(e, t); + } }, { key: "addAudioInfoToPresence", value: function value(e) { + this.removeFromPresence("audiomuted"), this.addToPresence("audiomuted", { attributes: { xmlns: "http://jitsi.org/jitmeet/audio" }, value: e.toString() }); + } }, { key: "sendAudioInfoPresence", value: function value(e, t) { + this.addAudioInfoToPresence(e), this.connection && this.sendPresence(), t && t(); + } }, { key: "addVideoInfoToPresence", value: function value(e) { + this.removeFromPresence("videomuted"), this.addToPresence("videomuted", { attributes: { xmlns: "http://jitsi.org/jitmeet/video" }, value: e.toString() }); + } }, { key: "sendVideoInfoPresence", value: function value(e) { + this.addVideoInfoToPresence(e), this.connection && this.sendPresence(); + } }, { key: "getMediaPresenceInfo", value: function value(e, t) { + var n = this.lastPresences[this.roomjid + "/" + e];if (!n) return null;var r = { muted: !1, videoType: void 0 }, + i = null;if (t === d.a) i = a(n, "audiomuted");else { + if (t !== d.b) return g.error("Unsupported media type: " + t), null;i = a(n, "videomuted");var o = a(n, "videoType");o.length > 0 && (r.videoType = o[0].value); + }return r.muted = i.length > 0 && "true" === i[0].value, r; + } }, { key: "isRecordingSupported", value: function value() { + return !!this.recording && this.recording.isSupported(); + } }, { key: "getRecordingState", value: function value() { + return this.recording ? this.recording.getState() : void 0; + } }, { key: "getRecordingURL", value: function value() { + return this.recording ? this.recording.getURL() : null; + } }, { key: "toggleRecording", value: function value(e, t) { + return this.recording ? this.recording.toggleRecording(e, t) : t("error", new Error("The conference is not created yet!")); + } }, { key: "isSIPCallingSupported", value: function value() { + return !!this.moderator && this.moderator.isSipGatewayEnabled(); + } }, { key: "dial", value: function value(e) { + return this.connection.rayo.dial(e, "fromnumber", Strophe.getBareJidFromJid(this.myroomjid), this.password, this.focusMucJid); + } }, { key: "hangup", value: function value() { + return this.connection.rayo.hangup(); + } }, { key: "getPhoneNumber", value: function value() { + return this.phoneNumber; + } }, { key: "getPhonePin", value: function value() { + return this.phonePin; + } }, { key: "muteParticipant", value: function value(e, t) { + g.info("set mute", t);var n = $iq({ to: this.focusMucJid, type: "set" }).c("mute", { xmlns: "http://jitsi.org/jitmeet/audio", jid: e }).t(t.toString()).up();this.connection.sendIQ(n, function (e) { + return g.log("set mute", e); + }, function (e) { + return g.log("set mute error", e); + }); + } }, { key: "onMute", value: function value(e) { + if (e.getAttribute("from") !== this.focusMucJid) return g.warn("Ignored mute from non focus peer"), !1;var t = $(e).find("mute");if (t.length) { + var n = "true" === t.text();this.eventEmitter.emit(m.a.AUDIO_MUTED_BY_FOCUS, n); + }return !0; + } }, { key: "leave", value: function value() { + var e = this;return new Promise(function (t, n) { + function r() { + var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];o.removeListener(m.a.MUC_LEFT, r), clearTimeout(i), e ? n(new Error("The timeout for the confirmation about leaving the room expired.")) : t(); + }var i = setTimeout(function () { + return r(!0); + }, 5e3), + o = e.eventEmitter;o.on(m.a.MUC_LEFT, r), e.doLeave(); + }); + } }]), t; + }(l.a);t.a = b; + }).call(t, "modules/xmpp/ChatRoom.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(50)), + a = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + s = n.i(i.getLogger)(e), + c = function () { + function e(t, n, i, o, a, s) { + r(this, e), this.sid = t, this.localJid = n, this.peerjid = i, this.connection = o, this.mediaConstraints = a, this.iceConfig = s, this.usedrip = !0, this.dripContainer = [], this.room = null, this.state = null, this.rtc = null; + }return a(e, [{ key: "initialize", value: function value(e, t, n) { + if (null !== this.state) { + var r = "attempt to initiate on session " + this.sid + "\n in state " + this.state;throw s.error(r), new Error(r); + }this.room = t, this.rtc = n, this.state = o.b, this.initiator = e ? this.localJid : this.peerjid, this.responder = e ? this.peerjid : this.localJid, this.doInitialize(); + } }, { key: "doInitialize", value: function value() {} }, { key: "addIceCandidates", value: function value(e) {} }, { key: "getState", value: function value() { + return this.state; + } }, { key: "addSources", value: function value(e) {} }, { key: "removeSources", value: function value(e) {} }, { key: "terminate", value: function value(e, t, n) {} }, { key: "acceptOffer", value: function value(e, t, n) {} }]), e; + }();t.a = c; + }).call(t, "modules/xmpp/JingleSession.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(70), + s = n.n(a), + c = n(0), + u = (n.n(c), n(3)), + l = n.n(u), + d = n(122), + p = n(51), + f = n(125), + h = n(12), + m = n(127), + v = n(6), + g = n(7), + y = n.n(g), + b = n(50), + S = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + E = n.i(c.getLogger)(e), + T = function (e) { + function t(e, n, o, a, c, u, l, d, p) { + r(this, t);var f = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, o, a, c, u));return f._iceCheckingStartedTimestamp = null, f._gatheringStartedTimestamp = null, f._localVideoActive = !0, f._remoteVideoActive = !0, f._gatheringReported = !1, f.bridgeWebSocketUrl = null, f.lasticecandidate = !1, f.closed = !1, f.isInitiator = d, f.isP2P = l, f.signalingLayer = new m.a(), f.webrtcIceUdpDisable = Boolean(p.webrtcIceUdpDisable), f.webrtcIceTcpDisable = Boolean(p.webrtcIceTcpDisable), f.failICE = Boolean(p.failICE), f.modificationQueue = s.a.queue(f._processQueueTasks.bind(f), 1), f.wasConnected = !1, f.establishmentDuration = void 0, f; + }return o(t, e), S(t, null, [{ key: "parseVideoSenders", value: function value(e) { + var t = e.find('>content[name="video"]');if (t.length) { + var n = t[0].getAttribute("senders");if ("both" === n || "initiator" === n || "responder" === n || "none" === n) return n; + }return null; + } }]), S(t, [{ key: "_assertNotEnded", value: function value(e) { + return this.state !== b.a || (E.log("The session has ended - cancelling action: " + e), !1); + } }, { key: "doInitialize", value: function value() { + var e = this;this.lasticecandidate = !1, this.isreconnect = !1, this.wasstable = !1, this.isP2P ? this.peerconnection = this.rtc.createPeerConnection(this.signalingLayer, this.iceConfig, this.isP2P, { disableSimulcast: !0, disableRtx: this.room.options.disableRtx, preferH264: this.room.options.p2p && this.room.options.p2p.preferH264 }) : this.peerconnection = this.rtc.createPeerConnection(this.signalingLayer, this.iceConfig, this.isP2P, { disableSimulcast: this.room.options.disableSimulcast || this.room.options.preferH264, disableRtx: this.room.options.disableRtx, preferH264: this.room.options.preferH264, enableFirefoxSimulcast: this.room.options.testing && this.room.options.testing.enableFirefoxSimulcast }), this.peerconnection.onicecandidate = function (t) { + if (t) { + var n = t.candidate, + r = window.performance.now();if (n) { + null === e._gatheringStartedTimestamp && (e._gatheringStartedTimestamp = r);var i = n.protocol;if ("string" == typeof i) if ("tcp" === (i = i.toLowerCase()) || "ssltcp" === i) { + if (e.webrtcIceTcpDisable) return; + } else if ("udp" === i && e.webrtcIceUdpDisable) return; + } else if (!e._gatheringReported) { + var o = e.isP2P ? "p2p.ice." : "ice.";o += e.isInitiator ? "initiator" : "responder", o += ".gatheringDuration", v.a.analytics.sendEvent(o, { value: r - e._gatheringStartedTimestamp }), e._gatheringReported = !0; + }e.sendIceCandidate(n); + } + }, this.peerconnection.onsignalingstatechange = function () { + e.peerconnection && ("stable" === e.peerconnection.signalingState ? e.wasstable = !0 : "closed" !== e.peerconnection.signalingState && "closed" !== e.peerconnection.connectionState || e.closed || e.room.eventEmitter.emit(y.a.SUSPEND_DETECTED, e)); + }, this.peerconnection.oniceconnectionstatechange = function () { + if (e.peerconnection && e._assertNotEnded("oniceconnectionstatechange")) { + var t = window.performance.now();switch (e.isP2P || (e.room.connectionTimes["ice.state." + e.peerconnection.iceConnectionState] = t), E.log("(TIME) ICE " + e.peerconnection.iceConnectionState + " P2P? " + e.isP2P + ":\t", t), v.a.analytics.sendEvent((e.isP2P ? "p2p.ice." : "ice.") + e.peerconnection.iceConnectionState, { value: t }), e.room.eventEmitter.emit(y.a.ICE_CONNECTION_STATE_CHANGED, e, e.peerconnection.iceConnectionState), e.peerconnection.iceConnectionState) {case "checking": + e._iceCheckingStartedTimestamp = t;break;case "connected": + if ("stable" === e.peerconnection.signalingState && e.isreconnect && e.room.eventEmitter.emit(y.a.CONNECTION_RESTORED, e), !e.wasConnected && e.wasstable) { + var n = e.isP2P ? "p2p.ice." : "ice.";n += e.isInitiator ? "initiator." : "responder.", v.a.analytics.sendEvent(n + "checksDuration", { value: t - e._iceCheckingStartedTimestamp });var r = Math.min(e._iceCheckingStartedTimestamp, e._gatheringStartedTimestamp);e.establishmentDuration = t - r, v.a.analytics.sendEvent(n + "establishmentDuration", { value: e.establishmentDuration }), e.wasConnected = !0, e.room.eventEmitter.emit(y.a.CONNECTION_ESTABLISHED, e); + }e.isreconnect = !1;break;case "disconnected": + if (e.closed) break;e.isreconnect = !0, e.wasstable && e.room.eventEmitter.emit(y.a.CONNECTION_INTERRUPTED, e);break;case "failed": + e.room.eventEmitter.emit(y.a.CONNECTION_ICE_FAILED, e), e.room.eventEmitter.emit(y.a.CONFERENCE_SETUP_FAILED, e, new Error("ICE fail"));} + } + }, this.peerconnection.onnegotiationneeded = function () { + e.room.eventEmitter.emit(y.a.PEERCONNECTION_READY, e); + }, this.signalingLayer.setChatRoom(this.room); + } }, { key: "sendIceCandidate", value: function value(e) { + var t = this, + n = new p.a(this.peerconnection.localDescription.sdp);if (e && !this.lasticecandidate) { + var r = h.a.iceparams(n.media[e.sdpMLineIndex], n.session), + i = h.a.candidateToJingle(e.candidate);if (!r || !i) return l.a.callErrorHandler(new Error("failed to get ice && jcand")), void E.error("failed to get ice && jcand");r.xmlns = "urn:xmpp:jingle:transports:ice-udp:1", this.usedrip ? (0 === this.dripContainer.length && setTimeout(function () { + 0 !== t.dripContainer.length && (t.sendIceCandidates(t.dripContainer), t.dripContainer = []); + }, 20), this.dripContainer.push(e)) : this.sendIceCandidates([e]); + } else E.log("sendIceCandidate: last candidate."), this.lasticecandidate = !0; + } }, { key: "sendIceCandidates", value: function value(e) { + var t = this;if (this._assertNotEnded("sendIceCandidates")) { + E.log("sendIceCandidates", e);for (var n = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "transport-info", initiator: this.initiator, sid: this.sid }), r = new p.a(this.peerconnection.localDescription.sdp), i = 0; i < r.media.length; i++) { + !function (i) { + var o = e.filter(function (e) { + return e.sdpMLineIndex === i; + }), + a = h.a.parseMLine(r.media[i].split("\r\n")[0]);if (o.length > 0) { + var s = h.a.iceparams(r.media[i], r.session);s.xmlns = "urn:xmpp:jingle:transports:ice-udp:1", n.c("content", { creator: t.initiator === t.localJid ? "initiator" : "responder", name: o[0].sdpMid ? o[0].sdpMid : a.media }).c("transport", s);for (var c = 0; c < o.length; c++) { + var u = h.a.candidateToJingle(o[c].candidate);t.failICE && (u.ip = "1.1.1.1"), n.c("candidate", u).up(); + }var l = h.a.findLine(r.media[i], "a=fingerprint:", r.session);if (l) { + var d = h.a.parseFingerprint(l);d.required = !0, n.c("fingerprint", { xmlns: "urn:xmpp:jingle:apps:dtls:0" }).t(d.fingerprint), delete d.fingerprint, n.attrs(d), n.up(); + }n.up(), n.up(); + } + }(i); + }this.connection.sendIQ(n, null, this.newJingleErrorHandler(n), 1e4); + } + } }, { key: "addIceCandidates", value: function value(e) { + var t = this;if ("closed" === this.peerconnection.signalingState) return void E.warn("Ignored add ICE candidate when in closed state");var n = [];if (e.find(">content>transport>candidate").each(function (e, t) { + var r = h.a.candidateFromJingle(t);r = r.replace("\r\n", "").replace("a=", "");var i = new RTCIceCandidate({ sdpMLineIndex: 0, sdpMid: "", candidate: r });n.push(i); + }), !n.length) return void E.error("No ICE candidates to add ?", e[0] && e[0].outerHTML);var r = function r(e) { + var r = !0, + i = !1, + o = void 0;try { + for (var a, s = n[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value;t.peerconnection.addIceCandidate(c, function () { + E.debug("addIceCandidate ok!"); + }, function (e) { + E.error("addIceCandidate failed!", e); + }); + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }e(); + };E.debug("Queued add (" + n.length + ") ICE candidates task..."), this.modificationQueue.push(r); + } }, { key: "readSsrcInfo", value: function value(e) { + var t = this;$(e).find('>description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function (e, n) { + var r = Number(n.getAttribute("ssrc"));t.isP2P ? t.signalingLayer.setSSRCOwner(r, Strophe.getResourceFromJid(t.peerjid)) : $(n).find('>ssrc-info[xmlns="http://jitsi.org/jitmeet"]').each(function (e, n) { + var i = n.getAttribute("owner");i && i.length && (isNaN(r) || r < 0 ? E.warn("Invalid SSRC " + r + " value received for " + i) : t.signalingLayer.setSSRCOwner(r, Strophe.getResourceFromJid(i))); + }); + }); + } }, { key: "readBridgeWebSocketUrl", value: function value(e) { + var t = $(e).find("transport>web-socket").first();1 === t.length && (this.bridgeWebSocketUrl = t[0].getAttribute("url")); + } }, { key: "generateRecvonlySsrc", value: function value() { + this.peerconnection ? this.peerconnection.generateRecvonlySsrc() : E.error("Unable to generate recvonly SSRC - no peerconnection"); + } }, { key: "acceptOffer", value: function value(e, t, n, r) { + var i = this;this.setOfferAnswerCycle(e, function () { + i.sendSessionAccept(t, n); + }, n, r); + } }, { key: "invite", value: function value(e) { + var t = this;if (!this.isInitiator) throw new Error("Trying to invite from the responder session");var n = function n(_n4) { + var r = !0, + i = !1, + o = void 0;try { + for (var a, s = e[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (a = s.next()).done); r = !0) { + var c = a.value;t.peerconnection.addTrack(c); + } + } catch (e) { + i = !0, o = e; + } finally { + try { + !r && s.return && s.return(); + } finally { + if (i) throw o; + } + }t.peerconnection.createOffer(function (e) { + t.sendSessionInitiate(e, _n4, _n4); + }, function (e) { + E.error("Failed to create an offer", e, t.mediaConstraints), _n4(e); + }, t.mediaConstraints); + };this.modificationQueue.push(n, function (e) { + e ? E.error("invite error", e) : E.debug("invite executed - OK"); + }); + } }, { key: "sendSessionInitiate", value: function value(e, t, n) { + var r = this;E.log("createdOffer", e);var i = function i() { + var e = $iq({ to: r.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "session-initiate", initiator: r.initiator, sid: r.sid });new p.a(r.peerconnection.localDescription.sdp).toJingle(e, r.initiator === r.me ? "initiator" : "responder"), e = e.tree(), E.info("Session-initiate: ", e), r.connection.sendIQ(e, function () { + E.info('Got RESULT for "session-initiate"'); + }, function (e) { + E.error('"session-initiate" error', e); + }, 1e4), t(); + };this.peerconnection.setLocalDescription(e, i, function (e) { + E.error("session-init setLocalDescription failed", e), n(e); + }); + } }, { key: "setAnswer", value: function value(e) { + if (!this.isInitiator) throw new Error("Trying to set an answer on the responder session");this.setOfferAnswerCycle(e, function () { + E.info("setAnswer - succeeded"); + }, function (e) { + E.error("setAnswer failed: ", e); + }); + } }, { key: "setOfferAnswerCycle", value: function value(e, n, r, i) { + var o = this, + a = function a(n) { + if (i) { + var r = !0, + a = !1, + s = void 0;try { + for (var c, u = i[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(r = (c = u.next()).done); r = !0) { + var l = c.value;o.peerconnection.addTrack(l); + } + } catch (e) { + a = !0, s = e; + } finally { + try { + !r && u.return && u.return(); + } finally { + if (a) throw s; + } + } + }var d = o._processNewJingleOfferIq(e), + f = o.peerconnection.localDescription.sdp;o._renegotiate(d.raw).then(function () { + if (o.state === b.b && (o.state = b.c, o.isP2P && !o._localVideoActive && o.sendContentModify(o._localVideoActive)), f) { + var e = new p.a(o.peerconnection.localDescription.sdp);o.notifyMySSRCUpdate(new p.a(f), e); + }n(); + }, function (e) { + E.error("Error renegotiating after setting new remote " + (o.isInitiator ? "answer: " : "offer: ") + e, d), t.onJingleFatalError(o, e), n(e); + }); + };this.modificationQueue.push(a, function (e) { + e ? r(e) : n(); + }); + } }, { key: "replaceTransport", value: function value(e, t, n) { + var r = this;this.room.eventEmitter.emit(y.a.ICE_RESTARTING, this);var i = e.clone();e.find(">content[name='data']").remove(), this.setOfferAnswerCycle(e, function () { + r.setOfferAnswerCycle(i, function () { + var e = new p.a(r.peerconnection.localDescription.sdp);r.sendTransportAccept(e, t, n); + }, n); + }, n); + } }, { key: "sendSessionAccept", value: function value(e, t) { + var n = this, + r = new p.a(this.peerconnection.localDescription.sdp), + i = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "session-accept", initiator: this.initiator, responder: this.responder, sid: this.sid });this.webrtcIceTcpDisable && (r.removeTcpCandidates = !0), this.webrtcIceUdpDisable && (r.removeUdpCandidates = !0), this.failICE && (r.failICE = !0), r.toJingle(i, this.initiator === this.localJid ? "initiator" : "responder", null), i = i.tree(), E.info("Sending session-accept", i), this.connection.sendIQ(i, e, this.newJingleErrorHandler(i, function (e) { + t(e), n.room.eventEmitter.emit(y.a.SESSION_ACCEPT_TIMEOUT, n); + }), 1e4); + } }, { key: "sendContentModify", value: function value(e) { + var t = e ? "both" : "none", + n = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "content-modify", initiator: this.initiator, sid: this.sid }).c("content", { name: "video", senders: t });E.info("Sending content-modify, video senders: " + t), this.connection.sendIQ(n, null, this.newJingleErrorHandler(n), 1e4); + } }, { key: "sendTransportAccept", value: function value(e, t, n) { + var r = this, + i = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "transport-accept", initiator: this.initiator, sid: this.sid });e.media.forEach(function (t, n) { + var o = h.a.parseMLine(t.split("\r\n")[0]);i.c("content", { creator: r.initiator === r.localJid ? "initiator" : "responder", name: o.media }), e.transportToJingle(n, i), i.up(); + }), i = i.tree(), E.info("Sending transport-accept: ", i), this.connection.sendIQ(i, t, this.newJingleErrorHandler(i, n), 1e4); + } }, { key: "sendTransportReject", value: function value(e, t) { + var n = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "transport-reject", initiator: this.initiator, sid: this.sid });n = n.tree(), E.info("Sending 'transport-reject", n), this.connection.sendIQ(n, e, this.newJingleErrorHandler(n, t), 1e4); + } }, { key: "terminate", value: function value(e, t, n) { + if (this.state !== b.a) { + if (!n || Boolean(n.sendSessionTerminate)) { + var r = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "session-terminate", initiator: this.initiator, sid: this.sid }).c("reason").c(n && n.reason || "success");n && n.reasonDescription && r.up().c("text").t(n.reasonDescription), r = r.tree(), E.info("Sending session-terminate", r), this.connection.sendIQ(r, e, this.newJingleErrorHandler(r, t), 1e4); + } else E.info("Skipped sending session-terminate for " + this);this.connection.jingle.terminate(this.sid); + } + } }, { key: "onTerminated", value: function value(e, t) { + this.state = b.a, this.establishmentDuration = void 0, E.info("Session terminated " + this, e, t), this.close(); + } }, { key: "_parseSsrcInfoFromSourceAdd", value: function value(e, t) { + var n = [];return $(e).each(function (e, r) { + var i = $(r).attr("name"), + o = "";$(r).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function () { + var e = this.getAttribute("semantics"), + t = $(this).find(">source").map(function () { + return this.getAttribute("ssrc"); + }).get();t.length && (o += "a=ssrc-group:" + e + " " + t.join(" ") + "\r\n"); + }), $(r).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function () { + var e = $(this).attr("ssrc");if (t.containsSSRC(e)) return void E.warn("Source-add request for existing SSRC: " + e);$(this).find(">parameter").each(function () { + o += "a=ssrc:" + e + " " + $(this).attr("name"), $(this).attr("value") && $(this).attr("value").length && (o += ":" + $(this).attr("value")), o += "\r\n"; + }); + }), t.media.forEach(function (e, t) { + h.a.findLine(e, "a=mid:" + i) && (n[t] || (n[t] = ""), n[t] += o); + }); + }), n; + } }, { key: "addRemoteStream", value: function value(e) { + this._addOrRemoveRemoteStream(!0, e); + } }, { key: "removeRemoteStream", value: function value(e) { + this._addOrRemoveRemoteStream(!1, e); + } }, { key: "_addOrRemoveRemoteStream", value: function value(e, t) { + var n = this, + r = e ? "addRemoteStream" : "removeRemoteStream";e && this.readSsrcInfo(t);var i = function (_i3) { + function i(_x6) { + return _i3.apply(this, arguments); + } + + i.toString = function () { + return _i3.toString(); + }; + + return i; + }(function (i) { + if (!n.peerconnection.localDescription || !n.peerconnection.localDescription.sdp) { + var o = r + " - localDescription not ready yet";return E.error(o), void i(o); + }E.log("Processing " + r), E.log("ICE connection state: ", n.peerconnection.iceConnectionState);var a = new p.a(n.peerconnection.localDescription.sdp), + s = new p.a(n.peerconnection.remoteDescription.sdp), + c = e ? n._parseSsrcInfoFromSourceAdd(t, s) : n._parseSsrcInfoFromSourceRemove(t, s), + u = e ? n._processRemoteAddSource(c) : n._processRemoteRemoveSource(c);n._renegotiate(u.raw).then(function () { + var e = new p.a(n.peerconnection.localDescription.sdp);E.log(r + " - OK, SDPs: ", a, e), n.notifyMySSRCUpdate(a, e), i(); + }, function (e) { + E.error(r + " failed:", e), i(e); + }); + });this.modificationQueue.push(i); + } }, { key: "_processQueueTasks", value: function value(e, t) { + e(t); + } }, { key: "_processNewJingleOfferIq", value: function value(e) { + var t = new p.a("");return this.webrtcIceTcpDisable && (t.removeTcpCandidates = !0), this.webrtcIceUdpDisable && (t.removeUdpCandidates = !0), this.failICE && (t.failICE = !0), t.fromJingle(e), this.readSsrcInfo($(e).find(">content")), this.readBridgeWebSocketUrl($(e).find(">content")), t; + } }, { key: "_processRemoteRemoveSource", value: function value(e) { + var t = new p.a(this.peerconnection.remoteDescription.sdp);return e.forEach(function (e, n) { + e = e.split("\r\n"), e.pop(), e.forEach(function (e) { + t.media[n] = t.media[n].replace(e + "\r\n", ""); + }); + }), t.raw = t.session + t.media.join(""), t; + } }, { key: "_processRemoteAddSource", value: function value(e) { + var t = new p.a(this.peerconnection.remoteDescription.sdp);return e.forEach(function (e, n) { + t.media[n] += e; + }), t.raw = t.session + t.media.join(""), t; + } }, { key: "_renegotiate", value: function value(e) { + var t = this, + n = e || this.peerconnection.remoteDescription.sdp;if (!n) return Promise.reject("Can not renegotiate without remote description,- current state: " + this.state);var r = new RTCSessionDescription({ type: this.isInitiator ? "answer" : "offer", sdp: n });return new Promise(function (e, n) { + if ("closed" === t.peerconnection.signalingState) return void n("Attempted to renegotiate in state closed");t.isInitiator ? t._initiatorRenegotiate(r, e, n) : t._responderRenegotiate(r, e, n); + }); + } }, { key: "_responderRenegotiate", value: function value(e, t, n) { + var r = this;E.debug("Renegotiate: setting remote description"), this.peerconnection.setRemoteDescription(e, function () { + E.debug("Renegotiate: creating answer"), r.peerconnection.createAnswer(function (e) { + E.debug("Renegotiate: setting local description"), r.peerconnection.setLocalDescription(e, function () { + t(); + }, function (e) { + n("setLocalDescription failed: " + e); + }); + }, function (e) { + return n("createAnswer failed: " + e); + }, r.mediaConstraints); + }, function (e) { + return n("setRemoteDescription failed: " + e); + }); + } }, { key: "_initiatorRenegotiate", value: function value(e, t, n) { + var r = this;"have-local-offer" === this.peerconnection.signalingState ? (E.debug("Renegotiate: setting remote description"), this.peerconnection.setRemoteDescription(e, function () { + t(); + }, function (e) { + return n("setRemoteDescription failed: " + e); + })) : (E.debug("Renegotiate: creating offer"), this.peerconnection.createOffer(function (i) { + E.debug("Renegotiate: setting local description"), r.peerconnection.setLocalDescription(i, function () { + E.debug("Renegotiate: setting remote description"), r.peerconnection.setRemoteDescription(e, function () { + t(); + }, function (e) { + return n("setRemoteDescription failed: " + e); + }); + }, function (e) { + n("setLocalDescription failed: ", e); + }); + }, function (e) { + return n("createOffer failed: " + e); + }, this.mediaConstraints)); + } }, { key: "replaceTrack", value: function value(e, t) { + var n = this, + r = function r(_r) { + if ("closed" === n.peerconnection.signalingState || "closed" === n.peerconnection.connectionState || n.closed) return void _r();var i = n.peerconnection.localDescription.sdp;!e && t && t.isVideoTrack() ? n.peerconnection.clearRecvonlySsrc() : e && e.isVideoTrack() && !t && (n.peerconnection.clearRecvonlySsrc(), n.peerconnection.generateRecvonlySsrc()), e && n.peerconnection.removeTrack(e), t && n.peerconnection.addTrack(t), (e || t) && n.state === b.c ? n._renegotiate().then(function () { + var e = new p.a(n.peerconnection.localDescription.sdp);n.notifyMySSRCUpdate(new p.a(i), e), _r(); + }, _r) : _r(); + };this.modificationQueue.push(r, function (e) { + e ? E.error("Replace track error:", e) : E.info("Replace track done!"); + }); + } }, { key: "_parseSsrcInfoFromSourceRemove", value: function value(e, t) { + var n = [];return $(e).each(function (e, r) { + var i = $(r).attr("name"), + o = "";$(r).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function () { + var e = this.getAttribute("semantics"), + t = $(this).find(">source").map(function () { + return this.getAttribute("ssrc"); + }).get();t.length && (o += "a=ssrc-group:" + e + " " + t.join(" ") + "\r\n"); + });var a = [];$(r).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function () { + var e = $(this).attr("ssrc");a.push(e); + }), t.media.forEach(function (e, t) { + h.a.findLine(e, "a=mid:" + i) && (n[t] || (n[t] = ""), a.forEach(function (r) { + var i = h.a.findLines(e, "a=ssrc:" + r);i.length && (n[t] += i.join("\r\n") + "\r\n"); + }), n[t] += o); + }); + }), n; + } }, { key: "_verifyNoSSRCChanged", value: function value(e, t) { + var n = new p.a(this.peerconnection.localDescription.sdp), + r = new f.a(t, n), + i = r.getNewMedia();if (Object.keys(i).length) return E.error("Some SSRC were added on " + e, i), !1;r = new f.a(n, t);var o = r.getNewMedia();return !Object.keys(o).length || (E.error("Some SSRCs were removed on " + e, o), !1); + } }, { key: "addTrackAsUnmute", value: function value(e) { + return this._addRemoveTrackAsMuteUnmute(!1, e); + } }, { key: "removeTrackAsMute", value: function value(e) { + return this._addRemoveTrackAsMuteUnmute(!0, e); + } }, { key: "_addRemoveTrackAsMuteUnmute", value: function value(e, t) { + var n = this;if (!t) return Promise.reject('invalid "track" argument value');var r = e ? "removeTrackMute" : "addTrackUnmute", + i = function (_i4) { + function i(_x7) { + return _i4.apply(this, arguments); + } + + i.toString = function () { + return _i4.toString(); + }; + + return i; + }(function (i) { + var o = n.peerconnection;if (!o) return void i("Error: tried " + r + " track with no active peerconnection");var a = o.localDescription.sdp;(e ? o.removeTrackMute.bind(o, t) : o.addTrackUnmute.bind(o, t))() ? a && o.remoteDescription.sdp ? n._renegotiate().then(function () { + n._verifyNoSSRCChanged(r, new p.a(a)), i(); + }, i) : i() : i(r + " failed!"); + });return new Promise(function (e, t) { + n.modificationQueue.push(i, function (n) { + n ? t(n) : e(); + }); + }); + } }, { key: "setMediaTransferActive", value: function value(e, t) { + var n = this;if (!this.peerconnection) return Promise.reject('Can not modify transfer active state, before "initialize" is called');var r = e ? "audio active" : "audio inactive", + i = t ? "video active" : "video inactive";E.info("Queued make " + i + ", " + r + " task...");var o = function o(r) { + var i = n.state === b.c, + o = n.peerconnection.setAudioTransferActive(e);n._localVideoActive !== t && (n._localVideoActive = t, n.isP2P && i && n.sendContentModify(t));var a = n.peerconnection.setVideoTransferActive(n._localVideoActive && n._remoteVideoActive);i && (o || a) ? n._renegotiate().then(r, r) : r(); + };return new Promise(function (e, t) { + n.modificationQueue.push(o, function (n) { + n ? t(n) : e(); + }); + }); + } }, { key: "modifyContents", value: function value(e) { + var n = this, + r = t.parseVideoSenders(e);if (null === r) return void E.error(this + ' - failed to parse video "senders" attribute in"content-modify" action');var i = function i(e) { + n._assertNotEnded("content-modify") && n._modifyRemoteVideoActive(r) ? n._renegotiate().then(e, e) : e(); + };E.debug(this + ' queued "content-modify" task(video senders="' + r + '")'), this.modificationQueue.push(i, function (e) { + e && E.error('"content-modify" failed', e); + }); + } }, { key: "_modifyRemoteVideoActive", value: function value(e) { + var t = "both" === e || "initiator" === e && this.isInitiator || "responder" === e && !this.isInitiator;return t !== this._remoteVideoActive && (E.debug(this + " new remote video active: " + t), this._remoteVideoActive = t), this.peerconnection.setVideoTransferActive(this._localVideoActive && this._remoteVideoActive); + } }, { key: "notifyMySSRCUpdate", value: function value(e, t) { + if (this.state !== b.c) return void E.warn("Skipping SSRC update in '" + this.state + " ' state.");var n = new f.a(t, e), + r = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "source-remove", initiator: this.initiator, sid: this.sid });n.toJingle(r) ? (E.info("Sending source-remove", r.tree()), this.connection.sendIQ(r, null, this.newJingleErrorHandler(r, function (e) { + l.a.callErrorHandler(new Error("Jingle error: " + JSON.stringify(e))); + }), 1e4)) : E.log("removal not necessary"), n = new f.a(e, t);var i = $iq({ to: this.peerjid, type: "set" }).c("jingle", { xmlns: "urn:xmpp:jingle:1", action: "source-add", initiator: this.initiator, sid: this.sid });n.toJingle(i) ? (E.info("Sending source-add", i.tree()), this.connection.sendIQ(i, null, this.newJingleErrorHandler(i, function (e) { + l.a.callErrorHandler(new Error("Jingle error: " + JSON.stringify(e))); + }), 1e4)) : E.log("addition not necessary"); + } }, { key: "newJingleErrorHandler", value: function value(e, t) { + var n = this;return function (r) { + var i = {}, + o = $(r).find("error");if (o.length) { + i.code = o.attr("code");var a = $(r).find("error :first");a.length && (i.reason = a[0].tagName); + }r || (i.reason = "timeout"), i.source = e, e && "function" == typeof e.tree && (i.source = e.tree()), i.source && i.source.outerHTML && (i.source = i.source.outerHTML), i.session = n.toString(), t ? t(i) : n.state === b.a && "item-not-found" === i.reason ? E.debug("Jingle error", i) : l.a.callErrorHandler(new Error("Jingle error: " + JSON.stringify(i))); + }; + } }, { key: "getIceConnectionState", value: function value() { + return this.peerconnection.iceConnectionState; + } }, { key: "close", value: function value() { + this.closed = !0, this.signalingLayer.setChatRoom(null), this.peerconnection && (this.peerconnection.signalingState && "closed" !== this.peerconnection.signalingState || this.peerconnection.connectionState && "closed" !== this.peerconnection.connectionState) && this.peerconnection.close(); + } }, { key: "toString", value: function value() { + return "JingleSessionPC[p2p=" + this.isP2P + ",initiator=" + this.isInitiator + ",sid=" + this.sid + "]"; + } }], [{ key: "onJingleFatalError", value: function value(e, t) { + this.room && (this.room.eventEmitter.emit(y.a.CONFERENCE_SETUP_FAILED, e, t), this.room.eventEmitter.emit(y.a.JINGLE_FATAL_ERROR, e, t)); + } }]), t; + }(d.a);t.a = T; + }).call(t, "modules/xmpp/JingleSessionPC.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t, n) { + u.debug("Updating mline to associate " + n + "rtx ssrc with primary stream, " + t.id);var r = t.id, + i = t.msid, + o = t.cname, + a = e.getRtxSSRC(r);if (a === n) return void u.debug(n + " was already associated with " + r);a && (u.debug(r + " was previously associated with rtx" + a + ", removing all references to it"), e.removeSSRC(a), u.debug("groups before filtering for " + a), u.debug(e.dumpSSRCGroups()), e.removeGroupsWithSSRC(a)), e.addSSRCAttribute({ id: n, attribute: "cname", value: o }), e.addSSRCAttribute({ id: n, attribute: "msid", value: i }), e.addSSRCGroup({ semantics: "FID", ssrcs: r + " " + n }); + }var o = n(0), + a = (n.n(o), n(24)), + s = n(12), + c = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + u = n.i(o.getLogger)(e), + l = function () { + function e() { + r(this, e), this.correspondingRtxSsrcs = new Map(); + }return c(e, [{ key: "clearSsrcCache", value: function value() { + this.correspondingRtxSsrcs.clear(); + } }, { key: "setSsrcCache", value: function value(e) { + u.debug("Setting ssrc cache to ", e), this.correspondingRtxSsrcs = e; + } }, { key: "modifyRtxSsrcs", value: function value(e) { + var t = new a.a(e), + n = t.selectMedia("video");return n ? this.modifyRtxSsrcs2(n) ? t.toRawSDP() : e : (u.error("No 'video' media found in the sdp: " + e), e); + } }, { key: "modifyRtxSsrcs2", value: function value(e) { + if ("recvonly" === e.direction) return u.debug("RtxModifier doing nothing, video m line is recvonly"), !1;if (e.getSSRCCount() < 1) return u.debug("RtxModifier doing nothing, no video ssrcs present"), !1;u.debug("Current ssrc mapping: ", this.correspondingRtxSsrcs);var t = e.getPrimaryVideoSSRCs();u.debug("Parsed primary video ssrcs ", t, " making sure all have rtx streams");var n = !0, + r = !1, + o = void 0;try { + for (var a, c = t[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(n = (a = c.next()).done); n = !0) { + var l = a.value, + d = e.getSSRCAttrValue(l, "msid"), + p = e.getSSRCAttrValue(l, "cname"), + f = this.correspondingRtxSsrcs.get(l);if (f) u.debug("Already have an associated rtx ssrc forvideo ssrc " + l + ": " + f);else { + u.debug("No previously associated rtx ssrc for video ssrc " + l);var h = e.getRtxSSRC(l);h ? (u.debug("Rtx stream " + h + " already existed in the sdp as an rtx stream for " + l), f = h) : (f = s.a.generateSsrc(), u.debug("Generated rtx ssrc " + f + " for ssrc " + l)), u.debug("Caching rtx ssrc " + f + " for video ssrc " + l), this.correspondingRtxSsrcs.set(l, f); + }i(e, { id: l, cname: p, msid: d }, f); + } + } catch (e) { + r = !0, o = e; + } finally { + try { + !n && c.return && c.return(); + } finally { + if (r) throw o; + } + }return !0; + } }, { key: "stripRtx", value: function value(e) { + var t = new a.a(e), + r = t.selectMedia("video");if (!r) return u.error("No 'video' media found in the sdp: " + e), e;if ("recvonly" === r.direction) return u.debug("RtxModifier doing nothing, video m line is recvonly"), e;if (r.getSSRCCount() < 1) return u.debug("RtxModifier doing nothing, no video ssrcs present"), e;if (!r.containsAnySSRCGroups()) return u.debug("RtxModifier doing nothing, no video ssrcGroups present"), e;var i = r.findGroups("FID");r.removeGroupsBySemantics("FID");var o = !0, + s = !1, + c = void 0;try { + for (var l, d = i[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(o = (l = d.next()).done); o = !0) { + var p = l.value, + f = n.i(a.b)(p);r.removeSSRC(f); + } + } catch (e) { + s = !0, c = e; + } finally { + try { + !o && d.return && d.return(); + } finally { + if (s) throw c; + } + }return t.toRawSDP(); + } }]), e; + }();t.a = l; + }).call(t, "modules/xmpp/RtxModifier.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!t) return !1;if (e.length !== t.length) return !1;for (var n = 0, r = e.length; n < r; n++) { + if (e[n] instanceof Array && t[n] instanceof Array) { + if (!e[n].equals(t[n])) return !1; + } else if (e[n] !== t[n]) return !1; + }return !0; + }function i(e, t) { + if (this.mySDP = e, this.otherSDP = t, !e) throw new Error('"mySDP" is undefined!');if (!t) throw new Error('"otherSDP" is undefined!'); + }t.a = i;var o = n(12);i.prototype.getNewMedia = function () { + var e = this.mySDP.getMediaSsrcMap(), + t = this.otherSDP.getMediaSsrcMap(), + n = {};return Object.keys(t).forEach(function (i) { + var o = e[i], + a = t[i];if (!o && a) return void (n[i] = a);Object.keys(a.ssrcs).forEach(function (e) { + -1 === Object.keys(o.ssrcs).indexOf(e) && (n[i] || (n[i] = { mediaindex: a.mediaindex, mid: a.mid, ssrcs: {}, ssrcGroups: [] }), n[i].ssrcs[e] = a.ssrcs[e]); + }), a.ssrcGroups.forEach(function (e) { + for (var t = !1, s = 0; s < o.ssrcGroups.length; s++) { + var c = o.ssrcGroups[s];if (e.semantics === c.semantics && r(e.ssrcs, c.ssrcs)) { + t = !0;break; + } + }t || (n[i] || (n[i] = { mediaindex: a.mediaindex, mid: a.mid, ssrcs: {}, ssrcGroups: [] }), n[i].ssrcGroups.push(e)); + }); + }), n; + }, i.prototype.toJingle = function (e) { + var t = this.getNewMedia(), + n = !1;return Object.keys(t).forEach(function (r) { + n = !0;var i = t[r];e.c("content", { name: i.mid }), e.c("description", { xmlns: "urn:xmpp:jingle:apps:rtp:1", media: i.mid }), Object.keys(i.ssrcs).forEach(function (t) { + var n = i.ssrcs[t];e.c("source", { xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), e.attrs({ ssrc: n.ssrc }), n.lines.forEach(function (t) { + var n = t.indexOf(" "), + r = t.substr(n + 1);if (e.c("parameter"), -1 === r.indexOf(":")) e.attrs({ name: r });else { + var i = r.split(":", 2), + a = i[0], + s = o.a.filterSpecialChars(i[1]);e.attrs({ name: a }), e.attrs({ value: s }); + }e.up(); + }), e.up(); + }), i.ssrcGroups.forEach(function (t) { + t.ssrcs.length && (e.c("ssrc-group", { semantics: t.semantics, xmlns: "urn:xmpp:jingle:apps:rtp:ssma:0" }), t.ssrcs.forEach(function (t) { + e.c("source", { ssrc: t }).up(); + }), e.up()); + }), e.up(), e.up(); + }), n; + }; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }var i = n(0), + o = (n.n(i), n(24)), + a = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + s = n.i(i.getLogger)(e), + c = function () { + function e(t) { + r(this, e), this.clearVideoSsrcCache(), this.logPrefix = t; + }return a(e, [{ key: "clearVideoSsrcCache", value: function value() { + this.cachedPrimarySsrc = null, this.injectRecvOnly = !1; + } }, { key: "setPrimarySsrc", value: function value(e) { + if ("number" != typeof e) throw new Error("Primary SSRC must be a number!");this.cachedPrimarySsrc = e; + } }, { key: "hasPrimarySsrcCached", value: function value() { + return Boolean(this.cachedPrimarySsrc); + } }, { key: "makeVideoPrimarySsrcsConsistent", value: function value(e) { + var t = new o.a(e), + r = t.selectMedia("video");if (!r) return s.error(this.logPrefix + " no 'video' media found in the sdp: " + e), e;if ("recvonly" === r.direction) this.cachedPrimarySsrc && this.injectRecvOnly ? r.addSSRCAttribute({ id: this.cachedPrimarySsrc, attribute: "cname", value: "recvonly-" + this.cachedPrimarySsrc }) : s.info(this.logPrefix + " no SSRC found for the recvonly videostream!");else { + var i = r.getPrimaryVideoSsrc();if (!i) return s.info(this.logPrefix + " sdp-consistency couldn't parse new primary ssrc"), e;if (this.cachedPrimarySsrc) { + s.info(this.logPrefix + " sdp-consistency replacing new ssrc" + i + " with cached " + this.cachedPrimarySsrc), r.replaceSSRC(i, this.cachedPrimarySsrc);var a = !0, + c = !1, + u = void 0;try { + for (var l, d = r.ssrcGroups[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"](); !(a = (l = d.next()).done); a = !0) { + var p = l.value;if ("FID" === p.semantics) { + var f = n.i(o.c)(p), + h = n.i(o.b)(p);f === i && (p.ssrcs = this.cachedPrimarySsrc + " " + h); + } + } + } catch (e) { + c = !0, u = e; + } finally { + try { + !a && d.return && d.return(); + } finally { + if (c) throw u; + } + } + } else this.cachedPrimarySsrc = i, s.info(this.logPrefix + " sdp-consistency caching primary ssrc" + this.cachedPrimarySsrc);this.injectRecvOnly = !0; + }return t.toRawSDP(); + } }]), e; + }();t.a = c; + }).call(t, "modules/xmpp/SdpConsistency.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(4)), + c = n(53), + u = n(137), + l = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + d = n.i(a.getLogger)(e), + p = function (e) { + function t() { + r(this, t);var e = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return e.ssrcOwners = new Map(), e.chatRoom = null, e; + }return o(t, e), l(t, [{ key: "setChatRoom", value: function value(e) { + var t = this, + n = this.chatRoom;this.chatRoom = e, n && (n.removePresenceListener("audiomuted", this._audioMuteHandler), n.removePresenceListener("videomuted", this._videoMuteHandler), n.removePresenceListener("videoType", this._videoTypeHandler)), e && (this._audioMuteHandler = function (e, n) { + t.eventEmitter.emit(c.b, n, s.a, "true" === e.value); + }, e.addPresenceListener("audiomuted", this._audioMuteHandler), this._videoMuteHandler = function (e, n) { + t.eventEmitter.emit(c.b, n, s.b, "true" === e.value); + }, e.addPresenceListener("videomuted", this._videoMuteHandler), this._videoTypeHandler = function (e, n) { + t.eventEmitter.emit(c.a, n, e.value); + }, e.addPresenceListener("videoType", this._videoTypeHandler)); + } }, { key: "getPeerMediaInfo", value: function value(e, t) { + if (this.chatRoom) return this.chatRoom.getMediaPresenceInfo(e, t);d.error("Requested peer media info, before room was set"); + } }, { key: "getSSRCOwner", value: function value(e) { + return this.ssrcOwners.get(e); + } }, { key: "setSSRCOwner", value: function value(e, t) { + if ("number" != typeof e) throw new TypeError("SSRC(" + e + ") must be a number");this.ssrcOwners.set(e, t); + } }]), t; + }(u.a);t.a = p; + }).call(t, "modules/xmpp/SignalingLayerImpl.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e) { + var t = 1;return function (n) { + if (n) return void (t = 1);var r = Math.pow(2, t - 1);return t += 1, r * e; + }; + }function i(e, t, n, i) { + function o(e) { + if (e.data && e.data.sessionId) { + if (e.origin !== window.location.origin) return void s.warn("Ignoring sessionId from different origin: " + e.origin);a.a.setSessionId(e.data.sessionId); + } + }this.roomName = e, this.xmppService = t, this.getNextTimeout = r(1e3), this.getNextErrorTimeout = r(1e3), this.externalAuthEnabled = !1, this.options = i, this.sipGatewayEnabled = this.options.connection.hosts && void 0 !== this.options.connection.hosts.call_control, this.eventEmitter = n, this.connection = this.xmppService.connection, window.addEventListener ? window.addEventListener("message", o, !1) : window.attachEvent("onmessage", o); + }t.a = i;var o = n(2), + a = n(29), + s = n(0).getLogger(e), + c = n(7), + u = n(54), + l = n(3);i.prototype.isExternalAuthEnabled = function () { + return this.externalAuthEnabled; + }, i.prototype.isSipGatewayEnabled = function () { + return this.sipGatewayEnabled; + }, i.prototype.onMucMemberLeft = function (e) { + s.info("Someone left is it focus ? " + e), "focus" === Strophe.getResourceFromJid(e) && (s.info("Focus has left the room - leaving conference"), this.eventEmitter.emit(c.FOCUS_LEFT)); + }, i.prototype.setFocusUserJid = function (e) { + this.focusUserJid || (this.focusUserJid = e, s.info("Focus jid set to: " + this.focusUserJid)); + }, i.prototype.getFocusUserJid = function () { + return this.focusUserJid; + }, i.prototype.getFocusComponent = function () { + var e = this.options.connection.hosts.focus;return e || (e = "focus." + this.options.connection.hosts.domain), e; + }, i.prototype.createConferenceIq = function () { + var e = $iq({ to: this.getFocusComponent(), type: "set" }), + t = a.a.getSessionId(), + n = a.a.getMachineId();s.info("Session ID: " + t + " machine UID: " + n), e.c("conference", { xmlns: "http://jitsi.org/protocol/focus", room: this.roomName, "machine-uid": n }), t && e.attrs({ "session-id": t }), void 0 !== this.options.connection.enforcedBridge && e.c("property", { name: "enforcedBridge", value: this.options.connection.enforcedBridge }).up(), void 0 !== this.options.connection.hosts && void 0 !== this.options.connection.hosts.call_control && e.c("property", { name: "call_control", value: this.options.connection.hosts.call_control }).up(), void 0 !== this.options.conference.channelLastN && e.c("property", { name: "channelLastN", value: this.options.conference.channelLastN }).up(), e.c("property", { name: "disableRtx", value: Boolean(this.options.conference.disableRtx) }).up(), e.c("property", { name: "enableLipSync", value: !1 !== this.options.connection.enableLipSync }).up(), void 0 !== this.options.conference.audioPacketDelay && e.c("property", { name: "audioPacketDelay", value: this.options.conference.audioPacketDelay }).up(), this.options.conference.startBitrate && e.c("property", { name: "startBitrate", value: this.options.conference.startBitrate }).up(), this.options.conference.minBitrate && e.c("property", { name: "minBitrate", value: this.options.conference.minBitrate }).up();var r = void 0;switch (this.options.conference.openBridgeChannel) {case "datachannel":case !0:case void 0: + r = !0;break;case "websocket": + r = !1;}return r && !o.a.supportsDataChannels() && (r = !1), e.c("property", { name: "openSctp", value: r }).up(), void 0 !== this.options.conference.startAudioMuted && e.c("property", { name: "startAudioMuted", value: this.options.conference.startAudioMuted }).up(), void 0 !== this.options.conference.startVideoMuted && e.c("property", { name: "startVideoMuted", value: this.options.conference.startVideoMuted }).up(), void 0 !== this.options.conference.stereo && e.c("property", { name: "stereo", value: this.options.conference.stereo }).up(), void 0 !== this.options.conference.useRoomAsSharedDocumentName && e.c("property", { name: "useRoomAsSharedDocumentName", value: this.options.conference.useRoomAsSharedDocumentName }).up(), e.up(), e; + }, i.prototype.parseSessionId = function (e) { + var t = $(e).find("conference").attr("session-id");t && (s.info("Received sessionId: " + t), a.a.setSessionId(t)); + }, i.prototype.parseConfigOptions = function (e) { + this.setFocusUserJid($(e).find("conference").attr("focusjid"));var t = $(e).find(">conference>property[name='authentication'][value='true']").length > 0;s.info("Authentication enabled: " + t), this.externalAuthEnabled = $(e).find(">conference>property[name='externalAuth'][value='true']").length > 0, s.info("External authentication enabled: " + this.externalAuthEnabled), this.externalAuthEnabled || this.parseSessionId(e);var n = $(e).find(">conference").attr("identity");this.eventEmitter.emit(u.IDENTITY_UPDATED, t, n), $(e).find(">conference>property[name='sipGatewayEnabled'][value='true']").length && (this.sipGatewayEnabled = !0), s.info("Sip gateway enabled: " + this.sipGatewayEnabled); + }, i.prototype.allocateConferenceFocus = function (e) { + var t = this;this.setFocusUserJid(this.options.connection.focusUserJid), this.connection.sendIQ(this.createConferenceIq(), function (n) { + return t._allocateConferenceFocusSuccess(n, e); + }, function (n) { + return t._allocateConferenceFocusError(n, e); + }), this.connection.flush(); + }, i.prototype._allocateConferenceFocusError = function (e, t) { + var n = this, + r = $(e).find(">error>session-invalid").length;if (r && (s.info("Session expired! - removing"), a.a.clearSessionId()), $(e).find(">error>graceful-shutdown").length) return void this.eventEmitter.emit(c.GRACEFUL_SHUTDOWN);var i = $(e).find(">error>reservation-error");if (i.length) { + var o = i.attr("error-code"), + u = $(e).find(">error>text"), + d = void 0;return u && (d = u.text()), void this.eventEmitter.emit(c.RESERVATION_ERROR, o, d); + }if ($(e).find(">error>not-authorized").length) return s.warn("Unauthorized to start the conference", e), Strophe.getDomainFromJid(e.getAttribute("to")) !== this.options.connection.hosts.anonymousdomain && (this.externalAuthEnabled = !0), void this.eventEmitter.emit(c.AUTHENTICATION_REQUIRED);var p = this.getNextErrorTimeout(), + f = "Focus error, retry after " + p;l.callErrorHandler(new Error(f)), s.error(f, e);var h = this.getFocusComponent(), + m = p / 1e3;r || this.eventEmitter.emit(c.FOCUS_DISCONNECTED, h, m), this.getNextTimeout(!0), window.setTimeout(function () { + return n.allocateConferenceFocus(t); + }, p); + }, i.prototype._allocateConferenceFocusSuccess = function (e, t) { + var n = this;if (this.parseConfigOptions(e), this.getNextErrorTimeout(!0), "true" === $(e).find("conference").attr("ready")) this.getNextTimeout(!0), t();else { + var r = this.getNextTimeout();s.info("Waiting for the focus... " + r), window.setTimeout(function () { + return n.allocateConferenceFocus(t); + }, r); + } + }, i.prototype.authenticate = function () { + var e = this;return new Promise(function (t, n) { + e.connection.sendIQ(e.createConferenceIq(), function (n) { + e.parseSessionId(n), t(); + }, function (e) { + var t = $(e).find(">error").attr("code");n(e, t); + }); + }); + }, i.prototype.getLoginUrl = function (e, t) { + this._getLoginUrl(!1, e, t); + }, i.prototype._getLoginUrl = function (e, t, n) { + function r(e, t) { + l.callErrorHandler(new Error(e)), s.error(e, t), n(t); + }var i = $iq({ to: this.getFocusComponent(), type: "get" }), + o = { xmlns: "http://jitsi.org/protocol/focus", room: this.roomName, "machine-uid": a.a.getMachineId() }, + c = "auth url";e && (o.popup = !0, c = "POPUP " + c), i.c("login-url", o), this.connection.sendIQ(i, function (e) { + var n = $(e).find("login-url").attr("url");n = decodeURIComponent(n), n ? (s.info("Got " + c + ": " + n), t(n)) : r("Failed to get " + c + " from the focus", e); + }, r.bind(void 0, "Get " + c + " error")); + }, i.prototype.getPopupLoginUrl = function (e, t) { + this._getLoginUrl(!0, e, t); + }, i.prototype.logout = function (e) { + var t = $iq({ to: this.getFocusComponent(), type: "set" }), + n = a.a.getSessionId();if (!n) return void e();t.c("logout", { xmlns: "http://jitsi.org/protocol/focus", "session-id": n }), this.connection.sendIQ(t, function (t) { + var n = $(t).find("logout").attr("logout-url");n && (n = decodeURIComponent(n)), s.info("Log out OK, url: " + n, t), a.a.clearSessionId(), e(n); + }, function (e) { + l.callErrorHandler(new Error("Logout error")), s.error("Logout error", e); + }); + }; + }).call(t, "modules/xmpp/moderator.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t, n, i, o, a) { + this.eventEmitter = t, this.connection = n, this.state = null, this.focusMucJid = i, this.jirecon = o, this.url = null, this.type = e, this._isSupported = !(e === r.types.JIRECON && !this.jirecon || e !== r.types.JIBRI && e !== r.types.COLIBRI), this.jireconRid = null, this.roomjid = a; + }t.a = r;var i = n(0), + o = (n.n(i), n.i(i.getLogger)(e)), + a = n(7), + s = n(45), + c = n(3);r.types = { COLIBRI: "colibri", JIRECON: "jirecon", JIBRI: "jibri" }, r.status = { ON: "on", OFF: "off", AVAILABLE: "available", UNAVAILABLE: "unavailable", PENDING: "pending", RETRYING: "retrying", BUSY: "busy", FAILED: "failed" }, r.action = { START: "start", STOP: "stop" }, r.prototype.handleJibriPresence = function (e) { + var t = e.attributes;if (t) { + var n = t.status;o.log("Handle jibri presence : ", n), n !== this.state && ("undefined" === n ? this.state = r.status.UNAVAILABLE : n === r.status.OFF ? this.state && "undefined" !== this.state && this.state !== r.status.UNAVAILABLE ? this.state = r.status.OFF : this.state = r.status.AVAILABLE : this.state = n, this.eventEmitter.emit(a.RECORDER_STATE_CHANGED, this.state)); + } + }, r.prototype.setRecordingJibri = function (e, t, n) { + var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};e === this.state && n(s.INVALID_STATE);var a = $iq({ to: this.focusMucJid, type: "set" }).c("jibri", { xmlns: "http://jitsi.org/protocol/jibri", action: e === r.status.ON ? r.action.START : r.action.STOP, streamid: i.streamId }).up();o.log("Set jibri recording: " + e, a.nodeTree), o.log(a.nodeTree), this.connection.sendIQ(a, function (e) { + o.log("Result", e);var n = $(e).find("jibri");t(n.attr("state"), n.attr("url")); + }, function (e) { + o.log("Failed to start recording, error: ", e), n(e); + }); + }, r.prototype.setRecordingJirecon = function (e, t, n) { + e === this.state && n(new Error("Invalid state!"));var i = $iq({ to: this.jirecon, type: "set" }).c("recording", { xmlns: "http://jitsi.org/protocol/jirecon", action: e === r.status.ON ? r.action.START : r.action.STOP, mucjid: this.roomjid });e === r.status.OFF && i.attrs({ rid: this.jireconRid }), o.log("Start recording");var a = this;this.connection.sendIQ(i, function (n) { + a.jireconRid = $(n).find("recording").attr("rid"), o.log("Recording " + (e === r.status.ON ? "started" : "stopped") + "(jirecon)" + n), a.state = e, e === r.status.OFF && (a.jireconRid = null), t(e); + }, function (e) { + o.log("Failed to start recording, error: ", e), n(e); + }); + }, r.prototype.setRecordingColibri = function (e, t, n, r) { + var i = $iq({ to: this.focusMucJid, type: "set" });i.c("conference", { xmlns: "http://jitsi.org/protocol/colibri" }), i.c("recording", { state: e, token: r.token });var a = this;this.connection.sendIQ(i, function (n) { + o.log('Set recording "', e, '". Result:', n);var r = $(n).find(">conference>recording"), + i = r.attr("state");a.state = i, t(i), "pending" === i && a.connection.addHandler(function (e) { + var n = $(e).find("recording").attr("state");n && (a.state = i, t(n)); + }, "http://jitsi.org/protocol/colibri", "iq", null, null, null); + }, function (e) { + o.warn(e), n(e); + }); + }, r.prototype.setRecording = function () { + switch (this.type) {case r.types.JIRECON: + this.setRecordingJirecon.apply(this, arguments);break;case r.types.COLIBRI: + this.setRecordingColibri.apply(this, arguments);break;case r.types.JIBRI: + this.setRecordingJibri.apply(this, arguments);break;default: + var e = "Unknown recording type!";c.callErrorHandler(new Error(e)), o.error(e);} + }, r.prototype.toggleRecording = function (e, t) { + var n = this.state;if (n === r.status.UNAVAILABLE || n === r.status.FAILED ? t(r.status.FAILED, s.RECORDER_UNAVAILABLE) : n === r.status.BUSY && t(r.status.BUSY, s.RECORDER_BUSY), (n === r.status.OFF || n === r.status.AVAILABLE) && (!e.token && this.type === r.types.COLIBRI || !e.streamId && this.type === r.types.JIBRI)) return t(r.status.FAILED, s.NO_TOKEN), void o.error("No token passed!");var i = n === r.status.AVAILABLE || n === r.status.OFF ? r.status.ON : r.status.OFF, + a = this;o.log("Toggle recording (old state, new state): ", n, i), this.setRecording(i, function (e, r) { + e && e !== n && (a.state = e, a.url = r, t(e)); + }, function (e) { + return t(r.status.FAILED, e); + }, e); + }, r.prototype.isSupported = function () { + return this._isSupported; + }, r.prototype.getState = function () { + return this.state; + }, r.prototype.getURL = function () { + return this.url; + }; + }).call(t, "modules/xmpp/recording.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(121)), + c = n(20), + u = n(7), + l = n.n(u), + d = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + p = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + f = n.i(a.getLogger)(e), + h = function (e) { + function t(e) { + r(this, t);var n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.xmpp = e, n.rooms = {}, n; + }return o(t, e), d(t, [{ key: "init", value: function value(e) { + p(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "init", this).call(this, e), this.connection.addHandler(this.onPresence.bind(this), null, "presence", null, null, null, null), this.connection.addHandler(this.onPresenceUnavailable.bind(this), null, "presence", "unavailable", null), this.connection.addHandler(this.onPresenceError.bind(this), null, "presence", "error", null), this.connection.addHandler(this.onMessage.bind(this), null, "message", null, null), this.connection.addHandler(this.onMute.bind(this), "http://jitsi.org/jitmeet/audio", "iq", "set", null, null); + } }, { key: "createRoom", value: function value(e, t, n) { + var r = Strophe.getBareJidFromJid(e);if (this.rooms[r]) { + var i = "You are already in the room!";throw f.error(i), new Error(i); + }return this.rooms[r] = new s.a(this.connection, e, t, this.xmpp, n), this.eventEmitter.emit(l.a.EMUC_ROOM_ADDED, this.rooms[r]), this.rooms[r]; + } }, { key: "doLeave", value: function value(e) { + this.eventEmitter.emit(l.a.EMUC_ROOM_REMOVED, this.rooms[e]), delete this.rooms[e]; + } }, { key: "onPresence", value: function value(e) { + var t = e.getAttribute("from");if (e.getAttribute("type")) return !0;var n = this.rooms[Strophe.getBareJidFromJid(t)];return n ? ($(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="201"]').length && n.createNonAnonymousRoom(), n.onPresence(e), !0) : void 0; + } }, { key: "onPresenceUnavailable", value: function value(e) { + var t = e.getAttribute("from"), + n = this.rooms[Strophe.getBareJidFromJid(t)];if (n) return n.onPresenceUnavailable(e, t), !0; + } }, { key: "onPresenceError", value: function value(e) { + var t = e.getAttribute("from"), + n = this.rooms[Strophe.getBareJidFromJid(t)];if (n) return n.onPresenceError(e, t), !0; + } }, { key: "onMessage", value: function value(e) { + var t = e.getAttribute("from"), + n = this.rooms[Strophe.getBareJidFromJid(t)];if (n) return n.onMessage(e, t), !0; + } }, { key: "onMute", value: function value(e) { + var t = e.getAttribute("from"), + n = this.rooms[Strophe.getBareJidFromJid(t)];if (n) return n.onMute(e), !0; + } }]), t; + }(c.b);t.a = function (e) { + Strophe.addConnectionPlugin("emuc", new h(e)); + }; + }).call(t, "modules/xmpp/strophe.emuc.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e, t, n) { + Strophe.addConnectionPlugin("jingle", new S(e, t, n)); + }t.a = a;var s = n(0), + c = (n.n(s), n(123)), + u = n(7), + l = n.n(u), + d = n(3), + p = n.n(d), + f = n(19), + h = n.n(f), + m = n(6), + v = n(20), + g = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + y = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + b = n.i(s.getLogger)(e), + S = function (e) { + function t(e, n, o) { + r(this, t);var a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return a.xmpp = e, a.eventEmitter = n, a.sessions = {}, a.jvbIceConfig = { iceServers: [] }, a.p2pIceConfig = { iceServers: [] }, Array.isArray(o) && (b.info("Configured STUN servers: ", o), a.p2pIceConfig.iceServers = o), a.mediaConstraints = { mandatory: { OfferToReceiveAudio: !0, OfferToReceiveVideo: !0 } }, a; + }return o(t, e), g(t, [{ key: "init", value: function value(e) { + y(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "init", this).call(this, e), this.connection.addHandler(this.onJingle.bind(this), "urn:xmpp:jingle:1", "iq", "set", null, null); + } }, { key: "onJingle", value: function value(e) { + var t = $(e).find("jingle").attr("sid"), + n = $(e).find("jingle").attr("action"), + r = e.getAttribute("from"), + i = $iq({ type: "result", to: r, id: e.getAttribute("id") });b.log("on jingle " + n + " from " + r, e);var o = this.sessions[t];if ("session-initiate" !== n) { + if (!o) return i.attrs({ type: "error" }), i.c("error", { type: "cancel" }).c("item-not-found", { xmlns: "urn:ietf:params:xml:ns:xmpp-stanzas" }).up().c("unknown-session", { xmlns: "urn:xmpp:jingle:errors:1" }), b.warn("invalid session id", e), this.connection.send(i), !0;if (r !== o.peerjid) return b.warn("jid mismatch for session id", t, o.peerjid, e), i.attrs({ type: "error" }), i.c("error", { type: "cancel" }).c("item-not-found", { xmlns: "urn:ietf:params:xml:ns:xmpp-stanzas" }).up().c("unknown-session", { xmlns: "urn:xmpp:jingle:errors:1" }), this.connection.send(i), !0; + } else if (void 0 !== o) return i.attrs({ type: "error" }), i.c("error", { type: "cancel" }).c("service-unavailable", { xmlns: "urn:ietf:params:xml:ns:xmpp-stanzas" }).up(), b.warn("duplicate session id", t, e), this.connection.send(i), !0;var a = window.performance.now();switch (n) {case "session-initiate": + b.log("(TIME) received session-initiate:\t", a);var s = $(e).find("jingle>startmuted");if (s && s.length > 0) { + var u = s.attr("audio"), + d = s.attr("video");this.eventEmitter.emit(l.a.START_MUTED_FROM_FOCUS, "true" === u, "true" === d); + }var f = "focus" !== Strophe.getResourceFromJid(r);b.info("Marking session from " + r + " as " + (f ? "" : "*not*") + " P2P"), o = new c.a($(e).find("jingle").attr("sid"), $(e).attr("to"), r, this.connection, this.mediaConstraints, f ? this.p2pIceConfig : this.jvbIceConfig, f, !1, this.xmpp.options), this.sessions[o.sid] = o, this.eventEmitter.emit(l.a.CALL_INCOMING, o, $(e).find(">jingle"), a), m.a.analytics.sendEvent("xmpp.session-initiate", { value: a });break;case "session-accept": + this.eventEmitter.emit(l.a.CALL_ACCEPTED, o, $(e).find(">jingle"));break;case "content-modify": + o.modifyContents($(e).find(">jingle"));break;case "transport-info": + this.eventEmitter.emit(l.a.TRANSPORT_INFO, o, $(e).find(">jingle"));break;case "session-terminate": + b.log("terminating...", o.sid);var h = null, + v = null;$(e).find(">jingle>reason").length && (h = $(e).find(">jingle>reason>:first")[0].tagName, v = $(e).find(">jingle>reason>text").text()), this.terminate(o.sid, h, v), this.eventEmitter.emit(l.a.CALL_ENDED, o, h, v);break;case "transport-replace": + b.info("(TIME) Start transport replace", a), m.a.analytics.sendEvent("xmpp.transport-replace.start", { value: a }), o.replaceTransport($(e).find(">jingle"), function () { + var e = window.performance.now();b.info("(TIME) Transport replace success!", e), m.a.analytics.sendEvent("xmpp.transport-replace.success", { value: e }); + }, function (e) { + p.a.callErrorHandler(e), b.error("Transport replace failed", e), o.sendTransportReject(); + });break;case "addsource":case "source-add": + o.addRemoteStream($(e).find(">jingle>content"));break;case "removesource":case "source-remove": + o.removeRemoteStream($(e).find(">jingle>content"));break;default: + b.warn("jingle action not implemented", n), i.attrs({ type: "error" }), i.c("error", { type: "cancel" }).c("bad-request", { xmlns: "urn:ietf:params:xml:ns:xmpp-stanzas" }).up();}return this.connection.send(i), !0; + } }, { key: "newP2PJingleSession", value: function value(e, t) { + var n = new c.a(h.a.randomHexString(12), e, t, this.connection, this.mediaConstraints, this.p2pIceConfig, !0, !0, this.xmpp.options);return this.sessions[n.sid] = n, n; + } }, { key: "terminate", value: function value(e, t, n) { + this.sessions.hasOwnProperty(e) && ("ended" !== this.sessions[e].state && this.sessions[e].onTerminated(t, n), delete this.sessions[e]); + } }, { key: "getStunAndTurnCredentials", value: function value() { + var e = this;this.connection.sendIQ($iq({ type: "get", to: this.connection.domain }).c("services", { xmlns: "urn:xmpp:extdisco:1" }).c("service", { host: "turn." + this.connection.domain }), function (t) { + var n = [];$(t).find(">services>service").each(function (e, t) { + t = $(t);var r = {}, + i = t.attr("type");switch (i) {case "stun": + r.url = "stun:" + t.attr("host"), t.attr("port") && (r.url += ":" + t.attr("port")), n.push(r);break;case "turn":case "turns": + r.url = i + ":";var o = t.attr("username");o && (navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) && parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10) < 28 ? r.url += o + "@" : r.username = o), r.url += t.attr("host");var a = t.attr("port");a && "3478" !== a && (r.url += ":" + t.attr("port"));var s = t.attr("transport");s && "udp" !== s && (r.url += "?transport=" + s), r.credential = t.attr("password") || r.credential, n.push(r);} + });var r = e.xmpp.options;r.useStunTurn && (e.jvbIceConfig.iceServers = n), r.p2p && r.p2p.useStunTurn && (e.p2pIceConfig.iceServers = n); + }, function (e) { + b.warn("getting turn credentials failed", e), b.warn("is mod_turncredentials or similar installed?"); + }); + } }, { key: "getLog", value: function value() { + var e = this, + t = {};return Object.keys(this.sessions).forEach(function (n) { + var r = e.sessions[n], + i = r.peerconnection;i && i.updateLog && (t["jingle_" + n] = { updateLog: i.updateLog, stats: i.stats, url: window.location.href }); + }), t; + } }]), t; + }(v.a); + }).call(t, "modules/xmpp/strophe.jingle.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(20), + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + u = function (e) { + function t() { + r(this, t);var e = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return e.log = [], e; + }return o(t, e), s(t, [{ key: "init", value: function value(e) { + c(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "init", this).call(this, e), this.connection.rawInput = this.logIncoming.bind(this), this.connection.rawOutput = this.logOutgoing.bind(this); + } }, { key: "logIncoming", value: function value(e) { + this.log.push([new Date().getTime(), "incoming", e]); + } }, { key: "logOutgoing", value: function value(e) { + this.log.push([new Date().getTime(), "outgoing", e]); + } }]), t; + }(a.a);t.a = function () { + Strophe.addConnectionPlugin("logger", new u()); + }; + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(20)), + c = n(3), + u = n.n(c), + l = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + d = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + p = n.i(a.getLogger)(e), + f = function (e) { + function t(e) { + r(this, t);var n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.failedPings = 0, n.xmpp = e, n; + }return o(t, e), l(t, [{ key: "init", value: function value(e) { + d(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "init", this).call(this, e), Strophe.addNamespace("PING", "urn:xmpp:ping"); + } }, { key: "ping", value: function value(e, t, n, r) { + var i = $iq({ type: "get", to: e });i.c("ping", { xmlns: Strophe.NS.PING }), this.connection.sendIQ(i, t, n, r); + } }, { key: "hasPingSupport", value: function value(e, t) { + this.xmpp.caps.getFeatures(e).then(function (e) { + return t(e.has("urn:xmpp:ping")); + }, function (e) { + var n = "Ping feature discovery error";u.a.callErrorHandler(new Error(n + ": " + e)), p.error(n, e), t(!1); + }); + } }, { key: "startInterval", value: function value(e) { + var t = this, + n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1e4;if (this.intervalId) { + var r = "Ping task scheduled already";return u.a.callErrorHandler(new Error(r)), void p.error(r); + }this.intervalId = window.setInterval(function () { + t.ping(e, function () { + t.failedPings = 0; + }, function (e) { + t.failedPings += 1;var n = "Ping " + (e ? "error" : "timeout");t.failedPings >= 3 ? (u.a.callErrorHandler(new Error(n)), p.error(n, e)) : p.warn(n, e); + }, 15e3); + }, n), p.info("XMPP pings will be sent every " + n + " ms"); + } }, { key: "stopInterval", value: function value() { + this.intervalId && (window.clearInterval(this.intervalId), this.intervalId = null, this.failedPings = 0, p.info("Ping interval cleared")); + } }]), t; + }(s.a);t.a = function (e) { + Strophe.addConnectionPlugin("ping", new f(e)); + }; + }).call(t, "modules/xmpp/strophe.ping.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(0), + s = (n.n(a), n(20)), + c = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + u = function e(t, n, r) { + null === t && (t = Function.prototype);var i = Object.getOwnPropertyDescriptor(t, n);if (void 0 === i) { + var o = Object.getPrototypeOf(t);return null === o ? void 0 : e(o, n, r); + }if ("value" in i) return i.value;var a = i.get;return void 0 !== a ? a.call(r) : void 0; + }, + l = n.i(a.getLogger)(e), + d = function (e) { + function t() { + return r(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)); + }return o(t, e), c(t, [{ key: "init", value: function value(e) { + u(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "init", this).call(this, e), this.connection.addHandler(this.onRayo.bind(this), "urn:xmpp:rayo:1", "iq", "set", null, null); + } }, { key: "onRayo", value: function value(e) { + l.info("Rayo IQ", e); + } }, { key: "dial", value: function value(e, t, n, r, i) { + var o = this;return new Promise(function (a, s) { + if (!i) return void s(new Error("Internal error!"));var c = $iq({ type: "set", to: i });c.c("dial", { xmlns: "urn:xmpp:rayo:1", to: e, from: t }), c.c("header", { name: "JvbRoomName", value: n }).up(), r && r.length && c.c("header", { name: "JvbRoomPassword", value: r }).up(), o.connection.sendIQ(c, function (e) { + l.info("Dial result ", e);var t = $(e).find("ref").attr("uri");o.callResource = t.substr("xmpp:".length), l.info("Received call resource: " + o.callResource), a(); + }, function (e) { + l.info("Dial error ", e), s(e); + }); + }); + } }, { key: "hangup", value: function value() { + var e = this;return new Promise(function (t, n) { + if (!e.callResource) return n(new Error("No call in progress")), void l.warn("No call in progress");var r = $iq({ type: "set", to: e.callResource });r.c("hangup", { xmlns: "urn:xmpp:rayo:1" }), e.connection.sendIQ(r, function (n) { + l.info("Hangup result ", n), e.callResource = null, t(); + }, function (t) { + l.info("Hangup error ", t), e.callResource = null, n(new Error("Hangup error ")); + }); + }); + } }]), t; + }(s.a);t.a = function () { + Strophe.addConnectionPlugin("rayo", new d()); + }; + }).call(t, "modules/xmpp/strophe.rayo.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + var r = n(0), + i = (n.n(r), n(3)), + o = n.n(i), + a = n.i(r.getLogger)(e), + s = -1, + c = /request id \d+.\d+ got 200/, + u = /request errored, status: (\d+), number of errors: \d+/;t.a = function () { + Strophe.log = function (e, t) { + switch (a.trace("Strophe", e, t), "string" == typeof t && -1 !== t.indexOf("Request ") && -1 !== t.indexOf("timed out (secondary), restarting") && (e = Strophe.LogLevel.WARN), e) {case Strophe.LogLevel.DEBUG: + -1 !== s && c.test(t) && (a.debug("Reset lastErrorStatus"), s = -1);break;case Strophe.LogLevel.WARN: + a.warn("Strophe: " + t);var n = u.exec(t);n && 2 === n.length && (s = parseInt(n[1], 10), a.debug("lastErrorStatus set to: " + s));break;case Strophe.LogLevel.ERROR:case Strophe.LogLevel.FATAL: + t = "Strophe: " + t, o.a.callErrorHandler(new Error(t)), a.error(t);} + }, Strophe.getLastErrorStatus = function () { + return s; + }, Strophe.getStatusString = function (e) { + switch (e) {case Strophe.Status.ERROR: + return "ERROR";case Strophe.Status.CONNECTING: + return "CONNECTING";case Strophe.Status.CONNFAIL: + return "CONNFAIL";case Strophe.Status.AUTHENTICATING: + return "AUTHENTICATING";case Strophe.Status.AUTHFAIL: + return "AUTHFAIL";case Strophe.Status.CONNECTED: + return "CONNECTED";case Strophe.Status.DISCONNECTED: + return "DISCONNECTED";case Strophe.Status.DISCONNECTING: + return "DISCONNECTING";case Strophe.Status.ATTACHED: + return "ATTACHED";default: + return "unknown";} + }; + }; + }).call(t, "modules/xmpp/strophe.util.js"); + }, function (e, t, n) { + "use strict"; + (function (e) { + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }function a(e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "/http-bind";return e && (t += (-1 === t.indexOf("?") ? "?" : "&") + "token=" + e), new Strophe.Connection(t); + }var s = n(0), + c = (n.n(s), n(19)), + u = n.n(c), + l = n(43), + d = n(27), + p = n(2), + f = n(130), + h = n(131), + m = n(135), + v = n(133), + g = n(134), + y = n(132), + b = n(10), + S = n(120), + E = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + T = n.i(s.getLogger)(e), + _ = function (e) { + function t(e, n) { + r(this, t);var o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return o.connection = null, o.disconnectInProgress = !1, o.connectionTimes = {}, o.forceMuted = !1, o.options = e, o.connectParams = {}, o.token = n, o.authenticatedUser = !1, o._initStrophePlugins(o), o.connection = a(n, e.bosh), o.caps = new S.a(o.connection, o.options.clientNode), o.initFeaturesList(), $(window).on("beforeunload unload", o.disconnect.bind(o)), o; + }return o(t, e), E(t, [{ key: "initFeaturesList", value: function value() { + this.caps.addFeature("urn:xmpp:jingle:1"), this.caps.addFeature("urn:xmpp:jingle:apps:rtp:1"), this.caps.addFeature("urn:xmpp:jingle:transports:ice-udp:1"), this.caps.addFeature("urn:xmpp:jingle:apps:dtls:0"), this.caps.addFeature("urn:xmpp:jingle:transports:dtls-sctp:1"), this.caps.addFeature("urn:xmpp:jingle:apps:rtp:audio"), this.caps.addFeature("urn:xmpp:jingle:apps:rtp:video"), !this.options.disableRtx && p.a.supportsRtx() && this.caps.addFeature("urn:ietf:rfc:4588"), this.caps.addFeature("urn:ietf:rfc:5761"), this.caps.addFeature("urn:ietf:rfc:5888"), p.a.isChrome() && !1 !== this.options.enableLipSync && (T.info("Lip-sync enabled !"), this.caps.addFeature("http://jitsi.org/meet/lipsync")), this.connection.rayo && this.caps.addFeature("urn:xmpp:rayo:client:1"); + } }, { key: "getConnection", value: function value() { + return this.connection; + } }, { key: "connectionHandler", value: function value(e, t, n) { + var r = this, + i = window.performance.now(), + o = Strophe.getStatusString(t).toLowerCase();if (this.connectionTimes[o] = i, T.log("(TIME) Strophe " + o + (n ? "[" + n + "]" : "") + ":\t", i), t === Strophe.Status.CONNECTED || t === Strophe.Status.ATTACHED) { + (this.options.useStunTurn || this.options.p2p && this.options.p2p.useStunTurn) && this.connection.jingle.getStunAndTurnCredentials(), T.info("My Jabber ID: " + this.connection.jid);var a = this.connection.domain;this.connection.ping.hasPingSupport(a, function (e) { + e ? r.connection.ping.startInterval(a) : T.warn("Ping NOT supported by " + a); + }), e && (this.authenticatedUser = !0), this.connection && this.connection.connected && Strophe.getResourceFromJid(this.connection.jid) && this.eventEmitter.emit(d.CONNECTION_ESTABLISHED, Strophe.getResourceFromJid(this.connection.jid)); + } else if (t === Strophe.Status.CONNFAIL) "x-strophe-bad-non-anon-jid" === n ? this.anonymousConnectionFailed = !0 : this.connectionFailed = !0, this.lastErrorMsg = n;else if (t === Strophe.Status.DISCONNECTED) { + this.connection.ping.stopInterval();var s = this.disconnectInProgress, + c = n || this.lastErrorMsg;if (this.disconnectInProgress = !1, this.anonymousConnectionFailed) this.eventEmitter.emit(d.CONNECTION_FAILED, l.PASSWORD_REQUIRED);else if (this.connectionFailed) this.eventEmitter.emit(d.CONNECTION_FAILED, l.OTHER_ERROR, c);else if (s) this.eventEmitter.emit(d.CONNECTION_DISCONNECTED, c);else { + T.error("XMPP connection dropped!");var u = Strophe.getLastErrorStatus();u >= 500 && u < 600 ? this.eventEmitter.emit(d.CONNECTION_FAILED, l.SERVER_ERROR, c || "server-error") : this.eventEmitter.emit(d.CONNECTION_FAILED, l.CONNECTION_DROPPED_ERROR, c || "connection-dropped-error"); + } + } else t === Strophe.Status.AUTHFAIL && this.eventEmitter.emit(d.CONNECTION_FAILED, l.PASSWORD_REQUIRED); + } }, { key: "_connect", value: function value(e, t) { + this.anonymousConnectionFailed = !1, this.connectionFailed = !1, this.lastErrorMsg = void 0, this.connection.connect(e, t, this.connectionHandler.bind(this, t)); + } }, { key: "attach", value: function value(e) { + var t = this.connectionTimes.attaching = window.performance.now();T.log("(TIME) Strophe Attaching\t:" + t), this.connection.attach(e.jid, e.sid, parseInt(e.rid, 10) + 1, this.connectionHandler.bind(this, e.password)); + } }, { key: "connect", value: function value(e, t) { + if (this.connectParams = { jid: e, password: t }, !e) { + var n = this.options.hosts.anonymousdomain || this.options.hosts.domain;this.options.hosts.anonymousdomain && (-1 !== window.location.search.indexOf("login=true") || this.token) && (n = this.options.hosts.domain), e = n || window.location.hostname; + }return this._connect(e, t); + } }, { key: "createRoom", value: function value(e, t) { + var n = Strophe.getNodeFromJid(this.connection.jid), + r = e + "@" + this.options.hosts.muc + "/", + i = t.useNicks && t.nick ? t.nick : null;return i ? n = t.nick : this.authenticatedUser || (n = n.substr(0, 8)), (this.authenticatedUser || null !== i) && (n += "-" + u.a.randomHexString(6)), r += n, this.connection.emuc.createRoom(r, null, t); + } }, { key: "getJingleLog", value: function value() { + var e = this.connection.jingle;return e ? e.getLog() : {}; + } }, { key: "getXmppLog", value: function value() { + return (this.connection.logger || {}).log || null; + } }, { key: "dial", value: function value() { + var e;(e = this.connection.rayo).dial.apply(e, arguments); + } }, { key: "setMute", value: function value(e, t) { + this.connection.moderate.setMute(e, t); + } }, { key: "eject", value: function value(e) { + this.connection.moderate.eject(e); + } }, { key: "getSessions", value: function value() { + return this.connection.jingle.sessions; + } }, { key: "disconnect", value: function value(e) { + if (this.disconnectInProgress || !this.connection || !this.connection.connected) return void this.eventEmitter.emit(d.WRONG_STATE);if (this.disconnectInProgress = !0, this.connection.flush(), null !== e && void 0 !== e) { + var t = e.type;"beforeunload" !== t && "unload" !== t || (this.connection.options.sync = !0); + }this.connection.disconnect(), !0 !== this.connection.options.sync && this.connection.flush(); + } }, { key: "_initStrophePlugins", value: function value() { + var e = [{ urls: "stun:stun.l.google.com:19302" }, { urls: "stun:stun1.l.google.com:19302" }, { urls: "stun:stun2.l.google.com:19302" }], + t = this.options.p2p && this.options.p2p.stunServers || e;n.i(f.a)(this), n.i(h.a)(this, this.eventEmitter, t), n.i(m.a)(), n.i(v.a)(this), n.i(g.a)(), n.i(y.a)(); + } }]), t; + }(b.a);t.a = _; + }).call(t, "modules/xmpp/xmpp.js"); + }, function (e, t, n) { + "use strict"; + function r(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + }function i(e, t) { + if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != typeof t && "function" != typeof t ? e : t; + }function o(e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); + }var a = n(10), + s = function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n];r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + }return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + }(), + c = function (e) { + function t() { + return r(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)); + }return o(t, e), s(t, [{ key: "getSSRCOwner", value: function value(e) { + throw new Error("not implemented"); + } }, { key: "getPeerMediaInfo", value: function value(e, t) { + throw new Error("not implemented"); + } }]), t; + }(a.a);t.a = c; + }, function (e, t) { + var n = { LOCAL_JID: "local" };e.exports = n; + }, function (e, t) { + e.exports = function e(t) { + if (!t) return !1;if (this.length != t.length) return !1;for (var n = 0, r = this.length; n < r; n++) { + if (this[n] instanceof Array && t[n] instanceof Array) { + if (!e.apply(this[n], [t[n]])) return !1; + } else if (this[n] != t[n]) return !1; + }return !0; + }; + }, function (e, t, n) { + t.Interop = n(141); + }, function (e, t, n) { + "use strict"; + function r() { + this.cache = { mlB2UMap: {}, mlU2BMap: {} }; + }var i = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + }, + o = n(142), + a = n(139);e.exports = r, r.prototype.candidateToUnifiedPlan = function (e) { + var t = new RTCIceCandidate(e);return t.sdpMLineIndex = this.cache.mlB2UMap[t.sdpMLineIndex], t; + }, r.prototype.candidateToPlanB = function (e) { + var t = new RTCIceCandidate(e);if (0 === t.sdpMid.indexOf("audio")) t.sdpMid = "audio";else { + if (0 !== t.sdpMid.indexOf("video")) throw new Error("candidate with " + t.sdpMid + " not allowed");t.sdpMid = "video"; + }return t.sdpMLineIndex = this.cache.mlU2BMap[t.sdpMLineIndex], t; + }, r.prototype.getFirstSendingIndexFromAnswer = function (e) { + if (!this.cache.answer) return null;var t = o.parse(this.cache.answer);if (t && t.media && Array.isArray(t.media)) for (var n = 0; n < t.media.length; n++) { + if (t.media[n].type == e && (!t.media[n].direction || "sendrecv" === t.media[n].direction || "sendonly" === t.media[n].direction)) return n; + }return null; + }, r.prototype.toPlanB = function (e) { + var t = this;if ("object" !== (void 0 === e ? "undefined" : i(e)) || null === e || "string" != typeof e.sdp) return console.warn("An empty description was passed as an argument."), e;var n = o.parse(e.sdp);if (void 0 === n.media || !Array.isArray(n.media) || 0 === n.media.length) return console.warn("The description has no media."), e;if (n.media.length <= 3 && n.media.every(function (e) { + return -1 !== ["video", "audio", "data"].indexOf(e.mid); + })) return console.warn("This description does not look like Unified Plan."), e;for (var r = e.sdp, a = !1, s = 0; s < n.media.length; s++) { + n.media[s].rtp.forEach(function (e) { + if ("NULL" === e.codec) { + a = !0;var n = o.parse(t.cache.offer);e.codec = n.media[s].rtp[0].codec; + } + }); + }a && (r = o.write(n)), this.cache[e.type] = r;var c = n.media;n.media = [];var u = {}, + l = [];c.forEach(function (e) { + if (("string" != typeof e.rtcpMux || "rtcp-mux" !== e.rtcpMux) && "inactive" !== e.direction) throw new Error("Cannot convert to Plan B because m-lines without the rtcp-mux attribute were found.");void 0 !== u[e.type] && "inactive" !== u[e.type].direction || (u[e.type] = e); + }), c.forEach(function (e) { + if ("application" === e.type) return n.media.push(e), void l.push(e.mid);"object" === i(e.sources) && Object.keys(e.sources).forEach(function (t) { + "object" !== i(u[e.type].sources) && (u[e.type].sources = {}), u[e.type].sources[t] = e.sources[t], void 0 !== e.msid && (u[e.type].sources[t].msid = e.msid); + }), void 0 !== e.ssrcGroups && Array.isArray(e.ssrcGroups) && (void 0 !== u[e.type].ssrcGroups && Array.isArray(u[e.type].ssrcGroups) || (u[e.type].ssrcGroups = []), u[e.type].ssrcGroups = u[e.type].ssrcGroups.concat(e.ssrcGroups)), u[e.type] === e && (e.mid = e.type, delete e.bundleOnly, delete e.msid, "inactive" !== e.direction && l.push(e.type), n.media.push(e)); + }), n.groups.some(function (e) { + if ("BUNDLE" === e.type) return e.mids = l.join(" "), !0; + }), n.msidSemantic = { semantic: "WMS", token: "*" };var d = o.write(n);return new RTCSessionDescription({ type: e.type, sdp: d }); + }, r.prototype.toUnifiedPlan = function (e) { + var t = this;if ("object" !== (void 0 === e ? "undefined" : i(e)) || null === e || "string" != typeof e.sdp) return console.warn("An empty description was passed as an argument."), e;var n = o.parse(e.sdp);if (void 0 === n.media || !Array.isArray(n.media) || 0 === n.media.length) return console.warn("The description has no media."), e;if (n.media.length > 3 || !n.media.every(function (e) { + return -1 !== ["video", "audio", "data"].indexOf(e.mid); + })) return console.warn("This description does not look like Plan B."), e;var r = [];n.media.forEach(function (e) { + r.push(e.mid); + });var s = !1;if (void 0 !== n.groups && Array.isArray(n.groups) && (s = n.groups.every(function (e) { + return "BUNDLE" !== e.type || a.apply(e.mids.sort(), [r.sort()]); + })), !s) throw new Error("Cannot convert to Unified Plan because m-lines that are not bundled were found.");var c;void 0 !== this.cache[e.type] && (c = o.parse(this.cache[e.type]));var u = { audio: {}, video: {} }, + l = {}, + d = 0, + p = 0;if (n.media.forEach(function (n) { + if (("string" != typeof n.rtcpMux || "rtcp-mux" !== n.rtcpMux) && "inactive" !== n.direction) throw new Error("Cannot convert to Unified Plan because m-lines without the rtcp-mux attribute were found.");if ("application" === n.type) return void (l[n.mid] = n);var r = n.sources, + o = n.ssrcGroups, + a = n.candidates, + s = n.iceUfrag, + f = n.icePwd, + h = n.fingerprint, + m = n.port;delete n.sources, delete n.ssrcGroups, delete n.candidates, delete n.iceUfrag, delete n.icePwd, delete n.fingerprint, delete n.port, delete n.mid;var v = {};void 0 !== o && Array.isArray(o) && o.forEach(function (e) { + "SIM" !== e.semantics && void 0 !== e.ssrcs && Array.isArray(e.ssrcs) && e.ssrcs.forEach(function (t) { + void 0 === v[t] && (v[t] = []), v[t].push(e); + }); + });var g = {};"object" === (void 0 === r ? "undefined" : i(r)) && Object.keys(r).forEach(function (o) { + var y;if ("offer" === e.type && !r[o].msid) return void (u[n.type][o] = r[o]);if (void 0 !== v[o] && Array.isArray(v[o]) && v[o].some(function (e) { + return e.ssrcs.some(function (e) { + if ("object" === i(g[e])) return y = g[e], !0; + }); + }), "object" === (void 0 === y ? "undefined" : i(y))) y.sources[o] = r[o], delete r[o].msid;else { + if (y = Object.create(n), g[o] = y, void 0 !== r[o].msid && (y.msid = r[o].msid, delete r[o].msid), y.sources = {}, y.sources[o] = r[o], y.ssrcGroups = v[o], void 0 !== c && void 0 !== c.media && Array.isArray(c.media) && c.media.forEach(function (e) { + "object" === i(e.sources) && Object.keys(e.sources).forEach(function (t) { + t === o && (y.mid = e.mid); + }); + }), void 0 === y.mid) { + if ("answer" === e.type) throw new Error("An unmapped SSRC was found.");y.mid = [n.type, "-", o].join(""); + }y.candidates = a, y.iceUfrag = s, y.icePwd = f, y.fingerprint = h, y.port = m, l[y.mid] = y, t.cache.mlU2BMap[p] = d, void 0 === t.cache.mlB2UMap[d] && (t.cache.mlB2UMap[d] = p), p++; + } + }), d++; + }), n.media = [], r = [], "answer" === e.type) for (var f = 0; f < c.media.length; f++) { + var h = c.media[f];void 0 === l[h.mid] && (delete h.msid, delete h.sources, delete h.ssrcGroups, h.direction && "sendrecv" !== h.direction ? "sendonly" === h.direction && (h.direction = "inactive") : h.direction = "recvonly"), n.media.push(h), "string" == typeof h.mid && r.push(h.mid); + } else void 0 !== c && void 0 !== c.media && Array.isArray(c.media) && c.media.forEach(function (e) { + r.push(e.mid), void 0 !== l[e.mid] ? n.media.push(l[e.mid]) : (delete e.msid, delete e.sources, delete e.ssrcGroups, e.direction && "sendrecv" !== e.direction || (e.direction = "recvonly"), e.direction && "sendonly" !== e.direction || (e.direction = "inactive"), n.media.push(e)); + }), Object.keys(l).forEach(function (e) { + -1 === r.indexOf(e) && (r.push(e), "recvonly" === l[e].direction ? n.media.some(function (t) { + if (("sendrecv" === t.direction || "sendonly" === t.direction) && t.type === l[e].type) return Object.keys(l[e].sources).forEach(function (n) { + t.sources[n] = l[e].sources[n]; + }), !0; + }) : n.media.push(l[e])); + });["audio", "video"].forEach(function (e) { + if (n && n.media && Array.isArray(n.media)) { + var r = null;if (Object.keys(u[e]).length > 0 && null === (r = t.getFirstSendingIndexFromAnswer(e))) for (var i = 0; i < n.media.length; i++) { + if (n.media[i].type === e) { + r = i;break; + } + }if (r && n.media.length > r) { + var o = n.media[r];Object.keys(u[e]).forEach(function (t) { + o.sources && o.sources[t] && console.warn("Replacing an existing SSRC."), o.sources || (o.sources = {}), o.sources[t] = u[e][t]; + }); + } + } + }), n.groups.some(function (e) { + if ("BUNDLE" === e.type) return e.mids = r.join(" "), !0; + }), n.msidSemantic = { semantic: "WMS", token: "*" };var m = o.write(n);return this.cache[e.type] = m, new RTCSessionDescription({ type: e.type, sdp: m }); + }; + }, function (e, t, n) { + var r = n(13);t.write = function (e, t) { + return void 0 !== e && void 0 !== e.media && Array.isArray(e.media) && e.media.forEach(function (e) { + void 0 !== e.sources && 0 !== Object.keys(e.sources).length && (e.ssrcs = [], Object.keys(e.sources).forEach(function (t) { + var n = e.sources[t];Object.keys(n).forEach(function (r) { + e.ssrcs.push({ id: t, attribute: r, value: n[r] }); + }); + }), delete e.sources), void 0 !== e.ssrcGroups && Array.isArray(e.ssrcGroups) && e.ssrcGroups.forEach(function (e) { + void 0 !== e.ssrcs && Array.isArray(e.ssrcs) && (e.ssrcs = e.ssrcs.join(" ")); + }); + }), void 0 !== e && void 0 !== e.groups && Array.isArray(e.groups) && e.groups.forEach(function (e) { + void 0 !== e.mids && Array.isArray(e.mids) && (e.mids = e.mids.join(" ")); + }), r.write(e, t); + }, t.parse = function (e) { + var t = r.parse(e);return void 0 !== t && void 0 !== t.media && Array.isArray(t.media) && t.media.forEach(function (e) { + void 0 !== e.ssrcs && Array.isArray(e.ssrcs) && (e.sources = {}, e.ssrcs.forEach(function (t) { + e.sources[t.id] || (e.sources[t.id] = {}), e.sources[t.id][t.attribute] = t.value; + }), delete e.ssrcs), void 0 !== e.ssrcGroups && Array.isArray(e.ssrcGroups) && e.ssrcGroups.forEach(function (e) { + "string" == typeof e.ssrcs && (e.ssrcs = e.ssrcs.split(" ")); + }); + }), void 0 !== t && void 0 !== t.groups && Array.isArray(t.groups) && t.groups.forEach(function (e) { + "string" == typeof e.mids && (e.mids = e.mids.split(" ")); + }), t; + }; + }, function (e, t, n) { + function r(e, t, n) { + return e.ssrcs.filter(function (e) { + return e.id === t; + }).filter(function (e) { + return e.attribute === n; + }).map(function (e) { + return e.value; + })[0]; + }function i(e) { + this.options = e || {}, this.options.numOfLayers || (this.options.numOfLayers = v), console.log("SdpSimulcast: using " + this.options.numOfLayers + " layers"), this.ssrcCache = []; + }function o() { + return Math.floor(4294967295 * Math.random()) + 0; + }function a(e, t) { + null != e && Array.isArray(e.media) && e.media.forEach(function (e) { + "video" === e.type && t(e); + }); + }function s(e) { + return e && null != e && e.type && "" != e.type && e.sdp && "" != e.sdp; + }function c(e) { + if (e && Array.isArray(e.ssrcGroups)) for (var t = h(e), n = [], r = e.ssrcGroups.length; r--;) { + if ("SIM" === e.ssrcGroups[r].semantics) { + for (var i = e.ssrcGroups[r].ssrcs.split(" "), o = 0; o < i.length; o++) { + var a = i[o];n.push(a);var s = t[a].msid.split(" ");t[a].msid = [s[0], "/", o, " ", s[1], "/", o].join(""), t[a].cname = [t[a].cname, "/", o].join(""), e.ssrcGroups.forEach(function (e) { + if ("SIM" !== e.semantics) { + var r = e.ssrcs.split(" ");-1 !== r.indexOf(a) && r.forEach(function (e) { + t[e].msid = t[a].msid, t[e].cname = t[a].cname, e !== a && n.push(e); + }); + } + }); + }e.ssrcs = m(t, n), e.ssrcGroups.splice(r, 1); + } + } + }function u(e) { + if (!e || !Array.isArray(e.ssrcGroups)) return void console.info("Halt: There are no SSRC groups in the remote description.");var t = h(e);e.ssrcGroups.forEach(function (n) { + if ("SIM" === n.semantics) { + console.info("Imploding SIM group: " + n.ssrcs), n.nuke = !0;for (var r = n.ssrcs.split(" "), i = 1; i < r.length; i++) { + var o = r[i];delete t[o], e.ssrcGroups.forEach(function (e) { + if ("SIM" !== e.semantics) { + var n = e.ssrcs.split(" ");-1 !== n.indexOf(o) && (n.forEach(function (e) { + delete t[e]; + }), e.nuke = !0); + } + }); + } + } + }), e.ssrcs = m(t);for (var n = e.ssrcGroups.length; n--;) { + e.ssrcGroups[n].nuke && e.ssrcGroups.splice(n, 1); + } + }function l(e) { + if (e && Array.isArray(e.invalid)) for (var t = e.invalid.length; t--;) { + "x-google-flag:conference" == e.invalid[t].value && e.invalid.splice(t, 1); + } + }function d(e) { + e && (Array.isArray(e.invalid) || (e.invalid = []), e.invalid.some(function (e) { + return "x-google-flag:conference" === e.value; + }) || e.invalid.push({ value: "x-google-flag:conference" })); + }var p = n(13), + f = n(144), + h = f.parseSsrcs, + m = f.writeSsrcs, + v = 3;i.prototype.clearSsrcCache = function () { + this.ssrcCache = []; + }, i.prototype.setSsrcCache = function (e) { + this.ssrcCache = e; + }, i.prototype._parseSimLayers = function (e) { + var t = e.ssrcGroups && e.ssrcGroups.find(function (e) { + return "SIM" === e.semantics; + });return t ? t.ssrcs.split(" ").map(function (e) { + return parseInt(e); + }) : [e.ssrcs[0].id]; + }, i.prototype._buildNewToOldSsrcMap = function (e, t) { + for (var n = {}, r = 0; r < e.length; ++r) { + var i = e[r], + o = t[r] || null;n[i] = o; + }return n; + }, i.prototype._fillInSourceDataFromCache = function (e) { + console.log("SdpSimulcast restoring from cache: ", this.ssrcCache);var t = this._parseSimLayers(e);console.log("SdpSimulcast Parsed new sim ssrcs: ", t);var n = r(e, t[0], "msid"), + i = r(e, t[0], "cname"), + o = this._buildNewToOldSsrcMap(t, this.ssrcCache);console.log("SdpSimulcast built replacement map: ", o);var a = this.ssrcCache.filter(function (e) { + return -1 === Object.values(o).indexOf(e); + });return console.log("SdpSimulcast built ssrcs to add: ", a), e.ssrcs.forEach(function (e) { + o[e.id] && (e.id = o[e.id]); + }), a.forEach(function (t) { + e.ssrcs.push({ id: t, attribute: "msid", value: n }), e.ssrcs.push({ id: t, attribute: "cname", value: i }); + }), e.ssrcGroups = e.ssrcGroups || [], e.ssrcGroups.push({ semantics: "SIM", ssrcs: this.ssrcCache.join(" ") }), e; + }, i.prototype._generateSourceData = function (e, t) { + for (var n = r(e, t, "msid"), i = r(e, t, "cname"), a = [], s = 0; s < this.options.numOfLayers - 1; ++s) { + var c = o();!function (e, t) { + e.ssrcs.push({ id: t, attribute: "cname", value: i }), e.ssrcs.push({ id: t, attribute: "msid", value: n }); + }(e, c), a.push(c); + }return e.ssrcGroups = e.ssrcGroups || [], e.ssrcGroups.push({ semantics: "SIM", ssrcs: t + " " + a.join(" ") }), e; + }, i.prototype._restoreSimulcast = function (e) { + var t, + n = e.ssrcs && e.ssrcs.map(function (e) { + return e.id; + }).filter(function (e, t, n) { + return n.indexOf(e) === t; + }).length || 0, + r = e.ssrcGroups && e.ssrcGroups.length || 0;if (0 === n || n > 2) return e;if (2 == n && 0 === r) return e;if (1 === n) t = e.ssrcs[0].id;else { + var i = e.ssrcGroups.filter(function (e) { + return "FID" === e.semantics; + })[0];if (!i) return e;t = parseInt(i.ssrcs.split(" ")[0]); + }return console.log("SdpSimulcast: current ssrc cache: ", this.ssrcCache), console.log("SdpSimulcast: parsed primary ssrc " + t), -1 !== this.ssrcCache.indexOf(t) ? (console.log("SdpSimulcast: Have seen primary ssrc before, filling in data from cache"), e = this._fillInSourceDataFromCache(e)) : (console.log("SdpSimulcast: Have not seen primary ssrc before, generating source data"), e = this._generateSourceData(e, t)), this.ssrcCache = this._parseSimLayers(e), e; + }, i.prototype.mungeRemoteDescription = function (e) { + if (!s(e)) return e;var t = p.parse(e.sdp), + n = this;return a(t, function (e) { + n.options.explodeRemoteSimulcast ? c(e) : u(e), n.ssrcCache.length < 1 ? l(e) : d(e); + }), new RTCSessionDescription({ type: e.type, sdp: p.write(t) }); + }, i.prototype.mungeLocalDescription = function (e) { + if (!s(e)) return e;var t = p.parse(e.sdp), + n = this;return a(t, function (e) { + "recvonly" != e.direction && "inactive" != e.direction && n._restoreSimulcast(e); + }), new RTCSessionDescription({ type: e.type, sdp: p.write(t) }); + }, e.exports = i; + }, function (e, t) { + t.writeSsrcs = function (e, t) { + var n = [];if (void 0 !== e && 0 !== Object.keys(e).length) { + Array.isArray(t) || (t = []);for (var r = 0; r < t.length; r++) { + var i = t[r], + o = e[i];Object.keys(o).forEach(function (e) { + n.push({ id: i, attribute: e, value: o[e] }); + }); + }Object.keys(e).forEach(function (r) { + if (r = parseInt(r), !(t.indexOf(r) >= 0)) { + var i = e[r];Object.keys(i).forEach(function (e) { + n.push({ id: r, attribute: e, value: i[e] }); + }); + } + }); + }return n; + }, t.parseSsrcs = function (e) { + var t = {};return void 0 !== e.ssrcs && Array.isArray(e.ssrcs) && e.ssrcs.forEach(function (e) { + t[e.id] || (t[e.id] = {}), t[e.id][e.attribute] = e.value; + }), t; + }; + }, function (e, t, n) { + var r = function r(e) { + return String(Number(e)) === e ? Number(e) : e; + }, + i = function (_i5) { + function i(_x8, _x9, _x10, _x11) { + return _i5.apply(this, arguments); + } + + i.toString = function () { + return _i5.toString(); + }; + + return i; + }(function (e, t, n, i) { + if (i && !n) t[i] = r(e[1]);else for (var o = 0; o < n.length; o += 1) { + null != e[o + 1] && (t[n[o]] = r(e[o + 1])); + } + }), + o = function o(e, t, n) { + var r = e.name && e.names;e.push && !t[e.push] ? t[e.push] = [] : r && !t[e.name] && (t[e.name] = {});var o = e.push ? {} : r ? t[e.name] : t;i(n.match(e.reg), o, e.names, e.name), e.push && t[e.push].push(o); + }, + a = n(57), + s = RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse = function (e) { + var t = {}, + n = [], + r = t;return e.split(/(\r\n|\r|\n)/).filter(s).forEach(function (e) { + var t = e[0], + i = e.slice(2);"m" === t && (n.push({ rtp: [], fmtp: [] }), r = n[n.length - 1]);for (var s = 0; s < (a[t] || []).length; s += 1) { + var c = a[t][s];if (c.reg.test(i)) return o(c, r, i); + } + }), t.media = n, t; + };var c = function c(e, t) { + var n = t.split(/=(.+)/, 2);return 2 === n.length && (e[n[0]] = r(n[1])), e; + };t.parseParams = function (e) { + return e.split(/\;\s?/).reduce(c, {}); + }, t.parseFmtpConfig = t.parseParams, t.parsePayloads = function (e) { + return e.split(" ").map(Number); + }, t.parseRemoteCandidates = function (e) { + for (var t = [], n = e.split(" ").map(r), i = 0; i < n.length; i += 3) { + t.push({ component: n[i], ip: n[i + 1], port: n[i + 2] }); + }return t; + }, t.parseImageAttributes = function (e) { + return e.split(" ").map(function (e) { + return e.substring(1, e.length - 1).split(",").reduce(c, {}); + }); + }, t.parseSimulcastStreamList = function (e) { + return e.split(";").map(function (e) { + return e.split(",").map(function (e) { + var t, + n = !1;return "~" !== e[0] ? t = r(e) : (t = r(e.substring(1, e.length)), n = !0), { scid: t, paused: n }; + }); + }); + }; + }, function (e, t, n) { + var r = n(57), + i = /%[sdv%]/g, + o = function o(e) { + var t = 1, + n = arguments, + r = n.length;return e.replace(i, function (e) { + if (t >= r) return e;var i = n[t];switch (t += 1, e) {case "%%": + return "%";case "%s": + return String(i);case "%d": + return Number(i);case "%v": + return "";} + }); + }, + a = function a(e, t, n) { + var r = t.format instanceof Function ? t.format(t.push ? n : n[t.name]) : t.format, + i = [e + "=" + r];if (t.names) for (var a = 0; a < t.names.length; a += 1) { + var s = t.names[a];t.name ? i.push(n[t.name][s]) : i.push(n[t.names[a]]); + } else i.push(n[t.name]);return o.apply(null, i); + }, + s = ["v", "o", "s", "i", "u", "e", "p", "c", "b", "t", "r", "z", "a"], + c = ["i", "c", "b", "a"];e.exports = function (e, t) { + t = t || {}, null == e.version && (e.version = 0), null == e.name && (e.name = " "), e.media.forEach(function (e) { + null == e.payloads && (e.payloads = ""); + });var n = t.outerOrder || s, + i = t.innerOrder || c, + o = [];return n.forEach(function (t) { + r[t].forEach(function (n) { + n.name in e && null != e[n.name] ? o.push(a(t, n, e)) : n.push in e && null != e[n.push] && e[n.push].forEach(function (e) { + o.push(a(t, n, e)); + }); + }); + }), e.media.forEach(function (e) { + o.push(a("m", r.m[0], e)), i.forEach(function (t) { + r[t].forEach(function (n) { + n.name in e && null != e[n.name] ? o.push(a(t, n, e)) : n.push in e && null != e[n.push] && e[n.push].forEach(function (e) { + o.push(a(t, n, e)); + }); + }); + }); + }), o.join("\r\n") + "\r\n"; + }; + }, function (e, t, n) { + (function (e, t) { + !function (e, n) { + "use strict"; + function r(e) { + "function" != typeof e && (e = new Function("" + e));for (var t = new Array(arguments.length - 1), n = 0; n < t.length; n++) { + t[n] = arguments[n + 1]; + }var r = { callback: e, args: t };return u[c] = r, s(c), c++; + }function i(e) { + delete u[e]; + }function o(e) { + var t = e.callback, + r = e.args;switch (r.length) {case 0: + t();break;case 1: + t(r[0]);break;case 2: + t(r[0], r[1]);break;case 3: + t(r[0], r[1], r[2]);break;default: + t.apply(n, r);} + }function a(e) { + if (l) setTimeout(a, 0, e);else { + var t = u[e];if (t) { + l = !0;try { + o(t); + } finally { + i(e), l = !1; + } + } + } + }if (!e.setImmediate) { + var s, + c = 1, + u = {}, + l = !1, + d = e.document, + p = Object.getPrototypeOf && Object.getPrototypeOf(e);p = p && p.setTimeout ? p : e, "[object process]" === {}.toString.call(e.process) ? function () { + s = function s(e) { + t.nextTick(function () { + a(e); + }); + }; + }() : function () { + if (e.postMessage && !e.importScripts) { + var t = !0, + n = e.onmessage;return e.onmessage = function () { + t = !1; + }, e.postMessage("", "*"), e.onmessage = n, t; + } + }() ? function () { + var t = "setImmediate$" + Math.random() + "$", + n = function n(_n5) { + _n5.source === e && "string" == typeof _n5.data && 0 === _n5.data.indexOf(t) && a(+_n5.data.slice(t.length)); + };e.addEventListener ? e.addEventListener("message", n, !1) : e.attachEvent("onmessage", n), s = function s(n) { + e.postMessage(t + n, "*"); + }; + }() : e.MessageChannel ? function () { + var e = new MessageChannel();e.port1.onmessage = function (e) { + a(e.data); + }, s = function s(t) { + e.port2.postMessage(t); + }; + }() : d && "onreadystatechange" in d.createElement("script") ? function () { + var e = d.documentElement;s = function s(t) { + var n = d.createElement("script");n.onreadystatechange = function () { + a(t), n.onreadystatechange = null, e.removeChild(n), n = null; + }, e.appendChild(n); + }; + }() : function () { + s = function s(e) { + setTimeout(a, 0, e); + }; + }(), p.setImmediate = r, p.clearImmediate = i; + } + }("undefined" == typeof self ? void 0 === e ? this : e : self); + }).call(t, n(1), n(56)); + }, function (e, t, n) { + function r(e, t) { + this._id = e, this._clearFn = t; + }var i = Function.prototype.apply;t.setTimeout = function () { + return new r(i.call(setTimeout, window, arguments), clearTimeout); + }, t.setInterval = function () { + return new r(i.call(setInterval, window, arguments), clearInterval); + }, t.clearTimeout = t.clearInterval = function (e) { + e && e.close(); + }, r.prototype.unref = r.prototype.ref = function () {}, r.prototype.close = function () { + this._clearFn.call(window, this._id); + }, t.enroll = function (e, t) { + clearTimeout(e._idleTimeoutId), e._idleTimeout = t; + }, t.unenroll = function (e) { + clearTimeout(e._idleTimeoutId), e._idleTimeout = -1; + }, t._unrefActive = t.active = function (e) { + clearTimeout(e._idleTimeoutId);var t = e._idleTimeout;t >= 0 && (e._idleTimeoutId = setTimeout(function () { + e._onTimeout && e._onTimeout(); + }, t)); + }, n(147);var o = n(74);t.setImmediate = o.setImmediate, t.clearImmediate = o.clearImmediate; + }, function (e, t) { + function n(e, t) { + var n = [];t = t || 0;for (var r = t || 0; r < e.length; r++) { + n[r - t] = e[r]; + }return n; + }e.exports = n; + }, function (e, t, n) { + (function (e, r) { + var i, + o = "function" == typeof Symbol && "symbol" == typeof (typeof Symbol === "function" ? Symbol.iterator : "@@iterator") ? function (e) { + return typeof e; + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== (typeof Symbol === "function" ? Symbol.prototype : "@@prototype") ? "symbol" : typeof e; + };!function (a) { + function s(e) { + for (var t, n, r = [], i = 0, o = e.length; i < o;) { + t = e.charCodeAt(i++), t >= 55296 && t <= 56319 && i < o ? (n = e.charCodeAt(i++), 56320 == (64512 & n) ? r.push(((1023 & t) << 10) + (1023 & n) + 65536) : (r.push(t), i--)) : r.push(t); + }return r; + }function c(e) { + for (var t, n = e.length, r = -1, i = ""; ++r < n;) { + t = e[r], t > 65535 && (t -= 65536, i += T(t >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), i += T(t); + }return i; + }function u(e) { + if (e >= 55296 && e <= 57343) throw Error("Lone surrogate U+" + e.toString(16).toUpperCase() + " is not a scalar value"); + }function l(e, t) { + return T(e >> t & 63 | 128); + }function d(e) { + if (0 == (4294967168 & e)) return T(e);var t = "";return 0 == (4294965248 & e) ? t = T(e >> 6 & 31 | 192) : 0 == (4294901760 & e) ? (u(e), t = T(e >> 12 & 15 | 224), t += l(e, 6)) : 0 == (4292870144 & e) && (t = T(e >> 18 & 7 | 240), t += l(e, 12), t += l(e, 6)), t += T(63 & e | 128); + }function p(e) { + for (var t, n = s(e), r = n.length, i = -1, o = ""; ++i < r;) { + t = n[i], o += d(t); + }return o; + }function f() { + if (E >= S) throw Error("Invalid byte index");var e = 255 & b[E];if (E++, 128 == (192 & e)) return 63 & e;throw Error("Invalid continuation byte"); + }function h() { + var e, t, n, r, i;if (E > S) throw Error("Invalid byte index");if (E == S) return !1;if (e = 255 & b[E], E++, 0 == (128 & e)) return e;if (192 == (224 & e)) { + var t = f();if ((i = (31 & e) << 6 | t) >= 128) return i;throw Error("Invalid continuation byte"); + }if (224 == (240 & e)) { + if (t = f(), n = f(), (i = (15 & e) << 12 | t << 6 | n) >= 2048) return u(i), i;throw Error("Invalid continuation byte"); + }if (240 == (248 & e) && (t = f(), n = f(), r = f(), (i = (15 & e) << 18 | t << 12 | n << 6 | r) >= 65536 && i <= 1114111)) return i;throw Error("Invalid UTF-8 detected"); + }function m(e) { + b = s(e), S = b.length, E = 0;for (var t, n = []; !1 !== (t = h());) { + n.push(t); + }return c(n); + }var v = "object" == o(t) && t, + g = "object" == o(e) && e && e.exports == v && e, + y = "object" == (void 0 === r ? "undefined" : o(r)) && r;y.global !== y && y.window !== y || (a = y);var b, + S, + E, + T = String.fromCharCode, + _ = { version: "2.0.0", encode: p, decode: m };if ("object" == o(n(25)) && n(25)) void 0 !== (i = function () { + return _; + }.call(t, n, t, e)) && (e.exports = i);else if (v && !v.nodeType) { + if (g) g.exports = _;else { + var C = {}, + w = C.hasOwnProperty;for (var R in _) { + w.call(_, R) && (v[R] = _[R]); + } + } + } else a.utf8 = _; + }(this); + }).call(t, n(58)(e), n(1)); + }, function (e, t, n) { + e.exports = { EventTarget: n(153), Event: n(152) }; + }, function (e, t, n) { + (function (t) { + e.exports = t.Event; + }).call(t, n(1)); + }, function (e, t) { + function n() { + this._listeners = {}; + }Object.defineProperties(n.prototype, { listeners: { get: function get() { + return this._listeners; + } } }), n.prototype.addEventListener = function (e, t) { + var n, r, i;if (e && t) { + for (n = this._listeners[e], void 0 === n && (this._listeners[e] = n = []), r = 0; i = n[r]; r++) { + if (i === t) return; + }n.push(t); + } + }, n.prototype.removeEventListener = function (e, t) { + var n, r, i;if (e && t && void 0 !== (n = this._listeners[e])) { + for (r = 0; i = n[r]; r++) { + if (i === t) { + n.splice(r, 1);break; + } + }0 === n.length && delete this._listeners[e]; + } + }, n.prototype.dispatchEvent = function (e) { + var t, + n, + r, + i, + o, + a = !1;if (!e || "string" != typeof e.type) throw new Error("`event` must have a valid `type` property");e._yaeti && (e.target = this, e.cancelable = !0);try { + e.stopImmediatePropagation = function () { + a = !0; + }; + } catch (e) {}if (t = e.type, n = this._listeners[t] || [], "function" == typeof (r = this["on" + t])) try { + r.call(this, e); + } catch (e) { + console.error(e); + }for (i = 0; (o = n[i]) && !a; i++) { + try { + o.call(this, e); + } catch (e) { + console.error(e); + } + }return !e.defaultPrevented; + }, e.exports = n; + }, function (e, t) { + function n(e, t, n) { + function i(e, r) { + if (i.count <= 0) throw new Error("after called too many times");--i.count, e ? (o = !0, t(e), t = n) : 0 !== i.count || o || t(null, r); + }var o = !1;return n = n || r, i.count = e, 0 === e ? t() : i; + }function r() {}e.exports = n; + }, function (e, t) { + !function (e) { + "use strict"; + t.encode = function (t) { + var n, + r = new Uint8Array(t), + i = r.length, + o = "";for (n = 0; n < i; n += 3) { + o += e[r[n] >> 2], o += e[(3 & r[n]) << 4 | r[n + 1] >> 4], o += e[(15 & r[n + 1]) << 2 | r[n + 2] >> 6], o += e[63 & r[n + 2]]; + }return i % 3 == 2 ? o = o.substring(0, o.length - 1) + "=" : i % 3 == 1 && (o = o.substring(0, o.length - 2) + "=="), o; + }, t.decode = function (t) { + var n, + r, + i, + o, + a, + s = .75 * t.length, + c = t.length, + u = 0;"=" === t[t.length - 1] && (s--, "=" === t[t.length - 2] && s--);var l = new ArrayBuffer(s), + d = new Uint8Array(l);for (n = 0; n < c; n += 4) { + r = e.indexOf(t[n]), i = e.indexOf(t[n + 1]), o = e.indexOf(t[n + 2]), a = e.indexOf(t[n + 3]), d[u++] = r << 2 | i >> 4, d[u++] = (15 & i) << 4 | o >> 2, d[u++] = (3 & o) << 6 | 63 & a; + }return l; + }; + }("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); + }, function (e, t, n) { + function r() { + return t.colors[l++ % t.colors.length]; + }function i(e) { + function n() {}function i() { + var e = i, + n = +new Date(), + o = n - (u || n);e.diff = o, e.prev = u, e.curr = n, u = n, null == e.useColors && (e.useColors = t.useColors()), null == e.color && e.useColors && (e.color = r());var a = Array.prototype.slice.call(arguments);a[0] = t.coerce(a[0]), "string" != typeof a[0] && (a = ["%o"].concat(a));var s = 0;a[0] = a[0].replace(/%([a-z%])/g, function (n, r) { + if ("%%" === n) return n;s++;var i = t.formatters[r];if ("function" == typeof i) { + var o = a[s];n = i.call(e, o), a.splice(s, 1), s--; + }return n; + }), "function" == typeof t.formatArgs && (a = t.formatArgs.apply(e, a)), (i.log || t.log || console.log.bind(console)).apply(e, a); + }n.enabled = !1, i.enabled = !0;var o = t.enabled(e) ? i : n;return o.namespace = e, o; + }function o(e) { + t.save(e);for (var n = (e || "").split(/[\s,]+/), r = n.length, i = 0; i < r; i++) { + n[i] && (e = n[i].replace(/\*/g, ".*?"), "-" === e[0] ? t.skips.push(new RegExp("^" + e.substr(1) + "$")) : t.names.push(new RegExp("^" + e + "$"))); + } + }function a() { + t.enable(""); + }function s(e) { + var n, r;for (n = 0, r = t.skips.length; n < r; n++) { + if (t.skips[n].test(e)) return !1; + }for (n = 0, r = t.names.length; n < r; n++) { + if (t.names[n].test(e)) return !0; + }return !1; + }function c(e) { + return e instanceof Error ? e.stack || e.message : e; + }t = e.exports = i, t.coerce = c, t.disable = a, t.enable = o, t.enabled = s, t.humanize = n(165), t.names = [], t.skips = [], t.formatters = {};var u, + l = 0; + }, function (e, t, n) { + e.exports = n(158); + }, function (e, t, n) { + e.exports = n(159), e.exports.parser = n(18); + }, function (e, t, n) { + (function (t) { + function r(e, n) { + if (!(this instanceof r)) return new r(e, n);n = n || {}, e && "object" == typeof e && (n = e, e = null), e ? (e = l(e), n.hostname = e.host, n.secure = "https" == e.protocol || "wss" == e.protocol, n.port = e.port, e.query && (n.query = e.query)) : n.host && (n.hostname = l(n.host).host), this.secure = null != n.secure ? n.secure : t.location && "https:" == location.protocol, n.hostname && !n.port && (n.port = this.secure ? "443" : "80"), this.agent = n.agent || !1, this.hostname = n.hostname || (t.location ? location.hostname : "localhost"), this.port = n.port || (t.location && location.port ? location.port : this.secure ? 443 : 80), this.query = n.query || {}, "string" == typeof this.query && (this.query = p.decode(this.query)), this.upgrade = !1 !== n.upgrade, this.path = (n.path || "/engine.io").replace(/\/$/, "") + "/", this.forceJSONP = !!n.forceJSONP, this.jsonp = !1 !== n.jsonp, this.forceBase64 = !!n.forceBase64, this.enablesXDR = !!n.enablesXDR, this.timestampParam = n.timestampParam || "t", this.timestampRequests = n.timestampRequests, this.transports = n.transports || ["polling", "websocket"], this.readyState = "", this.writeBuffer = [], this.policyPort = n.policyPort || 843, this.rememberUpgrade = n.rememberUpgrade || !1, this.binaryType = null, this.onlyBinaryUpgrades = n.onlyBinaryUpgrades, this.perMessageDeflate = !1 !== n.perMessageDeflate && (n.perMessageDeflate || {}), !0 === this.perMessageDeflate && (this.perMessageDeflate = {}), this.perMessageDeflate && null == this.perMessageDeflate.threshold && (this.perMessageDeflate.threshold = 1024), this.pfx = n.pfx || null, this.key = n.key || null, this.passphrase = n.passphrase || null, this.cert = n.cert || null, this.ca = n.ca || null, this.ciphers = n.ciphers || null, this.rejectUnauthorized = void 0 === n.rejectUnauthorized ? null : n.rejectUnauthorized;var i = "object" == typeof t && t;i.global === i && n.extraHeaders && Object.keys(n.extraHeaders).length > 0 && (this.extraHeaders = n.extraHeaders), this.open(); + }function i(e) { + var t = {};for (var n in e) { + e.hasOwnProperty(n) && (t[n] = e[n]); + }return t; + }var o = n(61), + a = n(36), + s = n(9)("engine.io-client:socket"), + c = n(41), + u = n(18), + l = n(63), + d = n(166), + p = n(38);e.exports = r, r.priorWebsocketSuccess = !1, a(r.prototype), r.protocol = u.protocol, r.Socket = r, r.Transport = n(34), r.transports = n(61), r.parser = n(18), r.prototype.createTransport = function (e) { + s('creating transport "%s"', e);var t = i(this.query);return t.EIO = u.protocol, t.transport = e, this.id && (t.sid = this.id), new o[e]({ agent: this.agent, hostname: this.hostname, port: this.port, secure: this.secure, path: this.path, query: t, forceJSONP: this.forceJSONP, jsonp: this.jsonp, forceBase64: this.forceBase64, enablesXDR: this.enablesXDR, timestampRequests: this.timestampRequests, timestampParam: this.timestampParam, policyPort: this.policyPort, socket: this, pfx: this.pfx, key: this.key, passphrase: this.passphrase, cert: this.cert, ca: this.ca, ciphers: this.ciphers, rejectUnauthorized: this.rejectUnauthorized, perMessageDeflate: this.perMessageDeflate, extraHeaders: this.extraHeaders }); + }, r.prototype.open = function () { + var e;if (this.rememberUpgrade && r.priorWebsocketSuccess && -1 != this.transports.indexOf("websocket")) e = "websocket";else { + if (0 === this.transports.length) { + var t = this;return void setTimeout(function () { + t.emit("error", "No transports available"); + }, 0); + }e = this.transports[0]; + }this.readyState = "opening";try { + e = this.createTransport(e); + } catch (e) { + return this.transports.shift(), void this.open(); + }e.open(), this.setTransport(e); + }, r.prototype.setTransport = function (e) { + s("setting transport %s", e.name);var t = this;this.transport && (s("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = e, e.on("drain", function () { + t.onDrain(); + }).on("packet", function (e) { + t.onPacket(e); + }).on("error", function (e) { + t.onError(e); + }).on("close", function () { + t.onClose("transport close"); + }); + }, r.prototype.probe = function (e) { + function t() { + if (p.onlyBinaryUpgrades) { + var t = !this.supportsBinary && p.transport.supportsBinary;d = d || t; + }d || (s('probe transport "%s" opened', e), l.send([{ type: "ping", data: "probe" }]), l.once("packet", function (t) { + if (!d) if ("pong" == t.type && "probe" == t.data) { + if (s('probe transport "%s" pong', e), p.upgrading = !0, p.emit("upgrading", l), !l) return;r.priorWebsocketSuccess = "websocket" == l.name, s('pausing current transport "%s"', p.transport.name), p.transport.pause(function () { + d || "closed" != p.readyState && (s("changing transport and sending upgrade packet"), u(), p.setTransport(l), l.send([{ type: "upgrade" }]), p.emit("upgrade", l), l = null, p.upgrading = !1, p.flush()); + }); + } else { + s('probe transport "%s" failed', e);var n = new Error("probe error");n.transport = l.name, p.emit("upgradeError", n); + } + })); + }function n() { + d || (d = !0, u(), l.close(), l = null); + }function i(t) { + var r = new Error("probe error: " + t);r.transport = l.name, n(), s('probe transport "%s" failed because of error: %s', e, t), p.emit("upgradeError", r); + }function o() { + i("transport closed"); + }function a() { + i("socket closed"); + }function c(e) { + l && e.name != l.name && (s('"%s" works - aborting "%s"', e.name, l.name), n()); + }function u() { + l.removeListener("open", t), l.removeListener("error", i), l.removeListener("close", o), p.removeListener("close", a), p.removeListener("upgrading", c); + }s('probing transport "%s"', e);var l = this.createTransport(e, { probe: 1 }), + d = !1, + p = this;r.priorWebsocketSuccess = !1, l.once("open", t), l.once("error", i), l.once("close", o), this.once("close", a), this.once("upgrading", c), l.open(); + }, r.prototype.onOpen = function () { + if (s("socket open"), this.readyState = "open", r.priorWebsocketSuccess = "websocket" == this.transport.name, this.emit("open"), this.flush(), "open" == this.readyState && this.upgrade && this.transport.pause) { + s("starting upgrade probes");for (var e = 0, t = this.upgrades.length; e < t; e++) { + this.probe(this.upgrades[e]); + } + } + }, r.prototype.onPacket = function (e) { + if ("opening" == this.readyState || "open" == this.readyState) switch (s('socket receive: type "%s", data "%s"', e.type, e.data), this.emit("packet", e), this.emit("heartbeat"), e.type) {case "open": + this.onHandshake(d(e.data));break;case "pong": + this.setPing(), this.emit("pong");break;case "error": + var t = new Error("server error");t.code = e.data, this.onError(t);break;case "message": + this.emit("data", e.data), this.emit("message", e.data);} else s('packet received with socket readyState "%s"', this.readyState); + }, r.prototype.onHandshake = function (e) { + this.emit("handshake", e), this.id = e.sid, this.transport.query.sid = e.sid, this.upgrades = this.filterUpgrades(e.upgrades), this.pingInterval = e.pingInterval, this.pingTimeout = e.pingTimeout, this.onOpen(), "closed" != this.readyState && (this.setPing(), this.removeListener("heartbeat", this.onHeartbeat), this.on("heartbeat", this.onHeartbeat)); + }, r.prototype.onHeartbeat = function (e) { + clearTimeout(this.pingTimeoutTimer);var t = this;t.pingTimeoutTimer = setTimeout(function () { + "closed" != t.readyState && t.onClose("ping timeout"); + }, e || t.pingInterval + t.pingTimeout); + }, r.prototype.setPing = function () { + var e = this;clearTimeout(e.pingIntervalTimer), e.pingIntervalTimer = setTimeout(function () { + s("writing ping packet - expecting pong within %sms", e.pingTimeout), e.ping(), e.onHeartbeat(e.pingTimeout); + }, e.pingInterval); + }, r.prototype.ping = function () { + var e = this;this.sendPacket("ping", function () { + e.emit("ping"); + }); + }, r.prototype.onDrain = function () { + this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush(); + }, r.prototype.flush = function () { + "closed" != this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (s("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush")); + }, r.prototype.write = r.prototype.send = function (e, t, n) { + return this.sendPacket("message", e, t, n), this; + }, r.prototype.sendPacket = function (e, t, n, r) { + if ("function" == typeof t && (r = t, t = void 0), "function" == typeof n && (r = n, n = null), "closing" != this.readyState && "closed" != this.readyState) { + n = n || {}, n.compress = !1 !== n.compress;var i = { type: e, data: t, options: n };this.emit("packetCreate", i), this.writeBuffer.push(i), r && this.once("flush", r), this.flush(); + } + }, r.prototype.close = function () { + function e() { + r.onClose("forced close"), s("socket closing - telling transport to close"), r.transport.close(); + }function t() { + r.removeListener("upgrade", t), r.removeListener("upgradeError", t), e(); + }function n() { + r.once("upgrade", t), r.once("upgradeError", t); + }if ("opening" == this.readyState || "open" == this.readyState) { + this.readyState = "closing";var r = this;this.writeBuffer.length ? this.once("drain", function () { + this.upgrading ? n() : e(); + }) : this.upgrading ? n() : e(); + }return this; + }, r.prototype.onError = function (e) { + s("socket error %j", e), r.priorWebsocketSuccess = !1, this.emit("error", e), this.onClose("transport error", e); + }, r.prototype.onClose = function (e, t) { + if ("opening" == this.readyState || "open" == this.readyState || "closing" == this.readyState) { + s('socket close with reason: "%s"', e);var n = this;clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", e, t), n.writeBuffer = [], n.prevBufferLen = 0; + } + }, r.prototype.filterUpgrades = function (e) { + for (var t = [], n = 0, r = e.length; n < r; n++) { + ~c(this.transports, e[n]) && t.push(e[n]); + }return t; + }; + }).call(t, n(1)); + }, function (e, t, n) { + (function (t) { + function r() {}function i(e) { + o.call(this, e), this.query = this.query || {}, s || (t.___eio || (t.___eio = []), s = t.___eio), this.index = s.length;var n = this;s.push(function (e) { + n.onData(e); + }), this.query.j = this.index, t.document && t.addEventListener && t.addEventListener("beforeunload", function () { + n.script && (n.script.onerror = r); + }, !1); + }var o = n(62), + a = n(21);e.exports = i;var s, + c = /\n/g, + u = /\\n/g;a(i, o), i.prototype.supportsBinary = !1, i.prototype.doClose = function () { + this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), o.prototype.doClose.call(this); + }, i.prototype.doPoll = function () { + var e = this, + t = document.createElement("script");this.script && (this.script.parentNode.removeChild(this.script), this.script = null), t.async = !0, t.src = this.uri(), t.onerror = function (t) { + e.onError("jsonp poll error", t); + };var n = document.getElementsByTagName("script")[0];n ? n.parentNode.insertBefore(t, n) : (document.head || document.body).appendChild(t), this.script = t, "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent) && setTimeout(function () { + var e = document.createElement("iframe");document.body.appendChild(e), document.body.removeChild(e); + }, 100); + }, i.prototype.doWrite = function (e, t) { + function n() { + r(), t(); + }function r() { + if (i.iframe) try { + i.form.removeChild(i.iframe); + } catch (e) { + i.onError("jsonp polling iframe removal error", e); + }try { + var e = '