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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, constants, _dec, _class, _class2, _crd, ccclass, property, stateManager;

  function _reportPossibleCrUseOfconstants(extras) {
    _reporterNs.report("constants", "../data/constants", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
    }, function (_unresolved_2) {
      constants = _unresolved_2.constants;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "f022bEI7uxEAp0tVku3N+ot", "stateManager", undefined);

      __checkObsolete__(['_decorator', 'Label']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("stateManager", stateManager = (_dec = ccclass('stateManager'), _dec(_class = (_class2 = class stateManager {
        constructor() {
          this.uiBindings = new Map();
        }

        //获取单例实例
        static ins() {
          if (!this.instance) {
            this.instance = new stateManager();
          }

          return this.instance;
        }
        /**
         * 注册UI组件
         * @param field 注册的key uiName
         * @param label 具体的文本
         */


        registerUI(field, label) {
          if (!this.uiBindings.has(field)) {
            this.uiBindings.set(field, []);
          } //将UI组件添加到绑定列表


          var uiArr = this.uiBindings.get(field);

          if (!uiArr.includes(label)) {
            uiArr.push(label);
          } //初始化UI显示


          this.updateSingleUI(field, label);
        }
        /**
         * 全局更新所有绑定该字段
         * @param field 注册的key uiName
         */


        updateAllUI(field) {
          var labels = this.uiBindings.get(field);

          if (labels) {
            labels.forEach(label => {
              this.updateSingleUI(field, label);
            });
          }
        }
        /**
         * 更新单个UI组件
         * @param field 
         * @param label 
         */


        updateSingleUI(field, com) {
          if (field == (_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).playerInfoData) {//玩家信息变化
            //com.string = `${storageData.pureCount}`;
            //com.refreshData();
          } else if (field == (_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).playerName) {//玩家名字变化
          }
        }

      }, _class2.instance = void 0, _class2)) || _class));

      _export("default", stateManager.ins());

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=7f8e9b48f52a3585f217aed8e441765666481bd5.js.map