@robylon/react-native-sdk 2.0.19-staging.20 → 2.0.19-staging.23

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.
@@ -1,11 +1,11 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=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 _version=require("./version");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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Chatbot=function Chatbot(_ref){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,onOpen=_ref.onOpen,onClose=_ref.onClose,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 webViewRef=(0,_react.useRef)(null);var fadeAnim=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;var isFirstLoadRef=(0,_react.useRef)(true);var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];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;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=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 _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _version=require("./version");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 _ChatbotWebView=_interopRequireDefault(require("./components/ChatbotWebView"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Chatbot=function Chatbot(_ref){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,onOpen=_ref.onOpen,onClose=_ref.onClose,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 webViewRef=(0,_react.useRef)(null);var fadeAnim=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;var isFirstLoadRef=(0,_react.useRef)(true);var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];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;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
5
  `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.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)(systemInfo))}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.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"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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(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$config,_orgInfo$brand_config,_orgInfo$config2;setChatbotConfig({brand_color:(orgInfo==null?void 0:(_orgInfo$config=orgInfo.config)==null?void 0:_orgInfo$config.brand_colour)||"#007AFF",image_url:(orgInfo==null?void 0:(_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config.launcher_logo_url)||"",welcome_message:(orgInfo==null?void 0:(_orgInfo$config2=orgInfo.config)==null?void 0:_orgInfo$config2.welcome_message)||""});}}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 _ref3.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});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return"https://demo.robylon.ai/chat/public/RG5x9i1fvk/";}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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 screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style: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,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{nestedScrollEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,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);},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
8
+ `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(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$config,_orgInfo$brand_config,_orgInfo$config2;setChatbotConfig({brand_color:(orgInfo==null?void 0:(_orgInfo$config=orgInfo.config)==null?void 0:_orgInfo$config.brand_colour)||"#007AFF",image_url:(orgInfo==null?void 0:(_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config.launcher_logo_url)||"",welcome_message:(orgInfo==null?void 0:(_orgInfo$config2=orgInfo.config)==null?void 0:_orgInfo$config2.welcome_message)||""});}}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 _ref3.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});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return"https://demo.robylon.ai/chat/public/RG5x9i1fvk/";}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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 screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var userAgent=_reactNative.Platform.select({android:"Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",ios:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"});return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style: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,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_ChatbotWebView.default,{ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,onDebugMessage:function onDebugMessage(message){console.log("WebView Debug:",message);},style:styles.webview,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){var allowedDomains=[_constants.BASE_CHATBOT_URL,"about:blank"];return allowedDomains.some(function(domain){return request.url.startsWith(domain);});},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
9
9
  if (!document.querySelector('meta[name="viewport"]')) {
10
10
  var meta = document.createElement('meta');
11
11
  meta.name = 'viewport';
@@ -71,6 +71,33 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
71
71
  }
72
72
  }
73
73
 
74
+ // Add touch event handlers
75
+ document.addEventListener('touchstart', function(e) {
76
+ e.stopPropagation();
77
+ }, true);
78
+
79
+ // Improve click handling
80
+ document.addEventListener('click', function(e) {
81
+ const clickedElement = e.target;
82
+ console.log('Clicked element:', clickedElement);
83
+
84
+ // Log the event for debugging
85
+ window.ReactNativeWebView.postMessage(JSON.stringify({
86
+ type: 'CONSOLE',
87
+ level: 'debug',
88
+ data: 'Click event fired on: ' + clickedElement.className
89
+ }));
90
+ }, true);
91
+
74
92
  true;
75
- `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});}})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
93
+ `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});},userAgent:userAgent,originWhitelist:["*"],mixedContentMode:"always",onContentProcessDidTerminate:function onContentProcessDidTerminate(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.reload();},injectedJavaScriptBeforeContentLoaded:`
94
+ window.onerror = function(message, source, lineno, colno, error) {
95
+ window.ReactNativeWebView.postMessage(JSON.stringify({
96
+ type: 'ERROR',
97
+ data: {message, source, lineno, colno}
98
+ }));
99
+ return true;
100
+ };
101
+ true;
102
+ `,androidLayerType:"hardware",overScrollMode:"never",textZoom:100,setSupportMultipleWindows:false,allowsBackForwardNavigationGestures:false,useWebKit:true,keyboardDisplayRequiresUserAction:false,hideKeyboardAccessoryView:true,applicationNameForUserAgent:"ChatbotApp"})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
76
103
  //# sourceMappingURL=Chatbotsdk.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","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$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_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$config","_orgInfo$brand_config","_orgInfo$config2","brand_color","config","brand_colour","image_url","brand_config","launcher_logo_url","welcome_message","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","WebView","nestedScrollEnabled","ref","source","uri","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,mBAAA,CAAAF,OAAA,yBACA,IAAAG,eAAA,CAAAC,sBAAA,CAAAJ,OAAA,sBACA,IAAAK,UAAA,CAAAL,OAAA,gBACA,IAAAM,QAAA,CAAAN,OAAA,cACA,IAAAO,WAAA,CAAAP,OAAA,uBACA,IAAAQ,kBAAA,CAAAR,OAAA,6BACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,OAAA,CAAAV,OAAA,mBACA,IAAAW,YAAA,CAAAX,OAAA,wBACA,IAAAY,YAAA,CAAAR,sBAAA,CAAAJ,OAAA,8BACA,IAAAa,cAAA,CAAAb,OAAA,+BACA,IAAAc,eAAA,CAAAd,OAAA,+BAMA,IAAAe,qBAAA,CAAAf,OAAA,oCACA,IAAAgB,YAAA,CAAAhB,OAAA,wBACA,IAAAiB,eAAA,CAAAjB,OAAA,2BAKgC,IAAAkB,WAAA,CAAAlB,OAAA,0BAAAmB,KAAA,MAAAC,YAAA,+FAAAC,yBAAAC,CAAA,wBAAAC,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AC+J,GAAG,CACpBS,IAAI,CAAExK,WAAW,CAACwK,IACpB,CACF,CACF,CAAC,CACH,CAAE,CACH,CAAC,CACW,CAAC,CAEZ,CAAC,EACP,CACH,CAEApJ,OAAO,EAAI,GAAA1H,WAAA,CAAAqO,GAAA,EAAC3O,YAAA,CAAAe,OAAW,GAAE,CAAC,EACvB,CAAC,CACM,CAAC,CAEpB,CAAC,CAED,GAAM,CAAAmO,MAAM,CAAGmC,uBAAU,CAACC,MAAM,CAAC,CAC/BnC,aAAa,CAAE,CACboC,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UACZ,CAAC,CACDC,cAAc,CAAE,CACdD,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,QAAQ,CAAE,QAAQ,CAClBC,MAAM,CAAE,GACV,CAAC,CACDC,mBAAmB,CAAE,CACnBR,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTI,eAAe,CAAE,OAAO,CACxBF,MAAM,CAAE,GACV,CAAC,CACDG,eAAe,CAAE,CACfX,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CAAC,CACDlC,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAArR,OAAA,CAEYc,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_ChatbotWebView","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","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$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_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$config","_orgInfo$brand_config","_orgInfo$config2","brand_color","config","brand_colour","image_url","brand_config","launcher_logo_url","welcome_message","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","userAgent","select","android","ios","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","ref","source","uri","onDebugMessage","message","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","allowedDomains","some","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","originWhitelist","mixedContentMode","onContentProcessDidTerminate","_webViewRef$current7","reload","injectedJavaScriptBeforeContentLoaded","androidLayerType","overScrollMode","textZoom","setSupportMultipleWindows","allowsBackForwardNavigationGestures","useWebKit","keyboardDisplayRequiresUserAction","hideKeyboardAccessoryView","applicationNameForUserAgent","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,IAAAE,eAAA,CAAAC,sBAAA,CAAAH,OAAA,sBACA,IAAAI,UAAA,CAAAJ,OAAA,gBACA,IAAAK,QAAA,CAAAL,OAAA,cACA,IAAAM,WA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AC,oBAAA,CACf,GAAIrJ,OAAO,CAAE,CACX,GAAAsJ,+BAAkB,EAAC3N,UAAU,CAAC,CAChC,CACA,CAAA0N,oBAAA,CAAA1N,UAAU,CAACK,OAAO,eAAlBqN,oBAAA,CAAoBlL,gBAAgB,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,CACkBlC,cAAc,CAACD,OAAO,CAAG,KAAK,CAChC,CAAE,CACFuN,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAGC,cAAc,CAAK,CAC3B,GAAQ,CAAA5K,WAAW,CAAK4K,cAAc,CAA9B5K,WAAW,CACnB8C,kCAAY,CAACC,UAAU,CACrB,GAAI,CAAAC,KAAK,CAAChD,WAAW,CAAC6K,WAAW,CAAC,CAClC,gBAAgB,CAChB,CACEtK,IAAI,CAAE0C,0BAAU,CAACC,aAAa,CAC9BC,OAAO,CAAE,CACPkH,GAAG,CAAErK,WAAW,CAACqK,GAAG,CACpBS,IAAI,CAAE9K,WAAW,CAAC8K,IACpB,CACF,CACF,CAAC,CACH,CAAE,CACF/C,SAAS,CAAEA,SAAU,CACrBgD,eAAe,CAAE,CAAC,GAAG,CAAE,CACvBC,gBAAgB,CAAC,QAAQ,CACzBC,4BAA4B,CAAE,QAA9B,CAAAA,4BAA4BA,CAAA,CAAQ,KAAAC,oBAAA,CAClC,CAAAA,oBAAA,CA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AE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAA1S,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
