/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{openBlock as e,createElementBlock as o,normalizeStyle as r,normalizeClass as t,createCommentVNode as s,createElementVNode as i,renderSlot as l,Fragment as d,renderList as n,defineComponent as a,ref as u,onMounted as p,nextTick as c,unref as m,watch as v,computed as f}from"vue";import{isIterableArray as y}from"@gsc-basic/utils";import x from"./videoBackground.js";import{useNamespace as g}from"../../hooks/useNamespace.js";import './index3.css';import './index2.css';import './index.css';/* empty css          *//* empty css          *//* empty css          */import b from"../../_virtual/_plugin-vue_export-helper.js";import h from"../../node_modules/lodash-es/isNil.js";import I from"../../node_modules/lodash-es/isString.js";const j=a({name:"GscVideoBackground",props:{source:{type:[String,Array],required:!0},cover:{type:String,default:""},videoRemoval:{type:Boolean,default:!1},videoZIndex:{type:Number,default:-1},fullscreen:{type:Boolean,default:!0}},setup(e){const{prefixCls:o}=g("video-bg"),r=`${o}-ready`,t=u(null);function s(o){h(m(t))||(I(o)&&""!==o&&m(t).setAttribute("src",e.source),y(o)&&m(t).removeAttribute("src"))}return p(()=>{s(e.source),c(()=>{new x(m(t),{helperClass:r,videoRemoval:e.videoRemoval})})}),v(()=>e.source,e=>{s(e)}),{prefixCls:o,isIterableArray:y,videoRef:t,containerStyle:f(()=>{const o={zIndex:e.videoZIndex};return e.fullscreen?{...o,position:"fixed",minWidth:"100vw",minHeight:"100vh"}:{...o,position:"absolute",minWidth:"100%",minHeight:"100%"}})}}}),k=["src","type"];const _=/* @__PURE__ */b(j,[["render",function(a,u,p,c,m,v){return e(),o("div",{class:t([a.prefixCls]),style:r(a.containerStyle)},[a.cover?(e(),o("div",{key:0,class:"bg-cover",style:r({backgroundImage:`url(${a.cover})`,zIndex:a.videoZIndex+1})},null,4)):s("",!0),i("video",{ref:"videoRef",class:t(`${a.prefixCls}-video`),preload:"metadata",loop:"",autoplay:"",muted:""},[l(a.$slots,"default",{},()=>[a.isIterableArray(a.source)?(e(!0),o(d,{key:0},n(a.source,r=>(e(),o(d,null,[""!==r.type?(e(),o("source",{key:r.type,src:r.src,type:`video/${r.type}`},null,8,k)):s("",!0)],64))),256)):s("",!0)],!0)],2)],6)}],["__scopeId","data-v-e8a07a6a"]]);export{_ as default};