import{a as R,b as N,c as O}from"./chunk-XEHBQAFR.mjs";var v={};N(v,{default:()=>_});var b,_,g=R(()=>{"use strict";b=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n=[{kind:"Variable",name:"input",variableName:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"notificationsUnreadCount",storageKey:null},r={alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notifications",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"unread",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"NotificationsMarkAsReadMutation",selections:[{alias:null,args:n,concreteType:"NotificationsMarkAsReadPayload",kind:"LinkedField",name:"notificationsMarkAsRead",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"recipient",plural:!1,selections:[t,a],storageKey:null},r],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"NotificationsMarkAsReadMutation",selections:[{alias:null,args:n,concreteType:"NotificationsMarkAsReadPayload",kind:"LinkedField",name:"notificationsMarkAsRead",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"recipient",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,a],storageKey:null},r],storageKey:null}]},params:{cacheID:"0698b685c49a59a3df4f281ad894f4e3",id:null,metadata:{},name:"NotificationsMarkAsReadMutation",operationKind:"mutation",text:`mutation NotificationsMarkAsReadMutation(
  $input: NotificationsMarkAsReadInput!
) {
  notificationsMarkAsRead(input: $input) {
    recipient {
      __typename
      id
      notificationsUnreadCount
    }
    notifications {
      id
      unread
    }
  }
}
`}}}();b.hash="0cbe23296c6c313d6443121d9695dc09";_=b});import{useNotification as C}from"@baseapp-frontend/utils";import{useMutation as x}from"react-relay";function d(e){"@babel/helpers - typeof";return d=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},d(e)}var l;function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,a)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?k(Object(t),!0).forEach(function(a){j(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function j(e,n,t){return(n=S(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function S(e){var n=P(e,"string");return d(n)=="symbol"?n:n+""}function P(e,n){if(d(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var a=t.call(e,n||"default");if(d(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function T(e,n){return F(e)||I(e,n)||K(e,n)||w()}function w(){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 K(e,n){if(e){if(typeof e=="string")return A(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(e,n):void 0}}function A(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}function I(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a,r,f,u,s=[],c=!0,i=!1;try{if(f=(t=t.call(e)).next,n===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(a=f.call(t)).done)&&(s.push(a.value),s.length!==n);c=!0);}catch(y){i=!0,r=y}finally{try{if(!c&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(i)throw r}}return s}}function F(e){if(Array.isArray(e))return e}var E=(l!==void 0||(l=(g(),O(v)),l.hash&&l.hash!=="0cbe23296c6c313d6443121d9695dc09"&&console.error("The definition of 'NotificationsMarkAsReadMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),l),q=function(){var n=C(),t=n.sendToast,a=x(E),r=T(a,2),f=r[0],u=r[1],s=function(i){return f(M(M({},i),{},{onCompleted:function(p,o){var m;o?.forEach(function(h){t(h.message,{type:"error"})}),i==null||(m=i.onCompleted)===null||m===void 0||m.call(i,p,o)},onError:function(p){var o;t(p.message,{type:"error"}),i==null||(o=i.onError)===null||o===void 0||o.call(i,p)}}))};return[s,u]};export{q as a};
//# sourceMappingURL=chunk-4DWGD4TS.mjs.map