2
+ // Inject CSS to force all elements to be clickable
3
+ if (!document.getElementById('clickable-styles')) {
4
+ const style = document.createElement('style');
5
+ style.id = 'clickable-styles';
6
+ style.textContent = \`
7
+ * {
8
+ pointer-events: auto !important;
9
+ cursor: auto !important;
10
+ -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
11
+ touch-action: manipulation !important;
12
+ }
13
+ button,
14
+ [role="button"],
15
+ a,
16
+ input,
17
+ select,
18
+ textarea {
19
+ cursor: pointer !important;
20
+ user-select: none !important;
21
+ -webkit-user-select: none !important;
22
+ -webkit-touch-callout: none !important;
23
+ outline: none !important;
24
+ }
25
+ \`;
26
+ document.head.appendChild(style);
27
+ }
28
+
29
+ // Override preventDefault to ensure clicks work
30
+ const originalPreventDefault = Event.prototype.preventDefault;
31
+ Event.prototype.preventDefault = function() {
32
+ if (this.type === 'click' || this.type === 'touchstart' || this.type === 'touchend') {
33
+ console.log('Prevented preventDefault for:', this.type);
34
+ return;
35
+ }
36
+ originalPreventDefault.call(this);
37
+ };
38
+
39
+ // Intercept and log all click events
40
+ document.addEventListener('click', function(e) {
41
+ const target = e.target;
42
+ console.log('Click event on:', {
43
+ tagName: target.tagName,
44
+ className: target.className,
45
+ id: target.id,
46
+ text: target.textContent,
47
+ rect: target.getBoundingClientRect()
48
+ });
49
+
50
+ // Force click event to propagate
51
+ e.stopPropagation = function() {};
52
+ e.cancelBubble = false;
53
+ }, true);
54
+
55
+ // Handle touch events
56
+ document.addEventListener('touchstart', function(e) {
57
+ const target = e.target;
58
+ target.click(); // Force click event
59
+ console.log('Touch event on:', target.tagName, target.className);
60
+ }, true);
61
+
62
+ // Ensure all buttons and clickable elements are properly configured
63
+ function makeElementsClickable() {
64
+ document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
65
+ el.style.setProperty('pointer-events', 'auto', 'important');
66
+ el.style.setProperty('cursor', 'pointer', 'important');
67
+ el.style.setProperty('touch-action', 'manipulation', 'important');
68
+
69
+ // Remove any click prevention
70
+ el.onclick = el.onclick || function() {};
71
+ el.addEventListener('click', function(e) {
72
+ e.stopPropagation = function() {};
73
+ console.log('Click handler activated for:', el.tagName, el.className);
74
+ }, true);
75
+ });
76
+ }
77
+
78
+ // Run immediately and observe DOM changes
79
+ makeElementsClickable();
80
+ new MutationObserver(function(mutations) {
81
+ makeElementsClickable();
82
+ }).observe(document.body, {
83
+ childList: true,
84
+ subtree: true,
85
+ attributes: true,
86
+ attributeFilter: ['style', 'class']
87
+ });
88
+
89
+ // Debug tap/click coordinates
90
+ document.addEventListener('touchstart', function(e) {
91
+ const touch = e.touches[0];
92
+ window.ReactNativeWebView.postMessage(JSON.stringify({
93
+ type: 'CONSOLE',
94
+ level: 'debug',
95
+ data: 'Touch coordinates: ' + JSON.stringify({
96
+ clientX: touch.clientX,
97
+ clientY: touch.clientY,
98
+ pageX: touch.pageX,
99
+ pageY: touch.pageY
100
+ })
101
+ }));
102
+ }, true);
103
+
104
+ true;
105
+ `;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
106
+ ${defaultInjectedJavaScript}
107
+ ${props.injectedJavaScript||""}
108
+ `,onMessage:function onMessage(event){props.onMessage==null?void 0:props.onMessage(event);try{var data=JSON.parse(event.nativeEvent.data);if(data.type==="CONSOLE"){onDebugMessage==null?void 0:onDebugMessage(data.data);}}catch(e){}},style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:true,automaticallyAdjustContentInsets:false,decelerationRate:"normal",scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
109
+ //# sourceMappingURL=ChatbotWebView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","event","data","JSON","parse","nativeEvent","type","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","automaticallyAdjustContentInsets","decelerationRate","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot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AAA,CAAAQ,CAAA,EAAAA,CAAA,EAe7D,GAAM,CAAAW,cAAc,CAAG,GAAAC,iBAAU,EAC/B,SAACC,KAAK,CAAEC,GAAG,CAAK,CACd,GAAQ,CAAAC,cAAc,CAAmBF,KAAK,CAAtCE,cAAc,CAAKC,SAAS,IAAAC,yBAAA,CAAApB,OAAA,EAAKgB,KAAK,CAAAzB,SAAA,EAE9C,GAAM,CAAA8B,yBAAyB,CAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAEC,MACE,GAAA/B,WAAA,CAAAgC,GAAA,EAACjC,mBAAA,CAAAkC,OAAO,CAAAjB,MAAA,CAAAkB,MAAA,EACNP,GAAG,CAAEA,GAAI,EACLE,SAAS,EACbM,kBAAkB,CAAE;AAC5B,YAAYJ,yBAAyB;AACrC,YAAYL,KAAK,CAACS,kBAAkB,EAAI,EAAE;AAC1C,SAAU,CACFC,SAAS,CAAE,QAAX,CAAAA,SAASA,CAAGC,KAAK,CAAK,CACpBX,KAAK,CAACU,SAAS,cAAfV,KAAK,CAACU,SAAS,CAAGC,KAAK,CAAC,CACxB,GAAI,CACF,GAAM,CAAAC,IAAI,CAAGC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,WAAW,CAACH,IAAI,CAAC,CAC/C,GAAIA,IAAI,CAACI,IAAI,GAAK,SAAS,CAAE,CAC3Bd,cAAc,cAAdA,cAAc,CAAGU,IAAI,CAACA,IAAI,CAAC,CAC7B,CACF,CAAE,MAAOjC,CAAC,CAAE,CAAC,CACf,CAAE,CACFsC,KAAK,CAAE,CAAC,CAAEC,OAAO,CAAE,IAAK,CAAC,CAAElB,KAAK,CAACiB,KAAK,CAAE,CACxCE,OAAO,CAAE,KAAM,CACfC,8BAA8B,CAAE,KAAM,CACtCC,4BAA4B,CAAE,KAAM,CACpCC,eAAe,CAAE,IAAK,CACtBC,gCAAgC,CAAE,KAAM,CACxCC,gBAAgB,CAAC,QAAQ,CACzBC,aAAa,CAAE,IAAK,CACpBC,sBAAsB,CAAE,IAAK,EAC9B,CAAC,CAEN,CACF,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAA5C,OAAA,CAEac,cAAc","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.19-staging.20';
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.23';
2
2
  //# sourceMappingURL=version.staging.js.map
@@ -1,11 +1,11 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=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 _version=require("./version");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 _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Chatbot=function Chatbot(_ref){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,onOpen=_ref.onOpen,onClose=_ref.onClose,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 webViewRef=(0,_react.useRef)(null);var fadeAnim=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;var isFirstLoadRef=(0,_react.useRef)(true);var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];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;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=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 _FloatingButton=_interopRequireDefault(require("./FloatingButton"));var _constants=require("./constants");var _version=require("./version");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 _ChatbotWebView=_interopRequireDefault(require("./components/ChatbotWebView"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/Chatbotsdk.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var Chatbot=function Chatbot(_ref){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,onOpen=_ref.onOpen,onClose=_ref.onClose,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 webViewRef=(0,_react.useRef)(null);var fadeAnim=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;var isFirstLoadRef=(0,_react.useRef)(true);var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),toastVisible=_useState8[0],setToastVisible=_useState8[1];var _useState9=(0,_react.useState)(""),_useState10=(0,_slicedToArray2.default)(_useState9,2),toastMessage=_useState10[0],setToastMessage=_useState10[1];var _useState11=(0,_react.useState)(),_useState12=(0,_slicedToArray2.default)(_useState11,2),effectiveUserId=_useState12[0],setEffectiveUserId=_useState12[1];var _useState13=(0,_react.useState)(false),_useState14=(0,_slicedToArray2.default)(_useState13,2),isStorageReady=_useState14[0],setIsStorageReady=_useState14[1];var pendingStorageOps=(0,_react.useRef)([]);var memoryCache=(0,_react.useRef)({});var _useState15=(0,_react.useState)({os:"",browser:""}),_useState16=(0,_slicedToArray2.default)(_useState15,2),systemInfo=_useState16[0],setSystemInfo=_useState16[1];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;var triggerAppInit=function triggerAppInit(){if(webViewRef.current){webViewRef.current.injectJavaScript(`
2
2
  // Trigger APP_READY equivalent
3
3
  window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'APP_READY' }));
