"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickEditArgsDto = void 0;
const class_validator_1 = require("class-validator");
const sanitizer_decorator_1 = require("./sanitizer.decorator");
class QuickEditArgsDto {
    constructor() {
        this.action = 'replace';
    }
}
exports.QuickEditArgsDto = QuickEditArgsDto;
__decorate([
    (0, class_validator_1.IsString)({ message: 'file_path must be a string.' }),
    (0, class_validator_1.IsNotEmpty)({ message: 'file_path must not be empty.' }),
    __metadata("design:type", String)
], QuickEditArgsDto.prototype, "file_path", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsIn)(['insert_after', 'insert_before', 'replace', 'delete_block'], {
        message: 'action must be one of: insert_after, insert_before, replace, delete_block.',
    }),
    __metadata("design:type", String)
], QuickEditArgsDto.prototype, "action", void 0);
__decorate([
    (0, sanitizer_decorator_1.SanitizeCodeBlock)(),
    (0, class_validator_1.IsString)({ message: 'search_block must be a string.' }),
    (0, class_validator_1.IsNotEmpty)({ message: 'search_block must not be empty.' }),
    __metadata("design:type", String)
], QuickEditArgsDto.prototype, "search_block", void 0);
__decorate([
    (0, class_validator_1.ValidateIf)((o) => !o.action ||
        o.action === 'insert_after' ||
        o.action === 'insert_before' ||
        o.action === 'replace'),
    (0, class_validator_1.IsDefined)({
        message: 'new_content is required for insert_after, insert_before, and replace actions.',
    }),
    (0, class_validator_1.IsString)({ message: 'new_content must be a string.' }),
    (0, sanitizer_decorator_1.SanitizeCodeBlock)(),
    __metadata("design:type", String)
], QuickEditArgsDto.prototype, "new_content", void 0);
//# sourceMappingURL=quick-edit.args.dto.js.map