import { __extends } from "tslib";
import { PDFArray, PDFName } from "../..";
import { PDFAcroButton } from './index';
var PDFCheckBox = /** @class */ (function (_super) {
    __extends(PDFCheckBox, _super);
    function PDFCheckBox(dict) {
        var _this = _super.call(this, dict) || this;
        _this.unsetFlag(16);
        _this.unsetFlag(17);
        return _this;
    }
    PDFCheckBox.fromDict = function (dict) {
        return new PDFCheckBox(dict);
    };
    PDFCheckBox.prototype.Opt = function () {
        return this.dict.lookupMaybe(PDFName.Opt, PDFArray);
    };
    PDFCheckBox.prototype.getOptions = function () {
        var optionsArray = this.Opt();
        return optionsArray ? optionsArray.lookupElements(PDFName) : [];
    };
    PDFCheckBox.prototype.check = function () {
        this.dict.set(PDFName.V, PDFName.Yes);
    };
    PDFCheckBox.prototype.uncheck = function () {
        this.dict.set(PDFName.V, PDFName.Off);
    };
    PDFCheckBox.prototype.toggle = function () {
        var value = this.getValue();
        if (value === PDFName.Yes) {
            this.uncheck();
        }
        else {
            this.check();
        }
    };
    PDFCheckBox.prototype.setValue = function (value) {
        this.dict.set(PDFName.V, value);
    };
    return PDFCheckBox;
}(PDFAcroButton));
export default PDFCheckBox;
//# sourceMappingURL=PDFCheckBox.js.map