"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk5KSFIOHFjs = require('./chunk-5KSFIOHF.js');var _chunkDNFXVZVIjs = require('./chunk-DNFXVZVI.js');var _chunkBVUCCBCLjs = require('./chunk-BVUCCBCL.js');var _react = require('react');var _authentication = require('@baseapp-frontend/authentication');var _utils = require('@baseapp-frontend/utils');var _zod = require('@hookform/resolvers/zod');var _reacthookform = require('react-hook-form');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}function _(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,o)}return e}function C(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?_(Object(e),!0).forEach(function(o){R(r,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):_(Object(e)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(e,o))})}return r}function R(r,t,e){return(t=T(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function T(r){var t=D(r,"string");return f(t)=="symbol"?t:t+""}function D(r,t){if(f(r)!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var o=e.call(r,t||"default");if(f(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function L(r,t){return $(r)||U(r,t)||x(r,t)||F()}function F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(r,t){if(r){if(typeof r=="string")return P(r,t);var e={}.toString.call(r).slice(8,-1);return e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set"?Array.from(r):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?P(r,t):void 0}}function P(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,o=Array(t);e<t;e++)o[e]=r[e];return o}function U(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var o,i,a,l,c=[],n=!0,u=!1;try{if(a=(e=e.call(r)).next,t===0){if(Object(e)!==e)return;n=!1}else for(;!(n=(o=a.call(e)).done)&&(c.push(o.value),c.length!==t);n=!0);}catch(m){u=!0,i=m}finally{try{if(!n&&e.return!=null&&(l=e.return(),Object(l)!==l))return}finally{if(u)throw i}}return c}}function $(r){if(Array.isArray(r))return r}var h=0,q=_react.forwardRef.call(void 0, function(r,t){var e=r.roomId,o=r.SocialInput,i=o===void 0?_chunkDNFXVZVIjs.a:o,a=r.SocialInputProps,l=a===void 0?{}:a,c=_authentication.useCurrentProfile.call(void 0, ),n=c.currentProfile,u=_reacthookform.useForm.call(void 0, {defaultValues:_chunkBVUCCBCLjs.a,resolver:_zod.zodResolver.call(void 0, _chunkBVUCCBCLjs.c)}),m=_chunk5KSFIOHFjs.b.call(void 0, ),b=L(m,2),j=b[0],d=b[1],M=function(A){if(!(d||!n)){h+=1;var w=h.toString(),E=_reactrelay.ConnectionHandler.getConnectionID(e,"chatRoom_allMessages");j({variables:{input:{content:A.body,profileId:_optionalChain([n, 'optionalAccess', _2 => _2.id]),roomId:e,clientMutationId:w},connections:[E]},onCompleted:function(p,v){var y;v&&console.error(v);var s=p==null||(y=p.chatRoomSendMessage)===null||y===void 0?void 0:y.errors;_utils.setFormRelayErrors.call(void 0, u,s),s!=null&&s.length||u.reset()},onError:console.error})}};return _jsxruntime.jsx.call(void 0, i,C({ref:t,form:u,submit:M,isLoading:d},l))}),ir= exports.a =q;exports.a = ir;
//# sourceMappingURL=chunk-DELKUM36.js.map