import { extend, globalDefine, isBlank, noop } from '@jscrpt/common';
globalDefine(global => {
    if (isBlank(global.ngDesignerMetadata)) {
        global.ngDesignerMetadata = true;
    }
});
/**
 * Sets dynamic metadata to for property
 * @param value - Object with metadata to be stored
 * @param property - Property definition symbol
 */
export function DynamicPropertyMetadata(value, property) {
    if (ngDesignerMetadata) {
        return function (target, propertyKey) {
            var _a, _b;
            var _c;
            const metadata = (_a = Reflect.get(target, property)) !== null && _a !== void 0 ? _a : {};
            const propertyMetadata = (_b = metadata[_c = propertyKey]) !== null && _b !== void 0 ? _b : (metadata[_c] = {});
            extend(true, propertyMetadata, value);
            if (!Reflect.has(target, property)) {
                Reflect.defineProperty(target, property, {
                    value: metadata
                });
            }
        };
    }
    return noop;
}
//# sourceMappingURL=dynamicPropertyMetadata.decorator.js.map