import { defineComponent as y, ref as a, onMounted as k, createElementBlock as u, openBlock as r, normalizeStyle as p, createElementVNode as T, normalizeClass as m, Fragment as f, renderList as B, createCommentVNode as _, createBlock as C } from "vue";
import N from "./video/videos-h5player.vue.mjs";
const I = ["onClick"], b = y({ name: "zv-hj-video-common" }), F = /* @__PURE__ */ y({
  ...b,
  props: {
    width: {},
    height: {},
    row: { default: 3 },
    col: { default: 3 },
    showToolBar: { type: Boolean, default: !1 },
    sourceType: { default: "onepage" }
  },
  setup(h) {
    const n = h, s = a(!1), c = a(0), t = a(0), l = a(0), g = a(0), v = a([]);
    t.value = n.col, l.value = n.row, c.value = n.row * n.col;
    for (let e = 0; e < c.value; e++)
      v.value.push({ video_Type: "HK" });
    k(() => {
      var e;
      (e = document == null ? void 0 : document.querySelector(".video_list")) == null || e.addEventListener("fullscreenchange", function(d) {
        s.value = !s.value;
      });
    });
    const w = (e, d) => {
    };
    return (e, d) => (r(), u("div", {
      class: "video",
      style: p({ width: e.width + "px", height: e.height + "px" })
    }, [
      T("div", {
        class: m(["video_list", e.showToolBar ? "" : "no_bottom", s.value ? "video_list_active" : ""]),
        style: p({ gridTemplateRows: "repeat(" + l.value + ", 1fr)", gridTemplateColumns: "repeat(" + (t.value * l.value == 6 || t.value * l.value == 8 ? l.value : t.value) + ", 1fr)" })
      }, [
        (r(!0), u(f, null, B(v.value, (i, o) => (r(), u("div", {
          key: "A" + o,
          class: m([
            "video_grid_item",
            g.value === o ? "active_grid_border" : "",
            o == 0 && t.value * l.value == 6 ? "video_grid_item_6" : "",
            o == 0 && t.value * l.value == 8 ? "video_grid_item_8" : ""
          ]),
          onClick: (z) => w()
        }, [
          i.video_Type && !i.playbackInRealplay ? (r(), u(f, { key: 0 }, [
            i.video_Type == "HK" ? (r(), C(N, {
              id: "player" + (o + 1),
              ref_for: !0,
              ref: "player" + o,
              key: "B" + o,
              "f-index": o,
              "source-page": e.sourceType,
              "span-num": 1,
              "play-type": "realplay",
              "span-style": { width: "100%", height: "100%" },
              "device-info": i
            }, null, 8, ["id", "f-index", "source-page", "device-info"])) : _("", !0)
          ], 64)) : _("", !0)
        ], 10, I))), 128))
      ], 6)
    ], 4));
  }
});
export {
  F as default
};
