System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
  "use strict";

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, MeshRenderer, instantiate, platformSystem, BasePanel, audioMgr, Data, ResUtil, GameConst, levelsData, _dec, _class, _crd, ccclass, property, NewPackOpenedLayer;

  function _reportPossibleCrUseOfplatformSystem(extras) {
    _reporterNs.report("platformSystem", "../platform/platformSystem", _context.meta, extras);
  }

  function _reportPossibleCrUseOfBasePanel(extras) {
    _reporterNs.report("BasePanel", "../core/component/BasePanel", _context.meta, extras);
  }

  function _reportPossibleCrUseOfaudioMgr(extras) {
    _reporterNs.report("audioMgr", "../core/manager/AudioManager", _context.meta, extras);
  }

  function _reportPossibleCrUseOfData(extras) {
    _reporterNs.report("Data", "../core/manager/Data", _context.meta, extras);
  }

  function _reportPossibleCrUseOfResUtil(extras) {
    _reporterNs.report("ResUtil", "../core/utils/ResUtil", _context.meta, extras);
  }

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

  function _reportPossibleCrUseOflevelsData(extras) {
    _reporterNs.report("levelsData", "../user/LevelsData", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
      MeshRenderer = _cc.MeshRenderer;
      instantiate = _cc.instantiate;
    }, function (_unresolved_2) {
      platformSystem = _unresolved_2.default;
    }, function (_unresolved_3) {
      BasePanel = _unresolved_3.default;
    }, function (_unresolved_4) {
      audioMgr = _unresolved_4.audioMgr;
    }, function (_unresolved_5) {
      Data = _unresolved_5.default;
    }, function (_unresolved_6) {
      ResUtil = _unresolved_6.ResUtil;
    }, function (_unresolved_7) {
      GameConst = _unresolved_7.GameConst;
    }, function (_unresolved_8) {
      levelsData = _unresolved_8.levelsData;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "95f086kzGRB7ZwROVD6GqqD", "NewPackOpenedLayer", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node', 'MeshRenderer', 'instantiate']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("NewPackOpenedLayer", NewPackOpenedLayer = (_dec = ccclass('NewPackOpenedLayer'), _dec(_class = class NewPackOpenedLayer extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        onBtnClicked(event, customEventData) {
          (_crd && audioMgr === void 0 ? (_reportPossibleCrUseOfaudioMgr({
            error: Error()
          }), audioMgr) : audioMgr).playOneShot((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
            error: Error()
          }), GameConst) : GameConst).audios.btnclick);
          this.close();
        }

        show() {
          (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
            error: Error()
          }), platformSystem) : platformSystem).platform.showInterstitialAd();
          let node_items = this.GetGameObject("node_items");
          node_items.children.map(a => a.active = false);
          let ids = [];
          let OpenItems = (_crd && levelsData === void 0 ? (_reportPossibleCrUseOflevelsData({
            error: Error()
          }), levelsData) : levelsData).getModesNames();

          for (var i = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex; i < (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex + 8 && i < OpenItems.length; ++i) {
            ids.push(OpenItems[i]);
          }

          for (var i = 0; i < node_items.children.length; ++i) {
            let child = node_items.children[i];
            child.active = true;
            this.setMesh(child, ids[i]);
          }

          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex += 8;
          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex = Math.min((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex, OpenItems.length - 1);
          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).save();
        }

        setMesh(node, name) {
          (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
            error: Error()
          }), ResUtil) : ResUtil).loadModelPrefabName(name).then(res => {
            let tmp = instantiate(res);
            let render = tmp.getComponentInChildren(MeshRenderer);
            let mesh = render.mesh;
            node.scale = render.node.scale.multiplyScalar(100);
            node.getComponent(MeshRenderer).mesh = mesh;
            tmp.destroy();
          });
        }

      }) || _class));

      _cclegacy._RF.pop();

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