movius-chats 1.3.15 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +5 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/assets/Icons/ChevronUpIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/LockIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/TrashIcon.d.ts +5 -0
- package/lib/typescript/components/ChatInput/types.d.ts +2 -2
- package/lib/typescript/components/VoiceRecorder/LongPressRecording.d.ts +13 -0
- package/lib/typescript/components/VoiceRecorder/NormalRecording.d.ts +20 -0
- package/lib/typescript/components/VoiceRecorder/WaveformAnimation.d.ts +10 -0
- package/lib/typescript/hooks/useVoiceRecorder.d.ts +19 -0
- package/lib/typescript/types/index.d.ts +66 -1
- package/package.json +12 -2
- package/src/assets/Icons/ChevronUpIcon.tsx +20 -0
- package/src/assets/Icons/LockIcon.tsx +28 -0
- package/src/assets/Icons/TrashIcon.tsx +26 -0
- package/src/components/ChatBubble/MediaGrid.tsx +4 -1
- package/src/components/ChatInput/ChatInput.tsx +296 -62
- package/src/components/ChatInput/FilePreview.tsx +3 -0
- package/src/components/ChatInput/types.ts +2 -2
- package/src/components/MediaViewer/MediaViewer.tsx +45 -10
- package/src/components/VoiceRecorder/LongPressRecording.tsx +195 -0
- package/src/components/VoiceRecorder/NormalRecording.tsx +156 -0
- package/src/components/VoiceRecorder/WaveformAnimation.tsx +56 -0
- package/src/hooks/useVoiceRecorder.ts +206 -0
- package/src/types/index.ts +72 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
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-sound"),l=require("react-native-video");function s(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 a(e,t,n){return t=f(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,y()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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,b(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function h(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(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 m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function x(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 s(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)?s(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 g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(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 w=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"})})},j=["children"],S=r.createContext(void 0),P=function(t){var n=t.children,o=v(t,j),i=x(r.useState(null),2),l=i[0],s=i[1],a=x(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(S.Provider,{value:p(p({},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})},C=function(){var e=r.useContext(S);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function I(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 O="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function T(e,t){return t?[e,{fontFamily:t}]:e}var k,V,M,E,R=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"})})},A=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"})})},z=r.createContext(void 0),N=function(t){var n=t.children,o=x(r.useState(null),2),i=o[0],l=o[1];return e.jsx(z.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})};try{var _=require("react-native/Libraries/Image/resolveAssetSource");if("function"!=typeof _){var F=t.Image.resolveAssetSource.bind(t.Image);Object.keys(_).forEach((function(e){try{_[e]=F[e]}catch(e){}})),Object.defineProperty(_,"__esModule",{value:!1,configurable:!0}),global.__moviusRAS=F}}catch(e){}var L,$,W,q,B,D,U,H,G=function(o){var l,s,a,u,c,d,f,y,h,v,m,b,w=o.audioUrl,j=o.audioId,S=o.isVideoPlaying,P=o.isCurrentUser,I=C(),O=I.theme,N=I.CustomPlayIcon,_=I.CustomPauseIcon,F=function(){var e=r.useContext(z);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),L=F.currentlyPlayingId,$=F.setCurrentlyPlayingId,W=x(r.useState(null),2),q=W[0],B=W[1],D=x(r.useState(!1),2),U=D[0],H=D[1],G=x(r.useState(0),2),Y=G[0],Z=G[1],K=x(r.useState(0),2),J=K[0],Q=K[1],X=x(r.useState(!1),2),ee=X[0],te=X[1],ne=r.useRef(0),re=r.useRef(null),oe=r.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(w,34)}),[w]),ie=null!==(l=null==O||null===(s=O.colors)||void 0===s?void 0:s.audioWaveformColor)&&void 0!==l?l:P?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.20)",le=null!==(a=null==O||null===(u=O.colors)||void 0===u?void 0:u.audioWaveformActiveColor)&&void 0!==a?a:P?"rgba(255,255,255,0.95)":"rgba(0,0,0,0.60)",se=null!==(c=P?null==O||null===(d=O.colors)||void 0===d?void 0:d.sentAudioTimestampColor:null==O||null===(f=O.colors)||void 0===f?void 0:f.receivedAudioTimestampColor)&&void 0!==c?c:P?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.45)";r.useEffect((function(){var e=!0,t=null;try{t=new i(w,"",(function(n){!n&&e&&t&&Q(t.getDuration())})),B(t),re.current=t}catch(e){console.warn("[movius-chats] AudioPlayer: Could not initialize react-native-sound. Reinstall the package to apply the resolveAssetSource patch automatically.")}return function(){var n,r;e=!1,null===(n=t)||void 0===n||n.pause(),null===(r=t)||void 0===r||r.release(),re.current=null}}),[w]),r.useEffect((function(){L&&L!==j&&U&&q&&(q.pause(),H(!1),Z(0))}),[L,j,U,q]),r.useEffect((function(){S&&U&&q&&q.pause((function(){H(!1),$(null)}))}),[S]),r.useEffect((function(){var e;return U&&q&&!ee&&(e=setInterval((function(){q.getCurrentTime((function(e){"number"!=typeof e||isNaN(e)||Z(e)}))}),80)),function(){e&&clearInterval(e)}}),[U,q,ee,J]);var ae,ue,ce,de=function(e){var t,n=ne.current;if(!(n<=0||J<=0)){var r=Math.max(0,Math.min(e/n,1))*J;Z(r),null===(t=re.current)||void 0===t||t.setCurrentTime(r)}},fe=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){te(!0),de(e.nativeEvent.locationX)},onPanResponderMove:function(e){de(e.nativeEvent.locationX)},onPanResponderRelease:function(){te(!1)},onPanResponderTerminate:function(){te(!1)}}),ye=J>0?Y/J:0;return e.jsx(t.View,{style:n(k||(k=g(["rounded-lg w-60"]))),children:e.jsxs(t.View,{style:n(V||(V=g(["flex-row items-center gap-2 px-2 pt-2 pb-1"]))),children:[e.jsx(t.Pressable,{onPress:function(){q&&(U?q.pause((function(){H(!1),$(null)})):($(j),q.play((function(e){e&&(H(!1),Z(0),$(null))})),H(!0)))},style:[n(M||(M=g(["bg-black/35 rounded-full p-2 shrink-0"]))),null==O||null===(y=O.messageStyle)||void 0===y?void 0:y.audioPlayButtonStyle],children:U?_?e.jsx(_,{}):e.jsx(R,{style:n.style("h-5 w-5"),color:(null==O||null===(h=O.colors)||void 0===h?void 0:h.audioPauseIconColor)||"white"}):N?e.jsx(N,{}):e.jsx(A,{style:n.style("h-5 w-5"),color:(null==O||null===(v=O.colors)||void 0===v?void 0:v.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{style:{flex:1},children:[e.jsx(t.View,p(p({style:[{height:34,flexDirection:"row",alignItems:"flex-end"},null==O||null===(m=O.messageStyle)||void 0===m?void 0:m.progressBarStyle],onLayout:function(e){ne.current=e.nativeEvent.layout.width}},fe.panHandlers),{},{children:oe.map((function(n,r){var o,i=(r+.5)/34<=ye;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:1,height:Math.max(3,Math.round(34*n)),borderRadius:2,backgroundColor:i?le:ie},i?null==O||null===(o=O.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))})),e.jsx(t.Text,{style:T([n(E||(E=g(["text-[10px] mt-0.5"]))),{color:se},null==O||null===(b=O.messageStyle)||void 0===b?void 0:b.audioDurationStyle],null==O?void 0:O.fontFamily),children:isNaN(Y)?"0:00":(ae=Y,ue=Math.floor(ae/60),ce=Math.floor(ae%60),"".concat(ue,":").concat(ce<10?"0":"").concat(ce))})]})]})})},Y=r.memo(G),Z=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"})})})},K=320,J=K,Q=Math.round(176),X=K-Q-2,ee=Math.round(159),te=function(o){var i,s=o.uri,a=o.cellStyle,u=o.roundedStyle,c=C(),d=c.theme,f=c.CustomPlayIcon,y=r.useRef(null),h=x(r.useState(0),2),p=h[0],v=h[1],m=x(r.useState(!0),2),b=m[0],w=m[1],j=x(r.useState(!1),2),S=j[0],P=j[1];return e.jsxs(t.View,{style:[a,u],children:[e.jsx(l,{source:{uri:s},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)}}),b&&e.jsx(t.View,{style:[n(L||(L=g(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(Z,{style:n.style("h-8 w-8"),spinning:!0})}),!b&&!S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n($||($=g(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx(A,{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(W||(W=g(["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(q||(q=g(["text-white text-[10px] font-semibold"]))),children:ne(p)})})]}),S&&e.jsx(t.View,{style:[n(B||(B=g(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:T(n(D||(D=g(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ne(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 re=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(te,{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:J,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:J},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(te,{uri:n.uri,cellStyle:{width:c,height:J},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:K,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:Q},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(te,{uri:d.uri,cellStyle:{width:s,height:Q},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:X},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:X},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(te,{uri:f.uri,cellStyle:{width:h,height:X},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:X},children:"image"===y.kind?e.jsx(t.Image,{source:{uri:y.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(te,{uri:y.uri,cellStyle:{width:h,height:X},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:K,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:ee,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(te,{uri:r.uri,cellStyle:{width:p,height:ee},roundedStyle:a}),3===l&&v>0&&e.jsx(t.View,{style:n(U||(U=g(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(H||(H=g(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(r.uri,"-").concat(l))}))})};function oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie,le={exports:{}},se={exports:{}},ae={};var ue,ce,de,fe,ye,he,pe,ve,me,xe,ge,be,we,je,Se,Pe={};
|
|
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-sound"),s=require("react-native-video"),l=require("react-native-reanimated");function a(e,t){this.v=e,this.k=t}function u(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 c(e,t,n,r,o,i,s){try{var l=e[i](s),a=l.value}catch(e){return void n(e)}l.done?t(a):Promise.resolve(a).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){c(i,r,o,s,l,"next",e)}function l(e){c(i,r,o,s,l,"throw",e)}s(void 0)}))}}function f(e,t,n){return t=v(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,m()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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,T(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}function g(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 x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(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 w(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof l?r:l,u=Object.create(a.prototype);return S(u,"_invoke",function(n,r,o){var i,l,a,u=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,l=0,a=e,f.n=n,s}};function h(n,r){for(l=n,a=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],h=f.p,p=i[2];n>3?(o=p===r)&&(a=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(l=0,f.v=r,f.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,f.n=p,l=0))}if(o||n>1)return s;throw d=!0,r}return function(o,c,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,p),l=c,a=p;(t=l<2?e:a)||!d;){i||(l?l<3?(l>1&&(f.n=-1),h(l,a)):f.n=a:f.v=a);try{if(u=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=f.n<0)?a:n.call(r,f))!==s)break}catch(t){i=e,l=1,a=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var s={};function l(){}function a(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(S(t={},r,(function(){return this})),t),d=u.prototype=l.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,S(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return a.prototype=u,S(d,"constructor",u),S(u,"constructor",a),a.displayName="GeneratorFunction",S(u,o,"GeneratorFunction"),S(d),S(d,o,"Generator"),S(d,r,(function(){return this})),S(d,"toString",(function(){return"[object Generator]"})),(w=function(){return{w:i,m:f}})()}function j(e,t,n,r,o){var i=C(e,t,n,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function C(e,t,n,r,o){return new A(w().w(e,t,n,r),o||Promise)}function A(e,t){function n(r,o,i,s){try{var l=e[r](o),u=l.value;return u instanceof a?t.resolve(u.v).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(u).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}catch(e){s(e)}}var r;this.next||(S(A.prototype),S(A.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),S(this,"_invoke",(function(e,o,i){function s(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(s,s):s()}),!0)}function S(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}S=function(e,t,n,r){function i(t,n){S(e,t,(function(e){return this._invoke(t,n,e)}))}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},S(e,t,n,r)}function P(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function k(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function R(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,s,l=[],a=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function T(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+""}function E(){var e=w(),t=e.m(E),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,k(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(E=function(){return{wrap:function(t,n,r,o){return e.w(i(t),n,r,o&&o.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new a(e,t)},AsyncIterator:A,async:function(e,t,n,o,s){return(r(t)?C:j)(i(e),t,n,o,s)},keys:P,values:k}})()}var M=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"})})},V=["children"],_=r.createContext(void 0),L=function(t){var n=t.children,o=b(t,V),i=R(r.useState(null),2),s=i[0],l=i[1],a=R(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(_.Provider,{value:x(x({},o),{},{mediaViewerGallery:s,setMediaViewerGallery:function(e,t){l({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){l(null),c(!1)},isVideoPlaying:u,setIsVideoPlaying:c}),children:n})},F=function(){var e=r.useContext(_);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function z(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 N="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function D(e,t){return t?[e,{fontFamily:t}]:e}var B,W,$,q,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=R(r.useState(null),2),i=o[0],s=o[1];return e.jsx(G.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:s},children:n})},Q=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)};try{var K=require("react-native/Libraries/Image/resolveAssetSource");if("function"!=typeof K){var X=t.Image.resolveAssetSource.bind(t.Image);Object.keys(K).forEach((function(e){try{K[e]=X[e]}catch(e){}})),Object.defineProperty(K,"__esModule",{value:!1,configurable:!0}),global.__moviusRAS=X}}catch(e){}var Z,J,ee,te,ne,re,oe,ie,se=function(o){var s,l,a,u,c,d,f,h,p,y,v,m,g=o.audioUrl,b=o.audioId,w=o.isVideoPlaying,j=o.isCurrentUser,C=F(),A=C.theme,S=C.CustomPlayIcon,P=C.CustomPauseIcon,k=function(){var e=r.useContext(G);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),I=k.currentlyPlayingId,T=k.setCurrentlyPlayingId,E=R(r.useState(null),2),M=E[0],V=E[1],_=R(r.useState(!1),2),L=_[0],z=_[1],N=R(r.useState(0),2),Y=N[0],K=N[1],X=R(r.useState(0),2),Z=X[0],J=X[1],ee=R(r.useState(!1),2),te=ee[0],ne=ee[1],re=r.useRef(0),oe=r.useRef(null),ie=r.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(g,34)}),[g]),se=null!==(s=null==A||null===(l=A.colors)||void 0===l?void 0:l.audioWaveformColor)&&void 0!==s?s:j?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.20)",le=null!==(a=null==A||null===(u=A.colors)||void 0===u?void 0:u.audioWaveformActiveColor)&&void 0!==a?a:j?"rgba(255,255,255,0.95)":"rgba(0,0,0,0.60)",ae=null!==(c=j?null==A||null===(d=A.colors)||void 0===d?void 0:d.sentAudioTimestampColor:null==A||null===(f=A.colors)||void 0===f?void 0:f.receivedAudioTimestampColor)&&void 0!==c?c:j?"rgba(255,255,255,0.75)":"rgba(0,0,0,0.45)";r.useEffect((function(){var e=!0,t=null;try{t=new i(g,"",(function(n){!n&&e&&t&&J(t.getDuration())})),V(t),oe.current=t}catch(e){console.warn("[movius-chats] AudioPlayer: Could not initialize react-native-sound. Reinstall the package to apply the resolveAssetSource patch automatically.")}return function(){var n,r;e=!1,null===(n=t)||void 0===n||n.pause(),null===(r=t)||void 0===r||r.release(),oe.current=null}}),[g]),r.useEffect((function(){I&&I!==b&&L&&M&&(M.pause(),z(!1),K(0))}),[I,b,L,M]),r.useEffect((function(){w&&L&&M&&M.pause((function(){z(!1),T(null)}))}),[w]),r.useEffect((function(){var e;return L&&M&&!te&&(e=setInterval((function(){M.getCurrentTime((function(e){"number"!=typeof e||isNaN(e)||K(e)}))}),80)),function(){e&&clearInterval(e)}}),[L,M,te,Z]);var ue=function(e){var t,n=re.current;if(!(n<=0||Z<=0)){var r=Math.max(0,Math.min(e/n,1))*Z;K(r),null===(t=oe.current)||void 0===t||t.setCurrentTime(r)}},ce=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){ne(!0),ue(e.nativeEvent.locationX)},onPanResponderMove:function(e){ue(e.nativeEvent.locationX)},onPanResponderRelease:function(){ne(!1)},onPanResponderTerminate:function(){ne(!1)}}),de=Z>0?Y/Z:0;return e.jsx(t.View,{style:n(B||(B=O(["rounded-lg w-60"]))),children:e.jsxs(t.View,{style:n(W||(W=O(["flex-row items-center gap-2 px-2 pt-2 pb-1"]))),children:[e.jsx(t.Pressable,{onPress:function(){M&&(L?M.pause((function(){z(!1),T(null)})):(T(b),M.play((function(e){e&&(z(!1),K(0),T(null))})),z(!0)))},style:[n($||($=O(["bg-black/35 rounded-full p-2 shrink-0"]))),null==A||null===(h=A.messageStyle)||void 0===h?void 0:h.audioPlayButtonStyle],children:L?P?e.jsx(P,{}):e.jsx(U,{style:n.style("h-5 w-5"),color:(null==A||null===(p=A.colors)||void 0===p?void 0:p.audioPauseIconColor)||"white"}):S?e.jsx(S,{}):e.jsx(H,{style:n.style("h-5 w-5"),color:(null==A||null===(y=A.colors)||void 0===y?void 0:y.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{style:{flex:1},children:[e.jsx(t.View,x(x({style:[{height:34,flexDirection:"row",alignItems:"flex-end"},null==A||null===(v=A.messageStyle)||void 0===v?void 0:v.progressBarStyle],onLayout:function(e){re.current=e.nativeEvent.layout.width}},ce.panHandlers),{},{children:ie.map((function(n,r){var o,i=(r+.5)/34<=de;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:1,height:Math.max(3,Math.round(34*n)),borderRadius:2,backgroundColor:i?le:se},i?null==A||null===(o=A.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))})),e.jsx(t.Text,{style:D([n(q||(q=O(["text-[10px] mt-0.5"]))),{color:ae},null==A||null===(m=A.messageStyle)||void 0===m?void 0:m.audioDurationStyle],null==A?void 0:A.fontFamily),children:isNaN(Y)?"0:00":Q(Y)})]})]})})},le=r.memo(se),ae=function(n){var i=n.style,s=n.spinning,l=void 0!==s&&s,a=r.useRef(new t.Animated.Value(0)).current;r.useEffect((function(){l&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[l]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:l?{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"})})})},ue=320,ce=ue,de=Math.round(176),fe=ue-de-2,he=Math.round(159),pe=function(o){var i,l=o.uri,a=o.cellStyle,u=o.roundedStyle,c=F(),d=c.theme,f=c.CustomPlayIcon,h=r.useRef(null),p=R(r.useState(0),2),y=p[0],v=p[1],m=R(r.useState(!0),2),g=m[0],x=m[1],b=R(r.useState(!1),2),w=b[0],j=b[1];return e.jsxs(t.View,{style:[a,u],pointerEvents:"none",children:[e.jsx(s,{source:{uri:l},ref:h,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),j(!1)},onLoad:function(e){v(e.duration),x(!1)},onError:function(){j(!0),x(!1)}}),g&&e.jsx(t.View,{style:[n(Z||(Z=O(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(ae,{style:n.style("h-8 w-8"),spinning:!0})}),!g&&!w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(J||(J=O(["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(ee||(ee=O(["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(te||(te=O(["text-white text-[10px] font-semibold"]))),children:ye(y)})})]}),w&&e.jsx(t.View,{style:[n(ne||(ne=O(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:D(n(re||(re=O(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ye(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 ve=function(r){var o=r.items,i=r.onOpenGallery,s=t.useWindowDimensions().width,l=Math.min(240,.72*s);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:l,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(pe,{uri:u.uri,cellStyle:{width:l,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(l-2)/2;return e.jsx(t.View,{style:{width:l,height:ce,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:ce},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(pe,{uri:n.uri,cellStyle:{width:c,height:ce},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],h=o[2],p=(l-2)/2;return e.jsxs(t.View,{style:{width:l,height:ue,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:l,height:de},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(pe,{uri:d.uri,cellStyle:{width:l,height:de},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:fe},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:p,height:fe},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(pe,{uri:f.uri,cellStyle:{width:p,height:fe},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:p,height:fe},children:"image"===h.kind?e.jsx(t.Image,{source:{uri:h.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(pe,{uri:h.uri,cellStyle:{width:p,height:fe},roundedStyle:a})},"".concat(h.uri,"-2"))]})]})}var y=(l-2)/2,v=o.length-4,m=o.slice(0,4);return e.jsx(t.View,{style:{width:l,height:ue,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(r,s){return e.jsxs(t.Pressable,{onPress:function(){return i(o,s)},style:{width:y,height:he,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(pe,{uri:r.uri,cellStyle:{width:y,height:he},roundedStyle:a}),3===s&&v>0&&e.jsx(t.View,{style:n(oe||(oe=O(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(ie||(ie=O(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(r.uri,"-").concat(s))}))})};function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge,xe={exports:{}},be={exports:{}},we={};var je,Ce,Ae,Se,Pe,ke,Ie,Re,Oe,Te,Ee,Me,Ve,_e,Le,Fe={};
|
|
2
4
|
/** @license React v16.13.1
|
|
3
5
|
* react-is.development.js
|
|
4
6
|
*
|
|
@@ -6,10 +8,10 @@
|
|
|
6
8
|
*
|
|
7
9
|
* This source code is licensed under the MIT license found in the
|
|
8
10
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/function
|
|
11
|
+
*/function ze(){return Ce||(Ce=1,"production"===process.env.NODE_ENV?be.exports=function(){if(ge)return we;ge=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,s=e?Symbol.for("react.provider"):60109,l=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,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case c:case p:case h:case s:return e;default:return f}}case n:return f}}}function b(e){return x(e)===u}return we.AsyncMode=a,we.ConcurrentMode=u,we.ContextConsumer=l,we.ContextProvider=s,we.Element=t,we.ForwardRef=c,we.Fragment=r,we.Lazy=p,we.Memo=h,we.Portal=n,we.Profiler=i,we.StrictMode=o,we.Suspense=d,we.isAsyncMode=function(e){return b(e)||x(e)===a},we.isConcurrentMode=b,we.isContextConsumer=function(e){return x(e)===l},we.isContextProvider=function(e){return x(e)===s},we.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},we.isForwardRef=function(e){return x(e)===c},we.isFragment=function(e){return x(e)===r},we.isLazy=function(e){return x(e)===p},we.isMemo=function(e){return x(e)===h},we.isPortal=function(e){return x(e)===n},we.isProfiler=function(e){return x(e)===i},we.isStrictMode=function(e){return x(e)===o},we.isSuspense=function(e){return x(e)===d},we.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===p||e.$$typeof===h||e.$$typeof===s||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===y)},we.typeOf=x,we}():be.exports=(je||(je=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,s=e?Symbol.for("react.provider"):60109,l=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,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var y=e.type;switch(y){case a:case u:case r:case i:case o:case d:return y;default:var v=y&&y.$$typeof;switch(v){case l:case c:case p:case h:case s:return v;default:return f}}case n:return f}}}var b=a,w=u,j=l,C=s,A=t,S=c,P=r,k=p,I=h,R=n,O=i,T=o,E=d,M=!1;function V(e){return x(e)===u}Fe.AsyncMode=b,Fe.ConcurrentMode=w,Fe.ContextConsumer=j,Fe.ContextProvider=C,Fe.Element=A,Fe.ForwardRef=S,Fe.Fragment=P,Fe.Lazy=k,Fe.Memo=I,Fe.Portal=R,Fe.Profiler=O,Fe.StrictMode=T,Fe.Suspense=E,Fe.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.")),V(e)||x(e)===a},Fe.isConcurrentMode=V,Fe.isContextConsumer=function(e){return x(e)===l},Fe.isContextProvider=function(e){return x(e)===s},Fe.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Fe.isForwardRef=function(e){return x(e)===c},Fe.isFragment=function(e){return x(e)===r},Fe.isLazy=function(e){return x(e)===p},Fe.isMemo=function(e){return x(e)===h},Fe.isPortal=function(e){return x(e)===n},Fe.isProfiler=function(e){return x(e)===i},Fe.isStrictMode=function(e){return x(e)===o},Fe.isSuspense=function(e){return x(e)===d},Fe.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===p||e.$$typeof===h||e.$$typeof===s||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===g||e.$$typeof===y)},Fe.typeOf=x}()),Fe)),be.exports}
|
|
10
12
|
/*
|
|
11
13
|
object-assign
|
|
12
14
|
(c) Sindre Sorhus
|
|
13
15
|
@license MIT
|
|
14
|
-
*/function Ie(){if(fe)return de;fe=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return de=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},de}function Oe(){if(he)return ye;he=1;return ye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Te(){return ve?pe:(ve=1,pe=Function.call.bind(Object.prototype.hasOwnProperty))}function ke(){if(xe)return me;xe=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Oe(),n={},r=Te();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={})},me=o}function Ve(){if(be)return ge;be=1;var e=Ce(),t=Ie(),n=Oe(),r=Te(),o=ke(),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){}}),ge=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},ge}function Me(){if(je)return we;je=1;var e=Oe();function t(){}function n(){}return n.resetWarningCache=t,we=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 Ee(){if(Se)return le.exports;if(Se=1,"production"!==process.env.NODE_ENV){var e=Ce();le.exports=Ve()(e.isElement,true)}else le.exports=Me()();return le.exports}var Re,Ae,ze,Ne,_e,Fe,Le,$e=oe(Ee()),We=function(){return c((function e(t,n){u(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)),p(p({},o),{},{children:i,_matched:!0})}}])}(),qe=["type"],Be=["style"],De=["parse","childrenProps"],Ue={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},He=$e.shape(p(p({},t.Text.propTypes),{},{type:$e.oneOf(Object.keys(Ue)).isRequired,nonExhaustiveMaxMatchCount:$e.number})),Ge=$e.shape(p(p({},t.Text.propTypes),{},{pattern:$e.oneOfType([$e.string,$e.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:$e.number})),Ye=function(){function n(){return u(this,n),a(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&&m(e,t)}(n,r.Component),c(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=v(e,qe);if(t){if(!Ue[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Ue[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new We(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=v(r,Be);return e.jsx(t.Text,p(p({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=p({},this.props);r.parse,r.childrenProps;var o=v(r,De);return e.jsx(t.Text,p(p({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();Ye.displayName="ParsedText",Ye.propTypes=p(p({},t.Text.propTypes),{},{parse:$e.arrayOf($e.oneOfType([He,Ge])),childrenProps:$e.shape(t.Text.propTypes)}),Ye.defaultProps={parse:null,childrenProps:{}};var Ze,Ke,Je,Qe,Xe,et,tt,nt,rt,ot,it,lt,st,at,ut,ct,dt,ft,yt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,y=C(),h=y.theme,v=y.showMessageStatus,m=y.onFileAttachmentPress,x=r.useMemo((function(){return I(u)}),[u]);return e.jsxs(t.View,{children:[x.length>0&&e.jsx(re,{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(Re||(Re=g(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[e.jsxs(t.Text,{style:T(n(Ae||(Ae=g(["text-xs font-semibold"]))),null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:n(ze||(ze=g(["text-[10px] opacity-70 mt-0.5"]))),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(t.View,{style:n(Ne||(Ne=g(["my-2"]))),children:e.jsx(Y,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d,isCurrentUser:f})}),u.text&&e.jsx(Ye,{style:T([n(_e||(_e=g(["pt-1"]))),n(v?Fe||(Fe=g(["pb-0"])):Le||(Le=g(["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:p({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})]})},ht=r.memo(yt),pt=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"})})},vt=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})})},mt=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=C(),v=p.theme,m=p.showMessageStatus,x=(y||h)&&!d&&!f;return e.jsx(e.Fragment,{children:m&&e.jsxs(t.View,{style:[n(Ze||(Ze=g(["flex-row items-center"]))),n(d?Ke||(Ke=g(["justify-end pb-1 ml-4"])):f?Je||(Je=g(["absolute right-3 bottom-3"])):x?Qe||(Qe=g(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):Xe||(Xe=g(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:T([n(et||(et=g(["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(tt||(tt=g(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(vt,{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(pt,{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(pt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==v||null===(s=v.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},xt=r.memo(mt),gt=function(r){var o,i,l,s,a,u,c,d,f,y,h=r.message,v=r.isCurrentUser,m=r.isFirstInSequence,x=r.onLongPress,b=C(),j=b.theme,S=b.showAvatars,P=b.showUserNames,O=b.showBubbleTail,k=b.setMediaViewerGallery,V=b.isVideoPlaying,M=I(h),E=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===M.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:x,style:[n(nt||(nt=g(["px-2 my-1 max-w-[75%] relative"]))),n(v?rt||(rt=g(["self-end mr-3"])):ot||(ot=g(["self-start ml-9"]))),n(m?v?it||(it=g(["bg-green-500 rounded-tr-none"])):lt||(lt=g(["bg-white rounded-tl-none"])):v?st||(st=g(["bg-green-500"])):at||(at=g(["bg-white"]))),p({borderRadius:8},v?null==j||null===(l=j.bubbleStyle)||void 0===l?void 0:l.sent:null==j||null===(s=j.bubbleStyle)||void 0===s?void 0:s.received)],children:[!v&&m&&S&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(ut||(ut=g(["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(ct||(ct=g(["w-full h-full rounded-full"]))),null==j||null===(a=j.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:T([n(dt||(dt=g(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==j||null===(u=j.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==j?void 0:j.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),P&&h.senderName&&e.jsx(t.Text,{style:T([n(ft||(ft=g(["text-sm text-black font-semibold mt-1 capitalize"]))),null==j||null===(d=j.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==j?void 0:j.fontFamily),children:h.senderName})]}),m&&O&&e.jsx(w,{style:n.style("absolute -top-1 w-6 h-6 ",v?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:v?"90deg":"180deg"}]}),color:"".concat(v?(null==j||null===(f=j.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==j||null===(y=j.colors)||void 0===y?void 0:y.receivedMessageTailColor)||"white")}),e.jsx(ht,{message:h,isCurrentUser:v,isFirstInSequence:m,onGalleryOpen:function(e,t){k(e,t)},isVideoPlaying:V}),e.jsx(xt,{time:h.time,status:v?h.status:void 0,isCurrentUser:v,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:M.length>0&&!h.text,hasFileAttachments:E})]})},bt=r.memo(gt),wt=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"})]})})},jt=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"})]})})},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:"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"})]})})},Pt=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"})})},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",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"})]})})},It=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"})]})},Ot=function(n){var r=n.fileName,o=n.style,i=C().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:T([{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)})},Tt=r.memo(Ot);function kt(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 Vt,Mt,Et,Rt,At,zt,Nt,_t,Ft,Lt,$t,Wt,qt,Bt,Dt,Ut,Ht=function(n){var r,o=n.previews,i=n.closePreview,s=n.onRemoveItem,a=n.CustomFileIcon,u=n.CustomImagePreview,c=n.CustomVideoPreview,d=n.inputHeight,f=C(),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=kt(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,s=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 s&&u?e.jsx(u,{uri:n.uri}):a&&c?e.jsx(c,{uri:n.uri}):s?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(l,{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 s?s(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:T({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=kt(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(It,{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(Tt,{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)}))})]})})},Gt=r.memo(Ht),Yt="ios"===t.Platform.OS?32:30,Zt="ios"===t.Platform.OS?50:48,Kt="h-6 w-6",Jt=function(o){var i,l,s,a,u,c,d,f,y,h,v,m,b,w=o.onSendMessage,j=o.onTypingStart,S=o.onTypingEnd,P=o.onAttachmentPress,I=o.onCameraPress,k=o.onAudioRecordStart,V=o.onAudioRecordEnd,M=o.CustomEmojiIcon,E=o.CustomAttachmentIcon,R=o.CustomCameraIcon,A=o.CustomSendIcon,z=o.CustomMicrophoneIcon,N=o.CustomFileIcon,_=o.CustomImagePreview,F=o.CustomVideoPreview,L=x(r.useState(""),2),$=L[0],W=L[1],q=x(r.useState(0),2),B=q[0],D=q[1],U=x(r.useState({height:Yt,isMultiline:!1}),2),H=U[0],G=U[1],Y=C(),Z=Y.theme,K=Y.currentUserId,J=Y.showEmojiButton,Q=Y.showAttachmentsButton,X=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==Z||null===(i=Z.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():O;return n.style(t)}(ae),ce="number"==typeof(b=ae)&&b>0?b:24,de=0===$.trim().length&&!H.isMultiline,fe=Math.max(0,(Zt-ce)/2),ye=de?{paddingTop:fe,paddingBottom:fe}:{paddingBottom:fe},he=r.useCallback((function(){G({height:Yt,isMultiline:!1}),D((function(e){return e+1}))}),[]),pe=r.useCallback((function(e){W(e),0===e.length&&he()}),[he]),ve=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Yt),118),n=t>Yt;G({height:n?t:Yt,isMultiline:n})}),[]),me=r.useCallback((function(){var e=$.trim();(e||se)&&(w({text:e,senderId:K}),W(""),he())}),[$,w,K,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(Vt||(Vt=g(["w-full px-2"]))),children:[se&&e.jsx(Gt,{previews:le,closePreview:oe,onRemoveItem:ie,CustomFileIcon:N,CustomImagePreview:_,CustomVideoPreview:F,inputHeight:H.height}),e.jsxs(t.View,{style:[n(Mt||(Mt=g(["flex-row items-end gap-2"]))),null==Z||null===(l=Z.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(Et||(Et=g(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Zt,borderRadius:de?9999:24,alignItems:de?"center":"flex-end"},null==Z||null===(s=Z.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[J&&e.jsx(t.View,{style:ye,children:e.jsx(t.Pressable,{children:M?e.jsx(M,{}):e.jsx(jt,{style:ue,color:(null==Z||null===(a=Z.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:T([n(Rt||(Rt=g(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(At||(At=g(["text-[17px]"]))):n(zt||(zt=g(["text-[16px]"]))),{minHeight:Yt,maxHeight:118,paddingVertical:de?0:8,marginVertical:de?(Zt-Yt)/2:4},{color:(null==Z||null===(u=Z.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==Z?void 0:Z.fontFamily),placeholderTextColor:(null==Z||null===(c=Z.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:H.isMultiline&&$.length>0?"top":"center",onContentSizeChange:ve},"chat-input-".concat(B)),e.jsxs(t.View,{style:[n(Nt||(Nt=g(["flex-row items-center gap-4"]))),ye],children:[Q&&e.jsx(t.Pressable,{onPress:P,children:E?e.jsx(E,{}):e.jsx(Pt,{style:ue,color:(null==Z||null===(d=Z.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),X&&!$.trim()&&e.jsx(t.Pressable,{onPress:I,children:R?e.jsx(R,{}):e.jsx(wt,{style:ue,color:(null==Z||null===(f=Z.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[n(_t||(_t=g(["p-2 rounded-full bg-green-600 justify-center items-center"]))),p({height:Zt,width:Zt},null==Z||null===(y=Z.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:xe?me:k,onLongPress:k,onPressOut:V,children:xe?A?e.jsx(A,{}):e.jsx(Ct,{style:n.style(Kt),color:(null==Z||null===(h=Z.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"}):ee?z?e.jsx(z,{}):e.jsx(St,{style:n.style("h-8 w-8"),color:(null==Z||null===(v=Z.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):A?e.jsx(A,{}):e.jsx(Ct,{style:n.style(Kt),color:(null==Z||null===(m=Z.colors)||void 0===m?void 0:m.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Qt=r.memo(Jt);function Xt(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 en,tn,nn,rn,on,ln,sn,an,un,cn,dn,fn,yn,hn,pn,vn=function(o){var i=o.gallery,l=o.onClose,s=C(),a=s.theme,u=s.setIsVideoPlaying,c=r.useRef(null),d=x(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(Ft||(Ft=g(["flex-1 bg-black"]))),{width:p,height:v}],children:[e.jsx(t.Pressable,{onPress:l,style:n(Lt||(Lt=g(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Xt,{style:n($t||($t=g(["h-8 w-8"])))})}),i.items.length>1&&e.jsx(t.View,{style:n(Wt||(Wt=g(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:T(n(qt||(qt=g(["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(mn,{item:n,width:p,height:v})}})]})}):null},mn=function(o){var i=o.item,s=o.width,a=o.height,u=C().theme,c=r.useRef(null),d=x(r.useState("video"===i.kind),2),f=d[0],y=d[1],h=x(r.useState(!1),2),p=h[0],v=h[1];return"image"===i.kind?e.jsx(t.View,{style:{width:s,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:i.uri},style:{width:s,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:s,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(l,{source:{uri:i.uri},ref:c,controls:!0,shutterColor:"transparent",style:{width:s-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(Bt||(Bt=g(["absolute inset-0 items-center justify-center"]))),children:e.jsx(Z,{style:n.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(t.View,{style:n(Dt||(Dt=g(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:T(n(Ut||(Ut=g(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},xn=r.memo(vn),gn=function(r){var o,i,l,s,a=r.typingUsers,u=r.currentUserId,c=C(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,h=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var m=v.slice(0,2),x=v.length-2;return e.jsxs(t.View,{style:n(en||(en=g(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:n(tn||(tn=g(["flex-row"]))),children:[m.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(nn||(nn=g(["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(rn||(rn=g(["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:T([n(on||(on=g(["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(ln||(ln=g(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},p({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:T([n(sn||(sn=g(["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(w,{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(an||(an=g(["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(un||(un=g(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:T(n(cn||(cn=g(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var bn=function(){var o=C(),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,b=o.renderCustomInput,w=o.CustomEmojiIcon,j=o.CustomAttachmentIcon,S=o.CustomCameraIcon,P=o.CustomMicrophoneIcon,I=o.CustomSendIcon,O=o.CustomFileIcon,T=o.CustomImagePreview,k=o.CustomVideoPreview,V=o.keyboardVerticalOffset,M=void 0===V?0:V,E=o.disableKeyboardAvoiding,R=void 0!==E&&E,A=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=x(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}(!R),z=b?b():e.jsx(Qt,{onSendMessage:d,onTypingStart:f,onTypingEnd:y,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:v,onCameraPress:m,CustomEmojiIcon:w,CustomAttachmentIcon:j,CustomCameraIcon:S,CustomMicrophoneIcon:P,CustomSendIcon:I,CustomFileIcon:O,CustomImagePreview:T,CustomVideoPreview:k}),N=e.jsxs(t.View,{style:n(dn||(dn=g(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(fn||(fn=g(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(bt,{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(gn,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!R&&A>0?{marginBottom:A}:void 0,children:z}),e.jsx(xn,{gallery:a,onClose:u})]});return R?e.jsx(t.View,{style:n(yn||(yn=g(["flex-1"]))),children:N}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(hn||(hn=g(["flex-1"]))),children:N}):e.jsx(t.KeyboardAvoidingView,{style:n(pn||(pn=g(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:M,children:N})};module.exports=function(t){return e.jsx(N,{children:e.jsx(P,p(p({},t),{},{children:e.jsx(bn,{})}))})};
|
|
16
|
+
*/function Ne(){if(Se)return Ae;Se=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Ae=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,s,l=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)&&(l[u]=i[u]);if(e){s=e(i);for(var c=0;c<s.length;c++)n.call(i,s[c])&&(l[s[c]]=i[s[c]])}}return l},Ae}function De(){if(ke)return Pe;ke=1;return Pe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Be(){return Re?Ie:(Re=1,Ie=Function.call.bind(Object.prototype.hasOwnProperty))}function We(){if(Te)return Oe;Te=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=De(),n={},r=Be();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,s,l,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((l||"React class")+": "+s+" 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,l,s,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((l||"React class")+": type specification of "+s+" `"+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 "+s+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},Oe=o}function $e(){if(Me)return Ee;Me=1;var e=ze(),t=Ne(),n=De(),r=Be(),o=We(),i=function(){};function s(){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){}}),Ee=function(l,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:p(s),arrayOf:function(e){return p((function(t,r,o,i,s){if("function"!=typeof e)return new h("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new h("Invalid "+i+" `"+s+"` of type `"+g(l)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<l.length;a++){var u=e(l,a,o,i,s+"["+a+"]",n);if(u instanceof Error)return u}return null}))},element:p((function(e,t,n,r,o){var i=e[t];return l(i)?null:new h("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:p((function(t,n,r,o,i){var s=t[n];return e.isValidElementType(s)?null:new h("Invalid "+o+" `"+i+"` of type `"+g(s)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||c;return new h("Invalid "+o+" `"+i+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+s+"`.")}var l;return null}))},node:p((function(e,t,n,r,o){return m(e[t])?null:new h("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,s,l){if("function"!=typeof e)return new h("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=g(a);if("object"!==u)return new h("Invalid "+s+" `"+l+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(r(a,c)){var d=e(a,c,i,s,l+"."+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."),s;return p((function(t,n,r,o,i){for(var s=t[n],l=0;l<e.length;l++)if(f(s,e[l]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new h("Invalid "+o+" `"+i+"` of value `"+String(s)+"` 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."),s;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+"."),s}return p((function(t,o,i,s,l){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,s,l,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&a.push(c.data.expectedType)}return new h("Invalid "+s+" `"+l+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,r,o,i,s){var l=t[r],a=g(l);if("object"!==a)return new h("Invalid "+i+" `"+s+"` 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,s,u,x(c));var d=c(l,u,o,i,s+"."+u,n);if(d)return d}return null}))},exact:function(e){return p((function(o,i,s,l,a){var u=o[i],c=g(u);if("object"!==c)return new h("Invalid "+l+" `"+a+"` of type `"+c+"` supplied to `"+s+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(r(e,f)&&"function"!=typeof p)return v(s,l,a,f,x(p));if(!p)return new h("Invalid "+l+" `"+a+"` key `"+f+"` supplied to `"+s+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=p(u,f,s,l,a+"."+f,n);if(y)return y}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,s,l,u,d,f,p){if(u=u||c,f=f||l,p!==n){if(a){var y=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 y.name="Invariant Violation",y}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=u+":"+l;!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==s[l]?o?null===s[l]?new h("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new h("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(s,l,u,d,f)}var s=o.bind(null,!1);return s.isRequired=o.bind(null,!0),s}function y(e){return p((function(t,n,r,o,i,s){var l=t[n];return g(l)!==e?new h("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,n,r,o){return new h((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||l(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 g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},Ee}function qe(){if(_e)return Ve;_e=1;var e=De();function t(){}function n(){}return n.resetWarningCache=t,Ve=function(){function r(t,n,r,o,i,s){if(s!==e){var l=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 l.name="Invariant Violation",l}}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 Ue(){if(Le)return xe.exports;if(Le=1,"production"!==process.env.NODE_ENV){var e=ze();xe.exports=$e()(e.isElement,true)}else xe.exports=qe()();return xe.exports}var He,Ge,Ye,Qe,Ke,Xe,Ze,Je=me(Ue()),et=function(){return p((function e(t,n){h(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),s=0;t.forEach((function(t){if(t._matched)r.push(t);else{var o,l=[],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,++s>i)break;l.push({children:c}),l.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}l.push({children:a}),r.push.apply(r,l)}})),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)),x(x({},o),{},{children:i,_matched:!0})}}])}(),tt=["type"],nt=["style"],rt=["parse","childrenProps"],ot={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+/},it=Je.shape(x(x({},t.Text.propTypes),{},{type:Je.oneOf(Object.keys(ot)).isRequired,nonExhaustiveMaxMatchCount:Je.number})),st=Je.shape(x(x({},t.Text.propTypes),{},{pattern:Je.oneOfType([Je.string,Je.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Je.number})),lt=function(){function n(){return h(this,n),f(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&&I(e,t)}(n,r.Component),p(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=b(e,tt);if(t){if(!ot[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=ot[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new et(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,s=r.style,l=b(r,nt);return e.jsx(t.Text,x(x({style:[i,s]},n.props.childrenProps),l),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=x({},this.props);r.parse,r.childrenProps;var o=b(r,rt);return e.jsx(t.Text,x(x({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();lt.displayName="ParsedText",lt.propTypes=x(x({},t.Text.propTypes),{},{parse:Je.arrayOf(Je.oneOfType([it,st])),childrenProps:Je.shape(t.Text.propTypes)}),lt.defaultProps={parse:null,childrenProps:{}};var at,ut,ct,dt,ft,ht,pt,yt,vt,mt,gt,xt,bt,wt,jt,Ct,At,St,Pt=function(o){var i,s,l,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,h=F(),p=h.theme,y=h.showMessageStatus,v=h.onFileAttachmentPress,m=r.useMemo((function(){return z(u)}),[u]);return e.jsxs(t.View,{children:[m.length>0&&e.jsx(ve,{items:m,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){return e.jsxs(t.Pressable,{onPress:function(){v?v(r):t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:n(He||(He=O(["my-1.5 py-2 px-3 rounded-lg bg-black/10 max-w-[220px]"]))),children:[e.jsxs(t.Text,{style:D(n(Ge||(Ge=O(["text-xs font-semibold"]))),null==p?void 0:p.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:n(Ye||(Ye=O(["text-[10px] opacity-70 mt-0.5"]))),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(t.View,{style:n(Qe||(Qe=O(["my-2"]))),children:e.jsx(le,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d,isCurrentUser:f})}),u.text&&e.jsx(lt,{style:D([n(Ke||(Ke=O(["pt-1"]))),n(y?Xe||(Xe=O(["pb-0"])):Ze||(Ze=O(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==p||null===(s=p.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==p||null===(l=p.messageStyle)||void 0===l?void 0:l.receivedTextStyle],null==p?void 0:p.fontFamily),parse:[{type:"url",style:x({color:"blue",textDecorationLine:"underline"},(a=null==p?void 0:p.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})]})},kt=r.memo(Pt),It=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"})})},Rt=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})})},Ot=function(r){var o,i,s,l,a=r.time,u=r.status,c=r.isCurrentUser,d=r.hasText,f=r.hasAudio,h=r.hasGalleryMedia,p=r.hasFileAttachments,y=F(),v=y.theme,m=y.showMessageStatus,g=(h||p)&&!d&&!f;return e.jsx(e.Fragment,{children:m&&e.jsxs(t.View,{style:[n(at||(at=O(["flex-row items-center"]))),n(d?ut||(ut=O(["justify-end pb-1 ml-4"])):f?ct||(ct=O(["absolute right-3 bottom-3"])):g?dt||(dt=O(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])):ft||(ft=O(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:D([n(ht||(ht=O(["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(pt||(pt=O(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(Rt,{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(It,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==v||null===(s=v.colors)||void 0===s?void 0:s.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(It,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==v||null===(l=v.colors)||void 0===l?void 0:l.readIconColor)||"#3B82F6"})]})]})})},Tt=r.memo(Ot),Et=function(r){var o,i,s,l,a,u,c,d,f,h,p=r.message,y=r.isCurrentUser,v=r.isFirstInSequence,m=r.onLongPress,g=F(),b=g.theme,w=g.showAvatars,j=g.showUserNames,C=g.showBubbleTail,A=g.setMediaViewerGallery,S=g.isVideoPlaying,P=z(p),k=(null!==(o=null===(i=p.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===P.length&&!p.text&&!p.audio;return e.jsxs(t.Pressable,{onLongPress:m,style:[n(yt||(yt=O(["px-2 my-1 max-w-[75%] relative"]))),n(y?vt||(vt=O(["self-end mr-3"])):mt||(mt=O(["self-start ml-9"]))),n(v?y?gt||(gt=O(["bg-green-500 rounded-tr-none"])):xt||(xt=O(["bg-white rounded-tl-none"])):y?bt||(bt=O(["bg-green-500"])):wt||(wt=O(["bg-white"]))),x({borderRadius:8},y?null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.sent:null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.received)],children:[!y&&v&&w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(jt||(jt=O(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:p.senderAvatar?e.jsx(t.Image,{source:{uri:p.senderAvatar},style:[n(Ct||(Ct=O(["w-full h-full rounded-full"]))),null==b||null===(a=b.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:D([n(At||(At=O(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(c=p.senderName)||void 0===c?void 0:c.charAt(0)})}),j&&p.senderName&&e.jsx(t.Text,{style:D([n(St||(St=O(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(d=b.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==b?void 0:b.fontFamily),children:p.senderName})]}),v&&C&&e.jsx(M,{style:n.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(f=b.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(h=b.colors)||void 0===h?void 0:h.receivedMessageTailColor)||"white")}),e.jsx(kt,{message:p,isCurrentUser:y,isFirstInSequence:v,onGalleryOpen:function(e,t){A(e,t)},isVideoPlaying:S}),e.jsx(Tt,{time:p.time,status:y?p.status:void 0,isCurrentUser:y,hasText:!!p.text,hasAudio:!!p.audio,hasGalleryMedia:P.length>0&&!p.text,hasFileAttachments:k})]})},Mt=r.memo(Et),Vt=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"})]})})},_t=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"})]})})},Lt=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"})]})})},Ft=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"})})},zt=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"})]})})},Nt=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Dt=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Rect,{x:"5",y:"11",width:"14",height:"10",rx:"2",stroke:i,strokeWidth:"1.5"}),e.jsx(o.Path,{d:"M8 11V7a4 4 0 0 1 8 0v4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})},Bt={code:"function LongPressRecordingTsx1(){const{micScale}=this.__closure;return{transform:[{scale:micScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx1","micScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AA+BsC,SAAAA,uBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACrCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,QAAQ,CAACI,KAAM,CAAC,CACzC,CAAC","ignoreList":[]}',version:"3.16.7"},Wt={code:"function LongPressRecordingTsx2(){const{slideTextX,cancelProgress}=this.__closure;return{transform:[{translateX:slideTextX.value}],opacity:1-cancelProgress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx2","slideTextX","cancelProgress","__closure","transform","translateX","value","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAoC4C,SAAAA,uBAAA,QAAAC,UAAA,CAAAC,cAAA,OAAAC,SAAA,OAAO,CAC3CC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,UAAU,CAACK,KAAM,CAAC,CAAC,CAC7CC,OAAO,CAAE,CAAC,CAAGL,cACjB,CAAC","ignoreList":[]}',version:"3.16.7"},$t={code:"function LongPressRecordingTsx3(){const{chevronY}=this.__closure;return{transform:[{translateY:chevronY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx3","chevronY","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAwC0C,SAAAA,uBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,QAAQ,CAACI,KAAM,CAAC,CAC9C,CAAC","ignoreList":[]}',version:"3.16.7"},qt={code:"function LongPressRecordingTsx4(){const{lockScale}=this.__closure;return{transform:[{scale:lockScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx4","lockScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AA2CuC,SAAAA,uBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CACtCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},Ut=function(n){var o,i,s=n.duration,a=n.slideX,u=n.containerHeight,c=void 0===u?50:u,d=n.fontFamily,f=n.voiceRecorderStyles,h=n.recordingUIProps,p=null!==(o=null==h?void 0:h.micPulseColor)&&void 0!==o?o:"#ef4444",y=null!==(i=null==h?void 0:h.cancelTextColor)&&void 0!==i?i:"#6b7280",v=l.useSharedValue(1);r.useEffect((function(){v.value=l.withRepeat(l.withSequence(l.withTiming(1.28,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var m=l.useSharedValue(0);r.useEffect((function(){m.value=l.withRepeat(l.withSequence(l.withTiming(-8,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var g=l.useSharedValue(0);r.useEffect((function(){g.value=l.withRepeat(l.withSequence(l.withTiming(-5,{duration:450,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:450,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var x=l.useSharedValue(.8);r.useEffect((function(){x.value=l.withRepeat(l.withSequence(l.withTiming(1,{duration:550,easing:l.Easing.out(l.Easing.ease)}),l.withTiming(.8,{duration:550,easing:l.Easing.in(l.Easing.ease)})),-1,!1)}),[]);var b,w,j=l.useAnimatedStyle((b=[new global.Error,-2,-27],(w=function(){return{transform:[{scale:v.value}]}}).__closure={micScale:v},w.__workletHash=0xeed74ce9076,w.__initData=Bt,w.__stackDetails=b,w)),C=Math.min(1,Math.abs(Math.min(0,a))/70),A=l.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){return{transform:[{translateX:m.value}],opacity:1-C}};return t.__closure={slideTextX:m,cancelProgress:C},t.__workletHash=0x97a8eecc20c,t.__initData=Wt,t.__stackDetails=e,t}()),S=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:g.value}]}};return t.__closure={chevronY:g},t.__workletHash=0xaac75d47893,t.__initData=$t,t.__stackDetails=e,t}()),P=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{scale:x.value}]}};return t.__closure={lockScale:x},t.__workletHash=4651881594739,t.__initData=qt,t.__stackDetails=e,t}()),k=.5*c;return e.jsxs(t.View,{style:[{flexDirection:"row",alignItems:"center",height:c,paddingHorizontal:8},null==f?void 0:f.container],children:[e.jsx(l.View,{style:[j,{width:c,height:c,borderRadius:c/2,backgroundColor:"".concat(p,"22"),justifyContent:"center",alignItems:"center"},null==f?void 0:f.micButton],children:e.jsx(Lt,{style:{width:k,height:k},color:p})}),e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:"#374151",marginLeft:8,fontFamily:d},null==f?void 0:f.timer],children:Q(s)}),e.jsx(l.View,{style:[A,{flex:1,alignItems:"center"}],children:e.jsx(t.Text,{style:[{fontSize:14,color:y,fontFamily:d},null==f?void 0:f.slideText],children:"< Slide to cancel"})}),e.jsxs(t.View,{style:[{alignItems:"center",marginRight:4},null==f?void 0:f.lockContainer],children:[e.jsx(l.View,{style:P,children:e.jsx(Dt,{style:{width:18,height:18},color:"#6b7280"})}),e.jsx(l.View,{style:S,children:e.jsx(Nt,{style:{width:18,height:18},color:"#6b7280"})})]})]})},Ht=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Path,{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx(o.Path,{d:"M10 11v6M14 11v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})};var Gt=function(n){var o=n.isActive,i=n.color,s=void 0===i?"rgba(0,0,0,0.45)":i,l=n.height,a=void 0===l?26:l,u=n.style,c=R(r.useState((function(){return Array.from({length:22},(function(){return.3}))})),2),d=c[0],f=c[1];return r.useEffect((function(){if(o){var e=setInterval((function(){return f(Array.from({length:22},(function(){return.15+.85*Math.random()})))}),110);return function(){return clearInterval(e)}}f(Array.from({length:22},(function(){return.3})))}),[o]),e.jsx(t.View,{style:[{flexDirection:"row",alignItems:"center",height:a,gap:2},u],children:d.map((function(n,r){return e.jsx(t.View,{style:{flex:1,height:Math.max(3,Math.round(n*a)),borderRadius:2,backgroundColor:s}},r)}))})},Yt=function(n){var r,o,i,s=n.isRecording,l=n.isPaused,a=n.duration,u=n.onCancel,c=n.onSend,d=n.onPause,f=n.onResume,h=n.containerHeight,p=void 0===h?50:h,y=n.fontFamily,v=n.sendButtonColor,m=void 0===v?"#16a34a":v,g=n.sendIconColor,x=void 0===g?"#ffffff":g,b=n.enablePauseResume,w=void 0===b||b,j=n.voiceRecorderStyles,C=n.recordingUIProps,A=null!==(r=null==C?void 0:C.waveformColor)&&void 0!==r?r:"rgba(0,0,0,0.45)",S=null!==(o=null==C?void 0:C.cancelTextColor)&&void 0!==o?o:"#ef4444",P=null!==(i=null==C?void 0:C.recordingBackground)&&void 0!==i?i:"transparent",k=null==C?void 0:C.timerTextStyle;return e.jsxs(t.View,{style:[{flexDirection:"row",alignItems:"center",height:p,paddingHorizontal:4,backgroundColor:P,gap:8},null==j?void 0:j.container],children:[e.jsx(t.Pressable,{onPress:u,style:[{width:p,height:p,borderRadius:p/2,justifyContent:"center",alignItems:"center",backgroundColor:"".concat(S,"18")},null==j?void 0:j.trashButton],hitSlop:6,children:e.jsx(Ht,{style:{width:.44*p,height:.44*p},color:S})}),e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:"#374151",minWidth:40,fontFamily:y},null==j?void 0:j.timer,k],children:Q(a)}),e.jsx(Gt,{isActive:s&&!l,color:A,height:Math.round(.52*p),style:[{flex:1},null==j?void 0:j.waveform]}),w&&e.jsx(t.Pressable,{onPress:l?f:d,style:{width:36,height:36,borderRadius:18,backgroundColor:"rgba(0,0,0,0.08)",justifyContent:"center",alignItems:"center"},hitSlop:6,children:l?e.jsx(H,{style:{width:18,height:18},color:"#374151"}):e.jsx(U,{style:{width:18,height:18},color:"#374151"})}),e.jsx(t.Pressable,{onPress:c,style:{width:p,height:p,borderRadius:p/2,backgroundColor:m,justifyContent:"center",alignItems:"center"},hitSlop:4,children:e.jsx(zt,{style:{width:.44*p,height:.44*p},color:x})})]})};var Qt=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=F().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:D([{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)})},Xt=r.memo(Kt);function Zt(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 Jt,en,tn,nn,rn,on,sn,ln,an,un,cn,dn,fn,hn,pn,yn,vn,mn,gn,xn=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=F(),h=f.theme,p=f.setMediaViewerGallery,y=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=Zt(o);if(0===o.length)return null;var g=function(e){0!==m.length&&p(m,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/"),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,pointerEvents:"none",playInBackground:!1,playWhenInactive:!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:D({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==h?void 0:h.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==h||null===(r=h.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===y.length)return null;if(1===y.length){var n=y[0];return n?e.jsxs(t.Pressable,{onPress:function(){return g(0)},style:{position:"relative"},children:[x(n),b(n.uri)]}):null}var r=y.slice(0,3),o=y.length>3?y.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var s=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",l=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=Zt(y).findIndex((function(e){return e.uri===n.uri}));g(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:s}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[x(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,l)]})},"".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,s,l;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==h||null===(o=h.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==h||null===(i=h.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:a?e.jsx(a,{}):e.jsx(Qt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==h||null===(s=h.filePreviewStyle)||void 0===s?void 0:s.nameContainer],children:e.jsx(Xt,{fileName:n.name||"File",style:null==h||null===(l=h.filePreviewStyle)||void 0===l?void 0:l.text})})]}),b(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},bn=r.memo(xn),wn="ios"===t.Platform.OS?32:30,jn="ios"===t.Platform.OS?50:48,Cn="h-6 w-6",An=function(o){var i,s,l,a,u,c,f,h,p,y,v,m,g,b,w,j,C=o.onSendMessage,A=o.onTypingStart,S=o.onTypingEnd,P=o.onAttachmentPress,k=o.onCameraPress,I=o.onAudioRecordStart,T=o.onAudioRecordEnd,M=o.CustomEmojiIcon,V=o.CustomAttachmentIcon,_=o.CustomCameraIcon,L=o.CustomSendIcon,z=o.CustomMicrophoneIcon,B=o.CustomFileIcon,W=o.CustomImagePreview,$=o.CustomVideoPreview,q=R(r.useState(""),2),U=q[0],H=q[1],G=R(r.useState(0),2),Y=G[0],Q=G[1],K=R(r.useState({height:wn,isMultiline:!1}),2),X=K[0],Z=K[1],J=F(),ee=J.theme,te=J.currentUserId,ne=J.showEmojiButton,re=J.showAttachmentsButton,oe=J.showCameraButton,ie=J.showVoiceRecordButton,se=J.placeholder,le=J.previewData,ae=J.previewItems,ue=J.closePreview,ce=J.onRemovePreviewItem,de=J.voiceRecorderProps,fe=J.voiceRecorderStyles,he=J.recordingUIProps,pe=J.renderVoiceRecorder,ye=r.useMemo((function(){return null!=ae&&ae.length?ae:le?[le]:[]}),[ae,le]),ve=ye.length>0,me=null==ee||null===(i=ee.sizes)||void 0===i?void 0:i.inputIconSize,ge=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():N;return n.style(t)}(me),xe="number"==typeof(j=me)&&j>0?j:24,be=0===U.trim().length&&!X.isMultiline,we=Math.max(0,(jn-xe)/2),je=be?{paddingTop:we,paddingBottom:we}:{paddingBottom:we},Ce=r.useCallback((function(){Z({height:wn,isMultiline:!1}),Q((function(e){return e+1}))}),[]),Ae=r.useCallback((function(e){H(e),0===e.length&&Ce()}),[Ce]),Se=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,wn),118),n=t>wn;Z({height:n?t:wn,isMultiline:n})}),[]),Pe=r.useCallback((function(){var e=U.trim();(e||ve)&&(C({text:e,senderId:te}),H(""),Ce())}),[U,C,te,ve,Ce]);r.useEffect((function(){U.trim()?null==A||A():null==S||S()}),[U,A,S]);var ke=!!U.trim()||ve,Ie=R(r.useState("idle"),2),Re=Ie[0],Oe=Ie[1],Te=r.useRef("idle"),Ee=r.useCallback((function(e){Te.current=e,Oe(e)}),[]),Me=R(r.useState(0),2),Ve=Me[0],_e=Me[1],Le=r.useRef(0),Fe=r.useCallback((function(e){null==T||T(e)}),[T]),ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDuration,n=void 0===t?300:t,o=e.onRecordStart,i=e.onRecordEnd,s=R(r.useState("idle"),2),l=s[0],a=s[1],u=R(r.useState(0),2),c=u[0],f=u[1],h=r.useRef(null),p=r.useRef(null),y=r.useRef(0),v=r.useRef(i);v.current=i;var m=r.useRef(o);m.current=o;var g=r.useRef(n);g.current=n;var x=r.useCallback((function(){p.current&&(clearInterval(p.current),p.current=null)}),[]),b=r.useCallback((function(e){x(),p.current=setInterval((function(){y.current+=1,f(y.current),y.current>=g.current&&e()}),1e3)}),[x]),w=r.useCallback(d(E().mark((function e(){var t,n,r;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("expo-av").Audio,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires expo-av. Install it with: bun add expo-av"),e.abrupt("return");case 8:return e.prev=8,e.next=11,t.requestPermissionsAsync();case 11:if("granted"===e.sent.status){e.next=16;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 16:return e.next=18,t.setAudioModeAsync({allowsRecordingIOS:!0,playsInSilentModeIOS:!0});case 18:return r=new t.Recording,e.next=21,r.prepareToRecordAsync(t.RecordingOptionsPresets.HIGH_QUALITY);case 21:return e.next=23,r.startAsync();case 23:h.current=r,y.current=0,f(0),a("recording"),b((function(){return P()})),null===(n=m.current)||void 0===n||n.call(m),e.next=34;break;case 31:e.prev=31,e.t1=e.catch(8),console.warn("[movius-chats] Failed to start recording:",e.t1);case 34:case"end":return e.stop()}}),e,null,[[0,4],[8,31]])}))),[b]),j=r.useCallback(d(E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.current){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,h.current.pauseAsync();case 5:a("paused"),x(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.warn("[movius-chats] Failed to pause:",e.t0);case 12:case"end":return e.stop()}}),e,null,[[2,9]])}))),[x]),C=r.useCallback(d(E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.current){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,h.current.startAsync();case 5:a("recording"),b((function(){return P()})),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.warn("[movius-chats] Failed to resume:",e.t0);case 12:case"end":return e.stop()}}),e,null,[[2,9]])}))),[b]),A=r.useCallback(d(E().mark((function e(){var t,n,r,o,i,s,l;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.current){e.next=3;break}return e.abrupt("return",null);case 3:return x(),h.current=null,n=y.current,y.current=0,a("idle"),f(0),e.prev=9,e.next=12,t.stopAndUnloadAsync();case 12:if(o=t.getURI()){e.next=15;break}return e.abrupt("return",null);case 15:return i=1e3*n,e.prev=16,e.next=19,t.getStatusAsync();case 19:null!=(s=e.sent)&&s.durationMillis&&(i=s.durationMillis),e.next=25;break;case 23:e.prev=23,e.t0=e.catch(16);case 25:return l={uri:o,duration:Math.max(1,Math.round(i/1e3)),mimeType:"audio/m4a"},null===(r=v.current)||void 0===r||r.call(v,l),e.abrupt("return",l);case 30:return e.prev=30,e.t1=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t1),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,null,[[9,30],[16,23]])}))),[x]),S=r.useRef(A);S.current=A;var P=r.useCallback((function(){return S.current()}),[]),k=r.useCallback(d(E().mark((function e(){var t,n,r,o;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.current,x(),h.current=null,y.current=0,a("idle"),f(0),!t){e.next=24;break}return e.prev=7,e.next=10,t.stopAndUnloadAsync();case 10:if(!(n=t.getURI())){e.next=20;break}return e.prev=12,r=require("expo-file-system"),o=r.deleteAsync,e.next=16,o(n,{idempotent:!0});case 16:e.next=20;break;case 18:e.prev=18,e.t0=e.catch(12);case 20:e.next=24;break;case 22:e.prev=22,e.t1=e.catch(7);case 24:case"end":return e.stop()}}),e,null,[[7,22],[12,18]])}))),[x]);return r.useEffect((function(){return function(){var e;x(),null===(e=h.current)||void 0===e||e.stopAndUnloadAsync().catch((function(){}))}}),[x]),{status:l,duration:c,isRecording:"recording"===l,isPaused:"paused"===l,startRecording:w,pauseRecording:j,resumeRecording:C,stopRecording:P,cancelRecording:k}}({maxDuration:null!==(s=null==de?void 0:de.maxDuration)&&void 0!==s?s:300,onRecordStart:I,onRecordEnd:Fe}),Ne=r.useRef(ze);Ne.current=ze;var De=r.useCallback(d(E().mark((function e(){var t;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ne.current.stopRecording();case 2:t=e.sent,Ee("idle"),t&&C({audio:t.uri,senderId:te});case 5:case"end":return e.stop()}}),e)}))),[C,te,Ee]),Be=r.useCallback((function(){Ne.current.cancelRecording(),Ee("idle"),_e(0),Le.current=0}),[Ee]),We=r.useRef(De);We.current=De;var $e=r.useRef(Be);$e.current=Be;var qe=r.useRef(),Ue=r.useRef(!1),He=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return Ue.current},onPanResponderGrant:function(){Ue.current=!1,Le.current=0,_e(0),qe.current=setTimeout(d(E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ue.current=!0,e.next=3,Ne.current.startRecording();case 3:Ee("longPress");case 4:case"end":return e.stop()}}),e)}))),500)},onPanResponderMove:function(e,t){Ue.current&&(Le.current=t.dx,_e(t.dx),t.dy<-80&&"longPress"===Te.current&&Ee("locked"))},onPanResponderRelease:(e=d(E().mark((function e(t,n){var r;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(qe.current),r=Ue.current,Ue.current=!1,r){e.next=8;break}return e.next=6,Ne.current.startRecording();case 6:return Ee("normal"),e.abrupt("return");case 8:if("locked"!==Te.current){e.next=10;break}return e.abrupt("return");case 10:n.dx<-70?$e.current():We.current();case 11:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)}),onPanResponderTerminate:function(){clearTimeout(qe.current),Ue.current=!1}});var e}),[]);if("idle"!==Re){var Ge,Ye,Qe,Ke,Xe,Ze={isRecording:ze.isRecording,isPaused:ze.isPaused,duration:ze.duration,isLocked:"locked"===Re,slideOffset:{x:Ve,y:0},waveformData:[],startRecording:ze.startRecording,stopRecording:ze.stopRecording,pauseRecording:ze.pauseRecording,resumeRecording:ze.resumeRecording,cancelRecording:Be},Je=null!==(Ge=null==ee||null===(Ye=ee.inputStyles)||void 0===Ye||null===(Ye=Ye.sendButtonStyle)||void 0===Ye?void 0:Ye.backgroundColor)&&void 0!==Ge?Ge:"#16a34a",et=null!==(Qe=null==ee||null===(Ke=ee.colors)||void 0===Ke?void 0:Ke.sendIconsColor)&&void 0!==Qe?Qe:"#ffffff";return e.jsx(t.View,{style:n(Jt||(Jt=O(["w-full px-2"]))),children:pe?pe(Ze):"longPress"===Re?e.jsx(Ut,{duration:ze.duration,slideX:Ve,containerHeight:jn,fontFamily:null==ee?void 0:ee.fontFamily,voiceRecorderStyles:fe,recordingUIProps:he}):e.jsx(Yt,{isRecording:ze.isRecording,isPaused:ze.isPaused,duration:ze.duration,onCancel:Be,onSend:De,onPause:ze.pauseRecording,onResume:ze.resumeRecording,enablePauseResume:null===(Xe=null==de?void 0:de.enablePauseResume)||void 0===Xe||Xe,containerHeight:jn,fontFamily:null==ee?void 0:ee.fontFamily,sendButtonColor:Je,sendIconColor:et,voiceRecorderStyles:fe,recordingUIProps:he})})}return e.jsxs(t.View,{style:n(en||(en=O(["w-full px-2"]))),children:[ve&&e.jsx(bn,{previews:ye,closePreview:ue,onRemoveItem:ce,CustomFileIcon:B,CustomImagePreview:W,CustomVideoPreview:$,inputHeight:X.height}),e.jsxs(t.View,{style:[n(tn||(tn=O(["flex-row items-end gap-2"]))),null==ee||null===(l=ee.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(nn||(nn=O(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:jn,borderRadius:be?9999:24,alignItems:be?"center":"flex-end"},null==ee||null===(a=ee.inputStyles)||void 0===a?void 0:a.inputContainerStyle],children:[ne&&e.jsx(t.View,{style:je,children:e.jsx(t.Pressable,{children:M?e.jsx(M,{}):e.jsx(_t,{style:ge,color:(null==ee||null===(u=ee.colors)||void 0===u?void 0:u.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:U,onChangeText:Ae,placeholder:se||"Message",style:D([n(rn||(rn=O(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(on||(on=O(["text-[17px]"]))):n(sn||(sn=O(["text-[16px]"]))),{minHeight:wn,maxHeight:118,paddingVertical:be?0:8,marginVertical:be?(jn-wn)/2:4},{color:(null==ee||null===(c=ee.colors)||void 0===c?void 0:c.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==ee?void 0:ee.fontFamily),placeholderTextColor:(null==ee||null===(f=ee.colors)||void 0===f?void 0:f.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:X.isMultiline&&U.length>0?"top":"center",onContentSizeChange:Se},"chat-input-".concat(Y)),e.jsxs(t.View,{style:[n(ln||(ln=O(["flex-row items-center gap-4"]))),je],children:[re&&e.jsx(t.Pressable,{onPress:P,children:V?e.jsx(V,{}):e.jsx(Ft,{style:ge,color:(null==ee||null===(h=ee.colors)||void 0===h?void 0:h.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),oe&&!U.trim()&&e.jsx(t.Pressable,{onPress:k,children:_?e.jsx(_,{}):e.jsx(Vt,{style:ge,color:(null==ee||null===(p=ee.colors)||void 0===p?void 0:p.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),ke?e.jsx(t.Pressable,{onPress:Pe,style:[n(an||(an=O(["rounded-full justify-center items-center"]))),x({height:jn,width:jn,backgroundColor:"#16a34a"},null==ee||null===(y=ee.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],children:L?e.jsx(L,{}):e.jsx(zt,{style:n.style(Cn),color:(null==ee||null===(v=ee.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"})}):ie?e.jsx(t.View,x(x({},He.panHandlers),{},{style:[n(un||(un=O(["rounded-full justify-center items-center"]))),x({height:jn,width:jn,backgroundColor:"#16a34a"},null==ee||null===(m=ee.inputStyles)||void 0===m?void 0:m.sendButtonStyle)],children:z?e.jsx(z,{}):e.jsx(Lt,{style:n.style("h-8 w-8"),color:(null==ee||null===(g=ee.colors)||void 0===g?void 0:g.sendIconsColor)||"rgba(255,255,255,0.7)"})})):e.jsx(t.Pressable,{onPress:Pe,style:[n(cn||(cn=O(["rounded-full justify-center items-center"]))),x({height:jn,width:jn,backgroundColor:"#16a34a"},null==ee||null===(b=ee.inputStyles)||void 0===b?void 0:b.sendButtonStyle)],children:L?e.jsx(L,{}):e.jsx(zt,{style:n.style(Cn),color:(null==ee||null===(w=ee.colors)||void 0===w?void 0:w.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Sn=r.memo(An);function Pn(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 kn,In,Rn,On,Tn,En,Mn,Vn,_n,Ln,Fn,zn,Nn,Dn,Bn,Wn=function(o){var i,s=o.gallery,l=o.onClose,a=F(),u=a.theme,c=a.setIsVideoPlaying,d=r.useRef(null),f=null!==(i=null==s?void 0:s.initialIndex)&&void 0!==i?i:0,h=R(r.useState(f),2),p=h[0],y=h[1],v=t.useWindowDimensions(),m=v.width,g=v.height;r.useEffect((function(){if(null!=s&&s.items.length){var e=s.initialIndex;y(e);var t=s.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=d.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==s?void 0:s.initialIndex,null==s?void 0:s.items,c]);var x=r.useCallback((function(){c(!1),l()}),[l,c]),b=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/m);y(t);var n=null==s?void 0:s.items[t];c("video"===(null==n?void 0:n.kind))}),[null==s?void 0:s.items,m,c]);return s&&0!==s.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:x,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[n(dn||(dn=O(["flex-1 bg-black"]))),{width:m,height:g}],children:[e.jsx(t.Pressable,{onPress:x,style:n(fn||(fn=O(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Pn,{style:n(hn||(hn=O(["h-8 w-8"])))})}),s.items.length>1&&e.jsx(t.View,{style:n(pn||(pn=O(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:D(n(yn||(yn=O(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==u?void 0:u.fontFamily),children:[p+1," / ",s.items.length]})}),e.jsx(t.FlatList,{ref:d,data:s.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:s.initialIndex,extraData:p,getItemLayout:function(e,t){return{length:m,offset:m*t,index:t}},onMomentumScrollEnd:b,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=d.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx($n,{item:n,width:m,height:g,isActive:r===p,autoPlayVideo:r===f&&"video"===n.kind})}})]})}):null},$n=function(o){var i=o.item,l=o.width,a=o.height,u=o.isActive,c=o.autoPlayVideo,d=F().theme,f=r.useRef(null),h=R(r.useState("video"===i.kind),2),p=h[0],y=h[1],v=R(r.useState(!1),2),m=v[0],g=v[1],x="video"===i.kind&&u&&c;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:f,controls:!0,paused:!x,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:l-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){y(!0),g(!1)},onLoad:function(){return y(!1)},onBuffer:function(e){var t=e.isBuffering;return y(t)},onError:function(){g(!0),y(!1)}}),p&&e.jsx(t.View,{style:n(vn||(vn=O(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(ae,{style:n.style("h-14 w-14"),spinning:!0})}),m&&e.jsx(t.View,{style:n(mn||(mn=O(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:D(n(gn||(gn=O(["text-white font-semibold"]))),null==d?void 0:d.fontFamily),children:"Failed to load video"})})]})},qn=r.memo(Wn),Un=function(r){var o,i,s,l,a=r.typingUsers,u=r.currentUserId,c=F(),d=c.theme,f=c.showAvatars,h=c.renderCustomTyping,p=c.showBubbleTail,y=a.filter((function(e){return e.id!==u}));if(!y.length)return null;var v=y.slice(0,2),m=y.length-2;return e.jsxs(t.View,{style:n(kn||(kn=O(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:n(In||(In=O(["flex-row"]))),children:[v.map((function(r,o){var i,s,l;return e.jsx(t.View,{style:[n(Rn||(Rn=O(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:v.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(On||(On=O(["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:D([n(Tn||(Tn=O(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(l=r.name)||void 0===l?void 0:l.charAt(0)})},r.id)})),m>0&&e.jsx(t.View,{style:[n(En||(En=O(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},x({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:D([n(Mn||(Mn=O(["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:["+",m]})})]}),p&&e.jsx(M,{style:n.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(s=d.colors)||void 0===s?void 0:s.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[n(Vn||(Vn=O(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.typingContainerStyle],children:h?h():e.jsx(t.View,{style:n(_n||(_n=O(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:D(n(Ln||(Ln=O(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var Hn=function(){var o=F(),i=o.messages,s=o.currentUserId,l=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,h=o.onTypingEnd,p=o.onAttachmentPress,y=o.onAudioRecordEnd,v=o.onAudioRecordStart,m=o.onCameraPress,g=o.renderCustomInput,x=o.CustomEmojiIcon,b=o.CustomAttachmentIcon,w=o.CustomCameraIcon,j=o.CustomMicrophoneIcon,C=o.CustomSendIcon,A=o.CustomFileIcon,S=o.CustomImagePreview,P=o.CustomVideoPreview,k=o.keyboardVerticalOffset,I=void 0===k?0:k,T=o.disableKeyboardAvoiding,E=void 0!==T&&T,M=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=R(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)})),s=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),s.remove()}}i(0)}),[e]),e?o:0}(!E),V=g?g():e.jsx(Sn,{onSendMessage:d,onTypingStart:f,onTypingEnd:h,onAttachmentPress:p,onAudioRecordEnd:y,onAudioRecordStart:v,onCameraPress:m,CustomEmojiIcon:x,CustomAttachmentIcon:b,CustomCameraIcon:w,CustomMicrophoneIcon:j,CustomSendIcon:C,CustomFileIcon:A,CustomImagePreview:S,CustomVideoPreview:P}),_=e.jsxs(t.View,{style:n(Fn||(Fn=O(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(zn||(zn=O(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(Mt,{message:r,isCurrentUser:r.senderId===s,onLongPress:function(){return null==l?void 0:l(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(Un,{typingUsers:c||[],currentUserId:s}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!E&&M>0?{marginBottom:M}:void 0,children:V}),e.jsx(qn,{gallery:a,onClose:u})]});return E?e.jsx(t.View,{style:n(Nn||(Nn=O(["flex-1"]))),children:_}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(Dn||(Dn=O(["flex-1"]))),children:_}):e.jsx(t.KeyboardAvoidingView,{style:n(Bn||(Bn=O(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:I,children:_})};module.exports=function(t){return e.jsx(Y,{children:e.jsx(L,x(x({},t),{},{children:e.jsx(Hn,{})}))})};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|