@robylon/react-native-sdk 2.0.32-staging.4 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/android/build.gradle +35 -0
  2. package/ios/RobylonDownloadModule.h +5 -0
  3. package/ios/RobylonDownloadModule.m +124 -0
  4. package/lib/commonjs/Chatbotsdk.js +4 -4
  5. package/lib/commonjs/Chatbotsdk.js.map +1 -1
  6. package/lib/commonjs/config.js +1 -1
  7. package/lib/commonjs/config.js.map +1 -1
  8. package/lib/commonjs/constants.js +1 -1
  9. package/lib/commonjs/constants.js.map +1 -1
  10. package/lib/commonjs/utils/fileDownload.js +1 -1
  11. package/lib/commonjs/utils/fileDownload.js.map +1 -1
  12. package/lib/commonjs/versions/version.staging.js +1 -1
  13. package/lib/module/Chatbotsdk.js +4 -4
  14. package/lib/module/Chatbotsdk.js.map +1 -1
  15. package/lib/module/config.js +1 -1
  16. package/lib/module/config.js.map +1 -1
  17. package/lib/module/constants.js +1 -1
  18. package/lib/module/constants.js.map +1 -1
  19. package/lib/module/utils/fileDownload.js +1 -1
  20. package/lib/module/utils/fileDownload.js.map +1 -1
  21. package/lib/module/versions/version.staging.js +1 -1
  22. package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
  23. package/lib/typescript/utils/fileDownload.d.ts +3 -2
  24. package/lib/typescript/utils/fileDownload.d.ts.map +1 -1
  25. package/lib/typescript/versions/version.staging.d.ts +1 -1
  26. package/package.json +3 -3
  27. package/robylon-react-native-sdk.podspec +18 -0
  28. package/src/Chatbotsdk.tsx +0 -979
  29. package/src/FloatingButton/launchers/ImageLauncher.tsx +0 -75
  30. package/src/FloatingButton/launchers/TextLauncher.tsx +0 -84
  31. package/src/FloatingButton/launchers/TextualImageLauncher.tsx +0 -133
  32. package/src/FloatingButton.tsx +0 -97
  33. package/src/LoadingIndicator.tsx +0 -11
  34. package/src/Toast.tsx +0 -65
  35. package/src/components/DebugButton.tsx +0 -46
  36. package/src/components/ErrorBoundary.tsx +0 -38
  37. package/src/config.ts +0 -4
  38. package/src/constants/errorConstants.ts +0 -21
  39. package/src/constants/fontStyles.ts +0 -3
  40. package/src/constants.ts +0 -5
  41. package/src/global.d.ts +0 -11
  42. package/src/hooks/useChatbotEvents.ts +0 -93
  43. package/src/index.tsx +0 -10
  44. package/src/openChatbot.ts +0 -11
  45. package/src/openChatbot.tsx +0 -0
  46. package/src/services/ErrorTrackingService.ts +0 -217
  47. package/src/types/events.ts +0 -28
  48. package/src/types/react-native-flipper-performance-plugin.d.ts +0 -3
  49. package/src/types/react-native-globals.d.ts +0 -10
  50. package/src/utils/animations.ts +0 -120
  51. package/src/utils/colorUtils.ts +0 -35
  52. package/src/utils/cookieUtils.ts +0 -7
  53. package/src/utils/debugConfig.ts +0 -56
  54. package/src/utils/debugMenu.ts +0 -14
  55. package/src/utils/errorHandler.ts +0 -58
  56. package/src/utils/fileDownload.ts +0 -70
  57. package/src/utils/logger.ts +0 -14
  58. package/src/utils/systemInfo.ts +0 -110
  59. package/src/utils/webViewStorage.ts +0 -62
  60. package/src/version.ts +0 -2
  61. package/src/versions/version.dev.ts +0 -2
  62. package/src/versions/version.production.ts +0 -2
  63. package/src/versions/version.staging.ts +0 -2
