"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 _chunkXD2OIZABjs = require('./chunk-XD2OIZAB.js');var g={};_chunkXD2OIZABjs.b.call(void 0, g,{default:()=>_});var b,_,v=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";b=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"id"}],n=[{fields:[{kind:"Variable",name:"id",variableName:"id"}],kind:"ObjectValue",name:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"deletedId",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,concreteType:"CommentsCount",kind:"LinkedField",name:"commentsCount",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"main",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"replies",storageKey:null}],storageKey:null},u=[l,a],o={alias:null,args:null,concreteType:"Comment",kind:"LinkedField",name:"inReplyTo",plural:!1,selections:u,storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"CommentDeleteMutation",selections:[{alias:null,args:n,concreteType:"CommentDeletePayload",kind:"LinkedField",name:"commentDelete",plural:!1,selections:[t,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"target",plural:!1,selections:u,storageKey:null},o],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"CommentDeleteMutation",selections:[{alias:null,args:n,concreteType:"CommentDeletePayload",kind:"LinkedField",name:"commentDelete",plural:!1,selections:[t,{alias:null,args:null,filters:null,handle:"deleteRecord",key:"",kind:"ScalarHandle",name:"deletedId"},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"target",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,a],storageKey:null},o],storageKey:null}]},params:{cacheID:"3f9b66fbbc156f14c485bd1a520b7c8c",id:null,metadata:{},name:"CommentDeleteMutation",operationKind:"mutation",text:`mutation CommentDeleteMutation(
  $id: ID!
) {
  commentDelete(input: {id: $id}) {
    deletedId
    target {
      __typename
      id
      commentsCount {
        total
        main
        replies
      }
    }
    inReplyTo {
      id
      commentsCount {
        total
        main
        replies
      }
    }
  }
}
`}}}();b.hash="453e11c9b3acd12fc26471e671726bfc";_=b});var _utils = require('@baseapp-frontend/utils');var _reactrelay = require('react-relay');function c(e){"@babel/helpers - typeof";return c=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},c(e)}var d;function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);n&&(l=l.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,l)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?h(Object(t),!0).forEach(function(l){j(e,l,t[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})}return e}function j(e,n,t){return(n=T(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function T(e){var n=K(e,"string");return c(n)=="symbol"?n:n+""}function K(e,n){if(c(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var l=t.call(e,n||"default");if(c(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function P(e,n){return A(e)||I(e,n)||w(e,n)||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 w(e,n){if(e){if(typeof e=="string")return D(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)?D(e,n):void 0}}function D(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function I(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var l,a,u,o,s=[],m=!0,r=!1;try{if(u=(t=t.call(e)).next,n===0){if(Object(t)!==t)return;m=!1}else for(;!(m=(l=u.call(t)).done)&&(s.push(l.value),s.length!==n);m=!0);}catch(p){r=!0,a=p}finally{try{if(!m&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(r)throw a}}return s}}function A(e){if(Array.isArray(e))return e}var L=(d!==void 0||(d=(v(),_chunkXD2OIZABjs.c.call(void 0, g)),d.hash&&d.hash!=="453e11c9b3acd12fc26471e671726bfc"&&console.error("The definition of 'CommentDeleteMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),d),N= exports.b =function(){var n=_utils.useNotification.call(void 0, ),t=n.sendToast,l=_reactrelay.useMutation.call(void 0, L),a=P(l,2),u=a[0],o=a[1],s=function(r){return u(C(C({},r),{},{onCompleted:function(y,i){var f;_optionalChain([i, 'optionalAccess', _2 => _2.forEach, 'call', _3 => _3(function(k){t(k.message,{type:"error"})})]),r==null||(f=r.onCompleted)===null||f===void 0||f.call(r,y,i)},onError:function(y){var i;t(y.message,{type:"error"}),r==null||(i=r.onError)===null||i===void 0||i.call(r,y)}}))};return[s,o]};exports.a = L; exports.b = N;
//# sourceMappingURL=chunk-MA5VO7M7.js.map