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

  var _reporterNs, _cclegacy, ITEM_TYPE, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _crd, savepars, UserModel;

  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 ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }

  function save(target, propertyKey) {
    savepars.push(propertyKey);
  }

  function _reportPossibleCrUseOfITEM_TYPE(extras) {
    _reporterNs.report("ITEM_TYPE", "../../core/common/GameConst", _context.meta, extras);
  }

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

      _cclegacy._RF.push({}, "b4ba1iTJkxJF5YRmpQZFJBZ", "UserModel", undefined);

      savepars = [];

      //用户数据模型
      _export("default", UserModel = (_class = class UserModel {
        constructor() {
          this.js_code = "";

          _initializerDefineProperty(this, "nickName", _descriptor, this);

          _initializerDefineProperty(this, "avatarUrl", _descriptor2, this);

          _initializerDefineProperty(this, "openid", _descriptor3, this);

          _initializerDefineProperty(this, "magnet", _descriptor4, this);

          _initializerDefineProperty(this, "frozen", _descriptor5, this);

          _initializerDefineProperty(this, "hint", _descriptor6, this);

          _initializerDefineProperty(this, "time", _descriptor7, this);

          _initializerDefineProperty(this, "soundVolume", _descriptor8, this);

          _initializerDefineProperty(this, "vibration", _descriptor9, this);

          _initializerDefineProperty(this, "lvboxDrawInfo", _descriptor10, this);

          _initializerDefineProperty(this, "starboxDrawInfo", _descriptor11, this);

          this.useMagnet = false;
          this.useTime = false;

          _initializerDefineProperty(this, "life", _descriptor12, this);

          _initializerDefineProperty(this, "coin", _descriptor13, this);

          _initializerDefineProperty(this, "lv", _descriptor14, this);

          _initializerDefineProperty(this, "star", _descriptor15, this);

          _initializerDefineProperty(this, "openIndex", _descriptor16, this);

          _initializerDefineProperty(this, "life_cost_time", _descriptor17, this);

          this.self_rank = -1;

          _initializerDefineProperty(this, "invite_draw_info", _descriptor18, this);

          _initializerDefineProperty(this, "storeup", _descriptor19, this);

          this.launch_from_my_minigame = false;
          this.query = null;

          _initializerDefineProperty(this, "signinfo", _descriptor20, this);

          _initializerDefineProperty(this, "lastlogintime", _descriptor21, this);

          _initializerDefineProperty(this, "onlineTime", _descriptor22, this);

          _initializerDefineProperty(this, "drawed_online_reward_ids", _descriptor23, this);

          this.serverTime = 0;
        }

        //等级宝箱领取状态
        //每10关
        hasLvBox() {
          let key = Math.floor(this.lv / 10);
          return key != 0 && !this.lvboxDrawInfo[key];
        }

        hasStarBox() {
          let key = Math.floor(this.star / 1000);
          return key != 0 && !this.starboxDrawInfo[key];
        }

        addItem(type, num = 1) {
          switch (type) {
            case (_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
              error: Error()
            }), ITEM_TYPE) : ITEM_TYPE).Coin:
              this.coin += num;
              break;

            case (_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
              error: Error()
            }), ITEM_TYPE) : ITEM_TYPE).Magnet:
              this.magnet += num;
              break;

            case (_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
              error: Error()
            }), ITEM_TYPE) : ITEM_TYPE).Hint:
              this.hint += num;
              break;

            case (_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
              error: Error()
            }), ITEM_TYPE) : ITEM_TYPE).Frozen:
              this.frozen += num;
              break;

            case (_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
              error: Error()
            }), ITEM_TYPE) : ITEM_TYPE).Time:
              this.time += num;
              break;

            default:
              debugger;
              break;
          }
        }

        //检查每日邀请是否领取奖励
        checkDayInviteIsDraw(cn) {
          if (!this.invite_draw_info["day"]) this.invite_draw_info["day"] = {};
          return this.invite_draw_info["day"][cn] == 1;
        }

        inviteDayDraw(cn) {
          if (!this.invite_draw_info["day"]) this.invite_draw_info["day"] = {};
          return this.invite_draw_info["day"][cn] = 1;
        } //检查新邀请是否领取奖励


        checkNewInviteIsDraw(cn) {
          if (!this.invite_draw_info["new"]) this.invite_draw_info["new"] = {};
          return this.invite_draw_info["new"][cn] == 1;
        }

        inviteNewDraw(cn) {
          if (!this.invite_draw_info["new"]) this.invite_draw_info["new"] = {};
          return this.invite_draw_info["new"][cn] = 1;
        }

        getUploadData() {
          var data = {};
          this.serverTime = Date.now();

          for (var i = 0; i < savepars.length; ++i) {
            data[savepars[i]] = this[savepars[i]];
          }

          return data;
        }

        setData(data) {
          //初始化下数据       
          if (!data) {
            return;
          }

          for (var i = 0; i < savepars.length; ++i) {
            const element = data[savepars[i]];

            if (element != null || element != undefined) {
              if (Object.prototype.toString.call(element) == "[object Object]") {
                for (const key in element) {
                  this[savepars[i]][key] = element[key];
                }
              } else this[savepars[i]] = element;
            }
          }
        }

      }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "nickName", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return "";
        }
      }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "avatarUrl", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return "";
        }
      }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "openid", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return "";
        }
      }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, "magnet", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, "frozen", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, "hint", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, "time", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, "soundVolume", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 1;
        }
      }), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, "vibration", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 1;
        }
      }), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, "lvboxDrawInfo", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return {};
        }
      }), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, "starboxDrawInfo", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return {};
        }
      }), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, "life", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 5;
        }
      }), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, "coin", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 500;
        }
      }), _descriptor14 = _applyDecoratedDescriptor(_class.prototype, "lv", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 1;
        }
      }), _descriptor15 = _applyDecoratedDescriptor(_class.prototype, "star", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor16 = _applyDecoratedDescriptor(_class.prototype, "openIndex", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor17 = _applyDecoratedDescriptor(_class.prototype, "life_cost_time", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor18 = _applyDecoratedDescriptor(_class.prototype, "invite_draw_info", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return {};
        }
      }), _descriptor19 = _applyDecoratedDescriptor(_class.prototype, "storeup", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return false;
        }
      }), _descriptor20 = _applyDecoratedDescriptor(_class.prototype, "signinfo", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return {
            sign_index: 0,
            sign_time: 0,
            sign_beisu: 1
          };
        }
      }), _descriptor21 = _applyDecoratedDescriptor(_class.prototype, "lastlogintime", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor22 = _applyDecoratedDescriptor(_class.prototype, "onlineTime", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return 0;
        }
      }), _descriptor23 = _applyDecoratedDescriptor(_class.prototype, "drawed_online_reward_ids", [save], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function () {
          return [];
        }
      })), _class));

      _cclegacy._RF.pop();

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