movius-chats 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -259,7 +259,7 @@ Older messages sit at higher indices and appear higher on screen.
259
259
  | `onSendMessage` | `(msg: Omit<Message, 'id' \| 'time' \| 'status'>) => void` | Yes | Fired when user taps send with text and/or `previewData` |
260
260
  | `onMessageLongPress` | `(message: Message) => void` | No | Long-press on a bubble (reply, delete, etc.) |
261
261
  | `placeholder` | `string` | No | Input placeholder (default: `"Message"`) |
262
- | `keyboardVerticalOffset` | `number` | No | Subtract from keyboard height (header + tab bar + safe area). Default: `0` |
262
+ | `keyboardVerticalOffset` | `number` | No | **iOS only:** header offset for `KeyboardAvoidingView`. Default: `0` |
263
263
  | `disableKeyboardAvoiding` | `boolean` | No | Set `true` if your screen already handles the keyboard |
264
264
 
265
265
  ### Feature flags
@@ -407,7 +407,7 @@ Use either **pixels** (recommended) or **twrnc classes**:
407
407
  <ChatScreen
408
408
  theme={{
409
409
  sizes: {
410
- inputIconSize: 28, // 28×28 px — attachment, camera, emoji, send, mic
410
+ inputIconSize: 28, // 28×28 px — emoji, attachment, camera only
411
411
  // inputIconSize: 'h-8 w-8', // alternative: tailwind classes via twrnc
412
412
  },
413
413
  }}
@@ -419,17 +419,20 @@ Use either **pixels** (recommended) or **twrnc classes**:
419
419
  The package lifts the chat when the keyboard opens (keyboard listeners + `KeyboardAvoidingView` on iOS).
420
420
 
421
421
  1. Wrap `ChatScreen` in a parent with `flex: 1` (e.g. `SafeAreaView style={{ flex: 1 }}`).
422
- 2. Set `keyboardVerticalOffset` to your header + top inset (try `60`–`100` on iOS with a stack header):
422
+ 2. Wrap `ChatScreen` in `<View style={{ flex: 1 }}>` and give the screen root `flex: 1`.
423
+ 3. **iOS only:** set `keyboardVerticalOffset` to header + status bar (e.g. `insets.top + 44`). **Android:** omit or use `0` — the package lifts the input by the full keyboard height.
423
424
 
424
425
  ```tsx
425
426
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
426
427
 
427
428
  const insets = useSafeAreaInsets();
428
429
 
429
- <ChatScreen
430
- keyboardVerticalOffset={insets.top + 44}
431
- // ...
432
- />
430
+ <View style={{ flex: 1 }}>
431
+ <ChatScreen
432
+ keyboardVerticalOffset={Platform.OS === 'ios' ? insets.top + 44 : 0}
433
+ // ...
434
+ />
435
+ </View>
433
436
  ```
434
437
 
435
438
  3. **Android (Expo):** in `app.json`:
