"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
module.exports = ScenarioRouter;
var _jsxRuntime = require("react/jsx-runtime");
var _paymentReactHeadless = require("@blocklet/payment-react-headless");
var _scenarioDetector = require("../../utils/scenario-detector");
var _compositePanel = _interopRequireDefault(require("./composite-panel"));
var _creditTopupPanel = _interopRequireDefault(require("./credit-topup-panel"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const SubscriptionPanel = _compositePanel.default;
function ScenarioRouter() {
  const {
    session,
    items
  } = (0, _paymentReactHeadless.useSessionContext)();
  const scenario = (0, _scenarioDetector.detectScenario)(session, items);
  switch (scenario) {
    case "subscription":
      return /* @__PURE__ */(0, _jsxRuntime.jsx)(SubscriptionPanel, {});
    case "credit-topup":
      return /* @__PURE__ */(0, _jsxRuntime.jsx)(_creditTopupPanel.default, {});
    case "composite":
    default:
      return /* @__PURE__ */(0, _jsxRuntime.jsx)(_compositePanel.default, {});
  }
}