import{a as S,b as K,c as O}from"./chunk-XEHBQAFR.mjs";var b={};K(b,{default:()=>R});var f,R,M=S(()=>{"use strict";f=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null},r={alias:null,args:null,concreteType:"ErrorType",kind:"LinkedField",name:"errors",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"field",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"messages",storageKey:null}],storageKey:null},o=[a];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"MessageUpdateMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomEditMessagePayload",kind:"LinkedField",name:"chatRoomEditMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"message",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[a,t,{args:null,kind:"FragmentSpread",name:"MessageItemFragment"}],storageKey:null}],storageKey:null},r],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"MessageUpdateMutation",selections:[{alias:null,args:n,concreteType:"ChatRoomEditMessagePayload",kind:"LinkedField",name:"chatRoomEditMessage",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"message",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[a,t,{alias:null,args:null,kind:"ScalarField",name:"created",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"deleted",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"extraData",storageKey:null},{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"inReplyTo",plural:!1,selections:o,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRead",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pk",storageKey:null},{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:o,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verb",storageKey:null}],storageKey:null}],storageKey:null},r],storageKey:null}]},params:{cacheID:"e64b604abf3ef1fa62f047b6a2563da3",id:null,metadata:{},name:"MessageUpdateMutation",operationKind:"mutation",text:`mutation MessageUpdateMutation(
  $input: ChatRoomEditMessageInput!
) {
  chatRoomEditMessage(input: $input) {
    message {
      node {
        id
        content
        ...MessageItemFragment
      }
    }
    errors {
      field
      messages
    }
  }
}

fragment MessageItemFragment on Message {
  id
  content
  created
  deleted
  extraData
  inReplyTo {
    id
  }
  isRead
  pk
  profile {
    id
  }
  verb
}
`}}}();f.hash="b118f4853919251adbfb8bcdbf909ca5";R=f});import{useNotification as A}from"@baseapp-frontend/utils";import{useMutation as x}from"react-relay";function p(e){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},p(e)}var s;function v(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,t)}return a}function h(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?v(Object(a),!0).forEach(function(t){E(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):v(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function E(e,n,a){return(n=T(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function T(e){var n=j(e,"string");return p(n)=="symbol"?n:n+""}function j(e,n){if(p(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n||"default");if(p(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function P(e,n){return w(e)||U(e,n)||I(e,n)||_()}function _(){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 I(e,n){if(e){if(typeof e=="string")return k(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?k(e,n):void 0}}function k(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function U(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var t,r,o,u,d=[],c=!0,l=!1;try{if(o=(a=a.call(e)).next,n===0){if(Object(a)!==a)return;c=!1}else for(;!(c=(t=o.call(a)).done)&&(d.push(t.value),d.length!==n);c=!0);}catch(m){l=!0,r=m}finally{try{if(!c&&a.return!=null&&(u=a.return(),Object(u)!==u))return}finally{if(l)throw r}}return d}}function w(e){if(Array.isArray(e))return e}var C=(s!==void 0||(s=(M(),O(b)),s.hash&&s.hash!=="b118f4853919251adbfb8bcdbf909ca5"&&console.error("The definition of 'MessageUpdateMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),s),q=function(){var n=A(),a=n.sendToast,t=x(C),r=P(t,2),o=r[0],u=r[1],d=function(l){return o(h(h({},l),{},{onCompleted:function(g,i){var y;i?.forEach(function(F){a(F.message,{type:"error"})}),l==null||(y=l.onCompleted)===null||y===void 0||y.call(l,g,i)},onError:function(g){var i;a(g.message,{type:"error"}),l==null||(i=l.onError)===null||i===void 0||i.call(l,g)}}))};return[d,u]};export{C as a,q as b};
//# sourceMappingURL=chunk-7G6NTKIV.mjs.map