movius-chats 1.3.1 → 1.3.3

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.
package/README.md CHANGED
@@ -259,6 +259,8 @@ Older messages sit at higher indices and appear higher on screen.
259
259
  | `onSendMessage` | `(msg: Omit<Message, 'id' \| 'time' \| 'status'>) => void` | Yes | Fired when user taps send with text and/or `previewData` |
260
260
  | `onMessageLongPress` | `(message: Message) => void` | No | Long-press on a bubble (reply, delete, etc.) |
261
261
  | `placeholder` | `string` | No | Input placeholder (default: `"Message"`) |
262
+ | `keyboardVerticalOffset` | `number` | No | **iOS only:** header offset for `KeyboardAvoidingView`. Default: `0` |
263
+ | `disableKeyboardAvoiding` | `boolean` | No | Set `true` if your screen already handles the keyboard |
262
264
 
263
265
  ### Feature flags
264
266
 
@@ -324,9 +326,10 @@ theme?: {
324
326
  readIconColor?: string;
325
327
  };
326
328
 
327
- sizes?: {
328
- inputIconSize?: string; // twrnc class, e.g. 'h-6 w-6'
329
- };
329
+ sizes?: {
330
+ /** Twrnc classes (`"h-8 w-8"`) or pixels (`28`) for input-bar icons */
331
+ inputIconSize?: string | number;
332
+ };
330
333
 
