{"version":3,"file":"no-validator-lite.bundle.cjs","sources":["../src/converter/lite.ts"],"sourcesContent":["import {\n\tENTERPRISE_VENUE_TYPE_VALUES,\n\tLOCATION_STATE_VALUES,\n\tSIBLING_GROUP_TYPE_VALUES,\n\tTEXTURE_FACE_VALUES,\n\tTEXTURE_SURFACE_VALUES,\n\tTEXT_ALIGNMENT_VALUES,\n\tTEXT_AREA_ALIGNMENT_VALUES,\n} from '@mappedin/mvf-cms/values';\nimport { CONNECTION_TYPE_VALUES } from '@mappedin/mvf-connections/values';\nimport type { DecompressError } from '@mappedin/mvf-core';\nimport { type PartialExcept, deepMergeOn } from '@mappedin/mvf-core/locale';\nimport { KIND_VALUES } from '@mappedin/mvf-kinds/values';\nimport { type Result, err, ok } from '@mappedin/safe-types/result';\nimport { strFromU8, unzipSync } from 'fflate';\nimport type { ParsedMVF } from '../types/bundle.js';\nimport { convertUnzippedStandardMVFv3ToParsedMVFv2 } from './convert.js';\nimport type { MVFv2_STANDARD_MVFv3 } from './index.js';\n\nexport type { MVFv2_STANDARD_MVFv3 };\nexport { convertUnzippedStandardMVFv3ToParsedMVFv2 };\n\nconst json = (d: Uint8Array) => JSON.parse(strFromU8(d));\n\ntype Handler = (path: string, data: Uint8Array) => Record<string, unknown> | undefined;\n\nconst GeometryPath = /^geometry\\/(.+)\\.geojson$/;\nconst NodesPath = /^nodes\\/(.+)\\.(geo)?json$/;\nconst FloorImagesPath = /^floorImages\\/(.+)\\.geojson$/;\nconst FacadePath = /^facade\\/(.+)\\.json$/;\nconst WalkablePath = /^walkable\\/(.+)\\.json$/;\nconst NonWalkablePath = /^nonwalkable\\/(.+)\\.json$/;\nconst KindsPath = /^kinds\\/(.+)\\.json$/;\nconst AnnotationsPath = /^annotations\\/(.+)\\.json$/;\nconst CMSPath = /^cms\\/(?:([^/]+)\\/)?([^/]+)\\.(?:json|geojson)$/;\n\nconst handlers: Handler[] = [\n\t(p, d) => (p === 'manifest.geojson' ? { manifest: json(d) } : undefined),\n\t(p, d) => (p === 'floors.geojson' ? { floors: json(d) } : undefined),\n\t(p, d) => {\n\t\tconst m = p.match(GeometryPath);\n\t\treturn m ? { geometry: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => (p === 'connections.json' ? { connections: json(d) } : undefined),\n\t(p, d) => (p === 'navigationFlags.json' ? { navigationFlags: json(d) } : undefined),\n\t(p, d) => {\n\t\tconst m = p.match(NodesPath);\n\t\treturn m ? { nodes: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => (p === 'default-style.json' ? { defaultStyle: json(d) } : undefined),\n\t(p, d) => (p === 'floor-stacks.json' ? { floorStacks: json(d) } : undefined),\n\t(p, d) => (p === 'outdoors.json' ? { outdoors: json(d) } : undefined),\n\t(p, d) => (p === 'tileset.json' ? { tileset: json(d) } : undefined),\n\t(p, d) => {\n\t\tconst m = p.match(FloorImagesPath);\n\t\treturn m ? { floorImages: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => {\n\t\tconst m = p.match(FacadePath);\n\t\treturn m ? { facade: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => {\n\t\tconst m = p.match(WalkablePath);\n\t\treturn m ? { walkable: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => {\n\t\tconst m = p.match(NonWalkablePath);\n\t\treturn m ? { nonwalkable: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => {\n\t\tconst m = p.match(KindsPath);\n\t\treturn m ? { kinds: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => (p === 'annotation-symbols.json' ? { annotationSymbols: json(d) } : undefined),\n\t(p, d) => {\n\t\tconst m = p.match(AnnotationsPath);\n\t\treturn m ? { annotations: { [m[1]]: json(d) } } : undefined;\n\t},\n\t(p, d) => (p === 'locations.json' ? { locations: json(d) } : undefined),\n\t(p, d) => (p === 'location-categories.json' ? { locationCategories: json(d) } : undefined),\n\t(p, d) => (p === 'location-instances.json' ? { locationInstances: json(d) } : undefined),\n\t(p, d) => {\n\t\tconst m = p.match(CMSPath);\n\t\tif (!m) return undefined;\n\t\tconst [, subSchema, fileName] = m;\n\t\tif (subSchema === 'floorText' || subSchema === 'textures' || subSchema === 'textAreas') {\n\t\t\treturn { cms: { [subSchema]: { [fileName]: json(d) } } };\n\t\t}\n\t\treturn { cms: { [fileName]: json(d) } };\n\t},\n];\n\n// --- SafeStringEnum normalization (typebox-free) ---\n// Mirrors the Type.Transform(...).Decode(...) normalization in the full parser:\n// unrecognized values are replaced with 'unknown'.\nconst connectionTypes = new Set<string>(CONNECTION_TYPE_VALUES);\nconst kindValues = new Set<string>(KIND_VALUES);\nconst venueTypes = new Set<string>(ENTERPRISE_VENUE_TYPE_VALUES);\nconst locationStates = new Set<string>(LOCATION_STATE_VALUES);\nconst siblingGroupTypes = new Set<string>(SIBLING_GROUP_TYPE_VALUES);\nconst textAlignments = new Set<string>(TEXT_ALIGNMENT_VALUES);\nconst textAreaAlignments = new Set<string>(TEXT_AREA_ALIGNMENT_VALUES);\nconst textureFaces = new Set<string>(TEXTURE_FACE_VALUES);\nconst textureSurfaces = new Set<string>(TEXTURE_SURFACE_VALUES);\n\nfunction norm(value: unknown, allowed: Set<string>): string {\n\treturn typeof value === 'string' && allowed.has(value) ? value : 'unknown';\n}\n\nfunction normalizeEnums(data: Record<string, unknown>): void {\n\tconst connections = data.connections;\n\tif (Array.isArray(connections)) {\n\t\tfor (const c of connections) {\n\t\t\tif (c && typeof c === 'object' && 'type' in c) {\n\t\t\t\t(c as Record<string, unknown>).type = norm(c.type, connectionTypes);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst kinds = data.kinds;\n\tif (kinds && typeof kinds === 'object') {\n\t\tfor (const floorMap of Object.values(kinds as Record<string, unknown>)) {\n\t\t\tif (floorMap && typeof floorMap === 'object') {\n\t\t\t\tconst fm = floorMap as Record<string, unknown>;\n\t\t\t\tfor (const geoId of Object.keys(fm)) {\n\t\t\t\t\tfm[geoId] = norm(fm[geoId], kindValues);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst cms = data.cms;\n\tif (!cms || typeof cms !== 'object') return;\n\tconst cmsObj = cms as Record<string, unknown>;\n\n\tconst cmsLocations = cmsObj.locations;\n\tif (Array.isArray(cmsLocations)) {\n\t\tfor (const loc of cmsLocations) {\n\t\t\tif (!loc || typeof loc !== 'object') continue;\n\t\t\tconst l = loc as Record<string, unknown>;\n\t\t\tif ('type' in l) l.type = norm(l.type, venueTypes);\n\n\t\t\tif (Array.isArray(l.states)) {\n\t\t\t\tfor (const s of l.states) {\n\t\t\t\t\tif (s && typeof s === 'object' && 'type' in s) {\n\t\t\t\t\t\t(s as Record<string, unknown>).type = norm(s.type, locationStates);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Array.isArray(l.siblingGroups)) {\n\t\t\t\tfor (const sg of l.siblingGroups) {\n\t\t\t\t\tif (sg && typeof sg === 'object' && 'type' in sg) {\n\t\t\t\t\t\t(sg as Record<string, unknown>).type = norm(sg.type, siblingGroupTypes);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const key of ['floorText', 'textAreas'] as const) {\n\t\tconst allowed = key === 'floorText' ? textAlignments : textAreaAlignments;\n\t\tconst sub = cmsObj[key];\n\t\tif (!sub || typeof sub !== 'object') continue;\n\t\tfor (const fc of Object.values(sub as Record<string, unknown>)) {\n\t\t\tif (!fc || typeof fc !== 'object') continue;\n\t\t\tconst features = (fc as Record<string, unknown>).features;\n\t\t\tif (!Array.isArray(features)) continue;\n\t\t\tfor (const f of features) {\n\t\t\t\tif (!f || typeof f !== 'object') continue;\n\t\t\t\tconst props = (f as Record<string, unknown>).properties;\n\t\t\t\tif (props && typeof props === 'object' && 'alignment' in props) {\n\t\t\t\t\t(props as Record<string, unknown>).alignment = norm((props as Record<string, unknown>).alignment, allowed);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst textures = cmsObj.textures;\n\tif (textures && typeof textures === 'object') {\n\t\tfor (const floorTextures of Object.values(textures as Record<string, unknown>)) {\n\t\t\tif (!Array.isArray(floorTextures)) continue;\n\t\t\tfor (const tex of floorTextures) {\n\t\t\t\tif (!tex || typeof tex !== 'object') continue;\n\t\t\t\tconst t = tex as Record<string, unknown>;\n\t\t\t\tif ('face' in t) t.face = norm(t.face, textureFaces);\n\t\t\t\tif ('surface' in t) t.surface = norm(t.surface, textureSurfaces);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction decompressLite(data: Uint8Array): Record<string, unknown> {\n\tconst files = unzipSync(data);\n\tlet result: Record<string, unknown> = {};\n\tfor (const filePath of Object.keys(files)) {\n\t\tfor (const h of handlers) {\n\t\t\tconst decoded = h(filePath, files[filePath]);\n\t\t\tif (decoded) {\n\t\t\t\tresult = deepMergeOn(result, decoded as PartialExcept<typeof result, never>, []);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tnormalizeEnums(result);\n\treturn result;\n}\n\nfunction decompressLiteSync(data: Uint8Array): Result<Record<string, unknown>, Error> {\n\ttry {\n\t\treturn ok(decompressLite(data));\n\t} catch (e) {\n\t\treturn err(e instanceof Error ? e : new Error(String(e)));\n\t}\n}\n\n/**\n * Lightweight stub parser with the same API as the real STANDARD_MVF_V3_PARSER.\n * Uses inlined fromBundle handlers and skips TypeBox schema validation.\n * SafeStringEnum values are normalized: unrecognized strings become 'unknown'.\n */\nexport const STANDARD_MVF_V3_PARSER: {\n\tdecompressUnsafeSync(data: Uint8Array): Result<MVFv2_STANDARD_MVFv3, DecompressError>;\n\tdecompressUnsafe(data: Uint8Array): Promise<Result<MVFv2_STANDARD_MVFv3, DecompressError>>;\n\tdecompressSync(data: Uint8Array): Result<MVFv2_STANDARD_MVFv3, DecompressError>;\n\tdecompress(data: Uint8Array): Promise<Result<MVFv2_STANDARD_MVFv3, DecompressError>>;\n} = {\n\tdecompressUnsafeSync: (data) => decompressLiteSync(data) as Result<MVFv2_STANDARD_MVFv3, DecompressError>,\n\tdecompressUnsafe: (data) =>\n\t\tPromise.resolve(decompressLiteSync(data) as Result<MVFv2_STANDARD_MVFv3, DecompressError>),\n\tdecompressSync: (data) => decompressLiteSync(data) as Result<MVFv2_STANDARD_MVFv3, DecompressError>,\n\tdecompress: (data) => Promise.resolve(decompressLiteSync(data) as Result<MVFv2_STANDARD_MVFv3, DecompressError>),\n};\n\nexport function extractAndConvertMVFv3UnsafeSync(data: Uint8Array): Result<ParsedMVF, DecompressError> {\n\tconst result = decompressLiteSync(data);\n\tif (result.isOk()) {\n\t\treturn ok(convertUnzippedStandardMVFv3ToParsedMVFv2(result.value as MVFv2_STANDARD_MVFv3));\n\t}\n\treturn err(result.error as DecompressError);\n}\n\nexport async function extractAndConvertMVFv3Unsafe(data: Uint8Array): Promise<Result<ParsedMVF, DecompressError>> {\n\treturn extractAndConvertMVFv3UnsafeSync(data);\n}\n\nexport function extractAndConvertMVFv3Sync(data: Uint8Array): Result<ParsedMVF, DecompressError> {\n\treturn extractAndConvertMVFv3UnsafeSync(data);\n}\n\nexport async function extractAndConvertMVFv3(data: Uint8Array): Promise<Result<ParsedMVF, DecompressError>> {\n\treturn extractAndConvertMVFv3UnsafeSync(data);\n}\n"],"names":["json","d","strFromU8","GeometryPath","NodesPath","FloorImagesPath","FacadePath","WalkablePath","NonWalkablePath","KindsPath","AnnotationsPath","CMSPath","handlers","p","m","subSchema","fileName","connectionTypes","CONNECTION_TYPE_VALUES","kindValues","KIND_VALUES","venueTypes","ENTERPRISE_VENUE_TYPE_VALUES","locationStates","LOCATION_STATE_VALUES","siblingGroupTypes","SIBLING_GROUP_TYPE_VALUES","textAlignments","TEXT_ALIGNMENT_VALUES","textAreaAlignments","TEXT_AREA_ALIGNMENT_VALUES","textureFaces","TEXTURE_FACE_VALUES","textureSurfaces","TEXTURE_SURFACE_VALUES","norm","value","allowed","normalizeEnums","data","connections","c","kinds","floorMap","fm","geoId","cms","cmsObj","cmsLocations","loc","l","s","sg","key","sub","fc","features","f","props","textures","floorTextures","tex","decompressLite","files","unzipSync","result","filePath","h","decoded","deepMergeOn","decompressLiteSync","ok","e","err","STANDARD_MVF_V3_PARSER","extractAndConvertMVFv3UnsafeSync","convertUnzippedStandardMVFv3ToParsedMVFv2","extractAndConvertMVFv3Unsafe","extractAndConvertMVFv3Sync","extractAndConvertMVFv3"],"mappings":"8IAsBMA,EAAQC,GAAkB,KAAK,MAAMC,EAAAA,UAAUD,CAAC,CAAC,EAIjDE,EAAe,4BACfC,EAAY,4BACZC,EAAkB,+BAClBC,EAAa,uBACbC,EAAe,yBACfC,EAAkB,4BAClBC,EAAY,sBACZC,EAAkB,4BAClBC,EAAU,iDAEVC,EAAsB,CAC3B,CAACC,EAAGZ,IAAOY,IAAM,mBAAqB,CAAE,SAAUb,EAAKC,CAAC,CAAA,EAAM,OAC9D,CAACY,EAAGZ,IAAOY,IAAM,iBAAmB,CAAE,OAAQb,EAAKC,CAAC,CAAA,EAAM,OAC1D,CAACY,EAAGZ,IAAM,CACT,MAAMa,EAAID,EAAE,MAAMV,CAAY,EAC9B,OAAOW,EAAI,CAAE,SAAU,CAAE,CAACA,EAAE,CAAC,CAAC,EAAGd,EAAKC,CAAC,CAAA,GAAQ,MAChD,EACA,CAACY,EAAGZ,IAAOY,IAAM,mBAAqB,CAAE,YAAab,EAAKC,CAAC,CAAA,EAAM,OACjE,CAACY,EAAGZ,IAAOY,IAAM,uBAAyB,CAAE,gBAAiBb,EAAKC,CAAC,CAAA,EAAM,OACzE,CAACY,EAAGZ,IAAM,CACT,MAAMa,EAAID,EAAE,MAAMT,CAAS,EAC3B,OAAOU,EAAI,CAAE,MAAO,CAAE,CAACA,EAAE,CAAC,CAAC,EAAGd,EAAKC,CAAC,CAAA,GAAQ,MAC7C,EACA,CAACY,EAAGZ,IAAOY,IAAM,qBAAuB,CAAE,aAAcb,EAAKC,CAAC,CAAA,EAAM,OACpE,CAACY,EAAGZ,IAAOY,IAAM,oBAAsB,CAAE,YAAab,EA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