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}); const s = t("App"), o = t("BaseView"), a = (t("ViewConst"), t("TimeCom")), {property: n, ccclass: r, menu: l} = cc._decorator; t = class extends o.default { constructor() { super(...arguments), (this.item = null), (this.content = null), (this.arrow = null), (this.rePoint = null), (this.isPlayIng = !1), (this.controller = null), (this.bgType = 0); } initUI() { super.initUI(), (this.itemMap = new Map()); } open() { super.open(); } updateBuffItem(e, i) { if (!this.itemMap.has(i.buffIndex)) { let t = cc.instantiate(this.item); this.content.addChild(t), (t.y = 30 * this.itemMap.size + 50), this.itemMap.set(i.buffIndex, t.getComponent(a.TimeCom)), this.itemMap.get(i.buffIndex).setIcon(e), (this.content.height = 30 * this.itemMap.size + 50); } this.itemMap.get(i.buffIndex).setTime(i.buffEndTime), (this.arrow.active = !0), (this.rePoint.active = !1), this.content.active && this.hideItem(); } updateTime(i) { this.itemMap && (this.itemMap.forEach((t, e) => { t.updateTime(i) && (t.node.removeFromParent(), t.destroy(), this.itemMap.delete(e)); }), this.itemMap.size || ((this.rePoint.active = !0), (this.arrow.active = !1))); } showItem() { var t = 30 * this.itemMap.size + 48; (this.isPlayIng = !0), (this.arrow.scaleY = -1), cc .tween(this.arrow) .to(0.1, {y: t}) .call(() => { (this.content.active = !0), (this.isPlayIng = !1); }) .start(); } hideItem() { (this.isPlayIng = !0), (this.content.active = !1), (this.arrow.scaleY = 1), cc .tween(this.arrow) .to(0.1, {y: 48}) .call(() => { this.isPlayIng = !1; }) .start(); } onTouchIcon() { s.default.ViewManager.open(28); } onTouchArrow() { this.isPlayIng || (this.content.active ? this.hideItem() : this.showItem()); } }; e([n(cc.Prefab)], t.prototype, "item", void 0), e([n(cc.Node)], t.prototype, "content", void 0), e([n(cc.Node)], t.prototype, "arrow", void 0), e([n(cc.Node)], t.prototype, "rePoint", void 0), (t = e([r, l("view/Shop/ShopBuffViewIcon")], t)), (i.default = t);