import {
  __esm,
  __export,
  __toCommonJS
} from "./chunk-NFEGQTCC.mjs";

// __generated__/useMessageCountUpdateSubscription.graphql.ts
var useMessageCountUpdateSubscription_graphql_exports = {};
__export(useMessageCountUpdateSubscription_graphql_exports, {
  default: () => useMessageCountUpdateSubscription_graphql_default
});
var node, useMessageCountUpdateSubscription_graphql_default;
var init_useMessageCountUpdateSubscription_graphql = __esm({
  "__generated__/useMessageCountUpdateSubscription.graphql.ts"() {
    "use strict";
    node = /* @__PURE__ */ function() {
      var v0 = [
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "profileId"
        }
      ], v1 = [
        {
          "kind": "Variable",
          "name": "profileId",
          "variableName": "profileId"
        }
      ], v2 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "id",
        "storageKey": null
      }, v3 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "totalCount",
        "storageKey": null
      }, v4 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "count",
        "storageKey": null
      }, v5 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "markedUnread",
        "storageKey": null
      }, v6 = {
        "alias": null,
        "args": null,
        "concreteType": "MessageConnection",
        "kind": "LinkedField",
        "name": "allMessages",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "MessageEdge",
            "kind": "LinkedField",
            "name": "edges",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": "Message",
                "kind": "LinkedField",
                "name": "node",
                "plural": false,
                "selections": [
                  v2,
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "isRead",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      };
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "useMessageCountUpdateSubscription",
          "selections": [
            {
              "alias": null,
              "args": v1,
              "concreteType": "ChatRoomOnMessagesCountUpdate",
              "kind": "LinkedField",
              "name": "chatRoomOnMessagesCountUpdate",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "Profile",
                  "kind": "LinkedField",
                  "name": "profile",
                  "plural": false,
                  "selections": [
                    v2,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "ChatRoomConnection",
                      "kind": "LinkedField",
                      "name": "chatRooms",
                      "plural": false,
                      "selections": [
                        v3,
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "ChatRoomEdge",
                          "kind": "LinkedField",
                          "name": "edges",
                          "plural": true,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "concreteType": "ChatRoom",
                              "kind": "LinkedField",
                              "name": "node",
                              "plural": false,
                              "selections": [
                                v2,
                                {
                                  "alias": null,
                                  "args": null,
                                  "concreteType": "UnreadMessageCount",
                                  "kind": "LinkedField",
                                  "name": "unreadMessages",
                                  "plural": false,
                                  "selections": [
                                    v4,
                                    v5
                                  ],
                                  "storageKey": null
                                },
                                v6
                              ],
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "type": "Subscription",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "useMessageCountUpdateSubscription",
          "selections": [
            {
              "alias": null,
              "args": v1,
              "concreteType": "ChatRoomOnMessagesCountUpdate",
              "kind": "LinkedField",
              "name": "chatRoomOnMessagesCountUpdate",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "Profile",
                  "kind": "LinkedField",
                  "name": "profile",
                  "plural": false,
                  "selections": [
                    v2,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "ChatRoomConnection",
                      "kind": "LinkedField",
                      "name": "chatRooms",
                      "plural": false,
                      "selections": [
                        v3,
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "ChatRoomEdge",
                          "kind": "LinkedField",
                          "name": "edges",
                          "plural": true,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "concreteType": "ChatRoom",
                              "kind": "LinkedField",
                              "name": "node",
                              "plural": false,
                              "selections": [
                                v2,
                                {
                                  "alias": null,
                                  "args": null,
                                  "concreteType": "UnreadMessageCount",
                                  "kind": "LinkedField",
                                  "name": "unreadMessages",
                                  "plural": false,
                                  "selections": [
                                    v4,
                                    v5,
                                    v2
                                  ],
                                  "storageKey": null
                                },
                                v6
                              ],
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ]
        },
        "params": {
          "cacheID": "ee87a4300f113870813418b0a818d031",
          "id": null,
          "metadata": {},
          "name": "useMessageCountUpdateSubscription",
          "operationKind": "subscription",
          "text": "subscription useMessageCountUpdateSubscription(\n  $profileId: ID!\n) {\n  chatRoomOnMessagesCountUpdate(profileId: $profileId) {\n    profile {\n      id\n      chatRooms {\n        totalCount\n        edges {\n          node {\n            id\n            unreadMessages {\n              count\n              markedUnread\n              id\n            }\n            allMessages {\n              edges {\n                node {\n                  id\n                  isRead\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
        }
      };
    }();
    node.hash = "57b09f90d1cdf7f57abc3956378d6b27";
    useMessageCountUpdateSubscription_graphql_default = node;
  }
});

// tmp-babel/messages/common/graphql/subscriptions/useMessageCountUpdateSubscription.js
import { useMemo } from "react";
import { useCurrentProfile } from "@baseapp-frontend/authentication";
import { graphql, useSubscription } from "react-relay";
var _useMessageCountUpdateSubscription;
var MessageCountUpdateSubscription = _useMessageCountUpdateSubscription !== void 0 ? _useMessageCountUpdateSubscription : (_useMessageCountUpdateSubscription = (init_useMessageCountUpdateSubscription_graphql(), __toCommonJS(useMessageCountUpdateSubscription_graphql_exports)), _useMessageCountUpdateSubscription.hash && _useMessageCountUpdateSubscription.hash !== "57b09f90d1cdf7f57abc3956378d6b27" && console.error("The definition of 'useMessageCountUpdateSubscription' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _useMessageCountUpdateSubscription);
var useMessageCountUpdate = function useMessageCountUpdate2() {
  var _useCurrentProfile = useCurrentProfile(), profile = _useCurrentProfile.currentProfile;
  var config = useMemo(function() {
    return {
      subscription: MessageCountUpdateSubscription,
      onError: console.error,
      variables: {
        profileId: profile === null || profile === void 0 ? void 0 : profile.id
      }
    };
  }, [profile === null || profile === void 0 ? void 0 : profile.id]);
  return useSubscription(config);
};

export {
  useMessageCountUpdate
};
//# sourceMappingURL=chunk-HND2TGKE.mjs.map