{"version":3,"file":"api.cjs","names":["tsplus_module_1","tsplus_module_3","tsplus_module_2","tsplus_module_4","tsplus_module_5","tsplus_module_6","tsplus_module_7","ownKeys","tsplus_module_8","tsplus_module_9","tsplus_module_10","TemplateLiteralSpan","getParameter"],"sources":["../../esm/Schema/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/schema) src/Schema/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/schema/Schema/definition\";\nimport * as tsplus_module_2 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_3 from \"@fncts/schema/AST\";\nimport * as tsplus_module_4 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_5 from \"@fncts/schema/ParseResult\";\nimport * as tsplus_module_6 from \"@fncts/schema/Parser/api\";\nimport * as tsplus_module_7 from \"@fncts/base/data/Maybe/api\";\nimport * as tsplus_module_8 from \"@fncts/schema/Schema/api/maybe\";\nimport * as tsplus_module_9 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_10 from \"@fncts/base/data/Maybe/definition\";\nexport const make = make_1;\nexport const annotate = annotate_1;\nexport const filter = filter_1;\nexport const union = union_1;\nexport const isOptional = isOptional_1;\nexport const isParseOptional = isParseOptional_1;\nexport const enum_ = enum_1;\nexport const instanceOf = instanceOf_1;\nexport const transformOrFail = transformOrFail_1;\nexport const transform = transform_1;\nimport { show } from \"@fncts/base/data/Showable\";\nimport { getParameter } from \"../AST.js\";\nimport { concrete, TemplateLiteralSpan } from \"../AST.js\";\nimport { ownKeys } from \"../utils.js\";\n/**\n * @tsplus static fncts.schema.SchemaOps fromAST\n */\nfunction make_1(ast) {\n    return new tsplus_module_1.Schema(ast);\n}\n/**\n * @tsplus pipeable fncts.schema.Schema annotate\n */\nfunction annotate_1(annotation, value) {\n    return (self) => {\n        return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(annotation, value) }));\n    };\n}\n/**\n * @tsplus static fncts.schema.SchemaOps declaration\n */\nexport function declaration(typeParameters, decode, encode, annotations) {\n    return make_1(tsplus_module_3.createDeclaration(tsplus_module_2.map((tp) => tp.ast)(typeParameters), (...typeParameters) => decode(...typeParameters.map(make_1)), (...typeParameters) => encode(...typeParameters.map(make_1)), annotations));\n}\nfunction filter_1(predicate) {\n    return (self) => {\n        const ast = tsplus_module_3.createRefinement(self.ast, predicate);\n        return make_1(ast);\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema brand\n */\nexport function brand(validation) {\n    return (self) => {\n        const ast = tsplus_module_3.createRefinement(self.ast, validation.validate, self.ast.annotations.annotate(tsplus_module_4.Brand, tsplus_module_2.vector(validation)));\n        return make_1(ast);\n    };\n}\nfunction makeLiteral(value) {\n    return make_1(tsplus_module_3.createLiteral(value));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps literal\n */\nexport function literal(...literals) {\n    return union_1(...literals.map(makeLiteral));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps never\n * @tsplus implicit\n */\nexport const never = make_1(tsplus_module_3.neverKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps unknown\n * @tsplus implicit\n */\nconst unknown_1 = make_1(tsplus_module_3.unknownKeyword);\nexport const unknown = unknown_1;\n/**\n * @tsplus static fncts.schema.SchemaOps any\n */\nexport const any = make_1(tsplus_module_3.anyKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps undefined\n * @tsplus implicit\n */\nconst _undefined_1 = make_1(tsplus_module_3.undefinedKeyword);\nexport const _undefined = _undefined_1;\nexport { _undefined_1 as undefined };\n/**\n * @tsplus static fncts.schema.SchemaOps null\n * @tsplus implicit\n */\nconst _null_1 = make_1(tsplus_module_3.createLiteral(null));\nexport const _null = _null_1;\nexport { _null_1 as null };\n/**\n * @tsplus static fncts.schema.SchemaOps void\n * @tsplus implicit\n */\nconst _void_1 = make_1(tsplus_module_3.voidKeyword);\nexport const _void = _void_1;\nexport { _void_1 as void };\n/**\n * @tsplus static fncts.schema.SchemaOps string\n * @tsplus implicit\n */\nexport const string = make_1(tsplus_module_3.stringKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps number\n * @tsplus implicit\n */\nexport const number = make_1(tsplus_module_3.numberKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps boolean\n * @tsplus implicit\n */\nexport const boolean = make_1(tsplus_module_3.booleanKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps bigint\n * @tsplus implicit\n */\nexport const bigint = make_1(tsplus_module_3.bigIntKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps symbol\n * @tsplus implicit\n */\nexport const symbol = make_1(tsplus_module_3.symbolKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps object\n * @tsplus implicit\n */\nconst object_1 = make_1(tsplus_module_3.objectKeyword);\nexport const object = object_1;\n/**\n * @tsplus static fncts.schema.SchemaOps date\n */\nconst date_1 = instanceOf_1(Date)(object_1);\nexport const date = date_1;\n/**\n * @tsplus implicit\n */\nexport const implicitDate = transformOrFail_1(date_1, (input, options) => {\n    if (typeof input === \"string\" || typeof input === \"number\") {\n        return tsplus_module_5.succeed(new Date(input));\n    }\n    else {\n        return tsplus_module_6.decode(date_1)(input, options);\n    }\n}, (input) => tsplus_module_5.succeed(input))(unknown_1);\n/**\n * @tsplus derive fncts.schema.Schema<|> 30\n * @tsplus static fncts.schema.SchemaOps union\n */\nfunction union_1(...members) {\n    return make_1(tsplus_module_3.createUnion(tsplus_module_2.from(members.map((m) => m.ast))));\n}\n/**\n * @tsplus getter fncts.schema.Schema nullable\n */\nexport function nullable(self) {\n    return union_1(_null_1, self);\n}\n/**\n * @tsplus static fncts.schema.SchemaOps uniqueSymbol\n */\nexport function uniqueSymbol(symbol, annotations) {\n    return make_1(tsplus_module_3.createUniqueSymbol(symbol, annotations));\n}\n/**\n * @tsplus getter fncts.schema.Schema optional\n */\nexport function optional(self) {\n    return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(tsplus_module_4.Optional, true) }));\n}\n/**\n * @tsplus fluent fncts.schema.Schema isOptional\n */\nfunction isOptional_1(self) {\n    return tsplus_module_7.getOrElse(() => false)(self.ast.annotations.get(tsplus_module_4.Optional));\n}\n/**\n * @tsplus getter fncts.schema.Schema parseOptional\n */\nexport function parseOptional(self) {\n    return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(tsplus_module_4.ParseOptional, true) }));\n}\n/**\n * @tsplus fluent fncts.schema.Schema isParseOptional\n */\nfunction isParseOptional_1(self) {\n    return tsplus_module_7.getOrElse(() => false)(self.ast.annotations.get(tsplus_module_4.ParseOptional));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps struct\n */\nexport function struct(fields) {\n    const parseOptionalKeys = tsplus_module_2.filter((key) => isParseOptional_1(fields[key]))(ownKeys(fields));\n    const struct = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((key) => tsplus_module_3.createPropertySignature(key, fields[key].ast, isOptional_1(fields[key]), true))(ownKeys(fields)), tsplus_module_2.empty()));\n    if (tsplus_module_2.isEmpty(parseOptionalKeys)) {\n        return struct;\n    }\n    const propertySignatures = struct.ast.propertySignatures;\n    const from = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((p) => tsplus_module_2.includes(p.name)(parseOptionalKeys)\n        ? tsplus_module_3.createPropertySignature(p.name, tsplus_module_3.createUnion(tsplus_module_2.vector(tsplus_module_3.undefinedKeyword, tsplus_module_3.createLiteral(null), p.type)), true, p.isReadonly)\n        : p)(propertySignatures), tsplus_module_2.empty()));\n    const to = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((p) => {\n        if (tsplus_module_2.includes(p.name)(parseOptionalKeys)) {\n            if (tsplus_module_3.isLazy(fields[p.name].ast)) {\n                return tsplus_module_3.createPropertySignature(p.name, tsplus_module_3.createLazy(() => tsplus_module_8.maybe(fields[p.name]).ast), true, p.isReadonly);\n            }\n            return tsplus_module_3.createPropertySignature(p.name, tsplus_module_8.maybe(fields[p.name]).ast, true, p.isReadonly);\n        }\n        return p;\n    })(propertySignatures), tsplus_module_2.empty()));\n    return transform_1(to, (input) => {\n        const output = { ...input };\n        for (const key of parseOptionalKeys) {\n            output[key] = tsplus_module_9.fromNullable(input[key]);\n        }\n        return output;\n    }, (input) => {\n        const output = { ...input };\n        for (const key of parseOptionalKeys) {\n            const value = input[key];\n            if (tsplus_module_10.isNothing(value)) {\n                delete output[key];\n                continue;\n            }\n            output[key] = tsplus_module_7.toUndefined(value);\n        }\n        return output;\n    })(from);\n}\n/**\n * @tsplus static fncts.schema.SchemaOps tuple\n */\nexport function tuple(...elements) {\n    return make_1(tsplus_module_3.createTuple(tsplus_module_2.from(elements.map((schema) => tsplus_module_3.createElement(schema.ast, false))), tsplus_module_9.nothing(fileName_1 + \":333:105\"), true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps lazy\n */\nexport function lazy(f, annotations) {\n    return make_1(tsplus_module_3.createLazy(() => f().ast, annotations));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps array\n * @tsplus getter fncts.schema.Schema array\n */\nexport function array(item) {\n    return make_1(tsplus_module_3.createTuple(tsplus_module_2.empty(), tsplus_module_9.just(tsplus_module_2.vector(item.ast), fileName_1 + \":349:61\"), true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps mutableArray\n * @tsplus getter fncts.schema.Schema mutableArray\n */\nexport function mutableArray(item) {\n    return make_1(tsplus_module_3.createTuple(tsplus_module_2.empty(), tsplus_module_9.just(tsplus_module_2.vector(item.ast), fileName_1 + \":357:61\"), false));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps record\n */\nexport function record(key, value) {\n    return make_1(tsplus_module_3.createRecord(key.ast, value.ast, true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps enum\n */\nfunction enum_1(enums) {\n    return make_1(tsplus_module_3.createEnum(tsplus_module_2.from(Object.keys(enums)\n        .filter((key) => typeof enums[enums[key]] !== \"number\")\n        .map((key) => [key, enums[key]]))));\n}\nexport { enum_1 as enum };\nfunction getTemplateLiterals(ast) {\n    void 0;\n    switch (ast._tag) {\n        case 1 /* ASTTag.Literal */:\n            return tsplus_module_2.vector(ast);\n        case 9 /* ASTTag.NumberKeyword */:\n        case 8 /* ASTTag.StringKeyword */:\n            return tsplus_module_2.vector(tsplus_module_3.createTemplateLiteral(\"\", tsplus_module_2.vector(new TemplateLiteralSpan(ast, \"\"))));\n        case 18 /* ASTTag.Union */:\n            return tsplus_module_2.flatMap(getTemplateLiterals)(ast.types);\n        default:\n            throw new Error(`Unsupported template literal span ${show(ast)}`);\n    }\n}\nfunction combineTemplateLiterals(a, b) {\n    if (tsplus_module_3.isLiteral(a)) {\n        return tsplus_module_3.isLiteral(b)\n            ? tsplus_module_3.createLiteral(String(a.literal) + String(b.literal))\n            : tsplus_module_3.createTemplateLiteral(String(a.literal) + b.head, b.spans);\n    }\n    if (tsplus_module_3.isLiteral(b)) {\n        if (!tsplus_module_2.isNonEmpty(a.spans)) {\n            throw new Error(\"Invalid template literal\");\n        }\n        const last = tsplus_module_2.unsafeLast(a.spans);\n        return tsplus_module_3.createTemplateLiteral(a.head, tsplus_module_2.append(new TemplateLiteralSpan(last.type, last.literal + String(b.literal)))(tsplus_module_2.slice(0, -1)(a.spans)));\n    }\n    if (!tsplus_module_2.isNonEmpty(a.spans)) {\n        throw new Error(\"Invalid template literal\");\n    }\n    const last = tsplus_module_2.unsafeLast(a.spans);\n    return tsplus_module_3.createTemplateLiteral(a.head, tsplus_module_2.concat(b.spans)(tsplus_module_2.append(new TemplateLiteralSpan(last.type, last.literal + String(b.head)))(tsplus_module_2.slice(0, -1)(a.spans))));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps templateLiteral\n */\nexport function templateLiteral(...[head, ...tail]) {\n    let types = getTemplateLiterals(head.ast);\n    for (const span of tail) {\n        types = tsplus_module_2.flatMap((a) => tsplus_module_2.map((b) => combineTemplateLiterals(a, b))(getTemplateLiterals(span.ast)))(types);\n    }\n    return make_1(tsplus_module_3.createUnion(types));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps keyof\n * @tsplus getter fncts.schema.Schema keyof\n */\nexport function keyof(self) {\n    return make_1(tsplus_module_3.keyof(self.ast));\n}\nfunction isOverlappingPropertySignatures(x, y) {\n    return tsplus_module_2.some((px) => tsplus_module_2.some((py) => px.name === py.name)(y.propertySignatures))(x.propertySignatures);\n}\nfunction isOverlappingIndexSignatures(x, y) {\n    return tsplus_module_2.some((ix) => tsplus_module_2.some((iy) => {\n        const bx = getParameter(ix.parameter);\n        const by = getParameter(iy.parameter);\n        return (tsplus_module_3.isStringKeyword(bx) && tsplus_module_3.isStringKeyword(by)) || (tsplus_module_3.isSymbolKeyword(bx) && tsplus_module_3.isSymbolKeyword(by));\n    })(y.indexSignatures))(x.indexSignatures);\n}\n/**\n * @tsplus pipeable fncts.schema.Schema extend\n */\nexport function extend(that) {\n    return (self) => {\n        const selfTypes = tsplus_module_3.isUnion(self.ast) ? self.ast.types : tsplus_module_2.vector(self.ast);\n        const thatTypes = tsplus_module_3.isUnion(that.ast) ? that.ast.types : tsplus_module_2.vector(that.ast);\n        if (tsplus_module_2.every(tsplus_module_3.isTypeLiteral)(selfTypes) && tsplus_module_2.every(tsplus_module_3.isTypeLiteral)(thatTypes)) {\n            return make_1(tsplus_module_3.createUnion(tsplus_module_2.flatMap((x) => tsplus_module_2.map((y) => {\n                if (isOverlappingPropertySignatures(x, y)) {\n                    throw new Error(\"`extend` cannot handle overlapping property signatures\");\n                }\n                if (isOverlappingIndexSignatures(x, y)) {\n                    throw new Error(\"`extend` cannot handle overlapping index signatures\");\n                }\n                return tsplus_module_3.createTypeLiteral(tsplus_module_2.concat(y.propertySignatures)(x.propertySignatures), tsplus_module_2.concat(y.indexSignatures)(x.indexSignatures));\n            })(thatTypes))(selfTypes)));\n        }\n        throw new Error(\"`extend can only handle type literals or unions of type literals`\");\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema instanceOf\n */\nfunction instanceOf_1(constructor) {\n    return (self) => {\n        return annotate_1(tsplus_module_4.Description, `an instance of ${constructor.name}`)(filter_1((value) => value instanceof constructor)(self));\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema transformOrFail\n */\nfunction transformOrFail_1(to, decode, encode) {\n    return (from) => {\n        return make_1(tsplus_module_3.createTransform(from.ast, to.ast, decode, encode));\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema transform\n */\nfunction transform_1(to, decode, encode) {\n    return (from) => {\n        return transformOrFail_1(to, (input, options) => tsplus_module_5.succeed(decode(input, options)), (input, options) => tsplus_module_5.succeed(encode(input, options)))(from);\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema pick\n */\nexport function pick(...keys) {\n    return (self) => {\n        return make_1(tsplus_module_3.pick(tsplus_module_2.from(keys))(self.ast));\n    };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema omit\n */\nexport function omit(...keys) {\n    return (self) => {\n        return make_1(tsplus_module_3.omit(tsplus_module_2.from(keys))(self.ast));\n    };\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,aAAa;AAWnB,MAAa,OAAO;AACpB,MAAa,WAAW;AACxB,MAAa,SAAS;AACtB,MAAa,QAAQ;AACrB,MAAa,aAAa;AAC1B,MAAa,kBAAkB;AAC/B,MAAa,QAAQ;AACrB,MAAa,aAAa;AAC1B,MAAa,kBAAkB;AAC/B,MAAa,YAAY;;;;AAQzB,SAAS,OAAO,KAAK;AACjB,QAAO,IAAIA,gCAAgB,OAAO,IAAI;;;;;AAK1C,SAAS,WAAW,YAAY,OAAO;AACnC,SAAQ,SAAS;AACb,SAAO,OAAO,KAAK,IAAI,MAAM,EAAE,aAAa,KAAK,IAAI,YAAY,SAAS,YAAY,MAAM,EAAE,CAAC,CAAC;;;;;;AAMxG,SAAgB,YAAY,gBAAgB,QAAQ,QAAQ,aAAa;AACrE,QAAO,OAAOC,kBAAgB,kBAAkBC,4CAAgB,KAAK,OAAO,GAAG,IAAI,CAAC,eAAe,GAAG,GAAG,mBAAmB,OAAO,GAAG,eAAe,IAAI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