@@ -0,0 +1,35 @@
1
+ buildscript {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ }
6
+ dependencies {
7
+ classpath("com.android.tools.build:gradle:8.3.2")
8
+ }
9
+ }
10
+
11
+ apply plugin: "com.android.library"
12
+
13
+ android {
14
+ namespace "com.robylonreactnativesdk"
15
+ compileSdkVersion 34
16
+
17
+ defaultConfig {
18
+ minSdkVersion 21
19
+ targetSdkVersion 34
20
+ }
21
+
22
+ compileOptions {
23
+ sourceCompatibility JavaVersion.VERSION_17
24
+ targetCompatibility JavaVersion.VERSION_17
25
+ }
26
+ }
27
+
28
+ repositories {
29
+ google()
30
+ mavenCentral()
31
+ }
32
+
33
+ dependencies {
34
+ implementation "com.facebook.react:react-native:+"
35
+ }
@@ -0,0 +1,5 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RobylonDownloadModule : NSObject <RCTBridgeModule>
4
+
5
+ @end
@@ -0,0 +1,124 @@
1
+ #import "RobylonDownloadModule.h"
2
+
3
+ #import <React/RCTUtils.h>
4
+ #import <UIKit/UIKit.h>
5
+
6
+ @implementation RobylonDownloadModule
7
+
8
+ RCT_EXPORT_MODULE();
9
+
10
+ - (dispatch_queue_t)methodQueue
11
+ {
12
+ return dispatch_get_main_queue();
13
+ }
14
+
15
+ RCT_REMAP_METHOD(downloadFile,
16
+ downloadFileWithUrl:(NSString *)url
17
+ filename:(NSString *)filename
18
+ resolver:(RCTPromiseResolveBlock)resolve
19
+ rejecter:(RCTPromiseRejectBlock)reject)
20
+ {
21
+ if (url == nil || url.length == 0) {
22
+ reject(@"INVALID_URL", @"Download URL is missing", nil);
23
+ return;
24
+ }
25
+
26
+ NSURL *downloadURL = [NSURL URLWithString:url];
27
+ if (downloadURL == nil) {
28
+ reject(@"INVALID_URL", @"Download URL is invalid", nil);
29
+ return;
30
+ }
31
+
32
+ NSURLSessionDownloadTask *task = [[NSURLSession sharedSession]
33
+ downloadTaskWithURL:downloadURL
34
+ completionHandler:^(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error) {
35
+ if (error != nil) {
36
+ reject(@"DOWNLOAD_FAILED", @"Failed to download file", error);
37
+ return;
38
+ }
39
+
40
+ if (location == nil) {
41
+ reject(@"DOWNLOAD_FAILED", @"Downloaded file location is empty", nil);
42
+ return;
43
+ }
44
+
45
+ NSString *resolvedName = [self resolvedFileName:filename response:response url:downloadURL];
46
+ NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:resolvedName];
47
+ NSURL *targetURL = [NSURL fileURLWithPath:targetPath];
48
+
49
+ [[NSFileManager defaultManager] removeItemAtURL:targetURL error:nil];
50
+
51
+ NSError *moveError = nil;
52
+ [[NSFileManager defaultManager] moveItemAtURL:location toURL:targetURL error:&moveError];
53
+ if (moveError != nil) {
54
+ reject(@"FILE_MOVE_FAILED", @"Failed to move downloaded file", moveError);
55
+ return;
56
+ }
57
+
58
+ dispatch_async(dispatch_get_main_queue(), ^{
59
+ UIViewController *rootViewController = RCTPresentedViewController();
60
+ if (rootViewController == nil) {
61
+ reject(@"VIEW_CONTROLLER_MISSING", @"Unable to open iOS share sheet", nil);
62
+ return;
63
+ }
64
+
65
+ UIActivityViewController *activityController =
66
+ [[UIActivityViewController alloc] initWithActivityItems:@[ targetURL ] applicationActivities:nil];
67
+
68
+ UIPopoverPresentationController *popover = activityController.popoverPresentationController;
69
+ if (popover != nil) {
70
+ popover.sourceView = rootViewController.view;
71
+ popover.sourceRect = CGRectMake(rootViewController.view.bounds.size.width / 2.0,
72
+ rootViewController.view.bounds.size.height / 2.0,
73
+ 1,
74
+ 1);
75
+ }
76
+
77
+ [rootViewController presentViewController:activityController animated:YES completion:^{
78
+ resolve(resolvedName);
79
+ }];
80
+ });
81
+ }];
82
+
83
+ [task resume];
84
+ }
85
+
86
+ - (NSString *)resolvedFileName:(NSString *)filename response:(NSURLResponse *)response url:(NSURL *)url
87
+ {
88
+ NSString *cleanName = [self sanitizedName:filename];
89
+ if (cleanName.length > 0) {
90
+ NSString *urlExtension = [url.path pathExtension];
91
+ NSString *nameExtension = [cleanName pathExtension];
92
+ if (nameExtension.length == 0 && urlExtension.length > 0) {
93
+ return [cleanName stringByAppendingFormat:@".%@", urlExtension];
94
+ }
95
+ return cleanName;
96
+ }
97
+
98
+ NSString *suggested = [self sanitizedName:response.suggestedFilename];
99
+ if (suggested.length > 0) {
100
+ return suggested;
101
+ }
102
+
103
+ NSString *lastPath = [self sanitizedName:url.lastPathComponent];
104
+ if (lastPath.length > 0) {
105
+ return lastPath;
106
+ }
107
+
108
+ return [NSString stringWithFormat:@"download-%f", [[NSDate date] timeIntervalSince1970]];
109
+ }
110
+
111
+ - (NSString *)sanitizedName:(NSString *)name
112
+ {
113
+ if (name == nil || name.length == 0) {
114
+ return @"";
115
+ }
116
+
117
+ NSCharacterSet *invalidCharacters =
118
+ [NSCharacterSet characterSetWithCharactersInString:@"/\\?%*|\"<>:"];
119
+ NSArray<NSString *> *parts = [name componentsSeparatedByCharactersInSet:invalidCharacters];
120
+ NSString *joined = [parts componentsJoinedByString:@"_"];
121
+ return [joined stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
122
+ }
123
+
124
+ @end
@@ -1,12 +1,12 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var getOriginFromUrl=function getOriginFromUrl(url){if(!url)return null;try{var _URL$origin,_URL;return(_URL$origin=(_URL=new URL(url))==null?void 0:_URL.origin)!=null?_URL$origin:null;}catch(_unused){return null;}};var warmupHttpOrigin=function(){var _ref=(0,_asyncToGenerator2.default)(function*(origin){if(!origin)return;try{yield fetch(origin,{method:"HEAD"});}catch(_unused2){try{yield fetch(origin,{method:"GET"});}catch(_unused3){}}});return function warmupHttpOrigin(_x){return _ref.apply(this,arguments);};}();var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref2,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref2.api_key,user_id=_ref2.user_id,user_token=_ref2.user_token,_ref2$show_floating_b=_ref2.show_floating_button,show_floating_button=_ref2$show_floating_b===void 0?true:_ref2$show_floating_b,onEvent=_ref2.onEvent,onMessage=_ref2.onMessage,_ref2$isFullScreen=_ref2.isFullScreen,isFullScreen=_ref2$isFullScreen===void 0?true:_ref2$isFullScreen,_ref2$enableAnimation=_ref2.enableAnimation,enableAnimation=_ref2$enableAnimation===void 0?true:_ref2$enableAnimation,externalOnOpen=_ref2.onOpen,externalOnClose=_ref2.onClose,onReady=_ref2.onReady,user_profile=_ref2.user_profile;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WidgetPositionEnums=exports.LauncherType=exports.ChatbotInterfaceType=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeWebview=require("react-native-webview");var _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _systemInfo=require("./utils/systemInfo");var _useChatbotEvents2=require("./hooks/useChatbotEvents");var _events=require("./types/events");var _logger=require("./utils/logger");var _debugConfig=require("./utils/debugConfig");var _DebugButton=_interopRequireDefault(require("./components/DebugButton"));var _ErrorBoundary=require("./components/ErrorBoundary");var _errorConstants=require("./constants/errorConstants");var _ErrorTrackingService=require("./services/ErrorTrackingService");var _cookieUtils=require("./utils/cookieUtils");var _webViewStorage=require("./utils/webViewStorage");var _animations=require("./utils/animations");var _fileDownload=require("./utils/fileDownload");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/professional/Mobile sdks/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var ChatbotInterfaceType=exports.ChatbotInterfaceType=function(ChatbotInterfaceType){ChatbotInterfaceType["WIDGET"]="WIDGET";ChatbotInterfaceType["POPOVER"]="POPOVER";ChatbotInterfaceType["EMBED"]="EMBED";return ChatbotInterfaceType;}({});var WidgetPositionEnums=exports.WidgetPositionEnums=function(WidgetPositionEnums){WidgetPositionEnums["RIGHT"]="Right";WidgetPositionEnums["LEFT"]="Left";return WidgetPositionEnums;}({});var LauncherType=exports.LauncherType=function(LauncherType){LauncherType["TEXT"]="TEXT";LauncherType["IMAGE"]="IMAGE";LauncherType["TEXTUAL_IMAGE"]="TEXTUAL_IMAGE";return LauncherType;}({});var Chatbot=(0,_react.forwardRef)(function(_ref,ref){var _chatbotConfig$interf,_chatbotConfig$interf2,_chatbotConfig$interf3,_chatbotConfig$interf4,_chatbotConfig$interf5;var api_key=_ref.api_key,user_id=_ref.user_id,user_token=_ref.user_token,_ref$show_floating_bu=_ref.show_floating_button,show_floating_button=_ref$show_floating_bu===void 0?true:_ref$show_floating_bu,onEvent=_ref.onEvent,onMessage=_ref.onMessage,_ref$isFullScreen=_ref.isFullScreen,isFullScreen=_ref$isFullScreen===void 0?true:_ref$isFullScreen,_ref$enableAnimation=_ref.enableAnimation,enableAnimation=_ref$enableAnimation===void 0?true:_ref$enableAnimation,externalOnOpen=_ref.onOpen,externalOnClose=_ref.onClose,onReady=_ref.onReady,user_profile=_ref.user_profile;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isWebViewVisible=_useState2[0],setIsWebViewVisible=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),chatbotConfig=_useState4[0],setChatbotConfig=_useState4[1];var _useState5=(0,_react.useState)(true),_useState6=(0,_slicedToArray2.default)(_useState5,2),loading=_useState6[0],setLoading=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),isInitialized=_useState8[0],setIsInitialized=_useState8[1];var webViewRef=(0,_react.useRef)(null);var isFirstLoadRef=(0,_react.useRef)(true);var _useState9=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastVisible=_useState10[0],setToastVisible=_useState10[1];var _useState11=(0,_react.useState)(""),_useState12=(0,_slicedToArray2.default)(_useState11,2),toastMessage=_useState12[0],setToastMessage=_useState12[1];var _useState13=(0,_react.useState)(),_useState14=(0,_slicedToArray2.default)(_useState13,2),effectiveUserId=_useState14[0],setEffectiveUserId=_useState14[1];var _useState15=(0,_react.useState)(false),_useState16=(0,_slicedToArray2.default)(_useState15,2),isStorageReady=_useState16[0],setIsStorageReady=_useState16[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState17=(0,_react.useState)({os:"",browser:""}),_useState18=(0,_slicedToArray2.default)(_useState17,2),systemInfo=_useState18[0],setSystemInfo=_useState18[1];var systemInfoRef=(0,_react.useRef)({os:"",browser:""});var animatedValues=(0,_react.useRef)({scale:new _reactNative.Animated.Value(1),translateY:new _reactNative.Animated.Value(0),opacity:new _reactNative.Animated.Value(1)}).current;var chatbotConfigForEvents=(0,_react.useMemo)(function(){return{userId:effectiveUserId,isAnonymous:!user_id&&user_id!==0};},[effectiveUserId,user_id]);var _useChatbotEvents=(0,_useChatbotEvents2.useChatbotEvents)({api_key:api_key,chatbotConfig:chatbotConfigForEvents!=null?chatbotConfigForEvents:{},user_profile:user_profile,onEvent:onEvent,systemInfo:systemInfo!=null?systemInfo:{os:"",browser:""}}),emitEvent=_useChatbotEvents.emitEvent,onInternalEvent=_useChatbotEvents.onInternalEvent;(0,_react.useImperativeHandle)(ref,function(){return{open:function open(){if(isInitialized){openWebView();}},close:function close(){if(isInitialized){closeWebView();}},toggle:function toggle(){if(isInitialized){if(isWebViewVisible){closeWebView();}else{openWebView();}}},isReady:function isReady(){return isInitialized;}};},[isInitialized,isWebViewVisible]);var triggerAppInit=function triggerAppInit(){if(webViewRef.current){var _webViewRef$current;(_webViewRef$current=webViewRef.current)==null?void 0:_webViewRef$current.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
- `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:{userId:effectiveUserId,token:user_token?`${user_token}`:undefined,userProfile:Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
5
+ `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(event){var _webViewRef$current2;var data=event.nativeEvent.data;try{var parsedData=JSON.parse(data);if(Object.values(_webViewStorage.StorageMessageType).includes(parsedData.type)){var storageMessage=parsedData;switch(storageMessage.type){case _webViewStorage.StorageMessageType.STORAGE_READY:setIsStorageReady(true);pendingStorageOps.current.forEach(function(op){return op();});pendingStorageOps.current=[];(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));break;case _webViewStorage.StorageMessageType.STORAGE_RESPONSE:if(storageMessage.key&&storageMessage.value){memoryCache.current[storageMessage.key]=storageMessage.value;if(storageMessage.key==="rblyn_anon"){setEffectiveUserId(storageMessage.value);}}break;case _webViewStorage.StorageMessageType.STORAGE_ERROR:_logger.logger.error("WebView storage error:",storageMessage.error);break;}return;}if(__DEV__){if((parsedData==null?void 0:parsedData.type)==="CONSOLE"){console.log(`WebView ${parsedData==null?void 0:parsedData.level}:`,parsedData==null?void 0:parsedData.data);return;}if((parsedData==null?void 0:parsedData.type)==="ERROR"){console.error("WebView Error:",parsedData==null?void 0:parsedData.data);return;}}if((parsedData==null?void 0:parsedData.type)==="SYSTEM_INFO"){var _parsedData$data;setSystemInfo((_parsedData$data=parsedData==null?void 0:parsedData.data)!=null?_parsedData$data:{os:"",browser:""});systemInfoRef.current=parsedData==null?void 0:parsedData.data;return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current3,_webViewRef$current4;(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.injectJavaScript((0,_systemInfo.getBrowserAndOSInfoScript)());var messageData={name:"registerUserId",action:"registerUserId",data:{userId:effectiveUserId,token:user_token?`${user_token}`:undefined,userProfile:Object.assign({},user_profile,(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current),{__INT_SYS_INFO__:Object.assign({},(0,_systemInfo.getSystemInfo)(systemInfoRef==null?void 0:systemInfoRef.current))})}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript(`
6
6
  window.postMessage(${JSON.stringify({name:"openFrame",domain:"app-domain.com"})}, '*');
7
7
  window.postMessage(${JSON.stringify(messageData)}, '*');
8
- `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"download_file":if(parsedData!=null&&parsedData.data||parsedData!=null&&parsedData.url&&parsedData!=null&&parsedData.filename){var downloadData=(parsedData==null?void 0:parsedData.data)||{url:parsedData==null?void 0:parsedData.url,filename:parsedData==null?void 0:parsedData.filename};(0,_fileDownload.handleDownloadRequest)(downloadData);}break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;case"REQUEST_MIC_PERMISSION":var granted=yield requestAndroidMicPermission();if(webViewRef.current&&isWebViewVisible){var _webViewRef$current5;var _messageData={name:"requestMicPermission",action:"requestMicPermission",type:granted?"MIC_PERMISSION_GRANTED":"MIC_PERMISSION_DENIED"};_logger.logger.debug("messageData====>",JSON.stringify(_messageData));(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript(`
9
- window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x2){return _ref3.apply(this,arguments);};}(),[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref4.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",image_url:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.display_name)||"",welcome_message:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config8=_orgInfo$brand_config7.interface_properties)==null?void 0:_orgInfo$brand_config8.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config9=(_orgInfo$brand_config10=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config11=_orgInfo$brand_config10.interface_properties)==null?void 0:_orgInfo$brand_config11.side_spacing)!=null?_orgInfo$brand_config9:20,bottom_spacing:(_orgInfo$brand_config12=(_orgInfo$brand_config13=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config14=_orgInfo$brand_config13.interface_properties)==null?void 0:_orgInfo$brand_config14.bottom_spacing)!=null?_orgInfo$brand_config12:20},interface_type:((_orgInfo$brand_config15=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config15.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config18=_orgInfo$brand_config17.launcher_properties)==null?void 0:_orgInfo$brand_config18.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config19=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config20=_orgInfo$brand_config19.images)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.launcher_image_url)==null?void 0:_orgInfo$brand_config21.url)||_constants.DEFAULT_LAUNCHER_IMAGE}},chat_iframe_url:((_orgInfo$brand_config22=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config22.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref5.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);(0,_react.useEffect)(function(){var warmupOrigins=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){var apiOrigin=getOriginFromUrl(_constants.API_URL);var chatbotOrigin=getOriginFromUrl(_constants.BASE_CHATBOT_URL);yield Promise.allSettled([warmupHttpOrigin(apiOrigin),warmupHttpOrigin(chatbotOrigin)]);});return function warmupOrigins(){return _ref6.apply(this,arguments);};}();warmupOrigins();},[]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
8
+ `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();break;case"download_file":if(parsedData!=null&&parsedData.data||parsedData!=null&&parsedData.url&&parsedData!=null&&parsedData.filename){var downloadData=(parsedData==null?void 0:parsedData.data)||{url:parsedData==null?void 0:parsedData.url,filename:parsedData==null?void 0:parsedData.filename,inPlace:parsedData==null?void 0:parsedData.inPlace};(0,_fileDownload.handleDownloadRequest)(downloadData);}break;case"CHATBOT_LOADED":emitEvent(_events.ChatbotEventType.CHATBOT_LOADED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZED,parsedData==null?void 0:parsedData.data);break;case"SESSION_REFRESHED":emitEvent(_events.ChatbotEventType.SESSION_REFRESHED,parsedData==null?void 0:parsedData.data);break;case"CHAT_INITIALIZATION_FAILED":emitEvent(_events.ChatbotEventType.CHAT_INITIALIZATION_FAILED,parsedData==null?void 0:parsedData.data);break;case"REQUEST_MIC_PERMISSION":var granted=yield requestAndroidMicPermission();if(webViewRef.current&&isWebViewVisible){var _webViewRef$current5;var _messageData={name:"requestMicPermission",action:"requestMicPermission",type:granted?"MIC_PERMISSION_GRANTED":"MIC_PERMISSION_DENIED"};(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript(`
9
+ window.postMessage(${JSON.stringify(_messageData)}, '*');`);}break;default:if(onMessage)onMessage(parsedData!=null?parsedData:{});}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to parse WebView message"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{messageData:data}});}});return function(_x){return _ref2.apply(this,arguments);};}(),[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){var userId=user_id?String(user_id):undefined;if(!userId){userId=memoryCache.current["rblyn_anon"];if(!userId){userId=(0,_cookieUtils.generateUUID)();executeStorageOp(function(){var _webViewRef$current6;(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref3.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){try{var _data$user;var endpointUrl=`${_constants.API_URL}/chat/chatbot/get/`;var payload={client_user_id:effectiveUserId,org_id:api_key,token:user_token,extra_info:{}};var response=yield fetch(endpointUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)});if(!response.ok){throw new Error("Failed to fetch chatbot configuration");}var data=yield response.json();var orgInfo=data==null?void 0:(_data$user=data.user)==null?void 0:_data$user.org_info;if(orgInfo){var _orgInfo$brand_config,_orgInfo$brand_config2,_orgInfo$brand_config3,_orgInfo$brand_config4,_orgInfo$brand_config5,_orgInfo$brand_config6,_orgInfo$brand_config7,_orgInfo$brand_config8,_orgInfo$brand_config9,_orgInfo$brand_config10,_orgInfo$brand_config11,_orgInfo$brand_config12,_orgInfo$brand_config13,_orgInfo$brand_config14,_orgInfo$brand_config15,_orgInfo$brand_config16,_orgInfo$brand_config17,_orgInfo$brand_config18,_orgInfo$brand_config19,_orgInfo$brand_config20,_orgInfo$brand_config21,_orgInfo$brand_config22;var config={brand_colour:((_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config2=_orgInfo$brand_config.colors)==null?void 0:_orgInfo$brand_config2.brand_color)||"",image_url:((_orgInfo$brand_config3=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config3.launcher_logo_url)||"",chat_interface_config:{chat_bubble_prompts:[],display_name:((_orgInfo$brand_config4=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config4.display_name)||"",welcome_message:((_orgInfo$brand_config5=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config5.welcome_message)||"Hey! What can we help you with today?",redirect_url:((_orgInfo$brand_config6=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config6.redirect_url)||""},interface_properties:{position:((_orgInfo$brand_config7=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config8=_orgInfo$brand_config7.interface_properties)==null?void 0:_orgInfo$brand_config8.position)||WidgetPositionEnums.RIGHT,side_spacing:(_orgInfo$brand_config9=(_orgInfo$brand_config10=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config11=_orgInfo$brand_config10.interface_properties)==null?void 0:_orgInfo$brand_config11.side_spacing)!=null?_orgInfo$brand_config9:20,bottom_spacing:(_orgInfo$brand_config12=(_orgInfo$brand_config13=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config14=_orgInfo$brand_config13.interface_properties)==null?void 0:_orgInfo$brand_config14.bottom_spacing)!=null?_orgInfo$brand_config12:20},interface_type:((_orgInfo$brand_config15=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config15.interface_type)||ChatbotInterfaceType.WIDGET,launcher_type:((_orgInfo$brand_config16=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config16.launcher_type)||LauncherType.IMAGE,launcher_properties:{text:((_orgInfo$brand_config17=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config18=_orgInfo$brand_config17.launcher_properties)==null?void 0:_orgInfo$brand_config18.text)||""},images:{launcher_image_url:{url:((_orgInfo$brand_config19=orgInfo.brand_config)==null?void 0:(_orgInfo$brand_config20=_orgInfo$brand_config19.images)==null?void 0:(_orgInfo$brand_config21=_orgInfo$brand_config20.launcher_image_url)==null?void 0:_orgInfo$brand_config21.url)||_constants.DEFAULT_LAUNCHER_IMAGE}},chat_iframe_url:((_orgInfo$brand_config22=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config22.chat_iframe_url)||""};setChatbotConfig(config);}}catch(error){_ErrorTrackingService.errorTracker.trackError(error instanceof Error?error:new Error("Failed to fetch chatbot configuration"),"ChatbotSDK",{type:_errorConstants.ErrorTypes.NETWORK_ERROR,context:{api_key:api_key,user_id:user_id}});}finally{setLoading(false);}});return function fetchChatbotConfig(){return _ref4.apply(this,arguments);};}();if(api_key&&effectiveUserId){fetchChatbotConfig();}},[api_key,effectiveUserId,user_token]);function constructUrl(){if(!effectiveUserId)return"";var params=new URLSearchParams({id:api_key});return`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){(0,_animations.animateWebViewOpen)(animatedValues,function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{requestAnimationFrame(function(){externalOnOpen==null?void 0:externalOnOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,animatedValues,externalOnOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}if(enableAnimation){(0,_animations.animateWebViewClose)(animatedValues,function(){setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);});}else{setIsWebViewVisible(false);externalOnClose==null?void 0:externalOnClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);}},[enableAnimation,animatedValues,externalOnClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);(0,_react.useEffect)(function(){if(!loading&&chatbotConfig&&effectiveUserId&&!isInitialized){setIsInitialized(true);onReady==null?void 0:onReady();}},[loading,chatbotConfig,effectiveUserId,isInitialized,onReady]);var getScreenDimensions=function getScreenDimensions(){var windowHeight=_reactNative.Dimensions.get("window").height;var windowWidth=_reactNative.Dimensions.get("window").width;var statusBarHeight=_reactNative.Platform.OS==="ios"?0:_reactNative.StatusBar.currentHeight||0;return{height:windowHeight-statusBarHeight,width:windowWidth};};var requestAndroidMicPermission=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){try{if(_reactNative.Platform.OS==="ios"){return true;}var alreadyGranted=yield _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);if(alreadyGranted){return true;}var result=yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone permission",message:"This app uses your microphone for voice features.",buttonPositive:"Allow",buttonNegative:"Deny"});var granted=result===_reactNative.PermissionsAndroid.RESULTS.GRANTED;if(!granted){_reactNative.Alert.alert("Microphone required","Voice features will not work unless you allow microphone access.");}return granted;}catch(err){console.warn("Error requesting mic permission",err);return false;}}),[]);var screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var position=(chatbotConfig==null?void 0:(_chatbotConfig$interf=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf.position)||"Right";var sideSpacing=(_chatbotConfig$interf2=chatbotConfig==null?void 0:(_chatbotConfig$interf3=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf3.side_spacing)!=null?_chatbotConfig$interf2:20;var bottomSpacing=(_chatbotConfig$interf4=chatbotConfig==null?void 0:(_chatbotConfig$interf5=chatbotConfig.interface_properties)==null?void 0:_chatbotConfig$interf5.bottom_spacing)!=null?_chatbotConfig$interf4:20;return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles==null?void 0:styles.mainContainer,children:[!loading&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"FloatingButton",children:show_floating_button&&api_key&&chatbotConfig&&(0,_jsxRuntime.jsx)(_FloatingButton.default,{chatbotConfig:chatbotConfig,isWebViewVisible:isWebViewVisible,onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_colour,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.webViewWrapper,{height:isWebViewVisible?"100%":0}],pointerEvents:isWebViewVisible?"auto":"none",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.fullScreenContainer,{opacity:animatedValues.opacity,transform:[{scale:animatedValues.scale},{translateY:animatedValues.translateY}]}],children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{mediaCapturePermissionGrantType:"grant",webviewDebuggingEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,containerStyle:isFullScreen?{width:screenDimensions.width,height:screenDimensions.height-40}:undefined,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){return request.url.startsWith(_constants.BASE_CHATBOT_URL)||request.url.startsWith((chatbotConfig==null?void 0:chatbotConfig.chat_iframe_url)||"");},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current8;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current8=webViewRef.current)==null?void 0:_webViewRef$current8.injectJavaScript(`
10
10
  if (!document.querySelector('meta[name="viewport"]')) {
11
11
  var meta = document.createElement('meta');
12
12
  meta.name = 'viewport';
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getOriginFromUrl","url","_URL$origin","_URL","URL","origin","_unused","warmupHttpOrigin","_ref","_asyncToGenerator2","fetch","method","_unused2","_unused3","_x","apply","arguments","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref2","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref2$show_floating_b","show_floating_button","onEvent","onMessage","_ref2$isFullScreen","isFullScreen","_ref2$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","useCallback","operation","push","handleMessage","_ref3","event","_webViewRef$current2","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_webViewRef$current4","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","filename","downloadData","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","_x2","useEffect","initializeUserId","_ref4","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref5","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","config","brand_colour","brand_config","colors","brand_color","image_url","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","images","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","warmupOrigins","_ref6","apiOrigin","chatbotOrigin","BASE_CHATBOT_URL","Promise","allSettled","constructUrl","params","URLSearchParams","id","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"+aAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+BACA,IAAAa,eAAA,CAAAb,OAAA,+BAMA,IAAAc,qBAAA,CAAAd,OAAA,oCACA,IAAAe,YAAA,CAAAf,OAAA,wBACA,IAAAgB,eAAA,CAAAhB,OAAA,2BAMA,IAAAiB,WAAA,CAAAjB,OAAA,uBACA,IAAAkB,aAAA,CAAAlB,OAAA,yBAA8E,IAAAmB,WAAA,CAAAnB,OAAA,0BAAAoB,KAAA,MAAAC,YAAA,+GAAAtB,wBAAAuB,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAzB,uBAAA,UAAAA,wBAAAuB,C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AE,SACZ,CAAC,CACDlC,cAAc,CAAE,CACdjF,QAAQ,CAAE,UAAU,CACpBoH,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTJ,QAAQ,CAAE,SAAS,CACnBK,MAAM,CAAE,KAAK,CACbC,eAAe,CAAE,SACnB,CAAC,CACDtC,mBAAmB,CAAE,CACnBnF,QAAQ,CAAE,UAAU,CACpBoH,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAAhW,OAAA,CAAA5B,OAAA,CAEY+B,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_animations","_fileDownload","_jsxRuntime","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChatbotInterfaceType","exports","WidgetPositionEnums","LauncherType","Chatbot","forwardRef","_ref","ref","_chatbotConfig$interf","_chatbotConfig$interf2","_chatbotConfig$interf3","_chatbotConfig$interf4","_chatbotConfig$interf5","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","externalOnOpen","onOpen","externalOnClose","onClose","onReady","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","_useState7","_useState8","isInitialized","setIsInitialized","webViewRef","useRef","isFirstLoadRef","_useState9","_useState10","toastVisible","setToastVisible","_useState11","_useState12","toastMessage","setToastMessage","_useState13","_useState14","effectiveUserId","setEffectiveUserId","_useState15","_useState16","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState17","os","browser","_useState18","systemInfo","setSystemInfo","systemInfoRef","animatedValues","scale","Animated","Value","translateY","opacity","current","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","useImperativeHandle","open","openWebView","close","closeWebView","toggle","isReady","triggerAppInit","_webViewRef$current","injectJavaScript","getBrowserAndOSInfoScript","executeStorageOp","useCallback","operation","push","handleMessage","_ref2","_asyncToGenerator2","event","_webViewRef$current2","data","nativeEvent","parsedData","JSON","parse","values","StorageMessageType","includes","type","storageMessage","STORAGE_READY","forEach","op","createStorageMessage","GET_STORAGE","STORAGE_RESPONSE","key","value","STORAGE_ERROR","logger","error","__DEV__","console","log","level","_parsedData$data","ChatbotEventType","CHATBOT_APP_READY","_webViewRef$current3","_webViewRef$current4","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","__INT_SYS_INFO__","debug","stringify","domain","url","filename","downloadData","inPlace","handleDownloadRequest","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","granted","requestAndroidMicPermission","_webViewRef$current5","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","_x","apply","arguments","useEffect","initializeUserId","_ref3","String","generateUUID","_webViewRef$current6","SET_STORAGE","getStorageScript","_webViewRef$current7","fetchChatbotConfig","_ref4","_data$user","endpointUrl","API_URL","payload","client_user_id","org_id","extra_info","response","fetch","method","headers","body","ok","json","orgInfo","user","org_info","_orgInfo$brand_config","_orgInfo$brand_config2","_orgInfo$brand_config3","_orgInfo$brand_config4","_orgInfo$brand_config5","_orgInfo$brand_config6","_orgInfo$brand_config7","_orgInfo$brand_config8","_orgInfo$brand_config9","_orgInfo$brand_config10","_orgInfo$brand_config11","_orgInfo$brand_config12","_orgInfo$brand_config13","_orgInfo$brand_config14","_orgInfo$brand_config15","_orgInfo$brand_config16","_orgInfo$brand_config17","_orgInfo$brand_config18","_orgInfo$brand_config19","_orgInfo$brand_config20","_orgInfo$brand_config21","_orgInfo$brand_config22","config","brand_colour","brand_config","colors","brand_color","image_url","launcher_logo_url","chat_interface_config","chat_bubble_prompts","display_name","welcome_message","redirect_url","interface_properties","position","RIGHT","side_spacing","bottom_spacing","interface_type","WIDGET","launcher_type","IMAGE","launcher_properties","text","images","launcher_image_url","DEFAULT_LAUNCHER_IMAGE","chat_iframe_url","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","toString","animateWebViewOpen","CHATBOT_OPENED","setTimeout","requestAnimationFrame","postMessage","animateWebViewClose","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","alreadyGranted","PermissionsAndroid","check","PERMISSIONS","RECORD_AUDIO","result","request","title","message","buttonPositive","buttonNegative","RESULTS","GRANTED","Alert","alert","err","warn","screenDimensions","enableNetworkDebug","sideSpacing","bottomSpacing","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","webViewWrapper","pointerEvents","fullScreenContainer","transform","WebView","mediaCapturePermissionGrantType","webviewDebuggingEnabled","source","uri","webview","containerStyle","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current8","enableWebViewDebug","onError","syntheticEvent","description","code","displayName","StyleSheet","create","flex","overflow","top","left","right","bottom","zIndex","backgroundColor","inlineContainer","_default"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"+aAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WASA,IAAAC,YAAA,CAAAD,OAAA,iBAYA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBAKA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAP,sBAAA,CAAAJ,OAAA,8BACA,IAAAY,cAAA,CAAAZ,OAAA,+BACA,IAAAa,eAAA,CAAAb,OAAA,+BAMA,IAAAc,qBAAA,CAAAd,OAAA,oCACA,IAAAe,YAAA,CAAAf,OAAA,wBACA,IAAAgB,eAAA,CAAAhB,OAAA,2BAMA,IAAAiB,WAAA,CAAAjB,OAAA,uBACA,IAAAkB,aAAA,CAAAlB,OAAA,yBAA8E,IAAAmB,WAAA,CAAAnB,OAAA,0BAAAoB,KAAA,MAAAC,YAAA,+GAAAtB,wBAAAuB,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAzB,uBAAA,UAAAA,wBAAAuB,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,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NC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTE,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KAAK,CACbL,QAAQ,CAAE,SAEZ,CAAC,CACDO,eAAe,CAAE,CACfR,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OACnB,CAAC,CACD/B,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPO,eAAe,CAAE,OAAO,CACxBD,MAAM,CAAE,KACV,CACF,CAAC,CAAC,CAAC,IAAAG,QAAA,CAAAjW,OAAA,CAAAX,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.config=void 0;var config=exports.config={API_URL:process&&process.env&&process.env.API_URL||"https://stage-api.robylon.ai"||'https://api.robylon.com',DEBUG:(process&&process.env&&process.env.DEBUG||"true")==='true'};
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.config=void 0;var config=exports.config={API_URL:process&&process.env&&process.env.API_URL||"https://api.robylon.ai"||'https://api.robylon.com',DEBUG:(process&&process.env&&process.env.DEBUG||"false")==='true'};
2
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["config","exports","API_URL","process","env","process.env","DEBUG"],"sourceRoot":"../../src","sources":["config.ts"],"mappings":"+EAAO,GAAM,CAAAA,MAAM,CAAAC,OAAA,CAAAD,MAAA,CAAG,CACpBE,OAAO,CAAEC,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAH,OAAA,kCAAuB,yBAAyB,CACzDI,KAAK,CAAE,CAAAH,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAC,KAAA,YAAsB,MAC/B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["config","exports","API_URL","process","env","process.env","DEBUG"],"sourceRoot":"../../src","sources":["config.ts"],"mappings":"+EAAO,GAAM,CAAAA,MAAM,CAAAC,OAAA,CAAAD,MAAA,CAAG,CACpBE,OAAO,CAAEC,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAH,OAAA,4BAAuB,yBAAyB,CACzDI,KAAK,CAAE,CAAAH,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAC,KAAA,aAAsB,MAC/B,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.DEFAULT_LAUNCHER_IMAGE=exports.BASE_CHATBOT_URL=exports.API_URL=void 0;var BASE_CHATBOT_DOMAIN=process&&process.env&&process.env.CHATBOT_DOMAIN||"https://staging.d2s3wsqyyond1h.amplifyapp.com"||"";var CHATBOT_PATH=process&&process.env&&process.env.CHATBOT_PATH||"chatbot-plugin"||"";var BASE_CHATBOT_URL=exports.BASE_CHATBOT_URL=`${BASE_CHATBOT_DOMAIN}/${CHATBOT_PATH}`;var API_URL=exports.API_URL=process&&process.env&&process.env.API_URL||"https://stage-api.robylon.ai";var DEFAULT_LAUNCHER_IMAGE=exports.DEFAULT_LAUNCHER_IMAGE=`${BASE_CHATBOT_DOMAIN}/chatbubble.png`;
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.DEFAULT_LAUNCHER_IMAGE=exports.BASE_CHATBOT_URL=exports.API_URL=void 0;var BASE_CHATBOT_DOMAIN=process&&process.env&&process.env.CHATBOT_DOMAIN||"https://chatbot.robylon.ai"||"";var CHATBOT_PATH=process&&process.env&&process.env.CHATBOT_PATH||"chatbot-plugin"||"";var BASE_CHATBOT_URL=exports.BASE_CHATBOT_URL=`${BASE_CHATBOT_DOMAIN}/${CHATBOT_PATH}`;var API_URL=exports.API_URL=process&&process.env&&process.env.API_URL||"https://api.robylon.ai";var DEFAULT_LAUNCHER_IMAGE=exports.DEFAULT_LAUNCHER_IMAGE=`${BASE_CHATBOT_DOMAIN}/chatbubble.png`;
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_CHATBOT_DOMAIN","process","env","process.env","CHATBOT_DOMAIN","CHATBOT_PATH","BASE_CHATBOT_URL","exports","API_URL","DEFAULT_LAUNCHER_IMAGE"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":"wIAAA,GAAM,CAAAA,mBAAmB,CAAGC,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAC,cAAA,mDAA8B,EAAE,CAC5D,GAAM,CAAAC,YAAY,CAAGJ,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAE,YAAA,oBAA4B,EAAE,CAC5C,GAAM,CAAAC,gBAAgB,CAAAC,OAAA,CAAAD,gBAAA,CAAG,GAAGN,mBAAmB,IAAIK,YAAY,EAAE,CACjE,GAAM,CAAAG,OAAO,CAAAD,OAAA,CAAAC,OAAA,CAAAP,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAK,OAAA,gCAAsB,CACnC,GAAM,CAAAC,sBAAsB,CAAAF,OAAA,CAAAE,sBAAA,CAAG,GAAGT,mBAAmB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["BASE_CHATBOT_DOMAIN","process","env","process.env","CHATBOT_DOMAIN","CHATBOT_PATH","BASE_CHATBOT_URL","exports","API_URL","DEFAULT_LAUNCHER_IMAGE"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":"wIAAA,GAAM,CAAAA,mBAAmB,CAAGC,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAC,cAAA,gCAA8B,EAAE,CAC5D,GAAM,CAAAC,YAAY,CAAGJ,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAE,YAAA,oBAA4B,EAAE,CAC5C,GAAM,CAAAC,gBAAgB,CAAAC,OAAA,CAAAD,gBAAA,CAAG,GAAGN,mBAAmB,IAAIK,YAAY,EAAE,CACjE,GAAM,CAAAG,OAAO,CAAAD,OAAA,CAAAC,OAAA,CAAAP,OAAA,EAAAA,OAAA,CAAAC,GAAA,EAAAC,WAAA,CAAAK,OAAA,0BAAsB,CACnC,GAAM,CAAAC,sBAAsB,CAAAF,OAAA,CAAAE,sBAAA,CAAG,GAAGT,mBAAmB,iBAAiB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.handleDownloadRequest=exports.downloadFile=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _logger=require("./logger");var downloadFile=exports.downloadFile=function(){var _ref=(0,_asyncToGenerator2.default)(function*(url,filename){try{_logger.logger.debug("Initiating file download",{url:url,filename:filename});if(!url||typeof url!=="string"){throw new Error("Invalid URL provided for download");}var supported=yield _reactNative.Linking.canOpenURL(url);if(!supported){throw new Error("Cannot open the provided URL");}yield _reactNative.Linking.openURL(url);_logger.logger.debug("File download initiated successfully");}catch(error){_logger.logger.error("File download failed",{url:url,filename:filename,error:error});throw error;}});return function downloadFile(_x,_x2){return _ref.apply(this,arguments);};}();var handleDownloadRequest=exports.handleDownloadRequest=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(downloadRequest){var url=downloadRequest.url,filename=downloadRequest.filename;if(!url){_logger.logger.error("Download request missing URL");return;}try{yield downloadFile(url,filename);}catch(error){_logger.logger.error("Failed to handle download request",{downloadRequest:downloadRequest,error:error});}});return function handleDownloadRequest(_x3){return _ref2.apply(this,arguments);};}();
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.handleDownloadRequest=exports.downloadFile=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _logger=require("./logger");var normalizeUrl=function normalizeUrl(url){return url==null?void 0:url.trim();};var getUrlPathTail=function getUrlPathTail(url){var _url$split,_cleanedUrl$split,_cleanedUrl$split$pop;var cleanedUrl=(url==null?void 0:(_url$split=url.split("?"))==null?void 0:_url$split[0])||"";return(cleanedUrl==null?void 0:(_cleanedUrl$split=cleanedUrl.split("/"))==null?void 0:(_cleanedUrl$split$pop=_cleanedUrl$split.pop())==null?void 0:_cleanedUrl$split$pop.trim())||"";};var getExtensionFromName=function getExtensionFromName(name){if(!(name!=null&&name.includes(".")))return"";return name.substring(name.lastIndexOf("."));};var resolveDownloadFileName=function resolveDownloadFileName(filename,url){var trimmedName=filename==null?void 0:filename.trim();if(trimmedName){var sanitizedName=trimmedName.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_");var urlExtension=getExtensionFromName(getUrlPathTail(url));if(getExtensionFromName(sanitizedName)||!urlExtension)return sanitizedName;return`${sanitizedName}${urlExtension}`;}var tailName=getUrlPathTail(url);if(tailName)return tailName.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_");return`download-robylon-${Date.now()}`;};var isValidHttpUrl=function isValidHttpUrl(url){return /^https?:\/\//i.test(url);};var getNativeDownloadModule=function getNativeDownloadModule(){return(_reactNative.NativeModules==null?void 0:_reactNative.NativeModules.RobylonDownloadModule)||null;};var openUrlWithFallback=function(){var _ref=(0,_asyncToGenerator2.default)(function*(url){try{yield _reactNative.Linking.openURL(url);return;}catch(primaryError){_logger.logger.warn("Primary URL open failed, trying browser fallback",{url:url,primaryError:primaryError instanceof Error?primaryError==null?void 0:primaryError.message:String(primaryError)});}yield _reactNative.Linking.openURL(`https://docs.google.com/viewer?url=${encodeURIComponent(url)}`);});return function openUrlWithFallback(_x){return _ref.apply(this,arguments);};}();var downloadOnAndroid=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(url,filename){var module=getNativeDownloadModule();if(!(module!=null&&module.downloadFile)){throw new Error("Robylon native download module is not linked on Android");}yield module.downloadFile(url,filename);});return function downloadOnAndroid(_x2,_x3){return _ref2.apply(this,arguments);};}();var downloadOniOS=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(url,filename){var module=getNativeDownloadModule();if(!(module!=null&&module.downloadFile)){throw new Error("Robylon native download module is not linked on iOS");}yield module.downloadFile(url,filename);});return function downloadOniOS(_x4,_x5){return _ref3.apply(this,arguments);};}();var downloadWithNativeStorage=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(url,filename){var safeName=resolveDownloadFileName(filename,url);if(_reactNative.Platform.OS==="android"){yield downloadOnAndroid(url,safeName);return;}if(_reactNative.Platform.OS==="ios"){yield downloadOniOS(url,safeName);return;}yield openUrlWithFallback(url);});return function downloadWithNativeStorage(_x6,_x7){return _ref4.apply(this,arguments);};}();var shouldUseInPlaceDownload=function shouldUseInPlaceDownload(downloadRequest){return(downloadRequest==null?void 0:downloadRequest.inPlace)===true;};var downloadFile=exports.downloadFile=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(url,filename,inPlace){try{var normalizedUrl=normalizeUrl(url);_logger.logger.debug("Initiating file download",{url:normalizedUrl,filename:filename});if(!normalizedUrl||typeof normalizedUrl!=="string"){throw new Error("Invalid URL provided for download");}if(!isValidHttpUrl(normalizedUrl)){throw new Error("Download URL must be an http/https URL");}if(inPlace){try{yield downloadWithNativeStorage(normalizedUrl,filename);_logger.logger.debug("File downloaded with native storage flow");}catch(nativeDownloadError){_logger.logger.warn("Native download failed, falling back to URL open",{url:normalizedUrl,nativeDownloadError:nativeDownloadError instanceof Error?nativeDownloadError==null?void 0:nativeDownloadError.message:String(nativeDownloadError)});yield openUrlWithFallback(normalizedUrl);_logger.logger.debug("File download opened with fallback browser flow");}return;}yield openUrlWithFallback(normalizedUrl);_logger.logger.debug("File download opened with legacy URL flow");}catch(error){_logger.logger.error("File download failed",{url:url,filename:filename,error:error instanceof Error?error==null?void 0:error.message:String(error)});throw error;}});return function downloadFile(_x8,_x9,_x10){return _ref5.apply(this,arguments);};}();var handleDownloadRequest=exports.handleDownloadRequest=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(downloadRequest){var url=downloadRequest.url,filename=downloadRequest.filename;if(!url){_logger.logger.error("Download request missing URL");return;}try{yield downloadFile(url,filename,shouldUseInPlaceDownload(downloadRequest));}catch(error){_logger.logger.error("Failed to handle download request",{downloadRequest:downloadRequest,error:error});}});return function handleDownloadRequest(_x11){return _ref6.apply(this,arguments);};}();
2
2
  //# sourceMappingURL=fileDownload.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_logger","downloadFile","exports","_ref","_asyncToGenerator2","default","url","filename","logger","debug","Error","supported","Linking","canOpenURL","openURL","error","_x","_x2","apply","arguments","handleDownloadRequest","_ref2","downloadRequest","_x3"],"sourceRoot":"../../../src","sources":["utils/fileDownload.ts"],"mappings":"wSAKA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,OAAA,CAAAD,OAAA,aAYO,GAAM,CAAAE,YAAY,CAAAC,OAAA,CAAAD,YAAA,gBAAAE,IAAA,IAAAC,kBAAA,CAAAC,OAAA,EAAG,UAC1BC,GAAW,CACXC,QAAiB,CACC,CAClB,GAAI,CACFC,cAAM,CAACC,KAAK,CAAC,0BAA0B,CAAE,CAAEH,GAAG,CAAHA,GAAG,CAAEC,QAAQ,CAARA,QAAS,CAAC,CAAC,CAG3D,GAAI,CAACD,GAAG,EAAI,MAAO,CAAAA,GAAG,GAAK,QAAQ,CAAE,CACnC,KAAM,IAAI,CAAAI,KAAK,CAAC,mCAAmC,CAAC,CACtD,CAIA,GAAM,CAAAC,SAAS,MAAS,CAAAC,oBAAO,CAACC,UAAU,CAACP,GAAG,CAAC,CAE/C,GAAI,CAACK,SAAS,CAAE,CACd,KAAM,IAAI,CAAAD,KAAK,CAAC,8BAA8B,CAAC,CACjD,CAEA,KAAM,CAAAE,oBAAO,CAACE,OAAO,CAACR,GAAG,CAAC,CAC1BE,cAAM,CAACC,KAAK,CAAC,sCAAsC,CAAC,CACtD,CAAE,MAAOM,KAAK,CAAE,CACdP,cAAM,CAACO,KAAK,CAAC,sBAAsB,CAAE,CAAET,GAAG,CAAHA,GAAG,CAAEC,QAAQ,CAARA,QAAQ,CAAEQ,KAAK,CAALA,KAAM,CAAC,CAAC,CAC9D,KAAM,CAAAA,KAAK,CACb,CACF,CAAC,iBA1BY,CAAAd,YAAYA,CAAAe,EAAA,CAAAC,GAAA,SAAAd,IAAA,CAAAe,KAAA,MAAAC,SAAA,OA0BxB,CAMM,GAAM,CAAAC,qBAAqB,CAAAlB,OAAA,CAAAkB,qBAAA,gBAAAC,KAAA,IAAAjB,kBAAA,CAAAC,OAAA,EAAG,UACnCiB,eAAgC,CACd,CAClB,GAAQ,CAAAhB,GAAG,CAAegB,eAAe,CAAjChB,GAAG,CAAEC,QAAQ,CAAKe,eAAe,CAA5Bf,QAAQ,CAErB,GAAI,CAACD,GAAG,CAAE,CACRE,cAAM,CAACO,KAAK,CAAC,8BAA8B,CAAC,CAC5C,OACF,CAEA,GAAI,CACF,KAAM,CAAAd,YAAY,CAACK,GAAG,CAAEC,QAAQ,CAAC,CACnC,CAAE,MAAOQ,KAAK,CAAE,CACdP,cAAM,CAACO,KAAK,CAAC,mCAAmC,CAAE,CAChDO,eAAe,CAAfA,eAAe,CACfP,KAAK,CAALA,KACF,CAAC,CAAC,CAEJ,CACF,CAAC,iBAnBY,CAAAK,qBAAqBA,CAAAG,GAAA,SAAAF,KAAA,CAAAH,KAAA,MAAAC,SAAA,OAmBjC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_logger","normalizeUrl","url","trim","getUrlPathTail","_url$split","_cleanedUrl$split","_cleanedUrl$split$pop","cleanedUrl","split","pop","getExtensionFromName","name","includes","substring","lastIndexOf","resolveDownloadFileName","filename","trimmedName","sanitizedName","replace","urlExtension","tailName","Date","now","isValidHttpUrl","test","getNativeDownloadModule","NativeModules","RobylonDownloadModule","openUrlWithFallback","_ref","_asyncToGenerator2","default","Linking","openURL","primaryError","logger","warn","Error","message","String","encodeURIComponent","_x","apply","arguments","downloadOnAndroid","_ref2","module","downloadFile","_x2","_x3","downloadOniOS","_ref3","_x4","_x5","downloadWithNativeStorage","_ref4","safeName","Platform","OS","_x6","_x7","shouldUseInPlaceDownload","downloadRequest","inPlace","exports","_ref5","normalizedUrl","debug","nativeDownloadError","error","_x8","_x9","_x10","handleDownloadRequest","_ref6","_x11"],"sourceRoot":"../../../src","sources":["utils/fileDownload.ts"],"mappings":"wSAKA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,OAAA,CAAAD,OAAA,aAQA,GAAM,CAAAE,YAAY,CAAG,QAAf,CAAAA,YAAYA,CAAIC,GAAW,CAAa,CAC5C,MAAO,CAAAA,GAAG,cAAHA,GAAG,CAAEC,IAAI,CAAC,CAAC,CACpB,CAAC,CAED,GAAM,CAAAC,cAAc,CAAG,QAAjB,CAAAA,cAAcA,CAAIF,GAAY,CAAa,KAAAG,UAAA,CAAAC,iBAAA,CAAAC,qBAAA,CAC/C,GAAM,CAAAC,UAAU,CAAG,CAAAN,GAAG,eAAAG,UAAA,CAAHH,GAAG,CAAEO,KAAK,CAAC,GAAG,CAAC,eAAfJ,UAAA,CAAkB,CAAC,CAAC,GAAI,EAAE,CAC7C,MAAO,CAAAG,UAAU,eAAAF,iBAAA,CAAVE,UAAU,CAAEC,KAAK,CAAC,GAAG,CAAC,gBAAAF,qBAAA,CAAtBD,iBAAA,CAAwBI,GAAG,CAAC,CAAC,eAA7BH,qBAAA,CAA+BJ,IAAI,CAAC,CAAC,GAAI,EAAE,CACpD,CAAC,CAED,GAAM,CAAAQ,oBAAoB,CAAG,QAAvB,CAAAA,oBAAoBA,CAAIC,IAAa,CAAa,CACtD,GAAI,EAACA,IAAI,QAAJA,IAAI,CAAEC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAO,EAAE,CACnC,MAAO,CAAAD,IAAI,CAACE,SAAS,CAACF,IAAI,CAACG,WAAW,CAAC,GAAG,CAAC,CAAC,CAC9C,CAAC,CAED,GAAM,CAAAC,uBAAuB,CAAG,QAA1B,CAAAA,uBAAuBA,CAAIC,QAAiB,CAAEf,GAAY,CAAa,C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,CAClB,GAAQ,CAAA9D,GAAG,CAAe8D,eAAe,CAAjC9D,GAAG,CAAEe,QAAQ,CAAK+C,eAAe,CAA5B/C,QAAQ,CAErB,GAAI,CAACf,GAAG,CAAE,CACRmC,cAAM,CAACkC,KAAK,CAAC,8BAA8B,CAAC,CAC5C,OACF,CAEA,GAAI,CACF,KAAM,CAAAtB,YAAY,CAChB/C,GAAG,CACHe,QAAQ,CACR8C,wBAAwB,CAACC,eAAe,CAC1C,CAAC,CACH,CAAE,MAAOO,KAAK,CAAE,CACdlC,cAAM,CAACkC,KAAK,CAAC,mCAAmC,CAAE,CAChDP,eAAe,CAAfA,eAAe,CACfO,KAAK,CAALA,KACF,CAAC,CAAC,CAEJ,CACF,CAAC,iBAvBY,CAAAI,qBAAqBA,CAAAE,IAAA,SAAAD,KAAA,CAAAhC,KAAA,MAAAC,SAAA,OAuBjC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.32-staging.4';
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.31-staging.6';
2
2
  //# sourceMappingURL=version.staging.js.map