@fluenti/nuxt 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/detectors-BBAX-ZGA.cjs +1 -2
  2. package/dist/detectors-Ds481Wx6.js +0 -2
  3. package/dist/locale-head-Ezrd93Ax.js +0 -2
  4. package/dist/locale-head-jGmp0Xnb.cjs +1 -2
  5. package/dist/module.cjs +1 -2
  6. package/dist/module.js +0 -2
  7. package/dist/packages/nuxt/src/devtools.d.ts +0 -1
  8. package/dist/packages/nuxt/src/isr-validation.d.ts +0 -1
  9. package/dist/packages/nuxt/src/module.d.ts +0 -1
  10. package/dist/packages/nuxt/src/page-meta-transform.d.ts +0 -1
  11. package/dist/packages/nuxt/src/runtime/client.d.ts +0 -1
  12. package/dist/packages/nuxt/src/runtime/components/NuxtLinkLocale.d.ts +0 -1
  13. package/dist/packages/nuxt/src/runtime/composables.d.ts +0 -1
  14. package/dist/packages/nuxt/src/runtime/define-i18n-route.d.ts +0 -1
  15. package/dist/packages/nuxt/src/runtime/detectors/cookie.d.ts +0 -1
  16. package/dist/packages/nuxt/src/runtime/detectors/domain.d.ts +0 -1
  17. package/dist/packages/nuxt/src/runtime/detectors/header.d.ts +0 -1
  18. package/dist/packages/nuxt/src/runtime/detectors/index.d.ts +0 -1
  19. package/dist/packages/nuxt/src/runtime/detectors/path.d.ts +0 -1
  20. package/dist/packages/nuxt/src/runtime/detectors/query.d.ts +0 -1
  21. package/dist/packages/nuxt/src/runtime/index.d.ts +0 -1
  22. package/dist/packages/nuxt/src/runtime/locale-head.d.ts +0 -1
  23. package/dist/packages/nuxt/src/runtime/middleware/locale-redirect.d.ts +0 -1
  24. package/dist/packages/nuxt/src/runtime/page-extend.d.ts +0 -1
  25. package/dist/packages/nuxt/src/runtime/path-utils.d.ts +0 -1
  26. package/dist/packages/nuxt/src/runtime/plugin.d.ts +0 -1
  27. package/dist/packages/nuxt/src/runtime/server/locale-redirect.d.ts +0 -1
  28. package/dist/packages/nuxt/src/runtime/standalone-composables.d.ts +0 -1
  29. package/dist/packages/nuxt/src/runtime/utils/parse-accept-language.d.ts +0 -1
  30. package/dist/packages/nuxt/src/sitemap.d.ts +0 -1
  31. package/dist/packages/nuxt/src/types.d.ts +0 -1
  32. package/dist/page-extend-Bnxtcvnr.js +0 -2
  33. package/dist/page-extend-DqTELmU6.cjs +1 -2
  34. package/dist/parse-accept-language-BJacT1Mq.js +0 -2
  35. package/dist/parse-accept-language-ZKitIm3n.cjs +1 -2
  36. package/dist/path-utils-BQIsp_or.cjs +1 -2
  37. package/dist/path-utils-BcvXLCGi.js +0 -2
  38. package/dist/runtime/client.cjs +1 -2
  39. package/dist/runtime/client.js +0 -2
  40. package/dist/runtime/components/NuxtLinkLocale.cjs +1 -2
  41. package/dist/runtime/components/NuxtLinkLocale.js +0 -2
  42. package/dist/runtime/composables.cjs +1 -2
  43. package/dist/runtime/composables.js +0 -2
  44. package/dist/runtime/define-i18n-route.cjs +1 -2
  45. package/dist/runtime/define-i18n-route.js +0 -2
  46. package/dist/runtime/detectors/domain.cjs +1 -2
  47. package/dist/runtime/detectors/domain.js +0 -2
  48. package/dist/runtime/middleware/locale-redirect.cjs +1 -2
  49. package/dist/runtime/middleware/locale-redirect.js +0 -2
  50. package/dist/runtime/plugin.cjs +1 -2
  51. package/dist/runtime/plugin.js +0 -2
  52. package/dist/runtime/server/locale-redirect.cjs +1 -2
  53. package/dist/runtime/server/locale-redirect.js +0 -2
  54. package/dist/runtime/standalone-composables.cjs +1 -2
  55. package/dist/runtime/standalone-composables.js +0 -2
  56. package/package.json +3 -3
  57. package/dist/detectors-BBAX-ZGA.cjs.map +0 -1
  58. package/dist/detectors-Ds481Wx6.js.map +0 -1
  59. package/dist/locale-head-Ezrd93Ax.js.map +0 -1
  60. package/dist/locale-head-jGmp0Xnb.cjs.map +0 -1
  61. package/dist/module.cjs.map +0 -1
  62. package/dist/module.js.map +0 -1
  63. package/dist/packages/nuxt/src/devtools.d.ts.map +0 -1
  64. package/dist/packages/nuxt/src/isr-validation.d.ts.map +0 -1
  65. package/dist/packages/nuxt/src/module.d.ts.map +0 -1
  66. package/dist/packages/nuxt/src/page-meta-transform.d.ts.map +0 -1
  67. package/dist/packages/nuxt/src/runtime/client.d.ts.map +0 -1
  68. package/dist/packages/nuxt/src/runtime/components/NuxtLinkLocale.d.ts.map +0 -1
  69. package/dist/packages/nuxt/src/runtime/composables.d.ts.map +0 -1
  70. package/dist/packages/nuxt/src/runtime/define-i18n-route.d.ts.map +0 -1
  71. package/dist/packages/nuxt/src/runtime/detectors/cookie.d.ts.map +0 -1
  72. package/dist/packages/nuxt/src/runtime/detectors/domain.d.ts.map +0 -1
  73. package/dist/packages/nuxt/src/runtime/detectors/header.d.ts.map +0 -1
  74. package/dist/packages/nuxt/src/runtime/detectors/index.d.ts.map +0 -1
  75. package/dist/packages/nuxt/src/runtime/detectors/path.d.ts.map +0 -1
  76. package/dist/packages/nuxt/src/runtime/detectors/query.d.ts.map +0 -1
  77. package/dist/packages/nuxt/src/runtime/index.d.ts.map +0 -1
  78. package/dist/packages/nuxt/src/runtime/locale-head.d.ts.map +0 -1
  79. package/dist/packages/nuxt/src/runtime/middleware/locale-redirect.d.ts.map +0 -1
  80. package/dist/packages/nuxt/src/runtime/page-extend.d.ts.map +0 -1
  81. package/dist/packages/nuxt/src/runtime/path-utils.d.ts.map +0 -1
  82. package/dist/packages/nuxt/src/runtime/plugin.d.ts.map +0 -1
  83. package/dist/packages/nuxt/src/runtime/server/locale-redirect.d.ts.map +0 -1
  84. package/dist/packages/nuxt/src/runtime/standalone-composables.d.ts.map +0 -1
  85. package/dist/packages/nuxt/src/runtime/utils/parse-accept-language.d.ts.map +0 -1
  86. package/dist/packages/nuxt/src/sitemap.d.ts.map +0 -1
  87. package/dist/packages/nuxt/src/types.d.ts.map +0 -1
  88. package/dist/page-extend-Bnxtcvnr.js.map +0 -1
  89. package/dist/page-extend-DqTELmU6.cjs.map +0 -1
  90. package/dist/parse-accept-language-BJacT1Mq.js.map +0 -1
  91. package/dist/parse-accept-language-ZKitIm3n.cjs.map +0 -1
  92. package/dist/path-utils-BQIsp_or.cjs.map +0 -1
  93. package/dist/path-utils-BcvXLCGi.js.map +0 -1
  94. package/dist/runtime/client.cjs.map +0 -1
  95. package/dist/runtime/client.js.map +0 -1
  96. package/dist/runtime/components/NuxtLinkLocale.cjs.map +0 -1
  97. package/dist/runtime/components/NuxtLinkLocale.js.map +0 -1
  98. package/dist/runtime/composables.cjs.map +0 -1
  99. package/dist/runtime/composables.js.map +0 -1
  100. package/dist/runtime/define-i18n-route.cjs.map +0 -1
  101. package/dist/runtime/define-i18n-route.js.map +0 -1
  102. package/dist/runtime/detectors/domain.cjs.map +0 -1
  103. package/dist/runtime/detectors/domain.js.map +0 -1
  104. package/dist/runtime/middleware/locale-redirect.cjs.map +0 -1
  105. package/dist/runtime/middleware/locale-redirect.js.map +0 -1
  106. package/dist/runtime/plugin.cjs.map +0 -1
  107. package/dist/runtime/plugin.js.map +0 -1
  108. package/dist/runtime/server/locale-redirect.cjs.map +0 -1
  109. package/dist/runtime/server/locale-redirect.js.map +0 -1
  110. package/dist/runtime/standalone-composables.cjs.map +0 -1
  111. package/dist/runtime/standalone-composables.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.cjs","names":[],"sources":["../src/types.ts","../src/isr-validation.ts","../src/devtools.ts","../src/page-meta-transform.ts","../src/sitemap.ts","../src/module.ts"],"sourcesContent":["import type { FluentiBuildConfig } from '@fluenti/core/compiler'\nimport { resolveLocaleCodes } from '@fluenti/core/compiler'\n// Re-export core types for backwards compatibility\nexport type { LocaleObject, LocaleDefinition } from '@fluenti/core'\nexport { resolveLocaleCodes }\n\n// Import core types needed locally\nimport type { LocaleDefinition, LocaleObject } from '@fluenti/core'\n\n/** Routing strategy for locale-prefixed URLs */\nexport type Strategy = 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix' | 'domains'\n\n/** Browser language detection options */\nexport interface DetectBrowserLanguageOptions {\n /** Use a cookie to persist the detected locale */\n useCookie?: boolean\n /** Cookie key name (default: 'fluenti_locale') */\n cookieKey?: string\n /** Fallback locale when detection fails */\n fallbackLocale?: string\n}\n\n/** Built-in detector names */\nexport type BuiltinDetector = 'path' | 'cookie' | 'header' | 'query' | 'domain'\n\n/**\n * Context passed to locale detectors and the `fluenti:detect-locale` hook.\n *\n * Detectors inspect the context and call `setLocale()` to claim a locale.\n * Once a locale is set, subsequent detectors are skipped.\n */\nexport interface LocaleDetectContext {\n /** The request path (e.g. '/ja/about') */\n path: string\n /** Available locale codes */\n locales: string[]\n /** Default locale */\n defaultLocale: string\n /** Routing strategy */\n strategy: Strategy\n /** detectBrowserLanguage config */\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /** The detected locale so far (null if not yet detected) */\n detectedLocale: string | null\n /** Set the locale and stop the detection chain */\n setLocale: (locale: string) => void\n /** Whether we are running on the server */\n isServer: boolean\n /** The request hostname (available when `strategy: 'domains'`) */\n host?: string\n /** Pre-read cookie value (hoisted before await in plugin) */\n cookieValue?: string | null\n /** Pre-read Accept-Language header (hoisted before await in plugin) */\n acceptLanguage?: string\n}\n\n/**\n * A locale detector function.\n *\n * Can be sync or async. Call `ctx.setLocale(locale)` to claim a locale.\n */\nexport type LocaleDetectorFn = (ctx: LocaleDetectContext) => void | Promise<void>\n\n/**\n * Per-page locale configuration.\n *\n * Restricts which locales a page supports. Routes will only be generated\n * for the specified locales.\n *\n * @example\n * ```ts\n * // In a page component's <script setup>\n * defineI18nRoute({ locales: ['en', 'ja'] }) // only en and ja for this page\n * defineI18nRoute(false) // disable i18n for this page\n * ```\n */\nexport type I18nRouteConfig = { locales: string[] } | false\n\n/** Domain-to-locale mapping for the `'domains'` strategy */\nexport interface DomainConfig {\n /** Domain hostname (e.g. 'example.jp', 'ja.example.com') */\n domain: string\n /** Locale code for this domain */\n locale: string\n /** Whether this is the default domain (used for x-default hreflang) */\n defaultForLocale?: boolean\n}\n\n/** @fluenti/nuxt module options (set in nuxt.config.ts under `fluenti` key) */\nexport interface FluentNuxtOptions {\n /** fluenti.config.ts path or inline config */\n config?: string | FluentiBuildConfig\n\n // ---- Core overrides (take precedence over fluenti.config.ts) ----\n\n /** Override locales from fluenti.config.ts */\n locales?: FluentiBuildConfig['locales']\n /** Override defaultLocale from fluenti.config.ts */\n defaultLocale?: string\n /** Override sourceLocale from fluenti.config.ts */\n sourceLocale?: string\n /** Override catalogDir from fluenti.config.ts */\n catalogDir?: string\n\n // ---- Nuxt-specific: routing, detection, components ----\n\n /** URL routing strategy */\n strategy?: Strategy\n /** Browser language detection settings */\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /**\n * Ordered list of locale detectors.\n *\n * Each entry is either a built-in detector name ('path', 'cookie', 'header', 'query', 'domain')\n * or a file path to a custom detector module (e.g. '~/detectors/jwt-detector').\n *\n * Detectors run in order; the first one to call `ctx.setLocale()` wins.\n *\n * @default ['path', 'cookie', 'header']\n */\n detectOrder?: Array<BuiltinDetector | string>\n /**\n * Query parameter name for locale detection (e.g. `?lang=ja`).\n *\n * @default 'locale'\n */\n queryParamKey?: string\n /**\n * Prefix for globally registered i18n components (Trans, Plural, Select, DateTime, NumberFormat).\n *\n * Use this to avoid naming conflicts with other libraries.\n *\n * @example 'I18n' // → I18nTrans, I18nPlural, I18nSelect, I18nDateTime, I18nNumberFormat\n * @default '' (no prefix)\n */\n componentPrefix?: string\n /**\n * Automatically register `@fluenti/vite-plugin` in the Vite config.\n *\n * Set to `false` to disable if you configure the Vite plugin manually.\n *\n * @default true\n */\n autoVitePlugin?: boolean\n /**\n * Whether to auto-import composables (useLocalePath, useSwitchLocalePath, useLocaleHead, useI18n).\n *\n * Set to `false` to disable all auto-imports. Useful when migrating from `@nuxtjs/i18n`\n * or when you want explicit imports to avoid naming collisions.\n *\n * @default true\n */\n autoImports?: boolean\n /**\n * Whether to extend routes with locale-prefixed variants.\n *\n * Set to `false` to handle locale routing yourself (e.g., via a custom\n * `pages:extend` hook or Nuxt Layers). When `false`, the module will NOT\n * create locale-suffixed route clones and will NOT remove unprefixed routes.\n *\n * @default true\n */\n extendRoutes?: boolean\n /**\n * Route generation mode for locale variants.\n *\n * - `'all'` (default): All pages get locale route variants unless explicitly\n * opted out via `definePageMeta({ i18n: false })`.\n * - `'opt-in'`: Only pages that explicitly declare `definePageMeta({ i18n: { locales: [...] } })`\n * get locale route variants. Pages without an `i18n` meta field are left untouched.\n *\n * Use `'opt-in'` for large projects where only a subset of pages need i18n routing.\n *\n * @default 'all'\n */\n routeMode?: 'all' | 'opt-in'\n /**\n * Template for generating locale-specific route names.\n *\n * Receives the original route name and locale code, returns the desired name.\n * Only used when `extendRoutes` is not `false`.\n *\n * @default (name, locale) => `${name}___${locale}`\n * @example (name, locale) => `${locale}:${name}`\n */\n routeNameTemplate?: (name: string, locale: string) => string\n /**\n * Custom route paths per locale.\n *\n * Allows different URL slugs for different locales (e.g. `/about` in English\n * becomes `/について` in Japanese).\n *\n * Keys are the original route paths; values are locale-to-path mappings.\n *\n * @example\n * ```ts\n * routeOverrides: {\n * '/about': { ja: '/について', 'zh-CN': '/关于' },\n * '/contact': { ja: '/お問い合わせ' },\n * }\n * ```\n */\n routeOverrides?: Record<string, Record<string, string>>\n /**\n * Whether the locale redirect middleware should be registered globally.\n *\n * Set to `false` to register it as a named middleware instead, so you can\n * apply it only to specific pages via `definePageMeta({ middleware: ['fluenti-locale-redirect'] })`.\n *\n * Only relevant when `strategy` is `'prefix'`.\n *\n * @default true\n */\n globalMiddleware?: boolean\n /**\n * Whether to register the page meta transform plugin.\n *\n * When enabled (default), `defineI18nRoute()` and `definePageMeta({ i18n: ... })`\n * are automatically transformed. Set to `false` to disable the Vite transform.\n *\n * @default true\n */\n pageMetaTransform?: boolean\n /**\n * Whether to register the `NuxtLinkLocale` component globally.\n *\n * Set to `false` to disable registration. You can still import it manually\n * from `@fluenti/nuxt/runtime/components/NuxtLinkLocale`.\n *\n * @default true\n */\n registerNuxtLinkLocale?: boolean\n /**\n * Domain-to-locale mappings for the `'domains'` strategy.\n *\n * Each entry maps a domain hostname to a locale. Required when `strategy` is `'domains'`.\n *\n * Can also be specified inline in locale objects via `{ code: 'ja', domain: 'example.jp' }`.\n *\n * @example\n * ```ts\n * domains: [\n * { domain: 'example.com', locale: 'en', defaultForLocale: true },\n * { domain: 'example.jp', locale: 'ja' },\n * ]\n * ```\n */\n domains?: DomainConfig[]\n /**\n * Incremental Static Regeneration (ISR) settings.\n *\n * When enabled, the module automatically generates `routeRules` with\n * ISR caching for all locale route patterns.\n */\n isr?: ISROptions\n /** Enable @fluenti/vue-i18n-compat bridge mode */\n compat?: boolean\n /**\n * Whether to inject `$localePath` onto `app.config.globalProperties`.\n *\n * Set to `false` if another plugin (e.g. `@nuxtjs/i18n`) already provides `$localePath`,\n * or when using composition API exclusively.\n *\n * @default true\n */\n injectGlobalProperties?: boolean\n /**\n * Callback fired when a translation key is missing from the catalog.\n *\n * Useful for logging, error tracking, or providing dynamic fallbacks.\n */\n onMissingTranslation?: (locale: string, id: string) => string | undefined\n /**\n * Structured error handler for i18n errors.\n */\n onError?: I18nErrorHandler\n /**\n * Generate fallback text when a translation is missing or errors.\n */\n getMessageFallback?: MessageFallbackHandler\n}\n\n/** Structured i18n error types */\nexport type I18nErrorCode = 'MISSING_MESSAGE' | 'MISSING_LOCALE' | 'FORMAT_ERROR' | 'LOAD_ERROR'\n\n/** Structured error passed to the onError callback */\nexport interface I18nError {\n /** Error classification */\n code: I18nErrorCode\n /** Human-readable error message */\n message: string\n /** The message key that caused the error */\n key?: string\n /** The locale that caused the error */\n locale?: string\n /** The original error (if wrapping a lower-level error) */\n cause?: unknown\n}\n\n/** Callback for structured i18n error handling */\nexport type I18nErrorHandler = (error: I18nError) => void\n\n/**\n * Callback to generate fallback text when a translation is missing or errors.\n *\n * Return a string to use as the fallback, or `undefined` for default behavior\n * (which shows the message key).\n */\nexport type MessageFallbackHandler = (error: I18nError) => string | undefined\n\n/** ISR configuration */\nexport interface ISROptions {\n /** Enable ISR route rules generation */\n enabled: boolean\n /** Cache TTL in seconds (default: 3600 — 1 hour) */\n ttl?: number\n}\n\n/** Runtime config injected into Nuxt's public runtimeConfig */\nexport interface FluentNuxtRuntimeConfig {\n locales: string[]\n defaultLocale: string\n strategy: Strategy\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /** Ordered list of detector names/paths */\n detectOrder: Array<string>\n /** Query parameter name for locale detection */\n queryParamKey: string\n /** Whether to inject $localePath onto globalProperties */\n injectGlobalProperties: boolean\n /** Domain-to-locale mappings (when strategy is 'domains') */\n domains?: DomainConfig[]\n /** Locale metadata (iso tags, dir, names) — keyed by locale code */\n localeProperties?: Record<string, LocaleObject>\n}\n\n// ---- Utility helpers ----\n\n/** Build a locale properties map from LocaleDefinition[] */\nexport function resolveLocaleProperties(locales: LocaleDefinition[]): Record<string, LocaleObject> {\n const map: Record<string, LocaleObject> = {}\n for (const l of locales) {\n if (typeof l === 'string') {\n map[l] = { code: l }\n } else {\n map[l.code] = l\n }\n }\n return map\n}\n\n/** Build domain configs from locale objects that have a `domain` field */\nexport function resolveDomainConfigs(\n locales: LocaleDefinition[],\n explicit?: DomainConfig[],\n): DomainConfig[] {\n if (explicit?.length) return explicit\n const configs: DomainConfig[] = []\n for (const l of locales) {\n if (typeof l !== 'string' && l.domain) {\n configs.push({ domain: l.domain, locale: l.code })\n }\n }\n return configs\n}\n","import type { FluentNuxtOptions, Strategy } from './types'\n\nexport interface ISRWarning {\n level: 'warn' | 'error'\n message: string\n}\n\n/**\n * Validate ISR configuration against locale detection settings.\n *\n * ISR caches responses by URL path. If locale detection relies on\n * non-path signals (cookies, headers), the cached response may serve\n * the wrong locale to subsequent visitors.\n */\nexport function validateISRConfig(\n isr: FluentNuxtOptions['isr'],\n strategy: Strategy,\n detectOrder: string[],\n): ISRWarning[] {\n const warnings: ISRWarning[] = []\n if (!isr?.enabled) return warnings\n\n const nonPathDetectors = detectOrder.filter(\n (d) => d === 'cookie' || d === 'header',\n )\n if (nonPathDetectors.length > 0) {\n warnings.push({\n level: 'warn',\n message:\n `[@fluenti/nuxt] ISR is enabled but detectOrder includes non-path ` +\n `detectors (${nonPathDetectors.join(', ')}). ISR caches by URL path, ` +\n `so cookie/header-based detection may serve the wrong locale from ` +\n `cache. Consider using detectOrder: ['path'] with ISR.`,\n })\n }\n\n if (strategy === 'no_prefix') {\n warnings.push({\n level: 'warn',\n message:\n `[@fluenti/nuxt] ISR is enabled with strategy: 'no_prefix'. All ` +\n `locales share the same URL path, so ISR will cache only one locale ` +\n `per URL. Use 'prefix' or 'prefix_except_default' strategy with ISR.`,\n })\n }\n\n return warnings\n}\n","import type { Nuxt } from '@nuxt/schema'\n\n/**\n * DevTools state exposed to the custom tab.\n * Serialized to JSON and sent to the DevTools panel.\n */\nexport interface DevToolsI18nState {\n currentLocale: string\n availableLocales: string[]\n defaultLocale: string\n strategy: string\n detectedBy: string\n messageCount: number\n loadedLocales: string[]\n missingKeys: string[]\n}\n\n/**\n * Register a Nuxt DevTools custom tab for Fluenti.\n *\n * Shows: current locale, available locales, detection chain result,\n * loaded message count, and missing translation keys.\n */\nexport function setupDevTools(nuxt: Nuxt, localeCodes: string[], defaultLocale: string, strategy: string): void {\n try {\n // Attempt to use @nuxt/devtools-kit if available\n // @ts-expect-error — devtools:customTabs hook is provided by @nuxt/devtools\n nuxt.hook('devtools:customTabs', (tabs: unknown[]) => {\n tabs.push({\n name: 'fluenti',\n title: 'Fluenti i18n',\n icon: 'i-carbon-translate',\n view: {\n type: 'client-component',\n componentName: 'FluentiDevToolsPanel',\n },\n })\n })\n } catch {\n // DevTools not available — silently skip\n }\n\n // Inject DevTools client component via virtual module\n // @ts-expect-error — nitro:config hook is provided by Nitro\n nuxt.hook('nitro:config', (nitroConfig: Record<string, unknown>) => {\n const publicConfig = nitroConfig['runtimeConfig'] as Record<string, unknown> | undefined\n if (publicConfig) {\n const pub = (publicConfig['public'] ?? (publicConfig['public'] = {})) as Record<string, unknown>\n const fluentiConfig = (pub['fluenti'] ?? {}) as Record<string, unknown>\n fluentiConfig['devtools'] = {\n enabled: true,\n locales: localeCodes,\n defaultLocale,\n strategy,\n }\n }\n })\n}\n\n/**\n * Client-side DevTools panel component source.\n *\n * This is injected as a virtual module and rendered inside the\n * Nuxt DevTools panel. It reads the Fluenti runtime state and\n * displays it in a simple, readable format.\n */\nexport const DEVTOOLS_PANEL_COMPONENT = `\n<template>\n <div style=\"padding: 16px; font-family: system-ui, sans-serif;\">\n <h2 style=\"margin: 0 0 16px; font-size: 18px;\">🌐 Fluenti i18n</h2>\n\n <div style=\"display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px;\">\n <span style=\"color: #888;\">Current locale:</span>\n <strong>{{ state.currentLocale }}</strong>\n\n <span style=\"color: #888;\">Default locale:</span>\n <span>{{ state.defaultLocale }}</span>\n\n <span style=\"color: #888;\">Strategy:</span>\n <span>{{ state.strategy }}</span>\n\n <span style=\"color: #888;\">Available:</span>\n <span>{{ state.availableLocales.join(', ') }}</span>\n\n <span style=\"color: #888;\">Loaded:</span>\n <span>{{ state.loadedLocales.join(', ') || 'none' }}</span>\n\n <span style=\"color: #888;\">Messages:</span>\n <span>{{ state.messageCount }}</span>\n\n <span style=\"color: #888;\">Missing keys:</span>\n <span :style=\"{ color: state.missingKeys.length > 0 ? '#e53e3e' : '#38a169' }\">\n {{ state.missingKeys.length > 0 ? state.missingKeys.length + ' missing' : 'All translated ✓' }}\n </span>\n </div>\n\n <div v-if=\"state.missingKeys.length > 0\" style=\"margin-top: 16px;\">\n <h3 style=\"margin: 0 0 8px; font-size: 14px; color: #e53e3e;\">Missing translations:</h3>\n <ul style=\"margin: 0; padding: 0 0 0 20px; font-size: 13px; font-family: monospace;\">\n <li v-for=\"key in state.missingKeys\" :key=\"key\" style=\"margin: 2px 0;\">{{ key }}</li>\n </ul>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted } from 'vue'\n\nconst state = ref({\n currentLocale: '',\n defaultLocale: '',\n strategy: '',\n availableLocales: [],\n loadedLocales: [],\n messageCount: 0,\n missingKeys: [],\n})\n\nonMounted(() => {\n try {\n const nuxtApp = window.__NUXT_DEVTOOLS_VIEW__?.nuxtApp ?? useNuxtApp()\n const config = nuxtApp.$config?.public?.fluenti ?? {}\n const fluentiLocale = nuxtApp.$fluentiLocale ?? ref('')\n\n state.value = {\n currentLocale: fluentiLocale.value || config.defaultLocale || '',\n defaultLocale: config.defaultLocale || '',\n strategy: config.strategy || '',\n availableLocales: config.locales || [],\n loadedLocales: [],\n messageCount: 0,\n missingKeys: [],\n }\n } catch (e) {\n // DevTools context not available\n }\n})\n</script>\n`\n","import type { Plugin } from 'vite'\n\n/**\n * Vite plugin that transforms `definePageMeta({ i18n: ... })` into\n * the internal `i18nRoute` format used by the page extension system.\n *\n * This allows users to use native Nuxt `definePageMeta` with an `i18n` key\n * instead of the separate `defineI18nRoute()` macro.\n *\n * Supports:\n * - `definePageMeta({ i18n: { locales: ['en', 'ja'] } })`\n * - `definePageMeta({ i18n: false })`\n *\n * The transform also rewrites `defineI18nRoute(...)` to\n * `definePageMeta({ i18nRoute: ... })` for backwards compatibility.\n */\nexport function createPageMetaTransform(): Plugin {\n return {\n name: 'fluenti:page-meta-transform',\n enforce: 'pre',\n\n transform(code, id) {\n // Only transform Vue SFC script blocks and TS/JS files in pages/\n if (!id.includes('/pages/') && !id.includes('\\\\pages\\\\')) return null\n if (!code.includes('defineI18nRoute') && !code.includes('i18n')) return null\n\n let transformed = code\n\n // Transform: defineI18nRoute({ locales: [...] })\n // → definePageMeta({ i18nRoute: { locales: [...] } })\n // Transform: defineI18nRoute(false)\n // → definePageMeta({ i18nRoute: false })\n if (transformed.includes('defineI18nRoute')) {\n transformed = transformed.replace(\n /defineI18nRoute\\s*\\(([^)]*?)\\)/g,\n (_match, arg: string) => `definePageMeta({ i18nRoute: ${arg.trim()} })`,\n )\n }\n\n // Support native: definePageMeta({ i18n: { locales: [...] } })\n // Rewrite `i18n:` key to `i18nRoute:` so page-extend can read it\n if (transformed.includes('definePageMeta') && transformed.includes('i18n:')) {\n // Simple regex for { i18n: ... } within definePageMeta\n // This handles the common case; complex nested objects may need\n // AST-based transformation in the future.\n transformed = transformed.replace(\n /(definePageMeta\\s*\\(\\s*\\{[^}]*?)\\bi18n\\s*:/g,\n '$1i18nRoute:',\n )\n }\n\n if (transformed === code) return null\n\n return {\n code: transformed,\n map: null,\n }\n },\n }\n}\n","import type { Strategy } from './types'\n\nexport interface SitemapUrl {\n loc: string\n alternatives?: Array<{ hreflang: string; href: string }>\n}\n\n/**\n * Generate multi-locale sitemap URLs from a list of base paths.\n *\n * For each base path, produces a URL entry with hreflang alternatives\n * pointing to every locale variant. Compatible with `@nuxtjs/sitemap`'s\n * `sources` hook format.\n */\nexport function generateSitemapUrls(\n paths: string[],\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n baseUrl?: string,\n): SitemapUrl[] {\n const urls: SitemapUrl[] = []\n const base = baseUrl ?? ''\n\n for (const rawPath of paths) {\n const path = rawPath.startsWith('/') ? rawPath : `/${rawPath}`\n\n for (const locale of locales) {\n const localizedPath = buildLocalePath(path, locale, defaultLocale, strategy)\n\n const alternatives = locales.map((altLocale) => ({\n hreflang: altLocale,\n href: `${base}${buildLocalePath(path, altLocale, defaultLocale, strategy)}`,\n }))\n\n // Add x-default pointing to default locale\n alternatives.push({\n hreflang: 'x-default',\n href: `${base}${buildLocalePath(path, defaultLocale, defaultLocale, strategy)}`,\n })\n\n urls.push({\n loc: `${base}${localizedPath}`,\n alternatives,\n })\n }\n }\n\n return urls\n}\n\nfunction buildLocalePath(\n path: string,\n locale: string,\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return path\n\n if (strategy === 'prefix_except_default' && locale === defaultLocale) {\n return path\n }\n\n const cleanPath = path === '/' ? '' : path\n return `/${locale}${cleanPath}`\n}\n\n/**\n * Hook handler for `@nuxtjs/sitemap`'s `sitemap:generate` hook.\n *\n * Transforms single-locale URLs into multi-locale entries with hreflang.\n * Register this in your nuxt.config.ts or let the module auto-register it.\n */\nexport function createSitemapHook(\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n baseUrl?: string,\n) {\n return (urls: SitemapUrl[]) => {\n if (strategy === 'no_prefix') return urls\n\n const expanded: SitemapUrl[] = []\n\n for (const url of urls) {\n const loc = url.loc.replace(/^https?:\\/\\/[^/]+/, '')\n\n for (const locale of locales) {\n const localizedPath = buildLocalePath(loc, locale, defaultLocale, strategy)\n const alternatives = locales.map((altLocale) => ({\n hreflang: altLocale,\n href: `${baseUrl ?? ''}${buildLocalePath(loc, altLocale, defaultLocale, strategy)}`,\n }))\n alternatives.push({\n hreflang: 'x-default',\n href: `${baseUrl ?? ''}${buildLocalePath(loc, defaultLocale, defaultLocale, strategy)}`,\n })\n\n expanded.push({\n loc: `${baseUrl ?? ''}${localizedPath}`,\n alternatives,\n })\n }\n }\n\n return expanded\n }\n}\n","import { defineNuxtModule, addPlugin, addImports, addComponent, addRouteMiddleware, addServerHandler, createResolver } from '@nuxt/kit'\nimport type { FluentNuxtOptions } from './types'\nimport { resolveLocaleProperties, resolveDomainConfigs } from './types'\nimport { resolveLocaleCodes } from '@fluenti/core/compiler'\nimport type { FluentiBuildConfig } from '@fluenti/core/compiler'\nimport { DEFAULT_FLUENTI_CONFIG, loadConfigSync } from '@fluenti/core/config'\nimport fluentiVue from '@fluenti/vue/vite-plugin'\nimport { extendPages } from './runtime/page-extend'\nimport { validateISRConfig } from './isr-validation'\nimport { setupDevTools } from './devtools'\nimport { createPageMetaTransform } from './page-meta-transform'\n\nexport type { FluentNuxtOptions, Strategy, FluentNuxtRuntimeConfig, DetectBrowserLanguageOptions, LocaleDetectContext, LocaleDetectorFn, BuiltinDetector, ISROptions, LocaleObject, LocaleDefinition, DomainConfig, I18nRouteConfig, I18nError, I18nErrorCode, I18nErrorHandler, MessageFallbackHandler } from './types'\nexport { generateSitemapUrls, createSitemapHook } from './sitemap'\nexport type { SitemapUrl } from './sitemap'\nexport { resolveLocaleProperties, resolveDomainConfigs } from './types'\nexport { resolveLocaleCodes } from '@fluenti/core/compiler'\nexport { localePath, extractLocaleFromPath, switchLocalePath } from './runtime/path-utils'\nexport { extendPages } from './runtime/page-extend'\nexport type { PageRoute, RouteNameTemplate, ExtendPagesOptions } from './runtime/page-extend'\nexport { buildLocaleHead } from './runtime/locale-head'\nexport type { LocaleHeadMeta, LocaleHeadOptions } from './runtime/locale-head'\nexport { useLocalePath, useSwitchLocalePath, useLocaleRoute, useLocaleHead } from './runtime/standalone-composables'\nexport { defineI18nRoute } from './runtime/define-i18n-route'\n\nexport const MODULE_NAME = '@fluenti/nuxt'\nexport const CONFIG_KEY = 'fluenti'\n\ntype PortableNuxtModule<TOptions> = {\n (this: void, resolvedOptions: TOptions, nuxt: any): any\n getOptions?: (inlineOptions?: Partial<TOptions>, nuxt?: any) => Promise<TOptions>\n getModuleDependencies?: (nuxt: any) => any\n getMeta?: () => Promise<any>\n onInstall?: (nuxt: any) => any\n onUpgrade?: (nuxt: any, options: TOptions, previousVersion: string) => any\n}\n\n/**\n * Resolve the FluentiBuildConfig from the module options.\n */\nfunction resolveFluentiBuildConfig(configOption: string | FluentiBuildConfig | undefined, rootDir: string): FluentiBuildConfig {\n\n if (typeof configOption === 'object') {\n return { ...DEFAULT_FLUENTI_CONFIG, ...configOption }\n }\n\n return loadConfigSync(\n typeof configOption === 'string' ? configOption : undefined,\n rootDir,\n )\n}\n\nconst fluentiNuxtModule: PortableNuxtModule<FluentNuxtOptions> = defineNuxtModule<FluentNuxtOptions>({\n meta: {\n name: MODULE_NAME,\n configKey: CONFIG_KEY,\n compatibility: { nuxt: '>=3.0.0' },\n },\n defaults: {\n strategy: 'prefix_except_default',\n },\n setup(options, nuxt) {\n const { resolve } = createResolver(import.meta.url)\n\n // --- Resolve FluentiBuildConfig from options.config, then overlay module-level options ---\n const rootDir = nuxt.options.rootDir ?? process.cwd()\n const fluentiConfig = resolveFluentiBuildConfig(options.config, rootDir)\n\n // Module-level options (e.g. nuxt.config.ts `fluenti.locales`) override the\n // resolved fluenti.config.ts values — this ensures Nuxt-specific config takes\n // precedence even when config file loading fails (e.g. CJS/jiti issues).\n if (options.locales) fluentiConfig.locales = options.locales\n if (options.defaultLocale) fluentiConfig.defaultLocale = options.defaultLocale\n if (options.sourceLocale) fluentiConfig.sourceLocale = options.sourceLocale\n if (options.catalogDir) fluentiConfig.catalogDir = options.catalogDir\n\n // --- Resolve locale codes and metadata ---\n const localeCodes = resolveLocaleCodes(fluentiConfig.locales)\n const localeProperties = resolveLocaleProperties(fluentiConfig.locales)\n const defaultLocale = fluentiConfig.defaultLocale ?? fluentiConfig.sourceLocale\n const domainConfigs = options.strategy === 'domains'\n ? resolveDomainConfigs(fluentiConfig.locales, options.domains)\n : undefined\n\n // --- Inject runtime config ---\n const detectOrder = options.detectOrder ?? (\n options.strategy === 'domains'\n ? ['domain', 'cookie', 'header']\n : ['path', 'cookie', 'header']\n )\n nuxt.options.runtimeConfig.public['fluenti'] = {\n locales: localeCodes,\n defaultLocale,\n strategy: options.strategy ?? 'prefix_except_default',\n detectBrowserLanguage: options.detectBrowserLanguage,\n detectOrder,\n queryParamKey: options.queryParamKey ?? 'locale',\n injectGlobalProperties: options.injectGlobalProperties !== false,\n ...(domainConfigs ? { domains: domainConfigs } : {}),\n localeProperties,\n }\n\n // --- Auto-register @fluenti/vue vite plugin (includes v-t transform + scope transform) ---\n if (options.autoVitePlugin !== false) {\n nuxt.options.vite = nuxt.options.vite || {}\n nuxt.options.vite.plugins = nuxt.options.vite.plugins || []\n ;(nuxt.options.vite.plugins as unknown[]).push(\n ...fluentiVue({ config: fluentiConfig }),\n )\n }\n\n // --- Register definePageMeta({ i18n }) transform ---\n if (options.pageMetaTransform !== false) {\n nuxt.options.vite = nuxt.options.vite || {}\n nuxt.options.vite.plugins = nuxt.options.vite.plugins || []\n ;(nuxt.options.vite.plugins as unknown[]).push(createPageMetaTransform())\n }\n\n // --- Register runtime plugin ---\n addPlugin({\n src: resolve('./runtime/plugin'),\n mode: 'all',\n })\n\n // --- Extend routes with locale prefixes ---\n const strategy = options.strategy ?? 'prefix_except_default'\n if (strategy !== 'no_prefix' && strategy !== 'domains' && options.extendRoutes !== false) {\n nuxt.hook('pages:extend', (pages) => {\n extendPages(pages, {\n locales: localeCodes,\n defaultLocale,\n strategy,\n ...(options.routeNameTemplate ? { routeNameTemplate: options.routeNameTemplate } : {}),\n ...(options.routeOverrides ? { routeOverrides: options.routeOverrides } : {}),\n ...(options.routeMode ? { routeMode: options.routeMode } : {}),\n })\n })\n }\n\n // --- Register locale redirect middleware ---\n if (strategy === 'prefix') {\n addRouteMiddleware({\n name: 'fluenti-locale-redirect',\n path: resolve('./runtime/middleware/locale-redirect'),\n global: options.globalMiddleware !== false,\n })\n }\n\n // --- Auto-import composables ---\n if (options.autoImports !== false) {\n addImports([\n { name: 'useLocalePath', from: resolve('./runtime/composables') },\n { name: 'useSwitchLocalePath', from: resolve('./runtime/composables') },\n { name: 'useLocaleRoute', from: resolve('./runtime/composables') },\n { name: 'useLocaleHead', from: resolve('./runtime/composables') },\n { name: 'useI18nScoped', from: resolve('./runtime/composables') },\n { name: 'useI18n', from: '@fluenti/vue' },\n { name: 'defineI18nRoute', from: resolve('./runtime/define-i18n-route') },\n ])\n }\n\n // --- Register components (including DateTime + NumberFormat) ---\n const prefix = options.componentPrefix ?? ''\n if (options.registerNuxtLinkLocale !== false) {\n addComponent({\n name: `${prefix}NuxtLinkLocale`,\n filePath: resolve('./runtime/components/NuxtLinkLocale'),\n })\n }\n\n // Auto-import DateTime and NumberFormat from @fluenti/vue\n addComponent({ name: `${prefix}Trans`, filePath: '@fluenti/vue/components', export: 'Trans' })\n addComponent({ name: `${prefix}Plural`, filePath: '@fluenti/vue/components', export: 'Plural' })\n addComponent({ name: `${prefix}Select`, filePath: '@fluenti/vue/components', export: 'Select' })\n addComponent({ name: `${prefix}DateTime`, filePath: '@fluenti/vue/components', export: 'DateTime' })\n addComponent({ name: `${prefix}NumberFormat`, filePath: '@fluenti/vue/components', export: 'NumberFormat' })\n\n // --- SSG / ISR: configure nitro prerender and route rules ---\n if (strategy !== 'no_prefix' && strategy !== 'domains') {\n const nuxtOpts = nuxt.options as unknown as Record<string, unknown>\n\n // Enable link crawling so locale-prefixed routes are discovered during prerender\n const nitroOpts = (nuxtOpts['nitro'] ?? (nuxtOpts['nitro'] = {})) as Record<string, unknown>\n const prerender = (nitroOpts['prerender'] ?? (nitroOpts['prerender'] = {})) as Record<string, unknown>\n prerender['crawlLinks'] = prerender['crawlLinks'] ?? true\n\n // For 'prefix' strategy, / has no matching route (all routes are\n // locale-prefixed). Replace the default / initial route with\n // /<defaultLocale> so the prerenderer starts from a valid route.\n if (strategy === 'prefix') {\n const routes = (prerender['routes'] ?? ['/']) as string[]\n prerender['routes'] = routes.map((r) =>\n r === '/' ? `/${defaultLocale}` : r,\n )\n }\n\n // ISR: validate configuration and generate routeRules\n for (const w of validateISRConfig(options.isr, strategy, detectOrder)) {\n console.warn(w.message)\n }\n if (options.isr?.enabled) {\n const routeRules = (nuxtOpts['routeRules'] ?? (nuxtOpts['routeRules'] = {})) as Record<string, Record<string, unknown>>\n const ttl = options.isr.ttl ?? 3600\n for (const locale of localeCodes) {\n if (locale === defaultLocale && strategy === 'prefix_except_default') {\n routeRules['/**'] = { ...routeRules['/**'], isr: ttl }\n } else {\n routeRules[`/${locale}/**`] = { ...routeRules[`/${locale}/**`], isr: ttl }\n }\n }\n }\n }\n\n // --- Nuxt DevTools integration ---\n if (nuxt.options.dev) {\n setupDevTools(nuxt as any, localeCodes, defaultLocale, strategy)\n }\n\n // --- Nitro server handler for locale redirect (T2-10) ---\n if (strategy === 'prefix' || strategy === 'prefix_and_default') {\n addServerHandler({\n handler: resolve('./runtime/server/locale-redirect'),\n middleware: true,\n })\n }\n },\n})\n\nexport default fluentiNuxtModule\n"],"mappings":"u6BAmVA,SA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QAAW,EAAE,CACzD,EAAa,AAA2B,EAAU,YAAe,EAAE,CACzE,EAAU,WAAgB,EAAU,YAAiB,GAKjD,IAAa,WAEf,EAAU,QADM,EAAU,QAAa,CAAC,IAAI,EACf,IAAK,GAChC,IAAM,IAAM,IAAI,IAAkB,EACnC,EAIH,IAAK,IAAM,KAAK,EAAkB,EAAQ,IAAK,EAAU,EAAY,CACnE,QAAQ,KAAK,EAAE,QAAQ,CAEzB,GAAI,EAAQ,KAAK,QAAS,CACxB,IAAM,EAAc,AAA2B,EAAS,aAAgB,EAAE,CACpE,EAAM,EAAQ,IAAI,KAAO,KAC/B,IAAK,IAAM,KAAU,EACf,IAAW,GAAiB,IAAa,wBAC3C,EAAW,OAAS,CAAE,GAAG,EAAW,OAAQ,IAAK,EAAK,CAEtD,EAAW,IAAI,EAAO,MAAQ,CAAE,GAAG,EAAW,IAAI,EAAO,MAAO,IAAK,EAAK,EAO9E,EAAK,QAAQ,KACf,EAAc,EAAa,EAAa,EAAe,EAAS,EAI9D,IAAa,UAAY,IAAa,wBACxC,EAAA,EAAA,kBAAiB,CACf,QAAS,EAAQ,mCAAmC,CACpD,WAAY,GACb,CAAC,EAGP,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.js","names":[],"sources":["../src/types.ts","../src/isr-validation.ts","../src/devtools.ts","../src/page-meta-transform.ts","../src/sitemap.ts","../src/module.ts"],"sourcesContent":["import type { FluentiBuildConfig } from '@fluenti/core/compiler'\nimport { resolveLocaleCodes } from '@fluenti/core/compiler'\n// Re-export core types for backwards compatibility\nexport type { LocaleObject, LocaleDefinition } from '@fluenti/core'\nexport { resolveLocaleCodes }\n\n// Import core types needed locally\nimport type { LocaleDefinition, LocaleObject } from '@fluenti/core'\n\n/** Routing strategy for locale-prefixed URLs */\nexport type Strategy = 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix' | 'domains'\n\n/** Browser language detection options */\nexport interface DetectBrowserLanguageOptions {\n /** Use a cookie to persist the detected locale */\n useCookie?: boolean\n /** Cookie key name (default: 'fluenti_locale') */\n cookieKey?: string\n /** Fallback locale when detection fails */\n fallbackLocale?: string\n}\n\n/** Built-in detector names */\nexport type BuiltinDetector = 'path' | 'cookie' | 'header' | 'query' | 'domain'\n\n/**\n * Context passed to locale detectors and the `fluenti:detect-locale` hook.\n *\n * Detectors inspect the context and call `setLocale()` to claim a locale.\n * Once a locale is set, subsequent detectors are skipped.\n */\nexport interface LocaleDetectContext {\n /** The request path (e.g. '/ja/about') */\n path: string\n /** Available locale codes */\n locales: string[]\n /** Default locale */\n defaultLocale: string\n /** Routing strategy */\n strategy: Strategy\n /** detectBrowserLanguage config */\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /** The detected locale so far (null if not yet detected) */\n detectedLocale: string | null\n /** Set the locale and stop the detection chain */\n setLocale: (locale: string) => void\n /** Whether we are running on the server */\n isServer: boolean\n /** The request hostname (available when `strategy: 'domains'`) */\n host?: string\n /** Pre-read cookie value (hoisted before await in plugin) */\n cookieValue?: string | null\n /** Pre-read Accept-Language header (hoisted before await in plugin) */\n acceptLanguage?: string\n}\n\n/**\n * A locale detector function.\n *\n * Can be sync or async. Call `ctx.setLocale(locale)` to claim a locale.\n */\nexport type LocaleDetectorFn = (ctx: LocaleDetectContext) => void | Promise<void>\n\n/**\n * Per-page locale configuration.\n *\n * Restricts which locales a page supports. Routes will only be generated\n * for the specified locales.\n *\n * @example\n * ```ts\n * // In a page component's <script setup>\n * defineI18nRoute({ locales: ['en', 'ja'] }) // only en and ja for this page\n * defineI18nRoute(false) // disable i18n for this page\n * ```\n */\nexport type I18nRouteConfig = { locales: string[] } | false\n\n/** Domain-to-locale mapping for the `'domains'` strategy */\nexport interface DomainConfig {\n /** Domain hostname (e.g. 'example.jp', 'ja.example.com') */\n domain: string\n /** Locale code for this domain */\n locale: string\n /** Whether this is the default domain (used for x-default hreflang) */\n defaultForLocale?: boolean\n}\n\n/** @fluenti/nuxt module options (set in nuxt.config.ts under `fluenti` key) */\nexport interface FluentNuxtOptions {\n /** fluenti.config.ts path or inline config */\n config?: string | FluentiBuildConfig\n\n // ---- Core overrides (take precedence over fluenti.config.ts) ----\n\n /** Override locales from fluenti.config.ts */\n locales?: FluentiBuildConfig['locales']\n /** Override defaultLocale from fluenti.config.ts */\n defaultLocale?: string\n /** Override sourceLocale from fluenti.config.ts */\n sourceLocale?: string\n /** Override catalogDir from fluenti.config.ts */\n catalogDir?: string\n\n // ---- Nuxt-specific: routing, detection, components ----\n\n /** URL routing strategy */\n strategy?: Strategy\n /** Browser language detection settings */\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /**\n * Ordered list of locale detectors.\n *\n * Each entry is either a built-in detector name ('path', 'cookie', 'header', 'query', 'domain')\n * or a file path to a custom detector module (e.g. '~/detectors/jwt-detector').\n *\n * Detectors run in order; the first one to call `ctx.setLocale()` wins.\n *\n * @default ['path', 'cookie', 'header']\n */\n detectOrder?: Array<BuiltinDetector | string>\n /**\n * Query parameter name for locale detection (e.g. `?lang=ja`).\n *\n * @default 'locale'\n */\n queryParamKey?: string\n /**\n * Prefix for globally registered i18n components (Trans, Plural, Select, DateTime, NumberFormat).\n *\n * Use this to avoid naming conflicts with other libraries.\n *\n * @example 'I18n' // → I18nTrans, I18nPlural, I18nSelect, I18nDateTime, I18nNumberFormat\n * @default '' (no prefix)\n */\n componentPrefix?: string\n /**\n * Automatically register `@fluenti/vite-plugin` in the Vite config.\n *\n * Set to `false` to disable if you configure the Vite plugin manually.\n *\n * @default true\n */\n autoVitePlugin?: boolean\n /**\n * Whether to auto-import composables (useLocalePath, useSwitchLocalePath, useLocaleHead, useI18n).\n *\n * Set to `false` to disable all auto-imports. Useful when migrating from `@nuxtjs/i18n`\n * or when you want explicit imports to avoid naming collisions.\n *\n * @default true\n */\n autoImports?: boolean\n /**\n * Whether to extend routes with locale-prefixed variants.\n *\n * Set to `false` to handle locale routing yourself (e.g., via a custom\n * `pages:extend` hook or Nuxt Layers). When `false`, the module will NOT\n * create locale-suffixed route clones and will NOT remove unprefixed routes.\n *\n * @default true\n */\n extendRoutes?: boolean\n /**\n * Route generation mode for locale variants.\n *\n * - `'all'` (default): All pages get locale route variants unless explicitly\n * opted out via `definePageMeta({ i18n: false })`.\n * - `'opt-in'`: Only pages that explicitly declare `definePageMeta({ i18n: { locales: [...] } })`\n * get locale route variants. Pages without an `i18n` meta field are left untouched.\n *\n * Use `'opt-in'` for large projects where only a subset of pages need i18n routing.\n *\n * @default 'all'\n */\n routeMode?: 'all' | 'opt-in'\n /**\n * Template for generating locale-specific route names.\n *\n * Receives the original route name and locale code, returns the desired name.\n * Only used when `extendRoutes` is not `false`.\n *\n * @default (name, locale) => `${name}___${locale}`\n * @example (name, locale) => `${locale}:${name}`\n */\n routeNameTemplate?: (name: string, locale: string) => string\n /**\n * Custom route paths per locale.\n *\n * Allows different URL slugs for different locales (e.g. `/about` in English\n * becomes `/について` in Japanese).\n *\n * Keys are the original route paths; values are locale-to-path mappings.\n *\n * @example\n * ```ts\n * routeOverrides: {\n * '/about': { ja: '/について', 'zh-CN': '/关于' },\n * '/contact': { ja: '/お問い合わせ' },\n * }\n * ```\n */\n routeOverrides?: Record<string, Record<string, string>>\n /**\n * Whether the locale redirect middleware should be registered globally.\n *\n * Set to `false` to register it as a named middleware instead, so you can\n * apply it only to specific pages via `definePageMeta({ middleware: ['fluenti-locale-redirect'] })`.\n *\n * Only relevant when `strategy` is `'prefix'`.\n *\n * @default true\n */\n globalMiddleware?: boolean\n /**\n * Whether to register the page meta transform plugin.\n *\n * When enabled (default), `defineI18nRoute()` and `definePageMeta({ i18n: ... })`\n * are automatically transformed. Set to `false` to disable the Vite transform.\n *\n * @default true\n */\n pageMetaTransform?: boolean\n /**\n * Whether to register the `NuxtLinkLocale` component globally.\n *\n * Set to `false` to disable registration. You can still import it manually\n * from `@fluenti/nuxt/runtime/components/NuxtLinkLocale`.\n *\n * @default true\n */\n registerNuxtLinkLocale?: boolean\n /**\n * Domain-to-locale mappings for the `'domains'` strategy.\n *\n * Each entry maps a domain hostname to a locale. Required when `strategy` is `'domains'`.\n *\n * Can also be specified inline in locale objects via `{ code: 'ja', domain: 'example.jp' }`.\n *\n * @example\n * ```ts\n * domains: [\n * { domain: 'example.com', locale: 'en', defaultForLocale: true },\n * { domain: 'example.jp', locale: 'ja' },\n * ]\n * ```\n */\n domains?: DomainConfig[]\n /**\n * Incremental Static Regeneration (ISR) settings.\n *\n * When enabled, the module automatically generates `routeRules` with\n * ISR caching for all locale route patterns.\n */\n isr?: ISROptions\n /** Enable @fluenti/vue-i18n-compat bridge mode */\n compat?: boolean\n /**\n * Whether to inject `$localePath` onto `app.config.globalProperties`.\n *\n * Set to `false` if another plugin (e.g. `@nuxtjs/i18n`) already provides `$localePath`,\n * or when using composition API exclusively.\n *\n * @default true\n */\n injectGlobalProperties?: boolean\n /**\n * Callback fired when a translation key is missing from the catalog.\n *\n * Useful for logging, error tracking, or providing dynamic fallbacks.\n */\n onMissingTranslation?: (locale: string, id: string) => string | undefined\n /**\n * Structured error handler for i18n errors.\n */\n onError?: I18nErrorHandler\n /**\n * Generate fallback text when a translation is missing or errors.\n */\n getMessageFallback?: MessageFallbackHandler\n}\n\n/** Structured i18n error types */\nexport type I18nErrorCode = 'MISSING_MESSAGE' | 'MISSING_LOCALE' | 'FORMAT_ERROR' | 'LOAD_ERROR'\n\n/** Structured error passed to the onError callback */\nexport interface I18nError {\n /** Error classification */\n code: I18nErrorCode\n /** Human-readable error message */\n message: string\n /** The message key that caused the error */\n key?: string\n /** The locale that caused the error */\n locale?: string\n /** The original error (if wrapping a lower-level error) */\n cause?: unknown\n}\n\n/** Callback for structured i18n error handling */\nexport type I18nErrorHandler = (error: I18nError) => void\n\n/**\n * Callback to generate fallback text when a translation is missing or errors.\n *\n * Return a string to use as the fallback, or `undefined` for default behavior\n * (which shows the message key).\n */\nexport type MessageFallbackHandler = (error: I18nError) => string | undefined\n\n/** ISR configuration */\nexport interface ISROptions {\n /** Enable ISR route rules generation */\n enabled: boolean\n /** Cache TTL in seconds (default: 3600 — 1 hour) */\n ttl?: number\n}\n\n/** Runtime config injected into Nuxt's public runtimeConfig */\nexport interface FluentNuxtRuntimeConfig {\n locales: string[]\n defaultLocale: string\n strategy: Strategy\n detectBrowserLanguage?: DetectBrowserLanguageOptions\n /** Ordered list of detector names/paths */\n detectOrder: Array<string>\n /** Query parameter name for locale detection */\n queryParamKey: string\n /** Whether to inject $localePath onto globalProperties */\n injectGlobalProperties: boolean\n /** Domain-to-locale mappings (when strategy is 'domains') */\n domains?: DomainConfig[]\n /** Locale metadata (iso tags, dir, names) — keyed by locale code */\n localeProperties?: Record<string, LocaleObject>\n}\n\n// ---- Utility helpers ----\n\n/** Build a locale properties map from LocaleDefinition[] */\nexport function resolveLocaleProperties(locales: LocaleDefinition[]): Record<string, LocaleObject> {\n const map: Record<string, LocaleObject> = {}\n for (const l of locales) {\n if (typeof l === 'string') {\n map[l] = { code: l }\n } else {\n map[l.code] = l\n }\n }\n return map\n}\n\n/** Build domain configs from locale objects that have a `domain` field */\nexport function resolveDomainConfigs(\n locales: LocaleDefinition[],\n explicit?: DomainConfig[],\n): DomainConfig[] {\n if (explicit?.length) return explicit\n const configs: DomainConfig[] = []\n for (const l of locales) {\n if (typeof l !== 'string' && l.domain) {\n configs.push({ domain: l.domain, locale: l.code })\n }\n }\n return configs\n}\n","import type { FluentNuxtOptions, Strategy } from './types'\n\nexport interface ISRWarning {\n level: 'warn' | 'error'\n message: string\n}\n\n/**\n * Validate ISR configuration against locale detection settings.\n *\n * ISR caches responses by URL path. If locale detection relies on\n * non-path signals (cookies, headers), the cached response may serve\n * the wrong locale to subsequent visitors.\n */\nexport function validateISRConfig(\n isr: FluentNuxtOptions['isr'],\n strategy: Strategy,\n detectOrder: string[],\n): ISRWarning[] {\n const warnings: ISRWarning[] = []\n if (!isr?.enabled) return warnings\n\n const nonPathDetectors = detectOrder.filter(\n (d) => d === 'cookie' || d === 'header',\n )\n if (nonPathDetectors.length > 0) {\n warnings.push({\n level: 'warn',\n message:\n `[@fluenti/nuxt] ISR is enabled but detectOrder includes non-path ` +\n `detectors (${nonPathDetectors.join(', ')}). ISR caches by URL path, ` +\n `so cookie/header-based detection may serve the wrong locale from ` +\n `cache. Consider using detectOrder: ['path'] with ISR.`,\n })\n }\n\n if (strategy === 'no_prefix') {\n warnings.push({\n level: 'warn',\n message:\n `[@fluenti/nuxt] ISR is enabled with strategy: 'no_prefix'. All ` +\n `locales share the same URL path, so ISR will cache only one locale ` +\n `per URL. Use 'prefix' or 'prefix_except_default' strategy with ISR.`,\n })\n }\n\n return warnings\n}\n","import type { Nuxt } from '@nuxt/schema'\n\n/**\n * DevTools state exposed to the custom tab.\n * Serialized to JSON and sent to the DevTools panel.\n */\nexport interface DevToolsI18nState {\n currentLocale: string\n availableLocales: string[]\n defaultLocale: string\n strategy: string\n detectedBy: string\n messageCount: number\n loadedLocales: string[]\n missingKeys: string[]\n}\n\n/**\n * Register a Nuxt DevTools custom tab for Fluenti.\n *\n * Shows: current locale, available locales, detection chain result,\n * loaded message count, and missing translation keys.\n */\nexport function setupDevTools(nuxt: Nuxt, localeCodes: string[], defaultLocale: string, strategy: string): void {\n try {\n // Attempt to use @nuxt/devtools-kit if available\n // @ts-expect-error — devtools:customTabs hook is provided by @nuxt/devtools\n nuxt.hook('devtools:customTabs', (tabs: unknown[]) => {\n tabs.push({\n name: 'fluenti',\n title: 'Fluenti i18n',\n icon: 'i-carbon-translate',\n view: {\n type: 'client-component',\n componentName: 'FluentiDevToolsPanel',\n },\n })\n })\n } catch {\n // DevTools not available — silently skip\n }\n\n // Inject DevTools client component via virtual module\n // @ts-expect-error — nitro:config hook is provided by Nitro\n nuxt.hook('nitro:config', (nitroConfig: Record<string, unknown>) => {\n const publicConfig = nitroConfig['runtimeConfig'] as Record<string, unknown> | undefined\n if (publicConfig) {\n const pub = (publicConfig['public'] ?? (publicConfig['public'] = {})) as Record<string, unknown>\n const fluentiConfig = (pub['fluenti'] ?? {}) as Record<string, unknown>\n fluentiConfig['devtools'] = {\n enabled: true,\n locales: localeCodes,\n defaultLocale,\n strategy,\n }\n }\n })\n}\n\n/**\n * Client-side DevTools panel component source.\n *\n * This is injected as a virtual module and rendered inside the\n * Nuxt DevTools panel. It reads the Fluenti runtime state and\n * displays it in a simple, readable format.\n */\nexport const DEVTOOLS_PANEL_COMPONENT = `\n<template>\n <div style=\"padding: 16px; font-family: system-ui, sans-serif;\">\n <h2 style=\"margin: 0 0 16px; font-size: 18px;\">🌐 Fluenti i18n</h2>\n\n <div style=\"display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px;\">\n <span style=\"color: #888;\">Current locale:</span>\n <strong>{{ state.currentLocale }}</strong>\n\n <span style=\"color: #888;\">Default locale:</span>\n <span>{{ state.defaultLocale }}</span>\n\n <span style=\"color: #888;\">Strategy:</span>\n <span>{{ state.strategy }}</span>\n\n <span style=\"color: #888;\">Available:</span>\n <span>{{ state.availableLocales.join(', ') }}</span>\n\n <span style=\"color: #888;\">Loaded:</span>\n <span>{{ state.loadedLocales.join(', ') || 'none' }}</span>\n\n <span style=\"color: #888;\">Messages:</span>\n <span>{{ state.messageCount }}</span>\n\n <span style=\"color: #888;\">Missing keys:</span>\n <span :style=\"{ color: state.missingKeys.length > 0 ? '#e53e3e' : '#38a169' }\">\n {{ state.missingKeys.length > 0 ? state.missingKeys.length + ' missing' : 'All translated ✓' }}\n </span>\n </div>\n\n <div v-if=\"state.missingKeys.length > 0\" style=\"margin-top: 16px;\">\n <h3 style=\"margin: 0 0 8px; font-size: 14px; color: #e53e3e;\">Missing translations:</h3>\n <ul style=\"margin: 0; padding: 0 0 0 20px; font-size: 13px; font-family: monospace;\">\n <li v-for=\"key in state.missingKeys\" :key=\"key\" style=\"margin: 2px 0;\">{{ key }}</li>\n </ul>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted } from 'vue'\n\nconst state = ref({\n currentLocale: '',\n defaultLocale: '',\n strategy: '',\n availableLocales: [],\n loadedLocales: [],\n messageCount: 0,\n missingKeys: [],\n})\n\nonMounted(() => {\n try {\n const nuxtApp = window.__NUXT_DEVTOOLS_VIEW__?.nuxtApp ?? useNuxtApp()\n const config = nuxtApp.$config?.public?.fluenti ?? {}\n const fluentiLocale = nuxtApp.$fluentiLocale ?? ref('')\n\n state.value = {\n currentLocale: fluentiLocale.value || config.defaultLocale || '',\n defaultLocale: config.defaultLocale || '',\n strategy: config.strategy || '',\n availableLocales: config.locales || [],\n loadedLocales: [],\n messageCount: 0,\n missingKeys: [],\n }\n } catch (e) {\n // DevTools context not available\n }\n})\n</script>\n`\n","import type { Plugin } from 'vite'\n\n/**\n * Vite plugin that transforms `definePageMeta({ i18n: ... })` into\n * the internal `i18nRoute` format used by the page extension system.\n *\n * This allows users to use native Nuxt `definePageMeta` with an `i18n` key\n * instead of the separate `defineI18nRoute()` macro.\n *\n * Supports:\n * - `definePageMeta({ i18n: { locales: ['en', 'ja'] } })`\n * - `definePageMeta({ i18n: false })`\n *\n * The transform also rewrites `defineI18nRoute(...)` to\n * `definePageMeta({ i18nRoute: ... })` for backwards compatibility.\n */\nexport function createPageMetaTransform(): Plugin {\n return {\n name: 'fluenti:page-meta-transform',\n enforce: 'pre',\n\n transform(code, id) {\n // Only transform Vue SFC script blocks and TS/JS files in pages/\n if (!id.includes('/pages/') && !id.includes('\\\\pages\\\\')) return null\n if (!code.includes('defineI18nRoute') && !code.includes('i18n')) return null\n\n let transformed = code\n\n // Transform: defineI18nRoute({ locales: [...] })\n // → definePageMeta({ i18nRoute: { locales: [...] } })\n // Transform: defineI18nRoute(false)\n // → definePageMeta({ i18nRoute: false })\n if (transformed.includes('defineI18nRoute')) {\n transformed = transformed.replace(\n /defineI18nRoute\\s*\\(([^)]*?)\\)/g,\n (_match, arg: string) => `definePageMeta({ i18nRoute: ${arg.trim()} })`,\n )\n }\n\n // Support native: definePageMeta({ i18n: { locales: [...] } })\n // Rewrite `i18n:` key to `i18nRoute:` so page-extend can read it\n if (transformed.includes('definePageMeta') && transformed.includes('i18n:')) {\n // Simple regex for { i18n: ... } within definePageMeta\n // This handles the common case; complex nested objects may need\n // AST-based transformation in the future.\n transformed = transformed.replace(\n /(definePageMeta\\s*\\(\\s*\\{[^}]*?)\\bi18n\\s*:/g,\n '$1i18nRoute:',\n )\n }\n\n if (transformed === code) return null\n\n return {\n code: transformed,\n map: null,\n }\n },\n }\n}\n","import type { Strategy } from './types'\n\nexport interface SitemapUrl {\n loc: string\n alternatives?: Array<{ hreflang: string; href: string }>\n}\n\n/**\n * Generate multi-locale sitemap URLs from a list of base paths.\n *\n * For each base path, produces a URL entry with hreflang alternatives\n * pointing to every locale variant. Compatible with `@nuxtjs/sitemap`'s\n * `sources` hook format.\n */\nexport function generateSitemapUrls(\n paths: string[],\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n baseUrl?: string,\n): SitemapUrl[] {\n const urls: SitemapUrl[] = []\n const base = baseUrl ?? ''\n\n for (const rawPath of paths) {\n const path = rawPath.startsWith('/') ? rawPath : `/${rawPath}`\n\n for (const locale of locales) {\n const localizedPath = buildLocalePath(path, locale, defaultLocale, strategy)\n\n const alternatives = locales.map((altLocale) => ({\n hreflang: altLocale,\n href: `${base}${buildLocalePath(path, altLocale, defaultLocale, strategy)}`,\n }))\n\n // Add x-default pointing to default locale\n alternatives.push({\n hreflang: 'x-default',\n href: `${base}${buildLocalePath(path, defaultLocale, defaultLocale, strategy)}`,\n })\n\n urls.push({\n loc: `${base}${localizedPath}`,\n alternatives,\n })\n }\n }\n\n return urls\n}\n\nfunction buildLocalePath(\n path: string,\n locale: string,\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return path\n\n if (strategy === 'prefix_except_default' && locale === defaultLocale) {\n return path\n }\n\n const cleanPath = path === '/' ? '' : path\n return `/${locale}${cleanPath}`\n}\n\n/**\n * Hook handler for `@nuxtjs/sitemap`'s `sitemap:generate` hook.\n *\n * Transforms single-locale URLs into multi-locale entries with hreflang.\n * Register this in your nuxt.config.ts or let the module auto-register it.\n */\nexport function createSitemapHook(\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n baseUrl?: string,\n) {\n return (urls: SitemapUrl[]) => {\n if (strategy === 'no_prefix') return urls\n\n const expanded: SitemapUrl[] = []\n\n for (const url of urls) {\n const loc = url.loc.replace(/^https?:\\/\\/[^/]+/, '')\n\n for (const locale of locales) {\n const localizedPath = buildLocalePath(loc, locale, defaultLocale, strategy)\n const alternatives = locales.map((altLocale) => ({\n hreflang: altLocale,\n href: `${baseUrl ?? ''}${buildLocalePath(loc, altLocale, defaultLocale, strategy)}`,\n }))\n alternatives.push({\n hreflang: 'x-default',\n href: `${baseUrl ?? ''}${buildLocalePath(loc, defaultLocale, defaultLocale, strategy)}`,\n })\n\n expanded.push({\n loc: `${baseUrl ?? ''}${localizedPath}`,\n alternatives,\n })\n }\n }\n\n return expanded\n }\n}\n","import { defineNuxtModule, addPlugin, addImports, addComponent, addRouteMiddleware, addServerHandler, createResolver } from '@nuxt/kit'\nimport type { FluentNuxtOptions } from './types'\nimport { resolveLocaleProperties, resolveDomainConfigs } from './types'\nimport { resolveLocaleCodes } from '@fluenti/core/compiler'\nimport type { FluentiBuildConfig } from '@fluenti/core/compiler'\nimport { DEFAULT_FLUENTI_CONFIG, loadConfigSync } from '@fluenti/core/config'\nimport fluentiVue from '@fluenti/vue/vite-plugin'\nimport { extendPages } from './runtime/page-extend'\nimport { validateISRConfig } from './isr-validation'\nimport { setupDevTools } from './devtools'\nimport { createPageMetaTransform } from './page-meta-transform'\n\nexport type { FluentNuxtOptions, Strategy, FluentNuxtRuntimeConfig, DetectBrowserLanguageOptions, LocaleDetectContext, LocaleDetectorFn, BuiltinDetector, ISROptions, LocaleObject, LocaleDefinition, DomainConfig, I18nRouteConfig, I18nError, I18nErrorCode, I18nErrorHandler, MessageFallbackHandler } from './types'\nexport { generateSitemapUrls, createSitemapHook } from './sitemap'\nexport type { SitemapUrl } from './sitemap'\nexport { resolveLocaleProperties, resolveDomainConfigs } from './types'\nexport { resolveLocaleCodes } from '@fluenti/core/compiler'\nexport { localePath, extractLocaleFromPath, switchLocalePath } from './runtime/path-utils'\nexport { extendPages } from './runtime/page-extend'\nexport type { PageRoute, RouteNameTemplate, ExtendPagesOptions } from './runtime/page-extend'\nexport { buildLocaleHead } from './runtime/locale-head'\nexport type { LocaleHeadMeta, LocaleHeadOptions } from './runtime/locale-head'\nexport { useLocalePath, useSwitchLocalePath, useLocaleRoute, useLocaleHead } from './runtime/standalone-composables'\nexport { defineI18nRoute } from './runtime/define-i18n-route'\n\nexport const MODULE_NAME = '@fluenti/nuxt'\nexport const CONFIG_KEY = 'fluenti'\n\ntype PortableNuxtModule<TOptions> = {\n (this: void, resolvedOptions: TOptions, nuxt: any): any\n getOptions?: (inlineOptions?: Partial<TOptions>, nuxt?: any) => Promise<TOptions>\n getModuleDependencies?: (nuxt: any) => any\n getMeta?: () => Promise<any>\n onInstall?: (nuxt: any) => any\n onUpgrade?: (nuxt: any, options: TOptions, previousVersion: string) => any\n}\n\n/**\n * Resolve the FluentiBuildConfig from the module options.\n */\nfunction resolveFluentiBuildConfig(configOption: string | FluentiBuildConfig | undefined, rootDir: string): FluentiBuildConfig {\n\n if (typeof configOption === 'object') {\n return { ...DEFAULT_FLUENTI_CONFIG, ...configOption }\n }\n\n return loadConfigSync(\n typeof configOption === 'string' ? configOption : undefined,\n rootDir,\n )\n}\n\nconst fluentiNuxtModule: PortableNuxtModule<FluentNuxtOptions> = defineNuxtModule<FluentNuxtOptions>({\n meta: {\n name: MODULE_NAME,\n configKey: CONFIG_KEY,\n compatibility: { nuxt: '>=3.0.0' },\n },\n defaults: {\n strategy: 'prefix_except_default',\n },\n setup(options, nuxt) {\n const { resolve } = createResolver(import.meta.url)\n\n // --- Resolve FluentiBuildConfig from options.config, then overlay module-level options ---\n const rootDir = nuxt.options.rootDir ?? process.cwd()\n const fluentiConfig = resolveFluentiBuildConfig(options.config, rootDir)\n\n // Module-level options (e.g. nuxt.config.ts `fluenti.locales`) override the\n // resolved fluenti.config.ts values — this ensures Nuxt-specific config takes\n // precedence even when config file loading fails (e.g. CJS/jiti issues).\n if (options.locales) fluentiConfig.locales = options.locales\n if (options.defaultLocale) fluentiConfig.defaultLocale = options.defaultLocale\n if (options.sourceLocale) fluentiConfig.sourceLocale = options.sourceLocale\n if (options.catalogDir) fluentiConfig.catalogDir = options.catalogDir\n\n // --- Resolve locale codes and metadata ---\n const localeCodes = resolveLocaleCodes(fluentiConfig.locales)\n const localeProperties = resolveLocaleProperties(fluentiConfig.locales)\n const defaultLocale = fluentiConfig.defaultLocale ?? fluentiConfig.sourceLocale\n const domainConfigs = options.strategy === 'domains'\n ? resolveDomainConfigs(fluentiConfig.locales, options.domains)\n : undefined\n\n // --- Inject runtime config ---\n const detectOrder = options.detectOrder ?? (\n options.strategy === 'domains'\n ? ['domain', 'cookie', 'header']\n : ['path', 'cookie', 'header']\n )\n nuxt.options.runtimeConfig.public['fluenti'] = {\n locales: localeCodes,\n defaultLocale,\n strategy: options.strategy ?? 'prefix_except_default',\n detectBrowserLanguage: options.detectBrowserLanguage,\n detectOrder,\n queryParamKey: options.queryParamKey ?? 'locale',\n injectGlobalProperties: options.injectGlobalProperties !== false,\n ...(domainConfigs ? { domains: domainConfigs } : {}),\n localeProperties,\n }\n\n // --- Auto-register @fluenti/vue vite plugin (includes v-t transform + scope transform) ---\n if (options.autoVitePlugin !== false) {\n nuxt.options.vite = nuxt.options.vite || {}\n nuxt.options.vite.plugins = nuxt.options.vite.plugins || []\n ;(nuxt.options.vite.plugins as unknown[]).push(\n ...fluentiVue({ config: fluentiConfig }),\n )\n }\n\n // --- Register definePageMeta({ i18n }) transform ---\n if (options.pageMetaTransform !== false) {\n nuxt.options.vite = nuxt.options.vite || {}\n nuxt.options.vite.plugins = nuxt.options.vite.plugins || []\n ;(nuxt.options.vite.plugins as unknown[]).push(createPageMetaTransform())\n }\n\n // --- Register runtime plugin ---\n addPlugin({\n src: resolve('./runtime/plugin'),\n mode: 'all',\n })\n\n // --- Extend routes with locale prefixes ---\n const strategy = options.strategy ?? 'prefix_except_default'\n if (strategy !== 'no_prefix' && strategy !== 'domains' && options.extendRoutes !== false) {\n nuxt.hook('pages:extend', (pages) => {\n extendPages(pages, {\n locales: localeCodes,\n defaultLocale,\n strategy,\n ...(options.routeNameTemplate ? { routeNameTemplate: options.routeNameTemplate } : {}),\n ...(options.routeOverrides ? { routeOverrides: options.routeOverrides } : {}),\n ...(options.routeMode ? { routeMode: options.routeMode } : {}),\n })\n })\n }\n\n // --- Register locale redirect middleware ---\n if (strategy === 'prefix') {\n addRouteMiddleware({\n name: 'fluenti-locale-redirect',\n path: resolve('./runtime/middleware/locale-redirect'),\n global: options.globalMiddleware !== false,\n })\n }\n\n // --- Auto-import composables ---\n if (options.autoImports !== false) {\n addImports([\n { name: 'useLocalePath', from: resolve('./runtime/composables') },\n { name: 'useSwitchLocalePath', from: resolve('./runtime/composables') },\n { name: 'useLocaleRoute', from: resolve('./runtime/composables') },\n { name: 'useLocaleHead', from: resolve('./runtime/composables') },\n { name: 'useI18nScoped', from: resolve('./runtime/composables') },\n { name: 'useI18n', from: '@fluenti/vue' },\n { name: 'defineI18nRoute', from: resolve('./runtime/define-i18n-route') },\n ])\n }\n\n // --- Register components (including DateTime + NumberFormat) ---\n const prefix = options.componentPrefix ?? ''\n if (options.registerNuxtLinkLocale !== false) {\n addComponent({\n name: `${prefix}NuxtLinkLocale`,\n filePath: resolve('./runtime/components/NuxtLinkLocale'),\n })\n }\n\n // Auto-import DateTime and NumberFormat from @fluenti/vue\n addComponent({ name: `${prefix}Trans`, filePath: '@fluenti/vue/components', export: 'Trans' })\n addComponent({ name: `${prefix}Plural`, filePath: '@fluenti/vue/components', export: 'Plural' })\n addComponent({ name: `${prefix}Select`, filePath: '@fluenti/vue/components', export: 'Select' })\n addComponent({ name: `${prefix}DateTime`, filePath: '@fluenti/vue/components', export: 'DateTime' })\n addComponent({ name: `${prefix}NumberFormat`, filePath: '@fluenti/vue/components', export: 'NumberFormat' })\n\n // --- SSG / ISR: configure nitro prerender and route rules ---\n if (strategy !== 'no_prefix' && strategy !== 'domains') {\n const nuxtOpts = nuxt.options as unknown as Record<string, unknown>\n\n // Enable link crawling so locale-prefixed routes are discovered during prerender\n const nitroOpts = (nuxtOpts['nitro'] ?? (nuxtOpts['nitro'] = {})) as Record<string, unknown>\n const prerender = (nitroOpts['prerender'] ?? (nitroOpts['prerender'] = {})) as Record<string, unknown>\n prerender['crawlLinks'] = prerender['crawlLinks'] ?? true\n\n // For 'prefix' strategy, / has no matching route (all routes are\n // locale-prefixed). Replace the default / initial route with\n // /<defaultLocale> so the prerenderer starts from a valid route.\n if (strategy === 'prefix') {\n const routes = (prerender['routes'] ?? ['/']) as string[]\n prerender['routes'] = routes.map((r) =>\n r === '/' ? `/${defaultLocale}` : r,\n )\n }\n\n // ISR: validate configuration and generate routeRules\n for (const w of validateISRConfig(options.isr, strategy, detectOrder)) {\n console.warn(w.message)\n }\n if (options.isr?.enabled) {\n const routeRules = (nuxtOpts['routeRules'] ?? (nuxtOpts['routeRules'] = {})) as Record<string, Record<string, unknown>>\n const ttl = options.isr.ttl ?? 3600\n for (const locale of localeCodes) {\n if (locale === defaultLocale && strategy === 'prefix_except_default') {\n routeRules['/**'] = { ...routeRules['/**'], isr: ttl }\n } else {\n routeRules[`/${locale}/**`] = { ...routeRules[`/${locale}/**`], isr: ttl }\n }\n }\n }\n }\n\n // --- Nuxt DevTools integration ---\n if (nuxt.options.dev) {\n setupDevTools(nuxt as any, localeCodes, defaultLocale, strategy)\n }\n\n // --- Nitro server handler for locale redirect (T2-10) ---\n if (strategy === 'prefix' || strategy === 'prefix_and_default') {\n addServerHandler({\n handler: resolve('./runtime/server/locale-redirect'),\n middleware: true,\n })\n }\n },\n})\n\nexport default fluentiNuxtModule\n"],"mappings":";;;;;;;;;;AAmVA,SAAgB,EAAwB,GAA2D;CACjG,IAAM,IAAoC,EAAE;AAC5C,MAAK,IA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AA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isr-validation.d.ts","sourceRoot":"","sources":["../../../../src/isr-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE1D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAC7B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,UAAU,EAAE,CA6Bd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAWhD,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACxT,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,YAAY,EAAE,SAAS,EAAE,iBA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,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,WAAW,CAAC,cAAc,CAAC,CAI7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NuxtLinkLocale.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/components/NuxtLinkLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAIjE;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,cAAc;;cAIY,QAAQ,CAAC,MAAM,GAAG;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;;;;cAI9C,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;cAJlB,QAAQ,CAAC,MAAM,GAAG;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;;;;cAI9C,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;4EAkBhD,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,eAAe,cAAc,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/composables.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAIzE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAStE;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAYzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAahE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,CAAC,EAAE,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAmBjG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM;sBAMzB,OAAO,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;YAY5D,MAAM,WAAW,MAAM,GAAG,OAAO;YAGjC,MAAM,WAAW,MAAM;IAG/B,8CAA8C;;;;;;;;;;;;EAGjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,CAQtF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-i18n-route.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/define-i18n-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAS7D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/cookie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,sCAAsC;AACtC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAqBnE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAgBnE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/header.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,2DAA2D;AAC3D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAWnE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAOjG,8DAA8D;AAC9D,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAMtD,CAAA;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,uBAAuB,EAC/B,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC/C,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC3D,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,EAC3B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAC3B,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,iEAAiE;AACjE,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAMjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/detectors/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,2DAA2D;AAC3D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CAYlE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAGlF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAGtE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGhH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-head.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/locale-head.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAmBvD,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACzC,IAAI,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5D,IAAI,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kGAAkG;IAClG,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CA2HhB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-redirect.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/middleware/locale-redirect.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;;AACH,wBA6BE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-extend.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/page-extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,6DAA6D;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;AAKxE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACvD;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAAE,EAClB,OAAO,EAAE,kBAAkB,GAC1B,IAAI,CAkDN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,GAChB;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAgBtD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,GACjB,MAAM,CAQR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/plugin.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;;AACH,wBA4IE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-redirect.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/server/locale-redirect.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;;AACH,wBAwEE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"standalone-composables.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/standalone-composables.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAGtE;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,EACnB,MAAM,EAAE,uBAAuB,GAC9B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CASjD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,MAAM,EAAE,uBAAuB,GAC9B,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAU5B;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,uBAAuB,GAC9B,CAAC,EAAE,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAaxE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,EACnB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,WAAW,CAAC,cAAc,CAAC,CAI7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-accept-language.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/utils/parse-accept-language.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CA2BpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../../../src/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,MAAM,GACf,UAAU,EAAE,CA6Bd;AAkBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,MAAM,IAER,MAAM,UAAU,EAAE,kBA4B3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AA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AAEzD;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,GAAG,SAAS,CAAA;AAE7E,wBAAwB;AACxB,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,+DAA+D;AAC/D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,qBAAqB,CAAC,EAAE,4BAA4B,CAAA;IACpD,2CAA2C;IAC3C,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAA;IACrB,0DAA0D;IAC1D,sBAAsB,EAAE,OAAO,CAAA;IAC/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAChD;AAID,4DAA4D;AAC5D,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAUjG;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,QAAQ,CAAC,EAAE,YAAY,EAAE,GACxB,YAAY,EAAE,CAShB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-extend-Bnxtcvnr.js","names":[],"sources":["../src/runtime/page-extend.ts"],"sourcesContent":["import type { Strategy } from '../types'\n\n/** Page route definition used for route extension */\nexport interface PageRoute {\n path: string\n name?: string\n children?: PageRoute[]\n meta?: Record<string, unknown>\n}\n\n/** Route name template: (originalName, locale) => newName */\nexport type RouteNameTemplate = (name: string, locale: string) => string\n\nconst DEFAULT_ROUTE_NAME_TEMPLATE: RouteNameTemplate = (name, locale) =>\n `${name}___${locale}`\n\nexport interface ExtendPagesOptions {\n locales: string[]\n defaultLocale: string\n strategy: Strategy\n routeNameTemplate?: RouteNameTemplate\n /**\n * Custom route paths per locale.\n * Keys are original route paths; values map locale → custom path.\n */\n routeOverrides?: Record<string, Record<string, string>>\n /**\n * Route generation mode.\n * - `'all'` (default): All pages get locale variants unless opted out via `i18nRoute: false`.\n * - `'opt-in'`: Only pages with explicit `i18nRoute` meta get locale variants.\n */\n routeMode?: 'all' | 'opt-in'\n}\n\n/**\n * Extend page routes with locale-prefixed variants.\n * Mutates the pages array in place (Nuxt convention).\n *\n * This is a build-time utility used in the module's `pages:extend` hook.\n */\nexport function extendPages(\n pages: PageRoute[],\n options: ExtendPagesOptions,\n): void {\n const { locales, defaultLocale, strategy, routeOverrides } = options\n const routeMode = options.routeMode ?? 'all'\n if (strategy === 'no_prefix' || strategy === 'domains') return\n\n const nameTemplate = options.routeNameTemplate ?? DEFAULT_ROUTE_NAME_TEMPLATE\n const originalPages = [...pages]\n\n // Filter out pages that have i18nRoute === false in their meta\n const isPageEnabled = (page: PageRoute, locale: string): boolean => {\n const i18nRoute = page.meta?.['i18nRoute'] as { locales?: string[] } | false | undefined\n\n // opt-in mode: pages without any i18nRoute meta are not extended\n if (routeMode === 'opt-in' && i18nRoute === undefined) return false\n\n if (i18nRoute === false) return false\n if (i18nRoute && i18nRoute.locales) {\n return i18nRoute.locales.includes(locale)\n }\n return true\n }\n\n for (const locale of locales) {\n // For prefix_except_default, skip creating prefixed routes for the default locale\n if (strategy === 'prefix_except_default' && locale === defaultLocale) continue\n\n for (const page of originalPages) {\n if (!isPageEnabled(page, locale)) continue\n const prefixedPage = prefixPage(page, locale, nameTemplate, routeOverrides)\n pages.push(prefixedPage)\n }\n }\n\n // For prefix strategy, remove the original unprefixed routes\n // (every locale including default must have a prefix)\n if (strategy === 'prefix') {\n // Remove all original pages (they'll only exist as prefixed versions)\n pages.splice(0, originalPages.length)\n }\n\n // For prefix_except_default, filter out pages disabled for the default locale\n if (strategy === 'prefix_except_default') {\n for (let i = pages.length - 1; i >= 0; i--) {\n const page = pages[i]!\n // Only check original (unprefixed) pages\n if (originalPages.includes(page) && !isPageEnabled(page, defaultLocale)) {\n pages.splice(i, 1)\n }\n }\n }\n}\n\nfunction prefixPage(\n page: PageRoute,\n locale: string,\n nameTemplate: RouteNameTemplate,\n routeOverrides?: Record<string, Record<string, string>>,\n): PageRoute {\n // Check if there's a custom path for this locale\n const overridePath = routeOverrides?.[page.path]?.[locale]\n const basePath = overridePath ?? page.path\n\n const prefixed: PageRoute = {\n ...page,\n path: `/${locale}${basePath === '/' ? '' : basePath}`,\n }\n if (page.name) {\n prefixed.name = nameTemplate(page.name, locale)\n }\n\n if (page.children) {\n prefixed.children = page.children.map((child) => {\n const childOverride = routeOverrides?.[child.path]?.[locale]\n // Skip cloning if no changes needed\n if (!childOverride && !child.name) return child\n\n const prefixedChild: PageRoute = {\n ...child,\n ...(childOverride ? { path: childOverride } : {}),\n }\n if (child.name) {\n prefixedChild.name = nameTemplate(child.name, locale)\n }\n return prefixedChild\n })\n }\n\n return prefixed\n}\n"],"mappings":";AAaA,IAAM,KAAkD,GAAM,MAC5D,GAAG,EAAK,KAAK;AA0Bf,SAAgB,EACd,GACA,GACM;CACN,IAAM,EAAE,YAAS,kBAAe,aAAU,sBAAmB,GACvD,IAAY,EAAQ,aAAa;AACvC,KAAI,MAAa,eAAe,MAAa,UAAW;CAExD,IAAM,IAAe,EAAQ,qBAAqB,GAC5C,IAAgB,CAAC,GAAG,EAAM,EAG1B,KAAiB,GAAiB,MAA4B;EAClE,IAAM,IAAY,EAAK,MAAO;AAS9B,SANI,MAAc,YAAY,MAAc,KAAA,KAExC,MAAc,KAAc,KAC5B,KAAa,EAAU,UAClB,EAAU,QAAQ,SAAS,EAAO,GAEpC;;AAGT,MAAK,IAAM,KAAU,EAEf,aAAa,2BAA2B,MAAW,GAEvD,MAAK,IAAM,KAAQ,GAAe;AAChC,MAAI,CAAC,EAAc,GAAM,EAAO,CAAE;EAClC,IAAM,IAAe,EAAW,GAAM,GAAQ,GAAc,EAAe;AAC3E,IAAM,KAAK,EAAa;;AAY5B,KANI,MAAa,YAEf,EAAM,OAAO,GAAG,EAAc,OAAO,EAInC,MAAa,wBACf,MAAK,IAAI,IAAI,EAAM,SAAS,GAAG,KAAK,GAAG,KAAK;EAC1C,IAAM,IAAO,EAAM;AAEnB,EAAI,EAAc,SAAS,EAAK,IAAI,CAAC,EAAc,GAAM,EAAc,IACrE,EAAM,OAAO,GAAG,EAAE;;;AAM1B,SAAS,EACP,GACA,GACA,GACA,GACW;CAGX,IAAM,IADe,IAAiB,EAAK,QAAQ,MAClB,EAAK,MAEhC,IAAsB;EAC1B,GAAG;EACH,MAAM,IAAI,IAAS,MAAa,MAAM,KAAK;EAC5C;AAsBD,QArBI,EAAK,SACP,EAAS,OAAO,EAAa,EAAK,MAAM,EAAO,GAG7C,EAAK,aACP,EAAS,WAAW,EAAK,SAAS,KAAK,MAAU;EAC/C,IAAM,IAAgB,IAAiB,EAAM,QAAQ;AAErD,MAAI,CAAC,KAAiB,CAAC,EAAM,KAAM,QAAO;EAE1C,IAAM,IAA2B;GAC/B,GAAG;GACH,GAAI,IAAgB,EAAE,MAAM,GAAe,GAAG,EAAE;GACjD;AAID,SAHI,EAAM,SACR,EAAc,OAAO,EAAa,EAAM,MAAM,EAAO,GAEhD;GACP,GAGG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-extend-DqTELmU6.cjs","names":[],"sources":["../src/runtime/page-extend.ts"],"sourcesContent":["import type { Strategy } from '../types'\n\n/** Page route definition used for route extension */\nexport interface PageRoute {\n path: string\n name?: string\n children?: PageRoute[]\n meta?: Record<string, unknown>\n}\n\n/** Route name template: (originalName, locale) => newName */\nexport type RouteNameTemplate = (name: string, locale: string) => string\n\nconst DEFAULT_ROUTE_NAME_TEMPLATE: RouteNameTemplate = (name, locale) =>\n `${name}___${locale}`\n\nexport interface ExtendPagesOptions {\n locales: string[]\n defaultLocale: string\n strategy: Strategy\n routeNameTemplate?: RouteNameTemplate\n /**\n * Custom route paths per locale.\n * Keys are original route paths; values map locale → custom path.\n */\n routeOverrides?: Record<string, Record<string, string>>\n /**\n * Route generation mode.\n * - `'all'` (default): All pages get locale variants unless opted out via `i18nRoute: false`.\n * - `'opt-in'`: Only pages with explicit `i18nRoute` meta get locale variants.\n */\n routeMode?: 'all' | 'opt-in'\n}\n\n/**\n * Extend page routes with locale-prefixed variants.\n * Mutates the pages array in place (Nuxt convention).\n *\n * This is a build-time utility used in the module's `pages:extend` hook.\n */\nexport function extendPages(\n pages: PageRoute[],\n options: ExtendPagesOptions,\n): void {\n const { locales, defaultLocale, strategy, routeOverrides } = options\n const routeMode = options.routeMode ?? 'all'\n if (strategy === 'no_prefix' || strategy === 'domains') return\n\n const nameTemplate = options.routeNameTemplate ?? DEFAULT_ROUTE_NAME_TEMPLATE\n const originalPages = [...pages]\n\n // Filter out pages that have i18nRoute === false in their meta\n const isPageEnabled = (page: PageRoute, locale: string): boolean => {\n const i18nRoute = page.meta?.['i18nRoute'] as { locales?: string[] } | false | undefined\n\n // opt-in mode: pages without any i18nRoute meta are not extended\n if (routeMode === 'opt-in' && i18nRoute === undefined) return false\n\n if (i18nRoute === false) return false\n if (i18nRoute && i18nRoute.locales) {\n return i18nRoute.locales.includes(locale)\n }\n return true\n }\n\n for (const locale of locales) {\n // For prefix_except_default, skip creating prefixed routes for the default locale\n if (strategy === 'prefix_except_default' && locale === defaultLocale) continue\n\n for (const page of originalPages) {\n if (!isPageEnabled(page, locale)) continue\n const prefixedPage = prefixPage(page, locale, nameTemplate, routeOverrides)\n pages.push(prefixedPage)\n }\n }\n\n // For prefix strategy, remove the original unprefixed routes\n // (every locale including default must have a prefix)\n if (strategy === 'prefix') {\n // Remove all original pages (they'll only exist as prefixed versions)\n pages.splice(0, originalPages.length)\n }\n\n // For prefix_except_default, filter out pages disabled for the default locale\n if (strategy === 'prefix_except_default') {\n for (let i = pages.length - 1; i >= 0; i--) {\n const page = pages[i]!\n // Only check original (unprefixed) pages\n if (originalPages.includes(page) && !isPageEnabled(page, defaultLocale)) {\n pages.splice(i, 1)\n }\n }\n }\n}\n\nfunction prefixPage(\n page: PageRoute,\n locale: string,\n nameTemplate: RouteNameTemplate,\n routeOverrides?: Record<string, Record<string, string>>,\n): PageRoute {\n // Check if there's a custom path for this locale\n const overridePath = routeOverrides?.[page.path]?.[locale]\n const basePath = overridePath ?? page.path\n\n const prefixed: PageRoute = {\n ...page,\n path: `/${locale}${basePath === '/' ? '' : basePath}`,\n }\n if (page.name) {\n prefixed.name = nameTemplate(page.name, locale)\n }\n\n if (page.children) {\n prefixed.children = page.children.map((child) => {\n const childOverride = routeOverrides?.[child.path]?.[locale]\n // Skip cloning if no changes needed\n if (!childOverride && !child.name) return child\n\n const prefixedChild: PageRoute = {\n ...child,\n ...(childOverride ? { path: childOverride } : {}),\n }\n if (child.name) {\n prefixedChild.name = nameTemplate(child.name, locale)\n }\n return prefixedChild\n })\n }\n\n return prefixed\n}\n"],"mappings":"AAaA,IAAM,GAAkD,EAAM,IAC5D,GAAG,EAAK,KAAK,IA0Bf,SAAgB,EACd,EACA,EACM,CACN,GAAM,CAAE,UAAS,gBAAe,WAAU,kBAAmB,EACvD,EAAY,EAAQ,WAAa,MACvC,GAAI,IAAa,aAAe,IAAa,UAAW,OAExD,IAAM,EAAe,EAAQ,mBAAqB,EAC5C,EAAgB,CAAC,GAAG,EAAM,CAG1B,GAAiB,EAAiB,IAA4B,CAClE,IAAM,EAAY,EAAK,MAAO,UAS9B,OANI,IAAc,UAAY,IAAc,IAAA,IAExC,IAAc,GAAc,GAC5B,GAAa,EAAU,QAClB,EAAU,QAAQ,SAAS,EAAO,CAEpC,IAGT,IAAK,IAAM,KAAU,EAEf,SAAa,yBAA2B,IAAW,GAEvD,IAAK,IAAM,KAAQ,EAAe,CAChC,GAAI,CAAC,EAAc,EAAM,EAAO,CAAE,SAClC,IAAM,EAAe,EAAW,EAAM,EAAQ,EAAc,EAAe,CAC3E,EAAM,KAAK,EAAa,CAY5B,GANI,IAAa,UAEf,EAAM,OAAO,EAAG,EAAc,OAAO,CAInC,IAAa,wBACf,IAAK,IAAI,EAAI,EAAM,OAAS,EAAG,GAAK,EAAG,IAAK,CAC1C,IAAM,EAAO,EAAM,GAEf,EAAc,SAAS,EAAK,EAAI,CAAC,EAAc,EAAM,EAAc,EACrE,EAAM,OAAO,EAAG,EAAE,EAM1B,SAAS,EACP,EACA,EACA,EACA,EACW,CAGX,IAAM,EADe,IAAiB,EAAK,QAAQ,IAClB,EAAK,KAEhC,EAAsB,CAC1B,GAAG,EACH,KAAM,IAAI,IAAS,IAAa,IAAM,GAAK,IAC5C,CAsBD,OArBI,EAAK,OACP,EAAS,KAAO,EAAa,EAAK,KAAM,EAAO,EAG7C,EAAK,WACP,EAAS,SAAW,EAAK,SAAS,IAAK,GAAU,CAC/C,IAAM,EAAgB,IAAiB,EAAM,QAAQ,GAErD,GAAI,CAAC,GAAiB,CAAC,EAAM,KAAM,OAAO,EAE1C,IAAM,EAA2B,CAC/B,GAAG,EACH,GAAI,EAAgB,CAAE,KAAM,EAAe,CAAG,EAAE,CACjD,CAID,OAHI,EAAM,OACR,EAAc,KAAO,EAAa,EAAM,KAAM,EAAO,EAEhD,GACP,EAGG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-accept-language-BJacT1Mq.js","names":[],"sources":["../src/runtime/utils/parse-accept-language.ts"],"sourcesContent":["/**\n * Parse Accept-Language header and find the best matching locale.\n * Shared between server handler and client-side header detector.\n */\nexport function parseAcceptLanguage(header: string, locales: string[]): string | null {\n const entries = header\n .split(',')\n .map((part) => {\n const [lang = '', q = ''] = part.trim().split(';q=')\n const parsed = q ? parseFloat(q) : 1.0\n const quality = Number.isFinite(parsed) ? Math.min(1, Math.max(0, parsed)) : 0\n return { lang: lang!.trim().toLowerCase(), quality }\n })\n .filter((e) => e.quality > 0)\n .sort((a, b) => b.quality - a.quality)\n\n for (const { lang } of entries) {\n // Exact match (case-insensitive)\n const exact = locales.find((l) => l.toLowerCase() === lang)\n if (exact) return exact\n\n // Prefix match (e.g., 'en' matches 'en-US', or 'en-US' matches 'en')\n const prefix = lang.split('-')[0]!\n const match = locales.find((l) => {\n const ll = l.toLowerCase()\n return ll === prefix || ll.startsWith(prefix + '-')\n })\n if (match) return match\n }\n\n return null\n}\n"],"mappings":";AAIA,SAAgB,EAAoB,GAAgB,GAAkC;CACpF,IAAM,IAAU,EACb,MAAM,IAAI,CACV,KAAK,MAAS;EACb,IAAM,CAAC,IAAO,IAAI,IAAI,MAAM,EAAK,MAAM,CAAC,MAAM,MAAM,EAC9C,IAAS,IAAI,WAAW,EAAE,GAAG,GAC7B,IAAU,OAAO,SAAS,EAAO,GAAG,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,EAAO,CAAC,GAAG;AAC7E,SAAO;GAAE,MAAM,EAAM,MAAM,CAAC,aAAa;GAAE;GAAS;GACpD,CACD,QAAQ,MAAM,EAAE,UAAU,EAAE,CAC5B,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,QAAQ;AAExC,MAAK,IAAM,EAAE,aAAU,GAAS;EAE9B,IAAM,IAAQ,EAAQ,MAAM,MAAM,EAAE,aAAa,KAAK,EAAK;AAC3D,MAAI,EAAO,QAAO;EAGlB,IAAM,IAAS,EAAK,MAAM,IAAI,CAAC,IACzB,IAAQ,EAAQ,MAAM,MAAM;GAChC,IAAM,IAAK,EAAE,aAAa;AAC1B,UAAO,MAAO,KAAU,EAAG,WAAW,IAAS,IAAI;IACnD;AACF,MAAI,EAAO,QAAO;;AAGpB,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-accept-language-ZKitIm3n.cjs","names":[],"sources":["../src/runtime/utils/parse-accept-language.ts"],"sourcesContent":["/**\n * Parse Accept-Language header and find the best matching locale.\n * Shared between server handler and client-side header detector.\n */\nexport function parseAcceptLanguage(header: string, locales: string[]): string | null {\n const entries = header\n .split(',')\n .map((part) => {\n const [lang = '', q = ''] = part.trim().split(';q=')\n const parsed = q ? parseFloat(q) : 1.0\n const quality = Number.isFinite(parsed) ? Math.min(1, Math.max(0, parsed)) : 0\n return { lang: lang!.trim().toLowerCase(), quality }\n })\n .filter((e) => e.quality > 0)\n .sort((a, b) => b.quality - a.quality)\n\n for (const { lang } of entries) {\n // Exact match (case-insensitive)\n const exact = locales.find((l) => l.toLowerCase() === lang)\n if (exact) return exact\n\n // Prefix match (e.g., 'en' matches 'en-US', or 'en-US' matches 'en')\n const prefix = lang.split('-')[0]!\n const match = locales.find((l) => {\n const ll = l.toLowerCase()\n return ll === prefix || ll.startsWith(prefix + '-')\n })\n if (match) return match\n }\n\n return null\n}\n"],"mappings":"AAIA,SAAgB,EAAoB,EAAgB,EAAkC,CACpF,IAAM,EAAU,EACb,MAAM,IAAI,CACV,IAAK,GAAS,CACb,GAAM,CAAC,EAAO,GAAI,EAAI,IAAM,EAAK,MAAM,CAAC,MAAM,MAAM,CAC9C,EAAS,EAAI,WAAW,EAAE,CAAG,EAC7B,EAAU,OAAO,SAAS,EAAO,CAAG,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,EAAO,CAAC,CAAG,EAC7E,MAAO,CAAE,KAAM,EAAM,MAAM,CAAC,aAAa,CAAE,UAAS,EACpD,CACD,OAAQ,GAAM,EAAE,QAAU,EAAE,CAC5B,MAAM,EAAG,IAAM,EAAE,QAAU,EAAE,QAAQ,CAExC,IAAK,GAAM,CAAE,UAAU,EAAS,CAE9B,IAAM,EAAQ,EAAQ,KAAM,GAAM,EAAE,aAAa,GAAK,EAAK,CAC3D,GAAI,EAAO,OAAO,EAGlB,IAAM,EAAS,EAAK,MAAM,IAAI,CAAC,GACzB,EAAQ,EAAQ,KAAM,GAAM,CAChC,IAAM,EAAK,EAAE,aAAa,CAC1B,OAAO,IAAO,GAAU,EAAG,WAAW,EAAS,IAAI,EACnD,CACF,GAAI,EAAO,OAAO,EAGpB,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-utils-BQIsp_or.cjs","names":[],"sources":["../src/runtime/path-utils.ts"],"sourcesContent":["import type { Strategy } from '../types'\n\n/**\n * Add a locale prefix to a path based on the routing strategy.\n */\nexport function localePath(\n path: string,\n locale: string,\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return path\n\n // prefix_except_default: default locale gets no prefix\n if (strategy === 'prefix_except_default' && locale === defaultLocale) {\n return path.startsWith('/') ? path : `/${path}`\n }\n\n // prefix / prefix_and_default: always add prefix\n const cleanPath = path === '/' ? '' : (path.startsWith('/') ? path : `/${path}`)\n return `/${locale}${cleanPath}`\n}\n\n/**\n * Extract the locale code from the beginning of a path.\n * Returns the locale and the path without the locale prefix.\n */\nexport function extractLocaleFromPath(\n path: string,\n locales: string[],\n): { locale: string | null; pathWithoutLocale: string } {\n // Match /{locale} or /{locale}/...\n const match = path.match(/^\\/([^/]+)(.*)$/)\n if (!match) return { locale: null, pathWithoutLocale: path }\n\n const segment = match[1]!\n const rest = match[2] || '/'\n\n if (locales.includes(segment)) {\n return {\n locale: segment,\n pathWithoutLocale: rest || '/',\n }\n }\n\n return { locale: null, pathWithoutLocale: path }\n}\n\n/**\n * Generate a path for switching to a different locale,\n * preserving the current route path.\n */\nexport function switchLocalePath(\n currentPath: string,\n newLocale: string,\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return currentPath\n\n // Extract current locale prefix (if any)\n const { pathWithoutLocale } = extractLocaleFromPath(currentPath, locales)\n\n // Build new path with the target locale\n return localePath(pathWithoutLocale, newLocale, defaultLocale, strategy)\n}\n"],"mappings":"AAKA,SAAgB,EACd,EACA,EACA,EACA,EACQ,CAUR,OATI,IAAa,YAAoB,EAGjC,IAAa,yBAA2B,IAAW,EAC9C,EAAK,WAAW,IAAI,CAAG,EAAO,IAAI,IAKpC,IAAI,IADO,IAAS,IAAM,GAAM,EAAK,WAAW,IAAI,CAAG,EAAO,IAAI,MAQ3E,SAAgB,EACd,EACA,EACsD,CAEtD,IAAM,EAAQ,EAAK,MAAM,kBAAkB,CAC3C,GAAI,CAAC,EAAO,MAAO,CAAE,OAAQ,KAAM,kBAAmB,EAAM,CAE5D,IAAM,EAAU,EAAM,GAChB,EAAO,EAAM,IAAM,IASzB,OAPI,EAAQ,SAAS,EAAQ,CACpB,CACL,OAAQ,EACR,kBAAmB,GAAQ,IAC5B,CAGI,CAAE,OAAQ,KAAM,kBAAmB,EAAM,CAOlD,SAAgB,EACd,EACA,EACA,EACA,EACA,EACQ,CACR,GAAI,IAAa,YAAa,OAAO,EAGrC,GAAM,CAAE,qBAAsB,EAAsB,EAAa,EAAQ,CAGzE,OAAO,EAAW,EAAmB,EAAW,EAAe,EAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-utils-BcvXLCGi.js","names":[],"sources":["../src/runtime/path-utils.ts"],"sourcesContent":["import type { Strategy } from '../types'\n\n/**\n * Add a locale prefix to a path based on the routing strategy.\n */\nexport function localePath(\n path: string,\n locale: string,\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return path\n\n // prefix_except_default: default locale gets no prefix\n if (strategy === 'prefix_except_default' && locale === defaultLocale) {\n return path.startsWith('/') ? path : `/${path}`\n }\n\n // prefix / prefix_and_default: always add prefix\n const cleanPath = path === '/' ? '' : (path.startsWith('/') ? path : `/${path}`)\n return `/${locale}${cleanPath}`\n}\n\n/**\n * Extract the locale code from the beginning of a path.\n * Returns the locale and the path without the locale prefix.\n */\nexport function extractLocaleFromPath(\n path: string,\n locales: string[],\n): { locale: string | null; pathWithoutLocale: string } {\n // Match /{locale} or /{locale}/...\n const match = path.match(/^\\/([^/]+)(.*)$/)\n if (!match) return { locale: null, pathWithoutLocale: path }\n\n const segment = match[1]!\n const rest = match[2] || '/'\n\n if (locales.includes(segment)) {\n return {\n locale: segment,\n pathWithoutLocale: rest || '/',\n }\n }\n\n return { locale: null, pathWithoutLocale: path }\n}\n\n/**\n * Generate a path for switching to a different locale,\n * preserving the current route path.\n */\nexport function switchLocalePath(\n currentPath: string,\n newLocale: string,\n locales: string[],\n defaultLocale: string,\n strategy: Strategy,\n): string {\n if (strategy === 'no_prefix') return currentPath\n\n // Extract current locale prefix (if any)\n const { pathWithoutLocale } = extractLocaleFromPath(currentPath, locales)\n\n // Build new path with the target locale\n return localePath(pathWithoutLocale, newLocale, defaultLocale, strategy)\n}\n"],"mappings":";AAKA,SAAgB,EACd,GACA,GACA,GACA,GACQ;AAUR,QATI,MAAa,cAAoB,IAGjC,MAAa,2BAA2B,MAAW,IAC9C,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI,MAKpC,IAAI,IADO,MAAS,MAAM,KAAM,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;;AAQ3E,SAAgB,EACd,GACA,GACsD;CAEtD,IAAM,IAAQ,EAAK,MAAM,kBAAkB;AAC3C,KAAI,CAAC,EAAO,QAAO;EAAE,QAAQ;EAAM,mBAAmB;EAAM;CAE5D,IAAM,IAAU,EAAM,IAChB,IAAO,EAAM,MAAM;AASzB,QAPI,EAAQ,SAAS,EAAQ,GACpB;EACL,QAAQ;EACR,mBAAmB,KAAQ;EAC5B,GAGI;EAAE,QAAQ;EAAM,mBAAmB;EAAM;;AAOlD,SAAgB,EACd,GACA,GACA,GACA,GACA,GACQ;AACR,KAAI,MAAa,YAAa,QAAO;CAGrC,IAAM,EAAE,yBAAsB,EAAsB,GAAa,EAAQ;AAGzE,QAAO,EAAW,GAAmB,GAAW,GAAe,EAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.cjs","names":[],"sources":["../../src/runtime/client.ts"],"sourcesContent":["// Browser-safe exports — no Nuxt auto-imports (#imports) dependency.\n// Use this entry point in non-Nuxt environments (e.g. plain Vue SPA).\n\nimport { computed } from 'vue'\nimport type { ComputedRef, Ref } from 'vue'\nimport { localePath, switchLocalePath } from './path-utils'\nimport { buildLocaleHead } from './locale-head'\nimport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\nimport type { FluentNuxtRuntimeConfig } from '../types'\n\n// Path utilities (pure functions, framework-agnostic)\nexport { localePath, extractLocaleFromPath, switchLocalePath } from './path-utils'\n\n// Page route extension (build-time utility)\nexport { extendPages } from './page-extend'\nexport type { PageRoute } from './page-extend'\n\n// Locale head (pure function)\nexport { buildLocaleHead } from './locale-head'\nexport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\n\n// Re-export types\nexport type { FluentNuxtRuntimeConfig } from '../types'\n\n/**\n * Browser-safe composable for locale-prefixed paths.\n * Accepts explicit locale and config instead of using Nuxt auto-imports.\n */\nexport function useLocalePath(\n locale: Ref<string>,\n config: FluentNuxtRuntimeConfig,\n): (path: string, targetLocale?: string) => string {\n return (path: string, targetLocale?: string) => {\n return localePath(\n path,\n targetLocale ?? locale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Browser-safe composable for switching locale paths.\n * Accepts explicit currentPath and config instead of using Nuxt auto-imports.\n */\nexport function useSwitchLocalePath(\n currentPath: Ref<string> | ComputedRef<string>,\n config: FluentNuxtRuntimeConfig,\n): (locale: string) => string {\n return (newLocale: string) => {\n return switchLocalePath(\n currentPath.value,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Browser-safe composable for locale head metadata.\n * Accepts explicit locale, currentPath, and config instead of using Nuxt auto-imports.\n */\nexport function useLocaleHead(\n locale: Ref<string>,\n currentPath: Ref<string> | ComputedRef<string>,\n config: FluentNuxtRuntimeConfig,\n options?: LocaleHeadOptions,\n): ComputedRef<LocaleHeadMeta> {\n return computed(() => {\n return buildLocaleHead(locale.value, currentPath.value, config, options)\n })\n}\n"],"mappings":"iPA4BA,SAAgB,EACd,EACA,EACiD,CACjD,OAAQ,EAAc,IACb,EAAA,EACL,EACA,GAAgB,EAAO,MACvB,EAAO,cACP,EAAO,SACR,CAQL,SAAgB,EACd,EACA,EAC4B,CAC5B,MAAQ,IACC,EAAA,EACL,EAAY,MACZ,EACA,EAAO,QACP,EAAO,cACP,EAAO,SACR,CAQL,SAAgB,EACd,EACA,EACA,EACA,EAC6B,CAC7B,OAAA,EAAA,EAAA,cACS,EAAA,EAAgB,EAAO,MAAO,EAAY,MAAO,EAAQ,EAAQ,CACxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","names":[],"sources":["../../src/runtime/client.ts"],"sourcesContent":["// Browser-safe exports — no Nuxt auto-imports (#imports) dependency.\n// Use this entry point in non-Nuxt environments (e.g. plain Vue SPA).\n\nimport { computed } from 'vue'\nimport type { ComputedRef, Ref } from 'vue'\nimport { localePath, switchLocalePath } from './path-utils'\nimport { buildLocaleHead } from './locale-head'\nimport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\nimport type { FluentNuxtRuntimeConfig } from '../types'\n\n// Path utilities (pure functions, framework-agnostic)\nexport { localePath, extractLocaleFromPath, switchLocalePath } from './path-utils'\n\n// Page route extension (build-time utility)\nexport { extendPages } from './page-extend'\nexport type { PageRoute } from './page-extend'\n\n// Locale head (pure function)\nexport { buildLocaleHead } from './locale-head'\nexport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\n\n// Re-export types\nexport type { FluentNuxtRuntimeConfig } from '../types'\n\n/**\n * Browser-safe composable for locale-prefixed paths.\n * Accepts explicit locale and config instead of using Nuxt auto-imports.\n */\nexport function useLocalePath(\n locale: Ref<string>,\n config: FluentNuxtRuntimeConfig,\n): (path: string, targetLocale?: string) => string {\n return (path: string, targetLocale?: string) => {\n return localePath(\n path,\n targetLocale ?? locale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Browser-safe composable for switching locale paths.\n * Accepts explicit currentPath and config instead of using Nuxt auto-imports.\n */\nexport function useSwitchLocalePath(\n currentPath: Ref<string> | ComputedRef<string>,\n config: FluentNuxtRuntimeConfig,\n): (locale: string) => string {\n return (newLocale: string) => {\n return switchLocalePath(\n currentPath.value,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Browser-safe composable for locale head metadata.\n * Accepts explicit locale, currentPath, and config instead of using Nuxt auto-imports.\n */\nexport function useLocaleHead(\n locale: Ref<string>,\n currentPath: Ref<string> | ComputedRef<string>,\n config: FluentNuxtRuntimeConfig,\n options?: LocaleHeadOptions,\n): ComputedRef<LocaleHeadMeta> {\n return computed(() => {\n return buildLocaleHead(locale.value, currentPath.value, config, options)\n })\n}\n"],"mappings":";;;;;AA4BA,SAAgB,EACd,GACA,GACiD;AACjD,SAAQ,GAAc,MACb,EACL,GACA,KAAgB,EAAO,OACvB,EAAO,eACP,EAAO,SACR;;AAQL,SAAgB,EACd,GACA,GAC4B;AAC5B,SAAQ,MACC,EACL,EAAY,OACZ,GACA,EAAO,SACP,EAAO,eACP,EAAO,SACR;;AAQL,SAAgB,EACd,GACA,GACA,GACA,GAC6B;AAC7B,QAAO,QACE,EAAgB,EAAO,OAAO,EAAY,OAAO,GAAQ,EAAQ,CACxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NuxtLinkLocale.cjs","names":[],"sources":["../../../src/runtime/components/NuxtLinkLocale.ts"],"sourcesContent":["import { defineComponent, computed, h, type PropType } from 'vue'\nimport { NuxtLink } from '#components'\nimport { useLocalePath } from '../composables'\n\n/**\n * Locale-aware wrapper around NuxtLink.\n *\n * Automatically prefixes the `to` prop with the current locale\n * based on the routing strategy. Uses the real NuxtLink component\n * for client-side navigation and prefetching.\n *\n * @example\n * ```vue\n * <NuxtLinkLocale to=\"/about\">About</NuxtLinkLocale>\n * <NuxtLinkLocale to=\"/about\" locale=\"ja\">About (Japanese)</NuxtLinkLocale>\n * ```\n */\nconst NuxtLinkLocale = defineComponent({\n name: 'NuxtLinkLocale',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n locale: {\n type: String as PropType<string | undefined>,\n default: undefined,\n },\n },\n setup(props, { slots, attrs }) {\n const getLocalePath = useLocalePath()\n\n const localizedTo = computed(() => {\n const path = typeof props.to === 'string' ? props.to : props.to.path ?? '/'\n return getLocalePath(path, props.locale)\n })\n\n return () => h(\n NuxtLink,\n { ...attrs, to: localizedTo.value },\n slots,\n )\n },\n})\n\nexport { NuxtLinkLocale }\nexport default NuxtLinkLocale\n"],"mappings":"+MAiBA,IAAM,GAAA,EAAA,EAAA,iBAAiC,CACrC,KAAM,iBACN,MAAO,CACL,GAAI,CACF,KAAM,CAAC,OAAQ,OAAO,CACtB,SAAU,GACX,CACD,OAAQ,CACN,KAAM,OACN,QAAS,IAAA,GACV,CACF,CACD,MAAM,EAAO,CAAE,QAAO,SAAS,CAC7B,IAAM,EAAgB,EAAA,eAAe,CAE/B,GAAA,EAAA,EAAA,cAEG,EADM,OAAO,EAAM,IAAO,SAAW,EAAM,GAAK,EAAM,GAAG,MAAQ,IAC7C,EAAM,OAAO,CACxC,CAEF,WAAA,EAAA,EAAA,GACE,EAAA,SACA,CAAE,GAAG,EAAO,GAAI,EAAY,MAAO,CACnC,EACD,EAEJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NuxtLinkLocale.js","names":[],"sources":["../../../src/runtime/components/NuxtLinkLocale.ts"],"sourcesContent":["import { defineComponent, computed, h, type PropType } from 'vue'\nimport { NuxtLink } from '#components'\nimport { useLocalePath } from '../composables'\n\n/**\n * Locale-aware wrapper around NuxtLink.\n *\n * Automatically prefixes the `to` prop with the current locale\n * based on the routing strategy. Uses the real NuxtLink component\n * for client-side navigation and prefetching.\n *\n * @example\n * ```vue\n * <NuxtLinkLocale to=\"/about\">About</NuxtLinkLocale>\n * <NuxtLinkLocale to=\"/about\" locale=\"ja\">About (Japanese)</NuxtLinkLocale>\n * ```\n */\nconst NuxtLinkLocale = defineComponent({\n name: 'NuxtLinkLocale',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n locale: {\n type: String as PropType<string | undefined>,\n default: undefined,\n },\n },\n setup(props, { slots, attrs }) {\n const getLocalePath = useLocalePath()\n\n const localizedTo = computed(() => {\n const path = typeof props.to === 'string' ? props.to : props.to.path ?? '/'\n return getLocalePath(path, props.locale)\n })\n\n return () => h(\n NuxtLink,\n { ...attrs, to: localizedTo.value },\n slots,\n )\n },\n})\n\nexport { NuxtLinkLocale }\nexport default NuxtLinkLocale\n"],"mappings":";;;;AAiBA,IAAM,IAAiB,EAAgB;CACrC,MAAM;CACN,OAAO;EACL,IAAI;GACF,MAAM,CAAC,QAAQ,OAAO;GACtB,UAAU;GACX;EACD,QAAQ;GACN,MAAM;GACN,SAAS,KAAA;GACV;EACF;CACD,MAAM,GAAO,EAAE,UAAO,YAAS;EAC7B,IAAM,IAAgB,GAAe,EAE/B,IAAc,QAEX,EADM,OAAO,EAAM,MAAO,WAAW,EAAM,KAAK,EAAM,GAAG,QAAQ,KAC7C,EAAM,OAAO,CACxC;AAEF,eAAa,EACX,GACA;GAAE,GAAG;GAAO,IAAI,EAAY;GAAO,EACnC,EACD;;CAEJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables.cjs","names":[],"sources":["../../src/runtime/composables.ts"],"sourcesContent":["import { computed } from 'vue'\nimport type { ComputedRef } from 'vue'\nimport { useRoute, useRouter, useRuntimeConfig } from '#imports'\nimport type { RouteLocationRaw, RouteLocationResolved } from 'vue-router'\nimport { useI18n } from '@fluenti/vue'\nimport { localePath, switchLocalePath } from './path-utils'\nimport type { FluentNuxtRuntimeConfig } from '../types'\nimport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\nimport { buildLocaleHead } from './locale-head'\n\n/** Resolve fluenti runtime config from Nuxt's public runtimeConfig */\nfunction useFluentiConfig(): FluentNuxtRuntimeConfig {\n const runtimeConfig = useRuntimeConfig()\n return runtimeConfig.public['fluenti'] as FluentNuxtRuntimeConfig\n}\n\n/**\n * Composable that returns a function to generate locale-prefixed paths.\n *\n * Zero-argument — automatically reads the current locale from @fluenti/vue\n * and routing config from Nuxt runtimeConfig.\n *\n * @example\n * ```ts\n * const localePath = useLocalePath()\n * localePath('/about') // '/ja/about' (current locale is 'ja')\n * localePath('/about', 'en') // '/about' (prefix_except_default, en is default)\n * ```\n */\nexport function useLocalePath(): (path: string, locale?: string) => string {\n const { locale } = useI18n()\n const config = useFluentiConfig()\n\n return (path: string, targetLocale?: string) => {\n return localePath(\n path,\n targetLocale ?? locale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Composable that returns a function to get the current path in a different locale.\n *\n * @example\n * ```ts\n * const switchLocalePath = useSwitchLocalePath()\n * switchLocalePath('en') // '/about' (if on '/ja/about')\n * ```\n */\nexport function useSwitchLocalePath(): (locale: string) => string {\n const route = useRoute()\n const config = useFluentiConfig()\n\n return (newLocale: string) => {\n return switchLocalePath(\n route.path,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Composable that returns a function to resolve a locale-prefixed route object.\n *\n * Unlike `useLocalePath()` which returns a path string, this returns a full\n * resolved `RouteLocationResolved` that can be passed to `router.push()`.\n *\n * @example\n * ```ts\n * const localeRoute = useLocaleRoute()\n * const route = localeRoute('/about') // resolved route for '/ja/about'\n * const route = localeRoute('/about', 'en') // resolved route for '/about'\n * router.push(route)\n * ```\n */\nexport function useLocaleRoute(): (to: RouteLocationRaw, locale?: string) => RouteLocationResolved {\n const { locale } = useI18n()\n const router = useRouter()\n const config = useFluentiConfig()\n\n return (to: RouteLocationRaw, targetLocale?: string) => {\n const resolvedLocale = targetLocale ?? locale.value\n if (typeof to === 'string') {\n const path = localePath(to, resolvedLocale, config.defaultLocale, config.strategy)\n return router.resolve(path)\n }\n // For object routes, prefix the path if present\n if ('path' in to && to.path) {\n const path = localePath(to.path, resolvedLocale, config.defaultLocale, config.strategy)\n return router.resolve({ ...to, path })\n }\n // For named routes, resolve as-is\n return router.resolve(to)\n }\n}\n\n/**\n * Composable that returns a namespace-scoped i18n context.\n *\n * The `t()` function automatically prepends the namespace to message keys,\n * reducing boilerplate when a component only uses messages from one section.\n *\n * @example\n * ```ts\n * const { t } = useI18nScoped('Navbar')\n * t('home') // looks up 'Navbar.home'\n * t('about') // looks up 'Navbar.about'\n * ```\n */\nexport function useI18nScoped(namespace: string) {\n const ctx = useI18n()\n const separator = '.'\n\n return {\n ...ctx,\n t(idOrDescriptor: unknown, values?: Record<string, unknown>): string {\n if (typeof idOrDescriptor === 'string') {\n return ctx.t(`${namespace}${separator}${idOrDescriptor}`, values)\n }\n // MessageDescriptor — prefix the id\n if (idOrDescriptor && typeof idOrDescriptor === 'object' && 'id' in idOrDescriptor) {\n const desc = idOrDescriptor as { id: string }\n return ctx.t({ ...desc, id: `${namespace}${separator}${desc.id}` }, values)\n }\n // Tagged template — pass through (no namespacing for tagged templates)\n return (ctx.t as Function)(idOrDescriptor, values)\n },\n te(key: string, locale?: string): boolean {\n return ctx.te(`${namespace}${separator}${key}`, locale)\n },\n tm(key: string, locale?: string) {\n return ctx.tm(`${namespace}${separator}${key}`, locale)\n },\n /** The namespace this context is scoped to */\n namespace,\n }\n}\n\n/**\n * Composable that generates locale-aware HTML head metadata.\n *\n * @example\n * ```ts\n * const head = useLocaleHead({ addSeoAttributes: true, baseUrl: 'https://example.com' })\n * useHead(head.value) // Nuxt useHead\n * ```\n */\nexport function useLocaleHead(options?: LocaleHeadOptions): ComputedRef<LocaleHeadMeta> {\n const { locale } = useI18n()\n const route = useRoute()\n const config = useFluentiConfig()\n\n return computed(() => {\n return buildLocaleHead(locale.value, route.path, config, options)\n })\n}\n"],"mappings":"wPAWA,SAAS,GAA4C,CAEnD,OAAA,EAAA,EAAA,mBADwC,CACnB,OAAO,QAgB9B,SAAgB,GAA2D,CACzE,GAAM,CAAE,WAAA,EAAA,EAAA,UAAoB,CACtB,EAAS,GAAkB,CAEjC,OAAQ,EAAc,IACb,EAAA,EACL,EACA,GAAgB,EAAO,MACvB,EAAO,c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AYH,SAAgB,EAAc,EAA0D,CACtF,GAAM,CAAE,WAAA,EAAA,EAAA,UAAoB,CACtB,GAAA,EAAA,EAAA,WAAkB,CAClB,EAAS,GAAkB,CAEjC,OAAA,EAAA,EAAA,cACS,EAAA,EAAgB,EAAO,MAAO,EAAM,KAAM,EAAQ,EAAQ,CACjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables.js","names":[],"sources":["../../src/runtime/composables.ts"],"sourcesContent":["import { computed } from 'vue'\nimport type { ComputedRef } from 'vue'\nimport { useRoute, useRouter, useRuntimeConfig } from '#imports'\nimport type { RouteLocationRaw, RouteLocationResolved } from 'vue-router'\nimport { useI18n } from '@fluenti/vue'\nimport { localePath, switchLocalePath } from './path-utils'\nimport type { FluentNuxtRuntimeConfig } from '../types'\nimport type { LocaleHeadMeta, LocaleHeadOptions } from './locale-head'\nimport { buildLocaleHead } from './locale-head'\n\n/** Resolve fluenti runtime config from Nuxt's public runtimeConfig */\nfunction useFluentiConfig(): FluentNuxtRuntimeConfig {\n const runtimeConfig = useRuntimeConfig()\n return runtimeConfig.public['fluenti'] as FluentNuxtRuntimeConfig\n}\n\n/**\n * Composable that returns a function to generate locale-prefixed paths.\n *\n * Zero-argument — automatically reads the current locale from @fluenti/vue\n * and routing config from Nuxt runtimeConfig.\n *\n * @example\n * ```ts\n * const localePath = useLocalePath()\n * localePath('/about') // '/ja/about' (current locale is 'ja')\n * localePath('/about', 'en') // '/about' (prefix_except_default, en is default)\n * ```\n */\nexport function useLocalePath(): (path: string, locale?: string) => string {\n const { locale } = useI18n()\n const config = useFluentiConfig()\n\n return (path: string, targetLocale?: string) => {\n return localePath(\n path,\n targetLocale ?? locale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Composable that returns a function to get the current path in a different locale.\n *\n * @example\n * ```ts\n * const switchLocalePath = useSwitchLocalePath()\n * switchLocalePath('en') // '/about' (if on '/ja/about')\n * ```\n */\nexport function useSwitchLocalePath(): (locale: string) => string {\n const route = useRoute()\n const config = useFluentiConfig()\n\n return (newLocale: string) => {\n return switchLocalePath(\n route.path,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n}\n\n/**\n * Composable that returns a function to resolve a locale-prefixed route object.\n *\n * Unlike `useLocalePath()` which returns a path string, this returns a full\n * resolved `RouteLocationResolved` that can be passed to `router.push()`.\n *\n * @example\n * ```ts\n * const localeRoute = useLocaleRoute()\n * const route = localeRoute('/about') // resolved route for '/ja/about'\n * const route = localeRoute('/about', 'en') // resolved route for '/about'\n * router.push(route)\n * ```\n */\nexport function useLocaleRoute(): (to: RouteLocationRaw, locale?: string) => RouteLocationResolved {\n const { locale } = useI18n()\n const router = useRouter()\n const config = useFluentiConfig()\n\n return (to: RouteLocationRaw, targetLocale?: string) => {\n const resolvedLocale = targetLocale ?? locale.value\n if (typeof to === 'string') {\n const path = localePath(to, resolvedLocale, config.defaultLocale, config.strategy)\n return router.resolve(path)\n }\n // For object routes, prefix the path if present\n if ('path' in to && to.path) {\n const path = localePath(to.path, resolvedLocale, config.defaultLocale, config.strategy)\n return router.resolve({ ...to, path })\n }\n // For named routes, resolve as-is\n return router.resolve(to)\n }\n}\n\n/**\n * Composable that returns a namespace-scoped i18n context.\n *\n * The `t()` function automatically prepends the namespace to message keys,\n * reducing boilerplate when a component only uses messages from one section.\n *\n * @example\n * ```ts\n * const { t } = useI18nScoped('Navbar')\n * t('home') // looks up 'Navbar.home'\n * t('about') // looks up 'Navbar.about'\n * ```\n */\nexport function useI18nScoped(namespace: string) {\n const ctx = useI18n()\n const separator = '.'\n\n return {\n ...ctx,\n t(idOrDescriptor: unknown, values?: Record<string, unknown>): string {\n if (typeof idOrDescriptor === 'string') {\n return ctx.t(`${namespace}${separator}${idOrDescriptor}`, values)\n }\n // MessageDescriptor — prefix the id\n if (idOrDescriptor && typeof idOrDescriptor === 'object' && 'id' in idOrDescriptor) {\n const desc = idOrDescriptor as { id: string }\n return ctx.t({ ...desc, id: `${namespace}${separator}${desc.id}` }, values)\n }\n // Tagged template — pass through (no namespacing for tagged templates)\n return (ctx.t as Function)(idOrDescriptor, values)\n },\n te(key: string, locale?: string): boolean {\n return ctx.te(`${namespace}${separator}${key}`, locale)\n },\n tm(key: string, locale?: string) {\n return ctx.tm(`${namespace}${separator}${key}`, locale)\n },\n /** The namespace this context is scoped to */\n namespace,\n }\n}\n\n/**\n * Composable that generates locale-aware HTML head metadata.\n *\n * @example\n * ```ts\n * const head = useLocaleHead({ addSeoAttributes: true, baseUrl: 'https://example.com' })\n * useHead(head.value) // Nuxt useHead\n * ```\n */\nexport function useLocaleHead(options?: LocaleHeadOptions): ComputedRef<LocaleHeadMeta> {\n const { locale } = useI18n()\n const route = useRoute()\n const config = useFluentiConfig()\n\n return computed(() => {\n return buildLocaleHead(locale.value, route.path, config, options)\n })\n}\n"],"mappings":";;;;;;AAWA,SAAS,IAA4C;AAEnD,QADsB,GAAkB,CACnB,OAAO;;AAgB9B,SAAgB,IAA2D;CACzE,IAAM,EAAE,cAAW,GAAS,EACtB,IAAS,GAAkB;AAEjC,SAAQ,GAAc,MACb,EACL,GACA,KAAgB,EAAO,OACvB,EAAO,eACP,EAAO,SACR;;AAaL,SAAgB,IAAkD;CAChE,IAAM,IAAQ,GAAU,EAClB,IAAS,GAAkB;AAEjC,SAAQ,MACC,EACL,EAAM,MACN,GACA,EAAO,SACP,EAAO,eACP,EAAO,SACR;;AAkBL,SAAgB,IAAmF;CACjG,IAAM,EAAE,cAAW,GAAS,EACtB,IAAS,GAAW,EACpB,IAAS,GAAkB;AAEjC,SAAQ,GAAsB,MAA0B;EACtD,IAAM,IAAiB,KAAgB,EAAO;AAC9C,MAAI,OAAO,KAAO,UAAU;GAC1B,IAAM,IAAO,EAAW,GAAI,GAAgB,EAAO,eAAe,EAAO,SAAS;AAClF,UAAO,EAAO,QAAQ,EAAK;;AAG7B,MAAI,UAAU,KAAM,EAAG,MAAM;GAC3B,IAAM,IAAO,EAAW,EAAG,MAAM,GAAgB,EAAO,eAAe,EAAO,SAAS;AACvF,UAAO,EAAO,QAAQ;IAAE,GAAG;IAAI;IAAM,CAAC;;AAGxC,SAAO,EAAO,QAAQ,EAAG;;;AAiB7B,SAAgB,EAAc,GAAmB;CAC/C,IAAM,IAAM,GAAS;AAGrB,QAAO;EACL,GAAG;EACH,EAAE,GAAyB,GAA0C;AACnE,OAAI,OAAO,KAAmB,SAC5B,QAAO,EAAI,EAAE,GAAG,KAAwB,KAAkB,EAAO;AAGnE,OAAI,KAAkB,OAAO,KAAmB,YAAY,QAAQ,GAAgB;IAClF,IAAM,IAAO;AACb,WAAO,EAAI,EAAE;KAAE,GAAG;KAAM,IAAI,GAAG,KAAwB,EAAK;KAAM,EAAE,EAAO;;AAG7E,UAAQ,EAAI,EAAe,GAAgB,EAAO;;EAEpD,GAAG,GAAa,GAA0B;AACxC,UAAO,EAAI,GAAG,GAAG,KAAwB,KAAO,EAAO;;EAEzD,GAAG,GAAa,GAAiB;AAC/B,UAAO,EAAI,GAAG,GAAG,KAAwB,KAAO,EAAO;;EAGzD;EACD;;AAYH,SAAgB,EAAc,GAA0D;CACtF,IAAM,EAAE,cAAW,GAAS,EACtB,IAAQ,GAAU,EAClB,IAAS,GAAkB;AAEjC,QAAO,QACE,EAAgB,EAAO,OAAO,EAAM,MAAM,GAAQ,EAAQ,CACjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-i18n-route.cjs","names":[],"sources":["../../src/runtime/define-i18n-route.ts"],"sourcesContent":["import type { I18nRouteConfig } from '../types'\n\n/**\n * Define per-page i18n route configuration.\n *\n * Use in `<script setup>` to restrict which locales a page supports,\n * or set to `false` to disable i18n routing for a page.\n *\n * Under the hood, this stores the config in `definePageMeta` via `meta.i18nRoute`.\n *\n * @example\n * ```vue\n * <script setup>\n * // Only generate /en/pricing and /ja/pricing routes\n * defineI18nRoute({ locales: ['en', 'ja'] })\n * </script>\n * ```\n *\n * @example\n * ```vue\n * <script setup>\n * // Skip i18n routing for this page entirely\n * defineI18nRoute(false)\n * </script>\n * ```\n */\nexport function defineI18nRoute(config: I18nRouteConfig): void {\n // This is a compile-time macro. At runtime, the config is read from\n // page meta during route extension. This function exists only for type\n // checking and IDE support. The actual page meta injection is handled\n // by a Vite transform or by the user calling definePageMeta manually.\n //\n // Usage: definePageMeta({ i18nRoute: defineI18nRoute({ locales: ['en', 'ja'] }) })\n // Or the module can provide a Vite plugin to auto-transform this.\n void config\n}\n"],"mappings":"mEA0BA,SAAgB,EAAgB,EAA+B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-i18n-route.js","names":[],"sources":["../../src/runtime/define-i18n-route.ts"],"sourcesContent":["import type { I18nRouteConfig } from '../types'\n\n/**\n * Define per-page i18n route configuration.\n *\n * Use in `<script setup>` to restrict which locales a page supports,\n * or set to `false` to disable i18n routing for a page.\n *\n * Under the hood, this stores the config in `definePageMeta` via `meta.i18nRoute`.\n *\n * @example\n * ```vue\n * <script setup>\n * // Only generate /en/pricing and /ja/pricing routes\n * defineI18nRoute({ locales: ['en', 'ja'] })\n * </script>\n * ```\n *\n * @example\n * ```vue\n * <script setup>\n * // Skip i18n routing for this page entirely\n * defineI18nRoute(false)\n * </script>\n * ```\n */\nexport function defineI18nRoute(config: I18nRouteConfig): void {\n // This is a compile-time macro. At runtime, the config is read from\n // page meta during route extension. This function exists only for type\n // checking and IDE support. The actual page meta injection is handled\n // by a Vite transform or by the user calling definePageMeta manually.\n //\n // Usage: definePageMeta({ i18nRoute: defineI18nRoute({ locales: ['en', 'ja'] }) })\n // Or the module can provide a Vite plugin to auto-transform this.\n void config\n}\n"],"mappings":";AA0BA,SAAgB,EAAgB,GAA+B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain.cjs","names":[],"sources":["../../../src/runtime/detectors/domain.ts"],"sourcesContent":["import type { LocaleDetectContext } from '../../types'\nimport type { DomainConfig } from '../../types'\n\n/**\n * Detect locale from the request hostname.\n *\n * Matches the current host against the `domains` config to determine locale.\n * Only active when `strategy: 'domains'` is configured.\n */\nexport default function detectDomain(ctx: LocaleDetectContext): void {\n if (ctx.strategy !== 'domains') return\n if (!ctx.host) return\n\n // Access domains from the runtime config injected by the module\n const domains = (ctx as unknown as { domains?: DomainConfig[] }).domains\n if (!domains?.length) return\n\n const host = ctx.host.toLowerCase().replace(/:\\d+$/, '') // strip port\n\n for (const entry of domains) {\n if (entry.domain.toLowerCase() === host) {\n ctx.setLocale(entry.locale)\n return\n }\n }\n}\n"],"mappings":"AASA,SAAwB,EAAa,EAAgC,CAEnE,GADI,EAAI,WAAa,WACjB,CAAC,EAAI,KAAM,OAGf,IAAM,EAAW,EAAgD,QACjE,GAAI,CAAC,GAAS,OAAQ,OAEtB,IAAM,EAAO,EAAI,KAAK,aAAa,CAAC,QAAQ,QAAS,GAAG,CAExD,IAAK,IAAM,KAAS,EAClB,GAAI,EAAM,OAAO,aAAa,GAAK,EAAM,CACvC,EAAI,UAAU,EAAM,OAAO,CAC3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain.js","names":[],"sources":["../../../src/runtime/detectors/domain.ts"],"sourcesContent":["import type { LocaleDetectContext } from '../../types'\nimport type { DomainConfig } from '../../types'\n\n/**\n * Detect locale from the request hostname.\n *\n * Matches the current host against the `domains` config to determine locale.\n * Only active when `strategy: 'domains'` is configured.\n */\nexport default function detectDomain(ctx: LocaleDetectContext): void {\n if (ctx.strategy !== 'domains') return\n if (!ctx.host) return\n\n // Access domains from the runtime config injected by the module\n const domains = (ctx as unknown as { domains?: DomainConfig[] }).domains\n if (!domains?.length) return\n\n const host = ctx.host.toLowerCase().replace(/:\\d+$/, '') // strip port\n\n for (const entry of domains) {\n if (entry.domain.toLowerCase() === host) {\n ctx.setLocale(entry.locale)\n return\n }\n }\n}\n"],"mappings":";AASA,SAAwB,EAAa,GAAgC;AAEnE,KADI,EAAI,aAAa,aACjB,CAAC,EAAI,KAAM;CAGf,IAAM,IAAW,EAAgD;AACjE,KAAI,CAAC,GAAS,OAAQ;CAEtB,IAAM,IAAO,EAAI,KAAK,aAAa,CAAC,QAAQ,SAAS,GAAG;AAExD,MAAK,IAAM,KAAS,EAClB,KAAI,EAAM,OAAO,aAAa,KAAK,GAAM;AACvC,IAAI,UAAU,EAAM,OAAO;AAC3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-redirect.cjs","names":[],"sources":["../../../src/runtime/middleware/locale-redirect.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useNuxtApp, useRuntimeConfig } from '#imports'\nimport { extractLocaleFromPath, localePath } from '../path-utils'\nimport { runDetectors } from '../detectors'\nimport type { FluentNuxtRuntimeConfig } from '../../types'\n\n/**\n * Route middleware that redirects users to locale-prefixed URLs\n * based on the locale detection chain (detectors + hook).\n *\n * Only active when strategy is not 'no_prefix'.\n * Skips redirect when the URL already contains a valid locale prefix.\n */\nexport default defineNuxtRouteMiddleware(async (to) => {\n const config = useRuntimeConfig().public['fluenti'] as FluentNuxtRuntimeConfig\n\n if (config.strategy === 'no_prefix') return\n\n // If the path already has a locale prefix, do nothing\n const { locale: pathLocale } = extractLocaleFromPath(to.path, config.locales)\n if (pathLocale) return\n\n // For prefix_except_default / prefix_and_default, an unprefixed path\n // means the default locale — no redirect needed for prefix_except_default\n if (config.strategy === 'prefix_except_default') return\n\n // Capture nuxtApp BEFORE any await — async local storage (composable\n // context) is lost after awaiting, so navigateTo would fail without this.\n const nuxtApp = useNuxtApp()\n\n // For 'prefix' strategy, we must redirect to a locale-prefixed URL\n // Run detectors excluding 'path' (since we know path has no locale)\n const configWithoutPath = {\n ...config,\n detectOrder: config.detectOrder.filter((d) => d !== 'path'),\n }\n const detectedLocale = await runDetectors(to.path, configWithoutPath)\n const targetPath = localePath(to.path, detectedLocale, config.defaultLocale, config.strategy)\n\n if (targetPath !== to.path) {\n return nuxtApp.runWithContext(() => navigateTo(targetPath, { redirectCode: 302 }))\n }\n})\n"],"mappings":"uJAYA,IAAA,GAAA,EAAA,EAAA,2BAAyC,KAAO,IAAO,CACrD,IAAM,GAAA,EAAA,EAAA,mBAA2B,CAAC,OAAO,QAEzC,GAAI,EAAO,WAAa,YAAa,OAGrC,GAAM,CAAE,OAAQ,GAAe,EAAA,EAAsB,EAAG,KAAM,EAAO,QAAQ,CAK7E,GAJI,GAIA,EAAO,WAAa,wBAAyB,OAIjD,IAAM,GAAA,EAAA,EAAA,aAAsB,CAItB,EAAoB,CACxB,GAAG,EACH,YAAa,EAAO,YAAY,OAAQ,GAAM,IAAM,OAAO,CAC5D,CACK,EAAiB,MAAM,EAAA,EAAa,EAAG,KAAM,EAAkB,CAC/D,EAAa,EAAA,EAAW,EAAG,KAAM,EAAgB,EAAO,cAAe,EAAO,SAAS,CAE7F,GAAI,IAAe,EAAG,KACpB,OAAO,EAAQ,oBAAA,EAAA,EAAA,YAAgC,EAAY,CAAE,aAAc,IAAK,CAAC,CAAC,EAEpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-redirect.js","names":[],"sources":["../../../src/runtime/middleware/locale-redirect.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useNuxtApp, useRuntimeConfig } from '#imports'\nimport { extractLocaleFromPath, localePath } from '../path-utils'\nimport { runDetectors } from '../detectors'\nimport type { FluentNuxtRuntimeConfig } from '../../types'\n\n/**\n * Route middleware that redirects users to locale-prefixed URLs\n * based on the locale detection chain (detectors + hook).\n *\n * Only active when strategy is not 'no_prefix'.\n * Skips redirect when the URL already contains a valid locale prefix.\n */\nexport default defineNuxtRouteMiddleware(async (to) => {\n const config = useRuntimeConfig().public['fluenti'] as FluentNuxtRuntimeConfig\n\n if (config.strategy === 'no_prefix') return\n\n // If the path already has a locale prefix, do nothing\n const { locale: pathLocale } = extractLocaleFromPath(to.path, config.locales)\n if (pathLocale) return\n\n // For prefix_except_default / prefix_and_default, an unprefixed path\n // means the default locale — no redirect needed for prefix_except_default\n if (config.strategy === 'prefix_except_default') return\n\n // Capture nuxtApp BEFORE any await — async local storage (composable\n // context) is lost after awaiting, so navigateTo would fail without this.\n const nuxtApp = useNuxtApp()\n\n // For 'prefix' strategy, we must redirect to a locale-prefixed URL\n // Run detectors excluding 'path' (since we know path has no locale)\n const configWithoutPath = {\n ...config,\n detectOrder: config.detectOrder.filter((d) => d !== 'path'),\n }\n const detectedLocale = await runDetectors(to.path, configWithoutPath)\n const targetPath = localePath(to.path, detectedLocale, config.defaultLocale, config.strategy)\n\n if (targetPath !== to.path) {\n return nuxtApp.runWithContext(() => navigateTo(targetPath, { redirectCode: 302 }))\n }\n})\n"],"mappings":";;;;AAYA,IAAA,IAAe,EAA0B,OAAO,MAAO;CACrD,IAAM,IAAS,GAAkB,CAAC,OAAO;AAEzC,KAAI,EAAO,aAAa,YAAa;CAGrC,IAAM,EAAE,QAAQ,MAAe,EAAsB,EAAG,MAAM,EAAO,QAAQ;AAK7E,KAJI,KAIA,EAAO,aAAa,wBAAyB;CAIjD,IAAM,IAAU,GAAY,EAItB,IAAoB;EACxB,GAAG;EACH,aAAa,EAAO,YAAY,QAAQ,MAAM,MAAM,OAAO;EAC5D,EACK,IAAiB,MAAM,EAAa,EAAG,MAAM,EAAkB,EAC/D,IAAa,EAAW,EAAG,MAAM,GAAgB,EAAO,eAAe,EAAO,SAAS;AAE7F,KAAI,MAAe,EAAG,KACpB,QAAO,EAAQ,qBAAqB,EAAW,GAAY,EAAE,cAAc,KAAK,CAAC,CAAC;EAEpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.cjs","names":[],"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig, useRoute, useCookie, useRequestHeaders } from '#imports'\nimport { ref, watch } from 'vue'\nimport { localePath, extractLocaleFromPath, switchLocalePath } from './path-utils'\nimport { runDetectors } from './detectors'\nimport type { FluentNuxtRuntimeConfig, LocaleDetectContext } from '../types'\n\n/**\n * Nuxt runtime plugin that:\n * 1. Server: runs the locale detection chain, stores locale in payload for hydration\n * 2. Client: reads locale from payload to avoid hydration mismatch\n * 3. Provides reactive locale state and global helpers\n */\nexport default defineNuxtPlugin(async (nuxtApp) => {\n const config = useRuntimeConfig().public['fluenti'] as FluentNuxtRuntimeConfig\n const route = useRoute()\n\n // Hoist useCookie calls BEFORE any await to avoid losing the Nuxt\n // composable context (async local storage is dropped after await).\n const cookieCfg = config.detectBrowserLanguage?.useCookie\n ? config.detectBrowserLanguage\n : null\n const cookieKey = cookieCfg?.cookieKey ?? 'fluenti_locale'\n const localeCookie = cookieCfg ? useCookie(cookieKey) : null\n\n // Hoist all server-side header/cookie reads BEFORE any await.\n // Nuxt composables rely on async local storage that is dropped after await.\n let host: string | undefined\n let acceptLanguage: string | undefined\n if (import.meta.server) {\n try {\n const reqHeaders = useRequestHeaders(['host', 'accept-language'])\n acceptLanguage = reqHeaders['accept-language']\n if (config.strategy === 'domains') {\n host = reqHeaders['host']\n }\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Header read failed:', err)\n }\n } else if (config.strategy === 'domains') {\n try {\n host = window.location.host\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Domain detection failed:', err)\n }\n }\n\n let detectedLocale: string\n\n if (import.meta.server) {\n // --- Server (SSR / SSG / ISR): run full detection chain ---\n detectedLocale = await runDetectors(\n route.path,\n config,\n undefined,\n async (ctx: LocaleDetectContext) => {\n await (nuxtApp.callHook as Function)('fluenti:detect-locale', ctx)\n },\n host,\n localeCookie?.value ?? undefined,\n acceptLanguage,\n )\n // Store in payload — Nuxt serializes this to HTML automatically.\n // The client reads it back to ensure hydration uses the same locale.\n nuxtApp.payload['fluentiLocale'] = detectedLocale\n // Also set on event context so other plugins (e.g. i18n.ts) can read it\n try {\n const event = (nuxtApp as unknown as { ssrContext?: { event?: { context: Record<string, unknown> } } }).ssrContext?.event\n if (event) event.context['locale'] = detectedLocale\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Event context not available:', err)\n }\n } else if (nuxtApp.payload['fluentiLocale']) {\n // --- Client (SSR hydration): read from payload to avoid mismatch ---\n detectedLocale = nuxtApp.payload['fluentiLocale'] as string\n } else {\n // --- Client (SPA mode / no payload): detect from path and cookie ---\n if (config.strategy === 'domains' && host && config.domains?.length) {\n const cleanHost = host.toLowerCase().replace(/:\\d+$/, '')\n const domainMatch = config.domains.find((d) => d.domain.toLowerCase() === cleanHost)\n if (domainMatch) {\n detectedLocale = domainMatch.locale\n } else {\n detectedLocale = config.defaultLocale\n }\n } else {\n const { locale: pathLocale } = extractLocaleFromPath(route.path, config.locales)\n if (pathLocale) {\n detectedLocale = pathLocale\n } else if (localeCookie) {\n detectedLocale = (localeCookie.value && config.locales.includes(localeCookie.value))\n ? localeCookie.value\n : config.defaultLocale\n } else {\n detectedLocale = config.defaultLocale\n }\n }\n }\n\n const currentLocale = ref(detectedLocale)\n\n // Sync locale when route changes (path-based detection)\n if (config.strategy !== 'no_prefix' && config.strategy !== 'domains') {\n watch(() => route.path, (newPath) => {\n const { locale } = extractLocaleFromPath(newPath, config.locales)\n if (locale) {\n currentLocale.value = locale\n } else if (config.strategy === 'prefix_except_default') {\n // No locale prefix found — this means we're on a default locale route\n currentLocale.value = config.defaultLocale\n }\n })\n }\n\n // Persist locale in cookie if detectBrowserLanguage is configured\n if (localeCookie) {\n watch(currentLocale, (newLocale) => {\n localeCookie.value = newLocale\n })\n }\n\n // --- Inject global helpers ---\n if (config.injectGlobalProperties) {\n const gp = nuxtApp.vueApp.config.globalProperties\n gp.$localePath = (path: string, locale?: string) => {\n return localePath(\n path,\n locale ?? currentLocale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n gp.$switchLocalePath = (newLocale: string) => {\n return switchLocalePath(\n route.path,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n\n // $t/$d/$n are injected by the @fluenti/vue plugin via globalProperties.\n // No additional injection needed here — useI18n() cannot be called outside\n // a component setup() context.\n }\n\n return {\n provide: {\n fluentiLocale: currentLocale,\n fluentiConfig: config,\n },\n }\n})\n"],"mappings":"+JAYA,IAAA,G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kBAErB,CACL,GAAM,CAAE,OAAQ,GAAe,EAAA,EAAsB,EAAM,KAAM,EAAO,QAAQ,CAChF,AAOE,EAPE,IAEO,GACS,EAAa,OAAS,EAAO,QAAQ,SAAS,EAAa,MAAM,CAC/E,EAAa,MACb,EAAO,eAOjB,IAAM,GAAA,EAAA,EAAA,KAAoB,EAAe,CAuBzC,GApBI,EAAO,WAAa,aAAe,EAAO,WAAa,YACzD,EAAA,EAAA,WAAY,EAAM,KAAO,GAAY,CACnC,GAAM,CAAE,UAAW,EAAA,EAAsB,EAAS,EAAO,QAAQ,CAC7D,EACF,EAAc,MAAQ,EACb,EAAO,WAAa,0BAE7B,EAAc,MAAQ,EAAO,gBAE/B,CAIA,IACF,EAAA,EAAA,OAAM,EAAgB,GAAc,CAClC,EAAa,MAAQ,GACrB,CAIA,EAAO,uBAAwB,CACjC,IAAM,EAAK,EAAQ,OAAO,OAAO,iBACjC,EAAG,aAAe,EAAc,IACvB,EAAA,EACL,EACA,GAAU,EAAc,MACxB,EAAO,cACP,EAAO,SACR,CAEH,EAAG,kBAAqB,GACf,EAAA,EACL,EAAM,KACN,EACA,EAAO,QACP,EAAO,cACP,EAAO,SACR,CAQL,MAAO,CACL,QAAS,CACP,cAAe,EACf,cAAe,EAChB,CACF,EACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","names":[],"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig, useRoute, useCookie, useRequestHeaders } from '#imports'\nimport { ref, watch } from 'vue'\nimport { localePath, extractLocaleFromPath, switchLocalePath } from './path-utils'\nimport { runDetectors } from './detectors'\nimport type { FluentNuxtRuntimeConfig, LocaleDetectContext } from '../types'\n\n/**\n * Nuxt runtime plugin that:\n * 1. Server: runs the locale detection chain, stores locale in payload for hydration\n * 2. Client: reads locale from payload to avoid hydration mismatch\n * 3. Provides reactive locale state and global helpers\n */\nexport default defineNuxtPlugin(async (nuxtApp) => {\n const config = useRuntimeConfig().public['fluenti'] as FluentNuxtRuntimeConfig\n const route = useRoute()\n\n // Hoist useCookie calls BEFORE any await to avoid losing the Nuxt\n // composable context (async local storage is dropped after await).\n const cookieCfg = config.detectBrowserLanguage?.useCookie\n ? config.detectBrowserLanguage\n : null\n const cookieKey = cookieCfg?.cookieKey ?? 'fluenti_locale'\n const localeCookie = cookieCfg ? useCookie(cookieKey) : null\n\n // Hoist all server-side header/cookie reads BEFORE any await.\n // Nuxt composables rely on async local storage that is dropped after await.\n let host: string | undefined\n let acceptLanguage: string | undefined\n if (import.meta.server) {\n try {\n const reqHeaders = useRequestHeaders(['host', 'accept-language'])\n acceptLanguage = reqHeaders['accept-language']\n if (config.strategy === 'domains') {\n host = reqHeaders['host']\n }\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Header read failed:', err)\n }\n } else if (config.strategy === 'domains') {\n try {\n host = window.location.host\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Domain detection failed:', err)\n }\n }\n\n let detectedLocale: string\n\n if (import.meta.server) {\n // --- Server (SSR / SSG / ISR): run full detection chain ---\n detectedLocale = await runDetectors(\n route.path,\n config,\n undefined,\n async (ctx: LocaleDetectContext) => {\n await (nuxtApp.callHook as Function)('fluenti:detect-locale', ctx)\n },\n host,\n localeCookie?.value ?? undefined,\n acceptLanguage,\n )\n // Store in payload — Nuxt serializes this to HTML automatically.\n // The client reads it back to ensure hydration uses the same locale.\n nuxtApp.payload['fluentiLocale'] = detectedLocale\n // Also set on event context so other plugins (e.g. i18n.ts) can read it\n try {\n const event = (nuxtApp as unknown as { ssrContext?: { event?: { context: Record<string, unknown> } } }).ssrContext?.event\n if (event) event.context['locale'] = detectedLocale\n } catch (err) {\n if (import.meta.dev) console.debug('[fluenti] Event context not available:', err)\n }\n } else if (nuxtApp.payload['fluentiLocale']) {\n // --- Client (SSR hydration): read from payload to avoid mismatch ---\n detectedLocale = nuxtApp.payload['fluentiLocale'] as string\n } else {\n // --- Client (SPA mode / no payload): detect from path and cookie ---\n if (config.strategy === 'domains' && host && config.domains?.length) {\n const cleanHost = host.toLowerCase().replace(/:\\d+$/, '')\n const domainMatch = config.domains.find((d) => d.domain.toLowerCase() === cleanHost)\n if (domainMatch) {\n detectedLocale = domainMatch.locale\n } else {\n detectedLocale = config.defaultLocale\n }\n } else {\n const { locale: pathLocale } = extractLocaleFromPath(route.path, config.locales)\n if (pathLocale) {\n detectedLocale = pathLocale\n } else if (localeCookie) {\n detectedLocale = (localeCookie.value && config.locales.includes(localeCookie.value))\n ? localeCookie.value\n : config.defaultLocale\n } else {\n detectedLocale = config.defaultLocale\n }\n }\n }\n\n const currentLocale = ref(detectedLocale)\n\n // Sync locale when route changes (path-based detection)\n if (config.strategy !== 'no_prefix' && config.strategy !== 'domains') {\n watch(() => route.path, (newPath) => {\n const { locale } = extractLocaleFromPath(newPath, config.locales)\n if (locale) {\n currentLocale.value = locale\n } else if (config.strategy === 'prefix_except_default') {\n // No locale prefix found — this means we're on a default locale route\n currentLocale.value = config.defaultLocale\n }\n })\n }\n\n // Persist locale in cookie if detectBrowserLanguage is configured\n if (localeCookie) {\n watch(currentLocale, (newLocale) => {\n localeCookie.value = newLocale\n })\n }\n\n // --- Inject global helpers ---\n if (config.injectGlobalProperties) {\n const gp = nuxtApp.vueApp.config.globalProperties\n gp.$localePath = (path: string, locale?: string) => {\n return localePath(\n path,\n locale ?? currentLocale.value,\n config.defaultLocale,\n config.strategy,\n )\n }\n gp.$switchLocalePath = (newLocale: string) => {\n return switchLocalePath(\n route.path,\n newLocale,\n config.locales,\n config.defaultLocale,\n config.strategy,\n )\n }\n\n // $t/$d/$n are injected by the @fluenti/vue plugin via globalProperties.\n // No additional injection needed here — useI18n() cannot be called outside\n // a component setup() context.\n }\n\n return {\n provide: {\n fluentiLocale: currentLocale,\n fluentiConfig: config,\n },\n }\n})\n"],"mappings":";;;;;AAYA,IAAA,IAAe,EAAiB,OAAO,MAAY;CACjD,IAAM,IAAS,GAAkB,CAAC,OAAO,SACnC,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