import { Ctx as i } from "./accelbyte-widgets33.mjs";
import { Container as e } from "unstated";
import { Platform as s } from "@accelbyte/sdk-platform";
class p extends e {
  constructor(t) {
    super(), this.fetchAdditionalAppInfo = async () => await s.ItemApi(this.sdk).getAppLocale_ByItemId(this.props.item.itemId), this.props = t, this.state = {
      isFetching: !1,
      additionalAppInfo: null,
      error: null
    }, this.sdk = i.getAppState().getSdk();
  }
  async requestAdditionalAppInfo() {
    try {
      if (this.state.isFetching)
        return;
      await this.setState({
        isFetching: !0,
        additionalAppInfo: null,
        error: null
      });
      const t = await this.fetchAdditionalAppInfo();
      await this.setState({
        additionalAppInfo: t
      });
    } catch (t) {
      this.setState({ error: t });
    } finally {
      this.setState({ isFetching: !1 });
    }
  }
}
export {
  p as StoreGridItemLogic
};