331
334
  bubbleStyle?: {
332
335
  sent?: ViewStyle;
@@ -367,6 +370,81 @@ theme?: {
367
370
 
368
371
  Default bubble colors (before `theme` overrides): sent ≈ green (`bg-green-500`), received ≈ white.
369
372
 
373
+ #### Custom font (`theme.fontFamily`)
374
+
375
+ `fontFamily` applies to **all text** in the package (messages, timestamps, typing label, input, file names, errors).
376
+
377
+ **You must load the font in your app first** — the library only sets the `fontFamily` style name.
378
+
379
+ **Expo:**
380
+
381
+ ```tsx
382
+ import { useFonts } from 'expo-font';
383
+
384
+ export default function App() {
385
+ const [loaded] = useFonts({
386
+ InterRegular: require('./assets/fonts/Inter-Regular.ttf'),
387
+ });
388
+
389
+ if (!loaded) return null;
390
+
391
+ return (
392
+ <ChatScreen
393
+ theme={{ fontFamily: 'InterRegular' }}
394
+ // ...
395
+ />
396
+ );
397
+ }
398
+ ```
399
+
400
+ **React Native CLI:** follow [react-native custom fonts](https://reactnative.dev/docs/custom-fonts) and use the exact font family name registered on each platform.
401
+
402
+ #### Input icon size (`theme.sizes.inputIconSize`)
403
+
404
+ Use either **pixels** (recommended) or **twrnc classes**:
405
+
406
+ ```tsx
407
+ <ChatScreen
408
+ theme={{
409
+ sizes: {
410
+ inputIconSize: 28, // 28×28 px — emoji, attachment, camera only
411
+ // inputIconSize: 'h-8 w-8', // alternative: tailwind classes via twrnc
412
+ },
413
+ }}
414
+ />
415
+ ```
416
+
417
+ #### Keyboard avoiding
418
+
419
+ The package lifts the chat when the keyboard opens (keyboard listeners + `KeyboardAvoidingView` on iOS).
420
+
421
+ 1. Wrap `ChatScreen` in a parent with `flex: 1` (e.g. `SafeAreaView style={{ flex: 1 }}`).
422
+ 2. Wrap `ChatScreen` in `<View style={{ flex: 1 }}>` and give the screen root `flex: 1`.
423
+ 3. **iOS only:** set `keyboardVerticalOffset` to header + status bar (e.g. `insets.top + 44`). **Android:** omit or use `0` — the package lifts the input by the full keyboard height.
424
+
425
+ ```tsx
426
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
427
+
428
+ const insets = useSafeAreaInsets();
429
+
430
+ <View style={{ flex: 1 }}>
431
+ <ChatScreen
432
+ keyboardVerticalOffset={Platform.OS === 'ios' ? insets.top + 44 : 0}
433
+ // ...
434
+ />
435
+ </View>
436
+ ```
437
+
438
+ 3. **Android (Expo):** in `app.json`:
439
+
440
+ ```json
441
+ "android": {
442
+ "softwareKeyboardLayoutMode": "resize"
443
+ }
444
+ ```
445
+
446
+ 4. If your navigator already uses `KeyboardAvoidingView`, pass `disableKeyboardAvoiding` to avoid double offset.
447
+
370
448
  ### Custom components & icons
371
449
 
372
450
  | Prop | Type | Description |
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),r=require("twrnc"),n=require("react"),o=require("react-native-svg"),i=require("react-native-video"),l=require("react-native-reanimated"),s=require("react-native-sound"),a=require("react-native-image-zoom-viewer");function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){return t=y(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,r||[],y(e).constructor):t.apply(e,r))}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,s=[],a=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(a=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var P,S,C,O,I,A,T,E=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},M=["children"],k=n.createContext(void 0),V=function(t){var r=t.children,o=x(t,M),i=g(n.useState({imageUrl:"",videoUrl:""}),2),l=i[0],s=i[1],a=g(n.useState(!1),2),u=a[0],c=a[1];return e.jsx(k.Provider,{value:m(m({},o),{},{mediaUrl:l,setMediaUrl:s,isVideoPlaying:u,setIsVideoPlaying:c}),children:r})},R=function(){var e=n.useContext(k);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},_=function(r){var i=r.style,l=r.spinning,s=void 0!==l&&l,a=n.useRef(new t.Animated.Value(0)).current;n.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},N=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},z=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},$=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},U=n.createContext(void 0),L=function(t){var r=t.children,o=g(n.useState(null),2),i=o[0],l=o[1];return e.jsx(U.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},q={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAgH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},B=function(o){var i,a,u,c,d,f,p,y=o.audioUrl,h=o.audioId,v=o.isVideoPlaying,x=R(),b=x.theme,j=x.CustomPlayIcon,E=x.CustomPauseIcon,M=function(){var e=n.useContext(U);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),k=M.currentlyPlayingId,V=M.setCurrentlyPlayingId,_=g(n.useState(null),2),L=_[0],B=_[1],D=g(n.useState(!1),2),F=D[0],W=D[1],H=g(n.useState(0),2),Y=H[0],X=H[1],Z=g(n.useState(0),2),G=Z[0],Q=Z[1],J=g(n.useState(!1),2),K=J[0],ee=J[1],te=n.useRef(null),re=n.useRef(0),ne=n.useRef(0),oe=n.useRef(0),ie=l.useSharedValue(0);n.useEffect((function(){var e=!0,t=new s(y,"",(function(r){!r&&e&&Q(t.getDuration())}));return B(t),function(){e=!1,t&&(t.pause(),t.release())}}),[y]),n.useEffect((function(){k&&k!==h&&F&&L&&(L.pause(),W(!1),X(0),ie.value=0)}),[k,h,F,L]),n.useEffect((function(){var e;return F&&L&&!K&&(e=setInterval((function(){L.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(X(e),re.current>0&&G>0)){var t=e/G*re.current;isNaN(t)||(ie.value=l.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[F,L,K,G]);var le,se,ae=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){ee(!0),oe.current=e.nativeEvent.pageX-ie.value},onPanResponderMove:function(e){if(re.current>0){var t=e.nativeEvent.pageX-oe.current,r=Math.max(0,Math.min(t,re.current));ie.value=r;var n=r/re.current*G;isNaN(n)||X(n)}},onPanResponderRelease:function(){if(ee(!1),L&&re.current>0){var e=ie.value/re.current*G;isNaN(e)||L.setCurrentTime(e)}},onPanResponderTerminate:function(){ee(!1)}}),ue=l.useAnimatedStyle((le=[new global.Error,-2,-27],(se=function(){return{transform:[{translateX:ie.value}]}}).__closure={knobPosition:ie},se.__workletHash=1935336866997,se.__initData=q,se.__stackDetails=le,se));return n.useEffect((function(){v&&F&&L&&L.pause((function(){W(!1),V(null)}))}),[v]),e.jsxs(t.View,{style:r(P||(P=w(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:r(S||(S=w(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){L&&(F?L.pause((function(){W(!1),V(null)})):(V(h),L.play((function(e){e&&(W(!1),X(0),ie.value=l.withSpring(0),V(null))})),W(!0)))},style:[r(C||(C=w(["bg-black/40 rounded-full p-2"]))),null==b||null===(i=b.messageStyle)||void 0===i?void 0:i.audioPlayButtonStyle],children:F?E?e.jsx(E,{}):e.jsx($,{style:r.style("h-6 w-6"),color:(null==b||null===(a=b.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx(N,{style:r.style("h-6 w-6"),color:(null==b||null===(u=b.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:te,onLayout:function(e){var t,r=e.nativeEvent.layout.width;re.current=r,null===(t=te.current)||void 0===t||t.measure((function(e,t,r,n,o){ne.current=o}))},style:[r(O||(O=w(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==b||null===(c=b.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[r(I||(I=w(["absolute h-full bg-slate-200"]))),{width:"".concat(G>0?Y/G*100:0,"%")},null==b||null===(d=b.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(l.View,m(m({},ae.panHandlers),{},{style:[ue,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},m({},null==b||null===(f=b.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:r(A||(A=w(["px-4 py-1"]))),children:e.jsx(t.Text,{style:[r(T||(T=w(["text-xs text-gray-500"]))),null==b||null===(p=b.messageStyle)||void 0===p?void 0:p.audioDurationStyle],children:isNaN(Y)?"0:00":z(Y)})})]})},D=n.memo(B);function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var W,H={exports:{}},Y={exports:{}},X={};var Z,G,Q,J,K,ee,te,re,ne,oe,ie,le,se,ae,ue,ce={};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),r=require("twrnc"),n=require("react"),o=require("react-native-svg"),i=require("react-native-video"),l=require("react-native-reanimated"),s=require("react-native-sound"),a=require("react-native-image-zoom-viewer");function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,s=[],a=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(a=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var P=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},S=["children"],C=n.createContext(void 0),O=function(t){var r=t.children,o=b(t,S),i=g(n.useState({imageUrl:"",videoUrl:""}),2),l=i[0],s=i[1],a=g(n.useState(!1),2),u=a[0],c=a[1];return e.jsx(C.Provider,{value:m(m({},o),{},{mediaUrl:l,setMediaUrl:s,isVideoPlaying:u,setIsVideoPlaying:c}),children:r})},I=function(){var e=n.useContext(C);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},A="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function T(e,t){if("number"==typeof e&&e>0)return{width:e,height:e};var n="string"==typeof e&&e.trim().length>0?e.trim():A;return r.style(n,t)}function E(e,t){return t?[e,{fontFamily:t}]:e}var k,M,V,R,_,N,z,$=function(r){var i=r.style,l=r.spinning,s=void 0!==l&&l,a=n.useRef(new t.Animated.Value(0)).current;n.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},L=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},U=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},F=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},B=n.createContext(void 0),q=function(t){var r=t.children,o=g(n.useState(null),2),i=o[0],l=o[1];return e.jsx(B.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},D={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAiH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},W=function(o){var i,a,u,c,d,f,y,p=o.audioUrl,v=o.audioId,h=o.isVideoPlaying,b=I(),x=b.theme,j=b.CustomPlayIcon,P=b.CustomPauseIcon,S=function(){var e=n.useContext(B);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=S.currentlyPlayingId,O=S.setCurrentlyPlayingId,A=g(n.useState(null),2),T=A[0],$=A[1],q=g(n.useState(!1),2),W=q[0],H=q[1],Y=g(n.useState(0),2),X=Y[0],Z=Y[1],K=g(n.useState(0),2),G=K[0],Q=K[1],J=g(n.useState(!1),2),ee=J[0],te=J[1],re=n.useRef(null),ne=n.useRef(0),oe=n.useRef(0),ie=n.useRef(0),le=l.useSharedValue(0);n.useEffect((function(){var e=!0,t=new s(p,"",(function(r){!r&&e&&Q(t.getDuration())}));return $(t),function(){e=!1,t&&(t.pause(),t.release())}}),[p]),n.useEffect((function(){C&&C!==v&&W&&T&&(T.pause(),H(!1),Z(0),le.value=0)}),[C,v,W,T]),n.useEffect((function(){var e;return W&&T&&!ee&&(e=setInterval((function(){T.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(Z(e),ne.current>0&&G>0)){var t=e/G*ne.current;isNaN(t)||(le.value=l.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[W,T,ee,G]);var se,ae,ue=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){te(!0),ie.current=e.nativeEvent.pageX-le.value},onPanResponderMove:function(e){if(ne.current>0){var t=e.nativeEvent.pageX-ie.current,r=Math.max(0,Math.min(t,ne.current));le.value=r;var n=r/ne.current*G;isNaN(n)||Z(n)}},onPanResponderRelease:function(){if(te(!1),T&&ne.current>0){var e=le.value/ne.current*G;isNaN(e)||T.setCurrentTime(e)}},onPanResponderTerminate:function(){te(!1)}}),ce=l.useAnimatedStyle((se=[new global.Error,-2,-27],(ae=function(){return{transform:[{translateX:le.value}]}}).__closure={knobPosition:le},ae.__workletHash=1935336866997,ae.__initData=D,ae.__stackDetails=se,ae));return n.useEffect((function(){h&&W&&T&&T.pause((function(){H(!1),O(null)}))}),[h]),e.jsxs(t.View,{style:r(k||(k=w(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:r(M||(M=w(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){T&&(W?T.pause((function(){H(!1),O(null)})):(O(v),T.play((function(e){e&&(H(!1),Z(0),le.value=l.withSpring(0),O(null))})),H(!0)))},style:[r(V||(V=w(["bg-black/40 rounded-full p-2"]))),null==x||null===(i=x.messageStyle)||void 0===i?void 0:i.audioPlayButtonStyle],children:W?P?e.jsx(P,{}):e.jsx(F,{style:r.style("h-6 w-6"),color:(null==x||null===(a=x.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx(L,{style:r.style("h-6 w-6"),color:(null==x||null===(u=x.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:re,onLayout:function(e){var t,r=e.nativeEvent.layout.width;ne.current=r,null===(t=re.current)||void 0===t||t.measure((function(e,t,r,n,o){oe.current=o}))},style:[r(R||(R=w(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==x||null===(c=x.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[r(_||(_=w(["absolute h-full bg-slate-200"]))),{width:"".concat(G>0?X/G*100:0,"%")},null==x||null===(d=x.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(l.View,m(m({},ue.panHandlers),{},{style:[ce,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},m({},null==x||null===(f=x.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:r(N||(N=w(["px-4 py-1"]))),children:e.jsx(t.Text,{style:E([r(z||(z=w(["text-xs text-gray-500"]))),null==x||null===(y=x.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==x?void 0:x.fontFamily),children:isNaN(X)?"0:00":U(X)})})]})},H=n.memo(W);function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X,Z={exports:{}},K={exports:{}},G={};var Q,J,ee,te,re,ne,oe,ie,le,se,ae,ue,ce,de,fe,ye={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -6,10 +6,10 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */function de(){return G||(G=1,"production"===process.env.NODE_ENV?Y.exports=function(){if(W)return X;W=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case n:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case y:case p:case l:return e;default:return f}}case r:return f}}}function g(e){return b(e)===u}return X.AsyncMode=a,X.ConcurrentMode=u,X.ContextConsumer=s,X.ContextProvider=l,X.Element=t,X.ForwardRef=c,X.Fragment=n,X.Lazy=y,X.Memo=p,X.Portal=r,X.Profiler=i,X.StrictMode=o,X.Suspense=d,X.isAsyncMode=function(e){return g(e)||b(e)===a},X.isConcurrentMode=g,X.isContextConsumer=function(e){return b(e)===s},X.isContextProvider=function(e){return b(e)===l},X.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},X.isForwardRef=function(e){return b(e)===c},X.isFragment=function(e){return b(e)===n},X.isLazy=function(e){return b(e)===y},X.isMemo=function(e){return b(e)===p},X.isPortal=function(e){return b(e)===r},X.isProfiler=function(e){return b(e)===i},X.isStrictMode=function(e){return b(e)===o},X.isSuspense=function(e){return b(e)===d},X.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===h)},X.typeOf=b,X}():Y.exports=(Z||(Z=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var h=e.type;switch(h){case a:case u:case n:case i:case o:case d:return h;default:var v=h&&h.$$typeof;switch(v){case s:case c:case y:case p:case l:return v;default:return f}}case r:return f}}}var g=a,w=u,j=s,P=l,S=t,C=c,O=n,I=y,A=p,T=r,E=i,M=o,k=d,V=!1;function R(e){return b(e)===u}ce.AsyncMode=g,ce.ConcurrentMode=w,ce.ContextConsumer=j,ce.ContextProvider=P,ce.Element=S,ce.ForwardRef=C,ce.Fragment=O,ce.Lazy=I,ce.Memo=A,ce.Portal=T,ce.Profiler=E,ce.StrictMode=M,ce.Suspense=k,ce.isAsyncMode=function(e){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||b(e)===a},ce.isConcurrentMode=R,ce.isContextConsumer=function(e){return b(e)===s},ce.isContextProvider=function(e){return b(e)===l},ce.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ce.isForwardRef=function(e){return b(e)===c},ce.isFragment=function(e){return b(e)===n},ce.isLazy=function(e){return b(e)===y},ce.isMemo=function(e){return b(e)===p},ce.isPortal=function(e){return b(e)===r},ce.isProfiler=function(e){return b(e)===i},ce.isStrictMode=function(e){return b(e)===o},ce.isSuspense=function(e){return b(e)===d},ce.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===h)},ce.typeOf=b}()),ce)),Y.exports}
9
+ */function pe(){return J||(J=1,"production"===process.env.NODE_ENV?K.exports=function(){if(X)return G;X=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case n:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case p:case y:case l:return e;default:return f}}case r:return f}}}function g(e){return x(e)===u}return G.AsyncMode=a,G.ConcurrentMode=u,G.ContextConsumer=s,G.ContextProvider=l,G.Element=t,G.ForwardRef=c,G.Fragment=n,G.Lazy=p,G.Memo=y,G.Portal=r,G.Profiler=i,G.StrictMode=o,G.Suspense=d,G.isAsyncMode=function(e){return g(e)||x(e)===a},G.isConcurrentMode=g,G.isContextConsumer=function(e){return x(e)===s},G.isContextProvider=function(e){return x(e)===l},G.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},G.isForwardRef=function(e){return x(e)===c},G.isFragment=function(e){return x(e)===n},G.isLazy=function(e){return x(e)===p},G.isMemo=function(e){return x(e)===y},G.isPortal=function(e){return x(e)===r},G.isProfiler=function(e){return x(e)===i},G.isStrictMode=function(e){return x(e)===o},G.isSuspense=function(e){return x(e)===d},G.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},G.typeOf=x,G}():K.exports=(Q||(Q=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var v=e.type;switch(v){case a:case u:case n:case i:case o:case d:return v;default:var h=v&&v.$$typeof;switch(h){case s:case c:case p:case y:case l:return h;default:return f}}case r:return f}}}var g=a,w=u,j=s,P=l,S=t,C=c,O=n,I=p,A=y,T=r,E=i,k=o,M=d,V=!1;function R(e){return x(e)===u}ye.AsyncMode=g,ye.ConcurrentMode=w,ye.ContextConsumer=j,ye.ContextProvider=P,ye.Element=S,ye.ForwardRef=C,ye.Fragment=O,ye.Lazy=I,ye.Memo=A,ye.Portal=T,ye.Profiler=E,ye.StrictMode=k,ye.Suspense=M,ye.isAsyncMode=function(e){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||x(e)===a},ye.isConcurrentMode=R,ye.isContextConsumer=function(e){return x(e)===s},ye.isContextProvider=function(e){return x(e)===l},ye.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ye.isForwardRef=function(e){return x(e)===c},ye.isFragment=function(e){return x(e)===n},ye.isLazy=function(e){return x(e)===p},ye.isMemo=function(e){return x(e)===y},ye.isPortal=function(e){return x(e)===r},ye.isProfiler=function(e){return x(e)===i},ye.isStrictMode=function(e){return x(e)===o},ye.isSuspense=function(e){return x(e)===d},ye.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},ye.typeOf=x}()),ye)),K.exports}
10
10
  /*
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function fe(){if(J)return Q;J=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Q=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},Q}function pe(){if(ee)return K;ee=1;return K="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ye(){return re?te:(re=1,te=Function.call.bind(Object.prototype.hasOwnProperty))}function he(){if(oe)return ne;oe=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=pe(),r={},n=ye();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ne=o}function ve(){if(le)return ie;le=1;var e=de(),t=fe(),r=pe(),n=ye(),o=he(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ie=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:y(l),arrayOf:function(e){return y((function(t,n,o,i,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+i+" `"+l+"` of type `"+x(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:y((function(e,t,r,n,o){var i=e[t];return s(i)?null:new p("Invalid "+n+" `"+o+"` of type `"+x(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:y((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new p("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new p("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:y((function(e,t,r,n,o){return m(e[t])?null:new p("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(t,o,i,l,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=x(a);if("object"!==u)return new p("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return y((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return y((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new p("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return y((function(t,n,o,i,l){var s=t[n],a=x(s);if("object"!==a)return new p("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return v(o,i,l,u,b(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return y((function(o,i,l,s,a){var u=o[i],c=x(u);if("object"!==c)return new p("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var y=e[f];if(n(e,f)&&"function"!=typeof y)return v(l,s,a,f,b(y));if(!y)return new p("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=y(u,f,l,s,a+"."+f,r);if(h)return h}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,y){if(u=u||c,f=f||s,y!==r){if(a){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=u+":"+s;!t[v]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,n++)}}return null==l[s]?o?null===l[s]?new p("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return y((function(t,r,n,o,i,l){var s=t[r];return x(s)!==e?new p("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,r,n,o){return new p((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function x(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=x(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ie}function me(){if(ae)return se;ae=1;var e=pe();function t(){}function r(){}return r.resetWarningCache=t,se=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function xe(){if(ue)return H.exports;if(ue=1,"production"!==process.env.NODE_ENV){var e=de();H.exports=ve()(e.isElement,true)}else H.exports=me()();return H.exports}var be,ge,we,je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,Me,ke=F(xe()),Ve=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),Re=["type"],_e=["style"],Ne=["parse","childrenProps"],ze={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},$e=ke.shape(m(m({},t.Text.propTypes),{},{type:ke.oneOf(Object.keys(ze)).isRequired,nonExhaustiveMaxMatchCount:ke.number})),Ue=ke.shape(m(m({},t.Text.propTypes),{},{pattern:ke.oneOfType([ke.string,ke.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:ke.number})),Le=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=x(e,Re);if(t){if(!ze[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=ze[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ve(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=x(n,_e);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=x(n,Ne);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();Le.displayName="ParsedText",Le.propTypes=m(m({},t.Text.propTypes),{},{parse:ke.arrayOf(ke.oneOfType([$e,Ue])),childrenProps:ke.shape(t.Text.propTypes)}),Le.defaultProps={parse:null,childrenProps:{}};var qe,Be,De,Fe,We,He,Ye,Xe,Ze,Ge,Qe,Je,Ke,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,pt,yt,ht,vt,mt,xt,bt,gt,wt,jt,Pt=function(o){var l,s,a,u=o.message,c=o.onMediaPress,d=o.isVideoPlaying,f=o.isCurrentUser,p=R(),y=p.theme,h=p.showMessageStatus,v=p.CustomPlayIcon,m=p.renderCustomVideoBubbleError,x=n.useRef(null),b=g(n.useState(0),2),j=b[0],P=b[1],S=g(n.useState(!1),2),C=S[0],O=S[1],I=g(n.useState(!1),2),A=I[0],T=I[1];return e.jsxs(t.View,{children:[u.image&&e.jsx(t.Pressable,{onPress:function(){return c("image",u.image)},style:r(be||(be=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:u.image},style:r(ge||(ge=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),u.video&&e.jsxs(t.Pressable,{onPress:function(){return c("video",u.video)},style:r(we||(we=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:C,children:[e.jsx(i,{source:{uri:u.video},ref:x,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){O(!0),T(!1)},onLoad:function(e){P(e.duration),O(!1)},onBuffer:function(e){var t=e.isBuffering;return O(t)},onError:function(){T(!0),O(!1)}}),C?e.jsx(t.View,{style:r(je||(je=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(_,{style:r.style("h-12 w-12"),spinning:!0})}):A?m?m():e.jsx(t.View,{style:r(Pe||(Pe=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:r(Se||(Se=w(["text-white font-bold"]))),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute bg-black/40 rounded-full"]))),children:v?e.jsx(v,{}):e.jsx(N,{style:r.style("h-16 w-16"),color:(null==y||null===(l=y.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Oe||(Oe=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Ie||(Ie=w(["text-white text-xs font-semibold"]))),children:z(j)})})]})]}),u.audio&&e.jsx(t.View,{style:r(Ae||(Ae=w(["my-2"]))),children:e.jsx(D,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d})}),u.text&&e.jsx(Le,{style:[r(Te||(Te=w(["pt-1"]))),r(h?Ee||(Ee=w(["pb-0"])):Me||(Me=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==y||null===(s=y.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==y||null===(a=y.messageStyle)||void 0===a?void 0:a.receivedTextStyle],parse:[{type:"url",style:{color:"blue",textDecorationLine:"underline"},onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},St=n.memo(Pt),Ct=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Ot=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},It=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,p=R(),y=p.theme,h=p.showMessageStatus;return e.jsx(e.Fragment,{children:h&&e.jsxs(t.View,{style:[r(qe||(qe=w(["flex-row items-center"]))),r(d?Be||(Be=w(["justify-end pb-1 ml-4"])):f?De||(De=w(["absolute right-3 bottom-3"])):Fe||(Fe=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:[r(We||(We=w(["text-xs"]))),{color:d||f?(null==y||null===(o=y.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],children:a}),c&&e.jsxs(t.View,{style:r(He||(He=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(Ot,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==y||null===(i=y.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(Ct,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==y||null===(l=y.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(Ct,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==y||null===(s=y.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},At=n.memo(It),Tt=function(n){var o,i,l,s,a,u,c,d,f=n.message,p=n.isCurrentUser,y=n.isFirstInSequence,h=n.onLongPress,v=R(),x=v.theme,b=v.showAvatars,g=v.showUserNames,j=v.showBubbleTail,P=v.setMediaUrl,S=v.setIsVideoPlaying,C=v.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:h,style:[r(Ye||(Ye=w(["px-2 my-1 max-w-[75%] relative"]))),r(p?Xe||(Xe=w(["self-end mr-3"])):Ze||(Ze=w(["self-start ml-9"]))),r(y?p?Ge||(Ge=w(["bg-green-500 rounded-tr-none"])):Qe||(Qe=w(["bg-white rounded-tl-none"])):p?Je||(Je=w(["bg-green-500"])):Ke||(Ke=w(["bg-white"]))),m({borderRadius:8},p?null==x||null===(o=x.bubbleStyle)||void 0===o?void 0:o.sent:null==x||null===(i=x.bubbleStyle)||void 0===i?void 0:i.received)],children:[!p&&y&&b&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(et||(et=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(tt||(tt=w(["w-full h-full rounded-full"]))),null==x||null===(l=x.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:[r(rt||(rt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==x||null===(s=x.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:[r(nt||(nt=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==x||null===(u=x.bubbleStyle)||void 0===u?void 0:u.userNameStyle],children:f.senderName})]}),y&&j&&e.jsx(E,{style:r.style("absolute -top-1 w-6 h-6 ",p?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:p?"90deg":"180deg"}]}),color:"".concat(p?(null==x||null===(c=x.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==x||null===(d=x.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(St,{message:f,isCurrentUser:p,isFirstInSequence:y,onMediaPress:function(e,t){P({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&S(!0)},isVideoPlaying:C}),e.jsx(At,{time:f.time,status:p?f.status:void 0,isCurrentUser:p,hasText:!!f.text,hasAudio:!!f.audio})]})},Et=n.memo(Tt),Mt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},kt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Vt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},Rt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},_t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Nt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},zt=function(r){var n=r.fileName,o=r.style;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:[{fontSize:14,fontWeight:"600",color:"black"},o],children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},$t=n.memo(zt),Ut=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,p=r.CustomFileIcon,y=r.CustomImagePreview,h=r.CustomVideoPreview,v=r.inputHeight,m=R(),x=m.theme,b=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=v?v:0)+8,zIndex:20,borderRadius:12},null==x||null===(l=x.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(b({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:{fontSize:12,color:"black"},children:"X"})}),w?y?e.jsx(y,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?h?e.jsx(h,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==x||null===(s=x.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==x||null===(a=x.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:p?e.jsx(p,{}):e.jsx(Nt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==x||null===(u=x.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx($t,{fileName:d.name,style:null==x||null===(c=x.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},Lt=n.memo(Ut),qt="ios"===t.Platform.OS?32:30,Bt=function(o){var i,l,s,a,u,c,d,f,p,y,h,v,x,b,j=o.onSendMessage,P=o.onTypingStart,S=o.onTypingEnd,C=o.onAttachmentPress,O=o.onCameraPress,I=o.onAudioRecordStart,A=o.onAudioRecordEnd,T=o.CustomEmojiIcon,E=o.CustomAttachmentIcon,M=o.CustomCameraIcon,k=o.CustomSendIcon,V=o.CustomMicrophoneIcon,_=o.CustomFileIcon,N=o.CustomImagePreview,z=o.CustomVideoPreview,$=g(n.useState(""),2),U=$[0],L=$[1],q=g(n.useState({height:qt,isMultiline:!1}),2),B=q[0],D=q[1],F=R(),W=F.theme,H=F.currentUserId,Y=F.showEmojiButton,X=F.showAttachmentsButton,Z=F.showCameraButton,G=F.showVoiceRecordButton,Q=F.placeholder,J=F.previewData,K=F.closePreview,ee=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,qt),118);D({height:t,isMultiline:t>qt})}),[]),te=n.useCallback((function(){var e=U.trim();(e||J)&&(j({text:e,senderId:H}),L(""),D({height:qt,isMultiline:!1}))}),[U,j,H,J]);return n.useEffect((function(){U.trim()?null==P||P():null==S||S()}),[U,P,S]),e.jsxs(t.View,{style:r(ot||(ot=w(["w-full px-2"]))),children:[J&&e.jsx(Lt,{previewData:J,closePreview:K,CustomFileIcon:_,CustomImagePreview:N,CustomVideoPreview:z,inputHeight:B.height}),e.jsxs(t.View,{style:[r(it||(it=w(["flex-row items-end gap-2"]))),null==W||null===(i=W.inputStyles)||void 0===i?void 0:i.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(lt||(lt=w(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),B.isMultiline?r(st||(st=w(["rounded-3xl items-end"]))):r(at||(at=w(["rounded-full items-center"]))),null==W||null===(l=W.inputStyles)||void 0===l?void 0:l.inputContainerStyle],children:[Y&&e.jsx(t.Pressable,{children:T?e.jsx(T,{}):e.jsx(kt,{style:r.style("".concat(null!=W&&null!==(s=W.sizes)&&void 0!==s&&s.inputIconSize||"ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6"),B.isMultiline?"pb-14":"pb-0"),color:(null==W||null===(a=W.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e.jsx(t.TextInput,{value:U,onChangeText:L,placeholder:Q||"Message",style:[r(ut||(ut=w(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===t.Platform.OS?r(ct||(ct=w(["text-[17px]"]))):r(dt||(dt=w(["text-[16px]"]))),{minHeight:qt,maxHeight:118},{color:(null==W||null===(u=W.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(247, 247, 247, 0.9)"},null!=W&&W.fontFamily?{fontFamily:W.fontFamily}:void 0],placeholderTextColor:(null==W||null===(c=W.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:ee}),e.jsxs(t.View,{style:[r(ft||(ft=w(["gap-4 flex-row"]))),B.isMultiline?r(pt||(pt=w(["pb-4"]))):r(yt||(yt=w(["pb-0"])))],children:[X&&e.jsx(t.Pressable,{onPress:C,children:E?e.jsx(E,{}):e.jsx(Rt,{style:r.style(null!=W&&null!==(d=W.sizes)&&void 0!==d&&d.inputIconSize||"ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6"),color:(null==W||null===(f=W.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Z&&!U.trim()&&e.jsx(t.Pressable,{onPress:O,children:M?e.jsx(M,{}):e.jsx(Mt,{style:r.style(null!=W&&null!==(p=W.sizes)&&void 0!==p&&p.inputIconSize||"ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6"),color:(null==W||null===(y=W.colors)||void 0===y?void 0:y.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(ht||(ht=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:"ios"===t.Platform.OS?50:48,width:"ios"===t.Platform.OS?50:48},null==W||null===(h=W.inputStyles)||void 0===h?void 0:h.sendButtonStyle)],onPress:U.trim()||J?te:I,onLongPress:I,onPressOut:A,children:U.trim()?k?e.jsx(k,{}):e.jsx(_t,{style:r.style("h-6 w-6"),color:(null==W||null===(v=W.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):G?V?e.jsx(V,{}):e.jsx(Vt,{style:r.style("h-8 w-8"),color:(null==W||null===(x=W.colors)||void 0===x?void 0:x.sendIconsColor)||"rgba(255,255,255,0.7)"}):k?e.jsx(k,{}):e.jsx(_t,{style:r.style("h-6 w-6"),color:(null==W||null===(b=W.colors)||void 0===b?void 0:b.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Dt=n.memo(Bt);function Ft(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Wt,Ht,Yt,Xt,Zt,Gt,Qt,Jt,Kt,er,tr,rr,nr=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=n.useRef(null),d=g(n.useState(!1),2),f=d[0],p=d[1],y=g(n.useState(!1),2),h=y[0],v=y[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(vt||(vt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(mt||(mt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Ft,{style:r(xt||(xt=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(bt||(bt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:c,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),v(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){v(!0),p(!1)}}),f&&e.jsx(t.View,{style:r(gt||(gt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(_,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(wt||(wt=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:r(jt||(jt=w(["text-white font-bold"]))),children:"Failed to load video"})})]})]})}):null},or=n.memo(nr),ir=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=R(),d=c.theme,f=c.showAvatars,p=c.renderCustomTyping,y=c.showBubbleTail,h=a.filter((function(e){return e.id!==u}));if(!h.length)return null;var v=h.slice(0,2),x=h.length-2;return e.jsxs(t.View,{style:r(Wt||(Wt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Ht||(Ht=w(["flex-row"]))),children:[v.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Yt||(Yt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:v.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Xt||(Xt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:[r(Zt||(Zt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),x>0&&e.jsx(t.View,{style:[r(Gt||(Gt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:[r(Qt||(Qt=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],children:["+",x]})})]}),y&&e.jsx(E,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(Jt||(Jt=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:p?p():e.jsx(t.View,{style:r(Kt||(Kt=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:r(er||(er=w(["text-gray-600"]))),children:"Typing..."})})})]})},lr=function(){var n=R(),o=n.messages,i=n.currentUserId,l=n.onMessageLongPress,s=n.mediaUrl,a=n.setMediaUrl,u=n.setIsVideoPlaying,c=n.typingUsers,d=n.onSendMessage,f=n.onTypingStart,p=n.onTypingEnd,y=n.onAttachmentPress,h=n.onAudioRecordEnd,v=n.onAudioRecordStart,m=n.onCameraPress,x=n.renderCustomInput,b=n.CustomEmojiIcon,g=n.CustomAttachmentIcon,j=n.CustomCameraIcon,P=n.CustomMicrophoneIcon,S=n.CustomSendIcon,C=n.CustomFileIcon,O=n.CustomImagePreview,I=n.CustomVideoPreview;return e.jsx(t.KeyboardAvoidingView,{style:r(tr||(tr=w(["flex-1"]))),behavior:"ios"===t.Platform.OS?"padding":"height",keyboardVerticalOffset:"ios"===t.Platform.OS?90:0,children:e.jsxs(t.View,{style:r(rr||(rr=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{data:o,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,s=t.index;return e.jsx(Et,{message:n,isCurrentUser:n.senderId===i,onLongPress:function(){return null==l?void 0:l(n)},isFirstInSequence:s===o.length-1||(null===(r=o[s+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(ir,{typingUsers:c||[],currentUserId:i}),showsVerticalScrollIndicator:!1,inverted:!0}),x?x():e.jsx(Dt,{onSendMessage:d,onTypingStart:f,onTypingEnd:p,onAttachmentPress:y,onAudioRecordEnd:h,onAudioRecordStart:v,onCameraPress:m,CustomEmojiIcon:b,CustomAttachmentIcon:g,CustomCameraIcon:j,CustomMicrophoneIcon:P,CustomSendIcon:S,CustomFileIcon:C,CustomImagePreview:O,CustomVideoPreview:I}),e.jsx(or,{imageUrl:s.imageUrl,videoUrl:s.videoUrl,onClose:function(){a({imageUrl:"",videoUrl:""}),u(!1)}})]})})};module.exports=function(t){return e.jsx(L,{children:e.jsx(V,m(m({},t),{},{children:e.jsx(lr,{})}))})};
14
+ */function ve(){if(te)return ee;te=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},ee}function he(){if(ne)return re;ne=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function me(){return ie?oe:(ie=1,oe=Function.call.bind(Object.prototype.hasOwnProperty))}function be(){if(se)return le;se=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=he(),r={},n=me();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},le=o}function xe(){if(ue)return ae;ue=1;var e=pe(),t=ve(),r=he(),n=me(),o=be(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ae=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(l),arrayOf:function(e){return p((function(t,n,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new y("Invalid "+i+" `"+l+"` of type `"+b(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:p((function(e,t,r,n,o){var i=e[t];return s(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:p((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:p((function(e,t,r,n,o){return m(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,s){if("function"!=typeof e)return new y("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=b(a);if("object"!==u)return new y("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return p((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new y("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,n,o,i,l){var s=t[n],a=b(s);if("object"!==a)return new y("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,s,a){var u=o[i],c=b(u);if("object"!==c)return new y("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(n(e,f)&&"function"!=typeof p)return h(l,s,a,f,x(p));if(!p)return new y("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=p(u,f,l,s,a+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,p){if(u=u||c,f=f||s,p!==r){if(a){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+s;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[s]?o?null===l[s]?new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return p((function(t,r,n,o,i,l){var s=t[r];return b(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new y((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ae}function ge(){if(de)return ce;de=1;var e=he();function t(){}function r(){}return r.resetWarningCache=t,ce=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function we(){if(fe)return Z.exports;if(fe=1,"production"!==process.env.NODE_ENV){var e=pe();Z.exports=xe()(e.isElement,true)}else Z.exports=ge()();return Z.exports}var je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,ke,Me,Ve,Re,_e=Y(we()),Ne=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),ze=["type"],$e=["style"],Le=["parse","childrenProps"],Ue={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Fe=_e.shape(m(m({},t.Text.propTypes),{},{type:_e.oneOf(Object.keys(Ue)).isRequired,nonExhaustiveMaxMatchCount:_e.number})),Be=_e.shape(m(m({},t.Text.propTypes),{},{pattern:_e.oneOfType([_e.string,_e.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:_e.number})),qe=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=b(e,ze);if(t){if(!Ue[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Ue[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ne(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=b(n,$e);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=b(n,Le);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();qe.displayName="ParsedText",qe.propTypes=m(m({},t.Text.propTypes),{},{parse:_e.arrayOf(_e.oneOfType([Fe,Be])),childrenProps:_e.shape(t.Text.propTypes)}),qe.defaultProps={parse:null,childrenProps:{}};var De,We,He,Ye,Xe,Ze,Ke,Ge,Qe,Je,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,yt,pt,vt,ht,mt,bt,xt,gt,wt,jt,Pt,St,Ct,Ot=function(o){var l,s,a,u,c=o.message,d=o.onMediaPress,f=o.isVideoPlaying,y=o.isCurrentUser,p=I(),v=p.theme,h=p.showMessageStatus,b=p.CustomPlayIcon,x=p.renderCustomVideoBubbleError,j=n.useRef(null),P=g(n.useState(0),2),S=P[0],C=P[1],O=g(n.useState(!1),2),A=O[0],T=O[1],k=g(n.useState(!1),2),M=k[0],V=k[1];return e.jsxs(t.View,{children:[c.image&&e.jsx(t.Pressable,{onPress:function(){return d("image",c.image)},style:r(je||(je=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:c.image},style:r(Pe||(Pe=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),c.video&&e.jsxs(t.Pressable,{onPress:function(){return d("video",c.video)},style:r(Se||(Se=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:A,children:[e.jsx(i,{source:{uri:c.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){T(!0),V(!1)},onLoad:function(e){C(e.duration),T(!1)},onBuffer:function(e){var t=e.isBuffering;return T(t)},onError:function(){V(!0),T(!1)}}),A?e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}):M?x?x():e.jsx(t.View,{style:r(Oe||(Oe=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ie||(Ie=w(["text-white font-bold"]))),null==v?void 0:v.fontFamily),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ae||(Ae=w(["absolute bg-black/40 rounded-full"]))),children:b?e.jsx(b,{}):e.jsx(L,{style:r.style("h-16 w-16"),color:(null==v||null===(l=v.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Te||(Te=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Ee||(Ee=w(["text-white text-xs font-semibold"]))),children:U(S)})})]})]}),c.audio&&e.jsx(t.View,{style:r(ke||(ke=w(["my-2"]))),children:e.jsx(H,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:f})}),c.text&&e.jsx(qe,{style:E([r(Me||(Me=w(["pt-1"]))),r(h?Ve||(Ve=w(["pb-0"])):Re||(Re=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},y?null==v||null===(s=v.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==v||null===(a=v.messageStyle)||void 0===a?void 0:a.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:m({color:"blue",textDecorationLine:"underline"},(u=null==v?void 0:v.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},It=n.memo(Ot),At=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Tt=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},Et=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,y=I(),p=y.theme,v=y.showMessageStatus;return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(De||(De=w(["flex-row items-center"]))),r(d?We||(We=w(["justify-end pb-1 ml-4"])):f?He||(He=w(["absolute right-3 bottom-3"])):Ye||(Ye=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:E([r(Xe||(Xe=w(["text-xs"]))),{color:d||f?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==p?void 0:p.fontFamily),children:a}),c&&e.jsxs(t.View,{style:r(Ze||(Ze=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(Tt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},kt=n.memo(Et),Mt=function(n){var o,i,l,s,a,u,c,d,f=n.message,y=n.isCurrentUser,p=n.isFirstInSequence,v=n.onLongPress,h=I(),b=h.theme,x=h.showAvatars,g=h.showUserNames,j=h.showBubbleTail,S=h.setMediaUrl,C=h.setIsVideoPlaying,O=h.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:v,style:[r(Ke||(Ke=w(["px-2 my-1 max-w-[75%] relative"]))),r(y?Ge||(Ge=w(["self-end mr-3"])):Qe||(Qe=w(["self-start ml-9"]))),r(p?y?Je||(Je=w(["bg-green-500 rounded-tr-none"])):et||(et=w(["bg-white rounded-tl-none"])):y?tt||(tt=w(["bg-green-500"])):rt||(rt=w(["bg-white"]))),m({borderRadius:8},y?null==b||null===(o=b.bubbleStyle)||void 0===o?void 0:o.sent:null==b||null===(i=b.bubbleStyle)||void 0===i?void 0:i.received)],children:[!y&&p&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(nt||(nt=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(ot||(ot=w(["w-full h-full rounded-full"]))),null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:E([r(it||(it=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:E([r(lt||(lt=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==b?void 0:b.fontFamily),children:f.senderName})]}),p&&j&&e.jsx(P,{style:r.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(c=b.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(d=b.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(It,{message:f,isCurrentUser:y,isFirstInSequence:p,onMediaPress:function(e,t){S({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&C(!0)},isVideoPlaying:O}),e.jsx(kt,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},Vt=n.memo(Mt),Rt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},_t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Nt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},zt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},$t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Lt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},Ut=function(r){var n=r.fileName,o=r.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:E([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},Ft=n.memo(Ut),Bt=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,y=r.CustomFileIcon,p=r.CustomImagePreview,v=r.CustomVideoPreview,h=r.inputHeight,m=I(),b=m.theme,x=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12},null==b||null===(l=b.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(x({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:E({fontSize:12,color:"black"},null==b?void 0:b.fontFamily),children:"X"})}),w?p?e.jsx(p,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?v?e.jsx(v,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==b||null===(s=b.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==b||null===(a=b.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:y?e.jsx(y,{}):e.jsx(Lt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==b||null===(u=b.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx(Ft,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},qt=n.memo(Bt),Dt="ios"===t.Platform.OS?32:30,Wt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b=o.onSendMessage,x=o.onTypingStart,j=o.onTypingEnd,P=o.onAttachmentPress,S=o.onCameraPress,C=o.onAudioRecordStart,O=o.onAudioRecordEnd,A=o.CustomEmojiIcon,k=o.CustomAttachmentIcon,M=o.CustomCameraIcon,V=o.CustomSendIcon,R=o.CustomMicrophoneIcon,_=o.CustomFileIcon,N=o.CustomImagePreview,z=o.CustomVideoPreview,$=g(n.useState(""),2),L=$[0],U=$[1],F=g(n.useState({height:Dt,isMultiline:!1}),2),B=F[0],q=F[1],D=I(),W=D.theme,H=D.currentUserId,Y=D.showEmojiButton,X=D.showAttachmentsButton,Z=D.showCameraButton,K=D.showVoiceRecordButton,G=D.placeholder,Q=D.previewData,J=D.closePreview,ee=null==W||null===(i=W.sizes)||void 0===i?void 0:i.inputIconSize,te=T(ee,B.isMultiline?"pb-14":void 0),re=T(ee),ne=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Dt),118);q({height:t,isMultiline:t>Dt})}),[]),oe=n.useCallback((function(){var e=L.trim();(e||Q)&&(b({text:e,senderId:H}),U(""),q({height:Dt,isMultiline:!1}))}),[L,b,H,Q]);return n.useEffect((function(){L.trim()?null==x||x():null==j||j()}),[L,x,j]),e.jsxs(t.View,{style:r(st||(st=w(["w-full px-2"]))),children:[Q&&e.jsx(qt,{previewData:Q,closePreview:J,CustomFileIcon:_,CustomImagePreview:N,CustomVideoPreview:z,inputHeight:B.height}),e.jsxs(t.View,{style:[r(at||(at=w(["flex-row items-end gap-2"]))),null==W||null===(l=W.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(ut||(ut=w(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),B.isMultiline?r(ct||(ct=w(["rounded-3xl items-end"]))):r(dt||(dt=w(["rounded-full items-center"]))),null==W||null===(s=W.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Y&&e.jsx(t.Pressable,{children:A?e.jsx(A,{}):e.jsx(_t,{style:te,color:(null==W||null===(a=W.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e.jsx(t.TextInput,{value:L,onChangeText:U,placeholder:G||"Message",style:E([r(ft||(ft=w(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===t.Platform.OS?r(yt||(yt=w(["text-[17px]"]))):r(pt||(pt=w(["text-[16px]"]))),{minHeight:Dt,maxHeight:118},{color:(null==W||null===(u=W.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(247, 247, 247, 0.9)"}],null==W?void 0:W.fontFamily),placeholderTextColor:(null==W||null===(c=W.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:ne}),e.jsxs(t.View,{style:[r(vt||(vt=w(["gap-4 flex-row"]))),B.isMultiline?r(ht||(ht=w(["pb-4"]))):r(mt||(mt=w(["pb-0"])))],children:[X&&e.jsx(t.Pressable,{onPress:P,children:k?e.jsx(k,{}):e.jsx(zt,{style:re,color:(null==W||null===(d=W.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Z&&!L.trim()&&e.jsx(t.Pressable,{onPress:S,children:M?e.jsx(M,{}):e.jsx(Rt,{style:re,color:(null==W||null===(f=W.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(bt||(bt=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:"ios"===t.Platform.OS?50:48,width:"ios"===t.Platform.OS?50:48},null==W||null===(y=W.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:L.trim()||Q?oe:C,onLongPress:C,onPressOut:O,children:L.trim()?V?e.jsx(V,{}):e.jsx($t,{style:r.style("h-6 w-6"),color:(null==W||null===(p=W.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):K?R?e.jsx(R,{}):e.jsx(Nt,{style:r.style("h-6 w-6"),color:(null==W||null===(v=W.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):V?e.jsx(V,{}):e.jsx($t,{style:r.style("h-6 w-6"),color:(null==W||null===(h=W.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Ht=n.memo(Wt);function Yt(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr,sr,ar,ur=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=I().theme,d=n.useRef(null),f=g(n.useState(!1),2),y=f[0],p=f[1],v=g(n.useState(!1),2),h=v[0],m=v[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(xt||(xt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(gt||(gt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Yt,{style:r(wt||(wt=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(jt||(jt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),m(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){m(!0),p(!1)}}),y&&e.jsx(t.View,{style:r(Pt||(Pt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(St||(St=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ct||(Ct=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},cr=n.memo(ur),dr=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,p=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var h=v.slice(0,2),b=v.length-2;return e.jsxs(t.View,{style:r(Xt||(Xt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Zt||(Zt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Kt||(Kt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:h.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Gt||(Gt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:E([r(Qt||(Qt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),b>0&&e.jsx(t.View,{style:[r(Jt||(Jt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:E([r(er||(er=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",b]})})]}),p&&e.jsx(P,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(tr||(tr=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:y?y():e.jsx(t.View,{style:r(rr||(rr=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:E(r(nr||(nr=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var fr=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaUrl,u=o.setMediaUrl,c=o.setIsVideoPlaying,d=o.typingUsers,f=o.onSendMessage,y=o.onTypingStart,p=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,m=o.onAudioRecordStart,b=o.onCameraPress,x=o.renderCustomInput,j=o.CustomEmojiIcon,P=o.CustomAttachmentIcon,S=o.CustomCameraIcon,C=o.CustomMicrophoneIcon,O=o.CustomSendIcon,A=o.CustomFileIcon,T=o.CustomImagePreview,E=o.CustomVideoPreview,k=o.keyboardVerticalOffset,M=void 0===k?0:k,V=o.disableKeyboardAvoiding,R=void 0!==V&&V,_=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=g(n.useState(0),2),o=r[0],i=r[1];return n.useEffect((function(){if(e){var r="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(r,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!R),N=x?x():e.jsx(Ht,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:P,CustomCameraIcon:S,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),z=e.jsxs(t.View,{style:r(or||(or=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(ir||(ir=w(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(Vt,{message:n,isCurrentUser:n.senderId===l,onLongPress:function(){return null==s?void 0:s(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(dr,{typingUsers:d||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!R&&_>0?{marginBottom:_}:void 0,children:N}),e.jsx(cr,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(lr||(lr=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(sr||(sr=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(ar||(ar=w(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:M,children:z})};module.exports=function(t){return e.jsx(q,{children:e.jsx(O,m(m({},t),{},{children:e.jsx(fr,{})}))})};
15
15
  //# sourceMappingURL=index.js.map