import '@das-fed/ui/packages/business-components/video-dialog/style.css';
import { getCurrentScope as ce, onScopeDispose as ue, getCurrentInstance as de, onMounted as J, nextTick as P, unref as l, ref as w, watch as R, defineComponent as O, useCssVars as pe, computed as U, createElementBlock as S, openBlock as p, normalizeClass as ve, renderSlot as ee, createCommentVNode as b, Fragment as x, renderList as fe, createBlock as N, withCtx as y, withModifiers as _, createVNode as v, createElementVNode as f, toDisplayString as V, toRefs as me } from "vue";
import { withInstall as ye } from "@das-fed/utils/with-install/index";
import { t as C, setI18nRule as Ce } from "@das-fed/web/packages/i18n/index";
import { DasDialog as ge } from "@das-fed/ui/packages/components/dialog/index";
import { DasTooltip as h } from "@das-fed/ui/packages/components/tooltip/index";
import { DasIconFullscreen2 as ke } from "@das-fed/ui/packages/icons/fullscreen-2/index";
import { DasAutoRegisterIcon as _e, DasIcon as $ } from "@das-fed/ui/packages/components/icon/index";
import { DasLivePlayer as we } from "@das-fed/ui/packages/components/live-player/index";
import { DasSpin as he } from "@das-fed/ui/packages/components/spin/index";
import { DasHlsPlayer as be } from "@das-fed/ui/packages/components/hls-player/index";
import Ie from "dayjs";
import { createService as te } from "@das-fed/utils/api-services/src/create-service";
import { getProjectInfo as A, getToken as Ee } from "@das-fed/utils/common-info";
var Q;
const j = typeof window < "u", Ne = (t) => typeof t == "string", Fe = () => {
};
j && ((Q = window == null ? void 0 : window.navigator) != null && Q.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function oe(t) {
  return typeof t == "function" ? t() : l(t);
}
function Re(t) {
  return t;
}
function ne(t) {
  return ce() ? (ue(t), !0) : !1;
}
function Se(t, n = !0) {
  de() ? J(t) : n ? t() : P(t);
}
function le(t) {
  var n;
  const e = oe(t);
  return (n = e == null ? void 0 : e.$el) != null ? n : e;
}
const ze = j ? window : void 0, De = j ? window.document : void 0;
function Oe(...t) {
  let n, e, i, r;
  if (Ne(t[0]) || Array.isArray(t[0]) ? ([e, i, r] = t, n = ze) : [n, e, i, r] = t, !n)
    return Fe;
  Array.isArray(e) || (e = [e]), Array.isArray(i) || (i = [i]);
  const o = [], a = () => {
    o.forEach((c) => c()), o.length = 0;
  }, g = (c, d, k, I) => (c.addEventListener(d, k, I), () => c.removeEventListener(d, k, I)), s = R(() => [le(n), oe(r)], ([c, d]) => {
    a(), c && o.push(...e.flatMap((k) => i.map((I) => g(c, k, I, d))));
  }, { immediate: !0, flush: "post" }), m = () => {
    s(), a();
  };
  return ne(m), m;
}
function Le(t, n = !1) {
  const e = w(), i = () => e.value = !!t();
  return i(), Se(i, n), e;
}
const q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, G = "__vueuse_ssr_handlers__";
q[G] = q[G] || {};
const W = [
  [
    "requestFullscreen",
    "exitFullscreen",
    "fullscreenElement",
    "fullscreenEnabled",
    "fullscreenchange",
    "fullscreenerror"
  ],
  [
    "webkitRequestFullscreen",
    "webkitExitFullscreen",
    "webkitFullscreenElement",
    "webkitFullscreenEnabled",
    "webkitfullscreenchange",
    "webkitfullscreenerror"
  ],
  [
    "webkitRequestFullScreen",
    "webkitCancelFullScreen",
    "webkitCurrentFullScreenElement",
    "webkitCancelFullScreen",
    "webkitfullscreenchange",
    "webkitfullscreenerror"
  ],
  [
    "mozRequestFullScreen",
    "mozCancelFullScreen",
    "mozFullScreenElement",
    "mozFullScreenEnabled",
    "mozfullscreenchange",
    "mozfullscreenerror"
  ],
  [
    "msRequestFullscreen",
    "msExitFullscreen",
    "msFullscreenElement",
    "msFullscreenEnabled",
    "MSFullscreenChange",
    "MSFullscreenError"
  ]
];
function ie(t, n = {}) {
  const { document: e = De, autoExit: i = !1 } = n, r = t || (e == null ? void 0 : e.querySelector("html")), o = w(!1);
  let a = W[0];
  const g = Le(() => {
    if (e) {
      for (const F of W)
        if (F[1] in e)
          return a = F, !0;
    } else
      return !1;
    return !1;
  }), [s, m, c, , d] = a;
  async function k() {
    g.value && (e != null && e[c] && await e[m](), o.value = !1);
  }
  async function I() {
    if (!g.value)
      return;
    await k();
    const F = le(r);
    F && (await F[s](), o.value = !0);
  }
  async function L() {
    o.value ? await k() : await I();
  }
  return e && Oe(e, d, () => {
    o.value = !!(e != null && e[c]);
  }, !1), i && ne(k), {
    isSupported: g,
    isFullscreen: o,
    enter: I,
    exit: k,
    toggle: L
  };
}
var Y;
(function(t) {
  t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE";
})(Y || (Y = {}));
var $e = Object.defineProperty, Z = Object.getOwnPropertySymbols, Pe = Object.prototype.hasOwnProperty, Ue = Object.prototype.propertyIsEnumerable, K = (t, n, e) => n in t ? $e(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e, xe = (t, n) => {
  for (var e in n || (n = {}))
    Pe.call(n, e) && K(t, e, n[e]);
  if (Z)
    for (var e of Z(n))
      Ue.call(n, e) && K(t, e, n[e]);
  return t;
};
const Te = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
xe({
  linear: Re
}, Te);
const Be = /* @__PURE__ */ O({
  __name: "GridItem",
  props: {
    active: { type: Boolean },
    gridNum: {}
  },
  emits: ["itemClick"],
  setup(t, { emit: n }) {
    pe((c) => ({
      "9b3a2c32": m.value
    }));
    const e = t, i = n, r = w(), { toggle: o, isFullscreen: a } = ie(r), g = () => {
      r.value != document.fullscreenElement && (a.value ? (a.value = !1, P(() => {
        o();
      })) : o());
    }, s = () => {
      i("itemClick");
    }, m = U(() => `calc(100% / ${Math.sqrt(e.gridNum)})`);
    return (c, d) => (p(), S(
      "div",
      {
        ref_key: "containerRef",
        ref: r,
        class: ve(["wrapper", { "is-active": e.active }]),
        onDblclick: d[0] || (d[0] = (k) => g()),
        onClick: d[1] || (d[1] = (k) => s())
      },
      [
        ee(c.$slots, "default", {}, void 0, !0)
      ],
      34
      /* CLASS, NEED_HYDRATION */
    ));
  }
}), T = (t, n) => {
  const e = t.__vccOpts || t;
  for (const [i, r] of n)
    e[i] = r;
  return e;
}, He = /* @__PURE__ */ T(Be, [["__scopeId", "data-v-100b67ca"]]), Ve = { class: "layout-wrapper" }, je = /* @__PURE__ */ O({
  __name: "GridLayout",
  props: {
    gridNum: {},
    activeIndex: { default: 0 },
    showFn: {}
  },
  emits: ["update:activeIndex"],
  setup(t, { emit: n }) {
    const e = t, i = n, r = (o) => {
      i("update:activeIndex", o);
    };
    return (o, a) => (p(), S("div", Ve, [
      b(' :active="index === activeIndex" '),
      (p(!0), S(
        x,
        null,
        fe(e.gridNum, (g, s) => (p(), N(He, {
          active: !1,
          "grid-num": e.gridNum,
          onItemClick: (m) => r(s)
        }, {
          default: y(() => [
            o.showFn(s) ? ee(o.$slots, "default", {
              key: 0,
              index: s
            }, void 0, !0) : b("v-if", !0)
          ]),
          _: 2
          /* DYNAMIC */
        }, 1032, ["grid-num", "onItemClick"]))),
        256
        /* UNKEYED_FRAGMENT */
      ))
    ]));
  }
}), Me = /* @__PURE__ */ T(je, [["__scopeId", "data-v-661e2289"]]), Ae = /* @__PURE__ */ O({
  __name: "DirectionControl",
  emits: ["change"],
  setup(t, { emit: n }) {
    const e = n, i = (r) => {
      e("change", r);
    };
    return (r, o) => (p(), S(
      "div",
      {
        class: "direction-control",
        onDblclick: o[9] || (o[9] = _((a) => a.stopPropagation(), ["stop"]))
      },
      [
        v(l(h), {
          content: l(C)("左上")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-top-left",
              onClick: o[0] || (o[0] = _((a) => i("leftUp"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("上")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-top",
              onClick: o[1] || (o[1] = _((a) => i("up"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("右上")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-top-right",
              onClick: o[2] || (o[2] = _((a) => i("rightUp"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("左")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-left",
              onClick: o[3] || (o[3] = _((a) => i("left"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("自动")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-auto",
              onClick: o[4] || (o[4] = _((a) => i("auto"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("右")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-right",
              onClick: o[5] || (o[5] = _((a) => i("right"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("左下")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-bottom-left",
              onClick: o[6] || (o[6] = _((a) => i("leftDown"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("下")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-bottom",
              onClick: o[7] || (o[7] = _((a) => i("down"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"]),
        v(l(h), {
          content: l(C)("右下")
        }, {
          default: y(() => [
            f("div", {
              class: "icon icon-bottom-right",
              onClick: o[8] || (o[8] = _((a) => i("rightDown"), ["stop"]))
            })
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"])
      ],
      32
      /* NEED_HYDRATION */
    ));
  }
}), Qe = /* @__PURE__ */ T(Ae, [["__scopeId", "data-v-db2e8ec2"]]), qe = { class: "video-wrapper" }, Ge = { class: "video-top" }, We = { class: "video-top_l" }, Ye = { class: "video-title-wrapper" }, Ze = { class: "video-title" }, Ke = { class: "video-top_r" }, Xe = {
  key: 0,
  class: "play-status"
}, Je = { class: "video-bottom" }, et = { class: "video-bottom_r" }, tt = /* @__PURE__ */ O({
  __name: "index",
  props: {
    videoUrl: {},
    title: {},
    type: {},
    loading: { type: Boolean },
    isFullscreen: { type: Boolean },
    playbackRate: { default: 1 },
    paused: { type: Boolean, default: !1 },
    authType: { default: () => [] },
    isHls: { type: Boolean, default: !1 },
    onReplay: {}
  },
  emits: ["close", "directionControl", "zoomControl"],
  setup(t, { emit: n }) {
    const e = t, i = n;
    _e({
      muted: import("@das-fed/ui/packages/icons/muted"),
      volume: import("@das-fed/ui/packages/icons/volume"),
      shrink: import("@das-fed/ui/packages/icons/shrink"),
      enlarge: import("@das-fed/ui/packages/icons/enlarge"),
      "direction-control": import("@das-fed/ui/packages/icons/direction-control")
    });
    const r = w(!0), o = w(), a = w(!1), g = w(), s = U(() => {
      var u;
      return (u = g.value) == null ? void 0 : u.video;
    }), m = w(!1), c = w(!0), d = (u) => {
      o.value = u, !e.isHls && o.value.on(window.mpegts.Events.ERROR, (E) => {
      });
    }, k = () => {
      r.value = !r.value, o.value && (o.value.muted = r.value);
    }, I = () => {
      a.value = !a.value;
    }, L = w(""), F = () => {
      const u = document.createElement("canvas");
      if (s.value) {
        u.width = s.value.clientWidth, u.height = s.value.clientHeight;
        const E = u.getContext("2d");
        E == null || E.drawImage(s.value, 0, 0, u.width, u.height);
        const D = u.toDataURL("image/jpg"), ae = `【${e.title}】${Ie().format("YYYYMMDDHHmmss").toString()}.jpg`;
        if (L.value = D, "download" in document.createElement("a")) {
          const z = document.createElement("a");
          z.download = ae, z.style.display = "none", z.href = D, document.body.appendChild(z), document.body.appendChild(u), z.click(), URL.revokeObjectURL(z.href), document.body.removeChild(z), document.body.removeChild(u);
        }
      }
    }, B = (u) => {
      i("directionControl", u);
    }, M = (u) => {
      i("zoomControl", u);
    }, H = (u) => e.authType.includes(u);
    return R(
      () => s.value,
      () => {
        s.value && s.value.addEventListener("ended", () => {
          m.value = !0, e.type === "playback" && (c.value = !1);
        });
      }
    ), R(
      () => s.value,
      () => {
        s.value && P(() => {
          s.value.playbackRate = e.playbackRate || 1;
        });
      }
    ), R(
      () => o.value,
      () => {
        o.value && P(() => {
          o.value.muted = r.value;
        });
      }
    ), R(
      () => e.playbackRate,
      () => {
        s.value && (s.value.playbackRate = e.playbackRate || 1);
      },
      {
        immediate: !0
      }
    ), R(
      () => e.paused,
      () => {
        o.value && (e.paused ? o.value.pause() : o.value.play());
      }
    ), R(
      () => e.videoUrl,
      () => {
        c.value = !1, P(() => {
          c.value = !0;
        });
      }
    ), (u, E) => (p(), S("div", qe, [
      v(l(he), {
        spinning: e.loading,
        type: "component",
        tip: l(C)("加载中...")
      }, {
        default: y(() => [
          f("div", Ge, [
            f("div", We, [
              f("div", Ye, [
                f(
                  "div",
                  Ze,
                  V(e.title.length > 20 ? e.title.slice(0, 19) + "..." : e.title),
                  1
                  /* TEXT */
                )
              ])
            ]),
            f("div", Ke, [
              ["live"].includes(u.type) ? (p(), S(
                "span",
                Xe,
                V(l(C)("正在实时预览")),
                1
                /* TEXT */
              )) : b("v-if", !0),
              b(' <das-icon v-if="isFullscreen" class="icon close-icon" icon="close" @click.stop="handleClose"></das-icon> ')
            ])
          ]),
          u.isHls ? (p(), S(
            x,
            { key: 1 },
            [
              e.videoUrl && c.value ? (p(), N(l(be), {
                key: 0,
                ref_key: "dasLivePlayerRef",
                ref: g,
                muted: r.value,
                onLoaded: d,
                src: e.videoUrl
              }, null, 8, ["muted", "src"])) : b("v-if", !0)
            ],
            64
            /* STABLE_FRAGMENT */
          )) : (p(), S(
            x,
            { key: 0 },
            [
              e.videoUrl && c.value ? (p(), N(l(we), {
                key: 0,
                type: "flv",
                ref_key: "dasLivePlayerRef",
                ref: g,
                muted: r.value,
                onLoaded: d,
                src: e.videoUrl
              }, null, 8, ["muted", "src"])) : b("v-if", !0)
            ],
            64
            /* STABLE_FRAGMENT */
          )),
          f("div", Je, [
            E[3] || (E[3] = f(
              "div",
              { class: "video-bottom_l" },
              null,
              -1
              /* HOISTED */
            )),
            f("div", et, [
              f(
                "div",
                {
                  class: "controls",
                  onDblclick: E[2] || (E[2] = _((D) => D.stopPropagation(), ["stop"]))
                },
                [
                  v(l(h), {
                    content: l(C)("声音")
                  }, {
                    default: y(() => [
                      v(l($), {
                        class: "icon icon-volume",
                        icon: r.value ? "muted" : "volume",
                        onClick: _(k, ["stop"])
                      }, null, 8, ["icon"])
                    ]),
                    _: 1
                    /* STABLE */
                  }, 8, ["content"]),
                  v(l(h), {
                    content: l(C)("截图")
                  }, {
                    default: y(() => [
                      v(l($), {
                        class: "icon icon-screenshot",
                        icon: "screenshot",
                        onClick: _(F, ["stop"])
                      })
                    ]),
                    _: 1
                    /* STABLE */
                  }, 8, ["content"]),
                  H("control") ? (p(), N(l(h), {
                    key: 0,
                    content: l(C)("聚焦-")
                  }, {
                    default: y(() => [
                      ["live", "polling"].includes(e.type) ? (p(), N(l($), {
                        key: 0,
                        class: "icon icon-shrink",
                        icon: "shrink",
                        onClick: E[0] || (E[0] = _((D) => M("zoomOut"), ["stop"]))
                      })) : b("v-if", !0)
                    ]),
                    _: 1
                    /* STABLE */
                  }, 8, ["content"])) : b("v-if", !0),
                  H("control") ? (p(), N(l(h), {
                    key: 1,
                    content: l(C)("聚焦+")
                  }, {
                    default: y(() => [
                      ["live", "polling"].includes(e.type) ? (p(), N(l($), {
                        key: 0,
                        class: "icon icon-enlarge",
                        icon: "enlarge",
                        onClick: E[1] || (E[1] = _((D) => M("zoomIn"), ["stop"]))
                      })) : b("v-if", !0)
                    ]),
                    _: 1
                    /* STABLE */
                  }, 8, ["content"])) : b("v-if", !0),
                  H("control") ? (p(), N(l(h), {
                    key: 2,
                    content: l(C)("方向控制")
                  }, {
                    default: y(() => [
                      ["live", "polling"].includes(e.type) ? (p(), N(l($), {
                        key: 0,
                        class: "icon icon-direction-control",
                        icon: "direction-control",
                        onClick: _(I, ["stop"])
                      })) : b("v-if", !0)
                    ]),
                    _: 1
                    /* STABLE */
                  }, 8, ["content"])) : b("v-if", !0)
                ],
                32
                /* NEED_HYDRATION */
              )
            ])
          ]),
          a.value ? (p(), N(Qe, {
            key: 2,
            onChange: B
          })) : b("v-if", !0)
        ]),
        _: 1
        /* STABLE */
      }, 8, ["spinning", "tip"])
    ]));
  }
}), ot = /* @__PURE__ */ T(tt, [["__scopeId", "data-v-12f30393"]]), nt = "/api/device-relation/deviceproject/v1/project/device/video", lt = "v1", it = te(`/api/enterpriseright/permission/${lt}`), se = te(`${nt}`, st);
function st(t) {
  const n = A() ? A().id : 1;
  return t.params || (t.params = {}), t.params.project = n, t.params.projectId = n, t;
}
function re(t) {
  const n = new URLSearchParams("");
  for (let [e, i] of Object.entries(t))
    n.append(e, i);
  return n.toString();
}
function X(t) {
  return se.post(`/ptz?${re(t)}`)().run();
}
function rt(t) {
  return se.post(`/url/preview?${re(t)}`)().run();
}
it.post("data/device-auth");
const at = (t) => {
  const n = Ee();
  return `${t}?token=${n}`;
};
w([]);
const ct = /* @__PURE__ */ O({
  props: {
    deviceInfo: {
      type: Object,
      required: !0
    },
    source: {
      type: String
    },
    isHls: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    slots: n
  }) {
    const {
      deviceInfo: e,
      source: i,
      isHls: r
    } = me(t), o = w(!1), a = w(""), g = async () => {
      var k;
      if (!((k = e.value) != null && k.deviceId)) return;
      o.value = !0;
      const [c, d] = await rt({
        productId: e.value.productId,
        deviceId: e.value.deviceId,
        source: i.value
      });
      if (!c) {
        let I = r.value ? "httpHlsStreamURL" : "wsFlvStreamURL";
        a.value = at(d == null ? void 0 : d[I]);
      }
      o.value = !1;
    }, s = (c) => {
      X({
        productId: e.value.productId,
        deviceId: e.value.deviceId,
        direction: c,
        zoom: "",
        source: i.value || "web"
      });
    }, m = (c) => {
      X({
        productId: e.value.productId,
        deviceId: e.value.deviceId,
        direction: "",
        zoom: c,
        source: i.value || "web"
      });
    };
    return J(() => {
      g();
    }), R(() => e.value, () => {
      g();
    }, {
      deep: !0
    }), () => v(x, null, [n.default({
      videoUrl: a.value,
      loading: o.value,
      onDirectionControl: s,
      onZoomControl: m,
      isHls: r.value
    })]);
  }
});
function ut(t) {
  const n = w(0), e = w(), {
    toggle: i,
    isFullscreen: r,
    exit: o
  } = ie(e), a = (s, m) => {
    r.value && o();
  };
  return {
    render: () => v(Me, {
      ref: e,
      gridNum: t.gridNum,
      activeIndex: n.value,
      "onUpdate:activeIndex": (s) => n.value = s,
      showFn: (s) => !!t.deviceList[s]
    }, {
      default: ({
        index: s
      }) => {
        const m = t.deviceList[s], c = t.source, d = t.isHls;
        return v(ct, {
          deviceInfo: m,
          source: c,
          isHls: d
        }, {
          default: ({
            videoUrl: k,
            onDirectionControl: I,
            onZoomControl: L,
            loading: F,
            isHls: B
          }) => v(ot, {
            type: "live",
            loading: F,
            isFullscreen: r.value,
            videoUrl: k,
            title: m.deviceName,
            onClose: () => a(),
            onDirectionControl: I,
            onZoomControl: L,
            authType: m.authType === 2 ? ["control"] : [],
            isHls: B
          }, null)
        });
      }
    }),
    toggleFullscreen: i
  };
}
const dt = /* @__PURE__ */ O({
  __name: "index",
  props: {
    visible: { type: Boolean, default: !1 },
    deviceList: { default: () => [] },
    gridNum: { default: 4 },
    source: {},
    isHls: { type: Boolean, default: !1 }
  },
  emits: ["update:visible"],
  setup(t, { emit: n }) {
    const e = t, i = n, r = U({
      get: () => e.visible,
      set: (s) => i("update:visible", s)
    }), { render: o, toggleFullscreen: a } = ut(e), g = U(() => {
      let s = {};
      switch (e.gridNum) {
        case 1:
          s = "one-video";
          break;
        case 4:
          s = "four-video";
          break;
        case 9:
          s = "nine-video";
          break;
      }
      return s;
    });
    return (s, m) => (p(), N(l(ge), {
      size: "mini",
      title: l(C)("视频监控"),
      "custom-class": `das-linakge-video-dialog ${g.value}`,
      modelValue: r.value,
      "onUpdate:modelValue": m[0] || (m[0] = (c) => r.value = c),
      bodyStyle: { padding: 0 },
      "close-on-click-modal": !1,
      "close-on-press-escape": !1,
      modal: !1,
      "header-style": { display: "flex", justifyContent: "space-between", alignItems: "center" }
    }, {
      header: y(() => [
        f("div", null, [
          f(
            "span",
            null,
            V(l(C)("视频监控")),
            1
            /* TEXT */
          )
        ]),
        v(l(h), {
          content: l(C)("页面全屏")
        }, {
          default: y(() => [
            v(l(ke), {
              class: "icon",
              color: "#999",
              onClick: l(a)
            }, null, 8, ["onClick"])
          ]),
          _: 1
          /* STABLE */
        }, 8, ["content"])
      ]),
      default: y(() => [
        r.value ? (p(), N(l(o), { key: 0 })) : b("v-if", !0)
      ]),
      _: 1
      /* STABLE */
    }, 8, ["title", "custom-class", "modelValue"]));
  }
}), pt = {
  加载中: { "zh-CN": "加载中", en: "Loading", _appCode: "framework" },
  正在实时预览: { "zh-CN": "正在实时预览", en: "Real-time Video", _appCode: "framework" },
  声音: { "zh-CN": "声音", en: "Sound", _appCode: "framework" },
  截图: { "zh-CN": "截图", en: "Screenshot", _appCode: "framework" },
  聚焦: { "zh-CN": "聚焦", en: "Focus", _appCode: "framework" },
  方向控制: { "zh-CN": "方向控制", en: "Direction Control", _appCode: "framework" },
  左上: { "zh-CN": "左上", en: "Top Left", _appCode: "framework" },
  上: { "zh-CN": "上", en: "Up", _appCode: "framework" },
  右上: { "zh-CN": "右上", en: "Top Right", _appCode: "framework" },
  左: { "zh-CN": "左", en: "Left", _appCode: "framework" },
  自动: { "zh-CN": "自动", en: "Auto", _appCode: "framework" },
  右: { "zh-CN": "右", en: "Right", _appCode: "framework" },
  左下: { "zh-CN": "左下", en: "Bottom Left", _appCode: "framework" },
  下: { "zh-CN": "下", en: "Down", _appCode: "framework" },
  右下: { "zh-CN": "右下", en: "Bottom Right", _appCode: "framework" },
  视频监控: { "zh-CN": "视频监控", en: "Video Surveillance", _appCode: "framework" },
  页面全屏: { "zh-CN": "页面全屏", en: "Full Screen", _appCode: "framework" },
  "加载中...": { "zh-CN": "加载中...", en: "Loading...", _appCode: "framework" },
  "聚焦-": { "zh-CN": "聚焦-", en: "Focus-", _appCode: "framework" },
  "聚焦+": { "zh-CN": "聚焦+", en: "Focus+", _appCode: "framework" }
};
Ce(pt);
const Nt = ye(dt), Ft = () => w(null);
export {
  Nt as DasVideoDialog,
  Ft as DasVideoDialogRef,
  ut as useVideo
};
