import { defineComponent as xe, computed as he, ref as n, reactive as u, onMounted as Ie, nextTick as we, onBeforeUnmount as Te, createElementBlock as ke, openBlock as be, createElementVNode as Pe, createVNode as Ee } from "vue";
import Fe from "moment";
import { ElMessage as De } from "element-plus";
import Me from "./operate.vue.mjs";
import "../../../../text-text-basic/index.mjs";
import "../../../../text-table-basic/index.mjs";
import "../../../../chart-other-gauge/index.mjs";
import "../../../../chart-other-gauge-stage/index.mjs";
import "../../../../chart-other-gauge-grade/index.mjs";
import "../../../../chart-other-word-cloud/index.mjs";
import "../../../../chart-other-liquidfill/index.mjs";
import "../../../../chart-other-funnel/index.mjs";
import "../../../../chart-other-force/index.mjs";
import "../../../../chart-other-radar/index.mjs";
import "../../../../chart-other-funnel-split/index.mjs";
import "../../../../chart-other-funnel-contrast/index.mjs";
import "../../../../chart-other-candlestick-basic/index.mjs";
import "../../../../chart-other-candlestick-shanghai/index.mjs";
import "../../../../chart-other-candlestick-demo/index.mjs";
import "../../../../chart-other-heatmap/index.mjs";
import "../../../../chart-other-force2/index.mjs";
import "../../../../chart-other-graph-basic/index.mjs";
import "../../../../chart-other-graph-basic2/index.mjs";
import "../../../../chart-other-graph-calendar/index.mjs";
import "../../../../chart-other-tree-line/index.mjs";
import "../../../../chart-other-treemap-basic/index.mjs";
import "../../../../chart-other-sunburst-basic/index.mjs";
import "../../../../chart-other-sunburst-basic2/index.mjs";
import "../../../../chart-other-sunburst-basic3/index.mjs";
import "../../../../chart-other-sunburst-basic4/index.mjs";
import "../../../../chart-other-sunburst-book/index.mjs";
import "../../../../chart-other-sunburst-radius/index.mjs";
import "../../../../chart-other-sunburst-flavors/index.mjs";
import "../../../../chart-other-parallel-basic/index.mjs";
import "../../../../chart-other-parallel-mul/index.mjs";
import "../../../../chart-other-circular-graph/index.mjs";
import "../../../../map-earth-basic/index.mjs";
import "../../../../map-earth-cool-tech/index.mjs";
import "../../../../map-earth-particle/index.mjs";
import "../../../../map-earth-hacker/index.mjs";
import "../../../../map-earth-fly-line/index.mjs";
import "../../../../chart-other-grid-percentage/index.mjs";
import "../../../../chart-other-radar-stack/index.mjs";
import "../../../../chart-other-funnel2/index.mjs";
import "../../../../chart-other-label-gauge/index.mjs";
import "../../../../chart-other-theme-river/index.mjs";
import "../../../../chart-other-tree/index.mjs";
import "../../../../chart-other-treemap/index.mjs";
import "../../../../commons-product-model/index.mjs";
import "../../../../commons-vr-photo/index.mjs";
import "../../../../commons-vr-video/index.mjs";
import "../../../../commons-three-loader/index.mjs";
import "../../../../commons-three-loader3/index.mjs";
import "../../../../commons-loop-iterator/index.mjs";
import "../../../../commons-gaussian-splatting-view/index.mjs";
import "../../../../commons-babylon/index.mjs";
import "../../../../commons-svg/index.mjs";
import "../../../../commons-weather/index.mjs";
import "../../../../commons-weather-dynamic/index.mjs";
import "../../../../media-wavesurfer/index.mjs";
import "../../../../interaction-tabs/index.mjs";
import "../../../../interaction-tabs2/index.mjs";
import "../../../../interaction-button/index.mjs";
import "../../../../interaction-button-image/index.mjs";
import "../../../../interaction-select/index.mjs";
import "../../../../interaction-input/index.mjs";
import "../../../../interaction-radio/index.mjs";
import "../../../../interaction-slider/index.mjs";
import "../../../../interaction-switch/index.mjs";
import "../../../../interaction-data-picker/index.mjs";
import "../../../../interaction-button-refresh/index.mjs";
import "../../../../media-image/index.mjs";
import "../../../../text-title/index.mjs";
import "../../../../commons-qrcode/index.mjs";
import "../../../../media-video/index.mjs";
import "../../../../media-audio/index.mjs";
import "../../../../text-real-time/index.mjs";
import "../../../../media-carousel/index.mjs";
import "../../../../media-carousel-slides/index.mjs";
import "../../../../media-iframe-carousel/index.mjs";
import "../../../../media-iframe/index.mjs";
import "../../../../media-m3u8/index.mjs";
import "../../../../media-m3u8-dynamic/index.mjs";
import "../../../../media-audio-dynamic/index.mjs";
import "../../../../media-video-dynamic/index.mjs";
import "../../../../media-image-dynamic/index.mjs";
import "../../../../media-iframe-dynamic/index.mjs";
import "../../../../media-flv/index.mjs";
import "../../../../commons-echarts/index.mjs";
import "../../../../text-over-number/index.mjs";
import "../../../../text-table-scroll/index.mjs";
import "../../../../text-carousel/index.mjs";
import "../../../../text-row-scroll/index.mjs";
import "../../../../text-text-dynamic/index.mjs";
import "../../../../text-count-down/index.mjs";
import "../../../../graphical-circle/index.mjs";
import "../../../../graphical-diamond/index.mjs";
import "../../../../graphical-hexagon/index.mjs";
import "../../../../graphical-isosceles-triangle/index.mjs";
import "../../../../graphical-pentagon/index.mjs";
import "../../../../graphical-rect/index.mjs";
import "../../../../graphical-right-triangle/index.mjs";
import "../../../../scene-map3d/index.mjs";
import "../../../../scene-amap2d/index.mjs";
import "../../../../scene-amap3d/index.mjs";
import "../../../../scene-vr/index.mjs";
import "../../../../scene-unity-iframe/index.mjs";
import "../../../../scene-unity-webgl/index.mjs";
import "../../../../scene-ue-iframe/index.mjs";
import "../../../../scene-ue-shj/index.mjs";
import "../../../../scene-default/index.mjs";
import "../../../../interaction/tabs/index.mjs";
import "../../../../interaction/tabs-icon/index.mjs";
import "../../../../interaction/button/index.mjs";
import "../../../../interaction/date-picker/src/date-picker/index.mjs";
import "../../../../interaction/date-picker/src/date-picker-range/index.mjs";
import "../../../../text/list/index.mjs";
import "../../../../chart/src/bar/basic/index.mjs";
import "../../../../chart/src/bar/animation/index.mjs";
import "../../../../chart/src/bar/contrast/index.mjs";
import "../../../../chart/src/bar/contrast2/index.mjs";
import "../../../../chart/src/bar/contrast3/index.mjs";
import "../../../../chart/src/bar/gradient-column-chart/index.mjs";
import "../../../../chart/src/bar/horizontal/index.mjs";
import "../../../../chart/src/bar/horizontal-stack/index.mjs";
import "../../../../chart/src/bar/line-bar/index.mjs";
import "../../../../chart/src/bar/line-bar2/index.mjs";
import "../../../../chart/src/bar/loop/index.mjs";
import "../../../../chart/src/bar/mini/index.mjs";
import "../../../../chart/src/bar/polar/index.mjs";
import "../../../../chart/src/bar/polar-stack/index.mjs";
import "../../../../chart/src/bar/polar2/index.mjs";
import "../../../../chart/src/bar/radius-circle/index.mjs";
import "../../../../chart/src/bar/rank/index.mjs";
import "../../../../chart/src/bar/segmented-progress/index.mjs";
import "../../../../chart/src/bar/spire/index.mjs";
import "../../../../chart/src/bar/stack/index.mjs";
import "../../../../chart/src/bar/stack-line/index.mjs";
import "../../../../chart/src/bar/stack2/index.mjs";
import "../../../../chart/src/bar/stack3/index.mjs";
import "../../../../chart/src/bar/staggered/index.mjs";
import "../../../../chart/src/bar/three/index.mjs";
import "../../../../chart/src/bar/waterfall/index.mjs";
import "../../../../chart/src/bar/zebra/index.mjs";
import "../../../../chart/src/line/area-gradient/index.mjs";
import "../../../../chart/src/line/area-highlight/index.mjs";
import "../../../../chart/src/line/area-highlight2/index.mjs";
import "../../../../chart/src/line/basic/index.mjs";
import "../../../../chart/src/line/bump/index.mjs";
import "../../../../chart/src/line/dashed/index.mjs";
import "../../../../chart/src/line/ladder/index.mjs";
import "../../../../chart/src/line/logarithm/index.mjs";
import "../../../../chart/src/line/multix/index.mjs";
import "../../../../chart/src/line/polar-double/index.mjs";
import "../../../../chart/src/line/rain-flow/index.mjs";
import "../../../../chart/src/line/scale/index.mjs";
import "../../../../chart/src/line/smooth/index.mjs";
import "../../../../chart/src/line/smooth-area/index.mjs";
import "../../../../chart/src/line/stack/index.mjs";
import "../../../../chart/src/line/stack-area/index.mjs";
import "../../../../chart/src/line/temp/index.mjs";
import "../../../../chart/src/line/vertical/index.mjs";
import "../../../../chart/src/map/basic/index.mjs";
import "../../../../chart/src/map/bmap-basic/index.mjs";
import "../../../../chart/src/map/bmap-heatmap/index.mjs";
import "../../../../chart/src/map/bmap-rich/index.mjs";
import "../../../../chart/src/map/customize/index.mjs";
import "../../../../chart/src/map/lines/index.mjs";
import "../../../../chart/src/map/scatter/index.mjs";
import "../../../../chart/src/pie/3d/index.mjs";
import "../../../../chart/src/pie/basic/index.mjs";
import "../../../../chart/src/pie/basic2/index.mjs";
import "../../../../chart/src/pie/customized/index.mjs";
import "../../../../chart/src/pie/index/index.mjs";
import "../../../../chart/src/pie/interval/index.mjs";
import "../../../../chart/src/pie/legend-scroll/index.mjs";
import "../../../../chart/src/pie/radius/index.mjs";
import "../../../../chart/src/pie/rose/index.mjs";
import "../../../../chart/src/pie/round/index.mjs";
import "../../../../chart/src/pie/sunburst/index.mjs";
import "../../../../chart/src/scatter/basic/index.mjs";
import "../../../../chart/src/scatter/basic2/index.mjs";
import "../../../../chart/src/scatter/bubble/index.mjs";
import "../../../../chart/src/scatter/ripples/index.mjs";
import "../../../zv-hj-tree-list/index.mjs";
import "../../../zv-hj-model-resource/index.mjs";
import "../../../zv-hj-one-map-config/index.mjs";
import "../../../zv-hj-video-control/index.mjs";
import "../../index.mjs";
import "../../../zv-hj-password-input/index.mjs";
import "../../../zv-hj-carousel/index.mjs";
import "../../../zv-hj-video-monitor/index.mjs";
import "../../../zv-hj-scene-amap2d/index.mjs";
import "../../../zv-hj-scene-amap3d/index.mjs";
import "../../../zv-hj-person-face/index.mjs";
import "../../../zv-hj-resource-type-phone/index.mjs";
import "../../../zv-hj-tree-list-phone/index.mjs";
import "../../../zv-hj-video-page-phone/index.mjs";
import "../../../zv-hj-model-resource-phone/index.mjs";
import "../../../zv-hj-bottom-suspend/index.mjs";
import "../../../zv-hj-pagination/index.mjs";
import "../../../zv-hj-password-input-phone/index.mjs";
/* empty css                                 */
/* empty css                                        */
import "lodash";
import "../../../../../plugins/datasource/utils/request.mjs";
import "../../../../../plugins/datasource/utils/wsManager.mjs";
import { HJLYDatasourceApi as Re } from "../../../../../plugins/datasource/hjly/index.mjs";
import "../../../../../plugins/event/actions/fullScreenAction.mjs";
const He = ["id"], Fa = /* @__PURE__ */ xe({
  __name: "videos-h5player",
  props: {
    id: {
      type: String,
      default: "player"
    },
    fIndex: {
      type: Number,
      default: null
    },
    spanNum: {
      // 网格数量
      type: Number,
      default: 0
    },
    spanStyle: {
      type: Object,
      default: () => ({})
    },
    playType: {
      type: String,
      default: "realplay"
    },
    sourcePage: {
      type: String,
      default: "onepage"
      // onepage综合视频监控  chart图表
    },
    pollShow: {
      type: Boolean,
      default: !1
      // 轮询状态
    },
    deviceInfo: {
      type: Object,
      default: () => ({})
    },
    playbackInRealplay: {
      type: Boolean,
      default: !1
    },
    playBackIndexInRealPlay: {
      type: Number,
      default: null
    },
    playBackIndexInMonitor: {
      type: Number,
      default: null
    },
    basicOption: {
      type: Object,
      default: null
    }
  },
  emits: ["collect", "realplay", "updateDeviceInfo", "playback", "openPlaybackInRealPlay", "controlConfig"],
  setup(m, { expose: R, emit: H }) {
    const d = H, q = document.body.clientWidth < 992, N = !!window.MediaSource, W = {
      "0x12f910033": "视频格式错误",
      "0x12f900009": "取流超时",
      "0x12f900008": "地址格式错误",
      "0x12f910000": "连接失败",
      "0x12f910011": "流中断",
      "0x12f910010": "取流失败",
      "0x12f910027": "连接断开",
      "0x12f910029": "码流异常",
      "0x12f910012": "取流失败",
      "0x01b01307": "取流失败",
      "0x0190004a": "取流超时",
      "0x0190005c": "暂无画面"
    }, i = m, z = he(() => V.value === "mse" ? 0 : 1), k = [1375, 1376], J = n(q), l = n(null);
    n(J.value ? 1 : 2);
    const B = n(N), V = n(B.value ? "mse" : "decoder");
    n({ span: 5 }), n({ span: 18 }), u({
      realplay: "ws://192.168.100.251:559/openUrl/iLMn3t6",
      talk: "wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S",
      playback: "wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S"
    });
    const b = u({
      startTime: "2021-07-26T00:00:00",
      endTime: "2021-07-26T23:59:59",
      valueFormat: "",
      seekStart: "2021-07-26T12:00:00",
      rate: 0
    });
    n(!0), n(50), u({
      template: '<svg t="1624453273744" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1421" width="200" height="200"><path d="M597.994667 138.005333q130.005333 28.010667 213.994667 132.992t84.010667 241.002667-84.010667 241.002667-213.994667 132.992l0-88q93.994667-28.010667 153.002667-106.005333t59.008-180.010667-59.008-180.010667-153.002667-106.005333l0-88zM704 512q0 120-106.005333 172.010667l0-344q106.005333 52.010667 106.005333 172.010667zM128 384l170.005333 0 213.994667-213.994667 0 684.010667-213.994667-213.994667-170.005333 0 0-256z" p-id="1422"></path></svg>'
    }), u({
      template: '<svg t="1624453193279" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9147" width="200" height="200"><path d="M512 170.005333l0 180.010667-90.005333-90.005333zM181.994667 128l714.005333 714.005333-53.994667 53.994667-88-88q-74.005333 58.005333-156.010667 77.994667l0-88q50.005333-13.994667 96-50.005333l-181.994667-181.994667 0 288-213.994667-213.994667-170.005333 0 0-256 202.005333 0-202.005333-202.005333zM810.005333 512q0-101.994667-59.008-180.010667t-153.002667-106.005333l0-88q130.005333 28.010667 213.994667 132.992t84.010667 241.002667q0 96-44.010667 178.005333l-64-66.005333q21.994667-53.994667 21.994667-112zM704 512q0 18.005333-2.005333 26.005333l-104-104 0-93.994667q106.005333 52.010667 106.005333 172.010667z" p-id="9148"></path></svg>'
    });
    const o = n([]);
    n(0);
    const C = n("");
    n(!1);
    const s = n(0), U = n(["1", "5", "9", "12", "14", "15"]), h = n(0), I = n(0), v = u({
      x: "",
      y: "",
      pageX: "",
      pageY: ""
    }), f = u({
      x: "",
      y: "",
      pageX: "",
      pageY: ""
    }), y = u({
      w: 0,
      h: 0
    }), g = n(null);
    n(!1);
    const w = n(!1), S = n();
    Ie(() => {
      _(), O();
    }), (() => {
      let e = i.spanNum;
      i.playbackInRealplay && (e = 1);
      for (let t = 0; t < e; t++) {
        const r = {
          playStatus: "",
          // 播放状态
          tipText: "",
          // 错误提示
          voiceFlag: !1,
          // 声音状态
          recordFlag: !1,
          // 录像状态
          zoomFlag: !1,
          // 电子放大状态
          scale3DFlag: !1,
          talkFlag: !1,
          // 对讲状态
          controlFlag: !1,
          // 云台状态
          controlMoveStatus: !1,
          screenFlag: !1,
          // 窗口全屏状态
          arrangeFlag: "",
          // 单窗口全屏屏状态
          index: t,
          // 窗口索引
          uri: "",
          // 播放地址
          deviceId: "",
          resourceTags: "",
          resourceName: "",
          offlineFlag: "",
          errorNum: 0,
          // 加载失败次数，3次之内自动重连
          errorTimer: null,
          // 失败重连定时器
          playbackInRealplay: !1,
          width: 0,
          height: 0,
          collectId: 0
          // 是否收藏
        };
        i.playBackIndexInRealPlay >= 0 && (r.playbackInRealplay = i.playbackInRealplay), o.value.push(r);
      }
    })();
    const Y = (e, t) => {
      const r = e || S.value.clientWidth, a = t || S.value.clientHeight;
      !r && !a || setTimeout(() => {
        var c;
        const p = document.querySelector("#" + i.id);
        p && (p.style.width = r + "px", p.style.height = a + "px"), (c = l.value) == null || c.JS_Resize(r, a).then(
          () => {
          },
          () => {
          }
        );
      }, 600);
    }, _ = () => {
      window.addEventListener("resize", P);
    }, P = () => {
      let e = null;
      e && (clearTimeout(e), e = null), we(() => {
        e = setTimeout(() => {
          var t, r;
          !i.fIndex && i.fIndex !== 0 && ((r = (t = l.value) == null ? void 0 : t.JS_Resize()) == null || r.then(() => {
          }));
        }, 500);
      });
    }, O = async () => {
      const e = S.value.clientWidth, t = S.value.clientHeight, { JSPlugin: r } = window;
      l.value = new r({
        szId: i.id,
        szBasePath: i.basicOption.videoConfig.hk.videoJSBasePath,
        iMaxSplit: 1,
        iWidth: e,
        iHeight: t,
        iCurrentSplit: 1,
        openDebug: !0,
        bSupporDoubleClickFull: !1,
        oStyle: {
          background: i.sourcePage === "chart" ? "#284a4750" : "#1c2834",
          borderSelect: "#009cff"
        }
      }), l.value.JS_SetWindowControlCallback({
        pluginErrorHandler: function(a, p, c) {
        },
        windowEventOver: function(a) {
        },
        windowEventOut: function(a) {
        },
        windowEventUp: function(a) {
        },
        firstFrameDisplay: function(a, p, c) {
        },
        performanceLack: function() {
        }
      }), setTimeout(() => {
      }, 2e3);
    }, X = (e) => {
      const t = e.index || e.index === 0 ? e.index : l.value.currentWindowIndex, r = e.uri || o.value[t].uri;
      !e.deviceId || !r || (o.value[t].playStatus = "loading", o.value[t].deviceId = e.deviceId, o.value[t].resourceTags = e.resourceTags, o.value[t].collectId = e.collectId, e.resourceTags && e.resourceTags === k[0] && (o.value[t].controlFlag = !0), o.value[t].index = t, o.value[t].resourceName = e.resourceName || "", o.value[t].uri = e.uri || o.value[t].uri, l.value.JS_Play(e.uri, { playURL: r, mode: z }, 0).then(
        () => {
          o.value[t].playStatus === "loading" && (o.value[t].playStatus = "success", o.value[t].tipText = "", o.value[t].errorNum = 0, E("success"));
        },
        (a) => {
          o.value[t].playStatus = "error", o.value[t].tipText = W[a] || "加载失败", o.value[t].errorNum < 10 && (o.value[t].errorTimer && clearTimeout(o.value[t].errorTimer), o.value[t].errorTimer = setTimeout(() => {
          }, 1e4));
        }
      ));
    }, E = (e) => {
      (i.fIndex || i.fIndex === 0) && d("realplay", e, i.fIndex);
    }, L = () => {
      l.value.JS_StopRealPlayAll().then(
        () => {
          b.rate = 0, o.value.forEach((e) => {
            e.playStatus = "", e.tipText = "", e.deviceId = "", e.errorNum = 0, e.errorTimer && (clearTimeout(e.errorTimer), e.errorTimer = null);
          });
        },
        (e) => {
        }
      );
    }, j = (e) => {
      const t = e || l.value.currentWindowIndex;
      C.value = t, A(t);
    }, A = (e) => {
      l.value.JS_FullScreenSingle(e).then(
        () => {
        },
        (t) => {
        }
      );
    }, Z = (e = "MP4", t, r) => {
      const a = { MP4: 5, PS: 2 }, p = t || l.value.currentWindowIndex, c = `${Fe().format("YYYYMMDDHHmm")}.mp4`, T = a[e];
      l.value.JS_StartSaveEx(p, c, T).then(
        () => {
          o.value[p].recordFlag = !0, r && r();
        },
        (M) => {
        }
      );
    }, $ = (e, t) => {
      l.value.JS_StopSave(e).then(
        () => {
          o.value[e].recordFlag = !1, t && t();
        },
        (r) => {
        }
      );
    }, G = (e) => {
      l.value.JS_OpenSound(e).then(
        () => {
          o.value[e].voiceFlag = !0, o.value.forEach((t, r) => {
            r !== e && (t.voiceFlag = !1);
          });
        },
        (t) => {
        }
      );
    }, K = (e) => {
      l.value.JS_CloseSound(e).then(
        () => {
          o.value[e].voiceFlag = !1;
        },
        (t) => {
        }
      );
    }, Q = (e) => {
    }, ee = (e) => {
    }, te = (e) => {
      l.value.JS_DisableZoom(e).then(
        () => {
          o.value[e].zoomFlag = !1;
        },
        (t) => {
        }
      );
    }, oe = (e) => {
      l.value.JS_EnableZoom(e).then(
        () => {
          o.value[e].zoomFlag = !0;
        },
        (t) => {
        }
      );
    }, re = (e) => {
    }, ae = (e) => {
    }, ie = (e, t) => {
      l.value.JS_CapturePicture(t, "img", e).then(
        () => {
        },
        (r) => {
        }
      );
    }, le = (e) => {
    }, ne = (e, t, r) => {
      const a = Date.now();
      if (h.value && a - h.value < 300)
        return s.value = 0, e.preventDefault(), e.stopPropagation(), !1;
      h.value = Date.now(), e.target.nodeName ? s.value ? s.value = 0 : (s.value = Date.now(), x(r, 0, 50, t)) : s.value = 0;
    }, pe = (e, t, r) => {
      const a = Date.now();
      if (!s.value || I.value && a - I.value < 300)
        return e.preventDefault(), e.stopPropagation(), !1;
      {
        I.value = a;
        const p = a - s.value;
        e.target.nodeName ? p < 300 ? setTimeout(() => {
          x(r, 1, 50, t), s.value = 0;
        }, 120) : (x(r, 1, 50, t), s.value = 0) : s.value = 0;
      }
    }, x = (e, t = 0, r = 50, a) => {
      if (e !== 0 && !e) return;
      const p = a === 0 || a ? a : l.value.currentWindowIndex, c = o.value[p];
      if (c && c.deviceId) {
        if (!c.resourceTags || c.resourceTags !== k[0])
          return w.value || (w.value = !0, De({
            message: "设备不支持该功能",
            type: "error"
          }), setTimeout(() => {
            w.value = !1;
          }, 500)), !1;
        const T = {
          deviceId: c.deviceId,
          directionFlag: e,
          // 方向
          speed: r,
          action: t
          // 启停
        };
        Re.cameraTurn(T).then((M) => {
        }).catch((M) => {
        });
      }
    }, ce = (e) => {
    }, F = (e) => {
      const t = e || l.value.currentWindowIndex;
      o.value[t].scale3DFlag = !o.value[t].scale3DFlag;
    }, se = (e = 0.5) => {
      let t = e;
      e < 0.5 ? t = 0.5 : e > 2 && (t = 2);
      const r = i.fIndex || 0, p = document.querySelector("#" + i.id).querySelector(".parent-wnd").querySelector("#player-container-" + r).querySelector("#" + i.id + "_playVideo" + r);
      p && (p.style.transform = `scale(${t})`);
    }, me = (e, t) => {
      v.x = e.offsetX, v.y = e.offsetY, v.pageX = e.pageX, v.pageY = e.pageY;
      const a = document.querySelector("#" + i.id).querySelector(".parent-wnd").querySelector("#player-container-" + t).querySelector("#scale_canvas_box");
      a instanceof HTMLCanvasElement && (g.value = a.getContext("2d"), g.value && (y.w = a.width, y.h = a.height));
    }, ue = (e, t) => {
    }, de = (e, t) => {
      if (g.value) {
        const r = e.pageX, a = e.pageY;
        f.x = e.offsetX, f.y = e.offsetY, f.pageX = r, f.pageY = a;
        const { x: p, y: c } = v;
        g.value.clearRect(0, 0, y.w, y.h), g.value = null, fe(p, c, f.x, f.y);
      }
    }, fe = (e, t, r, a, p) => {
    }, ve = (e, t, r) => {
      D(0, !0), d("openPlaybackInRealPlay", e, t, r);
    }, D = (e, t = !1) => {
      if (i.playType === "realplay" ? (o.value[e].errorTimer && (clearTimeout(o.value[e].errorTimer), o.value[e].errorTimer = null), ge(e), d("controlConfig", !1)) : ye(e), !t) {
        let r = 0;
        i.fIndex >= 0 ? r = i.fIndex : i.playBackIndexInRealPlay >= 0 ? r = i.playBackIndexInRealPlay : i.playBackIndexInMonitor >= 0 && (r = i.playBackIndexInMonitor), d("updateDeviceInfo", r);
      }
    }, ye = (e) => {
      l.value.JS_Stop().then(
        () => {
          o.value[e].playStatus = "", o.value[e].tipText = "", d("playback", "error");
        },
        (t) => {
        }
      );
    }, ge = (e) => {
      l.value.JS_Stop(e).then(
        () => {
          o.value[e].playStatus = "", o.value[e].tipText = "", o.value[e].deviceId = "", o.value[e].uri = "", b.rate = 0, E("close");
        },
        (t) => {
        }
      );
    }, Se = (e, t) => {
      o.value[e].collectId = t, d("collect", { resourceId: o.value[e].deviceId, status: t });
    };
    return R({
      showVideo: X,
      destoryVideo: L,
      resize: Y,
      scaleHandle: se,
      changeScale: F,
      changePosition: x
    }), Te(() => {
      window.removeEventListener("resize", P);
    }), (e, t) => (be(), ke("div", {
      ref_key: "contentRef",
      ref: S,
      class: "container"
    }, [
      Pe("div", {
        id: m.id,
        class: "player"
      }, null, 8, He),
      Ee(Me, {
        "video-list": o.value,
        index: m.fIndex,
        "span-style": m.spanStyle,
        "play-type": m.playType,
        "f-index": m.fIndex,
        "source-page": m.sourcePage,
        "model-ids-support": U.value,
        "ctx-style": y,
        "play-back-index-in-real-play": m.playBackIndexInRealPlay,
        "basic-option": m.basicOption,
        onChangeScreen: j,
        onRecordStart: Z,
        onRecordStop: $,
        onStopVideoPlay: D,
        onOpenSound: G,
        onCloseSound: K,
        onTalkStop: Q,
        onTalkStart: ee,
        onEnlargeClose: te,
        onEnlarge: oe,
        onResetVideoUrl: re,
        onResetVideoUrl1: ae,
        onCapture: ie,
        onChangeControl: le,
        onChangePositionDownHandle: ne,
        onChangePositionUpHandle: pe,
        onChooseDevice: ce,
        onChangeScale: F,
        onScaleDownHandle: me,
        onScaleMoveHandle: ue,
        onScaleUpHandle: de,
        onOpenVideoPlayback: ve,
        onCollect: Se
      }, null, 8, ["video-list", "index", "span-style", "play-type", "f-index", "source-page", "model-ids-support", "ctx-style", "play-back-index-in-real-play", "basic-option"])
    ], 512));
  }
});
export {
  Fa as default
};
