movius-chats 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +605 -197
- package/lib/commonjs/index.js +3 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/assets/Icons/CheckAllIcon.d.ts +5 -2
- package/lib/typescript/assets/Icons/CheckIcon.d.ts +5 -2
- package/lib/typescript/components/ChatInput/TruncateFileName.d.ts +2 -2
- package/lib/typescript/hooks/useKeyboardInset.d.ts +5 -0
- package/lib/typescript/types/index.d.ts +13 -0
- package/lib/typescript/utils/theme.d.ts +6 -0
- package/package.json +1 -1
- package/src/assets/Icons/CheckAllIcon.tsx +6 -1
- package/src/assets/Icons/CheckIcon.tsx +6 -2
- package/src/components/AudioPlayer/AudioPlayer.tsx +8 -4
- package/src/components/ChatBubble/ChatBubble.tsx +15 -8
- package/src/components/ChatBubble/MessageContent.tsx +23 -10
- package/src/components/ChatBubble/MessageStatus.tsx +19 -12
- package/src/components/ChatInput/ChatInput.tsx +26 -22
- package/src/components/ChatInput/FilePreview.tsx +9 -1
- package/src/components/ChatInput/TruncateFileName.tsx +9 -3
- package/src/components/MediaViewer/MediaViewer.tsx +9 -1
- package/src/components/TypingComponent/TypingIndicator.tsx +18 -9
- package/src/hooks/useKeyboardInset.ts +42 -0
- package/src/index.tsx +35 -3
- package/src/types/index.ts +14 -0
- package/src/utils/theme.ts +37 -0
package/lib/module/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Animated as n,Easing as o,PanResponder as i,View as l,Pressable as a,Text as s,Image as u,Linking as c,Platform as d,TextInput as f,Modal as p,FlatList as y}from"react-native";import h from"twrnc";import v,{useState as m,createContext as b,useContext as g,useRef as w,useEffect as x,useCallback as S}from"react";import P,{Path as C,Svg as O,G as I,Circle as A,Ellipse as j,Line as E}from"react-native-svg";import T from"react-native-video";import M,{useSharedValue as k,withSpring as R,useAnimatedStyle as _}from"react-native-reanimated";import N from"react-native-sound";import z from"react-native-image-zoom-viewer";function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e,t,r){return t=D(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,q()?Reflect.construct(t,r||[],D(e).constructor):t.apply(e,r))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Q(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function B(e,t,r){return(t=Q(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},D(e)}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q=function(){return!!e})()}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){B(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}function X(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(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 Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Q(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var J,K,G,ee,te,re,ne,oe=function(t){var r=t.style,n=t.color;return e(P,{style:r,viewBox:"0 0 48 48",children:e(C,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},ie=["children"],le=b(void 0),ae=function(t){var r=t.children,n=H(t,ie),o=X(m({imageUrl:"",videoUrl:""}),2),i=o[0],l=o[1],a=X(m(!1),2),s=a[0],u=a[1];return e(le.Provider,{value:W(W({},n),{},{mediaUrl:i,setMediaUrl:l,isVideoPlaying:s,setIsVideoPlaying:u}),children:r})},se=function(){var e=g(le);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},ue=function(t){var r=t.style,i=t.spinning,l=void 0!==i&&i,a=w(new n.Value(0)).current;x((function(){l&&n.loop(n.timing(a,{toValue:1,duration:1e3,easing:o.linear,useNativeDriver:!0})).start()}),[l]);var s=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e(n.View,{style:l?{transform:[{rotate:s}]}:void 0,children:e(P,{style:r,viewBox:"0 0 1024 1024",children:e(C,{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"})})})},ce=function(t){var r=t.style,n=t.color;return e(P,{style:r,viewBox:"0 0 24 24",children:e(C,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},de=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},fe=function(t){var r=t.style,n=t.color;return e(P,{style:r,viewBox:"0 0 15 15",children:e(C,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},pe=b(void 0),ye=function(t){var r=t.children,n=X(m(null),2),o=n[0],i=n[1];return e(pe.Provider,{value:{currentlyPlayingId:o,setCurrentlyPlayingId:i},children:r})},he={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAgH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},ve=function(r){var n,o,u,c,d,f,p,y=r.audioUrl,v=r.audioId,b=r.isVideoPlaying,S=se(),P=S.theme,C=S.CustomPlayIcon,O=S.CustomPauseIcon,I=function(){var e=g(pe);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),A=I.currentlyPlayingId,j=I.setCurrentlyPlayingId,E=X(m(null),2),T=E[0],z=E[1],$=X(m(!1),2),V=$[0],U=$[1],L=X(m(0),2),B=L[0],D=L[1],q=X(m(0),2),F=q[0],H=q[1],Y=X(m(!1),2),Q=Y[0],oe=Y[1],ie=w(null),le=w(0),ae=w(0),ue=w(0),ye=k(0);x((function(){var e=!0,t=new N(y,"",(function(r){!r&&e&&H(t.getDuration())}));return z(t),function(){e=!1,t&&(t.pause(),t.release())}}),[y]),x((function(){A&&A!==v&&V&&T&&(T.pause(),U(!1),D(0),ye.value=0)}),[A,v,V,T]),x((function(){var e;return V&&T&&!Q&&(e=setInterval((function(){T.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(D(e),le.current>0&&F>0)){var t=e/F*le.current;isNaN(t)||(ye.value=R(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[V,T,Q,F]);var ve,me,be=i.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){oe(!0),ue.current=e.nativeEvent.pageX-ye.value},onPanResponderMove:function(e){if(le.current>0){var t=e.nativeEvent.pageX-ue.current,r=Math.max(0,Math.min(t,le.current));ye.value=r;var n=r/le.current*F;isNaN(n)||D(n)}},onPanResponderRelease:function(){if(oe(!1),T&&le.current>0){var e=ye.value/le.current*F;isNaN(e)||T.setCurrentTime(e)}},onPanResponderTerminate:function(){oe(!1)}}),ge=_((ve=[new global.Error,-2,-27],(me=function(){return{transform:[{translateX:ye.value}]}}).__closure={knobPosition:ye},me.__workletHash=1935336866997,me.__initData=he,me.__stackDetails=ve,me));return x((function(){b&&V&&T&&T.pause((function(){U(!1),j(null)}))}),[b]),t(l,{style:h(J||(J=Z(["rounded-lg w-56"]))),children:[t(l,{style:h(K||(K=Z(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e(a,{onPress:function(){T&&(V?T.pause((function(){U(!1),j(null)})):(j(v),T.play((function(e){e&&(U(!1),D(0),ye.value=R(0),j(null))})),U(!0)))},style:[h(G||(G=Z(["bg-black/40 rounded-full p-2"]))),null==P||null===(n=P.messageStyle)||void 0===n?void 0:n.audioPlayButtonStyle],children:V?O?e(O,{}):e(fe,{style:h.style("h-6 w-6"),color:(null==P||null===(o=P.colors)||void 0===o?void 0:o.audioPauseIconColor)||"white"}):C?e(C,{}):e(ce,{style:h.style("h-6 w-6"),color:(null==P||null===(u=P.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),t(l,{ref:ie,onLayout:function(e){var t,r=e.nativeEvent.layout.width;le.current=r,null===(t=ie.current)||void 0===t||t.measure((function(e,t,r,n,o){ae.current=o}))},style:[h(ee||(ee=Z(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==P||null===(c=P.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e(l,{style:[h(te||(te=Z(["absolute h-full bg-slate-200"]))),{width:"".concat(F>0?B/F*100:0,"%")},null==P||null===(d=P.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e(M.View,W(W({},be.panHandlers),{},{style:[ge,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},W({},null==P||null===(f=P.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e(l,{style:h(re||(re=Z(["px-4 py-1"]))),children:e(s,{style:[h(ne||(ne=Z(["text-xs text-gray-500"]))),null==P||null===(p=P.messageStyle)||void 0===p?void 0:p.audioDurationStyle],children:isNaN(B)?"0:00":de(B)})})]})},me=v.memo(ve);function be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge,we={exports:{}},xe={exports:{}},Se={};var Pe,Ce,Oe,Ie,Ae,je,Ee,Te,Me,ke,Re,_e,Ne,ze,$e,Ve={};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Platform as n,Animated as o,Easing as i,PanResponder as l,View as a,Pressable as u,Text as s,Image as c,Linking as d,TextInput as f,Modal as p,Keyboard as y,FlatList as v,KeyboardAvoidingView as h}from"react-native";import m from"twrnc";import b,{useState as g,createContext as w,useContext as x,useRef as S,useEffect as C,useCallback as P}from"react";import O,{Path as I,Svg as A,G as j,Circle as k,Ellipse as E,Line as T}from"react-native-svg";import M from"react-native-video";import R,{useSharedValue as _,withSpring as N,useAnimatedStyle as z}from"react-native-reanimated";import V from"react-native-sound";import $ from"react-native-image-zoom-viewer";function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function L(e,t,r){return t=q(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,W()?Reflect.construct(t,r||[],q(e).constructor):t.apply(e,r))}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,K(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function D(e,t,r){return(t=K(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}function W(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(W=function(){return!!e})()}function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function X(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Z(e,t)}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],u=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return U(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var G=function(t){var r=t.style,n=t.color;return e(O,{style:r,viewBox:"0 0 48 48",children:e(I,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},ee=["children"],te=w(void 0),re=function(t){var r=t.children,n=X(t,ee),o=Q(g({imageUrl:"",videoUrl:""}),2),i=o[0],l=o[1],a=Q(g(!1),2),u=a[0],s=a[1];return e(te.Provider,{value:Y(Y({},n),{},{mediaUrl:i,setMediaUrl:l,isVideoPlaying:u,setIsVideoPlaying:s}),children:r})},ne=function(){var e=x(te);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},oe="ios"===n.OS?"h-6 w-6":"w-6 h-6";function ie(e,t){if("number"==typeof e&&e>0)return{width:e,height:e};var r="string"==typeof e&&e.trim().length>0?e.trim():oe;return m.style(r,t)}function le(e,t){return t?[e,{fontFamily:t}]:e}var ae,ue,se,ce,de,fe,pe,ye=function(t){var r=t.style,n=t.spinning,l=void 0!==n&&n,a=S(new o.Value(0)).current;C((function(){l&&o.loop(o.timing(a,{toValue:1,duration:1e3,easing:i.linear,useNativeDriver:!0})).start()}),[l]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e(o.View,{style:l?{transform:[{rotate:u}]}:void 0,children:e(O,{style:r,viewBox:"0 0 1024 1024",children:e(I,{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"})})})},ve=function(t){var r=t.style,n=t.color;return e(O,{style:r,viewBox:"0 0 24 24",children:e(I,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},he=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},me=function(t){var r=t.style,n=t.color;return e(O,{style:r,viewBox:"0 0 15 15",children:e(I,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},be=w(void 0),ge=function(t){var r=t.children,n=Q(g(null),2),o=n[0],i=n[1];return e(be.Provider,{value:{currentlyPlayingId:o,setCurrentlyPlayingId:i},children:r})},we={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAiH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},xe=function(r){var n,o,i,c,d,f,p,y=r.audioUrl,v=r.audioId,h=r.isVideoPlaying,b=ne(),w=b.theme,P=b.CustomPlayIcon,O=b.CustomPauseIcon,I=function(){var e=x(be);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),A=I.currentlyPlayingId,j=I.setCurrentlyPlayingId,k=Q(g(null),2),E=k[0],T=k[1],M=Q(g(!1),2),$=M[0],U=M[1],L=Q(g(0),2),F=L[0],B=L[1],D=Q(g(0),2),q=D[0],W=D[1],H=Q(g(!1),2),X=H[0],Z=H[1],K=S(null),G=S(0),ee=S(0),te=S(0),re=_(0);C((function(){var e=!0,t=new V(y,"",(function(r){!r&&e&&W(t.getDuration())}));return T(t),function(){e=!1,t&&(t.pause(),t.release())}}),[y]),C((function(){A&&A!==v&&$&&E&&(E.pause(),U(!1),B(0),re.value=0)}),[A,v,$,E]),C((function(){var e;return $&&E&&!X&&(e=setInterval((function(){E.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(B(e),G.current>0&&q>0)){var t=e/q*G.current;isNaN(t)||(re.value=N(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[$,E,X,q]);var oe,ie,ye=l.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){Z(!0),te.current=e.nativeEvent.pageX-re.value},onPanResponderMove:function(e){if(G.current>0){var t=e.nativeEvent.pageX-te.current,r=Math.max(0,Math.min(t,G.current));re.value=r;var n=r/G.current*q;isNaN(n)||B(n)}},onPanResponderRelease:function(){if(Z(!1),E&&G.current>0){var e=re.value/G.current*q;isNaN(e)||E.setCurrentTime(e)}},onPanResponderTerminate:function(){Z(!1)}}),ge=z((oe=[new global.Error,-2,-27],(ie=function(){return{transform:[{translateX:re.value}]}}).__closure={knobPosition:re},ie.__workletHash=1935336866997,ie.__initData=we,ie.__stackDetails=oe,ie));return C((function(){h&&$&&E&&E.pause((function(){U(!1),j(null)}))}),[h]),t(a,{style:m(ae||(ae=J(["rounded-lg w-56"]))),children:[t(a,{style:m(ue||(ue=J(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e(u,{onPress:function(){E&&($?E.pause((function(){U(!1),j(null)})):(j(v),E.play((function(e){e&&(U(!1),B(0),re.value=N(0),j(null))})),U(!0)))},style:[m(se||(se=J(["bg-black/40 rounded-full p-2"]))),null==w||null===(n=w.messageStyle)||void 0===n?void 0:n.audioPlayButtonStyle],children:$?O?e(O,{}):e(me,{style:m.style("h-6 w-6"),color:(null==w||null===(o=w.colors)||void 0===o?void 0:o.audioPauseIconColor)||"white"}):P?e(P,{}):e(ve,{style:m.style("h-6 w-6"),color:(null==w||null===(i=w.colors)||void 0===i?void 0:i.audioPlayIconColor)||"white"})}),t(a,{ref:K,onLayout:function(e){var t,r=e.nativeEvent.layout.width;G.current=r,null===(t=K.current)||void 0===t||t.measure((function(e,t,r,n,o){ee.current=o}))},style:[m(ce||(ce=J(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==w||null===(c=w.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e(a,{style:[m(de||(de=J(["absolute h-full bg-slate-200"]))),{width:"".concat(q>0?F/q*100:0,"%")},null==w||null===(d=w.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e(R.View,Y(Y({},ye.panHandlers),{},{style:[ge,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},Y({},null==w||null===(f=w.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e(a,{style:m(fe||(fe=J(["px-4 py-1"]))),children:e(s,{style:le([m(pe||(pe=J(["text-xs text-gray-500"]))),null==w||null===(p=w.messageStyle)||void 0===p?void 0:p.audioDurationStyle],null==w?void 0:w.fontFamily),children:isNaN(F)?"0:00":he(F)})})]})},Se=b.memo(xe);function Ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pe,Oe={exports:{}},Ie={exports:{}},Ae={};var je,ke,Ee,Te,Me,Re,_e,Ne,ze,Ve,$e,Ue,Le,Fe,Be,De={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -6,10 +6,10 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Animated
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/function
|
|
9
|
+
*/function qe(){return ke||(ke=1,"production"===process.env.NODE_ENV?Ie.exports=function(){if(Pe)return Ae;Pe=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case u:case s:case n:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case a:case c:case y:case p:case l:return e;default:return f}}case r:return f}}}function w(e){return g(e)===s}return Ae.AsyncMode=u,Ae.ConcurrentMode=s,Ae.ContextConsumer=a,Ae.ContextProvider=l,Ae.Element=t,Ae.ForwardRef=c,Ae.Fragment=n,Ae.Lazy=y,Ae.Memo=p,Ae.Portal=r,Ae.Profiler=i,Ae.StrictMode=o,Ae.Suspense=d,Ae.isAsyncMode=function(e){return w(e)||g(e)===u},Ae.isConcurrentMode=w,Ae.isContextConsumer=function(e){return g(e)===a},Ae.isContextProvider=function(e){return g(e)===l},Ae.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ae.isForwardRef=function(e){return g(e)===c},Ae.isFragment=function(e){return g(e)===n},Ae.isLazy=function(e){return g(e)===y},Ae.isMemo=function(e){return g(e)===p},Ae.isPortal=function(e){return g(e)===r},Ae.isProfiler=function(e){return g(e)===i},Ae.isStrictMode=function(e){return g(e)===o},Ae.isSuspense=function(e){return g(e)===d},Ae.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},Ae.typeOf=g,Ae}():Ie.exports=(je||(je=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var v=e.type;switch(v){case u:case s:case n:case i:case o:case d:return v;default:var h=v&&v.$$typeof;switch(h){case a:case c:case y:case p:case l:return h;default:return f}}case r:return f}}}var w=u,x=s,S=a,C=l,P=t,O=c,I=n,A=y,j=p,k=r,E=i,T=o,M=d,R=!1;function _(e){return g(e)===s}De.AsyncMode=w,De.ConcurrentMode=x,De.ContextConsumer=S,De.ContextProvider=C,De.Element=P,De.ForwardRef=O,De.Fragment=I,De.Lazy=A,De.Memo=j,De.Portal=k,De.Profiler=E,De.StrictMode=T,De.Suspense=M,De.isAsyncMode=function(e){return R||(R=!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.")),_(e)||g(e)===u},De.isConcurrentMode=_,De.isContextConsumer=function(e){return g(e)===a},De.isContextProvider=function(e){return g(e)===l},De.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},De.isForwardRef=function(e){return g(e)===c},De.isFragment=function(e){return g(e)===n},De.isLazy=function(e){return g(e)===y},De.isMemo=function(e){return g(e)===p},De.isPortal=function(e){return g(e)===r},De.isProfiler=function(e){return g(e)===i},De.isStrictMode=function(e){return g(e)===o},De.isSuspense=function(e){return g(e)===d},De.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},De.typeOf=g}()),De)),Ie.exports}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function Le(){if(Ie)return Oe;Ie=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Oe=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),s=1;s<arguments.length;s++){for(var u in i=Object(arguments[s]))t.call(i,u)&&(a[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(a[l[c]]=i[l[c]])}}return a},Oe}function Be(){if(je)return Ae;je=1;return Ae="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function De(){return Te?Ee:(Te=1,Ee=Function.call.bind(Object.prototype.hasOwnProperty))}function qe(){if(ke)return Me;ke=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Be(),r={},n=De();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,a,s){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((a||"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,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=s?s():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},Me=o}function Fe(){if(_e)return Re;_e=1;var e=Ue(),t=Le(),r=Be(),n=De(),o=qe(),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){}}),Re=function(a,s){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:y(l),arrayOf:function(e){return y((function(t,n,o,i,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new p("Invalid "+i+" `"+l+"` of type `"+b(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var u=e(a,s,o,i,l+"["+s+"]",r);if(u instanceof Error)return u}return null}))},element:y((function(e,t,r,n,o){var i=e[t];return a(i)?null:new p("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:y((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new p("Invalid "+o+" `"+i+"` of type `"+(((a=t[r]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var a;return null}))},node:y((function(e,t,r,n,o){return m(e[t])?null:new p("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(t,o,i,l,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[o],u=b(s);if("object"!==u)return new p("Invalid "+l+" `"+a+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(n(s,c)){var d=e(s,c,i,l,a+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return y((function(t,r,n,o,i){for(var l=t[r],a=0;a<e.length;a++)if(f(l,e[a]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+s+".")}))},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 "+w(o)+" at index "+t+"."),l}return y((function(t,o,i,l,a){for(var s=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,a,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&s.push(c.data.expectedType)}return new p("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return y((function(t,n,o,i,l){var a=t[n],s=b(a);if("object"!==s)return new p("Invalid "+i+" `"+l+"` of type `"+s+"` 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(a,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return y((function(o,i,l,a,s){var u=o[i],c=b(u);if("object"!==c)return new p("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var y=e[f];if(n(e,f)&&"function"!=typeof y)return v(l,a,s,f,g(y));if(!y)return new p("Invalid "+a+" `"+s+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=y(u,f,l,a,s+"."+f,r);if(h)return h}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,a,u,d,f,y){if(u=u||c,f=f||a,y!==r){if(s){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=u+":"+a;!t[v]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[v]=!0,n++)}}return null==l[a]?o?null===l[a]?new p("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,a,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function h(e){return y((function(t,r,n,o,i,l){var a=t[r];return b(a)!==e?new p("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,r,n,o){return new p((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function g(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(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 p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},Re}function We(){if(ze)return Ne;ze=1;var e=Be();function t(){}function r(){}return r.resetWarningCache=t,Ne=function(){function n(t,r,n,o,i,l){if(l!==e){var a=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 a.name="Invariant Violation",a}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function He(){if($e)return we.exports;if($e=1,"production"!==process.env.NODE_ENV){var e=Ue();we.exports=Fe()(e.isElement,true)}else we.exports=We()();return we.exports}var Ye,Xe,Ze,Qe,Je,Ke,Ge,et,tt,rt,nt,ot,it,lt=be(He()),at=function(){return L((function e(t,r){U(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,a=[],s=t.children,u=0;for(r.pattern.lastIndex=0;s&&(o=r.pattern.exec(s));){var c=s.substr(0,o.index);if(u=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(r,o[0],o,u)),s=s.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}a.push({children:s}),n.push.apply(n,a)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),W(W({},o),{},{children:i,_matched:!0})}}])}(),st=["type"],ut=["style"],ct=["parse","childrenProps"],dt={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+/},ft=lt.shape(W(W({},s.propTypes),{},{type:lt.oneOf(Object.keys(dt)).isRequired,nonExhaustiveMaxMatchCount:lt.number})),pt=lt.shape(W(W({},s.propTypes),{},{pattern:lt.oneOfType([lt.string,lt.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:lt.number})),yt=function(){function t(){return U(this,t),V(this,t,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&&Y(e,t)}(t,v.Component),L(t,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=H(e,st);if(t){if(!dt[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=dt[t]}return r}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new at(this.props.children,this.getPatterns()).parse().map((function(r,n){var o=t.props.style,i=r.style,l=H(r,ut);return e(s,W(W({style:[o,i]},t.props.childrenProps),l),"parsedText-".concat(n))})):this.props.children}},{key:"render",value:function(){var t=this,r=W({},this.props);r.parse,r.childrenProps;var n=H(r,ct);return e(s,W(W({ref:function(e){return t._root=e}},n),{},{children:this.getParsedText()}))}}])}();yt.displayName="ParsedText",yt.propTypes=W(W({},s.propTypes),{},{parse:lt.arrayOf(lt.oneOfType([ft,pt])),childrenProps:lt.shape(s.propTypes)}),yt.defaultProps={parse:null,childrenProps:{}};var ht,vt,mt,bt,gt,wt,xt,St,Pt,Ct,Ot,It,At,jt,Et,Tt,Mt,kt,Rt,_t,Nt,zt,$t,Vt,Ut,Lt,Bt,Dt,qt,Ft,Wt,Ht,Yt,Xt,Zt,Qt,Jt=function(n){var o,i,d,f=n.message,p=n.onMediaPress,y=n.isVideoPlaying,m=n.isCurrentUser,b=se(),g=b.theme,w=b.showMessageStatus,x=b.CustomPlayIcon,S=b.renderCustomVideoBubbleError,P=v.useRef(null),C=X(v.useState(0),2),O=C[0],I=C[1],A=X(v.useState(!1),2),j=A[0],E=A[1],M=X(v.useState(!1),2),k=M[0],R=M[1];return t(l,{children:[f.image&&e(a,{onPress:function(){return p("image",f.image)},style:h(Ye||(Ye=Z(["w-60 h-80 my-2"]))),children:e(u,{source:{uri:f.image},style:h(Xe||(Xe=Z(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),f.video&&t(a,{onPress:function(){return p("video",f.video)},style:h(Ze||(Ze=Z(["w-60 h-80 my-2 justify-center items-center"]))),disabled:j,children:[e(T,{source:{uri:f.video},ref:P,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){E(!0),R(!1)},onLoad:function(e){I(e.duration),E(!1)},onBuffer:function(e){var t=e.isBuffering;return E(t)},onError:function(){R(!0),E(!1)}}),j?e(l,{style:h(Qe||(Qe=Z(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e(ue,{style:h.style("h-12 w-12"),spinning:!0})}):k?S?S():e(l,{style:h(Je||(Je=Z(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e(s,{style:h(Ke||(Ke=Z(["text-white font-bold"]))),children:"Failed to load video"})}):t(r,{children:[e(l,{style:h(Ge||(Ge=Z(["absolute bg-black/40 rounded-full"]))),children:x?e(x,{}):e(ce,{style:h.style("h-16 w-16"),color:(null==g||null===(o=g.colors)||void 0===o?void 0:o.audioPlayIconColor)||"white"})}),e(l,{style:h(et||(et=Z(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e(s,{style:h(tt||(tt=Z(["text-white text-xs font-semibold"]))),children:de(O)})})]})]}),f.audio&&e(l,{style:h(rt||(rt=Z(["my-2"]))),children:e(me,{audioUrl:f.audio,audioId:f.id,isVideoPlaying:y})}),f.text&&e(yt,{style:[h(nt||(nt=Z(["pt-1"]))),h(w?ot||(ot=Z(["pb-0"])):it||(it=Z(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},m?null==g||null===(i=g.messageStyle)||void 0===i?void 0:i.sentTextStyle:null==g||null===(d=g.messageStyle)||void 0===d?void 0:d.receivedTextStyle],parse:[{type:"url",style:{color:"blue",textDecorationLine:"underline"},onPress:function(e){return c.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:f.text})]})},Kt=v.memo(Jt),Gt=function(t){var r=t.style;return e(P,{style:r,viewBox:"0 0 24 24",children:e(C,{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"})})},er=function(t){var r=t.style;return e(P,{style:r,viewBox:"0 0 24 24",children:e(C,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"})})},tr=function(n){var o,i=n.time,a=n.status,u=n.isCurrentUser,c=n.hasText,d=n.hasAudio,f=se(),p=f.theme,y=f.showMessageStatus;return e(r,{children:y&&t(l,{style:[h(ht||(ht=Z(["flex-row items-center"]))),h(c?vt||(vt=Z(["justify-end pb-1 ml-4"])):d?mt||(mt=Z(["absolute right-3 bottom-3"])):bt||(bt=Z(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e(s,{style:[h(gt||(gt=Z(["text-xs"]))),{color:c||d?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],children:i}),u&&t(l,{style:h(wt||(wt=Z(["ml-1 flex-row items-center"]))),children:["sent"===a&&e(er,{style:h.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"delivered"===a&&e(Gt,{style:h.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"read"===a&&e(Gt,{style:h.style("fill-[#3B82F6] h-4 w-4",{opacity:.9})})]})]})})},rr=v.memo(tr),nr=function(n){var o,i,c,d,f,p,y,v,m=n.message,b=n.isCurrentUser,g=n.isFirstInSequence,w=n.onLongPress,x=se(),S=x.theme,P=x.showAvatars,C=x.showUserNames,O=x.showBubbleTail,I=x.setMediaUrl,A=x.setIsVideoPlaying,j=x.isVideoPlaying;return t(a,{onLongPress:w,style:[h(xt||(xt=Z(["px-2 my-1 max-w-[75%] relative"]))),h(b?St||(St=Z(["self-end mr-3"])):Pt||(Pt=Z(["self-start ml-9"]))),h(g?b?Ct||(Ct=Z(["bg-green-500 rounded-tr-none"])):Ot||(Ot=Z(["bg-white rounded-tl-none"])):b?It||(It=Z(["bg-green-500"])):At||(At=Z(["bg-white"]))),W({borderRadius:8},b?null==S||null===(o=S.bubbleStyle)||void 0===o?void 0:o.sent:null==S||null===(i=S.bubbleStyle)||void 0===i?void 0:i.received)],children:[!b&&g&&P&&t(r,{children:[e(l,{style:h(jt||(jt=Z(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:m.senderAvatar?e(u,{source:{uri:m.senderAvatar},style:[h(Et||(Et=Z(["w-full h-full rounded-full"]))),null==S||null===(c=S.bubbleStyle)||void 0===c?void 0:c.avatarImageStyle],resizeMode:"cover"}):e(s,{style:[h(Tt||(Tt=Z(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==S||null===(d=S.bubbleStyle)||void 0===d?void 0:d.avatarTextStyle],children:null===(f=m.senderName)||void 0===f?void 0:f.charAt(0)})}),C&&m.senderName&&e(s,{style:[h(Mt||(Mt=Z(["text-sm text-black font-semibold mt-1 capitalize"]))),null==S||null===(p=S.bubbleStyle)||void 0===p?void 0:p.userNameStyle],children:m.senderName})]}),g&&O&&e(oe,{style:h.style("absolute -top-1 w-6 h-6 ",b?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:b?"90deg":"180deg"}]}),color:"".concat(b?(null==S||null===(y=S.colors)||void 0===y?void 0:y.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==S||null===(v=S.colors)||void 0===v?void 0:v.receivedMessageTailColor)||"white")}),e(Kt,{message:m,isCurrentUser:b,isFirstInSequence:g,onMediaPress:function(e,t){I({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&A(!0)},isVideoPlaying:j}),e(rr,{time:m.time,status:b?m.status:void 0,isCurrentUser:b,hasText:!!m.text,hasAudio:!!m.audio})]})},or=v.memo(nr),ir=function(r){var n=r.style,o=r.color;return e(O,{style:n,viewBox:"0 0 24 24",children:t(I,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(A,{cx:"12",cy:"13",r:"3"}),e(C,{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(C,{strokeLinecap:"round",d:"M19 10h-1"})]})})},lr=function(r){var n=r.style,o=r.color;return e(P,{style:n,viewBox:"0 0 24 24",children:t(I,{fill:"none",stroke:o,children:[e(C,{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(j,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e(j,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e(C,{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(C,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},ar=function(r){var n=r.style,o=r.color;return e(P,{style:n,viewBox:"0 0 24 24",children:t(I,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(C,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e(C,{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"})]})})},sr=function(t){var r=t.style,n=t.color;return e(P,{style:r,fill:n,viewBox:"0 0 24 24",children:e(C,{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"})})},ur=function(r){var n=r.style,o=r.color;return e(P,{style:n,viewBox:"0 0 24 24",children:t(I,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(C,{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(C,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},cr=function(r){var n=r.style,o=r.fill,i=void 0===o?"currentColor":o;return t(P,{style:n,viewBox:"0 0 24 24",children:[e(C,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e(C,{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"})]})},dr=function(t){var r=t.fileName,n=t.style;return e(s,{numberOfLines:2,ellipsizeMode:"tail",style:[{fontSize:14,fontWeight:"600",color:"black"},n],children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(r)})},fr=v.memo(dr),pr=function(r){var n,o,i,c,d,f,p,y=r.previewData,h=r.closePreview,v=r.CustomFileIcon,m=r.CustomImagePreview,b=r.CustomVideoPreview,g=r.inputHeight,w=se(),x=w.theme,S=w.setMediaUrl,P=w.setIsVideoPlaying;if(!y)return null;var C=null===(n=y.type)||void 0===n?void 0:n.startsWith("image/"),O=null===(o=y.type)||void 0===o?void 0:o.startsWith("video/");return t(a,{style:[{position:"absolute",bottom:(null!=g?g:0)+8,zIndex:20,borderRadius:12},null==x||null===(i=x.filePreviewStyle)||void 0===i?void 0:i.root],onPress:function(){(C||O)&&(S({imageUrl:C?y.uri:"",videoUrl:O?y.uri:""}),O&&P(!0))},children:[e(a,{onPress:h,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e(s,{style:{fontSize:12,color:"black"},children:"X"})}),C?m?e(m,{uri:y.uri}):e(l,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e(u,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):O?b?e(b,{uri:y.uri}):e(l,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e(T,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):t(l,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==x||null===(c=x.filePreviewStyle)||void 0===c?void 0:c.container],children:[e(l,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==x||null===(d=x.filePreviewStyle)||void 0===d?void 0:d.iconContainer],children:v?e(v,{}):e(cr,{style:{width:40,height:40},fill:"white"})}),e(l,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==x||null===(f=x.filePreviewStyle)||void 0===f?void 0:f.nameContainer],children:e(fr,{fileName:y.name,style:null==x||null===(p=x.filePreviewStyle)||void 0===p?void 0:p.text})})]})]})},yr=v.memo(pr),hr="ios"===d.OS?32:30,vr=function(r){var n,o,i,s,u,c,p,y,v,b,g=r.onSendMessage,w=r.onTypingStart,P=r.onTypingEnd,C=r.onAttachmentPress,O=r.onCameraPress,I=r.onAudioRecordStart,A=r.onAudioRecordEnd,j=r.CustomEmojiIcon,E=r.CustomAttachmentIcon,T=r.CustomCameraIcon,M=r.CustomSendIcon,k=r.CustomMicrophoneIcon,R=r.CustomFileIcon,_=r.CustomImagePreview,N=r.CustomVideoPreview,z=X(m(""),2),$=z[0],V=z[1],U=X(m({height:hr,isMultiline:!1}),2),L=U[0],B=U[1],D=se(),q=D.theme,F=D.currentUserId,H=D.showEmojiButton,Y=D.showAttachmentsButton,Q=D.showCameraButton,J=D.showVoiceRecordButton,K=D.placeholder,G=D.previewData,ee=D.closePreview,te=S((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,hr),118);B({height:t,isMultiline:t>hr})}),[]),re=S((function(){var e=$.trim();(e||G)&&(g({text:e,senderId:F}),V(""),B({height:hr,isMultiline:!1}))}),[$,g,F,G]);return x((function(){$.trim()?null==w||w():null==P||P()}),[$,w,P]),t(l,{style:h(kt||(kt=Z(["w-full px-2"]))),children:[G&&e(yr,{previewData:G,closePreview:ee,CustomFileIcon:R,CustomImagePreview:_,CustomVideoPreview:N,inputHeight:L.height}),t(l,{style:[h(Rt||(Rt=Z(["flex-row items-end gap-2"]))),null==q||null===(n=q.inputStyles)||void 0===n?void 0:n.inputSectionContainerStyle],children:[t(l,{style:[h(_t||(_t=Z(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),L.isMultiline?h(Nt||(Nt=Z(["rounded-3xl items-end"]))):h(zt||(zt=Z(["rounded-full items-center"]))),null==q||null===(o=q.inputStyles)||void 0===o?void 0:o.inputContainerStyle],children:[H&&e(a,{children:j?e(j,{}):e(lr,{style:h.style("".concat("ios"===d.OS?"h-6 w-6":"w-7 h-7"),L.isMultiline?"pb-14":"pb-0"),color:(null==q||null===(i=q.colors)||void 0===i?void 0:i.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e(f,{value:$,onChangeText:V,placeholder:K||"Message",style:[h($t||($t=Z(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===d.OS?h(Vt||(Vt=Z(["text-[17px]"]))):h(Ut||(Ut=Z(["text-[16px]"]))),{minHeight:hr,maxHeight:118}],placeholderTextColor:(null==q||null===(s=q.colors)||void 0===s?void 0:s.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:te}),t(l,{style:[h(Lt||(Lt=Z(["gap-4 flex-row"]))),L.isMultiline?h(Bt||(Bt=Z(["pb-4"]))):h(Dt||(Dt=Z(["pb-0"])))],children:[Y&&e(a,{onPress:C,children:E?e(E,{}):e(sr,{style:h.style("ios"===d.OS?"h-6 w-6":"w-7 h-7"),color:(null==q||null===(u=q.colors)||void 0===u?void 0:u.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Q&&!$.trim()&&e(a,{onPress:O,children:T?e(T,{}):e(ir,{style:h.style("ios"===d.OS?"h-6 w-6":"w-7 h-7"),color:(null==q||null===(c=q.colors)||void 0===c?void 0:c.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e(a,{style:[h(qt||(qt=Z(["p-2 rounded-full bg-green-600 justify-center items-center"]))),W({height:"ios"===d.OS?50:48,width:"ios"===d.OS?50:48},null==q||null===(p=q.inputStyles)||void 0===p?void 0:p.sendButtonStyle)],onPress:$.trim()||G?re:I,onLongPress:I,onPressOut:A,children:$.trim()?M?e(M,{}):e(ur,{style:h.style("h-6 w-6"),color:(null==q||null===(y=q.colors)||void 0===y?void 0:y.sendIconsColor)||"rgba(255,255,255,0.7)"}):J?k?e(k,{}):e(ar,{style:h.style("h-8 w-8"),color:(null==q||null===(v=q.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):M?e(M,{}):e(ur,{style:h.style("h-6 w-6"),color:(null==q||null===(b=q.colors)||void 0===b?void 0:b.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},mr=v.memo(vr);function br(r){var n=r.style;return t(O,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:h.style("h-6 w-6 text-black",n),children:[e(E,{x1:"18",y1:"6",x2:"6",y2:"18"}),e(E,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var gr,wr,xr,Sr,Pr,Cr,Or,Ir,Ar,jr,Er,Tr=function(n){var o=n.imageUrl,i=n.videoUrl,u=n.onClose,c=w(null),d=X(m(!1),2),f=d[0],y=d[1],v=X(m(!1),2),b=v[0],g=v[1];return o||i?e(p,{visible:!!o||!!i,transparent:!0,children:t(l,{style:h(Ft||(Ft=Z(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e(a,{onPress:u,style:h(Wt||(Wt=Z(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e(br,{style:h(Ht||(Ht=Z(["h-8 w-8"])))})}),o&&e(z,{imageUrls:[{url:o}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return o},renderIndicator:function(){return e(r,{})}}),i&&t(l,{style:h(Yt||(Yt=Z(["justify-center items-center"]))),children:[e(T,{source:{uri:i},ref:c,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){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)}}),f&&e(l,{style:h(Xt||(Xt=Z(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e(ue,{style:h.style("h-12 w-12"),spinning:!0})}),b&&e(l,{style:h(Zt||(Zt=Z(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e(s,{style:h(Qt||(Qt=Z(["text-white font-bold"]))),children:"Failed to load video"})})]})]})}):null},Mr=v.memo(Tr),kr=function(r){var n,o,i,a,c=r.typingUsers,d=r.currentUserId,f=se(),p=f.theme,y=f.showAvatars,v=f.renderCustomTyping,m=f.showBubbleTail,b=c.filter((function(e){return e.id!==d}));if(!b.length)return null;var g=b.slice(0,2),w=b.length-2;return t(l,{style:h(gr||(gr=Z(["my-1 max-w-[75%] self-start flex-row"]))),children:[y&&t(l,{style:h(wr||(wr=Z(["flex-row"]))),children:[g.map((function(t,r){var n,o,i;return e(l,{style:[h(xr||(xr=Z(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:r>0?-10:0,zIndex:g.length+r}],children:t.avatar?e(u,{source:{uri:t.avatar},style:[h(Sr||(Sr=Z(["w-full h-full object-cover rounded-full"]))),null==p||null===(n=p.bubbleStyle)||void 0===n?void 0:n.avatarImageStyle]}):e(s,{style:[h(Pr||(Pr=Z(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==p||null===(o=p.bubbleStyle)||void 0===o?void 0:o.avatarTextStyle],children:null===(i=t.name)||void 0===i?void 0:i.charAt(0)})},t.id)})),w>0&&e(l,{style:[h(Cr||(Cr=Z(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},W({},null==p||null===(n=p.bubbleStyle)||void 0===n?void 0:n.additionalTypingUsersContainerStyle)],children:t(s,{style:[h(Or||(Or=Z(["text-white text-xs font-semibold"]))),null==p||null===(o=p.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersTextStyle],children:["+",w]})})]}),m&&e(oe,{style:h.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==p||null===(i=p.colors)||void 0===i?void 0:i.receivedMessageTailColor)||"white")}),e(l,{style:[h(Ir||(Ir=Z(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==p||null===(a=p.bubbleStyle)||void 0===a?void 0:a.typingContainerStyle],children:v?v():e(l,{style:h(Ar||(Ar=Z(["flex-row items-center py-3 px-2 justify-center"]))),children:e(s,{style:h(jr||(jr=Z(["text-gray-600"]))),children:"Typing..."})})})]})},Rr=function(){var r=se(),n=r.messages,o=r.currentUserId,i=r.onMessageLongPress,a=r.mediaUrl,s=r.setMediaUrl,u=r.setIsVideoPlaying,c=r.typingUsers,d=r.onSendMessage,f=r.onTypingStart,p=r.onTypingEnd,v=r.onAttachmentPress,m=r.onAudioRecordEnd,b=r.onAudioRecordStart,g=r.onCameraPress,w=r.renderCustomInput,x=r.CustomEmojiIcon,S=r.CustomAttachmentIcon,P=r.CustomCameraIcon,C=r.CustomMicrophoneIcon,O=r.CustomSendIcon,I=r.CustomFileIcon,A=r.CustomImagePreview,j=r.CustomVideoPreview;return t(l,{style:h(Er||(Er=Z(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e(y,{data:n,keyExtractor:function(e){return e.id},renderItem:function(t){var r,l=t.item,a=t.index;return e(or,{message:l,isCurrentUser:l.senderId===o,onLongPress:function(){return null==i?void 0:i(l)},isFirstInSequence:a===n.length-1||(null===(r=n[a+1])||void 0===r?void 0:r.senderId)!==l.senderId})},ListHeaderComponent:e(kr,{typingUsers:c||[],currentUserId:o}),showsVerticalScrollIndicator:!1,inverted:!0}),w?w():e(mr,{onSendMessage:d,onTypingStart:f,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:m,onAudioRecordStart:b,onCameraPress:g,CustomEmojiIcon:x,CustomAttachmentIcon:S,CustomCameraIcon:P,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:I,CustomImagePreview:A,CustomVideoPreview:j}),e(Mr,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){s({imageUrl:"",videoUrl:""}),u(!1)}})]})},_r=function(t){return e(ye,{children:e(ae,W(W({},t),{},{children:e(Rr,{})}))})};export{_r as default};
|
|
14
|
+
*/function We(){if(Te)return Ee;Te=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return Ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),u=1;u<arguments.length;u++){for(var s in i=Object(arguments[u]))t.call(i,s)&&(a[s]=i[s]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(a[l[c]]=i[l[c]])}}return a},Ee}function He(){if(Re)return Me;Re=1;return Me="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ye(){return Ne?_e:(Ne=1,_e=Function.call.bind(Object.prototype.hasOwnProperty))}function Xe(){if(Ve)return ze;Ve=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=He(),r={},n=Ye();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,a,u){if("production"!==process.env.NODE_ENV)for(var s in o)if(n(o,s)){var c;try{if("function"!=typeof o[s]){var d=Error((a||"React class")+": "+l+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[s](i,s,a,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((a||"React class")+": type specification of "+l+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=u?u():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ze=o}function Ze(){if(Ue)return $e;Ue=1;var e=qe(),t=We(),r=He(),n=Ye(),o=Xe(),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){}}),$e=function(a,u){var s="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(l),arrayOf:function(e){return y((function(t,n,o,i,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new p("Invalid "+i+" `"+l+"` of type `"+b(a)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,o,i,l+"["+u+"]",r);if(s instanceof Error)return s}return null}))},element:y((function(e,t,r,n,o){var i=e[t];return a(i)?null:new p("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:y((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new p("Invalid "+o+" `"+i+"` of type `"+(((a=t[r]).constructor&&a.constructor.name?a.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var a;return null}))},node:y((function(e,t,r,n,o){return m(e[t])?null:new p("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(t,o,i,l,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=t[o],s=b(u);if("object"!==s)return new p("Invalid "+l+" `"+a+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var c in u)if(n(u,c)){var d=e(u,c,i,l,a+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return y((function(t,r,n,o,i){for(var l=t[r],a=0;a<e.length;a++)if(f(l,e[a]))return null;var u=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+u+".")}))},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 "+w(o)+" at index "+t+"."),l}return y((function(t,o,i,l,a){for(var u=[],s=0;s<e.length;s++){var c=(0,e[s])(t,o,i,l,a,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&u.push(c.data.expectedType)}return new p("Invalid "+l+" `"+a+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return y((function(t,n,o,i,l){var a=t[n],u=b(a);if("object"!==u)return new p("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var c=e[s];if("function"!=typeof c)return h(o,i,l,s,g(c));var d=c(a,s,o,i,l+"."+s,r);if(d)return d}return null}))},exact:function(e){return y((function(o,i,l,a,u){var s=o[i],c=b(s);if("object"!==c)return new p("Invalid "+a+" `"+u+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var y=e[f];if(n(e,f)&&"function"!=typeof y)return h(l,a,u,f,g(y));if(!y)return new p("Invalid "+a+" `"+u+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=y(s,f,l,a,u+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,a,s,d,f,y){if(s=s||c,f=f||a,y!==r){if(u){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=s+":"+a;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[a]?o?null===l[a]?new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(l,a,s,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return y((function(t,r,n,o,i,l){var a=t[r];return b(a)!==e?new p("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new p((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||a(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function g(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(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 p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},$e}function Qe(){if(Fe)return Le;Fe=1;var e=He();function t(){}function r(){}return r.resetWarningCache=t,Le=function(){function n(t,r,n,o,i,l){if(l!==e){var a=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 a.name="Invariant Violation",a}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function Je(){if(Be)return Oe.exports;if(Be=1,"production"!==process.env.NODE_ENV){var e=qe();Oe.exports=Ze()(e.isElement,true)}else Oe.exports=Qe()();return Oe.exports}var Ke,Ge,et,tt,rt,nt,ot,it,lt,at,ut,st,ct,dt=Ce(Je()),ft=function(){return B((function e(t,r){F(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,a=[],u=t.children,s=0;for(r.pattern.lastIndex=0;u&&(o=r.pattern.exec(u));){var c=u.substr(0,o.index);if(s=o.index,++l>i)break;a.push({children:c}),a.push(e.getMatchedPart(r,o[0],o,s)),u=u.substr(o.index+o[0].length),s+=o[0].length-1,r.pattern.lastIndex=0}a.push({children:u}),n.push.apply(n,a)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),Y(Y({},o),{},{children:i,_matched:!0})}}])}(),pt=["type"],yt=["style"],vt=["parse","childrenProps"],ht={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+/},mt=dt.shape(Y(Y({},s.propTypes),{},{type:dt.oneOf(Object.keys(ht)).isRequired,nonExhaustiveMaxMatchCount:dt.number})),bt=dt.shape(Y(Y({},s.propTypes),{},{pattern:dt.oneOfType([dt.string,dt.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:dt.number})),gt=function(){function t(){return F(this,t),L(this,t,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&&Z(e,t)}(t,b.Component),B(t,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=X(e,pt);if(t){if(!ht[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=ht[t]}return r}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new ft(this.props.children,this.getPatterns()).parse().map((function(r,n){var o=t.props.style,i=r.style,l=X(r,yt);return e(s,Y(Y({style:[o,i]},t.props.childrenProps),l),"parsedText-".concat(n))})):this.props.children}},{key:"render",value:function(){var t=this,r=Y({},this.props);r.parse,r.childrenProps;var n=X(r,vt);return e(s,Y(Y({ref:function(e){return t._root=e}},n),{},{children:this.getParsedText()}))}}])}();gt.displayName="ParsedText",gt.propTypes=Y(Y({},s.propTypes),{},{parse:dt.arrayOf(dt.oneOfType([mt,bt])),childrenProps:dt.shape(s.propTypes)}),gt.defaultProps={parse:null,childrenProps:{}};var wt,xt,St,Ct,Pt,Ot,It,At,jt,kt,Et,Tt,Mt,Rt,_t,Nt,zt,Vt,$t,Ut,Lt,Ft,Bt,Dt,qt,Wt,Ht,Yt,Xt,Zt,Qt,Jt,Kt,Gt,er,tr,rr=function(n){var o,i,l,f,p=n.message,y=n.onMediaPress,v=n.isVideoPlaying,h=n.isCurrentUser,g=ne(),w=g.theme,x=g.showMessageStatus,S=g.CustomPlayIcon,C=g.renderCustomVideoBubbleError,P=b.useRef(null),O=Q(b.useState(0),2),I=O[0],A=O[1],j=Q(b.useState(!1),2),k=j[0],E=j[1],T=Q(b.useState(!1),2),R=T[0],_=T[1];return t(a,{children:[p.image&&e(u,{onPress:function(){return y("image",p.image)},style:m(Ke||(Ke=J(["w-60 h-80 my-2"]))),children:e(c,{source:{uri:p.image},style:m(Ge||(Ge=J(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),p.video&&t(u,{onPress:function(){return y("video",p.video)},style:m(et||(et=J(["w-60 h-80 my-2 justify-center items-center"]))),disabled:k,children:[e(M,{source:{uri:p.video},ref:P,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){E(!0),_(!1)},onLoad:function(e){A(e.duration),E(!1)},onBuffer:function(e){var t=e.isBuffering;return E(t)},onError:function(){_(!0),E(!1)}}),k?e(a,{style:m(tt||(tt=J(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e(ye,{style:m.style("h-12 w-12"),spinning:!0})}):R?C?C():e(a,{style:m(rt||(rt=J(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e(s,{style:le(m(nt||(nt=J(["text-white font-bold"]))),null==w?void 0:w.fontFamily),children:"Failed to load video"})}):t(r,{children:[e(a,{style:m(ot||(ot=J(["absolute bg-black/40 rounded-full"]))),children:S?e(S,{}):e(ve,{style:m.style("h-16 w-16"),color:(null==w||null===(o=w.colors)||void 0===o?void 0:o.audioPlayIconColor)||"white"})}),e(a,{style:m(it||(it=J(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e(s,{style:m(lt||(lt=J(["text-white text-xs font-semibold"]))),children:he(I)})})]})]}),p.audio&&e(a,{style:m(at||(at=J(["my-2"]))),children:e(Se,{audioUrl:p.audio,audioId:p.id,isVideoPlaying:v})}),p.text&&e(gt,{style:le([m(ut||(ut=J(["pt-1"]))),m(x?st||(st=J(["pb-0"])):ct||(ct=J(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},h?null==w||null===(i=w.messageStyle)||void 0===i?void 0:i.sentTextStyle:null==w||null===(l=w.messageStyle)||void 0===l?void 0:l.receivedTextStyle],null==w?void 0:w.fontFamily),parse:[{type:"url",style:Y({color:"blue",textDecorationLine:"underline"},(f=null==w?void 0:w.fontFamily,f?{fontFamily:f}:void 0)),onPress:function(e){return d.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:p.text})]})},nr=b.memo(rr),or=function(t){var r=t.style,n=t.fill;return e(O,{style:r,viewBox:"0 0 24 24",children:e(I,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},ir=function(t){var r=t.style,n=t.fill;return e(O,{style:r,viewBox:"0 0 24 24",children:e(I,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},lr=function(n){var o,i,l,u,c=n.time,d=n.status,f=n.isCurrentUser,p=n.hasText,y=n.hasAudio,v=ne(),h=v.theme,b=v.showMessageStatus;return e(r,{children:b&&t(a,{style:[m(wt||(wt=J(["flex-row items-center"]))),m(p?xt||(xt=J(["justify-end pb-1 ml-4"])):y?St||(St=J(["absolute right-3 bottom-3"])):Ct||(Ct=J(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e(s,{style:le([m(Pt||(Pt=J(["text-xs"]))),{color:p||y?(null==h||null===(o=h.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==h?void 0:h.fontFamily),children:c}),f&&t(a,{style:m(Ot||(Ot=J(["ml-1 flex-row items-center"]))),children:["sent"===d&&e(ir,{style:m.style("h-4 w-4",{opacity:.7}),fill:(null==h||null===(i=h.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===d&&e(or,{style:m.style("h-4 w-4",{opacity:.7}),fill:(null==h||null===(l=h.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===d&&e(or,{style:m.style("h-4 w-4",{opacity:.9}),fill:(null==h||null===(u=h.colors)||void 0===u?void 0:u.readIconColor)||"#3B82F6"})]})]})})},ar=b.memo(lr),ur=function(n){var o,i,l,d,f,p,y,v,h=n.message,b=n.isCurrentUser,g=n.isFirstInSequence,w=n.onLongPress,x=ne(),S=x.theme,C=x.showAvatars,P=x.showUserNames,O=x.showBubbleTail,I=x.setMediaUrl,A=x.setIsVideoPlaying,j=x.isVideoPlaying;return t(u,{onLongPress:w,style:[m(It||(It=J(["px-2 my-1 max-w-[75%] relative"]))),m(b?At||(At=J(["self-end mr-3"])):jt||(jt=J(["self-start ml-9"]))),m(g?b?kt||(kt=J(["bg-green-500 rounded-tr-none"])):Et||(Et=J(["bg-white rounded-tl-none"])):b?Tt||(Tt=J(["bg-green-500"])):Mt||(Mt=J(["bg-white"]))),Y({borderRadius:8},b?null==S||null===(o=S.bubbleStyle)||void 0===o?void 0:o.sent:null==S||null===(i=S.bubbleStyle)||void 0===i?void 0:i.received)],children:[!b&&g&&C&&t(r,{children:[e(a,{style:m(Rt||(Rt=J(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e(c,{source:{uri:h.senderAvatar},style:[m(_t||(_t=J(["w-full h-full rounded-full"]))),null==S||null===(l=S.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e(s,{style:le([m(Nt||(Nt=J(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==S||null===(d=S.bubbleStyle)||void 0===d?void 0:d.avatarTextStyle],null==S?void 0:S.fontFamily),children:null===(f=h.senderName)||void 0===f?void 0:f.charAt(0)})}),P&&h.senderName&&e(s,{style:le([m(zt||(zt=J(["text-sm text-black font-semibold mt-1 capitalize"]))),null==S||null===(p=S.bubbleStyle)||void 0===p?void 0:p.userNameStyle],null==S?void 0:S.fontFamily),children:h.senderName})]}),g&&O&&e(G,{style:m.style("absolute -top-1 w-6 h-6 ",b?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:b?"90deg":"180deg"}]}),color:"".concat(b?(null==S||null===(y=S.colors)||void 0===y?void 0:y.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==S||null===(v=S.colors)||void 0===v?void 0:v.receivedMessageTailColor)||"white")}),e(nr,{message:h,isCurrentUser:b,isFirstInSequence:g,onMediaPress:function(e,t){I({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&A(!0)},isVideoPlaying:j}),e(ar,{time:h.time,status:b?h.status:void 0,isCurrentUser:b,hasText:!!h.text,hasAudio:!!h.audio})]})},sr=b.memo(ur),cr=function(r){var n=r.style,o=r.color;return e(A,{style:n,viewBox:"0 0 24 24",children:t(j,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(k,{cx:"12",cy:"13",r:"3"}),e(I,{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(I,{strokeLinecap:"round",d:"M19 10h-1"})]})})},dr=function(r){var n=r.style,o=r.color;return e(O,{style:n,viewBox:"0 0 24 24",children:t(j,{fill:"none",stroke:o,children:[e(I,{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(E,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e(E,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e(I,{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(I,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},fr=function(r){var n=r.style,o=r.color;return e(O,{style:n,viewBox:"0 0 24 24",children:t(j,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(I,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e(I,{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"})]})})},pr=function(t){var r=t.style,n=t.color;return e(O,{style:r,fill:n,viewBox:"0 0 24 24",children:e(I,{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"})})},yr=function(r){var n=r.style,o=r.color;return e(O,{style:n,viewBox:"0 0 24 24",children:t(j,{fill:"none",strokeWidth:"1.5",stroke:o,children:[e(I,{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(I,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},vr=function(r){var n=r.style,o=r.fill,i=void 0===o?"currentColor":o;return t(O,{style:n,viewBox:"0 0 24 24",children:[e(I,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e(I,{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"})]})},hr=function(t){var r=t.fileName,n=t.style,o=ne().theme;return e(s,{numberOfLines:2,ellipsizeMode:"tail",style:le([{fontSize:14,fontWeight:"600",color:"black"},n],null==o?void 0:o.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(r)})},mr=b.memo(hr),br=function(r){var n,o,i,l,d,f,p,y=r.previewData,v=r.closePreview,h=r.CustomFileIcon,m=r.CustomImagePreview,b=r.CustomVideoPreview,g=r.inputHeight,w=ne(),x=w.theme,S=w.setMediaUrl,C=w.setIsVideoPlaying;if(!y)return null;var P=null===(n=y.type)||void 0===n?void 0:n.startsWith("image/"),O=null===(o=y.type)||void 0===o?void 0:o.startsWith("video/");return t(u,{style:[{position:"absolute",bottom:(null!=g?g:0)+8,zIndex:20,borderRadius:12},null==x||null===(i=x.filePreviewStyle)||void 0===i?void 0:i.root],onPress:function(){(P||O)&&(S({imageUrl:P?y.uri:"",videoUrl:O?y.uri:""}),O&&C(!0))},children:[e(u,{onPress:v,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e(s,{style:le({fontSize:12,color:"black"},null==x?void 0:x.fontFamily),children:"X"})}),P?m?e(m,{uri:y.uri}):e(a,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e(c,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):O?b?e(b,{uri:y.uri}):e(a,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e(M,{source:{uri:y.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):t(a,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==x||null===(l=x.filePreviewStyle)||void 0===l?void 0:l.container],children:[e(a,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==x||null===(d=x.filePreviewStyle)||void 0===d?void 0:d.iconContainer],children:h?e(h,{}):e(vr,{style:{width:40,height:40},fill:"white"})}),e(a,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==x||null===(f=x.filePreviewStyle)||void 0===f?void 0:f.nameContainer],children:e(mr,{fileName:y.name,style:null==x||null===(p=x.filePreviewStyle)||void 0===p?void 0:p.text})})]})]})},gr=b.memo(br),wr="ios"===n.OS?32:30,xr=function(r){var o,i,l,s,c,d,p,y,v,h,b,w,x,S,O=r.onSendMessage,I=r.onTypingStart,A=r.onTypingEnd,j=r.onAttachmentPress,k=r.onCameraPress,E=r.onAudioRecordStart,T=r.onAudioRecordEnd,M=r.CustomEmojiIcon,R=r.CustomAttachmentIcon,_=r.CustomCameraIcon,N=r.CustomSendIcon,z=r.CustomMicrophoneIcon,V=r.CustomFileIcon,$=r.CustomImagePreview,U=r.CustomVideoPreview,L=Q(g(""),2),F=L[0],B=L[1],D=Q(g({height:wr,isMultiline:!1}),2),q=D[0],W=D[1],H=ne(),X=H.theme,Z=H.currentUserId,K=H.showEmojiButton,G=H.showAttachmentsButton,ee=H.showCameraButton,te=H.showVoiceRecordButton,re=H.placeholder,oe=H.previewData,ae=H.closePreview,ue=ie(null==X||null===(o=X.sizes)||void 0===o?void 0:o.inputIconSize,q.isMultiline?"pb-14":void 0),se=ie(null==X||null===(i=X.sizes)||void 0===i?void 0:i.inputIconSize),ce=ie(null==X||null===(l=X.sizes)||void 0===l?void 0:l.inputIconSize),de=P((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,wr),118);W({height:t,isMultiline:t>wr})}),[]),fe=P((function(){var e=F.trim();(e||oe)&&(O({text:e,senderId:Z}),B(""),W({height:wr,isMultiline:!1}))}),[F,O,Z,oe]);return C((function(){F.trim()?null==I||I():null==A||A()}),[F,I,A]),t(a,{style:m(Vt||(Vt=J(["w-full px-2"]))),children:[oe&&e(gr,{previewData:oe,closePreview:ae,CustomFileIcon:V,CustomImagePreview:$,CustomVideoPreview:U,inputHeight:q.height}),t(a,{style:[m($t||($t=J(["flex-row items-end gap-2"]))),null==X||null===(s=X.inputStyles)||void 0===s?void 0:s.inputSectionContainerStyle],children:[t(a,{style:[m(Ut||(Ut=J(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),q.isMultiline?m(Lt||(Lt=J(["rounded-3xl items-end"]))):m(Ft||(Ft=J(["rounded-full items-center"]))),null==X||null===(c=X.inputStyles)||void 0===c?void 0:c.inputContainerStyle],children:[K&&e(u,{children:M?e(M,{}):e(dr,{style:ue,color:(null==X||null===(d=X.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e(f,{value:F,onChangeText:B,placeholder:re||"Message",style:le([m(Bt||(Bt=J(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===n.OS?m(Dt||(Dt=J(["text-[17px]"]))):m(qt||(qt=J(["text-[16px]"]))),{minHeight:wr,maxHeight:118},{color:(null==X||null===(p=X.colors)||void 0===p?void 0:p.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==X?void 0:X.fontFamily),placeholderTextColor:(null==X||null===(y=X.colors)||void 0===y?void 0:y.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:de}),t(a,{style:[m(Wt||(Wt=J(["gap-4 flex-row"]))),q.isMultiline?m(Ht||(Ht=J(["pb-4"]))):m(Yt||(Yt=J(["pb-0"])))],children:[G&&e(u,{onPress:j,children:R?e(R,{}):e(pr,{style:se,color:(null==X||null===(v=X.colors)||void 0===v?void 0:v.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),ee&&!F.trim()&&e(u,{onPress:k,children:_?e(_,{}):e(cr,{style:se,color:(null==X||null===(h=X.colors)||void 0===h?void 0:h.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e(u,{style:[m(Xt||(Xt=J(["p-2 rounded-full bg-green-600 justify-center items-center"]))),Y({height:"ios"===n.OS?50:48,width:"ios"===n.OS?50:48},null==X||null===(b=X.inputStyles)||void 0===b?void 0:b.sendButtonStyle)],onPress:F.trim()||oe?fe:E,onLongPress:E,onPressOut:T,children:F.trim()?N?e(N,{}):e(yr,{style:ce,color:(null==X||null===(w=X.colors)||void 0===w?void 0:w.sendIconsColor)||"rgba(255,255,255,0.7)"}):te?z?e(z,{}):e(fr,{style:ce,color:(null==X||null===(x=X.colors)||void 0===x?void 0:x.sendIconsColor)||"rgba(255,255,255,0.7)"}):N?e(N,{}):e(yr,{style:ce,color:(null==X||null===(S=X.colors)||void 0===S?void 0:S.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Sr=b.memo(xr);function Cr(r){var n=r.style;return t(A,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:m.style("h-6 w-6 text-black",n),children:[e(T,{x1:"18",y1:"6",x2:"6",y2:"18"}),e(T,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Pr,Or,Ir,Ar,jr,kr,Er,Tr,Mr,Rr,_r,Nr,zr,Vr,$r=function(n){var o=n.imageUrl,i=n.videoUrl,l=n.onClose,c=ne().theme,d=S(null),f=Q(g(!1),2),y=f[0],v=f[1],h=Q(g(!1),2),b=h[0],w=h[1];return o||i?e(p,{visible:!!o||!!i,transparent:!0,children:t(a,{style:m(Zt||(Zt=J(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e(u,{onPress:l,style:m(Qt||(Qt=J(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e(Cr,{style:m(Jt||(Jt=J(["h-8 w-8"])))})}),o&&e($,{imageUrls:[{url:o}],enableSwipeDown:!0,onSwipeDown:l,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return o},renderIndicator:function(){return e(r,{})}}),i&&t(a,{style:m(Kt||(Kt=J(["justify-center items-center"]))),children:[e(M,{source:{uri:i},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){v(!0),w(!1)},onLoad:function(){return v(!1)},onBuffer:function(e){var t=e.isBuffering;return v(t)},onError:function(){w(!0),v(!1)}}),y&&e(a,{style:m(Gt||(Gt=J(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e(ye,{style:m.style("h-12 w-12"),spinning:!0})}),b&&e(a,{style:m(er||(er=J(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e(s,{style:le(m(tr||(tr=J(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},Ur=b.memo($r),Lr=function(r){var n,o,i,l,u=r.typingUsers,d=r.currentUserId,f=ne(),p=f.theme,y=f.showAvatars,v=f.renderCustomTyping,h=f.showBubbleTail,b=u.filter((function(e){return e.id!==d}));if(!b.length)return null;var g=b.slice(0,2),w=b.length-2;return t(a,{style:m(Pr||(Pr=J(["my-1 max-w-[75%] self-start flex-row"]))),children:[y&&t(a,{style:m(Or||(Or=J(["flex-row"]))),children:[g.map((function(t,r){var n,o,i;return e(a,{style:[m(Ir||(Ir=J(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:r>0?-10:0,zIndex:g.length+r}],children:t.avatar?e(c,{source:{uri:t.avatar},style:[m(Ar||(Ar=J(["w-full h-full object-cover rounded-full"]))),null==p||null===(n=p.bubbleStyle)||void 0===n?void 0:n.avatarImageStyle]}):e(s,{style:le([m(jr||(jr=J(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==p||null===(o=p.bubbleStyle)||void 0===o?void 0:o.avatarTextStyle],null==p?void 0:p.fontFamily),children:null===(i=t.name)||void 0===i?void 0:i.charAt(0)})},t.id)})),w>0&&e(a,{style:[m(kr||(kr=J(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},Y({},null==p||null===(n=p.bubbleStyle)||void 0===n?void 0:n.additionalTypingUsersContainerStyle)],children:t(s,{style:le([m(Er||(Er=J(["text-white text-xs font-semibold"]))),null==p||null===(o=p.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersTextStyle],null==p?void 0:p.fontFamily),children:["+",w]})})]}),h&&e(G,{style:m.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==p||null===(i=p.colors)||void 0===i?void 0:i.receivedMessageTailColor)||"white")}),e(a,{style:[m(Tr||(Tr=J(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==p||null===(l=p.bubbleStyle)||void 0===l?void 0:l.typingContainerStyle],children:v?v():e(a,{style:m(Mr||(Mr=J(["flex-row items-center py-3 px-2 justify-center"]))),children:e(s,{style:le(m(Rr||(Rr=J(["text-gray-600"]))),null==p?void 0:p.fontFamily),children:"Typing..."})})})]})};var Fr=function(){var r=ne(),o=r.messages,i=r.currentUserId,l=r.onMessageLongPress,u=r.mediaUrl,s=r.setMediaUrl,c=r.setIsVideoPlaying,d=r.typingUsers,f=r.onSendMessage,p=r.onTypingStart,b=r.onTypingEnd,w=r.onAttachmentPress,x=r.onAudioRecordEnd,S=r.onAudioRecordStart,P=r.onCameraPress,O=r.renderCustomInput,I=r.CustomEmojiIcon,A=r.CustomAttachmentIcon,j=r.CustomCameraIcon,k=r.CustomMicrophoneIcon,E=r.CustomSendIcon,T=r.CustomFileIcon,M=r.CustomImagePreview,R=r.CustomVideoPreview,_=r.keyboardVerticalOffset,N=void 0===_?0:_,z=r.disableKeyboardAvoiding,V=void 0!==z&&z,$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Q(g(0),2),o=r[0],i=r[1];return C((function(){if(t){var r="ios"===n.OS?"keyboardWillShow":"keyboardDidShow",o="ios"===n.OS?"keyboardWillHide":"keyboardDidHide",l=y.addListener(r,(function(t){var r=t.endCoordinates.height;i(Math.max(0,r-e))})),a=y.addListener(o,(function(){return i(0)}));return function(){l.remove(),a.remove()}}i(0)}),[e,t]),t?o:0}(N,!V),U=t(a,{style:[m(_r||(_r=J(["flex-1 px-2 pb-4 gap-2 relative"]))),!V&&$>0?{paddingBottom:$+16}:void 0],children:[e(v,{style:m(Nr||(Nr=J(["flex-1"]))),data:o,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,a=t.index;return e(sr,{message:n,isCurrentUser:n.senderId===i,onLongPress:function(){return null==l?void 0:l(n)},isFirstInSequence:a===o.length-1||(null===(r=o[a+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e(Lr,{typingUsers:d||[],currentUserId:i}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),O?O():e(Sr,{onSendMessage:f,onTypingStart:p,onTypingEnd:b,onAttachmentPress:w,onAudioRecordEnd:x,onAudioRecordStart:S,onCameraPress:P,CustomEmojiIcon:I,CustomAttachmentIcon:A,CustomCameraIcon:j,CustomMicrophoneIcon:k,CustomSendIcon:E,CustomFileIcon:T,CustomImagePreview:M,CustomVideoPreview:R}),e(Ur,{imageUrl:u.imageUrl,videoUrl:u.videoUrl,onClose:function(){s({imageUrl:"",videoUrl:""}),c(!1)}})]});return V?e(a,{style:m(zr||(zr=J(["flex-1"]))),children:U}):e(h,{style:m(Vr||(Vr=J(["flex-1"]))),behavior:"ios"===n.OS?"padding":void 0,keyboardVerticalOffset:N,children:U})},Br=function(t){return e(ge,{children:e(re,Y(Y({},t),{},{children:e(Fr,{})}))})};export{Br as default};
|
|
15
15
|
//# sourceMappingURL=index.js.map
|