import { useQuery } from '@pinia/colada';
import { u as useApi } from './useApi-Dv-cyvzn.mjs';
import { d as useI18n } from './server.mjs';
import { computed } from 'vue';

function useCountriesQuery() {
  const { get } = useApi();
  const { locale } = useI18n();
  return useQuery({
    staleTime: 1e3 * 60 * 60,
    key: computed(() => ["countries", locale.value]),
    query: async () => {
      try {
        const response = await get("countries");
        return response.data.data;
      } catch (error) {
        console.error(error instanceof Error ? error.message : "Unknown error");
        return [];
      }
    }
  });
}
function useServicesQuery() {
  const { get } = useApi();
  const { locale } = useI18n();
  return useQuery({
    staleTime: 1e3 * 60 * 60,
    key: computed(() => ["services", locale.value]),
    query: async () => {
      try {
        const response = await get("services");
        return response.data.data;
      } catch (error) {
        console.error(error instanceof Error ? error.message : "Unknown error");
        return [];
      }
    }
  });
}
function useSocialIconsQuery() {
  const { get } = useApi();
  return useQuery({
    staleTime: 1e3 * 60 * 60,
    key: ["socialIcons"],
    query: async () => {
      var _a;
      try {
        const response = await get("general");
        const data = (_a = response.data.data) != null ? _a : {
          snapchat_link: null,
          facebook_link: null,
          instagram_link: null,
          tiktok_link: null,
          X_link: null,
          linkedIn_link: null,
          youtube_link: null
        };
        const socialIcons = [
          {
            name: "snapchat",
            link: data.snapchat_link
          },
          {
            name: "facebook",
            link: data.facebook_link
          },
          {
            name: "instagram",
            link: data.instagram_link
          },
          {
            name: "tiktok",
            link: data.tiktok_link
          },
          {
            name: "X",
            link: data.X_link
          },
          {
            name: "linkedIn",
            link: data.linkedIn_link
          },
          {
            name: "youtube",
            link: data.youtube_link
          }
        ].filter(
          (icon) => icon.link !== null && icon.link !== void 0 && icon.link !== ""
        );
        return socialIcons;
      } catch (error) {
        console.error(error instanceof Error ? error.message : "Unknown error");
        return [];
      }
    }
  });
}

export { useServicesQuery as a, useCountriesQuery as b, useSocialIconsQuery as u };
//# sourceMappingURL=contact-k0MTtZDV.mjs.map
