@noego/forge 0.1.19 → 0.1.21
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/dist/client.cjs +3 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +932 -737
- package/dist/client.mjs.map +1 -1
- package/dist/plugins-cjs/routing/html_render/html_render.js +4 -2
- package/dist/plugins-cjs/routing/html_render/html_render.js.map +1 -1
- package/dist/plugins-es/routing/html_render/html_render.js +4 -2
- package/dist/plugins-es/routing/html_render/html_render.js.map +1 -1
- package/dist/routing/html_render/html_render.js +4 -2
- package/dist/routing/html_render/html_render.js.map +1 -1
- package/dist-ssr/server.cjs +51 -46
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.js +51 -46
- package/dist-ssr/server.js.map +1 -1
- package/dist-ssr/static.cjs +1 -1
- package/dist-ssr/static.js +1 -1
- package/dist-ssr/{url_parser-CCrM2TRM.js → url_parser-BY7Z0l_n.js} +253 -19
- package/dist-ssr/url_parser-BY7Z0l_n.js.map +1 -0
- package/dist-ssr/{url_parser-BWBuKJkA.cjs → url_parser-C-aLYzi3.cjs} +253 -19
- package/dist-ssr/url_parser-C-aLYzi3.cjs.map +1 -0
- package/package.json +2 -1
- package/dist-ssr/url_parser-BWBuKJkA.cjs.map +0 -1
- package/dist-ssr/url_parser-CCrM2TRM.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url_parser-CCrM2TRM.js","sources":["../src/routing/component_loader/component_loader.ts","../src/parser/openapi.ts","../src/routing/component_loader/component_manager.ts","../src/routing/url_parser.ts"],"sourcesContent":["import type { SvelteComponent } from 'svelte';\nimport type { ViteDevServer } from 'vite';\nimport path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { SvelteImport, SvelteModuleComponent } from '../base';\n\n\ntype SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent\n\nexport interface IComponentLoader{\n load(component: string,options?:any): Promise<SvelteResource<SvelteComponent>>\n getComponentFullPath(component: string, options?: any): string\n}\n\n\nexport class BasicComponentLoader implements IComponentLoader {\n private resolvedBasePath: string;\n\n constructor(private basePath: string) {\n // Resolve basePath relative to current working directory\n this.resolvedBasePath = path.isAbsolute(basePath)\n ? basePath\n : path.resolve(process.cwd(), basePath);\n }\n\n async load(componentPath: string) {\n const component_full_path = this.getComponentFullPath(componentPath);\n // Use pathToFileURL for proper ESM import of absolute paths\n const module = await import(pathToFileURL(component_full_path).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.resolvedBasePath, componentPath);\n }\n}\n\n\n\nexport class ViteComponentLoader implements IComponentLoader {\n constructor(private basePath:string, private vite: ViteDevServer) {}\n \n async load(componentPath: string, options = {use_base_path:true}): Promise<SvelteResource<any>> {\n const absoluteComponentPath = this.getComponentFullPath(componentPath, options);\n\n console.log(`[ViteComponentLoader] Loading component from path: ${absoluteComponentPath}`);\n\n // Smart detection: check for precompiled .js file first\n const jsPath = absoluteComponentPath.replace(/\\.svelte$/, '.js');\n const jsExists = fs.existsSync(jsPath);\n\n // TODO: Remove this if we only need svelte files\n if (false && jsExists) {\n // Precompiled .js exists - use it directly (production mode)\n console.log(`[ViteComponentLoader] Found precompiled component at: ${jsPath}`);\n try {\n const module: any = await import(jsPath);\n console.log(`[ViteComponentLoader] Loaded precompiled module successfully`);\n return module as SvelteResource<any>;\n } catch (error) {\n console.error(`[ViteComponentLoader] Error loading precompiled module from ${jsPath}`, error);\n throw error;\n }\n }\n\n // No .js file - fall back to Vite dev mode (.svelte)\n let vitePath = path.relative(process.cwd(), absoluteComponentPath);\n\n vitePath = vitePath.replace(/\\\\/g, '/');\n\n if (!vitePath.startsWith('/')) {\n vitePath = '/' + vitePath;\n }\n\n console.log(`[ViteComponentLoader] Resolved Vite path: ${vitePath} from componentPath: ${componentPath}`);\n\n\n try {\n console.log(`[ViteComponentLoader] Loading module for vitePath: ${vitePath}`);\n const module = await this.vite.ssrLoadModule(vitePath);\n console.log(`[ViteComponentLoader] Module loaded successfully for: ${vitePath}`);\n if (!module || !module.default) {\n console.error(`[ViteComponentLoader] Loaded module for ${vitePath} is invalid or missing a default export. Module content:`, module);\n throw new Error(`Module ${vitePath} loaded successfully but is invalid or missing default export.`);\n }\n return module as SvelteResource<any>;\n } catch (error) {\n console.error(`[ViteComponentLoader] Error loading module for vitePath: ${vitePath} (derived from componentPath: ${componentPath})`, error);\n\n try {\n await fs.promises.access(absoluteComponentPath);\n } catch (fsError) {\n }\n throw error;\n }\n }\n\n getComponentFullPath(componentPath: string, options = {use_base_path:true}): string {\n const use_base_path = options.use_base_path || false;\n\n if (use_base_path) {\n return path.join(this.basePath, componentPath);\n }\n\n if (path.isAbsolute(componentPath)) {\n return componentPath;\n }\n\n return componentPath;\n }\n}\n\n\nexport class ProdComponentLoader implements IComponentLoader {\n\n private componentMapPromise: Promise<Record<string, SvelteResource<any>>> | null = null;\n\n constructor(private base_path: string) {}\n\n async load(componentPath: string): Promise<SvelteResource<any>> {\n const normalized = this.normalizeKey(componentPath);\n\n try {\n const map = await this.loadComponentMap();\n const module = map[normalized];\n if (module) {\n return module;\n }\n } catch (error) {\n console.warn(`[Forge] Failed to load component \"${componentPath}\" from entry manifest:`, error);\n }\n\n const component_path = this.getComponentFullPath(componentPath);\n const fallbackPath = component_path.endsWith('.js')\n ? component_path\n : component_path.replace(/\\.svelte$/, '.js');\n const module: any = await import(pathToFileURL(fallbackPath).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.base_path, componentPath);\n }\n\n private normalizeKey(componentPath: string): string {\n const trimmed = componentPath.replace(/^\\.\\//, '');\n if (trimmed.endsWith('.svelte')) {\n return trimmed.replace(/\\.svelte$/, '.js');\n }\n return trimmed;\n }\n\n private async loadComponentMap(): Promise<Record<string, SvelteResource<any>>> {\n if (!this.componentMapPromise) {\n const entryPath = path.join(this.base_path, 'entry-ssr.js');\n const entryUrl = pathToFileURL(entryPath).href;\n this.componentMapPromise = import(entryUrl)\n .then((mod: any) => {\n const source = mod.components ?? mod.default ?? {};\n const normalized: Record<string, SvelteResource<any>> = {};\n for (const [key, value] of Object.entries<SvelteResource<any>>(source)) {\n const cleanKey = key.replace(/^\\.\\//, '');\n normalized[cleanKey] = value;\n if (cleanKey.startsWith('ui/')) {\n normalized[cleanKey.slice(3)] = value;\n }\n if (cleanKey.endsWith('.svelte')) {\n const jsKey = cleanKey.replace(/\\.svelte$/, '.js');\n normalized[jsKey] = value;\n }\n }\n return normalized;\n })\n .catch((error) => {\n this.componentMapPromise = null;\n throw error;\n });\n }\n return this.componentMapPromise;\n }\n}\n","import yaml from 'js-yaml'\nimport clone from 'clone-deep'\nimport join from 'url-join'\nimport type {IRoute, IServerRoute} from \"./IRoute\"\nimport {parsePathConfig} from \"./path\"\nimport fs from 'fs'\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n 'trace'\n])\n\nfunction getGlobalPathsMiddleware(openapi:any): string[] {\n if (!openapi || !openapi.paths) {\n return []\n }\n const value = openapi.paths['x-middleware']\n return Array.isArray(value) ? [...value] : []\n}\n\nexport function parseConfigfile(file_content:string) {\n let config:any = null\n try {\n config = yaml.load(file_content)\n } catch (e) {\n console.log(e)\n }\n return config\n}\n\n\nexport function parse_modules(openapi:any, inheritedMiddleware: string[] = []){\n const modules_config = (openapi.modules || openapi.module)\n if (!modules_config) {\n return\n }\n\n // Detect format: array (deprecated) vs named object (new)\n const isArrayFormat = Array.isArray(modules_config)\n\n let moduleEntries: Array<{module: any, name: string, isObjectFormat: boolean}>\n\n if (isArrayFormat) {\n // Old array format - backwards compatible, log deprecation warning\n console.warn('[Forge] Deprecation warning: Array format for modules is deprecated. ' +\n 'Please migrate to named object format: modules: { moduleName: { basePath, paths, x-layout } }')\n moduleEntries = modules_config.map((m: any, idx: number) => ({\n module: m,\n name: `module[${idx}]`,\n isObjectFormat: false\n }))\n } else {\n // New named object format - validate like Dinner\n moduleEntries = Object.entries(modules_config).map(([name, module]: [string, any]) => {\n if (!module.basePath) {\n throw new Error(`Module '${name}' is missing required 'basePath' property`)\n }\n if (!module.paths) {\n throw new Error(`Module '${name}' is missing required 'paths' property`)\n }\n return { module, name, isObjectFormat: true }\n })\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const modules_path: (IRoute[] | undefined)[] = moduleEntries.map(({ module, isObjectFormat }) => {\n const basePath = module.basePath || ''\n // Use x-layout for object format, baseLayouts for array format (backwards compat)\n const baseLayouts = isObjectFormat\n ? (module['x-layout'] || [])\n : (module.baseLayouts || [])\n const moduleMiddleware = Array.isArray(module['x-middleware']) ? module['x-middleware'] : []\n const inherited = [...globalMiddleware, ...moduleMiddleware]\n\n const paths = module.paths\n\n if(!paths){\n return\n }\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,inherited)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[])\n\n routes.forEach((route:IRoute) => {\n route.path = join(basePath, route.path)\n route.layout = baseLayouts.concat(route.layout|| [])\n })\n return routes\n })\n\n return modules_path.reduce((flat_config,config)=>{\n if (!config) {\n return flat_config\n }\n return flat_config.concat(config)\n }\n ,[] as IRoute[])\n}\n\n\nexport function parse_paths(openapi:any, inheritedMiddleware: string[] = []){\n const paths = openapi.paths\n if (!paths) {\n return\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,globalMiddleware)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[] as IRoute[])\n\n return routes\n}\n\n\n\n\nexport function transform_openapi_spec(openapi_spec:string) {\n\n const openapi = parseConfigfile(openapi_spec)\n const config = normalize_openapi_config(openapi)\n return yaml.dump(config)\n}\n\n\nexport function normalize_openapi_config(openapi_config:any){\n const config = clone(openapi_config)\n\n const modules = parse_modules(config) || []\n const paths = parse_paths(config) || []\n\n const routes = [...modules, ...paths]\n\n routes.forEach((route:IRoute) => {\n const path = route.path\n const method = route.method\n const config_path = config.paths[path] || {}\n const config_method = config_path[method] || {}\n\n config_method.summary = route.summary\n config_method.description = route.description\n config_method.parameters = route.parameters\n config_method.query = route.query\n config_method.body = route.body\n config_method.responses = route.responses\n config_method['x-view'] = route.view\n config_method['x-layout'] = route.layout\n if (route.middleware && route.middleware.length > 0) {\n config_method['x-middleware'] = route.middleware\n } else {\n delete config_method['x-middleware']\n }\n\n config_path[method] = config_method\n config.paths[path] = config_path\n })\n\n delete config.modules\n return config\n}\n\n\n/**\n * Check if a YAML document is a stitch configuration file\n * @param document The parsed YAML document\n * @returns True if it's a stitch config, false otherwise\n */\nfunction isStitchConfig(document: any): boolean {\n return document && typeof document === 'object' && 'stitch' in document;\n}\n\n/**\n * Check if a YAML document is a regular OpenAPI file\n * @param document The parsed YAML document\n * @returns True if it's a regular OpenAPI file, false otherwise\n */\nfunction isOpenAPIConfig(document: any): boolean {\n return document && typeof document === 'object' && ('paths' in document || 'module' in document || 'modules' in document);\n}\n\nexport async function parse_openapi_config(openapi_config_path:string):Promise<IServerRoute>{\n const content = fs.readFileSync(openapi_config_path, 'utf8')\n const parsed_config = parseConfigfile(content)\n \n let openapi_config: any;\n \n if (isStitchConfig(parsed_config)) {\n // Handle stitch configuration - build using Node.js stitch engine\n console.log('Detected stitch configuration, building with Node.js stitch engine...');\n \n try {\n const { StitchEngine } = await import('@noego/stitch');\n \n const startTime = Date.now();\n const engine = new StitchEngine();\n const result = engine.buildSync(openapi_config_path, { format: 'json' });\n \n if (!result.success) {\n throw new Error(`Stitch build failed: ${result.error}`);\n }\n \n const buildTime = Date.now() - startTime;\n console.log(`INFO Stitch build completed in ${buildTime} ms – ${parsed_config.stitch ? parsed_config.stitch.length : 0} modules processed`);\n \n // Parse the JSON string result to get the JavaScript object\n openapi_config = typeof result.data === 'string' ? JSON.parse(result.data) : result.data;\n } catch (error) {\n throw new Error(`Failed to process stitch configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n } else if (isOpenAPIConfig(parsed_config)) {\n // Handle regular OpenAPI file (legacy path)\n console.log('Detected regular OpenAPI configuration');\n openapi_config = parsed_config;\n } else {\n throw new Error(`Invalid OpenAPI or stitch configuration file: ${openapi_config_path}. File must contain either 'stitch', 'paths', 'module', or 'modules' at the root level.`);\n }\n const globalPathsMiddleware = getGlobalPathsMiddleware(openapi_config)\n\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let fallback_layout = openapi_config['x-fallback-layout'] || null\n let fallback_view = openapi_config['x-fallback-view'] || null\n const fallback_middleware = Array.isArray(openapi_config['x-fallback-middleware'])\n ? [...openapi_config['x-fallback-middleware']]\n : [...globalPathsMiddleware]\n let fallback = {\n layout: fallback_layout ? [fallback_layout]:[],\n view: fallback_view,\n middleware: fallback_middleware\n }\n\n const routes = [...modules, ...paths]\n\n let config = {\n fallback,\n routes\n }\n return config\n}\n\n\nexport function transform_openapi_config(openapi_config:any):IRoute[] {\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let routes = [...modules, ...paths]\n return routes\n}\n","import path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport type { IRoute } from \"../../parser/IRoute\";\nimport type { IComponentLoader } from \"./component_loader\";\n\n\n\n\n\n\nexport class ComponentManager {\n\n constructor(\n private componentLoader: IComponentLoader\n ){\n\n }\n\n async getLayoutComponents(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map((layout)=>{\n console.log(\"layout path\",layout)\n return this.componentLoader.load(layout)}))\n return layouts_components\n }\n\n async getLayouts(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map(async (layout_path)=>{\n const layout = await this.componentLoader.load(layout_path)\n return layout.default\n \n }))\n return layouts_components\n }\n\n async getLayoutLoaders(route:IRoute){\n const layout_paths = route.layout || [];\n \n // First, check for .load.js/.load.ts files using resolveLoader (maintains order)\n // Each loader at index N corresponds to the layout at index N\n const loaders_from_files = await Promise.all(\n layout_paths.map((layoutPath) => this.resolveLoader(layoutPath))\n );\n \n // Check if any need fallback to old-style component.load\n const needs_fallback = loaders_from_files.some(loader => !loader);\n \n if (needs_fallback) {\n // Fall back to old-style component.load for backward compatibility\n const layout_components = await this.getLayoutComponents(route);\n const old_style_loaders = layout_components.map(layout => layout.load);\n \n // Merge: prefer .load.js/.load.ts file loaders, fall back to old-style component.load\n // This maintains order: loader[index] corresponds to layout_paths[index]\n // Only include loaders that are actually functions\n return loaders_from_files.map((loader, index) => {\n const resolved = loader || old_style_loaders[index];\n return typeof resolved === 'function' ? resolved : null;\n });\n }\n \n return loaders_from_files;\n }\n\n\n async getViewComponent(route: IRoute) {\n return await this.componentLoader.load(route.view)\n }\n\n\n async hasLoaders(route:IRoute):Promise<boolean>{\n const componentPaths = [...(route.layout || []), route.view];\n\n for (const componentPath of componentPaths) {\n const loader = await this.resolveLoader(componentPath);\n if (loader) {\n return true;\n }\n }\n\n return false;\n }\n\n\n async getLoaders(route: IRoute) {\n const layoutPaths = route.layout || [];\n const layouts = await Promise.all(layoutPaths.map((layoutPath) => this.resolveLoader(layoutPath)));\n const view = await this.resolveLoader(route.view);\n\n return {\n layouts,\n view\n };\n }\n\n\n private getLoaderFilePath(componentPath?: string | null, extension: '.js' | '.ts' = '.js'): string | null {\n if (!componentPath) {\n return null;\n }\n\n const fullPath = this.componentLoader.getComponentFullPath(componentPath);\n const { dir, name } = path.parse(fullPath);\n return path.join(dir, `${name}.load${extension}`);\n }\n\n\n private async resolveLoader(componentPath?: string | null): Promise<((...args: any[]) => any) | null> {\n if (!componentPath) {\n return null;\n }\n\n // Try .load.js first (production), then .load.ts (development)\n const extensions: Array<'.js' | '.ts'> = ['.js', '.ts'];\n \n for (const ext of extensions) {\n const loaderFilePath = this.getLoaderFilePath(componentPath, ext);\n if (!loaderFilePath) {\n continue;\n }\n\n try {\n console.log(`[ComponentManager] Trying loader path: ${loaderFilePath}`);\n const module = await import(pathToFileURL(loaderFilePath).href);\n const loader = module?.default;\n console.log(`[ComponentManager] Imported loader module: default=${typeof loader}`);\n if (typeof loader === \"function\") {\n console.log(`[ComponentManager] Loaded loader function from: ${loaderFilePath}`);\n return loader;\n }\n } catch (error: any) {\n const code = error?.code || error?.name || 'UNKNOWN_ERROR';\n if (code === \"MODULE_NOT_FOUND\" || code === \"ERR_MODULE_NOT_FOUND\") {\n console.warn(`[ComponentManager] Loader not found at ${loaderFilePath} (${ext}): ${error?.message || code}`);\n // File doesn't exist with this extension, try next one\n continue;\n }\n // Other errors (syntax errors, etc.) should be logged\n console.error(`[ComponentManager] Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);\n // Continue to try next extension\n }\n }\n\n // Neither .load.js nor .load.ts found\n return null;\n }\n\n\n async getView(route: IRoute) {\n const view = await this.componentLoader.load(route.view)\n return view.default\n }\n}\n","import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n if (!result) return null;\n\n // Decode URL-encoded param values\n const decoded: Record<string, string> = {};\n for (const [key, value] of Object.entries(result)) {\n decoded[key] = decodeURIComponent(value as string);\n }\n return decoded;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n"],"names":["path","fs","module"],"mappings":";;;;;;;;;;;AAgBO,MAAM,qBAAiD;AAAA,EAG1D,YAAoB,UAAkB;AAF9B;AAEY,SAAA,WAAA;AAElB,SAAK,mBAAmBA,cAAK,WAAW,QAAQ,IAC5C,WACAA,cAAK,QAAQ,QAAQ,IAAA,GAAO,QAAQ;AAAA,EAC1C;AAAA,EAEA,MAAM,KAAK,eAAuB;AAChC,UAAM,sBAAsB,KAAK,qBAAqB,aAAa;AAEnE,UAAM,SAAS,MAAM,OAAO,cAAc,mBAAmB,EAAE;AAC/D,WAAO;AAAA,EACT;AAAA,EAEA,qBAAqB,eAA+B;AAClD,WAAOA,cAAK,KAAK,KAAK,kBAAkB,aAAa;AAAA,EACvD;AACJ;AAIO,MAAM,oBAAgD;AAAA,EACzD,YAAoB,UAAyB,MAAqB;AAA9C,SAAA,WAAA;AAAyB,SAAA,OAAA;AAAA,EAAsB;AAAA,EAEnE,MAAM,KAAK,eAAuB,UAAU,EAAC,eAAc,QAAqC;AAC5F,UAAM,wBAAwB,KAAK,qBAAqB,eAAe,OAAO;AAE9E,YAAQ,IAAI,sDAAsD,qBAAqB,EAAE;AAGzF,UAAM,SAAS,sBAAsB,QAAQ,aAAa,KAAK;AAC9CC,gBAAG,WAAW,MAAM;AAiBrC,QAAI,WAAWD,cAAK,SAAS,QAAQ,IAAA,GAAO,qBAAqB;AAEjE,eAAW,SAAS,QAAQ,OAAO,GAAG;AAEtC,QAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAC3B,iBAAW,MAAM;AAAA,IACrB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