4
4
  true;
5
5
  `);}};var executeStorageOp=(0,_react.useCallback)(function(operation){if(isStorageReady){operation();}else{pendingStorageOps.current.push(operation);}},[isStorageReady]);var handleMessage=(0,_react.useCallback)(function(event){var _webViewRef$current;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$current=webViewRef.current)==null?void 0:_webViewRef$current.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:""});return;}if((parsedData==null?void 0:parsedData.type)==="APP_READY"){emitEvent(_events.ChatbotEventType.CHATBOT_APP_READY);if(webViewRef.current&&isWebViewVisible){var _webViewRef$current2,_webViewRef$current3;(_webViewRef$current2=webViewRef.current)==null?void 0:_webViewRef$current2.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)(systemInfo))}};_logger.logger.debug("messageData====>",JSON.stringify(messageData));(_webViewRef$current3=webViewRef.current)==null?void 0:_webViewRef$current3.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"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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(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$config,_orgInfo$brand_config,_orgInfo$config2;setChatbotConfig({brand_color:(orgInfo==null?void 0:(_orgInfo$config=orgInfo.config)==null?void 0:_orgInfo$config.brand_colour)||"#007AFF",image_url:(orgInfo==null?void 0:(_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config.launcher_logo_url)||"",welcome_message:(orgInfo==null?void 0:(_orgInfo$config2=orgInfo.config)==null?void 0:_orgInfo$config2.welcome_message)||""});}}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 _ref3.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});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return"https://demo.robylon.ai/chat/public/RG5x9i1fvk/";}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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 screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style: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,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,{nestedScrollEnabled:true,ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,style:styles.webview,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);},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
8
+ `);}}switch(parsedData==null?void 0:parsedData.type){case"close_chatbot":closeWebView();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;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}});}},[emitEvent,isWebViewVisible,onMessage,systemInfo,effectiveUserId,user_token,user_profile]);(0,_react.useEffect)(function(){var initializeUserId=function(){var _ref2=(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$current4;(_webViewRef$current4=webViewRef.current)==null?void 0:_webViewRef$current4.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.SET_STORAGE,"rblyn_anon",userId));});}}setEffectiveUserId(userId);});return function initializeUserId(){return _ref2.apply(this,arguments);};}();initializeUserId();},[user_id,executeStorageOp]);(0,_react.useEffect)(function(){if(webViewRef.current){webViewRef.current.injectJavaScript((0,_webViewStorage.getStorageScript)());executeStorageOp(function(){var _webViewRef$current5;(_webViewRef$current5=webViewRef.current)==null?void 0:_webViewRef$current5.injectJavaScript((0,_webViewStorage.createStorageMessage)(_webViewStorage.StorageMessageType.GET_STORAGE,"rblyn_anon"));});}},[]);(0,_react.useEffect)(function(){var fetchChatbotConfig=function(){var _ref3=(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$config,_orgInfo$brand_config,_orgInfo$config2;setChatbotConfig({brand_color:(orgInfo==null?void 0:(_orgInfo$config=orgInfo.config)==null?void 0:_orgInfo$config.brand_colour)||"#007AFF",image_url:(orgInfo==null?void 0:(_orgInfo$brand_config=orgInfo.brand_config)==null?void 0:_orgInfo$brand_config.launcher_logo_url)||"",welcome_message:(orgInfo==null?void 0:(_orgInfo$config2=orgInfo.config)==null?void 0:_orgInfo$config2.welcome_message)||""});}}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 _ref3.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});console.log("BASE_CHATBOT_URL SDK_VERSION",_constants.BASE_CHATBOT_URL,_version.SDK_VERSION);return"https://demo.robylon.ai/chat/public/RG5x9i1fvk/";}var openWebView=(0,_react.useCallback)(function(){setIsWebViewVisible(true);if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:1,duration:250,useNativeDriver:true}).start(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}else{fadeAnim.setValue(1);requestAnimationFrame(function(){onOpen==null?void 0:onOpen();emitEvent(_events.ChatbotEventType.CHATBOT_OPENED);if(!isFirstLoadRef.current){setTimeout(triggerAppInit,100);}});}},[enableAnimation,fadeAnim,onOpen,emitEvent]);var closeWebView=(0,_react.useCallback)(function(){if(webViewRef.current){webViewRef.current.postMessage(JSON.stringify({name:"closeFrame",domain:"app-domain.com"}));}var complete=function complete(){setIsWebViewVisible(false);onClose==null?void 0:onClose();emitEvent(_events.ChatbotEventType.CHATBOT_CLOSED);};if(enableAnimation){_reactNative.Animated.timing(fadeAnim,{toValue:0,duration:200,useNativeDriver:true}).start(complete);}else{fadeAnim.setValue(0);requestAnimationFrame(complete);}},[enableAnimation,fadeAnim,onClose,emitEvent]);(0,_react.useEffect)(function(){if(show_floating_button&&chatbotConfig){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_LOADED);}},[show_floating_button,chatbotConfig,emitEvent]);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 screenDimensions=getScreenDimensions();(0,_react.useEffect)(function(){if(__DEV__){(0,_debugConfig.enableNetworkDebug)();}},[]);var userAgent=_reactNative.Platform.select({android:"Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",ios:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"});return(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotSDK",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style: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,{onPress:function onPress(){emitEvent(_events.ChatbotEventType.CHATBOT_BUTTON_CLICKED);openWebView();},brandColor:chatbotConfig.brand_color,imageUrl:chatbotConfig.image_url})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{height:isWebViewVisible?"100%":0}],pointerEvents:"auto",children:(0,_jsxRuntime.jsx)(_ErrorBoundary.ErrorBoundary,{componentName:"ChatbotWebView",children:(0,_jsxRuntime.jsx)(_ChatbotWebView.default,{ref:webViewRef,source:{uri:constructUrl()},onMessage:handleMessage,onDebugMessage:function onDebugMessage(message){console.log("WebView Debug:",message);},style:styles.webview,allowsInlineMediaPlayback:true,mediaPlaybackRequiresUserAction:false,allowFileAccess:false,geolocationEnabled:false,javaScriptEnabled:true,domStorageEnabled:true,cacheEnabled:true,scrollEnabled:true,bounces:false,onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(request){var allowedDomains=[_constants.BASE_CHATBOT_URL,"about:blank"];return allowedDomains.some(function(domain){return request.url.startsWith(domain);});},startInLoadingState:isFirstLoadRef.current,onLoadEnd:function onLoadEnd(){var _webViewRef$current6;if(__DEV__){(0,_debugConfig.enableWebViewDebug)(webViewRef);}(_webViewRef$current6=webViewRef.current)==null?void 0:_webViewRef$current6.injectJavaScript(`
9
9
  if (!document.querySelector('meta[name="viewport"]')) {
10
10
  var meta = document.createElement('meta');
11
11
  meta.name = 'viewport';
@@ -71,6 +71,33 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
71
71
  }
72
72
  }
73
73
 
74
+ // Add touch event handlers
75
+ document.addEventListener('touchstart', function(e) {
76
+ e.stopPropagation();
77
+ }, true);
78
+
79
+ // Improve click handling
80
+ document.addEventListener('click', function(e) {
81
+ const clickedElement = e.target;
82
+ console.log('Clicked element:', clickedElement);
83
+
84
+ // Log the event for debugging
85
+ window.ReactNativeWebView.postMessage(JSON.stringify({
86
+ type: 'CONSOLE',
87
+ level: 'debug',
88
+ data: 'Click event fired on: ' + clickedElement.className
89
+ }));
90
+ }, true);
91
+
74
92
  true;
75
- `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});}})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
93
+ `);isFirstLoadRef.current=false;},onError:function onError(syntheticEvent){var nativeEvent=syntheticEvent.nativeEvent;_ErrorTrackingService.errorTracker.trackError(new Error(nativeEvent.description),"ChatbotWebView",{type:_errorConstants.ErrorTypes.RUNTIME_ERROR,context:{url:nativeEvent.url,code:nativeEvent.code}});},userAgent:userAgent,originWhitelist:["*"],mixedContentMode:"always",onContentProcessDidTerminate:function onContentProcessDidTerminate(){var _webViewRef$current7;(_webViewRef$current7=webViewRef.current)==null?void 0:_webViewRef$current7.reload();},injectedJavaScriptBeforeContentLoaded:`
94
+ window.onerror = function(message, source, lineno, colno, error) {
95
+ window.ReactNativeWebView.postMessage(JSON.stringify({
96
+ type: 'ERROR',
97
+ data: {message, source, lineno, colno}
98
+ }));
99
+ return true;
100
+ };
101
+ true;
102
+ `,androidLayerType:"hardware",overScrollMode:"never",textZoom:100,setSupportMultipleWindows:false,allowsBackForwardNavigationGestures:false,useWebKit:true,keyboardDisplayRequiresUserAction:false,hideKeyboardAccessoryView:true,applicationNameForUserAgent:"ChatbotApp"})})})]}),__DEV__&&(0,_jsxRuntime.jsx)(_DebugButton.default,{})]})});};var styles=_reactNative.StyleSheet.create({mainContainer:{flex:1,position:"relative"},webViewWrapper:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",zIndex:100},fullScreenContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"white",zIndex:100},inlineContainer:{flex:1,backgroundColor:"white"},webview:{flex:1,backgroundColor:"white"}});var _default=exports.default=Chatbot;
76
103
  //# sourceMappingURL=Chatbotsdk.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","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$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_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$config","_orgInfo$brand_config","_orgInfo$config2","brand_color","config","brand_colour","image_url","brand_config","launcher_logo_url","welcome_message","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","WebView","nestedScrollEnabled","ref","source","uri","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,I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Q,CAAE,QAAQ,CAClBC,MAAM,CAAE,GACV,CAAC,CACDC,mBAAmB,CAAE,CACnBR,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTI,eAAe,CAAE,OAAO,CACxBF,MAAM,CAAE,GACV,CAAC,CACDG,eAAe,CAAE,CACfX,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CAAC,CACDlC,OAAO,CAAE,CACPwB,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAArR,OAAA,CAEYc,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_FloatingButton","_interopRequireDefault","_constants","_version","_systemInfo","_useChatbotEvents2","_events","_logger","_debugConfig","_DebugButton","_ErrorBoundary","_errorConstants","_ErrorTrackingService","_cookieUtils","_webViewStorage","_ChatbotWebView","_jsxRuntime","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Chatbot","_ref","api_key","user_id","user_token","_ref$show_floating_bu","show_floating_button","onEvent","onMessage","_ref$isFullScreen","isFullScreen","_ref$enableAnimation","enableAnimation","onOpen","onClose","user_profile","_useState","useState","_useState2","_slicedToArray2","isWebViewVisible","setIsWebViewVisible","_useState3","_useState4","chatbotConfig","setChatbotConfig","_useState5","_useState6","loading","setLoading","webViewRef","useRef","fadeAnim","Animated","Value","current","isFirstLoadRef","_useState7","_useState8","toastVisible","setToastVisible","_useState9","_useState10","toastMessage","setToastMessage","_useState11","_useState12","effectiveUserId","setEffectiveUserId","_useState13","_useState14","isStorageReady","setIsStorageReady","pendingStorageOps","memoryCache","_useState15","os","browser","_useState16","systemInfo","setSystemInfo","chatbotConfigForEvents","useMemo","userId","isAnonymous","_useChatbotEvents","useChatbotEvents","emitEvent","onInternalEvent","triggerAppInit","injectJavaScript","executeStorageOp","useCallback","operation","push","handleMessage","event","_webViewRef$current","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$current2","_webViewRef$current3","getBrowserAndOSInfoScript","messageData","name","action","token","undefined","userProfile","assign","getSystemInfo","debug","stringify","domain","closeWebView","CHATBOT_LOADED","CHAT_INITIALIZED","SESSION_REFRESHED","CHAT_INITIALIZATION_FAILED","errorTracker","trackError","Error","ErrorTypes","RUNTIME_ERROR","context","useEffect","initializeUserId","_ref2","_asyncToGenerator2","String","generateUUID","_webViewRef$current4","SET_STORAGE","apply","arguments","getStorageScript","_webViewRef$current5","fetchChatbotConfig","_ref3","_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$config","_orgInfo$brand_config","_orgInfo$config2","brand_color","config","brand_colour","image_url","brand_config","launcher_logo_url","welcome_message","NETWORK_ERROR","constructUrl","params","URLSearchParams","id","BASE_CHATBOT_URL","SDK_VERSION","openWebView","timing","toValue","duration","useNativeDriver","start","CHATBOT_OPENED","setTimeout","setValue","requestAnimationFrame","postMessage","complete","CHATBOT_CLOSED","CHATBOT_BUTTON_LOADED","getScreenDimensions","windowHeight","Dimensions","height","windowWidth","width","statusBarHeight","Platform","OS","StatusBar","currentHeight","screenDimensions","enableNetworkDebug","userAgent","select","android","ios","jsx","ErrorBoundary","componentName","children","jsxs","View","style","styles","mainContainer","Fragment","onPress","CHATBOT_BUTTON_CLICKED","brandColor","imageUrl","pointerEvents","ref","source","uri","onDebugMessage","message","webview","allowsInlineMediaPlayback","mediaPlaybackRequiresUserAction","allowFileAccess","geolocationEnabled","javaScriptEnabled","domStorageEnabled","cacheEnabled","scrollEnabled","bounces","onShouldStartLoadWithRequest","request","allowedDomains","some","url","startsWith","startInLoadingState","onLoadEnd","_webViewRef$current6","enableWebViewDebug","onError","syntheticEvent","description","code","originWhitelist","mixedContentMode","onContentProcessDidTerminate","_webViewRef$current7","reload","injectedJavaScriptBeforeContentLoaded","androidLayerType","overScrollMode","textZoom","setSupportMultipleWindows","allowsBackForwardNavigationGestures","useWebKit","keyboardDisplayRequiresUserAction","hideKeyboardAccessoryView","applicationNameForUserAgent","StyleSheet","create","flex","position","webViewWrapper","top","left","right","bottom","overflow","zIndex","fullScreenContainer","backgroundColor","inlineContainer","_default","exports"],"sourceRoot":"../../src","sources":["Chatbotsdk.tsx"],"mappings":"iWAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAOA,IAAAC,YAAA,CAAAD,OAAA,iBAUA,IAAAE,eAAA,CAAAC,sBAAA,CAAAH,OAAA,sBACA,IAAAI,UAAA,CAAAJ,OAAA,gBACA,IAAAK,QAAA,CAAAL,OAAA,cACA,IAAAM,WAAA,CAAAN,OAAA,uBACA,IAAAO,kBAAA,CAAAP,OAAA,6BACA,IAAAQ,OAAA,CAAAR,OAAA,mBACA,IAAAS,OAAA,CAAAT,OAAA,mBACA,IAAAU,YAAA,CAAAV,OAAA,wBACA,IAAAW,YAAA,CAAAR,sBAAA,CAAAH,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,eAAA,CAAAd,sBAAA,CAAAH,OAAA,iCAAyD,IAAAkB,WAAA,CAAAlB,OAAA,0BAAAmB,KAAA,MAAAC,YAAA,+FAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KA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vB,CAAC,CACM,CAAC,CAEpB,CAAC,CAED,GAAM,CAAAuO,MAAM,CAAGoD,uBAAU,CAACC,MAAM,CAAC,CAC/BpD,aAAa,CAAE,CACbqD,IAAI,CAAE,CAAC,CACPC,QAAQ,CAAE,UACZ,CAAC,CACDC,cAAc,CAAE,CACdD,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,QAAQ,CAAE,QAAQ,CAClBC,MAAM,CAAE,GACV,CAAC,CACDC,mBAAmB,CAAE,CACnBR,QAAQ,CAAE,UAAU,CACpBE,GAAG,CAAE,CAAC,CACNC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTI,eAAe,CAAE,OAAO,CACxBF,MAAM,CAAE,GACV,CAAC,CACDG,eAAe,CAAE,CACfX,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CAAC,CACDnD,OAAO,CAAE,CACPyC,IAAI,CAAE,CAAC,CACPU,eAAe,CAAE,OACnB,CACF,CAAC,CAAC,CAAC,IAAAE,QAAA,CAAAC,OAAA,CAAA1S,OAAA,CAEYc,OAAO","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNativeWebview=require("react-native-webview");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onDebugMessage"];var _this=this,_jsxFileName="/Users/jobinabraham/Developer/personal/robylon-react-native-sdk/src/components/ChatbotWebView.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var ChatbotWebView=(0,_react.forwardRef)(function(props,ref){var onDebugMessage=props.onDebugMessage,restProps=(0,_objectWithoutProperties2.default)(props,_excluded);var defaultInjectedJavaScript=`
2
+ // Inject CSS to force all elements to be clickable
3
+ if (!document.getElementById('clickable-styles')) {
4
+ const style = document.createElement('style');
5
+ style.id = 'clickable-styles';
6
+ style.textContent = \`
7
+ * {
8
+ pointer-events: auto !important;
9
+ cursor: auto !important;
10
+ -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
11
+ touch-action: manipulation !important;
12
+ }
13
+ button,
14
+ [role="button"],
15
+ a,
16
+ input,
17
+ select,
18
+ textarea {
19
+ cursor: pointer !important;
20
+ user-select: none !important;
21
+ -webkit-user-select: none !important;
22
+ -webkit-touch-callout: none !important;
23
+ outline: none !important;
24
+ }
25
+ \`;
26
+ document.head.appendChild(style);
27
+ }
28
+
29
+ // Override preventDefault to ensure clicks work
30
+ const originalPreventDefault = Event.prototype.preventDefault;
31
+ Event.prototype.preventDefault = function() {
32
+ if (this.type === 'click' || this.type === 'touchstart' || this.type === 'touchend') {
33
+ console.log('Prevented preventDefault for:', this.type);
34
+ return;
35
+ }
36
+ originalPreventDefault.call(this);
37
+ };
38
+
39
+ // Intercept and log all click events
40
+ document.addEventListener('click', function(e) {
41
+ const target = e.target;
42
+ console.log('Click event on:', {
43
+ tagName: target.tagName,
44
+ className: target.className,
45
+ id: target.id,
46
+ text: target.textContent,
47
+ rect: target.getBoundingClientRect()
48
+ });
49
+
50
+ // Force click event to propagate
51
+ e.stopPropagation = function() {};
52
+ e.cancelBubble = false;
53
+ }, true);
54
+
55
+ // Handle touch events
56
+ document.addEventListener('touchstart', function(e) {
57
+ const target = e.target;
58
+ target.click(); // Force click event
59
+ console.log('Touch event on:', target.tagName, target.className);
60
+ }, true);
61
+
62
+ // Ensure all buttons and clickable elements are properly configured
63
+ function makeElementsClickable() {
64
+ document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
65
+ el.style.setProperty('pointer-events', 'auto', 'important');
66
+ el.style.setProperty('cursor', 'pointer', 'important');
67
+ el.style.setProperty('touch-action', 'manipulation', 'important');
68
+
69
+ // Remove any click prevention
70
+ el.onclick = el.onclick || function() {};
71
+ el.addEventListener('click', function(e) {
72
+ e.stopPropagation = function() {};
73
+ console.log('Click handler activated for:', el.tagName, el.className);
74
+ }, true);
75
+ });
76
+ }
77
+
78
+ // Run immediately and observe DOM changes
79
+ makeElementsClickable();
80
+ new MutationObserver(function(mutations) {
81
+ makeElementsClickable();
82
+ }).observe(document.body, {
83
+ childList: true,
84
+ subtree: true,
85
+ attributes: true,
86
+ attributeFilter: ['style', 'class']
87
+ });
88
+
89
+ // Debug tap/click coordinates
90
+ document.addEventListener('touchstart', function(e) {
91
+ const touch = e.touches[0];
92
+ window.ReactNativeWebView.postMessage(JSON.stringify({
93
+ type: 'CONSOLE',
94
+ level: 'debug',
95
+ data: 'Touch coordinates: ' + JSON.stringify({
96
+ clientX: touch.clientX,
97
+ clientY: touch.clientY,
98
+ pageX: touch.pageX,
99
+ pageY: touch.pageY
100
+ })
101
+ }));
102
+ }, true);
103
+
104
+ true;
105
+ `;return(0,_jsxRuntime.jsx)(_reactNativeWebview.WebView,Object.assign({ref:ref},restProps,{injectedJavaScript:`
106
+ ${defaultInjectedJavaScript}
107
+ ${props.injectedJavaScript||""}
108
+ `,onMessage:function onMessage(event){props.onMessage==null?void 0:props.onMessage(event);try{var data=JSON.parse(event.nativeEvent.data);if(data.type==="CONSOLE"){onDebugMessage==null?void 0:onDebugMessage(data.data);}}catch(e){}},style:[{opacity:0.99},props.style],bounces:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,scalesPageToFit:true,automaticallyAdjustContentInsets:false,decelerationRate:"normal",scrollEnabled:true,directionalLockEnabled:true}));});var _default=exports.default=ChatbotWebView;
109
+ //# sourceMappingURL=ChatbotWebView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeWebview","_jsxRuntime","_excluded","_this","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChatbotWebView","forwardRef","props","ref","onDebugMessage","restProps","_objectWithoutProperties2","defaultInjectedJavaScript","jsx","WebView","assign","injectedJavaScript","onMessage","event","data","JSON","parse","nativeEvent","type","style","opacity","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","scalesPageToFit","automaticallyAdjustContentInsets","decelerationRate","scrollEnabled","directionalLockEnabled","_default","exports"],"sourceRoot":"../../../src","sources":["components/ChatbotWebView.tsx"],"mappings":"mRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAEA,IAAAC,mBAAA,CAAAD,OAAA,yBAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,SAAA,wBAAAC,KAAA,MAAAC,YAAA,8GAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAR,wBAAAQ,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OA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QAAA,CAAAC,OAAA,CAAA5C,OAAA,CAEac,cAAc","ignoreList":[]}
@@ -1,3 +1,2 @@
1
-
2
- //# sourceMappingURL=openChatbot.js.mape",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.openChatbot=void 0;var _reactNative=require("react-native");var _constants=require("./constants");var openChatbot=exports.openChatbot=function openChatbot(chatbotId){var additionalParams=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var params=new URLSearchParams(Object.assign({id:chatbotId},additionalParams));var url=`${_constants.BASE_CHATBOT_URL}?${params.toString()}`;_reactNative.Linking.openURL(url);};
3
2
  //# sourceMappingURL=openChatbot.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["openChatbot.tsx"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_constants","openChatbot","exports","chatbotId","additionalParams","arguments","length","undefined","params","URLSearchParams","Object","assign","id","url","BASE_CHATBOT_URL","toString","Linking","openURL"],"sourceRoot":"../../src","sources":["openChatbot.ts"],"mappings":"oFAAA,IAAAA,YAAA,CAAAC,OAAA,iBACA,IAAAC,UAAA,CAAAD,OAAA,gBAEO,GAAM,CAAAE,WAAW,CAAAC,OAAA,CAAAD,WAAA,CAAG,QAAd,CAAAA,WAAWA,CACtBE,SAAiB,CAER,IADT,CAAAC,gBAAwC,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAE7C,GAAM,CAAAG,MAAM,CAAG,GAAI,CAAAC,eAAe,CAAAC,MAAA,CAAAC,MAAA,EAAGC,EAAE,CAAET,SAAS,EAAKC,gBAAgB,CAAE,CAAC,CAC1E,GAAM,CAAAS,GAAG,CAAG,GAAGC,2BAAgB,IAAIN,MAAM,CAACO,QAAQ,CAAC,CAAC,EAAE,CACtDC,oBAAO,CAACC,OAAO,CAACJ,GAAG,CAAC,CACtB,CAAC","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.19-staging.20';
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;var SDK_VERSION=exports.SDK_VERSION='2.0.19-staging.23';
2
2
  //# sourceMappingURL=version.staging.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAoBvE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,oBAAqB,SAAQ,YAAY;IACjD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAcD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2jB3C,CAAC;AAmCF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Chatbotsdk.d.ts","sourceRoot":"","sources":["../../src/Chatbotsdk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAoB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAqBvE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,UAAU,oBAAqB,SAAQ,YAAY;IACjD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAcD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmnB3C,CAAC;AAmCF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { WebView, WebViewProps } from "react-native-webview";
