System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Button, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _crd, ccclass, property, menu, requireComponent, disallowMultiple, btnAdapter;

  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }

  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }

  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      Button = _cc.Button;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "d76b99m+wNN3J6d5TJ6oKxe", "btn_adapter", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Button']);

      ({
        ccclass,
        property,
        menu,
        requireComponent,
        disallowMultiple
      } = _decorator); //按钮适配脚本

      _export("btnAdapter", btnAdapter = (_dec = ccclass("btnAdapter"), _dec2 = menu('自定义组件/btnAdapter'), _dec3 = requireComponent(Button), _dec4 = property({
        tooltip: '点击后是否播放点击音效'
      }), _dec5 = property({
        tooltip: '点击音效名'
      }), _dec6 = property({
        tooltip: '是否禁止快速二次点击'
      }), _dec7 = property({
        tooltip: '点击后多久才能再次点击,仅isPreventSecondClick为true生效'
      }), _dec(_class = _dec2(_class = _dec3(_class = disallowMultiple(_class = (_class2 = class btnAdapter extends Component {
        constructor() {
          super(...arguments);

          /**
           * 点击后是否播放点击音效
           * @property isPlaySound
           * @type {Boolean}
           * @default false
           */
          _initializerDefineProperty(this, "isPlaySound", _descriptor, this);

          /**
           * 点击音效名
           * @property clickSoundName
           * @type {String}
           * @default false
           */
          _initializerDefineProperty(this, "clickSoundName", _descriptor2, this);

          /**
           * 是否禁止快速二次点击
           * @property isPreventSecondClick
           * @type {Boolean}
           * @default true
           */
          _initializerDefineProperty(this, "isPreventSecondClick", _descriptor3, this);

          /**
           * 点击后多久才能再次点击,仅isPreventSecondClick为true生效
           * @property preventTime
           * @type {number}
           * @default true
           */
          _initializerDefineProperty(this, "preventTime", _descriptor4, this);
        }

        start() {
          var button = this.node.getComponent(Button);
          this.node.on('click', () => {
            //外部可能会修改interactable，所以这里需要做判断：不可交互则跳过点击监听
            if (!button.interactable) {
              return;
            }

            if (this.isPreventSecondClick) {
              button.interactable = false;
              this.scheduleOnce(() => {
                if (button.node) button.interactable = true;
              }, this.preventTime);
            }
          });
        } // update (dt) {},


      }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "isPlaySound", [_dec4], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return false;
        }
      }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "clickSoundName", [_dec5], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return 'click';
        }
      }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "isPreventSecondClick", [_dec6], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return false;
        }
      }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "preventTime", [_dec7], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return 2;
        }
      })), _class2)) || _class) || _class) || _class) || _class));

      ;

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=03ad27a534be83442e971a820657af5436a206e2.js.map