"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.11.8
//   protoc               v4.25.9
// source: io/restorecommerce/rendering.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.RenderingServiceDefinition = exports.RenderResponseList = exports.RenderResponse = exports.RenderResult_Bodies = exports.RenderResult = exports.RenderRequestList = exports.RenderRequest_Template = exports.RenderRequest = exports.RenderRequest_Strategy = exports.protobufPackage = void 0;
exports.renderRequest_StrategyFromJSON = renderRequest_StrategyFromJSON;
exports.renderRequest_StrategyToJSON = renderRequest_StrategyToJSON;
exports.renderRequest_StrategyToNumber = renderRequest_StrategyToNumber;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const any_1 = require("../../google/protobuf/any");
const auth_1 = require("./auth");
const status_1 = require("./status");
exports.protobufPackage = "io.restorecommerce.rendering";
/** style-applying 'strategy' */
var RenderRequest_Strategy;
(function (RenderRequest_Strategy) {
    RenderRequest_Strategy["INLINE"] = "INLINE";
    RenderRequest_Strategy["COPY"] = "COPY";
    RenderRequest_Strategy["UNRECOGNIZED"] = "UNRECOGNIZED";
})(RenderRequest_Strategy || (exports.RenderRequest_Strategy = RenderRequest_Strategy = {}));
function renderRequest_StrategyFromJSON(object) {
    switch (object) {
        case 0:
        case "INLINE":
            return RenderRequest_Strategy.INLINE;
        case 1:
        case "COPY":
            return RenderRequest_Strategy.COPY;
        case -1:
        case "UNRECOGNIZED":
        default:
            return RenderRequest_Strategy.UNRECOGNIZED;
    }
}
function renderRequest_StrategyToJSON(object) {
    switch (object) {
        case RenderRequest_Strategy.INLINE:
            return "INLINE";
        case RenderRequest_Strategy.COPY:
            return "COPY";
        case RenderRequest_Strategy.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function renderRequest_StrategyToNumber(object) {
    switch (object) {
        case RenderRequest_Strategy.INLINE:
            return 0;
        case RenderRequest_Strategy.COPY:
            return 1;
        case RenderRequest_Strategy.UNRECOGNIZED:
        default:
            return -1;
    }
}
function createBaseRenderRequest() {
    return {};
}
exports.RenderRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.templates !== undefined && message.templates.length !== 0) {
            for (const v of message.templates) {
                exports.RenderRequest_Template.encode(v, writer.uint32(18).fork()).join();
            }
        }
        if (message.data !== undefined) {
            any_1.Any.encode(message.data, writer.uint32(26).fork()).join();
        }
        if (message.styleUrl !== undefined) {
            writer.uint32(34).string(message.styleUrl);
        }
        if (message.strategy !== undefined) {
            writer.uint32(40).int32(renderRequest_StrategyToNumber(message.strategy));
        }
        if (message.options !== undefined) {
            any_1.Any.encode(message.options, writer.uint32(50).fork()).join();
        }
        if (message.contentType !== undefined) {
            writer.uint32(58).string(message.contentType);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.templates === undefined) {
                        message.templates = [];
                    }
                    const el = exports.RenderRequest_Template.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.templates.push(el);
                    }
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.data = any_1.Any.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.styleUrl = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.strategy = renderRequest_StrategyFromJSON(reader.int32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.options = any_1.Any.decode(reader, reader.uint32());
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.contentType = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            templates: globalThis.Array.isArray(object?.templates)
                ? object.templates.map((e) => exports.RenderRequest_Template.fromJSON(e))
                : undefined,
            data: isSet(object.data) ? any_1.Any.fromJSON(object.data) : undefined,
            styleUrl: isSet(object.styleUrl)
                ? globalThis.String(object.styleUrl)
                : isSet(object.style_url)
                    ? globalThis.String(object.style_url)
                    : undefined,
            strategy: isSet(object.strategy) ? renderRequest_StrategyFromJSON(object.strategy) : undefined,
            options: isSet(object.options) ? any_1.Any.fromJSON(object.options) : undefined,
            contentType: isSet(object.contentType)
                ? globalThis.String(object.contentType)
                : isSet(object.content_type)
                    ? globalThis.String(object.content_type)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.templates?.length) {
            obj.templates = message.templates.map((e) => exports.RenderRequest_Template.toJSON(e));
        }
        if (message.data !== undefined) {
            obj.data = any_1.Any.toJSON(message.data);
        }
        if (message.styleUrl !== undefined) {
            obj.styleUrl = message.styleUrl;
        }
        if (message.strategy !== undefined) {
            obj.strategy = renderRequest_StrategyToJSON(message.strategy);
        }
        if (message.options !== undefined) {
            obj.options = any_1.Any.toJSON(message.options);
        }
        if (message.contentType !== undefined) {
            obj.contentType = message.contentType;
        }
        return obj;
    },
    create(base) {
        return exports.RenderRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderRequest();
        message.id = object.id ?? undefined;
        message.templates = object.templates?.map((e) => exports.RenderRequest_Template.fromPartial(e)) || undefined;
        message.data = (object.data !== undefined && object.data !== null) ? any_1.Any.fromPartial(object.data) : undefined;
        message.styleUrl = object.styleUrl ?? undefined;
        message.strategy = object.strategy ?? undefined;
        message.options = (object.options !== undefined && object.options !== null)
            ? any_1.Any.fromPartial(object.options)
            : undefined;
        message.contentType = object.contentType ?? undefined;
        return message;
    },
};
function createBaseRenderRequest_Template() {
    return {};
}
exports.RenderRequest_Template = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.body !== undefined) {
            writer.uint32(18).bytes(message.body);
        }
        if (message.layout !== undefined) {
            writer.uint32(26).bytes(message.layout);
        }
        if (message.charset !== undefined) {
            writer.uint32(34).string(message.charset);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderRequest_Template();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.body = Buffer.from(reader.bytes());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.layout = Buffer.from(reader.bytes());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.charset = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            body: isSet(object.body) ? Buffer.from(bytesFromBase64(object.body)) : undefined,
            layout: isSet(object.layout) ? Buffer.from(bytesFromBase64(object.layout)) : undefined,
            charset: isSet(object.charset) ? globalThis.String(object.charset) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.body !== undefined) {
            obj.body = base64FromBytes(message.body);
        }
        if (message.layout !== undefined) {
            obj.layout = base64FromBytes(message.layout);
        }
        if (message.charset !== undefined) {
            obj.charset = message.charset;
        }
        return obj;
    },
    create(base) {
        return exports.RenderRequest_Template.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderRequest_Template();
        message.id = object.id ?? undefined;
        message.body = object.body ?? undefined;
        message.layout = object.layout ?? undefined;
        message.charset = object.charset ?? undefined;
        return message;
    },
};
function createBaseRenderRequestList() {
    return {};
}
exports.RenderRequestList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.RenderRequest.encode(v, writer.uint32(18).fork()).join();
            }
        }
        if (message.subject !== undefined) {
            auth_1.Subject.encode(message.subject, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderRequestList();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.RenderRequest.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.subject = auth_1.Subject.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            items: globalThis.Array.isArray(object?.items)
                ? object.items.map((e) => exports.RenderRequest.fromJSON(e))
                : undefined,
            subject: isSet(object.subject) ? auth_1.Subject.fromJSON(object.subject) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.RenderRequest.toJSON(e));
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.RenderRequestList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderRequestList();
        message.id = object.id ?? undefined;
        message.items = object.items?.map((e) => exports.RenderRequest.fromPartial(e)) || undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseRenderResult() {
    return {};
}
exports.RenderResult = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.bodies !== undefined && message.bodies.length !== 0) {
            for (const v of message.bodies) {
                exports.RenderResult_Bodies.encode(v, writer.uint32(18).fork()).join();
            }
        }
        if (message.contentType !== undefined) {
            writer.uint32(58).string(message.contentType);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderResult();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.bodies === undefined) {
                        message.bodies = [];
                    }
                    const el = exports.RenderResult_Bodies.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.bodies.push(el);
                    }
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.contentType = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            bodies: globalThis.Array.isArray(object?.bodies)
                ? object.bodies.map((e) => exports.RenderResult_Bodies.fromJSON(e))
                : undefined,
            contentType: isSet(object.contentType)
                ? globalThis.String(object.contentType)
                : isSet(object.content_type)
                    ? globalThis.String(object.content_type)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.bodies?.length) {
            obj.bodies = message.bodies.map((e) => exports.RenderResult_Bodies.toJSON(e));
        }
        if (message.contentType !== undefined) {
            obj.contentType = message.contentType;
        }
        return obj;
    },
    create(base) {
        return exports.RenderResult.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderResult();
        message.id = object.id ?? undefined;
        message.bodies = object.bodies?.map((e) => exports.RenderResult_Bodies.fromPartial(e)) || undefined;
        message.contentType = object.contentType ?? undefined;
        return message;
    },
};
function createBaseRenderResult_Bodies() {
    return {};
}
exports.RenderResult_Bodies = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.body !== undefined) {
            writer.uint32(18).bytes(message.body);
        }
        if (message.charset !== undefined) {
            writer.uint32(26).string(message.charset);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderResult_Bodies();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.body = Buffer.from(reader.bytes());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.charset = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            body: isSet(object.body) ? Buffer.from(bytesFromBase64(object.body)) : undefined,
            charset: isSet(object.charset) ? globalThis.String(object.charset) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.body !== undefined) {
            obj.body = base64FromBytes(message.body);
        }
        if (message.charset !== undefined) {
            obj.charset = message.charset;
        }
        return obj;
    },
    create(base) {
        return exports.RenderResult_Bodies.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderResult_Bodies();
        message.id = object.id ?? undefined;
        message.body = object.body ?? undefined;
        message.charset = object.charset ?? undefined;
        return message;
    },
};
function createBaseRenderResponse() {
    return {};
}
exports.RenderResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.RenderResult.encode(message.payload, writer.uint32(10).fork()).join();
        }
        if (message.status !== undefined) {
            status_1.Status.encode(message.status, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.RenderResult.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.status = status_1.Status.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            payload: isSet(object.payload) ? exports.RenderResult.fromJSON(object.payload) : undefined,
            status: isSet(object.status) ? status_1.Status.fromJSON(object.status) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.payload !== undefined) {
            obj.payload = exports.RenderResult.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.RenderResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.RenderResult.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseRenderResponseList() {
    return {};
}
exports.RenderResponseList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.RenderResponse.encode(v, writer.uint32(18).fork()).join();
            }
        }
        if (message.operationStatus !== undefined) {
            status_1.OperationStatus.encode(message.operationStatus, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRenderResponseList();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.RenderResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operationStatus = status_1.OperationStatus.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            items: globalThis.Array.isArray(object?.items)
                ? object.items.map((e) => exports.RenderResponse.fromJSON(e))
                : undefined,
            operationStatus: isSet(object.operationStatus)
                ? status_1.OperationStatus.fromJSON(object.operationStatus)
                : isSet(object.operation_status)
                    ? status_1.OperationStatus.fromJSON(object.operation_status)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.RenderResponse.toJSON(e));
        }
        if (message.operationStatus !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operationStatus);
        }
        return obj;
    },
    create(base) {
        return exports.RenderResponseList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRenderResponseList();
        message.id = object.id ?? undefined;
        message.items = object.items?.map((e) => exports.RenderResponse.fromPartial(e)) || undefined;
        message.operationStatus = (object.operationStatus !== undefined && object.operationStatus !== null)
            ? status_1.OperationStatus.fromPartial(object.operationStatus)
            : undefined;
        return message;
    },
};
exports.RenderingServiceDefinition = {
    name: "RenderingService",
    fullName: "io.restorecommerce.rendering.RenderingService",
    methods: {
        render: {
            name: "Render",
            requestType: exports.RenderRequestList,
            requestStream: false,
            responseType: exports.RenderResponseList,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/rendering.proto",
        "package": "io.restorecommerce.rendering",
        "dependency": ["google/protobuf/any.proto", "io/restorecommerce/status.proto", "io/restorecommerce/auth.proto"],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "RenderRequest",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "templates",
                        "number": 2,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rendering.RenderRequest.Template",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "templates",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "data",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Any",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "data",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "style_url",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "styleUrl",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "strategy",
                        "number": 5,
                        "label": 1,
                        "type": 14,
                        "typeName": ".io.restorecommerce.rendering.RenderRequest.Strategy",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "strategy",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "options",
                        "number": 6,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Any",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "options",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "content_type",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "contentType",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [{
                        "name": "Template",
                        "field": [{
                                "name": "id",
                                "number": 1,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 0,
                                "jsonName": "id",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "body",
                                "number": 2,
                                "label": 1,
                                "type": 12,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 1,
                                "jsonName": "body",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "layout",
                                "number": 3,
                                "label": 1,
                                "type": 12,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 2,
                                "jsonName": "layout",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "charset",
                                "number": 4,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 3,
                                "jsonName": "charset",
                                "options": undefined,
                                "proto3Optional": true,
                            }],
                        "extension": [],
                        "nestedType": [],
                        "enumType": [],
                        "extensionRange": [],
                        "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_body", "options": undefined }, {
                                "name": "_layout",
                                "options": undefined,
                            }, { "name": "_charset", "options": undefined }],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "enumType": [{
                        "name": "Strategy",
                        "value": [{ "name": "INLINE", "number": 0, "options": undefined }, {
                                "name": "COPY",
                                "number": 1,
                                "options": undefined,
                            }],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_data", "options": undefined },
                    { "name": "_style_url", "options": undefined },
                    { "name": "_strategy", "options": undefined },
                    { "name": "_options", "options": undefined },
                    { "name": "_content_type", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "RenderRequestList",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "items",
                        "number": 2,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rendering.RenderRequest",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "subject",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.auth.Subject",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "subject",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_subject", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "RenderResult",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "bodies",
                        "number": 2,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rendering.RenderResult.Bodies",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "bodies",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "content_type",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "contentType",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [{
                        "name": "Bodies",
                        "field": [{
                                "name": "id",
                                "number": 1,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 0,
                                "jsonName": "id",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "body",
                                "number": 2,
                                "label": 1,
                                "type": 12,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 1,
                                "jsonName": "body",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "charset",
                                "number": 3,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 2,
                                "jsonName": "charset",
                                "options": undefined,
                                "proto3Optional": true,
                            }],
                        "extension": [],
                        "nestedType": [],
                        "enumType": [],
                        "extensionRange": [],
                        "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_body", "options": undefined }, {
                                "name": "_charset",
                                "options": undefined,
                            }],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_content_type", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "RenderResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rendering.RenderResult",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "payload",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "status",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.Status",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "status",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_payload", "options": undefined }, { "name": "_status", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "RenderResponseList",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "items",
                        "number": 2,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rendering.RenderResponse",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "operation_status",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.OperationStatus",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "operationStatus",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_operation_status", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "RenderingService",
                "method": [{
                        "name": "Render",
                        "inputType": ".io.restorecommerce.rendering.RenderRequestList",
                        "outputType": ".io.restorecommerce.rendering.RenderResponseList",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [6, 0],
                    "span": [11, 0, 13, 1],
                    "leadingComments": "\nMicroservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 4, 0],
                    "span": [16, 2, 19, 3],
                    "leadingComments": "",
                    "trailingComments": " style-applying 'strategy'\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 3, 0, 2, 0],
                    "span": [22, 4, 27],
                    "leadingComments": "",
                    "trailingComments": " snippit name\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 3, 0, 2, 3],
                    "span": [25, 4, 32],
                    "leadingComments": "",
                    "trailingComments": " defaults to utf-8\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 2],
                    "span": [30, 2, 40],
                    "leadingComments": "",
                    "trailingComments": " data to fill template with\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 3],
                    "span": [31, 2, 32],
                    "leadingComments": "",
                    "trailingComments": " stylesheet URL\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 4],
                    "span": [32, 2, 33],
                    "leadingComments": "",
                    "trailingComments": " inlining, copying CSS into <style>, etc...\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 5],
                    "span": [33, 2, 43],
                    "leadingComments": "",
                    "trailingComments": " rendering options JSON object\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 6],
                    "span": [34, 2, 35],
                    "leadingComments": "",
                    "trailingComments": " content type for rendering such as 'application/html' or 'application/text'\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 0],
                    "span": [38, 2, 25],
                    "leadingComments": "",
                    "trailingComments": " identifies the render request payload\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 1],
                    "span": [39, 2, 35],
                    "leadingComments": "",
                    "trailingComments": " List of templates with associated data and rendering options\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 2, 3, 0, 2, 0],
                    "span": [45, 4, 27],
                    "leadingComments": "",
                    "trailingComments": " snippit name\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 2, 3, 0, 2, 2],
                    "span": [47, 4, 32],
                    "leadingComments": "",
                    "trailingComments": " defaults to utf-8\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 2, 2, 0],
                    "span": [50, 2, 25],
                    "leadingComments": "",
                    "trailingComments": " snippit name\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 2, 2, 2],
                    "span": [52, 2, 35],
                    "leadingComments": "",
                    "trailingComments": " content type for rendering such as 'application/html' or 'application/text'\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.rendering.RenderRequest": exports.RenderRequest,
        ".io.restorecommerce.rendering.RenderRequest.Strategy": RenderRequest_Strategy,
        ".io.restorecommerce.rendering.RenderRequest.Template": exports.RenderRequest_Template,
        ".io.restorecommerce.rendering.RenderRequestList": exports.RenderRequestList,
        ".io.restorecommerce.rendering.RenderResult": exports.RenderResult,
        ".io.restorecommerce.rendering.RenderResult.Bodies": exports.RenderResult_Bodies,
        ".io.restorecommerce.rendering.RenderResponse": exports.RenderResponse,
        ".io.restorecommerce.rendering.RenderResponseList": exports.RenderResponseList,
    },
    dependencies: [any_1.protoMetadata, status_1.protoMetadata, auth_1.protoMetadata],
};
function bytesFromBase64(b64) {
    return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
}
function base64FromBytes(arr) {
    return globalThis.Buffer.from(arr).toString("base64");
}
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=rendering.js.map