3
+ interface ChatbotWebViewProps extends WebViewProps {
4
+ onDebugMessage?: (message: string) => void;
5
+ useWebKit?: boolean;
6
+ keyboardDisplayRequiresUserAction?: boolean;
7
+ hideKeyboardAccessoryView?: boolean;
8
+ applicationNameForUserAgent?: string;
9
+ textZoom?: number;
10
+ androidLayerType?: "none" | "software" | "hardware";
11
+ setSupportMultipleWindows?: boolean;
12
+ overScrollMode?: "always" | "content" | "never";
13
+ directionalLockEnabled?: boolean;
14
+ }
15
+ declare const ChatbotWebView: React.ForwardRefExoticComponent<ChatbotWebViewProps & React.RefAttributes<WebView<{}>>>;
16
+ export default ChatbotWebView;
17
+ //# sourceMappingURL=ChatbotWebView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatbotWebView.d.ts","sourceRoot":"","sources":["../../../src/components/ChatbotWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,YAAY;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACpD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,cAAc,yFA2InB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.19-staging.20";
1
+ export declare const SDK_VERSION = "2.0.19-staging.23";
2
2
  //# sourceMappingURL=version.staging.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robylon/react-native-sdk",
3
- "version": "2.0.19-staging.20",
3
+ "version": "2.0.19-staging.23",
4
4
  "description": "React Native SDK for Robylon",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -39,6 +39,7 @@ import {
39
39
  getStorageScript,
40
40
  createStorageMessage,
41
41
  } from "./utils/webViewStorage";
