"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZfbTransform = void 0;
const strings_1 = require("@angular-devkit/core/src/utils/strings");
const static_injector_1 = require("static-injector");
const wx_transform_base_1 = require("../template-transform-strategy/wx-like/wx-transform.base");
const i0 = __importStar(require("static-injector"));
const BIND_PREFIX_REGEXP = /^(bind|mut-bind|capture-bind)(.*)/;
const CATCH_PREFIX_REGEXP = /^(catch|capture-catch)(.*)/;
class ZfbTransform extends wx_transform_base_1.WxTransformLike {
    constructor() {
        super(...arguments);
        this.directivePrefix = 'a';
    }
    eventNameConvert(name) {
        let result = name.match(BIND_PREFIX_REGEXP);
        if (result) {
            return {
                prefix: 'on',
                type: result[2],
                name: `on${(0, strings_1.capitalize)(result[2])}`,
            };
        }
        result = name.match(CATCH_PREFIX_REGEXP);
        if (result) {
            return {
                prefix: 'catch',
                type: result[2],
                name: `catch${(0, strings_1.capitalize)(result[2])}`,
            };
        }
        return {
            prefix: 'on',
            type: name,
            name: `on${(0, strings_1.capitalize)(name)}`,
        };
    }
}
ZfbTransform.ɵfac = /*@__PURE__*/ function () { let ɵZfbTransform_BaseFactory; return function ZfbTransform_Factory(t) { return (ɵZfbTransform_BaseFactory || (ɵZfbTransform_BaseFactory = i0.ɵɵgetInheritedFactory(ZfbTransform)))(t || ZfbTransform); }; }();
ZfbTransform.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ZfbTransform, factory: ZfbTransform.ɵfac });
exports.ZfbTransform = ZfbTransform;
