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