@fluenti/vite-plugin 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/client.d.ts +9 -0
- package/dist/index.cjs +273 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +965 -0
- package/dist/index.js.map +1 -0
- package/dist/src/build-transform.d.ts +18 -0
- package/dist/src/build-transform.d.ts.map +1 -0
- package/dist/src/framework-detect.d.ts +2 -0
- package/dist/src/framework-detect.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/mode-detect.d.ts +17 -0
- package/dist/src/mode-detect.d.ts.map +1 -0
- package/dist/src/route-resolve.d.ts +41 -0
- package/dist/src/route-resolve.d.ts.map +1 -0
- package/dist/src/scope-transform.d.ts +3 -0
- package/dist/src/scope-transform.d.ts.map +1 -0
- package/dist/src/sfc-transform.d.ts +2 -0
- package/dist/src/sfc-transform.d.ts.map +1 -0
- package/dist/src/solid-jsx-transform.d.ts +6 -0
- package/dist/src/solid-jsx-transform.d.ts.map +1 -0
- package/dist/src/trans-transform.d.ts +3 -0
- package/dist/src/trans-transform.d.ts.map +1 -0
- package/dist/src/types.d.ts +15 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/virtual-modules.d.ts +33 -0
- package/dist/src/virtual-modules.d.ts.map +1 -0
- package/dist/src/vt-transform.d.ts +57 -0
- package/dist/src/vt-transform.d.ts.map +1 -0
- package/dist/tests/build-transform.test.d.ts +2 -0
- package/dist/tests/build-transform.test.d.ts.map +1 -0
- package/dist/tests/mode-detect.test.d.ts +2 -0
- package/dist/tests/mode-detect.test.d.ts.map +1 -0
- package/dist/tests/per-route-splitting.test.d.ts +2 -0
- package/dist/tests/per-route-splitting.test.d.ts.map +1 -0
- package/dist/tests/route-resolve.test.d.ts +2 -0
- package/dist/tests/route-resolve.test.d.ts.map +1 -0
- package/dist/tests/scope-transform.test.d.ts +2 -0
- package/dist/tests/scope-transform.test.d.ts.map +1 -0
- package/dist/tests/trans-transform.test.d.ts +2 -0
- package/dist/tests/trans-transform.test.d.ts.map +1 -0
- package/dist/tests/virtual-modules.test.d.ts +2 -0
- package/dist/tests/virtual-modules.test.d.ts.map +1 -0
- package/dist/tests/vite-plugin.test.d.ts +2 -0
- package/dist/tests/vite-plugin.test.d.ts.map +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/mode-detect.ts","../src/build-transform.ts","../src/virtual-modules.ts","../src/route-resolve.ts","../src/framework-detect.ts","../src/sfc-transform.ts","../src/solid-jsx-transform.ts","../src/index.ts"],"sourcesContent":["/**\n * Detect whether Vite is running in build or dev mode.\n * Supports Vite 7 (configResolved) and Vite 8 (environment API).\n */\n\nlet resolvedMode: 'build' | 'dev' = 'dev'\n\n/** Called from configResolved hook to capture the mode early */\nexport function setResolvedMode(command: string): void {\n resolvedMode = command === 'build' ? 'build' : 'dev'\n}\n\n/** Get the current resolved mode */\nexport function getResolvedMode(): 'build' | 'dev' {\n return resolvedMode\n}\n\n/**\n * Check if we're in build mode.\n * Tries environment API (Vite 8), then falls back to configResolved capture,\n * then falls back to NODE_ENV.\n */\nexport function isBuildMode(environment?: { mode?: string }): boolean {\n // Vite 8: environment.mode === 'build'\n if (environment?.mode === 'build') return true\n\n // Vite 7: captured from configResolved\n if (resolvedMode === 'build') return true\n\n // Last resort: NODE_ENV\n if (process.env['NODE_ENV'] === 'production') return true\n\n return false\n}\n","/**\n * Build-mode transform for code-splitting.\n *\n * Strategy 'dynamic': rewrites supported translation calls to __catalog._<hash> references.\n * Strategy 'static': rewrites to direct named imports from compiled locale modules.\n */\n\nimport { hashMessage } from '@fluenti/core'\nimport { parseSourceModule, walkSourceAst, type SourceNode } from '@fluenti/core/internal'\n\nexport interface BuildTransformResult {\n code: string\n needsCatalogImport: boolean\n usedHashes: Set<string>\n}\n\ntype SplitStrategy = 'dynamic' | 'static'\n\ninterface IdentifierNode extends SourceNode {\n type: 'Identifier'\n name: string\n}\n\ninterface StringLiteralNode extends SourceNode {\n type: 'StringLiteral'\n value: string\n}\n\ninterface NumericLiteralNode extends SourceNode {\n type: 'NumericLiteral'\n value: number\n}\n\ninterface TemplateElementNode extends SourceNode {\n type: 'TemplateElement'\n value: { cooked: string | null; raw: string }\n}\n\ninterface TemplateLiteralNode extends SourceNode {\n type: 'TemplateLiteral'\n expressions: SourceNode[]\n quasis: TemplateElementNode[]\n}\n\ninterface ImportDeclarationNode extends SourceNode {\n type: 'ImportDeclaration'\n source: StringLiteralNode\n specifiers: SourceNode[]\n}\n\ninterface ImportSpecifierNode extends SourceNode {\n type: 'ImportSpecifier'\n imported: IdentifierNode | StringLiteralNode\n local: IdentifierNode\n}\n\ninterface CallExpressionNode extends SourceNode {\n type: 'CallExpression'\n callee: SourceNode\n arguments: SourceNode[]\n}\n\ninterface AwaitExpressionNode extends SourceNode {\n type: 'AwaitExpression'\n argument: SourceNode\n}\n\ninterface VariableDeclaratorNode extends SourceNode {\n type: 'VariableDeclarator'\n id: SourceNode\n init?: SourceNode | null\n}\n\ninterface ProgramNode extends SourceNode {\n type: 'Program'\n body: SourceNode[]\n}\n\ninterface ObjectExpressionNode extends SourceNode {\n type: 'ObjectExpression'\n properties: SourceNode[]\n}\n\ninterface ObjectPropertyNode extends SourceNode {\n type: 'ObjectProperty'\n key: SourceNode\n value: SourceNode\n computed?: boolean\n}\n\ninterface ObjectPatternNode extends SourceNode {\n type: 'ObjectPattern'\n properties: SourceNode[]\n}\n\ninterface MemberExpressionNode extends SourceNode {\n type: 'MemberExpression'\n object: SourceNode\n property: SourceNode\n computed?: boolean\n}\n\ninterface JSXElementNode extends SourceNode {\n type: 'JSXElement'\n openingElement: JSXOpeningElementNode\n}\n\ninterface JSXOpeningElementNode extends SourceNode {\n type: 'JSXOpeningElement'\n name: SourceNode\n attributes: SourceNode[]\n}\n\ninterface JSXIdentifierNode extends SourceNode {\n type: 'JSXIdentifier'\n name: string\n}\n\ninterface JSXAttributeNode extends SourceNode {\n type: 'JSXAttribute'\n name: JSXIdentifierNode\n value?: SourceNode | null\n}\n\ninterface JSXExpressionContainerNode extends SourceNode {\n type: 'JSXExpressionContainer'\n expression: SourceNode\n}\n\ninterface SplitReplacement {\n start: number\n end: number\n replacement: string\n}\n\ninterface SplitTarget {\n catalogId: string\n valuesSource?: string\n}\n\ninterface RuntimeBindings {\n tracked: Set<string>\n unref: Set<string>\n}\n\nexport function transformForDynamicSplit(code: string): BuildTransformResult {\n return transformForSplitStrategy(code, 'dynamic')\n}\n\nexport function transformForStaticSplit(code: string): BuildTransformResult {\n return transformForSplitStrategy(code, 'static')\n}\n\nfunction transformForSplitStrategy(\n code: string,\n strategy: SplitStrategy,\n): BuildTransformResult {\n const ast = parseSourceModule(code)\n if (!ast || ast.type !== 'Program') {\n return { code, needsCatalogImport: false, usedHashes: new Set() }\n }\n\n const bindings = collectTrackedRuntimeBindings(ast as ProgramNode)\n const replacements: SplitReplacement[] = []\n const usedHashes = new Set<string>()\n\n walkSourceAst(ast, (node) => {\n const replacement = extractCallReplacement(code, node, bindings, strategy, usedHashes)\n if (replacement) {\n replacements.push(replacement)\n return\n }\n\n collectComponentUsage(node, usedHashes)\n })\n\n if (replacements.length === 0) {\n return { code, needsCatalogImport: false, usedHashes }\n }\n\n let result = code\n for (let i = replacements.length - 1; i >= 0; i--) {\n const { start, end, replacement } = replacements[i]!\n result = result.slice(0, start) + replacement + result.slice(end)\n }\n\n return { code: result, needsCatalogImport: true, usedHashes }\n}\n\nfunction collectTrackedRuntimeBindings(program: ProgramNode): RuntimeBindings {\n const tracked = new Set<string>()\n const useI18nBindings = new Set<string>()\n const getI18nBindings = new Set<string>()\n const unrefBindings = new Set<string>()\n\n for (const statement of program.body) {\n if (!isImportDeclaration(statement)) continue\n for (const specifier of statement.specifiers) {\n if (!isImportSpecifier(specifier)) continue\n const importedName = readImportedName(specifier)\n if (!importedName) continue\n if (importedName === 'useI18n') {\n useI18nBindings.add(specifier.local.name)\n }\n if (importedName === 'getI18n') {\n getI18nBindings.add(specifier.local.name)\n }\n if (importedName === 'unref') {\n unrefBindings.add(specifier.local.name)\n }\n }\n }\n\n walkSourceAst(program, (node) => {\n if (!isVariableDeclarator(node) || !node.init || !isObjectPattern(node.id)) return\n\n if (isCallExpression(node.init) && isIdentifier(node.init.callee) && useI18nBindings.has(node.init.callee.name)) {\n addTrackedObjectPatternBindings(node.id, tracked)\n return\n }\n\n const awaitedCall = node.init.type === 'AwaitExpression'\n ? (node.init as AwaitExpressionNode).argument\n : null\n\n if (\n awaitedCall\n && isCallExpression(awaitedCall)\n && isIdentifier(awaitedCall.callee)\n && getI18nBindings.has(awaitedCall.callee.name)\n ) {\n addTrackedObjectPatternBindings(node.id, tracked)\n }\n })\n\n return { tracked, unref: unrefBindings }\n}\n\nfunction addTrackedObjectPatternBindings(pattern: ObjectPatternNode, tracked: Set<string>): void {\n for (const property of pattern.properties) {\n if (!isObjectProperty(property) || property.computed) continue\n if (!isIdentifier(property.key) || property.key.name !== 't') continue\n if (isIdentifier(property.value)) {\n tracked.add(property.value.name)\n }\n }\n}\n\nfunction extractCallReplacement(\n code: string,\n node: SourceNode,\n bindings: RuntimeBindings,\n strategy: SplitStrategy,\n usedHashes: Set<string>,\n): SplitReplacement | undefined {\n if (!isCallExpression(node) || node.start == null || node.end == null) {\n return undefined\n }\n\n const splitTarget = resolveSplitTarget(code, node, bindings)\n if (!splitTarget) {\n return undefined\n }\n\n const { catalogId } = splitTarget\n usedHashes.add(catalogId)\n const exportHash = hashMessage(catalogId)\n const replacementTarget = strategy === 'dynamic'\n ? `__catalog[${JSON.stringify(catalogId)}]`\n : `_${exportHash}`\n const replacement = splitTarget.valuesSource\n ? `${replacementTarget}(${splitTarget.valuesSource})`\n : replacementTarget\n\n return {\n start: node.start,\n end: node.end,\n replacement,\n }\n}\n\nfunction resolveSplitTarget(\n code: string,\n call: CallExpressionNode,\n bindings: RuntimeBindings,\n): SplitTarget | undefined {\n if (call.arguments.length === 0) return undefined\n\n const callee = call.callee\n const isTrackedIdentifierCall = isIdentifier(callee) && (bindings.tracked.has(callee.name) || callee.name === '$t')\n const isTemplateMemberCall = isMemberExpression(callee)\n && !callee.computed\n && isIdentifier(callee.property)\n && (\n callee.property.name === '$t'\n || (\n callee.property.name === 't'\n && isIdentifier(callee.object)\n && (callee.object.name === '_ctx' || callee.object.name === '$setup')\n )\n )\n const isVueUnrefCall = isCallExpression(callee)\n && isIdentifier(callee.callee)\n && bindings.unref.has(callee.callee.name)\n && callee.arguments.length === 1\n && isIdentifier(callee.arguments[0])\n && bindings.tracked.has(callee.arguments[0].name)\n\n if (!isTrackedIdentifierCall && !isTemplateMemberCall && !isVueUnrefCall) {\n return undefined\n }\n\n const catalogId = extractCatalogId(call.arguments[0]!)\n if (!catalogId) return undefined\n\n const valuesSource = call.arguments[1] && call.arguments[1]!.start != null && call.arguments[1]!.end != null\n ? code.slice(call.arguments[1]!.start, call.arguments[1]!.end)\n : undefined\n\n return valuesSource === undefined\n ? { catalogId }\n : { catalogId, valuesSource }\n}\n\nfunction extractCatalogId(argument: SourceNode): string | undefined {\n const staticString = readStaticString(argument)\n if (staticString !== undefined) {\n return hashMessage(staticString)\n }\n\n if (!isObjectExpression(argument)) {\n return undefined\n }\n\n let id: string | undefined\n let message: string | undefined\n let context: string | undefined\n\n for (const property of argument.properties) {\n if (!isObjectProperty(property) || property.computed) continue\n const key = readPropertyKey(property.key)\n if (!key) continue\n\n const value = readStaticString(property.value)\n if (value === undefined) continue\n\n if (key === 'id') id = value\n if (key === 'message') message = value\n if (key === 'context') context = value\n }\n\n if (id) return id\n if (message) return hashMessage(message, context)\n return undefined\n}\n\nfunction collectComponentUsage(node: SourceNode, usedHashes: Set<string>): void {\n if (!isJsxElement(node)) return\n\n const componentName = readJsxName(node.openingElement.name)\n if (!componentName) return\n\n if (componentName === 'Trans') {\n const id = readJsxStaticAttribute(node.openingElement, '__id') ?? readJsxStaticAttribute(node.openingElement, 'id')\n if (id) {\n usedHashes.add(id)\n return\n }\n\n const message = readJsxStaticAttribute(node.openingElement, '__message')\n const context = readJsxStaticAttribute(node.openingElement, 'context')\n if (message) {\n usedHashes.add(hashMessage(message, context))\n }\n return\n }\n\n if (componentName === 'Plural') {\n const messageId = buildPluralMessageId(node.openingElement)\n if (messageId) {\n usedHashes.add(messageId)\n }\n return\n }\n\n if (componentName === 'Select') {\n const messageId = buildSelectMessageId(node.openingElement)\n if (messageId) {\n usedHashes.add(messageId)\n }\n }\n}\n\nfunction buildPluralMessageId(openingElement: JSXOpeningElementNode): string | undefined {\n const id = readJsxStaticAttribute(openingElement, 'id')\n if (id) return id\n\n const context = readJsxStaticAttribute(openingElement, 'context')\n const offsetRaw = readJsxStaticNumber(openingElement, 'offset')\n const forms = [\n readJsxStaticAttribute(openingElement, 'zero') === undefined ? undefined : `=0 {${readJsxStaticAttribute(openingElement, 'zero')}}`,\n readJsxStaticAttribute(openingElement, 'one') === undefined ? undefined : `one {${readJsxStaticAttribute(openingElement, 'one')}}`,\n readJsxStaticAttribute(openingElement, 'two') === undefined ? undefined : `two {${readJsxStaticAttribute(openingElement, 'two')}}`,\n readJsxStaticAttribute(openingElement, 'few') === undefined ? undefined : `few {${readJsxStaticAttribute(openingElement, 'few')}}`,\n readJsxStaticAttribute(openingElement, 'many') === undefined ? undefined : `many {${readJsxStaticAttribute(openingElement, 'many')}}`,\n readJsxStaticAttribute(openingElement, 'other') === undefined ? undefined : `other {${readJsxStaticAttribute(openingElement, 'other')}}`,\n ].filter(Boolean)\n\n if (forms.length === 0) return undefined\n\n const offsetPart = typeof offsetRaw === 'number' ? ` offset:${offsetRaw}` : ''\n const icuMessage = `{count, plural,${offsetPart} ${forms.join(' ')}}`\n return hashMessage(icuMessage, context)\n}\n\nfunction buildSelectMessageId(openingElement: JSXOpeningElementNode): string | undefined {\n const id = readJsxStaticAttribute(openingElement, 'id')\n if (id) return id\n\n const context = readJsxStaticAttribute(openingElement, 'context')\n const forms = readStaticSelectForms(openingElement)\n if (!forms || forms['other'] === undefined) return undefined\n\n const orderedKeys = [...Object.keys(forms).filter((key) => key !== 'other').sort(), 'other']\n const icuMessage = `{value, select, ${orderedKeys.map((key) => `${key} {${forms[key]!}}`).join(' ')}}`\n return hashMessage(icuMessage, context)\n}\n\nfunction readStaticSelectForms(openingElement: JSXOpeningElementNode): Record<string, string> | undefined {\n const optionForms = readJsxStaticObject(openingElement, 'options')\n if (optionForms) {\n const other = readJsxStaticAttribute(openingElement, 'other')\n return {\n ...optionForms,\n ...(other !== undefined ? { other } : {}),\n }\n }\n\n const forms: Record<string, string> = {}\n for (const attribute of openingElement.attributes) {\n if (!isJsxAttribute(attribute)) continue\n const name = attribute.name.name\n if (['value', 'id', 'context', 'comment', 'options'].includes(name)) continue\n const value = readJsxAttributeValue(attribute)\n if (value !== undefined) {\n forms[name] = value\n }\n }\n\n return Object.keys(forms).length > 0 ? forms : undefined\n}\n\nfunction readStaticSelectObjectValue(node: SourceNode): Record<string, string> | undefined {\n if (!isObjectExpression(node)) return undefined\n const values: Record<string, string> = {}\n\n for (const property of node.properties) {\n if (!isObjectProperty(property) || property.computed) return undefined\n const key = readPropertyKey(property.key)\n const value = readStaticString(property.value)\n if (!key || value === undefined) return undefined\n values[key] = value\n }\n\n return values\n}\n\nfunction readJsxStaticObject(openingElement: JSXOpeningElementNode, name: string): Record<string, string> | undefined {\n const attribute = findJsxAttribute(openingElement, name)\n if (!attribute?.value) return undefined\n if (attribute.value.type !== 'JSXExpressionContainer') return undefined\n return readStaticSelectObjectValue((attribute.value as JSXExpressionContainerNode).expression)\n}\n\nfunction readJsxStaticAttribute(openingElement: JSXOpeningElementNode, name: string): string | undefined {\n return readJsxAttributeValue(findJsxAttribute(openingElement, name))\n}\n\nfunction readJsxStaticNumber(openingElement: JSXOpeningElementNode, name: string): number | undefined {\n const attribute = findJsxAttribute(openingElement, name)\n if (!attribute?.value || attribute.value.type !== 'JSXExpressionContainer') return undefined\n const expression = (attribute.value as JSXExpressionContainerNode).expression\n return expression.type === 'NumericLiteral' ? (expression as NumericLiteralNode).value : undefined\n}\n\nfunction findJsxAttribute(openingElement: JSXOpeningElementNode, name: string): JSXAttributeNode | undefined {\n return openingElement.attributes.find((attribute) => {\n return isJsxAttribute(attribute) && attribute.name.name === name\n }) as JSXAttributeNode | undefined\n}\n\nfunction readJsxAttributeValue(attribute: JSXAttributeNode | undefined): string | undefined {\n if (!attribute?.value) return undefined\n\n if (attribute.value.type === 'StringLiteral') {\n return (attribute.value as StringLiteralNode).value\n }\n\n if (attribute.value.type === 'JSXExpressionContainer') {\n return readStaticString((attribute.value as JSXExpressionContainerNode).expression)\n }\n\n return undefined\n}\n\nfunction readJsxName(node: SourceNode): string | undefined {\n return node.type === 'JSXIdentifier' ? (node as JSXIdentifierNode).name : undefined\n}\n\nfunction readStaticString(node: SourceNode): string | undefined {\n if (node.type === 'StringLiteral') {\n return (node as StringLiteralNode).value\n }\n\n if (node.type === 'TemplateLiteral') {\n const template = node as TemplateLiteralNode\n if (template.expressions.length === 0 && template.quasis.length === 1) {\n return template.quasis[0]!.value.cooked ?? template.quasis[0]!.value.raw\n }\n }\n\n return undefined\n}\n\nfunction readPropertyKey(node: SourceNode): string | undefined {\n if (isIdentifier(node)) return node.name\n if (node.type === 'StringLiteral') return (node as StringLiteralNode).value\n return undefined\n}\n\nfunction isImportDeclaration(node: SourceNode): node is ImportDeclarationNode {\n return node.type === 'ImportDeclaration'\n}\n\nfunction isImportSpecifier(node: SourceNode): node is ImportSpecifierNode {\n return node.type === 'ImportSpecifier'\n}\n\nfunction isVariableDeclarator(node: SourceNode): node is VariableDeclaratorNode {\n return node.type === 'VariableDeclarator'\n}\n\nfunction isObjectPattern(node: SourceNode): node is ObjectPatternNode {\n return node.type === 'ObjectPattern'\n}\n\nfunction isObjectExpression(node: SourceNode): node is ObjectExpressionNode {\n return node.type === 'ObjectExpression'\n}\n\nfunction isObjectProperty(node: SourceNode): node is ObjectPropertyNode {\n return node.type === 'ObjectProperty'\n}\n\nfunction isCallExpression(node: SourceNode): node is CallExpressionNode {\n return node.type === 'CallExpression'\n}\n\nfunction isMemberExpression(node: SourceNode): node is MemberExpressionNode {\n return node.type === 'MemberExpression'\n}\n\nfunction isIdentifier(node: SourceNode | undefined | null): node is IdentifierNode {\n return node?.type === 'Identifier'\n}\n\nfunction isJsxElement(node: SourceNode): node is JSXElementNode {\n return node.type === 'JSXElement'\n}\n\nfunction isJsxAttribute(node: SourceNode): node is JSXAttributeNode {\n return node.type === 'JSXAttribute'\n}\n\nfunction readImportedName(specifier: ImportSpecifierNode): string | undefined {\n const imported = specifier.imported\n if (imported.type === 'Identifier') return imported.name\n if (imported.type === 'StringLiteral') return imported.value\n return undefined\n}\n\n/**\n * Inject the catalog import statement at the top of the module.\n */\nexport function injectCatalogImport(code: string, strategy: 'dynamic' | 'static' | 'per-route', hashes: Set<string>): string {\n if (strategy === 'dynamic') {\n return `import { __catalog } from 'virtual:fluenti/runtime';\\n${code}`\n }\n\n if (strategy === 'per-route') {\n return `import { __catalog } from 'virtual:fluenti/route-runtime';\\n${code}`\n }\n\n // Static: import named exports directly\n const imports = [...hashes].map((id) => `_${hashMessage(id)}`).join(', ')\n return `import { ${imports} } from 'virtual:fluenti/messages';\\n${code}`\n}\n","/**\n * Virtual module resolution for code-splitting mode.\n *\n * Provides:\n * - virtual:fluenti/runtime → reactive catalog + switchLocale + preloadLocale\n * - virtual:fluenti/messages → re-export from static locale (for static strategy)\n * - virtual:fluenti/catalog → dev-mode single-object catalog (existing behavior)\n */\n\nimport { resolve } from 'node:path'\n\nconst VIRTUAL_RUNTIME = 'virtual:fluenti/runtime'\nconst VIRTUAL_MESSAGES = 'virtual:fluenti/messages'\nconst VIRTUAL_ROUTE_RUNTIME = 'virtual:fluenti/route-runtime'\nconst RESOLVED_RUNTIME = '\\0virtual:fluenti/runtime'\nconst RESOLVED_MESSAGES = '\\0virtual:fluenti/messages'\nconst RESOLVED_ROUTE_RUNTIME = '\\0virtual:fluenti/route-runtime'\n\nexport interface VirtualModuleOptions {\n catalogDir: string\n locales: string[]\n sourceLocale: string\n defaultBuildLocale: string\n framework: 'vue' | 'solid' | 'react'\n}\n\nexport function resolveVirtualSplitId(id: string): string | undefined {\n if (id === VIRTUAL_RUNTIME) return RESOLVED_RUNTIME\n if (id === VIRTUAL_MESSAGES) return RESOLVED_MESSAGES\n if (id === VIRTUAL_ROUTE_RUNTIME) return RESOLVED_ROUTE_RUNTIME\n return undefined\n}\n\nexport function loadVirtualSplitModule(\n id: string,\n options: VirtualModuleOptions,\n): string | undefined {\n if (id === RESOLVED_RUNTIME) {\n return generateRuntimeModule(options)\n }\n if (id === RESOLVED_MESSAGES) {\n return generateStaticMessagesModule(options)\n }\n if (id === RESOLVED_ROUTE_RUNTIME) {\n return generateRouteRuntimeModule(options)\n }\n return undefined\n}\n\nfunction generateRuntimeModule(options: VirtualModuleOptions): string {\n const { catalogDir, locales, sourceLocale, defaultBuildLocale, framework } = options\n const defaultLocale = defaultBuildLocale || sourceLocale\n const absoluteCatalogDir = resolve(process.cwd(), catalogDir)\n const runtimeKey = `fluenti.runtime.${framework}`\n const lazyLocales = locales.filter((locale) => locale !== defaultLocale)\n\n if (framework === 'react') {\n // React uses I18nProvider for state management, so the virtual runtime\n // module just provides a simple mutable object + async loaders.\n return `\nimport __defaultMsgs from '${absoluteCatalogDir}/${defaultLocale}.js'\n\nconst __catalog = { ...__defaultMsgs }\nlet __currentLocale = '${defaultLocale}'\nconst __loadedLocales = new Set(['${defaultLocale}'])\nlet __loading = false\nconst __cache = new Map()\nconst __normalizeMessages = (mod) => mod.default ?? mod\n\nconst __loaders = {\n${lazyLocales.map((l) => ` '${l}': () => import('${absoluteCatalogDir}/${l}.js'),`).join('\\n')}\n}\n\nasync function __switchLocale(locale) {\n if (__loadedLocales.has(locale)) {\n Object.assign(__catalog, __cache.get(locale) || __defaultMsgs)\n __currentLocale = locale\n return\n }\n __loading = true\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n Object.assign(__catalog, mod)\n __currentLocale = locale\n } finally {\n __loading = false\n }\n}\n\nasync function __preloadLocale(locale) {\n if (__loadedLocales.has(locale) || !__loaders[locale]) return\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n } catch {}\n}\n\nglobalThis[Symbol.for('${runtimeKey}')] = { __switchLocale, __preloadLocale }\n\nexport { __catalog, __switchLocale, __preloadLocale, __currentLocale, __loading, __loadedLocales }\n`\n }\n\n if (framework === 'vue') {\n return `\nimport { shallowReactive, triggerRef, ref } from 'vue'\nimport __defaultMsgs from '${absoluteCatalogDir}/${defaultLocale}.js'\n\nconst __catalog = shallowReactive({ ...__defaultMsgs })\nconst __currentLocale = ref('${defaultLocale}')\nconst __loadedLocales = new Set(['${defaultLocale}'])\nconst __loading = ref(false)\nconst __cache = new Map()\nconst __normalizeMessages = (mod) => mod.default ?? mod\n\nconst __loaders = {\n${lazyLocales.map((l) => ` '${l}': () => import('${absoluteCatalogDir}/${l}.js'),`).join('\\n')}\n}\n\nasync function __switchLocale(locale) {\n if (__loadedLocales.has(locale)) {\n Object.assign(__catalog, __cache.get(locale) || __defaultMsgs)\n __currentLocale.value = locale\n return\n }\n __loading.value = true\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n Object.assign(__catalog, mod)\n __currentLocale.value = locale\n } finally {\n __loading.value = false\n }\n}\n\nasync function __preloadLocale(locale) {\n if (__loadedLocales.has(locale) || !__loaders[locale]) return\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n } catch {}\n}\n\nglobalThis[Symbol.for('${runtimeKey}')] = { __switchLocale, __preloadLocale }\n\nexport { __catalog, __switchLocale, __preloadLocale, __currentLocale, __loading, __loadedLocales }\n`\n }\n\n // Solid\n return `\nimport { createSignal } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport __defaultMsgs from '${absoluteCatalogDir}/${defaultLocale}.js'\n\nconst [__catalog, __setCatalog] = createStore({ ...__defaultMsgs })\nconst [__currentLocale, __setCurrentLocale] = createSignal('${defaultLocale}')\nconst __loadedLocales = new Set(['${defaultLocale}'])\nconst [__loading, __setLoading] = createSignal(false)\nconst __cache = new Map()\nconst __normalizeMessages = (mod) => mod.default ?? mod\n\nconst __loaders = {\n${lazyLocales.map((l) => ` '${l}': () => import('${absoluteCatalogDir}/${l}.js'),`).join('\\n')}\n}\n\nasync function __switchLocale(locale) {\n if (__loadedLocales.has(locale)) {\n __setCatalog(reconcile(__cache.get(locale) || __defaultMsgs))\n __setCurrentLocale(locale)\n return\n }\n __setLoading(true)\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n __setCatalog(reconcile(mod))\n __setCurrentLocale(locale)\n } finally {\n __setLoading(false)\n }\n}\n\nasync function __preloadLocale(locale) {\n if (__loadedLocales.has(locale) || !__loaders[locale]) return\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n } catch {}\n}\n\nglobalThis[Symbol.for('${runtimeKey}')] = { __switchLocale, __preloadLocale }\n\nexport { __catalog, __switchLocale, __preloadLocale, __currentLocale, __loading, __loadedLocales }\n`\n}\n\nfunction generateStaticMessagesModule(options: VirtualModuleOptions): string {\n const { catalogDir, defaultBuildLocale, sourceLocale } = options\n const defaultLocale = defaultBuildLocale || sourceLocale\n const absoluteCatalogDir = resolve(process.cwd(), catalogDir)\n\n return `export * from '${absoluteCatalogDir}/${defaultLocale}.js'\\n`\n}\n\n/**\n * Generate the route runtime module for per-route splitting.\n *\n * At transform time, this module serves as the import target for `__catalog`.\n * It imports ALL messages from the default locale (same as 'dynamic') so the\n * build completes. The actual per-route chunk partitioning happens in\n * `generateBundle` which emits smaller chunk files and rewrites imports.\n *\n * At runtime, the module provides:\n * - `__catalog`: reactive object holding current locale messages\n * - `__switchLocale(locale)`: loads all route chunks for the new locale\n * - `__loadRoute(routeId, locale)`: loads a single route chunk\n * - `__currentLocale`, `__loading`, `__loadedLocales`: state refs\n */\nexport function generateRouteRuntimeModule(options: VirtualModuleOptions): string {\n const { catalogDir, locales, sourceLocale, defaultBuildLocale, framework } = options\n const defaultLocale = defaultBuildLocale || sourceLocale\n const absoluteCatalogDir = resolve(process.cwd(), catalogDir)\n const runtimeKey = `fluenti.runtime.${framework}`\n const lazyLocales = locales.filter((locale) => locale !== defaultLocale)\n\n if (framework === 'vue') {\n return `\nimport { shallowReactive, ref } from 'vue'\nimport __defaultMsgs from '${absoluteCatalogDir}/${defaultLocale}.js'\n\nconst __catalog = shallowReactive({ ...__defaultMsgs })\nconst __currentLocale = ref('${defaultLocale}')\nconst __loadedLocales = new Set(['${defaultLocale}'])\nconst __loading = ref(false)\nconst __cache = new Map()\nconst __loadedRoutes = new Set()\nconst __normalizeMessages = (mod) => mod.default ?? mod\n\nconst __loaders = {\n${lazyLocales.map((l) => ` '${l}': () => import('${absoluteCatalogDir}/${l}.js'),`).join('\\n')}\n}\n\nconst __routeLoaders = {}\n\nfunction __registerRouteLoader(routeId, locale, loader) {\n const key = routeId + ':' + locale\n __routeLoaders[key] = loader\n}\n\nasync function __loadRoute(routeId, locale) {\n const key = routeId + ':' + (locale || __currentLocale.value)\n if (__loadedRoutes.has(key)) return\n const loader = __routeLoaders[key]\n if (!loader) return\n const mod = __normalizeMessages(await loader())\n Object.assign(__catalog, mod)\n __loadedRoutes.add(key)\n}\n\nasync function __switchLocale(locale) {\n if (locale === __currentLocale.value) return\n __loading.value = true\n try {\n if (__cache.has(locale)) {\n Object.assign(__catalog, __cache.get(locale))\n } else {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n Object.assign(__catalog, mod)\n }\n __loadedLocales.add(locale)\n __currentLocale.value = locale\n } finally {\n __loading.value = false\n }\n}\n\nasync function __preloadLocale(locale) {\n if (__cache.has(locale) || !__loaders[locale]) return\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n } catch {}\n}\n\nglobalThis[Symbol.for('${runtimeKey}')] = { __switchLocale, __preloadLocale }\n\nexport { __catalog, __switchLocale, __preloadLocale, __loadRoute, __registerRouteLoader, __currentLocale, __loading, __loadedLocales }\n`\n }\n\n // Solid\n return `\nimport { createSignal } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport __defaultMsgs from '${absoluteCatalogDir}/${defaultLocale}.js'\n\nconst [__catalog, __setCatalog] = createStore({ ...__defaultMsgs })\nconst [__currentLocale, __setCurrentLocale] = createSignal('${defaultLocale}')\nconst __loadedLocales = new Set(['${defaultLocale}'])\nconst [__loading, __setLoading] = createSignal(false)\nconst __cache = new Map()\nconst __loadedRoutes = new Set()\nconst __normalizeMessages = (mod) => mod.default ?? mod\n\nconst __loaders = {\n${lazyLocales.map((l) => ` '${l}': () => import('${absoluteCatalogDir}/${l}.js'),`).join('\\n')}\n}\n\nconst __routeLoaders = {}\n\nfunction __registerRouteLoader(routeId, locale, loader) {\n const key = routeId + ':' + locale\n __routeLoaders[key] = loader\n}\n\nasync function __loadRoute(routeId, locale) {\n const key = routeId + ':' + (locale || __currentLocale())\n if (__loadedRoutes.has(key)) return\n const loader = __routeLoaders[key]\n if (!loader) return\n const mod = __normalizeMessages(await loader())\n __setCatalog(reconcile({ ...__catalog, ...mod }))\n __loadedRoutes.add(key)\n}\n\nasync function __switchLocale(locale) {\n if (locale === __currentLocale()) return\n __setLoading(true)\n try {\n if (__cache.has(locale)) {\n __setCatalog(reconcile(__cache.get(locale)))\n } else {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __setCatalog(reconcile(mod))\n }\n __loadedLocales.add(locale)\n __setCurrentLocale(locale)\n } finally {\n __setLoading(false)\n }\n}\n\nasync function __preloadLocale(locale) {\n if (__cache.has(locale) || !__loaders[locale]) return\n try {\n const mod = __normalizeMessages(await __loaders[locale]())\n __cache.set(locale, mod)\n __loadedLocales.add(locale)\n } catch {}\n}\n\nglobalThis[Symbol.for('${runtimeKey}')] = { __switchLocale, __preloadLocale }\n\nexport { __catalog, __switchLocale, __preloadLocale, __loadRoute, __registerRouteLoader, __currentLocale, __loading, __loadedLocales }\n`\n }\n","/**\n * Utilities for per-route message splitting.\n *\n * - deriveRouteName: strips hash/dir/ext from chunk filenames to produce stable route IDs\n * - parseCompiledCatalog: extracts Map<hash, exportLine> from compiled catalog source\n * - readCatalogSource: reads compiled catalog file from disk\n */\n\nimport { readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { hashMessage } from '@fluenti/core'\n\n/**\n * Derive a stable route name from a Rollup chunk filename.\n *\n * Examples:\n * 'assets/index-abc123.js' → 'index'\n * 'assets/about-def456.js' → 'about'\n * 'pages/settings-g7h8.js' → 'settings'\n * 'index.js' → 'index'\n */\nexport function deriveRouteName(chunkFileName: string): string {\n // Strip directory prefix\n const base = chunkFileName.includes('/')\n ? chunkFileName.slice(chunkFileName.lastIndexOf('/') + 1)\n : chunkFileName\n\n // Strip extension\n const withoutExt = base.replace(/\\.[^.]+$/, '')\n\n // Strip trailing hash (e.g., 'index-abc123' → 'index')\n // Hash pattern: dash followed by alphanumeric chars at end\n const withoutHash = withoutExt.replace(/-[a-zA-Z0-9]{4,}$/, '')\n\n return withoutHash || withoutExt\n}\n\n/**\n * Parse a compiled catalog source and extract named exports by hash.\n *\n * The CLI outputs lines like:\n * export const _abc123 = \"Hello\"\n * export const _def456 = (v) => `Hello ${v.name}`\n *\n * Returns a Map from hash (without underscore prefix) to the full export line.\n */\nexport function parseCompiledCatalog(source: string): Map<string, string> {\n const exports = new Map<string, string>()\n\n // Match lines: export const _<hash> = <anything until end of statement>\n // Handles multi-line arrow functions by tracking balanced braces\n const lines = source.split('\\n')\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!\n const match = line.match(/^(?:\\/\\*.*?\\*\\/\\s*)?export\\s+const\\s+_([a-z0-9]+)\\s*=\\s*/)\n if (!match) continue\n\n const hash = match[1]!\n\n // Collect the full statement — may span multiple lines if it contains template literals or functions\n let statement = line\n let braceDepth = 0\n let parenDepth = 0\n let templateDepth = 0\n\n for (const ch of line.slice(match[0].length)) {\n if (ch === '{') braceDepth++\n if (ch === '}') braceDepth--\n if (ch === '(') parenDepth++\n if (ch === ')') parenDepth--\n if (ch === '`') templateDepth = templateDepth === 0 ? 1 : 0\n }\n\n while ((braceDepth > 0 || parenDepth > 0 || templateDepth > 0) && i + 1 < lines.length) {\n i++\n const nextLine = lines[i]!\n statement += '\\n' + nextLine\n for (const ch of nextLine) {\n if (ch === '{') braceDepth++\n if (ch === '}') braceDepth--\n if (ch === '(') parenDepth++\n if (ch === ')') parenDepth--\n if (ch === '`') templateDepth = templateDepth === 0 ? 1 : 0\n }\n }\n\n exports.set(hash, statement)\n }\n\n return exports\n}\n\n/**\n * Build a JS module that re-exports only the specified hashes from a catalog.\n *\n * Given hashes ['abc', 'def'] and catalog exports, produces:\n * export const _abc = \"Hello\"\n * export const _def = (v) => `Hi ${v.name}`\n */\nexport function buildChunkModule(\n catalogIds: ReadonlySet<string>,\n catalogExports: Map<string, string>,\n): string {\n const lines: string[] = []\n const defaultEntries: string[] = []\n\n for (const catalogId of catalogIds) {\n const exportHash = hashMessage(catalogId)\n const exportLine = catalogExports.get(exportHash)\n if (exportLine) {\n lines.push(exportLine)\n defaultEntries.push(` '${escapeStringLiteral(catalogId)}': _${exportHash},`)\n }\n }\n\n if (defaultEntries.length > 0) {\n lines.push('', 'export default {', ...defaultEntries, '}')\n }\n\n return lines.join('\\n') + '\\n'\n}\n\n/**\n * Read a compiled catalog file from disk.\n * Returns the source string, or undefined if the file doesn't exist.\n */\nexport function readCatalogSource(catalogDir: string, locale: string): string | undefined {\n try {\n return readFileSync(resolve(catalogDir, `${locale}.js`), 'utf-8')\n } catch {\n return undefined\n }\n}\n\nfunction escapeStringLiteral(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\r/g, '\\\\r')\n .replace(/\\n/g, '\\\\n')\n}\n","export function detectFramework(id: string, code: string): 'vue' | 'solid' | 'react' {\n if (id.endsWith('.vue')) return 'vue'\n if (code.includes('@fluenti/solid') || code.includes('solid-js') || code.includes('createSignal') || code.includes('createMemo')) {\n return 'solid'\n }\n if (code.includes('@fluenti/react') || code.includes('react') || code.includes('useState') || code.includes('useEffect') || code.includes('jsx')) {\n return 'react'\n }\n return 'vue'\n}\n","// ─── SFC pre-transform fallback for v-t ──────────────────────────────────────\n// Used when the nodeTransform can't be injected into @vitejs/plugin-vue\n\nimport { hashMessage } from '@fluenti/core'\n\nfunction escapeSingleQuotedString(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction buildDescriptorExpression(\n message: string,\n options?: {\n id?: string | undefined\n context?: string | undefined\n },\n): string {\n const id = options?.id ?? hashMessage(message, options?.context)\n return `{ id: '${escapeSingleQuotedString(id)}', message: '${escapeSingleQuotedString(message)}' }`\n}\n\nexport function transformVtDirectives(sfc: string): string {\n const tmplOpen = sfc.match(/<template(\\s[^>]*)?>/)\n if (!tmplOpen) return sfc\n\n const tmplStart = tmplOpen.index! + tmplOpen[0].length\n const tmplCloseIdx = sfc.lastIndexOf('</template>')\n if (tmplCloseIdx < 0) return sfc\n\n const beforeTemplate = sfc.slice(0, tmplStart)\n let template = sfc.slice(tmplStart, tmplCloseIdx)\n const afterTemplate = sfc.slice(tmplCloseIdx)\n\n const hasVt = /\\bv-t\\b/.test(template)\n const hasTrans = /<Trans[\\s>]/.test(template)\n const hasPlural = /<Plural[\\s/>]/.test(template)\n\n if (!hasVt && !hasTrans && !hasPlural) return sfc\n\n if (hasVt) {\n template = transformVtAttribute(template)\n template = transformVtContent(template)\n }\n if (hasTrans) {\n template = transformTransSFC(template)\n }\n if (hasPlural) {\n template = transformPluralSFC(template)\n }\n\n return beforeTemplate + template + afterTemplate\n}\n\nfunction transformVtAttribute(template: string): string {\n const vtAttrRegex = /<(\\w+)(\\s[^>]*?)\\bv-t\\.(\\w+)\\b([^>]*?)>/g\n\n return template.replace(vtAttrRegex, (_match, tag: string, before: string, attrName: string, after: string) => {\n if (attrName === 'plural') return _match\n\n const allAttrs = before + after\n const attrRegex = new RegExp(`\\\\b${attrName}=\"([^\"]*)\"`)\n const attrMatch = allAttrs.match(attrRegex)\n if (!attrMatch) return _match\n\n const attrValue = attrMatch[1]!\n const descriptor = buildDescriptorExpression(attrValue)\n\n let newBefore = before.replace(/\\s*\\bv-t\\.\\w+\\b/, '')\n let newAfter = after.replace(/\\s*\\bv-t\\.\\w+\\b/, '')\n\n const staticAttrPattern = new RegExp(`\\\\s*\\\\b${attrName}=\"[^\"]*\"`)\n newBefore = newBefore.replace(staticAttrPattern, '')\n newAfter = newAfter.replace(staticAttrPattern, '')\n\n return `<${tag}${newBefore} :${attrName}=\"$t(${descriptor})\"${newAfter}>`\n })\n}\n\n/**\n * Extract `{{ expr }}` interpolations from v-t content.\n * Returns the message with ICU `{var}` placeholders and a list of variable entries.\n */\nfunction extractTemplateVars(content: string): { message: string; vars: string[] } {\n const vars: string[] = []\n const message = content.replace(/\\{\\{\\s*([^}]+?)\\s*\\}\\}/g, (_m, expr: string) => {\n const trimmed = expr.trim()\n // Strategy B: simple ident → {name}, property → {lastSegment}, complex → {0}\n let varName: string\n if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(trimmed)) {\n varName = trimmed\n } else if (/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(trimmed) && !trimmed.endsWith('.')) {\n const parts = trimmed.split('.')\n varName = parts[parts.length - 1]!\n } else {\n varName = String(vars.length)\n }\n vars.push(`${varName}: ${trimmed}`)\n return `{${varName}}`\n })\n return { message, vars }\n}\n\nfunction transformVtContent(template: string): string {\n const vtContentRegex = /<(\\w+)(\\s[^>]*?)\\bv-t(?::([a-zA-Z0-9_.]+))?(?:\\.plural)?(?:=\"([^\"]*)\")?\\b([^>]*)>([\\s\\S]*?)<\\/\\1>/g\n\n return template.replace(vtContentRegex, (_match, tag: string, before: string, explicitId: string | undefined, bindExpr: string | undefined, after: string, content: string) => {\n const isPlural = _match.includes('v-t.plural')\n\n let cleanBefore = before.replace(/\\s*\\bv-t(?::[a-zA-Z0-9_.]+)?(?:\\.plural)?(?:=\"[^\"]*\")?\\b/, '')\n let cleanAfter = after.replace(/\\s*\\bv-t(?::[a-zA-Z0-9_.]+)?(?:\\.plural)?(?:=\"[^\"]*\")?\\b/, '')\n\n if (isPlural && bindExpr) {\n const forms = content.trim().split('|').map((s: string) => s.trim())\n const categories = forms.length === 2\n ? ['one', 'other']\n : ['one', 'other', 'zero', 'few', 'many'].slice(0, forms.length)\n const icuParts = categories.map((cat, i) => `${cat} {${forms[i] ?? ''}}`)\n const icuMessage = `{${bindExpr}, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, { id: explicitId })\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}, { ${bindExpr} }) }}</${tag}>`\n }\n\n const rawContent = content.trim()\n\n // Check for child HTML elements → rich text with $vtRich\n const childElementRegex = /<(\\w+)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/g\n if (childElementRegex.test(rawContent)) {\n const elements: Array<{ tag: string; attrs: Record<string, string> }> = []\n let elemIdx = 0\n const richMessage = rawContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, attrStr: string, innerContent: string) => {\n const idx = elemIdx++\n const attrs: Record<string, string> = {}\n const attrRegex = /(\\w+)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(attrStr)) !== null) {\n attrs[attrMatch[1]!] = attrMatch[2]!\n }\n elements.push({ tag: childTag, attrs })\n return `<${idx}>${innerContent}</${idx}>`\n },\n )\n const descriptor = buildDescriptorExpression(richMessage, { id: explicitId })\n // Build elements as JS array literal to avoid JSON quote conflicts with v-html=\"...\"\n const elemEntries = elements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${tag}${cleanBefore}${cleanAfter} v-html=\"$vtRich(${descriptor}, ${elementsLiteral})\"></${tag}>`\n }\n\n const { message, vars } = extractTemplateVars(rawContent)\n const descriptor = buildDescriptorExpression(message, { id: explicitId })\n\n if (vars.length > 0) {\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}, { ${vars.join(', ')} }) }}</${tag}>`\n }\n\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}) }}</${tag}>`\n })\n}\n\n// ─── <Trans> SFC pre-transform ────────────────────────────────────────────────\n\nfunction transformTransSFC(template: string): string {\n // Match <Trans ...>content</Trans> — skip those with a `message` prop (old API)\n const transRegex = /<Trans(\\s[^>]*)?>(?!\\s*$)([\\s\\S]*?)<\\/Trans>/g\n\n return template.replace(transRegex, (_match, attrStr: string | undefined, content: string) => {\n const attrs = attrStr ?? ''\n\n // If <Trans> has a `message` prop, don't transform (old API)\n if (/\\bmessage\\s*=/.test(attrs)) return _match\n\n const explicitId = readStaticSfcAttr(attrs, 'id')\n if (explicitId.kind === 'dynamic') return _match\n\n const context = readStaticSfcAttr(attrs, 'context')\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n // Remove Trans-only props from the generated DOM element.\n const cleanAttrs = attrs\n .replace(/\\s*\\btag\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n\n const rawContent = content.trim()\n\n // Check for child HTML elements → rich text with $vtRich\n const childElementRegex = /<(\\w+)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/g\n if (childElementRegex.test(rawContent)) {\n const elements: Array<{ tag: string; attrs: Record<string, string> }> = []\n let elemIdx = 0\n const richMessage = rawContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, childAttrStr: string, innerContent: string) => {\n const idx = elemIdx++\n const childAttrs: Record<string, string> = {}\n const attrRegex = /(\\w[\\w-]*)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(childAttrStr)) !== null) {\n childAttrs[attrMatch[1]!] = attrMatch[2]!\n }\n elements.push({ tag: childTag, attrs: childAttrs })\n return `<${idx}>${innerContent}</${idx}>`\n },\n )\n const descriptor = buildDescriptorExpression(richMessage, {\n id: explicitId.value,\n context: context.value,\n })\n const elemEntries = elements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${wrapperTag}${cleanAttrs} v-html=\"$vtRich(${descriptor}, ${elementsLiteral})\"></${wrapperTag}>`\n }\n\n // Plain text\n const descriptor = buildDescriptorExpression(rawContent, {\n id: explicitId.value,\n context: context.value,\n })\n return `<${wrapperTag}${cleanAttrs}>{{ $t(${descriptor}) }}</${wrapperTag}>`\n })\n}\n\n// ─── <Plural> SFC pre-transform ──────────────────────────────────────────────\n\nfunction transformPluralSFC(template: string): string {\n // First handle <Plural> with template slot children (rich text)\n const pluralSlotRegex = /<Plural(\\s[^>]*?)>([\\s\\S]*?)<\\/Plural>/g\n template = template.replace(pluralSlotRegex, (_match, attrStr: string, content: string) => {\n const attrs = attrStr ?? ''\n const explicitId = readStaticSfcAttr(attrs, 'id')\n const context = readStaticSfcAttr(attrs, 'context')\n if (explicitId.kind === 'dynamic') return _match\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Check if content has template slots\n const templateSlotRegex = /<template\\s+#(\\w+)\\s*>([\\s\\S]*?)<\\/template>/g\n const slots: Array<{ cat: string; content: string }> = []\n let slotMatch\n while ((slotMatch = templateSlotRegex.exec(content)) !== null) {\n slots.push({ cat: slotMatch[1]!, content: slotMatch[2]!.trim() })\n }\n\n if (slots.length === 0) return _match\n\n // Extract :value binding\n const valueMatch = attrs.match(/:value\\s*=\\s*\"([^\"]*)\"/)\n if (!valueMatch) return _match\n const valueExpr = valueMatch[1]!\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n const PLURAL_CATS = ['zero', 'one', 'two', 'few', 'many', 'other'] as const\n const allElements: Array<{ tag: string; attrs: Record<string, string> }> = []\n const icuParts: string[] = []\n\n for (const cat of PLURAL_CATS) {\n const slot = slots.find(s => s.cat === cat)\n if (!slot) continue\n\n const slotContent = slot.content\n // Check for child HTML elements → rich text\n const childElementRegex = /<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g\n let branchMessage = slotContent\n\n if (childElementRegex.test(slotContent)) {\n const baseIndex = allElements.length\n let elemIdx = 0\n branchMessage = slotContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, childAttrStr: string, innerContent: string) => {\n const globalIdx = baseIndex + elemIdx++\n const childAttrs: Record<string, string> = {}\n const attrRegex = /(\\w[\\w-]*)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(childAttrStr)) !== null) {\n childAttrs[attrMatch[1]!] = attrMatch[2]!\n }\n allElements.push({ tag: childTag, attrs: childAttrs })\n return `<${globalIdx}>${innerContent}</${globalIdx}>`\n },\n )\n }\n\n const icuKey = cat === 'zero' ? '=0' : cat\n icuParts.push(`${icuKey} {${branchMessage}}`)\n }\n\n if (icuParts.length === 0) return _match\n\n const icuMessage = `{count, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, {\n id: explicitId.value,\n context: context.value,\n })\n\n // Collect remaining attrs (strip Plural-specific ones)\n let cleanAttrs = attrs\n cleanAttrs = cleanAttrs.replace(/:value\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\btag\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s+/g, ' ').trim()\n const attrsPart = cleanAttrs ? ` ${cleanAttrs}` : ''\n\n if (allElements.length > 0) {\n const elemEntries = allElements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${wrapperTag}${attrsPart} v-html=\"$vtRich(${descriptor}, ${elementsLiteral}, { count: ${valueExpr} })\"></${wrapperTag}>`\n }\n\n return `<${wrapperTag}${attrsPart} v-text=\"$t(${descriptor}, { count: ${valueExpr} })\"></${wrapperTag}>`\n })\n\n // Then handle <Plural ... /> (self-closing) or <Plural ...></Plural> without slot content\n const pluralRegex = /<Plural(\\s[^>]*?)\\/?>(?:<\\/Plural>)?/g\n\n return template.replace(pluralRegex, (_match, attrStr: string) => {\n const attrs = attrStr ?? ''\n const explicitId = readStaticSfcAttr(attrs, 'id')\n const context = readStaticSfcAttr(attrs, 'context')\n if (explicitId.kind === 'dynamic') return _match\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Extract :value binding\n const valueMatch = attrs.match(/:value\\s*=\\s*\"([^\"]*)\"/)\n if (!valueMatch) return _match\n const valueExpr = valueMatch[1]!\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n // Extract plural categories\n const PLURAL_CATEGORIES = ['zero', 'one', 'two', 'few', 'many', 'other'] as const\n const icuParts: string[] = []\n\n for (const cat of PLURAL_CATEGORIES) {\n // Match static prop only (not :zero=\"...\")\n const catRegex = new RegExp(`(?<!:)\\\\b${cat}\\\\s*=\\\\s*\"([^\"]*)\"`)\n const catMatch = attrs.match(catRegex)\n if (catMatch) {\n const icuKey = cat === 'zero' ? '=0' : cat\n icuParts.push(`${icuKey} {${catMatch[1]}}`)\n }\n }\n\n if (icuParts.length === 0) return _match\n\n const icuMessage = `{count, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, {\n id: explicitId.value,\n context: context.value,\n })\n\n // Collect remaining attrs (strip Plural-specific ones)\n let cleanAttrs = attrs\n cleanAttrs = cleanAttrs.replace(/:value\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\btag\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n for (const cat of PLURAL_CATEGORIES) {\n cleanAttrs = cleanAttrs.replace(new RegExp(`(?<!:)\\\\b${cat}\\\\s*=\\\\s*\"[^\"]*\"`), '')\n }\n cleanAttrs = cleanAttrs.replace(/\\s+/g, ' ').trim()\n const attrsPart = cleanAttrs ? ` ${cleanAttrs}` : ''\n\n return `<${wrapperTag}${attrsPart} v-text=\"$t(${descriptor}, { count: ${valueExpr} })\"></${wrapperTag}>`\n })\n}\n\ninterface StaticSfcAttrValue {\n kind: 'missing' | 'static' | 'dynamic'\n value?: string\n}\n\nfunction readStaticSfcAttr(attrs: string, name: string): StaticSfcAttrValue {\n if (new RegExp(`(?:^|\\\\s):${name}\\\\s*=`).test(attrs)) {\n return { kind: 'dynamic' }\n }\n\n const match = attrs.match(new RegExp(`\\\\b${name}\\\\s*=\\\\s*\"([^\"]*)\"`))\n if (!match) {\n return { kind: 'missing' }\n }\n\n return {\n kind: 'static',\n value: match[1] ?? '',\n }\n}\n","// Strict transform mode intentionally leaves Solid JSX components untouched.\n// Runtime <Trans> / <Plural> provide the supported behavior without relying on\n// injected module-level i18n accessors.\n\nexport interface SolidJsxTransformResult {\n code: string\n changed: boolean\n}\n\nexport function transformSolidJsx(code: string): SolidJsxTransformResult {\n return { code, changed: false }\n}\n","import type { Plugin } from 'vite'\nimport type { FluentiPluginOptions } from './types'\nimport { setResolvedMode, isBuildMode } from './mode-detect'\nimport { resolve } from 'node:path'\nimport { transformForDynamicSplit, transformForStaticSplit, injectCatalogImport } from './build-transform'\nimport { resolveVirtualSplitId, loadVirtualSplitModule } from './virtual-modules'\nimport { deriveRouteName, parseCompiledCatalog, buildChunkModule, readCatalogSource } from './route-resolve'\nimport { scopeTransform } from './scope-transform'\nimport { transformTransComponents } from './trans-transform'\nimport { detectFramework } from './framework-detect'\nimport { transformVtDirectives } from './sfc-transform'\nimport { transformSolidJsx } from './solid-jsx-transform'\n\nexport type { FluentiPluginOptions } from './types'\n\nconst VIRTUAL_PREFIX = 'virtual:fluenti/messages/'\nconst RESOLVED_PREFIX = '\\0virtual:fluenti/messages/'\ntype InternalSplitStrategy = FluentiPluginOptions['splitting'] | 'per-route'\n\n// ─── Plugin entry ────────────────────────────────────────────────────────────\n\n/** Fluenti Vite plugin */\nexport default function fluentiPlugin(options?: FluentiPluginOptions): Plugin[] {\n const catalogDir = options?.catalogDir ?? 'src/locales/compiled'\n const frameworkOption = options?.framework ?? 'auto'\n const splitting = (options?.splitting as InternalSplitStrategy | undefined) ?? false\n const sourceLocale = options?.sourceLocale ?? 'en'\n const locales = options?.locales ?? [sourceLocale]\n const defaultBuildLocale = options?.defaultBuildLocale ?? sourceLocale\n let detectedFramework: 'vue' | 'solid' | 'react' = 'vue'\n\n const virtualPlugin: Plugin = {\n name: 'fluenti:virtual',\n configResolved(config) {\n setResolvedMode(config.command)\n },\n resolveId(id) {\n if (id.startsWith(VIRTUAL_PREFIX)) {\n return '\\0' + id\n }\n // Handle split-mode virtual modules\n if (splitting) {\n const resolved = resolveVirtualSplitId(id)\n if (resolved) return resolved\n }\n return undefined\n },\n load(id) {\n if (id.startsWith(RESOLVED_PREFIX)) {\n const locale = id.slice(RESOLVED_PREFIX.length)\n const catalogPath = `${catalogDir}/${locale}.js`\n return `export { default } from '${catalogPath}'`\n }\n // Handle split-mode virtual modules\n if (splitting) {\n const result = loadVirtualSplitModule(id, {\n catalogDir,\n locales,\n sourceLocale,\n defaultBuildLocale,\n framework: detectedFramework,\n })\n if (result) return result\n }\n return undefined\n },\n }\n\n const vueTemplatePlugin: Plugin = {\n name: 'fluenti:vue-template',\n enforce: 'pre',\n\n // SFC pre-transform: rewrites v-t directives, <Trans>, and <Plural> in <template>\n // before Vue compiler runs. Manual compiler-level transforms are treated as\n // internal implementation details; the supported public path is this plugin.\n transform(code, id) {\n if (!id.endsWith('.vue')) return undefined\n if (!/\\bv-t\\b/.test(code) && !/<Trans[\\s>]/.test(code) && !/<Plural[\\s/>]/.test(code)) return undefined\n\n const transformed = transformVtDirectives(code)\n if (transformed === code) return undefined\n\n return { code: transformed, map: null }\n },\n }\n\n const scriptTransformPlugin: Plugin = {\n name: 'fluenti:script-transform',\n enforce: 'pre',\n transform(code, id) {\n if (id.includes('node_modules')) return undefined\n if (!id.match(/\\.(vue|tsx|jsx|ts|js)(\\?|$)/)) return undefined\n if (id.includes('.vue') && !id.includes('type=script')) return undefined\n\n let result = code\n let changed = false\n\n // ── <Trans> compile-time optimization (JSX/TSX only) ──────────────\n if (id.match(/\\.[jt]sx(\\?|$)/) && /<Trans[\\s>]/.test(result)) {\n const transResult = transformTransComponents(result)\n if (transResult.transformed) {\n result = transResult.code\n changed = true\n }\n }\n\n // ── t`` / t() scope-aware transform ────────────────────────────────\n if (hasScopeTransformCandidate(result)) {\n const framework = frameworkOption === 'auto'\n ? detectFramework(id, result)\n : frameworkOption\n\n const scoped = scopeTransform(result, {\n framework,\n allowTopLevelImportedT: framework === 'vue' && id.includes('.vue'),\n })\n if (scoped.transformed) {\n return { code: scoped.code, map: null }\n }\n }\n\n return changed ? { code: result, map: null } : undefined\n },\n }\n\n // Track module → used hashes for per-route splitting\n const moduleMessages = new Map<string, Set<string>>()\n\n const buildSplitPlugin: Plugin = {\n name: 'fluenti:build-split',\n // No enforce — runs AFTER @vitejs/plugin-vue compiles templates to JavaScript.\n // With enforce: 'pre', this would see raw SFC <template> blocks before Vue\n // compilation, which breaks import injection (imports land outside <script>).\n transform(code, id) {\n if (!splitting) return undefined\n if (!isBuildMode((this as any).environment)) return undefined\n if (id.includes('node_modules')) return undefined\n if (!id.match(/\\.(vue|tsx|jsx|ts|js)(\\?|$)/)) return undefined\n\n // Detect framework for this file\n if (frameworkOption === 'auto') {\n detectedFramework = detectFramework(id, code)\n } else {\n detectedFramework = frameworkOption\n }\n\n // per-route uses the same transform as dynamic ($t → __catalog._hash)\n const strategy = splitting === 'static' ? 'static' : 'dynamic'\n const transformed = strategy === 'static'\n ? transformForStaticSplit(code)\n : transformForDynamicSplit(code)\n\n // Track hashes per module for per-route generateBundle\n if (splitting === 'per-route' && transformed.usedHashes.size > 0) {\n moduleMessages.set(id, transformed.usedHashes)\n }\n\n if (!transformed.needsCatalogImport) return undefined\n\n const importStrategy = splitting === 'per-route' ? 'per-route' : strategy\n const finalCode = injectCatalogImport(transformed.code, importStrategy, transformed.usedHashes)\n return { code: finalCode, map: null }\n },\n\n generateBundle(_outputOptions, bundle) {\n if (splitting !== 'per-route') return\n if (moduleMessages.size === 0) return\n\n // 1. Map chunks → hashes via moduleMessages\n const chunkHashes = new Map<string, Set<string>>()\n for (const [fileName, chunk] of Object.entries(bundle)) {\n if (chunk.type !== 'chunk') continue\n const hashes = new Set<string>()\n for (const moduleId of Object.keys(chunk.modules)) {\n const modHashes = moduleMessages.get(moduleId)\n if (modHashes) {\n for (const h of modHashes) hashes.add(h)\n }\n }\n if (hashes.size > 0) {\n chunkHashes.set(fileName, hashes)\n }\n }\n\n if (chunkHashes.size === 0) return\n\n // 2. Classify: shared (≥2 chunks) vs route-specific (1 chunk)\n const hashToChunks = new Map<string, string[]>()\n for (const [chunkName, hashes] of chunkHashes) {\n for (const h of hashes) {\n const chunks = hashToChunks.get(h) ?? []\n chunks.push(chunkName)\n hashToChunks.set(h, chunks)\n }\n }\n\n const sharedHashes = new Set<string>()\n const routeHashes = new Map<string, Set<string>>()\n\n for (const [hash, chunks] of hashToChunks) {\n if (chunks.length > 1) {\n sharedHashes.add(hash)\n } else {\n const routeName = deriveRouteName(chunks[0]!)\n const existing = routeHashes.get(routeName) ?? new Set()\n existing.add(hash)\n routeHashes.set(routeName, existing)\n }\n }\n\n // 3. Read compiled catalogs and emit chunk files\n const absoluteCatalogDir = resolve(process.cwd(), catalogDir)\n for (const locale of locales) {\n const catalogSource = readCatalogSource(absoluteCatalogDir, locale)\n if (!catalogSource) continue\n const catalogExports = parseCompiledCatalog(catalogSource)\n\n // Emit shared chunk\n if (sharedHashes.size > 0) {\n const sharedCode = buildChunkModule(sharedHashes, catalogExports)\n this.emitFile({\n type: 'asset',\n fileName: `_fluenti/shared-${locale}.js`,\n source: sharedCode,\n })\n }\n\n // Emit per-route chunks\n for (const [routeName, hashes] of routeHashes) {\n const routeCode = buildChunkModule(hashes, catalogExports)\n this.emitFile({\n type: 'asset',\n fileName: `_fluenti/${routeName}-${locale}.js`,\n source: routeCode,\n })\n }\n }\n },\n }\n\n const solidJsxPlugin: Plugin = {\n name: 'fluenti:solid-jsx',\n enforce: 'pre',\n transform(code, id) {\n if (!id.match(/\\.[tj]sx(\\?|$)/)) return undefined\n if (id.includes('node_modules')) return undefined\n if (!/<Trans[\\s>]/.test(code) && !/<Plural[\\s/>]/.test(code)) return undefined\n\n // Only run when framework is solid or auto-detected as solid\n const framework = frameworkOption === 'auto'\n ? detectFramework(id, code)\n : frameworkOption\n if (framework !== 'solid') return undefined\n\n const transformed = transformSolidJsx(code)\n if (!transformed.changed) return undefined\n\n return { code: transformed.code, map: null }\n },\n }\n\n const devPlugin: Plugin = {\n name: 'fluenti:dev',\n configureServer(_server) {\n // server reference available via hotUpdate's `this`\n },\n hotUpdate({ file }) {\n if (file.includes(catalogDir)) {\n const modules = [...this.environment.moduleGraph.urlToModuleMap.entries()]\n .filter(([url]) => url.includes('virtual:fluenti'))\n .map(([, mod]) => mod)\n\n if (modules.length > 0) {\n return modules\n }\n }\n return undefined\n },\n }\n\n return [virtualPlugin, vueTemplatePlugin, solidJsxPlugin, scriptTransformPlugin, buildSplitPlugin, devPlugin]\n}\n\nfunction hasScopeTransformCandidate(code: string): boolean {\n if (/(?<![.\\w$])t\\(\\s*['\"]/.test(code) || /[A-Za-z_$][\\w$]*\\(\\s*\\{/.test(code)) {\n return true\n }\n\n if (/[A-Za-z_$][\\w$]*`/.test(code) && (code.includes('useI18n') || code.includes('getI18n'))) {\n return true\n }\n\n return /import\\s*\\{[^}]*\\bt(?:\\s+as\\s+[A-Za-z_$][\\w$]*)?\\b[^}]*\\}/.test(code)\n && /@fluenti\\/(react|vue|solid|next\\/__generated)/.test(code)\n}\n"],"mappings":"+GAKA,IAAI,EAAgC,MAGpC,SAAgB,EAAgB,EAAuB,CACrD,EAAe,IAAY,QAAU,QAAU,MAajD,SAAgB,EAAY,EAA0C,CAUpE,OARI,GAAa,OAAS,SAGtB,IAAiB,SAGrB,QAAA,IAAA,WAAgC,aCmHlC,SAAgB,EAAyB,EAAoC,CAC3E,OAAO,EAA0B,EAAM,UAAU,CAGnD,SAAgB,EAAwB,EAAoC,CAC1E,OAAO,EAA0B,EAAM,SAAS,CAGlD,SAAS,EACP,EACA,EACsB,CACtB,IAAM,GAAA,EAAA,EAAA,mBAAwB,EAAK,CACnC,GAAI,CAAC,GAAO,EAAI,OAAS,UACvB,MAAO,CAAE,OAAM,mBAAoB,GAAO,WAAY,IAAI,IAAO,CAGnE,IAAM,EAAW,EAA8B,EAAmB,CAC5D,EAAmC,EAAE,CACrC,EAAa,IAAI,IAYvB,IAVA,EAAA,EAAA,eAAc,EAAM,GAAS,CAC3B,IAAM,EAAc,EAAuB,EAAM,EAAM,EAAU,EAAU,EAAW,CACtF,GAAI,EAAa,CACf,EAAa,KAAK,EAAY,CAC9B,OAGF,EAAsB,EAAM,EAAW,EACvC,CAEE,EAAa,SAAW,EAC1B,M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