// https://nuxt.com/docs/api/configuration/nuxt-config
import vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
export default defineNuxtConfig({
  ssr: false,
  devtools: { enabled: true },
  build: {
    transpile: ["vuetify"],
  },

  runtimeConfig: {
    public: {
      cookieConfig: {
        domain: (process.env.DOMAIN as string) ?? "localhost",
        secure: true,
        maxAge: 30 * 24 * 60 * 60,
      },
      APP: (process.env.APP as string) ?? "App",
      API_DO_STORAGE_ENDPOINT:
        (process.env.API_DO_STORAGE_ENDPOINT as string) ?? "",
      API_DO_STORAGE_ENDPOINT_ANPR:
        (process.env.API_DO_STORAGE_ENDPOINT_ANPR as string) ?? "",
      APP_NAME: (process.env.APP_NAME as string) ?? "App",
      APP_NAME_ROUTE: (process.env.APP_NAME_ROUTE as string) ?? "index",
      APP_MAIN: (process.env.APP_MAIN as string) ?? "",
      APP_ACCOUNT: (process.env.APP_ACCOUNT as string) ?? "",
      APP_ADMIN: (process.env.APP_ADMIN as string) ?? "",
      APP_ORG: (process.env.APP_ORG as string) ?? "",
      APP_HYGIENE: (process.env.APP_HYGIENE as string) ?? "",
      APP_SECURITY: (process.env.APP_SECURITY as string) ?? "",
      APP_PROPERTY_MANAGEMENT:
        (process.env.APP_PROPERTY_MANAGEMENT as string) ?? "",
      APP_MECHANICAL_ELECTRICAL:
        (process.env.APP_MECHANICAL_ELECTRICAL as string) ?? "",
      APP_PEST_CONTROL: (process.env.APP_PEST_CONTROL as string) ?? "",
      APP_LANDSCAPING: (process.env.APP_LANDSCAPING as string) ?? "",
      APP_POOL_MAINTENANCE: (process.env.APP_POOL_MAINTENANCE as string) ?? "",
      ENTRYPASS_ACM_URL:
        (process.env.ENTRYPASS_ACM_URL as string) ??
        "https://entrypass-xsocket.iservice365.app/",
    },
  },

  modules: [
    (_options, nuxt) => {
      nuxt.hooks.hook("vite:extendConfig", (config) => {
        // @ts-expect-error
        config.plugins.push(vuetify({ autoImport: true }));
      });
    },
    "nuxt-signature-pad",
  ],

  vite: {
    vue: {
      template: {
        transformAssetUrls,
      },
    },
  },
});
