movius-chats 1.3.8 → 1.3.10

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
@@ -37,6 +37,7 @@ A highly customizable, feature-rich chat UI for **React Native**. Drop in a sing
37
37
  - [Font family (all text)](#font-family-all-text)
38
38
  - [Keyboard avoiding](#keyboard-avoiding)
39
39
  - [Custom input bar](#custom-input-bar)
40
+ - [Opening file attachments (expo-sharing)](#opening-file-attachments-expo-sharing)
40
41
  - [Long-press on a message](#long-press-on-a-message)
41
42
  - [Full-screen gallery viewer](#full-screen-gallery-viewer)
42
43
  - [Architecture overview](#architecture-overview)
@@ -289,6 +290,7 @@ All default to `false` (hidden) unless explicitly set to `true`:
289
290
  | `onCameraPress` | `() => void` | Camera icon tapped — open camera |
290
291
  | `onAudioRecordStart` | `() => void` | Mic pressed / long-pressed — start recording |
291
292
  | `onAudioRecordEnd` | `() => void` | Mic released — stop recording, upload, add message |
293
+ | `onFileAttachmentPress` | `(file: MessageFileAttachment) => void` | Tapped a file-attachment chip in a bubble. Defaults to `Linking.openURL`. Supply this to use `expo-sharing` or a custom downloader. |
292
294
  | `typingUsers` | `{ id: string; avatar: string; name: string }[]` | Users currently typing (current user is excluded from display) |
293
295
 
294
296
  ### Attachment preview (composer)
@@ -299,7 +301,10 @@ Show a preview strip above the input before the user taps send.
299
301
  |------|------|-------------|
300
302
  | `previewItems` | `PreviewAttachment[]` | **Multiple** attachments — images/videos shown as a fanned spread; documents shown as file chips |
301
303
  | `previewData` | `PreviewAttachment` | **Single** attachment (kept for backward compatibility; `previewItems` takes precedence) |
302
- | `closePreview` | `() => void` | Called when the user taps the × on the preview |
304
+ | `closePreview` | `() => void` | Fallback called when no `onRemovePreviewItem` is provided |
305
+ | `onRemovePreviewItem` | `(uri: string) => void` | Called with the URI of whichever card the user tapped × on — removes only that item |
306
+
307
+ **Per-item removal:** Every media thumbnail and every document chip shows its own × button. When `onRemovePreviewItem` is provided, tapping × on a card calls it with that card's URI so you can filter it out of your state. `closePreview` is only used as a fallback when `onRemovePreviewItem` is not supplied.
303
308
 
304
309
  When any preview is present, the send button appears regardless of text content.
305
310
 
@@ -416,14 +421,14 @@ theme?: {
416
421
 
417
422
  Use `mediaItems` in the `Message` object. The bubble renders a WhatsApp-style grid:
418
423
 
419
- | Count | Layout |
420
- |-------|--------|
421
- | 1 | Single full-width tile (cover) |
422
- | 2 | Side by side |
423
- | 3 | One on top, two below |
424
- | 4+ | 2 × 2 grid; bottom-right cell shows `+N` overlay |
424
+ | Count | Layout | Height |
425
+ |-------|--------|--------|
426
+ | 1 | Single full-width tile (cover) | 320 px |
427
+ | 2 | Side by side, two equal columns | 320 px |
428
+ | 3 | One on top (55%), two below (45%) | 320 px |
429
+ | 4+ | 2 × 2 grid; bottom-right cell shows `+N` overlay | 320 px |
425
430
 
426
- Tapping any cell opens the full-screen swipe gallery.
431
+ All layouts share the same fixed height so multi-image bubbles stay visually consistent with single-image bubbles. Tapping any cell opens the full-screen swipe gallery.
427
432
 
428
433
  ```tsx
429
434
  const message: Message = {
@@ -466,7 +471,7 @@ const message: Message = {
466
471
  };
467
472
  ```
468
473
 
469
- Each attachment renders as a tappable row. Tapping it calls `Linking.openURL(uri)`.
474
+ Each attachment renders as a tappable row. By default tapping calls `Linking.openURL(uri)`. Supply `onFileAttachmentPress` to override this with your own handler (e.g. `expo-sharing`).
470
475
 
471
476
  ### Audio message bubble
472
477
 
@@ -493,6 +498,10 @@ const [previews, setPreviews] = useState<PreviewAttachment[]>([]);
493
498
  <ChatScreen
494
499
  previewItems={previews}
495
500
  closePreview={() => setPreviews([])}
501
+ // Remove only the card whose × was tapped:
502
+ onRemovePreviewItem={(uri) =>
503
+ setPreviews((prev) => prev.filter((p) => p.uri !== uri))
504
+ }
496
505
  onAttachmentPress={async () => {
497
506
  const picked = await myPicker.pick(); // returns an array
498
507
  setPreviews(
@@ -530,10 +539,12 @@ const [previews, setPreviews] = useState<PreviewAttachment[]>([]);
530
539
  ```
531
540
 
532
541
  Preview UI:
533
- - **1 image/video** — single thumbnail.
534
- - **2–3 images/videos** — overlapping fan spread.
535
- - **4+ images/videos** — fan of 3 with a `+N` badge.
536
- - **Documents** — file chip with name + icon.
542
+ - **1 image/video** — single thumbnail with × in the top-right corner.
543
+ - **2–3 images/videos** — overlapping fan spread; each card has its own ×.
544
+ - **4+ images/videos** — fan of 3 with a `+N` badge; each visible card has its own ×.
545
+ - **Documents** — file chips, each with their own ×. If more than 3 documents are selected the list becomes scrollable.
546
+
547
+ Tapping × on any card calls `onRemovePreviewItem(uri)` for that specific file. When the last item is removed the preview strip disappears automatically.
537
548
 
538
549
  ### Send button vs microphone
539
550
 
@@ -675,6 +686,39 @@ If your screen or navigator already handles the keyboard (e.g. wraps in its own
675
686
 
676
687
  When `renderCustomInput` is provided the default `ChatInput` is not mounted. Preview props (`previewItems`, `closePreview`) are not wired automatically — handle them inside your custom component.
677
688
 
689
+ ### Opening file attachments (expo-sharing)
690
+
691
+ By default tapping a file-attachment chip in a bubble calls `Linking.openURL`. For Expo apps that need to share or download local files, supply `onFileAttachmentPress`:
692
+
693
+ ```bash
694
+ yarn add expo-sharing
695
+ ```
696
+
697
+ ```tsx
698
+ import * as Sharing from 'expo-sharing';
699
+ import { Linking } from 'react-native';
700
+ import type { MessageFileAttachment } from 'movius-chats/lib/typescript/types';
701
+
702
+ const handleFilePress = async (file: MessageFileAttachment) => {
703
+ const uri =
704
+ file.uri.startsWith('http') || file.uri.startsWith('file:')
705
+ ? file.uri
706
+ : `file://${file.uri}`;
707
+
708
+ const available = await Sharing.isAvailableAsync();
709
+ if (available) {
710
+ await Sharing.shareAsync(uri, { dialogTitle: file.name });
711
+ } else {
712
+ Linking.openURL(uri);
713
+ }
714
+ };
715
+
716
+ <ChatScreen
717
+ onFileAttachmentPress={handleFilePress}
718
+ // ...
719
+ />
720
+ ```
721
+
678
722
  ### Long-press on a message
679
723
 
680
724
  ```tsx
@@ -763,6 +807,8 @@ import type {
763
807
  | Messages appear in wrong order | Newest message must be at `messages[0]` (inverted FlatList) |
764
808
  | Feature buttons missing | Feature flags (`showAttachmentsButton`, etc.) default to `false` — pass `true` to show them |
765
809
  | Gallery does not swipe | Ensure `mediaItems` is an array; single `image`/`video` strings open the viewer for that single item |
810
+ | File attachment tap does nothing | Default is `Linking.openURL`. For local files on iOS/Android use `onFileAttachmentPress` with `expo-sharing` |
811
+ | Tapping × removes all previews | Supply `onRemovePreviewItem` — without it the fallback `closePreview` clears everything |
766
812
 
767
813
  ---
768
814
 
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),n=require("twrnc"),r=require("react"),o=require("react-native-svg"),i=require("react-native-reanimated"),l=require("react-native-sound"),s=require("react-native-video");function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){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,n||[],y(e).constructor):t.apply(e,n))}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}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 n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,s=[],a=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(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 b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var j=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,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"],P=r.createContext(void 0),C=function(t){var n=t.children,o=m(t,S),i=g(r.useState(null),2),l=i[0],s=i[1],a=g(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(P.Provider,{value:v(v({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:function(e,t){s({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){s(null),c(!1)},isVideoPlaying:u,setIsVideoPlaying:c}),children:n})},I=function(){var e=r.useContext(P);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function O(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var T="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function k(e,t){return t?[e,{fontFamily:t}]:e}var A,V,E,M,R,_,z,N,L,F,$,D,q,W,B,U=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:r,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"})})},H=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},G=r.createContext(void 0),Y=function(t){var n=t.children,o=g(r.useState(null),2),i=o[0],l=o[1];return e.jsx(G.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})},K={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"},X=function(o){var s,a,u,c,d,f,y,h=o.audioUrl,p=o.audioId,m=o.isVideoPlaying,x=I(),w=x.theme,j=x.CustomPlayIcon,S=x.CustomPauseIcon,P=function(){var e=r.useContext(G);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=P.currentlyPlayingId,O=P.setCurrentlyPlayingId,T=g(r.useState(null),2),N=T[0],L=T[1],F=g(r.useState(!1),2),$=F[0],D=F[1],q=g(r.useState(0),2),W=q[0],B=q[1],Y=g(r.useState(0),2),X=Y[0],Z=Y[1],Q=g(r.useState(!1),2),J=Q[0],ee=Q[1],te=r.useRef(null),ne=r.useRef(0),re=r.useRef(0),oe=r.useRef(0),ie=i.useSharedValue(0);r.useEffect((function(){var e=!0,t=new l(h,"",(function(n){!n&&e&&Z(t.getDuration())}));return L(t),function(){e=!1,t&&(t.pause(),t.release())}}),[h]),r.useEffect((function(){C&&C!==p&&$&&N&&(N.pause(),D(!1),B(0),ie.value=0)}),[C,p,$,N]),r.useEffect((function(){var e;return $&&N&&!J&&(e=setInterval((function(){N.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(B(e),ne.current>0&&X>0)){var t=e/X*ne.current;isNaN(t)||(ie.value=i.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[$,N,J,X]);var le,se,ae,ue,ce,de=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(ne.current>0){var t=e.nativeEvent.pageX-oe.current,n=Math.max(0,Math.min(t,ne.current));ie.value=n;var r=n/ne.current*X;isNaN(r)||B(r)}},onPanResponderRelease:function(){if(ee(!1),N&&ne.current>0){var e=ie.value/ne.current*X;isNaN(e)||N.setCurrentTime(e)}},onPanResponderTerminate:function(){ee(!1)}}),fe=i.useAnimatedStyle((le=[new global.Error,-2,-27],(se=function(){return{transform:[{translateX:ie.value}]}}).__closure={knobPosition:ie},se.__workletHash=1935336866997,se.__initData=K,se.__stackDetails=le,se));return r.useEffect((function(){m&&$&&N&&N.pause((function(){D(!1),O(null)}))}),[m]),e.jsxs(t.View,{style:n(A||(A=b(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:n(V||(V=b(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){N&&($?N.pause((function(){D(!1),O(null)})):(O(p),N.play((function(e){e&&(D(!1),B(0),ie.value=i.withSpring(0),O(null))})),D(!0)))},style:[n(E||(E=b(["bg-black/40 rounded-full p-2"]))),null==w||null===(s=w.messageStyle)||void 0===s?void 0:s.audioPlayButtonStyle],children:$?S?e.jsx(S,{}):e.jsx(U,{style:n.style("h-6 w-6"),color:(null==w||null===(a=w.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx(H,{style:n.style("h-6 w-6"),color:(null==w||null===(u=w.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:te,onLayout:function(e){var t,n=e.nativeEvent.layout.width;ne.current=n,null===(t=te.current)||void 0===t||t.measure((function(e,t,n,r,o){re.current=o}))},style:[n(M||(M=b(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==w||null===(c=w.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[n(R||(R=b(["absolute h-full bg-slate-200"]))),{width:"".concat(X>0?W/X*100:0,"%")},null==w||null===(d=w.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(i.View,v(v({},de.panHandlers),{},{style:[fe,{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},v({},null==w||null===(f=w.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:n(_||(_=b(["px-4 py-1"]))),children:e.jsx(t.Text,{style:k([n(z||(z=b(["text-xs text-gray-500"]))),null==w||null===(y=w.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==w?void 0:w.fontFamily),children:isNaN(W)?"0:00":(ae=W,ue=Math.floor(ae/60),ce=Math.floor(ae%60),"".concat(ue,":").concat(ce<10?"0":"").concat(ce))})})]})},Z=r.memo(X),Q=function(n){var i=n.style,l=n.spinning,s=void 0!==l&&l,a=r.useRef(new t.Animated.Value(0)).current;r.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"})})})},J=function(o){var i,l=o.uri,a=o.cellStyle,u=o.roundedStyle,c=I(),d=c.theme,f=c.CustomPlayIcon,y=r.useRef(null),h=g(r.useState(0),2),p=h[0],v=h[1],m=g(r.useState(!0),2),x=m[0],w=m[1],j=g(r.useState(!1),2),S=j[0],P=j[1];return e.jsxs(t.View,{style:[a,u],children:[e.jsx(s,{source:{uri:l},ref:y,paused:!0,muted:!0,style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){w(!0),P(!1)},onLoad:function(e){v(e.duration),w(!1)},onError:function(){P(!0),w(!1)}}),x&&e.jsx(t.View,{style:[n(N||(N=b(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(Q,{style:n.style("h-8 w-8"),spinning:!0})}),!x&&!S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(L||(L=b(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx(H,{style:n.style("h-10 w-10"),color:(null==d||null===(i=d.colors)||void 0===i?void 0:i.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:n(F||(F=b(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:n($||($=b(["text-white text-[10px] font-semibold"]))),children:ee(p)})})]}),S&&e.jsx(t.View,{style:[n(D||(D=b(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:k(n(q||(q=b(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ee(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var te=function(r){var o=r.items,i=r.onOpenGallery,l=t.useWindowDimensions().width,s=Math.min(240,.72*l);if(0===o.length)return null;var a={borderRadius:6,overflow:"hidden"};if(1===o.length){var u=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(J,{uri:u.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:140,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(n,r){return e.jsx(t.Pressable,{onPress:function(){return i(o,r)},style:{width:c,height:140},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(J,{uri:n.uri,cellStyle:{width:c,height:140},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],y=o[2],h=100,p=(s-2)/2;return e.jsxs(t.View,{style:{width:s,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:100},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(J,{uri:d.uri,cellStyle:{width:s,height:100},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:h},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:p,height:h},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(J,{uri:f.uri,cellStyle:{width:p,height:h},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:p,height:h},children:"image"===y.kind?e.jsx(t.Image,{source:{uri:y.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(J,{uri:y.uri,cellStyle:{width:p,height:h},roundedStyle:a})},"".concat(y.uri,"-2"))]})]})}var v=(s-2)/2,m=o.length-4,x=o.slice(0,4);return e.jsx(t.View,{style:{width:s,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:x.map((function(r,l){return e.jsxs(t.Pressable,{onPress:function(){return i(o,l)},style:{width:v,height:100,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(J,{uri:r.uri,cellStyle:{width:v,height:100},roundedStyle:a}),3===l&&m>0&&e.jsx(t.View,{style:n(W||(W=b(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(B||(B=b(["text-white text-lg font-bold"]))),children:["+",m]})})]},"".concat(r.uri,"-").concat(l))}))})};function ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re,oe={exports:{}},ie={exports:{}},le={};var se,ae,ue,ce,de,fe,ye,he,pe,ve,me,xe,ge,be,we,je={};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),n=require("twrnc"),r=require("react"),o=require("react-native-svg"),i=require("react-native-reanimated"),l=require("react-native-sound"),s=require("react-native-video");function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){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,n||[],y(e).constructor):t.apply(e,n))}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}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 n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,s=[],a=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(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 b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var j=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,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"],P=r.createContext(void 0),C=function(t){var n=t.children,o=m(t,S),i=g(r.useState(null),2),l=i[0],s=i[1],a=g(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(P.Provider,{value:v(v({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:function(e,t){s({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){s(null),c(!1)},isVideoPlaying:u,setIsVideoPlaying:c}),children:n})},I=function(){var e=r.useContext(P);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function O(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var T="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function A(e,t){return t?[e,{fontFamily:t}]:e}var k,V,E,M,R,_,z,N,F,L,$,D,q,W,B,H=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:r,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=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},G=r.createContext(void 0),Y=function(t){var n=t.children,o=g(r.useState(null),2),i=o[0],l=o[1];return e.jsx(G.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})},K={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"},X=function(o){var s,a,u,c,d,f,y,h=o.audioUrl,p=o.audioId,m=o.isVideoPlaying,x=I(),w=x.theme,j=x.CustomPlayIcon,S=x.CustomPauseIcon,P=function(){var e=r.useContext(G);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=P.currentlyPlayingId,O=P.setCurrentlyPlayingId,T=g(r.useState(null),2),N=T[0],F=T[1],L=g(r.useState(!1),2),$=L[0],D=L[1],q=g(r.useState(0),2),W=q[0],B=q[1],Y=g(r.useState(0),2),X=Y[0],Z=Y[1],Q=g(r.useState(!1),2),J=Q[0],ee=Q[1],te=r.useRef(null),ne=r.useRef(0),re=r.useRef(0),oe=r.useRef(0),ie=i.useSharedValue(0);r.useEffect((function(){var e=!0,t=new l(h,"",(function(n){!n&&e&&Z(t.getDuration())}));return F(t),function(){e=!1,t&&(t.pause(),t.release())}}),[h]),r.useEffect((function(){C&&C!==p&&$&&N&&(N.pause(),D(!1),B(0),ie.value=0)}),[C,p,$,N]),r.useEffect((function(){var e;return $&&N&&!J&&(e=setInterval((function(){N.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(B(e),ne.current>0&&X>0)){var t=e/X*ne.current;isNaN(t)||(ie.value=i.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[$,N,J,X]);var le,se,ae,ue,ce,de=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(ne.current>0){var t=e.nativeEvent.pageX-oe.current,n=Math.max(0,Math.min(t,ne.current));ie.value=n;var r=n/ne.current*X;isNaN(r)||B(r)}},onPanResponderRelease:function(){if(ee(!1),N&&ne.current>0){var e=ie.value/ne.current*X;isNaN(e)||N.setCurrentTime(e)}},onPanResponderTerminate:function(){ee(!1)}}),fe=i.useAnimatedStyle((le=[new global.Error,-2,-27],(se=function(){return{transform:[{translateX:ie.value}]}}).__closure={knobPosition:ie},se.__workletHash=1935336866997,se.__initData=K,se.__stackDetails=le,se));return r.useEffect((function(){m&&$&&N&&N.pause((function(){D(!1),O(null)}))}),[m]),e.jsxs(t.View,{style:n(k||(k=b(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:n(V||(V=b(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){N&&($?N.pause((function(){D(!1),O(null)})):(O(p),N.play((function(e){e&&(D(!1),B(0),ie.value=i.withSpring(0),O(null))})),D(!0)))},style:[n(E||(E=b(["bg-black/40 rounded-full p-2"]))),null==w||null===(s=w.messageStyle)||void 0===s?void 0:s.audioPlayButtonStyle],children:$?S?e.jsx(S,{}):e.jsx(H,{style:n.style("h-6 w-6"),color:(null==w||null===(a=w.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx(U,{style:n.style("h-6 w-6"),color:(null==w||null===(u=w.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:te,onLayout:function(e){var t,n=e.nativeEvent.layout.width;ne.current=n,null===(t=te.current)||void 0===t||t.measure((function(e,t,n,r,o){re.current=o}))},style:[n(M||(M=b(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==w||null===(c=w.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[n(R||(R=b(["absolute h-full bg-slate-200"]))),{width:"".concat(X>0?W/X*100:0,"%")},null==w||null===(d=w.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(i.View,v(v({},de.panHandlers),{},{style:[fe,{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},v({},null==w||null===(f=w.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:n(_||(_=b(["px-4 py-1"]))),children:e.jsx(t.Text,{style:A([n(z||(z=b(["text-xs text-gray-500"]))),null==w||null===(y=w.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==w?void 0:w.fontFamily),children:isNaN(W)?"0:00":(ae=W,ue=Math.floor(ae/60),ce=Math.floor(ae%60),"".concat(ue,":").concat(ce<10?"0":"").concat(ce))})})]})},Z=r.memo(X),Q=function(n){var i=n.style,l=n.spinning,s=void 0!==l&&l,a=r.useRef(new t.Animated.Value(0)).current;r.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"})})})},J=320,ee=J,te=Math.round(176),ne=J-te-2,re=Math.round(159),oe=function(o){var i,l=o.uri,a=o.cellStyle,u=o.roundedStyle,c=I(),d=c.theme,f=c.CustomPlayIcon,y=r.useRef(null),h=g(r.useState(0),2),p=h[0],v=h[1],m=g(r.useState(!0),2),x=m[0],w=m[1],j=g(r.useState(!1),2),S=j[0],P=j[1];return e.jsxs(t.View,{style:[a,u],children:[e.jsx(s,{source:{uri:l},ref:y,paused:!0,muted:!0,style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){w(!0),P(!1)},onLoad:function(e){v(e.duration),w(!1)},onError:function(){P(!0),w(!1)}}),x&&e.jsx(t.View,{style:[n(N||(N=b(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(Q,{style:n.style("h-8 w-8"),spinning:!0})}),!x&&!S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(F||(F=b(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx(U,{style:n.style("h-10 w-10"),color:(null==d||null===(i=d.colors)||void 0===i?void 0:i.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:n(L||(L=b(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:n($||($=b(["text-white text-[10px] font-semibold"]))),children:ie(p)})})]}),S&&e.jsx(t.View,{style:[n(D||(D=b(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:A(n(q||(q=b(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ie(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var le=function(r){var o=r.items,i=r.onOpenGallery,l=t.useWindowDimensions().width,s=Math.min(240,.72*l);if(0===o.length)return null;var a={borderRadius:6,overflow:"hidden"};if(1===o.length){var u=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(oe,{uri:u.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:ee,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(n,r){return e.jsx(t.Pressable,{onPress:function(){return i(o,r)},style:{width:c,height:ee},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(oe,{uri:n.uri,cellStyle:{width:c,height:ee},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],y=o[2],h=(s-2)/2;return e.jsxs(t.View,{style:{width:s,height:J,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:te},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(oe,{uri:d.uri,cellStyle:{width:s,height:te},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:ne},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:ne},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(oe,{uri:f.uri,cellStyle:{width:h,height:ne},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:ne},children:"image"===y.kind?e.jsx(t.Image,{source:{uri:y.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(oe,{uri:y.uri,cellStyle:{width:h,height:ne},roundedStyle:a})},"".concat(y.uri,"-2"))]})]})}var p=(s-2)/2,v=o.length-4,m=o.slice(0,4);return e.jsx(t.View,{style:{width:s,height:J,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(r,l){return e.jsxs(t.Pressable,{onPress:function(){return i(o,l)},style:{width:p,height:re,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(oe,{uri:r.uri,cellStyle:{width:p,height:re},roundedStyle:a}),3===l&&v>0&&e.jsx(t.View,{style:n(W||(W=b(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(B||(B=b(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(r.uri,"-").concat(l))}))})};function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae,ue={exports:{}},ce={exports:{}},de={};var fe,ye,he,pe,ve,me,xe,ge,be,we,je,Se,Pe,Ce,Ie,Oe={};
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 Se(){return ae||(ae=1,"production"===process.env.NODE_ENV?ie.exports=function(){if(re)return le;re=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=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,h=e?Symbol.for("react.lazy"):60116,p=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 g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case h:case y:case l:return e;default:return f}}case n:return f}}}function b(e){return g(e)===u}return le.AsyncMode=a,le.ConcurrentMode=u,le.ContextConsumer=s,le.ContextProvider=l,le.Element=t,le.ForwardRef=c,le.Fragment=r,le.Lazy=h,le.Memo=y,le.Portal=n,le.Profiler=i,le.StrictMode=o,le.Suspense=d,le.isAsyncMode=function(e){return b(e)||g(e)===a},le.isConcurrentMode=b,le.isContextConsumer=function(e){return g(e)===s},le.isContextProvider=function(e){return g(e)===l},le.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},le.isForwardRef=function(e){return g(e)===c},le.isFragment=function(e){return g(e)===r},le.isLazy=function(e){return g(e)===h},le.isMemo=function(e){return g(e)===y},le.isPortal=function(e){return g(e)===n},le.isProfiler=function(e){return g(e)===i},le.isStrictMode=function(e){return g(e)===o},le.isSuspense=function(e){return g(e)===d},le.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===p)},le.typeOf=g,le}():ie.exports=(se||(se=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=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,h=e?Symbol.for("react.lazy"):60116,p=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 g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var p=e.type;switch(p){case a:case u:case r:case i:case o:case d:return p;default:var v=p&&p.$$typeof;switch(v){case s:case c:case h:case y:case l:return v;default:return f}}case n:return f}}}var b=a,w=u,j=s,S=l,P=t,C=c,I=r,O=h,T=y,k=n,A=i,V=o,E=d,M=!1;function R(e){return g(e)===u}je.AsyncMode=b,je.ConcurrentMode=w,je.ContextConsumer=j,je.ContextProvider=S,je.Element=P,je.ForwardRef=C,je.Fragment=I,je.Lazy=O,je.Memo=T,je.Portal=k,je.Profiler=A,je.StrictMode=V,je.Suspense=E,je.isAsyncMode=function(e){return M||(M=!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)||g(e)===a},je.isConcurrentMode=R,je.isContextConsumer=function(e){return g(e)===s},je.isContextProvider=function(e){return g(e)===l},je.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},je.isForwardRef=function(e){return g(e)===c},je.isFragment=function(e){return g(e)===r},je.isLazy=function(e){return g(e)===h},je.isMemo=function(e){return g(e)===y},je.isPortal=function(e){return g(e)===n},je.isProfiler=function(e){return g(e)===i},je.isStrictMode=function(e){return g(e)===o},je.isSuspense=function(e){return g(e)===d},je.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===p)},je.typeOf=g}()),je)),ie.exports}
9
+ */function Te(){return ye||(ye=1,"production"===process.env.NODE_ENV?ce.exports=function(){if(ae)return de;ae=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=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,h=e?Symbol.for("react.lazy"):60116,p=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 g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case h:case y:case l:return e;default:return f}}case n:return f}}}function b(e){return g(e)===u}return de.AsyncMode=a,de.ConcurrentMode=u,de.ContextConsumer=s,de.ContextProvider=l,de.Element=t,de.ForwardRef=c,de.Fragment=r,de.Lazy=h,de.Memo=y,de.Portal=n,de.Profiler=i,de.StrictMode=o,de.Suspense=d,de.isAsyncMode=function(e){return b(e)||g(e)===a},de.isConcurrentMode=b,de.isContextConsumer=function(e){return g(e)===s},de.isContextProvider=function(e){return g(e)===l},de.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},de.isForwardRef=function(e){return g(e)===c},de.isFragment=function(e){return g(e)===r},de.isLazy=function(e){return g(e)===h},de.isMemo=function(e){return g(e)===y},de.isPortal=function(e){return g(e)===n},de.isProfiler=function(e){return g(e)===i},de.isStrictMode=function(e){return g(e)===o},de.isSuspense=function(e){return g(e)===d},de.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===p)},de.typeOf=g,de}():ce.exports=(fe||(fe=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=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,h=e?Symbol.for("react.lazy"):60116,p=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 g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var p=e.type;switch(p){case a:case u:case r:case i:case o:case d:return p;default:var v=p&&p.$$typeof;switch(v){case s:case c:case h:case y:case l:return v;default:return f}}case n:return f}}}var b=a,w=u,j=s,S=l,P=t,C=c,I=r,O=h,T=y,A=n,k=i,V=o,E=d,M=!1;function R(e){return g(e)===u}Oe.AsyncMode=b,Oe.ConcurrentMode=w,Oe.ContextConsumer=j,Oe.ContextProvider=S,Oe.Element=P,Oe.ForwardRef=C,Oe.Fragment=I,Oe.Lazy=O,Oe.Memo=T,Oe.Portal=A,Oe.Profiler=k,Oe.StrictMode=V,Oe.Suspense=E,Oe.isAsyncMode=function(e){return M||(M=!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)||g(e)===a},Oe.isConcurrentMode=R,Oe.isContextConsumer=function(e){return g(e)===s},Oe.isContextProvider=function(e){return g(e)===l},Oe.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Oe.isForwardRef=function(e){return g(e)===c},Oe.isFragment=function(e){return g(e)===r},Oe.isLazy=function(e){return g(e)===h},Oe.isMemo=function(e){return g(e)===y},Oe.isPortal=function(e){return g(e)===n},Oe.isProfiler=function(e){return g(e)===i},Oe.isStrictMode=function(e){return g(e)===o},Oe.isSuspense=function(e){return g(e)===d},Oe.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===x||e.$$typeof===p)},Oe.typeOf=g}()),Oe)),ce.exports}
10
10
  /*
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function Pe(){if(ce)return ue;ce=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return ue=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={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,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)}(r),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++)n.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},ue}function Ce(){if(fe)return de;fe=1;return de="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ie(){return he?ye:(he=1,ye=Function.call.bind(Object.prototype.hasOwnProperty))}function Oe(){if(ve)return pe;ve=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Ce(),n={},r=Ie();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(r(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 n)){n[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&&(n={})},pe=o}function Te(){if(xe)return me;xe=1;var e=Se(),t=Pe(),n=Ce(),r=Ie(),o=Oe(),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){}}),me=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:h(l),arrayOf:function(e){return h((function(t,r,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new y("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+"]",n);if(u instanceof Error)return u}return null}))},element:h((function(e,t,n,r,o){var i=e[t];return s(i)?null:new y("Invalid "+r+" `"+o+"` of type `"+x(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:h((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return m(e[t])?null:new y("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((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=x(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(r(a,c)){var d=e(a,c,i,l,s+"."+c,n);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 h((function(t,n,r,o,i){for(var l=t[n],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, 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 "+b(o)+" at index "+t+"."),l}return h((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,n);if(null==c)return null;c.data&&r(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 h((function(t,r,o,i,l){var s=t[r],a=x(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 v(o,i,l,u,g(c));var d=c(s,u,o,i,l+"."+u,n);if(d)return d}return null}))},exact:function(e){return h((function(o,i,l,s,a){var u=o[i],c=x(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 h=e[f];if(r(e,f)&&"function"!=typeof h)return v(l,s,a,f,g(h));if(!h)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 p=h(u,f,l,s,a+"."+f,n);if(p)return p}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 h(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,s,u,d,f,h){if(u=u||c,f=f||s,h!==n){if(a){var p=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 p.name="Invariant Violation",p}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=u+":"+s;!t[v]&&r<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,r++)}}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 p(e){return h((function(t,n,r,o,i,l){var s=t[n];return x(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+g(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,n,r,o){return new y((e||"React class")+": "+t+" type `"+n+"."+r+"` 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 n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.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 g(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 b(e){var t=g(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},me}function ke(){if(be)return ge;be=1;var e=Ce();function t(){}function n(){}return n.resetWarningCache=t,ge=function(){function r(t,n,r,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 r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function Ae(){if(we)return oe.exports;if(we=1,"production"!==process.env.NODE_ENV){var e=Se();oe.exports=Te()(e.isElement,true)}else oe.exports=ke()();return oe.exports}var Ve,Ee,Me,Re,_e,ze,Ne,Le=ne(Ae()),Fe=function(){return d((function e(t,n){c(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.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)r.push(t);else{var o,s=[],a=t.children,u=0;for(n.pattern.lastIndex=0;a&&(o=n.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(n,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,n.pattern.lastIndex=0}s.push({children:a}),r.push.apply(r,s)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),v(v({},o),{},{children:i,_matched:!0})}}])}(),$e=["type"],De=["style"],qe=["parse","childrenProps"],We={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+/},Be=Le.shape(v(v({},t.Text.propTypes),{},{type:Le.oneOf(Object.keys(We)).isRequired,nonExhaustiveMaxMatchCount:Le.number})),Ue=Le.shape(v(v({},t.Text.propTypes),{},{pattern:Le.oneOfType([Le.string,Le.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Le.number})),He=function(){function n(){return c(this,n),u(this,n,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)}(n,r.Component),d(n,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=m(e,$e);if(t){if(!We[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=We[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Fe(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=m(r,De);return e.jsx(t.Text,v(v({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=v({},this.props);r.parse,r.childrenProps;var o=m(r,qe);return e.jsx(t.Text,v(v({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();He.displayName="ParsedText",He.propTypes=v(v({},t.Text.propTypes),{},{parse:Le.arrayOf(Le.oneOfType([Be,Ue])),childrenProps:Le.shape(t.Text.propTypes)}),He.defaultProps={parse:null,childrenProps:{}};var Ge,Ye,Ke,Xe,Ze,Qe,Je,et,tt,nt,rt,ot,it,lt,st,at,ut,ct,dt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,y=I(),h=y.theme,p=y.showMessageStatus,m=r.useMemo((function(){return O(u)}),[u]);return e.jsxs(t.View,{children:[m.length>0&&e.jsx(te,{items:m,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){return e.jsxs(t.Pressable,{onPress:function(){return t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:n(Ve||(Ve=b(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[e.jsxs(t.Text,{style:k(n(Ee||(Ee=b(["text-xs font-semibold"]))),null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:n(Me||(Me=b(["text-[10px] opacity-70 mt-0.5"]))),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(t.View,{style:n(Re||(Re=b(["my-2"]))),children:e.jsx(Z,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d})}),u.text&&e.jsx(He,{style:k([n(_e||(_e=b(["pt-1"]))),n(p?ze||(ze=b(["pb-0"])):Ne||(Ne=b(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle],null==h?void 0:h.fontFamily),parse:[{type:"url",style:v({color:"blue",textDecorationLine:"underline"},(a=null==h?void 0:h.fontFamily,a?{fontFamily:a}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},ft=r.memo(dt),yt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},ht=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,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:r})})},pt=function(r){var o,i,l,s,a=r.time,u=r.status,c=r.isCurrentUser,d=r.hasText,f=r.hasAudio,y=r.hasGalleryMedia,h=r.hasFileAttachments,p=I(),v=p.theme,m=p.showMessageStatus,x=(y||h)&&!d&&!f;return e.jsx(e.Fragment,{children:m&&e.jsxs(t.View,{style:[n(Ge||(Ge=b(["flex-row items-center"]))),n(d?Ye||(Ye=b(["justify-end pb-1 ml-4"])):f?Ke||(Ke=b(["absolute right-3 bottom-3"])):x?Xe||(Xe=b(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):Ze||(Ze=b(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:k([n(Qe||(Qe=b(["text-xs"]))),{color:d||f?(null==v||null===(o=v.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==v?void 0:v.fontFamily),children:a}),c&&e.jsxs(t.View,{style:n(Je||(Je=b(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(ht,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==v||null===(i=v.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(yt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==v||null===(l=v.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(yt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==v||null===(s=v.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},vt=r.memo(pt),mt=function(r){var o,i,l,s,a,u,c,d,f,y,h=r.message,p=r.isCurrentUser,m=r.isFirstInSequence,x=r.onLongPress,g=I(),w=g.theme,S=g.showAvatars,P=g.showUserNames,C=g.showBubbleTail,T=g.setMediaViewerGallery,A=g.isVideoPlaying,V=O(h),E=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===V.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:x,style:[n(et||(et=b(["px-2 my-1 max-w-[75%] relative"]))),n(p?tt||(tt=b(["self-end mr-3"])):nt||(nt=b(["self-start ml-9"]))),n(m?p?rt||(rt=b(["bg-green-500 rounded-tr-none"])):ot||(ot=b(["bg-white rounded-tl-none"])):p?it||(it=b(["bg-green-500"])):lt||(lt=b(["bg-white"]))),v({borderRadius:8},p?null==w||null===(l=w.bubbleStyle)||void 0===l?void 0:l.sent:null==w||null===(s=w.bubbleStyle)||void 0===s?void 0:s.received)],children:[!p&&m&&S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(st||(st=b(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e.jsx(t.Image,{source:{uri:h.senderAvatar},style:[n(at||(at=b(["w-full h-full rounded-full"]))),null==w||null===(a=w.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:k([n(ut||(ut=b(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==w||null===(u=w.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==w?void 0:w.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),P&&h.senderName&&e.jsx(t.Text,{style:k([n(ct||(ct=b(["text-sm text-black font-semibold mt-1 capitalize"]))),null==w||null===(d=w.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==w?void 0:w.fontFamily),children:h.senderName})]}),m&&C&&e.jsx(j,{style:n.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==w||null===(f=w.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==w||null===(y=w.colors)||void 0===y?void 0:y.receivedMessageTailColor)||"white")}),e.jsx(ft,{message:h,isCurrentUser:p,isFirstInSequence:m,onGalleryOpen:function(e,t){T(e,t)},isVideoPlaying:A}),e.jsx(vt,{time:h.time,status:p?h.status:void 0,isCurrentUser:p,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:V.length>0&&!h.text,hasFileAttachments:E})]})},xt=r.memo(mt),gt=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},bt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,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"})]})})},wt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},jt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,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"})})},St=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Pt=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,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"})]})},Ct=function(n){var r=n.fileName,o=n.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:k([{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 n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(r)})},It=r.memo(Ct);function Ot(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var Tt,kt,At,Vt,Et,Mt,Rt,_t,zt,Nt,Lt,Ft,$t,Dt,qt,Wt,Bt=function(n){var r,o=n.previews,i=n.closePreview,l=n.CustomFileIcon,a=n.CustomImagePreview,u=n.CustomVideoPreview,c=n.inputHeight,d=I(),f=d.theme,y=d.setMediaViewerGallery,h=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),p=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),v=Ot(o);if(0===o.length)return null;var m=function(e){0!==v.length&&y(v,e)},x=function(n){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(r=n.type)||void 0===r?void 0:r.startsWith("image/"),c=null===(o=n.type)||void 0===o?void 0:o.startsWith("video/");return l&&a?e.jsx(a,{uri:n.uri}):c&&u?e.jsx(u,{uri:n.uri}):l?e.jsx(t.Image,{source:{uri:n.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):c?e.jsx(t.View,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e.jsx(s,{source:{uri:n.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):null};return e.jsxs(t.View,{style:[{position:"absolute",bottom:(null!=c?c:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==f||null===(r=f.filePreviewStyle)||void 0===r?void 0:r.root],children:[e.jsx(t.Pressable,{onPress:i,style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(255, 255, 255, 0.65)",right:-4,top:-4,borderRadius:11,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:k({fontSize:11,color:"black",fontWeight:"700"},null==f?void 0:f.fontFamily),children:"×"})}),e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===h.length)return null;if(1===h.length){var n=h[0];return n?e.jsx(t.Pressable,{onPress:function(){return m(0)},children:x(n)}):null}var r=h.length>=2,o=h.slice(0,3),i=h.length>3?h.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:o.map((function(n,l){var s=2===o.length?0===l?"-4deg":"4deg":0===l?"-10deg":1===l?"0deg":"10deg";return e.jsx(t.Pressable,{onPress:function(){var e=Ot(h).findIndex((function(e){return e.uri===n.uri}));m(e>=0?e:0)},style:{marginLeft:0===l?0:-18,zIndex:l+1,transform:r?[{rotate:s}]:void 0},children:e.jsxs(t.View,{style:{position:"relative"},children:[x(n),2===l&&i>0&&e.jsx(t.View,{style:{position:"absolute",inset:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",i]})})]})},"".concat(n.uri,"-").concat(l))}))})}(),p.map((function(n,r){var o,i,s,a;return e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==f||null===(o=f.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==f||null===(i=f.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:l?e.jsx(l,{}):e.jsx(Pt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==f||null===(s=f.filePreviewStyle)||void 0===s?void 0:s.nameContainer],children:e.jsx(It,{fileName:n.name||"File",style:null==f||null===(a=f.filePreviewStyle)||void 0===a?void 0:a.text})})]},"".concat(n.uri,"-").concat(r))}))]})]})},Ut=r.memo(Bt),Ht="ios"===t.Platform.OS?32:30,Gt="ios"===t.Platform.OS?50:48,Yt="h-6 w-6",Kt=function(o){var i,l,s,a,u,c,d,f,y,h,p,m,x,w=o.onSendMessage,j=o.onTypingStart,S=o.onTypingEnd,P=o.onAttachmentPress,C=o.onCameraPress,O=o.onAudioRecordStart,A=o.onAudioRecordEnd,V=o.CustomEmojiIcon,E=o.CustomAttachmentIcon,M=o.CustomCameraIcon,R=o.CustomSendIcon,_=o.CustomMicrophoneIcon,z=o.CustomFileIcon,N=o.CustomImagePreview,L=o.CustomVideoPreview,F=g(r.useState(""),2),$=F[0],D=F[1],q=g(r.useState(0),2),W=q[0],B=q[1],U=g(r.useState({height:Ht,isMultiline:!1}),2),H=U[0],G=U[1],Y=I(),K=Y.theme,X=Y.currentUserId,Z=Y.showEmojiButton,Q=Y.showAttachmentsButton,J=Y.showCameraButton,ee=Y.showVoiceRecordButton,te=Y.placeholder,ne=Y.previewData,re=Y.previewItems,oe=Y.closePreview,ie=r.useMemo((function(){return null!=re&&re.length?re:ne?[ne]:[]}),[re,ne]),le=ie.length>0,se=null==K||null===(i=K.sizes)||void 0===i?void 0:i.inputIconSize,ae=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():T;return n.style(t)}(se),ue="number"==typeof(x=se)&&x>0?x:24,ce=0===$.trim().length&&!H.isMultiline,de=Math.max(0,(Gt-ue)/2),fe=ce?{paddingTop:de,paddingBottom:de}:{paddingBottom:de},ye=r.useCallback((function(){G({height:Ht,isMultiline:!1}),B((function(e){return e+1}))}),[]),he=r.useCallback((function(e){D(e),0===e.length&&ye()}),[ye]),pe=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Ht),118),n=t>Ht;G({height:n?t:Ht,isMultiline:n})}),[]),ve=r.useCallback((function(){var e=$.trim();(e||le)&&(w({text:e,senderId:X}),D(""),ye())}),[$,w,X,le,ye]);r.useEffect((function(){$.trim()?null==j||j():null==S||S()}),[$,j,S]);var me=!!$.trim()||le;return e.jsxs(t.View,{style:n(Tt||(Tt=b(["w-full px-2"]))),children:[le&&e.jsx(Ut,{previews:ie,closePreview:oe,CustomFileIcon:z,CustomImagePreview:N,CustomVideoPreview:L,inputHeight:H.height}),e.jsxs(t.View,{style:[n(kt||(kt=b(["flex-row items-end gap-2"]))),null==K||null===(l=K.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(At||(At=b(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Gt,borderRadius:ce?9999:24,alignItems:ce?"center":"flex-end"},null==K||null===(s=K.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Z&&e.jsx(t.View,{style:fe,children:e.jsx(t.Pressable,{children:V?e.jsx(V,{}):e.jsx(bt,{style:ae,color:(null==K||null===(a=K.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:$,onChangeText:he,placeholder:te||"Message",style:k([n(Vt||(Vt=b(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(Et||(Et=b(["text-[17px]"]))):n(Mt||(Mt=b(["text-[16px]"]))),{minHeight:Ht,maxHeight:118,paddingVertical:ce?0:8,marginVertical:ce?(Gt-Ht)/2:4},{color:(null==K||null===(u=K.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==K?void 0:K.fontFamily),placeholderTextColor:(null==K||null===(c=K.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:H.isMultiline&&$.length>0?"top":"center",onContentSizeChange:pe},"chat-input-".concat(W)),e.jsxs(t.View,{style:[n(Rt||(Rt=b(["flex-row items-center gap-4"]))),fe],children:[Q&&e.jsx(t.Pressable,{onPress:P,children:E?e.jsx(E,{}):e.jsx(jt,{style:ae,color:(null==K||null===(d=K.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),J&&!$.trim()&&e.jsx(t.Pressable,{onPress:C,children:M?e.jsx(M,{}):e.jsx(gt,{style:ae,color:(null==K||null===(f=K.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[n(_t||(_t=b(["p-2 rounded-full bg-green-600 justify-center items-center"]))),v({height:Gt,width:Gt},null==K||null===(y=K.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:me?ve:O,onLongPress:O,onPressOut:A,children:me?R?e.jsx(R,{}):e.jsx(St,{style:n.style(Yt),color:(null==K||null===(h=K.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"}):ee?_?e.jsx(_,{}):e.jsx(wt,{style:n.style("h-8 w-8"),color:(null==K||null===(p=K.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):R?e.jsx(R,{}):e.jsx(St,{style:n.style(Yt),color:(null==K||null===(m=K.colors)||void 0===m?void 0:m.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Xt=r.memo(Kt);function Zt(t){var r=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.style("h-6 w-6 text-black",r),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 Qt,Jt,en,tn,nn,rn,on,ln,sn,an,un,cn,dn,fn,yn,hn=function(o){var i=o.gallery,l=o.onClose,s=I(),a=s.theme,u=s.setIsVideoPlaying,c=r.useRef(null),d=g(r.useState(0),2),f=d[0],y=d[1],h=t.useWindowDimensions(),p=h.width,v=h.height;r.useEffect((function(){null!=i&&i.items.length&&(y(i.initialIndex),requestAnimationFrame((function(){try{var e;null===(e=c.current)||void 0===e||e.scrollToIndex({index:i.initialIndex,animated:!1})}catch(e){}})))}),[null==i?void 0:i.initialIndex,null==i?void 0:i.items]);var m=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/p);y(t);var n=null==i?void 0:i.items[t];u("video"===(null==n?void 0:n.kind))}),[null==i?void 0:i.items,p,u]);return i&&0!==i.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:l,children:e.jsxs(t.View,{style:[n(zt||(zt=b(["flex-1 bg-black"]))),{width:p,height:v}],children:[e.jsx(t.Pressable,{onPress:l,style:n(Nt||(Nt=b(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Zt,{style:n(Lt||(Lt=b(["h-8 w-8"])))})}),i.items.length>1&&e.jsx(t.View,{style:n(Ft||(Ft=b(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:k(n($t||($t=b(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==a?void 0:a.fontFamily),children:[f+1," / ",i.items.length]})}),e.jsx(t.FlatList,{ref:c,data:i.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:i.initialIndex,getItemLayout:function(e,t){return{length:p,offset:p*t,index:t}},onMomentumScrollEnd:m,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=c.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item;return e.jsx(pn,{item:n,width:p,height:v})}})]})}):null},pn=function(o){var i=o.item,l=o.width,a=o.height,u=I().theme,c=r.useRef(null),d=g(r.useState("video"===i.kind),2),f=d[0],y=d[1],h=g(r.useState(!1),2),p=h[0],v=h[1];return"image"===i.kind?e.jsx(t.View,{style:{width:l,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:i.uri},style:{width:l,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:l,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(s,{source:{uri:i.uri},ref:c,controls:!0,shutterColor:"transparent",style:{width:l-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){y(!0),v(!1)},onLoad:function(){return y(!1)},onBuffer:function(e){var t=e.isBuffering;return y(t)},onError:function(){v(!0),y(!1)}}),f&&e.jsx(t.View,{style:n(Dt||(Dt=b(["absolute inset-0 items-center justify-center"]))),children:e.jsx(Q,{style:n.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(t.View,{style:n(qt||(qt=b(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:k(n(Wt||(Wt=b(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},vn=r.memo(hn),mn=function(r){var o,i,l,s,a=r.typingUsers,u=r.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,h=c.showBubbleTail,p=a.filter((function(e){return e.id!==u}));if(!p.length)return null;var m=p.slice(0,2),x=p.length-2;return e.jsxs(t.View,{style:n(Qt||(Qt=b(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:n(Jt||(Jt=b(["flex-row"]))),children:[m.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(en||(en=b(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:m.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(tn||(tn=b(["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:k([n(nn||(nn=b(["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=r.name)||void 0===s?void 0:s.charAt(0)})},r.id)})),x>0&&e.jsx(t.View,{style:[n(rn||(rn=b(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},v({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:k([n(on||(on=b(["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:["+",x]})})]}),h&&e.jsx(j,{style:n.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:[n(ln||(ln=b(["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:n(sn||(sn=b(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:k(n(an||(an=b(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var xn=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,y=o.onTypingEnd,h=o.onAttachmentPress,p=o.onAudioRecordEnd,v=o.onAudioRecordStart,m=o.onCameraPress,x=o.renderCustomInput,w=o.CustomEmojiIcon,j=o.CustomAttachmentIcon,S=o.CustomCameraIcon,P=o.CustomMicrophoneIcon,C=o.CustomSendIcon,O=o.CustomFileIcon,T=o.CustomImagePreview,k=o.CustomVideoPreview,A=o.keyboardVerticalOffset,V=void 0===A?0:A,E=o.disableKeyboardAvoiding,M=void 0!==E&&E,R=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=g(r.useState(0),2),o=n[0],i=n[1];return r.useEffect((function(){if(e){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(n,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!M),_=x?x():e.jsx(Xt,{onSendMessage:d,onTypingStart:f,onTypingEnd:y,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:v,onCameraPress:m,CustomEmojiIcon:w,CustomAttachmentIcon:j,CustomCameraIcon:S,CustomMicrophoneIcon:P,CustomSendIcon:C,CustomFileIcon:O,CustomImagePreview:T,CustomVideoPreview:k}),z=e.jsxs(t.View,{style:n(un||(un=b(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(cn||(cn=b(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(xt,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==s?void 0:s(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(mn,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&R>0?{marginBottom:R}:void 0,children:_}),e.jsx(vn,{gallery:a,onClose:u})]});return M?e.jsx(t.View,{style:n(dn||(dn=b(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(fn||(fn=b(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:n(yn||(yn=b(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:V,children:z})};module.exports=function(t){return e.jsx(Y,{children:e.jsx(C,v(v({},t),{},{children:e.jsx(xn,{})}))})};
14
+ */function Ae(){if(pe)return he;pe=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return he=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={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,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)}(r),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++)n.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},he}function ke(){if(me)return ve;me=1;return ve="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ve(){return ge?xe:(ge=1,xe=Function.call.bind(Object.prototype.hasOwnProperty))}function Ee(){if(we)return be;we=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=ke(),n={},r=Ve();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(r(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 n)){n[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&&(n={})},be=o}function Me(){if(Se)return je;Se=1;var e=Te(),t=Ae(),n=ke(),r=Ve(),o=Ee(),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){}}),je=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:h(l),arrayOf:function(e){return h((function(t,r,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new y("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+"]",n);if(u instanceof Error)return u}return null}))},element:h((function(e,t,n,r,o){var i=e[t];return s(i)?null:new y("Invalid "+r+" `"+o+"` of type `"+x(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:h((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return m(e[t])?null:new y("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((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=x(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(r(a,c)){var d=e(a,c,i,l,s+"."+c,n);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 h((function(t,n,r,o,i){for(var l=t[n],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, 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 "+b(o)+" at index "+t+"."),l}return h((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,n);if(null==c)return null;c.data&&r(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 h((function(t,r,o,i,l){var s=t[r],a=x(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 v(o,i,l,u,g(c));var d=c(s,u,o,i,l+"."+u,n);if(d)return d}return null}))},exact:function(e){return h((function(o,i,l,s,a){var u=o[i],c=x(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 h=e[f];if(r(e,f)&&"function"!=typeof h)return v(l,s,a,f,g(h));if(!h)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 p=h(u,f,l,s,a+"."+f,n);if(p)return p}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 h(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,s,u,d,f,h){if(u=u||c,f=f||s,h!==n){if(a){var p=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 p.name="Invariant Violation",p}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=u+":"+s;!t[v]&&r<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,r++)}}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 p(e){return h((function(t,n,r,o,i,l){var s=t[n];return x(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+g(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,n,r,o){return new y((e||"React class")+": "+t+" type `"+n+"."+r+"` 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 n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.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 g(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 b(e){var t=g(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},je}function Re(){if(Ce)return Pe;Ce=1;var e=ke();function t(){}function n(){}return n.resetWarningCache=t,Pe=function(){function r(t,n,r,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 r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function _e(){if(Ie)return ue.exports;if(Ie=1,"production"!==process.env.NODE_ENV){var e=Te();ue.exports=Me()(e.isElement,true)}else ue.exports=Re()();return ue.exports}var ze,Ne,Fe,Le,$e,De,qe,We=se(_e()),Be=function(){return d((function e(t,n){c(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.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)r.push(t);else{var o,s=[],a=t.children,u=0;for(n.pattern.lastIndex=0;a&&(o=n.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(n,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,n.pattern.lastIndex=0}s.push({children:a}),r.push.apply(r,s)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),v(v({},o),{},{children:i,_matched:!0})}}])}(),He=["type"],Ue=["style"],Ge=["parse","childrenProps"],Ye={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+/},Ke=We.shape(v(v({},t.Text.propTypes),{},{type:We.oneOf(Object.keys(Ye)).isRequired,nonExhaustiveMaxMatchCount:We.number})),Xe=We.shape(v(v({},t.Text.propTypes),{},{pattern:We.oneOfType([We.string,We.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:We.number})),Ze=function(){function n(){return c(this,n),u(this,n,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)}(n,r.Component),d(n,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=m(e,He);if(t){if(!Ye[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Ye[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Be(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=m(r,Ue);return e.jsx(t.Text,v(v({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=v({},this.props);r.parse,r.childrenProps;var o=m(r,Ge);return e.jsx(t.Text,v(v({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();Ze.displayName="ParsedText",Ze.propTypes=v(v({},t.Text.propTypes),{},{parse:We.arrayOf(We.oneOfType([Ke,Xe])),childrenProps:We.shape(t.Text.propTypes)}),Ze.defaultProps={parse:null,childrenProps:{}};var Qe,Je,et,tt,nt,rt,ot,it,lt,st,at,ut,ct,dt,ft,yt,ht,pt,vt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,y=I(),h=y.theme,p=y.showMessageStatus,m=y.onFileAttachmentPress,x=r.useMemo((function(){return O(u)}),[u]);return e.jsxs(t.View,{children:[x.length>0&&e.jsx(le,{items:x,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){return e.jsxs(t.Pressable,{onPress:function(){m?m(r):t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:n(ze||(ze=b(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[e.jsxs(t.Text,{style:A(n(Ne||(Ne=b(["text-xs font-semibold"]))),null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:n(Fe||(Fe=b(["text-[10px] opacity-70 mt-0.5"]))),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(t.View,{style:n(Le||(Le=b(["my-2"]))),children:e.jsx(Z,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d})}),u.text&&e.jsx(Ze,{style:A([n($e||($e=b(["pt-1"]))),n(p?De||(De=b(["pb-0"])):qe||(qe=b(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle],null==h?void 0:h.fontFamily),parse:[{type:"url",style:v({color:"blue",textDecorationLine:"underline"},(a=null==h?void 0:h.fontFamily,a?{fontFamily:a}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},mt=r.memo(vt),xt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},gt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,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:r})})},bt=function(r){var o,i,l,s,a=r.time,u=r.status,c=r.isCurrentUser,d=r.hasText,f=r.hasAudio,y=r.hasGalleryMedia,h=r.hasFileAttachments,p=I(),v=p.theme,m=p.showMessageStatus,x=(y||h)&&!d&&!f;return e.jsx(e.Fragment,{children:m&&e.jsxs(t.View,{style:[n(Qe||(Qe=b(["flex-row items-center"]))),n(d?Je||(Je=b(["justify-end pb-1 ml-4"])):f?et||(et=b(["absolute right-3 bottom-3"])):x?tt||(tt=b(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):nt||(nt=b(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:A([n(rt||(rt=b(["text-xs"]))),{color:d||f?(null==v||null===(o=v.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==v?void 0:v.fontFamily),children:a}),c&&e.jsxs(t.View,{style:n(ot||(ot=b(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(gt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==v||null===(i=v.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(xt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==v||null===(l=v.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(xt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==v||null===(s=v.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},wt=r.memo(bt),jt=function(r){var o,i,l,s,a,u,c,d,f,y,h=r.message,p=r.isCurrentUser,m=r.isFirstInSequence,x=r.onLongPress,g=I(),w=g.theme,S=g.showAvatars,P=g.showUserNames,C=g.showBubbleTail,T=g.setMediaViewerGallery,k=g.isVideoPlaying,V=O(h),E=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===V.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:x,style:[n(it||(it=b(["px-2 my-1 max-w-[75%] relative"]))),n(p?lt||(lt=b(["self-end mr-3"])):st||(st=b(["self-start ml-9"]))),n(m?p?at||(at=b(["bg-green-500 rounded-tr-none"])):ut||(ut=b(["bg-white rounded-tl-none"])):p?ct||(ct=b(["bg-green-500"])):dt||(dt=b(["bg-white"]))),v({borderRadius:8},p?null==w||null===(l=w.bubbleStyle)||void 0===l?void 0:l.sent:null==w||null===(s=w.bubbleStyle)||void 0===s?void 0:s.received)],children:[!p&&m&&S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(ft||(ft=b(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e.jsx(t.Image,{source:{uri:h.senderAvatar},style:[n(yt||(yt=b(["w-full h-full rounded-full"]))),null==w||null===(a=w.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:A([n(ht||(ht=b(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==w||null===(u=w.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==w?void 0:w.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),P&&h.senderName&&e.jsx(t.Text,{style:A([n(pt||(pt=b(["text-sm text-black font-semibold mt-1 capitalize"]))),null==w||null===(d=w.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==w?void 0:w.fontFamily),children:h.senderName})]}),m&&C&&e.jsx(j,{style:n.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==w||null===(f=w.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==w||null===(y=w.colors)||void 0===y?void 0:y.receivedMessageTailColor)||"white")}),e.jsx(mt,{message:h,isCurrentUser:p,isFirstInSequence:m,onGalleryOpen:function(e,t){T(e,t)},isVideoPlaying:k}),e.jsx(wt,{time:h.time,status:p?h.status:void 0,isCurrentUser:p,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:V.length>0&&!h.text,hasFileAttachments:E})]})},St=r.memo(jt),Pt=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Ct=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,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"})]})})},It=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Ot=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,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"})})},Tt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},At=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,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"})]})},kt=function(n){var r=n.fileName,o=n.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:A([{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 n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(r)})},Vt=r.memo(kt);function Et(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var Mt,Rt,_t,zt,Nt,Ft,Lt,$t,Dt,qt,Wt,Bt,Ht,Ut,Gt,Yt,Kt=function(n){var r,o=n.previews,i=n.closePreview,l=n.onRemoveItem,a=n.CustomFileIcon,u=n.CustomImagePreview,c=n.CustomVideoPreview,d=n.inputHeight,f=I(),y=f.theme,h=f.setMediaViewerGallery,p=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),v=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),m=Et(o);if(0===o.length)return null;var x=function(e){0!==m.length&&h(m,e)},g=function(n){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(r=n.type)||void 0===r?void 0:r.startsWith("image/"),a=null===(o=n.type)||void 0===o?void 0:o.startsWith("video/");return l&&u?e.jsx(u,{uri:n.uri}):a&&c?e.jsx(c,{uri:n.uri}):l?e.jsx(t.Image,{source:{uri:n.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):a?e.jsx(t.View,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e.jsx(s,{source:{uri:n.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):null},b=function(n,r){return e.jsx(t.Pressable,{onPress:function(){return l?l(n):null==i?void 0:i()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:r?[{rotate:r}]:void 0},children:e.jsx(t.Text,{style:A({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==y?void 0:y.fontFamily),children:"×"})})};return e.jsx(t.View,{style:[{position:"absolute",bottom:(null!=d?d:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==y||null===(r=y.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===p.length)return null;if(1===p.length){var n=p[0];return n?e.jsxs(t.Pressable,{onPress:function(){return x(0)},style:{position:"relative"},children:[g(n),b(n.uri)]}):null}var r=p.slice(0,3),o=p.length>3?p.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",s=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=Et(p).findIndex((function(e){return e.uri===n.uri}));x(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[g(n),2===i&&o>0&&e.jsx(t.View,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),b(n.uri,s)]})},"".concat(n.uri,"-").concat(i))}))})}(),v.length>0&&e.jsx(t.ScrollView,{scrollEnabled:v.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:v.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:v.map((function(n,r){return function(n,r){var o,i,l,s;return e.jsxs(t.View,{style:{position:"relative"},children:[e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==y||null===(o=y.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==y||null===(i=y.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:a?e.jsx(a,{}):e.jsx(At,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==y||null===(l=y.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(Vt,{fileName:n.name||"File",style:null==y||null===(s=y.filePreviewStyle)||void 0===s?void 0:s.text})})]}),b(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},Xt=r.memo(Kt),Zt="ios"===t.Platform.OS?32:30,Qt="ios"===t.Platform.OS?50:48,Jt="h-6 w-6",en=function(o){var i,l,s,a,u,c,d,f,y,h,p,m,x,w=o.onSendMessage,j=o.onTypingStart,S=o.onTypingEnd,P=o.onAttachmentPress,C=o.onCameraPress,O=o.onAudioRecordStart,k=o.onAudioRecordEnd,V=o.CustomEmojiIcon,E=o.CustomAttachmentIcon,M=o.CustomCameraIcon,R=o.CustomSendIcon,_=o.CustomMicrophoneIcon,z=o.CustomFileIcon,N=o.CustomImagePreview,F=o.CustomVideoPreview,L=g(r.useState(""),2),$=L[0],D=L[1],q=g(r.useState(0),2),W=q[0],B=q[1],H=g(r.useState({height:Zt,isMultiline:!1}),2),U=H[0],G=H[1],Y=I(),K=Y.theme,X=Y.currentUserId,Z=Y.showEmojiButton,Q=Y.showAttachmentsButton,J=Y.showCameraButton,ee=Y.showVoiceRecordButton,te=Y.placeholder,ne=Y.previewData,re=Y.previewItems,oe=Y.closePreview,ie=Y.onRemovePreviewItem,le=r.useMemo((function(){return null!=re&&re.length?re:ne?[ne]:[]}),[re,ne]),se=le.length>0,ae=null==K||null===(i=K.sizes)||void 0===i?void 0:i.inputIconSize,ue=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():T;return n.style(t)}(ae),ce="number"==typeof(x=ae)&&x>0?x:24,de=0===$.trim().length&&!U.isMultiline,fe=Math.max(0,(Qt-ce)/2),ye=de?{paddingTop:fe,paddingBottom:fe}:{paddingBottom:fe},he=r.useCallback((function(){G({height:Zt,isMultiline:!1}),B((function(e){return e+1}))}),[]),pe=r.useCallback((function(e){D(e),0===e.length&&he()}),[he]),ve=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Zt),118),n=t>Zt;G({height:n?t:Zt,isMultiline:n})}),[]),me=r.useCallback((function(){var e=$.trim();(e||se)&&(w({text:e,senderId:X}),D(""),he())}),[$,w,X,se,he]);r.useEffect((function(){$.trim()?null==j||j():null==S||S()}),[$,j,S]);var xe=!!$.trim()||se;return e.jsxs(t.View,{style:n(Mt||(Mt=b(["w-full px-2"]))),children:[se&&e.jsx(Xt,{previews:le,closePreview:oe,onRemoveItem:ie,CustomFileIcon:z,CustomImagePreview:N,CustomVideoPreview:F,inputHeight:U.height}),e.jsxs(t.View,{style:[n(Rt||(Rt=b(["flex-row items-end gap-2"]))),null==K||null===(l=K.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(_t||(_t=b(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Qt,borderRadius:de?9999:24,alignItems:de?"center":"flex-end"},null==K||null===(s=K.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Z&&e.jsx(t.View,{style:ye,children:e.jsx(t.Pressable,{children:V?e.jsx(V,{}):e.jsx(Ct,{style:ue,color:(null==K||null===(a=K.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:$,onChangeText:pe,placeholder:te||"Message",style:A([n(zt||(zt=b(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(Nt||(Nt=b(["text-[17px]"]))):n(Ft||(Ft=b(["text-[16px]"]))),{minHeight:Zt,maxHeight:118,paddingVertical:de?0:8,marginVertical:de?(Qt-Zt)/2:4},{color:(null==K||null===(u=K.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==K?void 0:K.fontFamily),placeholderTextColor:(null==K||null===(c=K.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:U.isMultiline&&$.length>0?"top":"center",onContentSizeChange:ve},"chat-input-".concat(W)),e.jsxs(t.View,{style:[n(Lt||(Lt=b(["flex-row items-center gap-4"]))),ye],children:[Q&&e.jsx(t.Pressable,{onPress:P,children:E?e.jsx(E,{}):e.jsx(Ot,{style:ue,color:(null==K||null===(d=K.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),J&&!$.trim()&&e.jsx(t.Pressable,{onPress:C,children:M?e.jsx(M,{}):e.jsx(Pt,{style:ue,color:(null==K||null===(f=K.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[n($t||($t=b(["p-2 rounded-full bg-green-600 justify-center items-center"]))),v({height:Qt,width:Qt},null==K||null===(y=K.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:xe?me:O,onLongPress:O,onPressOut:k,children:xe?R?e.jsx(R,{}):e.jsx(Tt,{style:n.style(Jt),color:(null==K||null===(h=K.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"}):ee?_?e.jsx(_,{}):e.jsx(It,{style:n.style("h-8 w-8"),color:(null==K||null===(p=K.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):R?e.jsx(R,{}):e.jsx(Tt,{style:n.style(Jt),color:(null==K||null===(m=K.colors)||void 0===m?void 0:m.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},tn=r.memo(en);function nn(t){var r=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.style("h-6 w-6 text-black",r),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 rn,on,ln,sn,an,un,cn,dn,fn,yn,hn,pn,vn,mn,xn,gn=function(o){var i=o.gallery,l=o.onClose,s=I(),a=s.theme,u=s.setIsVideoPlaying,c=r.useRef(null),d=g(r.useState(0),2),f=d[0],y=d[1],h=t.useWindowDimensions(),p=h.width,v=h.height;r.useEffect((function(){null!=i&&i.items.length&&(y(i.initialIndex),requestAnimationFrame((function(){try{var e;null===(e=c.current)||void 0===e||e.scrollToIndex({index:i.initialIndex,animated:!1})}catch(e){}})))}),[null==i?void 0:i.initialIndex,null==i?void 0:i.items]);var m=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/p);y(t);var n=null==i?void 0:i.items[t];u("video"===(null==n?void 0:n.kind))}),[null==i?void 0:i.items,p,u]);return i&&0!==i.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:l,children:e.jsxs(t.View,{style:[n(Dt||(Dt=b(["flex-1 bg-black"]))),{width:p,height:v}],children:[e.jsx(t.Pressable,{onPress:l,style:n(qt||(qt=b(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(nn,{style:n(Wt||(Wt=b(["h-8 w-8"])))})}),i.items.length>1&&e.jsx(t.View,{style:n(Bt||(Bt=b(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:A(n(Ht||(Ht=b(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==a?void 0:a.fontFamily),children:[f+1," / ",i.items.length]})}),e.jsx(t.FlatList,{ref:c,data:i.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:i.initialIndex,getItemLayout:function(e,t){return{length:p,offset:p*t,index:t}},onMomentumScrollEnd:m,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=c.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item;return e.jsx(bn,{item:n,width:p,height:v})}})]})}):null},bn=function(o){var i=o.item,l=o.width,a=o.height,u=I().theme,c=r.useRef(null),d=g(r.useState("video"===i.kind),2),f=d[0],y=d[1],h=g(r.useState(!1),2),p=h[0],v=h[1];return"image"===i.kind?e.jsx(t.View,{style:{width:l,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:i.uri},style:{width:l,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:l,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(s,{source:{uri:i.uri},ref:c,controls:!0,shutterColor:"transparent",style:{width:l-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){y(!0),v(!1)},onLoad:function(){return y(!1)},onBuffer:function(e){var t=e.isBuffering;return y(t)},onError:function(){v(!0),y(!1)}}),f&&e.jsx(t.View,{style:n(Ut||(Ut=b(["absolute inset-0 items-center justify-center"]))),children:e.jsx(Q,{style:n.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(t.View,{style:n(Gt||(Gt=b(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:A(n(Yt||(Yt=b(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},wn=r.memo(gn),jn=function(r){var o,i,l,s,a=r.typingUsers,u=r.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,h=c.showBubbleTail,p=a.filter((function(e){return e.id!==u}));if(!p.length)return null;var m=p.slice(0,2),x=p.length-2;return e.jsxs(t.View,{style:n(rn||(rn=b(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:n(on||(on=b(["flex-row"]))),children:[m.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(ln||(ln=b(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:m.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(sn||(sn=b(["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:A([n(an||(an=b(["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=r.name)||void 0===s?void 0:s.charAt(0)})},r.id)})),x>0&&e.jsx(t.View,{style:[n(un||(un=b(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},v({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:A([n(cn||(cn=b(["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:["+",x]})})]}),h&&e.jsx(j,{style:n.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:[n(dn||(dn=b(["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:n(fn||(fn=b(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:A(n(yn||(yn=b(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var Sn=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,y=o.onTypingEnd,h=o.onAttachmentPress,p=o.onAudioRecordEnd,v=o.onAudioRecordStart,m=o.onCameraPress,x=o.renderCustomInput,w=o.CustomEmojiIcon,j=o.CustomAttachmentIcon,S=o.CustomCameraIcon,P=o.CustomMicrophoneIcon,C=o.CustomSendIcon,O=o.CustomFileIcon,T=o.CustomImagePreview,A=o.CustomVideoPreview,k=o.keyboardVerticalOffset,V=void 0===k?0:k,E=o.disableKeyboardAvoiding,M=void 0!==E&&E,R=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=g(r.useState(0),2),o=n[0],i=n[1];return r.useEffect((function(){if(e){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(n,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!M),_=x?x():e.jsx(tn,{onSendMessage:d,onTypingStart:f,onTypingEnd:y,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:v,onCameraPress:m,CustomEmojiIcon:w,CustomAttachmentIcon:j,CustomCameraIcon:S,CustomMicrophoneIcon:P,CustomSendIcon:C,CustomFileIcon:O,CustomImagePreview:T,CustomVideoPreview:A}),z=e.jsxs(t.View,{style:n(hn||(hn=b(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(pn||(pn=b(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(St,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==s?void 0:s(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(jn,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&R>0?{marginBottom:R}:void 0,children:_}),e.jsx(wn,{gallery:a,onClose:u})]});return M?e.jsx(t.View,{style:n(vn||(vn=b(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(mn||(mn=b(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:n(xn||(xn=b(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:V,children:z})};module.exports=function(t){return e.jsx(Y,{children:e.jsx(C,v(v({},t),{},{children:e.jsx(Sn,{})}))})};
15
15
  //# sourceMappingURL=index.js.map