@@ -11,5 +11,5 @@
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function ve(){if(te)return ee;te=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},ee}function he(){if(ne)return re;ne=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function me(){return ie?oe:(ie=1,oe=Function.call.bind(Object.prototype.hasOwnProperty))}function be(){if(se)return le;se=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=he(),r={},n=me();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},le=o}function xe(){if(ue)return ae;ue=1;var e=pe(),t=ve(),r=he(),n=me(),o=be(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ae=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(l),arrayOf:function(e){return p((function(t,n,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new y("Invalid "+i+" `"+l+"` of type `"+b(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:p((function(e,t,r,n,o){var i=e[t];return s(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:p((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:p((function(e,t,r,n,o){return m(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,s){if("function"!=typeof e)return new y("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=b(a);if("object"!==u)return new y("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return p((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new y("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,n,o,i,l){var s=t[n],a=b(s);if("object"!==a)return new y("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,s,a){var u=o[i],c=b(u);if("object"!==c)return new y("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(n(e,f)&&"function"!=typeof p)return h(l,s,a,f,x(p));if(!p)return new y("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=p(u,f,l,s,a+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,p){if(u=u||c,f=f||s,p!==r){if(a){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+s;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[s]?o?null===l[s]?new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return p((function(t,r,n,o,i,l){var s=t[r];return b(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new y((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ae}function ge(){if(de)return ce;de=1;var e=he();function t(){}function r(){}return r.resetWarningCache=t,ce=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function we(){if(fe)return Z.exports;if(fe=1,"production"!==process.env.NODE_ENV){var e=pe();Z.exports=xe()(e.isElement,true)}else Z.exports=ge()();return Z.exports}var je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,ke,Me,Ve,Re,_e=Y(we()),Ne=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),ze=["type"],$e=["style"],Le=["parse","childrenProps"],Ue={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Fe=_e.shape(m(m({},t.Text.propTypes),{},{type:_e.oneOf(Object.keys(Ue)).isRequired,nonExhaustiveMaxMatchCount:_e.number})),Be=_e.shape(m(m({},t.Text.propTypes),{},{pattern:_e.oneOfType([_e.string,_e.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:_e.number})),qe=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=b(e,ze);if(t){if(!Ue[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Ue[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ne(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=b(n,$e);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=b(n,Le);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();qe.displayName="ParsedText",qe.propTypes=m(m({},t.Text.propTypes),{},{parse:_e.arrayOf(_e.oneOfType([Fe,Be])),childrenProps:_e.shape(t.Text.propTypes)}),qe.defaultProps={parse:null,childrenProps:{}};var De,We,He,Ye,Xe,Ze,Ke,Ge,Qe,Je,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,yt,pt,vt,ht,mt,bt,xt,gt,wt,jt,Pt,St,Ct,Ot=function(o){var l,s,a,u,c=o.message,d=o.onMediaPress,f=o.isVideoPlaying,y=o.isCurrentUser,p=I(),v=p.theme,h=p.showMessageStatus,b=p.CustomPlayIcon,x=p.renderCustomVideoBubbleError,j=n.useRef(null),P=g(n.useState(0),2),S=P[0],C=P[1],O=g(n.useState(!1),2),A=O[0],T=O[1],k=g(n.useState(!1),2),M=k[0],V=k[1];return e.jsxs(t.View,{children:[c.image&&e.jsx(t.Pressable,{onPress:function(){return d("image",c.image)},style:r(je||(je=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:c.image},style:r(Pe||(Pe=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),c.video&&e.jsxs(t.Pressable,{onPress:function(){return d("video",c.video)},style:r(Se||(Se=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:A,children:[e.jsx(i,{source:{uri:c.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){T(!0),V(!1)},onLoad:function(e){C(e.duration),T(!1)},onBuffer:function(e){var t=e.isBuffering;return T(t)},onError:function(){V(!0),T(!1)}}),A?e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}):M?x?x():e.jsx(t.View,{style:r(Oe||(Oe=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ie||(Ie=w(["text-white font-bold"]))),null==v?void 0:v.fontFamily),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ae||(Ae=w(["absolute bg-black/40 rounded-full"]))),children:b?e.jsx(b,{}):e.jsx(L,{style:r.style("h-16 w-16"),color:(null==v||null===(l=v.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Te||(Te=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Ee||(Ee=w(["text-white text-xs font-semibold"]))),children:U(S)})})]})]}),c.audio&&e.jsx(t.View,{style:r(ke||(ke=w(["my-2"]))),children:e.jsx(H,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:f})}),c.text&&e.jsx(qe,{style:E([r(Me||(Me=w(["pt-1"]))),r(h?Ve||(Ve=w(["pb-0"])):Re||(Re=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},y?null==v||null===(s=v.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==v||null===(a=v.messageStyle)||void 0===a?void 0:a.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:m({color:"blue",textDecorationLine:"underline"},(u=null==v?void 0:v.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},It=n.memo(Ot),At=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Tt=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},Et=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,y=I(),p=y.theme,v=y.showMessageStatus;return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(De||(De=w(["flex-row items-center"]))),r(d?We||(We=w(["justify-end pb-1 ml-4"])):f?He||(He=w(["absolute right-3 bottom-3"])):Ye||(Ye=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:E([r(Xe||(Xe=w(["text-xs"]))),{color:d||f?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==p?void 0:p.fontFamily),children:a}),c&&e.jsxs(t.View,{style:r(Ze||(Ze=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(Tt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},kt=n.memo(Et),Mt=function(n){var o,i,l,s,a,u,c,d,f=n.message,y=n.isCurrentUser,p=n.isFirstInSequence,v=n.onLongPress,h=I(),b=h.theme,x=h.showAvatars,g=h.showUserNames,j=h.showBubbleTail,S=h.setMediaUrl,C=h.setIsVideoPlaying,O=h.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:v,style:[r(Ke||(Ke=w(["px-2 my-1 max-w-[75%] relative"]))),r(y?Ge||(Ge=w(["self-end mr-3"])):Qe||(Qe=w(["self-start ml-9"]))),r(p?y?Je||(Je=w(["bg-green-500 rounded-tr-none"])):et||(et=w(["bg-white rounded-tl-none"])):y?tt||(tt=w(["bg-green-500"])):rt||(rt=w(["bg-white"]))),m({borderRadius:8},y?null==b||null===(o=b.bubbleStyle)||void 0===o?void 0:o.sent:null==b||null===(i=b.bubbleStyle)||void 0===i?void 0:i.received)],children:[!y&&p&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(nt||(nt=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(ot||(ot=w(["w-full h-full rounded-full"]))),null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:E([r(it||(it=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:E([r(lt||(lt=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==b?void 0:b.fontFamily),children:f.senderName})]}),p&&j&&e.jsx(P,{style:r.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(c=b.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(d=b.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(It,{message:f,isCurrentUser:y,isFirstInSequence:p,onMediaPress:function(e,t){S({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&C(!0)},isVideoPlaying:O}),e.jsx(kt,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},Vt=n.memo(Mt),Rt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},_t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Nt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},zt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},$t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Lt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},Ut=function(r){var n=r.fileName,o=r.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:E([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},Ft=n.memo(Ut),Bt=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,y=r.CustomFileIcon,p=r.CustomImagePreview,v=r.CustomVideoPreview,h=r.inputHeight,m=I(),b=m.theme,x=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12},null==b||null===(l=b.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(x({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:E({fontSize:12,color:"black"},null==b?void 0:b.fontFamily),children:"X"})}),w?p?e.jsx(p,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?v?e.jsx(v,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==b||null===(s=b.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==b||null===(a=b.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:y?e.jsx(y,{}):e.jsx(Lt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==b||null===(u=b.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx(Ft,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},qt=n.memo(Bt),Dt="ios"===t.Platform.OS?32:30,Wt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b,x,j=o.onSendMessage,P=o.onTypingStart,S=o.onTypingEnd,C=o.onAttachmentPress,O=o.onCameraPress,A=o.onAudioRecordStart,k=o.onAudioRecordEnd,M=o.CustomEmojiIcon,V=o.CustomAttachmentIcon,R=o.CustomCameraIcon,_=o.CustomSendIcon,N=o.CustomMicrophoneIcon,z=o.CustomFileIcon,$=o.CustomImagePreview,L=o.CustomVideoPreview,U=g(n.useState(""),2),F=U[0],B=U[1],q=g(n.useState({height:Dt,isMultiline:!1}),2),D=q[0],W=q[1],H=I(),Y=H.theme,X=H.currentUserId,Z=H.showEmojiButton,K=H.showAttachmentsButton,G=H.showCameraButton,Q=H.showVoiceRecordButton,J=H.placeholder,ee=H.previewData,te=H.closePreview,re=T(null==Y||null===(i=Y.sizes)||void 0===i?void 0:i.inputIconSize,D.isMultiline?"pb-14":void 0),ne=T(null==Y||null===(l=Y.sizes)||void 0===l?void 0:l.inputIconSize),oe=T(null==Y||null===(s=Y.sizes)||void 0===s?void 0:s.inputIconSize),ie=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Dt),118);W({height:t,isMultiline:t>Dt})}),[]),le=n.useCallback((function(){var e=F.trim();(e||ee)&&(j({text:e,senderId:X}),B(""),W({height:Dt,isMultiline:!1}))}),[F,j,X,ee]);return n.useEffect((function(){F.trim()?null==P||P():null==S||S()}),[F,P,S]),e.jsxs(t.View,{style:r(st||(st=w(["w-full px-2"]))),children:[ee&&e.jsx(qt,{previewData:ee,closePreview:te,CustomFileIcon:z,CustomImagePreview:$,CustomVideoPreview:L,inputHeight:D.height}),e.jsxs(t.View,{style:[r(at||(at=w(["flex-row items-end gap-2"]))),null==Y||null===(a=Y.inputStyles)||void 0===a?void 0:a.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(ut||(ut=w(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),D.isMultiline?r(ct||(ct=w(["rounded-3xl items-end"]))):r(dt||(dt=w(["rounded-full items-center"]))),null==Y||null===(u=Y.inputStyles)||void 0===u?void 0:u.inputContainerStyle],children:[Z&&e.jsx(t.Pressable,{children:M?e.jsx(M,{}):e.jsx(_t,{style:re,color:(null==Y||null===(c=Y.colors)||void 0===c?void 0:c.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e.jsx(t.TextInput,{value:F,onChangeText:B,placeholder:J||"Message",style:E([r(ft||(ft=w(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===t.Platform.OS?r(yt||(yt=w(["text-[17px]"]))):r(pt||(pt=w(["text-[16px]"]))),{minHeight:Dt,maxHeight:118},{color:(null==Y||null===(d=Y.colors)||void 0===d?void 0:d.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==Y?void 0:Y.fontFamily),placeholderTextColor:(null==Y||null===(f=Y.colors)||void 0===f?void 0:f.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:ie}),e.jsxs(t.View,{style:[r(vt||(vt=w(["gap-4 flex-row"]))),D.isMultiline?r(ht||(ht=w(["pb-4"]))):r(mt||(mt=w(["pb-0"])))],children:[K&&e.jsx(t.Pressable,{onPress:C,children:V?e.jsx(V,{}):e.jsx(zt,{style:ne,color:(null==Y||null===(y=Y.colors)||void 0===y?void 0:y.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),G&&!F.trim()&&e.jsx(t.Pressable,{onPress:O,children:R?e.jsx(R,{}):e.jsx(Rt,{style:ne,color:(null==Y||null===(p=Y.colors)||void 0===p?void 0:p.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(bt||(bt=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:"ios"===t.Platform.OS?50:48,width:"ios"===t.Platform.OS?50:48},null==Y||null===(v=Y.inputStyles)||void 0===v?void 0:v.sendButtonStyle)],onPress:F.trim()||ee?le:A,onLongPress:A,onPressOut:k,children:F.trim()?_?e.jsx(_,{}):e.jsx($t,{style:oe,color:(null==Y||null===(h=Y.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"}):Q?N?e.jsx(N,{}):e.jsx(Nt,{style:oe,color:(null==Y||null===(b=Y.colors)||void 0===b?void 0:b.sendIconsColor)||"rgba(255,255,255,0.7)"}):_?e.jsx(_,{}):e.jsx($t,{style:oe,color:(null==Y||null===(x=Y.colors)||void 0===x?void 0:x.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Ht=n.memo(Wt);function Yt(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr,sr,ar=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=I().theme,d=n.useRef(null),f=g(n.useState(!1),2),y=f[0],p=f[1],v=g(n.useState(!1),2),h=v[0],m=v[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(xt||(xt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(gt||(gt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Yt,{style:r(wt||(wt=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(jt||(jt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),m(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){m(!0),p(!1)}}),y&&e.jsx(t.View,{style:r(Pt||(Pt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(St||(St=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ct||(Ct=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},ur=n.memo(ar),cr=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,p=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var h=v.slice(0,2),b=v.length-2;return e.jsxs(t.View,{style:r(Xt||(Xt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Zt||(Zt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Kt||(Kt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:h.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Gt||(Gt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:E([r(Qt||(Qt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),b>0&&e.jsx(t.View,{style:[r(Jt||(Jt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:E([r(er||(er=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",b]})})]}),p&&e.jsx(P,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(tr||(tr=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:y?y():e.jsx(t.View,{style:r(rr||(rr=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:E(r(nr||(nr=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var dr=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaUrl,u=o.setMediaUrl,c=o.setIsVideoPlaying,d=o.typingUsers,f=o.onSendMessage,y=o.onTypingStart,p=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,m=o.onAudioRecordStart,b=o.onCameraPress,x=o.renderCustomInput,j=o.CustomEmojiIcon,P=o.CustomAttachmentIcon,S=o.CustomCameraIcon,C=o.CustomMicrophoneIcon,O=o.CustomSendIcon,A=o.CustomFileIcon,T=o.CustomImagePreview,E=o.CustomVideoPreview,k=o.keyboardVerticalOffset,M=void 0===k?0:k,V=o.disableKeyboardAvoiding,R=void 0!==V&&V,_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=g(n.useState(0),2),i=o[0],l=o[1];return n.useEffect((function(){if(r){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",o="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",i=t.Keyboard.addListener(n,(function(t){var r=t.endCoordinates.height;l(Math.max(0,r-e))})),s=t.Keyboard.addListener(o,(function(){return l(0)}));return function(){i.remove(),s.remove()}}l(0)}),[e,r]),r?i:0}(M,!R),N=e.jsxs(t.View,{style:[r(or||(or=w(["flex-1 px-2 pb-4 gap-2 relative"]))),!R&&_>0?{paddingBottom:_+16}:void 0],children:[e.jsx(t.FlatList,{style:r(ir||(ir=w(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(Vt,{message:n,isCurrentUser:n.senderId===l,onLongPress:function(){return null==s?void 0:s(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(cr,{typingUsers:d||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),x?x():e.jsx(Ht,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:P,CustomCameraIcon:S,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),e.jsx(ur,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(lr||(lr=w(["flex-1"]))),children:N}):e.jsx(t.KeyboardAvoidingView,{style:r(sr||(sr=w(["flex-1"]))),behavior:"ios"===t.Platform.OS?"padding":void 0,keyboardVerticalOffset:M,children:N})};module.exports=function(t){return e.jsx(q,{children:e.jsx(O,m(m({},t),{},{children:e.jsx(dr,{})}))})};
14
+ */function ve(){if(te)return ee;te=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return ee=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},ee}function he(){if(ne)return re;ne=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function me(){return ie?oe:(ie=1,oe=Function.call.bind(Object.prototype.hasOwnProperty))}function be(){if(se)return le;se=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=he(),r={},n=me();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},le=o}function xe(){if(ue)return ae;ue=1;var e=pe(),t=ve(),r=he(),n=me(),o=be(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ae=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(l),arrayOf:function(e){return p((function(t,n,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new y("Invalid "+i+" `"+l+"` of type `"+b(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:p((function(e,t,r,n,o){var i=e[t];return s(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:p((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:p((function(e,t,r,n,o){return m(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,s){if("function"!=typeof e)return new y("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=b(a);if("object"!==u)return new y("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return p((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new y("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,n,o,i,l){var s=t[n],a=b(s);if("object"!==a)return new y("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,s,a){var u=o[i],c=b(u);if("object"!==c)return new y("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(n(e,f)&&"function"!=typeof p)return h(l,s,a,f,x(p));if(!p)return new y("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=p(u,f,l,s,a+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,p){if(u=u||c,f=f||s,p!==r){if(a){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+s;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[s]?o?null===l[s]?new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return p((function(t,r,n,o,i,l){var s=t[r];return b(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new y((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ae}function ge(){if(de)return ce;de=1;var e=he();function t(){}function r(){}return r.resetWarningCache=t,ce=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function we(){if(fe)return Z.exports;if(fe=1,"production"!==process.env.NODE_ENV){var e=pe();Z.exports=xe()(e.isElement,true)}else Z.exports=ge()();return Z.exports}var je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,ke,Me,Ve,Re,_e=Y(we()),Ne=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),ze=["type"],$e=["style"],Le=["parse","childrenProps"],Ue={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Fe=_e.shape(m(m({},t.Text.propTypes),{},{type:_e.oneOf(Object.keys(Ue)).isRequired,nonExhaustiveMaxMatchCount:_e.number})),Be=_e.shape(m(m({},t.Text.propTypes),{},{pattern:_e.oneOfType([_e.string,_e.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:_e.number})),qe=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=b(e,ze);if(t){if(!Ue[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Ue[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ne(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=b(n,$e);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=b(n,Le);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();qe.displayName="ParsedText",qe.propTypes=m(m({},t.Text.propTypes),{},{parse:_e.arrayOf(_e.oneOfType([Fe,Be])),childrenProps:_e.shape(t.Text.propTypes)}),qe.defaultProps={parse:null,childrenProps:{}};var De,We,He,Ye,Xe,Ze,Ke,Ge,Qe,Je,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,yt,pt,vt,ht,mt,bt,xt,gt,wt,jt,Pt,St,Ct,Ot=function(o){var l,s,a,u,c=o.message,d=o.onMediaPress,f=o.isVideoPlaying,y=o.isCurrentUser,p=I(),v=p.theme,h=p.showMessageStatus,b=p.CustomPlayIcon,x=p.renderCustomVideoBubbleError,j=n.useRef(null),P=g(n.useState(0),2),S=P[0],C=P[1],O=g(n.useState(!1),2),A=O[0],T=O[1],k=g(n.useState(!1),2),M=k[0],V=k[1];return e.jsxs(t.View,{children:[c.image&&e.jsx(t.Pressable,{onPress:function(){return d("image",c.image)},style:r(je||(je=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:c.image},style:r(Pe||(Pe=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),c.video&&e.jsxs(t.Pressable,{onPress:function(){return d("video",c.video)},style:r(Se||(Se=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:A,children:[e.jsx(i,{source:{uri:c.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){T(!0),V(!1)},onLoad:function(e){C(e.duration),T(!1)},onBuffer:function(e){var t=e.isBuffering;return T(t)},onError:function(){V(!0),T(!1)}}),A?e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}):M?x?x():e.jsx(t.View,{style:r(Oe||(Oe=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ie||(Ie=w(["text-white font-bold"]))),null==v?void 0:v.fontFamily),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ae||(Ae=w(["absolute bg-black/40 rounded-full"]))),children:b?e.jsx(b,{}):e.jsx(L,{style:r.style("h-16 w-16"),color:(null==v||null===(l=v.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Te||(Te=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Ee||(Ee=w(["text-white text-xs font-semibold"]))),children:U(S)})})]})]}),c.audio&&e.jsx(t.View,{style:r(ke||(ke=w(["my-2"]))),children:e.jsx(H,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:f})}),c.text&&e.jsx(qe,{style:E([r(Me||(Me=w(["pt-1"]))),r(h?Ve||(Ve=w(["pb-0"])):Re||(Re=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},y?null==v||null===(s=v.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==v||null===(a=v.messageStyle)||void 0===a?void 0:a.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:m({color:"blue",textDecorationLine:"underline"},(u=null==v?void 0:v.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},It=n.memo(Ot),At=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Tt=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},Et=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,y=I(),p=y.theme,v=y.showMessageStatus;return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(De||(De=w(["flex-row items-center"]))),r(d?We||(We=w(["justify-end pb-1 ml-4"])):f?He||(He=w(["absolute right-3 bottom-3"])):Ye||(Ye=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:E([r(Xe||(Xe=w(["text-xs"]))),{color:d||f?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==p?void 0:p.fontFamily),children:a}),c&&e.jsxs(t.View,{style:r(Ze||(Ze=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(Tt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(At,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},kt=n.memo(Et),Mt=function(n){var o,i,l,s,a,u,c,d,f=n.message,y=n.isCurrentUser,p=n.isFirstInSequence,v=n.onLongPress,h=I(),b=h.theme,x=h.showAvatars,g=h.showUserNames,j=h.showBubbleTail,S=h.setMediaUrl,C=h.setIsVideoPlaying,O=h.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:v,style:[r(Ke||(Ke=w(["px-2 my-1 max-w-[75%] relative"]))),r(y?Ge||(Ge=w(["self-end mr-3"])):Qe||(Qe=w(["self-start ml-9"]))),r(p?y?Je||(Je=w(["bg-green-500 rounded-tr-none"])):et||(et=w(["bg-white rounded-tl-none"])):y?tt||(tt=w(["bg-green-500"])):rt||(rt=w(["bg-white"]))),m({borderRadius:8},y?null==b||null===(o=b.bubbleStyle)||void 0===o?void 0:o.sent:null==b||null===(i=b.bubbleStyle)||void 0===i?void 0:i.received)],children:[!y&&p&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(nt||(nt=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(ot||(ot=w(["w-full h-full rounded-full"]))),null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:E([r(it||(it=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:E([r(lt||(lt=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==b?void 0:b.fontFamily),children:f.senderName})]}),p&&j&&e.jsx(P,{style:r.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(c=b.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(d=b.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(It,{message:f,isCurrentUser:y,isFirstInSequence:p,onMediaPress:function(e,t){S({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&C(!0)},isVideoPlaying:O}),e.jsx(kt,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},Vt=n.memo(Mt),Rt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},_t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Nt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},zt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},$t=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Lt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},Ut=function(r){var n=r.fileName,o=r.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:E([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},Ft=n.memo(Ut),Bt=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,y=r.CustomFileIcon,p=r.CustomImagePreview,v=r.CustomVideoPreview,h=r.inputHeight,m=I(),b=m.theme,x=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12},null==b||null===(l=b.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(x({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:E({fontSize:12,color:"black"},null==b?void 0:b.fontFamily),children:"X"})}),w?p?e.jsx(p,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?v?e.jsx(v,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==b||null===(s=b.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==b||null===(a=b.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:y?e.jsx(y,{}):e.jsx(Lt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==b||null===(u=b.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx(Ft,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},qt=n.memo(Bt),Dt="ios"===t.Platform.OS?32:30,Wt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b=o.onSendMessage,x=o.onTypingStart,j=o.onTypingEnd,P=o.onAttachmentPress,S=o.onCameraPress,C=o.onAudioRecordStart,O=o.onAudioRecordEnd,A=o.CustomEmojiIcon,k=o.CustomAttachmentIcon,M=o.CustomCameraIcon,V=o.CustomSendIcon,R=o.CustomMicrophoneIcon,_=o.CustomFileIcon,N=o.CustomImagePreview,z=o.CustomVideoPreview,$=g(n.useState(""),2),L=$[0],U=$[1],F=g(n.useState({height:Dt,isMultiline:!1}),2),B=F[0],q=F[1],D=I(),W=D.theme,H=D.currentUserId,Y=D.showEmojiButton,X=D.showAttachmentsButton,Z=D.showCameraButton,K=D.showVoiceRecordButton,G=D.placeholder,Q=D.previewData,J=D.closePreview,ee=null==W||null===(i=W.sizes)||void 0===i?void 0:i.inputIconSize,te=T(ee,B.isMultiline?"pb-14":void 0),re=T(ee),ne=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Dt),118);q({height:t,isMultiline:t>Dt})}),[]),oe=n.useCallback((function(){var e=L.trim();(e||Q)&&(b({text:e,senderId:H}),U(""),q({height:Dt,isMultiline:!1}))}),[L,b,H,Q]);return n.useEffect((function(){L.trim()?null==x||x():null==j||j()}),[L,x,j]),e.jsxs(t.View,{style:r(st||(st=w(["w-full px-2"]))),children:[Q&&e.jsx(qt,{previewData:Q,closePreview:J,CustomFileIcon:_,CustomImagePreview:N,CustomVideoPreview:z,inputHeight:B.height}),e.jsxs(t.View,{style:[r(at||(at=w(["flex-row items-end gap-2"]))),null==W||null===(l=W.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(ut||(ut=w(["flex-1 px-3.5 bg-white gap-1 flex-row justify-between"]))),B.isMultiline?r(ct||(ct=w(["rounded-3xl items-end"]))):r(dt||(dt=w(["rounded-full items-center"]))),null==W||null===(s=W.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Y&&e.jsx(t.Pressable,{children:A?e.jsx(A,{}):e.jsx(_t,{style:te,color:(null==W||null===(a=W.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e.jsx(t.TextInput,{value:L,onChangeText:U,placeholder:G||"Message",style:E([r(ft||(ft=w(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===t.Platform.OS?r(yt||(yt=w(["text-[17px]"]))):r(pt||(pt=w(["text-[16px]"]))),{minHeight:Dt,maxHeight:118},{color:(null==W||null===(u=W.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(247, 247, 247, 0.9)"}],null==W?void 0:W.fontFamily),placeholderTextColor:(null==W||null===(c=W.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:ne}),e.jsxs(t.View,{style:[r(vt||(vt=w(["gap-4 flex-row"]))),B.isMultiline?r(ht||(ht=w(["pb-4"]))):r(mt||(mt=w(["pb-0"])))],children:[X&&e.jsx(t.Pressable,{onPress:P,children:k?e.jsx(k,{}):e.jsx(zt,{style:re,color:(null==W||null===(d=W.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Z&&!L.trim()&&e.jsx(t.Pressable,{onPress:S,children:M?e.jsx(M,{}):e.jsx(Rt,{style:re,color:(null==W||null===(f=W.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(bt||(bt=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:"ios"===t.Platform.OS?50:48,width:"ios"===t.Platform.OS?50:48},null==W||null===(y=W.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:L.trim()||Q?oe:C,onLongPress:C,onPressOut:O,children:L.trim()?V?e.jsx(V,{}):e.jsx($t,{style:r.style("h-6 w-6"),color:(null==W||null===(p=W.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):K?R?e.jsx(R,{}):e.jsx(Nt,{style:r.style("h-6 w-6"),color:(null==W||null===(v=W.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):V?e.jsx(V,{}):e.jsx($t,{style:r.style("h-6 w-6"),color:(null==W||null===(h=W.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Ht=n.memo(Wt);function Yt(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr,sr,ar,ur=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=I().theme,d=n.useRef(null),f=g(n.useState(!1),2),y=f[0],p=f[1],v=g(n.useState(!1),2),h=v[0],m=v[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(xt||(xt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(gt||(gt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Yt,{style:r(wt||(wt=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(jt||(jt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),m(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){m(!0),p(!1)}}),y&&e.jsx(t.View,{style:r(Pt||(Pt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx($,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(St||(St=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:E(r(Ct||(Ct=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},cr=n.memo(ur),dr=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,p=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var h=v.slice(0,2),b=v.length-2;return e.jsxs(t.View,{style:r(Xt||(Xt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Zt||(Zt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Kt||(Kt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:h.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Gt||(Gt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:E([r(Qt||(Qt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),b>0&&e.jsx(t.View,{style:[r(Jt||(Jt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:E([r(er||(er=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",b]})})]}),p&&e.jsx(P,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(tr||(tr=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:y?y():e.jsx(t.View,{style:r(rr||(rr=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:E(r(nr||(nr=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var fr=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaUrl,u=o.setMediaUrl,c=o.setIsVideoPlaying,d=o.typingUsers,f=o.onSendMessage,y=o.onTypingStart,p=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,m=o.onAudioRecordStart,b=o.onCameraPress,x=o.renderCustomInput,j=o.CustomEmojiIcon,P=o.CustomAttachmentIcon,S=o.CustomCameraIcon,C=o.CustomMicrophoneIcon,O=o.CustomSendIcon,A=o.CustomFileIcon,T=o.CustomImagePreview,E=o.CustomVideoPreview,k=o.keyboardVerticalOffset,M=void 0===k?0:k,V=o.disableKeyboardAvoiding,R=void 0!==V&&V,_=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=g(n.useState(0),2),o=r[0],i=r[1];return n.useEffect((function(){if(e){var r="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(r,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!R),N=x?x():e.jsx(Ht,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:P,CustomCameraIcon:S,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),z=e.jsxs(t.View,{style:r(or||(or=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(ir||(ir=w(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(Vt,{message:n,isCurrentUser:n.senderId===l,onLongPress:function(){return null==s?void 0:s(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(dr,{typingUsers:d||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!R&&_>0?{marginBottom:_}:void 0,children:N}),e.jsx(cr,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(lr||(lr=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(sr||(sr=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(ar||(ar=w(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:M,children:z})};module.exports=function(t){return e.jsx(q,{children:e.jsx(O,m(m({},t),{},{children:e.jsx(fr,{})}))})};
15
15
  //# sourceMappingURL=index.js.map