movius-chats 1.4.8 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/AudioPlayer/AudioPlayer.tsx +54 -51
- package/src/components/ChatBubble/ChatBubble.tsx +1 -1
- package/src/components/ChatBubble/MessageStatus.tsx +1 -1
- package/src/components/TypingComponent/TypingIndicator.tsx +50 -27
- package/src/types/index.ts +4 -2
package/lib/commonjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var e=require("react/jsx-runtime"),t=require("react-native"),n=require("twrnc"),r=require("react"),o=require("react-native-svg"),i=require("react-native-video"),l=require("react-native-reanimated");function s(e,t){this.v=e,this.k=t}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,o,i,l){try{var s=e[i](l),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){u(i,r,o,l,s,"next",e)}function s(e){u(i,r,o,l,s,"throw",e)}l(void 0)}))}}function d(e,t,n){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function b(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof s?r:s,u=Object.create(a.prototype);return S(u,"_invoke",function(n,r,o){var i,s,a,u=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,n){return i=t,s=0,a=e,f.n=n,l}};function v(n,r){for(s=n,a=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],v=f.p,h=i[2];n>3?(o=h===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=n<2&&v<i[1])?(s=0,f.v=r,f.n=i[1]):v<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,s=0))}if(o||n>1)return l;throw d=!0,r}return function(o,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&v(c,h),s=c,a=h;(t=s<2?e:a)||!d;){i||(s?s<3?(s>1&&(f.n=-1),v(s,a)):f.n=a:f.v=a);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=f.n<0)?a:n.call(r,f))!==l)break}catch(t){i=e,s=1,a=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var l={};function s(){}function a(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(S(t={},r,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,S(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return a.prototype=u,S(d,"constructor",u),S(u,"constructor",a),a.displayName="GeneratorFunction",S(u,o,"GeneratorFunction"),S(d),S(d,o,"Generator"),S(d,r,(function(){return this})),S(d,"toString",(function(){return"[object Generator]"})),(b=function(){return{w:i,m:f}})()}function w(e,t,n,r,o){var i=j(e,t,n,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function j(e,t,n,r,o){return new C(b().w(e,t,n,r),o||Promise)}function C(e,t){function n(r,o,i,l){try{var a=e[r](o),u=a.value;return u instanceof s?t.resolve(u.v).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){a.value=e,i(a)}),(function(e){return n("throw",e,i,l)}))}catch(e){l(e)}}var r;this.next||(S(C.prototype),S(C.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),S(this,"_invoke",(function(e,o,i){function l(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(l,l):l()}),!0)}function S(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}S=function(e,t,n,r){function i(t,n){S(e,t,(function(e){return this._invoke(t,n,e)}))}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},S(e,t,n,r)}function A(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function P(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,s=[],a=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function R(){var e=b(),t=e.m(R),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,P(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(R=function(){return{wrap:function(t,n,r,o){return e.w(i(t),n,r,o&&o.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new s(e,t)},AsyncIterator:C,async:function(e,t,n,o,l){return(r(t)?j:w)(i(e),t,n,o,l)},keys:A,values:P}})()}var M=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},E=["children"],V=r.createContext(void 0),_=function(t){var n=t.children,o=x(t,E),i=I(r.useState(null),2),l=i[0],s=i[1],a=I(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(V.Provider,{value:g(g({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:function(e,t){s({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){s(null),c(!1)},isVideoPlaying:u,setIsVideoPlaying:c}),children:n})},F=function(){var e=r.useContext(V);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function B(e){return null==e?void 0:e.colors}function L(e,t){var n,r,o,i,l=B(e),s=t?null!==(n=null==l?void 0:l.sentMediaTimestampBackground)&&void 0!==n?n:"rgba(0,0,0,0.45)":null!==(r=null==l?void 0:l.receivedMediaTimestampBackground)&&void 0!==r?r:"rgba(0,0,0,0.45)",a=t?null==e||null===(o=e.messageStyle)||void 0===o?void 0:o.sentMediaTimestampContainerStyle:null==e||null===(i=e.messageStyle)||void 0===i?void 0:i.receivedMediaTimestampContainerStyle;return g(g({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:s},a)}function z(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentBackground)&&void 0!==r?r:"rgba(255, 255, 255, 0.15)":null!==(n=null==o?void 0:o.receivedFileAttachmentBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}function
|
|
3
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof s?r:s,u=Object.create(a.prototype);return S(u,"_invoke",function(n,r,o){var i,s,a,u=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,n){return i=t,s=0,a=e,f.n=n,l}};function v(n,r){for(s=n,a=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],v=f.p,h=i[2];n>3?(o=h===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=n<2&&v<i[1])?(s=0,f.v=r,f.n=i[1]):v<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,f.n=h,s=0))}if(o||n>1)return l;throw d=!0,r}return function(o,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&v(c,h),s=c,a=h;(t=s<2?e:a)||!d;){i||(s?s<3?(s>1&&(f.n=-1),v(s,a)):f.n=a:f.v=a);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=f.n<0)?a:n.call(r,f))!==l)break}catch(t){i=e,s=1,a=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var l={};function s(){}function a(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(S(t={},r,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,S(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return a.prototype=u,S(d,"constructor",u),S(u,"constructor",a),a.displayName="GeneratorFunction",S(u,o,"GeneratorFunction"),S(d),S(d,o,"Generator"),S(d,r,(function(){return this})),S(d,"toString",(function(){return"[object Generator]"})),(b=function(){return{w:i,m:f}})()}function w(e,t,n,r,o){var i=j(e,t,n,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function j(e,t,n,r,o){return new C(b().w(e,t,n,r),o||Promise)}function C(e,t){function n(r,o,i,l){try{var a=e[r](o),u=a.value;return u instanceof s?t.resolve(u.v).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){a.value=e,i(a)}),(function(e){return n("throw",e,i,l)}))}catch(e){l(e)}}var r;this.next||(S(C.prototype),S(C.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),S(this,"_invoke",(function(e,o,i){function l(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(l,l):l()}),!0)}function S(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}S=function(e,t,n,r){function i(t,n){S(e,t,(function(e){return this._invoke(t,n,e)}))}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},S(e,t,n,r)}function A(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}}function P(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,l,s=[],a=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(a=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function R(){var e=b(),t=e.m(R),n=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,P(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(R=function(){return{wrap:function(t,n,r,o){return e.w(i(t),n,r,o&&o.reverse())},isGeneratorFunction:r,mark:e.m,awrap:function(e,t){return new s(e,t)},AsyncIterator:C,async:function(e,t,n,o,l){return(r(t)?j:w)(i(e),t,n,o,l)},keys:A,values:P}})()}var M=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",stroke:r,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},E=["children"],V=r.createContext(void 0),_=function(t){var n=t.children,o=x(t,E),i=I(r.useState(null),2),l=i[0],s=i[1],a=I(r.useState(!1),2),u=a[0],c=a[1];return e.jsx(V.Provider,{value:g(g({},o),{},{mediaViewerGallery:l,setMediaViewerGallery:function(e,t){s({items:e,initialIndex:t});var n=e[t];c("video"===(null==n?void 0:n.kind))},clearMediaViewerGallery:function(){s(null),c(!1)},isVideoPlaying:u,setIsVideoPlaying:c}),children:n})},F=function(){var e=r.useContext(V);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function B(e){return null==e?void 0:e.colors}function L(e,t){var n,r,o,i,l=B(e),s=t?null!==(n=null==l?void 0:l.sentMediaTimestampBackground)&&void 0!==n?n:"rgba(0,0,0,0.45)":null!==(r=null==l?void 0:l.receivedMediaTimestampBackground)&&void 0!==r?r:"rgba(0,0,0,0.45)",a=t?null==e||null===(o=e.messageStyle)||void 0===o?void 0:o.sentMediaTimestampContainerStyle:null==e||null===(i=e.messageStyle)||void 0===i?void 0:i.receivedMediaTimestampContainerStyle;return g(g({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:s},a)}function z(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentBackground)&&void 0!==r?r:"rgba(255, 255, 255, 0.15)":null!==(n=null==o?void 0:o.receivedFileAttachmentBackground)&&void 0!==n?n:"rgba(0, 0, 0, 0.08)"}function D(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedFileAttachmentTextColor)&&void 0!==n?n:"#1f2937"}function N(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentFileAttachmentSubtitleColor)&&void 0!==r?r:"rgba(255,255,255,0.7)":null!==(n=null==o?void 0:o.receivedFileAttachmentSubtitleColor)&&void 0!==n?n:"rgba(31,41,55,0.65)"}function W(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioSpeedTextColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioSpeedTextColor)&&void 0!==n?n:"#e5e7eb"}function H(e,t){var n=B(e);return t?null==n?void 0:n.sentMessageTextColor:null==n?void 0:n.receivedMessageTextColor}function $(e,t){var n=B(e);return t?null==n?void 0:n.sentBubbleBackgroundColor:null==n?void 0:n.receivedBubbleBackgroundColor}function U(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var q="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function G(e,t){return t?[e,{fontFamily:t}]:e}function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y,X={exports:{}},Q={exports:{}},Z={};var J,ee,te,ne,re,oe,ie,le,se,ae,ue,ce,de,fe,ve,he={};
|
|
4
4
|
/** @license React v16.13.1
|
|
5
5
|
* react-is.development.js
|
|
6
6
|
*
|
|
@@ -13,5 +13,5 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toS
|
|
|
13
13
|
object-assign
|
|
14
14
|
(c) Sindre Sorhus
|
|
15
15
|
@license MIT
|
|
16
|
-
*/function ye(){if(ne)return te;ne=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return te=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)n.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},te}function me(){if(oe)return re;oe=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ge(){return le?ie:(le=1,ie=Function.call.bind(Object.prototype.hasOwnProperty))}function xe(){if(ae)return se;ae=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=me(),n={},r=ge();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(r(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},se=o}function be(){if(ce)return ue;ce=1;var e=pe(),t=ye(),n=me(),r=ge(),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){}}),ue=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:h(l),arrayOf:function(e){return h((function(t,r,o,i,l){if("function"!=typeof e)return new v("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new v("Invalid "+i+" `"+l+"` of type `"+g(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",n);if(u instanceof Error)return u}return null}))},element:h((function(e,t,n,r,o){var i=e[t];return s(i)?null:new v("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:h((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new v("Invalid "+o+" `"+i+"` of type `"+g(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new v("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return m(e[t])?null:new v("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,o,i,l,s){if("function"!=typeof e)return new v("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=g(a);if("object"!==u)return new v("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(r(a,c)){var d=e(a,c,i,l,s+"."+c,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return h((function(t,n,r,o,i){for(var l=t[n],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new v("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+b(o)+" at index "+t+"."),l}return h((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&a.push(c.data.expectedType)}return new v("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return h((function(t,r,o,i,l){var s=t[r],a=g(s);if("object"!==a)return new v("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 y(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,n);if(d)return d}return null}))},exact:function(e){return h((function(o,i,l,s,a){var u=o[i],c=g(u);if("object"!==c)return new v("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var h=e[f];if(r(e,f)&&"function"!=typeof h)return y(l,s,a,f,x(h));if(!h)return new v("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=h(u,f,l,s,a+"."+f,n);if(p)return p}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function v(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function h(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,s,u,d,f,h){if(u=u||c,f=f||s,h!==n){if(a){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=u+":"+s;!t[y]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[y]=!0,r++)}}return null==l[s]?o?null===l[s]?new v("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new v("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function p(e){return h((function(t,n,r,o,i,l){var s=t[n];return g(s)!==e?new v("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,o){return new v((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return v.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ue}function we(){if(fe)return de;fe=1;var e=me();function t(){}function n(){}return n.resetWarningCache=t,de=function(){function r(t,n,r,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function je(){if(ve)return X.exports;if(ve=1,"production"!==process.env.NODE_ENV){var e=pe();X.exports=be()(e.isElement,true)}else X.exports=we()();return X.exports}var Ce=K(je()),Se=function(){return v((function e(t,n){f(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)r.push(t);else{var o,s=[],a=t.children,u=0;for(n.pattern.lastIndex=0;a&&(o=n.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(n,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,n.pattern.lastIndex=0}s.push({children:a}),r.push.apply(r,s)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),g(g({},o),{},{children:i,_matched:!0})}}])}(),Ae=["type"],Pe=["style"],ke=["parse","childrenProps"],Ie={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+/},Te=Ce.shape(g(g({},t.Text.propTypes),{},{type:Ce.oneOf(Object.keys(Ie)).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Oe=Ce.shape(g(g({},t.Text.propTypes),{},{pattern:Ce.oneOfType([Ce.string,Ce.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Re=function(){function n(){return f(this,n),d(this,n,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k(e,t)}(n,r.Component),v(n,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=x(e,Ae);if(t){if(!Ie[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Ie[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Se(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=x(r,Pe);return e.jsx(t.Text,g(g({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=g({},this.props);r.parse,r.childrenProps;var o=x(r,ke);return e.jsx(t.Text,g(g({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();Re.displayName="ParsedText",Re.propTypes=g(g({},t.Text.propTypes),{},{parse:Ce.arrayOf(Ce.oneOfType([Te,Oe])),childrenProps:Ce.shape(t.Text.propTypes)}),Re.defaultProps={parse:null,childrenProps:{}};var Me,Ee,Ve,_e,Fe,Be,Le,ze,Ne,De,We,He=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},$e=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},Ue=r.createContext(void 0),qe=function(t){var n=t.children,o=I(r.useState(null),2),i=o[0],l=o[1];return e.jsx(Ue.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})},Ge=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)},Ke=[1,1.5,2],Ye=42;function Xe(r){var o,i,l,s,a,u=r.isPlaying,c=r.playbackRate,d=r.onCycleSpeed,f=r.senderAvatar,v=r.senderName,h=r.isCurrentUser,p=r.theme;return u?e.jsx(t.Pressable,{onPress:d,style:[n(Me||(Me=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(t.Text,{style:G([n(Ee||(Ee=T(["text-xs font-semibold"]))),{color:W(p,h)},null==p||null===(i=p.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==p?void 0:p.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):f?e.jsx(t.Image,{source:{uri:f},style:[n(Ve||(Ve=T(["rounded-full"]))),{width:Ye,height:Ye},null==p||null===(l=p.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.View,{style:[n(_e||(_e=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(t.Text,{style:G([n(Fe||(Fe=T(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==p?void 0:p.fontFamily),children:(s=v,a=null==s?void 0:s.trim(),a?a.charAt(0).toUpperCase():"?")})})}var Qe,Ze,Je,et,tt,nt,rt,ot,it=function(o){var l,s,a=o.audioUrl,u=o.audioId,c=o.isVideoPlaying,d=o.isCurrentUser,f=o.senderAvatar,v=o.senderName,h=o.reserveStatusSpace,p=void 0===h||h,y=F(),m=y.theme,x=y.CustomPlayIcon,b=y.CustomPauseIcon,w=y.showMessageStatus,j=function(){var e=r.useContext(Ue);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=j.currentlyPlayingId,S=j.setCurrentlyPlayingId,A=r.useRef(null),P=I(r.useState(!1),2),k=P[0],O=P[1],R=I(r.useState(0),2),M=R[0],E=R[1],V=I(r.useState(0),2),_=V[0],L=V[1],z=I(r.useState(!1),2),N=z[0],D=z[1],W=I(r.useState(1),2),H=W[0],$=W[1],U=I(r.useState(0),2),q=U[0],K=U[1],Y=r.useRef(null),X=r.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(a,50)}),[a]),Q=function(e,t){var n,r,o,i,l=B(e);return t?{inactive:null!==(o=null==l?void 0:l.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==l?void 0:l.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(n=null==l?void 0:l.receivedAudioWaveformColor)&&void 0!==n?n:"rgba(0,0,0,0.20)",active:null!==(r=null==l?void 0:l.receivedAudioWaveformActiveColor)&&void 0!==r?r:"rgba(0,0,0,0.60)"}}(m,d),Z=Q.inactive,J=Q.active,ee=function(e,t){var n,r,o,i,l=B(e);return t?null!==(o=null!==(i=null==l?void 0:l.sentAudioTimestampColor)&&void 0!==i?i:null==l?void 0:l.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(n=null!==(r=null==l?void 0:l.receivedAudioTimestampColor)&&void 0!==r?r:null==l?void 0:l.receivedTimestampColor)&&void 0!==n?n:"rgba(0,0,0,0.45)"}(m,d),te=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==n?n:"#374151"}(m,d),ne=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==n?n:"#374151"}(m,d),re=k&&!(c||!!C&&C!==u),oe=_>0?M/_:0,ie=r.useCallback((function(e){var t;(L(e.duration),null!==Y.current)&&(null===(t=A.current)||void 0===t||t.seek(Y.current),Y.current=null)}),[]),le=r.useCallback((function(e){var t=e.currentTime;N||E(t)}),[N]),se=r.useCallback((function(){var e;O(!1),E(0),null===(e=A.current)||void 0===e||e.seek(0),S(null)}),[S]),ae=r.useCallback((function(){re?(O(!1),S(null)):(S(u),O(!0))}),[re,u,S]),ue=r.useCallback((function(){$((function(e){var t=Ke.indexOf(e),n=Ke[(t+1)%Ke.length];return null!=n?n:1}))}),[]),ce=r.useCallback((function(e){var t=q;if(!(t<=0||_<=0)){var n,r=Math.max(0,Math.min(e/t,1))*_;if(E(r),_>0)null===(n=A.current)||void 0===n||n.seek(r);else Y.current=r}}),[_,q]),de=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){D(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return D(!1)},onPanResponderTerminate:function(){return D(!1)}})}),[ce]),fe=e.jsx(t.Pressable,{onPress:ae,hitSlop:8,style:n(Be||(Be=T(["shrink-0 px-0.5"]))),children:re?b?e.jsx(b,{}):e.jsx(He,{style:n.style("h-6 w-6"),color:ne}):x?e.jsx(x,{}):e.jsx($e,{style:n.style("h-6 w-6"),color:te})}),ve=e.jsx(Xe,{isPlaying:re,playbackRate:H,onCycleSpeed:ue,senderAvatar:f,senderName:v,isCurrentUser:d,theme:m}),he=e.jsxs(t.View,{style:n(Le||(Le=T(["flex-1 min-w-0"]))),children:[e.jsx(t.View,{style:{height:36},onLayout:function(e){return K(e.nativeEvent.layout.width)},children:e.jsx(t.View,g(g({style:[{height:36,flexDirection:"row",alignItems:"center"},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.progressBarStyle]},de.panHandlers),{},{children:X.map((function(n,r){var o,i=(r+.5)/50<=oe;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*n)),borderRadius:2,backgroundColor:i?J:Z},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))}))}),e.jsx(t.Text,{style:G([n(ze||(ze=T(["text-[11px] mt-0.5"]))),{color:ee},null==m||null===(s=m.messageStyle)||void 0===s?void 0:s.audioDurationStyle],null==m?void 0:m.fontFamily),children:Ge(re?M:_>0?_:M)})]});return e.jsxs(t.View,{style:[n(Ne||(Ne=T(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),p&&w&&n(De||(De=T(["pb-4"])))],children:[e.jsx(i,{ref:A,source:{uri:a},paused:!re,rate:H,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:le,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(t.View,{style:n(We||(We=T(["flex-row items-center gap-1.5"]))),children:d?e.jsxs(e.Fragment,{children:[ve,fe,he]}):e.jsxs(e.Fragment,{children:[fe,he,ve]})})]})},lt=r.memo(it),st=function(n){var i=n.style,l=n.spinning,s=void 0!==l&&l,a=r.useRef(new t.Animated.Value(0)).current;r.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},at=320,ut=at,ct=Math.round(176),dt=at-ct-2,ft=Math.round(159),vt=function(o){var l,s=o.uri,a=o.cellStyle,u=o.roundedStyle,c=F(),d=c.theme,f=c.CustomPlayIcon,v=r.useRef(null),h=I(r.useState(0),2),p=h[0],y=h[1],m=I(r.useState(!0),2),g=m[0],x=m[1],b=I(r.useState(!1),2),w=b[0],j=b[1];return e.jsxs(t.View,{style:[a,u],pointerEvents:"none",children:[e.jsx(i,{source:{uri:s},ref:v,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),j(!1)},onLoad:function(e){y(e.duration),x(!1)},onError:function(){j(!0),x(!1)}}),g&&e.jsx(t.View,{style:[n(Qe||(Qe=T(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(st,{style:n.style("h-8 w-8"),spinning:!0})}),!g&&!w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(Ze||(Ze=T(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx($e,{style:n.style("h-10 w-10"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.videoPlayIconColor)||"white"})}),e.jsx(t.View,{style:n(Je||(Je=T(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:n(et||(et=T(["text-white text-[10px] font-semibold"]))),children:ht(p)})})]}),w&&e.jsx(t.View,{style:[n(tt||(tt=T(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:G(n(nt||(nt=T(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ht(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var pt,yt,mt,gt,xt,bt,wt,jt,Ct,St,At,Pt,kt,It,Tt,Ot,Rt,Mt,Et,Vt,_t,Ft,Bt,Lt,zt=function(r){var o=r.items,i=r.onOpenGallery,l=t.useWindowDimensions().width,s=Math.min(240,.72*l);if(0===o.length)return null;var a={borderRadius:6,overflow:"hidden"};if(1===o.length){var u=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(vt,{uri:u.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:ut,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(n,r){return e.jsx(t.Pressable,{onPress:function(){return i(o,r)},style:{width:c,height:ut},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:n.uri,cellStyle:{width:c,height:ut},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],v=o[2],h=(s-2)/2;return e.jsxs(t.View,{style:{width:s,height:at,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:ct},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:d.uri,cellStyle:{width:s,height:ct},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:dt},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:dt},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:f.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:dt},children:"image"===v.kind?e.jsx(t.Image,{source:{uri:v.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:v.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(v.uri,"-2"))]})]})}var p=(s-2)/2,y=o.length-4,m=o.slice(0,4);return e.jsx(t.View,{style:{width:s,height:at,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(r,l){return e.jsxs(t.Pressable,{onPress:function(){return i(o,l)},style:{width:p,height:ft,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:r.uri,cellStyle:{width:p,height:ft},roundedStyle:a}),3===l&&y>0&&e.jsx(t.View,{style:n(rt||(rt=T(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(ot||(ot=T(["text-white text-lg font-bold"]))),children:["+",y]})})]},"".concat(r.uri,"-").concat(l))}))})},Nt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,v=F(),h=v.theme,p=v.showMessageStatus,y=v.onFileAttachmentPress,m=r.useMemo((function(){return U(u)}),[u]);return e.jsxs(t.View,{children:[m.length>0&&e.jsx(zt,{items:m,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){var i,l,s,a,u,c;return e.jsxs(t.Pressable,{onPress:function(){y?y(r):t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:[n(pt||(pt=T(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:z(h,f)},f?null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(t.Text,{style:G([n(yt||(yt=T(["text-xs font-semibold"]))),{color:N(h,f)},f?null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.sentFileAttachmentTextStyle:null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.receivedFileAttachmentTextStyle],null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:G([n(mt||(mt=T(["text-[10px] mt-0.5"]))),{color:D(h,f)},f?null==h||null===(u=h.messageStyle)||void 0===u?void 0:u.sentFileAttachmentSubtitleStyle:null==h||null===(c=h.messageStyle)||void 0===c?void 0:c.receivedFileAttachmentSubtitleStyle],null==h?void 0:h.fontFamily),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(lt,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d,isCurrentUser:f,senderAvatar:u.senderAvatar,senderName:u.senderName,reserveStatusSpace:!u.text}),u.text&&e.jsx(Re,{style:G([n(gt||(gt=T(["pt-1"]))),n(p?xt||(xt=T(["pb-0"])):bt||(bt=T(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle,H(h,f)?{color:H(h,f)}:void 0],null==h?void 0:h.fontFamily),parse:[{type:"url",style:g({color:"blue",textDecorationLine:"underline"},(a=null==h?void 0:h.fontFamily,a?{fontFamily:a}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},Dt=r.memo(Nt),Wt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Ht=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},$t=function(r){var o,i,l,s=r.time,a=r.status,u=r.isCurrentUser,c=r.hasText,d=r.hasAudio,f=r.hasGalleryMedia,v=r.hasFileAttachments,h=F(),p=h.theme,y=h.showMessageStatus,m=(f||v)&&!c&&!d,g=f&&!c&&!d?"#ffffff":m?function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u):function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u);return e.jsx(e.Fragment,{children:y&&e.jsxs(t.View,{style:[n(wt||(wt=T(["flex-row items-center"]))),c?n(jt||(jt=T(["justify-end pb-1 ml-4"]))):d?n(Ct||(Ct=T(["absolute right-3 bottom-1"]))):m?[n(St||(St=T(["absolute right-3 bottom-4"]))),L(p,u)]:[n(At||(At=T(["absolute right-3 bottom-4"]))),L(p,u)]],children:[e.jsx(t.Text,{style:G([n(Pt||(Pt=T(["text-xs"]))),{color:g}],null==p?void 0:p.fontFamily),children:s}),u&&e.jsxs(t.View,{style:n(kt||(kt=T(["ml-1 flex-row items-center"]))),children:["sent"===a&&e.jsx(Ht,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(o=p.colors)||void 0===o?void 0:o.sentIconColor)||"#6B7280"}),"delivered"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.deliveredIconColor)||"#6B7280"}),"read"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.readIconColor)||"#3B82F6"})]})]})})},Ut=r.memo($t),qt=function(r){var o,i,l,s,a,u,c,d,f,v,h=r.message,p=r.isCurrentUser,y=r.isFirstInSequence,m=r.onLongPress,x=F(),b=x.theme,w=x.showAvatars,j=x.showUserNames,C=x.showBubbleTail,S=x.setMediaViewerGallery,A=x.isVideoPlaying,P=U(h),k=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===P.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:m,style:[n(It||(It=T(["px-2 my-1 max-w-[75%] relative"]))),n(p?Tt||(Tt=T(["self-end mr-3"])):Ot||(Ot=T(["self-start ml-9"]))),n(y?p?Rt||(Rt=T(["bg-green-500 rounded-tr-none"])):Mt||(Mt=T(["bg-white rounded-tl-none"])):p?Et||(Et=T(["bg-green-500"])):Vt||(Vt=T(["bg-white"]))),g(g({borderRadius:8},$(b,p)?{backgroundColor:$(b,p)}:{}),p?null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.sent:null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.received)],children:[!p&&y&&w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(_t||(_t=T(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e.jsx(t.Image,{source:{uri:h.senderAvatar},style:[n(Ft||(Ft=T(["w-full h-full rounded-full"]))),null==b||null===(a=b.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:G([n(Bt||(Bt=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),j&&h.senderName&&e.jsx(t.Text,{style:G([n(Lt||(Lt=T(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(d=b.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==b?void 0:b.fontFamily),children:h.senderName})]}),y&&C&&e.jsx(M,{style:n.style("absolute -top-1 w-6 h-6",p?"rotate-90 -right-3.5 mt-[1.24px]":"rotate-180 -left-3.5 mt-[1.27px]"),color:p?(null==b||null===(f=b.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==b||null===(v=b.colors)||void 0===v?void 0:v.receivedMessageTailColor)||"white"}),e.jsx(Dt,{message:h,isCurrentUser:p,isFirstInSequence:y,onGalleryOpen:function(e,t){S(e,t)},isVideoPlaying:A}),e.jsx(Ut,{time:h.time,status:p?h.status:void 0,isCurrentUser:p,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:P.length>0&&!h.text,hasFileAttachments:k})]})},Gt=r.memo(qt),Kt=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},Yt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Xt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},Qt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},Zt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Jt={code:"function AnimatedHoldMicTsx1(){const{scale}=this.__closure;return{transform:[{scale:scale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx",sourceMap:'{"version":3,"names":["AnimatedHoldMicTsx1","scale","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx"],"mappings":"AAU2C,SAAAA,oBAAA,QAAAC,KAAA,OAAAC,SAAA,OAAO,CAC1CC,SAAS,CAAE,CAAC,CAAEF,KAAK,CAAEA,KAAK,CAACG,KAAM,CAAC,CACtC,CAAC","ignoreList":[]}',version:"3.16.7"},en=function(t){var n=t.color,o=void 0===n?"#ef4444":n,i=t.size,s=void 0===i?28:i,a=t.style,u=l.useSharedValue(1);r.useEffect((function(){u.value=l.withRepeat(l.withSequence(l.withTiming(1.22,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var c,d,f=l.useAnimatedStyle((c=[new global.Error,-2,-27],(d=function(){return{transform:[{scale:u.value}]}}).__closure={scale:u},d.__workletHash=3539239666849,d.__initData=Jt,d.__stackDetails=c,d));return e.jsx(l.View,{style:[f,a],children:e.jsx(Xt,{style:{width:s,height:s},color:o})})},tn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},nn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Rect,{x:"5",y:"11",width:"14",height:"10",rx:"2",stroke:i,strokeWidth:"1.5"}),e.jsx(o.Path,{d:"M8 11V7a4 4 0 0 1 8 0v4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})},rn={code:"function LockSlideColumnTsx1(){const{chevronY}=this.__closure;return{transform:[{translateY:chevronY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx1","chevronY","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAoB0C,SAAAA,oBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,QAAQ,CAACI,KAAM,CAAC,CAC9C,CAAC","ignoreList":[]}',version:"3.16.7"},on={code:"function LockSlideColumnTsx2(){const{lockScale}=this.__closure;return{transform:[{scale:lockScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx2","lockScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAuBuC,SAAAA,oBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CACtCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},ln=function(n){var o,i,s,a,u,c,d=n.slideY,f=n.lockSlideDistance,v=n.recordingUIProps,h=n.voiceRecorderStyles,p=null!==(o=null==v?void 0:v.lockPillBackground)&&void 0!==o?o:"rgba(30,30,30,0.88)",y=null!==(i=null==v?void 0:v.lockIconColor)&&void 0!==i?i:"#e5e7eb",m=null!==(s=null==v?void 0:v.chevronIconColor)&&void 0!==s?s:"#9ca3af",g=null!==(a=null==v?void 0:v.lockPillGap)&&void 0!==a?a:8,x=null!==(u=null==v?void 0:v.lockPillMarginBottom)&&void 0!==u?u:10,b=l.useSharedValue(0);r.useEffect((function(){b.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:450,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:450,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var w=l.useSharedValue(.92);r.useEffect((function(){w.value=l.withRepeat(l.withSequence(l.withTiming(1,{duration:550,easing:l.Easing.out(l.Easing.ease)}),l.withTiming(.92,{duration:550,easing:l.Easing.in(l.Easing.ease)})),-1,!1)}),[]);var j,C,S=l.useAnimatedStyle((j=[new global.Error,-2,-27],(C=function(){return{transform:[{translateY:b.value}]}}).__closure={chevronY:b},C.__workletHash=0xfad898b1b5b,C.__initData=rn,C.__stackDetails=j,C)),A=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{scale:w.value}]}};return t.__closure={lockScale:w},t.__workletHash=0xbc18c7930ff,t.__initData=on,t.__stackDetails=e,t}()),P=Math.min(1,Math.max(0,-d/f));return e.jsx(t.View,{style:[{alignItems:"center",marginBottom:x},null==h?void 0:h.lockContainer],pointerEvents:"none",children:e.jsxs(t.View,{style:[{backgroundColor:p,borderRadius:22,paddingVertical:10,paddingHorizontal:14,alignItems:"center",gap:g,opacity:.85+.15*P,borderWidth:P>.85?1.5:0,borderColor:null!==(c=null==v?void 0:v.lockPillActiveBorderColor)&&void 0!==c?c:"#22c55e"},null==h?void 0:h.lockPill],children:[e.jsx(l.View,{style:A,children:e.jsx(nn,{style:{width:20,height:20},color:y})}),e.jsx(l.View,{style:S,children:e.jsx(tn,{style:{width:18,height:18},color:m})})]})})},sn={code:"function LongPressRecordingTsx1(){const{slideTextX,cancelProgress}=this.__closure;return{transform:[{translateX:slideTextX.value}],opacity:1-cancelProgress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx1","slideTextX","cancelProgress","__closure","transform","translateX","value","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAc4C,SAAAA,uBAAA,QAAAC,UAAA,CAAAC,cAAA,OAAAC,SAAA,OAAO,CAC3CC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,UAAU,CAACK,KAAM,CAAC,CAAC,CAC7CC,OAAO,CAAE,CAAC,CAAGL,cACjB,CAAC","ignoreList":[]}',version:"3.16.7"},an=function(n){var o,i,s=n.duration,a=n.slideX,u=n.containerHeight,c=void 0===u?50:u,d=n.fontFamily,f=n.voiceRecorderStyles,v=n.recordingUIProps,h=null!==(o=null==v?void 0:v.cancelTextColor)&&void 0!==o?o:"rgba(107,114,128,1)",p=null!==(i=null==v?void 0:v.timerColor)&&void 0!==i?i:"#374151",y=l.useSharedValue(0);r.useEffect((function(){y.value=l.withRepeat(l.withSequence(l.withTiming(-6,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var m,g,x=Math.min(1,Math.abs(Math.min(0,a))/70),b=l.useAnimatedStyle((m=[new global.Error,-3,-27],(g=function(){return{transform:[{translateX:y.value}],opacity:1-x}}).__closure={slideTextX:y,cancelProgress:x},g.__workletHash=0xbbdd56b2a8f,g.__initData=sn,g.__stackDetails=m,g));return e.jsxs(t.View,{style:[{flex:1,flexDirection:"row",alignItems:"center",minHeight:c,paddingHorizontal:4},null==f?void 0:f.longPressBar],children:[e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:p,minWidth:44,fontFamily:d},null==f?void 0:f.timer,null==v?void 0:v.timerTextStyle],children:Ge(s)}),e.jsx(l.View,{style:[b,{flex:1,alignItems:"center"}],children:e.jsx(t.Text,{style:[{fontSize:14,color:h,fontFamily:d},null==f?void 0:f.slideText],children:"< Slide to cancel"})})]})},un=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Path,{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx(o.Path,{d:"M10 11v6M14 11v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})};var cn=function(n){var o=n.isActive,i=n.color,l=void 0===i?"rgba(0,0,0,0.45)":i,s=n.height,a=void 0===s?26:s,u=n.style,c=I(r.useState((function(){return Array.from({length:22},(function(){return.3}))})),2),d=c[0],f=c[1];return r.useEffect((function(){if(o){var e=setInterval((function(){return f(Array.from({length:22},(function(){return.15+.85*Math.random()})))}),110);return function(){return clearInterval(e)}}f(Array.from({length:22},(function(){return.3})))}),[o]),e.jsx(t.View,{style:[{flexDirection:"row",alignItems:"center",height:a,gap:2},u],children:d.map((function(n,r){return e.jsx(t.View,{style:{flex:1,height:Math.max(3,Math.round(n*a)),borderRadius:2,backgroundColor:l}},r)}))})},dn=function(n){var r,o,i,l,s,a,u,c=n.isRecording,d=n.isPaused,f=n.duration,v=n.onCancel,h=n.onSend,p=n.onPause,y=n.onResume,m=n.containerHeight,g=void 0===m?50:m,x=n.fontFamily,b=n.sendButtonColor,w=void 0===b?"#16a34a":b,j=n.sendIconColor,C=void 0===j?"#ffffff":j,S=n.enablePauseResume,A=void 0===S||S,P=n.voiceRecorderStyles,k=n.recordingUIProps,I=n.CustomPlayIcon,T=n.CustomPauseIcon,O=null!==(r=null==k?void 0:k.waveformColor)&&void 0!==r?r:"rgba(0,0,0,0.45)",R=null!==(o=null==k?void 0:k.cancelTextColor)&&void 0!==o?o:"#ef4444",M=null!==(i=null==k?void 0:k.timerColor)&&void 0!==i?i:"#374151",E=null!==(l=null==k?void 0:k.recordingBackground)&&void 0!==l?l:"transparent",V=null!==(s=null==k?void 0:k.playPauseButtonBackground)&&void 0!==s?s:"rgba(0,0,0,0.08)",_=null!==(a=null==k?void 0:k.playPauseIconColor)&&void 0!==a?a:"#374151",F=null!==(u=null==k?void 0:k.playPauseIconSize)&&void 0!==u?u:18;return e.jsxs(t.View,{style:[{flexDirection:"row",alignItems:"center",minHeight:g,paddingHorizontal:4,backgroundColor:E,gap:8},null==P?void 0:P.normalBar],children:[e.jsx(t.Pressable,{onPress:v,style:[{width:g,height:g,borderRadius:g/2,justifyContent:"center",alignItems:"center",backgroundColor:"".concat(R,"18")},null==P?void 0:P.trashButton],hitSlop:6,children:e.jsx(un,{style:{width:.44*g,height:.44*g},color:R})}),e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:M,minWidth:40,fontFamily:x},null==P?void 0:P.timer,null==k?void 0:k.timerTextStyle],children:Ge(f)}),e.jsx(cn,{isActive:c&&!d,color:O,height:Math.round(.52*g),style:[{flex:1},null==P?void 0:P.waveform]}),A&&e.jsx(t.Pressable,{onPress:d?y:p,style:[{width:40,height:40,borderRadius:20,backgroundColor:V,justifyContent:"center",alignItems:"center"},null==P?void 0:P.playPauseButton],hitSlop:6,children:d?I?e.jsx(I,{}):e.jsx($e,{style:{width:F,height:F},color:_}):T?e.jsx(T,{}):e.jsx(He,{style:{width:F,height:F},color:_})}),e.jsx(t.Pressable,{onPress:h,style:[{width:g,height:g,borderRadius:g/2,backgroundColor:w,justifyContent:"center",alignItems:"center"},null==P?void 0:P.sendButton],hitSlop:4,children:e.jsx(Zt,{style:{width:.44*g,height:.44*g},color:C})})]})};function fn(){return vn.apply(this,arguments)}function vn(){return(vn=c(R().mark((function e(){var n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==t.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,t.PermissionsAndroid.request(t.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return n=e.sent,e.abrupt("return",n===t.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var hn=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},pn=function(n){var r=n.fileName,o=n.style,i=F().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:G([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(r)})},yn=r.memo(pn);function mn(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var gn,xn,bn,wn,jn,Cn,Sn,An,Pn,kn,In,Tn,On,Rn,Mn,En,Vn,_n,Fn,Bn,Ln,zn=function(n){var r,o=n.previews,l=n.closePreview,s=n.onRemoveItem,a=n.CustomFileIcon,u=n.CustomImagePreview,c=n.CustomVideoPreview,d=n.inputHeight,f=F(),v=f.theme,h=f.setMediaViewerGallery,p=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),y=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),m=mn(o);if(0===o.length)return null;var g=function(e){0!==m.length&&h(m,e)},x=function(n){var r,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,s=null===(r=n.type)||void 0===r?void 0:r.startsWith("image/"),a=null===(o=n.type)||void 0===o?void 0:o.startsWith("video/");return s&&u?e.jsx(u,{uri:n.uri}):a&&c?e.jsx(c,{uri:n.uri}):s?e.jsx(t.Image,{source:{uri:n.uri},style:{width:l,height:l,borderRadius:12},resizeMode:"cover"}):a?e.jsx(t.View,{style:{width:l,height:l,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:n.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},b=function(n,r){return e.jsx(t.Pressable,{onPress:function(){return s?s(n):null==l?void 0:l()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:r?[{rotate:r}]:void 0},children:e.jsx(t.Text,{style:G({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==v?void 0:v.fontFamily),children:"×"})})};return e.jsx(t.View,{style:[{position:"absolute",bottom:(null!=d?d:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==v||null===(r=v.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===p.length)return null;if(1===p.length){var n=p[0];return n?e.jsxs(t.Pressable,{onPress:function(){return g(0)},style:{position:"relative"},children:[x(n),b(n.uri)]}):null}var r=p.slice(0,3),o=p.length>3?p.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",s=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=mn(p).findIndex((function(e){return e.uri===n.uri}));g(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[x(n),2===i&&o>0&&e.jsx(t.View,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),b(n.uri,s)]})},"".concat(n.uri,"-").concat(i))}))})}(),y.length>0&&e.jsx(t.ScrollView,{scrollEnabled:y.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:y.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:y.map((function(n,r){return function(n,r){var o,i,l,s;return e.jsxs(t.View,{style:{position:"relative"},children:[e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==v||null===(o=v.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==v||null===(i=v.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:a?e.jsx(a,{}):e.jsx(hn,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==v||null===(l=v.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(yn,{fileName:n.name||"File",style:null==v||null===(s=v.filePreviewStyle)||void 0===s?void 0:s.text})})]}),b(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},Nn=r.memo(zn),Dn="ios"===t.Platform.OS?32:30,Wn="ios"===t.Platform.OS?50:48,Hn="h-6 w-6",$n=function(o){var i,l,s,a,u,d,f,v,h,p,y,m,x,b,w,j,C,S,A,P,k,O,M,E=o.onSendMessage,V=o.onTypingStart,_=o.onTypingEnd,B=o.onAttachmentPress,L=o.onCameraPress,z=o.onAudioRecordStart,N=o.onAudioRecordEnd,D=o.CustomEmojiIcon,W=o.CustomAttachmentIcon,H=o.CustomCameraIcon,$=o.CustomSendIcon,U=o.CustomMicrophoneIcon,K=o.CustomFileIcon,Y=o.CustomImagePreview,X=o.CustomVideoPreview,Q=I(r.useState(""),2),Z=Q[0],J=Q[1],ee=I(r.useState(0),2),te=ee[0],ne=ee[1],re=I(r.useState({height:Dn,isMultiline:!1}),2),oe=re[0],ie=re[1],le=F(),se=le.theme,ae=le.currentUserId,ue=le.showEmojiButton,ce=le.showAttachmentsButton,de=le.showCameraButton,fe=le.showVoiceRecordButton,ve=le.placeholder,he=le.previewData,pe=le.previewItems,ye=le.closePreview,me=le.onRemovePreviewItem,ge=le.voiceRecorderProps,xe=le.voiceRecorderStyles,be=le.recordingUIProps,we=le.renderVoiceRecorder,je=le.CustomPlayIcon,Ce=le.CustomPauseIcon,Se=r.useMemo((function(){return null!=pe&&pe.length?pe:he?[he]:[]}),[pe,he]),Ae=Se.length>0,Pe=null==se||null===(i=se.sizes)||void 0===i?void 0:i.inputIconSize,ke=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():q;return n.style(t)}(Pe),Ie="number"==typeof(M=Pe)&&M>0?M:24,Te=0===Z.trim().length&&!oe.isMultiline,Oe=Math.max(0,(Wn-Ie)/2),Re=Te?{paddingTop:Oe,paddingBottom:Oe}:{paddingBottom:Oe},Me=r.useCallback((function(){ie({height:Dn,isMultiline:!1}),ne((function(e){return e+1}))}),[]),Ee=r.useCallback((function(e){J(e),0===e.length&&Me()}),[Me]),Ve=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Dn),118),n=t>Dn;ie({height:n?t:Dn,isMultiline:n})}),[]),_e=r.useCallback((function(){var e=Z.trim();(e||Ae)&&(E({text:e,senderId:ae}),J(""),Me())}),[Z,E,ae,Ae,Me]);r.useEffect((function(){Z.trim()?null==V||V():null==_||_()}),[Z,V,_]);var Fe=!!Z.trim()||Ae,Be=I(r.useState("idle"),2),Le=Be[0],ze=Be[1],Ne=r.useRef("idle"),De=r.useCallback((function(e){Ne.current=e,ze(e)}),[]),We=null!==(l=null==be?void 0:be.lockSlideDistance)&&void 0!==l?l:72,He=r.useRef(We);He.current=We;var $e=I(r.useState(0),2),Ue=$e[0],qe=$e[1],Ge=I(r.useState(0),2),Ke=Ge[0],Ye=Ge[1],Xe=r.useRef(0),Qe=r.useRef(0),Ze=r.useCallback((function(e){null==N||N(e)}),[N]),Je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDuration,n=void 0===t?300:t,o=e.onRecordStart,i=e.onRecordEnd,l=I(r.useState("idle"),2),s=l[0],a=l[1],u=I(r.useState(0),2),d=u[0],f=u[1],v=r.useRef(null),h=r.useRef(null),p=r.useRef(0),y=r.useRef(i);y.current=i;var m=r.useRef(o);m.current=o;var g=r.useRef(n);g.current=n;var x=r.useCallback((function(){h.current&&(clearInterval(h.current),h.current=null)}),[]),b=r.useCallback((function(e){x(),h.current=setInterval((function(){p.current+=1,f(p.current),p.current>=g.current&&e()}),1e3)}),[x]),w=r.useCallback(c(R().mark((function e(){var t,n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,fn();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),v.current=t,p.current=0,f(0),a("recording"),b((function(){return A.current()})),null===(n=m.current)||void 0===n||n.call(m)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[b]),j=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.stop(),a("paused"),x()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[x]),C=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.start(),a("recording"),b((function(){return A.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[b]),S=r.useCallback(c(R().mark((function e(){var t,n,r,o,i;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current){e.next=3;break}return e.abrupt("return",null);case 3:return x(),v.current=null,n=p.current,p.current=0,a("idle"),f(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,n),mimeType:"audio/wav"},null===(r=y.current)||void 0===r||r.call(y,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[x]),A=r.useRef(S);A.current=S;var P=r.useCallback((function(){return A.current()}),[]),k=r.useCallback(c(R().mark((function e(){var t,n,r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current,x(),v.current=null,p.current=0,a("idle"),f(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(n=e.sent)){e.next=21;break}return e.prev=12,r=require("react-native-fs"),o=n.startsWith("file://")?n.slice(7):n,e.next=17,r.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[x]);return r.useEffect((function(){return function(){x();try{var e;null===(e=v.current)||void 0===e||e.stop()}catch(e){}}}),[x]),{status:s,duration:d,isRecording:"recording"===s,isPaused:"paused"===s,startRecording:w,pauseRecording:j,resumeRecording:C,stopRecording:P,cancelRecording:k}}({maxDuration:null!==(s=null==ge?void 0:ge.maxDuration)&&void 0!==s?s:300,onRecordStart:z,onRecordEnd:Ze}),et=r.useRef(Je);et.current=Je;var tt=r.useCallback(c(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,et.current.stopRecording();case 2:t=e.sent,De("idle"),t&&E({audio:t.uri,senderId:ae});case 5:case"end":return e.stop()}}),e)}))),[E,ae,De]),nt=r.useCallback((function(){et.current.cancelRecording(),De("idle"),qe(0),Ye(0),Xe.current=0,Qe.current=0}),[De]),rt=r.useRef(tt);rt.current=tt;var ot=r.useRef(nt);ot.current=nt;var it=r.useRef(),lt=r.useRef(!1),st=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return lt.current},onPanResponderGrant:function(){lt.current=!1,Xe.current=0,Qe.current=0,qe(0),Ye(0),it.current=setTimeout(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return lt.current=!0,e.next=3,et.current.startRecording();case 3:De("longPress");case 4:case"end":return e.stop()}}),e)}))),500)},onPanResponderMove:function(e,t){lt.current&&(Xe.current=t.dx,Qe.current=t.dy,qe(t.dx),Ye(t.dy),!1!==(null==ge?void 0:ge.enableLockRecording)&&t.dy<=-He.current&&"longPress"===Ne.current&&(De("locked"),Qe.current=-He.current,Ye(-He.current)))},onPanResponderRelease:(e=c(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(it.current),r=lt.current,lt.current=!1,r){e.next=8;break}return e.next=6,et.current.startRecording();case 6:return De("normal"),e.abrupt("return");case 8:if("locked"!==Ne.current){e.next=10;break}return e.abrupt("return");case 10:n.dx<-70?ot.current():rt.current();case 11:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)}),onPanResponderTerminate:function(){clearTimeout(it.current),lt.current=!1}});var e}),[]),at=null!==(a=null!==(u=null==be?void 0:be.recordingSendButtonBackground)&&void 0!==u?u:null==se||null===(d=se.inputStyles)||void 0===d||null===(d=d.sendButtonStyle)||void 0===d?void 0:d.backgroundColor)&&void 0!==a?a:"#16a34a",ut=null!==(f=null==se||null===(v=se.colors)||void 0===v?void 0:v.sendIconsColor)&&void 0!==f?f:"#ffffff",ct=null!==(h=null==be?void 0:be.longPressMicColor)&&void 0!==h?h:"#ef4444",dt=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.containerBorderTopColor)&&void 0!==n?n:"rgba(0,0,0,0.12)";return g({borderTopWidth:null!==(r=null==t?void 0:t.containerBorderTopWidth)&&void 0!==r?r:1,borderTopColor:o,paddingTop:10,paddingBottom:4},null==e?void 0:e.container)}(xe,be);if("idle"!==Le){var ft,vt,ht,pt,yt,mt={isRecording:Je.isRecording,isPaused:Je.isPaused,duration:Je.duration,isLocked:"locked"===Le,slideOffset:{x:Ue,y:Ke},waveformData:[],startRecording:Je.startRecording,stopRecording:Je.stopRecording,pauseRecording:Je.pauseRecording,resumeRecording:Je.resumeRecording,cancelRecording:nt};return e.jsxs(t.View,{style:n(gn||(gn=T(["w-full px-2"]))),children:[Ae&&e.jsx(Nn,{previews:Se,closePreview:ye,onRemoveItem:me,CustomFileIcon:K,CustomImagePreview:Y,CustomVideoPreview:X,inputHeight:oe.height}),e.jsx(t.View,{style:dt,children:we?we(mt):"longPress"===Le?e.jsxs(t.View,{style:[n(xn||(xn=T(["flex-row items-end gap-2"]))),null==se||null===(ft=se.inputStyles)||void 0===ft?void 0:ft.inputSectionContainerStyle],children:[e.jsx(an,{duration:Je.duration,slideX:Ue,containerHeight:Wn,fontFamily:null==se?void 0:se.fontFamily,voiceRecorderStyles:xe,recordingUIProps:be}),e.jsxs(t.View,{style:{alignItems:"center"},children:[e.jsx(ln,{slideY:Ke,lockSlideDistance:We,recordingUIProps:be,voiceRecorderStyles:xe}),e.jsx(t.View,g(g({},st.panHandlers),{},{style:[n(bn||(bn=T(["rounded-full justify-center items-center"]))),{height:Wn,width:Wn,backgroundColor:at},null==xe?void 0:xe.holdMicButton,null==se||null===(vt=se.inputStyles)||void 0===vt?void 0:vt.sendButtonStyle],children:e.jsx(en,{color:ct,size:null!==(ht=null!==(pt=null==be?void 0:be.recordingIconSize)&&void 0!==pt?pt:null==be?void 0:be.iconSize)&&void 0!==ht?ht:28})}))]})]}):e.jsx(dn,{isRecording:Je.isRecording,isPaused:Je.isPaused,duration:Je.duration,onCancel:nt,onSend:tt,onPause:Je.pauseRecording,onResume:Je.resumeRecording,enablePauseResume:null===(yt=null==ge?void 0:ge.enablePauseResume)||void 0===yt||yt,containerHeight:Wn,fontFamily:null==se?void 0:se.fontFamily,sendButtonColor:at,sendIconColor:ut,voiceRecorderStyles:xe,recordingUIProps:be,CustomPlayIcon:je,CustomPauseIcon:Ce})})]})}return e.jsxs(t.View,{style:n(wn||(wn=T(["w-full px-2"]))),children:[Ae&&e.jsx(Nn,{previews:Se,closePreview:ye,onRemoveItem:me,CustomFileIcon:K,CustomImagePreview:Y,CustomVideoPreview:X,inputHeight:oe.height}),e.jsxs(t.View,{style:[n(jn||(jn=T(["flex-row items-end gap-2"]))),null==se||null===(p=se.inputStyles)||void 0===p?void 0:p.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(Cn||(Cn=T(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Wn,borderRadius:Te?9999:24,alignItems:Te?"center":"flex-end"},null==se||null===(y=se.inputStyles)||void 0===y?void 0:y.inputContainerStyle],children:[ue&&e.jsx(t.View,{style:Re,children:e.jsx(t.Pressable,{children:D?e.jsx(D,{}):e.jsx(Yt,{style:ke,color:(null==se||null===(m=se.colors)||void 0===m?void 0:m.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:Z,onChangeText:Ee,placeholder:ve||"Message",style:G([n(Sn||(Sn=T(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(An||(An=T(["text-[17px]"]))):n(Pn||(Pn=T(["text-[16px]"]))),{minHeight:Dn,maxHeight:118,paddingVertical:Te?0:8,marginVertical:Te?(Wn-Dn)/2:4},{color:(null==se||null===(x=se.colors)||void 0===x?void 0:x.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==se?void 0:se.fontFamily),placeholderTextColor:(null==se||null===(b=se.colors)||void 0===b?void 0:b.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:oe.isMultiline&&Z.length>0?"top":"center",onContentSizeChange:Ve},"chat-input-".concat(te)),e.jsxs(t.View,{style:[n(kn||(kn=T(["flex-row items-center gap-4"]))),Re],children:[ce&&e.jsx(t.Pressable,{onPress:B,children:W?e.jsx(W,{}):e.jsx(Qt,{style:ke,color:(null==se||null===(w=se.colors)||void 0===w?void 0:w.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),de&&!Z.trim()&&e.jsx(t.Pressable,{onPress:L,children:H?e.jsx(H,{}):e.jsx(Kt,{style:ke,color:(null==se||null===(j=se.colors)||void 0===j?void 0:j.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),Fe?e.jsx(t.Pressable,{onPress:_e,style:[n(In||(In=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(C=se.inputStyles)||void 0===C?void 0:C.sendButtonStyle)],children:$?e.jsx($,{}):e.jsx(Zt,{style:n.style(Hn),color:(null==se||null===(S=se.colors)||void 0===S?void 0:S.sendIconsColor)||"rgba(255,255,255,0.7)"})}):fe?e.jsx(t.View,g(g({},st.panHandlers),{},{style:[n(Tn||(Tn=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(A=se.inputStyles)||void 0===A?void 0:A.sendButtonStyle)],children:U?e.jsx(U,{}):e.jsx(Xt,{style:n.style("h-8 w-8"),color:(null==se||null===(P=se.colors)||void 0===P?void 0:P.sendIconsColor)||"rgba(255,255,255,0.7)"})})):e.jsx(t.Pressable,{onPress:_e,style:[n(On||(On=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(k=se.inputStyles)||void 0===k?void 0:k.sendButtonStyle)],children:$?e.jsx($,{}):e.jsx(Zt,{style:n.style(Hn),color:(null==se||null===(O=se.colors)||void 0===O?void 0:O.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Un=r.memo($n);function qn(t){var r=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.style("h-6 w-6 text-black",r),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Gn,Kn,Yn,Xn,Qn,Zn,Jn,er,tr,nr,rr,or,ir,lr,sr,ar=function(o){var i,l=o.gallery,s=o.onClose,a=F(),u=a.theme,c=a.setIsVideoPlaying,d=r.useRef(null),f=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,v=I(r.useState(f),2),h=v[0],p=v[1],y=t.useWindowDimensions(),m=y.width,g=y.height;r.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;p(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=d.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==l?void 0:l.initialIndex,null==l?void 0:l.items,c]);var x=r.useCallback((function(){c(!1),s()}),[s,c]),b=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/m);p(t);var n=null==l?void 0:l.items[t];c("video"===(null==n?void 0:n.kind))}),[null==l?void 0:l.items,m,c]);return l&&0!==l.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:x,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[n(Rn||(Rn=T(["flex-1 bg-black"]))),{width:m,height:g}],children:[e.jsx(t.Pressable,{onPress:x,style:n(Mn||(Mn=T(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(qn,{style:n(En||(En=T(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(t.View,{style:n(Vn||(Vn=T(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:G(n(_n||(_n=T(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==u?void 0:u.fontFamily),children:[h+1," / ",l.items.length]})}),e.jsx(t.FlatList,{ref:d,data:l.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:l.initialIndex,extraData:h,getItemLayout:function(e,t){return{length:m,offset:m*t,index:t}},onMomentumScrollEnd:b,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=d.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(ur,{item:n,width:m,height:g,isActive:r===h,autoPlayVideo:r===f&&"video"===n.kind})}})]})}):null},ur=function(o){var l=o.item,s=o.width,a=o.height,u=o.isActive,c=o.autoPlayVideo,d=F().theme,f=r.useRef(null),v=I(r.useState("video"===l.kind),2),h=v[0],p=v[1],y=I(r.useState(!1),2),m=y[0],g=y[1],x="video"===l.kind&&u&&c;return"image"===l.kind?e.jsx(t.View,{style:{width:s,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:l.uri},style:{width:s,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:s,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(i,{source:{uri:l.uri},ref:f,controls:!0,paused:!x,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:s-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){p(!0),g(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){g(!0),p(!1)}}),h&&e.jsx(t.View,{style:n(Fn||(Fn=T(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(st,{style:n.style("h-14 w-14"),spinning:!0})}),m&&e.jsx(t.View,{style:n(Bn||(Bn=T(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:G(n(Ln||(Ln=T(["text-white font-semibold"]))),null==d?void 0:d.fontFamily),children:"Failed to load video"})})]})},cr=r.memo(ar),dr=function(r){var o,i,l,s,a=r.typingUsers,u=r.currentUserId,c=F(),d=c.theme,f=c.showAvatars,v=c.renderCustomTyping,h=c.showBubbleTail,p=a.filter((function(e){return e.id!==u}));if(!p.length)return null;var y=p.slice(0,2),m=p.length-2;return e.jsxs(t.View,{style:n(Gn||(Gn=T(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:n(Kn||(Kn=T(["flex-row mr-2"]))),children:[y.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(Yn||(Yn=T(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:y.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(Xn||(Xn=T(["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:G([n(Qn||(Qn=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=r.name)||void 0===s?void 0:s.charAt(0)})},r.id)})),m>0&&e.jsx(t.View,{style:[n(Zn||(Zn=T(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},g({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:G([n(Jn||(Jn=T(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",m]})})]}),h&&e.jsx(M,{style:n.style("w-6 h-6 rotate-180 mt-[1.27px]"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white"}),e.jsx(t.View,{style:[n(er||(er=T(["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:v?v():e.jsx(t.View,{style:n(tr||(tr=T(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:G(n(nr||(nr=T(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var fr=function(){var o=F(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,v=o.onTypingEnd,h=o.onAttachmentPress,p=o.onAudioRecordEnd,y=o.onAudioRecordStart,m=o.onCameraPress,g=o.renderCustomInput,x=o.CustomEmojiIcon,b=o.CustomAttachmentIcon,w=o.CustomCameraIcon,j=o.CustomMicrophoneIcon,C=o.CustomSendIcon,S=o.CustomFileIcon,A=o.CustomImagePreview,P=o.CustomVideoPreview,k=o.keyboardVerticalOffset,O=void 0===k?0:k,R=o.disableKeyboardAvoiding,M=void 0!==R&&R,E=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=I(r.useState(0),2),o=n[0],i=n[1];return r.useEffect((function(){if(e){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(n,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!M),V=g?g():e.jsx(Un,{onSendMessage:d,onTypingStart:f,onTypingEnd:v,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:y,onCameraPress:m,CustomEmojiIcon:x,CustomAttachmentIcon:b,CustomCameraIcon:w,CustomMicrophoneIcon:j,CustomSendIcon:C,CustomFileIcon:S,CustomImagePreview:A,CustomVideoPreview:P}),_=e.jsxs(t.View,{style:n(rr||(rr=T(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(or||(or=T(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(Gt,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==s?void 0:s(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(dr,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&E>0?{marginBottom:E}:void 0,children:V}),e.jsx(cr,{gallery:a,onClose:u})]});return M?e.jsx(t.View,{style:n(ir||(ir=T(["flex-1"]))),children:_}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(lr||(lr=T(["flex-1"]))),children:_}):e.jsx(t.KeyboardAvoidingView,{style:n(sr||(sr=T(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:O,children:_})};module.exports=function(t){return e.jsx(qe,{children:e.jsx(_,g(g({},t),{},{children:e.jsx(fr,{})}))})};
|
|
16
|
+
*/function ye(){if(ne)return te;ne=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return te=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)n.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},te}function me(){if(oe)return re;oe=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ge(){return le?ie:(le=1,ie=Function.call.bind(Object.prototype.hasOwnProperty))}function xe(){if(ae)return se;ae=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=me(),n={},r=ge();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(r(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},se=o}function be(){if(ce)return ue;ce=1;var e=pe(),t=ye(),n=me(),r=ge(),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){}}),ue=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:h(l),arrayOf:function(e){return h((function(t,r,o,i,l){if("function"!=typeof e)return new v("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new v("Invalid "+i+" `"+l+"` of type `"+g(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",n);if(u instanceof Error)return u}return null}))},element:h((function(e,t,n,r,o){var i=e[t];return s(i)?null:new v("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:h((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new v("Invalid "+o+" `"+i+"` of type `"+g(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new v("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return m(e[t])?null:new v("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,o,i,l,s){if("function"!=typeof e)return new v("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=g(a);if("object"!==u)return new v("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(r(a,c)){var d=e(a,c,i,l,s+"."+c,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return h((function(t,n,r,o,i){for(var l=t[n],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new v("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+b(o)+" at index "+t+"."),l}return h((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&a.push(c.data.expectedType)}return new v("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return h((function(t,r,o,i,l){var s=t[r],a=g(s);if("object"!==a)return new v("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 y(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,n);if(d)return d}return null}))},exact:function(e){return h((function(o,i,l,s,a){var u=o[i],c=g(u);if("object"!==c)return new v("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var h=e[f];if(r(e,f)&&"function"!=typeof h)return y(l,s,a,f,x(h));if(!h)return new v("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=h(u,f,l,s,a+"."+f,n);if(p)return p}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function v(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function h(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,s,u,d,f,h){if(u=u||c,f=f||s,h!==n){if(a){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=u+":"+s;!t[y]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[y]=!0,r++)}}return null==l[s]?o?null===l[s]?new v("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new v("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function p(e){return h((function(t,n,r,o,i,l){var s=t[n];return g(s)!==e?new v("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,o){return new v((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return v.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ue}function we(){if(fe)return de;fe=1;var e=me();function t(){}function n(){}return n.resetWarningCache=t,de=function(){function r(t,n,r,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function je(){if(ve)return X.exports;if(ve=1,"production"!==process.env.NODE_ENV){var e=pe();X.exports=be()(e.isElement,true)}else X.exports=we()();return X.exports}var Ce=K(je()),Se=function(){return v((function e(t,n){f(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)r.push(t);else{var o,s=[],a=t.children,u=0;for(n.pattern.lastIndex=0;a&&(o=n.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(n,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,n.pattern.lastIndex=0}s.push({children:a}),r.push.apply(r,s)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),g(g({},o),{},{children:i,_matched:!0})}}])}(),Ae=["type"],Pe=["style"],ke=["parse","childrenProps"],Ie={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+/},Te=Ce.shape(g(g({},t.Text.propTypes),{},{type:Ce.oneOf(Object.keys(Ie)).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Oe=Ce.shape(g(g({},t.Text.propTypes),{},{pattern:Ce.oneOfType([Ce.string,Ce.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Re=function(){function n(){return f(this,n),d(this,n,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k(e,t)}(n,r.Component),v(n,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=x(e,Ae);if(t){if(!Ie[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Ie[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Se(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=x(r,Pe);return e.jsx(t.Text,g(g({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=g({},this.props);r.parse,r.childrenProps;var o=x(r,ke);return e.jsx(t.Text,g(g({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();Re.displayName="ParsedText",Re.propTypes=g(g({},t.Text.propTypes),{},{parse:Ce.arrayOf(Ce.oneOfType([Te,Oe])),childrenProps:Ce.shape(t.Text.propTypes)}),Re.defaultProps={parse:null,childrenProps:{}};var Me,Ee,Ve,_e,Fe,Be,Le,ze,De,Ne,We,He=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:r,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},$e=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},Ue=r.createContext(void 0),qe=function(t){var n=t.children,o=I(r.useState(null),2),i=o[0],l=o[1];return e.jsx(Ue.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})},Ge=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)},Ke=[1,1.5,2],Ye=42;function Xe(r){var o,i,l,s,a,u=r.isPlaying,c=r.playbackRate,d=r.onCycleSpeed,f=r.senderAvatar,v=r.senderName,h=r.isCurrentUser,p=r.theme;return u?e.jsx(t.Pressable,{onPress:d,style:[n(Me||(Me=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(t.Text,{style:G([n(Ee||(Ee=T(["text-xs font-semibold"]))),{color:W(p,h)},null==p||null===(i=p.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==p?void 0:p.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):f?e.jsx(t.Image,{source:{uri:f},style:[n(Ve||(Ve=T(["rounded-full"]))),{width:Ye,height:Ye},null==p||null===(l=p.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.View,{style:[n(_e||(_e=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(t.Text,{style:G([n(Fe||(Fe=T(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==p?void 0:p.fontFamily),children:(s=v,a=null==s?void 0:s.trim(),a?a.charAt(0).toUpperCase():"?")})})}var Qe,Ze,Je,et,tt,nt,rt,ot,it=function(o){var l,s,a=o.audioUrl,u=o.audioId,c=o.isVideoPlaying,d=o.isCurrentUser,f=o.senderAvatar,v=o.senderName,h=o.reserveStatusSpace,p=void 0===h||h,y=F(),m=y.theme,x=y.CustomPlayIcon,b=y.CustomPauseIcon,w=y.showMessageStatus,j=function(){var e=r.useContext(Ue);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=j.currentlyPlayingId,S=j.setCurrentlyPlayingId,A=r.useRef(null),P=I(r.useState(!1),2),k=P[0],O=P[1],R=I(r.useState(0),2),M=R[0],E=R[1],V=I(r.useState(0),2),_=V[0],L=V[1],z=I(r.useState(!1),2),D=z[0],N=z[1],W=I(r.useState(1),2),H=W[0],$=W[1],U=I(r.useState(0),2),q=U[0],K=U[1],Y=r.useRef(null),X=r.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(a,50)}),[a]),Q=function(e,t){var n,r,o,i,l=B(e);return t?{inactive:null!==(o=null==l?void 0:l.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==l?void 0:l.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(n=null==l?void 0:l.receivedAudioWaveformColor)&&void 0!==n?n:"rgba(0,0,0,0.20)",active:null!==(r=null==l?void 0:l.receivedAudioWaveformActiveColor)&&void 0!==r?r:"rgba(0,0,0,0.60)"}}(m,d),Z=Q.inactive,J=Q.active,ee=function(e,t){var n,r,o,i,l=B(e);return t?null!==(o=null!==(i=null==l?void 0:l.sentAudioTimestampColor)&&void 0!==i?i:null==l?void 0:l.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(n=null!==(r=null==l?void 0:l.receivedAudioTimestampColor)&&void 0!==r?r:null==l?void 0:l.receivedTimestampColor)&&void 0!==n?n:"rgba(0,0,0,0.45)"}(m,d),te=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==n?n:"#374151"}(m,d),ne=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==n?n:"#374151"}(m,d),re=k&&!(c||!!C&&C!==u),oe=_>0?M/_:0,ie=r.useCallback((function(e){var t;(L(e.duration),null!==Y.current)&&(null===(t=A.current)||void 0===t||t.seek(Y.current),Y.current=null)}),[]),le=r.useCallback((function(e){var t=e.currentTime;D||E(t)}),[D]),se=r.useCallback((function(){var e;O(!1),E(0),null===(e=A.current)||void 0===e||e.seek(0),S(null)}),[S]),ae=r.useCallback((function(){re?(O(!1),S(null)):(S(u),O(!0))}),[re,u,S]),ue=r.useCallback((function(){$((function(e){var t=Ke.indexOf(e),n=Ke[(t+1)%Ke.length];return null!=n?n:1}))}),[]),ce=r.useCallback((function(e){var t=q;if(!(t<=0||_<=0)){var n,r=Math.max(0,Math.min(e/t,1))*_;if(E(r),_>0)null===(n=A.current)||void 0===n||n.seek(r);else Y.current=r}}),[_,q]),de=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){N(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return N(!1)},onPanResponderTerminate:function(){return N(!1)}})}),[ce]),fe=e.jsx(t.Pressable,{onPress:ae,hitSlop:8,style:n(Be||(Be=T(["shrink-0 px-0.5"]))),children:re?b?e.jsx(b,{}):e.jsx(He,{style:n.style("h-6 w-6"),color:ne}):x?e.jsx(x,{}):e.jsx($e,{style:n.style("h-6 w-6"),color:te})}),ve=e.jsx(Xe,{isPlaying:re,playbackRate:H,onCycleSpeed:ue,senderAvatar:f,senderName:v,isCurrentUser:d,theme:m}),he=e.jsx(t.View,{style:[n(Le||(Le=T(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return K(e.nativeEvent.layout.width)},children:e.jsx(t.View,g(g({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.progressBarStyle]},de.panHandlers),{},{children:X.map((function(n,r){var o,i=(r+.5)/50<=oe;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*n)),borderRadius:2,backgroundColor:i?J:Z},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))}))});return e.jsxs(t.View,{style:[n(ze||(ze=T(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),p&&w&&n(De||(De=T(["pb-4"])))],children:[e.jsx(i,{ref:A,source:{uri:a},paused:!re,rate:H,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:le,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(t.View,{style:n(Ne||(Ne=T(["flex-row items-center gap-1.5"]))),children:d?e.jsxs(e.Fragment,{children:[ve,fe,he]}):e.jsxs(e.Fragment,{children:[fe,he,ve]})}),e.jsx(t.Text,{style:G([n(We||(We=T(["text-[11px] mt-1"]))),{color:ee,paddingLeft:d?82:34},null==m||null===(s=m.messageStyle)||void 0===s?void 0:s.audioDurationStyle],null==m?void 0:m.fontFamily),children:Ge(re?M:_>0?_:M)})]})},lt=r.memo(it),st=function(n){var i=n.style,l=n.spinning,s=void 0!==l&&l,a=r.useRef(new t.Animated.Value(0)).current;r.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},at=320,ut=at,ct=Math.round(176),dt=at-ct-2,ft=Math.round(159),vt=function(o){var l,s=o.uri,a=o.cellStyle,u=o.roundedStyle,c=F(),d=c.theme,f=c.CustomPlayIcon,v=r.useRef(null),h=I(r.useState(0),2),p=h[0],y=h[1],m=I(r.useState(!0),2),g=m[0],x=m[1],b=I(r.useState(!1),2),w=b[0],j=b[1];return e.jsxs(t.View,{style:[a,u],pointerEvents:"none",children:[e.jsx(i,{source:{uri:s},ref:v,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),j(!1)},onLoad:function(e){y(e.duration),x(!1)},onError:function(){j(!0),x(!1)}}),g&&e.jsx(t.View,{style:[n(Qe||(Qe=T(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(st,{style:n.style("h-8 w-8"),spinning:!0})}),!g&&!w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(Ze||(Ze=T(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx($e,{style:n.style("h-10 w-10"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.videoPlayIconColor)||"white"})}),e.jsx(t.View,{style:n(Je||(Je=T(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:n(et||(et=T(["text-white text-[10px] font-semibold"]))),children:ht(p)})})]}),w&&e.jsx(t.View,{style:[n(tt||(tt=T(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:G(n(nt||(nt=T(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ht(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var pt,yt,mt,gt,xt,bt,wt,jt,Ct,St,At,Pt,kt,It,Tt,Ot,Rt,Mt,Et,Vt,_t,Ft,Bt,Lt,zt=function(r){var o=r.items,i=r.onOpenGallery,l=t.useWindowDimensions().width,s=Math.min(240,.72*l);if(0===o.length)return null;var a={borderRadius:6,overflow:"hidden"};if(1===o.length){var u=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(vt,{uri:u.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:ut,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(n,r){return e.jsx(t.Pressable,{onPress:function(){return i(o,r)},style:{width:c,height:ut},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:n.uri,cellStyle:{width:c,height:ut},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],v=o[2],h=(s-2)/2;return e.jsxs(t.View,{style:{width:s,height:at,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:ct},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:d.uri,cellStyle:{width:s,height:ct},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:dt},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:dt},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:f.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:dt},children:"image"===v.kind?e.jsx(t.Image,{source:{uri:v.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:v.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(v.uri,"-2"))]})]})}var p=(s-2)/2,y=o.length-4,m=o.slice(0,4);return e.jsx(t.View,{style:{width:s,height:at,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(r,l){return e.jsxs(t.Pressable,{onPress:function(){return i(o,l)},style:{width:p,height:ft,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:r.uri,cellStyle:{width:p,height:ft},roundedStyle:a}),3===l&&y>0&&e.jsx(t.View,{style:n(rt||(rt=T(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(ot||(ot=T(["text-white text-lg font-bold"]))),children:["+",y]})})]},"".concat(r.uri,"-").concat(l))}))})},Dt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,v=F(),h=v.theme,p=v.showMessageStatus,y=v.onFileAttachmentPress,m=r.useMemo((function(){return U(u)}),[u]);return e.jsxs(t.View,{children:[m.length>0&&e.jsx(zt,{items:m,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){var i,l,s,a,u,c;return e.jsxs(t.Pressable,{onPress:function(){y?y(r):t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:[n(pt||(pt=T(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:z(h,f)},f?null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(t.Text,{style:G([n(yt||(yt=T(["text-xs font-semibold"]))),{color:D(h,f)},f?null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.sentFileAttachmentTextStyle:null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.receivedFileAttachmentTextStyle],null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:G([n(mt||(mt=T(["text-[10px] mt-0.5"]))),{color:N(h,f)},f?null==h||null===(u=h.messageStyle)||void 0===u?void 0:u.sentFileAttachmentSubtitleStyle:null==h||null===(c=h.messageStyle)||void 0===c?void 0:c.receivedFileAttachmentSubtitleStyle],null==h?void 0:h.fontFamily),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(lt,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d,isCurrentUser:f,senderAvatar:u.senderAvatar,senderName:u.senderName,reserveStatusSpace:!u.text}),u.text&&e.jsx(Re,{style:G([n(gt||(gt=T(["pt-1"]))),n(p?xt||(xt=T(["pb-0"])):bt||(bt=T(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle,H(h,f)?{color:H(h,f)}:void 0],null==h?void 0:h.fontFamily),parse:[{type:"url",style:g({color:"blue",textDecorationLine:"underline"},(a=null==h?void 0:h.fontFamily,a?{fontFamily:a}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},Nt=r.memo(Dt),Wt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},Ht=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:r})})},$t=function(r){var o,i,l,s=r.time,a=r.status,u=r.isCurrentUser,c=r.hasText,d=r.hasAudio,f=r.hasGalleryMedia,v=r.hasFileAttachments,h=F(),p=h.theme,y=h.showMessageStatus,m=(f||v)&&!c&&!d,g=f&&!c&&!d?"#ffffff":m?function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u):function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u);return e.jsx(e.Fragment,{children:y&&e.jsxs(t.View,{style:[n(wt||(wt=T(["flex-row items-center"]))),c?n(jt||(jt=T(["justify-end pb-1 ml-4"]))):d?n(Ct||(Ct=T(["absolute right-3 bottom-2"]))):m?[n(St||(St=T(["absolute right-3 bottom-4"]))),L(p,u)]:[n(At||(At=T(["absolute right-3 bottom-4"]))),L(p,u)]],children:[e.jsx(t.Text,{style:G([n(Pt||(Pt=T(["text-xs"]))),{color:g}],null==p?void 0:p.fontFamily),children:s}),u&&e.jsxs(t.View,{style:n(kt||(kt=T(["ml-1 flex-row items-center"]))),children:["sent"===a&&e.jsx(Ht,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(o=p.colors)||void 0===o?void 0:o.sentIconColor)||"#6B7280"}),"delivered"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.deliveredIconColor)||"#6B7280"}),"read"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.readIconColor)||"#3B82F6"})]})]})})},Ut=r.memo($t),qt=function(r){var o,i,l,s,a,u,c,d,f,v,h=r.message,p=r.isCurrentUser,y=r.isFirstInSequence,m=r.onLongPress,x=F(),b=x.theme,w=x.showAvatars,j=x.showUserNames,C=x.showBubbleTail,S=x.setMediaViewerGallery,A=x.isVideoPlaying,P=U(h),k=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===P.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:m,style:[n(It||(It=T(["px-2 my-1 max-w-[75%] relative"]))),n(p?Tt||(Tt=T(["self-end mr-3"])):Ot||(Ot=T(["self-start ml-9"]))),n(y?p?Rt||(Rt=T(["bg-green-500 rounded-tr-none"])):Mt||(Mt=T(["bg-white rounded-tl-none"])):p?Et||(Et=T(["bg-green-500"])):Vt||(Vt=T(["bg-white"]))),g(g({borderRadius:8},$(b,p)?{backgroundColor:$(b,p)}:{}),p?null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.sent:null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.received)],children:[!p&&y&&w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(_t||(_t=T(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e.jsx(t.Image,{source:{uri:h.senderAvatar},style:[n(Ft||(Ft=T(["w-full h-full rounded-full"]))),null==b||null===(a=b.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:G([n(Bt||(Bt=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),j&&h.senderName&&e.jsx(t.Text,{style:G([n(Lt||(Lt=T(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(d=b.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==b?void 0:b.fontFamily),children:h.senderName})]}),y&&C&&e.jsx(M,{style:n.style("absolute -top-1 w-6 h-6",p?"rotate-90 -right-3.5 mt-[1.24px]":"rotate-180 -left-3.5 mt-[1.30px]"),color:p?(null==b||null===(f=b.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==b||null===(v=b.colors)||void 0===v?void 0:v.receivedMessageTailColor)||"white"}),e.jsx(Nt,{message:h,isCurrentUser:p,isFirstInSequence:y,onGalleryOpen:function(e,t){S(e,t)},isVideoPlaying:A}),e.jsx(Ut,{time:h.time,status:p?h.status:void 0,isCurrentUser:p,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:P.length>0&&!h.text,hasFileAttachments:k})]})},Gt=r.memo(qt),Kt=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},Yt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},Xt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},Qt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},Zt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Jt={code:"function AnimatedHoldMicTsx1(){const{scale}=this.__closure;return{transform:[{scale:scale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx",sourceMap:'{"version":3,"names":["AnimatedHoldMicTsx1","scale","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx"],"mappings":"AAU2C,SAAAA,oBAAA,QAAAC,KAAA,OAAAC,SAAA,OAAO,CAC1CC,SAAS,CAAE,CAAC,CAAEF,KAAK,CAAEA,KAAK,CAACG,KAAM,CAAC,CACtC,CAAC","ignoreList":[]}',version:"3.16.7"},en=function(t){var n=t.color,o=void 0===n?"#ef4444":n,i=t.size,s=void 0===i?28:i,a=t.style,u=l.useSharedValue(1);r.useEffect((function(){u.value=l.withRepeat(l.withSequence(l.withTiming(1.22,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var c,d,f=l.useAnimatedStyle((c=[new global.Error,-2,-27],(d=function(){return{transform:[{scale:u.value}]}}).__closure={scale:u},d.__workletHash=3539239666849,d.__initData=Jt,d.__stackDetails=c,d));return e.jsx(l.View,{style:[f,a],children:e.jsx(Xt,{style:{width:s,height:s},color:o})})},tn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},nn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Rect,{x:"5",y:"11",width:"14",height:"10",rx:"2",stroke:i,strokeWidth:"1.5"}),e.jsx(o.Path,{d:"M8 11V7a4 4 0 0 1 8 0v4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})},rn={code:"function LockSlideColumnTsx1(){const{chevronY}=this.__closure;return{transform:[{translateY:chevronY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx1","chevronY","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAoB0C,SAAAA,oBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,QAAQ,CAACI,KAAM,CAAC,CAC9C,CAAC","ignoreList":[]}',version:"3.16.7"},on={code:"function LockSlideColumnTsx2(){const{lockScale}=this.__closure;return{transform:[{scale:lockScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx2","lockScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAuBuC,SAAAA,oBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CACtCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},ln=function(n){var o,i,s,a,u,c,d=n.slideY,f=n.lockSlideDistance,v=n.recordingUIProps,h=n.voiceRecorderStyles,p=null!==(o=null==v?void 0:v.lockPillBackground)&&void 0!==o?o:"rgba(30,30,30,0.88)",y=null!==(i=null==v?void 0:v.lockIconColor)&&void 0!==i?i:"#e5e7eb",m=null!==(s=null==v?void 0:v.chevronIconColor)&&void 0!==s?s:"#9ca3af",g=null!==(a=null==v?void 0:v.lockPillGap)&&void 0!==a?a:8,x=null!==(u=null==v?void 0:v.lockPillMarginBottom)&&void 0!==u?u:10,b=l.useSharedValue(0);r.useEffect((function(){b.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:450,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:450,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var w=l.useSharedValue(.92);r.useEffect((function(){w.value=l.withRepeat(l.withSequence(l.withTiming(1,{duration:550,easing:l.Easing.out(l.Easing.ease)}),l.withTiming(.92,{duration:550,easing:l.Easing.in(l.Easing.ease)})),-1,!1)}),[]);var j,C,S=l.useAnimatedStyle((j=[new global.Error,-2,-27],(C=function(){return{transform:[{translateY:b.value}]}}).__closure={chevronY:b},C.__workletHash=0xfad898b1b5b,C.__initData=rn,C.__stackDetails=j,C)),A=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{scale:w.value}]}};return t.__closure={lockScale:w},t.__workletHash=0xbc18c7930ff,t.__initData=on,t.__stackDetails=e,t}()),P=Math.min(1,Math.max(0,-d/f));return e.jsx(t.View,{style:[{alignItems:"center",marginBottom:x},null==h?void 0:h.lockContainer],pointerEvents:"none",children:e.jsxs(t.View,{style:[{backgroundColor:p,borderRadius:22,paddingVertical:10,paddingHorizontal:14,alignItems:"center",gap:g,opacity:.85+.15*P,borderWidth:P>.85?1.5:0,borderColor:null!==(c=null==v?void 0:v.lockPillActiveBorderColor)&&void 0!==c?c:"#22c55e"},null==h?void 0:h.lockPill],children:[e.jsx(l.View,{style:A,children:e.jsx(nn,{style:{width:20,height:20},color:y})}),e.jsx(l.View,{style:S,children:e.jsx(tn,{style:{width:18,height:18},color:m})})]})})},sn={code:"function LongPressRecordingTsx1(){const{slideTextX,cancelProgress}=this.__closure;return{transform:[{translateX:slideTextX.value}],opacity:1-cancelProgress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx1","slideTextX","cancelProgress","__closure","transform","translateX","value","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAc4C,SAAAA,uBAAA,QAAAC,UAAA,CAAAC,cAAA,OAAAC,SAAA,OAAO,CAC3CC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,UAAU,CAACK,KAAM,CAAC,CAAC,CAC7CC,OAAO,CAAE,CAAC,CAAGL,cACjB,CAAC","ignoreList":[]}',version:"3.16.7"},an=function(n){var o,i,s=n.duration,a=n.slideX,u=n.containerHeight,c=void 0===u?50:u,d=n.fontFamily,f=n.voiceRecorderStyles,v=n.recordingUIProps,h=null!==(o=null==v?void 0:v.cancelTextColor)&&void 0!==o?o:"rgba(107,114,128,1)",p=null!==(i=null==v?void 0:v.timerColor)&&void 0!==i?i:"#374151",y=l.useSharedValue(0);r.useEffect((function(){y.value=l.withRepeat(l.withSequence(l.withTiming(-6,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var m,g,x=Math.min(1,Math.abs(Math.min(0,a))/70),b=l.useAnimatedStyle((m=[new global.Error,-3,-27],(g=function(){return{transform:[{translateX:y.value}],opacity:1-x}}).__closure={slideTextX:y,cancelProgress:x},g.__workletHash=0xbbdd56b2a8f,g.__initData=sn,g.__stackDetails=m,g));return e.jsxs(t.View,{style:[{flex:1,flexDirection:"row",alignItems:"center",minHeight:c,paddingHorizontal:4},null==f?void 0:f.longPressBar],children:[e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:p,minWidth:44,fontFamily:d},null==f?void 0:f.timer,null==v?void 0:v.timerTextStyle],children:Ge(s)}),e.jsx(l.View,{style:[b,{flex:1,alignItems:"center"}],children:e.jsx(t.Text,{style:[{fontSize:14,color:h,fontFamily:d},null==f?void 0:f.slideText],children:"< Slide to cancel"})})]})},un=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Path,{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx(o.Path,{d:"M10 11v6M14 11v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})};var cn=function(n){var o=n.isActive,i=n.color,l=void 0===i?"rgba(0,0,0,0.45)":i,s=n.height,a=void 0===s?26:s,u=n.style,c=I(r.useState((function(){return Array.from({length:22},(function(){return.3}))})),2),d=c[0],f=c[1];return r.useEffect((function(){if(o){var e=setInterval((function(){return f(Array.from({length:22},(function(){return.15+.85*Math.random()})))}),110);return function(){return clearInterval(e)}}f(Array.from({length:22},(function(){return.3})))}),[o]),e.jsx(t.View,{style:[{flexDirection:"row",alignItems:"center",height:a,gap:2},u],children:d.map((function(n,r){return e.jsx(t.View,{style:{flex:1,height:Math.max(3,Math.round(n*a)),borderRadius:2,backgroundColor:l}},r)}))})},dn=function(n){var r,o,i,l,s,a,u,c=n.isRecording,d=n.isPaused,f=n.duration,v=n.onCancel,h=n.onSend,p=n.onPause,y=n.onResume,m=n.containerHeight,g=void 0===m?50:m,x=n.fontFamily,b=n.sendButtonColor,w=void 0===b?"#16a34a":b,j=n.sendIconColor,C=void 0===j?"#ffffff":j,S=n.enablePauseResume,A=void 0===S||S,P=n.voiceRecorderStyles,k=n.recordingUIProps,I=n.CustomPlayIcon,T=n.CustomPauseIcon,O=null!==(r=null==k?void 0:k.waveformColor)&&void 0!==r?r:"rgba(0,0,0,0.45)",R=null!==(o=null==k?void 0:k.cancelTextColor)&&void 0!==o?o:"#ef4444",M=null!==(i=null==k?void 0:k.timerColor)&&void 0!==i?i:"#374151",E=null!==(l=null==k?void 0:k.recordingBackground)&&void 0!==l?l:"transparent",V=null!==(s=null==k?void 0:k.playPauseButtonBackground)&&void 0!==s?s:"rgba(0,0,0,0.08)",_=null!==(a=null==k?void 0:k.playPauseIconColor)&&void 0!==a?a:"#374151",F=null!==(u=null==k?void 0:k.playPauseIconSize)&&void 0!==u?u:18;return e.jsxs(t.View,{style:[{flexDirection:"row",alignItems:"center",minHeight:g,paddingHorizontal:4,backgroundColor:E,gap:8},null==P?void 0:P.normalBar],children:[e.jsx(t.Pressable,{onPress:v,style:[{width:g,height:g,borderRadius:g/2,justifyContent:"center",alignItems:"center",backgroundColor:"".concat(R,"18")},null==P?void 0:P.trashButton],hitSlop:6,children:e.jsx(un,{style:{width:.44*g,height:.44*g},color:R})}),e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:M,minWidth:40,fontFamily:x},null==P?void 0:P.timer,null==k?void 0:k.timerTextStyle],children:Ge(f)}),e.jsx(cn,{isActive:c&&!d,color:O,height:Math.round(.52*g),style:[{flex:1},null==P?void 0:P.waveform]}),A&&e.jsx(t.Pressable,{onPress:d?y:p,style:[{width:40,height:40,borderRadius:20,backgroundColor:V,justifyContent:"center",alignItems:"center"},null==P?void 0:P.playPauseButton],hitSlop:6,children:d?I?e.jsx(I,{}):e.jsx($e,{style:{width:F,height:F},color:_}):T?e.jsx(T,{}):e.jsx(He,{style:{width:F,height:F},color:_})}),e.jsx(t.Pressable,{onPress:h,style:[{width:g,height:g,borderRadius:g/2,backgroundColor:w,justifyContent:"center",alignItems:"center"},null==P?void 0:P.sendButton],hitSlop:4,children:e.jsx(Zt,{style:{width:.44*g,height:.44*g},color:C})})]})};function fn(){return vn.apply(this,arguments)}function vn(){return(vn=c(R().mark((function e(){var n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==t.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,t.PermissionsAndroid.request(t.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return n=e.sent,e.abrupt("return",n===t.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var hn=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},pn=function(n){var r=n.fileName,o=n.style,i=F().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:G([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(r)})},yn=r.memo(pn);function mn(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var gn,xn,bn,wn,jn,Cn,Sn,An,Pn,kn,In,Tn,On,Rn,Mn,En,Vn,_n,Fn,Bn,Ln,zn=function(n){var r,o=n.previews,l=n.closePreview,s=n.onRemoveItem,a=n.CustomFileIcon,u=n.CustomImagePreview,c=n.CustomVideoPreview,d=n.inputHeight,f=F(),v=f.theme,h=f.setMediaViewerGallery,p=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),y=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),m=mn(o);if(0===o.length)return null;var g=function(e){0!==m.length&&h(m,e)},x=function(n){var r,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,s=null===(r=n.type)||void 0===r?void 0:r.startsWith("image/"),a=null===(o=n.type)||void 0===o?void 0:o.startsWith("video/");return s&&u?e.jsx(u,{uri:n.uri}):a&&c?e.jsx(c,{uri:n.uri}):s?e.jsx(t.Image,{source:{uri:n.uri},style:{width:l,height:l,borderRadius:12},resizeMode:"cover"}):a?e.jsx(t.View,{style:{width:l,height:l,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:n.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},b=function(n,r){return e.jsx(t.Pressable,{onPress:function(){return s?s(n):null==l?void 0:l()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:r?[{rotate:r}]:void 0},children:e.jsx(t.Text,{style:G({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==v?void 0:v.fontFamily),children:"×"})})};return e.jsx(t.View,{style:[{position:"absolute",bottom:(null!=d?d:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==v||null===(r=v.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===p.length)return null;if(1===p.length){var n=p[0];return n?e.jsxs(t.Pressable,{onPress:function(){return g(0)},style:{position:"relative"},children:[x(n),b(n.uri)]}):null}var r=p.slice(0,3),o=p.length>3?p.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",s=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=mn(p).findIndex((function(e){return e.uri===n.uri}));g(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[x(n),2===i&&o>0&&e.jsx(t.View,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),b(n.uri,s)]})},"".concat(n.uri,"-").concat(i))}))})}(),y.length>0&&e.jsx(t.ScrollView,{scrollEnabled:y.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:y.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:y.map((function(n,r){return function(n,r){var o,i,l,s;return e.jsxs(t.View,{style:{position:"relative"},children:[e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==v||null===(o=v.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==v||null===(i=v.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:a?e.jsx(a,{}):e.jsx(hn,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==v||null===(l=v.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(yn,{fileName:n.name||"File",style:null==v||null===(s=v.filePreviewStyle)||void 0===s?void 0:s.text})})]}),b(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},Dn=r.memo(zn),Nn="ios"===t.Platform.OS?32:30,Wn="ios"===t.Platform.OS?50:48,Hn="h-6 w-6",$n=function(o){var i,l,s,a,u,d,f,v,h,p,y,m,x,b,w,j,C,S,A,P,k,O,M,E=o.onSendMessage,V=o.onTypingStart,_=o.onTypingEnd,B=o.onAttachmentPress,L=o.onCameraPress,z=o.onAudioRecordStart,D=o.onAudioRecordEnd,N=o.CustomEmojiIcon,W=o.CustomAttachmentIcon,H=o.CustomCameraIcon,$=o.CustomSendIcon,U=o.CustomMicrophoneIcon,K=o.CustomFileIcon,Y=o.CustomImagePreview,X=o.CustomVideoPreview,Q=I(r.useState(""),2),Z=Q[0],J=Q[1],ee=I(r.useState(0),2),te=ee[0],ne=ee[1],re=I(r.useState({height:Nn,isMultiline:!1}),2),oe=re[0],ie=re[1],le=F(),se=le.theme,ae=le.currentUserId,ue=le.showEmojiButton,ce=le.showAttachmentsButton,de=le.showCameraButton,fe=le.showVoiceRecordButton,ve=le.placeholder,he=le.previewData,pe=le.previewItems,ye=le.closePreview,me=le.onRemovePreviewItem,ge=le.voiceRecorderProps,xe=le.voiceRecorderStyles,be=le.recordingUIProps,we=le.renderVoiceRecorder,je=le.CustomPlayIcon,Ce=le.CustomPauseIcon,Se=r.useMemo((function(){return null!=pe&&pe.length?pe:he?[he]:[]}),[pe,he]),Ae=Se.length>0,Pe=null==se||null===(i=se.sizes)||void 0===i?void 0:i.inputIconSize,ke=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():q;return n.style(t)}(Pe),Ie="number"==typeof(M=Pe)&&M>0?M:24,Te=0===Z.trim().length&&!oe.isMultiline,Oe=Math.max(0,(Wn-Ie)/2),Re=Te?{paddingTop:Oe,paddingBottom:Oe}:{paddingBottom:Oe},Me=r.useCallback((function(){ie({height:Nn,isMultiline:!1}),ne((function(e){return e+1}))}),[]),Ee=r.useCallback((function(e){J(e),0===e.length&&Me()}),[Me]),Ve=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Nn),118),n=t>Nn;ie({height:n?t:Nn,isMultiline:n})}),[]),_e=r.useCallback((function(){var e=Z.trim();(e||Ae)&&(E({text:e,senderId:ae}),J(""),Me())}),[Z,E,ae,Ae,Me]);r.useEffect((function(){Z.trim()?null==V||V():null==_||_()}),[Z,V,_]);var Fe=!!Z.trim()||Ae,Be=I(r.useState("idle"),2),Le=Be[0],ze=Be[1],De=r.useRef("idle"),Ne=r.useCallback((function(e){De.current=e,ze(e)}),[]),We=null!==(l=null==be?void 0:be.lockSlideDistance)&&void 0!==l?l:72,He=r.useRef(We);He.current=We;var $e=I(r.useState(0),2),Ue=$e[0],qe=$e[1],Ge=I(r.useState(0),2),Ke=Ge[0],Ye=Ge[1],Xe=r.useRef(0),Qe=r.useRef(0),Ze=r.useCallback((function(e){null==D||D(e)}),[D]),Je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDuration,n=void 0===t?300:t,o=e.onRecordStart,i=e.onRecordEnd,l=I(r.useState("idle"),2),s=l[0],a=l[1],u=I(r.useState(0),2),d=u[0],f=u[1],v=r.useRef(null),h=r.useRef(null),p=r.useRef(0),y=r.useRef(i);y.current=i;var m=r.useRef(o);m.current=o;var g=r.useRef(n);g.current=n;var x=r.useCallback((function(){h.current&&(clearInterval(h.current),h.current=null)}),[]),b=r.useCallback((function(e){x(),h.current=setInterval((function(){p.current+=1,f(p.current),p.current>=g.current&&e()}),1e3)}),[x]),w=r.useCallback(c(R().mark((function e(){var t,n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,fn();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),v.current=t,p.current=0,f(0),a("recording"),b((function(){return A.current()})),null===(n=m.current)||void 0===n||n.call(m)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[b]),j=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.stop(),a("paused"),x()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[x]),C=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.start(),a("recording"),b((function(){return A.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[b]),S=r.useCallback(c(R().mark((function e(){var t,n,r,o,i;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current){e.next=3;break}return e.abrupt("return",null);case 3:return x(),v.current=null,n=p.current,p.current=0,a("idle"),f(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,n),mimeType:"audio/wav"},null===(r=y.current)||void 0===r||r.call(y,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[x]),A=r.useRef(S);A.current=S;var P=r.useCallback((function(){return A.current()}),[]),k=r.useCallback(c(R().mark((function e(){var t,n,r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current,x(),v.current=null,p.current=0,a("idle"),f(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(n=e.sent)){e.next=21;break}return e.prev=12,r=require("react-native-fs"),o=n.startsWith("file://")?n.slice(7):n,e.next=17,r.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[x]);return r.useEffect((function(){return function(){x();try{var e;null===(e=v.current)||void 0===e||e.stop()}catch(e){}}}),[x]),{status:s,duration:d,isRecording:"recording"===s,isPaused:"paused"===s,startRecording:w,pauseRecording:j,resumeRecording:C,stopRecording:P,cancelRecording:k}}({maxDuration:null!==(s=null==ge?void 0:ge.maxDuration)&&void 0!==s?s:300,onRecordStart:z,onRecordEnd:Ze}),et=r.useRef(Je);et.current=Je;var tt=r.useCallback(c(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,et.current.stopRecording();case 2:t=e.sent,Ne("idle"),t&&E({audio:t.uri,senderId:ae});case 5:case"end":return e.stop()}}),e)}))),[E,ae,Ne]),nt=r.useCallback((function(){et.current.cancelRecording(),Ne("idle"),qe(0),Ye(0),Xe.current=0,Qe.current=0}),[Ne]),rt=r.useRef(tt);rt.current=tt;var ot=r.useRef(nt);ot.current=nt;var it=r.useRef(),lt=r.useRef(!1),st=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return lt.current},onPanResponderGrant:function(){lt.current=!1,Xe.current=0,Qe.current=0,qe(0),Ye(0),it.current=setTimeout(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return lt.current=!0,e.next=3,et.current.startRecording();case 3:Ne("longPress");case 4:case"end":return e.stop()}}),e)}))),500)},onPanResponderMove:function(e,t){lt.current&&(Xe.current=t.dx,Qe.current=t.dy,qe(t.dx),Ye(t.dy),!1!==(null==ge?void 0:ge.enableLockRecording)&&t.dy<=-He.current&&"longPress"===De.current&&(Ne("locked"),Qe.current=-He.current,Ye(-He.current)))},onPanResponderRelease:(e=c(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(it.current),r=lt.current,lt.current=!1,r){e.next=8;break}return e.next=6,et.current.startRecording();case 6:return Ne("normal"),e.abrupt("return");case 8:if("locked"!==De.current){e.next=10;break}return e.abrupt("return");case 10:n.dx<-70?ot.current():rt.current();case 11:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)}),onPanResponderTerminate:function(){clearTimeout(it.current),lt.current=!1}});var e}),[]),at=null!==(a=null!==(u=null==be?void 0:be.recordingSendButtonBackground)&&void 0!==u?u:null==se||null===(d=se.inputStyles)||void 0===d||null===(d=d.sendButtonStyle)||void 0===d?void 0:d.backgroundColor)&&void 0!==a?a:"#16a34a",ut=null!==(f=null==se||null===(v=se.colors)||void 0===v?void 0:v.sendIconsColor)&&void 0!==f?f:"#ffffff",ct=null!==(h=null==be?void 0:be.longPressMicColor)&&void 0!==h?h:"#ef4444",dt=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.containerBorderTopColor)&&void 0!==n?n:"rgba(0,0,0,0.12)";return g({borderTopWidth:null!==(r=null==t?void 0:t.containerBorderTopWidth)&&void 0!==r?r:1,borderTopColor:o,paddingTop:10,paddingBottom:4},null==e?void 0:e.container)}(xe,be);if("idle"!==Le){var ft,vt,ht,pt,yt,mt={isRecording:Je.isRecording,isPaused:Je.isPaused,duration:Je.duration,isLocked:"locked"===Le,slideOffset:{x:Ue,y:Ke},waveformData:[],startRecording:Je.startRecording,stopRecording:Je.stopRecording,pauseRecording:Je.pauseRecording,resumeRecording:Je.resumeRecording,cancelRecording:nt};return e.jsxs(t.View,{style:n(gn||(gn=T(["w-full px-2"]))),children:[Ae&&e.jsx(Dn,{previews:Se,closePreview:ye,onRemoveItem:me,CustomFileIcon:K,CustomImagePreview:Y,CustomVideoPreview:X,inputHeight:oe.height}),e.jsx(t.View,{style:dt,children:we?we(mt):"longPress"===Le?e.jsxs(t.View,{style:[n(xn||(xn=T(["flex-row items-end gap-2"]))),null==se||null===(ft=se.inputStyles)||void 0===ft?void 0:ft.inputSectionContainerStyle],children:[e.jsx(an,{duration:Je.duration,slideX:Ue,containerHeight:Wn,fontFamily:null==se?void 0:se.fontFamily,voiceRecorderStyles:xe,recordingUIProps:be}),e.jsxs(t.View,{style:{alignItems:"center"},children:[e.jsx(ln,{slideY:Ke,lockSlideDistance:We,recordingUIProps:be,voiceRecorderStyles:xe}),e.jsx(t.View,g(g({},st.panHandlers),{},{style:[n(bn||(bn=T(["rounded-full justify-center items-center"]))),{height:Wn,width:Wn,backgroundColor:at},null==xe?void 0:xe.holdMicButton,null==se||null===(vt=se.inputStyles)||void 0===vt?void 0:vt.sendButtonStyle],children:e.jsx(en,{color:ct,size:null!==(ht=null!==(pt=null==be?void 0:be.recordingIconSize)&&void 0!==pt?pt:null==be?void 0:be.iconSize)&&void 0!==ht?ht:28})}))]})]}):e.jsx(dn,{isRecording:Je.isRecording,isPaused:Je.isPaused,duration:Je.duration,onCancel:nt,onSend:tt,onPause:Je.pauseRecording,onResume:Je.resumeRecording,enablePauseResume:null===(yt=null==ge?void 0:ge.enablePauseResume)||void 0===yt||yt,containerHeight:Wn,fontFamily:null==se?void 0:se.fontFamily,sendButtonColor:at,sendIconColor:ut,voiceRecorderStyles:xe,recordingUIProps:be,CustomPlayIcon:je,CustomPauseIcon:Ce})})]})}return e.jsxs(t.View,{style:n(wn||(wn=T(["w-full px-2"]))),children:[Ae&&e.jsx(Dn,{previews:Se,closePreview:ye,onRemoveItem:me,CustomFileIcon:K,CustomImagePreview:Y,CustomVideoPreview:X,inputHeight:oe.height}),e.jsxs(t.View,{style:[n(jn||(jn=T(["flex-row items-end gap-2"]))),null==se||null===(p=se.inputStyles)||void 0===p?void 0:p.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(Cn||(Cn=T(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Wn,borderRadius:Te?9999:24,alignItems:Te?"center":"flex-end"},null==se||null===(y=se.inputStyles)||void 0===y?void 0:y.inputContainerStyle],children:[ue&&e.jsx(t.View,{style:Re,children:e.jsx(t.Pressable,{children:N?e.jsx(N,{}):e.jsx(Yt,{style:ke,color:(null==se||null===(m=se.colors)||void 0===m?void 0:m.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:Z,onChangeText:Ee,placeholder:ve||"Message",style:G([n(Sn||(Sn=T(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(An||(An=T(["text-[17px]"]))):n(Pn||(Pn=T(["text-[16px]"]))),{minHeight:Nn,maxHeight:118,paddingVertical:Te?0:8,marginVertical:Te?(Wn-Nn)/2:4},{color:(null==se||null===(x=se.colors)||void 0===x?void 0:x.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==se?void 0:se.fontFamily),placeholderTextColor:(null==se||null===(b=se.colors)||void 0===b?void 0:b.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:oe.isMultiline&&Z.length>0?"top":"center",onContentSizeChange:Ve},"chat-input-".concat(te)),e.jsxs(t.View,{style:[n(kn||(kn=T(["flex-row items-center gap-4"]))),Re],children:[ce&&e.jsx(t.Pressable,{onPress:B,children:W?e.jsx(W,{}):e.jsx(Qt,{style:ke,color:(null==se||null===(w=se.colors)||void 0===w?void 0:w.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),de&&!Z.trim()&&e.jsx(t.Pressable,{onPress:L,children:H?e.jsx(H,{}):e.jsx(Kt,{style:ke,color:(null==se||null===(j=se.colors)||void 0===j?void 0:j.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),Fe?e.jsx(t.Pressable,{onPress:_e,style:[n(In||(In=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(C=se.inputStyles)||void 0===C?void 0:C.sendButtonStyle)],children:$?e.jsx($,{}):e.jsx(Zt,{style:n.style(Hn),color:(null==se||null===(S=se.colors)||void 0===S?void 0:S.sendIconsColor)||"rgba(255,255,255,0.7)"})}):fe?e.jsx(t.View,g(g({},st.panHandlers),{},{style:[n(Tn||(Tn=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(A=se.inputStyles)||void 0===A?void 0:A.sendButtonStyle)],children:U?e.jsx(U,{}):e.jsx(Xt,{style:n.style("h-8 w-8"),color:(null==se||null===(P=se.colors)||void 0===P?void 0:P.sendIconsColor)||"rgba(255,255,255,0.7)"})})):e.jsx(t.Pressable,{onPress:_e,style:[n(On||(On=T(["rounded-full justify-center items-center"]))),g({height:Wn,width:Wn,backgroundColor:"#16a34a"},null==se||null===(k=se.inputStyles)||void 0===k?void 0:k.sendButtonStyle)],children:$?e.jsx($,{}):e.jsx(Zt,{style:n.style(Hn),color:(null==se||null===(O=se.colors)||void 0===O?void 0:O.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Un=r.memo($n);function qn(t){var r=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.style("h-6 w-6 text-black",r),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Gn,Kn,Yn,Xn,Qn,Zn,Jn,er,tr,nr,rr,or,ir,lr=function(o){var i,l=o.gallery,s=o.onClose,a=F(),u=a.theme,c=a.setIsVideoPlaying,d=r.useRef(null),f=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,v=I(r.useState(f),2),h=v[0],p=v[1],y=t.useWindowDimensions(),m=y.width,g=y.height;r.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;p(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=d.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==l?void 0:l.initialIndex,null==l?void 0:l.items,c]);var x=r.useCallback((function(){c(!1),s()}),[s,c]),b=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/m);p(t);var n=null==l?void 0:l.items[t];c("video"===(null==n?void 0:n.kind))}),[null==l?void 0:l.items,m,c]);return l&&0!==l.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:x,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[n(Rn||(Rn=T(["flex-1 bg-black"]))),{width:m,height:g}],children:[e.jsx(t.Pressable,{onPress:x,style:n(Mn||(Mn=T(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(qn,{style:n(En||(En=T(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(t.View,{style:n(Vn||(Vn=T(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:G(n(_n||(_n=T(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==u?void 0:u.fontFamily),children:[h+1," / ",l.items.length]})}),e.jsx(t.FlatList,{ref:d,data:l.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:l.initialIndex,extraData:h,getItemLayout:function(e,t){return{length:m,offset:m*t,index:t}},onMomentumScrollEnd:b,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=d.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(sr,{item:n,width:m,height:g,isActive:r===h,autoPlayVideo:r===f&&"video"===n.kind})}})]})}):null},sr=function(o){var l=o.item,s=o.width,a=o.height,u=o.isActive,c=o.autoPlayVideo,d=F().theme,f=r.useRef(null),v=I(r.useState("video"===l.kind),2),h=v[0],p=v[1],y=I(r.useState(!1),2),m=y[0],g=y[1],x="video"===l.kind&&u&&c;return"image"===l.kind?e.jsx(t.View,{style:{width:s,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:l.uri},style:{width:s,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:s,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(i,{source:{uri:l.uri},ref:f,controls:!0,paused:!x,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:s-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){p(!0),g(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){g(!0),p(!1)}}),h&&e.jsx(t.View,{style:n(Fn||(Fn=T(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(st,{style:n.style("h-14 w-14"),spinning:!0})}),m&&e.jsx(t.View,{style:n(Bn||(Bn=T(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:G(n(Ln||(Ln=T(["text-white font-semibold"]))),null==d?void 0:d.fontFamily),children:"Failed to load video"})})]})},ar=r.memo(lr),ur=function(r){var o,i,l,s,a,u=r.typingUsers,c=r.currentUserId,d=F(),f=d.theme,v=d.showAvatars,h=d.renderCustomTyping,p=d.showBubbleTail,y=d.typingText,m=u.filter((function(e){return e.id!==c}));if(!m.length)return null;var x=m.slice(0,2),b=m.length-2,w=v?x.length+(b>0?1:0):0,j=w>0?24+14*Math.max(0,w-1):0,C=w>0?j+12:8,S=-(j+12);return e.jsxs(t.View,{style:[n(Gn||(Gn=T(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:C},null==f||null===(o=f.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[v&&w>0&&e.jsxs(t.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[x.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(Kn||(Kn=T(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:x.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(Yn||(Yn=T(["w-full h-full object-cover rounded-full"]))),null==f||null===(i=f.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:G([n(Xn||(Xn=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==f||null===(l=f.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==f?void 0:f.fontFamily),children:null===(s=r.name)||void 0===s?void 0:s.charAt(0)})},r.id)})),b>0&&e.jsx(t.View,{style:[n(Qn||(Qn=T(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},g({},null==f||null===(i=f.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:G([n(Zn||(Zn=T(["text-white text-xs font-semibold"]))),null==f||null===(l=f.bubbleStyle)||void 0===l?void 0:l.additionalTypingUsersTextStyle],null==f?void 0:f.fontFamily),children:["+",b]})})]}),p&&e.jsx(M,{style:n.style("absolute -top-1 w-6 h-6 rotate-180 -left-3.5 mt-[1.26px]"),color:(null==f||null===(s=f.colors)||void 0===s?void 0:s.receivedMessageTailColor)||"white"}),h?h():e.jsx(t.View,{style:n(Jn||(Jn=T(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:G([n(er||(er=T(["text-gray-600"]))),null==f||null===(a=f.bubbleStyle)||void 0===a?void 0:a.typingTextStyle],null==f?void 0:f.fontFamily),children:null!=y?y:"Typing..."})})]})};var cr=function(){var o=F(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,v=o.onTypingEnd,h=o.onAttachmentPress,p=o.onAudioRecordEnd,y=o.onAudioRecordStart,m=o.onCameraPress,g=o.renderCustomInput,x=o.CustomEmojiIcon,b=o.CustomAttachmentIcon,w=o.CustomCameraIcon,j=o.CustomMicrophoneIcon,C=o.CustomSendIcon,S=o.CustomFileIcon,A=o.CustomImagePreview,P=o.CustomVideoPreview,k=o.keyboardVerticalOffset,O=void 0===k?0:k,R=o.disableKeyboardAvoiding,M=void 0!==R&&R,E=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=I(r.useState(0),2),o=n[0],i=n[1];return r.useEffect((function(){if(e){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(n,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!M),V=g?g():e.jsx(Un,{onSendMessage:d,onTypingStart:f,onTypingEnd:v,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:y,onCameraPress:m,CustomEmojiIcon:x,CustomAttachmentIcon:b,CustomCameraIcon:w,CustomMicrophoneIcon:j,CustomSendIcon:C,CustomFileIcon:S,CustomImagePreview:A,CustomVideoPreview:P}),_=e.jsxs(t.View,{style:n(tr||(tr=T(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(nr||(nr=T(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(Gt,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==s?void 0:s(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(ur,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&E>0?{marginBottom:E}:void 0,children:V}),e.jsx(ar,{gallery:a,onClose:u})]});return M?e.jsx(t.View,{style:n(rr||(rr=T(["flex-1"]))),children:_}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(or||(or=T(["flex-1"]))),children:_}):e.jsx(t.KeyboardAvoidingView,{style:n(ir||(ir=T(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:O,children:_})};module.exports=function(t){return e.jsx(qe,{children:e.jsx(_,g(g({},t),{},{children:e.jsx(cr,{})}))})};
|
|
17
17
|
//# sourceMappingURL=index.js.map
|