/*!
 * KoliBri - The accessible HTML-Standard
 */
import { emptyStringByArrayHandler, objectObjectHandler, parseJson, setState } from "../utils";
export const validateToolbarItems = (component, value) => {
    emptyStringByArrayHandler(value, () => {
        objectObjectHandler(value, () => {
            if (typeof value === 'undefined') {
                value = [];
            }
            try {
                value = parseJson(value);
            }
            catch (_a) {
            }
            if (Array.isArray(value) && value.every((items) => typeof items === 'object' && items !== null)) {
                setState(component, '_items', value);
            }
        });
    });
};
//# sourceMappingURL=toolbar-items.js.map