42
+ import ChatbotWebView from "./components/ChatbotWebView";
42
43
 
43
44
  export interface ChatbotProps {
44
45
  api_key: string;
@@ -489,6 +490,13 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
489
490
  // }
490
491
  // }, []);
491
492
 
493
+ // Add userAgent configuration
494
+ const userAgent = Platform.select({
495
+ android:
496
+ "Mozilla/5.0 (Linux; Android 10; Android SDK built for x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",
497
+ ios: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",
498
+ });
499
+
492
500
  return (
493
501
  <ErrorBoundary componentName="ChatbotSDK">
494
502
  <View style={styles.mainContainer}>
@@ -519,11 +527,13 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
519
527
  style={[styles.fullScreenContainer, { opacity: fadeAnim }]}
520
528
  > */}
521
529
  <ErrorBoundary componentName="ChatbotWebView">
522
- <WebView
523
- nestedScrollEnabled={true}
530
+ <ChatbotWebView
524
531
  ref={webViewRef}
525
532
  source={{ uri: constructUrl() }}
526
533
  onMessage={handleMessage}
534
+ onDebugMessage={(message) => {
535
+ console.log("WebView Debug:", message);
536
+ }}
527
537
  style={styles.webview}
528
538
  // containerStyle={
529
539
  // isFullScreen
@@ -543,7 +553,11 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
543
553
  scrollEnabled={true}
544
554
  bounces={false}
545
555
  onShouldStartLoadWithRequest={(request) => {
546
- return request.url.startsWith(BASE_CHATBOT_URL);
556
+ // Allow navigation only to trusted domains
557
+ const allowedDomains = [BASE_CHATBOT_URL, "about:blank"];
558
+ return allowedDomains.some((domain) =>
559
+ request.url.startsWith(domain)
560
+ );
547
561
  }}
548
562
  startInLoadingState={isFirstLoadRef.current}
549
563
  onLoadEnd={() => {
@@ -616,6 +630,24 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
616
630
  }
617
631
  }
618
632
 
633
+ // Add touch event handlers
634
+ document.addEventListener('touchstart', function(e) {
635
+ e.stopPropagation();
636
+ }, true);
637
+
638
+ // Improve click handling
639
+ document.addEventListener('click', function(e) {
640
+ const clickedElement = e.target;
641
+ console.log('Clicked element:', clickedElement);
642
+
643
+ // Log the event for debugging
644
+ window.ReactNativeWebView.postMessage(JSON.stringify({
645
+ type: 'CONSOLE',
646
+ level: 'debug',
647
+ data: 'Click event fired on: ' + clickedElement.className
648
+ }));
649
+ }, true);
650
+
619
651
  true;
620
652
  `);
621
653
  isFirstLoadRef.current = false;
@@ -634,6 +666,31 @@ const Chatbot: React.FC<InternalChatbotProps> = ({
634
666
  }
635
667
  );
636
668
  }}
669
+ userAgent={userAgent}
670
+ originWhitelist={["*"]}
671
+ mixedContentMode="always"
672
+ onContentProcessDidTerminate={() => {
673
+ webViewRef.current?.reload();
674
+ }}
675
+ injectedJavaScriptBeforeContentLoaded={`
676
+ window.onerror = function(message, source, lineno, colno, error) {
677
+ window.ReactNativeWebView.postMessage(JSON.stringify({
678
+ type: 'ERROR',
679
+ data: {message, source, lineno, colno}
680
+ }));
681
+ return true;
682
+ };
683
+ true;
684
+ `}
685
+ androidLayerType="hardware"
686
+ overScrollMode="never"
687
+ textZoom={100}
688
+ setSupportMultipleWindows={false}
689
+ allowsBackForwardNavigationGestures={false}
690
+ useWebKit={true}
691
+ keyboardDisplayRequiresUserAction={false}
692
+ hideKeyboardAccessoryView={true}
693
+ applicationNameForUserAgent="ChatbotApp"
637
694
  />
638
695
  </ErrorBoundary>
639
696
  {/* </Animated.View> */}
@@ -0,0 +1,159 @@
1
+ import React, { forwardRef } from "react";
2
+ import { Platform } from "react-native";
3
+ import { WebView, WebViewProps } from "react-native-webview";
4
+
5
+ interface ChatbotWebViewProps extends WebViewProps {
6
+ onDebugMessage?: (message: string) => void;
7
+ useWebKit?: boolean;
8
+ keyboardDisplayRequiresUserAction?: boolean;
9
+ hideKeyboardAccessoryView?: boolean;
10
+ applicationNameForUserAgent?: string;
11
+ textZoom?: number;
12
+ androidLayerType?: "none" | "software" | "hardware";
13
+ setSupportMultipleWindows?: boolean;
14
+ overScrollMode?: "always" | "content" | "never";
15
+ directionalLockEnabled?: boolean;
16
+ }
17
+
18
+ const ChatbotWebView = forwardRef<WebView, ChatbotWebViewProps>(
19
+ (props, ref) => {
20
+ const { onDebugMessage, ...restProps } = props;
21
+
22
+ const defaultInjectedJavaScript = `
23
+ // Inject CSS to force all elements to be clickable
24
+ if (!document.getElementById('clickable-styles')) {
25
+ const style = document.createElement('style');
26
+ style.id = 'clickable-styles';
27
+ style.textContent = \`
28
+ * {
29
+ pointer-events: auto !important;
30
+ cursor: auto !important;
31
+ -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
32
+ touch-action: manipulation !important;
33
+ }
34
+ button,
35
+ [role="button"],
36
+ a,
37
+ input,
38
+ select,
39
+ textarea {
40
+ cursor: pointer !important;
41
+ user-select: none !important;
42
+ -webkit-user-select: none !important;
43
+ -webkit-touch-callout: none !important;
44
+ outline: none !important;
45
+ }
46
+ \`;
47
+ document.head.appendChild(style);
48
+ }
49
+
50
+ // Override preventDefault to ensure clicks work
51
+ const originalPreventDefault = Event.prototype.preventDefault;
52
+ Event.prototype.preventDefault = function() {
53
+ if (this.type === 'click' || this.type === 'touchstart' || this.type === 'touchend') {
54
+ console.log('Prevented preventDefault for:', this.type);
55
+ return;
56
+ }
57
+ originalPreventDefault.call(this);
58
+ };
59
+
60
+ // Intercept and log all click events
61
+ document.addEventListener('click', function(e) {
62
+ const target = e.target;
63
+ console.log('Click event on:', {
64
+ tagName: target.tagName,
65
+ className: target.className,
66
+ id: target.id,
67
+ text: target.textContent,
68
+ rect: target.getBoundingClientRect()
69
+ });
70
+
71
+ // Force click event to propagate
72
+ e.stopPropagation = function() {};
73
+ e.cancelBubble = false;
74
+ }, true);
75
+
76
+ // Handle touch events
77
+ document.addEventListener('touchstart', function(e) {
78
+ const target = e.target;
79
+ target.click(); // Force click event
80
+ console.log('Touch event on:', target.tagName, target.className);
81
+ }, true);
82
+
83
+ // Ensure all buttons and clickable elements are properly configured
84
+ function makeElementsClickable() {
85
+ document.querySelectorAll('button, [role="button"], a, input, select, textarea').forEach(el => {
86
+ el.style.setProperty('pointer-events', 'auto', 'important');
87
+ el.style.setProperty('cursor', 'pointer', 'important');
88
+ el.style.setProperty('touch-action', 'manipulation', 'important');
89
+
90
+ // Remove any click prevention
91
+ el.onclick = el.onclick || function() {};
92
+ el.addEventListener('click', function(e) {
93
+ e.stopPropagation = function() {};
94
+ console.log('Click handler activated for:', el.tagName, el.className);
95
+ }, true);
96
+ });
97
+ }
98
+
99
+ // Run immediately and observe DOM changes
100
+ makeElementsClickable();
101
+ new MutationObserver(function(mutations) {
102
+ makeElementsClickable();
103
+ }).observe(document.body, {
104
+ childList: true,
105
+ subtree: true,
106
+ attributes: true,
107
+ attributeFilter: ['style', 'class']
108
+ });
109
+
110
+ // Debug tap/click coordinates
111
+ document.addEventListener('touchstart', function(e) {
112
+ const touch = e.touches[0];
113
+ window.ReactNativeWebView.postMessage(JSON.stringify({
114
+ type: 'CONSOLE',
115
+ level: 'debug',
116
+ data: 'Touch coordinates: ' + JSON.stringify({
117
+ clientX: touch.clientX,
118
+ clientY: touch.clientY,
119
+ pageX: touch.pageX,
120
+ pageY: touch.pageY
121
+ })
122
+ }));
123
+ }, true);
124
+
125
+ true;
126
+ `;
127
+
128
+ return (
129
+ <WebView
130
+ ref={ref}
131
+ {...restProps}
132
+ injectedJavaScript={`
133
+ ${defaultInjectedJavaScript}
134
+ ${props.injectedJavaScript || ""}
135
+ `}
136
+ onMessage={(event) => {
137
+ props.onMessage?.(event);
138
+ try {
139
+ const data = JSON.parse(event.nativeEvent.data);
140
+ if (data.type === "CONSOLE") {
141
+ onDebugMessage?.(data.data);
142
+ }
143
+ } catch (e) {}
144
+ }}
145
+ style={[{ opacity: 0.99 }, props.style]} // Force new layer
146
+ bounces={false}
147
+ showsHorizontalScrollIndicator={false}
148
+ showsVerticalScrollIndicator={false}
149
+ scalesPageToFit={true}
150
+ automaticallyAdjustContentInsets={false}
151
+ decelerationRate="normal"
152
+ scrollEnabled={true}
153
+ directionalLockEnabled={true}
154
+ />
155
+ );
156
+ }
157
+ );
158
+
159
+ export default ChatbotWebView;
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated. Do not modify it manually.
2
- export const SDK_VERSION = '2.0.19-staging.20';
2
+ export const SDK_VERSION = '2.0.19-staging.23';