posthog-react-native 3.15.0 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/lib/posthog-core/src/eventemitter.d.ts +8 -8
  2. package/lib/posthog-core/src/eventemitter.js +1 -0
  3. package/lib/posthog-core/src/eventemitter.js.map +1 -0
  4. package/lib/posthog-core/src/featureFlagUtils.d.ts +34 -34
  5. package/lib/posthog-core/src/featureFlagUtils.js +1 -0
  6. package/lib/posthog-core/src/featureFlagUtils.js.map +1 -0
  7. package/lib/posthog-core/src/index.d.ts +242 -239
  8. package/lib/posthog-core/src/index.js +1 -0
  9. package/lib/posthog-core/src/index.js.map +1 -0
  10. package/lib/posthog-core/src/lz-string.d.ts +8 -8
  11. package/lib/posthog-core/src/lz-string.js +1 -0
  12. package/lib/posthog-core/src/lz-string.js.map +1 -0
  13. package/lib/posthog-core/src/types.d.ts +422 -423
  14. package/lib/posthog-core/src/types.js +1 -0
  15. package/lib/posthog-core/src/types.js.map +1 -0
  16. package/lib/posthog-core/src/utils.d.ts +19 -19
  17. package/lib/posthog-core/src/utils.js +1 -0
  18. package/lib/posthog-core/src/utils.js.map +1 -0
  19. package/lib/posthog-core/src/vendor/uuidv7.d.ts +179 -179
  20. package/lib/posthog-core/src/vendor/uuidv7.js +7 -0
  21. package/lib/posthog-core/src/vendor/uuidv7.js.map +1 -0
  22. package/lib/posthog-react-native/index.d.ts +10 -10
  23. package/lib/posthog-react-native/index.js +1 -0
  24. package/lib/posthog-react-native/index.js.map +1 -0
  25. package/lib/posthog-react-native/src/PostHogContext.d.ts +5 -5
  26. package/lib/posthog-react-native/src/PostHogContext.js +1 -0
  27. package/lib/posthog-react-native/src/PostHogContext.js.map +1 -0
  28. package/lib/posthog-react-native/src/PostHogProvider.d.ts +14 -14
  29. package/lib/posthog-react-native/src/PostHogProvider.js +1 -0
  30. package/lib/posthog-react-native/src/PostHogProvider.js.map +1 -0
  31. package/lib/posthog-react-native/src/autocapture.d.ts +4 -4
  32. package/lib/posthog-react-native/src/autocapture.js +1 -0
  33. package/lib/posthog-react-native/src/autocapture.js.map +1 -0
  34. package/lib/posthog-react-native/src/frameworks/wix-navigation.d.ts +3 -3
  35. package/lib/posthog-react-native/src/frameworks/wix-navigation.js +1 -0
  36. package/lib/posthog-react-native/src/frameworks/wix-navigation.js.map +1 -0
  37. package/lib/posthog-react-native/src/hooks/useFeatureFlag.d.ts +5 -5
  38. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js +1 -0
  39. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js.map +1 -0
  40. package/lib/posthog-react-native/src/hooks/useFeatureFlags.d.ts +3 -3
  41. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js +1 -0
  42. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js.map +1 -0
  43. package/lib/posthog-react-native/src/hooks/useNavigationTracker.d.ts +6 -6
  44. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js +1 -0
  45. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js.map +1 -0
  46. package/lib/posthog-react-native/src/hooks/usePostHog.d.ts +2 -2
  47. package/lib/posthog-react-native/src/hooks/usePostHog.js +1 -0
  48. package/lib/posthog-react-native/src/hooks/usePostHog.js.map +1 -0
  49. package/lib/posthog-react-native/src/legacy.d.ts +4 -4
  50. package/lib/posthog-react-native/src/legacy.js +1 -0
  51. package/lib/posthog-react-native/src/legacy.js.map +1 -0
  52. package/lib/posthog-react-native/src/native-deps.d.ts +4 -4
  53. package/lib/posthog-react-native/src/native-deps.js +1 -0
  54. package/lib/posthog-react-native/src/native-deps.js.map +1 -0
  55. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.d.ts +2 -2
  56. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js +1 -0
  57. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js.map +1 -0
  58. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.d.ts +2 -2
  59. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js +1 -0
  60. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js.map +1 -0
  61. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.d.ts +2 -2
  62. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js +1 -0
  63. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js.map +1 -0
  64. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.d.ts +2 -2
  65. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js +1 -0
  66. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js.map +1 -0
  67. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.d.ts +2 -2
  68. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js +1 -0
  69. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js.map +1 -0
  70. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.d.ts +2 -2
  71. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js +1 -0
  72. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js.map +1 -0
  73. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.d.ts +13 -13
  74. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js +1 -0
  75. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js.map +1 -0
  76. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.d.ts +2 -2
  77. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js +1 -0
  78. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js.map +1 -0
  79. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.d.ts +2 -2
  80. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js +1 -0
  81. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js.map +1 -0
  82. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.d.ts +2 -2
  83. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js +1 -0
  84. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js.map +1 -0
  85. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.d.ts +2 -2
  86. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js +1 -0
  87. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js.map +1 -0
  88. package/lib/posthog-react-native/src/posthog-rn.d.ts +71 -71
  89. package/lib/posthog-react-native/src/posthog-rn.js +1 -0
  90. package/lib/posthog-react-native/src/posthog-rn.js.map +1 -0
  91. package/lib/posthog-react-native/src/storage.d.ts +21 -21
  92. package/lib/posthog-react-native/src/storage.js +1 -0
  93. package/lib/posthog-react-native/src/storage.js.map +1 -0
  94. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.d.ts +16 -16
  95. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js +1 -0
  96. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js.map +1 -0
  97. package/lib/posthog-react-native/src/surveys/components/BottomSection.d.ts +9 -9
  98. package/lib/posthog-react-native/src/surveys/components/BottomSection.js +1 -0
  99. package/lib/posthog-react-native/src/surveys/components/BottomSection.js.map +1 -0
  100. package/lib/posthog-react-native/src/surveys/components/Cancel.d.ts +6 -6
  101. package/lib/posthog-react-native/src/surveys/components/Cancel.js +1 -0
  102. package/lib/posthog-react-native/src/surveys/components/Cancel.js.map +1 -0
  103. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.d.ts +13 -13
  104. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js +1 -0
  105. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js.map +1 -0
  106. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.d.ts +7 -7
  107. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js +1 -0
  108. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js.map +1 -0
  109. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.d.ts +27 -27
  110. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js +1 -0
  111. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js.map +1 -0
  112. package/lib/posthog-react-native/src/surveys/components/SurveyModal.d.ts +10 -10
  113. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js +1 -0
  114. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js.map +1 -0
  115. package/lib/posthog-react-native/src/surveys/components/Surveys.d.ts +14 -14
  116. package/lib/posthog-react-native/src/surveys/components/Surveys.js +1 -0
  117. package/lib/posthog-react-native/src/surveys/components/Surveys.js.map +1 -0
  118. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.d.ts +2 -2
  119. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js +1 -0
  120. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js.map +1 -0
  121. package/lib/posthog-react-native/src/surveys/icons.d.ts +8 -10
  122. package/lib/posthog-react-native/src/surveys/icons.js +1 -0
  123. package/lib/posthog-react-native/src/surveys/icons.js.map +1 -0
  124. package/lib/posthog-react-native/src/surveys/index.d.ts +6 -6
  125. package/lib/posthog-react-native/src/surveys/index.js +1 -0
  126. package/lib/posthog-react-native/src/surveys/index.js.map +1 -0
  127. package/lib/posthog-react-native/src/surveys/surveys-utils.d.ts +13 -13
  128. package/lib/posthog-react-native/src/surveys/surveys-utils.js +1 -0
  129. package/lib/posthog-react-native/src/surveys/surveys-utils.js.map +1 -0
  130. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.d.ts +3 -3
  131. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js +1 -0
  132. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js.map +1 -0
  133. package/lib/posthog-react-native/src/surveys/useSurveyStorage.d.ts +8 -8
  134. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js +1 -0
  135. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js.map +1 -0
  136. package/lib/posthog-react-native/src/types.d.ts +112 -112
  137. package/lib/posthog-react-native/src/types.js +1 -0
  138. package/lib/posthog-react-native/src/types.js.map +1 -0
  139. package/lib/posthog-react-native/src/version.d.ts +1 -1
  140. package/lib/posthog-react-native/src/version.js +1 -0
  141. package/lib/posthog-react-native/src/version.js.map +1 -0
  142. package/lib/posthog-react-native/tsconfig.tsbuildinfo +1 -0
  143. package/package.json +8 -9
  144. package/lib/index.cjs.js +0 -4677
  145. package/lib/index.cjs.js.map +0 -1
  146. package/lib/index.d.ts +0 -875
  147. package/lib/index.esm.js +0 -4659
  148. package/lib/index.esm.js.map +0 -1
  149. package/lib/posthog-react-native/test/test-utils.d.ts +0 -2
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.defaultPostHogLabelProp=exports.autocaptureFromTouchEvent=void 0;var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}var _flattenStyles=function flattenStyles(styles){var flattened={};if(Array.isArray(styles)){var _iterator=_createForOfIteratorHelper(styles),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var style=_step.value;Object.assign(flattened,_flattenStyles(style));}}catch(err){_iterator.e(err);}finally{_iterator.f();}}else{Object.assign(flattened,styles);}return flattened;};var stringifyStyle=function stringifyStyle(styles){var flattened=_flattenStyles(styles);var str=Object.keys(flattened).map(function(x){return"".concat(x,":").concat(flattened[x]);}).join(';');return str;};var sanitiseLabel=function sanitiseLabel(label){return label.replace(/[^a-z0-9]+/gi,'-');};var defaultPostHogLabelProp=exports.defaultPostHogLabelProp='ph-label';var autocaptureFromTouchEvent=exports.autocaptureFromTouchEvent=function autocaptureFromTouchEvent(e,posthog){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _a,_b;var _options$noCapturePro=options.noCaptureProp,noCaptureProp=_options$noCapturePro===void 0?'ph-no-capture':_options$noCapturePro,_options$customLabelP=options.customLabelProp,customLabelProp=_options$customLabelP===void 0?defaultPostHogLabelProp:_options$customLabelP,_options$maxElementsC=options.maxElementsCaptured,maxElementsCaptured=_options$maxElementsC===void 0?20:_options$maxElementsC,_options$ignoreLabels=options.ignoreLabels,ignoreLabels=_options$ignoreLabels===void 0?[]:_options$ignoreLabels,_options$propsToCaptu=options.propsToCapture,propsToCapture=_options$propsToCaptu===void 0?['style','testID','accessibilityLabel',customLabelProp,'children']:_options$propsToCaptu;if(!e._targetInst){return;}var elements=[];var currentInst=e._targetInst;var _loop=function _loop(){var el={tag_name:''};var props=currentInst.memoizedProps;if(props===null||props===void 0?void 0:props[noCaptureProp]){return{v:void 0};}if(props){Object.keys(props).forEach(function(key){if(!propsToCapture.includes(key)){return;}var value=props[key];if(key==='style'){el.attr__style=stringifyStyle(value);}else if(['string','number','boolean'].includes((0,_typeof2["default"])(value))){if(key==='children'){el.$el_text=typeof value==='string'?value:JSON.stringify(value);}else{el["attr__".concat(key)]=value;}}});}var label=typeof(props===null||props===void 0?void 0:props[customLabelProp])!=='undefined'?"".concat(props[customLabelProp]):((_a=currentInst.elementType)===null||_a===void 0?void 0:_a.displayName)||((_b=currentInst.elementType)===null||_b===void 0?void 0:_b.name);if(label&&!ignoreLabels.includes(label)){el.tag_name=sanitiseLabel(label);elements.push(el);}currentInst=currentInst["return"];},_ret;while(currentInst&&elements.length<maxElementsCaptured){_ret=_loop();if(_ret)return _ret.v;}if(elements.length){var elAttrLabelKey="attr__".concat(customLabelProp);var lastLabel=undefined;for(var i=elements.length-1;i>=0;i--){var element=elements[i];if(element[elAttrLabelKey]){lastLabel=element[elAttrLabelKey];}if(lastLabel){element['tag_name']=lastLabel;}}posthog.autocapture('touch',elements,{$touch_x:e.nativeEvent.pageX,$touch_y:e.nativeEvent.pageY});}};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocapture.js","sourceRoot":"","sources":["../../../src/autocapture.tsx"],"names":[],"mappings":"AAaA,MAAM,aAAa,GAAG,CAAC,MAAW,EAAO,EAAE;IACzC,MAAM,SAAS,GAAQ,EAAE,CAAA;IAEzB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;SAC/C;KACF;SAAM;QACL,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;KACjC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,MAAW,EAAU,EAAE;IAC7C,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IAEvC,MAAM,GAAG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I,QAAQ,CAAC,MAAM,EAAE;QACnB,uHAAuH;QACvH,2FAA2F;QAC3F,0GAA0G;QAC1G,MAAM,cAAc,GAAG,SAAS,eAAe,EAAE,CAAA;QACjD,IAAI,SAAS,GAAuB,SAAS,CAAA;QAE7C,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YAC3B,IAAI,OAAO,CAAC,cAAc,CAAC,EAAE;gBAC3B,0FAA0F;gBAC1F,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;aACpC;YAED,qDAAqD;YACrD,IAAI,SAAS,EAAE;gBACb,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS,CAAA;aAChC;SACF;QACD,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE;YACrC,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK;YAC7B,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK;SAC9B,CAAC,CAAA;KACH;AACH,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
- import { PostHog } from '../posthog-rn';
2
- import { PostHogAutocaptureOptions } from '../types';
3
- export declare const withReactNativeNavigation: (posthog: PostHog, options?: PostHogAutocaptureOptions) => boolean;
1
+ import { PostHog } from '../posthog-rn';
2
+ import { PostHogAutocaptureOptions } from '../types';
3
+ export declare const withReactNativeNavigation: (posthog: PostHog, options?: PostHogAutocaptureOptions) => boolean;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.withReactNativeNavigation=void 0;var _OptionalReactNativeNavigationWix=require("../optional/OptionalReactNativeNavigationWix");var withReactNativeNavigation=exports.withReactNativeNavigation=function withReactNativeNavigation(posthog){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!_OptionalReactNativeNavigationWix.OptionalReactNativeNavigationWix){return false;}var Navigation=_OptionalReactNativeNavigationWix.OptionalReactNativeNavigationWix.Navigation;Navigation.events().registerComponentDidAppearListener(function(_ref){var componentName=_ref.componentName,passProps=_ref.passProps;var _a,_b,_c,_d,_e;if(!((_a=options.captureScreens)!==null&&_a!==void 0?_a:true)){return;}var currentRouteName=((_c=(_b=options===null||options===void 0?void 0:options.navigation)===null||_b===void 0?void 0:_b.routeToName)===null||_c===void 0?void 0:_c.call(_b,componentName,passProps||{}))||componentName||'Unknown';if(currentRouteName){var properties=(_e=(_d=options===null||options===void 0?void 0:options.navigation)===null||_d===void 0?void 0:_d.routeToProperties)===null||_e===void 0?void 0:_e.call(_d,currentRouteName,passProps||{});posthog.screen(currentRouteName,properties);}});return true;};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wix-navigation.js","sourceRoot":"","sources":["../../../../src/frameworks/wix-navigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAA;AAI/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,OAAgB,EAAE,UAAqC,EAAE,EAAW,EAAE;IAC9G,IAAI,CAAC,gCAAgC,EAAE;QACrC,OAAO,KAAK,CAAA;KACb;IAED,MAAM,UAAU,GAAG,gCAAgC,CAAC,UAAU,CAAA;IAE9D,uCAAuC;IACvC,UAAU,CAAC,MAAM,EAAE,CAAC,kCAAkC,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE;;QACtF,IAAI,CAAC,CAAC,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,CAAC,EAAE;YACrC,OAAM;SACP;QAED,MAAM,gBAAgB,GACpB,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,0CAAE,WAAW,mDAAG,aAAa,EAAE,SAAS,IAAI,EAAE,CAAC,KAAI,aAAa,IAAI,SAAS,CAAA;QAElG,IAAI,gBAAgB,EAAE;YACpB,MAAM,UAAU,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,0CAAE,iBAAiB,mDAAG,gBAAgB,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;YAC9F,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;SAC7C;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { JsonType, FeatureFlagValue } from 'posthog-core/src';
2
- import { PostHog } from '../posthog-rn';
3
- export declare function useFeatureFlag(flag: string, client?: PostHog): FeatureFlagValue | undefined;
4
- export type FeatureFlagWithPayload = [FeatureFlagValue | undefined, JsonType | undefined];
5
- export declare function useFeatureFlagWithPayload(flag: string, client?: PostHog): FeatureFlagWithPayload;
1
+ import { JsonType, FeatureFlagValue } from 'posthog-core/src';
2
+ import { PostHog } from '../posthog-rn';
3
+ export declare function useFeatureFlag(flag: string, client?: PostHog): FeatureFlagValue | undefined;
4
+ export type FeatureFlagWithPayload = [FeatureFlagValue | undefined, JsonType | undefined];
5
+ export declare function useFeatureFlagWithPayload(flag: string, client?: PostHog): FeatureFlagWithPayload;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useFeatureFlag=useFeatureFlag;exports.useFeatureFlagWithPayload=useFeatureFlagWithPayload;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _usePostHog=require("./usePostHog");function useFeatureFlag(flag,client){var contextClient=(0,_usePostHog.usePostHog)();var posthog=client||contextClient;var _useState=(0,_react.useState)(posthog.getFeatureFlag(flag)),_useState2=(0,_slicedToArray2["default"])(_useState,2),featureFlag=_useState2[0],setFeatureFlag=_useState2[1];(0,_react.useEffect)(function(){setFeatureFlag(posthog.getFeatureFlag(flag));return posthog.onFeatureFlags(function(){setFeatureFlag(posthog.getFeatureFlag(flag));});},[posthog,flag]);return featureFlag;}function useFeatureFlagWithPayload(flag,client){var contextClient=(0,_usePostHog.usePostHog)();var posthog=client||contextClient;var _useState3=(0,_react.useState)([undefined,undefined]),_useState4=(0,_slicedToArray2["default"])(_useState3,2),featureFlag=_useState4[0],setFeatureFlag=_useState4[1];(0,_react.useEffect)(function(){setFeatureFlag([posthog.getFeatureFlag(flag),posthog.getFeatureFlagPayload(flag)]);return posthog.onFeatureFlags(function(){setFeatureFlag([posthog.getFeatureFlag(flag),posthog.getFeatureFlagPayload(flag)]);});},[posthog,flag]);return featureFlag;}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFeatureFlag.js","sourceRoot":"","sources":["../../../../src/hooks/useFeatureFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAgB;IAC3D,MAAM,aAAa,GAAG,UAAU,EAAE,CAAA;IAClC,MAAM,OAAO,GAAG,MAAM,IAAI,aAAa,CAAA;IAEvC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAA+B,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;IAE1G,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE;YACjC,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAEnB,OAAO,WAAW,CAAA;AACpB,CAAC;AAID,MAAM,UAAU,yBAAyB,CAAC,IAAY,EAAE,MAAgB;IACtE,MAAM,aAAa,GAAG,UAAU,EAAE,CAAA;IAClC,MAAM,OAAO,GAAG,MAAM,IAAI,aAAa,CAAA;IACvC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;IAE9F,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACnF,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE;YACjC,cAAc,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrF,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAEnB,OAAO,WAAW,CAAA;AACpB,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { PostHog } from '../posthog-rn';
2
- import { PostHogDecideResponse } from 'posthog-core';
3
- export declare function useFeatureFlags(client?: PostHog): PostHogDecideResponse['featureFlags'] | undefined;
1
+ import type { PostHog } from '../posthog-rn';
2
+ import { PostHogDecideResponse } from 'posthog-core';
3
+ export declare function useFeatureFlags(client?: PostHog): PostHogDecideResponse['featureFlags'] | undefined;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useFeatureFlags=useFeatureFlags;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _usePostHog=require("./usePostHog");function useFeatureFlags(client){var contextClient=(0,_usePostHog.usePostHog)();var posthog=client||contextClient;var _useState=(0,_react.useState)(posthog.getFeatureFlags()),_useState2=(0,_slicedToArray2["default"])(_useState,2),featureFlags=_useState2[0],setFeatureFlags=_useState2[1];(0,_react.useEffect)(function(){setFeatureFlags(posthog.getFeatureFlags());return posthog.onFeatureFlags(function(flags){setFeatureFlags(flags);});},[posthog]);return featureFlags;}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFeatureFlags.js","sourceRoot":"","sources":["../../../../src/hooks/useFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,eAAe,CAAC,MAAgB;IAC9C,MAAM,aAAa,GAAG,UAAU,EAAE,CAAA;IAClC,MAAM,OAAO,GAAG,MAAM,IAAI,aAAa,CAAA;IACvC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,OAAO,CAAC,eAAe,EAAE,CAC1B,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAA;QAC1C,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,eAAe,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,OAAO,YAAY,CAAA;AACrB,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { PostHog } from '../posthog-rn';
2
- import { PostHogAutocaptureNavigationTrackerOptions } from '../types';
3
- import { PostHogNavigationRef } from '../types';
4
- declare function _useNavigationTracker(options?: PostHogAutocaptureNavigationTrackerOptions, navigationRef?: PostHogNavigationRef, client?: PostHog): void;
5
- export declare const useNavigationTracker: typeof _useNavigationTracker;
6
- export {};
1
+ import type { PostHog } from '../posthog-rn';
2
+ import { PostHogAutocaptureNavigationTrackerOptions } from '../types';
3
+ import { PostHogNavigationRef } from '../types';
4
+ declare function _useNavigationTracker(options?: PostHogAutocaptureNavigationTrackerOptions, navigationRef?: PostHogNavigationRef, client?: PostHog): void;
5
+ export declare const useNavigationTracker: typeof _useNavigationTracker;
6
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useNavigationTracker=void 0;var _react=require("react");var _OptionalReactNativeNavigation=require("../optional/OptionalReactNativeNavigation");var _usePostHog=require("./usePostHog");function _useNavigationTrackerDisabled(){return;}function _useNavigationTracker(options,navigationRef,client){var contextClient=(0,_usePostHog.usePostHog)();var posthog=client||contextClient;if(!_OptionalReactNativeNavigation.OptionalReactNativeNavigation){throw new Error('No OptionalReactNativeNavigation');}var routes=_OptionalReactNativeNavigation.OptionalReactNativeNavigation.useNavigationState(function(state){return state===null||state===void 0?void 0:state.routes;});var navigation=navigationRef||_OptionalReactNativeNavigation.OptionalReactNativeNavigation.useNavigation();var trackRoute=(0,_react.useCallback)(function(){var _a,_b,_c;if(!navigation){return;}var currentRoute=undefined;try{var isReady=false;try{isReady=navigation.isReady();}catch(error){isReady=true;}if(!isReady){return;}currentRoute=navigation.getCurrentRoute();}catch(error){return;}if(!currentRoute){return;}var _currentRoute=currentRoute,state=_currentRoute.state;var _currentRoute2=currentRoute,name=_currentRoute2.name,params=_currentRoute2.params;if((_a=state===null||state===void 0?void 0:state.routes)===null||_a===void 0?void 0:_a.length){var route=state.routes[state.routes.length-1];name=route.name;params=route.params;}var currentRouteName=((_b=options===null||options===void 0?void 0:options.routeToName)===null||_b===void 0?void 0:_b.call(options,name,params))||name||'Unknown';if(currentRouteName){var properties=(_c=options===null||options===void 0?void 0:options.routeToProperties)===null||_c===void 0?void 0:_c.call(options,currentRouteName,params);posthog.screen(currentRouteName,properties);}},[navigation,options,posthog]);(0,_react.useEffect)(function(){if(!routes){setTimeout(trackRoute,1);return;}trackRoute();},[routes,trackRoute]);}var useNavigationTracker=exports.useNavigationTracker=_OptionalReactNativeNavigation.OptionalReactNativeNavigation?_useNavigationTracker:_useNavigationTrackerDisabled;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNavigationTracker.js","sourceRoot":"","sources":["../../../../src/hooks/useNavigationTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA;AAGzF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,SAAS,6BAA6B;IACpC,OAAM;AACR,CAAC;AAED,SAAS,qBAAqB,CAC5B,OAAoD,EACpD,aAAoC,EACpC,MAAgB;IAEhB,MAAM,aAAa,GAAG,UAAU,EAAE,CAAA;IAClC,MAAM,OAAO,GAAG,MAAM,IAAI,aAAa,CAAA;IAEvC,IAAI,CAAC,6BAA6B,EAAE;QAClC,0EAA0E;QAC1E,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;KACpD;IAED,MAAM,MAAM,GAAG,6BAA6B,CAAC,kBAAkB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAA;IACzF,sDAAsD;IACtD,MAAM,UAAU,GAAG,aAAa,IAAI,6BAA6B,CAAC,aAAa,EAAE,CAAA;IAEjF,MAAM,UAAU,GAAG,WAAW,CAAC,GAAS,EAAE;;QACxC,IAAI,CAAC,UAAU,EAAE;YACf,OAAM;SACP;QAED,IAAI,YAAY,GAAG,SAAS,CAAA;QAE5B,iHAAiH;QACjH,IAAI;YACF,IAAI,OAAO,GAAG,KAAK,CAAA;YACnB,IAAI;gBACF,OAAO,GAAI,UAAkB,CAAC,OAAO,EAAE,CAAA;aACxC;YAAC,OAAO,KAAK,EAAE;gBACd,6DAA6D;gBAC7D,OAAO,GAAG,IAAI,CAAA;aACf;YAED,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAM;aACP;YAED,YAAY,GAAI,UAAkB,CAAC,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BAAqB;IACvB,CAAC,CAAC,6BAA6B,CAAA"}
@@ -1,2 +1,2 @@
1
- import { PostHog } from '../posthog-rn';
2
- export declare const usePostHog: () => PostHog;
1
+ import { PostHog } from '../posthog-rn';
2
+ export declare const usePostHog: () => PostHog;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePostHog=void 0;var _react=_interopRequireDefault(require("react"));var _PostHogContext=require("../PostHogContext");var usePostHog=exports.usePostHog=function usePostHog(){var _React$useContext=_react["default"].useContext(_PostHogContext.PostHogContext),client=_React$useContext.client;return client;};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePostHog.js","sourceRoot":"","sources":["../../../../src/hooks/usePostHog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE;IACtC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;IACnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- export declare const getLegacyValues: () => Promise<{
2
- distinctId?: string;
3
- anonymousId?: string;
4
- } | undefined>;
1
+ export declare const getLegacyValues: () => Promise<{
2
+ distinctId?: string;
3
+ anonymousId?: string;
4
+ } | undefined>;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getLegacyValues=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var getLegacyValues=exports.getLegacyValues=function(){var _ref=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var posthogFileDirectory,posthogDistinctIdFile,posthogAnonymousIdFile,res;return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(!_OptionalExpoFileSystem.OptionalExpoFileSystem||!_OptionalExpoApplication.OptionalExpoApplication)){_context.next=2;break;}return _context.abrupt("return");case 2:if(!(_reactNative.Platform.OS==='ios')){_context.next=30;break;}posthogFileDirectory="".concat(_OptionalExpoFileSystem.OptionalExpoFileSystem.documentDirectory,"../Library/Application%20Support/").concat(_OptionalExpoApplication.OptionalExpoApplication.applicationId,"/");posthogDistinctIdFile=posthogFileDirectory+'posthog.distinctId';posthogAnonymousIdFile=posthogFileDirectory+'posthog.anonymousId';res={distinctId:undefined,anonymousId:undefined};_context.prev=7;_context.t0=JSON;_context.next=11;return _OptionalExpoFileSystem.OptionalExpoFileSystem.readAsStringAsync(posthogDistinctIdFile);case 11:_context.t1=_context.sent;res.distinctId=_context.t0.parse.call(_context.t0,_context.t1)['posthog.distinctId'];_context.next=17;break;case 15:_context.prev=15;_context.t2=_context["catch"](7);case 17:_context.prev=17;_context.t3=JSON;_context.next=21;return _OptionalExpoFileSystem.OptionalExpoFileSystem.readAsStringAsync(posthogAnonymousIdFile);case 21:_context.t4=_context.sent;res.anonymousId=_context.t3.parse.call(_context.t3,_context.t4)['posthog.anonymousId'];_context.next=27;break;case 25:_context.prev=25;_context.t5=_context["catch"](17);case 27:return _context.abrupt("return",res);case 30:case"end":return _context.stop();}},_callee,null,[[7,15],[17,25]]);}));return function getLegacyValues(){return _ref.apply(this,arguments);};}();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../../src/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAwE,EAAE;IAC5G,yEAAyE;IACzE,oGAAoG;IAEpG,IAAI,CAAC,sBAAsB,IAAI,CAAC,uBAAuB,EAAE;QACvD,OAAM;KACP;IAED,mDAAmD;IACnD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,MAAM,oBAAoB,GAAG,GAAG,sBAAsB,CAAC,iBAAiB,oCAAoC,uBAAuB,CAAC,aAAa,GAAG,CAAA;QACpJ,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,oBAAoB,CAAA;QACzE,MAAM,sBAAsB,GAAG,oBAAoB,GAAG,qBAAqB,CAAA;QAE3E,MAAM,GAAG,GAAG;YACV,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,SAAS;SACvB,CAAA;QAED,IAAI;YACF,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,sBAAsB,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAChG,oBAAoB,CACrB,CAAA;SACF;QAAC,OAAO,CAAC,EAAE,GAAE;QAEd,IAAI;YACF,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,sBAAsB,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAClG,qBAAqB,CACtB,CAAA;SACF;QAAC,OAAO,CAAC,EAAE,GAAE;QAEd,OAAO,GAAG,CAAA;KACX;SAAM;QACL,qGAAqG;KACtG;AACH,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { PostHogCustomAppProperties, PostHogCustomStorage } from './types';
2
- export declare const currentDeviceType: string;
3
- export declare const getAppProperties: () => PostHogCustomAppProperties;
4
- export declare const buildOptimisiticAsyncStorage: () => PostHogCustomStorage;
1
+ import { PostHogCustomAppProperties, PostHogCustomStorage } from './types';
2
+ export declare const currentDeviceType: string;
3
+ export declare const getAppProperties: () => PostHogCustomAppProperties;
4
+ export declare const buildOptimisiticAsyncStorage: () => PostHogCustomStorage;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppProperties=exports.currentDeviceType=exports.buildOptimisiticAsyncStorage=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _OptionalAsyncStorage=require("./optional/OptionalAsyncStorage");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoDevice=require("./optional/OptionalExpoDevice");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var _OptionalExpoLocalization=require("./optional/OptionalExpoLocalization");var _OptionalReactNativeDeviceInfo=require("./optional/OptionalReactNativeDeviceInfo");var _OptionalReactNativeLocalize=require("./optional/OptionalReactNativeLocalize");var getDeviceType=function getDeviceType(){var deviceType='Mobile';if(_reactNative.Platform.OS==='macos'||_reactNative.Platform.OS==='windows'){deviceType='Desktop';}else if(_reactNative.Platform.OS==='web'){deviceType='Web';}return deviceType;};var currentDeviceType=exports.currentDeviceType=getDeviceType();var getAppProperties=exports.getAppProperties=function getAppProperties(){var properties={$device_type:currentDeviceType};if(_OptionalExpoApplication.OptionalExpoApplication){properties.$app_build=_OptionalExpoApplication.OptionalExpoApplication.nativeBuildVersion;properties.$app_name=_OptionalExpoApplication.OptionalExpoApplication.applicationName;properties.$app_namespace=_OptionalExpoApplication.OptionalExpoApplication.applicationId;properties.$app_version=_OptionalExpoApplication.OptionalExpoApplication.nativeApplicationVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$app_build=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBuildNumber());properties.$app_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getApplicationName());properties.$app_namespace=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBundleId());properties.$app_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getVersion());}if(_OptionalExpoDevice.OptionalExpoDevice){properties.$device_manufacturer=_OptionalExpoDevice.OptionalExpoDevice.manufacturer;properties.$device_name=_OptionalExpoDevice.OptionalExpoDevice.modelName;if(_reactNative.Platform.OS==='android'){properties.$os_name='Android';}else{properties.$os_name=_OptionalExpoDevice.OptionalExpoDevice.osName;}properties.$os_version=_OptionalExpoDevice.OptionalExpoDevice.osVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$device_manufacturer=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getManufacturerSync());properties.$device_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getModel());properties.$os_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemName());properties.$os_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemVersion());}if(_OptionalExpoLocalization.OptionalExpoLocalization){properties.$locale=_OptionalExpoLocalization.OptionalExpoLocalization.locale;properties.$timezone=_OptionalExpoLocalization.OptionalExpoLocalization.timezone;}else if(_OptionalReactNativeLocalize.OptionalReactNativeLocalize){var localesFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getLocales;if(localesFn){var locales=localesFn();if(locales&&locales.length>0){var languageTag=locales[0].languageTag;if(languageTag){properties.$locale=languageTag;}}}var timezoneFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getTimeZone;if(timezoneFn){var timezone=timezoneFn();if(timezone){properties.$timezone=timezone;}}}return properties;};var returnPropertyIfNotUnknown=function returnPropertyIfNotUnknown(value){if(value!=='unknown'){return value;}return null;};var buildOptimisiticAsyncStorage=exports.buildOptimisiticAsyncStorage=function buildOptimisiticAsyncStorage(){if(_OptionalExpoFileSystem.OptionalExpoFileSystem){var filesystem=_OptionalExpoFileSystem.OptionalExpoFileSystem;return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var uri,stringContent;return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context.prev=1;_context.next=4;return filesystem.readAsStringAsync(uri);case 4:stringContent=_context.sent;return _context.abrupt("return",stringContent);case 8:_context.prev=8;_context.t0=_context["catch"](1);return _context.abrupt("return",null);case 11:case"end":return _context.stop();}},_callee,null,[[1,8]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){var uri;return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context2.next=3;return filesystem.writeAsStringAsync(uri,value);case 3:case"end":return _context2.stop();}},_callee2);}))();}};}if(_OptionalAsyncStorage.OptionalAsyncStorage){return _OptionalAsyncStorage.OptionalAsyncStorage;}throw new Error('PostHog: No storage available. Please install expo-filesystem or react-native-async-storage OR implement a custom storage provider.');};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-deps.js","sourceRoot":"","sources":["../../../src/native-deps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC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AO,oBAAoB,CAAA;KAC5B;IAED,MAAM,IAAI,KAAK,CACb,qIAAqI,CACtI,CAAA;AACH,CAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- import type AsyncStorage from '@react-native-async-storage/async-storage';
2
- export declare let OptionalAsyncStorage: typeof AsyncStorage | undefined;
1
+ import type AsyncStorage from '@react-native-async-storage/async-storage';
2
+ export declare let OptionalAsyncStorage: typeof AsyncStorage | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalAsyncStorage=void 0;var OptionalAsyncStorage=exports.OptionalAsyncStorage=undefined;try{exports.OptionalAsyncStorage=OptionalAsyncStorage=require('@react-native-async-storage/async-storage')["default"];}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalAsyncStorage.js","sourceRoot":"","sources":["../../../../src/optional/OptionalAsyncStorage.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAI,oBAAoB,GAAoC,SAAS,CAAA;AAE5E,IAAI;IACF,8DAA8D;IAC9D,oBAAoB,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC,OAAO,CAAA;CACpF;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ExpoApplication from 'expo-application';
2
- export declare let OptionalExpoApplication: typeof ExpoApplication | undefined;
1
+ import type ExpoApplication from 'expo-application';
2
+ export declare let OptionalExpoApplication: typeof ExpoApplication | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalExpoApplication=void 0;var _reactNative=require("react-native");var OptionalExpoApplication=exports.OptionalExpoApplication=undefined;try{exports.OptionalExpoApplication=OptionalExpoApplication=_reactNative.Platform.select({macos:undefined,"default":require('expo-application')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalExpoApplication.js","sourceRoot":"","sources":["../../../../src/optional/OptionalExpoApplication.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,IAAI,uBAAuB,GAAuC,SAAS,CAAA;AAElF,IAAI;IACF,sBAAsB;IACtB,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAAC;QACxC,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC;KACrC,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ExpoDevice from 'expo-device';
2
- export declare let OptionalExpoDevice: typeof ExpoDevice | undefined;
1
+ import type ExpoDevice from 'expo-device';
2
+ export declare let OptionalExpoDevice: typeof ExpoDevice | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalExpoDevice=void 0;var _reactNative=require("react-native");var OptionalExpoDevice=exports.OptionalExpoDevice=undefined;try{exports.OptionalExpoDevice=OptionalExpoDevice=_reactNative.Platform.select({macos:undefined,"default":require('expo-device')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalExpoDevice.js","sourceRoot":"","sources":["../../../../src/optional/OptionalExpoDevice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,IAAI,kBAAkB,GAAkC,SAAS,CAAA;AAExE,IAAI;IACF,sBAAsB;IACtB,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC;QACnC,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;KAChC,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ExpoFileSystem from 'expo-file-system';
2
- export declare let OptionalExpoFileSystem: typeof ExpoFileSystem | undefined;
1
+ import type ExpoFileSystem from 'expo-file-system';
2
+ export declare let OptionalExpoFileSystem: typeof ExpoFileSystem | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalExpoFileSystem=void 0;var _reactNative=require("react-native");var OptionalExpoFileSystem=exports.OptionalExpoFileSystem=undefined;try{exports.OptionalExpoFileSystem=OptionalExpoFileSystem=_reactNative.Platform.select({macos:undefined,web:undefined,"default":require('expo-file-system')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalExpoFileSystem.js","sourceRoot":"","sources":["../../../../src/optional/OptionalExpoFileSystem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,IAAI,sBAAsB,GAAsC,SAAS,CAAA;AAEhF,IAAI;IACF,yFAAyF;IACzF,4FAA4F;IAC5F,4DAA4D;IAC5D,sFAAsF;IACtF,4EAA4E;IAC5E,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC;QACvC,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;QACd,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC;KACrC,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ExpoLocalization from 'expo-localization';
2
- export declare let OptionalExpoLocalization: typeof ExpoLocalization | undefined;
1
+ import type ExpoLocalization from 'expo-localization';
2
+ export declare let OptionalExpoLocalization: typeof ExpoLocalization | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalExpoLocalization=void 0;var _reactNative=require("react-native");var OptionalExpoLocalization=exports.OptionalExpoLocalization=undefined;try{exports.OptionalExpoLocalization=OptionalExpoLocalization=_reactNative.Platform.select({macos:undefined,"default":require('expo-localization')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalExpoLocalization.js","sourceRoot":"","sources":["../../../../src/optional/OptionalExpoLocalization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,IAAI,wBAAwB,GAAwC,SAAS,CAAA;AAEpF,IAAI;IACF,sBAAsB;IACtB,wBAAwB,GAAG,QAAQ,CAAC,MAAM,CAAC;QACzC,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC;KACtC,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ReactNativeDeviceInfo from 'react-native-device-info';
2
- export declare let OptionalReactNativeDeviceInfo: typeof ReactNativeDeviceInfo | undefined;
1
+ import type ReactNativeDeviceInfo from 'react-native-device-info';
2
+ export declare let OptionalReactNativeDeviceInfo: typeof ReactNativeDeviceInfo | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalReactNativeDeviceInfo=void 0;var _reactNative=require("react-native");var OptionalReactNativeDeviceInfo=exports.OptionalReactNativeDeviceInfo=undefined;try{exports.OptionalReactNativeDeviceInfo=OptionalReactNativeDeviceInfo=_reactNative.Platform.select({macos:undefined,"default":require('react-native-device-info')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalReactNativeDeviceInfo.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeDeviceInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGvC,MAAM,CAAC,IAAI,6BAA6B,GAA6C,SAAS,CAAA;AAE9F,IAAI;IACF,sBAAsB;IACtB,6BAA6B,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9C,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC,EAAE,kCAAkC;KACjF,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,13 +1,13 @@
1
- interface ReactNativeLocalize {
2
- getLocales: () => {
3
- languageCode: string;
4
- scriptCode?: string;
5
- countryCode: string;
6
- languageTag: string;
7
- isRTL: boolean;
8
- }[];
9
- getTimeZone(): string;
10
- }
11
- import type ReactNativeLocalize from 'react-native-localize';
12
- export declare let OptionalReactNativeLocalize: typeof ReactNativeLocalize | undefined;
13
- export {};
1
+ interface ReactNativeLocalize {
2
+ getLocales: () => {
3
+ languageCode: string;
4
+ scriptCode?: string;
5
+ countryCode: string;
6
+ languageTag: string;
7
+ isRTL: boolean;
8
+ }[];
9
+ getTimeZone(): string;
10
+ }
11
+ import type ReactNativeLocalize from 'react-native-localize';
12
+ export declare let OptionalReactNativeLocalize: typeof ReactNativeLocalize | undefined;
13
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalReactNativeLocalize=void 0;var OptionalReactNativeLocalize=exports.OptionalReactNativeLocalize=undefined;try{exports.OptionalReactNativeLocalize=OptionalReactNativeLocalize=require('react-native-localize');}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalReactNativeLocalize.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeLocalize.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,IAAI,2BAA2B,GAA2C,SAAS,CAAA;AAE1F,+BAA+B;AAC/B,+DAA+D;AAC/D,IAAI;IACF,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC/D;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ReactNativeNavigation from '@react-navigation/native';
2
- export declare let OptionalReactNativeNavigation: typeof ReactNativeNavigation | undefined;
1
+ import type ReactNativeNavigation from '@react-navigation/native';
2
+ export declare let OptionalReactNativeNavigation: typeof ReactNativeNavigation | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalReactNativeNavigation=void 0;var _reactNative=require("react-native");var OptionalReactNativeNavigation=exports.OptionalReactNativeNavigation=undefined;try{exports.OptionalReactNativeNavigation=OptionalReactNativeNavigation=_reactNative.Platform.select({macos:undefined,"default":require('@react-navigation/native')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalReactNativeNavigation.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,IAAI,6BAA6B,GAA6C,SAAS,CAAA;AAE9F,IAAI;IACF,sBAAsB;IACtB,6BAA6B,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9C,KAAK,EAAE,SAAS;QAChB,6EAA6E;QAC7E,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC;KAC7C,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type ReactNativeNavigationWix from 'react-native-navigation';
2
- export declare let OptionalReactNativeNavigationWix: typeof ReactNativeNavigationWix | undefined;
1
+ import type ReactNativeNavigationWix from 'react-native-navigation';
2
+ export declare let OptionalReactNativeNavigationWix: typeof ReactNativeNavigationWix | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalReactNativeNavigationWix=void 0;var _reactNative=require("react-native");var OptionalReactNativeNavigationWix=exports.OptionalReactNativeNavigationWix=undefined;try{exports.OptionalReactNativeNavigationWix=OptionalReactNativeNavigationWix=_reactNative.Platform.select({macos:undefined,web:undefined,"default":require('react-native-navigation')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalReactNativeNavigationWix.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeNavigationWix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGvC,MAAM,CAAC,IAAI,gCAAgC,GAAgD,SAAS,CAAA;AAEpG,IAAI;IACF,0BAA0B;IAC1B,gCAAgC,GAAG,QAAQ,CAAC,MAAM,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;QACd,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC;KAC5C,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,2 +1,2 @@
1
- import type RNSafeAreaContext from 'react-native-safe-area-context';
2
- export declare const useOptionalSafeAreaInsets: () => RNSafeAreaContext.EdgeInsets;
1
+ import type RNSafeAreaContext from 'react-native-safe-area-context';
2
+ export declare const useOptionalSafeAreaInsets: () => RNSafeAreaContext.EdgeInsets;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useOptionalSafeAreaInsets=void 0;var OptionalRNSafeArea=undefined;try{OptionalRNSafeArea=require('react-native-safe-area-context');}catch(e){}function createDefaultInsets(){return{top:60,bottom:30,left:0,right:0};}var useOptionalSafeAreaInsets=exports.useOptionalSafeAreaInsets=function useOptionalSafeAreaInsets(){var _a;var useSafeAreaInsets=(_a=OptionalRNSafeArea===null||OptionalRNSafeArea===void 0?void 0:OptionalRNSafeArea.useSafeAreaInsets)!==null&&_a!==void 0?_a:createDefaultInsets;try{return useSafeAreaInsets();}catch(err){return createDefaultInsets();}};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalReactNativeSafeArea.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeSafeArea.ts"],"names":[],"mappings":"AAEA,IAAI,kBAAkB,GAAyC,SAAS,CAAA;AAExE,IAAI;IACF,kBAAkB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAA;CAC/D;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,SAAS,mBAAmB;IAC1B,yFAAyF;IACzF,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAiC,EAAE;;IAC1E,MAAM,iBAAiB,GAAG,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,iBAAiB,mCAAI,mBAAmB,CAAA;IACtF,IAAI;QACF,OAAO,iBAAiB,EAAE,CAAA;KAC3B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,mBAAmB,EAAE,CAAA;KAC7B;AACH,CAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- import type PostHogReactNativeSessionReplay from 'posthog-react-native-session-replay';
2
- export declare let OptionalReactNativeSessionReplay: typeof PostHogReactNativeSessionReplay | undefined;
1
+ import type PostHogReactNativeSessionReplay from 'posthog-react-native-session-replay';
2
+ export declare let OptionalReactNativeSessionReplay: typeof PostHogReactNativeSessionReplay | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.OptionalReactNativeSessionReplay=void 0;var _reactNative=require("react-native");var OptionalReactNativeSessionReplay=exports.OptionalReactNativeSessionReplay=undefined;try{exports.OptionalReactNativeSessionReplay=OptionalReactNativeSessionReplay=_reactNative.Platform.select({macos:undefined,web:undefined,"default":require('posthog-react-native-session-replay')});}catch(e){}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionalSessionReplay.js","sourceRoot":"","sources":["../../../../src/optional/OptionalSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAIvC,MAAM,CAAC,IAAI,gCAAgC,GAAuD,SAAS,CAAA;AAE3G,IAAI;IACF,gCAAgC,GAAG,QAAQ,CAAC,MAAM,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,SAAS;QACd,OAAO,EAAE,OAAO,CAAC,qCAAqC,CAAC,EAAE,uBAAuB;KACjF,CAAC,CAAA;CACH;AAAC,OAAO,CAAC,EAAE,GAAE"}
@@ -1,71 +1,71 @@
1
- import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '../../posthog-core/src';
2
- import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
3
- import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
4
- export type PostHogOptions = PostHogCoreOptions & {
5
- /** Allows you to provide the storage type. By default 'file'.
6
- * 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.
7
- */
8
- persistence?: 'memory' | 'file';
9
- /** Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated */
10
- customAppProperties?: PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties);
11
- /** Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system or a synchronous storage such as mmkv.
12
- * If not provided, PostHog will attempt to use the best available storage via optional peer dependencies (async-storage, expo-file-system).
13
- * If `persistence` is set to 'memory', this option will be ignored.
14
- */
15
- customStorage?: PostHogCustomStorage;
16
- /** Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded.
17
- * By default is false.
18
- * If you're already using the 'captureLifecycleEvents' options with 'withReactNativeNavigation' or 'PostHogProvider, you don't need to set this.
19
- * If this is set, this value has priority over the 'captureLifecycleEvents' option.
20
- * Application Installed and Application Updated events are not supported with persistence set to 'memory'.
21
- */
22
- captureNativeAppLifecycleEvents?: boolean;
23
- /**
24
- * Enable Recording of Session Replays for Android and iOS
25
- * Requires Record user sessions to be enabled in the PostHog Project Settings
26
- * Defaults to false
27
- */
28
- enableSessionReplay?: boolean;
29
- /**
30
- * Configuration for Session Replay
31
- */
32
- sessionReplayConfig?: PostHogSessionReplayConfig;
33
- /**
34
- * If enabled, the session id ($session_id) will be persisted across app restarts.
35
- * This is an option for back compatibility, so your current data isn't skewed with the new version of the SDK.
36
- * If this is false, the session id will be always reset on app restart.
37
- * Defaults to false
38
- */
39
- enablePersistSessionIdAcrossRestart?: boolean;
40
- };
41
- export declare class PostHog extends PostHogCore {
42
- private _persistence;
43
- private _storage;
44
- private _appProperties;
45
- private _currentSessionId?;
46
- private _enableSessionReplay?;
47
- private _disableSurveys;
48
- private _disableRemoteConfig;
49
- constructor(apiKey: string, options?: PostHogOptions);
50
- ready(): Promise<void>;
51
- getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
52
- setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
53
- fetch(url: string, options: PostHogFetchOptions): Promise<PostHogFetchResponse>;
54
- getLibraryId(): string;
55
- getLibraryVersion(): string;
56
- getCustomUserAgent(): string;
57
- getCommonEventProperties(): any;
58
- screen(name: string, properties?: {
59
- [key: string]: any;
60
- }, options?: PostHogCaptureOptions): Promise<void>;
61
- _isEnableSessionReplay(): boolean;
62
- _resetSessionId(reactNativeSessionReplay: typeof OptionalReactNativeSessionReplay | undefined, sessionId: string): void;
63
- getSessionId(): string;
64
- resetSessionId(): void;
65
- identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
66
- initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
67
- getSurveys(): Promise<SurveyResponse['surveys']>;
68
- private startSessionReplay;
69
- private captureNativeAppLifecycleEvents;
70
- private persistAppVersion;
71
- }
1
+ import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '../../posthog-core/src';
2
+ import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
3
+ import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
4
+ export type PostHogOptions = PostHogCoreOptions & {
5
+ /** Allows you to provide the storage type. By default 'file'.
6
+ * 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.
7
+ */
8
+ persistence?: 'memory' | 'file';
9
+ /** Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated */
10
+ customAppProperties?: PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties);
11
+ /** Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system or a synchronous storage such as mmkv.
12
+ * If not provided, PostHog will attempt to use the best available storage via optional peer dependencies (async-storage, expo-file-system).
13
+ * If `persistence` is set to 'memory', this option will be ignored.
14
+ */
15
+ customStorage?: PostHogCustomStorage;
16
+ /** Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded.
17
+ * By default is false.
18
+ * If you're already using the 'captureLifecycleEvents' options with 'withReactNativeNavigation' or 'PostHogProvider, you don't need to set this.
19
+ * If this is set, this value has priority over the 'captureLifecycleEvents' option.
20
+ * Application Installed and Application Updated events are not supported with persistence set to 'memory'.
21
+ */
22
+ captureNativeAppLifecycleEvents?: boolean;
23
+ /**
24
+ * Enable Recording of Session Replays for Android and iOS
25
+ * Requires Record user sessions to be enabled in the PostHog Project Settings
26
+ * Defaults to false
27
+ */
28
+ enableSessionReplay?: boolean;
29
+ /**
30
+ * Configuration for Session Replay
31
+ */
32
+ sessionReplayConfig?: PostHogSessionReplayConfig;
33
+ /**
34
+ * If enabled, the session id ($session_id) will be persisted across app restarts.
35
+ * This is an option for back compatibility, so your current data isn't skewed with the new version of the SDK.
36
+ * If this is false, the session id will be always reset on app restart.
37
+ * Defaults to false
38
+ */
39
+ enablePersistSessionIdAcrossRestart?: boolean;
40
+ };
41
+ export declare class PostHog extends PostHogCore {
42
+ private _persistence;
43
+ private _storage;
44
+ private _appProperties;
45
+ private _currentSessionId?;
46
+ private _enableSessionReplay?;
47
+ private _disableSurveys;
48
+ private _disableRemoteConfig;
49
+ constructor(apiKey: string, options?: PostHogOptions);
50
+ ready(): Promise<void>;
51
+ getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
52
+ setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
53
+ fetch(url: string, options: PostHogFetchOptions): Promise<PostHogFetchResponse>;
54
+ getLibraryId(): string;
55
+ getLibraryVersion(): string;
56
+ getCustomUserAgent(): string;
57
+ getCommonEventProperties(): any;
58
+ screen(name: string, properties?: {
59
+ [key: string]: any;
60
+ }, options?: PostHogCaptureOptions): Promise<void>;
61
+ _isEnableSessionReplay(): boolean;
62
+ _resetSessionId(reactNativeSessionReplay: typeof OptionalReactNativeSessionReplay | undefined, sessionId: string): void;
63
+ getSessionId(): string;
64
+ resetSessionId(): void;
65
+ identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
66
+ initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
67
+ getSurveys(): Promise<SurveyResponse['surveys']>;
68
+ private startSessionReplay;
69
+ private captureNativeAppLifecycleEvents;
70
+ private persistAppVersion;
71
+ }
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHog=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _get2=_interopRequireDefault(require("@babel/runtime/helpers/get"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _reactNative=require("react-native");var _src=require("../../posthog-core/src");var _legacy=require("./legacy");var _storage=require("./storage");var _version=require("./version");var _nativeDeps=require("./native-deps");var _wixNavigation=require("./frameworks/wix-navigation");var _OptionalSessionReplay=require("./optional/OptionalSessionReplay");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _callSuper(t,o,e){return o=(0,_getPrototypeOf2["default"])(o),(0,_possibleConstructorReturn2["default"])(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2["default"])(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,e,o,r){var p=(0,_get2["default"])((0,_getPrototypeOf2["default"])(1&r?t.prototype:t),e,o);return 2&r&&"function"==typeof p?function(t){return p.apply(o,t);}:p;}var PostHog=exports.PostHog=function(_PostHogCore){function PostHog(apiKey,options){var _this;(0,_classCallCheck2["default"])(this,PostHog);var _a,_b,_c,_d;_this=_callSuper(this,PostHog,[apiKey,options]);_this._appProperties={};_this._isInitialized=false;_this._persistence=(_a=options===null||options===void 0?void 0:options.persistence)!==null&&_a!==void 0?_a:'file';_this._disableSurveys=(_b=options===null||options===void 0?void 0:options.disableSurveys)!==null&&_b!==void 0?_b:false;_this._disableRemoteConfig=(_c=options===null||options===void 0?void 0:options.disableRemoteConfig)!==null&&_c!==void 0?_c:false;_this._appProperties=typeof(options===null||options===void 0?void 0:options.customAppProperties)==='function'?options.customAppProperties((0,_nativeDeps.getAppProperties)()):(options===null||options===void 0?void 0:options.customAppProperties)||(0,_nativeDeps.getAppProperties)();_reactNative.AppState.addEventListener('change',function(){void _this.flush();});var storagePromise;if(_this._persistence==='file'){_this._storage=new _storage.PostHogRNStorage((_d=options===null||options===void 0?void 0:options.customStorage)!==null&&_d!==void 0?_d:(0,_nativeDeps.buildOptimisiticAsyncStorage)());storagePromise=_this._storage.preloadPromise;}else{_this._storage=new _storage.PostHogRNSyncMemoryStorage();}if(storagePromise){storagePromise.then(function(){if(!_this._storage.getItem(_src.PostHogPersistedProperty.AnonymousId)){void(0,_legacy.getLegacyValues)().then(function(legacyValues){var _a,_b;if(legacyValues===null||legacyValues===void 0?void 0:legacyValues.distinctId){(_a=_this._storage)===null||_a===void 0?void 0:_a.setItem(_src.PostHogPersistedProperty.DistinctId,legacyValues.distinctId);(_b=_this._storage)===null||_b===void 0?void 0:_b.setItem(_src.PostHogPersistedProperty.AnonymousId,legacyValues.anonymousId);}});}});}var initAfterStorage=function initAfterStorage(){var enablePersistSessionIdAcrossRestart=options===null||options===void 0?void 0:options.enablePersistSessionIdAcrossRestart;if(!enablePersistSessionIdAcrossRestart){_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionId,null);_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionLastTimestamp,null);}_this.setupBootstrap(options);_this._isInitialized=true;if(_this._disableRemoteConfig===false){_this.reloadRemoteConfigAsync();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Remote config is disabled.");});if((options===null||options===void 0?void 0:options.preloadFeatureFlags)!==false){_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Feature flags will be preloaded from Decide API.");});_this.reloadFeatureFlags();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"preloadFeatureFlags is disabled.");});}}if(options===null||options===void 0?void 0:options.captureNativeAppLifecycleEvents){void _this.captureNativeAppLifecycleEvents();}void _this.persistAppVersion();void _this.startSessionReplay(options);};if(storagePromise){_this._initPromise=storagePromise.then(initAfterStorage);}else{_this._initPromise=Promise.resolve();initAfterStorage();}return _this;}(0,_inherits2["default"])(PostHog,_PostHogCore);return(0,_createClass2["default"])(PostHog,[{key:"ready",value:function(){var _ready=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return this._initPromise;case 2:case"end":return _context.stop();}},_callee,this);}));function ready(){return _ready.apply(this,arguments);}return ready;}()},{key:"getPersistedProperty",value:function getPersistedProperty(key){return this._storage.getItem(key);}},{key:"setPersistedProperty",value:function setPersistedProperty(key,value){return value!==null?this._storage.setItem(key,value):this._storage.removeItem(key);}},{key:"fetch",value:function(_fetch){function fetch(_x,_x2){return _fetch.apply(this,arguments);}fetch.toString=function(){return _fetch.toString();};return fetch;}(function(url,options){return fetch(url,options);})},{key:"getLibraryId",value:function getLibraryId(){return'posthog-react-native';}},{key:"getLibraryVersion",value:function getLibraryVersion(){return _version.version;}},{key:"getCustomUserAgent",value:function getCustomUserAgent(){if(_reactNative.Platform.OS==='web'){return'';}return"".concat(this.getLibraryId(),"/").concat(this.getLibraryVersion());}},{key:"getCommonEventProperties",value:function getCommonEventProperties(){return _objectSpread(_objectSpread(_objectSpread({},_superPropGet(PostHog,"getCommonEventProperties",this,3)([])),this._appProperties),{},{$screen_height:_reactNative.Dimensions.get('screen').height,$screen_width:_reactNative.Dimensions.get('screen').width});}},{key:"screen",value:function(){var _screen=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(name,properties,options){return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this._initPromise;case 2:this.registerForSession({$screen_name:name});return _context2.abrupt("return",this.capture('$screen',_objectSpread(_objectSpread({},properties),{},{$screen_name:name}),options));case 4:case"end":return _context2.stop();}},_callee2,this);}));function screen(_x3,_x4,_x5){return _screen.apply(this,arguments);}return screen;}()},{key:"_isEnableSessionReplay",value:function _isEnableSessionReplay(){var _a;return!this.isDisabled&&((_a=this._enableSessionReplay)!==null&&_a!==void 0?_a:false);}},{key:"_resetSessionId",value:function _resetSessionId(reactNativeSessionReplay,sessionId){if(reactNativeSessionReplay){reactNativeSessionReplay.endSession();reactNativeSessionReplay.startSession(sessionId);}}},{key:"getSessionId",value:function getSessionId(){var _this2=this;var sessionId=_superPropGet(PostHog,"getSessionId",this,3)([]);if(!this._isEnableSessionReplay()){return sessionId;}if(sessionId.length>0&&this._currentSessionId&&sessionId!==this._currentSessionId){if(_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start with sessionId: ".concat(e,"."));});}}this._currentSessionId=sessionId;}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay session id not rotated, sessionId ".concat(sessionId," and currentSessionId ").concat(_this2._currentSessionId,"."));});}return sessionId;}},{key:"resetSessionId",value:function resetSessionId(){_superPropGet(PostHog,"resetSessionId",this,3)([]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{_OptionalSessionReplay.OptionalReactNativeSessionReplay.endSession();this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay ended.");});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to end: ".concat(e,"."));});}}}},{key:"identify",value:function identify(distinctId,properties,options){var previousDistinctId=this.getDistinctId();_superPropGet(PostHog,"identify",this,3)([distinctId,properties,options]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{distinctId=distinctId||previousDistinctId;_OptionalSessionReplay.OptionalReactNativeSessionReplay.identify(distinctId,this.getAnonymousId());this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay identified with distinctId ".concat(distinctId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to identify: ".concat(e,"."));});}}}},{key:"initReactNativeNavigation",value:function initReactNativeNavigation(options){return(0,_wixNavigation.withReactNativeNavigation)(this,options);}},{key:"getSurveys",value:function(){var _getSurveys=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(){var surveys,surveysFromApi;return _regenerator["default"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this._disableSurveys===true)){_context3.next=4;break;}this.logMsgIfDebug(function(){return console.log('Loading surveys is disabled.');});this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,null);return _context3.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_src.PostHogPersistedProperty.Surveys);if(!(surveys&&surveys.length>0)){_context3.next=10;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Surveys fetched from storage: ',JSON.stringify(surveys));});return _context3.abrupt("return",surveys);case 10:this.logMsgIfDebug(function(){return console.log('PostHog Debug','No surveys found in storage');});case 11:if(!(this._disableRemoteConfig===true)){_context3.next=18;break;}_context3.next=14;return _superPropGet(PostHog,"getSurveysStateless",this,3)([]);case 14:surveysFromApi=_context3.sent;if(!(surveysFromApi&&surveysFromApi.length>0)){_context3.next=18;break;}this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,surveysFromApi);return _context3.abrupt("return",surveysFromApi);case 18:return _context3.abrupt("return",[]);case 19:case"end":return _context3.stop();}},_callee3,this);}));function getSurveys(){return _getSurveys.apply(this,arguments);}return getSurveys;}()},{key:"startSessionReplay",value:function(){var _startSessionReplay=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(options){var _a,_b,_c,_d,_e,_ref,_ref$maskAllTextInput,maskAllTextInputs,_ref$maskAllImages,maskAllImages,_ref$maskAllSandboxed,maskAllSandboxedViews,_ref$maskPhotoLibrary,maskPhotoLibraryImages,_ref$captureLog,captureLog,_ref$captureNetworkTe,captureNetworkTelemetry,_ref$iOSdebouncerDela,iOSdebouncerDelayMs,_ref$androidDebouncer,androidDebouncerDelayMs,sdkReplayConfig,sessionReplay,featureFlags,decideFeatureFlags,decideReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regenerator["default"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:this._enableSessionReplay=options===null||options===void 0?void 0:options.enableSessionReplay;if(this._isEnableSessionReplay()){_context4.next=4;break;}this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay is not enabled.');});return _context4.abrupt("return");case 4:_ref=(_a=options===null||options===void 0?void 0:options.sessionReplayConfig)!==null&&_a!==void 0?_a:{},_ref$maskAllTextInput=_ref.maskAllTextInputs,maskAllTextInputs=_ref$maskAllTextInput===void 0?true:_ref$maskAllTextInput,_ref$maskAllImages=_ref.maskAllImages,maskAllImages=_ref$maskAllImages===void 0?true:_ref$maskAllImages,_ref$maskAllSandboxed=_ref.maskAllSandboxedViews,maskAllSandboxedViews=_ref$maskAllSandboxed===void 0?true:_ref$maskAllSandboxed,_ref$maskPhotoLibrary=_ref.maskPhotoLibraryImages,maskPhotoLibraryImages=_ref$maskPhotoLibrary===void 0?false:_ref$maskPhotoLibrary,_ref$captureLog=_ref.captureLog,captureLog=_ref$captureLog===void 0?true:_ref$captureLog,_ref$captureNetworkTe=_ref.captureNetworkTelemetry,captureNetworkTelemetry=_ref$captureNetworkTe===void 0?true:_ref$captureNetworkTe,_ref$iOSdebouncerDela=_ref.iOSdebouncerDelayMs,iOSdebouncerDelayMs=_ref$iOSdebouncerDela===void 0?1000:_ref$iOSdebouncerDela,_ref$androidDebouncer=_ref.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref$androidDebouncer===void 0?1000:_ref$androidDebouncer;sdkReplayConfig={maskAllTextInputs:maskAllTextInputs,maskAllImages:maskAllImages,maskAllSandboxedViews:maskAllSandboxedViews,maskPhotoLibraryImages:maskPhotoLibraryImages,captureLog:captureLog,captureNetworkTelemetry:captureNetworkTelemetry,iOSdebouncerDelayMs:iOSdebouncerDelayMs,androidDebouncerDelayMs:androidDebouncerDelayMs};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay sdk config: ".concat(JSON.stringify(sdkReplayConfig)));});sessionReplay=(_b=this.getPersistedProperty(_src.PostHogPersistedProperty.SessionReplay))!==null&&_b!==void 0?_b:{};featureFlags=(_c=this.getPersistedProperty(_src.PostHogPersistedProperty.FeatureFlags))!==null&&_c!==void 0?_c:{};decideFeatureFlags=(_d=featureFlags)!==null&&_d!==void 0?_d:{};decideReplayConfig=(_e=sessionReplay)!==null&&_e!==void 0?_e:{};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay decide cached config: ".concat(JSON.stringify(decideReplayConfig)));});recordingActive=true;linkedFlag=decideReplayConfig['linkedFlag'];if(typeof linkedFlag==='string'){value=decideFeatureFlags[linkedFlag];if(typeof value==='boolean'){recordingActive=value;}else if(typeof value==='string'){recordingActive=true;}else{recordingActive=false;}this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay ".concat(linkedFlag," linked flag value: ").concat(value));});}else if(linkedFlag&&(0,_typeof2["default"])(linkedFlag)==='object'){flag=linkedFlag['flag'];variant=linkedFlag['variant'];if(flag&&variant){_value=decideFeatureFlags[flag];recordingActive=_value===variant;this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay ".concat(flag," linked flag variant: ").concat(variant," and value ").concat(_value));});}else{recordingActive=false;}}if(!recordingActive){_context4.next=45;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context4.next=42;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context4.next=21;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context4.abrupt("return");case 21:sdkOptions={apiKey:this.apiKey,host:this.host,debug:this.isDebug,distinctId:this.getDistinctId(),anonymousId:this.getAnonymousId(),sdkVersion:this.getLibraryVersion(),flushAt:this.flushAt};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay sdk options: ".concat(JSON.stringify(sdkOptions)));});_context4.prev=23;_context4.next=26;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 26:if(_context4.sent){_context4.next=32;break;}_context4.next=29;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(sessionId,sdkOptions,sdkReplayConfig,decideReplayConfig);case 29:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context4.next=34;break;case 32:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 34:this._currentSessionId=sessionId;_context4.next=40;break;case 37:_context4.prev=37;_context4.t0=_context4["catch"](23);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context4.t0,"."));});case 40:_context4.next=43;break;case 42:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 43:_context4.next=46;break;case 45:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 46:case"end":return _context4.stop();}},_callee4,this,[[23,37]]);}));function startSessionReplay(_x6){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureNativeAppLifecycleEvents",value:function(){var _captureNativeAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regenerator["default"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;isMemoryPersistence=this._persistence==='memory';properties={version:appVersion,build:appBuild};if(!isMemoryPersistence){prevAppBuild=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild);prevAppVersion=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion);if(!appBuild||!appVersion){this.logMsgIfDebug(function(){return console.warn('PostHog could not track installation/update/open, as the build and version were not set. '+'This can happen if some dependencies are not installed correctly, or if you have provided'+'customAppProperties but not included $app_build or $app_version.');});}if(appBuild){if(!prevAppBuild){this.capture('Application Installed',properties);}else if(prevAppBuild!==appBuild){this.capture('Application Updated',_objectSpread({previous_version:prevAppVersion,previous_build:prevAppBuild},properties));}}}else{this.logMsgIfDebug(function(){return console.warn('PostHog was initialised with persistence set to "memory", capturing native app events (Application Installed and Application Updated) is not supported.');});}_context5.next=7;return _reactNative.Linking.getInitialURL();case 7:_context5.t1=_a=_context5.sent;_context5.t0=_context5.t1!==null;if(!_context5.t0){_context5.next=11;break;}_context5.t0=_a!==void 0;case 11:if(!_context5.t0){_context5.next=15;break;}_context5.t2=_a;_context5.next=16;break;case 15:_context5.t2=undefined;case 16:initialUrl=_context5.t2;this.capture('Application Opened',_objectSpread(_objectSpread({},properties),{},{url:initialUrl}));_reactNative.AppState.addEventListener('change',function(state){if(state==='active'){_this3.capture('Application Became Active');}else if(state==='background'){_this3.capture('Application Backgrounded');}});case 19:case"end":return _context5.stop();}},_callee5,this);}));function captureNativeAppLifecycleEvents(){return _captureNativeAppLifecycleEvents.apply(this,arguments);}return captureNativeAppLifecycleEvents;}()},{key:"persistAppVersion",value:function(){var _persistAppVersion=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6(){var appBuild,appVersion;return _regenerator["default"].wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context6.stop();}},_callee6,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_src.PostHogCore);