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

  var _reporterNs, _cclegacy, _decorator, instantiate, UICoordinateTrackerComponent, EventHandler, OTWFlagComponent, _dec, _class, _crd, ccclass, property, OTWAreaFlagComponent;

  function _reportPossibleCrUseOfIArea(extras) {
    _reporterNs.report("IArea", "../../shared/gameClient/games/OccupationTheWarModels", _context.meta, extras);
  }

  function _reportPossibleCrUseOfIMap(extras) {
    _reporterNs.report("IMap", "../../shared/gameClient/games/OccupationTheWarModels", _context.meta, extras);
  }

  function _reportPossibleCrUseOfOTWFlagComponent(extras) {
    _reporterNs.report("OTWFlagComponent", "./OTWFlagComponent", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      instantiate = _cc.instantiate;
      UICoordinateTrackerComponent = _cc.UICoordinateTrackerComponent;
      EventHandler = _cc.EventHandler;
    }, function (_unresolved_2) {
      OTWFlagComponent = _unresolved_2.OTWFlagComponent;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "0e625TALKBG240Js/Q+1ty/", "OTWAreaFlagComponent", undefined);

      ({
        ccclass,
        property
      } = _decorator);

      _export("OTWAreaFlagComponent", OTWAreaFlagComponent = (_dec = ccclass('OTWAreaFlagComponent'), _dec(_class = class OTWAreaFlagComponent extends (_crd && OTWFlagComponent === void 0 ? (_reportPossibleCrUseOfOTWFlagComponent({
        error: Error()
      }), OTWFlagComponent) : OTWFlagComponent) {
        static createFlagNode(getMap, area, areaFlagPrefab, areaNode, mainCamera, gameMgrNode, handlerFnName) {
          var flag = instantiate(areaFlagPrefab);
          flag.name = areaNode.name;
          var flagComp = flag.getComponent(OTWAreaFlagComponent);
          flagComp.getMap = getMap;
          flagComp.areaIndex = area.areaIndex;
          flagComp.countryId = area.countryId;
          flagComp.updateShow();
          var c = areaNode.addComponent(UICoordinateTrackerComponent);
          c.target = flag;
          c.camera = mainCamera;
          var ev = new EventHandler();
          ev.target = gameMgrNode;
          ev.component = "OTWGameManager";
          ev.handler = handlerFnName;
          ev.customEventData = area.areaIndex.toString();
          c.syncEvents.push(ev);
          return flag;
        }

        updateShow() {
          super.updateShow();
          var area = this.getMap().allArea[this.areaIndex];
          this.Text.string += " " + area.troopsCurr;
        }

      }) || _class));

      _cclegacy._RF.pop();

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