import { jsx as s, jsxs as o } from "react/jsx-runtime";
import { s as e } from "./sl-types.js";
import { e as A } from "./index12.js";
import { e as Q, i as l } from "./index9.js";
import { B as m } from "./index6.js";
import { P as n, Q as r, a as h } from "./useStreamLayerApp2.js";
const S = /* @__PURE__ */ e("div")({
  name: "QuestionItem",
  class: "q1w97g3p",
  propsAsIs: !1
}), T = /* @__PURE__ */ e("div")({
  name: "QuestionCaption",
  class: "q2sl39u",
  propsAsIs: !1
}), f = /* @__PURE__ */ e("div")({
  name: "QuestionBody",
  class: "qd5h0uc",
  propsAsIs: !1
}), v = /* @__PURE__ */ e("div")({
  name: "QuestionAction",
  class: "q105uluy",
  propsAsIs: !1
}), L = () => m, i = /* @__PURE__ */ e(L())({
  name: "QuestionActionIcon",
  class: "q1fa0b9h",
  propsAsIs: !0
}), k = () => i, E = /* @__PURE__ */ e(k())({
  name: "QuestionCheckIcon",
  class: "qxlt78s",
  propsAsIs: !0
}), N = () => m, P = /* @__PURE__ */ e(N())({
  name: "QuestionTypeIcon",
  class: "qmg0vkx",
  propsAsIs: !0
}), b = /* @__PURE__ */ e("div")({
  name: "QuestionTypeLabel",
  class: "q1uz5j1g",
  propsAsIs: !1
}), g = /* @__PURE__ */ e("div")({
  name: "QuestionContent",
  class: "qc3icwa",
  propsAsIs: !1
}), w = /* @__PURE__ */ e("button")({
  name: "PlayButton",
  class: "p169lohr",
  propsAsIs: !1
}), x = /* @__PURE__ */ e("div")({
  name: "SkeletonContainer",
  class: "s1f43z3r",
  propsAsIs: !1
}), D = () => Q, B = /* @__PURE__ */ e(D())({
  name: "SkeletonButton",
  class: "s16k8geu",
  propsAsIs: !0
}), C = {
  [n.LOST]: /* @__PURE__ */ s(i, { name: "incorrectVoted" }),
  [n.WON]: /* @__PURE__ */ s(E, { name: "icon-check" }),
  [n.UNSET]: /* @__PURE__ */ s(i, { name: "icon-arrow" }),
  [n.DNP]: /* @__PURE__ */ s(i, { name: "icon-arrow" })
}, F = () => /* @__PURE__ */ o(x, { children: [
  /* @__PURE__ */ s(l, { loading: !0, style: { width: "35%" } }),
  /* @__PURE__ */ s(l, { loading: !0, style: { width: "70%" } }),
  /* @__PURE__ */ s(B, {})
] }), O = ({ questionTypeData: t, questionType: a, questionStatus: p }) => /* @__PURE__ */ o(T, { className: "SL_QuestionCaption", children: [
  /* @__PURE__ */ s(
    P,
    {
      className: "SL_QuestionTypeIcon",
      "data-testid": "question-type-icon",
      "data-type-trivia": a === r.TRIVIA,
      "data-type-poll": a === r.POLL,
      name: t.iconName
    }
  ),
  /* @__PURE__ */ o(b, { className: "SL_QuestionTypeLabel", children: [
    t.label,
    a === r.TRIVIA && p === h.RESOLVED && " • Expired"
  ] })
] }), H = ({
  questionId: t,
  questionType: a,
  questionStatus: p,
  subject: d,
  openForVoting: I,
  status: y
}) => {
  const c = A[a], q = C[y];
  return c ? /* @__PURE__ */ o(S, { "data-a": "intr", "data-name": t, children: [
    /* @__PURE__ */ o(g, { children: [
      /* @__PURE__ */ s(
        O,
        {
          questionTypeData: c,
          questionType: a,
          questionStatus: p
        }
      ),
      /* @__PURE__ */ s(f, { children: d || "" })
    ] }),
    /* @__PURE__ */ s(v, { children: I ? /* @__PURE__ */ s(w, { "data-a": "intr", "data-name": t, children: "Play" }) : q })
  ] }) : null;
};
var u;
(function(t) {
  t.OPENED = "opened";
})(u || (u = {}));
export {
  F as D,
  H as R,
  w as S,
  S as r,
  O as x
};
