var t = require; var e = module; var i = exports; e = (this && this.__decorate) || function (t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", {value: !0}), (i.CostumeBagItem = void 0); const s = t("App"), o = (t("ViewConst"), t("GameConst")), a = t("CostumeConst"), {ccclass: n, property: r} = cc._decorator; t = class extends cc.Component { constructor() { super(...arguments), (this.typeIcon = null), (this.icon = null), (this.bgSpr = null), (this.lvLab = null), (this.data = null), (this.arrowList = null), (this.recommendNode = null); } setData(t) { (this.data = t), this.lvLab && (this.lvLab.string = "Lv." + t.data.lv), s.default.CommonUtils.setSpriteFrame(a.getRarityUrlByGrade(t.data.grade), this.bgSpr), s.default.CommonUtils.setSpriteFrameByBundle(o.BundleType.MAP_ICON, t.getIcon(), this.icon), s.default.CommonUtils.setSpriteFrameByBundle(o.BundleType.MAP_ICON, t.getTypeIcon(), this.typeIcon); var e = a.getGradeLv(t.data.grade); const i = this.arrowList.children; for (let t = 0; t < i.length; t++) i[t].active = t < e; } hide() { (this.data = null), (this.lvLab.node.active = this.typeIcon.node.active = this.icon.node.active = !1), s.default.CommonUtils.setSpriteFrame(a.getRarityUrlByGrade(a.RarityType.none), this.bgSpr); } show() { this.lvLab.node.active = this.typeIcon.node.active = this.icon.node.active = !0; } onToucItem() { s.default.ViewManager.open(26, this.data); } }; e([r(cc.Sprite)], t.prototype, "typeIcon", void 0), e([r(cc.Sprite)], t.prototype, "icon", void 0), e([r(cc.Sprite)], t.prototype, "bgSpr", void 0), e([r(cc.Label)], t.prototype, "lvLab", void 0), e([r(cc.Node)], t.prototype, "arrowList", void 0), e([r(cc.Node)], t.prototype, "recommendNode", void 0), (t = e([n()], t)), (i.CostumeBagItem = t);