@webitel/ui-sdk 25.12.19 → 25.12.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3149,7 +3149,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3149
3149
  array and $emits "input" event.
3150
3150
 
3151
3151
  True: "tag" method only $emits "tag" event. Tag addition is responsibility of client side.
3152
- `}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:i,option:o}){const n=this.getOptionLabel({optionLabel:i,option:o});return typeof n=="object"?o.label:n},initializeOptions(){if(!this.value)return[];const i=this.value.filter(o=>!this.options.find(n=>dc(n,o)));this.options.unshift(...i)}}},Uwe={class:"multiselect__loading-wrapper"};function Hwe(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-chip"),f=c.resolveComponent("wt-loader"),g=c.resolveComponent("vue-multiselect"),w=c.resolveComponent("wt-input-info"),v=c.resolveDirective("observe-visibility");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tags-input--disabled":i.disabled,"wt-tags-input--invalid":i.invalid,"wt-tags-input--loading":i.isLoading},"wt-tags-input"])},[i.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},i.labelProps,{disabled:i.disabled,invalid:i.invalid,class:"wt-tags-input__label"}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:i.label})),()=>[c.createTextVNode(c.toDisplayString(i.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createVNode(g,c.mergeProps(i.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:i.disabled,"internal-search":!i.searchMethod,label:i.selectOptionLabel,loading:!1,"model-value":i.selectValue,multiple:i.multiple,options:i.selectOptions,placeholder:i.placeholder||i.label,taggable:n.taggable,"track-by":n.trackBy,class:"wt-tags-input__select"},c.toHandlers(i.listeners)),c.createSlots({tag:c.withCtx(({option:C,remove:E})=>[c.createVNode(h,{class:"multiselect__custom-tag"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel}))+" ",1),c.createVNode(p,{color:"on-primary",icon:"close--filled",size:"sm",onClick:T=>E(C)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:c.withCtx(({option:C})=>[c.renderSlot(i.$slots,"option",c.normalizeProps(c.guardReactiveProps({option:C,optionLabel:i.optionLabel})),()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel})),1)],!0)]),caret:c.withCtx(({toggle:C})=>[c.createVNode(p,{disabled:i.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:c.withModifiers(C,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",Uwe,[c.createVNode(f,{size:"sm"})],512),[[c.vShow,i.isLoading]])]),_:2},[i.showIntersectionObserver?{name:"afterList",fn:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",null,null,512),[[v,i.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),i.isValidation?(c.openBlock(),c.createBlock(w,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const Kwe=Ne(zwe,[["render",Hwe],["__scopeId","data-v-5b67c1b1"]]),Gwe={class:"wt-textarea__wrapper"},Wwe=Ne(c.defineComponent({__name:"wt-textarea",props:c.mergeModels({label:{default:""},placeholder:{default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},name:{default:""},rows:{default:1},labelProps:{default:void 0},autoresize:{type:Boolean,default:!1},v:{default:void 0},customValidators:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:c.mergeModels(["enter","paste","blur","keydown"],["update:modelValue"]),setup(i,{emit:o}){const n=i,a=c.useModel(i,"modelValue"),l=c.useTemplateRef("textarea-wrapper"),s=o,d=c.ref(!1),{isValidation:p,invalid:h,validationText:f}=yh({v:n.v,customValidators:n.customValidators}),g=C=>{s("keydown",C),n.autoresize&&C.key==="Enter"&&!C.shiftKey&&(s("enter"),C.preventDefault())},w=()=>{v()},v=async()=>{var E;if(!n.autoresize)return;const C=(E=l.value)==null?void 0:E.$el;(C==null?void 0:C.scrollHeight)===(C==null?void 0:C.clientHeight)||(C==null?void 0:C.scrollHeight)===(C==null?void 0:C.clientHeight)+2?d.value=!0:d.value=!1};return c.onMounted(()=>{v()}),(C,E)=>{const T=c.resolveComponent("wt-label"),A=c.resolveComponent("p-textarea"),I=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wt-textarea",{"wt-textarea--hidden-scrollbar":d.value}])},[c.createVNode(T,c.mergeProps(C.labelProps,{disabled:C.disabled,for:C.name,required:C.required,invalid:c.unref(h)}),{default:c.withCtx(()=>[c.renderSlot(C.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:C.label})),()=>[c.createTextVNode(c.toDisplayString(C.label),1)],!0)],void 0,!0),_:3},16,["disabled","for","required","invalid"]),c.createElementVNode("div",Gwe,[c.createVNode(A,{ref:"textarea-wrapper",id:C.name,modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=x=>a.value=x),placeholder:C.placeholder||C.label,invalid:c.unref(h),disabled:C.disabled,rows:C.rows,"auto-resize":C.autoresize,readonly:C.readonly,class:"wt-textarea__textarea",onPaste:E[1]||(E[1]=x=>s("paste",x)),onKeydown:g,onInput:w,onBlur:E[2]||(E[2]=x=>s("blur"))},null,8,["id","modelValue","placeholder","invalid","disabled","rows","auto-resize","readonly"])]),c.unref(p)?(c.openBlock(),c.createBlock(I,{key:0,invalid:c.unref(h)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(f)),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-73ed39f1"]]),Zwe={name:"WtTimeInput",mixins:[sw],props:{value:{type:Number,default:0},label:{type:String,default:""},maxValue:{type:Number},required:{type:Boolean,default:!1,description:"Native input required attribute"},disabled:{type:Boolean,default:!1,description:"Native input disabled attribute"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},hideInputInfo:{type:Boolean,default:!1}},emits:["input"],computed:{hasLabel(){return!!(this.label||this.$slots.label)},showInfo(){return this.isValidation&&!this.hideInputInfo},listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value)}}}},Ywe={class:"wt-time-input__wrapper"},Xwe=["disabled","max","value"];function Qwe(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-time-input--disabled":n.disabled,"wt-time-input--invalid":i.invalid},"wt-time-input"])},[s.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{disabled:n.disabled,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",Ywe,[c.createElementVNode("input",c.mergeProps({disabled:n.disabled,max:n.maxValue,min:0,value:n.value,class:"wt-time-input__input",type:"number"},c.toHandlers(s.listeners,!0)),null,16,Xwe)]),s.showInfo?(c.openBlock(),c.createBlock(p,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const Jwe=Ne(Zwe,[["render",Qwe],["__scopeId","data-v-ae7cf0e8"]]),Rh=60*60,sv=60,eve={name:"WtTimepicker",mixins:[sw],model:{prop:"value",event:"input"},props:{value:{type:[String,Number],default:0},dateMode:{type:Boolean,default:!1},label:{type:String,default:""},format:{type:String,default:"hh:mm:ss"},disabled:{type:Boolean,default:!1},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},noLabel:{type:Boolean,default:!1},required:{type:Boolean,default:!1,description:"Native input required attribute"}},computed:{isHour(){return this.format.includes("hh")},isMin(){return this.format.includes("mm")},isSec(){return this.format.includes("ss")},labelHours(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.hour")},labelMin(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.min")},labelSec(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.sec")},hour:{get(){return this.dateMode?new Date(+this.value).getHours():Math.floor(this.value/Rh)},set(i){const o=this.dateMode?new Date(this.value).setHours(i):this.value-this.hour*Rh+i*Rh;this.$emit("input",o)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/sv%60)},set(i){const o=this.dateMode?new Date(this.value).setMinutes(i):this.value-this.min*sv+i*sv;this.$emit("input",o)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(i){const o=this.dateMode?new Date(this.value).setSeconds(i):this.value-this.sec+ +i;this.$emit("input",o)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const i=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*Rh+this.hour*Rh;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",i)})}}},tve={class:"wt-timepicker__wrapper"};function ove(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-time-input"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-timepicker--invalid":i.invalid},"wt-timepicker"])},[n.label||!n.noLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(s.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",tve,[s.isHour?(c.openBlock(),c.createBlock(p,{key:0,disabled:n.disabled,label:s.labelHours,"max-value":n.dateMode?null:23,v:i.v,value:s.hour,"hide-input-info":"",onBlur:s.onHoursBlurEvent,onInput:o[0]||(o[0]=f=>s.hour=f)},null,8,["disabled","label","max-value","v","value","onBlur"])):c.createCommentVNode("",!0),s.isMin?(c.openBlock(),c.createBlock(p,{key:1,disabled:n.disabled,label:s.labelMin,"max-value":59,v:i.v,value:s.min,"hide-input-info":"",onInput:o[1]||(o[1]=f=>s.min=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0),s.isSec?(c.openBlock(),c.createBlock(p,{key:2,disabled:n.disabled,label:s.labelSec,"max-value":59,v:i.v,value:s.sec,"hide-input-info":"",onInput:o[2]||(o[2]=f=>s.sec=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const ive=Ne(eve,[["render",ove],["__scopeId","data-v-e9eb3b40"]]),nve=["top","right","bottom","left"],xP=["start","end"],SP=nve.reduce((i,o)=>i.concat(o,o+"-"+xP[0],o+"-"+xP[1]),[]),xg=Math.min,mp=Math.max,Sg=Math.round,Ig=Math.floor,Zr=i=>({x:i,y:i}),ave={left:"right",right:"left",bottom:"top",top:"bottom"},rve={start:"end",end:"start"};function IP(i,o,n){return mp(i,xg(o,n))}function Bh(i,o){return typeof i=="function"?i(o):i}function ts(i){return i.split("-")[0]}function os(i){return i.split("-")[1]}function EP(i){return i==="x"?"y":"x"}function TP(i){return i==="y"?"height":"width"}function Bu(i){return["top","bottom"].includes(ts(i))?"y":"x"}function AP(i){return EP(Bu(i))}function _P(i,o,n){n===void 0&&(n=!1);const a=os(i),l=AP(i),s=TP(l);let d=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[s]>o.floating[s]&&(d=Tg(d)),[d,Tg(d)]}function lve(i){const o=Tg(i);return[Eg(i),o,Eg(o)]}function Eg(i){return i.replace(/start|end/g,o=>rve[o])}function sve(i,o,n){const a=["left","right"],l=["right","left"],s=["top","bottom"],d=["bottom","top"];switch(i){case"top":case"bottom":return n?o?l:a:o?a:l;case"left":case"right":return o?s:d;default:return[]}}function cve(i,o,n,a){const l=os(i);let s=sve(ts(i),n==="start",a);return l&&(s=s.map(d=>d+"-"+l),o&&(s=s.concat(s.map(Eg)))),s}function Tg(i){return i.replace(/left|right|bottom|top/g,o=>ave[o])}function dve(i){return{top:0,right:0,bottom:0,left:0,...i}}function pve(i){return typeof i!="number"?dve(i):{top:i,right:i,bottom:i,left:i}}function Ag(i){const{x:o,y:n,width:a,height:l}=i;return{width:a,height:l,top:n,left:o,right:o+a,bottom:n+l,x:o,y:n}}function DP(i,o,n){let{reference:a,floating:l}=i;const s=Bu(o),d=AP(o),p=TP(d),h=ts(o),f=s==="y",g=a.x+a.width/2-l.width/2,w=a.y+a.height/2-l.height/2,v=a[p]/2-l[p]/2;let C;switch(h){case"top":C={x:g,y:a.y-l.height};break;case"bottom":C={x:g,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:w};break;case"left":C={x:a.x-l.width,y:w};break;default:C={x:a.x,y:a.y}}switch(os(o)){case"start":C[d]-=v*(n&&f?-1:1);break;case"end":C[d]+=v*(n&&f?-1:1);break}return C}const uve=async(i,o,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:s=[],platform:d}=n,p=s.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(o));let f=await d.getElementRects({reference:i,floating:o,strategy:l}),{x:g,y:w}=DP(f,a,h),v=a,C={},E=0;for(let T=0;T<p.length;T++){const{name:A,fn:I}=p[T],{x,y:O,data:D,reset:R}=await I({x:g,y:w,initialPlacement:a,placement:v,strategy:l,middlewareData:C,rects:f,platform:d,elements:{reference:i,floating:o}});g=x??g,w=O??w,C={...C,[A]:{...C[A],...D}},R&&E<=50&&(E++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(f=R.rects===!0?await d.getElementRects({reference:i,floating:o,strategy:l}):R.rects),{x:g,y:w}=DP(f,v,h)),T=-1)}return{x:g,y:w,placement:v,strategy:l,middlewareData:C}};async function cv(i,o){var n;o===void 0&&(o={});const{x:a,y:l,platform:s,rects:d,elements:p,strategy:h}=i,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:w="floating",altBoundary:v=!1,padding:C=0}=Bh(o,i),E=pve(C),A=p[v?w==="floating"?"reference":"floating":w],I=Ag(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(p.floating)),boundary:f,rootBoundary:g,strategy:h})),x=w==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(p.floating)),D=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},R=Ag(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:x,offsetParent:O,strategy:h}):x);return{top:(I.top-R.top+E.top)/D.y,bottom:(R.bottom-I.bottom+E.bottom)/D.y,left:(I.left-R.left+E.left)/D.x,right:(R.right-I.right+E.right)/D.x}}function hve(i,o,n){return(i?[...n.filter(l=>os(l)===i),...n.filter(l=>os(l)!==i)]:n.filter(l=>ts(l)===l)).filter(l=>i?os(l)===i||(o?Eg(l)!==l:!1):!0)}const fve=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(o){var n,a,l;const{rects:s,middlewareData:d,placement:p,platform:h,elements:f}=o,{crossAxis:g=!1,alignment:w,allowedPlacements:v=SP,autoAlignment:C=!0,...E}=Bh(i,o),T=w!==void 0||v===SP?hve(w||null,C,v):v,A=await cv(o,E),I=((n=d.autoPlacement)==null?void 0:n.index)||0,x=T[I];if(x==null)return{};const O=_P(x,s,await(h.isRTL==null?void 0:h.isRTL(f.floating)));if(p!==x)return{reset:{placement:T[0]}};const D=[A[ts(x)],A[O[0]],A[O[1]]],R=[...((a=d.autoPlacement)==null?void 0:a.overflows)||[],{placement:x,overflows:D}],q=T[I+1];if(q)return{data:{index:I+1,overflows:R},reset:{placement:q}};const L=R.map(G=>{const F=os(G.placement);return[G.placement,F&&g?G.overflows.slice(0,2).reduce((j,ee)=>j+ee,0):G.overflows[0],G.overflows]}).sort((G,F)=>G[1]-F[1]),K=((l=L.filter(G=>G[2].slice(0,os(G[0])?2:3).every(F=>F<=0))[0])==null?void 0:l[0])||L[0][0];return K!==p?{data:{index:I+1,overflows:R},reset:{placement:K}}:{}}}},mve=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(o){var n,a;const{placement:l,middlewareData:s,rects:d,initialPlacement:p,platform:h,elements:f}=o,{mainAxis:g=!0,crossAxis:w=!0,fallbackPlacements:v,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...A}=Bh(i,o);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const I=ts(l),x=Bu(p),O=ts(p)===p,D=await(h.isRTL==null?void 0:h.isRTL(f.floating)),R=v||(O||!T?[Tg(p)]:lve(p)),q=E!=="none";!v&&q&&R.push(...cve(p,T,E,D));const L=[p,...R],U=await cv(o,A),K=[];let G=((a=s.flip)==null?void 0:a.overflows)||[];if(g&&K.push(U[I]),w){const le=_P(l,d,D);K.push(U[le[0]],U[le[1]])}if(G=[...G,{placement:l,overflows:K}],!K.every(le=>le<=0)){var F,j;const le=(((F=s.flip)==null?void 0:F.index)||0)+1,he=L[le];if(he)return{data:{index:le,overflows:G},reset:{placement:he}};let pe=(j=G.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:j.placement;if(!pe)switch(C){case"bestFit":{var ee;const $=(ee=G.filter(X=>{if(q){const W=Bu(X.placement);return W===x||W==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,Z)=>W+Z,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:ee[0];$&&(pe=$);break}case"initialPlacement":pe=p;break}if(l!==pe)return{reset:{placement:pe}}}return{}}}};async function bve(i,o){const{placement:n,platform:a,elements:l}=i,s=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=ts(n),p=os(n),h=Bu(n)==="y",f=["left","top"].includes(d)?-1:1,g=s&&h?-1:1,w=Bh(o,i);let{mainAxis:v,crossAxis:C,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return p&&typeof E=="number"&&(C=p==="end"?E*-1:E),h?{x:C*g,y:v*f}:{x:v*f,y:C*g}}const gve=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(o){var n,a;const{x:l,y:s,placement:d,middlewareData:p}=o,h=await bve(o,i);return d===((n=p.offset)==null?void 0:n.placement)&&(a=p.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:d}}}}},yve=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(o){const{x:n,y:a,placement:l}=o,{mainAxis:s=!0,crossAxis:d=!1,limiter:p={fn:A=>{let{x:I,y:x}=A;return{x:I,y:x}}},...h}=Bh(i,o),f={x:n,y:a},g=await cv(o,h),w=Bu(ts(l)),v=EP(w);let C=f[v],E=f[w];if(s){const A=v==="y"?"top":"left",I=v==="y"?"bottom":"right",x=C+g[A],O=C-g[I];C=IP(x,C,O)}if(d){const A=w==="y"?"top":"left",I=w==="y"?"bottom":"right",x=E+g[A],O=E-g[I];E=IP(x,E,O)}const T=p.fn({...o,[v]:C,[w]:E});return{...T,data:{x:T.x-n,y:T.y-a,enabled:{[v]:s,[w]:d}}}}}};function _g(){return typeof window<"u"}function bp(i){return dv(i)?(i.nodeName||"").toLowerCase():"#document"}function fa(i){var o;return(i==null||(o=i.ownerDocument)==null?void 0:o.defaultView)||window}function Yr(i){var o;return(o=(dv(i)?i.ownerDocument:i.document)||window.document)==null?void 0:o.documentElement}function dv(i){return _g()?i instanceof Node||i instanceof fa(i).Node:!1}function ar(i){return _g()?i instanceof Element||i instanceof fa(i).Element:!1}function Xr(i){return _g()?i instanceof HTMLElement||i instanceof fa(i).HTMLElement:!1}function OP(i){return!_g()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof fa(i).ShadowRoot}function Lh(i){const{overflow:o,overflowX:n,overflowY:a,display:l}=rr(i);return/auto|scroll|overlay|hidden|clip/.test(o+a+n)&&!["inline","contents"].includes(l)}function wve(i){return["table","td","th"].includes(bp(i))}function Dg(i){return[":popover-open",":modal"].some(o=>{try{return i.matches(o)}catch{return!1}})}function pv(i){const o=uv(),n=ar(i)?rr(i):i;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function vve(i){let o=pc(i);for(;Xr(o)&&!Lu(o);){if(pv(o))return o;if(Dg(o))return null;o=pc(o)}return null}function uv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Lu(i){return["html","body","#document"].includes(bp(i))}function rr(i){return fa(i).getComputedStyle(i)}function Og(i){return ar(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function pc(i){if(bp(i)==="html")return i;const o=i.assignedSlot||i.parentNode||OP(i)&&i.host||Yr(i);return OP(o)?o.host:o}function RP(i){const o=pc(i);return Lu(o)?i.ownerDocument?i.ownerDocument.body:i.body:Xr(o)&&Lh(o)?o:RP(o)}function Ph(i,o,n){var a;o===void 0&&(o=[]),n===void 0&&(n=!0);const l=RP(i),s=l===((a=i.ownerDocument)==null?void 0:a.body),d=fa(l);if(s){const p=hv(d);return o.concat(d,d.visualViewport||[],Lh(l)?l:[],p&&n?Ph(p):[])}return o.concat(l,Ph(l,[],n))}function hv(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function BP(i){const o=rr(i);let n=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=Xr(i),s=l?i.offsetWidth:n,d=l?i.offsetHeight:a,p=Sg(n)!==s||Sg(a)!==d;return p&&(n=s,a=d),{width:n,height:a,$:p}}function fv(i){return ar(i)?i:i.contextElement}function Pu(i){const o=fv(i);if(!Xr(o))return Zr(1);const n=o.getBoundingClientRect(),{width:a,height:l,$:s}=BP(o);let d=(s?Sg(n.width):n.width)/a,p=(s?Sg(n.height):n.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const Cve=Zr(0);function LP(i){const o=fa(i);return!uv()||!o.visualViewport?Cve:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function kve(i,o,n){return o===void 0&&(o=!1),!n||o&&n!==fa(i)?!1:o}function gp(i,o,n,a){o===void 0&&(o=!1),n===void 0&&(n=!1);const l=i.getBoundingClientRect(),s=fv(i);let d=Zr(1);o&&(a?ar(a)&&(d=Pu(a)):d=Pu(i));const p=kve(s,n,a)?LP(s):Zr(0);let h=(l.left+p.x)/d.x,f=(l.top+p.y)/d.y,g=l.width/d.x,w=l.height/d.y;if(s){const v=fa(s),C=a&&ar(a)?fa(a):a;let E=v,T=hv(E);for(;T&&a&&C!==E;){const A=Pu(T),I=T.getBoundingClientRect(),x=rr(T),O=I.left+(T.clientLeft+parseFloat(x.paddingLeft))*A.x,D=I.top+(T.clientTop+parseFloat(x.paddingTop))*A.y;h*=A.x,f*=A.y,g*=A.x,w*=A.y,h+=O,f+=D,E=fa(T),T=hv(E)}}return Ag({width:g,height:w,x:h,y:f})}function mv(i,o){const n=Og(i).scrollLeft;return o?o.left+n:gp(Yr(i)).left+n}function PP(i,o,n){n===void 0&&(n=!1);const a=i.getBoundingClientRect(),l=a.left+o.scrollLeft-(n?0:mv(i,a)),s=a.top+o.scrollTop;return{x:l,y:s}}function xve(i){let{elements:o,rect:n,offsetParent:a,strategy:l}=i;const s=l==="fixed",d=Yr(a),p=o?Dg(o.floating):!1;if(a===d||p&&s)return n;let h={scrollLeft:0,scrollTop:0},f=Zr(1);const g=Zr(0),w=Xr(a);if((w||!w&&!s)&&((bp(a)!=="body"||Lh(d))&&(h=Og(a)),Xr(a))){const C=gp(a);f=Pu(a),g.x=C.x+a.clientLeft,g.y=C.y+a.clientTop}const v=d&&!w&&!s?PP(d,h,!0):Zr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+g.x+v.x,y:n.y*f.y-h.scrollTop*f.y+g.y+v.y}}function Sve(i){return Array.from(i.getClientRects())}function Ive(i){const o=Yr(i),n=Og(i),a=i.ownerDocument.body,l=mp(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),s=mp(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let d=-n.scrollLeft+mv(i);const p=-n.scrollTop;return rr(a).direction==="rtl"&&(d+=mp(o.clientWidth,a.clientWidth)-l),{width:l,height:s,x:d,y:p}}function Eve(i,o){const n=fa(i),a=Yr(i),l=n.visualViewport;let s=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){s=l.width,d=l.height;const f=uv();(!f||f&&o==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}return{width:s,height:d,x:p,y:h}}function Tve(i,o){const n=gp(i,!0,o==="fixed"),a=n.top+i.clientTop,l=n.left+i.clientLeft,s=Xr(i)?Pu(i):Zr(1),d=i.clientWidth*s.x,p=i.clientHeight*s.y,h=l*s.x,f=a*s.y;return{width:d,height:p,x:h,y:f}}function $P(i,o,n){let a;if(o==="viewport")a=Eve(i,n);else if(o==="document")a=Ive(Yr(i));else if(ar(o))a=Tve(o,n);else{const l=LP(i);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Ag(a)}function MP(i,o){const n=pc(i);return n===o||!ar(n)||Lu(n)?!1:rr(n).position==="fixed"||MP(n,o)}function Ave(i,o){const n=o.get(i);if(n)return n;let a=Ph(i,[],!1).filter(p=>ar(p)&&bp(p)!=="body"),l=null;const s=rr(i).position==="fixed";let d=s?pc(i):i;for(;ar(d)&&!Lu(d);){const p=rr(d),h=pv(d);!h&&p.position==="fixed"&&(l=null),(s?!h&&!l:!h&&p.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||Lh(d)&&!h&&MP(i,d))?a=a.filter(g=>g!==d):l=p,d=pc(d)}return o.set(i,a),a}function _ve(i){let{element:o,boundary:n,rootBoundary:a,strategy:l}=i;const d=[...n==="clippingAncestors"?Dg(o)?[]:Ave(o,this._c):[].concat(n),a],p=d[0],h=d.reduce((f,g)=>{const w=$P(o,g,l);return f.top=mp(w.top,f.top),f.right=xg(w.right,f.right),f.bottom=xg(w.bottom,f.bottom),f.left=mp(w.left,f.left),f},$P(o,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Dve(i){const{width:o,height:n}=BP(i);return{width:o,height:n}}function Ove(i,o,n){const a=Xr(o),l=Yr(o),s=n==="fixed",d=gp(i,!0,s,o);let p={scrollLeft:0,scrollTop:0};const h=Zr(0);if(a||!a&&!s)if((bp(o)!=="body"||Lh(l))&&(p=Og(o)),a){const v=gp(o,!0,s,o);h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}else l&&(h.x=mv(l));const f=l&&!a&&!s?PP(l,p):Zr(0),g=d.left+p.scrollLeft-h.x-f.x,w=d.top+p.scrollTop-h.y-f.y;return{x:g,y:w,width:d.width,height:d.height}}function bv(i){return rr(i).position==="static"}function NP(i,o){if(!Xr(i)||rr(i).position==="fixed")return null;if(o)return o(i);let n=i.offsetParent;return Yr(i)===n&&(n=n.ownerDocument.body),n}function jP(i,o){const n=fa(i);if(Dg(i))return n;if(!Xr(i)){let l=pc(i);for(;l&&!Lu(l);){if(ar(l)&&!bv(l))return l;l=pc(l)}return n}let a=NP(i,o);for(;a&&wve(a)&&bv(a);)a=NP(a,o);return a&&Lu(a)&&bv(a)&&!pv(a)?n:a||vve(i)||n}const Rve=async function(i){const o=this.getOffsetParent||jP,n=this.getDimensions,a=await n(i.floating);return{reference:Ove(i.reference,await o(i.floating),i.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Bve(i){return rr(i).direction==="rtl"}const Lve={convertOffsetParentRelativeRectToViewportRelativeRect:xve,getDocumentElement:Yr,getClippingRect:_ve,getOffsetParent:jP,getElementRects:Rve,getClientRects:Sve,getDimensions:Dve,getScale:Pu,isElement:ar,isRTL:Bve};function FP(i,o){return i.x===o.x&&i.y===o.y&&i.width===o.width&&i.height===o.height}function Pve(i,o){let n=null,a;const l=Yr(i);function s(){var p;clearTimeout(a),(p=n)==null||p.disconnect(),n=null}function d(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),s();const f=i.getBoundingClientRect(),{left:g,top:w,width:v,height:C}=f;if(p||o(),!v||!C)return;const E=Ig(w),T=Ig(l.clientWidth-(g+v)),A=Ig(l.clientHeight-(w+C)),I=Ig(g),O={rootMargin:-E+"px "+-T+"px "+-A+"px "+-I+"px",threshold:mp(0,xg(1,h))||1};let D=!0;function R(q){const L=q[0].intersectionRatio;if(L!==h){if(!D)return d();L?d(!1,L):a=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!FP(f,i.getBoundingClientRect())&&d(),D=!1}try{n=new IntersectionObserver(R,{...O,root:l.ownerDocument})}catch{n=new IntersectionObserver(R,O)}n.observe(i)}return d(!0),s}function qP(i,o,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=fv(i),g=l||s?[...f?Ph(f):[],...Ph(o)]:[];g.forEach(I=>{l&&I.addEventListener("scroll",n,{passive:!0}),s&&I.addEventListener("resize",n)});const w=f&&p?Pve(f,n):null;let v=-1,C=null;d&&(C=new ResizeObserver(I=>{let[x]=I;x&&x.target===f&&C&&(C.unobserve(o),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=C)==null||O.observe(o)})),n()}),f&&!h&&C.observe(f),C.observe(o));let E,T=h?gp(i):null;h&&A();function A(){const I=gp(i);T&&!FP(T,I)&&n(),T=I,E=requestAnimationFrame(A)}return n(),()=>{var I;g.forEach(x=>{l&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),w==null||w(),(I=C)==null||I.disconnect(),C=null,h&&cancelAnimationFrame(E)}}const $ve=gve,Mve=fve,VP=yve,zP=mve,UP=(i,o,n)=>{const a=new Map,l={platform:Lve,...n},s={...l.platform,_c:a};return uve(i,o,{...l,platform:s})};function Nve(i){return i!=null&&typeof i=="object"&&"$el"in i}function HP(i){if(Nve(i)){const o=i.$el;return dv(o)&&bp(o)==="#comment"?null:o}return i}function $h(i){return typeof i=="function"?i():c.unref(i)}function KP(i){return typeof window>"u"?1:(i.ownerDocument.defaultView||window).devicePixelRatio||1}function GP(i,o){const n=KP(i);return Math.round(o*n)/n}function jve(i,o,n){n===void 0&&(n={});const a=n.whileElementsMounted,l=c.computed(()=>{var L;return(L=$h(n.open))!=null?L:!0}),s=c.computed(()=>$h(n.middleware)),d=c.computed(()=>{var L;return(L=$h(n.placement))!=null?L:"bottom"}),p=c.computed(()=>{var L;return(L=$h(n.strategy))!=null?L:"absolute"}),h=c.computed(()=>{var L;return(L=$h(n.transform))!=null?L:!0}),f=c.computed(()=>HP(i.value)),g=c.computed(()=>HP(o.value)),w=c.ref(0),v=c.ref(0),C=c.ref(p.value),E=c.ref(d.value),T=c.shallowRef({}),A=c.ref(!1),I=c.computed(()=>{const L={position:C.value,left:"0",top:"0"};if(!g.value)return L;const U=GP(g.value,w.value),K=GP(g.value,v.value);return h.value?{...L,transform:"translate("+U+"px, "+K+"px)",...KP(g.value)>=1.5&&{willChange:"transform"}}:{position:C.value,left:U+"px",top:K+"px"}});let x;function O(){if(f.value==null||g.value==null)return;const L=l.value;UP(f.value,g.value,{middleware:s.value,placement:d.value,strategy:p.value}).then(U=>{w.value=U.x,v.value=U.y,C.value=U.strategy,E.value=U.placement,T.value=U.middlewareData,A.value=L!==!1})}function D(){typeof x=="function"&&(x(),x=void 0)}function R(){if(D(),a===void 0){O();return}if(f.value!=null&&g.value!=null){x=a(f.value,g.value,O);return}}function q(){l.value||(A.value=!1)}return c.watch([s,d,p,l],O,{flush:"sync"}),c.watch([f,g],R,{flush:"sync"}),c.watch(l,q,{flush:"sync"}),c.getCurrentScope()&&c.onScopeDispose(D),{x:c.shallowReadonly(w),y:c.shallowReadonly(v),strategy:c.shallowReadonly(C),placement:c.shallowReadonly(E),middlewareData:c.shallowReadonly(T),isPositioned:c.shallowReadonly(A),floatingStyles:I,update:O}}const WP={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},ZP={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},YP=({target:i,triggers:o,show:n,hide:a})=>{const l=()=>{((p,h)=>{h.forEach(f=>{const g=WP[f];g?p.addEventListener(g,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=ZP[f];w?p.addEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)},s=()=>{((p,h)=>{h.forEach(f=>{const g=WP[f];g?p.removeEventListener(g,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=ZP[f];w?p.removeEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)};c.onMounted(()=>l()),c.onBeforeUnmount(()=>s())},Fve={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(null);return YP({target:l,triggers:n.triggers,show:()=>a("show"),hide:()=>a("hide")}),(s,d)=>(c.openBlock(),c.createElementBlock("aside",{ref_key:"floating",ref:l,class:"wt-tooltip-floating"},[c.renderSlot(s.$slots,"default")],512))}},qve=Ne({__name:"wt-tooltip",props:{visible:{type:Boolean,default:!1},placement:{type:String,default:"auto"},popperTriggers:{type:Array,default:()=>[]},triggers:{type:Array,default:()=>["hover","focus","touch"]},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},disableClickAway:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:o}){const n=i,a=o,l=c.useTemplateRef("activator"),s=c.useTemplateRef("floating"),d=c.useTemplateRef("floatingChild"),p=c.ref(n.visible),h=()=>{a("update:visible",p.value)},f=(T={})=>{n.disabled||p.value||(p.value=!0,T.usedByTooltip=!0,h(),v())},g=(T={})=>{var I;const A=(I=d.value)==null?void 0:I.contains(T.target);!p.value||T.usedByTooltip||A||(p.value=!1,h(),C())},w=(T={})=>{n.disableClickAway||g(T)},v=()=>{window.addEventListener("scroll",g,!0)},C=()=>{window.removeEventListener("scroll",g,!0)},{floatingStyles:E}=jve(l,s,{placement:n.placement==="auto"?null:n.placement,strategy:"fixed",whileElementsMounted:qP,middleware:[VP(),$ve(4),n.placement==="auto"?Mve():zP()]});return YP({target:l,triggers:n.triggers,show:f,hide:g}),c.watch(()=>n.visible,T=>{T?f():g()}),c.onMounted(()=>{n.visible&&f()}),c.onBeforeUnmount(()=>{C()}),(T,A)=>{const I=c.resolveDirective("clickaway");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tooltip--visible":p.value},"wt-tooltip"])},[c.createElementVNode("div",{ref_key:"activator",ref:l,class:"wt-tooltip__activator"},[c.renderSlot(T.$slots,"activator",c.normalizeProps(c.guardReactiveProps({visible:p.value})),void 0,!0)],512),p.value?c.withDirectives((c.openBlock(),c.createBlock(Fve,{key:0,ref_key:"floating",ref:s,class:c.normalizeClass([[i.popperClass],"wt-tooltip__floating"]),style:c.normalizeStyle(c.unref(E)),triggers:i.popperTriggers,onHide:g,onShow:f},{default:c.withCtx(()=>[c.createElementVNode("div",{ref_key:"floatingChild",ref:d},[c.renderSlot(T.$slots,"default",c.normalizeProps(c.guardReactiveProps({hide:g})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[I,w]]):c.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),Vve={class:"wt-tree-line"},zve={class:"wt-tree-line__icon-wrapper"},Uve={class:"wt-tree-line__label"},Hve=c.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},selectedParent:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},allowParent:{type:Boolean,default:!1},searchedProp:{default:"searched"},rootData:{}},emits:["openParent","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>n.itemLabel?n.data[n.itemLabel]:n.data),s=c.computed(()=>{const I=n.nestedIcons?[...n.nestedIcons]:[];return n.nestedLevel===0||I.push({icon:"tree-line",hidden:!n.nextElement}),I}),d=()=>Array.isArray(n.modelValue)?n.itemData?n.modelValue.includes(n.data[n.itemData]):!!n.modelValue.find(x=>dc(x,n.data)):!1,p=c.computed(()=>n.multiple?d():n.itemData?n.data[n.itemData]===n.modelValue:dc(n.modelValue,n.data)),h=c.computed(()=>n.multiple?p.value:p.value||n.selectedParent),f=(I,x,O)=>{const D=n.itemData?I[n.itemData]:I;if(x)O.some(R=>dc(R,D))||O.push(D);else{const R=O.findIndex(q=>dc(q,D));R!==-1&&O.splice(R,1)}if(I&&Array.isArray(I[n.childrenProp])&&I[n.childrenProp].length)for(const R of I[n.childrenProp])f(R,x,O)},g=(I,x,O)=>{const D=(R,q)=>{if(R===I){if(q){const L=n.itemData?q[n.itemData]:q,U=O.findIndex(K=>dc(K,L));U!==-1&&O.splice(U,1)}return!0}if(R&&Array.isArray(R[n.childrenProp])&&R[n.childrenProp].length){for(const L of R[n.childrenProp])if(D(L,R))return!0}return!1};D(x,null)},w=()=>{const I=p.value,x=[...n.modelValue];f(n.data,!I,x),I&&g(n.data,n.rootData,x),a("update:modelValue",x)},v=()=>{const I=n.itemData?n.data[n.itemData]:n.data;let x;if(n.itemData?x=n.modelValue.indexOf(n.data[n.itemData]):x=n.modelValue.findIndex(D=>dc(D,n.data)),x===-1){const D=[...n.modelValue];D.push(I),a("update:modelValue",D);return}const O=[...n.modelValue];O.splice(x,1),a("update:modelValue",O)},C=()=>{var I,x;if(n.multiple){(I=n.data[n.childrenProp])!=null&&I.length?w():v();return}if(n.allowParent&&!n.data[n.childrenProp])return a("update:modelValue",n.itemData?n.data[n.itemData]:n.data);if((x=n.data[n.childrenProp])!=null&&x.length){E.value=!E.value;return}a("update:modelValue",n.itemData?n.data[n.itemData]:n.data)},E=c.ref(!0),T=()=>{n.nestedLevel>0&&a("openParent")},A=()=>{E.value=!1,T()};return c.onMounted(()=>{p.value&&T(),n.data[n.searchedProp]&&T()}),c.watch(()=>n.modelValue,()=>{p.value&&T()}),(I,x)=>{const O=c.resolveComponent("wt-icon"),D=c.resolveComponent("wt-icon-btn"),R=c.resolveComponent("wt-tree-line",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",Vve,[c.createElementVNode("div",zve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.nestedIcons,(q,L)=>(c.openBlock(),c.createBlock(O,{key:L,icon:q.icon,class:c.normalizeClass({hidden:q.hidden})},null,8,["icon","class"]))),128)),I.nestedLevel>=1?(c.openBlock(),c.createBlock(O,{key:0,icon:I.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):c.createCommentVNode("",!0),I.data[I.childrenProp]&&I.data[I.childrenProp].length?(c.openBlock(),c.createBlock(D,{key:1,icon:E.value?"plus":"minus",onClick:x[0]||(x[0]=q=>E.value=!E.value)},null,8,["icon"])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:c.normalizeClass([{active:h.value,searched:n.data[n.searchedProp]},"wt-tree-line__label-wrapper"]),onClick:C},[c.createElementVNode("p",Uve,c.toDisplayString(l.value),1),h.value?(c.openBlock(),c.createBlock(O,{key:0,icon:"chat-message-status-sent"})):c.createCommentVNode("",!0)],2)]),c.withDirectives(c.createVNode(G8,null,{default:c.withCtx(()=>[c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.data[I.childrenProp],(q,L)=>(c.openBlock(),c.createBlock(R,{key:L,"model-value":I.modelValue,data:q,"children-prop":I.childrenProp,"item-label":I.itemLabel,"item-data":I.itemData,"nested-level":I.nestedLevel+1,"selected-parent":p.value||I.selectedParent,"next-element":!!I.data[I.childrenProp][L+1],"nested-icons":s.value,"last-child":L===I.data[I.childrenProp].length-1,multiple:I.multiple,"allow-parent":I.allowParent,"root-data":I.rootData||I.data,onOpenParent:A,"onUpdate:modelValue":x[1]||(x[1]=U=>a("update:modelValue",U))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","selected-parent","next-element","nested-icons","last-child","multiple","allow-parent","root-data"]))),128))])],void 0,!0),_:1},512),[[c.vShow,!E.value]])],64)}}}),gv={Tree:"tree",List:"list"},Kve={class:"wt-tree"},Gve={key:0,class:"wt-tree__content"},Wve={key:1,class:"wt-tree__list-content"},Zve=["onClick"],Yve=c.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:gv.Tree},childrenProp:{default:"children"},multiple:{type:Boolean},allowParent:{type:Boolean,default:!1}},emits:["select","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>{const p=[],h=f=>{p.push(f),f[n.childrenProp]&&f[n.childrenProp].forEach(g=>{h(g)})};return n.data.forEach(f=>{h(f)}),p}),s=p=>{a("update:modelValue",n.itemData?p[n.itemData]:p)},d=p=>n.itemData?p[n.itemData]===n.modelValue:dc(n.modelValue,p);return(p,h)=>{const f=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Kve,[p.mode===c.unref(gv).Tree?(c.openBlock(),c.createElementBlock("div",Gve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.data,(g,w)=>(c.openBlock(),c.createBlock(Hve,{key:w,"model-value":p.modelValue,"item-label":p.itemLabel,"item-data":p.itemData,data:g,"children-prop":p.childrenProp,multiple:p.multiple,"allow-parent":p.allowParent,"onUpdate:modelValue":h[0]||(h[0]=v=>a("update:modelValue",v))},null,8,["model-value","item-label","item-data","data","children-prop","multiple","allow-parent"]))),128))])):c.createCommentVNode("",!0),p.mode===c.unref(gv).List?(c.openBlock(),c.createElementBlock("div",Wve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.value,(g,w)=>(c.openBlock(),c.createElementBlock("span",{key:w,class:c.normalizeClass(["wt-tree__label-wrapper",{active:d(g)}])},[c.createElementVNode("p",{class:"wt-tree__label",onClick:v=>s(g)},c.toDisplayString(p.itemLabel?g[p.itemLabel]:g),9,Zve),d(g)?(c.openBlock(),c.createBlock(f,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):c.createCommentVNode("",!0)],2))),128))])):c.createCommentVNode("",!0)])}}}),Xve={class:"wt-tree-table-td__content"},Qve={key:0,class:"wt-tree-table-td__icon-wrapper"},Jve={key:0,class:"wt-tree-table-td__actions"},eCe={class:"wt-tree-table-td__content"},tCe=Ne(c.defineComponent({__name:"wt-tree-table-row",props:{data:{},rowPosition:{},childrenProp:{},selectable:{type:Boolean,default:!1},selectedElements:{},dataHeaders:{},gridActions:{type:Boolean,default:!0},nestingLevel:{default:0},searchedProp:{default:"searched"}},emits:["update:selected","expanded-collapse"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(!0),s=c.computed(()=>n.nestingLevel),d=c.computed(()=>n.nestingLevel+1),p=c.computed(()=>n.selectedElements.includes(n.data)),h=()=>{l.value=!1,a("expanded-collapse")},f=(g,w=0)=>{if(g[n.searchedProp]&&w)return!0;if(Array.isArray(g[n.childrenProp])){for(const v of g[n.childrenProp])if(f(v,w+1))return!0}return!1};return c.onMounted(()=>{n.searchedProp&&f(n.data)&&h()}),(g,w)=>{const v=c.resolveComponent("wt-tree-table-row",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("tr",{class:c.normalizeClass([[{"wt-tree-table-row--alternate":g.rowPosition%2}],"wt-tree-table-row"])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g.dataHeaders,(C,E)=>(c.openBlock(),c.createElementBlock("td",{key:E,class:"wt-tree-table-td"},[c.createElementVNode("div",Xve,[E?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",Qve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,T=>(c.openBlock(),c.createElementBlock("div",{key:T,class:"wt-tree-table-row__tree-space"}))),128)),g.selectable?(c.openBlock(),c.createBlock(d8,{key:0,selected:p.value,"onUpdate:selected":w[0]||(w[0]=T=>g.$emit("update:selected",{data:g.data,select:T}))},null,8,["selected"])):c.createCommentVNode("",!0),g.data[g.childrenProp]?(c.openBlock(),c.createBlock(up,{key:1,icon:l.value?"tree-expand":"tree-collapse",onClick:w[1]||(w[1]=T=>l.value=!l.value)},null,8,["icon"])):c.createCommentVNode("",!0)])),c.renderSlot(g.$slots,C.value,{index:g.rowPosition,item:g.data},()=>[c.createTextVNode(c.toDisplayString(g.data[C.value]),1)],!0)])]))),128)),g.gridActions?(c.openBlock(),c.createElementBlock("td",Jve,[c.createElementVNode("div",eCe,[c.renderSlot(g.$slots,"actions",{index:g.rowPosition,item:g.data},void 0,!0)])])):c.createCommentVNode("",!0)],2),l.value?c.createCommentVNode("",!0):(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(g.data[g.childrenProp],(C,E)=>(c.openBlock(),c.createBlock(v,{key:E,"children-prop":g.childrenProp,data:C,"data-headers":g.dataHeaders,"nesting-level":d.value,"row-position":g.rowPosition,"searched-prop":g.searchedProp,selectable:g.selectable,"selected-elements":g.selectedElements,onExpandedCollapse:h,"onUpdate:selected":w[2]||(w[2]=T=>g.$emit("update:selected",{data:T.data,select:T.select}))},c.createSlots({actions:c.withCtx(({item:T})=>[c.renderSlot(g.$slots,"actions",{index:g.rowPosition,item:T},void 0,!0)]),_:2},[c.renderList(g.dataHeaders,(T,A)=>({name:T.value,fn:c.withCtx(({item:I})=>[c.renderSlot(g.$slots,T.value,{index:g.rowPosition,item:I},()=>[c.createElementVNode("div",null,c.toDisplayString(I[T.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-638adedd"]]),oCe={class:"wt-tree-table"},iCe={class:"wt-tree-table-wrapper"},nCe={class:"wt-tree-table-head"},aCe={class:"wt-tree-table-tr wt-tree-table-tr-head"},rCe=["onClick"],lCe={class:"wt-tree-table-th__content"},sCe={class:"wt-tree-table-th__text"},cCe={key:0,class:"wt-tree-table-th__actions"},dCe={class:"wt-tree-table-th__content"},pCe={class:"wt-tree-table-body"},uCe=Ne(c.defineComponent({__name:"wt-tree-table",props:{headers:{},data:{},sortable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},selected:{},gridActions:{type:Boolean,default:!0},childrenProp:{},searchedProp:{default:"searched"}},emits:["sort","update:selected"],setup(i,{emit:o}){const n=i,a=o,l=T=>T[n.childrenProp]&&Array.isArray(T[n.childrenProp]),s=T=>{const A=[],I=x=>{if(x._isSelected)return[x];l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},d=T=>{const A=[],I=x=>{A.push(x),l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},p=c.computed(()=>n.selected||s(n.data)),h=c.computed(()=>p.value.length===d(n.data).length&&d(n.data).length>0),{tableHeaders:f}=r9e({headers:c.toRef(n,"headers")}),g=({sort:T})=>n.sortable&&T!==void 0,w=T=>{if(!g(T))return;const A=lL(T.sort);a("sort",T,A)},v=(T,A)=>{T.forEach(I=>{I._isSelected=A,l(I)&&v(I[n.childrenProp],A)})},C=()=>{n.selected?a("update:selected",h.value?[]:[...d(n.data)]):h.value?v(n.data,!1):v(n.data,!0)},E=(T,A)=>{n.selected?A?a("update:selected",[...p.value,T]):a("update:selected",p.value.filter(I=>I!==T)):T._isSelected=!T._isSelected};return(T,A)=>{const I=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",oCe,[c.createElementVNode("table",iCe,[c.createElementVNode("thead",nCe,[c.createElementVNode("tr",aCe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,O)=>(c.openBlock(),c.createElementBlock("th",{key:String(O)+(x==null?void 0:x.sort),class:c.normalizeClass([[{"wt-tree-table-th--sortable":g(x)},`wt-tree-table-th--sort-${x.sort}`],"wt-tree-table-th"]),style:c.normalizeStyle(x.width?`min-width:${x.width}`:""),onClick:D=>w(x)},[c.createElementVNode("div",lCe,[O===0&&T.selectable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:A[0]||(A[0]=c.withModifiers(()=>{},["stop"]))},[c.createVNode(d8,{selected:h.value,"onUpdate:selected":C},null,8,["selected"])])):c.createCommentVNode("",!0),c.createElementVNode("div",sCe,c.toDisplayString(x.text),1),T.sortable?(c.openBlock(),c.createBlock(I,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):c.createCommentVNode("",!0),T.sortable?(c.openBlock(),c.createBlock(I,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):c.createCommentVNode("",!0)])],14,rCe))),128)),T.gridActions?(c.openBlock(),c.createElementBlock("th",cCe,[c.createElementVNode("div",dCe,[c.renderSlot(T.$slots,"actions-header",{},void 0,!0)])])):c.createCommentVNode("",!0)])]),c.createElementVNode("tbody",pCe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(T.data,(x,O)=>(c.openBlock(),c.createBlock(tCe,{key:O,"row-position":O,"data-headers":c.unref(f),data:x,selectable:T.selectable,"children-prop":T.childrenProp,"selected-elements":p.value,"searched-prop":T.searchedProp,"onUpdate:selected":A[1]||(A[1]=D=>E(D.data,D.select))},c.createSlots({actions:c.withCtx(({item:D})=>[c.renderSlot(T.$slots,"actions",{item:D},void 0,!0)]),_:2},[c.renderList(c.unref(f),(D,R)=>({name:D.value,fn:c.withCtx(({item:q})=>[c.renderSlot(T.$slots,D.value,{index:O,item:q},()=>[c.createTextVNode(c.toDisplayString(q[D.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-8c02ec24"]]),Qr=Symbol(0);let Rg=!1,yv=!1,lr=null,$u=null,Pa=null,ma=0,Mu=[],wv={};const hCe=()=>{},Nu=0,XP=1,Bg=2,Lg=3;function fCe(){Rg=!0,queueMicrotask(QP)}function QP(){if(!Mu.length){Rg=!1;return}yv=!0;for(let i=0;i<Mu.length;i++)Mu[i].$st!==Nu&&mCe(Mu[i]);Mu=[],Rg=!1,yv=!1}function mCe(i){let o=[i];for(;i=i[Qr];)i.$e&&i.$st!==Nu&&o.push(i);for(let n=o.length-1;n>=0;n--)Iv(o[n])}function bCe(i){const o=uc();return Mh(o,i.length?i.bind(null,Fu.bind(o)):i,null)}function Re(i){return Mh(lr,i,null)}function ju(i){return Mh(null,i,null)}function is(){yv||QP()}function Pg(){return lr}function kn(i,o){try{return Mh(o,i,null)}catch(n){vv(o,n);return}}function JP(i,o=lr){return o==null?void 0:o.$cx[i]}function gCe(i,o,n=lr){n&&(n.$cx={...n.$cx,[i]:o})}function At(i){if(!i||!lr)return i||hCe;const o=lr;return o.$d?Array.isArray(o.$d)?o.$d.push(i):o.$d=[o.$d,i]:o.$d=i,function(){o.$st!==Lg&&(i.call(null),$g(o.$d)?o.$d=null:Array.isArray(o.$d)&&o.$d.splice(o.$d.indexOf(i),1))}}function Fu(i=!0){if(this.$st!==Lg){if(this.$h)if(Array.isArray(this.$h))for(let o=this.$h.length-1;o>=0;o--)Fu.call(this.$h[o]);else Fu.call(this.$h);if(i){const o=this[Qr];o&&(Array.isArray(o.$h)?o.$h.splice(o.$h.indexOf(this),1):o.$h=null),yCe(this)}}}function yCe(i){i.$st=Lg,i.$d&&e$(i),i.$s&&Ev(i,0),i[Qr]=null,i.$s=null,i.$o=null,i.$h=null,i.$cx=wv,i.$eh=null}function e$(i){try{if(Array.isArray(i.$d))for(let o=i.$d.length-1;o>=0;o--){const n=i.$d[o];n.call(n)}else i.$d.call(i.$d);i.$d=null}catch(o){vv(i,o)}}function Mh(i,o,n){const a=lr,l=$u;lr=i,$u=n;try{return o.call(i)}finally{lr=a,$u=l}}function vv(i,o){if(!i||!i.$eh)throw o;let n=0,a=i.$eh.length,l=o;for(n=0;n<a;n++)try{i.$eh[n](l);break}catch(s){l=s}if(n===a)throw l}function Cv(){return this.$st===Lg?this.$v:($u&&!this.$e&&(!Pa&&$u.$s&&$u.$s[ma]==this?ma++:Pa?Pa.push(this):Pa=[this]),this.$c&&Iv(this),this.$v)}function t$(i){const o=$g(i)?i(this.$v):i;if(this.$ch(this.$v,o)&&(this.$v=o,this.$o))for(let n=0;n<this.$o.length;n++)a$(this.$o[n],Bg);return this.$v}const kv=function(){this[Qr]=null,this.$h=null,lr&&lr.append(this)},yp=kv.prototype;yp.$cx=wv,yp.$eh=null,yp.$c=null,yp.$d=null,yp.append=function(i){i[Qr]=this,this.$h?Array.isArray(this.$h)?this.$h.push(i):this.$h=[this.$h,i]:this.$h=i,i.$cx=i.$cx===wv?this.$cx:{...this.$cx,...i.$cx},this.$eh&&(i.$eh=i.$eh?[...i.$eh,...this.$eh]:this.$eh)},yp.dispose=function(){Fu.call(this)};function uc(){return new kv}const o$=function(o,n,a){kv.call(this),this.$st=n?Bg:Nu,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=o,n&&(this.$c=n),a&&a.dirty&&(this.$ch=a.dirty)},xv=o$.prototype;Object.setPrototypeOf(xv,yp),xv.$ch=wCe,xv.call=Cv;function Sv(i,o,n){return new o$(i,o,n)}function wCe(i,o){return i!==o}function $g(i){return typeof i=="function"}function Iv(i){if(i.$st===XP)for(let o=0;o<i.$s.length&&(Iv(i.$s[o]),i.$st!==Bg);o++);i.$st===Bg?i$(i):i.$st=Nu}function vCe(i){i.$h&&Fu.call(i,!1),i.$d&&e$(i),i.$eh=i[Qr]?i[Qr].$eh:null}function i$(i){let o=Pa,n=ma;Pa=null,ma=0;try{vCe(i);const a=Mh(i,i.$c,i);n$(i),!i.$e&&i.$i?t$.call(i,a):(i.$v=a,i.$i=!0)}catch(a){n$(i),vv(i,a)}finally{Pa=o,ma=n,i.$st=Nu}}function n$(i){if(Pa){if(i.$s&&Ev(i,ma),i.$s&&ma>0){i.$s.length=ma+Pa.length;for(let n=0;n<Pa.length;n++)i.$s[ma+n]=Pa[n]}else i.$s=Pa;let o;for(let n=ma;n<i.$s.length;n++)o=i.$s[n],o.$o?o.$o.push(i):o.$o=[i]}else i.$s&&ma<i.$s.length&&(Ev(i,ma),i.$s.length=ma)}function a$(i,o){if(!(i.$st>=o)&&(i.$e&&i.$st===Nu&&(Mu.push(i),Rg||fCe()),i.$st=o,i.$o))for(let n=0;n<i.$o.length;n++)a$(i.$o[n],XP)}function Ev(i,o){let n,a;for(let l=o;l<i.$s.length;l++)n=i.$s[l],n.$o&&(a=n.$o.indexOf(i),n.$o[a]=n.$o[n.$o.length-1],n.$o.pop())}function Mg(...i){}function Jr(i){return i===null}function an(i){return typeof i>"u"}function CCe(i){return Jr(i)||an(i)}function r$(i){return(i==null?void 0:i.constructor)===Object}function Li(i){return typeof i=="number"&&!Number.isNaN(i)}function et(i){return typeof i=="string"}function l$(i){return typeof i=="boolean"}function sr(i){return typeof i=="function"}function rn(i){return Array.isArray(i)}const kCe=Event,s$=Symbol("DOM_EVENT");class Ot extends(Pz=kCe,Lz=s$,Pz){constructor(n,...a){var s,d;super(n,a[0]);V(this,Lz,!0);V(this,"detail");V(this,"triggers",new xCe);this.detail=(s=a[0])==null?void 0:s.detail;const l=(d=a[0])==null?void 0:d.trigger;l&&this.triggers.add(l)}get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){var n;return((n=this.triggers.origin)==null?void 0:n.isTrusted)??!1}}class xCe{constructor(){V(this,"chain",[])}get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(o){this.chain.push(o),SCe(o)&&this.chain.push(...o.triggers)}remove(o){return this.chain.splice(this.chain.indexOf(o),1)[0]}has(o){return this.chain.some(n=>n===o)}hasType(o){return!!this.findType(o)}findType(o){return this.chain.find(n=>n.type===o)}walk(o){for(const n of this.chain){const a=o(n);if(a)return[n,a]}}[Symbol.iterator](){return this.chain.values()}}function SCe(i){return!!(i!=null&&i[s$])}class c$ extends EventTarget{constructor(){super(...arguments);V(this,"$ts__events")}addEventListener(n,a,l){return super.addEventListener(n,a,l)}removeEventListener(n,a,l){return super.removeEventListener(n,a,l)}}function po(i,o,n,a){return i.addEventListener(o,n,a),At(()=>i.removeEventListener(o,n,a))}class go{constructor(o){P(this,p2);P(this,u2);N(this,p2,o),N(this,u2,new AbortController),At(this.abort.bind(this))}get signal(){return b(this,u2).signal}add(o,n,a){if(this.signal.aborted)throw Error("aborted");return b(this,p2).addEventListener(o,n,{...a,signal:a!=null&&a.signal?ICe(this.signal,a.signal):this.signal}),this}remove(o,n){return b(this,p2).removeEventListener(o,n),this}abort(o){b(this,u2).abort(o)}}p2=new WeakMap,u2=new WeakMap;function ICe(...i){const o=new AbortController,n={signal:o.signal};function a(l){o.abort(l.target.reason)}for(const l of i){if(l.aborted){o.abort(l.reason);break}l.addEventListener("abort",a,n)}return o.signal}function d$(i){return!!(i!=null&&i.type.startsWith("pointer"))}function Ng(i){return!!(i!=null&&i.type.startsWith("touch"))}function ECe(i){return/^(click|mouse)/.test((i==null?void 0:i.type)??"")}function jg(i){return!!(i!=null&&i.type.startsWith("key"))}function TCe(i){return jg(i)&&i.key==="Enter"}function p$(i){return jg(i)&&(i.key==="Enter"||i.key===" ")}function ACe(i){return i instanceof Node}function We(i,o,n){if(i)if(!n&&n!==""&&n!==0)i.removeAttribute(o);else{const a=n===!0?"":n+"";i.getAttribute(o)!==a&&i.setAttribute(o,a)}else return}function Zn(i,o,n){if(i)!n&&n!==0?i.style.removeProperty(o):i.style.setProperty(o,n+"");else return}function ct(i,o){const n=Sv(i,null,o),a=Cv.bind(n);return a[Qr]=!0,a.set=t$.bind(n),a}function _Ce(i){return $g(i)&&Qr in i}function cr(i,o){const n=Sv(o==null?void 0:o.initial,i,o),a=Cv.bind(n);return a[Qr]=!0,a}function DCe(i,o){const n=Sv(null,function(){let l=i();return $g(l)&&At(l),null},void 0);return n.$e=!0,i$(n),Fu.bind(n,!0)}function OCe(i){return _Ce(i)&&"set"in i}const fe=DCe;function hc(i){return{id:Symbol(),provide:i}}function ba(i,o,n=Pg()){var l;const a=!an(o);gCe(i.id,a?o:(l=i.provide)==null?void 0:l.call(i),n)}function qo(i){return JP(i.id)}function ga(i){return!an(JP(i.id))}const Nh=Symbol(0),jh=Symbol(0),u$=Symbol(0),Tv={};$z=u$;class RCe{constructor(o,n,a){P(this,ll);V(this,"$ts__events");V(this,"$ts__vars");V(this,$z,null);V(this,"$el",ct(null));V(this,"el",null);V(this,"scope",null);V(this,"attachScope",null);V(this,"connectScope",null);V(this,"component",null);V(this,"destroyed",!1);V(this,"props",Tv);V(this,"attrs",null);V(this,"styles",null);V(this,"state");V(this,"$state");P(this,h2,[]);P(this,f2,[]);P(this,Gp,[]);P(this,m2,[]);var d;this.scope=n,a!=null&&a.scope&&a.scope.append(n);let l=o.state,s=o.props;if(l&&(this.$state=l.create(),this.state=new Proxy(this.$state,{get:(p,h)=>this.$state[h]()}),ba(l,this.$state)),s&&(this.props=BCe(s),a!=null&&a.props))for(const p of Object.keys(a.props))(d=this.props[p])==null||d.set(a.props[p]);At(this.destroy.bind(this))}setup(){kn(()=>{for(const o of b(this,h2))o()},this.scope)}attach(o){this.el||(this.el=o,this.$el.set(o),kn(()=>{this.attachScope=uc(),kn(()=>{for(const n of b(this,f2))n(this.el);k(this,ll,oU).call(this),k(this,ll,iU).call(this)},this.attachScope)},this.scope),o.dispatchEvent(new Event("attached")))}detach(){var o;(o=this.attachScope)==null||o.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!b(this,Gp).length||kn(()=>{this.connectScope=uc(),kn(()=>{for(const o of b(this,Gp))o(this.el)},this.connectScope)},this.attachScope)}disconnect(){var o;(o=this.connectScope)==null||o.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,kn(()=>{for(const n of b(this,m2))n(this.el)},this.scope);const o=this.el;this.detach(),this.scope.dispose(),b(this,h2).length=0,b(this,f2).length=0,b(this,Gp).length=0,b(this,m2).length=0,this.component=null,this.attrs=null,this.styles=null,this.props=Tv,this.scope=null,this.state=Tv,this.$state=null,o&&delete o.$}addHooks(o){o.onSetup&&b(this,h2).push(o.onSetup.bind(o)),o.onAttach&&b(this,f2).push(o.onAttach.bind(o)),o.onConnect&&b(this,Gp).push(o.onConnect.bind(o)),o.onDestroy&&b(this,m2).push(o.onDestroy.bind(o))}}h2=new WeakMap,f2=new WeakMap,Gp=new WeakMap,m2=new WeakMap,ll=new WeakSet,oU=function(){if(this.attrs)for(const o of Object.keys(this.attrs))sr(this.attrs[o])?fe(k(this,ll,nU).bind(this,o)):We(this.el,o,this.attrs[o])},iU=function(){if(this.styles)for(const o of Object.keys(this.styles))sr(this.styles[o])?fe(k(this,ll,aU).bind(this,o)):Zn(this.el,o,this.styles[o])},nU=function(o){We(this.el,o,this.attrs[o].call(this.component))},aU=function(o){Zn(this.el,o,this.styles[o].call(this.component))};function BCe(i){const o={};for(const n of Object.keys(i)){const a=i[n];o[n]=ct(a,a)}return o}let Fh={$$:null};function LCe(i,o){return bCe(()=>{Fh.$$=new RCe(i,Pg(),o);const n=new i;return Fh.$$.component=n,Fh.$$=null,n})}class $a extends EventTarget{constructor(){super();V(this,"$$");Fh.$$&&this.attach(Fh)}get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}attach({$$:n}){return this.$$=n,n.addHooks(this),this}addEventListener(n,a,l){this.listen(n,a,l)}removeEventListener(n,a,l){var s;(s=this.el)==null||s.removeEventListener(n,a,l)}setAttributes(n){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,n)}setStyles(n){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,n)}setCSSVars(n){this.setStyles(n)}createEvent(n,...a){return new Ot(n,a[0])}dispatch(n,...a){if(!this.el)return!1;const l=n instanceof Event?n:new Ot(n,a[0]);return Object.defineProperty(l,"target",{get:()=>this.$$.component}),ju(()=>{var s,d;return(d=(s=this.$$)[u$])==null||d.call(s,l),this.el.dispatchEvent(l)})}dispatchEvent(n){return this.dispatch(n)}listen(n,a,l){return this.el?po(this.el,n,a,l):Mg}}class dt extends $a{subscribe(o){return kn(()=>fe(()=>o(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}}function $t(i,o,n){i[Nh]||(i[Nh]=new Set),i[Nh].add(o)}function ti(i,o,n){i[jh]||(i[jh]=new Set),i[jh].add(o)}class fc{constructor(o){V(this,"id",Symbol(0));V(this,"record");P(this,b2);this.record=o,N(this,b2,Object.getOwnPropertyDescriptors(o))}create(){const o={},n=new Proxy(o,{get:(a,l)=>o[l]()});for(const a of Object.keys(this.record)){const l=b(this,b2)[a].get;o[a]=l?cr(l.bind(n)):ct(this.record[a])}return o}reset(o,n){for(const a of Object.keys(o))!b(this,b2)[a].get&&(!n||n(a))&&o[a].set(this.record[a])}}b2=new WeakMap;function qu(i){return qo(i)}function PCe(i,o){for(const n of i)n(o)}function Fg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $Ce(i){return i.replace(/-./g,o=>o[1].toUpperCase())}function MCe(i){return i.charAt(0).toUpperCase()+i.slice(1)}function qg(i){return i?"true":"false"}function h$(i){return Object.keys(i)}function Vu(){let i,o;return{promise:new Promise((a,l)=>{i=a,o=l}),resolve:i,reject:o}}function NCe(i){return new Promise(o=>setTimeout(o,i))}function zu(i){let o=-1,n;function a(...l){n=l,!(o>=0)&&(o=window.requestAnimationFrame(()=>{i.apply(this,n),o=-1,n=void 0}))}return a}const jCe=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:i=>window.setTimeout(i,1):Mg;function FCe(i,o){return new Promise(n=>{jCe(a=>{i==null||i(a),n()},o)})}var ya={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},f$=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],m$=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],b$=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Yn=typeof window<"u"&&typeof window.document<"u"?window.document:{},Ma="fullscreenEnabled"in Yn&&Object.keys(ya)||f$[0]in Yn&&f$||m$[0]in Yn&&m$||b$[0]in Yn&&b$||[],wp={requestFullscreen:function(i){return i[Ma[ya.requestFullscreen]]()},requestFullscreenFunction:function(i){return i[Ma[ya.requestFullscreen]]},get exitFullscreen(){return Yn[Ma[ya.exitFullscreen]].bind(Yn)},get fullscreenPseudoClass(){return":"+Ma[ya.fullscreen]},addEventListener:function(i,o,n){return Yn.addEventListener(Ma[ya[i]],o,n)},removeEventListener:function(i,o,n){return Yn.removeEventListener(Ma[ya[i]],o,n)},get fullscreenEnabled(){return!!Yn[Ma[ya.fullscreenEnabled]]},set fullscreenEnabled(i){},get fullscreenElement(){return Yn[Ma[ya.fullscreenElement]]},set fullscreenElement(i){},get onfullscreenchange(){return Yn[("on"+Ma[ya.fullscreenchange]).toLowerCase()]},set onfullscreenchange(i){return Yn[("on"+Ma[ya.fullscreenchange]).toLowerCase()]=i},get onfullscreenerror(){return Yn[("on"+Ma[ya.fullscreenerror]).toLowerCase()]},set onfullscreenerror(i){return Yn[("on"+Ma[ya.fullscreenerror]).toLowerCase()]=i}},vp=qCe;function qCe(i,o,n){var a=null,l=null,s=n&&n.leading,d=n&&n.trailing;s==null&&(s=!0),d==null&&(d=!s),s==!0&&(d=!1);var p=function(){a&&(clearTimeout(a),a=null)},h=function(){var g=l;p(),g&&g()},f=function(){var g=s&&!a,w=this,v=arguments;if(l=function(){return i.apply(w,v)},a||(a=setTimeout(function(){if(a=null,d)return l()},o)),g)return g=!1,l()};return f.cancel=p,f.flush=h,f}var Av=VCe;function VCe(i,o,n){var a=null,l=null,s=function(){a&&(clearTimeout(a),l=null,a=null)},d=function(){var h=l;s(),h&&h()},p=function(){if(!o)return i.apply(this,arguments);var h=this,f=arguments,g=n&&!a;if(s(),l=function(){i.apply(h,f)},a=setTimeout(function(){if(a=null,!g){var w=l;return l=null,w()}},o),g)return l()};return p.cancel=s,p.flush=d,p}const g$=i=>typeof i=="object"&&i!=null&&i.nodeType===1,y$=(i,o)=>(!o||i!=="hidden")&&i!=="visible"&&i!=="clip",Vg=(i,o)=>{if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){const n=getComputedStyle(i,null);return y$(n.overflowY,o)||y$(n.overflowX,o)||(a=>{const l=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!l&&(l.clientHeight<a.scrollHeight||l.clientWidth<a.scrollWidth)})(i)}return!1},zg=(i,o,n,a,l,s,d,p)=>s<i&&d>o||s>i&&d<o?0:s<=i&&p<=n||d>=o&&p>=n?s-i-a:d>o&&p<n||s<i&&p>n?d-o+l:0,zCe=i=>{const o=i.parentElement;return o??(i.getRootNode().host||null)},UCe=(i,o)=>{var n,a,l,s;if(typeof document>"u")return[];const{scrollMode:d,block:p,inline:h,boundary:f,skipOverflowHiddenElements:g}=o,w=typeof f=="function"?f:pe=>pe!==f;if(!g$(i))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,C=[];let E=i;for(;g$(E)&&w(E);){if(E=zCe(E),E===v){C.push(E);break}E!=null&&E===document.body&&Vg(E)&&!Vg(document.documentElement)||E!=null&&Vg(E,g)&&C.push(E)}const T=(a=(n=window.visualViewport)==null?void 0:n.width)!=null?a:innerWidth,A=(s=(l=window.visualViewport)==null?void 0:l.height)!=null?s:innerHeight,{scrollX:I,scrollY:x}=window,{height:O,width:D,top:R,right:q,bottom:L,left:U}=i.getBoundingClientRect(),{top:K,right:G,bottom:F,left:j}=(pe=>{const $=window.getComputedStyle(pe);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(i);let ee=p==="start"||p==="nearest"?R-K:p==="end"?L+F:R+O/2-K+F,le=h==="center"?U+D/2-j+G:h==="end"?q+G:U-j;const he=[];for(let pe=0;pe<C.length;pe++){const $=C[pe],{height:X,width:W,top:Z,right:ce,bottom:be,left:ue}=$.getBoundingClientRect();if(d==="if-needed"&&R>=0&&U>=0&&L<=A&&q<=T&&($===v&&!Vg($)||R>=Z&&L<=be&&U>=ue&&q<=ce))return he;const M=getComputedStyle($),te=parseInt(M.borderLeftWidth,10),Ce=parseInt(M.borderTopWidth,10),xe=parseInt(M.borderRightWidth,10),Ae=parseInt(M.borderBottomWidth,10);let Le=0,re=0;const de="offsetWidth"in $?$.offsetWidth-$.clientWidth-te-xe:0,ge="offsetHeight"in $?$.offsetHeight-$.clientHeight-Ce-Ae:0,Se="offsetWidth"in $?$.offsetWidth===0?0:W/$.offsetWidth:0,Pe="offsetHeight"in $?$.offsetHeight===0?0:X/$.offsetHeight:0;if(v===$)Le=p==="start"?ee:p==="end"?ee-A:p==="nearest"?zg(x,x+A,A,Ce,Ae,x+ee,x+ee+O,O):ee-A/2,re=h==="start"?le:h==="center"?le-T/2:h==="end"?le-T:zg(I,I+T,T,te,xe,I+le,I+le+D,D),Le=Math.max(0,Le+x),re=Math.max(0,re+I);else{Le=p==="start"?ee-Z-Ce:p==="end"?ee-be+Ae+ge:p==="nearest"?zg(Z,be,X,Ce,Ae+ge,ee,ee+O,O):ee-(Z+X/2)+ge/2,re=h==="start"?le-ue-te:h==="center"?le-(ue+W/2)+de/2:h==="end"?le-ce+xe+de:zg(ue,ce,W,te,xe+de,le,le+D,D);const{scrollLeft:Ve,scrollTop:_e}=$;Le=Pe===0?0:Math.max(0,Math.min(_e+Le/Pe,$.scrollHeight-X/Pe+ge)),re=Se===0?0:Math.max(0,Math.min(Ve+re/Se,$.scrollWidth-W/Se+de)),ee+=_e-Le,le+=Ve-re}he.push({el:$,top:Le,left:re})}return he},_v=i=>i===null?"":i+"",HCe=i=>i===null?null:i+"",KCe=i=>i===null?0:Number(i),w$=i=>i!==null,GCe=()=>null,WCe=i=>i===null?[]:JSON.parse(i),ZCe=i=>i===null?{}:JSON.parse(i);function YCe(i){if(i===null)return HCe;switch(typeof i){case"undefined":return _v;case"string":return _v;case"boolean":return w$;case"number":return KCe;case"function":return GCe;case"object":return rn(i)?WCe:ZCe;default:return _v}}const mc=Symbol(0),v$=Symbol(0),Cp=Symbol(0),kp=Symbol(0);var ns;(function(i){i[i.Idle=0]="Idle";const n=1;i[i.Pending=n]="Pending";const a=2;i[i.Ready=a]="Ready"})(ns||(ns={}));function pt(i,o){var a,l,s;class n extends i{constructor(...h){super(...h);V(this,"$");V(this,l,ns.Idle);V(this,a,null);V(this,"keepAlive",!1);V(this,"forwardKeepAlive",!0);if(this.$=kn(()=>LCe(o),null),this.$.$$.addHooks(this),o.props){const f=this.$props,g=Object.getOwnPropertyDescriptors(this);for(const w of Object.keys(g))w in o.props&&(f[w].set(this[w]),delete this[w])}}static get observedAttributes(){var h;if(!this[mc]&&o.props){const f=new Map;for(const g of Object.keys(o.props)){let w=(h=this.attrs)==null?void 0:h[g],v=et(w)?w:w&&(w==null?void 0:w.attr);v!==!1&&(v||(v=Fg(g)),f.set(v,{prop:g,converter:w&&!et(w)&&(w==null?void 0:w.converter)||YCe(o.props[g])}))}this[mc]=f}return this[mc]?Array.from(this[mc].keys()):[]}get scope(){return this.$.$$.scope}get attachScope(){return this.$.$$.attachScope}get connectScope(){return this.$.$$.connectScope}get $props(){return this.$.$$.props}get $state(){return this.$.$$.$state}get state(){return this.$.state}attributeChangedCallback(h,f,g){var C;const w=this.constructor;if(!w[mc]){(C=super.attributeChangedCallback)==null||C.call(this,h,f,g);return}const v=w[mc].get(h);v&&(this[v.prop]=v.converter(g))}connectedCallback(){var g;const h=(g=this.$)==null?void 0:g.$$;if(!h||h.destroyed)return;if(this[Cp]!==ns.Ready){QCe.call(this);return}if(!this.isConnected)return;this.hasAttribute("keep-alive")&&(this.keepAlive=!0),h.connect(),rn(this[kp])&&PCe(this[kp],this),this[kp]=null;const f=super.connectedCallback;f&&kn(()=>f.call(this),this.connectScope)}disconnectedCallback(){var g;const h=(g=this.$)==null?void 0:g.$$;if(!h||h.destroyed)return;h.disconnect();const f=super.disconnectedCallback;f&&f.call(this),!this.keepAlive&&!this.hasAttribute("keep-alive")&&setTimeout(()=>{requestAnimationFrame(()=>{this.isConnected||h.destroy()})},0)}[(s=mc,l=Cp,a=kp,v$)](){const h=this.$.$$,f=this.constructor;if(h.destroyed)return;const g=f[mc];if(g)for(const w of this.attributes){let v=g.get(w.name);v&&v.converter&&h.props[v.prop].set(v.converter(this.getAttribute(w.name)))}h.setup(),h.attach(this),this[Cp]=ns.Ready,this.connectedCallback()}subscribe(h){return this.$.subscribe(h)}destroy(){this.disconnectedCallback(),this.$.destroy()}}return V(n,"attrs"),V(n,s,null),XCe(n,o),n}function XCe(i,o){const n=i.prototype,a=o.prototype;if(o.props)for(const l of Object.keys(o.props))Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$props[l]()},set(s){this.$props[l].set(s)}});if(a[Nh])for(const l of a[Nh])Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$[l]},set(s){this.$[l]=s}});if(a[jh])for(const l of a[jh])n[l]=function(...s){return this.$[l](...s)}}function QCe(){if(this[Cp]!==ns.Idle)return;this[Cp]=ns.Pending;const i=eke(this),o=i&&window.customElements.get(i.localName),n=i&&i[Cp]===ns.Ready;if(i&&(!o||!n)){JCe.call(this,i);return}C$.call(this,i)}async function JCe(i){await window.customElements.whenDefined(i.localName),i[Cp]!==ns.Ready&&await new Promise(o=>(i[kp]??(i[kp]=[])).push(o)),C$.call(this,i)}function C$(i){if(this.isConnected){if(i){i.keepAlive&&i.forwardKeepAlive&&(this.keepAlive=!0,this.setAttribute("keep-alive",""));const o=this.$.$$.scope;o&&i.$.$$.attachScope.append(o)}this[v$]()}}function eke(i){let o=i.parentNode,n=i.localName.split("-",1)[0]+"-";for(;o;){if(o.nodeType===1&&o.localName.startsWith(n))return o;o=o.parentNode}return null}function lt(i,o=!1){(o||!window.customElements.get(i.tagName))&&window.customElements.define(i.tagName,i)}var tke='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';const k$=hc();function Rt(){return qo(k$)}const oke=(navigator==null?void 0:navigator.userAgent.toLowerCase())||"",Ug=/iphone|ipad|ipod|ios|crios|fxios/i.test(oke),x$=/(iphone|ipod)/gi.test((navigator==null?void 0:navigator.platform)||""),Hg=!!window.chrome,Kg=!!window.safari||Ug;function S$(){return ike()&&sr(screen.orientation.unlock)}function ike(){return!an(window.screen.orientation)&&!an(window.screen.orientation.lock)}function I$(i,o){return i||(i=document.createElement("audio")),i.canPlayType(o).length>0}function E$(i,o){return i||(i=document.createElement("video")),i.canPlayType(o).length>0}function T$(i){return i||(i=document.createElement("video")),i.canPlayType("application/vnd.apple.mpegurl").length>0}function A$(i){return!!document.pictureInPictureEnabled&&!(i!=null&&i.disablePictureInPicture)}function _$(i){return sr(i==null?void 0:i.webkitSupportsPresentationMode)&&sr(i==null?void 0:i.webkitSetPresentationMode)}async function nke(){const i=document.createElement("video");return i.volume=.5,await NCe(0),i.volume===.5}function ake(){return(window==null?void 0:window.ManagedMediaSource)??(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function rke(){return(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function Gg(){const i=ake();if(an(i))return!1;const o=i&&sr(i.isTypeSupported)&&i.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=rke(),a=an(n)||!an(n.prototype)&&sr(n.prototype.appendBuffer)&&sr(n.prototype.remove);return!!o&&!!a}function D$(){return Gg()}const lke=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,ske=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),cke=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,dke=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),pke=/\.(m3u8)($|\?)/i,uke=/\.(mpd)($|\?)/i,hke=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),fke=new Set(["application/dash+xml"]);function O$({src:i,type:o}){return et(i)?lke.test(i)||ske.has(o)||i.startsWith("blob:")&&o==="audio/object":o==="audio/object"}function R$(i){return et(i.src)?cke.test(i.src)||dke.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||Uu(i)&&T$():i.type==="video/object"}function Uu({src:i,type:o}){return et(i)&&pke.test(i)||hke.has(o)}function Dv({src:i,type:o}){return et(i)&&uke.test(i)||fke.has(o)}function B$(i){return et(i.src)&&(O$(i)||R$(i)||Uu(i))}function mke(i){return typeof window.MediaStream<"u"&&i instanceof window.MediaStream}class Ti{constructor(o,n){P(this,hs);rn(o)?N(this,hs,o):!an(o)&&!an(n)?N(this,hs,[[o,n]]):N(this,hs,[])}get length(){return b(this,hs).length}start(o){return b(this,hs)[o][0]??1/0}end(o){return b(this,hs)[o][1]??1/0}}hs=new WeakMap;function L$(i){if(!i.length)return null;let o=i.start(0);for(let n=1;n<i.length;n++){const a=i.start(n);a<o&&(o=a)}return o}function xp(i){if(!i.length)return null;let o=i.end(0);for(let n=1;n<i.length;n++){const a=i.end(n);a>o&&(o=a)}return o}function bke(i){if(i.length<=1)return i;i.sort((a,l)=>a[0]-l[0]);let o=[],n=i[0];for(let a=1;a<i.length;a++){const l=i[a];n[1]>=l[0]-1?n=[n[0],Math.max(n[1],l[1])]:(o.push(n),n=l)}return o.push(n),o}function gke(i,o,n){let a=o[0],l=o[1];return n<a?[n,-1]:n===a?o:a===-1?(o[0]=n,o):(n>a&&(o[1]=n,l===-1&&i.push(o)),bke(i),o)}function yke(i,o){const n=new URL(i);for(const a of Object.keys(o))n.searchParams.set(a,o[a]+"");return n.toString()}function as(i,o="preconnect"){const n=document.querySelector(`link[href="${i}"]`);if(!Jr(n))return!0;const a=document.createElement("link");return a.rel=o,a.href=i,a.crossOrigin="true",document.head.append(a),!0}const qh={};function Ov(i){if(qh[i])return qh[i].promise;const o=Vu(),n=document.querySelector(`script[src="${i}"]`);if(!Jr(n))return o.resolve(),o.promise;qh[i]=o;const a=document.createElement("script");return a.src=i,a.onload=()=>{o.resolve(),delete qh[i]},a.onerror=()=>{o.reject(),delete qh[i]},setTimeout(()=>document.head.append(a),0),o.promise}function Vh(i){return i==="use-credentials"?"include":et(i)?"same-origin":void 0}function Rv(i,o){return o>=i.startTime&&o<i.endTime}function Wg(i,o,n){let a=null,l=Pg();function s(){const d=et(o)?[o]:o,p=i.toArray().find(h=>d.includes(h.kind)&&h.mode==="showing");if(p!==a){if(!p){n(null),a=null;return}p.readyState==2?n(p):(n(null),kn(()=>{const h=po(p,"load",()=>{n(p),h()},{once:!0})},l)),a=p}}return s(),po(i,"mode-change",s)}function wke(i,o,n){Wg(i,o,a=>{if(!a){n("");return}const l=()=>{const s=a==null?void 0:a.activeCues[0];n((s==null?void 0:s.text)||"")};l(),po(a,"cue-change",l)})}const vke=Symbol(0),Cke=Symbol(0),kke=Symbol(0),xke=Symbol(0),Ske=Symbol(0),Ike=Symbol(0),Eke=Symbol(0),kt={crossOrigin:vke,readyState:Cke,updateActiveCues:kke,canLoad:xke,onModeChange:Ske,native:Ike,nativeHLS:Eke};let bc=(qz=class extends c${constructor(n){super();P(this,Ci);V(this,"src");V(this,"content");V(this,"type");V(this,"encoding");V(this,"id","");V(this,"label","");V(this,"language","");V(this,"kind");V(this,"default",!1);P(this,vm,!1);P(this,fs,0);P(this,Wp,"disabled");P(this,Cm,{});P(this,Zp,[]);P(this,dn,[]);P(this,ms,[]);V(this,Fz,0);V(this,jz);V(this,Nz,null);V(this,Mz,null);for(const a of Object.keys(n))this[a]=n[a];this.type||(this.type="vtt"),n.content?k(this,Ci,rU).call(this,n):n.src||(this[kt.readyState]=2)}static createId(n){return`vds-${n.type}-${n.kind}-${n.src??n.label??"?"}`}get metadata(){return b(this,Cm)}get regions(){return b(this,Zp)}get cues(){return b(this,dn)}get activeCues(){return b(this,ms)}get readyState(){return this[kt.readyState]}get mode(){return b(this,Wp)}set mode(n){this.setMode(n)}addCue(n,a){var d;let l=0,s=b(this,dn).length;for(l=0;l<s&&!(n.endTime<=b(this,dn)[l].startTime);l++);l===s?b(this,dn).push(n):b(this,dn).splice(l,0,n),n instanceof TextTrackCue||(d=this[kt.native])==null||d.track.addCue(n),this.dispatchEvent(new Ot("add-cue",{detail:n,trigger:a})),Rv(n,b(this,fs))&&this[kt.updateActiveCues](b(this,fs),a)}removeCue(n,a){var s;const l=b(this,dn).indexOf(n);if(l>=0){const d=b(this,ms).includes(n);b(this,dn).splice(l,1),(s=this[kt.native])==null||s.track.removeCue(n),this.dispatchEvent(new Ot("remove-cue",{detail:n,trigger:a})),d&&this[kt.updateActiveCues](b(this,fs),a)}}setMode(n,a){var l;b(this,Wp)!==n&&(N(this,Wp,n),n==="disabled"?(N(this,ms,[]),k(this,Ci,Ex).call(this)):this.readyState===2?this[kt.updateActiveCues](b(this,fs),a):k(this,Ci,xx).call(this),this.dispatchEvent(new Ot("mode-change",{detail:this,trigger:a})),(l=this[kt.onModeChange])==null||l.call(this))}[(Fz=kt.readyState,jz=kt.crossOrigin,Nz=kt.onModeChange,Mz=kt.native,kt.updateActiveCues)](n,a){if(N(this,fs,n),this.mode==="disabled"||!b(this,dn).length)return;const l=[];for(let d=0,p=b(this,dn).length;d<p;d++){const h=b(this,dn)[d];Rv(h,n)&&l.push(h)}let s=l.length!==b(this,ms).length;if(!s){for(let d=0;d<l.length;d++)if(!b(this,ms).includes(l[d])){s=!0;break}}N(this,ms,l),s&&k(this,Ci,Ex).call(this,a)}[kt.canLoad](){N(this,vm,!0),b(this,Wp)!=="disabled"&&k(this,Ci,xx).call(this)}},vm=new WeakMap,fs=new WeakMap,Wp=new WeakMap,Cm=new WeakMap,Zp=new WeakMap,dn=new WeakMap,ms=new WeakMap,Ci=new WeakSet,rU=function(n){Promise.resolve().then(()=>Z4).then(({parseText:a,VTTCue:l,VTTRegion:s})=>{!et(n.content)||n.type==="json"?(k(this,Ci,Ix).call(this,n.content,l,s),this.readyState!==3&&k(this,Ci,P3).call(this)):a(n.content,{type:n.type}).then(({cues:d,regions:p})=>{N(this,dn,d),N(this,Zp,p),k(this,Ci,P3).call(this)})})},xx=async function(){var n,a;if(!(!b(this,vm)||this[kt.readyState]>0)){if(this[kt.readyState]=1,this.dispatchEvent(new Ot("load-start")),!this.src){k(this,Ci,P3).call(this);return}try{const{parseResponse:l,VTTCue:s,VTTRegion:d}=await Promise.resolve().then(()=>Z4),p=(n=this[kt.crossOrigin])==null?void 0:n.call(this),h=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Vh(p)});if(this.type==="json")k(this,Ci,Ix).call(this,await(await h).text(),s,d);else{const{errors:f,metadata:g,regions:w,cues:v}=await l(h,{type:this.type,encoding:this.encoding});if(((a=f[0])==null?void 0:a.code)===0)throw f[0];N(this,Cm,g),N(this,Zp,w),N(this,dn,v)}k(this,Ci,P3).call(this)}catch(l){k(this,Ci,Sx).call(this,l)}}},P3=function(){if(this[kt.readyState]=2,!this.src||this.type!=="vtt"){const a=this[kt.native];if(a&&!a.managed)for(const l of b(this,dn))a.track.addCue(l)}const n=new Ot("load");this[kt.updateActiveCues](b(this,fs),n),this.dispatchEvent(n)},Sx=function(n){this[kt.readyState]=3,this.dispatchEvent(new Ot("error",{detail:n}))},Ix=function(n,a,l){try{const{regions:s,cues:d}=Ake(n,a,l);N(this,Zp,s),N(this,dn,d)}catch(s){k(this,Ci,Sx).call(this,s)}},Ex=function(n){this.dispatchEvent(new Ot("cue-change",{trigger:n}))},qz);const Tke=/captions|subtitles/;function xn(i){return Tke.test(i.kind)}function Ake(i,o,n){const a=et(i)?JSON.parse(i):i;let l=[],s=[];return a.regions&&n&&(l=a.regions.map(d=>Object.assign(new n,d))),(a.cues||rn(a))&&(s=(rn(a)?a:a.cues).filter(d=>Li(d.startTime)&&Li(d.endTime)).map(d=>Object.assign(new o(0,0,""),d))),{regions:l,cues:s}}const _ke=Symbol(0),Dke=Symbol(0),Oke=Symbol(0),Rke=Symbol(0),Bke=Symbol(0),Lke=Symbol(0),Pke=Symbol(0),$ke=Symbol(0),Mke=Symbol(0),mt={add:_ke,remove:Dke,reset:Oke,select:Rke,readonly:Bke,setReadonly:Lke,onReset:Pke,onRemove:$ke,onUserSelect:Mke},Nke=Symbol(0),jke=Symbol(0),ln={setAuto:Nke,enableAuto:jke};function zh(i){return i instanceof Error?i:Error(typeof i=="string"?i:JSON.stringify(i))}function rs(i,o){if(!i)throw Error("Assertion failed.")}function P$(i,o){const n=o.composedPath()[0];return ACe(n)&&i.contains(n)}const Bv=new Set;{let i=function(){for(const o of Bv)try{o()}catch{}window.requestAnimationFrame(i)};i()}function Fke(i){return Bv.add(i),()=>Bv.delete(i)}function bo(i,o,n){i.hasAttribute(o)||i.setAttribute(o,n)}function gc(i,o){if(i.hasAttribute("aria-label")||i.hasAttribute("data-no-label"))return;if(!sr(o)){We(i,"aria-label",o);return}function n(){We(i,"aria-label",o())}fe(n)}function $$(i){const o=getComputedStyle(i);return o.display!=="none"&&parseInt(o.opacity)>0}function qke(i){return!!i&&("checkVisibility"in i?i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):$$(i))}function M$(i,o){return Fke(()=>o(qke(i)))}function N$(i,o,n){for(;o;){if(o===i)return!0;if(n!=null&&n(o))break;o=o.parentElement}return!1}function yc(i,o){return new go(i).add("pointerup",n=>{n.button===0&&!n.defaultPrevented&&o(n)}).add("keydown",n=>{p$(n)&&o(n)})}function Lv(i){return Ng(i)&&(i.touches.length>1||i.changedTouches.length>1)}function ls(i){let o=Pg(),n=window.requestAnimationFrame(()=>{kn(i,o),n=-1});return()=>void window.cancelAnimationFrame(n)}function Pv(i,o,n){let a,l=i,s=i.parentElement,d=i.content.firstElementChild,p=[];!d&&i.firstElementChild&&(i.innerHTML=i.firstElementChild.outerHTML,i.firstElementChild.remove(),d=i.content.firstElementChild);for(let h=0;h<o;h++)a=document.importNode(d,!0),n==null||n(a,h),s.insertBefore(a,l.nextSibling),p.push(a),l=a;return At(()=>{for(let h=0;h<p.length;h++)p[h].remove()}),p}function $v(i){const o=document.createElement("template");return o.innerHTML=i,o.content}function Mv(i){return i.cloneNode(!0).firstElementChild}function j$(i,o,n,{offsetVarName:a,xOffset:l,yOffset:s,...d}){if(!i)return;const p=n.replace(" ","-").replace("-center","");if(Zn(i,"visibility",o?null:"hidden"),!o)return;let h=n.includes("top");const f=w=>n.includes("left")?`calc(-1 * ${w})`:w,g=w=>h?`calc(-1 * ${w})`:w;return qP(o,i,()=>{UP(o,i,{placement:p,middleware:[...d.middleware??[],zP({fallbackAxisSideDirection:"start",crossAxis:!1}),VP()],...d}).then(({x:w,y:v,middlewareData:C})=>{var T;const E=!!((T=C.flip)!=null&&T.index);h=n.includes(E?"bottom":"top"),i.setAttribute("data-placement",E?n.startsWith("top")?n.replace("top","bottom"):n.replace("bottom","top"):n),Object.assign(i.style,{top:`calc(${v+"px"} + ${g(s?s+"px":`var(--${a}-y-offset, 0px)`)})`,left:`calc(${w+"px"} + ${f(l?l+"px":`var(--${a}-x-offset, 0px)`)})`})})})}function Vke(i){return getComputedStyle(i).animationName!=="none"}function Sp(i){return i instanceof HTMLElement}function zke(i){return i?"true":"false"}function sn(i){return()=>zke(i())}function Uke(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Pi(i,o=2){return Number(i.toFixed(o))}function Nv(i){var o;return((o=String(i).split(".")[1])==null?void 0:o.length)??0}function jv(i,o,n){return Math.max(i,Math.min(n,o))}let Zg=ct(!1);po(document,"pointerdown",()=>{Zg.set(!1)}),po(document,"keydown",i=>{i.metaKey||i.altKey||i.ctrlKey||Zg.set(!0)});class dr extends $a{constructor(){super(...arguments);P(this,sl);P(this,Rc,ct(!1))}onConnect(n){fe(()=>{const a=new go(n);if(!Zg()){b(this,Rc).set(!1),Yg(n,!1),a.add("pointerenter",k(this,sl,cU).bind(this)).add("pointerleave",k(this,sl,dU).bind(this));return}const l=document.activeElement===n;b(this,Rc).set(l),Yg(n,l),a.add("focus",k(this,sl,lU).bind(this)).add("blur",k(this,sl,sU).bind(this))})}focused(){return b(this,Rc).call(this)}}Rc=new WeakMap,sl=new WeakSet,lU=function(){b(this,Rc).set(!0),Yg(this.el,!0)},sU=function(){b(this,Rc).set(!1),Yg(this.el,!1)},cU=function(){F$(this.el,!0)},dU=function(){F$(this.el,!1)};function Yg(i,o){We(i,"data-focus",o),We(i,"data-hocus",o)}function F$(i,o){We(i,"data-hocus",o),We(i,"data-hover",o)}class q$ extends c${constructor(){super(...arguments);V(this,"items",[]);V(this,Vz,!1)}get length(){return this.items.length}get readonly(){return this[mt.readonly]}indexOf(n){return this.items.indexOf(n)}getById(n){return n===""?null:this.items.find(a=>a.id===n)??null}toArray(){return[...this.items]}[(Vz=mt.readonly,Symbol.iterator)](){return this.items.values()}[mt.add](n,a){const l=this.items.length;""+l in this||Object.defineProperty(this,l,{get(){return this.items[l]}}),!this.items.includes(n)&&(this.items.push(n),this.dispatchEvent(new Ot("add",{detail:n,trigger:a})))}[mt.remove](n,a){var s;const l=this.items.indexOf(n);l>=0&&((s=this[mt.onRemove])==null||s.call(this,n,a),this.items.splice(l,1),this.dispatchEvent(new Ot("remove",{detail:n,trigger:a})))}[mt.reset](n){var a;for(const l of[...this.items])this[mt.remove](l,n);this.items=[],this[mt.setReadonly](!1,n),(a=this[mt.onReset])==null||a.call(this)}[mt.setReadonly](n,a){this[mt.readonly]!==n&&(this[mt.readonly]=n,this.dispatchEvent(new Ot("readonly-change",{detail:n,trigger:a})))}}const Fv=wp.fullscreenEnabled;class Hke extends $a{constructor(){super(...arguments);P(this,Lc);P(this,Bc,!1);P(this,g2,!1)}get active(){return b(this,g2)}get supported(){return Fv}onConnect(){new go(wp).add("fullscreenchange",k(this,Lc,uU).bind(this)).add("fullscreenerror",k(this,Lc,hU).bind(this)),At(k(this,Lc,pU).bind(this))}async enter(){try{return N(this,Bc,!0),!this.el||qv(this.el)?void 0:(V$(),wp.requestFullscreen(this.el))}catch(n){throw N(this,Bc,!1),n}}async exit(){if(!(!this.el||!qv(this.el)))return V$(),wp.exitFullscreen()}}Bc=new WeakMap,g2=new WeakMap,Lc=new WeakSet,pU=async function(){Fv&&await this.exit()},uU=function(n){const a=qv(this.el);a!==b(this,g2)&&(a||N(this,Bc,!1),N(this,g2,a),this.dispatch("fullscreen-change",{detail:a,trigger:n}))},hU=function(n){b(this,Bc)&&(this.dispatch("fullscreen-error",{detail:null,trigger:n}),N(this,Bc,!1))};function qv(i){if(wp.fullscreenElement===i)return!0;try{return i.matches(wp.fullscreenPseudoClass)}catch{return!1}}function V$(){if(!Fv)throw Error("[vidstack] no fullscreen API")}const i5=class i5 extends $a{constructor(){super(...arguments);P(this,xa);P(this,Pc,ct(k(this,xa,_x).call(this)));P(this,bs,ct(!1));P(this,Yp)}get type(){return b(this,Pc).call(this)}get locked(){return b(this,bs).call(this)}get portrait(){return b(this,Pc).call(this).startsWith("portrait")}get landscape(){return b(this,Pc).call(this).startsWith("landscape")}get supported(){return i5.supported}onConnect(){if(this.supported)po(screen.orientation,"change",k(this,xa,Tx).bind(this));else{const n=window.matchMedia("(orientation: landscape)");n.onchange=k(this,xa,Tx).bind(this),At(()=>n.onchange=null)}At(k(this,xa,fU).bind(this))}async lock(n){Re(b(this,bs))||b(this,Yp)===n||(k(this,xa,Ax).call(this),await screen.orientation.lock(n),b(this,bs).set(!0),N(this,Yp,n))}async unlock(){Re(b(this,bs))&&(k(this,xa,Ax).call(this),N(this,Yp,void 0),await screen.orientation.unlock(),b(this,bs).set(!1))}};Pc=new WeakMap,bs=new WeakMap,Yp=new WeakMap,xa=new WeakSet,fU=async function(){this.supported&&b(this,bs).call(this)&&await this.unlock()},Tx=function(n){b(this,Pc).set(k(this,xa,_x).call(this)),this.dispatch("orientation-change",{detail:{orientation:Re(b(this,Pc)),lock:b(this,Yp)},trigger:n})},Ax=function(){if(!this.supported)throw Error("[vidstack] no orientation API")},_x=function(){return this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"},V(i5,"supported",S$());let Xg=i5;function Vv(i){return!et(i)&&"width"in i&&"height"in i&&Li(i.width)&&Li(i.height)}const z$=new fc({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Ti,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:S$(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return x$&&this.mediaType==="video"&&(!this.playsInline||!wp.fullscreenEnabled&&this.fullscreen)},get nativeControls(){return this.controls||this.iOSControls},controlsVisible:!1,get controlsHidden(){return!this.controlsVisible},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Ti,playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new Ti,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(xn).length>0},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow},get title(){return this.providedTitle||this.inferredTitle},get poster(){return this.providedPoster||this.inferredPoster},get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.inferredViewType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){const i=L$(this.buffered)??0;return Math.max(i,this.clipStartTime)},get bufferedEnd(){const i=xp(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,i-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)},get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const i=L$(this.seekable)??0;return Math.max(i,this.clipStartTime)},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;const i=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?xp(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,i):i},get seekableWindow(){const i=this.seekableEnd-this.seekableStart;return isNaN(i)?1/0:Math.max(0,i)},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return this.remotePlaybackType==="airplay"&&this.remotePlaybackState==="connected"},get isGoogleCastConnected(){return this.remotePlaybackType==="google-cast"&&this.remotePlaybackState==="connected"},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},get isLiveDVR(){return/:dvr/.test(this.streamType)},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow)},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),U$=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),Kke=new Set([...U$,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function H$(i,o=!1){const n=o?U$:Kke;z$.reset(i,a=>n.has(a)),is()}function K$(i,o){const n=i+o.clipStartTime(),a=Math.floor(i)===Math.floor(o.seekableStart()),l=Math.floor(n)===Math.floor(o.seekableEnd());return a?o.seekableStart():l?o.seekableEnd():o.isLiveDVR()&&o.liveDVRWindow()>0&&n<o.seekableEnd()-o.liveDVRWindow()?o.bufferedStart():Math.min(Math.max(o.seekableStart()+.1,n),o.seekableEnd()-.1)}class Gke{constructor(o=void 0){P(this,ao);P(this,Xp,null);P(this,Sa,null);P(this,y2,-1);P(this,n5);N(this,n5,o)}setTarget(o){N(this,Xp,o)}getPlayer(o){var n;return b(this,Sa)?b(this,Sa):((n=o??b(this,Xp))==null||n.dispatchEvent(new Ot("find-media-player",{detail:a=>void N(this,Sa,a),bubbles:!0,composed:!0})),b(this,Sa))}setPlayer(o){N(this,Sa,o)}startLoading(o){k(this,ao,Co).call(this,"media-start-loading",o)}startLoadingPoster(o){k(this,ao,Co).call(this,"media-poster-start-loading",o)}requestAirPlay(o){k(this,ao,Co).call(this,"media-airplay-request",o)}requestGoogleCast(o){k(this,ao,Co).call(this,"media-google-cast-request",o)}play(o){k(this,ao,Co).call(this,"media-play-request",o)}pause(o){k(this,ao,Co).call(this,"media-pause-request",o)}mute(o){k(this,ao,Co).call(this,"media-mute-request",o)}unmute(o){k(this,ao,Co).call(this,"media-unmute-request",o)}enterFullscreen(o,n){k(this,ao,Co).call(this,"media-enter-fullscreen-request",n,o)}exitFullscreen(o,n){k(this,ao,Co).call(this,"media-exit-fullscreen-request",n,o)}lockScreenOrientation(o,n){k(this,ao,Co).call(this,"media-orientation-lock-request",n,o)}unlockScreenOrientation(o){k(this,ao,Co).call(this,"media-orientation-unlock-request",o)}enterPictureInPicture(o){k(this,ao,Co).call(this,"media-enter-pip-request",o)}exitPictureInPicture(o){k(this,ao,Co).call(this,"media-exit-pip-request",o)}seeking(o,n){k(this,ao,Co).call(this,"media-seeking-request",n,o)}seek(o,n){k(this,ao,Co).call(this,"media-seek-request",n,o)}seekToLiveEdge(o){k(this,ao,Co).call(this,"media-live-edge-request",o)}changeDuration(o,n){k(this,ao,Co).call(this,"media-duration-change-request",n,o)}changeClipStart(o,n){k(this,ao,Co).call(this,"media-clip-start-change-request",n,o)}changeClipEnd(o,n){k(this,ao,Co).call(this,"media-clip-end-change-request",n,o)}changeVolume(o,n){k(this,ao,Co).call(this,"media-volume-change-request",n,Math.max(0,Math.min(1,o)))}changeAudioTrack(o,n){k(this,ao,Co).call(this,"media-audio-track-change-request",n,o)}changeQuality(o,n){k(this,ao,Co).call(this,"media-quality-change-request",n,o)}requestAutoQuality(o){this.changeQuality(-1,o)}changeTextTrackMode(o,n,a){k(this,ao,Co).call(this,"media-text-track-change-request",a,{index:o,mode:n})}changePlaybackRate(o,n){k(this,ao,Co).call(this,"media-rate-change-request",n,o)}changeAudioGain(o,n){k(this,ao,Co).call(this,"media-audio-gain-change-request",n,o)}resumeControls(o){k(this,ao,Co).call(this,"media-resume-controls-request",o)}pauseControls(o){k(this,ao,Co).call(this,"media-pause-controls-request",o)}togglePaused(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.paused?this.play(o):this.pause(o))}toggleControls(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.controls.showing?n.controls.hide(0,o):n.controls.show(0,o))}toggleMuted(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.muted?this.unmute(o):this.mute(o))}toggleFullscreen(o,n){const a=this.getPlayer(n==null?void 0:n.target);a&&(a.state.fullscreen?this.exitFullscreen(o,n):this.enterFullscreen(o,n))}togglePictureInPicture(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.pictureInPicture?this.exitPictureInPicture(o):this.enterPictureInPicture(o))}showCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;let a=n.state.textTracks,l=b(this,y2);(!a[l]||!xn(a[l]))&&(l=-1),l===-1&&(l=a.findIndex(s=>xn(s)&&s.default)),l===-1&&(l=a.findIndex(s=>xn(s))),l>=0&&this.changeTextTrackMode(l,"showing",o),N(this,y2,-1)}disableCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;const a=n.state.textTracks,l=n.state.textTrack;if(l){const s=a.indexOf(l);this.changeTextTrackMode(s,"disabled",o),N(this,y2,s)}}toggleCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(o,n){k(this,ao,Co).call(this,"media-user-loop-change-request",n,o)}}Xp=new WeakMap,Sa=new WeakMap,y2=new WeakMap,n5=new WeakMap,ao=new WeakSet,Co=function(o,n,a){var p,h;const l=new Ot(o,{bubbles:!0,composed:!0,cancelable:!0,detail:a,trigger:n});let s=(n==null?void 0:n.target)||null;s&&s instanceof dt&&(s=s.el),s=!s||s===document||s===window||s===document.body||((p=b(this,Sa))==null?void 0:p.el)&&s instanceof Node&&!b(this,Sa).el.contains(s)?b(this,Xp)??((h=this.getPlayer())==null?void 0:h.el):s??b(this,Xp),b(this,Sa)?o==="media-play-request"&&!b(this,Sa).state.canLoad?s==null||s.dispatchEvent(l):b(this,Sa).canPlayQueue.enqueue(o,()=>s==null?void 0:s.dispatchEvent(l)):s==null||s.dispatchEvent(l)},rWe=function(o){};class Wke{constructor(){V(this,"playerId","vds-player");V(this,"mediaId",null);P(this,di,{volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null});V(this,"saveTimeThrottled",vp(this.saveTime.bind(this),1e3))}async getVolume(){return b(this,di).volume}async setVolume(o){b(this,di).volume=o,this.save()}async getMuted(){return b(this,di).muted}async setMuted(o){b(this,di).muted=o,this.save()}async getTime(){return b(this,di).time}async setTime(o,n){const a=o<0;b(this,di).time=a?null:o,a||n?this.saveTime():this.saveTimeThrottled()}async getLang(){return b(this,di).lang}async setLang(o){b(this,di).lang=o,this.save()}async getCaptions(){return b(this,di).captions}async setCaptions(o){b(this,di).captions=o,this.save()}async getPlaybackRate(){return b(this,di).rate}async setPlaybackRate(o){b(this,di).rate=o,this.save()}async getAudioGain(){return b(this,di).audioGain}async setAudioGain(o){b(this,di).audioGain=o,this.save()}async getVideoQuality(){return b(this,di).quality}async setVideoQuality(o){b(this,di).quality=o,this.save()}onChange(o,n,a="vds-player"){const l=a?localStorage.getItem(a):null,s=n?localStorage.getItem(n):null;this.playerId=a,this.mediaId=n,N(this,di,{volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...l?JSON.parse(l):{},time:s?+s:null})}save(){if(!this.playerId)return;const o=JSON.stringify({...b(this,di),time:void 0});localStorage.setItem(this.playerId,o)}saveTime(){if(!this.mediaId)return;const o=(b(this,di).time??0).toString();localStorage.setItem(this.mediaId,o)}}di=new WeakMap;const Uh=Symbol(0);class G$ extends q${get selected(){return this.items.find(o=>o.selected)??null}get selectedIndex(){return this.items.findIndex(o=>o.selected)}[mt.onRemove](o,n){this[mt.select](o,!1,n)}[mt.add](o,n){o[Uh]=!1,Object.defineProperty(o,"selected",{get(){return this[Uh]},set:a=>{var l;this.readonly||((l=this[mt.onUserSelect])==null||l.call(this),this[mt.select](o,a))}}),super[mt.add](o,n)}[mt.select](o,n,a){if(n===(o==null?void 0:o[Uh]))return;const l=this.selected;o&&(o[Uh]=n),(n?l!==o:l===o)&&(l&&(l[Uh]=!1),this.dispatchEvent(new Ot("change",{detail:{prev:l,current:this.selected},trigger:a})))}}class Zke extends G${}class Yke{constructor(){P(this,Fa);V(this,"priority",0);P(this,km,!0);P(this,gs,null);P(this,xm,null);P(this,$c,new Set)}canRender(o,n){return!!n}attach(o){N(this,gs,o),o&&(o.textTracks.onchange=k(this,Fa,Ox).bind(this))}addTrack(o){b(this,$c).add(o),k(this,Fa,mU).call(this,o)}removeTrack(o){var n,a;(a=(n=o[kt.native])==null?void 0:n.remove)==null||a.call(n),o[kt.native]=null,b(this,$c).delete(o)}changeTrack(o){const n=o==null?void 0:o[kt.native];n&&n.track.mode!=="showing"&&(n.track.mode="showing"),N(this,xm,o)}setDisplay(o){N(this,km,o),k(this,Fa,Ox).call(this)}detach(){b(this,gs)&&(b(this,gs).textTracks.onchange=null);for(const o of b(this,$c))this.removeTrack(o);b(this,$c).clear(),N(this,gs,null),N(this,xm,null)}}km=new WeakMap,gs=new WeakMap,xm=new WeakMap,$c=new WeakMap,Fa=new WeakSet,mU=function(o){var a;if(!b(this,gs))return;const n=o[a=kt.native]??(o[a]=k(this,Fa,bU).call(this,o));Sp(n)&&(b(this,gs).append(n),n.track.mode=n.default?"showing":"disabled")},bU=function(o){const n=document.createElement("track"),a=o.default||o.mode==="showing",l=o.src&&o.type==="vtt";return n.id=o.id,n.src=l?o.src:"",n.label=o.label,n.kind=o.kind,n.default=a,o.language&&(n.srclang=o.language),a&&!l&&k(this,Fa,Dx).call(this,o,n.track),n},Dx=function(o,n){var a;if(!(o.src&&o.type==="vtt"||(a=n.cues)!=null&&a.length))for(const l of o.cues)n.addCue(l)},Ox=function(o){for(const n of b(this,$c)){const a=n[kt.native];if(!a)continue;if(!b(this,km)){a.track.mode=a.managed?"hidden":"disabled";continue}const l=a.track.mode==="showing";l&&k(this,Fa,Dx).call(this,n,a.track),n.setMode(l?"showing":"disabled",o)}};class Xke{constructor(o){P(this,ki);P(this,Qp,null);P(this,w2);P(this,Jp,[]);P(this,Sm);P(this,Im,!1);P(this,Ia,null);P(this,cl,null);N(this,Sm,o);const n=o.textTracks;N(this,w2,n),fe(k(this,ki,gU).bind(this)),At(k(this,ki,CU).bind(this)),new go(n).add("add",k(this,ki,wU).bind(this)).add("remove",k(this,ki,vU).bind(this)).add("mode-change",k(this,ki,j1).bind(this))}add(o){b(this,Jp).push(o),ju(k(this,ki,j1).bind(this))}remove(o){o.detach(),b(this,Jp).splice(b(this,Jp).indexOf(o),1),ju(k(this,ki,j1).bind(this))}attachVideo(o){requestAnimationFrame(()=>{if(N(this,Qp,o),o){N(this,Ia,new Yke),b(this,Ia).attach(o);for(const n of b(this,w2))k(this,ki,Rx).call(this,n)}k(this,ki,j1).call(this)})}}Qp=new WeakMap,w2=new WeakMap,Jp=new WeakMap,Sm=new WeakMap,Im=new WeakMap,Ia=new WeakMap,cl=new WeakMap,ki=new WeakSet,gU=function(){const{nativeControls:o}=b(this,Sm).$state;N(this,Im,o()),k(this,ki,j1).call(this)},Rx=function(o){var n;xn(o)&&((n=b(this,Ia))==null||n.addTrack(o))},yU=function(o){var n;xn(o)&&((n=b(this,Ia))==null||n.removeTrack(o))},wU=function(o){k(this,ki,Rx).call(this,o.detail)},vU=function(o){k(this,ki,yU).call(this,o.detail)},j1=function(){var a,l,s,d,p,h,f;const o=b(this,w2).selected;if(b(this,Qp)&&(b(this,Im)||o!=null&&o[kt.nativeHLS])){(a=b(this,cl))==null||a.changeTrack(null),(l=b(this,Ia))==null||l.setDisplay(!0),(s=b(this,Ia))==null||s.changeTrack(o);return}if((d=b(this,Ia))==null||d.setDisplay(!1),(p=b(this,Ia))==null||p.changeTrack(null),!o){(h=b(this,cl))==null||h.changeTrack(null);return}const n=b(this,Jp).sort((g,w)=>g.priority-w.priority).find(g=>g.canRender(o,b(this,Qp)));b(this,cl)!==n&&((f=b(this,cl))==null||f.detach(),n==null||n.attach(b(this,Qp)),N(this,cl,n??null)),n==null||n.changeTrack(o)},CU=function(){var o,n;(o=b(this,Ia))==null||o.detach(),N(this,Ia,null),(n=b(this,cl))==null||n.detach(),N(this,cl,null)};class Qke extends q${constructor(){super();P(this,hl);P(this,e0,!1);P(this,dl,{});P(this,pl,null);P(this,ul,null);V(this,zz);P(this,Em,Av(async()=>{var l;if(!b(this,e0))return;!b(this,ul)&&b(this,pl)&&N(this,ul,await b(this,pl).getLang());const n=await((l=b(this,pl))==null?void 0:l.getCaptions()),a=[["captions","subtitles"],"chapters","descriptions","metadata"];for(const s of a){const d=this.getByKind(s);if(d.find(w=>w.mode==="showing"))continue;const p=b(this,ul)?d.find(w=>w.language===b(this,ul)):null,h=rn(s)?b(this,dl)[s.find(w=>b(this,dl)[w])||""]:b(this,dl)[s],f=p??h,g=f&&xn(f);f&&(!g||n!==!1)&&(f.mode="showing",g&&k(this,hl,Bx).call(this,f))}},300));P(this,v2,null);P(this,Tm,k(this,hl,kU).bind(this))}get selected(){return this.items.find(a=>a.mode==="showing"&&xn(a))??null}get selectedIndex(){const n=this.selected;return n?this.indexOf(n):-1}get preferredLang(){return b(this,ul)}set preferredLang(n){N(this,ul,n),k(this,hl,Lx).call(this,n)}add(n,a){const l=n instanceof bc,s=l?n:new bc(n),d=n.kind==="captions"||n.kind==="subtitles"?"captions":n.kind;return b(this,dl)[d]&&n.default&&delete n.default,s.addEventListener("mode-change",b(this,Tm)),this[mt.add](s,a),s[kt.crossOrigin]=this[kt.crossOrigin],b(this,e0)&&s[kt.canLoad](),n.default&&(b(this,dl)[d]=s),b(this,Em).call(this),this}remove(n,a){if(N(this,v2,n),!!this.items.includes(n))return n===b(this,dl)[n.kind]&&delete b(this,dl)[n.kind],n.mode="disabled",n[kt.onModeChange]=null,n.removeEventListener("mode-change",b(this,Tm)),this[mt.remove](n,a),N(this,v2,null),this}clear(n){for(const a of[...this.items])this.remove(a,n);return this}getByKind(n){const a=Array.isArray(n)?n:[n];return this.items.filter(l=>a.includes(l.kind))}[(zz=kt.crossOrigin,kt.canLoad)](){if(!b(this,e0)){for(const n of this.items)n[kt.canLoad]();N(this,e0,!0),b(this,Em).call(this)}}setStorage(n){N(this,pl,n)}}e0=new WeakMap,dl=new WeakMap,pl=new WeakMap,ul=new WeakMap,Em=new WeakMap,v2=new WeakMap,Tm=new WeakMap,hl=new WeakSet,kU=function(n){const a=n.detail;if(b(this,pl)&&xn(a)&&a!==b(this,v2)&&k(this,hl,Bx).call(this,a),a.mode==="showing"){const l=xn(a)?["captions","subtitles"]:[a.kind];for(const s of this.items)s.mode==="showing"&&s!=a&&l.includes(s.kind)&&(s.mode="disabled")}this.dispatchEvent(new Ot("mode-change",{detail:n.detail,trigger:n}))},Bx=function(n){var a,l;n.mode!=="disabled"&&k(this,hl,Lx).call(this,n.language),(l=(a=b(this,pl))==null?void 0:a.setCaptions)==null||l.call(a,n.mode==="showing")},Lx=function(n){var a,l;(l=(a=b(this,pl))==null?void 0:a.setLang)==null||l.call(a,N(this,ul,n))};class Jke extends G${constructor(){super(...arguments);P(this,t0,!1);V(this,"switch","current");V(this,Uz)}get auto(){return b(this,t0)||this.readonly}[(Uz=ln.enableAuto,mt.onUserSelect)](){this[ln.setAuto](!1)}[mt.onReset](n){this[ln.enableAuto]=void 0,this[ln.setAuto](!1,n)}autoSelect(n){var a;this.readonly||b(this,t0)||!this[ln.enableAuto]||((a=this[ln.enableAuto])==null||a.call(this,n),this[ln.setAuto](!0,n))}getBySrc(n){return this.items.find(a=>a.src===n)}[ln.setAuto](n,a){b(this,t0)!==n&&(N(this,t0,n),this.dispatchEvent(new Ot("auto-change",{detail:n,trigger:a})))}}t0=new WeakMap;function exe(i){return i instanceof HTMLAudioElement}function txe(i){return i instanceof HTMLVideoElement}function oxe(i){return exe(i)||txe(i)}class Ip extends $a{}const ixe={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},Hh=new Set(["Shift","Alt","Meta","Ctrl"]),nxe='button, [role="button"]',W$='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';class axe extends Ip{constructor(n){super();P(this,xi);P(this,Zi);P(this,o0);P(this,ys,null);N(this,Zi,n)}onConnect(){fe(k(this,xi,xU).bind(this))}}Zi=new WeakMap,xi=new WeakSet,xU=function(){const{keyDisabled:n,keyTarget:a}=this.$props;if(n())return;const l=a()==="player"?this.el:document,s=ct(!1);l===this.el?new go(this.el).add("focusin",()=>s.set(!0)).add("focusout",d=>{this.el.contains(d.target)||s.set(!1)}):(Re(s)||s.set(document.querySelector("[data-media-player]")===this.el),po(document,"focusin",d=>{const p=d.composedPath().find(h=>h instanceof Element&&h.localName==="media-player");p!==void 0&&s.set(this.el===p)})),fe(()=>{s()&&new go(l).add("keyup",k(this,xi,SU).bind(this)).add("keydown",k(this,xi,IU).bind(this)).add("keydown",k(this,xi,EU).bind(this),{capture:!0})})},SU=function(n){var d,p;const a=document.activeElement;if(!n.key||!this.$state.canSeek()||a!=null&&a.matches(W$))return;let{method:l,value:s}=k(this,xi,N5).call(this,n);if(!et(s)&&!rn(s)){(d=s==null?void 0:s.onKeyUp)==null||d.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(p=s==null?void 0:s.callback)==null||p.call(s,n,b(this,Zi).remote);return}if(l!=null&&l.startsWith("seek")&&(n.preventDefault(),n.stopPropagation(),b(this,ys)?(k(this,xi,Px).call(this,n,l==="seekForward"),N(this,ys,null)):(b(this,Zi).remote.seek(b(this,o0),n),N(this,o0,void 0))),l!=null&&l.startsWith("volume")){const h=this.el.querySelector("[data-media-volume-slider]");h==null||h.dispatchEvent(new KeyboardEvent("keyup",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}))}},IU=function(n){var p,h,f,g;if(!n.key||Hh.has(n.key))return;const a=document.activeElement;if(a!=null&&a.matches(W$)||p$(n)&&(a!=null&&a.matches(nxe)))return;let{method:l,value:s}=k(this,xi,N5).call(this,n),d=!n.metaKey&&/^[0-9]$/.test(n.key);if(!et(s)&&!rn(s)&&!d){(p=s==null?void 0:s.onKeyDown)==null||p.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(h=s==null?void 0:s.callback)==null||h.call(s,n,b(this,Zi).remote);return}if(!l&&d&&!sxe(n)){n.preventDefault(),n.stopPropagation(),b(this,Zi).remote.seek(this.$state.duration()/10*Number(n.key),n);return}if(l){switch(n.preventDefault(),n.stopPropagation(),l){case"seekForward":case"seekBackward":k(this,xi,AU).call(this,n,l,l==="seekForward");break;case"volumeUp":case"volumeDown":const w=this.el.querySelector("[data-media-volume-slider]");if(w)w.dispatchEvent(new KeyboardEvent("keydown",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}));else{const C=n.shiftKey?.1:.05;b(this,Zi).remote.changeVolume(this.$state.volume()+(l==="volumeUp"?+C:-C),n)}break;case"toggleFullscreen":b(this,Zi).remote.toggleFullscreen("prefer-media",n);break;case"speedUp":case"slowDown":const v=this.$state.playbackRate();b(this,Zi).remote.changePlaybackRate(Math.max(.25,Math.min(2,v+(l==="speedUp"?.25:-.25))),n);break;default:(g=(f=b(this,Zi).remote)[l])==null||g.call(f,n)}this.$state.lastKeyboardAction.set({action:l,event:n})}},EU=function(n){oxe(n.target)&&k(this,xi,N5).call(this,n).method&&n.preventDefault()},N5=function(n){const a={...this.$props.keyShortcuts(),...b(this,Zi).ariaKeys},l=Object.keys(a).find(s=>{var f;const d=a[s],p=rn(d)?d.join(" "):et(d)?d:d==null?void 0:d.keys,h=(f=rn(p)?p:p==null?void 0:p.split(" "))==null?void 0:f.map(g=>lxe(g).replace(/Control/g,"Ctrl").split("+"));return h==null?void 0:h.some(g=>{const w=new Set(g.filter(v=>Hh.has(v)));for(const v of Hh){const C=v.toLowerCase()+"Key";if(!w.has(v)&&n[C])return!1}return g.every(v=>Hh.has(v)?n[v.toLowerCase()+"Key"]:n.key===v.replace("Space"," "))})});return{method:l,value:l?a[l]:null}},o0=new WeakMap,TU=function(n,a){const l=n.shiftKey?10:5;return N(this,o0,Math.max(0,Math.min((b(this,o0)??this.$state.currentTime())+(a==="seekForward"?+l:-l),this.$state.duration())))},ys=new WeakMap,Px=function(n,a){var l;(l=b(this,ys))==null||l.dispatchEvent(new KeyboardEvent(n.type,{key:a?"Right":"Left",shiftKey:n.shiftKey,trigger:n}))},AU=function(n,a,l){this.$state.canSeek()&&(b(this,ys)||N(this,ys,this.el.querySelector("[data-media-time-slider]")),b(this,ys)?k(this,xi,Px).call(this,n,l):b(this,Zi).remote.seeking(k(this,xi,TU).call(this,n,a),n))};const rxe=["!","@","#","$","%","^","&","*","(",")"];function lxe(i){return i.replace(/Shift\+(\d)/g,(o,n)=>rxe[n-1])}function sxe(i){for(const o of Hh)if(i[o.toLowerCase()+"Key"])return!0;return!1}class cxe extends Ip{constructor(){super(...arguments);P(this,ro);P(this,C2,-2);P(this,ws,!1);P(this,Am,ct(!1));P(this,k2,ct(!1));P(this,Mc,null);P(this,x2,ct(!0));V(this,"defaultDelay",2e3)}get canIdle(){return b(this,x2).call(this)}set canIdle(n){b(this,x2).set(n)}get hideOnMouseLeave(){const{hideControlsOnMouseLeave:n}=this.$props;return b(this,Am).call(this)||n()}set hideOnMouseLeave(n){b(this,Am).set(n)}get showing(){return this.$state.controlsVisible()}show(n=0,a){k(this,ro,j5).call(this),b(this,ws)||k(this,ro,$3).call(this,!0,n,a)}hide(n=this.defaultDelay,a){k(this,ro,j5).call(this),b(this,ws)||k(this,ro,$3).call(this,!1,n,a)}pause(n){N(this,ws,!0),k(this,ro,j5).call(this),k(this,ro,$3).call(this,!0,0,n)}resume(n){N(this,ws,!1),!this.$state.paused()&&k(this,ro,$3).call(this,!1,this.defaultDelay,n)}onConnect(){fe(k(this,ro,_U).bind(this))}}C2=new WeakMap,ws=new WeakMap,Am=new WeakMap,k2=new WeakMap,Mc=new WeakMap,x2=new WeakMap,ro=new WeakSet,_U=function(){const{viewType:n}=this.$state;if(!this.el||!b(this,x2).call(this))return;if(n()==="audio"){this.show();return}fe(k(this,ro,DU).bind(this)),fe(k(this,ro,OU).bind(this));const a=k(this,ro,RU).bind(this),l=k(this,ro,BU).bind(this),s=k(this,ro,LU).bind(this);new go(this.el).add("can-play",d=>this.show(0,d)).add("play",a).add("pause",l).add("end",s).add("auto-play-fail",l)},DU=function(){if(!this.el)return;const{started:n,pointer:a,paused:l}=this.$state;if(!n()||a()!=="fine")return;const s=new go(this.el),d=this.hideOnMouseLeave;(!d||!b(this,k2).call(this))&&fe(()=>{l()||s.add("pointermove",k(this,ro,$x).bind(this))}),d&&s.add("mouseenter",k(this,ro,PU).bind(this)).add("mouseleave",k(this,ro,$U).bind(this))},OU=function(){const{paused:n,started:a,autoPlayError:l}=this.$state;if(n()||l()&&!a())return;const s=k(this,ro,$x).bind(this);fe(()=>{if(!this.el)return;const d=this.$state.pointer(),p=d==="coarse",h=new go(this.el),f=[p?"touchend":"pointerup","keydown"];for(const g of f)h.add(g,s,{passive:!1})})},RU=function(n){n.triggers.hasType("ended")||(this.show(0,n),this.hide(void 0,n))},BU=function(n){this.show(0,n)},LU=function(n){const{loop:a}=this.$state;a()&&this.hide(0,n)},PU=function(n){b(this,k2).set(!1),this.show(0,n),this.hide(void 0,n)},$U=function(n){b(this,k2).set(!0),this.hide(0,n)},j5=function(){window.clearTimeout(b(this,C2)),N(this,C2,-1)},$x=function(n){var a;n.MEDIA_GESTURE||b(this,ws)||Lv(n)||(jg(n)&&(n.key==="Escape"?((a=this.el)==null||a.focus(),N(this,Mc,null)):b(this,Mc)&&(n.preventDefault(),requestAnimationFrame(()=>{var l;(l=b(this,Mc))==null||l.focus(),N(this,Mc,null)}))),this.show(0,n),this.hide(this.defaultDelay,n))},$3=function(n,a,l){if(a===0){k(this,ro,Mx).call(this,n,l);return}N(this,C2,window.setTimeout(()=>{this.scope&&k(this,ro,Mx).call(this,n&&!b(this,ws),l)},a))},Mx=function(n,a){var l;this.$state.controlsVisible()!==n&&(this.$state.controlsVisible.set(n),!n&&document.activeElement&&((l=this.el)!=null&&l.contains(document.activeElement))&&(N(this,Mc,document.activeElement),requestAnimationFrame(()=>{var s;(s=this.el)==null||s.focus({preventScroll:!0})})),this.dispatch("controls-change",{detail:n,trigger:a}))};class dxe{constructor(){V(this,"name","audio");V(this,"target")}canPlay(o){return O$(o)?!et(o.src)||o.type==="?"||I$(this.target,o.type):!1}mediaType(){return"audio"}async load(o){return new(await Promise.resolve().then(()=>oGe)).AudioProvider(this.target,o)}}class zv{constructor(){V(this,"name","video");V(this,"target")}canPlay(o){return R$(o)?!et(o.src)||o.type==="?"||E$(this.target,o.type):!1}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>cGe)).VideoProvider(this.target,o)}}const a5=class a5 extends zv{constructor(){super(...arguments);V(this,"name","hls")}canPlay(n){return a5.supported&&Uu(n)}async load(n){return new(await Promise.resolve().then(()=>bGe)).HLSProvider(this.target,n)}};V(a5,"supported",Gg());let Uv=a5;const r5=class r5 extends zv{constructor(){super(...arguments);V(this,"name","dash")}canPlay(n){return r5.supported&&Dv(n)}async load(n){return new(await Promise.resolve().then(()=>SGe)).DASHProvider(this.target,n)}};V(r5,"supported",D$());let Hv=r5;class pxe{constructor(){V(this,"name","vimeo");V(this,"target")}preconnect(){const o=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(const n of o)as(n)}canPlay(o){return et(o.src)&&o.type==="video/vimeo"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>_Ge)).VimeoProvider(this.target,o)}async loadPoster(o,n,a){const{resolveVimeoVideoId:l,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>EGe);if(!et(o.src))return null;const{videoId:d,hash:p}=l(o.src);return d?s(d,a,p).then(h=>h?h.poster:null):null}}class uxe{constructor(){V(this,"name","youtube");V(this,"target")}preconnect(){const o=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(const n of o)as(n)}canPlay(o){return et(o.src)&&o.type==="video/youtube"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>PGe)).YouTubeProvider(this.target,o)}async loadPoster(o,n,a){const{findYouTubePoster:l,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>BGe),d=et(o.src)&&s(o.src);return d?l(d,a):null}}const Kv=Symbol(0),hxe=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],fxe={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:ixe,storage:null};class Z$ extends Ip{constructor(n,a){super();P(this,_m);P(this,i0);N(this,_m,n),N(this,i0,a)}async onAttach(n){const a=this.$props[b(this,_m)]();if(a==="eager")requestAnimationFrame(b(this,i0));else if(a==="idle")FCe(b(this,i0));else if(a==="visible"){let l,s=new IntersectionObserver(d=>{this.scope&&d[0].isIntersecting&&(l==null||l(),l=void 0,b(this,i0).call(this))});s.observe(n),l=At(()=>s.disconnect())}}}_m=new WeakMap,i0=new WeakMap;class mxe{constructor(o,n){P(this,l5);P(this,Dm);P(this,br);N(this,Dm,o),N(this,br,n)}notify(o,...n){b(this,Dm).call(this,new Ot(o,{detail:n==null?void 0:n[0],trigger:n==null?void 0:n[1]}))}async ready(o,n){return ju(async()=>{var j,ee,le,he,pe,$,X;const{logger:a}=b(this,br),{autoPlay:l,canPlay:s,started:d,duration:p,seekable:h,buffered:f,remotePlaybackInfo:g,playsInline:w,savedState:v,source:C}=b(this,br).$state;if(s())return;const E={duration:(o==null?void 0:o.duration)??p(),seekable:(o==null?void 0:o.seekable)??h(),buffered:(o==null?void 0:o.buffered)??f(),provider:b(this,br).$provider()};this.notify("can-play",E,n),is();let T=b(this,br).$provider(),{storage:A,qualities:I}=b(this,br),{muted:x,volume:O,clipStartTime:D,playbackRate:R}=b(this,br).$props;await((j=A==null?void 0:A.onLoad)==null?void 0:j.call(A,C()));const q=(ee=v())==null?void 0:ee.currentTime,L=(le=v())==null?void 0:le.paused,U=await(A==null?void 0:A.getTime()),K=q??U??D(),G=L===!1||L!==!0&&!d()&&l();if(T){T.setVolume(await(A==null?void 0:A.getVolume())??O()),T.setMuted(x()||!!await(A==null?void 0:A.getMuted()));const W=await(A==null?void 0:A.getAudioGain())??1;W>1&&((pe=(he=T.audioGain)==null?void 0:he.setGain)==null||pe.call(he,W)),($=T.setPlaybackRate)==null||$.call(T,await(A==null?void 0:A.getPlaybackRate())??R()),(X=T.setPlaysInline)==null||X.call(T,w()),K>0&&T.setCurrentTime(K)}const F=await(A==null?void 0:A.getVideoQuality());if(F&&I.length){let W=null,Z=1/0;for(const ce of I){const be=Math.abs(F.width-ce.width)+Math.abs(F.height-ce.height)+(F.bitrate?Math.abs(F.bitrate-(ce.bitrate??0)):0);be<Z&&(W=ce,Z=be)}W&&(W.selected=!0)}s()&&G?await k(this,l5,MU).call(this,n):U&&U>0&&this.notify("started",void 0,n),g.set(null)})}}Dm=new WeakMap,br=new WeakMap,l5=new WeakSet,MU=async function(o){const{player:n,$state:{autoPlaying:a,muted:l}}=b(this,br);a.set(!0);const s=new Ot("auto-play-attempt",{trigger:o});try{await n.play(s)}catch{}};class bxe{constructor(){P(this,Nc,new Map)}enqueue(o,n){b(this,Nc).set(o,n)}serve(o){const n=this.peek(o);return b(this,Nc).delete(o),n}peek(o){return b(this,Nc).get(o)}delete(o){b(this,Nc).delete(o)}clear(){b(this,Nc).clear()}}Nc=new WeakMap;class Y${constructor(){P(this,Fc);P(this,jc,!1);P(this,S2,Vu());P(this,gr,new Map)}get size(){return b(this,gr).size}get isServing(){return b(this,jc)}async waitForFlush(){b(this,jc)||await b(this,S2).promise}enqueue(o,n){if(b(this,jc)){n();return}b(this,gr).delete(o),b(this,gr).set(o,n)}serve(o){var n;(n=b(this,gr).get(o))==null||n(),b(this,gr).delete(o)}start(){k(this,Fc,Nx).call(this),N(this,jc,!0),b(this,gr).size>0&&k(this,Fc,Nx).call(this)}stop(){N(this,jc,!1)}reset(){this.stop(),b(this,gr).clear(),k(this,Fc,jx).call(this)}}jc=new WeakMap,S2=new WeakMap,gr=new WeakMap,Fc=new WeakSet,Nx=function(){for(const o of b(this,gr).keys())this.serve(o);k(this,Fc,jx).call(this)},jx=function(){b(this,S2).resolve(),N(this,S2,Vu())};class gxe extends Ip{constructor(n,a,l){super();P(this,zt);P(this,vs);P(this,It);P(this,Cs);V(this,"controls");P(this,n0);P(this,ks);P(this,Vo);P(this,qc,new Y$);P(this,I2,!1);P(this,a0);N(this,vs,n),N(this,It,a),N(this,Cs,l),N(this,Vo,l.$provider),this.controls=new cxe,N(this,n0,new Hke),N(this,ks,new Xg)}onAttach(){this.listen("fullscreen-change",k(this,zt,GU).bind(this))}onConnect(n){const a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=new go(n),s=k(this,zt,FU).bind(this);for(const d of a)d.startsWith("media-")&&l.add(d,s);k(this,zt,NU).call(this),fe(k(this,zt,jU).bind(this)),fe(k(this,zt,qU).bind(this)),fe(k(this,zt,VU).bind(this)),fe(k(this,zt,zU).bind(this)),fe(k(this,zt,UU).bind(this)),fe(k(this,zt,HU).bind(this)),fe(k(this,zt,KU).bind(this))}onDestroy(){try{const n=this.createEvent("destroy"),{pictureInPicture:a,fullscreen:l}=this.$state;l()&&this.exitFullscreen("prefer-media",n),a()&&this.exitPictureInPicture(n)}catch{}b(this,qc).reset()}async play(n){const{canPlay:a,paused:l,autoPlaying:s}=this.$state;if(k(this,zt,Fx).call(this,n)||!Re(l))return;n&&b(this,It).queue.enqueue("media-play-request",n);const d=Re(s);try{const p=Re(b(this,Vo));return Gv(p,Re(a)),yxe(d),await p.play()}catch(p){const h=this.createEvent("play-fail",{detail:zh(p),trigger:n});throw h.autoPlay=d,b(this,vs).handle(h),p}}async pause(n){const{canPlay:a,paused:l}=this.$state;if(!Re(l)){n&&b(this,It).queue.enqueue("media-pause-request",n);try{const s=Re(b(this,Vo));return Gv(s,Re(a)),await s.pause()}catch(s){throw b(this,It).queue.delete("media-pause-request"),s}}}setAudioGain(n,a){const{audioGain:l,canSetAudioGain:s}=this.$state;if(l()===n)return;const d=b(this,Vo).call(this);if(!(d!=null&&d.audioGain)||!s())throw Error("[vidstack] audio gain api not available");a&&b(this,It).queue.enqueue("media-audio-gain-change-request",a),d.audioGain.setGain(n)}seekToLiveEdge(n){const{canPlay:a,live:l,liveEdge:s,canSeek:d,liveSyncPosition:p,seekableEnd:h,userBehindLiveEdge:f}=this.$state;if(f.set(!1),Re(()=>!l()||s()||!d()))return;const g=Re(b(this,Vo));Gv(g,Re(a)),n&&b(this,It).queue.enqueue("media-seek-request",n);const w=h()-2;g.setCurrentTime(Math.min(w,p()??w))}async enterFullscreen(n="prefer-media",a){const l=k(this,zt,qx).call(this,n);if(X$(n,l),!l.active)return Re(this.$state.pictureInPicture)&&(N(this,I2,!0),await this.exitPictureInPicture(a)),a&&b(this,It).queue.enqueue("media-enter-fullscreen-request",a),l.enter()}async exitFullscreen(n="prefer-media",a){const l=k(this,zt,qx).call(this,n);if(X$(n,l),!!l.active){a&&b(this,It).queue.enqueue("media-exit-fullscreen-request",a);try{const s=await l.exit();return b(this,I2)&&Re(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),s}finally{N(this,I2,!1)}}}async enterPictureInPicture(n){if(k(this,zt,Vx).call(this),!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-enter-pip-request",n),await b(this,Vo).call(this).pictureInPicture.enter()}async exitPictureInPicture(n){if(k(this,zt,Vx).call(this),!!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-exit-pip-request",n),await b(this,Vo).call(this).pictureInPicture.exit()}async"media-airplay-request"(n){try{await this.requestAirPlay(n)}catch{}}async requestAirPlay(n){var a;try{const l=(a=b(this,Vo).call(this))==null?void 0:a.airPlay;if(!(l!=null&&l.supported))throw Error("No AirPlay adapter.");return n&&b(this,It).queue.enqueue("media-airplay-request",n),await l.prompt()}catch(l){throw b(this,It).queue.delete("media-airplay-request"),l}}async"media-google-cast-request"(n){try{await this.requestGoogleCast(n)}catch{}}async requestGoogleCast(n){try{const{canGoogleCast:a}=this.$state;if(!Re(a)){const s=Error("Cast not available.");throw s.code="CAST_NOT_AVAILABLE",s}if(as("https://www.gstatic.com"),!b(this,a0)){const s=await Promise.resolve().then(()=>VGe);N(this,a0,new s.GoogleCastLoader)}await b(this,a0).prompt(b(this,Cs)),n&&b(this,It).queue.enqueue("media-google-cast-request",n);const l=Re(this.$state.remotePlaybackState)!=="disconnected";l&&this.$state.savedState.set({paused:Re(this.$state.paused),currentTime:Re(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(l?b(this,a0):null)}catch(a){throw b(this,It).queue.delete("media-google-cast-request"),a}}"media-clip-start-change-request"(n){const{clipStartTime:a}=this.$state;a.set(n.detail)}"media-clip-end-change-request"(n){const{clipEndTime:a}=this.$state;a.set(n.detail),this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-duration-change-request"(n){const{providedDuration:a,clipEndTime:l}=this.$state;a.set(n.detail),l()<=0&&this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-audio-track-change-request"(n){const{logger:a,audioTracks:l}=b(this,Cs);if(l.readonly)return;const s=n.detail,d=l[s];if(d){const p=n.type;b(this,It).queue.enqueue(p,n),d.selected=!0}}async"media-enter-fullscreen-request"(n){try{await this.enterFullscreen(n.detail,n)}catch(a){k(this,zt,zx).call(this,a,n)}}async"media-exit-fullscreen-request"(n){try{await this.exitFullscreen(n.detail,n)}catch(a){k(this,zt,zx).call(this,a,n)}}async"media-orientation-lock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ks).lock(n.detail)}catch{b(this,It).queue.delete(a)}}async"media-orientation-unlock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ks).unlock()}catch{b(this,It).queue.delete(a)}}async"media-enter-pip-request"(n){try{await this.enterPictureInPicture(n)}catch(a){k(this,zt,Ux).call(this,a,n)}}async"media-exit-pip-request"(n){try{await this.exitPictureInPicture(n)}catch(a){k(this,zt,Ux).call(this,a,n)}}"media-live-edge-request"(n){const{live:a,liveEdge:l,canSeek:s}=this.$state;if(!(!a()||l()||!s())){b(this,It).queue.enqueue("media-seek-request",n);try{this.seekToLiveEdge()}catch{b(this,It).queue.delete("media-seek-request")}}}async"media-loop-request"(n){try{b(this,It).looping=!0,b(this,It).replaying=!0,await this.play(n)}catch{b(this,It).looping=!1}}"media-user-loop-change-request"(n){this.$state.userPrefersLoop.set(n.detail)}async"media-pause-request"(n){if(!this.$state.paused())try{await this.pause(n)}catch{}}async"media-play-request"(n){if(this.$state.paused())try{await this.play(n)}catch{}}"media-rate-change-request"(n){const{playbackRate:a,canSetPlaybackRate:l}=this.$state;if(a()===n.detail||!l())return;const s=b(this,Vo).call(this);s!=null&&s.setPlaybackRate&&(b(this,It).queue.enqueue("media-rate-change-request",n),s.setPlaybackRate(n.detail))}"media-audio-gain-change-request"(n){try{this.setAudioGain(n.detail,n)}catch{}}"media-quality-change-request"(n){var p,h;const{qualities:a,storage:l,logger:s}=b(this,Cs);if(a.readonly)return;b(this,It).queue.enqueue("media-quality-change-request",n);const d=n.detail;if(d<0)a.autoSelect(n),n.isOriginTrusted&&((p=l==null?void 0:l.setVideoQuality)==null||p.call(l,null));else{const f=a[d];f&&(f.selected=!0,n.isOriginTrusted&&((h=l==null?void 0:l.setVideoQuality)==null||h.call(l,{id:f.id,width:f.width,height:f.height,bitrate:f.bitrate})))}}"media-pause-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.pause(n)}"media-resume-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.resume(n)}"media-seek-request"(n){const{canSeek:a,ended:l,live:s,seekableEnd:d,userBehindLiveEdge:p}=this.$state,h=n.detail;l()&&(b(this,It).replaying=!0);const f=n.type;b(this,It).seeking=!1,b(this,It).queue.delete(f);const g=K$(h,this.$state);!Number.isFinite(g)||!a()||(b(this,It).queue.enqueue(f,n),b(this,Vo).call(this).setCurrentTime(g),s()&&n.isOriginTrusted&&Math.abs(d()-g)>=2&&p.set(!0))}"media-seeking-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.$state.seeking.set(!0),b(this,It).seeking=!0}"media-start-loading"(n){if(this.$state.canLoad())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,vs).handle(this.createEvent("can-load"))}"media-poster-start-loading"(n){if(this.$state.canLoadPoster())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,vs).handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(n){const{index:a,mode:l}=n.detail,s=b(this,Cs).textTracks[a];if(s){const d=n.type;b(this,It).queue.enqueue(d,n),s.setMode(l,n)}}"media-mute-request"(n){if(this.$state.muted())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,Vo).call(this).setMuted(!0)}"media-unmute-request"(n){const{muted:a,volume:l}=this.$state;if(!a())return;const s=n.type;b(this,It).queue.enqueue(s,n),b(this,Cs).$provider().setMuted(!1),l()===0&&(b(this,It).queue.enqueue(s,n),b(this,Vo).call(this).setVolume(.25))}"media-volume-change-request"(n){const{muted:a,volume:l}=this.$state,s=n.detail;if(l()===s)return;const d=n.type;b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setVolume(s),s>0&&a()&&(b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setMuted(!1))}}vs=new WeakMap,It=new WeakMap,Cs=new WeakMap,n0=new WeakMap,ks=new WeakMap,Vo=new WeakMap,qc=new WeakMap,zt=new WeakSet,NU=function(){const{load:n}=this.$props,{canLoad:a}=this.$state;if(n()!=="play"||a())return;const l=this.listen("media-play-request",s=>{k(this,zt,Fx).call(this,s),l()})},jU=function(){const n=b(this,Vo).call(this),a=this.$state.canPlay();return n&&a&&b(this,qc).start(),()=>{b(this,qc).stop()}},FU=function(n){n.stopPropagation(),!n.defaultPrevented&&this[n.type]&&(Re(b(this,Vo))?this[n.type](n):b(this,qc).enqueue(n.type,()=>{Re(b(this,Vo))&&this[n.type](n)}))},Fx=function(n){const{load:a}=this.$props,{canLoad:l}=this.$state;if(a()==="play"&&!l()){const s=this.createEvent("media-start-loading",{trigger:n});return this.dispatchEvent(s),b(this,qc).enqueue("media-play-request",async()=>{try{await this.play(s)}catch{}}),!0}return!1},I2=new WeakMap,qx=function(n){const a=Re(b(this,Vo));return n==="prefer-media"&&b(this,n0).supported||n==="media"?b(this,n0):a==null?void 0:a.fullscreen},Vx=function(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")},qU=function(){this.controls.defaultDelay=this.$props.controlsDelay()},VU=function(){var l,s;const{canSetAudioGain:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.audioGain)!=null&&s.supported);n.set(a)},zU=function(){var l,s;const{canAirPlay:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.airPlay)!=null&&s.supported);n.set(a)},UU=function(){const{canGoogleCast:n,source:a}=this.$state,l=Hg&&!Ug&&B$(a());n.set(l)},HU=function(){var l,s;const{canFullscreen:n}=this.$state,a=b(this,n0).supported||!!((s=(l=b(this,Vo).call(this))==null?void 0:l.fullscreen)!=null&&s.supported);n.set(a)},KU=function(){var l,s;const{canPictureInPicture:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.pictureInPicture)!=null&&s.supported);n.set(a)},a0=new WeakMap,GU=async function(n){const a=Re(this.$props.fullscreenOrientation),l=n.detail;if(!(an(a)||a==="none"||!b(this,ks).supported))if(l){if(b(this,ks).locked)return;this.dispatch("media-orientation-lock-request",{detail:a,trigger:n})}else b(this,ks).locked&&this.dispatch("media-orientation-unlock-request",{trigger:n})},zx=function(n,a){b(this,vs).handle(this.createEvent("fullscreen-error",{detail:zh(n)}))},Ux=function(n,a){b(this,vs).handle(this.createEvent("picture-in-picture-error",{detail:zh(n)}))},lWe=function(n,a,l){};function Gv(i,o){if(!(i&&o))throw Error("[vidstack] media not ready")}function X$(i,o){if(!(o!=null&&o.supported))throw Error("[vidstack] no fullscreen support")}function yxe(i){if(!(!Uke()||!i))throw Error("[vidstack] autoplay blocked")}class wxe{constructor(){V(this,"seeking",!1);V(this,"looping",!1);V(this,"replaying",!1);V(this,"queue",new bxe)}}const vxe=new Set(["auto-play","auto-play-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]);class Cxe extends Ip{constructor(n,a){super();P(this,Oe);P(this,$n);P(this,eo);P(this,Oo,new Map);P(this,r0,!1);P(this,E2,[]);P(this,l0,[-1,-1]);P(this,s0,!1);P(this,xs);P(this,Vc,!1);P(this,T2,null);V(this,"seeking",vp(n=>{const{seeking:a,realCurrentTime:l,paused:s}=this.$state;a.set(!0),l.set(n.detail),k(this,Oe,ii).call(this,"media-seeking-request",n),s()&&(N(this,xs,n),b(this,A2).call(this)),N(this,l0,[-1,-1])},150,{leading:!0}));P(this,A2,Av(()=>{if(!b(this,xs))return;N(this,s0,!0);const{waiting:n,playing:a}=this.$state;n.set(!0),a.set(!1);const l=this.createEvent("waiting",{trigger:b(this,xs)});b(this,Oo).set("waiting",l),this.dispatch(l),N(this,xs,void 0),N(this,s0,!1)},300));N(this,$n,n),N(this,eo,a)}onAttach(n){n.setAttribute("aria-busy","true"),new go(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this))}onConnect(n){fe(k(this,Oe,iH).bind(this)),k(this,Oe,YU).call(this),k(this,Oe,XU).call(this),k(this,Oe,QU).call(this),k(this,Oe,WU).call(this),At(k(this,Oe,ZU).bind(this))}onDestroy(){const{audioTracks:n,qualities:a,textTracks:l}=b(this,eo);n[mt.reset](),a[mt.reset](),l[mt.reset](),k(this,Oe,q5).call(this)}handle(n){if(!this.scope)return;const a=n.type;ju(()=>{var l;return(l=this[n.type])==null?void 0:l.call(this,n)}),vxe.has(a)&&b(this,Oo).set(a,n),this.dispatch(n)}"provider-change"(n){var s,d;const a=b(this,eo).$provider(),l=n.detail;(a==null?void 0:a.type)!==(l==null?void 0:l.type)&&((s=a==null?void 0:a.destroy)==null||s.call(a),(d=a==null?void 0:a.scope)==null||d.dispose(),b(this,eo).$provider.set(n.detail),a&&n.detail===null&&k(this,Oe,Zx).call(this,n))}"provider-loader-change"(n){}"auto-play"(n){this.$state.autoPlayError.set(null)}"auto-play-fail"(n){this.$state.autoPlayError.set(n.detail),k(this,Oe,Rd).call(this)}"can-load"(n){this.$state.canLoad.set(!0),b(this,Oo).set("can-load",n),b(this,eo).textTracks[kt.canLoad](),k(this,Oe,ii).call(this,"media-start-loading",n)}"can-load-poster"(n){this.$state.canLoadPoster.set(!0),b(this,Oo).set("can-load-poster",n),k(this,Oe,ii).call(this,"media-poster-start-loading",n)}"media-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=this.$state.viewType();this.$state.mediaType.set(n.detail);const s=this.$state.providedViewType(),d=s==="unknown"?n.detail:s;l!==d&&setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(n.detail),this.dispatch("view-type-change",{detail:d,trigger:n}))})},0)}"stream-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const{streamType:l,inferredStreamType:s}=this.$state;s.set(n.detail),n.detail=l()}"rate-change"(n){var s;const{storage:a}=b(this,eo),{canPlay:l}=this.$state;this.$state.playbackRate.set(n.detail),k(this,Oe,ii).call(this,"media-rate-change-request",n),l()&&((s=a==null?void 0:a.setPlaybackRate)==null||s.call(a,n.detail))}"remote-playback-change"(n){const{remotePlaybackState:a,remotePlaybackType:l}=this.$state,{type:s,state:d}=n.detail,p=d==="connected";l.set(s),a.set(d);const h=s==="airplay"?"media-airplay-request":"media-google-cast-request";if(p)k(this,Oe,ii).call(this,h,n);else{const f=b(this,$n).queue.peek(h);f&&(n.request=f,n.triggers.add(f))}}"sources-change"(n){const a=this.$state.sources(),l=n.detail;this.$state.sources.set(l),k(this,Oe,nH).call(this,a,l,n)}"source-change"(n){var l,s;n.isQualityChange=((l=n.originEvent)==null?void 0:l.type)==="quality-change";const a=n.detail;k(this,Oe,Zx).call(this,n,n.isQualityChange),b(this,Oo).set(n.type,n),this.$state.source.set(a),(s=this.el)==null||s.setAttribute("aria-busy","true")}abort(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=b(this,Oo).get("can-load");l&&!n.triggers.hasType("can-load")&&n.triggers.add(l)}"load-start"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a)}error(n){this.$state.error.set(n.detail);const a=b(this,Oo).get("abort");a&&n.triggers.add(a)}"loaded-metadata"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"loaded-data"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"can-play"(n){var l;const a=b(this,Oo).get("loaded-metadata");a&&n.triggers.add(a),k(this,Oe,Yx).call(this,n.detail),(l=this.el)==null||l.setAttribute("aria-busy","false")}"can-play-through"(n){k(this,Oe,Yx).call(this,n.detail);const a=b(this,Oo).get("can-play");a&&n.triggers.add(a)}"duration-change"(n){const{live:a,intrinsicDuration:l,providedDuration:s,clipEndTime:d,ended:p}=this.$state,h=n.detail;if(!a()){const f=Number.isNaN(h)?0:h;l.set(f),p()&&k(this,Oe,Qx).call(this,n)}(s()>0||d()>0)&&n.stopImmediatePropagation()}progress(n){const{buffered:a,seekable:l}=this.$state,{buffered:s,seekable:d}=n.detail,p=xp(s),h=s.length!==a().length,f=p!==xp(a()),g=xp(d),w=d.length!==l().length,v=g!==xp(l());(h||f)&&a.set(s),(w||v)&&l.set(d)}play(n){const{paused:a,autoPlayError:l,ended:s,autoPlaying:d,playsInline:p,pointer:h,muted:f,viewType:g,live:w,userBehindLiveEdge:v}=this.$state;if(k(this,Oe,Xx).call(this),!a()){n.stopImmediatePropagation();return}n.autoPlay=d();const C=b(this,Oo).get("waiting");C&&n.triggers.add(C),k(this,Oe,ii).call(this,"media-play-request",n),b(this,Oo).set("play",n),a.set(!1),l.set(null),n.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:f()},trigger:n})),d.set(!1)),(s()||b(this,$n).replaying)&&(b(this,$n).replaying=!1,s.set(!1),this.handle(this.createEvent("replay",{trigger:n}))),!p()&&g()==="video"&&h()==="coarse"&&b(this,eo).remote.enterFullscreen("prefer-media",n),w()&&!v()&&b(this,eo).remote.seekToLiveEdge(n)}"play-fail"(n){const{muted:a,autoPlaying:l}=this.$state,s=b(this,Oo).get("play");s&&n.triggers.add(s),k(this,Oe,ii).call(this,"media-play-request",n);const{paused:d,playing:p}=this.$state;d.set(!0),p.set(!1),k(this,Oe,Rd).call(this),b(this,Oo).set("play-fail",n),n.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:a(),error:n.detail},trigger:n})),l.set(!1))}playing(n){const a=b(this,Oo).get("play"),l=b(this,Oo).get("seeked");a?n.triggers.add(a):l&&n.triggers.add(l),setTimeout(()=>k(this,Oe,Rd).call(this),0);const{paused:s,playing:d,live:p,liveSyncPosition:h,seekableEnd:f,started:g,currentTime:w,seeking:v,ended:C}=this.$state;if(s.set(!1),d.set(!0),v.set(!1),C.set(!1),b(this,$n).looping){b(this,$n).looping=!1;return}if(p()&&!g()&&w()===0){const E=h()??f()-2;Number.isFinite(E)&&b(this,eo).$provider().setCurrentTime(E)}this.started(n)}started(n){const{started:a}=this.$state;a()||(a.set(!0),this.handle(this.createEvent("started",{trigger:n})))}pause(n){var d;(d=this.el)!=null&&d.isConnected||N(this,Vc,!0),k(this,Oe,ii).call(this,"media-pause-request",n);const a=b(this,Oo).get("seeked");a&&n.triggers.add(a);const{paused:l,playing:s}=this.$state;l.set(!0),s.set(!1),b(this,r0)&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:n})),N(this,r0,!1)},0),k(this,Oe,Rd).call(this)}"time-change"(n){if(b(this,$n).looping){n.stopImmediatePropagation();return}let{waiting:a,played:l,clipEndTime:s,realCurrentTime:d,currentTime:p}=this.$state,h=n.detail,f=s();d.set(h),k(this,Oe,aH).call(this),a.set(!1);for(const g of b(this,eo).textTracks)g[kt.updateActiveCues](h,n);f>0&&h>=f&&(N(this,r0,!0),this.dispatch("media-pause-request",{trigger:n})),k(this,Oe,rH).call(this),this.dispatch("time-update",{detail:{currentTime:p(),played:l()},trigger:n})}"audio-gain-change"(n){var d;const{storage:a}=b(this,eo),{canPlay:l,audioGain:s}=this.$state;s.set(n.detail),k(this,Oe,ii).call(this,"media-audio-gain-change-request",n),l()&&((d=a==null?void 0:a.setAudioGain)==null||d.call(a,s()))}"volume-change"(n){var h,f;const{storage:a}=b(this,eo),{volume:l,muted:s,canPlay:d}=this.$state,p=n.detail;l.set(p.volume),s.set(p.muted||p.volume===0),k(this,Oe,ii).call(this,"media-volume-change-request",n),k(this,Oe,ii).call(this,p.muted?"media-mute-request":"media-unmute-request",n),d()&&((h=a==null?void 0:a.setVolume)==null||h.call(a,l()),(f=a==null?void 0:a.setMuted)==null||f.call(a,s()))}seeked(n){const{seeking:a,currentTime:l,realCurrentTime:s,paused:d,seekableEnd:p,ended:h,live:f}=this.$state;if(b(this,$n).seeking)a.set(!0),n.stopImmediatePropagation();else if(a()){const g=b(this,Oo).get("waiting");g&&n.triggers.add(g);const w=b(this,Oo).get("seeking");w&&!n.triggers.has(w)&&n.triggers.add(w),d()&&k(this,Oe,Jx).call(this),a.set(!1),s.set(n.detail),k(this,Oe,ii).call(this,"media-seek-request",n);const v=n==null?void 0:n.originEvent;v!=null&&v.isTrusted&&!(v instanceof MessageEvent)&&!/seek/.test(v.type)&&this.started(n)}f()||(Math.floor(l())!==Math.floor(p())?h.set(!1):this.end(n))}waiting(n){b(this,s0)||b(this,$n).seeking||(n.stopImmediatePropagation(),N(this,xs,n),b(this,A2).call(this))}end(n){const{loop:a,ended:l}=this.$state;if(!(!a()&&l())){if(a()){setTimeout(()=>{requestAnimationFrame(()=>{k(this,Oe,Xx).call(this,n),this.dispatch("media-loop-request",{trigger:n})})},10);return}setTimeout(()=>k(this,Oe,lH).call(this,n),0)}}"fullscreen-change"(n){const a=n.detail;this.$state.fullscreen.set(a),k(this,Oe,ii).call(this,a?"media-enter-fullscreen-request":"media-exit-fullscreen-request",n)}"fullscreen-error"(n){k(this,Oe,ii).call(this,"media-enter-fullscreen-request",n),k(this,Oe,ii).call(this,"media-exit-fullscreen-request",n)}"orientation-change"(n){const a=n.detail.lock;k(this,Oe,ii).call(this,a?"media-orientation-lock-request":"media-orientation-unlock-request",n)}"picture-in-picture-change"(n){const a=n.detail;this.$state.pictureInPicture.set(a),k(this,Oe,ii).call(this,a?"media-enter-pip-request":"media-exit-pip-request",n)}"picture-in-picture-error"(n){k(this,Oe,ii).call(this,"media-enter-pip-request",n),k(this,Oe,ii).call(this,"media-exit-pip-request",n)}"title-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredTitle.set(n.detail))}"poster-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredPoster.set(n.detail))}}$n=new WeakMap,eo=new WeakMap,Oo=new WeakMap,r0=new WeakMap,E2=new WeakMap,l0=new WeakMap,s0=new WeakMap,xs=new WeakMap,Vc=new WeakMap,Oe=new WeakSet,WU=function(){b(this,Vc)&&(requestAnimationFrame(()=>{this.scope&&b(this,eo).remote.play(new Ot("dom-connect"))}),N(this,Vc,!1))},ZU=function(){var n;b(this,Vc)||(N(this,Vc,!this.$state.paused()),(n=b(this,eo).$provider())==null||n.pause())},Rd=function(){k(this,Oe,Jx).call(this),N(this,r0,!1),b(this,$n).replaying=!1,b(this,$n).looping=!1,N(this,s0,!1),N(this,xs,void 0),b(this,Oo).clear()},ii=function(n,a){const l=b(this,$n).queue.serve(n);l&&(a.request=l,a.triggers.add(l))},YU=function(){k(this,Oe,F5).call(this),k(this,Oe,Hx).call(this);const n=b(this,eo).textTracks;new go(n).add("add",k(this,Oe,F5).bind(this)).add("remove",k(this,Oe,F5).bind(this)).add("mode-change",k(this,Oe,Hx).bind(this))},XU=function(){const n=b(this,eo).qualities;new go(n).add("add",k(this,Oe,Gx).bind(this)).add("remove",k(this,Oe,Gx).bind(this)).add("change",k(this,Oe,eH).bind(this)).add("auto-change",k(this,Oe,tH).bind(this)).add("readonly-change",k(this,Oe,oH).bind(this))},QU=function(){const n=b(this,eo).audioTracks;new go(n).add("add",k(this,Oe,Kx).bind(this)).add("remove",k(this,Oe,Kx).bind(this)).add("change",k(this,Oe,JU).bind(this))},F5=function(n){const{textTracks:a}=this.$state;a.set(b(this,eo).textTracks.toArray()),this.dispatch("text-tracks-change",{detail:a(),trigger:n})},Hx=function(n){n&&k(this,Oe,ii).call(this,"media-text-track-change-request",n);const a=b(this,eo).textTracks.selected,{textTrack:l}=this.$state;l()!==a&&(l.set(a),this.dispatch("text-track-change",{detail:a,trigger:n}))},Kx=function(n){const{audioTracks:a}=this.$state;a.set(b(this,eo).audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:a(),trigger:n})},JU=function(n){const{audioTrack:a}=this.$state;a.set(b(this,eo).audioTracks.selected),n&&k(this,Oe,ii).call(this,"media-audio-track-change-request",n),this.dispatch("audio-track-change",{detail:a(),trigger:n})},Gx=function(n){const{qualities:a}=this.$state;a.set(b(this,eo).qualities.toArray()),this.dispatch("qualities-change",{detail:a(),trigger:n})},eH=function(n){const{quality:a}=this.$state;a.set(b(this,eo).qualities.selected),n&&k(this,Oe,ii).call(this,"media-quality-change-request",n),this.dispatch("quality-change",{detail:a(),trigger:n})},tH=function(){const{qualities:n}=b(this,eo),a=n.auto;this.$state.autoQuality.set(a),a||k(this,Oe,q5).call(this)},T2=new WeakMap,Wx=function(){k(this,Oe,q5).call(this),N(this,T2,fe(()=>{const{qualities:n}=b(this,eo),{mediaWidth:a,mediaHeight:l}=this.$state,s=a(),d=l();if(s===0||d===0)return;let p=null,h=1/0;for(const f of n){const g=Math.abs(f.width-s)+Math.abs(f.height-d);g<h&&(h=g,p=f)}p&&n[mt.select](p,!0,new Ot("resize",{detail:{width:s,height:d}}))}))},q5=function(){var n;(n=b(this,T2))==null||n.call(this),N(this,T2,null)},oH=function(){this.$state.canSetQuality.set(!b(this,eo).qualities.readonly)},iH=function(){const{canSetVolume:n,isGoogleCastConnected:a}=this.$state;if(a()){n.set(!1);return}nke().then(n.set)},nH=function(n,a,l){let{qualities:s}=b(this,eo),d=!1,p=!1;for(const h of n){if(!Vv(h))continue;if(!a.some(g=>g.src===h.src)){const g=s.getBySrc(h.src);g&&(s[mt.remove](g,l),p=!0)}}p&&!s.length&&(this.$state.savedState.set(null),s[mt.reset](l));for(const h of a){if(!Vv(h)||s.getBySrc(h.src))continue;const f={id:h.id??h.height+"p",bitrate:null,codec:null,...h,selected:!1};s[mt.add](f,l),d=!0}d&&!s[ln.enableAuto]&&(k(this,Oe,Wx).call(this),s[ln.enableAuto]=k(this,Oe,Wx).bind(this),s[ln.setAuto](!0,l))},Zx=function(n,a=!1){const{audioTracks:l,qualities:s}=b(this,eo);if(!a){N(this,E2,[]),N(this,l0,[-1,-1]),l[mt.reset](n),s[mt.reset](n),H$(this.$state,a),k(this,Oe,Rd).call(this);return}H$(this.$state,a),k(this,Oe,Rd).call(this)},Yx=function(n){const{seekable:a,buffered:l,intrinsicDuration:s,canPlay:d}=this.$state;d.set(!0),l.set(n.buffered),a.set(n.seekable);const p=xp(n.seekable)??1/0;s.set(p)},Xx=function(n){if(!Re(b(this,eo).$provider))return;const{ended:l,seekableStart:s,clipEndTime:d,currentTime:p,realCurrentTime:h,duration:f}=this.$state,g=l()||h()<s()||d()>0&&h()>=d()||Math.abs(p()-f())<.1;return g&&this.dispatch("media-seek-request",{detail:s(),trigger:n}),g},aH=function(){const{currentTime:n,played:a,paused:l}=this.$state;l()||(N(this,l0,gke(b(this,E2),b(this,l0),n())),a.set(new Ti(b(this,E2))))},Qx=function(n){const{clipStartTime:a,clipEndTime:l,duration:s}=this.$state;a()>0||l()>0||this.handle(this.createEvent("time-change",{detail:s(),trigger:n}))},rH=function(){var s;const{storage:n}=b(this,eo),{canPlay:a,realCurrentTime:l}=this.$state;a()&&((s=n==null?void 0:n.setTime)==null||s.call(n,l()))},A2=new WeakMap,lH=function(n){var h;const{storage:a}=b(this,eo),{paused:l,seeking:s,ended:d,duration:p}=this.$state;k(this,Oe,Qx).call(this,n),l()||this.dispatch("pause",{trigger:n}),s()&&this.dispatch("seeked",{detail:p(),trigger:n}),d.set(!0),k(this,Oe,Rd).call(this),(h=a==null?void 0:a.setTime)==null||h.call(a,p(),!0),this.dispatch("ended",{trigger:n})},Jx=function(){b(this,A2).cancel(),this.$state.waiting.set(!1)};class kxe extends Ip{constructor(){super(...arguments);P(this,Zt)}onSetup(){k(this,Zt,sH).call(this);const n=[k(this,Zt,dH),k(this,Zt,uH),k(this,Zt,wH),k(this,Zt,vH),k(this,Zt,fH),k(this,Zt,bH),k(this,Zt,gH),k(this,Zt,CH),k(this,Zt,xH),k(this,Zt,kH),k(this,Zt,hH),k(this,Zt,yH),k(this,Zt,mH),k(this,Zt,cH),k(this,Zt,pH)];for(const a of n)fe(a.bind(this))}}Zt=new WeakSet,sH=function(){var l;const n={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},a=new Set(["currentTime","paused","playbackRate","volume"]);for(const s of Object.keys(this.$props))a.has(s)||(l=this.$state[n[s]??s])==null||l.set(this.$props[s]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)},cH=function(){const{viewType:n,streamType:a,title:l,poster:s,loop:d}=this.$props,p=this.$state;p.providedPoster.set(s()),p.providedStreamType.set(a()),p.providedViewType.set(n()),p.providedTitle.set(l()),p.providedLoop.set(d())},sWe=function(){},dH=function(){const{artist:n,artwork:a}=this.$props;this.$state.artist.set(n()),this.$state.artwork.set(a())},pH=function(){const{title:n}=this.$state;this.dispatch("title-change",{detail:n()})},uH=function(){const n=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(n),this.dispatch("auto-play-change",{detail:n})},hH=function(){const n=this.$state.loop();this.dispatch("loop-change",{detail:n})},fH=function(){const n=this.$props.controls();this.$state.controls.set(n)},mH=function(){const{poster:n}=this.$state;this.dispatch("poster-change",{detail:n()})},bH=function(){const n=this.$props.crossOrigin()??this.$props.crossorigin(),a=n===!0?"":n;this.$state.crossOrigin.set(a)},gH=function(){const{duration:n}=this.$props;this.dispatch("media-duration-change-request",{detail:n()})},yH=function(){const n=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(n),this.dispatch("plays-inline-change",{detail:n})},wH=function(){const{clipStartTime:n}=this.$props;this.dispatch("media-clip-start-change-request",{detail:n()})},vH=function(){const{clipEndTime:n}=this.$props;this.dispatch("media-clip-end-change-request",{detail:n()})},CH=function(){this.dispatch("live-change",{detail:this.$state.live()})},kH=function(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())},xH=function(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})};const Q$=["play","pause","seekforward","seekbackward","seekto"];class xxe extends Ip{constructor(){super(...arguments);P(this,fl)}onConnect(){fe(k(this,fl,IH).bind(this)),fe(k(this,fl,EH).bind(this));const n=k(this,fl,TH).bind(this);for(const a of Q$)navigator.mediaSession.setActionHandler(a,n);At(k(this,fl,SH).bind(this))}}fl=new WeakSet,SH=function(){for(const n of Q$)navigator.mediaSession.setActionHandler(n,null)},IH=function(){const{title:n,artist:a,artwork:l,poster:s}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:n(),artist:a(),artwork:l()??[{src:s()}]})},EH=function(){const{canPlay:n,paused:a}=this.$state;navigator.mediaSession.playbackState=n()?a()?"paused":"playing":"none"},TH=function(n){const a=new Ot("media-session-action",{detail:n});switch(n.action){case"play":this.dispatch("media-play-request",{trigger:a});break;case"pause":this.dispatch("media-pause-request",{trigger:a});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Li(n.seekTime)?n.seekTime:this.$state.currentTime()+(n.seekOffset??(n.action==="seekforward"?10:-10)),trigger:a});break}};const d0=class d0 extends dt{constructor(){super();P(this,Ke);P(this,pn);P(this,c0);P(this,un);V(this,"canPlayQueue",new Y$);V(this,"remoteControl");P(this,_2,!1);V(this,"orientation");new kxe;const n={player:this,qualities:new Jke,audioTracks:new Zke,storage:null,$provider:ct(null),$providerSetup:ct(!1),$props:this.$props,$state:this.$state};n.remote=this.remoteControl=new Gke(void 0),n.remote.setPlayer(this),n.textTracks=new Qke,n.textTracks[kt.crossOrigin]=this.$state.crossOrigin,n.textRenderers=new Xke(n),n.ariaKeys={},N(this,pn,n),ba(k$,n),this.orientation=new Xg,new dr,new axe(n);const a=new wxe;N(this,c0,new Cxe(a,n)),N(this,un,new gxe(b(this,c0),a,n)),n.delegate=new mxe(b(this,c0).handle.bind(b(this,c0)),n),n.notify=n.delegate.notify.bind(n.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new xxe,new Z$("load",this.startLoading.bind(this)),new Z$("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){k(this,Ke,OH).call(this),fe(k(this,Ke,DH).bind(this)),fe(k(this,Ke,LH).bind(this)),fe(k(this,Ke,BH).bind(this)),fe(k(this,Ke,$H).bind(this)),fe(k(this,Ke,PH).bind(this)),fe(k(this,Ke,NH).bind(this)),fe(k(this,Ke,MH).bind(this))}onAttach(n){n.setAttribute("data-media-player",""),bo(n,"tabindex","0"),bo(n,"role","region"),fe(k(this,Ke,FH).bind(this)),fe(k(this,Ke,AH).bind(this)),fe(k(this,Ke,_H).bind(this)),po(n,"find-media-player",k(this,Ke,RH).bind(this))}onConnect(n){x$&&We(n,"data-iphone","");const a=window.matchMedia("(pointer: coarse)");k(this,Ke,eS).call(this,a),a.onchange=k(this,Ke,eS).bind(this);const l=new ResizeObserver(zu(k(this,Ke,M3).bind(this)));l.observe(n),fe(k(this,Ke,M3).bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),At(()=>{l.disconnect(),a.onchange=null})}onDestroy(){b(this,pn).player=null,this.canPlayQueue.reset()}get provider(){return b(this,Ke,_a)}get controls(){return b(this,un).controls}set controls(n){b(this,Ke,V5).controls.set(n)}get title(){return Re(this.$state.title)}set title(n){if(b(this,_2)){N(this,_2,!1);return}b(this,Ke,V5).title.set(n)}get qualities(){return b(this,pn).qualities}get audioTracks(){return b(this,pn).audioTracks}get textTracks(){return b(this,pn).textTracks}get textRenderers(){return b(this,pn).textRenderers}get duration(){return this.$state.duration()}set duration(n){b(this,Ke,V5).duration.set(n)}get paused(){return Re(this.$state.paused)}set paused(n){k(this,Ke,tS).call(this,n)}get muted(){return Re(this.$state.muted)}set muted(n){k(this,Ke,oS).call(this,n)}get currentTime(){return Re(this.$state.currentTime)}set currentTime(n){k(this,Ke,iS).call(this,n)}get volume(){return Re(this.$state.volume)}set volume(n){k(this,Ke,nS).call(this,n)}get playbackRate(){return Re(this.$state.playbackRate)}set playbackRate(n){k(this,Ke,aS).call(this,n)}async play(n){return b(this,un).play(n)}async pause(n){return b(this,un).pause(n)}async enterFullscreen(n,a){return b(this,un).enterFullscreen(n,a)}async exitFullscreen(n,a){return b(this,un).exitFullscreen(n,a)}enterPictureInPicture(n){return b(this,un).enterPictureInPicture(n)}exitPictureInPicture(n){return b(this,un).exitPictureInPicture(n)}seekToLiveEdge(n){b(this,un).seekToLiveEdge(n)}startLoading(n){b(this,pn).notify("can-load",void 0,n)}startLoadingPoster(n){b(this,pn).notify("can-load-poster",void 0,n)}requestAirPlay(n){return b(this,un).requestAirPlay(n)}requestGoogleCast(n){return b(this,un).requestGoogleCast(n)}setAudioGain(n,a){return b(this,un).setAudioGain(n,a)}destroy(){super.destroy(),b(this,pn).remote.setPlayer(null),this.dispatch("destroy")}};pn=new WeakMap,c0=new WeakMap,un=new WeakMap,Ke=new WeakSet,_a=function(){return b(this,pn).$provider()},V5=function(){return this.$props},_2=new WeakMap,AH=function(){const n=this.$el,{title:a,live:l,viewType:s,providedTitle:d}=this.$state,p=l(),h=MCe(s()),f=h!=="Unknown"?`${p?"Live ":""}${h}`:p?"Live":"Media",g=a();We(this.el,"aria-label",`${f} Player`+(g?` - ${g}`:"")),n!=null&&n.hasAttribute("title")&&(N(this,_2,!0),n==null||n.removeAttribute("title"))},_H=function(){const n=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(n),We(this.el,"data-orientation",n),k(this,Ke,M3).call(this)},DH=function(){this.$state.canPlay()&&b(this,Ke,_a)?this.canPlayQueue.start():this.canPlayQueue.stop()},OH=function(){if(d0[Kv]){this.setAttributes(d0[Kv]);return}const n={"data-load":function(){return this.$props.load()},"data-captions":function(){const l=this.$state.textTrack();return!!l&&xn(l)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){const{canLoad:l,canPlay:s,waiting:d}=this.$state;return l()&&(!s()||d())},"data-error":function(){const{error:l}=this.$state;return!!l()},"data-autoplay-error":function(){const{autoPlayError:l}=this.$state;return!!l()}},a={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(const l of hxe){const s="data-"+(a[l]??Fg(l));n[s]=function(){return this.$state[l]()}}delete n.title,d0[Kv]=n,this.setAttributes(n)},RH=function(n){n.detail(this)},M3=function(){if(!this.el)return;const n=this.el.clientWidth,a=this.el.clientHeight;this.$state.width.set(n),this.$state.height.set(a),Zn(this.el,"--player-width",n+"px"),Zn(this.el,"--player-height",a+"px")},eS=function(n){const a=n.matches?"coarse":"fine";We(this.el,"data-pointer",a),this.$state.pointer.set(a),k(this,Ke,M3).call(this)},BH=function(){k(this,Ke,tS).call(this,this.$props.paused())},tS=function(n){n?this.canPlayQueue.enqueue("paused",()=>b(this,un).pause()):this.canPlayQueue.enqueue("paused",()=>b(this,un).play())},LH=function(){k(this,Ke,oS).call(this,this.$props.muted())},oS=function(n){this.canPlayQueue.enqueue("muted",()=>{b(this,Ke,_a)&&b(this,Ke,_a).setMuted(n)})},PH=function(){k(this,Ke,iS).call(this,this.$props.currentTime())},iS=function(n){this.canPlayQueue.enqueue("currentTime",()=>{const{currentTime:a}=this.$state;n!==Re(a)&&Re(()=>{if(!b(this,Ke,_a))return;const l=K$(n,this.$state);Number.isFinite(l)&&b(this,Ke,_a).setCurrentTime(l)})})},$H=function(){k(this,Ke,nS).call(this,this.$props.volume())},nS=function(n){const a=jv(0,n,1);this.canPlayQueue.enqueue("volume",()=>{b(this,Ke,_a)&&b(this,Ke,_a).setVolume(a)})},MH=function(){k(this,Ke,aS).call(this,this.$props.playbackRate())},aS=function(n){this.canPlayQueue.enqueue("rate",()=>{var a,l;b(this,Ke,_a)&&((l=(a=b(this,Ke,_a)).setPlaybackRate)==null||l.call(a,n))})},NH=function(){k(this,Ke,jH).call(this,this.$props.playsInline())},jH=function(n){this.canPlayQueue.enqueue("playsinline",()=>{var a,l;b(this,Ke,_a)&&((l=(a=b(this,Ke,_a)).setPlaysInline)==null||l.call(a,n))})},FH=function(){var l;let n=this.$props.storage(),a=et(n)?new Wke:n;if(a!=null&&a.onChange){const{source:s}=this.$state,d=et(n)?n:(l=this.el)==null?void 0:l.id,p=cr(k(this,Ke,qH).bind(this));fe(()=>a.onChange(s(),p(),d||void 0))}b(this,pn).storage=a,b(this,pn).textTracks.setStorage(a),At(()=>{var s;(s=a==null?void 0:a.onDestroy)==null||s.call(a),b(this,pn).storage=null,b(this,pn).textTracks.setStorage(null)})},qH=function(){const{clipStartTime:n,clipEndTime:a}=this.$props,{source:l}=this.$state,s=l();return s.src?`${s.src}:${n()}:${a()}`:null},V(d0,"props",fxe),V(d0,"state",z$);let Qg=d0;const Ao=Qg.prototype;$t(Ao,"canPlayQueue"),$t(Ao,"remoteControl"),$t(Ao,"provider"),$t(Ao,"controls"),$t(Ao,"orientation"),$t(Ao,"title"),$t(Ao,"qualities"),$t(Ao,"audioTracks"),$t(Ao,"textTracks"),$t(Ao,"textRenderers"),$t(Ao,"duration"),$t(Ao,"paused"),$t(Ao,"muted"),$t(Ao,"currentTime"),$t(Ao,"volume"),$t(Ao,"playbackRate"),ti(Ao,"play"),ti(Ao,"pause"),ti(Ao,"enterFullscreen"),ti(Ao,"exitFullscreen"),ti(Ao,"enterPictureInPicture"),ti(Ao,"exitPictureInPicture"),ti(Ao,"seekToLiveEdge"),ti(Ao,"startLoading"),ti(Ao,"startLoadingPoster"),ti(Ao,"requestAirPlay"),ti(Ao,"requestGoogleCast"),ti(Ao,"setAudioGain");function Sxe(i,o){return fetch(i,o).then(n=>n.text()).then(n=>/type="static"/.test(n)?"on-demand":"live")}function J$(i,o){return fetch(i,o).then(n=>n.text()).then(n=>{const a=Ixe(n);if(a)return J$(/^https?:/.test(a)?a:new URL(a,i).href,o);const l=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(n)?"on-demand":"live";return l==="live"&&Exe(n)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(n)||n.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":l})}function Ixe(i){const o=i.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return o?o[0].split(`
3152
+ `}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:i,option:o}){const n=this.getOptionLabel({optionLabel:i,option:o});return typeof n=="object"?o.label:n},initializeOptions(){if(!this.value)return[];const i=this.value.filter(o=>!this.options.find(n=>dc(n,o)));this.options.unshift(...i)}}},Uwe={class:"multiselect__loading-wrapper"};function Hwe(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-chip"),f=c.resolveComponent("wt-loader"),g=c.resolveComponent("vue-multiselect"),w=c.resolveComponent("wt-input-info"),v=c.resolveDirective("observe-visibility");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tags-input--disabled":i.disabled,"wt-tags-input--invalid":i.invalid,"wt-tags-input--loading":i.isLoading},"wt-tags-input"])},[i.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},i.labelProps,{disabled:i.disabled,invalid:i.invalid,class:"wt-tags-input__label"}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:i.label})),()=>[c.createTextVNode(c.toDisplayString(i.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createVNode(g,c.mergeProps(i.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:i.disabled,"internal-search":!i.searchMethod,label:i.selectOptionLabel,loading:!1,"model-value":i.selectValue,multiple:i.multiple,options:i.selectOptions,placeholder:i.placeholder||i.label,taggable:n.taggable,"track-by":n.trackBy,class:"wt-tags-input__select"},c.toHandlers(i.listeners)),c.createSlots({tag:c.withCtx(({option:C,remove:E})=>[c.createVNode(h,{class:"multiselect__custom-tag"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel}))+" ",1),c.createVNode(p,{color:"on-primary",icon:"close--filled",size:"sm",onClick:T=>E(C)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:c.withCtx(({option:C})=>[c.renderSlot(i.$slots,"option",c.normalizeProps(c.guardReactiveProps({option:C,optionLabel:i.optionLabel})),()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel})),1)],!0)]),caret:c.withCtx(({toggle:C})=>[c.createVNode(p,{disabled:i.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:c.withModifiers(C,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",Uwe,[c.createVNode(f,{size:"sm"})],512),[[c.vShow,i.isLoading]])]),_:2},[i.showIntersectionObserver?{name:"afterList",fn:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",null,null,512),[[v,i.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),i.isValidation?(c.openBlock(),c.createBlock(w,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const Kwe=Ne(zwe,[["render",Hwe],["__scopeId","data-v-5b67c1b1"]]),Gwe={class:"wt-textarea__wrapper"},Wwe=Ne(c.defineComponent({__name:"wt-textarea",props:c.mergeModels({label:{default:""},placeholder:{default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},name:{default:""},rows:{default:1},labelProps:{default:void 0},autoresize:{type:Boolean,default:!1},v:{default:void 0},customValidators:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:c.mergeModels(["enter","paste","blur","keydown"],["update:modelValue"]),setup(i,{emit:o}){const n=i,a=c.useModel(i,"modelValue"),l=c.useTemplateRef("textarea-wrapper"),s=o,d=c.ref(!1),{isValidation:p,invalid:h,validationText:f}=yh({v:n.v,customValidators:n.customValidators}),g=C=>{s("keydown",C),n.autoresize&&C.key==="Enter"&&!C.shiftKey&&(s("enter"),C.preventDefault())},w=()=>{v()},v=async()=>{var E;if(!n.autoresize)return;const C=(E=l.value)==null?void 0:E.$el;(C==null?void 0:C.scrollHeight)===(C==null?void 0:C.clientHeight)||(C==null?void 0:C.scrollHeight)===(C==null?void 0:C.clientHeight)+2?d.value=!0:d.value=!1};return c.onMounted(()=>{v()}),(C,E)=>{const T=c.resolveComponent("wt-label"),A=c.resolveComponent("p-textarea"),I=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wt-textarea",{"wt-textarea--hidden-scrollbar":d.value}])},[c.createVNode(T,c.mergeProps(C.labelProps,{disabled:C.disabled,for:C.name,required:C.required,invalid:c.unref(h)}),{default:c.withCtx(()=>[c.renderSlot(C.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:C.label})),()=>[c.createTextVNode(c.toDisplayString(C.label),1)],!0)],void 0,!0),_:3},16,["disabled","for","required","invalid"]),c.createElementVNode("div",Gwe,[c.createVNode(A,{id:C.name,ref:"textarea-wrapper",modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=x=>a.value=x),placeholder:C.placeholder||C.label,invalid:c.unref(h),disabled:C.disabled,rows:C.rows,"auto-resize":C.autoresize,readonly:C.readonly,class:"wt-textarea__textarea",onPaste:E[1]||(E[1]=x=>s("paste",x)),onKeydown:g,onInput:w,onBlur:E[2]||(E[2]=x=>s("blur"))},null,8,["id","modelValue","placeholder","invalid","disabled","rows","auto-resize","readonly"])]),c.unref(p)?(c.openBlock(),c.createBlock(I,{key:0,invalid:c.unref(h)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(f)),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-9d83a0ac"]]),Zwe={name:"WtTimeInput",mixins:[sw],props:{value:{type:Number,default:0},label:{type:String,default:""},maxValue:{type:Number},required:{type:Boolean,default:!1,description:"Native input required attribute"},disabled:{type:Boolean,default:!1,description:"Native input disabled attribute"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},hideInputInfo:{type:Boolean,default:!1}},emits:["input"],computed:{hasLabel(){return!!(this.label||this.$slots.label)},showInfo(){return this.isValidation&&!this.hideInputInfo},listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value)}}}},Ywe={class:"wt-time-input__wrapper"},Xwe=["disabled","max","value"];function Qwe(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-time-input--disabled":n.disabled,"wt-time-input--invalid":i.invalid},"wt-time-input"])},[s.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{disabled:n.disabled,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",Ywe,[c.createElementVNode("input",c.mergeProps({disabled:n.disabled,max:n.maxValue,min:0,value:n.value,class:"wt-time-input__input",type:"number"},c.toHandlers(s.listeners,!0)),null,16,Xwe)]),s.showInfo?(c.openBlock(),c.createBlock(p,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const Jwe=Ne(Zwe,[["render",Qwe],["__scopeId","data-v-ae7cf0e8"]]),Rh=60*60,sv=60,eve={name:"WtTimepicker",mixins:[sw],model:{prop:"value",event:"input"},props:{value:{type:[String,Number],default:0},dateMode:{type:Boolean,default:!1},label:{type:String,default:""},format:{type:String,default:"hh:mm:ss"},disabled:{type:Boolean,default:!1},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},noLabel:{type:Boolean,default:!1},required:{type:Boolean,default:!1,description:"Native input required attribute"}},computed:{isHour(){return this.format.includes("hh")},isMin(){return this.format.includes("mm")},isSec(){return this.format.includes("ss")},labelHours(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.hour")},labelMin(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.min")},labelSec(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.sec")},hour:{get(){return this.dateMode?new Date(+this.value).getHours():Math.floor(this.value/Rh)},set(i){const o=this.dateMode?new Date(this.value).setHours(i):this.value-this.hour*Rh+i*Rh;this.$emit("input",o)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/sv%60)},set(i){const o=this.dateMode?new Date(this.value).setMinutes(i):this.value-this.min*sv+i*sv;this.$emit("input",o)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(i){const o=this.dateMode?new Date(this.value).setSeconds(i):this.value-this.sec+ +i;this.$emit("input",o)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const i=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*Rh+this.hour*Rh;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",i)})}}},tve={class:"wt-timepicker__wrapper"};function ove(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-time-input"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-timepicker--invalid":i.invalid},"wt-timepicker"])},[n.label||!n.noLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(s.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",tve,[s.isHour?(c.openBlock(),c.createBlock(p,{key:0,disabled:n.disabled,label:s.labelHours,"max-value":n.dateMode?null:23,v:i.v,value:s.hour,"hide-input-info":"",onBlur:s.onHoursBlurEvent,onInput:o[0]||(o[0]=f=>s.hour=f)},null,8,["disabled","label","max-value","v","value","onBlur"])):c.createCommentVNode("",!0),s.isMin?(c.openBlock(),c.createBlock(p,{key:1,disabled:n.disabled,label:s.labelMin,"max-value":59,v:i.v,value:s.min,"hide-input-info":"",onInput:o[1]||(o[1]=f=>s.min=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0),s.isSec?(c.openBlock(),c.createBlock(p,{key:2,disabled:n.disabled,label:s.labelSec,"max-value":59,v:i.v,value:s.sec,"hide-input-info":"",onInput:o[2]||(o[2]=f=>s.sec=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const ive=Ne(eve,[["render",ove],["__scopeId","data-v-e9eb3b40"]]),nve=["top","right","bottom","left"],xP=["start","end"],SP=nve.reduce((i,o)=>i.concat(o,o+"-"+xP[0],o+"-"+xP[1]),[]),xg=Math.min,mp=Math.max,Sg=Math.round,Ig=Math.floor,Zr=i=>({x:i,y:i}),ave={left:"right",right:"left",bottom:"top",top:"bottom"},rve={start:"end",end:"start"};function IP(i,o,n){return mp(i,xg(o,n))}function Bh(i,o){return typeof i=="function"?i(o):i}function ts(i){return i.split("-")[0]}function os(i){return i.split("-")[1]}function EP(i){return i==="x"?"y":"x"}function TP(i){return i==="y"?"height":"width"}function Bu(i){return["top","bottom"].includes(ts(i))?"y":"x"}function AP(i){return EP(Bu(i))}function _P(i,o,n){n===void 0&&(n=!1);const a=os(i),l=AP(i),s=TP(l);let d=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[s]>o.floating[s]&&(d=Tg(d)),[d,Tg(d)]}function lve(i){const o=Tg(i);return[Eg(i),o,Eg(o)]}function Eg(i){return i.replace(/start|end/g,o=>rve[o])}function sve(i,o,n){const a=["left","right"],l=["right","left"],s=["top","bottom"],d=["bottom","top"];switch(i){case"top":case"bottom":return n?o?l:a:o?a:l;case"left":case"right":return o?s:d;default:return[]}}function cve(i,o,n,a){const l=os(i);let s=sve(ts(i),n==="start",a);return l&&(s=s.map(d=>d+"-"+l),o&&(s=s.concat(s.map(Eg)))),s}function Tg(i){return i.replace(/left|right|bottom|top/g,o=>ave[o])}function dve(i){return{top:0,right:0,bottom:0,left:0,...i}}function pve(i){return typeof i!="number"?dve(i):{top:i,right:i,bottom:i,left:i}}function Ag(i){const{x:o,y:n,width:a,height:l}=i;return{width:a,height:l,top:n,left:o,right:o+a,bottom:n+l,x:o,y:n}}function DP(i,o,n){let{reference:a,floating:l}=i;const s=Bu(o),d=AP(o),p=TP(d),h=ts(o),f=s==="y",g=a.x+a.width/2-l.width/2,w=a.y+a.height/2-l.height/2,v=a[p]/2-l[p]/2;let C;switch(h){case"top":C={x:g,y:a.y-l.height};break;case"bottom":C={x:g,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:w};break;case"left":C={x:a.x-l.width,y:w};break;default:C={x:a.x,y:a.y}}switch(os(o)){case"start":C[d]-=v*(n&&f?-1:1);break;case"end":C[d]+=v*(n&&f?-1:1);break}return C}const uve=async(i,o,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:s=[],platform:d}=n,p=s.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(o));let f=await d.getElementRects({reference:i,floating:o,strategy:l}),{x:g,y:w}=DP(f,a,h),v=a,C={},E=0;for(let T=0;T<p.length;T++){const{name:A,fn:I}=p[T],{x,y:O,data:D,reset:R}=await I({x:g,y:w,initialPlacement:a,placement:v,strategy:l,middlewareData:C,rects:f,platform:d,elements:{reference:i,floating:o}});g=x??g,w=O??w,C={...C,[A]:{...C[A],...D}},R&&E<=50&&(E++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(f=R.rects===!0?await d.getElementRects({reference:i,floating:o,strategy:l}):R.rects),{x:g,y:w}=DP(f,v,h)),T=-1)}return{x:g,y:w,placement:v,strategy:l,middlewareData:C}};async function cv(i,o){var n;o===void 0&&(o={});const{x:a,y:l,platform:s,rects:d,elements:p,strategy:h}=i,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:w="floating",altBoundary:v=!1,padding:C=0}=Bh(o,i),E=pve(C),A=p[v?w==="floating"?"reference":"floating":w],I=Ag(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(p.floating)),boundary:f,rootBoundary:g,strategy:h})),x=w==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(p.floating)),D=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},R=Ag(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:x,offsetParent:O,strategy:h}):x);return{top:(I.top-R.top+E.top)/D.y,bottom:(R.bottom-I.bottom+E.bottom)/D.y,left:(I.left-R.left+E.left)/D.x,right:(R.right-I.right+E.right)/D.x}}function hve(i,o,n){return(i?[...n.filter(l=>os(l)===i),...n.filter(l=>os(l)!==i)]:n.filter(l=>ts(l)===l)).filter(l=>i?os(l)===i||(o?Eg(l)!==l:!1):!0)}const fve=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(o){var n,a,l;const{rects:s,middlewareData:d,placement:p,platform:h,elements:f}=o,{crossAxis:g=!1,alignment:w,allowedPlacements:v=SP,autoAlignment:C=!0,...E}=Bh(i,o),T=w!==void 0||v===SP?hve(w||null,C,v):v,A=await cv(o,E),I=((n=d.autoPlacement)==null?void 0:n.index)||0,x=T[I];if(x==null)return{};const O=_P(x,s,await(h.isRTL==null?void 0:h.isRTL(f.floating)));if(p!==x)return{reset:{placement:T[0]}};const D=[A[ts(x)],A[O[0]],A[O[1]]],R=[...((a=d.autoPlacement)==null?void 0:a.overflows)||[],{placement:x,overflows:D}],q=T[I+1];if(q)return{data:{index:I+1,overflows:R},reset:{placement:q}};const L=R.map(G=>{const F=os(G.placement);return[G.placement,F&&g?G.overflows.slice(0,2).reduce((j,ee)=>j+ee,0):G.overflows[0],G.overflows]}).sort((G,F)=>G[1]-F[1]),K=((l=L.filter(G=>G[2].slice(0,os(G[0])?2:3).every(F=>F<=0))[0])==null?void 0:l[0])||L[0][0];return K!==p?{data:{index:I+1,overflows:R},reset:{placement:K}}:{}}}},mve=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(o){var n,a;const{placement:l,middlewareData:s,rects:d,initialPlacement:p,platform:h,elements:f}=o,{mainAxis:g=!0,crossAxis:w=!0,fallbackPlacements:v,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...A}=Bh(i,o);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const I=ts(l),x=Bu(p),O=ts(p)===p,D=await(h.isRTL==null?void 0:h.isRTL(f.floating)),R=v||(O||!T?[Tg(p)]:lve(p)),q=E!=="none";!v&&q&&R.push(...cve(p,T,E,D));const L=[p,...R],U=await cv(o,A),K=[];let G=((a=s.flip)==null?void 0:a.overflows)||[];if(g&&K.push(U[I]),w){const le=_P(l,d,D);K.push(U[le[0]],U[le[1]])}if(G=[...G,{placement:l,overflows:K}],!K.every(le=>le<=0)){var F,j;const le=(((F=s.flip)==null?void 0:F.index)||0)+1,he=L[le];if(he)return{data:{index:le,overflows:G},reset:{placement:he}};let pe=(j=G.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:j.placement;if(!pe)switch(C){case"bestFit":{var ee;const $=(ee=G.filter(X=>{if(q){const W=Bu(X.placement);return W===x||W==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,Z)=>W+Z,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:ee[0];$&&(pe=$);break}case"initialPlacement":pe=p;break}if(l!==pe)return{reset:{placement:pe}}}return{}}}};async function bve(i,o){const{placement:n,platform:a,elements:l}=i,s=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=ts(n),p=os(n),h=Bu(n)==="y",f=["left","top"].includes(d)?-1:1,g=s&&h?-1:1,w=Bh(o,i);let{mainAxis:v,crossAxis:C,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return p&&typeof E=="number"&&(C=p==="end"?E*-1:E),h?{x:C*g,y:v*f}:{x:v*f,y:C*g}}const gve=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(o){var n,a;const{x:l,y:s,placement:d,middlewareData:p}=o,h=await bve(o,i);return d===((n=p.offset)==null?void 0:n.placement)&&(a=p.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:d}}}}},yve=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(o){const{x:n,y:a,placement:l}=o,{mainAxis:s=!0,crossAxis:d=!1,limiter:p={fn:A=>{let{x:I,y:x}=A;return{x:I,y:x}}},...h}=Bh(i,o),f={x:n,y:a},g=await cv(o,h),w=Bu(ts(l)),v=EP(w);let C=f[v],E=f[w];if(s){const A=v==="y"?"top":"left",I=v==="y"?"bottom":"right",x=C+g[A],O=C-g[I];C=IP(x,C,O)}if(d){const A=w==="y"?"top":"left",I=w==="y"?"bottom":"right",x=E+g[A],O=E-g[I];E=IP(x,E,O)}const T=p.fn({...o,[v]:C,[w]:E});return{...T,data:{x:T.x-n,y:T.y-a,enabled:{[v]:s,[w]:d}}}}}};function _g(){return typeof window<"u"}function bp(i){return dv(i)?(i.nodeName||"").toLowerCase():"#document"}function fa(i){var o;return(i==null||(o=i.ownerDocument)==null?void 0:o.defaultView)||window}function Yr(i){var o;return(o=(dv(i)?i.ownerDocument:i.document)||window.document)==null?void 0:o.documentElement}function dv(i){return _g()?i instanceof Node||i instanceof fa(i).Node:!1}function ar(i){return _g()?i instanceof Element||i instanceof fa(i).Element:!1}function Xr(i){return _g()?i instanceof HTMLElement||i instanceof fa(i).HTMLElement:!1}function OP(i){return!_g()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof fa(i).ShadowRoot}function Lh(i){const{overflow:o,overflowX:n,overflowY:a,display:l}=rr(i);return/auto|scroll|overlay|hidden|clip/.test(o+a+n)&&!["inline","contents"].includes(l)}function wve(i){return["table","td","th"].includes(bp(i))}function Dg(i){return[":popover-open",":modal"].some(o=>{try{return i.matches(o)}catch{return!1}})}function pv(i){const o=uv(),n=ar(i)?rr(i):i;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function vve(i){let o=pc(i);for(;Xr(o)&&!Lu(o);){if(pv(o))return o;if(Dg(o))return null;o=pc(o)}return null}function uv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Lu(i){return["html","body","#document"].includes(bp(i))}function rr(i){return fa(i).getComputedStyle(i)}function Og(i){return ar(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function pc(i){if(bp(i)==="html")return i;const o=i.assignedSlot||i.parentNode||OP(i)&&i.host||Yr(i);return OP(o)?o.host:o}function RP(i){const o=pc(i);return Lu(o)?i.ownerDocument?i.ownerDocument.body:i.body:Xr(o)&&Lh(o)?o:RP(o)}function Ph(i,o,n){var a;o===void 0&&(o=[]),n===void 0&&(n=!0);const l=RP(i),s=l===((a=i.ownerDocument)==null?void 0:a.body),d=fa(l);if(s){const p=hv(d);return o.concat(d,d.visualViewport||[],Lh(l)?l:[],p&&n?Ph(p):[])}return o.concat(l,Ph(l,[],n))}function hv(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function BP(i){const o=rr(i);let n=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=Xr(i),s=l?i.offsetWidth:n,d=l?i.offsetHeight:a,p=Sg(n)!==s||Sg(a)!==d;return p&&(n=s,a=d),{width:n,height:a,$:p}}function fv(i){return ar(i)?i:i.contextElement}function Pu(i){const o=fv(i);if(!Xr(o))return Zr(1);const n=o.getBoundingClientRect(),{width:a,height:l,$:s}=BP(o);let d=(s?Sg(n.width):n.width)/a,p=(s?Sg(n.height):n.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const Cve=Zr(0);function LP(i){const o=fa(i);return!uv()||!o.visualViewport?Cve:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function kve(i,o,n){return o===void 0&&(o=!1),!n||o&&n!==fa(i)?!1:o}function gp(i,o,n,a){o===void 0&&(o=!1),n===void 0&&(n=!1);const l=i.getBoundingClientRect(),s=fv(i);let d=Zr(1);o&&(a?ar(a)&&(d=Pu(a)):d=Pu(i));const p=kve(s,n,a)?LP(s):Zr(0);let h=(l.left+p.x)/d.x,f=(l.top+p.y)/d.y,g=l.width/d.x,w=l.height/d.y;if(s){const v=fa(s),C=a&&ar(a)?fa(a):a;let E=v,T=hv(E);for(;T&&a&&C!==E;){const A=Pu(T),I=T.getBoundingClientRect(),x=rr(T),O=I.left+(T.clientLeft+parseFloat(x.paddingLeft))*A.x,D=I.top+(T.clientTop+parseFloat(x.paddingTop))*A.y;h*=A.x,f*=A.y,g*=A.x,w*=A.y,h+=O,f+=D,E=fa(T),T=hv(E)}}return Ag({width:g,height:w,x:h,y:f})}function mv(i,o){const n=Og(i).scrollLeft;return o?o.left+n:gp(Yr(i)).left+n}function PP(i,o,n){n===void 0&&(n=!1);const a=i.getBoundingClientRect(),l=a.left+o.scrollLeft-(n?0:mv(i,a)),s=a.top+o.scrollTop;return{x:l,y:s}}function xve(i){let{elements:o,rect:n,offsetParent:a,strategy:l}=i;const s=l==="fixed",d=Yr(a),p=o?Dg(o.floating):!1;if(a===d||p&&s)return n;let h={scrollLeft:0,scrollTop:0},f=Zr(1);const g=Zr(0),w=Xr(a);if((w||!w&&!s)&&((bp(a)!=="body"||Lh(d))&&(h=Og(a)),Xr(a))){const C=gp(a);f=Pu(a),g.x=C.x+a.clientLeft,g.y=C.y+a.clientTop}const v=d&&!w&&!s?PP(d,h,!0):Zr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+g.x+v.x,y:n.y*f.y-h.scrollTop*f.y+g.y+v.y}}function Sve(i){return Array.from(i.getClientRects())}function Ive(i){const o=Yr(i),n=Og(i),a=i.ownerDocument.body,l=mp(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),s=mp(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let d=-n.scrollLeft+mv(i);const p=-n.scrollTop;return rr(a).direction==="rtl"&&(d+=mp(o.clientWidth,a.clientWidth)-l),{width:l,height:s,x:d,y:p}}function Eve(i,o){const n=fa(i),a=Yr(i),l=n.visualViewport;let s=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){s=l.width,d=l.height;const f=uv();(!f||f&&o==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}return{width:s,height:d,x:p,y:h}}function Tve(i,o){const n=gp(i,!0,o==="fixed"),a=n.top+i.clientTop,l=n.left+i.clientLeft,s=Xr(i)?Pu(i):Zr(1),d=i.clientWidth*s.x,p=i.clientHeight*s.y,h=l*s.x,f=a*s.y;return{width:d,height:p,x:h,y:f}}function $P(i,o,n){let a;if(o==="viewport")a=Eve(i,n);else if(o==="document")a=Ive(Yr(i));else if(ar(o))a=Tve(o,n);else{const l=LP(i);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return Ag(a)}function MP(i,o){const n=pc(i);return n===o||!ar(n)||Lu(n)?!1:rr(n).position==="fixed"||MP(n,o)}function Ave(i,o){const n=o.get(i);if(n)return n;let a=Ph(i,[],!1).filter(p=>ar(p)&&bp(p)!=="body"),l=null;const s=rr(i).position==="fixed";let d=s?pc(i):i;for(;ar(d)&&!Lu(d);){const p=rr(d),h=pv(d);!h&&p.position==="fixed"&&(l=null),(s?!h&&!l:!h&&p.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||Lh(d)&&!h&&MP(i,d))?a=a.filter(g=>g!==d):l=p,d=pc(d)}return o.set(i,a),a}function _ve(i){let{element:o,boundary:n,rootBoundary:a,strategy:l}=i;const d=[...n==="clippingAncestors"?Dg(o)?[]:Ave(o,this._c):[].concat(n),a],p=d[0],h=d.reduce((f,g)=>{const w=$P(o,g,l);return f.top=mp(w.top,f.top),f.right=xg(w.right,f.right),f.bottom=xg(w.bottom,f.bottom),f.left=mp(w.left,f.left),f},$P(o,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Dve(i){const{width:o,height:n}=BP(i);return{width:o,height:n}}function Ove(i,o,n){const a=Xr(o),l=Yr(o),s=n==="fixed",d=gp(i,!0,s,o);let p={scrollLeft:0,scrollTop:0};const h=Zr(0);if(a||!a&&!s)if((bp(o)!=="body"||Lh(l))&&(p=Og(o)),a){const v=gp(o,!0,s,o);h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}else l&&(h.x=mv(l));const f=l&&!a&&!s?PP(l,p):Zr(0),g=d.left+p.scrollLeft-h.x-f.x,w=d.top+p.scrollTop-h.y-f.y;return{x:g,y:w,width:d.width,height:d.height}}function bv(i){return rr(i).position==="static"}function NP(i,o){if(!Xr(i)||rr(i).position==="fixed")return null;if(o)return o(i);let n=i.offsetParent;return Yr(i)===n&&(n=n.ownerDocument.body),n}function jP(i,o){const n=fa(i);if(Dg(i))return n;if(!Xr(i)){let l=pc(i);for(;l&&!Lu(l);){if(ar(l)&&!bv(l))return l;l=pc(l)}return n}let a=NP(i,o);for(;a&&wve(a)&&bv(a);)a=NP(a,o);return a&&Lu(a)&&bv(a)&&!pv(a)?n:a||vve(i)||n}const Rve=async function(i){const o=this.getOffsetParent||jP,n=this.getDimensions,a=await n(i.floating);return{reference:Ove(i.reference,await o(i.floating),i.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Bve(i){return rr(i).direction==="rtl"}const Lve={convertOffsetParentRelativeRectToViewportRelativeRect:xve,getDocumentElement:Yr,getClippingRect:_ve,getOffsetParent:jP,getElementRects:Rve,getClientRects:Sve,getDimensions:Dve,getScale:Pu,isElement:ar,isRTL:Bve};function FP(i,o){return i.x===o.x&&i.y===o.y&&i.width===o.width&&i.height===o.height}function Pve(i,o){let n=null,a;const l=Yr(i);function s(){var p;clearTimeout(a),(p=n)==null||p.disconnect(),n=null}function d(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),s();const f=i.getBoundingClientRect(),{left:g,top:w,width:v,height:C}=f;if(p||o(),!v||!C)return;const E=Ig(w),T=Ig(l.clientWidth-(g+v)),A=Ig(l.clientHeight-(w+C)),I=Ig(g),O={rootMargin:-E+"px "+-T+"px "+-A+"px "+-I+"px",threshold:mp(0,xg(1,h))||1};let D=!0;function R(q){const L=q[0].intersectionRatio;if(L!==h){if(!D)return d();L?d(!1,L):a=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!FP(f,i.getBoundingClientRect())&&d(),D=!1}try{n=new IntersectionObserver(R,{...O,root:l.ownerDocument})}catch{n=new IntersectionObserver(R,O)}n.observe(i)}return d(!0),s}function qP(i,o,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=fv(i),g=l||s?[...f?Ph(f):[],...Ph(o)]:[];g.forEach(I=>{l&&I.addEventListener("scroll",n,{passive:!0}),s&&I.addEventListener("resize",n)});const w=f&&p?Pve(f,n):null;let v=-1,C=null;d&&(C=new ResizeObserver(I=>{let[x]=I;x&&x.target===f&&C&&(C.unobserve(o),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=C)==null||O.observe(o)})),n()}),f&&!h&&C.observe(f),C.observe(o));let E,T=h?gp(i):null;h&&A();function A(){const I=gp(i);T&&!FP(T,I)&&n(),T=I,E=requestAnimationFrame(A)}return n(),()=>{var I;g.forEach(x=>{l&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),w==null||w(),(I=C)==null||I.disconnect(),C=null,h&&cancelAnimationFrame(E)}}const $ve=gve,Mve=fve,VP=yve,zP=mve,UP=(i,o,n)=>{const a=new Map,l={platform:Lve,...n},s={...l.platform,_c:a};return uve(i,o,{...l,platform:s})};function Nve(i){return i!=null&&typeof i=="object"&&"$el"in i}function HP(i){if(Nve(i)){const o=i.$el;return dv(o)&&bp(o)==="#comment"?null:o}return i}function $h(i){return typeof i=="function"?i():c.unref(i)}function KP(i){return typeof window>"u"?1:(i.ownerDocument.defaultView||window).devicePixelRatio||1}function GP(i,o){const n=KP(i);return Math.round(o*n)/n}function jve(i,o,n){n===void 0&&(n={});const a=n.whileElementsMounted,l=c.computed(()=>{var L;return(L=$h(n.open))!=null?L:!0}),s=c.computed(()=>$h(n.middleware)),d=c.computed(()=>{var L;return(L=$h(n.placement))!=null?L:"bottom"}),p=c.computed(()=>{var L;return(L=$h(n.strategy))!=null?L:"absolute"}),h=c.computed(()=>{var L;return(L=$h(n.transform))!=null?L:!0}),f=c.computed(()=>HP(i.value)),g=c.computed(()=>HP(o.value)),w=c.ref(0),v=c.ref(0),C=c.ref(p.value),E=c.ref(d.value),T=c.shallowRef({}),A=c.ref(!1),I=c.computed(()=>{const L={position:C.value,left:"0",top:"0"};if(!g.value)return L;const U=GP(g.value,w.value),K=GP(g.value,v.value);return h.value?{...L,transform:"translate("+U+"px, "+K+"px)",...KP(g.value)>=1.5&&{willChange:"transform"}}:{position:C.value,left:U+"px",top:K+"px"}});let x;function O(){if(f.value==null||g.value==null)return;const L=l.value;UP(f.value,g.value,{middleware:s.value,placement:d.value,strategy:p.value}).then(U=>{w.value=U.x,v.value=U.y,C.value=U.strategy,E.value=U.placement,T.value=U.middlewareData,A.value=L!==!1})}function D(){typeof x=="function"&&(x(),x=void 0)}function R(){if(D(),a===void 0){O();return}if(f.value!=null&&g.value!=null){x=a(f.value,g.value,O);return}}function q(){l.value||(A.value=!1)}return c.watch([s,d,p,l],O,{flush:"sync"}),c.watch([f,g],R,{flush:"sync"}),c.watch(l,q,{flush:"sync"}),c.getCurrentScope()&&c.onScopeDispose(D),{x:c.shallowReadonly(w),y:c.shallowReadonly(v),strategy:c.shallowReadonly(C),placement:c.shallowReadonly(E),middlewareData:c.shallowReadonly(T),isPositioned:c.shallowReadonly(A),floatingStyles:I,update:O}}const WP={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},ZP={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},YP=({target:i,triggers:o,show:n,hide:a})=>{const l=()=>{((p,h)=>{h.forEach(f=>{const g=WP[f];g?p.addEventListener(g,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=ZP[f];w?p.addEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)},s=()=>{((p,h)=>{h.forEach(f=>{const g=WP[f];g?p.removeEventListener(g,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=ZP[f];w?p.removeEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)};c.onMounted(()=>l()),c.onBeforeUnmount(()=>s())},Fve={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(null);return YP({target:l,triggers:n.triggers,show:()=>a("show"),hide:()=>a("hide")}),(s,d)=>(c.openBlock(),c.createElementBlock("aside",{ref_key:"floating",ref:l,class:"wt-tooltip-floating"},[c.renderSlot(s.$slots,"default")],512))}},qve=Ne({__name:"wt-tooltip",props:{visible:{type:Boolean,default:!1},placement:{type:String,default:"auto"},popperTriggers:{type:Array,default:()=>[]},triggers:{type:Array,default:()=>["hover","focus","touch"]},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},disableClickAway:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:o}){const n=i,a=o,l=c.useTemplateRef("activator"),s=c.useTemplateRef("floating"),d=c.useTemplateRef("floatingChild"),p=c.ref(n.visible),h=()=>{a("update:visible",p.value)},f=(T={})=>{n.disabled||p.value||(p.value=!0,T.usedByTooltip=!0,h(),v())},g=(T={})=>{var I;const A=(I=d.value)==null?void 0:I.contains(T.target);!p.value||T.usedByTooltip||A||(p.value=!1,h(),C())},w=(T={})=>{n.disableClickAway||g(T)},v=()=>{window.addEventListener("scroll",g,!0)},C=()=>{window.removeEventListener("scroll",g,!0)},{floatingStyles:E}=jve(l,s,{placement:n.placement==="auto"?null:n.placement,strategy:"fixed",whileElementsMounted:qP,middleware:[VP(),$ve(4),n.placement==="auto"?Mve():zP()]});return YP({target:l,triggers:n.triggers,show:f,hide:g}),c.watch(()=>n.visible,T=>{T?f():g()}),c.onMounted(()=>{n.visible&&f()}),c.onBeforeUnmount(()=>{C()}),(T,A)=>{const I=c.resolveDirective("clickaway");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tooltip--visible":p.value},"wt-tooltip"])},[c.createElementVNode("div",{ref_key:"activator",ref:l,class:"wt-tooltip__activator"},[c.renderSlot(T.$slots,"activator",c.normalizeProps(c.guardReactiveProps({visible:p.value})),void 0,!0)],512),p.value?c.withDirectives((c.openBlock(),c.createBlock(Fve,{key:0,ref_key:"floating",ref:s,class:c.normalizeClass([[i.popperClass],"wt-tooltip__floating"]),style:c.normalizeStyle(c.unref(E)),triggers:i.popperTriggers,onHide:g,onShow:f},{default:c.withCtx(()=>[c.createElementVNode("div",{ref_key:"floatingChild",ref:d},[c.renderSlot(T.$slots,"default",c.normalizeProps(c.guardReactiveProps({hide:g})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[I,w]]):c.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),Vve={class:"wt-tree-line"},zve={class:"wt-tree-line__icon-wrapper"},Uve={class:"wt-tree-line__label"},Hve=c.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},selectedParent:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},allowParent:{type:Boolean,default:!1},searchedProp:{default:"searched"},rootData:{}},emits:["openParent","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>n.itemLabel?n.data[n.itemLabel]:n.data),s=c.computed(()=>{const I=n.nestedIcons?[...n.nestedIcons]:[];return n.nestedLevel===0||I.push({icon:"tree-line",hidden:!n.nextElement}),I}),d=()=>Array.isArray(n.modelValue)?n.itemData?n.modelValue.includes(n.data[n.itemData]):!!n.modelValue.find(x=>dc(x,n.data)):!1,p=c.computed(()=>n.multiple?d():n.itemData?n.data[n.itemData]===n.modelValue:dc(n.modelValue,n.data)),h=c.computed(()=>n.multiple?p.value:p.value||n.selectedParent),f=(I,x,O)=>{const D=n.itemData?I[n.itemData]:I;if(x)O.some(R=>dc(R,D))||O.push(D);else{const R=O.findIndex(q=>dc(q,D));R!==-1&&O.splice(R,1)}if(I&&Array.isArray(I[n.childrenProp])&&I[n.childrenProp].length)for(const R of I[n.childrenProp])f(R,x,O)},g=(I,x,O)=>{const D=(R,q)=>{if(R===I){if(q){const L=n.itemData?q[n.itemData]:q,U=O.findIndex(K=>dc(K,L));U!==-1&&O.splice(U,1)}return!0}if(R&&Array.isArray(R[n.childrenProp])&&R[n.childrenProp].length){for(const L of R[n.childrenProp])if(D(L,R))return!0}return!1};D(x,null)},w=()=>{const I=p.value,x=[...n.modelValue];f(n.data,!I,x),I&&g(n.data,n.rootData,x),a("update:modelValue",x)},v=()=>{const I=n.itemData?n.data[n.itemData]:n.data;let x;if(n.itemData?x=n.modelValue.indexOf(n.data[n.itemData]):x=n.modelValue.findIndex(D=>dc(D,n.data)),x===-1){const D=[...n.modelValue];D.push(I),a("update:modelValue",D);return}const O=[...n.modelValue];O.splice(x,1),a("update:modelValue",O)},C=()=>{var I,x;if(n.multiple){(I=n.data[n.childrenProp])!=null&&I.length?w():v();return}if(n.allowParent&&!n.data[n.childrenProp])return a("update:modelValue",n.itemData?n.data[n.itemData]:n.data);if((x=n.data[n.childrenProp])!=null&&x.length){E.value=!E.value;return}a("update:modelValue",n.itemData?n.data[n.itemData]:n.data)},E=c.ref(!0),T=()=>{n.nestedLevel>0&&a("openParent")},A=()=>{E.value=!1,T()};return c.onMounted(()=>{p.value&&T(),n.data[n.searchedProp]&&T()}),c.watch(()=>n.modelValue,()=>{p.value&&T()}),(I,x)=>{const O=c.resolveComponent("wt-icon"),D=c.resolveComponent("wt-icon-btn"),R=c.resolveComponent("wt-tree-line",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",Vve,[c.createElementVNode("div",zve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.nestedIcons,(q,L)=>(c.openBlock(),c.createBlock(O,{key:L,icon:q.icon,class:c.normalizeClass({hidden:q.hidden})},null,8,["icon","class"]))),128)),I.nestedLevel>=1?(c.openBlock(),c.createBlock(O,{key:0,icon:I.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):c.createCommentVNode("",!0),I.data[I.childrenProp]&&I.data[I.childrenProp].length?(c.openBlock(),c.createBlock(D,{key:1,icon:E.value?"plus":"minus",onClick:x[0]||(x[0]=q=>E.value=!E.value)},null,8,["icon"])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:c.normalizeClass([{active:h.value,searched:n.data[n.searchedProp]},"wt-tree-line__label-wrapper"]),onClick:C},[c.createElementVNode("p",Uve,c.toDisplayString(l.value),1),h.value?(c.openBlock(),c.createBlock(O,{key:0,icon:"chat-message-status-sent"})):c.createCommentVNode("",!0)],2)]),c.withDirectives(c.createVNode(G8,null,{default:c.withCtx(()=>[c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.data[I.childrenProp],(q,L)=>(c.openBlock(),c.createBlock(R,{key:L,"model-value":I.modelValue,data:q,"children-prop":I.childrenProp,"item-label":I.itemLabel,"item-data":I.itemData,"nested-level":I.nestedLevel+1,"selected-parent":p.value||I.selectedParent,"next-element":!!I.data[I.childrenProp][L+1],"nested-icons":s.value,"last-child":L===I.data[I.childrenProp].length-1,multiple:I.multiple,"allow-parent":I.allowParent,"root-data":I.rootData||I.data,onOpenParent:A,"onUpdate:modelValue":x[1]||(x[1]=U=>a("update:modelValue",U))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","selected-parent","next-element","nested-icons","last-child","multiple","allow-parent","root-data"]))),128))])],void 0,!0),_:1},512),[[c.vShow,!E.value]])],64)}}}),gv={Tree:"tree",List:"list"},Kve={class:"wt-tree"},Gve={key:0,class:"wt-tree__content"},Wve={key:1,class:"wt-tree__list-content"},Zve=["onClick"],Yve=c.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:gv.Tree},childrenProp:{default:"children"},multiple:{type:Boolean},allowParent:{type:Boolean,default:!1}},emits:["select","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>{const p=[],h=f=>{p.push(f),f[n.childrenProp]&&f[n.childrenProp].forEach(g=>{h(g)})};return n.data.forEach(f=>{h(f)}),p}),s=p=>{a("update:modelValue",n.itemData?p[n.itemData]:p)},d=p=>n.itemData?p[n.itemData]===n.modelValue:dc(n.modelValue,p);return(p,h)=>{const f=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Kve,[p.mode===c.unref(gv).Tree?(c.openBlock(),c.createElementBlock("div",Gve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.data,(g,w)=>(c.openBlock(),c.createBlock(Hve,{key:w,"model-value":p.modelValue,"item-label":p.itemLabel,"item-data":p.itemData,data:g,"children-prop":p.childrenProp,multiple:p.multiple,"allow-parent":p.allowParent,"onUpdate:modelValue":h[0]||(h[0]=v=>a("update:modelValue",v))},null,8,["model-value","item-label","item-data","data","children-prop","multiple","allow-parent"]))),128))])):c.createCommentVNode("",!0),p.mode===c.unref(gv).List?(c.openBlock(),c.createElementBlock("div",Wve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.value,(g,w)=>(c.openBlock(),c.createElementBlock("span",{key:w,class:c.normalizeClass(["wt-tree__label-wrapper",{active:d(g)}])},[c.createElementVNode("p",{class:"wt-tree__label",onClick:v=>s(g)},c.toDisplayString(p.itemLabel?g[p.itemLabel]:g),9,Zve),d(g)?(c.openBlock(),c.createBlock(f,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):c.createCommentVNode("",!0)],2))),128))])):c.createCommentVNode("",!0)])}}}),Xve={class:"wt-tree-table-td__content"},Qve={key:0,class:"wt-tree-table-td__icon-wrapper"},Jve={key:0,class:"wt-tree-table-td__actions"},eCe={class:"wt-tree-table-td__content"},tCe=Ne(c.defineComponent({__name:"wt-tree-table-row",props:{data:{},rowPosition:{},childrenProp:{},selectable:{type:Boolean,default:!1},selectedElements:{},dataHeaders:{},gridActions:{type:Boolean,default:!0},nestingLevel:{default:0},searchedProp:{default:"searched"}},emits:["update:selected","expanded-collapse"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(!0),s=c.computed(()=>n.nestingLevel),d=c.computed(()=>n.nestingLevel+1),p=c.computed(()=>n.selectedElements.includes(n.data)),h=()=>{l.value=!1,a("expanded-collapse")},f=(g,w=0)=>{if(g[n.searchedProp]&&w)return!0;if(Array.isArray(g[n.childrenProp])){for(const v of g[n.childrenProp])if(f(v,w+1))return!0}return!1};return c.onMounted(()=>{n.searchedProp&&f(n.data)&&h()}),(g,w)=>{const v=c.resolveComponent("wt-tree-table-row",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("tr",{class:c.normalizeClass([[{"wt-tree-table-row--alternate":g.rowPosition%2}],"wt-tree-table-row"])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g.dataHeaders,(C,E)=>(c.openBlock(),c.createElementBlock("td",{key:E,class:"wt-tree-table-td"},[c.createElementVNode("div",Xve,[E?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",Qve,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,T=>(c.openBlock(),c.createElementBlock("div",{key:T,class:"wt-tree-table-row__tree-space"}))),128)),g.selectable?(c.openBlock(),c.createBlock(d8,{key:0,selected:p.value,"onUpdate:selected":w[0]||(w[0]=T=>g.$emit("update:selected",{data:g.data,select:T}))},null,8,["selected"])):c.createCommentVNode("",!0),g.data[g.childrenProp]?(c.openBlock(),c.createBlock(up,{key:1,icon:l.value?"tree-expand":"tree-collapse",onClick:w[1]||(w[1]=T=>l.value=!l.value)},null,8,["icon"])):c.createCommentVNode("",!0)])),c.renderSlot(g.$slots,C.value,{index:g.rowPosition,item:g.data},()=>[c.createTextVNode(c.toDisplayString(g.data[C.value]),1)],!0)])]))),128)),g.gridActions?(c.openBlock(),c.createElementBlock("td",Jve,[c.createElementVNode("div",eCe,[c.renderSlot(g.$slots,"actions",{index:g.rowPosition,item:g.data},void 0,!0)])])):c.createCommentVNode("",!0)],2),l.value?c.createCommentVNode("",!0):(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(g.data[g.childrenProp],(C,E)=>(c.openBlock(),c.createBlock(v,{key:E,"children-prop":g.childrenProp,data:C,"data-headers":g.dataHeaders,"nesting-level":d.value,"row-position":g.rowPosition,"searched-prop":g.searchedProp,selectable:g.selectable,"selected-elements":g.selectedElements,onExpandedCollapse:h,"onUpdate:selected":w[2]||(w[2]=T=>g.$emit("update:selected",{data:T.data,select:T.select}))},c.createSlots({actions:c.withCtx(({item:T})=>[c.renderSlot(g.$slots,"actions",{index:g.rowPosition,item:T},void 0,!0)]),_:2},[c.renderList(g.dataHeaders,(T,A)=>({name:T.value,fn:c.withCtx(({item:I})=>[c.renderSlot(g.$slots,T.value,{index:g.rowPosition,item:I},()=>[c.createElementVNode("div",null,c.toDisplayString(I[T.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-638adedd"]]),oCe={class:"wt-tree-table"},iCe={class:"wt-tree-table-wrapper"},nCe={class:"wt-tree-table-head"},aCe={class:"wt-tree-table-tr wt-tree-table-tr-head"},rCe=["onClick"],lCe={class:"wt-tree-table-th__content"},sCe={class:"wt-tree-table-th__text"},cCe={key:0,class:"wt-tree-table-th__actions"},dCe={class:"wt-tree-table-th__content"},pCe={class:"wt-tree-table-body"},uCe=Ne(c.defineComponent({__name:"wt-tree-table",props:{headers:{},data:{},sortable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},selected:{},gridActions:{type:Boolean,default:!0},childrenProp:{},searchedProp:{default:"searched"}},emits:["sort","update:selected"],setup(i,{emit:o}){const n=i,a=o,l=T=>T[n.childrenProp]&&Array.isArray(T[n.childrenProp]),s=T=>{const A=[],I=x=>{if(x._isSelected)return[x];l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},d=T=>{const A=[],I=x=>{A.push(x),l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},p=c.computed(()=>n.selected||s(n.data)),h=c.computed(()=>p.value.length===d(n.data).length&&d(n.data).length>0),{tableHeaders:f}=r9e({headers:c.toRef(n,"headers")}),g=({sort:T})=>n.sortable&&T!==void 0,w=T=>{if(!g(T))return;const A=lL(T.sort);a("sort",T,A)},v=(T,A)=>{T.forEach(I=>{I._isSelected=A,l(I)&&v(I[n.childrenProp],A)})},C=()=>{n.selected?a("update:selected",h.value?[]:[...d(n.data)]):h.value?v(n.data,!1):v(n.data,!0)},E=(T,A)=>{n.selected?A?a("update:selected",[...p.value,T]):a("update:selected",p.value.filter(I=>I!==T)):T._isSelected=!T._isSelected};return(T,A)=>{const I=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",oCe,[c.createElementVNode("table",iCe,[c.createElementVNode("thead",nCe,[c.createElementVNode("tr",aCe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,O)=>(c.openBlock(),c.createElementBlock("th",{key:String(O)+(x==null?void 0:x.sort),class:c.normalizeClass([[{"wt-tree-table-th--sortable":g(x)},`wt-tree-table-th--sort-${x.sort}`],"wt-tree-table-th"]),style:c.normalizeStyle(x.width?`min-width:${x.width}`:""),onClick:D=>w(x)},[c.createElementVNode("div",lCe,[O===0&&T.selectable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:A[0]||(A[0]=c.withModifiers(()=>{},["stop"]))},[c.createVNode(d8,{selected:h.value,"onUpdate:selected":C},null,8,["selected"])])):c.createCommentVNode("",!0),c.createElementVNode("div",sCe,c.toDisplayString(x.text),1),T.sortable?(c.openBlock(),c.createBlock(I,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):c.createCommentVNode("",!0),T.sortable?(c.openBlock(),c.createBlock(I,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):c.createCommentVNode("",!0)])],14,rCe))),128)),T.gridActions?(c.openBlock(),c.createElementBlock("th",cCe,[c.createElementVNode("div",dCe,[c.renderSlot(T.$slots,"actions-header",{},void 0,!0)])])):c.createCommentVNode("",!0)])]),c.createElementVNode("tbody",pCe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(T.data,(x,O)=>(c.openBlock(),c.createBlock(tCe,{key:O,"row-position":O,"data-headers":c.unref(f),data:x,selectable:T.selectable,"children-prop":T.childrenProp,"selected-elements":p.value,"searched-prop":T.searchedProp,"onUpdate:selected":A[1]||(A[1]=D=>E(D.data,D.select))},c.createSlots({actions:c.withCtx(({item:D})=>[c.renderSlot(T.$slots,"actions",{item:D},void 0,!0)]),_:2},[c.renderList(c.unref(f),(D,R)=>({name:D.value,fn:c.withCtx(({item:q})=>[c.renderSlot(T.$slots,D.value,{index:O,item:q},()=>[c.createTextVNode(c.toDisplayString(q[D.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-8c02ec24"]]),Qr=Symbol(0);let Rg=!1,yv=!1,lr=null,$u=null,Pa=null,ma=0,Mu=[],wv={};const hCe=()=>{},Nu=0,XP=1,Bg=2,Lg=3;function fCe(){Rg=!0,queueMicrotask(QP)}function QP(){if(!Mu.length){Rg=!1;return}yv=!0;for(let i=0;i<Mu.length;i++)Mu[i].$st!==Nu&&mCe(Mu[i]);Mu=[],Rg=!1,yv=!1}function mCe(i){let o=[i];for(;i=i[Qr];)i.$e&&i.$st!==Nu&&o.push(i);for(let n=o.length-1;n>=0;n--)Iv(o[n])}function bCe(i){const o=uc();return Mh(o,i.length?i.bind(null,Fu.bind(o)):i,null)}function Re(i){return Mh(lr,i,null)}function ju(i){return Mh(null,i,null)}function is(){yv||QP()}function Pg(){return lr}function kn(i,o){try{return Mh(o,i,null)}catch(n){vv(o,n);return}}function JP(i,o=lr){return o==null?void 0:o.$cx[i]}function gCe(i,o,n=lr){n&&(n.$cx={...n.$cx,[i]:o})}function At(i){if(!i||!lr)return i||hCe;const o=lr;return o.$d?Array.isArray(o.$d)?o.$d.push(i):o.$d=[o.$d,i]:o.$d=i,function(){o.$st!==Lg&&(i.call(null),$g(o.$d)?o.$d=null:Array.isArray(o.$d)&&o.$d.splice(o.$d.indexOf(i),1))}}function Fu(i=!0){if(this.$st!==Lg){if(this.$h)if(Array.isArray(this.$h))for(let o=this.$h.length-1;o>=0;o--)Fu.call(this.$h[o]);else Fu.call(this.$h);if(i){const o=this[Qr];o&&(Array.isArray(o.$h)?o.$h.splice(o.$h.indexOf(this),1):o.$h=null),yCe(this)}}}function yCe(i){i.$st=Lg,i.$d&&e$(i),i.$s&&Ev(i,0),i[Qr]=null,i.$s=null,i.$o=null,i.$h=null,i.$cx=wv,i.$eh=null}function e$(i){try{if(Array.isArray(i.$d))for(let o=i.$d.length-1;o>=0;o--){const n=i.$d[o];n.call(n)}else i.$d.call(i.$d);i.$d=null}catch(o){vv(i,o)}}function Mh(i,o,n){const a=lr,l=$u;lr=i,$u=n;try{return o.call(i)}finally{lr=a,$u=l}}function vv(i,o){if(!i||!i.$eh)throw o;let n=0,a=i.$eh.length,l=o;for(n=0;n<a;n++)try{i.$eh[n](l);break}catch(s){l=s}if(n===a)throw l}function Cv(){return this.$st===Lg?this.$v:($u&&!this.$e&&(!Pa&&$u.$s&&$u.$s[ma]==this?ma++:Pa?Pa.push(this):Pa=[this]),this.$c&&Iv(this),this.$v)}function t$(i){const o=$g(i)?i(this.$v):i;if(this.$ch(this.$v,o)&&(this.$v=o,this.$o))for(let n=0;n<this.$o.length;n++)a$(this.$o[n],Bg);return this.$v}const kv=function(){this[Qr]=null,this.$h=null,lr&&lr.append(this)},yp=kv.prototype;yp.$cx=wv,yp.$eh=null,yp.$c=null,yp.$d=null,yp.append=function(i){i[Qr]=this,this.$h?Array.isArray(this.$h)?this.$h.push(i):this.$h=[this.$h,i]:this.$h=i,i.$cx=i.$cx===wv?this.$cx:{...this.$cx,...i.$cx},this.$eh&&(i.$eh=i.$eh?[...i.$eh,...this.$eh]:this.$eh)},yp.dispose=function(){Fu.call(this)};function uc(){return new kv}const o$=function(o,n,a){kv.call(this),this.$st=n?Bg:Nu,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=o,n&&(this.$c=n),a&&a.dirty&&(this.$ch=a.dirty)},xv=o$.prototype;Object.setPrototypeOf(xv,yp),xv.$ch=wCe,xv.call=Cv;function Sv(i,o,n){return new o$(i,o,n)}function wCe(i,o){return i!==o}function $g(i){return typeof i=="function"}function Iv(i){if(i.$st===XP)for(let o=0;o<i.$s.length&&(Iv(i.$s[o]),i.$st!==Bg);o++);i.$st===Bg?i$(i):i.$st=Nu}function vCe(i){i.$h&&Fu.call(i,!1),i.$d&&e$(i),i.$eh=i[Qr]?i[Qr].$eh:null}function i$(i){let o=Pa,n=ma;Pa=null,ma=0;try{vCe(i);const a=Mh(i,i.$c,i);n$(i),!i.$e&&i.$i?t$.call(i,a):(i.$v=a,i.$i=!0)}catch(a){n$(i),vv(i,a)}finally{Pa=o,ma=n,i.$st=Nu}}function n$(i){if(Pa){if(i.$s&&Ev(i,ma),i.$s&&ma>0){i.$s.length=ma+Pa.length;for(let n=0;n<Pa.length;n++)i.$s[ma+n]=Pa[n]}else i.$s=Pa;let o;for(let n=ma;n<i.$s.length;n++)o=i.$s[n],o.$o?o.$o.push(i):o.$o=[i]}else i.$s&&ma<i.$s.length&&(Ev(i,ma),i.$s.length=ma)}function a$(i,o){if(!(i.$st>=o)&&(i.$e&&i.$st===Nu&&(Mu.push(i),Rg||fCe()),i.$st=o,i.$o))for(let n=0;n<i.$o.length;n++)a$(i.$o[n],XP)}function Ev(i,o){let n,a;for(let l=o;l<i.$s.length;l++)n=i.$s[l],n.$o&&(a=n.$o.indexOf(i),n.$o[a]=n.$o[n.$o.length-1],n.$o.pop())}function Mg(...i){}function Jr(i){return i===null}function an(i){return typeof i>"u"}function CCe(i){return Jr(i)||an(i)}function r$(i){return(i==null?void 0:i.constructor)===Object}function Li(i){return typeof i=="number"&&!Number.isNaN(i)}function et(i){return typeof i=="string"}function l$(i){return typeof i=="boolean"}function sr(i){return typeof i=="function"}function rn(i){return Array.isArray(i)}const kCe=Event,s$=Symbol("DOM_EVENT");class Ot extends(Pz=kCe,Lz=s$,Pz){constructor(n,...a){var s,d;super(n,a[0]);V(this,Lz,!0);V(this,"detail");V(this,"triggers",new xCe);this.detail=(s=a[0])==null?void 0:s.detail;const l=(d=a[0])==null?void 0:d.trigger;l&&this.triggers.add(l)}get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){var n;return((n=this.triggers.origin)==null?void 0:n.isTrusted)??!1}}class xCe{constructor(){V(this,"chain",[])}get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(o){this.chain.push(o),SCe(o)&&this.chain.push(...o.triggers)}remove(o){return this.chain.splice(this.chain.indexOf(o),1)[0]}has(o){return this.chain.some(n=>n===o)}hasType(o){return!!this.findType(o)}findType(o){return this.chain.find(n=>n.type===o)}walk(o){for(const n of this.chain){const a=o(n);if(a)return[n,a]}}[Symbol.iterator](){return this.chain.values()}}function SCe(i){return!!(i!=null&&i[s$])}class c$ extends EventTarget{constructor(){super(...arguments);V(this,"$ts__events")}addEventListener(n,a,l){return super.addEventListener(n,a,l)}removeEventListener(n,a,l){return super.removeEventListener(n,a,l)}}function po(i,o,n,a){return i.addEventListener(o,n,a),At(()=>i.removeEventListener(o,n,a))}class go{constructor(o){P(this,p2);P(this,u2);N(this,p2,o),N(this,u2,new AbortController),At(this.abort.bind(this))}get signal(){return b(this,u2).signal}add(o,n,a){if(this.signal.aborted)throw Error("aborted");return b(this,p2).addEventListener(o,n,{...a,signal:a!=null&&a.signal?ICe(this.signal,a.signal):this.signal}),this}remove(o,n){return b(this,p2).removeEventListener(o,n),this}abort(o){b(this,u2).abort(o)}}p2=new WeakMap,u2=new WeakMap;function ICe(...i){const o=new AbortController,n={signal:o.signal};function a(l){o.abort(l.target.reason)}for(const l of i){if(l.aborted){o.abort(l.reason);break}l.addEventListener("abort",a,n)}return o.signal}function d$(i){return!!(i!=null&&i.type.startsWith("pointer"))}function Ng(i){return!!(i!=null&&i.type.startsWith("touch"))}function ECe(i){return/^(click|mouse)/.test((i==null?void 0:i.type)??"")}function jg(i){return!!(i!=null&&i.type.startsWith("key"))}function TCe(i){return jg(i)&&i.key==="Enter"}function p$(i){return jg(i)&&(i.key==="Enter"||i.key===" ")}function ACe(i){return i instanceof Node}function We(i,o,n){if(i)if(!n&&n!==""&&n!==0)i.removeAttribute(o);else{const a=n===!0?"":n+"";i.getAttribute(o)!==a&&i.setAttribute(o,a)}else return}function Zn(i,o,n){if(i)!n&&n!==0?i.style.removeProperty(o):i.style.setProperty(o,n+"");else return}function ct(i,o){const n=Sv(i,null,o),a=Cv.bind(n);return a[Qr]=!0,a.set=t$.bind(n),a}function _Ce(i){return $g(i)&&Qr in i}function cr(i,o){const n=Sv(o==null?void 0:o.initial,i,o),a=Cv.bind(n);return a[Qr]=!0,a}function DCe(i,o){const n=Sv(null,function(){let l=i();return $g(l)&&At(l),null},void 0);return n.$e=!0,i$(n),Fu.bind(n,!0)}function OCe(i){return _Ce(i)&&"set"in i}const fe=DCe;function hc(i){return{id:Symbol(),provide:i}}function ba(i,o,n=Pg()){var l;const a=!an(o);gCe(i.id,a?o:(l=i.provide)==null?void 0:l.call(i),n)}function qo(i){return JP(i.id)}function ga(i){return!an(JP(i.id))}const Nh=Symbol(0),jh=Symbol(0),u$=Symbol(0),Tv={};$z=u$;class RCe{constructor(o,n,a){P(this,ll);V(this,"$ts__events");V(this,"$ts__vars");V(this,$z,null);V(this,"$el",ct(null));V(this,"el",null);V(this,"scope",null);V(this,"attachScope",null);V(this,"connectScope",null);V(this,"component",null);V(this,"destroyed",!1);V(this,"props",Tv);V(this,"attrs",null);V(this,"styles",null);V(this,"state");V(this,"$state");P(this,h2,[]);P(this,f2,[]);P(this,Gp,[]);P(this,m2,[]);var d;this.scope=n,a!=null&&a.scope&&a.scope.append(n);let l=o.state,s=o.props;if(l&&(this.$state=l.create(),this.state=new Proxy(this.$state,{get:(p,h)=>this.$state[h]()}),ba(l,this.$state)),s&&(this.props=BCe(s),a!=null&&a.props))for(const p of Object.keys(a.props))(d=this.props[p])==null||d.set(a.props[p]);At(this.destroy.bind(this))}setup(){kn(()=>{for(const o of b(this,h2))o()},this.scope)}attach(o){this.el||(this.el=o,this.$el.set(o),kn(()=>{this.attachScope=uc(),kn(()=>{for(const n of b(this,f2))n(this.el);k(this,ll,oU).call(this),k(this,ll,iU).call(this)},this.attachScope)},this.scope),o.dispatchEvent(new Event("attached")))}detach(){var o;(o=this.attachScope)==null||o.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!b(this,Gp).length||kn(()=>{this.connectScope=uc(),kn(()=>{for(const o of b(this,Gp))o(this.el)},this.connectScope)},this.attachScope)}disconnect(){var o;(o=this.connectScope)==null||o.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,kn(()=>{for(const n of b(this,m2))n(this.el)},this.scope);const o=this.el;this.detach(),this.scope.dispose(),b(this,h2).length=0,b(this,f2).length=0,b(this,Gp).length=0,b(this,m2).length=0,this.component=null,this.attrs=null,this.styles=null,this.props=Tv,this.scope=null,this.state=Tv,this.$state=null,o&&delete o.$}addHooks(o){o.onSetup&&b(this,h2).push(o.onSetup.bind(o)),o.onAttach&&b(this,f2).push(o.onAttach.bind(o)),o.onConnect&&b(this,Gp).push(o.onConnect.bind(o)),o.onDestroy&&b(this,m2).push(o.onDestroy.bind(o))}}h2=new WeakMap,f2=new WeakMap,Gp=new WeakMap,m2=new WeakMap,ll=new WeakSet,oU=function(){if(this.attrs)for(const o of Object.keys(this.attrs))sr(this.attrs[o])?fe(k(this,ll,nU).bind(this,o)):We(this.el,o,this.attrs[o])},iU=function(){if(this.styles)for(const o of Object.keys(this.styles))sr(this.styles[o])?fe(k(this,ll,aU).bind(this,o)):Zn(this.el,o,this.styles[o])},nU=function(o){We(this.el,o,this.attrs[o].call(this.component))},aU=function(o){Zn(this.el,o,this.styles[o].call(this.component))};function BCe(i){const o={};for(const n of Object.keys(i)){const a=i[n];o[n]=ct(a,a)}return o}let Fh={$$:null};function LCe(i,o){return bCe(()=>{Fh.$$=new RCe(i,Pg(),o);const n=new i;return Fh.$$.component=n,Fh.$$=null,n})}class $a extends EventTarget{constructor(){super();V(this,"$$");Fh.$$&&this.attach(Fh)}get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}attach({$$:n}){return this.$$=n,n.addHooks(this),this}addEventListener(n,a,l){this.listen(n,a,l)}removeEventListener(n,a,l){var s;(s=this.el)==null||s.removeEventListener(n,a,l)}setAttributes(n){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,n)}setStyles(n){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,n)}setCSSVars(n){this.setStyles(n)}createEvent(n,...a){return new Ot(n,a[0])}dispatch(n,...a){if(!this.el)return!1;const l=n instanceof Event?n:new Ot(n,a[0]);return Object.defineProperty(l,"target",{get:()=>this.$$.component}),ju(()=>{var s,d;return(d=(s=this.$$)[u$])==null||d.call(s,l),this.el.dispatchEvent(l)})}dispatchEvent(n){return this.dispatch(n)}listen(n,a,l){return this.el?po(this.el,n,a,l):Mg}}class dt extends $a{subscribe(o){return kn(()=>fe(()=>o(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}}function $t(i,o,n){i[Nh]||(i[Nh]=new Set),i[Nh].add(o)}function ti(i,o,n){i[jh]||(i[jh]=new Set),i[jh].add(o)}class fc{constructor(o){V(this,"id",Symbol(0));V(this,"record");P(this,b2);this.record=o,N(this,b2,Object.getOwnPropertyDescriptors(o))}create(){const o={},n=new Proxy(o,{get:(a,l)=>o[l]()});for(const a of Object.keys(this.record)){const l=b(this,b2)[a].get;o[a]=l?cr(l.bind(n)):ct(this.record[a])}return o}reset(o,n){for(const a of Object.keys(o))!b(this,b2)[a].get&&(!n||n(a))&&o[a].set(this.record[a])}}b2=new WeakMap;function qu(i){return qo(i)}function PCe(i,o){for(const n of i)n(o)}function Fg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $Ce(i){return i.replace(/-./g,o=>o[1].toUpperCase())}function MCe(i){return i.charAt(0).toUpperCase()+i.slice(1)}function qg(i){return i?"true":"false"}function h$(i){return Object.keys(i)}function Vu(){let i,o;return{promise:new Promise((a,l)=>{i=a,o=l}),resolve:i,reject:o}}function NCe(i){return new Promise(o=>setTimeout(o,i))}function zu(i){let o=-1,n;function a(...l){n=l,!(o>=0)&&(o=window.requestAnimationFrame(()=>{i.apply(this,n),o=-1,n=void 0}))}return a}const jCe=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:i=>window.setTimeout(i,1):Mg;function FCe(i,o){return new Promise(n=>{jCe(a=>{i==null||i(a),n()},o)})}var ya={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},f$=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],m$=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],b$=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Yn=typeof window<"u"&&typeof window.document<"u"?window.document:{},Ma="fullscreenEnabled"in Yn&&Object.keys(ya)||f$[0]in Yn&&f$||m$[0]in Yn&&m$||b$[0]in Yn&&b$||[],wp={requestFullscreen:function(i){return i[Ma[ya.requestFullscreen]]()},requestFullscreenFunction:function(i){return i[Ma[ya.requestFullscreen]]},get exitFullscreen(){return Yn[Ma[ya.exitFullscreen]].bind(Yn)},get fullscreenPseudoClass(){return":"+Ma[ya.fullscreen]},addEventListener:function(i,o,n){return Yn.addEventListener(Ma[ya[i]],o,n)},removeEventListener:function(i,o,n){return Yn.removeEventListener(Ma[ya[i]],o,n)},get fullscreenEnabled(){return!!Yn[Ma[ya.fullscreenEnabled]]},set fullscreenEnabled(i){},get fullscreenElement(){return Yn[Ma[ya.fullscreenElement]]},set fullscreenElement(i){},get onfullscreenchange(){return Yn[("on"+Ma[ya.fullscreenchange]).toLowerCase()]},set onfullscreenchange(i){return Yn[("on"+Ma[ya.fullscreenchange]).toLowerCase()]=i},get onfullscreenerror(){return Yn[("on"+Ma[ya.fullscreenerror]).toLowerCase()]},set onfullscreenerror(i){return Yn[("on"+Ma[ya.fullscreenerror]).toLowerCase()]=i}},vp=qCe;function qCe(i,o,n){var a=null,l=null,s=n&&n.leading,d=n&&n.trailing;s==null&&(s=!0),d==null&&(d=!s),s==!0&&(d=!1);var p=function(){a&&(clearTimeout(a),a=null)},h=function(){var g=l;p(),g&&g()},f=function(){var g=s&&!a,w=this,v=arguments;if(l=function(){return i.apply(w,v)},a||(a=setTimeout(function(){if(a=null,d)return l()},o)),g)return g=!1,l()};return f.cancel=p,f.flush=h,f}var Av=VCe;function VCe(i,o,n){var a=null,l=null,s=function(){a&&(clearTimeout(a),l=null,a=null)},d=function(){var h=l;s(),h&&h()},p=function(){if(!o)return i.apply(this,arguments);var h=this,f=arguments,g=n&&!a;if(s(),l=function(){i.apply(h,f)},a=setTimeout(function(){if(a=null,!g){var w=l;return l=null,w()}},o),g)return l()};return p.cancel=s,p.flush=d,p}const g$=i=>typeof i=="object"&&i!=null&&i.nodeType===1,y$=(i,o)=>(!o||i!=="hidden")&&i!=="visible"&&i!=="clip",Vg=(i,o)=>{if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){const n=getComputedStyle(i,null);return y$(n.overflowY,o)||y$(n.overflowX,o)||(a=>{const l=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!l&&(l.clientHeight<a.scrollHeight||l.clientWidth<a.scrollWidth)})(i)}return!1},zg=(i,o,n,a,l,s,d,p)=>s<i&&d>o||s>i&&d<o?0:s<=i&&p<=n||d>=o&&p>=n?s-i-a:d>o&&p<n||s<i&&p>n?d-o+l:0,zCe=i=>{const o=i.parentElement;return o??(i.getRootNode().host||null)},UCe=(i,o)=>{var n,a,l,s;if(typeof document>"u")return[];const{scrollMode:d,block:p,inline:h,boundary:f,skipOverflowHiddenElements:g}=o,w=typeof f=="function"?f:pe=>pe!==f;if(!g$(i))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,C=[];let E=i;for(;g$(E)&&w(E);){if(E=zCe(E),E===v){C.push(E);break}E!=null&&E===document.body&&Vg(E)&&!Vg(document.documentElement)||E!=null&&Vg(E,g)&&C.push(E)}const T=(a=(n=window.visualViewport)==null?void 0:n.width)!=null?a:innerWidth,A=(s=(l=window.visualViewport)==null?void 0:l.height)!=null?s:innerHeight,{scrollX:I,scrollY:x}=window,{height:O,width:D,top:R,right:q,bottom:L,left:U}=i.getBoundingClientRect(),{top:K,right:G,bottom:F,left:j}=(pe=>{const $=window.getComputedStyle(pe);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(i);let ee=p==="start"||p==="nearest"?R-K:p==="end"?L+F:R+O/2-K+F,le=h==="center"?U+D/2-j+G:h==="end"?q+G:U-j;const he=[];for(let pe=0;pe<C.length;pe++){const $=C[pe],{height:X,width:W,top:Z,right:ce,bottom:be,left:ue}=$.getBoundingClientRect();if(d==="if-needed"&&R>=0&&U>=0&&L<=A&&q<=T&&($===v&&!Vg($)||R>=Z&&L<=be&&U>=ue&&q<=ce))return he;const M=getComputedStyle($),te=parseInt(M.borderLeftWidth,10),Ce=parseInt(M.borderTopWidth,10),xe=parseInt(M.borderRightWidth,10),Ae=parseInt(M.borderBottomWidth,10);let Le=0,re=0;const de="offsetWidth"in $?$.offsetWidth-$.clientWidth-te-xe:0,ge="offsetHeight"in $?$.offsetHeight-$.clientHeight-Ce-Ae:0,Se="offsetWidth"in $?$.offsetWidth===0?0:W/$.offsetWidth:0,Pe="offsetHeight"in $?$.offsetHeight===0?0:X/$.offsetHeight:0;if(v===$)Le=p==="start"?ee:p==="end"?ee-A:p==="nearest"?zg(x,x+A,A,Ce,Ae,x+ee,x+ee+O,O):ee-A/2,re=h==="start"?le:h==="center"?le-T/2:h==="end"?le-T:zg(I,I+T,T,te,xe,I+le,I+le+D,D),Le=Math.max(0,Le+x),re=Math.max(0,re+I);else{Le=p==="start"?ee-Z-Ce:p==="end"?ee-be+Ae+ge:p==="nearest"?zg(Z,be,X,Ce,Ae+ge,ee,ee+O,O):ee-(Z+X/2)+ge/2,re=h==="start"?le-ue-te:h==="center"?le-(ue+W/2)+de/2:h==="end"?le-ce+xe+de:zg(ue,ce,W,te,xe+de,le,le+D,D);const{scrollLeft:Ve,scrollTop:_e}=$;Le=Pe===0?0:Math.max(0,Math.min(_e+Le/Pe,$.scrollHeight-X/Pe+ge)),re=Se===0?0:Math.max(0,Math.min(Ve+re/Se,$.scrollWidth-W/Se+de)),ee+=_e-Le,le+=Ve-re}he.push({el:$,top:Le,left:re})}return he},_v=i=>i===null?"":i+"",HCe=i=>i===null?null:i+"",KCe=i=>i===null?0:Number(i),w$=i=>i!==null,GCe=()=>null,WCe=i=>i===null?[]:JSON.parse(i),ZCe=i=>i===null?{}:JSON.parse(i);function YCe(i){if(i===null)return HCe;switch(typeof i){case"undefined":return _v;case"string":return _v;case"boolean":return w$;case"number":return KCe;case"function":return GCe;case"object":return rn(i)?WCe:ZCe;default:return _v}}const mc=Symbol(0),v$=Symbol(0),Cp=Symbol(0),kp=Symbol(0);var ns;(function(i){i[i.Idle=0]="Idle";const n=1;i[i.Pending=n]="Pending";const a=2;i[i.Ready=a]="Ready"})(ns||(ns={}));function pt(i,o){var a,l,s;class n extends i{constructor(...h){super(...h);V(this,"$");V(this,l,ns.Idle);V(this,a,null);V(this,"keepAlive",!1);V(this,"forwardKeepAlive",!0);if(this.$=kn(()=>LCe(o),null),this.$.$$.addHooks(this),o.props){const f=this.$props,g=Object.getOwnPropertyDescriptors(this);for(const w of Object.keys(g))w in o.props&&(f[w].set(this[w]),delete this[w])}}static get observedAttributes(){var h;if(!this[mc]&&o.props){const f=new Map;for(const g of Object.keys(o.props)){let w=(h=this.attrs)==null?void 0:h[g],v=et(w)?w:w&&(w==null?void 0:w.attr);v!==!1&&(v||(v=Fg(g)),f.set(v,{prop:g,converter:w&&!et(w)&&(w==null?void 0:w.converter)||YCe(o.props[g])}))}this[mc]=f}return this[mc]?Array.from(this[mc].keys()):[]}get scope(){return this.$.$$.scope}get attachScope(){return this.$.$$.attachScope}get connectScope(){return this.$.$$.connectScope}get $props(){return this.$.$$.props}get $state(){return this.$.$$.$state}get state(){return this.$.state}attributeChangedCallback(h,f,g){var C;const w=this.constructor;if(!w[mc]){(C=super.attributeChangedCallback)==null||C.call(this,h,f,g);return}const v=w[mc].get(h);v&&(this[v.prop]=v.converter(g))}connectedCallback(){var g;const h=(g=this.$)==null?void 0:g.$$;if(!h||h.destroyed)return;if(this[Cp]!==ns.Ready){QCe.call(this);return}if(!this.isConnected)return;this.hasAttribute("keep-alive")&&(this.keepAlive=!0),h.connect(),rn(this[kp])&&PCe(this[kp],this),this[kp]=null;const f=super.connectedCallback;f&&kn(()=>f.call(this),this.connectScope)}disconnectedCallback(){var g;const h=(g=this.$)==null?void 0:g.$$;if(!h||h.destroyed)return;h.disconnect();const f=super.disconnectedCallback;f&&f.call(this),!this.keepAlive&&!this.hasAttribute("keep-alive")&&setTimeout(()=>{requestAnimationFrame(()=>{this.isConnected||h.destroy()})},0)}[(s=mc,l=Cp,a=kp,v$)](){const h=this.$.$$,f=this.constructor;if(h.destroyed)return;const g=f[mc];if(g)for(const w of this.attributes){let v=g.get(w.name);v&&v.converter&&h.props[v.prop].set(v.converter(this.getAttribute(w.name)))}h.setup(),h.attach(this),this[Cp]=ns.Ready,this.connectedCallback()}subscribe(h){return this.$.subscribe(h)}destroy(){this.disconnectedCallback(),this.$.destroy()}}return V(n,"attrs"),V(n,s,null),XCe(n,o),n}function XCe(i,o){const n=i.prototype,a=o.prototype;if(o.props)for(const l of Object.keys(o.props))Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$props[l]()},set(s){this.$props[l].set(s)}});if(a[Nh])for(const l of a[Nh])Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$[l]},set(s){this.$[l]=s}});if(a[jh])for(const l of a[jh])n[l]=function(...s){return this.$[l](...s)}}function QCe(){if(this[Cp]!==ns.Idle)return;this[Cp]=ns.Pending;const i=eke(this),o=i&&window.customElements.get(i.localName),n=i&&i[Cp]===ns.Ready;if(i&&(!o||!n)){JCe.call(this,i);return}C$.call(this,i)}async function JCe(i){await window.customElements.whenDefined(i.localName),i[Cp]!==ns.Ready&&await new Promise(o=>(i[kp]??(i[kp]=[])).push(o)),C$.call(this,i)}function C$(i){if(this.isConnected){if(i){i.keepAlive&&i.forwardKeepAlive&&(this.keepAlive=!0,this.setAttribute("keep-alive",""));const o=this.$.$$.scope;o&&i.$.$$.attachScope.append(o)}this[v$]()}}function eke(i){let o=i.parentNode,n=i.localName.split("-",1)[0]+"-";for(;o;){if(o.nodeType===1&&o.localName.startsWith(n))return o;o=o.parentNode}return null}function lt(i,o=!1){(o||!window.customElements.get(i.tagName))&&window.customElements.define(i.tagName,i)}var tke='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';const k$=hc();function Rt(){return qo(k$)}const oke=(navigator==null?void 0:navigator.userAgent.toLowerCase())||"",Ug=/iphone|ipad|ipod|ios|crios|fxios/i.test(oke),x$=/(iphone|ipod)/gi.test((navigator==null?void 0:navigator.platform)||""),Hg=!!window.chrome,Kg=!!window.safari||Ug;function S$(){return ike()&&sr(screen.orientation.unlock)}function ike(){return!an(window.screen.orientation)&&!an(window.screen.orientation.lock)}function I$(i,o){return i||(i=document.createElement("audio")),i.canPlayType(o).length>0}function E$(i,o){return i||(i=document.createElement("video")),i.canPlayType(o).length>0}function T$(i){return i||(i=document.createElement("video")),i.canPlayType("application/vnd.apple.mpegurl").length>0}function A$(i){return!!document.pictureInPictureEnabled&&!(i!=null&&i.disablePictureInPicture)}function _$(i){return sr(i==null?void 0:i.webkitSupportsPresentationMode)&&sr(i==null?void 0:i.webkitSetPresentationMode)}async function nke(){const i=document.createElement("video");return i.volume=.5,await NCe(0),i.volume===.5}function ake(){return(window==null?void 0:window.ManagedMediaSource)??(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function rke(){return(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function Gg(){const i=ake();if(an(i))return!1;const o=i&&sr(i.isTypeSupported)&&i.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=rke(),a=an(n)||!an(n.prototype)&&sr(n.prototype.appendBuffer)&&sr(n.prototype.remove);return!!o&&!!a}function D$(){return Gg()}const lke=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,ske=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),cke=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,dke=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),pke=/\.(m3u8)($|\?)/i,uke=/\.(mpd)($|\?)/i,hke=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),fke=new Set(["application/dash+xml"]);function O$({src:i,type:o}){return et(i)?lke.test(i)||ske.has(o)||i.startsWith("blob:")&&o==="audio/object":o==="audio/object"}function R$(i){return et(i.src)?cke.test(i.src)||dke.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||Uu(i)&&T$():i.type==="video/object"}function Uu({src:i,type:o}){return et(i)&&pke.test(i)||hke.has(o)}function Dv({src:i,type:o}){return et(i)&&uke.test(i)||fke.has(o)}function B$(i){return et(i.src)&&(O$(i)||R$(i)||Uu(i))}function mke(i){return typeof window.MediaStream<"u"&&i instanceof window.MediaStream}class Ti{constructor(o,n){P(this,hs);rn(o)?N(this,hs,o):!an(o)&&!an(n)?N(this,hs,[[o,n]]):N(this,hs,[])}get length(){return b(this,hs).length}start(o){return b(this,hs)[o][0]??1/0}end(o){return b(this,hs)[o][1]??1/0}}hs=new WeakMap;function L$(i){if(!i.length)return null;let o=i.start(0);for(let n=1;n<i.length;n++){const a=i.start(n);a<o&&(o=a)}return o}function xp(i){if(!i.length)return null;let o=i.end(0);for(let n=1;n<i.length;n++){const a=i.end(n);a>o&&(o=a)}return o}function bke(i){if(i.length<=1)return i;i.sort((a,l)=>a[0]-l[0]);let o=[],n=i[0];for(let a=1;a<i.length;a++){const l=i[a];n[1]>=l[0]-1?n=[n[0],Math.max(n[1],l[1])]:(o.push(n),n=l)}return o.push(n),o}function gke(i,o,n){let a=o[0],l=o[1];return n<a?[n,-1]:n===a?o:a===-1?(o[0]=n,o):(n>a&&(o[1]=n,l===-1&&i.push(o)),bke(i),o)}function yke(i,o){const n=new URL(i);for(const a of Object.keys(o))n.searchParams.set(a,o[a]+"");return n.toString()}function as(i,o="preconnect"){const n=document.querySelector(`link[href="${i}"]`);if(!Jr(n))return!0;const a=document.createElement("link");return a.rel=o,a.href=i,a.crossOrigin="true",document.head.append(a),!0}const qh={};function Ov(i){if(qh[i])return qh[i].promise;const o=Vu(),n=document.querySelector(`script[src="${i}"]`);if(!Jr(n))return o.resolve(),o.promise;qh[i]=o;const a=document.createElement("script");return a.src=i,a.onload=()=>{o.resolve(),delete qh[i]},a.onerror=()=>{o.reject(),delete qh[i]},setTimeout(()=>document.head.append(a),0),o.promise}function Vh(i){return i==="use-credentials"?"include":et(i)?"same-origin":void 0}function Rv(i,o){return o>=i.startTime&&o<i.endTime}function Wg(i,o,n){let a=null,l=Pg();function s(){const d=et(o)?[o]:o,p=i.toArray().find(h=>d.includes(h.kind)&&h.mode==="showing");if(p!==a){if(!p){n(null),a=null;return}p.readyState==2?n(p):(n(null),kn(()=>{const h=po(p,"load",()=>{n(p),h()},{once:!0})},l)),a=p}}return s(),po(i,"mode-change",s)}function wke(i,o,n){Wg(i,o,a=>{if(!a){n("");return}const l=()=>{const s=a==null?void 0:a.activeCues[0];n((s==null?void 0:s.text)||"")};l(),po(a,"cue-change",l)})}const vke=Symbol(0),Cke=Symbol(0),kke=Symbol(0),xke=Symbol(0),Ske=Symbol(0),Ike=Symbol(0),Eke=Symbol(0),kt={crossOrigin:vke,readyState:Cke,updateActiveCues:kke,canLoad:xke,onModeChange:Ske,native:Ike,nativeHLS:Eke};let bc=(qz=class extends c${constructor(n){super();P(this,Ci);V(this,"src");V(this,"content");V(this,"type");V(this,"encoding");V(this,"id","");V(this,"label","");V(this,"language","");V(this,"kind");V(this,"default",!1);P(this,vm,!1);P(this,fs,0);P(this,Wp,"disabled");P(this,Cm,{});P(this,Zp,[]);P(this,dn,[]);P(this,ms,[]);V(this,Fz,0);V(this,jz);V(this,Nz,null);V(this,Mz,null);for(const a of Object.keys(n))this[a]=n[a];this.type||(this.type="vtt"),n.content?k(this,Ci,rU).call(this,n):n.src||(this[kt.readyState]=2)}static createId(n){return`vds-${n.type}-${n.kind}-${n.src??n.label??"?"}`}get metadata(){return b(this,Cm)}get regions(){return b(this,Zp)}get cues(){return b(this,dn)}get activeCues(){return b(this,ms)}get readyState(){return this[kt.readyState]}get mode(){return b(this,Wp)}set mode(n){this.setMode(n)}addCue(n,a){var d;let l=0,s=b(this,dn).length;for(l=0;l<s&&!(n.endTime<=b(this,dn)[l].startTime);l++);l===s?b(this,dn).push(n):b(this,dn).splice(l,0,n),n instanceof TextTrackCue||(d=this[kt.native])==null||d.track.addCue(n),this.dispatchEvent(new Ot("add-cue",{detail:n,trigger:a})),Rv(n,b(this,fs))&&this[kt.updateActiveCues](b(this,fs),a)}removeCue(n,a){var s;const l=b(this,dn).indexOf(n);if(l>=0){const d=b(this,ms).includes(n);b(this,dn).splice(l,1),(s=this[kt.native])==null||s.track.removeCue(n),this.dispatchEvent(new Ot("remove-cue",{detail:n,trigger:a})),d&&this[kt.updateActiveCues](b(this,fs),a)}}setMode(n,a){var l;b(this,Wp)!==n&&(N(this,Wp,n),n==="disabled"?(N(this,ms,[]),k(this,Ci,Ex).call(this)):this.readyState===2?this[kt.updateActiveCues](b(this,fs),a):k(this,Ci,xx).call(this),this.dispatchEvent(new Ot("mode-change",{detail:this,trigger:a})),(l=this[kt.onModeChange])==null||l.call(this))}[(Fz=kt.readyState,jz=kt.crossOrigin,Nz=kt.onModeChange,Mz=kt.native,kt.updateActiveCues)](n,a){if(N(this,fs,n),this.mode==="disabled"||!b(this,dn).length)return;const l=[];for(let d=0,p=b(this,dn).length;d<p;d++){const h=b(this,dn)[d];Rv(h,n)&&l.push(h)}let s=l.length!==b(this,ms).length;if(!s){for(let d=0;d<l.length;d++)if(!b(this,ms).includes(l[d])){s=!0;break}}N(this,ms,l),s&&k(this,Ci,Ex).call(this,a)}[kt.canLoad](){N(this,vm,!0),b(this,Wp)!=="disabled"&&k(this,Ci,xx).call(this)}},vm=new WeakMap,fs=new WeakMap,Wp=new WeakMap,Cm=new WeakMap,Zp=new WeakMap,dn=new WeakMap,ms=new WeakMap,Ci=new WeakSet,rU=function(n){Promise.resolve().then(()=>Z4).then(({parseText:a,VTTCue:l,VTTRegion:s})=>{!et(n.content)||n.type==="json"?(k(this,Ci,Ix).call(this,n.content,l,s),this.readyState!==3&&k(this,Ci,P3).call(this)):a(n.content,{type:n.type}).then(({cues:d,regions:p})=>{N(this,dn,d),N(this,Zp,p),k(this,Ci,P3).call(this)})})},xx=async function(){var n,a;if(!(!b(this,vm)||this[kt.readyState]>0)){if(this[kt.readyState]=1,this.dispatchEvent(new Ot("load-start")),!this.src){k(this,Ci,P3).call(this);return}try{const{parseResponse:l,VTTCue:s,VTTRegion:d}=await Promise.resolve().then(()=>Z4),p=(n=this[kt.crossOrigin])==null?void 0:n.call(this),h=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Vh(p)});if(this.type==="json")k(this,Ci,Ix).call(this,await(await h).text(),s,d);else{const{errors:f,metadata:g,regions:w,cues:v}=await l(h,{type:this.type,encoding:this.encoding});if(((a=f[0])==null?void 0:a.code)===0)throw f[0];N(this,Cm,g),N(this,Zp,w),N(this,dn,v)}k(this,Ci,P3).call(this)}catch(l){k(this,Ci,Sx).call(this,l)}}},P3=function(){if(this[kt.readyState]=2,!this.src||this.type!=="vtt"){const a=this[kt.native];if(a&&!a.managed)for(const l of b(this,dn))a.track.addCue(l)}const n=new Ot("load");this[kt.updateActiveCues](b(this,fs),n),this.dispatchEvent(n)},Sx=function(n){this[kt.readyState]=3,this.dispatchEvent(new Ot("error",{detail:n}))},Ix=function(n,a,l){try{const{regions:s,cues:d}=Ake(n,a,l);N(this,Zp,s),N(this,dn,d)}catch(s){k(this,Ci,Sx).call(this,s)}},Ex=function(n){this.dispatchEvent(new Ot("cue-change",{trigger:n}))},qz);const Tke=/captions|subtitles/;function xn(i){return Tke.test(i.kind)}function Ake(i,o,n){const a=et(i)?JSON.parse(i):i;let l=[],s=[];return a.regions&&n&&(l=a.regions.map(d=>Object.assign(new n,d))),(a.cues||rn(a))&&(s=(rn(a)?a:a.cues).filter(d=>Li(d.startTime)&&Li(d.endTime)).map(d=>Object.assign(new o(0,0,""),d))),{regions:l,cues:s}}const _ke=Symbol(0),Dke=Symbol(0),Oke=Symbol(0),Rke=Symbol(0),Bke=Symbol(0),Lke=Symbol(0),Pke=Symbol(0),$ke=Symbol(0),Mke=Symbol(0),mt={add:_ke,remove:Dke,reset:Oke,select:Rke,readonly:Bke,setReadonly:Lke,onReset:Pke,onRemove:$ke,onUserSelect:Mke},Nke=Symbol(0),jke=Symbol(0),ln={setAuto:Nke,enableAuto:jke};function zh(i){return i instanceof Error?i:Error(typeof i=="string"?i:JSON.stringify(i))}function rs(i,o){if(!i)throw Error("Assertion failed.")}function P$(i,o){const n=o.composedPath()[0];return ACe(n)&&i.contains(n)}const Bv=new Set;{let i=function(){for(const o of Bv)try{o()}catch{}window.requestAnimationFrame(i)};i()}function Fke(i){return Bv.add(i),()=>Bv.delete(i)}function bo(i,o,n){i.hasAttribute(o)||i.setAttribute(o,n)}function gc(i,o){if(i.hasAttribute("aria-label")||i.hasAttribute("data-no-label"))return;if(!sr(o)){We(i,"aria-label",o);return}function n(){We(i,"aria-label",o())}fe(n)}function $$(i){const o=getComputedStyle(i);return o.display!=="none"&&parseInt(o.opacity)>0}function qke(i){return!!i&&("checkVisibility"in i?i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):$$(i))}function M$(i,o){return Fke(()=>o(qke(i)))}function N$(i,o,n){for(;o;){if(o===i)return!0;if(n!=null&&n(o))break;o=o.parentElement}return!1}function yc(i,o){return new go(i).add("pointerup",n=>{n.button===0&&!n.defaultPrevented&&o(n)}).add("keydown",n=>{p$(n)&&o(n)})}function Lv(i){return Ng(i)&&(i.touches.length>1||i.changedTouches.length>1)}function ls(i){let o=Pg(),n=window.requestAnimationFrame(()=>{kn(i,o),n=-1});return()=>void window.cancelAnimationFrame(n)}function Pv(i,o,n){let a,l=i,s=i.parentElement,d=i.content.firstElementChild,p=[];!d&&i.firstElementChild&&(i.innerHTML=i.firstElementChild.outerHTML,i.firstElementChild.remove(),d=i.content.firstElementChild);for(let h=0;h<o;h++)a=document.importNode(d,!0),n==null||n(a,h),s.insertBefore(a,l.nextSibling),p.push(a),l=a;return At(()=>{for(let h=0;h<p.length;h++)p[h].remove()}),p}function $v(i){const o=document.createElement("template");return o.innerHTML=i,o.content}function Mv(i){return i.cloneNode(!0).firstElementChild}function j$(i,o,n,{offsetVarName:a,xOffset:l,yOffset:s,...d}){if(!i)return;const p=n.replace(" ","-").replace("-center","");if(Zn(i,"visibility",o?null:"hidden"),!o)return;let h=n.includes("top");const f=w=>n.includes("left")?`calc(-1 * ${w})`:w,g=w=>h?`calc(-1 * ${w})`:w;return qP(o,i,()=>{UP(o,i,{placement:p,middleware:[...d.middleware??[],zP({fallbackAxisSideDirection:"start",crossAxis:!1}),VP()],...d}).then(({x:w,y:v,middlewareData:C})=>{var T;const E=!!((T=C.flip)!=null&&T.index);h=n.includes(E?"bottom":"top"),i.setAttribute("data-placement",E?n.startsWith("top")?n.replace("top","bottom"):n.replace("bottom","top"):n),Object.assign(i.style,{top:`calc(${v+"px"} + ${g(s?s+"px":`var(--${a}-y-offset, 0px)`)})`,left:`calc(${w+"px"} + ${f(l?l+"px":`var(--${a}-x-offset, 0px)`)})`})})})}function Vke(i){return getComputedStyle(i).animationName!=="none"}function Sp(i){return i instanceof HTMLElement}function zke(i){return i?"true":"false"}function sn(i){return()=>zke(i())}function Uke(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Pi(i,o=2){return Number(i.toFixed(o))}function Nv(i){var o;return((o=String(i).split(".")[1])==null?void 0:o.length)??0}function jv(i,o,n){return Math.max(i,Math.min(n,o))}let Zg=ct(!1);po(document,"pointerdown",()=>{Zg.set(!1)}),po(document,"keydown",i=>{i.metaKey||i.altKey||i.ctrlKey||Zg.set(!0)});class dr extends $a{constructor(){super(...arguments);P(this,sl);P(this,Rc,ct(!1))}onConnect(n){fe(()=>{const a=new go(n);if(!Zg()){b(this,Rc).set(!1),Yg(n,!1),a.add("pointerenter",k(this,sl,cU).bind(this)).add("pointerleave",k(this,sl,dU).bind(this));return}const l=document.activeElement===n;b(this,Rc).set(l),Yg(n,l),a.add("focus",k(this,sl,lU).bind(this)).add("blur",k(this,sl,sU).bind(this))})}focused(){return b(this,Rc).call(this)}}Rc=new WeakMap,sl=new WeakSet,lU=function(){b(this,Rc).set(!0),Yg(this.el,!0)},sU=function(){b(this,Rc).set(!1),Yg(this.el,!1)},cU=function(){F$(this.el,!0)},dU=function(){F$(this.el,!1)};function Yg(i,o){We(i,"data-focus",o),We(i,"data-hocus",o)}function F$(i,o){We(i,"data-hocus",o),We(i,"data-hover",o)}class q$ extends c${constructor(){super(...arguments);V(this,"items",[]);V(this,Vz,!1)}get length(){return this.items.length}get readonly(){return this[mt.readonly]}indexOf(n){return this.items.indexOf(n)}getById(n){return n===""?null:this.items.find(a=>a.id===n)??null}toArray(){return[...this.items]}[(Vz=mt.readonly,Symbol.iterator)](){return this.items.values()}[mt.add](n,a){const l=this.items.length;""+l in this||Object.defineProperty(this,l,{get(){return this.items[l]}}),!this.items.includes(n)&&(this.items.push(n),this.dispatchEvent(new Ot("add",{detail:n,trigger:a})))}[mt.remove](n,a){var s;const l=this.items.indexOf(n);l>=0&&((s=this[mt.onRemove])==null||s.call(this,n,a),this.items.splice(l,1),this.dispatchEvent(new Ot("remove",{detail:n,trigger:a})))}[mt.reset](n){var a;for(const l of[...this.items])this[mt.remove](l,n);this.items=[],this[mt.setReadonly](!1,n),(a=this[mt.onReset])==null||a.call(this)}[mt.setReadonly](n,a){this[mt.readonly]!==n&&(this[mt.readonly]=n,this.dispatchEvent(new Ot("readonly-change",{detail:n,trigger:a})))}}const Fv=wp.fullscreenEnabled;class Hke extends $a{constructor(){super(...arguments);P(this,Lc);P(this,Bc,!1);P(this,g2,!1)}get active(){return b(this,g2)}get supported(){return Fv}onConnect(){new go(wp).add("fullscreenchange",k(this,Lc,uU).bind(this)).add("fullscreenerror",k(this,Lc,hU).bind(this)),At(k(this,Lc,pU).bind(this))}async enter(){try{return N(this,Bc,!0),!this.el||qv(this.el)?void 0:(V$(),wp.requestFullscreen(this.el))}catch(n){throw N(this,Bc,!1),n}}async exit(){if(!(!this.el||!qv(this.el)))return V$(),wp.exitFullscreen()}}Bc=new WeakMap,g2=new WeakMap,Lc=new WeakSet,pU=async function(){Fv&&await this.exit()},uU=function(n){const a=qv(this.el);a!==b(this,g2)&&(a||N(this,Bc,!1),N(this,g2,a),this.dispatch("fullscreen-change",{detail:a,trigger:n}))},hU=function(n){b(this,Bc)&&(this.dispatch("fullscreen-error",{detail:null,trigger:n}),N(this,Bc,!1))};function qv(i){if(wp.fullscreenElement===i)return!0;try{return i.matches(wp.fullscreenPseudoClass)}catch{return!1}}function V$(){if(!Fv)throw Error("[vidstack] no fullscreen API")}const i5=class i5 extends $a{constructor(){super(...arguments);P(this,xa);P(this,Pc,ct(k(this,xa,_x).call(this)));P(this,bs,ct(!1));P(this,Yp)}get type(){return b(this,Pc).call(this)}get locked(){return b(this,bs).call(this)}get portrait(){return b(this,Pc).call(this).startsWith("portrait")}get landscape(){return b(this,Pc).call(this).startsWith("landscape")}get supported(){return i5.supported}onConnect(){if(this.supported)po(screen.orientation,"change",k(this,xa,Tx).bind(this));else{const n=window.matchMedia("(orientation: landscape)");n.onchange=k(this,xa,Tx).bind(this),At(()=>n.onchange=null)}At(k(this,xa,fU).bind(this))}async lock(n){Re(b(this,bs))||b(this,Yp)===n||(k(this,xa,Ax).call(this),await screen.orientation.lock(n),b(this,bs).set(!0),N(this,Yp,n))}async unlock(){Re(b(this,bs))&&(k(this,xa,Ax).call(this),N(this,Yp,void 0),await screen.orientation.unlock(),b(this,bs).set(!1))}};Pc=new WeakMap,bs=new WeakMap,Yp=new WeakMap,xa=new WeakSet,fU=async function(){this.supported&&b(this,bs).call(this)&&await this.unlock()},Tx=function(n){b(this,Pc).set(k(this,xa,_x).call(this)),this.dispatch("orientation-change",{detail:{orientation:Re(b(this,Pc)),lock:b(this,Yp)},trigger:n})},Ax=function(){if(!this.supported)throw Error("[vidstack] no orientation API")},_x=function(){return this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"},V(i5,"supported",S$());let Xg=i5;function Vv(i){return!et(i)&&"width"in i&&"height"in i&&Li(i.width)&&Li(i.height)}const z$=new fc({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Ti,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:S$(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return x$&&this.mediaType==="video"&&(!this.playsInline||!wp.fullscreenEnabled&&this.fullscreen)},get nativeControls(){return this.controls||this.iOSControls},controlsVisible:!1,get controlsHidden(){return!this.controlsVisible},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Ti,playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new Ti,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(xn).length>0},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow},get title(){return this.providedTitle||this.inferredTitle},get poster(){return this.providedPoster||this.inferredPoster},get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.inferredViewType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){const i=L$(this.buffered)??0;return Math.max(i,this.clipStartTime)},get bufferedEnd(){const i=xp(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,i-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)},get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const i=L$(this.seekable)??0;return Math.max(i,this.clipStartTime)},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;const i=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?xp(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,i):i},get seekableWindow(){const i=this.seekableEnd-this.seekableStart;return isNaN(i)?1/0:Math.max(0,i)},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return this.remotePlaybackType==="airplay"&&this.remotePlaybackState==="connected"},get isGoogleCastConnected(){return this.remotePlaybackType==="google-cast"&&this.remotePlaybackState==="connected"},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},get isLiveDVR(){return/:dvr/.test(this.streamType)},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow)},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),U$=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),Kke=new Set([...U$,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function H$(i,o=!1){const n=o?U$:Kke;z$.reset(i,a=>n.has(a)),is()}function K$(i,o){const n=i+o.clipStartTime(),a=Math.floor(i)===Math.floor(o.seekableStart()),l=Math.floor(n)===Math.floor(o.seekableEnd());return a?o.seekableStart():l?o.seekableEnd():o.isLiveDVR()&&o.liveDVRWindow()>0&&n<o.seekableEnd()-o.liveDVRWindow()?o.bufferedStart():Math.min(Math.max(o.seekableStart()+.1,n),o.seekableEnd()-.1)}class Gke{constructor(o=void 0){P(this,ao);P(this,Xp,null);P(this,Sa,null);P(this,y2,-1);P(this,n5);N(this,n5,o)}setTarget(o){N(this,Xp,o)}getPlayer(o){var n;return b(this,Sa)?b(this,Sa):((n=o??b(this,Xp))==null||n.dispatchEvent(new Ot("find-media-player",{detail:a=>void N(this,Sa,a),bubbles:!0,composed:!0})),b(this,Sa))}setPlayer(o){N(this,Sa,o)}startLoading(o){k(this,ao,Co).call(this,"media-start-loading",o)}startLoadingPoster(o){k(this,ao,Co).call(this,"media-poster-start-loading",o)}requestAirPlay(o){k(this,ao,Co).call(this,"media-airplay-request",o)}requestGoogleCast(o){k(this,ao,Co).call(this,"media-google-cast-request",o)}play(o){k(this,ao,Co).call(this,"media-play-request",o)}pause(o){k(this,ao,Co).call(this,"media-pause-request",o)}mute(o){k(this,ao,Co).call(this,"media-mute-request",o)}unmute(o){k(this,ao,Co).call(this,"media-unmute-request",o)}enterFullscreen(o,n){k(this,ao,Co).call(this,"media-enter-fullscreen-request",n,o)}exitFullscreen(o,n){k(this,ao,Co).call(this,"media-exit-fullscreen-request",n,o)}lockScreenOrientation(o,n){k(this,ao,Co).call(this,"media-orientation-lock-request",n,o)}unlockScreenOrientation(o){k(this,ao,Co).call(this,"media-orientation-unlock-request",o)}enterPictureInPicture(o){k(this,ao,Co).call(this,"media-enter-pip-request",o)}exitPictureInPicture(o){k(this,ao,Co).call(this,"media-exit-pip-request",o)}seeking(o,n){k(this,ao,Co).call(this,"media-seeking-request",n,o)}seek(o,n){k(this,ao,Co).call(this,"media-seek-request",n,o)}seekToLiveEdge(o){k(this,ao,Co).call(this,"media-live-edge-request",o)}changeDuration(o,n){k(this,ao,Co).call(this,"media-duration-change-request",n,o)}changeClipStart(o,n){k(this,ao,Co).call(this,"media-clip-start-change-request",n,o)}changeClipEnd(o,n){k(this,ao,Co).call(this,"media-clip-end-change-request",n,o)}changeVolume(o,n){k(this,ao,Co).call(this,"media-volume-change-request",n,Math.max(0,Math.min(1,o)))}changeAudioTrack(o,n){k(this,ao,Co).call(this,"media-audio-track-change-request",n,o)}changeQuality(o,n){k(this,ao,Co).call(this,"media-quality-change-request",n,o)}requestAutoQuality(o){this.changeQuality(-1,o)}changeTextTrackMode(o,n,a){k(this,ao,Co).call(this,"media-text-track-change-request",a,{index:o,mode:n})}changePlaybackRate(o,n){k(this,ao,Co).call(this,"media-rate-change-request",n,o)}changeAudioGain(o,n){k(this,ao,Co).call(this,"media-audio-gain-change-request",n,o)}resumeControls(o){k(this,ao,Co).call(this,"media-resume-controls-request",o)}pauseControls(o){k(this,ao,Co).call(this,"media-pause-controls-request",o)}togglePaused(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.paused?this.play(o):this.pause(o))}toggleControls(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.controls.showing?n.controls.hide(0,o):n.controls.show(0,o))}toggleMuted(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.muted?this.unmute(o):this.mute(o))}toggleFullscreen(o,n){const a=this.getPlayer(n==null?void 0:n.target);a&&(a.state.fullscreen?this.exitFullscreen(o,n):this.enterFullscreen(o,n))}togglePictureInPicture(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.pictureInPicture?this.exitPictureInPicture(o):this.enterPictureInPicture(o))}showCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;let a=n.state.textTracks,l=b(this,y2);(!a[l]||!xn(a[l]))&&(l=-1),l===-1&&(l=a.findIndex(s=>xn(s)&&s.default)),l===-1&&(l=a.findIndex(s=>xn(s))),l>=0&&this.changeTextTrackMode(l,"showing",o),N(this,y2,-1)}disableCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;const a=n.state.textTracks,l=n.state.textTrack;if(l){const s=a.indexOf(l);this.changeTextTrackMode(s,"disabled",o),N(this,y2,s)}}toggleCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(o,n){k(this,ao,Co).call(this,"media-user-loop-change-request",n,o)}}Xp=new WeakMap,Sa=new WeakMap,y2=new WeakMap,n5=new WeakMap,ao=new WeakSet,Co=function(o,n,a){var p,h;const l=new Ot(o,{bubbles:!0,composed:!0,cancelable:!0,detail:a,trigger:n});let s=(n==null?void 0:n.target)||null;s&&s instanceof dt&&(s=s.el),s=!s||s===document||s===window||s===document.body||((p=b(this,Sa))==null?void 0:p.el)&&s instanceof Node&&!b(this,Sa).el.contains(s)?b(this,Xp)??((h=this.getPlayer())==null?void 0:h.el):s??b(this,Xp),b(this,Sa)?o==="media-play-request"&&!b(this,Sa).state.canLoad?s==null||s.dispatchEvent(l):b(this,Sa).canPlayQueue.enqueue(o,()=>s==null?void 0:s.dispatchEvent(l)):s==null||s.dispatchEvent(l)},rWe=function(o){};class Wke{constructor(){V(this,"playerId","vds-player");V(this,"mediaId",null);P(this,di,{volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null});V(this,"saveTimeThrottled",vp(this.saveTime.bind(this),1e3))}async getVolume(){return b(this,di).volume}async setVolume(o){b(this,di).volume=o,this.save()}async getMuted(){return b(this,di).muted}async setMuted(o){b(this,di).muted=o,this.save()}async getTime(){return b(this,di).time}async setTime(o,n){const a=o<0;b(this,di).time=a?null:o,a||n?this.saveTime():this.saveTimeThrottled()}async getLang(){return b(this,di).lang}async setLang(o){b(this,di).lang=o,this.save()}async getCaptions(){return b(this,di).captions}async setCaptions(o){b(this,di).captions=o,this.save()}async getPlaybackRate(){return b(this,di).rate}async setPlaybackRate(o){b(this,di).rate=o,this.save()}async getAudioGain(){return b(this,di).audioGain}async setAudioGain(o){b(this,di).audioGain=o,this.save()}async getVideoQuality(){return b(this,di).quality}async setVideoQuality(o){b(this,di).quality=o,this.save()}onChange(o,n,a="vds-player"){const l=a?localStorage.getItem(a):null,s=n?localStorage.getItem(n):null;this.playerId=a,this.mediaId=n,N(this,di,{volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...l?JSON.parse(l):{},time:s?+s:null})}save(){if(!this.playerId)return;const o=JSON.stringify({...b(this,di),time:void 0});localStorage.setItem(this.playerId,o)}saveTime(){if(!this.mediaId)return;const o=(b(this,di).time??0).toString();localStorage.setItem(this.mediaId,o)}}di=new WeakMap;const Uh=Symbol(0);class G$ extends q${get selected(){return this.items.find(o=>o.selected)??null}get selectedIndex(){return this.items.findIndex(o=>o.selected)}[mt.onRemove](o,n){this[mt.select](o,!1,n)}[mt.add](o,n){o[Uh]=!1,Object.defineProperty(o,"selected",{get(){return this[Uh]},set:a=>{var l;this.readonly||((l=this[mt.onUserSelect])==null||l.call(this),this[mt.select](o,a))}}),super[mt.add](o,n)}[mt.select](o,n,a){if(n===(o==null?void 0:o[Uh]))return;const l=this.selected;o&&(o[Uh]=n),(n?l!==o:l===o)&&(l&&(l[Uh]=!1),this.dispatchEvent(new Ot("change",{detail:{prev:l,current:this.selected},trigger:a})))}}class Zke extends G${}class Yke{constructor(){P(this,Fa);V(this,"priority",0);P(this,km,!0);P(this,gs,null);P(this,xm,null);P(this,$c,new Set)}canRender(o,n){return!!n}attach(o){N(this,gs,o),o&&(o.textTracks.onchange=k(this,Fa,Ox).bind(this))}addTrack(o){b(this,$c).add(o),k(this,Fa,mU).call(this,o)}removeTrack(o){var n,a;(a=(n=o[kt.native])==null?void 0:n.remove)==null||a.call(n),o[kt.native]=null,b(this,$c).delete(o)}changeTrack(o){const n=o==null?void 0:o[kt.native];n&&n.track.mode!=="showing"&&(n.track.mode="showing"),N(this,xm,o)}setDisplay(o){N(this,km,o),k(this,Fa,Ox).call(this)}detach(){b(this,gs)&&(b(this,gs).textTracks.onchange=null);for(const o of b(this,$c))this.removeTrack(o);b(this,$c).clear(),N(this,gs,null),N(this,xm,null)}}km=new WeakMap,gs=new WeakMap,xm=new WeakMap,$c=new WeakMap,Fa=new WeakSet,mU=function(o){var a;if(!b(this,gs))return;const n=o[a=kt.native]??(o[a]=k(this,Fa,bU).call(this,o));Sp(n)&&(b(this,gs).append(n),n.track.mode=n.default?"showing":"disabled")},bU=function(o){const n=document.createElement("track"),a=o.default||o.mode==="showing",l=o.src&&o.type==="vtt";return n.id=o.id,n.src=l?o.src:"",n.label=o.label,n.kind=o.kind,n.default=a,o.language&&(n.srclang=o.language),a&&!l&&k(this,Fa,Dx).call(this,o,n.track),n},Dx=function(o,n){var a;if(!(o.src&&o.type==="vtt"||(a=n.cues)!=null&&a.length))for(const l of o.cues)n.addCue(l)},Ox=function(o){for(const n of b(this,$c)){const a=n[kt.native];if(!a)continue;if(!b(this,km)){a.track.mode=a.managed?"hidden":"disabled";continue}const l=a.track.mode==="showing";l&&k(this,Fa,Dx).call(this,n,a.track),n.setMode(l?"showing":"disabled",o)}};class Xke{constructor(o){P(this,ki);P(this,Qp,null);P(this,w2);P(this,Jp,[]);P(this,Sm);P(this,Im,!1);P(this,Ia,null);P(this,cl,null);N(this,Sm,o);const n=o.textTracks;N(this,w2,n),fe(k(this,ki,gU).bind(this)),At(k(this,ki,CU).bind(this)),new go(n).add("add",k(this,ki,wU).bind(this)).add("remove",k(this,ki,vU).bind(this)).add("mode-change",k(this,ki,j1).bind(this))}add(o){b(this,Jp).push(o),ju(k(this,ki,j1).bind(this))}remove(o){o.detach(),b(this,Jp).splice(b(this,Jp).indexOf(o),1),ju(k(this,ki,j1).bind(this))}attachVideo(o){requestAnimationFrame(()=>{if(N(this,Qp,o),o){N(this,Ia,new Yke),b(this,Ia).attach(o);for(const n of b(this,w2))k(this,ki,Rx).call(this,n)}k(this,ki,j1).call(this)})}}Qp=new WeakMap,w2=new WeakMap,Jp=new WeakMap,Sm=new WeakMap,Im=new WeakMap,Ia=new WeakMap,cl=new WeakMap,ki=new WeakSet,gU=function(){const{nativeControls:o}=b(this,Sm).$state;N(this,Im,o()),k(this,ki,j1).call(this)},Rx=function(o){var n;xn(o)&&((n=b(this,Ia))==null||n.addTrack(o))},yU=function(o){var n;xn(o)&&((n=b(this,Ia))==null||n.removeTrack(o))},wU=function(o){k(this,ki,Rx).call(this,o.detail)},vU=function(o){k(this,ki,yU).call(this,o.detail)},j1=function(){var a,l,s,d,p,h,f;const o=b(this,w2).selected;if(b(this,Qp)&&(b(this,Im)||o!=null&&o[kt.nativeHLS])){(a=b(this,cl))==null||a.changeTrack(null),(l=b(this,Ia))==null||l.setDisplay(!0),(s=b(this,Ia))==null||s.changeTrack(o);return}if((d=b(this,Ia))==null||d.setDisplay(!1),(p=b(this,Ia))==null||p.changeTrack(null),!o){(h=b(this,cl))==null||h.changeTrack(null);return}const n=b(this,Jp).sort((g,w)=>g.priority-w.priority).find(g=>g.canRender(o,b(this,Qp)));b(this,cl)!==n&&((f=b(this,cl))==null||f.detach(),n==null||n.attach(b(this,Qp)),N(this,cl,n??null)),n==null||n.changeTrack(o)},CU=function(){var o,n;(o=b(this,Ia))==null||o.detach(),N(this,Ia,null),(n=b(this,cl))==null||n.detach(),N(this,cl,null)};class Qke extends q${constructor(){super();P(this,hl);P(this,e0,!1);P(this,dl,{});P(this,pl,null);P(this,ul,null);V(this,zz);P(this,Em,Av(async()=>{var l;if(!b(this,e0))return;!b(this,ul)&&b(this,pl)&&N(this,ul,await b(this,pl).getLang());const n=await((l=b(this,pl))==null?void 0:l.getCaptions()),a=[["captions","subtitles"],"chapters","descriptions","metadata"];for(const s of a){const d=this.getByKind(s);if(d.find(w=>w.mode==="showing"))continue;const p=b(this,ul)?d.find(w=>w.language===b(this,ul)):null,h=rn(s)?b(this,dl)[s.find(w=>b(this,dl)[w])||""]:b(this,dl)[s],f=p??h,g=f&&xn(f);f&&(!g||n!==!1)&&(f.mode="showing",g&&k(this,hl,Bx).call(this,f))}},300));P(this,v2,null);P(this,Tm,k(this,hl,kU).bind(this))}get selected(){return this.items.find(a=>a.mode==="showing"&&xn(a))??null}get selectedIndex(){const n=this.selected;return n?this.indexOf(n):-1}get preferredLang(){return b(this,ul)}set preferredLang(n){N(this,ul,n),k(this,hl,Lx).call(this,n)}add(n,a){const l=n instanceof bc,s=l?n:new bc(n),d=n.kind==="captions"||n.kind==="subtitles"?"captions":n.kind;return b(this,dl)[d]&&n.default&&delete n.default,s.addEventListener("mode-change",b(this,Tm)),this[mt.add](s,a),s[kt.crossOrigin]=this[kt.crossOrigin],b(this,e0)&&s[kt.canLoad](),n.default&&(b(this,dl)[d]=s),b(this,Em).call(this),this}remove(n,a){if(N(this,v2,n),!!this.items.includes(n))return n===b(this,dl)[n.kind]&&delete b(this,dl)[n.kind],n.mode="disabled",n[kt.onModeChange]=null,n.removeEventListener("mode-change",b(this,Tm)),this[mt.remove](n,a),N(this,v2,null),this}clear(n){for(const a of[...this.items])this.remove(a,n);return this}getByKind(n){const a=Array.isArray(n)?n:[n];return this.items.filter(l=>a.includes(l.kind))}[(zz=kt.crossOrigin,kt.canLoad)](){if(!b(this,e0)){for(const n of this.items)n[kt.canLoad]();N(this,e0,!0),b(this,Em).call(this)}}setStorage(n){N(this,pl,n)}}e0=new WeakMap,dl=new WeakMap,pl=new WeakMap,ul=new WeakMap,Em=new WeakMap,v2=new WeakMap,Tm=new WeakMap,hl=new WeakSet,kU=function(n){const a=n.detail;if(b(this,pl)&&xn(a)&&a!==b(this,v2)&&k(this,hl,Bx).call(this,a),a.mode==="showing"){const l=xn(a)?["captions","subtitles"]:[a.kind];for(const s of this.items)s.mode==="showing"&&s!=a&&l.includes(s.kind)&&(s.mode="disabled")}this.dispatchEvent(new Ot("mode-change",{detail:n.detail,trigger:n}))},Bx=function(n){var a,l;n.mode!=="disabled"&&k(this,hl,Lx).call(this,n.language),(l=(a=b(this,pl))==null?void 0:a.setCaptions)==null||l.call(a,n.mode==="showing")},Lx=function(n){var a,l;(l=(a=b(this,pl))==null?void 0:a.setLang)==null||l.call(a,N(this,ul,n))};class Jke extends G${constructor(){super(...arguments);P(this,t0,!1);V(this,"switch","current");V(this,Uz)}get auto(){return b(this,t0)||this.readonly}[(Uz=ln.enableAuto,mt.onUserSelect)](){this[ln.setAuto](!1)}[mt.onReset](n){this[ln.enableAuto]=void 0,this[ln.setAuto](!1,n)}autoSelect(n){var a;this.readonly||b(this,t0)||!this[ln.enableAuto]||((a=this[ln.enableAuto])==null||a.call(this,n),this[ln.setAuto](!0,n))}getBySrc(n){return this.items.find(a=>a.src===n)}[ln.setAuto](n,a){b(this,t0)!==n&&(N(this,t0,n),this.dispatchEvent(new Ot("auto-change",{detail:n,trigger:a})))}}t0=new WeakMap;function exe(i){return i instanceof HTMLAudioElement}function txe(i){return i instanceof HTMLVideoElement}function oxe(i){return exe(i)||txe(i)}class Ip extends $a{}const ixe={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},Hh=new Set(["Shift","Alt","Meta","Ctrl"]),nxe='button, [role="button"]',W$='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';class axe extends Ip{constructor(n){super();P(this,xi);P(this,Zi);P(this,o0);P(this,ys,null);N(this,Zi,n)}onConnect(){fe(k(this,xi,xU).bind(this))}}Zi=new WeakMap,xi=new WeakSet,xU=function(){const{keyDisabled:n,keyTarget:a}=this.$props;if(n())return;const l=a()==="player"?this.el:document,s=ct(!1);l===this.el?new go(this.el).add("focusin",()=>s.set(!0)).add("focusout",d=>{this.el.contains(d.target)||s.set(!1)}):(Re(s)||s.set(document.querySelector("[data-media-player]")===this.el),po(document,"focusin",d=>{const p=d.composedPath().find(h=>h instanceof Element&&h.localName==="media-player");p!==void 0&&s.set(this.el===p)})),fe(()=>{s()&&new go(l).add("keyup",k(this,xi,SU).bind(this)).add("keydown",k(this,xi,IU).bind(this)).add("keydown",k(this,xi,EU).bind(this),{capture:!0})})},SU=function(n){var d,p;const a=document.activeElement;if(!n.key||!this.$state.canSeek()||a!=null&&a.matches(W$))return;let{method:l,value:s}=k(this,xi,N5).call(this,n);if(!et(s)&&!rn(s)){(d=s==null?void 0:s.onKeyUp)==null||d.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(p=s==null?void 0:s.callback)==null||p.call(s,n,b(this,Zi).remote);return}if(l!=null&&l.startsWith("seek")&&(n.preventDefault(),n.stopPropagation(),b(this,ys)?(k(this,xi,Px).call(this,n,l==="seekForward"),N(this,ys,null)):(b(this,Zi).remote.seek(b(this,o0),n),N(this,o0,void 0))),l!=null&&l.startsWith("volume")){const h=this.el.querySelector("[data-media-volume-slider]");h==null||h.dispatchEvent(new KeyboardEvent("keyup",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}))}},IU=function(n){var p,h,f,g;if(!n.key||Hh.has(n.key))return;const a=document.activeElement;if(a!=null&&a.matches(W$)||p$(n)&&(a!=null&&a.matches(nxe)))return;let{method:l,value:s}=k(this,xi,N5).call(this,n),d=!n.metaKey&&/^[0-9]$/.test(n.key);if(!et(s)&&!rn(s)&&!d){(p=s==null?void 0:s.onKeyDown)==null||p.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(h=s==null?void 0:s.callback)==null||h.call(s,n,b(this,Zi).remote);return}if(!l&&d&&!sxe(n)){n.preventDefault(),n.stopPropagation(),b(this,Zi).remote.seek(this.$state.duration()/10*Number(n.key),n);return}if(l){switch(n.preventDefault(),n.stopPropagation(),l){case"seekForward":case"seekBackward":k(this,xi,AU).call(this,n,l,l==="seekForward");break;case"volumeUp":case"volumeDown":const w=this.el.querySelector("[data-media-volume-slider]");if(w)w.dispatchEvent(new KeyboardEvent("keydown",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}));else{const C=n.shiftKey?.1:.05;b(this,Zi).remote.changeVolume(this.$state.volume()+(l==="volumeUp"?+C:-C),n)}break;case"toggleFullscreen":b(this,Zi).remote.toggleFullscreen("prefer-media",n);break;case"speedUp":case"slowDown":const v=this.$state.playbackRate();b(this,Zi).remote.changePlaybackRate(Math.max(.25,Math.min(2,v+(l==="speedUp"?.25:-.25))),n);break;default:(g=(f=b(this,Zi).remote)[l])==null||g.call(f,n)}this.$state.lastKeyboardAction.set({action:l,event:n})}},EU=function(n){oxe(n.target)&&k(this,xi,N5).call(this,n).method&&n.preventDefault()},N5=function(n){const a={...this.$props.keyShortcuts(),...b(this,Zi).ariaKeys},l=Object.keys(a).find(s=>{var f;const d=a[s],p=rn(d)?d.join(" "):et(d)?d:d==null?void 0:d.keys,h=(f=rn(p)?p:p==null?void 0:p.split(" "))==null?void 0:f.map(g=>lxe(g).replace(/Control/g,"Ctrl").split("+"));return h==null?void 0:h.some(g=>{const w=new Set(g.filter(v=>Hh.has(v)));for(const v of Hh){const C=v.toLowerCase()+"Key";if(!w.has(v)&&n[C])return!1}return g.every(v=>Hh.has(v)?n[v.toLowerCase()+"Key"]:n.key===v.replace("Space"," "))})});return{method:l,value:l?a[l]:null}},o0=new WeakMap,TU=function(n,a){const l=n.shiftKey?10:5;return N(this,o0,Math.max(0,Math.min((b(this,o0)??this.$state.currentTime())+(a==="seekForward"?+l:-l),this.$state.duration())))},ys=new WeakMap,Px=function(n,a){var l;(l=b(this,ys))==null||l.dispatchEvent(new KeyboardEvent(n.type,{key:a?"Right":"Left",shiftKey:n.shiftKey,trigger:n}))},AU=function(n,a,l){this.$state.canSeek()&&(b(this,ys)||N(this,ys,this.el.querySelector("[data-media-time-slider]")),b(this,ys)?k(this,xi,Px).call(this,n,l):b(this,Zi).remote.seeking(k(this,xi,TU).call(this,n,a),n))};const rxe=["!","@","#","$","%","^","&","*","(",")"];function lxe(i){return i.replace(/Shift\+(\d)/g,(o,n)=>rxe[n-1])}function sxe(i){for(const o of Hh)if(i[o.toLowerCase()+"Key"])return!0;return!1}class cxe extends Ip{constructor(){super(...arguments);P(this,ro);P(this,C2,-2);P(this,ws,!1);P(this,Am,ct(!1));P(this,k2,ct(!1));P(this,Mc,null);P(this,x2,ct(!0));V(this,"defaultDelay",2e3)}get canIdle(){return b(this,x2).call(this)}set canIdle(n){b(this,x2).set(n)}get hideOnMouseLeave(){const{hideControlsOnMouseLeave:n}=this.$props;return b(this,Am).call(this)||n()}set hideOnMouseLeave(n){b(this,Am).set(n)}get showing(){return this.$state.controlsVisible()}show(n=0,a){k(this,ro,j5).call(this),b(this,ws)||k(this,ro,$3).call(this,!0,n,a)}hide(n=this.defaultDelay,a){k(this,ro,j5).call(this),b(this,ws)||k(this,ro,$3).call(this,!1,n,a)}pause(n){N(this,ws,!0),k(this,ro,j5).call(this),k(this,ro,$3).call(this,!0,0,n)}resume(n){N(this,ws,!1),!this.$state.paused()&&k(this,ro,$3).call(this,!1,this.defaultDelay,n)}onConnect(){fe(k(this,ro,_U).bind(this))}}C2=new WeakMap,ws=new WeakMap,Am=new WeakMap,k2=new WeakMap,Mc=new WeakMap,x2=new WeakMap,ro=new WeakSet,_U=function(){const{viewType:n}=this.$state;if(!this.el||!b(this,x2).call(this))return;if(n()==="audio"){this.show();return}fe(k(this,ro,DU).bind(this)),fe(k(this,ro,OU).bind(this));const a=k(this,ro,RU).bind(this),l=k(this,ro,BU).bind(this),s=k(this,ro,LU).bind(this);new go(this.el).add("can-play",d=>this.show(0,d)).add("play",a).add("pause",l).add("end",s).add("auto-play-fail",l)},DU=function(){if(!this.el)return;const{started:n,pointer:a,paused:l}=this.$state;if(!n()||a()!=="fine")return;const s=new go(this.el),d=this.hideOnMouseLeave;(!d||!b(this,k2).call(this))&&fe(()=>{l()||s.add("pointermove",k(this,ro,$x).bind(this))}),d&&s.add("mouseenter",k(this,ro,PU).bind(this)).add("mouseleave",k(this,ro,$U).bind(this))},OU=function(){const{paused:n,started:a,autoPlayError:l}=this.$state;if(n()||l()&&!a())return;const s=k(this,ro,$x).bind(this);fe(()=>{if(!this.el)return;const d=this.$state.pointer(),p=d==="coarse",h=new go(this.el),f=[p?"touchend":"pointerup","keydown"];for(const g of f)h.add(g,s,{passive:!1})})},RU=function(n){n.triggers.hasType("ended")||(this.show(0,n),this.hide(void 0,n))},BU=function(n){this.show(0,n)},LU=function(n){const{loop:a}=this.$state;a()&&this.hide(0,n)},PU=function(n){b(this,k2).set(!1),this.show(0,n),this.hide(void 0,n)},$U=function(n){b(this,k2).set(!0),this.hide(0,n)},j5=function(){window.clearTimeout(b(this,C2)),N(this,C2,-1)},$x=function(n){var a;n.MEDIA_GESTURE||b(this,ws)||Lv(n)||(jg(n)&&(n.key==="Escape"?((a=this.el)==null||a.focus(),N(this,Mc,null)):b(this,Mc)&&(n.preventDefault(),requestAnimationFrame(()=>{var l;(l=b(this,Mc))==null||l.focus(),N(this,Mc,null)}))),this.show(0,n),this.hide(this.defaultDelay,n))},$3=function(n,a,l){if(a===0){k(this,ro,Mx).call(this,n,l);return}N(this,C2,window.setTimeout(()=>{this.scope&&k(this,ro,Mx).call(this,n&&!b(this,ws),l)},a))},Mx=function(n,a){var l;this.$state.controlsVisible()!==n&&(this.$state.controlsVisible.set(n),!n&&document.activeElement&&((l=this.el)!=null&&l.contains(document.activeElement))&&(N(this,Mc,document.activeElement),requestAnimationFrame(()=>{var s;(s=this.el)==null||s.focus({preventScroll:!0})})),this.dispatch("controls-change",{detail:n,trigger:a}))};class dxe{constructor(){V(this,"name","audio");V(this,"target")}canPlay(o){return O$(o)?!et(o.src)||o.type==="?"||I$(this.target,o.type):!1}mediaType(){return"audio"}async load(o){return new(await Promise.resolve().then(()=>oGe)).AudioProvider(this.target,o)}}class zv{constructor(){V(this,"name","video");V(this,"target")}canPlay(o){return R$(o)?!et(o.src)||o.type==="?"||E$(this.target,o.type):!1}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>cGe)).VideoProvider(this.target,o)}}const a5=class a5 extends zv{constructor(){super(...arguments);V(this,"name","hls")}canPlay(n){return a5.supported&&Uu(n)}async load(n){return new(await Promise.resolve().then(()=>bGe)).HLSProvider(this.target,n)}};V(a5,"supported",Gg());let Uv=a5;const r5=class r5 extends zv{constructor(){super(...arguments);V(this,"name","dash")}canPlay(n){return r5.supported&&Dv(n)}async load(n){return new(await Promise.resolve().then(()=>SGe)).DASHProvider(this.target,n)}};V(r5,"supported",D$());let Hv=r5;class pxe{constructor(){V(this,"name","vimeo");V(this,"target")}preconnect(){const o=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(const n of o)as(n)}canPlay(o){return et(o.src)&&o.type==="video/vimeo"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>_Ge)).VimeoProvider(this.target,o)}async loadPoster(o,n,a){const{resolveVimeoVideoId:l,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>EGe);if(!et(o.src))return null;const{videoId:d,hash:p}=l(o.src);return d?s(d,a,p).then(h=>h?h.poster:null):null}}class uxe{constructor(){V(this,"name","youtube");V(this,"target")}preconnect(){const o=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(const n of o)as(n)}canPlay(o){return et(o.src)&&o.type==="video/youtube"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>PGe)).YouTubeProvider(this.target,o)}async loadPoster(o,n,a){const{findYouTubePoster:l,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>BGe),d=et(o.src)&&s(o.src);return d?l(d,a):null}}const Kv=Symbol(0),hxe=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],fxe={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:ixe,storage:null};class Z$ extends Ip{constructor(n,a){super();P(this,_m);P(this,i0);N(this,_m,n),N(this,i0,a)}async onAttach(n){const a=this.$props[b(this,_m)]();if(a==="eager")requestAnimationFrame(b(this,i0));else if(a==="idle")FCe(b(this,i0));else if(a==="visible"){let l,s=new IntersectionObserver(d=>{this.scope&&d[0].isIntersecting&&(l==null||l(),l=void 0,b(this,i0).call(this))});s.observe(n),l=At(()=>s.disconnect())}}}_m=new WeakMap,i0=new WeakMap;class mxe{constructor(o,n){P(this,l5);P(this,Dm);P(this,br);N(this,Dm,o),N(this,br,n)}notify(o,...n){b(this,Dm).call(this,new Ot(o,{detail:n==null?void 0:n[0],trigger:n==null?void 0:n[1]}))}async ready(o,n){return ju(async()=>{var j,ee,le,he,pe,$,X;const{logger:a}=b(this,br),{autoPlay:l,canPlay:s,started:d,duration:p,seekable:h,buffered:f,remotePlaybackInfo:g,playsInline:w,savedState:v,source:C}=b(this,br).$state;if(s())return;const E={duration:(o==null?void 0:o.duration)??p(),seekable:(o==null?void 0:o.seekable)??h(),buffered:(o==null?void 0:o.buffered)??f(),provider:b(this,br).$provider()};this.notify("can-play",E,n),is();let T=b(this,br).$provider(),{storage:A,qualities:I}=b(this,br),{muted:x,volume:O,clipStartTime:D,playbackRate:R}=b(this,br).$props;await((j=A==null?void 0:A.onLoad)==null?void 0:j.call(A,C()));const q=(ee=v())==null?void 0:ee.currentTime,L=(le=v())==null?void 0:le.paused,U=await(A==null?void 0:A.getTime()),K=q??U??D(),G=L===!1||L!==!0&&!d()&&l();if(T){T.setVolume(await(A==null?void 0:A.getVolume())??O()),T.setMuted(x()||!!await(A==null?void 0:A.getMuted()));const W=await(A==null?void 0:A.getAudioGain())??1;W>1&&((pe=(he=T.audioGain)==null?void 0:he.setGain)==null||pe.call(he,W)),($=T.setPlaybackRate)==null||$.call(T,await(A==null?void 0:A.getPlaybackRate())??R()),(X=T.setPlaysInline)==null||X.call(T,w()),K>0&&T.setCurrentTime(K)}const F=await(A==null?void 0:A.getVideoQuality());if(F&&I.length){let W=null,Z=1/0;for(const ce of I){const be=Math.abs(F.width-ce.width)+Math.abs(F.height-ce.height)+(F.bitrate?Math.abs(F.bitrate-(ce.bitrate??0)):0);be<Z&&(W=ce,Z=be)}W&&(W.selected=!0)}s()&&G?await k(this,l5,MU).call(this,n):U&&U>0&&this.notify("started",void 0,n),g.set(null)})}}Dm=new WeakMap,br=new WeakMap,l5=new WeakSet,MU=async function(o){const{player:n,$state:{autoPlaying:a,muted:l}}=b(this,br);a.set(!0);const s=new Ot("auto-play-attempt",{trigger:o});try{await n.play(s)}catch{}};class bxe{constructor(){P(this,Nc,new Map)}enqueue(o,n){b(this,Nc).set(o,n)}serve(o){const n=this.peek(o);return b(this,Nc).delete(o),n}peek(o){return b(this,Nc).get(o)}delete(o){b(this,Nc).delete(o)}clear(){b(this,Nc).clear()}}Nc=new WeakMap;class Y${constructor(){P(this,Fc);P(this,jc,!1);P(this,S2,Vu());P(this,gr,new Map)}get size(){return b(this,gr).size}get isServing(){return b(this,jc)}async waitForFlush(){b(this,jc)||await b(this,S2).promise}enqueue(o,n){if(b(this,jc)){n();return}b(this,gr).delete(o),b(this,gr).set(o,n)}serve(o){var n;(n=b(this,gr).get(o))==null||n(),b(this,gr).delete(o)}start(){k(this,Fc,Nx).call(this),N(this,jc,!0),b(this,gr).size>0&&k(this,Fc,Nx).call(this)}stop(){N(this,jc,!1)}reset(){this.stop(),b(this,gr).clear(),k(this,Fc,jx).call(this)}}jc=new WeakMap,S2=new WeakMap,gr=new WeakMap,Fc=new WeakSet,Nx=function(){for(const o of b(this,gr).keys())this.serve(o);k(this,Fc,jx).call(this)},jx=function(){b(this,S2).resolve(),N(this,S2,Vu())};class gxe extends Ip{constructor(n,a,l){super();P(this,zt);P(this,vs);P(this,It);P(this,Cs);V(this,"controls");P(this,n0);P(this,ks);P(this,Vo);P(this,qc,new Y$);P(this,I2,!1);P(this,a0);N(this,vs,n),N(this,It,a),N(this,Cs,l),N(this,Vo,l.$provider),this.controls=new cxe,N(this,n0,new Hke),N(this,ks,new Xg)}onAttach(){this.listen("fullscreen-change",k(this,zt,GU).bind(this))}onConnect(n){const a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=new go(n),s=k(this,zt,FU).bind(this);for(const d of a)d.startsWith("media-")&&l.add(d,s);k(this,zt,NU).call(this),fe(k(this,zt,jU).bind(this)),fe(k(this,zt,qU).bind(this)),fe(k(this,zt,VU).bind(this)),fe(k(this,zt,zU).bind(this)),fe(k(this,zt,UU).bind(this)),fe(k(this,zt,HU).bind(this)),fe(k(this,zt,KU).bind(this))}onDestroy(){try{const n=this.createEvent("destroy"),{pictureInPicture:a,fullscreen:l}=this.$state;l()&&this.exitFullscreen("prefer-media",n),a()&&this.exitPictureInPicture(n)}catch{}b(this,qc).reset()}async play(n){const{canPlay:a,paused:l,autoPlaying:s}=this.$state;if(k(this,zt,Fx).call(this,n)||!Re(l))return;n&&b(this,It).queue.enqueue("media-play-request",n);const d=Re(s);try{const p=Re(b(this,Vo));return Gv(p,Re(a)),yxe(d),await p.play()}catch(p){const h=this.createEvent("play-fail",{detail:zh(p),trigger:n});throw h.autoPlay=d,b(this,vs).handle(h),p}}async pause(n){const{canPlay:a,paused:l}=this.$state;if(!Re(l)){n&&b(this,It).queue.enqueue("media-pause-request",n);try{const s=Re(b(this,Vo));return Gv(s,Re(a)),await s.pause()}catch(s){throw b(this,It).queue.delete("media-pause-request"),s}}}setAudioGain(n,a){const{audioGain:l,canSetAudioGain:s}=this.$state;if(l()===n)return;const d=b(this,Vo).call(this);if(!(d!=null&&d.audioGain)||!s())throw Error("[vidstack] audio gain api not available");a&&b(this,It).queue.enqueue("media-audio-gain-change-request",a),d.audioGain.setGain(n)}seekToLiveEdge(n){const{canPlay:a,live:l,liveEdge:s,canSeek:d,liveSyncPosition:p,seekableEnd:h,userBehindLiveEdge:f}=this.$state;if(f.set(!1),Re(()=>!l()||s()||!d()))return;const g=Re(b(this,Vo));Gv(g,Re(a)),n&&b(this,It).queue.enqueue("media-seek-request",n);const w=h()-2;g.setCurrentTime(Math.min(w,p()??w))}async enterFullscreen(n="prefer-media",a){const l=k(this,zt,qx).call(this,n);if(X$(n,l),!l.active)return Re(this.$state.pictureInPicture)&&(N(this,I2,!0),await this.exitPictureInPicture(a)),a&&b(this,It).queue.enqueue("media-enter-fullscreen-request",a),l.enter()}async exitFullscreen(n="prefer-media",a){const l=k(this,zt,qx).call(this,n);if(X$(n,l),!!l.active){a&&b(this,It).queue.enqueue("media-exit-fullscreen-request",a);try{const s=await l.exit();return b(this,I2)&&Re(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),s}finally{N(this,I2,!1)}}}async enterPictureInPicture(n){if(k(this,zt,Vx).call(this),!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-enter-pip-request",n),await b(this,Vo).call(this).pictureInPicture.enter()}async exitPictureInPicture(n){if(k(this,zt,Vx).call(this),!!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-exit-pip-request",n),await b(this,Vo).call(this).pictureInPicture.exit()}async"media-airplay-request"(n){try{await this.requestAirPlay(n)}catch{}}async requestAirPlay(n){var a;try{const l=(a=b(this,Vo).call(this))==null?void 0:a.airPlay;if(!(l!=null&&l.supported))throw Error("No AirPlay adapter.");return n&&b(this,It).queue.enqueue("media-airplay-request",n),await l.prompt()}catch(l){throw b(this,It).queue.delete("media-airplay-request"),l}}async"media-google-cast-request"(n){try{await this.requestGoogleCast(n)}catch{}}async requestGoogleCast(n){try{const{canGoogleCast:a}=this.$state;if(!Re(a)){const s=Error("Cast not available.");throw s.code="CAST_NOT_AVAILABLE",s}if(as("https://www.gstatic.com"),!b(this,a0)){const s=await Promise.resolve().then(()=>VGe);N(this,a0,new s.GoogleCastLoader)}await b(this,a0).prompt(b(this,Cs)),n&&b(this,It).queue.enqueue("media-google-cast-request",n);const l=Re(this.$state.remotePlaybackState)!=="disconnected";l&&this.$state.savedState.set({paused:Re(this.$state.paused),currentTime:Re(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(l?b(this,a0):null)}catch(a){throw b(this,It).queue.delete("media-google-cast-request"),a}}"media-clip-start-change-request"(n){const{clipStartTime:a}=this.$state;a.set(n.detail)}"media-clip-end-change-request"(n){const{clipEndTime:a}=this.$state;a.set(n.detail),this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-duration-change-request"(n){const{providedDuration:a,clipEndTime:l}=this.$state;a.set(n.detail),l()<=0&&this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-audio-track-change-request"(n){const{logger:a,audioTracks:l}=b(this,Cs);if(l.readonly)return;const s=n.detail,d=l[s];if(d){const p=n.type;b(this,It).queue.enqueue(p,n),d.selected=!0}}async"media-enter-fullscreen-request"(n){try{await this.enterFullscreen(n.detail,n)}catch(a){k(this,zt,zx).call(this,a,n)}}async"media-exit-fullscreen-request"(n){try{await this.exitFullscreen(n.detail,n)}catch(a){k(this,zt,zx).call(this,a,n)}}async"media-orientation-lock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ks).lock(n.detail)}catch{b(this,It).queue.delete(a)}}async"media-orientation-unlock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ks).unlock()}catch{b(this,It).queue.delete(a)}}async"media-enter-pip-request"(n){try{await this.enterPictureInPicture(n)}catch(a){k(this,zt,Ux).call(this,a,n)}}async"media-exit-pip-request"(n){try{await this.exitPictureInPicture(n)}catch(a){k(this,zt,Ux).call(this,a,n)}}"media-live-edge-request"(n){const{live:a,liveEdge:l,canSeek:s}=this.$state;if(!(!a()||l()||!s())){b(this,It).queue.enqueue("media-seek-request",n);try{this.seekToLiveEdge()}catch{b(this,It).queue.delete("media-seek-request")}}}async"media-loop-request"(n){try{b(this,It).looping=!0,b(this,It).replaying=!0,await this.play(n)}catch{b(this,It).looping=!1}}"media-user-loop-change-request"(n){this.$state.userPrefersLoop.set(n.detail)}async"media-pause-request"(n){if(!this.$state.paused())try{await this.pause(n)}catch{}}async"media-play-request"(n){if(this.$state.paused())try{await this.play(n)}catch{}}"media-rate-change-request"(n){const{playbackRate:a,canSetPlaybackRate:l}=this.$state;if(a()===n.detail||!l())return;const s=b(this,Vo).call(this);s!=null&&s.setPlaybackRate&&(b(this,It).queue.enqueue("media-rate-change-request",n),s.setPlaybackRate(n.detail))}"media-audio-gain-change-request"(n){try{this.setAudioGain(n.detail,n)}catch{}}"media-quality-change-request"(n){var p,h;const{qualities:a,storage:l,logger:s}=b(this,Cs);if(a.readonly)return;b(this,It).queue.enqueue("media-quality-change-request",n);const d=n.detail;if(d<0)a.autoSelect(n),n.isOriginTrusted&&((p=l==null?void 0:l.setVideoQuality)==null||p.call(l,null));else{const f=a[d];f&&(f.selected=!0,n.isOriginTrusted&&((h=l==null?void 0:l.setVideoQuality)==null||h.call(l,{id:f.id,width:f.width,height:f.height,bitrate:f.bitrate})))}}"media-pause-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.pause(n)}"media-resume-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.resume(n)}"media-seek-request"(n){const{canSeek:a,ended:l,live:s,seekableEnd:d,userBehindLiveEdge:p}=this.$state,h=n.detail;l()&&(b(this,It).replaying=!0);const f=n.type;b(this,It).seeking=!1,b(this,It).queue.delete(f);const g=K$(h,this.$state);!Number.isFinite(g)||!a()||(b(this,It).queue.enqueue(f,n),b(this,Vo).call(this).setCurrentTime(g),s()&&n.isOriginTrusted&&Math.abs(d()-g)>=2&&p.set(!0))}"media-seeking-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.$state.seeking.set(!0),b(this,It).seeking=!0}"media-start-loading"(n){if(this.$state.canLoad())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,vs).handle(this.createEvent("can-load"))}"media-poster-start-loading"(n){if(this.$state.canLoadPoster())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,vs).handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(n){const{index:a,mode:l}=n.detail,s=b(this,Cs).textTracks[a];if(s){const d=n.type;b(this,It).queue.enqueue(d,n),s.setMode(l,n)}}"media-mute-request"(n){if(this.$state.muted())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,Vo).call(this).setMuted(!0)}"media-unmute-request"(n){const{muted:a,volume:l}=this.$state;if(!a())return;const s=n.type;b(this,It).queue.enqueue(s,n),b(this,Cs).$provider().setMuted(!1),l()===0&&(b(this,It).queue.enqueue(s,n),b(this,Vo).call(this).setVolume(.25))}"media-volume-change-request"(n){const{muted:a,volume:l}=this.$state,s=n.detail;if(l()===s)return;const d=n.type;b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setVolume(s),s>0&&a()&&(b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setMuted(!1))}}vs=new WeakMap,It=new WeakMap,Cs=new WeakMap,n0=new WeakMap,ks=new WeakMap,Vo=new WeakMap,qc=new WeakMap,zt=new WeakSet,NU=function(){const{load:n}=this.$props,{canLoad:a}=this.$state;if(n()!=="play"||a())return;const l=this.listen("media-play-request",s=>{k(this,zt,Fx).call(this,s),l()})},jU=function(){const n=b(this,Vo).call(this),a=this.$state.canPlay();return n&&a&&b(this,qc).start(),()=>{b(this,qc).stop()}},FU=function(n){n.stopPropagation(),!n.defaultPrevented&&this[n.type]&&(Re(b(this,Vo))?this[n.type](n):b(this,qc).enqueue(n.type,()=>{Re(b(this,Vo))&&this[n.type](n)}))},Fx=function(n){const{load:a}=this.$props,{canLoad:l}=this.$state;if(a()==="play"&&!l()){const s=this.createEvent("media-start-loading",{trigger:n});return this.dispatchEvent(s),b(this,qc).enqueue("media-play-request",async()=>{try{await this.play(s)}catch{}}),!0}return!1},I2=new WeakMap,qx=function(n){const a=Re(b(this,Vo));return n==="prefer-media"&&b(this,n0).supported||n==="media"?b(this,n0):a==null?void 0:a.fullscreen},Vx=function(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")},qU=function(){this.controls.defaultDelay=this.$props.controlsDelay()},VU=function(){var l,s;const{canSetAudioGain:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.audioGain)!=null&&s.supported);n.set(a)},zU=function(){var l,s;const{canAirPlay:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.airPlay)!=null&&s.supported);n.set(a)},UU=function(){const{canGoogleCast:n,source:a}=this.$state,l=Hg&&!Ug&&B$(a());n.set(l)},HU=function(){var l,s;const{canFullscreen:n}=this.$state,a=b(this,n0).supported||!!((s=(l=b(this,Vo).call(this))==null?void 0:l.fullscreen)!=null&&s.supported);n.set(a)},KU=function(){var l,s;const{canPictureInPicture:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.pictureInPicture)!=null&&s.supported);n.set(a)},a0=new WeakMap,GU=async function(n){const a=Re(this.$props.fullscreenOrientation),l=n.detail;if(!(an(a)||a==="none"||!b(this,ks).supported))if(l){if(b(this,ks).locked)return;this.dispatch("media-orientation-lock-request",{detail:a,trigger:n})}else b(this,ks).locked&&this.dispatch("media-orientation-unlock-request",{trigger:n})},zx=function(n,a){b(this,vs).handle(this.createEvent("fullscreen-error",{detail:zh(n)}))},Ux=function(n,a){b(this,vs).handle(this.createEvent("picture-in-picture-error",{detail:zh(n)}))},lWe=function(n,a,l){};function Gv(i,o){if(!(i&&o))throw Error("[vidstack] media not ready")}function X$(i,o){if(!(o!=null&&o.supported))throw Error("[vidstack] no fullscreen support")}function yxe(i){if(!(!Uke()||!i))throw Error("[vidstack] autoplay blocked")}class wxe{constructor(){V(this,"seeking",!1);V(this,"looping",!1);V(this,"replaying",!1);V(this,"queue",new bxe)}}const vxe=new Set(["auto-play","auto-play-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]);class Cxe extends Ip{constructor(n,a){super();P(this,Oe);P(this,$n);P(this,eo);P(this,Oo,new Map);P(this,r0,!1);P(this,E2,[]);P(this,l0,[-1,-1]);P(this,s0,!1);P(this,xs);P(this,Vc,!1);P(this,T2,null);V(this,"seeking",vp(n=>{const{seeking:a,realCurrentTime:l,paused:s}=this.$state;a.set(!0),l.set(n.detail),k(this,Oe,ii).call(this,"media-seeking-request",n),s()&&(N(this,xs,n),b(this,A2).call(this)),N(this,l0,[-1,-1])},150,{leading:!0}));P(this,A2,Av(()=>{if(!b(this,xs))return;N(this,s0,!0);const{waiting:n,playing:a}=this.$state;n.set(!0),a.set(!1);const l=this.createEvent("waiting",{trigger:b(this,xs)});b(this,Oo).set("waiting",l),this.dispatch(l),N(this,xs,void 0),N(this,s0,!1)},300));N(this,$n,n),N(this,eo,a)}onAttach(n){n.setAttribute("aria-busy","true"),new go(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this))}onConnect(n){fe(k(this,Oe,iH).bind(this)),k(this,Oe,YU).call(this),k(this,Oe,XU).call(this),k(this,Oe,QU).call(this),k(this,Oe,WU).call(this),At(k(this,Oe,ZU).bind(this))}onDestroy(){const{audioTracks:n,qualities:a,textTracks:l}=b(this,eo);n[mt.reset](),a[mt.reset](),l[mt.reset](),k(this,Oe,q5).call(this)}handle(n){if(!this.scope)return;const a=n.type;ju(()=>{var l;return(l=this[n.type])==null?void 0:l.call(this,n)}),vxe.has(a)&&b(this,Oo).set(a,n),this.dispatch(n)}"provider-change"(n){var s,d;const a=b(this,eo).$provider(),l=n.detail;(a==null?void 0:a.type)!==(l==null?void 0:l.type)&&((s=a==null?void 0:a.destroy)==null||s.call(a),(d=a==null?void 0:a.scope)==null||d.dispose(),b(this,eo).$provider.set(n.detail),a&&n.detail===null&&k(this,Oe,Zx).call(this,n))}"provider-loader-change"(n){}"auto-play"(n){this.$state.autoPlayError.set(null)}"auto-play-fail"(n){this.$state.autoPlayError.set(n.detail),k(this,Oe,Rd).call(this)}"can-load"(n){this.$state.canLoad.set(!0),b(this,Oo).set("can-load",n),b(this,eo).textTracks[kt.canLoad](),k(this,Oe,ii).call(this,"media-start-loading",n)}"can-load-poster"(n){this.$state.canLoadPoster.set(!0),b(this,Oo).set("can-load-poster",n),k(this,Oe,ii).call(this,"media-poster-start-loading",n)}"media-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=this.$state.viewType();this.$state.mediaType.set(n.detail);const s=this.$state.providedViewType(),d=s==="unknown"?n.detail:s;l!==d&&setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(n.detail),this.dispatch("view-type-change",{detail:d,trigger:n}))})},0)}"stream-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const{streamType:l,inferredStreamType:s}=this.$state;s.set(n.detail),n.detail=l()}"rate-change"(n){var s;const{storage:a}=b(this,eo),{canPlay:l}=this.$state;this.$state.playbackRate.set(n.detail),k(this,Oe,ii).call(this,"media-rate-change-request",n),l()&&((s=a==null?void 0:a.setPlaybackRate)==null||s.call(a,n.detail))}"remote-playback-change"(n){const{remotePlaybackState:a,remotePlaybackType:l}=this.$state,{type:s,state:d}=n.detail,p=d==="connected";l.set(s),a.set(d);const h=s==="airplay"?"media-airplay-request":"media-google-cast-request";if(p)k(this,Oe,ii).call(this,h,n);else{const f=b(this,$n).queue.peek(h);f&&(n.request=f,n.triggers.add(f))}}"sources-change"(n){const a=this.$state.sources(),l=n.detail;this.$state.sources.set(l),k(this,Oe,nH).call(this,a,l,n)}"source-change"(n){var l,s;n.isQualityChange=((l=n.originEvent)==null?void 0:l.type)==="quality-change";const a=n.detail;k(this,Oe,Zx).call(this,n,n.isQualityChange),b(this,Oo).set(n.type,n),this.$state.source.set(a),(s=this.el)==null||s.setAttribute("aria-busy","true")}abort(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=b(this,Oo).get("can-load");l&&!n.triggers.hasType("can-load")&&n.triggers.add(l)}"load-start"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a)}error(n){this.$state.error.set(n.detail);const a=b(this,Oo).get("abort");a&&n.triggers.add(a)}"loaded-metadata"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"loaded-data"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"can-play"(n){var l;const a=b(this,Oo).get("loaded-metadata");a&&n.triggers.add(a),k(this,Oe,Yx).call(this,n.detail),(l=this.el)==null||l.setAttribute("aria-busy","false")}"can-play-through"(n){k(this,Oe,Yx).call(this,n.detail);const a=b(this,Oo).get("can-play");a&&n.triggers.add(a)}"duration-change"(n){const{live:a,intrinsicDuration:l,providedDuration:s,clipEndTime:d,ended:p}=this.$state,h=n.detail;if(!a()){const f=Number.isNaN(h)?0:h;l.set(f),p()&&k(this,Oe,Qx).call(this,n)}(s()>0||d()>0)&&n.stopImmediatePropagation()}progress(n){const{buffered:a,seekable:l}=this.$state,{buffered:s,seekable:d}=n.detail,p=xp(s),h=s.length!==a().length,f=p!==xp(a()),g=xp(d),w=d.length!==l().length,v=g!==xp(l());(h||f)&&a.set(s),(w||v)&&l.set(d)}play(n){const{paused:a,autoPlayError:l,ended:s,autoPlaying:d,playsInline:p,pointer:h,muted:f,viewType:g,live:w,userBehindLiveEdge:v}=this.$state;if(k(this,Oe,Xx).call(this),!a()){n.stopImmediatePropagation();return}n.autoPlay=d();const C=b(this,Oo).get("waiting");C&&n.triggers.add(C),k(this,Oe,ii).call(this,"media-play-request",n),b(this,Oo).set("play",n),a.set(!1),l.set(null),n.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:f()},trigger:n})),d.set(!1)),(s()||b(this,$n).replaying)&&(b(this,$n).replaying=!1,s.set(!1),this.handle(this.createEvent("replay",{trigger:n}))),!p()&&g()==="video"&&h()==="coarse"&&b(this,eo).remote.enterFullscreen("prefer-media",n),w()&&!v()&&b(this,eo).remote.seekToLiveEdge(n)}"play-fail"(n){const{muted:a,autoPlaying:l}=this.$state,s=b(this,Oo).get("play");s&&n.triggers.add(s),k(this,Oe,ii).call(this,"media-play-request",n);const{paused:d,playing:p}=this.$state;d.set(!0),p.set(!1),k(this,Oe,Rd).call(this),b(this,Oo).set("play-fail",n),n.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:a(),error:n.detail},trigger:n})),l.set(!1))}playing(n){const a=b(this,Oo).get("play"),l=b(this,Oo).get("seeked");a?n.triggers.add(a):l&&n.triggers.add(l),setTimeout(()=>k(this,Oe,Rd).call(this),0);const{paused:s,playing:d,live:p,liveSyncPosition:h,seekableEnd:f,started:g,currentTime:w,seeking:v,ended:C}=this.$state;if(s.set(!1),d.set(!0),v.set(!1),C.set(!1),b(this,$n).looping){b(this,$n).looping=!1;return}if(p()&&!g()&&w()===0){const E=h()??f()-2;Number.isFinite(E)&&b(this,eo).$provider().setCurrentTime(E)}this.started(n)}started(n){const{started:a}=this.$state;a()||(a.set(!0),this.handle(this.createEvent("started",{trigger:n})))}pause(n){var d;(d=this.el)!=null&&d.isConnected||N(this,Vc,!0),k(this,Oe,ii).call(this,"media-pause-request",n);const a=b(this,Oo).get("seeked");a&&n.triggers.add(a);const{paused:l,playing:s}=this.$state;l.set(!0),s.set(!1),b(this,r0)&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:n})),N(this,r0,!1)},0),k(this,Oe,Rd).call(this)}"time-change"(n){if(b(this,$n).looping){n.stopImmediatePropagation();return}let{waiting:a,played:l,clipEndTime:s,realCurrentTime:d,currentTime:p}=this.$state,h=n.detail,f=s();d.set(h),k(this,Oe,aH).call(this),a.set(!1);for(const g of b(this,eo).textTracks)g[kt.updateActiveCues](h,n);f>0&&h>=f&&(N(this,r0,!0),this.dispatch("media-pause-request",{trigger:n})),k(this,Oe,rH).call(this),this.dispatch("time-update",{detail:{currentTime:p(),played:l()},trigger:n})}"audio-gain-change"(n){var d;const{storage:a}=b(this,eo),{canPlay:l,audioGain:s}=this.$state;s.set(n.detail),k(this,Oe,ii).call(this,"media-audio-gain-change-request",n),l()&&((d=a==null?void 0:a.setAudioGain)==null||d.call(a,s()))}"volume-change"(n){var h,f;const{storage:a}=b(this,eo),{volume:l,muted:s,canPlay:d}=this.$state,p=n.detail;l.set(p.volume),s.set(p.muted||p.volume===0),k(this,Oe,ii).call(this,"media-volume-change-request",n),k(this,Oe,ii).call(this,p.muted?"media-mute-request":"media-unmute-request",n),d()&&((h=a==null?void 0:a.setVolume)==null||h.call(a,l()),(f=a==null?void 0:a.setMuted)==null||f.call(a,s()))}seeked(n){const{seeking:a,currentTime:l,realCurrentTime:s,paused:d,seekableEnd:p,ended:h,live:f}=this.$state;if(b(this,$n).seeking)a.set(!0),n.stopImmediatePropagation();else if(a()){const g=b(this,Oo).get("waiting");g&&n.triggers.add(g);const w=b(this,Oo).get("seeking");w&&!n.triggers.has(w)&&n.triggers.add(w),d()&&k(this,Oe,Jx).call(this),a.set(!1),s.set(n.detail),k(this,Oe,ii).call(this,"media-seek-request",n);const v=n==null?void 0:n.originEvent;v!=null&&v.isTrusted&&!(v instanceof MessageEvent)&&!/seek/.test(v.type)&&this.started(n)}f()||(Math.floor(l())!==Math.floor(p())?h.set(!1):this.end(n))}waiting(n){b(this,s0)||b(this,$n).seeking||(n.stopImmediatePropagation(),N(this,xs,n),b(this,A2).call(this))}end(n){const{loop:a,ended:l}=this.$state;if(!(!a()&&l())){if(a()){setTimeout(()=>{requestAnimationFrame(()=>{k(this,Oe,Xx).call(this,n),this.dispatch("media-loop-request",{trigger:n})})},10);return}setTimeout(()=>k(this,Oe,lH).call(this,n),0)}}"fullscreen-change"(n){const a=n.detail;this.$state.fullscreen.set(a),k(this,Oe,ii).call(this,a?"media-enter-fullscreen-request":"media-exit-fullscreen-request",n)}"fullscreen-error"(n){k(this,Oe,ii).call(this,"media-enter-fullscreen-request",n),k(this,Oe,ii).call(this,"media-exit-fullscreen-request",n)}"orientation-change"(n){const a=n.detail.lock;k(this,Oe,ii).call(this,a?"media-orientation-lock-request":"media-orientation-unlock-request",n)}"picture-in-picture-change"(n){const a=n.detail;this.$state.pictureInPicture.set(a),k(this,Oe,ii).call(this,a?"media-enter-pip-request":"media-exit-pip-request",n)}"picture-in-picture-error"(n){k(this,Oe,ii).call(this,"media-enter-pip-request",n),k(this,Oe,ii).call(this,"media-exit-pip-request",n)}"title-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredTitle.set(n.detail))}"poster-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredPoster.set(n.detail))}}$n=new WeakMap,eo=new WeakMap,Oo=new WeakMap,r0=new WeakMap,E2=new WeakMap,l0=new WeakMap,s0=new WeakMap,xs=new WeakMap,Vc=new WeakMap,Oe=new WeakSet,WU=function(){b(this,Vc)&&(requestAnimationFrame(()=>{this.scope&&b(this,eo).remote.play(new Ot("dom-connect"))}),N(this,Vc,!1))},ZU=function(){var n;b(this,Vc)||(N(this,Vc,!this.$state.paused()),(n=b(this,eo).$provider())==null||n.pause())},Rd=function(){k(this,Oe,Jx).call(this),N(this,r0,!1),b(this,$n).replaying=!1,b(this,$n).looping=!1,N(this,s0,!1),N(this,xs,void 0),b(this,Oo).clear()},ii=function(n,a){const l=b(this,$n).queue.serve(n);l&&(a.request=l,a.triggers.add(l))},YU=function(){k(this,Oe,F5).call(this),k(this,Oe,Hx).call(this);const n=b(this,eo).textTracks;new go(n).add("add",k(this,Oe,F5).bind(this)).add("remove",k(this,Oe,F5).bind(this)).add("mode-change",k(this,Oe,Hx).bind(this))},XU=function(){const n=b(this,eo).qualities;new go(n).add("add",k(this,Oe,Gx).bind(this)).add("remove",k(this,Oe,Gx).bind(this)).add("change",k(this,Oe,eH).bind(this)).add("auto-change",k(this,Oe,tH).bind(this)).add("readonly-change",k(this,Oe,oH).bind(this))},QU=function(){const n=b(this,eo).audioTracks;new go(n).add("add",k(this,Oe,Kx).bind(this)).add("remove",k(this,Oe,Kx).bind(this)).add("change",k(this,Oe,JU).bind(this))},F5=function(n){const{textTracks:a}=this.$state;a.set(b(this,eo).textTracks.toArray()),this.dispatch("text-tracks-change",{detail:a(),trigger:n})},Hx=function(n){n&&k(this,Oe,ii).call(this,"media-text-track-change-request",n);const a=b(this,eo).textTracks.selected,{textTrack:l}=this.$state;l()!==a&&(l.set(a),this.dispatch("text-track-change",{detail:a,trigger:n}))},Kx=function(n){const{audioTracks:a}=this.$state;a.set(b(this,eo).audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:a(),trigger:n})},JU=function(n){const{audioTrack:a}=this.$state;a.set(b(this,eo).audioTracks.selected),n&&k(this,Oe,ii).call(this,"media-audio-track-change-request",n),this.dispatch("audio-track-change",{detail:a(),trigger:n})},Gx=function(n){const{qualities:a}=this.$state;a.set(b(this,eo).qualities.toArray()),this.dispatch("qualities-change",{detail:a(),trigger:n})},eH=function(n){const{quality:a}=this.$state;a.set(b(this,eo).qualities.selected),n&&k(this,Oe,ii).call(this,"media-quality-change-request",n),this.dispatch("quality-change",{detail:a(),trigger:n})},tH=function(){const{qualities:n}=b(this,eo),a=n.auto;this.$state.autoQuality.set(a),a||k(this,Oe,q5).call(this)},T2=new WeakMap,Wx=function(){k(this,Oe,q5).call(this),N(this,T2,fe(()=>{const{qualities:n}=b(this,eo),{mediaWidth:a,mediaHeight:l}=this.$state,s=a(),d=l();if(s===0||d===0)return;let p=null,h=1/0;for(const f of n){const g=Math.abs(f.width-s)+Math.abs(f.height-d);g<h&&(h=g,p=f)}p&&n[mt.select](p,!0,new Ot("resize",{detail:{width:s,height:d}}))}))},q5=function(){var n;(n=b(this,T2))==null||n.call(this),N(this,T2,null)},oH=function(){this.$state.canSetQuality.set(!b(this,eo).qualities.readonly)},iH=function(){const{canSetVolume:n,isGoogleCastConnected:a}=this.$state;if(a()){n.set(!1);return}nke().then(n.set)},nH=function(n,a,l){let{qualities:s}=b(this,eo),d=!1,p=!1;for(const h of n){if(!Vv(h))continue;if(!a.some(g=>g.src===h.src)){const g=s.getBySrc(h.src);g&&(s[mt.remove](g,l),p=!0)}}p&&!s.length&&(this.$state.savedState.set(null),s[mt.reset](l));for(const h of a){if(!Vv(h)||s.getBySrc(h.src))continue;const f={id:h.id??h.height+"p",bitrate:null,codec:null,...h,selected:!1};s[mt.add](f,l),d=!0}d&&!s[ln.enableAuto]&&(k(this,Oe,Wx).call(this),s[ln.enableAuto]=k(this,Oe,Wx).bind(this),s[ln.setAuto](!0,l))},Zx=function(n,a=!1){const{audioTracks:l,qualities:s}=b(this,eo);if(!a){N(this,E2,[]),N(this,l0,[-1,-1]),l[mt.reset](n),s[mt.reset](n),H$(this.$state,a),k(this,Oe,Rd).call(this);return}H$(this.$state,a),k(this,Oe,Rd).call(this)},Yx=function(n){const{seekable:a,buffered:l,intrinsicDuration:s,canPlay:d}=this.$state;d.set(!0),l.set(n.buffered),a.set(n.seekable);const p=xp(n.seekable)??1/0;s.set(p)},Xx=function(n){if(!Re(b(this,eo).$provider))return;const{ended:l,seekableStart:s,clipEndTime:d,currentTime:p,realCurrentTime:h,duration:f}=this.$state,g=l()||h()<s()||d()>0&&h()>=d()||Math.abs(p()-f())<.1;return g&&this.dispatch("media-seek-request",{detail:s(),trigger:n}),g},aH=function(){const{currentTime:n,played:a,paused:l}=this.$state;l()||(N(this,l0,gke(b(this,E2),b(this,l0),n())),a.set(new Ti(b(this,E2))))},Qx=function(n){const{clipStartTime:a,clipEndTime:l,duration:s}=this.$state;a()>0||l()>0||this.handle(this.createEvent("time-change",{detail:s(),trigger:n}))},rH=function(){var s;const{storage:n}=b(this,eo),{canPlay:a,realCurrentTime:l}=this.$state;a()&&((s=n==null?void 0:n.setTime)==null||s.call(n,l()))},A2=new WeakMap,lH=function(n){var h;const{storage:a}=b(this,eo),{paused:l,seeking:s,ended:d,duration:p}=this.$state;k(this,Oe,Qx).call(this,n),l()||this.dispatch("pause",{trigger:n}),s()&&this.dispatch("seeked",{detail:p(),trigger:n}),d.set(!0),k(this,Oe,Rd).call(this),(h=a==null?void 0:a.setTime)==null||h.call(a,p(),!0),this.dispatch("ended",{trigger:n})},Jx=function(){b(this,A2).cancel(),this.$state.waiting.set(!1)};class kxe extends Ip{constructor(){super(...arguments);P(this,Zt)}onSetup(){k(this,Zt,sH).call(this);const n=[k(this,Zt,dH),k(this,Zt,uH),k(this,Zt,wH),k(this,Zt,vH),k(this,Zt,fH),k(this,Zt,bH),k(this,Zt,gH),k(this,Zt,CH),k(this,Zt,xH),k(this,Zt,kH),k(this,Zt,hH),k(this,Zt,yH),k(this,Zt,mH),k(this,Zt,cH),k(this,Zt,pH)];for(const a of n)fe(a.bind(this))}}Zt=new WeakSet,sH=function(){var l;const n={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},a=new Set(["currentTime","paused","playbackRate","volume"]);for(const s of Object.keys(this.$props))a.has(s)||(l=this.$state[n[s]??s])==null||l.set(this.$props[s]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)},cH=function(){const{viewType:n,streamType:a,title:l,poster:s,loop:d}=this.$props,p=this.$state;p.providedPoster.set(s()),p.providedStreamType.set(a()),p.providedViewType.set(n()),p.providedTitle.set(l()),p.providedLoop.set(d())},sWe=function(){},dH=function(){const{artist:n,artwork:a}=this.$props;this.$state.artist.set(n()),this.$state.artwork.set(a())},pH=function(){const{title:n}=this.$state;this.dispatch("title-change",{detail:n()})},uH=function(){const n=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(n),this.dispatch("auto-play-change",{detail:n})},hH=function(){const n=this.$state.loop();this.dispatch("loop-change",{detail:n})},fH=function(){const n=this.$props.controls();this.$state.controls.set(n)},mH=function(){const{poster:n}=this.$state;this.dispatch("poster-change",{detail:n()})},bH=function(){const n=this.$props.crossOrigin()??this.$props.crossorigin(),a=n===!0?"":n;this.$state.crossOrigin.set(a)},gH=function(){const{duration:n}=this.$props;this.dispatch("media-duration-change-request",{detail:n()})},yH=function(){const n=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(n),this.dispatch("plays-inline-change",{detail:n})},wH=function(){const{clipStartTime:n}=this.$props;this.dispatch("media-clip-start-change-request",{detail:n()})},vH=function(){const{clipEndTime:n}=this.$props;this.dispatch("media-clip-end-change-request",{detail:n()})},CH=function(){this.dispatch("live-change",{detail:this.$state.live()})},kH=function(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())},xH=function(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})};const Q$=["play","pause","seekforward","seekbackward","seekto"];class xxe extends Ip{constructor(){super(...arguments);P(this,fl)}onConnect(){fe(k(this,fl,IH).bind(this)),fe(k(this,fl,EH).bind(this));const n=k(this,fl,TH).bind(this);for(const a of Q$)navigator.mediaSession.setActionHandler(a,n);At(k(this,fl,SH).bind(this))}}fl=new WeakSet,SH=function(){for(const n of Q$)navigator.mediaSession.setActionHandler(n,null)},IH=function(){const{title:n,artist:a,artwork:l,poster:s}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:n(),artist:a(),artwork:l()??[{src:s()}]})},EH=function(){const{canPlay:n,paused:a}=this.$state;navigator.mediaSession.playbackState=n()?a()?"paused":"playing":"none"},TH=function(n){const a=new Ot("media-session-action",{detail:n});switch(n.action){case"play":this.dispatch("media-play-request",{trigger:a});break;case"pause":this.dispatch("media-pause-request",{trigger:a});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Li(n.seekTime)?n.seekTime:this.$state.currentTime()+(n.seekOffset??(n.action==="seekforward"?10:-10)),trigger:a});break}};const d0=class d0 extends dt{constructor(){super();P(this,Ke);P(this,pn);P(this,c0);P(this,un);V(this,"canPlayQueue",new Y$);V(this,"remoteControl");P(this,_2,!1);V(this,"orientation");new kxe;const n={player:this,qualities:new Jke,audioTracks:new Zke,storage:null,$provider:ct(null),$providerSetup:ct(!1),$props:this.$props,$state:this.$state};n.remote=this.remoteControl=new Gke(void 0),n.remote.setPlayer(this),n.textTracks=new Qke,n.textTracks[kt.crossOrigin]=this.$state.crossOrigin,n.textRenderers=new Xke(n),n.ariaKeys={},N(this,pn,n),ba(k$,n),this.orientation=new Xg,new dr,new axe(n);const a=new wxe;N(this,c0,new Cxe(a,n)),N(this,un,new gxe(b(this,c0),a,n)),n.delegate=new mxe(b(this,c0).handle.bind(b(this,c0)),n),n.notify=n.delegate.notify.bind(n.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new xxe,new Z$("load",this.startLoading.bind(this)),new Z$("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){k(this,Ke,OH).call(this),fe(k(this,Ke,DH).bind(this)),fe(k(this,Ke,LH).bind(this)),fe(k(this,Ke,BH).bind(this)),fe(k(this,Ke,$H).bind(this)),fe(k(this,Ke,PH).bind(this)),fe(k(this,Ke,NH).bind(this)),fe(k(this,Ke,MH).bind(this))}onAttach(n){n.setAttribute("data-media-player",""),bo(n,"tabindex","0"),bo(n,"role","region"),fe(k(this,Ke,FH).bind(this)),fe(k(this,Ke,AH).bind(this)),fe(k(this,Ke,_H).bind(this)),po(n,"find-media-player",k(this,Ke,RH).bind(this))}onConnect(n){x$&&We(n,"data-iphone","");const a=window.matchMedia("(pointer: coarse)");k(this,Ke,eS).call(this,a),a.onchange=k(this,Ke,eS).bind(this);const l=new ResizeObserver(zu(k(this,Ke,M3).bind(this)));l.observe(n),fe(k(this,Ke,M3).bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),At(()=>{l.disconnect(),a.onchange=null})}onDestroy(){b(this,pn).player=null,this.canPlayQueue.reset()}get provider(){return b(this,Ke,_a)}get controls(){return b(this,un).controls}set controls(n){b(this,Ke,V5).controls.set(n)}get title(){return Re(this.$state.title)}set title(n){if(b(this,_2)){N(this,_2,!1);return}b(this,Ke,V5).title.set(n)}get qualities(){return b(this,pn).qualities}get audioTracks(){return b(this,pn).audioTracks}get textTracks(){return b(this,pn).textTracks}get textRenderers(){return b(this,pn).textRenderers}get duration(){return this.$state.duration()}set duration(n){b(this,Ke,V5).duration.set(n)}get paused(){return Re(this.$state.paused)}set paused(n){k(this,Ke,tS).call(this,n)}get muted(){return Re(this.$state.muted)}set muted(n){k(this,Ke,oS).call(this,n)}get currentTime(){return Re(this.$state.currentTime)}set currentTime(n){k(this,Ke,iS).call(this,n)}get volume(){return Re(this.$state.volume)}set volume(n){k(this,Ke,nS).call(this,n)}get playbackRate(){return Re(this.$state.playbackRate)}set playbackRate(n){k(this,Ke,aS).call(this,n)}async play(n){return b(this,un).play(n)}async pause(n){return b(this,un).pause(n)}async enterFullscreen(n,a){return b(this,un).enterFullscreen(n,a)}async exitFullscreen(n,a){return b(this,un).exitFullscreen(n,a)}enterPictureInPicture(n){return b(this,un).enterPictureInPicture(n)}exitPictureInPicture(n){return b(this,un).exitPictureInPicture(n)}seekToLiveEdge(n){b(this,un).seekToLiveEdge(n)}startLoading(n){b(this,pn).notify("can-load",void 0,n)}startLoadingPoster(n){b(this,pn).notify("can-load-poster",void 0,n)}requestAirPlay(n){return b(this,un).requestAirPlay(n)}requestGoogleCast(n){return b(this,un).requestGoogleCast(n)}setAudioGain(n,a){return b(this,un).setAudioGain(n,a)}destroy(){super.destroy(),b(this,pn).remote.setPlayer(null),this.dispatch("destroy")}};pn=new WeakMap,c0=new WeakMap,un=new WeakMap,Ke=new WeakSet,_a=function(){return b(this,pn).$provider()},V5=function(){return this.$props},_2=new WeakMap,AH=function(){const n=this.$el,{title:a,live:l,viewType:s,providedTitle:d}=this.$state,p=l(),h=MCe(s()),f=h!=="Unknown"?`${p?"Live ":""}${h}`:p?"Live":"Media",g=a();We(this.el,"aria-label",`${f} Player`+(g?` - ${g}`:"")),n!=null&&n.hasAttribute("title")&&(N(this,_2,!0),n==null||n.removeAttribute("title"))},_H=function(){const n=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(n),We(this.el,"data-orientation",n),k(this,Ke,M3).call(this)},DH=function(){this.$state.canPlay()&&b(this,Ke,_a)?this.canPlayQueue.start():this.canPlayQueue.stop()},OH=function(){if(d0[Kv]){this.setAttributes(d0[Kv]);return}const n={"data-load":function(){return this.$props.load()},"data-captions":function(){const l=this.$state.textTrack();return!!l&&xn(l)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){const{canLoad:l,canPlay:s,waiting:d}=this.$state;return l()&&(!s()||d())},"data-error":function(){const{error:l}=this.$state;return!!l()},"data-autoplay-error":function(){const{autoPlayError:l}=this.$state;return!!l()}},a={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(const l of hxe){const s="data-"+(a[l]??Fg(l));n[s]=function(){return this.$state[l]()}}delete n.title,d0[Kv]=n,this.setAttributes(n)},RH=function(n){n.detail(this)},M3=function(){if(!this.el)return;const n=this.el.clientWidth,a=this.el.clientHeight;this.$state.width.set(n),this.$state.height.set(a),Zn(this.el,"--player-width",n+"px"),Zn(this.el,"--player-height",a+"px")},eS=function(n){const a=n.matches?"coarse":"fine";We(this.el,"data-pointer",a),this.$state.pointer.set(a),k(this,Ke,M3).call(this)},BH=function(){k(this,Ke,tS).call(this,this.$props.paused())},tS=function(n){n?this.canPlayQueue.enqueue("paused",()=>b(this,un).pause()):this.canPlayQueue.enqueue("paused",()=>b(this,un).play())},LH=function(){k(this,Ke,oS).call(this,this.$props.muted())},oS=function(n){this.canPlayQueue.enqueue("muted",()=>{b(this,Ke,_a)&&b(this,Ke,_a).setMuted(n)})},PH=function(){k(this,Ke,iS).call(this,this.$props.currentTime())},iS=function(n){this.canPlayQueue.enqueue("currentTime",()=>{const{currentTime:a}=this.$state;n!==Re(a)&&Re(()=>{if(!b(this,Ke,_a))return;const l=K$(n,this.$state);Number.isFinite(l)&&b(this,Ke,_a).setCurrentTime(l)})})},$H=function(){k(this,Ke,nS).call(this,this.$props.volume())},nS=function(n){const a=jv(0,n,1);this.canPlayQueue.enqueue("volume",()=>{b(this,Ke,_a)&&b(this,Ke,_a).setVolume(a)})},MH=function(){k(this,Ke,aS).call(this,this.$props.playbackRate())},aS=function(n){this.canPlayQueue.enqueue("rate",()=>{var a,l;b(this,Ke,_a)&&((l=(a=b(this,Ke,_a)).setPlaybackRate)==null||l.call(a,n))})},NH=function(){k(this,Ke,jH).call(this,this.$props.playsInline())},jH=function(n){this.canPlayQueue.enqueue("playsinline",()=>{var a,l;b(this,Ke,_a)&&((l=(a=b(this,Ke,_a)).setPlaysInline)==null||l.call(a,n))})},FH=function(){var l;let n=this.$props.storage(),a=et(n)?new Wke:n;if(a!=null&&a.onChange){const{source:s}=this.$state,d=et(n)?n:(l=this.el)==null?void 0:l.id,p=cr(k(this,Ke,qH).bind(this));fe(()=>a.onChange(s(),p(),d||void 0))}b(this,pn).storage=a,b(this,pn).textTracks.setStorage(a),At(()=>{var s;(s=a==null?void 0:a.onDestroy)==null||s.call(a),b(this,pn).storage=null,b(this,pn).textTracks.setStorage(null)})},qH=function(){const{clipStartTime:n,clipEndTime:a}=this.$props,{source:l}=this.$state,s=l();return s.src?`${s.src}:${n()}:${a()}`:null},V(d0,"props",fxe),V(d0,"state",z$);let Qg=d0;const Ao=Qg.prototype;$t(Ao,"canPlayQueue"),$t(Ao,"remoteControl"),$t(Ao,"provider"),$t(Ao,"controls"),$t(Ao,"orientation"),$t(Ao,"title"),$t(Ao,"qualities"),$t(Ao,"audioTracks"),$t(Ao,"textTracks"),$t(Ao,"textRenderers"),$t(Ao,"duration"),$t(Ao,"paused"),$t(Ao,"muted"),$t(Ao,"currentTime"),$t(Ao,"volume"),$t(Ao,"playbackRate"),ti(Ao,"play"),ti(Ao,"pause"),ti(Ao,"enterFullscreen"),ti(Ao,"exitFullscreen"),ti(Ao,"enterPictureInPicture"),ti(Ao,"exitPictureInPicture"),ti(Ao,"seekToLiveEdge"),ti(Ao,"startLoading"),ti(Ao,"startLoadingPoster"),ti(Ao,"requestAirPlay"),ti(Ao,"requestGoogleCast"),ti(Ao,"setAudioGain");function Sxe(i,o){return fetch(i,o).then(n=>n.text()).then(n=>/type="static"/.test(n)?"on-demand":"live")}function J$(i,o){return fetch(i,o).then(n=>n.text()).then(n=>{const a=Ixe(n);if(a)return J$(/^https?:/.test(a)?a:new URL(a,i).href,o);const l=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(n)?"on-demand":"live";return l==="live"&&Exe(n)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(n)||n.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":l})}function Ixe(i){const o=i.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return o?o[0].split(`
3153
3153
  `)[1].trim():null}function Exe(i){const o=i.split(`
3154
3154
  `);for(const n of o)if(n.startsWith("#EXT-X-TARGETDURATION")){const a=parseFloat(n.split(":")[1]);if(!isNaN(a))return a}return-1}const Wv=new Map;class Txe{constructor(o,n,a,l=[]){P(this,Si);P(this,D2,!1);P(this,O2);P(this,Om);P(this,to);P(this,Ss);N(this,Om,o),N(this,to,n),N(this,Ss,a);const s=new Hv,d=new Uv,p=new zv,h=new dxe,f=new uxe,g=new pxe,w=[f,g];N(this,O2,cr(()=>{const C=n.$state.remotePlaybackLoader(),E=n.$props.preferNativeHLS()?[p,h,s,d,...w,...l]:[d,p,h,s,...w,...l];return C?[C,...E]:E}));const{$state:v}=n;v.sources.set(eM(n.$props.src()));for(const C of v.sources()){const E=b(this,O2).call(this).find(A=>A.canPlay(C));if(!E)continue;const T=E.mediaType(C);n.$state.source.set(C),n.$state.mediaType.set(T),n.$state.inferredViewType.set(T),b(this,Ss).set(E),N(this,D2,!0);break}}connect(){const o=b(this,Ss).call(this);b(this,D2)&&(k(this,Si,lS).call(this,b(this,to).$state.source(),o),k(this,Si,sS).call(this,o),N(this,D2,!1)),fe(k(this,Si,VH).bind(this)),fe(k(this,Si,zH).bind(this)),fe(k(this,Si,UH).bind(this)),fe(k(this,Si,HH).bind(this)),fe(k(this,Si,KH).bind(this))}}D2=new WeakMap,O2=new WeakMap,Om=new WeakMap,to=new WeakMap,Ss=new WeakMap,Si=new WeakSet,VH=function(){b(this,to).notify("sources-change",[...eM(b(this,to).$props.src()),...b(this,Om).call(this)])},zH=function(){var d;const{$state:o}=b(this,to),n=o.sources(),a=Re(o.source),l=k(this,Si,rS).call(this,a,n);if(((d=n[0])==null?void 0:d.src)&&!l.src&&!l.type){const{crossOrigin:p}=o,h=Vh(p()),f=new AbortController;return Promise.all(n.map(g=>et(g.src)&&g.type==="?"?fetch(g.src,{method:"HEAD",credentials:h,signal:f.signal}).then(w=>(g.type=w.headers.get("content-type")||"??",Wv.set(g.src,g.type),g)).catch(()=>g):g)).then(g=>{if(f.signal.aborted)return;const w=k(this,Si,rS).call(this,Re(o.source),g);is(),w.src||b(this,to).notify("error",{message:"Failed to load resource.",code:4})}),()=>f.abort()}is()},rS=function(o,n){let a={src:"",type:""},l=null,s=new Ot("sources-change",{detail:{sources:n}}),d=b(this,O2).call(this),{started:p,paused:h,currentTime:f,quality:g,savedState:w}=b(this,to).$state;for(const v of n){const C=d.find(E=>E.canPlay(v));if(C){a=v,l=C;break}}if(Vv(a)){const v=g(),C=n.find(E=>E.src===(v==null?void 0:v.src));Re(p)?w.set({paused:Re(h),currentTime:Re(f)}):w.set(null),C&&(a=C,s=new Ot("quality-change",{detail:{quality:v}}))}return oM(o,a)||k(this,Si,lS).call(this,a,l,s),l!==Re(b(this,Ss))&&k(this,Si,sS).call(this,l,s),a},lS=function(o,n,a){b(this,to).notify("source-change",o,a),b(this,to).notify("media-type-change",(n==null?void 0:n.mediaType(o))||"unknown",a)},sS=function(o,n){b(this,to).$providerSetup.set(!1),b(this,to).notify("provider-change",null,n),o&&Re(()=>{var a;return(a=o.preconnect)==null?void 0:a.call(o,b(this,to))}),b(this,Ss).set(o),b(this,to).notify("provider-loader-change",o,n)},UH=function(){const o=b(this,to).$provider();if(!(!o||Re(b(this,to).$providerSetup))){if(b(this,to).$state.canLoad()){kn(()=>o.setup(),o.scope),b(this,to).$providerSetup.set(!0);return}Re(()=>{var n;return(n=o.preconnect)==null?void 0:n.call(o)})}},HH=function(){if(!b(this,to).$providerSetup())return;const o=b(this,to).$provider(),n=b(this,to).$state.source(),a=Re(b(this,to).$state.crossOrigin),l=Re(b(this,to).$props.preferNativeHLS);if(!oM(o==null?void 0:o.currentSrc,n)){if(b(this,to).$state.canLoad()){const s=new AbortController;return Uu(n)?(l||!Gg())&&J$(n.src,{credentials:Vh(a),signal:s.signal}).then(d=>{b(this,to).notify("stream-type-change",d)}).catch(Mg):Dv(n)?Sxe(n.src,{credentials:Vh(a),signal:s.signal}).then(d=>{b(this,to).notify("stream-type-change",d)}).catch(Mg):b(this,to).notify("stream-type-change","on-demand"),Re(()=>{const d=Re(b(this,to).$state.preload);return o==null?void 0:o.loadSource(n,d).catch(p=>{})}),()=>s.abort()}try{et(n.src)&&as(new URL(n.src).origin)}catch{}}},KH=function(){const o=b(this,Ss).call(this),{providedPoster:n,source:a,canLoadPoster:l}=b(this,to).$state;if(!o||!o.loadPoster||!a()||!l()||n())return;const s=new AbortController,d=new Ot("source-change",{detail:a});return o.loadPoster(a(),b(this,to),s).then(p=>{b(this,to).notify("poster-change",p||"",d)}).catch(()=>{b(this,to).notify("poster-change","",d)}),()=>{s.abort()}};function eM(i){return(rn(i)?i:[i]).map(o=>et(o)?{src:o,type:tM(o)}:{...o,type:tM(o.src,o.type)})}function tM(i,o){return et(o)&&o.length?o:et(i)&&Wv.has(i)?Wv.get(i):!o&&Uu({src:i,type:""})?"application/x-mpegurl":!o&&Dv({src:i,type:""})?"application/dash+xml":!et(i)||i.startsWith("blob:")?"video/object":i.includes("youtube")||i.includes("youtu.be")?"video/youtube":i.includes("vimeo")&&!i.includes("progressive_redirect")&&!i.includes(".m3u8")?"video/vimeo":"?"}function oM(i,o){return(i==null?void 0:i.src)===(o==null?void 0:o.src)&&(i==null?void 0:i.type)===(o==null?void 0:o.type)}class Axe{constructor(o,n){P(this,s5);P(this,Rm);P(this,zc);P(this,Bm,[]);N(this,Rm,o),N(this,zc,n),fe(k(this,s5,GH).bind(this))}}Rm=new WeakMap,zc=new WeakMap,Bm=new WeakMap,s5=new WeakSet,GH=function(){const o=b(this,Rm).call(this);for(const n of b(this,Bm))if(!o.some(a=>a.id===n.id)){const a=n.id&&b(this,zc).textTracks.getById(n.id);a&&b(this,zc).textTracks.remove(a)}for(const n of o){const a=n.id||bc.createId(n);b(this,zc).textTracks.getById(a)||(n.id=a,b(this,zc).textTracks.add(n))}N(this,Bm,o)};class Jg extends dt{constructor(){super(...arguments);P(this,Ea);P(this,yr);P(this,Lm);P(this,Pm,ct([]));P(this,$m,ct([]));P(this,R2,null);P(this,B2,-1)}onSetup(){N(this,yr,Rt()),N(this,Lm,new Txe(b(this,Pm),b(this,yr),this.$state.loader,this.$props.loaders()))}onAttach(n){n.setAttribute("data-media-provider","")}onConnect(n){b(this,Lm).connect(),new Axe(b(this,$m),b(this,yr));const a=new ResizeObserver(zu(k(this,Ea,dS).bind(this)));a.observe(n);const l=new MutationObserver(k(this,Ea,pS).bind(this));l.observe(n,{attributes:!0,childList:!0}),k(this,Ea,dS).call(this),k(this,Ea,pS).call(this),At(()=>{a.disconnect(),l.disconnect()})}load(n){n==null||n.setAttribute("aria-hidden","true"),window.cancelAnimationFrame(b(this,B2)),N(this,B2,requestAnimationFrame(()=>k(this,Ea,WH).call(this,n))),At(()=>{window.cancelAnimationFrame(b(this,B2))})}onDestroy(){N(this,R2,null),k(this,Ea,cS).call(this)}}yr=new WeakMap,Lm=new WeakMap,Pm=new WeakMap,$m=new WeakMap,R2=new WeakMap,B2=new WeakMap,Ea=new WeakSet,WH=function(n){if(!this.scope)return;const a=this.$state.loader(),{$provider:l}=b(this,yr);b(this,R2)===a&&(a==null?void 0:a.target)===n&&Re(l)||(k(this,Ea,cS).call(this),N(this,R2,a),a&&(a.target=n||null),!(!a||!n)&&a.load(b(this,yr)).then(s=>{this.scope&&Re(this.$state.loader)===a&&b(this,yr).notify("provider-change",s)}))},cS=function(){var n;(n=b(this,yr))==null||n.notify("provider-change",null)},dS=function(){if(!this.el)return;const{player:n,$state:a}=b(this,yr),l=this.el.offsetWidth,s=this.el.offsetHeight;n&&(a.mediaWidth.set(l),a.mediaHeight.set(s),n.el&&(Zn(n.el,"--media-width",l+"px"),Zn(n.el,"--media-height",s+"px")))},pS=function(){const n=[],a=[],l=this.el.children;for(const s of l)if(!s.hasAttribute("data-vds")){if(s instanceof HTMLSourceElement){const d={id:s.id,src:s.src,type:s.type};for(const p of["id","src","width","height","bitrate","codec"]){const h=s.getAttribute(`data-${p}`);et(h)&&(d[p]=/id|src|codec/.test(p)?h:Number(h))}n.push(d)}else if(s instanceof HTMLTrackElement){const d={src:s.src,kind:s.track.kind,language:s.srclang,label:s.label,default:s.default,type:s.getAttribute("data-type")};a.push({id:s.id||bc.createId(d),...d})}}b(this,Pm).set(n),b(this,$m).set(a),is()},V(Jg,"props",{loaders:[]}),V(Jg,"state",new fc({loader:null}));const _xe=Jg.prototype;ti(_xe,"load");class iM extends pt(HTMLElement,Jg){constructor(){super(...arguments);P(this,ml);P(this,Is);P(this,hn,null);P(this,ta,null)}onSetup(){N(this,Is,Rt()),this.setAttribute("keep-alive","")}onDestroy(){var n,a;(n=b(this,ta))==null||n.remove(),N(this,ta,null),(a=b(this,hn))==null||a.remove(),N(this,hn,null)}onConnect(){fe(()=>{var h,f,g;const n=this.$state.loader(),a=(n==null?void 0:n.name)==="youtube",l=(n==null?void 0:n.name)==="vimeo",s=a||l,d=(n==null?void 0:n.name)==="google-cast",p=n?d?k(this,ml,QH).call(this):s?k(this,ml,XH).call(this):n.mediaType()==="audio"?k(this,ml,ZH).call(this):k(this,ml,YH).call(this):null;if(b(this,hn)!==p){const w=((h=b(this,hn))==null?void 0:h.parentElement)??this;(f=b(this,hn))==null||f.remove(),N(this,hn,p),p&&w.prepend(p),s&&p&&fe(()=>{var I;const{nativeControls:v,viewType:C}=b(this,Is).$state,E=v(),T=C()==="audio";!E&&!T?(N(this,ta,this.querySelector(".vds-blocker")),b(this,ta)||(N(this,ta,document.createElement("div")),b(this,ta).classList.add("vds-blocker"),p.after(b(this,ta)))):((I=b(this,ta))==null||I.remove(),N(this,ta,null)),We(p,"data-no-controls",!E)})}a?p==null||p.classList.add("vds-youtube"):l&&(p==null||p.classList.add("vds-vimeo")),s||((g=b(this,ta))==null||g.remove(),N(this,ta,null)),this.load(p)})}}Is=new WeakMap,hn=new WeakMap,ta=new WeakMap,ml=new WeakSet,ZH=function(){const n=b(this,hn)instanceof HTMLAudioElement?b(this,hn):document.createElement("audio"),{controls:a,crossOrigin:l}=b(this,Is).$state;return fe(()=>{We(n,"controls",a()),We(n,"crossorigin",l())}),n},YH=function(){const n=b(this,hn)instanceof HTMLVideoElement?b(this,hn):document.createElement("video"),{crossOrigin:a,poster:l,nativeControls:s}=b(this,Is).$state,d=cr(()=>s()?"true":null),p=cr(()=>l()&&s()?l():null);return fe(()=>{We(n,"controls",d()),We(n,"crossorigin",a()),We(n,"poster",p())}),n},XH=function(){const n=b(this,hn)instanceof HTMLIFrameElement?b(this,hn):document.createElement("iframe"),{nativeControls:a}=b(this,Is).$state;return fe(()=>We(n,"tabindex",a()?null:-1)),n},QH=function(){var a;if((a=b(this,hn))!=null&&a.classList.contains("vds-google-cast"))return b(this,hn);const n=document.createElement("div");return n.classList.add("vds-google-cast"),Promise.resolve().then(()=>HGe).then(({insertContent:l})=>{l(n,b(this,Is).$state)}),n},V(iM,"tagName","media-provider");class Zv extends pt(HTMLElement,Qg){}V(Zv,"tagName","media-player"),V(Zv,"attrs",{autoPlay:"autoplay",crossOrigin:"crossorigin",playsInline:"playsinline",preferNativeHLS:"prefer-native-hls",minLiveDVRWindow:"min-live-dvr-window"}),lt(Zv),lt(iM);function nM(i,o){return[...i].sort(o?Oxe:Dxe)}function Dxe(i,o){return i.height===o.height?(i.bitrate??0)-(o.bitrate??0):i.height-o.height}function Oxe(i,o){return o.height===i.height?(o.bitrate??0)-(i.bitrate??0):o.height-i.height}class Rxe extends $a{constructor(n){super();P(this,p0);N(this,p0,n)}onAttach(n){const{$props:a,ariaKeys:l}=Rt(),s=n.getAttribute("aria-keyshortcuts");if(s){l[b(this,p0)]=s,At(()=>{delete l[b(this,p0)]});return}const d=a.keyShortcuts()[b(this,p0)];if(d){const p=rn(d)?d.join(" "):et(d)?d:d==null?void 0:d.keys;n.setAttribute("aria-keyshortcuts",rn(p)?p.join(" "):p)}}}p0=new WeakMap;function Yv(i,o){const n=String(i),a=n.length;if(a<o){const s=o-a;return`${"0".repeat(s)}${i}`}return n}function aM(i){const o=Math.trunc(i/3600),n=Math.trunc(i%3600/60),a=Math.trunc(i%60),l=Number((i-Math.trunc(i)).toPrecision(3));return{hours:o,minutes:n,seconds:a,fraction:l}}function e4(i,{padHrs:o=null,padMins:n=null,showHrs:a=!1,showMs:l=!1}={}){const{hours:s,minutes:d,seconds:p,fraction:h}=aM(i),f=o?Yv(s,2):s,g=n||Jr(n)&&i>=3600?Yv(d,2):d,w=Yv(p,2),v=l&&h>0?`.${String(h).replace(/^0?\./,"")}`:"",C=`${g}:${w}${v}`;return s>0||a?`${f}:${C}`:C}function t4(i){const o=[],{hours:n,minutes:a,seconds:l}=aM(i);return n>0&&o.push(`${n} hour`),a>0&&o.push(`${a} min`),(l>0||o.length===0)&&o.push(`${l} sec`),o.join(" ")}class rM extends $a{constructor(n){super();P(this,Uc);P(this,wr);P(this,u0,-1);P(this,h0,-1);P(this,bl,null);N(this,wr,n),fe(k(this,Uc,JH).bind(this))}onDestroy(){var n;(n=b(this,bl))==null||n.call(this),N(this,bl,null)}show(n){var a,l,s;k(this,Uc,z5).call(this),window.cancelAnimationFrame(b(this,h0)),N(this,h0,-1),(a=b(this,bl))==null||a.call(this),N(this,bl,null),N(this,u0,window.setTimeout(()=>{N(this,u0,-1);const d=b(this,wr).content();d&&d.style.removeProperty("display"),Re(()=>b(this,wr).onChange(!0,n))},((s=(l=b(this,wr)).showDelay)==null?void 0:s.call(l))??0))}hide(n){k(this,Uc,z5).call(this),Re(()=>b(this,wr).onChange(!1,n)),N(this,h0,requestAnimationFrame(()=>{var l;k(this,Uc,z5).call(this),N(this,h0,-1);const a=b(this,wr).content();if(a){const s=()=>{a.style.display="none",N(this,bl,null)};if(Vke(a)){(l=b(this,bl))==null||l.call(this);const p=po(a,"animationend",s,{once:!0});N(this,bl,p)}else s()}}))}}wr=new WeakMap,Uc=new WeakSet,JH=function(){const n=b(this,wr).trigger();if(!n){this.hide();return}const a=this.show.bind(this),l=this.hide.bind(this);b(this,wr).listen(n,a,l)},u0=new WeakMap,h0=new WeakMap,bl=new WeakMap,z5=function(){window.clearTimeout(b(this,u0)),N(this,u0,-1)};class Sn extends $a{constructor(n){super();P(this,gl);P(this,Es);N(this,Es,n),new dr,n.keyShortcut&&new Rxe(n.keyShortcut)}onSetup(){const{disabled:n}=this.$props;this.setAttributes({"data-pressed":b(this,Es).isPresssed,"aria-pressed":k(this,gl,eK).bind(this),"aria-disabled":()=>n()?"true":null})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button")}onConnect(n){const a=yc(n,k(this,gl,oK).bind(this));for(const l of["click","touchstart"])a.add(l,k(this,gl,iK).bind(this),{passive:!0})}}Es=new WeakMap,gl=new WeakSet,eK=function(){return qg(b(this,Es).isPresssed())},tK=function(n){OCe(b(this,Es).isPresssed)&&b(this,Es).isPresssed.set(a=>!a)},oK=function(n){if(this.$props.disabled()||this.el.hasAttribute("data-disabled")){n.preventDefault(),n.stopImmediatePropagation();return}n.preventDefault(),(b(this,Es).onPress??k(this,gl,tK)).call(this,n)},iK=function(n){this.$props.disabled()&&(n.preventDefault(),n.stopImmediatePropagation())},V(Sn,"props",{disabled:!1});class lM extends dt{constructor(){super();P(this,yl);P(this,Ts);new Sn({isPresssed:k(this,yl,aK).bind(this),onPress:k(this,yl,nK).bind(this)})}onSetup(){N(this,Ts,Rt());const{canAirPlay:n,isAirPlayConnected:a}=b(this,Ts).$state;this.setAttributes({"data-active":a,"data-supported":n,"data-state":k(this,yl,rK).bind(this),"aria-hidden":sn(()=>!n())})}onAttach(n){n.setAttribute("data-media-tooltip","airplay"),gc(n,k(this,yl,lK).bind(this))}}Ts=new WeakMap,yl=new WeakSet,nK=function(n){b(this,Ts).remote.requestAirPlay(n)},aK=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ts).$state;return n()==="airplay"&&a()!=="disconnected"},rK=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ts).$state;return n()==="airplay"&&a()},lK=function(){const{remotePlaybackState:n}=b(this,Ts).$state;return`AirPlay ${n()}`},V(lM,"props",Sn.props);class sM extends dt{constructor(){super();P(this,m0);P(this,f0);new Sn({isPresssed:k(this,m0,uS).bind(this),keyShortcut:"togglePaused",onPress:k(this,m0,sK).bind(this)})}onSetup(){N(this,f0,Rt());const{paused:n,ended:a}=b(this,f0).$state;this.setAttributes({"data-paused":n,"data-ended":a})}onAttach(n){n.setAttribute("data-media-tooltip","play"),gc(n,"Play")}}f0=new WeakMap,m0=new WeakSet,sK=function(n){const a=b(this,f0).remote;k(this,m0,uS).call(this)?a.pause(n):a.play(n)},uS=function(){const{paused:n}=b(this,f0).$state;return!n()},V(sM,"props",Sn.props);class cM extends dt{constructor(){super();P(this,wl);P(this,b0);new Sn({isPresssed:k(this,wl,hS).bind(this),keyShortcut:"toggleCaptions",onPress:k(this,wl,cK).bind(this)})}onSetup(){N(this,b0,Rt()),this.setAttributes({"data-active":k(this,wl,hS).bind(this),"data-supported":()=>!k(this,wl,fS).call(this),"aria-hidden":sn(k(this,wl,fS).bind(this))})}onAttach(n){n.setAttribute("data-media-tooltip","caption"),gc(n,"Captions")}}b0=new WeakMap,wl=new WeakSet,cK=function(n){b(this,b0).remote.toggleCaptions(n)},hS=function(){const{textTrack:n}=b(this,b0).$state,a=n();return!!a&&xn(a)},fS=function(){const{hasCaptions:n}=b(this,b0).$state;return!n()},V(cM,"props",Sn.props);let Bxe=(dx=class extends dt{constructor(){super();P(this,As);P(this,Hc);new Sn({isPresssed:k(this,As,mS).bind(this),keyShortcut:"toggleFullscreen",onPress:k(this,As,dK).bind(this)})}onSetup(){N(this,Hc,Rt());const{fullscreen:n}=b(this,Hc).$state,a=k(this,As,pK).bind(this);this.setAttributes({"data-active":n,"data-supported":a,"aria-hidden":sn(()=>!a())})}onAttach(n){n.setAttribute("data-media-tooltip","fullscreen"),gc(n,"Fullscreen")}},Hc=new WeakMap,As=new WeakSet,dK=function(n){const a=b(this,Hc).remote,l=this.$props.target();k(this,As,mS).call(this)?a.exitFullscreen(l,n):a.enterFullscreen(l,n)},mS=function(){const{fullscreen:n}=b(this,Hc).$state;return n()},pK=function(){const{canFullscreen:n}=b(this,Hc).$state;return n()},V(dx,"props",{...Sn.props,target:"prefer-media"}),dx);class dM extends dt{constructor(){super();P(this,vl);P(this,g0);new Sn({isPresssed:k(this,vl,U5).bind(this),keyShortcut:"toggleMuted",onPress:k(this,vl,uK).bind(this)})}onSetup(){N(this,g0,Rt()),this.setAttributes({"data-muted":k(this,vl,U5).bind(this),"data-state":k(this,vl,hK).bind(this)})}onAttach(n){n.setAttribute("data-media-mute-button",""),n.setAttribute("data-media-tooltip","mute"),gc(n,"Mute")}}g0=new WeakMap,vl=new WeakSet,uK=function(n){const a=b(this,g0).remote;k(this,vl,U5).call(this)?a.unmute(n):a.mute(n)},U5=function(){const{muted:n,volume:a}=b(this,g0).$state;return n()||a()===0},hK=function(){const{muted:n,volume:a}=b(this,g0).$state,l=a();if(n()||l===0)return"muted";if(l>=.5)return"high";if(l<.5)return"low"},V(dM,"props",Sn.props);class pM extends dt{constructor(){super();P(this,_s);P(this,Kc);new Sn({isPresssed:k(this,_s,bS).bind(this),keyShortcut:"togglePictureInPicture",onPress:k(this,_s,fK).bind(this)})}onSetup(){N(this,Kc,Rt());const{pictureInPicture:n}=b(this,Kc).$state,a=k(this,_s,mK).bind(this);this.setAttributes({"data-active":n,"data-supported":a,"aria-hidden":sn(()=>!a())})}onAttach(n){n.setAttribute("data-media-tooltip","pip"),gc(n,"PiP")}}Kc=new WeakMap,_s=new WeakSet,fK=function(n){const a=b(this,Kc).remote;k(this,_s,bS).call(this)?a.exitPictureInPicture(n):a.enterPictureInPicture(n)},bS=function(){const{pictureInPicture:n}=b(this,Kc).$state;return n()},mK=function(){const{canPictureInPicture:n}=b(this,Kc).$state;return n()},V(pM,"props",Sn.props);class uM extends dt{constructor(){super();P(this,Wc);P(this,Gc);new dr}onSetup(){N(this,Gc,Rt());const{seeking:n}=b(this,Gc).$state,{seconds:a}=this.$props,l=k(this,Wc,bK).bind(this);this.setAttributes({seconds:a,"data-seeking":n,"data-supported":l,"aria-hidden":sn(()=>!l())})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button"),n.setAttribute("data-media-tooltip","seek"),gc(n,k(this,Wc,gK).bind(this))}onConnect(n){yc(n,k(this,Wc,yK).bind(this))}}Gc=new WeakMap,Wc=new WeakSet,bK=function(){const{canSeek:n}=b(this,Gc).$state;return n()},gK=function(){const{seconds:n}=this.$props;return`Seek ${n()>0?"forward":"backward"} ${n()} seconds`},yK=function(n){const{seconds:a,disabled:l}=this.$props;if(l())return;const{currentTime:s}=b(this,Gc).$state,d=s()+a();b(this,Gc).remote.seek(d,n)},V(uM,"props",{disabled:!1,seconds:30});class hM extends dt{constructor(){super();P(this,c5);P(this,y0);new dr}onSetup(){N(this,y0,Rt());const{disabled:n}=this.$props,{live:a,liveEdge:l}=b(this,y0).$state,s=()=>!a();this.setAttributes({"data-edge":l,"data-hidden":s,"aria-disabled":sn(()=>n()||l()),"aria-hidden":sn(s)})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button"),n.setAttribute("data-media-tooltip","live")}onConnect(n){yc(n,k(this,c5,wK).bind(this))}}y0=new WeakMap,c5=new WeakSet,wK=function(n){const{disabled:a}=this.$props,{liveEdge:l}=b(this,y0).$state;a()||l()||b(this,y0).remote.seekToLiveEdge(n)},V(hM,"props",{disabled:!1});const Ep=new fc({min:0,max:100,value:0,step:1,pointerValue:0,focused:!1,dragging:!1,pointing:!1,hidden:!1,get active(){return this.dragging||this.focused||this.pointing},get fillRate(){return fM(this.min,this.max,this.value)},get fillPercent(){return this.fillRate*100},get pointerRate(){return fM(this.min,this.max,this.pointerValue)},get pointerPercent(){return this.pointerRate*100}});function fM(i,o,n){const a=o-i,l=n-i;return a>0?l/a:0}class mM extends $a{constructor(n){super();P(this,d5);P(this,L2);P(this,Zc);N(this,L2,n)}onConnect(n){N(this,Zc,new IntersectionObserver(a=>{var l,s;(s=(l=b(this,L2)).callback)==null||s.call(l,a,b(this,Zc))},b(this,L2))),b(this,Zc).observe(n),At(k(this,d5,vK).bind(this))}}L2=new WeakMap,Zc=new WeakMap,d5=new WeakSet,vK=function(){var n;(n=b(this,Zc))==null||n.disconnect(),N(this,Zc,void 0)};const Xv=hc(),Kh=hc();function Lxe(i,o,n,a){return jv(i,Pi(n,Nv(a)),o)}function Pxe(i,o,n,a){const l=jv(0,n,1),s=o-i,d=s*l,p=d/a,h=a*Math.round(p);return i+h}const Qv={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1};class $xe extends $a{constructor(n,a){super();P(this,Qe);P(this,fn);P(this,Yc);P(this,P2);P(this,Xc,null);P(this,vr,null);P(this,Ds,null);P(this,$2);P(this,Os,!1);P(this,p5,vp(n=>{k(this,Qe,Bd).call(this,k(this,Qe,N3).call(this,n),n)},20,{leading:!0}));N(this,fn,n),N(this,Yc,a)}onSetup(){ga(Kh)&&N(this,P2,qo(Kh))}onConnect(n){fe(k(this,Qe,SK).bind(this,n)),fe(k(this,Qe,IK).bind(this,n)),b(this,fn).swipeGesture&&fe(k(this,Qe,CK).bind(this))}}fn=new WeakMap,Yc=new WeakMap,P2=new WeakMap,Qe=new WeakSet,CK=function(){var a;const{pointer:n}=b(this,Yc).$state;if(n()!=="coarse"||!b(this,fn).swipeGesture()){N(this,Xc,null);return}N(this,Xc,(a=b(this,Yc).player.el)==null?void 0:a.querySelector("media-provider,[data-media-provider]")),b(this,Xc)&&new go(b(this,Xc)).add("touchstart",k(this,Qe,kK).bind(this),{passive:!0}).add("touchmove",k(this,Qe,xK).bind(this),{passive:!1})},Xc=new WeakMap,vr=new WeakMap,Ds=new WeakMap,kK=function(n){N(this,vr,n.touches[0])},xK=function(n){if(Jr(b(this,vr))||Lv(n))return;const a=n.touches[0],l=a.clientX-b(this,vr).clientX,s=a.clientY-b(this,vr).clientY,d=this.$state.dragging();!d&&Math.abs(s)>5||d||(n.preventDefault(),Math.abs(l)>20&&(N(this,vr,a),N(this,Ds,this.$state.value()),k(this,Qe,K5).call(this,b(this,Ds),n)))},SK=function(n){const{hidden:a}=this.$props;po(n,"focus",k(this,Qe,EK).bind(this)),!(a()||b(this,fn).isDisabled())&&new go(n).add("keyup",k(this,Qe,RK).bind(this)).add("keydown",k(this,Qe,OK).bind(this)).add("pointerenter",k(this,Qe,TK).bind(this)).add("pointermove",k(this,Qe,AK).bind(this)).add("pointerleave",k(this,Qe,_K).bind(this)).add("pointerdown",k(this,Qe,DK).bind(this))},IK=function(n){b(this,fn).isDisabled()||!this.$state.dragging()||new go(document).add("pointerup",k(this,Qe,BK).bind(this),{capture:!0}).add("pointermove",b(this,p5).bind(this)).add("touchmove",k(this,Qe,LK).bind(this),{passive:!1})},EK=function(){k(this,Qe,Bd).call(this,this.$state.value())},H5=function(n,a){var g,w,v,C;const{value:l,min:s,max:d,dragging:p}=this.$state,h=Math.max(s(),Math.min(n,d()));l.set(h);const f=this.createEvent("value-change",{detail:h,trigger:a});if(this.dispatch(f),(w=(g=b(this,fn)).onValueChange)==null||w.call(g,f),p()){const E=this.createEvent("drag-value-change",{detail:h,trigger:a});this.dispatch(E),(C=(v=b(this,fn)).onDragValueChange)==null||C.call(v,E)}},Bd=function(n,a){const{pointerValue:l,dragging:s}=this.$state;l.set(n),this.dispatch("pointer-value-change",{detail:n,trigger:a}),s()&&k(this,Qe,H5).call(this,n,a)},N3=function(n){let a,l=this.el.getBoundingClientRect(),{min:s,max:d}=this.$state;if(this.$props.orientation()==="vertical"){const{bottom:p,height:h}=l;a=(p-n.clientY)/h}else if(b(this,vr)&&Li(b(this,Ds))){const{width:p}=b(this,Xc).getBoundingClientRect(),h=(n.clientX-b(this,vr).clientX)/p,f=d()-s(),g=f*Math.abs(h);a=(h<0?b(this,Ds)-g:b(this,Ds)+g)/f}else{const{left:p,width:h}=l;a=(n.clientX-p)/h}return Math.max(s(),Math.min(d(),b(this,fn).roundValue(Pxe(s(),d(),a,b(this,fn).getStep()))))},TK=function(n){this.$state.pointing.set(!0)},AK=function(n){const{dragging:a}=this.$state;a()||k(this,Qe,Bd).call(this,k(this,Qe,N3).call(this,n),n)},_K=function(n){this.$state.pointing.set(!1)},DK=function(n){if(n.button!==0)return;const a=k(this,Qe,N3).call(this,n);k(this,Qe,K5).call(this,a,n),k(this,Qe,Bd).call(this,a,n)},K5=function(n,a){var d,p,h,f;const{dragging:l}=this.$state;if(l())return;l.set(!0),b(this,Yc).remote.pauseControls(a);const s=this.createEvent("drag-start",{detail:n,trigger:a});this.dispatch(s),(p=(d=b(this,fn)).onDragStart)==null||p.call(d,s),(f=(h=b(this,P2))==null?void 0:h.onDragStart)==null||f.call(h)},gS=function(n,a){var d,p,h,f;const{dragging:l}=this.$state;if(!l())return;l.set(!1),b(this,Yc).remote.resumeControls(a);const s=this.createEvent("drag-end",{detail:n,trigger:a});this.dispatch(s),(p=(d=b(this,fn)).onDragEnd)==null||p.call(d,s),N(this,vr,null),N(this,Ds,null),(f=(h=b(this,P2))==null?void 0:h.onDragEnd)==null||f.call(h)},$2=new WeakMap,Os=new WeakMap,OK=function(n){if(!Object.keys(Qv).includes(n.key))return;const{key:l}=n,s=k(this,Qe,yS).call(this,n);if(!Jr(s)){k(this,Qe,Bd).call(this,s,n),k(this,Qe,H5).call(this,s,n);return}const d=k(this,Qe,wS).call(this,n);b(this,Os)||(N(this,Os,l===b(this,$2)),!this.$state.dragging()&&b(this,Os)&&k(this,Qe,K5).call(this,d,n)),k(this,Qe,Bd).call(this,d,n),N(this,$2,l)},RK=function(n){if(!Object.keys(Qv).includes(n.key)||!Jr(k(this,Qe,yS).call(this,n)))return;const l=b(this,Os)?this.$state.pointerValue():k(this,Qe,wS).call(this,n);k(this,Qe,H5).call(this,l,n),k(this,Qe,gS).call(this,l,n),N(this,$2,""),N(this,Os,!1)},yS=function(n){let a=n.key,{min:l,max:s}=this.$state;return a==="Home"||a==="PageUp"?l():a==="End"||a==="PageDown"?s():!n.metaKey&&/^[0-9]$/.test(a)?(s()-l())/10*Number(a):null},wS=function(n){var I,x;const{key:a,shiftKey:l}=n;n.preventDefault(),n.stopPropagation();const{shiftKeyMultiplier:s}=this.$props,{min:d,max:p,value:h,pointerValue:f}=this.$state,g=b(this,fn).getStep(),w=b(this,fn).getKeyStep(),v=l?w*s():w,C=Number(Qv[a]),E=v*C,T=b(this,Os)?f():((x=(I=b(this,fn)).getValue)==null?void 0:x.call(I))??h(),A=(T+E)/g;return Math.max(d(),Math.min(p(),Number((g*A).toFixed(3))))},BK=function(n){if(n.button!==0)return;n.preventDefault(),n.stopImmediatePropagation();const a=k(this,Qe,N3).call(this,n);k(this,Qe,Bd).call(this,a,n),k(this,Qe,gS).call(this,a,n)},LK=function(n){n.preventDefault()},p5=new WeakMap;const Hu=hc(()=>({}));class wa extends $a{constructor(n){super();P(this,Yi);P(this,Mm);P(this,oa);P(this,Nm,ct(!0));P(this,jm,ct(!0));P(this,u5,zu((n,a)=>{var l,s;(l=this.el)==null||l.style.setProperty("--slider-fill",n+"%"),(s=this.el)==null||s.style.setProperty("--slider-pointer",a+"%")}));N(this,oa,n)}onSetup(){N(this,Mm,Rt());const n=new dr;n.attach(this),this.$state.focused=n.focused.bind(n),ga(Hu)||ba(Hu,{default:"value"}),ba(Xv,{orientation:this.$props.orientation,disabled:b(this,oa).isDisabled,preview:ct(null)}),fe(k(this,Yi,MK).bind(this)),fe(k(this,Yi,NK).bind(this)),fe(k(this,Yi,jK).bind(this)),k(this,Yi,qK).call(this),new $xe(b(this,oa),b(this,Mm)).attach(this),new mM({callback:k(this,Yi,PK).bind(this)}).attach(this)}onAttach(n){bo(n,"role","slider"),bo(n,"tabindex","0"),bo(n,"autocomplete","off"),fe(k(this,Yi,VK).bind(this))}onConnect(n){At(M$(n,b(this,Nm).set)),fe(k(this,Yi,$K).bind(this))}}Mm=new WeakMap,oa=new WeakMap,Nm=new WeakMap,jm=new WeakMap,Yi=new WeakSet,PK=function(n){b(this,jm).set(n[0].isIntersecting)},$K=function(){const{hidden:n}=this.$props;this.$state.hidden.set(n()||!b(this,Nm).call(this)||!b(this,jm).bind(this))},MK=function(){const{dragging:n,value:a,min:l,max:s}=this.$state;Re(n)||a.set(Lxe(l(),s(),a(),b(this,oa).getStep()))},NK=function(){this.$state.step.set(b(this,oa).getStep())},jK=function(){if(!b(this,oa).isDisabled())return;const{dragging:n,pointing:a}=this.$state;n.set(!1),a.set(!1)},FK=function(){return qg(b(this,oa).isDisabled())},qK=function(){const{orientation:n}=this.$props,{dragging:a,active:l,pointing:s}=this.$state;this.setAttributes({"data-dragging":a,"data-pointing":s,"data-active":l,"aria-disabled":k(this,Yi,FK).bind(this),"aria-valuemin":b(this,oa).aria.valueMin??this.$state.min,"aria-valuemax":b(this,oa).aria.valueMax??this.$state.max,"aria-valuenow":b(this,oa).aria.valueNow,"aria-valuetext":b(this,oa).aria.valueText,"aria-orientation":n})},VK=function(){const{fillPercent:n,pointerPercent:a}=this.$state;b(this,u5).call(this,Pi(n(),3),Pi(a(),3))},u5=new WeakMap,V(wa,"props",{hidden:!1,disabled:!1,step:1,keyStep:1,orientation:"horizontal",shiftKeyMultiplier:5});class Tp extends dt{constructor(){super();P(this,Cl);new wa({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.$props.disabled,aria:{valueNow:k(this,Cl,zK).bind(this),valueText:k(this,Cl,UK).bind(this)}})}onSetup(){fe(k(this,Cl,HK).bind(this)),fe(k(this,Cl,KK).bind(this))}}Cl=new WeakSet,zK=function(){const{value:n}=this.$state;return Math.round(n())},UK=function(){const{value:n,max:a}=this.$state;return Pi(n()/a()*100,2)+"%"},HK=function(){const{value:n}=this.$props;this.$state.value.set(n())},KK=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},V(Tp,"props",{...wa.props,min:0,max:100,value:0}),V(Tp,"state",Ep);const ss=new Map,o4=new Map,px=class px{constructor(o,n,a){P(this,Xo);P(this,Fm);P(this,M2);P(this,qm);V(this,"$images",ct([]));N(this,M2,o),N(this,qm,n),N(this,Fm,a),fe(k(this,Xo,GK).bind(this))}static create(o,n){const a=Rt();return new px(o,n,a)}};Fm=new WeakMap,M2=new WeakMap,qm=new WeakMap,Xo=new WeakSet,GK=function(){var a;const{canLoad:o}=b(this,Fm).$state;if(!o())return;const n=b(this,M2).call(this);if(n){if(et(n)&&ss.has(n)){const l=ss.get(n);if(ss.delete(n),ss.set(n,l),ss.size>99){const s=ss.keys().next().value;ss.delete(s)}this.$images.set(ss.get(n))}else if(et(n)){const l=b(this,qm).call(this),s=n+"::"+l;if(!o4.has(s)){const d=new Promise(async(p,h)=>{try{const f=await fetch(n,{credentials:Vh(l)});if(f.headers.get("content-type")==="application/json"){const w=await f.json();if(rn(w))if(w[0]&&"text"in w[0])p(k(this,Xo,CS).call(this,w));else{for(let v=0;v<w.length;v++){const C=w[v];rs(r$(C),!1),rs("url"in C&&et(C.url),!1),rs("startTime"in C&&Li(C.startTime),!1)}p(w)}else p(k(this,Xo,vS).call(this,w));return}Promise.resolve().then(()=>Z4).then(async({parseResponse:w})=>{try{const{cues:v}=await w(f);p(k(this,Xo,CS).call(this,v))}catch(v){h(v)}})}catch(f){h(f)}}).then(p=>(ss.set(s,p),p)).catch(p=>{k(this,Xo,G5).call(this,n,p)}).finally(()=>{et(s)&&o4.delete(s)});o4.set(s,d)}(a=o4.get(s))==null||a.then(d=>{this.$images.set(d||[])})}else if(rn(n))try{this.$images.set(k(this,Xo,WK).call(this,n))}catch(l){k(this,Xo,G5).call(this,n,l)}else try{this.$images.set(k(this,Xo,vS).call(this,n))}catch(l){k(this,Xo,G5).call(this,n,l)}return()=>{this.$images.set([])}}},WK=function(o){const n=k(this,Xo,kS).call(this);return o.map((a,l)=>(rs(a.url&&et(a.url)),rs("startTime"in a&&Li(a.startTime)),{...a,url:et(a.url)?k(this,Xo,xS).call(this,a.url,n):a.url}))},vS=function(o){var d;rs(et(o.url)),rs(rn(o.tiles)&&((d=o.tiles)==null?void 0:d.length));const n=new URL(o.url),a=[],l="tile_width"in o?o.tile_width:o.tileWidth,s="tile_height"in o?o.tile_height:o.tileHeight;for(const p of o.tiles)a.push({url:n,startTime:"start"in p?p.start:p.startTime,width:l,height:s,coords:{x:p.x,y:p.y}});return a},CS=function(o){for(let l=0;l<o.length;l++){const s=o[l];rs("startTime"in s&&Li(s.startTime)),rs("text"in s&&et(s.text))}const n=[],a=k(this,Xo,kS).call(this);for(const l of o){const[s,d]=l.text.split("#"),p=k(this,Xo,ZK).call(this,d);n.push({url:k(this,Xo,xS).call(this,s,a),startTime:l.startTime,endTime:l.endTime,width:p==null?void 0:p.w,height:p==null?void 0:p.h,coords:p&&Li(p.x)&&Li(p.y)?{x:p.x,y:p.y}:void 0})}return n},kS=function(){let o=Re(b(this,M2));return!et(o)||!/^https?:/.test(o)?location.href:o},xS=function(o,n){return/^https?:/.test(o)?new URL(o):new URL(o,n)},ZK=function(o){if(!o)return{};const[n,a]=o.split("="),l=a==null?void 0:a.split(","),s={};if(!n||!l)return null;for(let d=0;d<n.length;d++){const p=+l[d];isNaN(p)||(s[n[d]]=p)}return s},G5=function(o,n){};let Jv=px;class eC extends dt{constructor(){super(...arguments);P(this,Yt);V(this,"media");P(this,N2);P(this,j2,[])}onSetup(){this.media=Rt(),N(this,N2,Jv.create(this.$props.src,this.$state.crossOrigin)),k(this,Yt,SS).call(this),this.setAttributes({"data-loading":k(this,Yt,eG).bind(this),"data-error":k(this,Yt,IS).bind(this),"data-hidden":this.$state.hidden,"aria-hidden":sn(this.$state.hidden)})}onConnect(n){fe(k(this,Yt,YK).bind(this)),fe(k(this,Yt,tG).bind(this)),fe(k(this,Yt,SS).bind(this)),fe(k(this,Yt,XK).bind(this)),fe(k(this,Yt,oG).bind(this)),fe(k(this,Yt,ES).bind(this))}getTime(){return this.$props.time()}}N2=new WeakMap,j2=new WeakMap,Yt=new WeakSet,YK=function(){const n=this.$state.img();n&&new go(n).add("load",k(this,Yt,QK).bind(this)).add("error",k(this,Yt,JK).bind(this))},SS=function(){const{crossOrigin:n}=this.$props,{crossOrigin:a}=this.$state,{crossOrigin:l}=this.media.$state,s=n()!==null?n():l();a.set(s===!0?"anonymous":s)},XK=function(){const{src:n,loading:a,error:l}=this.$state;return n()&&(a.set(!0),l.set(null)),()=>{k(this,Yt,iG).call(this),a.set(!1),l.set(null)}},QK=function(){const{loading:n,error:a}=this.$state;k(this,Yt,ES).call(this),n.set(!1),a.set(null)},JK=function(n){const{loading:a,error:l}=this.$state;a.set(!1),l.set(n)},eG=function(){const{loading:n,hidden:a}=this.$state;return!a()&&n()},IS=function(){const{error:n}=this.$state;return!Jr(n())},tG=function(){const{hidden:n}=this.$state,{duration:a}=this.media.$state,l=b(this,N2).$images();n.set(k(this,Yt,IS).call(this)||!Number.isFinite(a())||l.length===0)},oG=function(){let n=b(this,N2).$images();if(!n.length)return;let a=this.getTime(),{src:l,activeThumbnail:s}=this.$state,d=-1,p=null;for(let h=n.length-1;h>=0;h--){const f=n[h];if(a>=f.startTime&&(!f.endTime||a<f.endTime)){d=h;break}}n[d]&&(p=n[d]),s.set(p),l.set((p==null?void 0:p.url.href)||"")},ES=function(){if(!this.scope||this.$state.hidden())return;const n=this.el,a=this.$state.img(),l=this.$state.activeThumbnail();if(!a||!l||!n)return;let s=l.width??a.naturalWidth,d=(l==null?void 0:l.height)??a.naturalHeight,{maxWidth:p,maxHeight:h,minWidth:f,minHeight:g,width:w,height:v}=getComputedStyle(this.el);f==="100%"&&(f=parseFloat(w)+""),g==="100%"&&(g=parseFloat(v)+"");let C=Math.max(parseInt(f)/s,parseInt(g)/d),E=Math.min(Math.max(parseInt(f),parseInt(p))/s,Math.max(parseInt(g),parseInt(h))/d),T=!isNaN(E)&&E<1?E:C>1?C:1;k(this,Yt,Ld).call(this,n,"--thumbnail-width",`${s*T}px`),k(this,Yt,Ld).call(this,n,"--thumbnail-height",`${d*T}px`),k(this,Yt,Ld).call(this,n,"--thumbnail-aspect-ratio",String(Pi(s/d,5))),k(this,Yt,Ld).call(this,a,"width",`${a.naturalWidth*T}px`),k(this,Yt,Ld).call(this,a,"height",`${a.naturalHeight*T}px`),k(this,Yt,Ld).call(this,a,"transform",l.coords?`translate(-${l.coords.x*T}px, -${l.coords.y*T}px)`:""),k(this,Yt,Ld).call(this,a,"max-width","none")},Ld=function(n,a,l){n.style.setProperty(a,l),b(this,j2).push(()=>n.style.removeProperty(a))},iG=function(){for(const n of b(this,j2))n();N(this,j2,[])},V(eC,"props",{src:null,time:0,crossOrigin:null}),V(eC,"state",new fc({src:"",img:null,thumbnails:[],activeThumbnail:null,crossOrigin:null,loading:!1,error:null,hidden:!1}));class tC extends dt{constructor(){super(...arguments);P(this,Qc);P(this,h5);P(this,Vm)}onSetup(){N(this,Vm,qu(Tp.state)),N(this,Qc,qo(Hu)),N(this,h5,cr(this.getValueText.bind(this)))}getValueText(){var T,A;const{type:n,format:a,decimalPlaces:l,padHours:s,padMinutes:d,showHours:p,showMs:h}=this.$props,{value:f,pointerValue:g,min:w,max:v}=b(this,Vm),C=(a==null?void 0:a())??b(this,Qc).default,E=n()==="current"?f():g();if(C==="percent"){const I=v()-w(),x=E/I*100;return(b(this,Qc).percent??Pi)(x,l())+"%"}else return C==="time"?(b(this,Qc).time??e4)(E,{padHrs:s(),padMins:d(),showHrs:p(),showMs:h()}):(((A=(T=b(this,Qc)).value)==null?void 0:A.call(T,E))??E.toFixed(2))+""}}Qc=new WeakMap,h5=new WeakMap,Vm=new WeakMap,V(tC,"props",{type:"pointer",format:null,showHours:!1,showMs:!1,padHours:null,padMinutes:null,decimalPlaces:2});const Mxe=tC.prototype;ti(Mxe,"getValueText");class bM extends dt{constructor(){super(...arguments);P(this,F2);P(this,zm,zu(()=>{const{disabled:n,orientation:a}=b(this,F2);if(n())return;const l=this.el,{offset:s,noClamp:d}=this.$props;l&&Nxe(l,{clamp:!d(),offset:s(),orientation:a()})}))}onSetup(){N(this,F2,qo(Xv));const{active:n}=qu(Tp.state);this.setAttributes({"data-visible":n})}onAttach(n){Object.assign(n.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(n){const{preview:a}=b(this,F2);a.set(n),At(()=>a.set(null)),fe(b(this,zm).bind(this));const l=new ResizeObserver(b(this,zm).bind(this));l.observe(n),At(()=>l.disconnect())}}F2=new WeakMap,zm=new WeakMap,V(bM,"props",{offset:0,noClamp:!1});function Nxe(i,{clamp:o,offset:n,orientation:a}){const l=getComputedStyle(i),s=parseFloat(l.width),d=parseFloat(l.height),p={top:null,right:null,bottom:null,left:null};if(p[a==="horizontal"?"bottom":"left"]=`calc(100% + var(--media-slider-preview-offset, ${n}px))`,a==="horizontal"){const h=s/2;if(!o)p.left=`calc(var(--slider-pointer) - ${h}px)`;else{const f=`max(0px, calc(var(--slider-pointer) - ${h}px))`,g=`calc(100% - ${s}px)`;p.left=`min(${f}, ${g})`}}else{const h=d/2;if(!o)p.bottom=`calc(var(--slider-pointer) - ${h}px)`;else{const f=`max(${h}px, calc(var(--slider-pointer) - ${h}px))`,g=`calc(100% - ${d}px)`;p.bottom=`min(${f}, ${g})`}}Object.assign(i.style,p)}class oC extends dt{constructor(){super(...arguments);P(this,Xi);P(this,qa);P(this,Um,vp(k(this,Xi,cG).bind(this),25))}onSetup(){N(this,qa,Rt());const{audioGain:n}=b(this,qa).$state;ba(Hu,{default:"percent",value(a){return(a*(n()??1)).toFixed(2)},percent(a){return Math.round(a*(n()??1))}}),new wa({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,Xi,lG).bind(this),aria:{valueMax:k(this,Xi,rG).bind(this),valueNow:k(this,Xi,nG).bind(this),valueText:k(this,Xi,aG).bind(this)},onDragValueChange:k(this,Xi,pG).bind(this),onValueChange:k(this,Xi,dG).bind(this)}).attach(this),fe(k(this,Xi,sG).bind(this))}onAttach(n){n.setAttribute("data-media-volume-slider",""),bo(n,"aria-label","Volume");const{canSetVolume:a}=b(this,qa).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}qa=new WeakMap,Xi=new WeakSet,nG=function(){const{value:n}=this.$state,{audioGain:a}=b(this,qa).$state;return Math.round(n()*(a()??1))},aG=function(){const{value:n,max:a}=this.$state,{audioGain:l}=b(this,qa).$state;return Pi(n()/a()*(l()??1)*100,2)+"%"},rG=function(){const{audioGain:n}=b(this,qa).$state;return this.$state.max()*(n()??1)},lG=function(){const{disabled:n}=this.$props,{canSetVolume:a}=b(this,qa).$state;return n()||!a()},sG=function(){const{muted:n,volume:a}=b(this,qa).$state,l=n()?0:a()*100;this.$state.value.set(l),this.dispatch("value-change",{detail:l})},Um=new WeakMap,cG=function(n){if(!n.trigger)return;const a=Pi(n.detail/100,3);b(this,qa).remote.changeVolume(a,n)},dG=function(n){b(this,Um).call(this,n)},pG=function(n){b(this,Um).call(this,n)},V(oC,"props",{...wa.props,keyStep:5,shiftKeyMultiplier:2}),V(oC,"state",Ep);class i4 extends dt{constructor(){super();P(this,it);P(this,zo);P(this,q2);P(this,Hm,ct(null));P(this,V2,!1);const{noSwipeGesture:n}=this.$props;new wa({swipeGesture:()=>!n(),getValue:k(this,it,_S).bind(this),getStep:k(this,it,CG).bind(this),getKeyStep:k(this,it,kG).bind(this),roundValue:k(this,it,xG),isDisabled:k(this,it,SG).bind(this),aria:{valueNow:k(this,it,IG).bind(this),valueText:k(this,it,EG).bind(this)},onDragStart:k(this,it,yG).bind(this),onDragValueChange:k(this,it,wG).bind(this),onDragEnd:k(this,it,AS).bind(this),onValueChange:k(this,it,vG).bind(this)})}onSetup(){N(this,zo,Rt()),ba(Hu,{default:"time",value:k(this,it,AG).bind(this),time:k(this,it,_G).bind(this)}),this.setAttributes({"data-chapters":k(this,it,hG).bind(this)}),this.setStyles({"--slider-progress":k(this,it,uG).bind(this)}),fe(k(this,it,mG).bind(this)),fe(k(this,it,fG).bind(this))}onAttach(n){n.setAttribute("data-media-time-slider",""),bo(n,"aria-label","Seek")}onConnect(n){fe(k(this,it,bG).bind(this)),Wg(b(this,zo).textTracks,"chapters",b(this,Hm).set)}}zo=new WeakMap,q2=new WeakMap,Hm=new WeakMap,it=new WeakSet,uG=function(){const{bufferedEnd:n,duration:a}=b(this,zo).$state;return Pi(Math.min(n()/Math.max(a(),1),1)*100,3)+"%"},hG=function(){var a;const{duration:n}=b(this,zo).$state;return((a=b(this,Hm).call(this))==null?void 0:a.cues.length)&&Number.isFinite(n())&&n()>0},fG=function(){N(this,q2,vp(k(this,it,TS).bind(this),this.$props.seekingRequestThrottle()))},mG=function(){if(this.$state.hidden())return;const{value:n,dragging:a}=this.$state,l=k(this,it,_S).call(this);Re(a)||(n.set(l),this.dispatch("value-change",{detail:l}))},bG=function(){const n=b(this,zo).player.el,{preview:a}=qo(Xv);n&&a()&&We(n,"data-preview",this.$state.active())},TS=function(n,a){b(this,zo).remote.seeking(n,a)},gG=function(n,a,l){b(this,q2).cancel();const{live:s}=b(this,zo).$state;if(s()&&a>=99){b(this,zo).remote.seekToLiveEdge(l);return}b(this,zo).remote.seek(n,l)},V2=new WeakMap,yG=function(n){const{pauseWhileDragging:a}=this.$props;if(a()){const{paused:l}=b(this,zo).$state;N(this,V2,!l()),b(this,zo).remote.pause(n)}},wG=function(n){b(this,q2).call(this,k(this,it,eu).call(this,n.detail),n)},AS=function(n){const{seeking:a}=b(this,zo).$state;Re(a)||k(this,it,TS).call(this,k(this,it,eu).call(this,n.detail),n);const l=n.detail;k(this,it,gG).call(this,k(this,it,eu).call(this,l),l,n);const{pauseWhileDragging:s}=this.$props;s()&&b(this,V2)&&(b(this,zo).remote.play(n),N(this,V2,!1))},vG=function(n){const{dragging:a}=this.$state;a()||!n.trigger||k(this,it,AS).call(this,n)},_S=function(){const{currentTime:n}=b(this,zo).$state;return k(this,it,TG).call(this,n())},CG=function(){const n=this.$props.step()/b(this,zo).$state.duration()*100;return Number.isFinite(n)?n:1},kG=function(){const n=this.$props.keyStep()/b(this,zo).$state.duration()*100;return Number.isFinite(n)?n:1},xG=function(n){return Pi(n,3)},SG=function(){const{disabled:n}=this.$props,{canSeek:a}=b(this,zo).$state;return n()||!a()},IG=function(){const{value:n}=this.$state;return Math.round(n())},EG=function(){const n=k(this,it,eu).call(this,this.$state.value()),{duration:a}=b(this,zo).$state;return Number.isFinite(n)?`${t4(n)} out of ${t4(a())}`:"live"},eu=function(n){const{duration:a}=b(this,zo).$state;return Pi(n/100*a(),5)},TG=function(n){const{liveEdge:a,duration:l}=b(this,zo).$state,s=Math.max(0,Math.min(1,a()?1:Math.min(n,l())/l()));return Number.isNaN(s)?0:Number.isFinite(s)?s*100:100},AG=function(n){const a=k(this,it,eu).call(this,n),{live:l,duration:s}=b(this,zo).$state;return Number.isFinite(a)?(l()?a-s():a).toFixed(0):"LIVE"},_G=function(n,a){const l=k(this,it,eu).call(this,n),{live:s,duration:d}=b(this,zo).$state,p=s()?l-d():l;return Number.isFinite(l)?`${p<0?"-":""}${e4(Math.abs(p),a)}`:"LIVE"},V(i4,"props",{...wa.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100}),V(i4,"state",Ep);const $i=hc();function jxe(i,o){const n=UCe(i,o);for(const{el:a,top:l,left:s}of n)a.scroll({top:l,left:s,behavior:o.behavior})}function Fxe(i,o={}){jxe(i,{scrollMode:"if-needed",block:"center",inline:"center",...o})}const qxe=["a[href]","[tabindex]","input","select","button"].map(i=>`${i}:not([aria-hidden='true'])`).join(","),Vxe=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]);class zxe{constructor(o){P(this,Lo);P(this,Jc,-1);P(this,Cr,null);P(this,ia,[]);P(this,Km);N(this,Km,o)}get items(){return b(this,ia)}attachMenu(o){po(o,"focus",k(this,Lo,DG).bind(this)),N(this,Cr,o),At(()=>{N(this,Cr,null)})}listen(){b(this,Cr)&&(this.update(),new go(b(this,Cr)).add("keyup",k(this,Lo,OG).bind(this)).add("keydown",k(this,Lo,RG).bind(this)),At(()=>{N(this,Jc,-1),N(this,ia,[])}))}update(){N(this,Jc,0),N(this,ia,k(this,Lo,BG).call(this))}scroll(o=k(this,Lo,DS).call(this)){const n=b(this,ia)[o];n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{Fxe(n,{behavior:"smooth",boundary:a=>!a.hasAttribute("data-root")})})})}focusActive(o=!0){const n=k(this,Lo,DS).call(this);k(this,Lo,tu).call(this,n>=0?n:0,o)}}Jc=new WeakMap,Cr=new WeakMap,ia=new WeakMap,Km=new WeakMap,Lo=new WeakSet,tu=function(o,n=!0){var a;N(this,Jc,o),b(this,ia)[o]?(b(this,ia)[o].focus({preventScroll:!0}),n&&this.scroll(o)):(a=b(this,Cr))==null||a.focus({preventScroll:!0})},DS=function(){return b(this,ia).findIndex(o=>document.activeElement===o||o.getAttribute("role")==="menuitemradio"&&o.getAttribute("aria-checked")==="true")},DG=function(){b(this,Jc)>=0||(this.update(),this.focusActive())},OS=function(o){const n=o.target;if(TCe(o)&&n instanceof Element){const a=n.getAttribute("role");return!/a|input|select|button/.test(n.localName)&&!a}return Vxe.has(o.key)},OG=function(o){k(this,Lo,OS).call(this,o)&&(o.stopPropagation(),o.preventDefault())},RG=function(o){if(k(this,Lo,OS).call(this,o))switch(o.stopPropagation(),o.preventDefault(),o.key){case"Escape":b(this,Km).closeMenu(o);break;case"Tab":k(this,Lo,tu).call(this,k(this,Lo,W5).call(this,o.shiftKey?-1:1));break;case"ArrowUp":k(this,Lo,tu).call(this,k(this,Lo,W5).call(this,-1));break;case"ArrowDown":k(this,Lo,tu).call(this,k(this,Lo,W5).call(this,1));break;case"Home":case"PageUp":k(this,Lo,tu).call(this,0);break;case"End":case"PageDown":k(this,Lo,tu).call(this,b(this,ia).length-1);break}},W5=function(o){var a;let n=b(this,Jc);do n=(n+o+b(this,ia).length)%b(this,ia).length;while(((a=b(this,ia)[n])==null?void 0:a.offsetParent)===null);return n},BG=function(){if(!b(this,Cr))return[];const o=b(this,Cr).querySelectorAll(qxe),n=[],a=l=>l.getAttribute("role")==="menu";for(const l of o)Sp(l)&&l.offsetParent!==null&&N$(b(this,Cr),l,a)&&n.push(l);return n};var Uxe=Object.defineProperty,Hxe=Object.getOwnPropertyDescriptor,Gh=(i,o,n,a)=>{for(var l=Hxe(o,n),s=i.length-1,d;s>=0;s--)(d=i[s])&&(l=d(o,n,l)||l);return l&&Uxe(o,n,l),l};let Kxe=0;class Ap extends dt{constructor(){super();P(this,gt);P(this,kr);P(this,z2);P(this,U2);P(this,Mn,ct(!1));P(this,Gm,ct(!1));P(this,kl,ct(null));P(this,Qi,ct(null));P(this,ed);P(this,td,new Set);P(this,w0,null);P(this,v0);P(this,Rs);P(this,C0,!1);P(this,Wm,ct(!1));P(this,k0,new Set);P(this,H2,!1);P(this,f5,k(this,gt,WG).bind(this));P(this,K2,!1);P(this,m5,k(this,gt,ZG).bind(this));P(this,b5,k(this,gt,YG).bind(this));P(this,G2,zu(()=>{const n=Re(b(this,Qi));if(!n)return;let a=0,l=getComputedStyle(n),s=[...n.children];for(const d of["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"])a+=parseFloat(l[d])||0;for(const d of s)if(Sp(d)&&d.style.display==="contents")s.push(...d.children);else if(d.nodeType===3)a+=parseFloat(getComputedStyle(d).fontSize);else if(Sp(d)){if(!$$(d))continue;const p=getComputedStyle(d);a+=d.offsetHeight+(parseFloat(p.marginTop)||0)+(parseFloat(p.marginBottom)||0)}Zn(n,"--menu-height",a+"px")}));P(this,W2,!1);const{showDelay:n}=this.$props;N(this,v0,new rM({trigger:b(this,kl),content:b(this,Qi),showDelay:n,listen:(a,l,s)=>{yc(a,p=>{b(this,Mn).call(this)?s(p):l(p)});const d=k(this,gt,HG).call(this);d&&yc(d,p=>{p.stopPropagation(),s(p)})},onChange:k(this,gt,FG).bind(this)}))}get triggerElement(){return b(this,kl).call(this)}get contentElement(){return b(this,Qi).call(this)}get isSubmenu(){return!!b(this,ed)}onSetup(){N(this,kr,Rt());const n=++Kxe;N(this,z2,`media-menu-${n}`),N(this,U2,`media-menu-button-${n}`),N(this,Rs,new zxe({closeMenu:this.close.bind(this)})),ga($i)&&N(this,ed,qo($i)),k(this,gt,LG).call(this),this.setAttributes({"data-open":b(this,Mn),"data-root":!this.isSubmenu,"data-submenu":this.isSubmenu,"data-disabled":k(this,gt,j3).bind(this)}),ba($i,{button:b(this,kl),content:b(this,Qi),expanded:b(this,Mn),hint:ct(""),submenu:!!b(this,ed),disable:k(this,gt,VG).bind(this),attachMenuButton:k(this,gt,$G).bind(this),attachMenuItems:k(this,gt,MG).bind(this),attachObserver:k(this,gt,NG).bind(this),disableMenuButton:k(this,gt,jG).bind(this),addSubmenu:k(this,gt,GG).bind(this),onTransitionEvent:a=>{b(this,k0).add(a),At(()=>{b(this,k0).delete(a)})}})}onAttach(n){n.style.setProperty("display","contents")}onConnect(n){var a;fe(k(this,gt,PG).bind(this)),this.isSubmenu&&((a=b(this,ed))==null||a.addSubmenu(this))}onDestroy(){b(this,kl).set(null),b(this,Qi).set(null),N(this,w0,null),b(this,k0).clear()}open(n){Re(b(this,Mn))||(b(this,v0).show(n),is())}close(n){Re(b(this,Mn))&&(b(this,v0).hide(n),is())}}kr=new WeakMap,z2=new WeakMap,U2=new WeakMap,Mn=new WeakMap,Gm=new WeakMap,kl=new WeakMap,Qi=new WeakMap,ed=new WeakMap,td=new WeakMap,w0=new WeakMap,v0=new WeakMap,Rs=new WeakMap,C0=new WeakMap,Wm=new WeakMap,k0=new WeakMap,gt=new WeakSet,LG=function(){let n=-1,a=ga(Kh)?qo(Kh):null;ba(Kh,{onDragStart:()=>{var l;(l=a==null?void 0:a.onDragStart)==null||l.call(a),window.clearTimeout(n),n=-1,N(this,C0,!0)},onDragEnd:()=>{var l;(l=a==null?void 0:a.onDragEnd)==null||l.call(a),n=window.setTimeout(()=>{N(this,C0,!1),n=-1},300)}})},PG=function(){const n=k(this,gt,qG).call(this);this.isSubmenu||b(this,G2).call(this),k(this,gt,RS).call(this,n),n&&(fe(()=>{const{height:a}=b(this,kr).$state,l=b(this,Qi).call(this);l&&Zn(l,"--player-height",a()+"px")}),b(this,Rs).listen(),this.listen("pointerup",k(this,gt,zG).bind(this)),po(window,"pointerup",k(this,gt,UG).bind(this)))},$G=function(n){const a=n.el,l=this.isSubmenu,s=sn(k(this,gt,j3).bind(this));bo(a,"tabindex",l?"-1":"0"),bo(a,"role",l?"menuitem":"button"),We(a,"id",b(this,U2)),We(a,"aria-haspopup","menu"),We(a,"aria-expanded","false"),We(a,"data-root",!this.isSubmenu),We(a,"data-submenu",this.isSubmenu),fe(()=>{We(a,"data-open",b(this,Mn).call(this)),We(a,"aria-disabled",s())}),b(this,kl).set(a),At(()=>{b(this,kl).set(null)})},MG=function(n){var d;const a=n.el;a.style.setProperty("display","none"),We(a,"id",b(this,z2)),bo(a,"role","menu"),bo(a,"tabindex","-1"),We(a,"data-root",!this.isSubmenu),We(a,"data-submenu",this.isSubmenu),b(this,Qi).set(a),At(()=>b(this,Qi).set(null)),fe(()=>We(a,"data-open",b(this,Mn).call(this))),b(this,Rs).attachMenu(a),k(this,gt,RS).call(this,!1);const s=k(this,gt,XG).bind(this);this.isSubmenu?(d=b(this,ed))==null||d.onTransitionEvent(s):(n.listen("transitionstart",s),n.listen("transitionend",s),n.listen("animationend",b(this,G2)),n.listen("vds-menu-resize",b(this,G2)))},NG=function(n){N(this,w0,n)},RS=function(n){const a=Re(b(this,Qi));a&&We(a,"aria-hidden",qg(!n))},jG=function(n){b(this,Wm).set(n)},H2=new WeakMap,FG=function(n,a){var d,p,h,f,g,w;if(N(this,H2,jg(a)),a==null||a.stopPropagation(),b(this,Mn).call(this)===n)return;if(k(this,gt,j3).call(this)){n&&b(this,v0).hide(a);return}(d=this.el)==null||d.dispatchEvent(new Event("vds-menu-resize",{bubbles:!0,composed:!0}));const l=b(this,kl).call(this),s=b(this,Qi).call(this);if(l&&(We(l,"aria-controls",n&&b(this,z2)),We(l,"aria-expanded",qg(n))),s&&We(s,"aria-labelledby",n&&b(this,U2)),b(this,Mn).set(n),k(this,gt,KG).call(this,a),is(),b(this,H2)){n?s==null||s.focus():l==null||l.focus();for(const v of[this.el,s])v&&v.setAttribute("data-keyboard","")}else for(const v of[this.el,s])v&&v.removeAttribute("data-keyboard");if(this.dispatch(n?"open":"close",{trigger:a}),n)!this.isSubmenu&&b(this,kr).activeMenu!==this&&((p=b(this,kr).activeMenu)==null||p.close(a),b(this,kr).activeMenu=this),(f=(h=b(this,w0))==null?void 0:h.onOpen)==null||f.call(h,a);else{if(this.isSubmenu)for(const v of b(this,td))v.close(a);else b(this,kr).activeMenu=null;(w=(g=b(this,w0))==null?void 0:g.onClose)==null||w.call(g,a)}n&&requestAnimationFrame(k(this,gt,BS).bind(this))},BS=function(){b(this,W2)||b(this,K2)||(b(this,Rs).update(),requestAnimationFrame(()=>{b(this,H2)?b(this,Rs).focusActive():b(this,Rs).scroll()}))},qG=function(){return!k(this,gt,j3).call(this)&&b(this,Mn).call(this)},j3=function(){return b(this,Gm).call(this)||b(this,Wm).call(this)},VG=function(n){b(this,Gm).set(n)},zG=function(n){const a=b(this,Qi).call(this);b(this,C0)||a&&P$(a,n)||n.stopPropagation()},UG=function(n){const a=b(this,Qi).call(this);b(this,C0)||a&&P$(a,n)||this.close(n)},HG=function(){var a;const n=(a=this.el)==null?void 0:a.querySelector('[data-part="close-target"]');return this.el&&n&&N$(this.el,n,l=>l.getAttribute("role")==="menu")?n:null},KG=function(n){this.isSubmenu||(b(this,Mn).call(this)?b(this,kr).remote.pauseControls(n):b(this,kr).remote.resumeControls(n))},GG=function(n){b(this,td).add(n),new go(n).add("open",b(this,m5)).add("close",b(this,b5)),At(b(this,f5))},f5=new WeakMap,WG=function(n){b(this,td).delete(n)},K2=new WeakMap,m5=new WeakMap,ZG=function(n){var l;N(this,K2,!0);const a=b(this,Qi).call(this);this.isSubmenu&&((l=this.triggerElement)==null||l.setAttribute("aria-hidden","true"));for(const s of b(this,td))if(s!==n.target)for(const d of[s.el,s.triggerElement])d==null||d.setAttribute("aria-hidden","true");if(a){const s=n.target.el;for(const d of a.children)d.contains(s)?d.setAttribute("data-open",""):d!==s&&d.setAttribute("data-hidden","")}},b5=new WeakMap,YG=function(n){var l;N(this,K2,!1);const a=b(this,Qi).call(this);this.isSubmenu&&((l=this.triggerElement)==null||l.setAttribute("aria-hidden","false"));for(const s of b(this,td))for(const d of[s.el,s.triggerElement])d==null||d.setAttribute("aria-hidden","false");if(a)for(const s of a.children)s.removeAttribute("data-open"),s.removeAttribute("data-hidden")},G2=new WeakMap,W2=new WeakMap,XG=function(n){const a=b(this,Qi).call(this);a&&n.propertyName==="height"&&(N(this,W2,n.type==="transitionstart"),We(a,"data-transition",b(this,W2)?"height":null),b(this,Mn).call(this)&&k(this,gt,BS).call(this));for(const l of b(this,k0))l(n)},V(Ap,"props",{showDelay:0}),Gh([$t],Ap.prototype,"triggerElement"),Gh([$t],Ap.prototype,"contentElement"),Gh([$t],Ap.prototype,"isSubmenu"),Gh([ti],Ap.prototype,"open"),Gh([ti],Ap.prototype,"close");class n4 extends dt{constructor(){super();P(this,Bs);P(this,od);P(this,Zm,ct(null));new dr}get expanded(){var n;return((n=b(this,od))==null?void 0:n.expanded())??!1}onSetup(){N(this,od,qo($i))}onAttach(n){b(this,od).attachMenuButton(this),fe(k(this,Bs,QG).bind(this)),bo(n,"type","button")}onConnect(n){fe(k(this,Bs,JG).bind(this)),k(this,Bs,LS).call(this);const a=new MutationObserver(k(this,Bs,LS).bind(this));a.observe(n,{attributeFilter:["data-part"],childList:!0,subtree:!0}),At(()=>a.disconnect()),yc(n,l=>{this.dispatch("select",{trigger:l})})}}od=new WeakMap,Zm=new WeakMap,Bs=new WeakSet,QG=function(){b(this,od).disableMenuButton(this.$props.disabled())},JG=function(){const n=b(this,Zm).call(this);n&&fe(()=>{const a=b(this,od).hint();a&&(n.textContent=a)})},LS=function(){var a;const n=(a=this.el)==null?void 0:a.querySelector('[data-part="hint"]');b(this,Zm).set(n??null)},V(n4,"props",{disabled:!1});const Gxe=n4.prototype;$t(Gxe,"expanded");class Wxe extends n4{}class gM extends dt{constructor(){super(...arguments);P(this,xr);P(this,na,null);P(this,Ym)}onSetup(){N(this,Ym,Rt()),ba(a4,{attach:k(this,xr,eW).bind(this)})}onAttach(n){n.style.setProperty("display","contents")}onConnect(n){}onDestroy(){var n;(n=b(this,na))==null||n.remove(),N(this,na,null)}}na=new WeakMap,Ym=new WeakMap,xr=new WeakSet,eW=function(n){k(this,xr,PS).call(this,!1),N(this,na,n),ls(()=>{ls(()=>{this.connectScope&&fe(k(this,xr,tW).bind(this))})})},tW=function(){const{fullscreen:n}=b(this,Ym).$state,{disabled:a}=this.$props;k(this,xr,PS).call(this,a()==="fullscreen"?!n():!a())},PS=function(n){var s;if(!b(this,na))return;let a=k(this,xr,oW).call(this,this.$props.container());if(!a)return;const l=b(this,na).parentElement===a;We(b(this,na),"data-portal",n),n?l||(b(this,na).remove(),a.append(b(this,na))):l&&b(this,na).parentElement===a&&(b(this,na).remove(),(s=this.el)==null||s.append(b(this,na)))},oW=function(n){return Sp(n)?n:n?document.querySelector(n):document.body},V(gM,"props",{container:null,disabled:!1});const a4=hc();class yM extends dt{constructor(){super();P(this,id);P(this,x0);new dr;const{placement:n}=this.$props;this.setAttributes({"data-placement":n})}onAttach(n){if(N(this,x0,qo($i)),b(this,x0).attachMenuItems(this),ga(a4)){const a=qo(a4);a&&(ba(a4,null),a.attach(n),At(()=>a.attach(null)))}}onConnect(n){fe(k(this,id,iW).bind(this))}}x0=new WeakMap,id=new WeakSet,iW=function(){const{expanded:n}=b(this,x0);if(!this.el||!n())return;const a=this.$props.placement();if(!a)return;Object.assign(this.el.style,{position:"absolute",top:0,left:0,width:"max-content"});const{offset:l,alignOffset:s}=this.$props;At(j$(this.el,k(this,id,aW).call(this),a,{offsetVarName:"media-menu",xOffset:s(),yOffset:l()})),At(k(this,id,nW).bind(this))},nW=function(){this.el&&(this.el.removeAttribute("style"),this.el.style.display="none")},aW=function(){return b(this,x0).button()},V(yM,"props",{placement:null,offset:0,alignOffset:0});const iC=hc();class _p extends $a{constructor(){super(...arguments);P(this,Va);P(this,Ls,new Set);P(this,nd,ct(""));P(this,ux,null);V(this,"onValueChange");P(this,g5,k(this,Va,$S).bind(this))}get values(){return Array.from(b(this,Ls)).map(n=>n.value())}get value(){return b(this,nd).call(this)}set value(n){k(this,Va,$S).call(this,n)}onSetup(){ba(iC,{add:k(this,Va,rW).bind(this),remove:k(this,Va,lW).bind(this)})}onAttach(n){ga($i)||bo(n,"role","radiogroup"),this.setAttributes({value:b(this,nd)})}onDestroy(){b(this,Ls).clear()}}Ls=new WeakMap,nd=new WeakMap,ux=new WeakMap,Va=new WeakSet,rW=function(n){b(this,Ls).has(n)||(b(this,Ls).add(n),n.onCheck=b(this,g5),n.check(n.value()===b(this,nd).call(this)))},lW=function(n){n.onCheck=null,b(this,Ls).delete(n)},g5=new WeakMap,$S=function(n,a){var p;const l=Re(b(this,nd));if(!n||n===l)return;const s=k(this,Va,MS).call(this,l),d=k(this,Va,MS).call(this,n);s==null||s.check(!1,a),d==null||d.check(!0,a),b(this,nd).set(n),(p=this.onValueChange)==null||p.call(this,n,a)},MS=function(n){for(const a of b(this,Ls))if(n===Re(a.value))return a;return null};class nC extends dt{constructor(){super();P(this,mn);P(this,xl,ct(!1));P(this,S0,{value:this.$props.value,check:k(this,mn,uW).bind(this),onCheck:null});new dr}get checked(){return b(this,xl).call(this)}onSetup(){this.setAttributes({value:this.$props.value,"data-checked":b(this,xl),"aria-checked":sn(b(this,xl))})}onAttach(n){const a=ga($i);bo(n,"tabindex",a?"-1":"0"),bo(n,"role",a?"menuitemradio":"radio"),fe(k(this,mn,dW).bind(this))}onConnect(n){k(this,mn,cW).call(this),yc(n,k(this,mn,pW).bind(this)),At(k(this,mn,sW).bind(this))}}xl=new WeakMap,S0=new WeakMap,mn=new WeakSet,sW=function(){kn(()=>{qo(iC).remove(b(this,S0))},this.connectScope)},cW=function(){qo(iC).add(b(this,S0))},dW=function(){var l,s;const{value:n}=this.$props,a=n();Re(b(this,xl))&&((s=(l=b(this,S0)).onCheck)==null||s.call(l,a))},pW=function(n){var a,l;Re(b(this,xl))||(k(this,mn,NS).call(this,!0,n),k(this,mn,hW).call(this,n),(l=(a=b(this,S0)).onCheck)==null||l.call(a,Re(this.$props.value),n))},uW=function(n,a){Re(b(this,xl))!==n&&k(this,mn,NS).call(this,n,a)},NS=function(n,a){b(this,xl).set(n),this.dispatch("change",{detail:n,trigger:a})},hW=function(n){this.dispatch("select",{trigger:n})},V(nC,"props",{value:""});const Zxe=nC.prototype;$t(Zxe,"checked");class aC extends dt{constructor(){super();P(this,za);P(this,Z2);P(this,Sr);P(this,I0);N(this,I0,new _p),b(this,I0).onValueChange=k(this,za,yW).bind(this)}get value(){return b(this,I0).value}get disabled(){const{audioTracks:n}=b(this,Sr).$state;return n().length<=1}onSetup(){N(this,Sr,Rt()),ga($i)&&N(this,Z2,qo($i))}onConnect(n){fe(k(this,za,fW).bind(this)),fe(k(this,za,bW).bind(this)),fe(k(this,za,mW).bind(this))}getOptions(){const{audioTracks:n}=b(this,Sr).$state;return n().map(a=>({track:a,label:a.label,value:a.label.toLowerCase()}))}}Z2=new WeakMap,Sr=new WeakMap,I0=new WeakMap,za=new WeakSet,fW=function(){b(this,I0).value=k(this,za,gW).call(this)},mW=function(){var s;const{emptyLabel:n}=this.$props,{audioTrack:a}=b(this,Sr).$state,l=a();(s=b(this,Z2))==null||s.hint.set((l==null?void 0:l.label)??n())},bW=function(){var n;(n=b(this,Z2))==null||n.disable(this.disabled)},gW=function(){const{audioTrack:n}=b(this,Sr).$state,a=n();return a?a.label.toLowerCase():""},yW=function(n,a){if(this.disabled)return;const l=b(this,Sr).audioTracks.toArray().findIndex(s=>s.label.toLowerCase()===n);if(l>=0){const s=b(this,Sr).audioTracks[l];b(this,Sr).remote.changeAudioTrack(l,a),this.dispatch("change",{detail:s,trigger:a})}},V(aC,"props",{emptyLabel:"Default"});const rC=aC.prototype;$t(rC,"value"),$t(rC,"disabled"),ti(rC,"getOptions");class lC extends dt{constructor(){super();P(this,Tn);P(this,aa);P(this,Y2);P(this,E0);N(this,E0,new _p),b(this,E0).onValueChange=k(this,Tn,xW).bind(this)}get value(){return b(this,E0).value}get disabled(){const{hasCaptions:n}=b(this,aa).$state;return!n()}onSetup(){N(this,aa,Rt()),ga($i)&&N(this,Y2,qo($i))}onConnect(n){var a;(a=super.onConnect)==null||a.call(this,n),fe(k(this,Tn,wW).bind(this)),fe(k(this,Tn,CW).bind(this)),fe(k(this,Tn,vW).bind(this))}getOptions(){const{offLabel:n}=this.$props,{textTracks:a}=b(this,aa).$state;return[{value:"off",label:n},...a().filter(xn).map(l=>({track:l,label:l.label,value:k(this,Tn,Z5).call(this,l)}))]}}aa=new WeakMap,Y2=new WeakMap,E0=new WeakMap,Tn=new WeakSet,wW=function(){b(this,E0).value=k(this,Tn,kW).call(this)},vW=function(){var s;const{offLabel:n}=this.$props,{textTrack:a}=b(this,aa).$state,l=a();(s=b(this,Y2))==null||s.hint.set(l&&xn(l)&&l.mode==="showing"?l.label:n())},CW=function(){var n;(n=b(this,Y2))==null||n.disable(this.disabled)},kW=function(){const{textTrack:n}=b(this,aa).$state,a=n();return a&&xn(a)&&a.mode==="showing"?k(this,Tn,Z5).call(this,a):"off"},xW=function(n,a){if(this.disabled)return;if(n==="off"){const s=b(this,aa).textTracks.selected;if(s){const d=b(this,aa).textTracks.indexOf(s);b(this,aa).remote.changeTextTrackMode(d,"disabled",a),this.dispatch("change",{detail:null,trigger:a})}return}const l=b(this,aa).textTracks.toArray().findIndex(s=>k(this,Tn,Z5).call(this,s)===n);if(l>=0){const s=b(this,aa).textTracks[l];b(this,aa).remote.changeTextTrackMode(l,"showing",a),this.dispatch("change",{detail:s,trigger:a})}},Z5=function(n){return n.id+":"+n.kind+"-"+n.label.toLowerCase()},V(lC,"props",{offLabel:"Off"});const sC=lC.prototype;$t(sC,"value"),$t(sC,"disabled"),ti(sC,"getOptions");const Yxe=[.25,.5,.75,1,1.25,1.5,1.75,2];class cC extends dt{constructor(){super();P(this,Ua);P(this,ad);P(this,X2);P(this,T0);N(this,T0,new _p),b(this,T0).onValueChange=k(this,Ua,AW).bind(this)}get value(){return b(this,T0).value}get disabled(){const{rates:n}=this.$props,{canSetPlaybackRate:a}=b(this,ad).$state;return!a()||n().length===0}onSetup(){N(this,ad,Rt()),ga($i)&&N(this,X2,qo($i))}onConnect(n){fe(k(this,Ua,SW).bind(this)),fe(k(this,Ua,IW).bind(this)),fe(k(this,Ua,EW).bind(this))}getOptions(){const{rates:n,normalLabel:a}=this.$props;return n().map(l=>({label:l===1?a:l+"×",value:l.toString()}))}}ad=new WeakMap,X2=new WeakMap,T0=new WeakMap,Ua=new WeakSet,SW=function(){b(this,T0).value=k(this,Ua,TW).call(this)},IW=function(){var s;const{normalLabel:n}=this.$props,{playbackRate:a}=b(this,ad).$state,l=a();(s=b(this,X2))==null||s.hint.set(l===1?n():l+"×")},EW=function(){var n;(n=b(this,X2))==null||n.disable(this.disabled)},TW=function(){const{playbackRate:n}=b(this,ad).$state;return n().toString()},AW=function(n,a){if(this.disabled)return;const l=+n;b(this,ad).remote.changePlaybackRate(l,a),this.dispatch("change",{detail:l,trigger:a})},V(cC,"props",{normalLabel:"Normal",rates:Yxe});const dC=cC.prototype;$t(dC,"value"),$t(dC,"disabled"),ti(dC,"getOptions");class pC extends dt{constructor(){super();P(this,An);P(this,Ir);P(this,Q2);P(this,A0);P(this,y5,cr(()=>{const{sort:n}=this.$props,{qualities:a}=b(this,Ir).$state;return nM(a(),n()==="descending")}));N(this,A0,new _p),b(this,A0).onValueChange=k(this,An,RW).bind(this)}get value(){return b(this,A0).value}get disabled(){const{canSetQuality:n,qualities:a}=b(this,Ir).$state;return!n()||a().length<=1}onSetup(){N(this,Ir,Rt()),ga($i)&&N(this,Q2,qo($i))}onConnect(n){fe(k(this,An,_W).bind(this)),fe(k(this,An,OW).bind(this)),fe(k(this,An,DW).bind(this))}getOptions(){const{autoLabel:n,hideBitrate:a}=this.$props;return[{value:"auto",label:n},...b(this,y5).call(this).map(l=>{const s=l.bitrate&&l.bitrate>=0?`${Pi(l.bitrate/1e6,2)} Mbps`:null;return{quality:l,label:l.height+"p",value:k(this,An,Y5).call(this,l),bitrate:()=>a()?null:s}})]}}Ir=new WeakMap,Q2=new WeakMap,A0=new WeakMap,y5=new WeakMap,An=new WeakSet,_W=function(){b(this,A0).value=k(this,An,BW).call(this)},DW=function(){var d;const{autoLabel:n}=this.$props,{autoQuality:a,quality:l}=b(this,Ir).$state,s=l()?l().height+"p":"";(d=b(this,Q2))==null||d.hint.set(a()?n()+(s?` (${s})`:""):s)},OW=function(){var n;(n=b(this,Q2))==null||n.disable(this.disabled)},RW=function(n,a){if(this.disabled)return;if(n==="auto"){b(this,Ir).remote.changeQuality(-1,a),this.dispatch("change",{detail:"auto",trigger:a});return}const{qualities:l}=b(this,Ir).$state,s=Re(l).findIndex(d=>k(this,An,Y5).call(this,d)===n);if(s>=0){const d=Re(l)[s];b(this,Ir).remote.changeQuality(s,a),this.dispatch("change",{detail:d,trigger:a})}},BW=function(){const{quality:n,autoQuality:a}=b(this,Ir).$state;if(a())return"auto";const l=n();return l?k(this,An,Y5).call(this,l):"auto"},Y5=function(n){return n.height+"_"+n.bitrate},V(pC,"props",{autoLabel:"Auto",hideBitrate:!1,sort:"descending"});const uC=pC.prototype;$t(uC,"value"),$t(uC,"disabled"),ti(uC,"getOptions");class hC extends dt{constructor(){super(...arguments);P(this,Ai);P(this,J2);P(this,rd,ct(null));P(this,Xm,ct(!0));P(this,Qm,ct(!0))}onSetup(){N(this,J2,Rt()),k(this,Ai,jS).call(this);const{type:n}=this.$props;this.setAttributes({"data-type":n,"data-remainder":k(this,Ai,FS).bind(this)}),new mM({callback:k(this,Ai,LW).bind(this)}).attach(this)}onAttach(n){n.hasAttribute("role")||fe(k(this,Ai,MW).bind(this)),fe(k(this,Ai,jS).bind(this))}onConnect(n){At(M$(n,b(this,Xm).set)),fe(k(this,Ai,PW).bind(this)),fe(k(this,Ai,$W).bind(this))}}J2=new WeakMap,rd=new WeakMap,Xm=new WeakMap,Qm=new WeakMap,Ai=new WeakSet,LW=function(n){b(this,Qm).set(n[0].isIntersecting)},PW=function(){const{hidden:n}=this.$props;this.$state.hidden.set(n()||!b(this,Xm).call(this)||!b(this,Qm).call(this))},$W=function(){if(!this.$props.toggle()){b(this,rd).set(null);return}this.el&&yc(this.el,k(this,Ai,jW).bind(this))},jS=function(){const{hidden:n,timeText:a}=this.$state,{duration:l}=b(this,J2).$state;if(n())return;const{type:s,padHours:d,padMinutes:p,showHours:h}=this.$props,f=k(this,Ai,NW).call(this,s()),g=l(),w=k(this,Ai,FS).call(this);if(!Number.isFinite(f+g)){a.set("LIVE");return}const v=w?Math.max(0,g-f):f,C=e4(v,{padHrs:d(),padMins:p(),showHrs:h()});a.set((w?"-":"")+C)},MW=function(){if(!this.el)return;const{toggle:n}=this.$props;We(this.el,"role",n()?"timer":null),We(this.el,"tabindex",n()?0:null)},NW=function(n){const{bufferedEnd:a,duration:l,currentTime:s}=b(this,J2).$state;switch(n){case"buffered":return a();case"duration":return l();default:return s()}},FS=function(){return this.$props.remainder()&&b(this,rd).call(this)!==!1},jW=function(n){if(n.preventDefault(),b(this,rd).call(this)===null){b(this,rd).set(!this.$props.remainder());return}b(this,rd).set(a=>!a)},V(hC,"props",{type:"current",showHours:!1,padHours:null,padMinutes:null,remainder:!1,toggle:!1,hidden:!1}),V(hC,"state",new fc({timeText:"",hidden:!1}));class fC extends dt{constructor(){super(...arguments);P(this,Po);P(this,Sl);P(this,e1,!1);P(this,ld,-1);P(this,t1,-1)}onSetup(){N(this,Sl,Rt())}onAttach(n){n.style.display="contents"}onConnect(n){n.setAttribute("data-media-announcer",""),bo(n,"role","status"),bo(n,"aria-live","polite");const{busy:a}=this.$state;this.setAttributes({"aria-busy":()=>a()?"true":null}),N(this,e1,!0),fe(k(this,Po,FW).bind(this)),fe(k(this,Po,UW).bind(this)),fe(k(this,Po,zW).bind(this)),fe(k(this,Po,qW).bind(this)),fe(k(this,Po,VW).bind(this)),fe(k(this,Po,HW).bind(this)),fe(k(this,Po,KW).bind(this)),is(),N(this,e1,!1)}}Sl=new WeakMap,e1=new WeakMap,Po=new WeakSet,FW=function(){const{paused:n}=b(this,Sl).$state;k(this,Po,ou).call(this,n()?"Pause":"Play")},qW=function(){const{fullscreen:n}=b(this,Sl).$state;k(this,Po,ou).call(this,n()?"Enter Fullscreen":"Exit Fullscreen")},VW=function(){const{pictureInPicture:n}=b(this,Sl).$state;k(this,Po,ou).call(this,n()?"Enter PiP":"Exit PiP")},zW=function(){const{textTrack:n}=b(this,Sl).$state;k(this,Po,ou).call(this,n()?"Closed-Captions On":"Closed-Captions Off")},UW=function(){const{muted:n,volume:a,audioGain:l}=b(this,Sl).$state;k(this,Po,ou).call(this,n()||a()===0?"Mute":`${Math.round(a()*(l()??1)*100)}% ${k(this,Po,X5).call(this,"Volume")}`)},ld=new WeakMap,t1=new WeakMap,HW=function(){const{seeking:n,currentTime:a}=b(this,Sl).$state,l=n();b(this,ld)>0?(window.clearTimeout(b(this,t1)),N(this,t1,window.setTimeout(()=>{if(!this.scope)return;const s=Re(a),d=Math.abs(s-b(this,ld));if(d>=1){const p=s>=b(this,ld),h=t4(d);k(this,Po,ou).call(this,`${k(this,Po,X5).call(this,p?"Seek Forward":"Seek Backward")} ${h}`)}N(this,ld,-1),N(this,t1,-1)},300))):l&&N(this,ld,Re(a))},X5=function(n){var l;const{translations:a}=this.$props;return((l=a==null?void 0:a())==null?void 0:l[n||""])??n},KW=function(){const{label:n,busy:a}=this.$state,l=k(this,Po,X5).call(this,n());if(b(this,e1))return;a.set(!0);const s=window.setTimeout(()=>void a.set(!1),150);return this.el&&We(this.el,"aria-label",l),et(l)&&this.dispatch("change",{detail:l}),()=>window.clearTimeout(s)},ou=function(n){const{label:a}=this.$state;a.set(n)},V(fC,"props",{translations:null}),V(fC,"state",new fc({label:null,busy:!1}));class wM extends dt{constructor(){super(...arguments);P(this,$s);P(this,Ps)}onSetup(){N(this,Ps,Rt()),fe(k(this,$s,WW).bind(this))}onAttach(n){const{pictureInPicture:a,fullscreen:l}=b(this,Ps).$state;Zn(n,"pointer-events","none"),bo(n,"role","group"),this.setAttributes({"data-visible":k(this,$s,qS).bind(this),"data-fullscreen":l,"data-pip":a}),fe(()=>{this.dispatch("change",{detail:k(this,$s,qS).call(this)})}),fe(k(this,$s,GW).bind(this)),fe(()=>{const s=l();for(const d of["top","right","bottom","left"])Zn(n,`padding-${d}`,s&&`env(safe-area-inset-${d})`)})}}Ps=new WeakMap,$s=new WeakSet,GW=function(){if(!this.el)return;const{nativeControls:n}=b(this,Ps).$state,a=n();We(this.el,"aria-hidden",a?"true":null),Zn(this.el,"display",a?"none":null)},WW=function(){const{controls:n}=b(this,Ps).player,{hideDelay:a,hideOnMouseLeave:l}=this.$props;n.defaultDelay=a()===2e3?b(this,Ps).$props.controlsDelay():a(),n.hideOnMouseLeave=l()},qS=function(){const{controlsVisible:n}=b(this,Ps).$state;return n()},V(wM,"props",{hideDelay:2e3,hideOnMouseLeave:!1});class Xxe extends dt{onAttach(o){o.style.pointerEvents||Zn(o,"pointer-events","auto")}}const Dp=hc();let Qxe=0,Jxe=(hx=class extends dt{constructor(){super();P(this,Ha);P(this,o1,`media-tooltip-${++Qxe}`);P(this,sd,ct(null));P(this,cd,ct(null));P(this,Jm,ct(!1));new dr;const{showDelay:n}=this.$props;new rM({trigger:b(this,sd),content:b(this,cd),showDelay:n,listen(a,l,s){fe(()=>{Zg()&&po(a,"focus",l),po(a,"blur",s)}),new go(a).add("touchstart",d=>d.preventDefault(),{passive:!1}).add("mouseenter",l).add("mouseleave",s)},onChange:k(this,Ha,JW).bind(this)})}onAttach(n){n.style.setProperty("display","contents")}onSetup(){ba(Dp,{trigger:b(this,sd),content:b(this,cd),showing:b(this,Jm),attachTrigger:k(this,Ha,ZW).bind(this),detachTrigger:k(this,Ha,YW).bind(this),attachContent:k(this,Ha,XW).bind(this),detachContent:k(this,Ha,QW).bind(this)})}},o1=new WeakMap,sd=new WeakMap,cd=new WeakMap,Jm=new WeakMap,Ha=new WeakSet,ZW=function(n){var l;b(this,sd).set(n);let a=n.getAttribute("data-media-tooltip");a&&((l=this.el)==null||l.setAttribute(`data-media-${a}-tooltip`,"")),We(n,"data-describedby",b(this,o1))},YW=function(n){n.removeAttribute("data-describedby"),n.removeAttribute("aria-describedby"),b(this,sd).set(null)},XW=function(n){n.setAttribute("id",b(this,o1)),n.style.display="none",bo(n,"role","tooltip"),b(this,cd).set(n)},QW=function(n){n.removeAttribute("id"),n.removeAttribute("role"),b(this,cd).set(null)},JW=function(n){const a=b(this,sd).call(this),l=b(this,cd).call(this);a&&We(a,"aria-describedby",n?b(this,o1):null);for(const s of[this.el,a,l])s&&We(s,"data-visible",n);b(this,Jm).set(n)},V(hx,"props",{showDelay:700}),hx);class eSe extends dt{constructor(){super();P(this,_0);new dr}onConnect(n){At(ls(()=>{if(!this.connectScope)return;k(this,_0,eZ).call(this);const a=qo(Dp);At(()=>{const l=k(this,_0,VS).call(this);l&&a.detachTrigger(l)})}))}}_0=new WeakSet,eZ=function(){const n=k(this,_0,VS).call(this),a=qo(Dp);n&&a.attachTrigger(n)},VS=function(){const n=this.el.firstElementChild;return(n==null?void 0:n.localName)==="button"||(n==null?void 0:n.getAttribute("role"))==="button"?n:this.el};class vM extends dt{constructor(){super();P(this,Ms);new dr;const{placement:n}=this.$props;this.setAttributes({"data-placement":n})}onAttach(n){k(this,Ms,zS).call(this,n),Object.assign(n.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(n){k(this,Ms,zS).call(this,n);const a=qo(Dp);At(()=>a.detachContent(n)),At(ls(()=>{this.connectScope&&fe(k(this,Ms,tZ).bind(this))}))}}Ms=new WeakSet,zS=function(n){qo(Dp).attachContent(n)},tZ=function(){const{showing:n}=qo(Dp);if(!n())return;const{placement:a,offset:l,alignOffset:s}=this.$props;return j$(this.el,k(this,Ms,oZ).call(this),a(),{offsetVarName:"media-tooltip",xOffset:s(),yOffset:l()})},oZ=function(){return qo(Dp).trigger()},V(vM,"props",{placement:"top center",offset:0,alignOffset:0});let CM=(fx=class extends dt{constructor(){super();P(this,e3,ct(!1));new Sn({isPresssed:b(this,e3)})}get pressed(){return b(this,e3).call(this)}},e3=new WeakMap,V(fx,"props",{disabled:!1,defaultPressed:!1}),fx);const tSe=CM.prototype;$t(tSe,"pressed");class kM extends dt{constructor(){super();P(this,Il);P(this,Ns);new Sn({isPresssed:k(this,Il,nZ).bind(this),onPress:k(this,Il,iZ).bind(this)})}onSetup(){N(this,Ns,Rt());const{canGoogleCast:n,isGoogleCastConnected:a}=b(this,Ns).$state;this.setAttributes({"data-active":a,"data-supported":n,"data-state":k(this,Il,aZ).bind(this),"aria-hidden":sn(()=>!n())})}onAttach(n){n.setAttribute("data-media-tooltip","google-cast"),gc(n,k(this,Il,rZ).bind(this))}}Ns=new WeakMap,Il=new WeakSet,iZ=function(n){b(this,Ns).remote.requestGoogleCast(n)},nZ=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ns).$state;return n()==="google-cast"&&a()!=="disconnected"},aZ=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ns).$state;return n()==="google-cast"&&a()},rZ=function(){const{remotePlaybackState:n}=b(this,Ns).$state;return`Google Cast ${n()}`},V(kM,"props",Sn.props);class r4 extends dt{constructor(){super(...arguments);P(this,Uo);P(this,dd);P(this,t3)}get video(){return this.$state.video()}onSetup(){N(this,dd,Rt()),N(this,t3,qu(Tp.state)),k(this,Uo,US).call(this),this.setAttributes({"data-loading":k(this,Uo,cZ).bind(this),"data-hidden":this.$state.hidden,"data-error":k(this,Uo,HS).bind(this),"aria-hidden":sn(this.$state.hidden)})}onAttach(n){fe(k(this,Uo,lZ).bind(this)),fe(k(this,Uo,sZ).bind(this)),fe(k(this,Uo,US).bind(this)),fe(k(this,Uo,dZ).bind(this)),fe(k(this,Uo,pZ).bind(this)),fe(k(this,Uo,hZ).bind(this))}}dd=new WeakMap,t3=new WeakMap,Uo=new WeakSet,lZ=function(){const n=this.$state.video();n&&(n.readyState>=2&&k(this,Uo,KS).call(this),new go(n).add("canplay",k(this,Uo,KS).bind(this)).add("error",k(this,Uo,uZ).bind(this)))},sZ=function(){const{src:n}=this.$state,{canLoad:a}=b(this,dd).$state;n.set(a()?this.$props.src():null)},US=function(){const{crossOrigin:n}=this.$props,{crossOrigin:a}=this.$state,{crossOrigin:l}=b(this,dd).$state,s=n()!==null?n():l();a.set(s===!0?"anonymous":s)},cZ=function(){const{canPlay:n,hidden:a}=this.$state;return!n()&&!a()},HS=function(){const{error:n}=this.$state;return!Jr(n)},dZ=function(){const{src:n,hidden:a}=this.$state,{canLoad:l,duration:s}=b(this,dd).$state;a.set(l()&&(!n()||k(this,Uo,HS).call(this)||!Number.isFinite(s())))},pZ=function(){const{src:n,canPlay:a,error:l}=this.$state;n(),a.set(!1),l.set(null)},KS=function(n){const{canPlay:a,error:l}=this.$state;a.set(!0),l.set(null),this.dispatch("can-play",{trigger:n})},uZ=function(n){const{canPlay:a,error:l}=this.$state;a.set(!1),l.set(n),this.dispatch("error",{trigger:n})},hZ=function(){const{video:n,canPlay:a}=this.$state,{duration:l}=b(this,dd).$state,{pointerRate:s}=b(this,t3),d=n();a()&&d&&Number.isFinite(l())&&Number.isFinite(s())&&(d.currentTime=s()*l())},V(r4,"props",{src:null,crossOrigin:null}),V(r4,"state",new fc({video:null,src:null,crossOrigin:null,canPlay:!1,error:null,hidden:!1}));const oSe=r4.prototype;$t(oSe,"video");class mC extends dt{constructor(){super(...arguments);P(this,Fi);P(this,pd)}onSetup(){N(this,pd,Rt()),ba(Hu,{default:"percent",percent:(n,a)=>Pi(this.$state.value(),a)+"%"}),new wa({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,Fi,yZ).bind(this),aria:{valueNow:k(this,Fi,fZ).bind(this),valueText:k(this,Fi,mZ).bind(this)},onDragValueChange:k(this,Fi,vZ).bind(this),onValueChange:k(this,Fi,wZ).bind(this)}).attach(this),fe(k(this,Fi,bZ).bind(this)),fe(k(this,Fi,gZ).bind(this))}onAttach(n){n.setAttribute("data-media-audio-gain-slider",""),bo(n,"aria-label","Audio Boost");const{canSetAudioGain:a}=b(this,pd).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}pd=new WeakMap,Fi=new WeakSet,fZ=function(){const{value:n}=this.$state;return Math.round(n())},mZ=function(){const{value:n}=this.$state;return n()+"%"},bZ=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},gZ=function(){const{audioGain:n}=b(this,pd).$state,a=((n()??1)-1)*100;this.$state.value.set(a),this.dispatch("value-change",{detail:a})},yZ=function(){const{disabled:n}=this.$props,{canSetAudioGain:a}=b(this,pd).$state;return n()||!a()},GS=function(n){if(!n.trigger)return;const a=Pi(1+n.detail/100,2);b(this,pd).remote.changeAudioGain(a,n)},wZ=function(n){k(this,Fi,GS).call(this,n)},vZ=function(n){k(this,Fi,GS).call(this,n)},V(mC,"props",{...wa.props,step:25,keyStep:25,shiftKeyMultiplier:2,min:0,max:300}),V(mC,"state",Ep);class bC extends dt{constructor(){super(...arguments);P(this,_i);P(this,ud);P(this,o3,vp(k(this,_i,TZ).bind(this),25))}onSetup(){N(this,ud,Rt()),new wa({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:k(this,_i,IZ),isDisabled:k(this,_i,EZ).bind(this),aria:{valueNow:k(this,_i,CZ).bind(this),valueText:k(this,_i,kZ).bind(this)},onDragValueChange:k(this,_i,_Z).bind(this),onValueChange:k(this,_i,AZ).bind(this)}).attach(this),fe(k(this,_i,xZ).bind(this)),fe(k(this,_i,SZ).bind(this))}onAttach(n){n.setAttribute("data-media-speed-slider",""),bo(n,"aria-label","Speed");const{canSetPlaybackRate:a}=b(this,ud).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}ud=new WeakMap,_i=new WeakSet,CZ=function(){const{value:n}=this.$state;return n()},kZ=function(){const{value:n}=this.$state;return n()+"x"},xZ=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},SZ=function(){const{playbackRate:n}=b(this,ud).$state,a=n();this.$state.value.set(a),this.dispatch("value-change",{detail:a})},IZ=function(n){return Pi(n,2)},EZ=function(){const{disabled:n}=this.$props,{canSetPlaybackRate:a}=b(this,ud).$state;return n()||!a()},o3=new WeakMap,TZ=function(n){if(!n.trigger)return;const a=n.detail;b(this,ud).remote.changePlaybackRate(a,n)},AZ=function(n){b(this,o3).call(this,n)},_Z=function(n){b(this,o3).call(this,n)},V(bC,"props",{...wa.props,step:.25,keyStep:.25,shiftKeyMultiplier:2,min:0,max:2}),V(bC,"state",Ep);class gC extends dt{constructor(){super(...arguments);P(this,Ji);P(this,Er);P(this,i1,cr(()=>{const{qualities:n}=b(this,Er).$state;return nM(n())}));P(this,i3,vp(k(this,Ji,PZ).bind(this),25))}onSetup(){N(this,Er,Rt()),new wa({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,Ji,LZ).bind(this),aria:{valueNow:k(this,Ji,DZ).bind(this),valueText:k(this,Ji,OZ).bind(this)},onDragValueChange:k(this,Ji,MZ).bind(this),onValueChange:k(this,Ji,$Z).bind(this)}).attach(this),fe(k(this,Ji,RZ).bind(this)),fe(k(this,Ji,BZ).bind(this))}onAttach(n){n.setAttribute("data-media-quality-slider",""),bo(n,"aria-label","Video Quality");const{qualities:a,canSetQuality:l}=b(this,Er).$state,s=cr(()=>l()&&a().length>0);this.setAttributes({"data-supported":s,"aria-hidden":sn(()=>!s())})}}Er=new WeakMap,i1=new WeakMap,Ji=new WeakSet,DZ=function(){const{value:n}=this.$state;return n()},OZ=function(){const{quality:n}=b(this,Er).$state;if(!n())return"";const{height:a,bitrate:l}=n(),s=l&&l>0?`${(l/1e6).toFixed(2)} Mbps`:null;return a?`${a}p${s?` (${s})`:""}`:"Auto"},RZ=function(){const n=b(this,i1).call(this);this.$state.max.set(Math.max(0,n.length-1))},BZ=function(){let{quality:n}=b(this,Er).$state,a=b(this,i1).call(this),l=Math.max(0,a.indexOf(n()));this.$state.value.set(l),this.dispatch("value-change",{detail:l})},LZ=function(){const{disabled:n}=this.$props,{canSetQuality:a,qualities:l}=b(this,Er).$state;return n()||l().length<=1||!a()},i3=new WeakMap,PZ=function(n){if(!n.trigger)return;const{qualities:a}=b(this,Er),l=Re(b(this,i1))[n.detail];b(this,Er).remote.changeQuality(a.indexOf(l),n)},$Z=function(n){b(this,i3).call(this,n)},MZ=function(n){b(this,i3).call(this,n)},V(gC,"props",{...wa.props,step:1,keyStep:1,shiftKeyMultiplier:1}),V(gC,"state",Ep);class yC extends dt{constructor(){super(...arguments);P(this,nt);P(this,ra);P(this,D0);P(this,n1);P(this,El,null);P(this,Nn,[]);P(this,O0,ct(null));P(this,jn,ct([]));P(this,js,ct(-1));P(this,R0,ct(-1));P(this,hd,0);P(this,w5,zu(n=>{var h;let a,l=b(this,jn).call(this),{seekableStart:s}=b(this,ra).$state,d=s(),p=k(this,nt,J5).call(this,l);for(let f=b(this,hd);f<b(this,Nn).length;f++)if(a=k(this,nt,ey).call(this,l[f],n,d,p),(h=b(this,Nn)[f])==null||h.style.setProperty("--chapter-progress",a+"%"),a<100){N(this,hd,f);break}}));P(this,v5,cr(k(this,nt,UZ).bind(this)));P(this,n3,Av(()=>{const n=Re(b(this,O0));!this.scope||!n||!n.cues.length||(b(this,jn).set(k(this,nt,HZ).call(this,n.cues)),b(this,js).set(0),N(this,hd,0))},150,!0))}get cues(){return b(this,jn).call(this)}get activeCue(){return b(this,jn).call(this)[b(this,js).call(this)]||null}get activePointerCue(){return b(this,jn).call(this)[b(this,R0).call(this)]||null}onSetup(){N(this,ra,Rt()),N(this,D0,qu(i4.state))}onAttach(n){Wg(b(this,ra).textTracks,"chapters",k(this,nt,WS).bind(this)),fe(k(this,nt,KZ).bind(this))}onConnect(){At(()=>k(this,nt,ZS).bind(this))}onDestroy(){k(this,nt,WS).call(this,null)}setRefs(n){var a;if(N(this,Nn,n),(a=b(this,n1))==null||a.dispose(),b(this,Nn).length===1){const l=b(this,Nn)[0];l.style.width="100%",l.style.setProperty("--chapter-fill","var(--slider-fill)"),l.style.setProperty("--chapter-progress","var(--slider-progress)")}else b(this,Nn).length>0&&kn(()=>k(this,nt,NZ).call(this),N(this,n1,uc()))}}ra=new WeakMap,D0=new WeakMap,n1=new WeakMap,El=new WeakMap,Nn=new WeakMap,O0=new WeakMap,jn=new WeakMap,js=new WeakMap,R0=new WeakMap,hd=new WeakMap,nt=new WeakSet,WS=function(n){Re(b(this,O0))!==n&&(k(this,nt,ZS).call(this),b(this,O0).set(n))},ZS=function(){var n;N(this,Nn,[]),b(this,jn).set([]),b(this,js).set(-1),b(this,R0).set(-1),N(this,hd,0),(n=b(this,n1))==null||n.dispose()},NZ=function(){b(this,Nn).length&&fe(k(this,nt,jZ).bind(this))},jZ=function(){const{hidden:n}=b(this,D0);n()||(fe(k(this,nt,FZ).bind(this)),fe(k(this,nt,qZ).bind(this)),fe(k(this,nt,VZ).bind(this)),fe(k(this,nt,zZ).bind(this)))},FZ=function(){const n=b(this,jn).call(this);if(!n.length)return;let a,{seekableStart:l,seekableEnd:s}=b(this,ra).$state,d=l(),p=s()||n[n.length-1].endTime,h=p-d,f=100;for(let g=0;g<n.length;g++)if(a=n[g],b(this,Nn)[g]){const w=g===n.length-1?f:Pi((a.endTime-Math.max(d,a.startTime))/h*100,3);b(this,Nn)[g].style.width=w+"%",f-=w}},qZ=function(){let{liveEdge:n,seekableStart:a,seekableEnd:l}=b(this,ra).$state,{fillPercent:s,value:d}=b(this,D0),p=b(this,jn).call(this),h=n(),f=Re(b(this,js)),g=p[f],w=h?b(this,jn).length-1:k(this,nt,XS).call(this,g&&g.startTime/l()*100<=Re(d)?f:0,s());h||!g?k(this,nt,Q5).call(this,0,p.length,100):w>f?k(this,nt,Q5).call(this,f,w,100):w<f&&k(this,nt,Q5).call(this,w+1,f+1,0);const v=h?100:k(this,nt,ey).call(this,p[w],s(),a(),k(this,nt,J5).call(this,p));k(this,nt,YS).call(this,b(this,Nn)[w],v),b(this,js).set(w)},VZ=function(){let{hidden:n,pointerPercent:a}=b(this,D0);if(n()){b(this,R0).set(-1);return}const l=k(this,nt,XS).call(this,0,a());b(this,R0).set(l)},Q5=function(n,a,l){for(let s=n;s<a;s++)k(this,nt,YS).call(this,b(this,Nn)[s],l)},YS=function(n,a){n&&(n.style.setProperty("--chapter-fill",a+"%"),We(n,"data-active",a>0&&a<100),We(n,"data-ended",a===100))},XS=function(n,a){let l=0,s=b(this,jn).call(this);if(a===0)return 0;if(a===100)return s.length-1;let{seekableStart:d}=b(this,ra).$state,p=d(),h=k(this,nt,J5).call(this,s);for(let f=n;f<s.length;f++)if(l=k(this,nt,ey).call(this,s[f],a,p,h),l>=0&&l<100)return f;return 0},zZ=function(){b(this,w5).call(this,b(this,v5).call(this))},w5=new WeakMap,v5=new WeakMap,UZ=function(){const{bufferedEnd:n,duration:a}=b(this,ra).$state;return Pi(Math.min(n()/Math.max(a(),1),1),3)*100},J5=function(n){var s;const{seekableEnd:a}=b(this,ra).$state,l=a();return Number.isFinite(l)?l:((s=n[n.length-1])==null?void 0:s.endTime)||0},ey=function(n,a,l,s){if(!n||b(this,jn).call(this).length===0)return 0;const p=s-l,h=Math.max(0,n.startTime-l),f=Math.min(s,n.endTime)-l,g=h/p,w=g*100,v=Math.min(1,g+(f-h)/p)*100;return Math.max(0,Pi(a>=v?100:(a-w)/(v-w)*100,3))},HZ=function(n){let a=[],{seekableStart:l,seekableEnd:s,duration:d}=b(this,ra).$state,p=l(),h=s();n=n.filter(w=>w.startTime<=h&&w.endTime>=p);const f=n[0];f&&f.startTime>p&&a.push(new window.VTTCue(p,f.startTime,""));for(let w=0;w<n.length-1;w++){const v=n[w],C=n[w+1];if(a.push(v),C){const E=C.startTime-v.endTime;E>0&&a.push(new window.VTTCue(v.endTime,v.endTime+E,""))}}const g=n[n.length-1];if(g){a.push(g);const w=d();w>=0&&w-g.endTime>1&&a.push(new window.VTTCue(g.endTime,d(),""))}return a},KZ=function(){const{source:n}=b(this,ra).$state;n(),k(this,nt,GZ).call(this)},GZ=function(){if(!this.scope)return;const{disabled:n}=this.$props;if(n()){b(this,jn).set([]),b(this,js).set(0),N(this,hd,0);return}const a=b(this,O0).call(this);if(a){const l=b(this,n3).bind(this);l(),new go(a).add("add-cue",l).add("remove-cue",l),fe(k(this,nt,WZ).bind(this))}return N(this,El,k(this,nt,XZ).call(this)),b(this,El)&&fe(k(this,nt,ZZ).bind(this)),()=>{b(this,El)&&(b(this,El).textContent="",N(this,El,null))}},WZ=function(){b(this,ra).$state.duration(),b(this,n3).call(this)},n3=new WeakMap,ZZ=function(){const n=this.activePointerCue||this.activeCue;b(this,El)&&(b(this,El).textContent=(n==null?void 0:n.text)||"")},YZ=function(){let n=this.el;for(;n&&n.getAttribute("role")!=="slider";)n=n.parentElement;return n},XZ=function(){const n=k(this,nt,YZ).call(this);return n?n.querySelector('[data-part="chapter-title"]'):null},V(yC,"props",{disabled:!1});const l4=yC.prototype;$t(l4,"cues"),$t(l4,"activeCue"),$t(l4,"activePointerCue"),ti(l4,"setRefs");class wC extends dt{constructor(){super();P(this,a1);P(this,Fs);N(this,Fs,new _p),b(this,Fs).onValueChange=k(this,a1,JZ).bind(this)}get values(){return b(this,Fs).values}get value(){return b(this,Fs).value}set value(n){b(this,Fs).value=n}onSetup(){fe(k(this,a1,QZ).bind(this))}}Fs=new WeakMap,a1=new WeakSet,QZ=function(){b(this,Fs).value=this.$props.value()},JZ=function(n,a){const l=this.createEvent("change",{detail:n,trigger:a});this.dispatch(l)},V(wC,"props",{value:""});const xM=wC.prototype;$t(xM,"values"),$t(xM,"value");var iSe=Object.defineProperty,nSe=Object.getOwnPropertyDescriptor,vC=(i,o,n,a)=>{for(var l=nSe(o,n),s=i.length-1,d;s>=0;s--)(d=i[s])&&(l=d(o,n,l)||l);return l&&iSe(o,n,l),l};class Wh extends dt{constructor(){super();P(this,Fn);P(this,Tl);P(this,B0);P(this,qs);P(this,r1,ct(null));P(this,Al,ct([]));N(this,qs,new _p),b(this,qs).onValueChange=k(this,Fn,nY).bind(this)}get value(){return b(this,qs).value}get disabled(){var n;return!((n=b(this,Al).call(this))!=null&&n.length)}onSetup(){N(this,Tl,Rt()),ga($i)&&N(this,B0,qo($i));const{thumbnails:n}=this.$props;this.setAttributes({"data-thumbnails":()=>!!n()})}onAttach(n){var a;(a=b(this,B0))==null||a.attachObserver({onOpen:k(this,Fn,eY).bind(this)})}getOptions(){const{seekableStart:n,seekableEnd:a}=b(this,Tl).$state,l=n(),s=a();return b(this,Al).call(this).map((d,p)=>({cue:d,value:p.toString(),label:d.text,startTime:e4(Math.max(0,d.startTime-l)),duration:t4(Math.min(s,d.endTime)-Math.max(l,d.startTime))}))}onConnect(n){fe(k(this,Fn,QS).bind(this)),fe(k(this,Fn,iY).bind(this)),fe(k(this,Fn,tY).bind(this)),Wg(b(this,Tl).textTracks,"chapters",b(this,r1).set)}}Tl=new WeakMap,B0=new WeakMap,qs=new WeakMap,r1=new WeakMap,Al=new WeakMap,Fn=new WeakSet,eY=function(){Re(()=>k(this,Fn,QS).call(this))},tY=function(){const n=b(this,r1).call(this);if(!n)return;const a=k(this,Fn,oY).bind(this,n);return a(),new go(n).add("add-cue",a).add("remove-cue",a),()=>{b(this,Al).set([])}},oY=function(n){const{seekableStart:a,seekableEnd:l}=b(this,Tl).$state,s=a(),d=l();b(this,Al).set([...n.cues].filter(p=>p.startTime<=d&&p.endTime>=s))},QS=function(){var g;if(!((g=b(this,B0))!=null&&g.expanded()))return;if(!b(this,r1).call(this)){b(this,qs).value="-1";return}const{realCurrentTime:a,seekableStart:l,seekableEnd:s}=b(this,Tl).$state,d=l(),p=s(),h=a(),f=b(this,Al).call(this).findIndex(w=>Rv(w,h));b(this,qs).value=f.toString(),f>=0&&ls(()=>{if(!this.connectScope)return;const w=b(this,Al).call(this)[f],v=this.el.querySelector("[aria-checked='true']"),C=Math.max(d,w.startTime),E=Math.min(p,w.endTime)-C,T=Math.max(0,h-C)/E*100;v&&Zn(v,"--progress",Pi(T,3)+"%")})},iY=function(){var n;(n=b(this,B0))==null||n.disable(this.disabled)},nY=function(n,a){if(this.disabled||!a)return;const l=+n,s=b(this,Al).call(this),{clipStartTime:d}=b(this,Tl).$state;Li(l)&&(s!=null&&s[l])&&(b(this,qs).value=l.toString(),b(this,Tl).remote.seek(s[l].startTime-d(),a),this.dispatch("change",{detail:s[l],trigger:a}))},V(Wh,"props",{thumbnails:null}),vC([$t],Wh.prototype,"value"),vC([$t],Wh.prototype,"disabled"),vC([ti],Wh.prototype,"getOptions");const aSe=[1,1.25,1.5,1.75,2,2.5,3,4];class CC extends dt{constructor(){super();P(this,Ka);P(this,fd);P(this,l1);P(this,L0);N(this,L0,new _p),b(this,L0).onValueChange=k(this,Ka,cY).bind(this)}get value(){return b(this,L0).value}get disabled(){const{gains:n}=this.$props,{canSetAudioGain:a}=b(this,fd).$state;return!a()||n().length===0}onSetup(){N(this,fd,Rt()),ga($i)&&N(this,l1,qo($i))}onConnect(n){fe(k(this,Ka,aY).bind(this)),fe(k(this,Ka,rY).bind(this)),fe(k(this,Ka,lY).bind(this))}getOptions(){const{gains:n,normalLabel:a}=this.$props;return n().map(l=>({label:l===1||l===null?a:String(l*100)+"%",value:l.toString()}))}}fd=new WeakMap,l1=new WeakMap,L0=new WeakMap,Ka=new WeakSet,aY=function(){b(this,L0).value=k(this,Ka,sY).call(this)},rY=function(){var s;const{normalLabel:n}=this.$props,{audioGain:a}=b(this,fd).$state,l=a();(s=b(this,l1))==null||s.hint.set(l===1||l==null?n():String(l*100)+"%")},lY=function(){var n;(n=b(this,l1))==null||n.disable(this.disabled)},sY=function(){var a;const{audioGain:n}=b(this,fd).$state;return((a=n())==null?void 0:a.toString())??"1"},cY=function(n,a){if(this.disabled)return;const l=+n;b(this,fd).remote.changeAudioGain(l,a),this.dispatch("change",{detail:l,trigger:a})},V(CC,"props",{normalLabel:"Disabled",gains:aSe});const kC=CC.prototype;$t(kC,"value"),$t(kC,"disabled"),ti(kC,"getOptions");class SM extends dt{constructor(){super(...arguments);P(this,qn);P(this,Ta);P(this,s1,null);P(this,_l,0);P(this,a3,-1)}onSetup(){N(this,Ta,Rt());const{event:n,action:a}=this.$props;this.setAttributes({event:n,action:a})}onAttach(n){n.setAttribute("data-media-gesture",""),n.style.setProperty("pointer-events","none")}onConnect(n){var a;N(this,s1,(a=b(this,Ta).player.el)==null?void 0:a.querySelector("[data-media-provider]")),fe(k(this,qn,dY).bind(this))}}Ta=new WeakMap,s1=new WeakMap,qn=new WeakSet,dY=function(){let n=this.$props.event(),a=this.$props.disabled();!b(this,s1)||!n||a||(/^dbl/.test(n)&&(n=n.split(/^dbl/)[1]),(n==="pointerup"||n==="pointerdown")&&b(this,Ta).$state.pointer()==="coarse"&&(n=n==="pointerup"?"touchend":"touchstart"),po(b(this,s1),n,k(this,qn,pY).bind(this),{passive:!1}))},_l=new WeakMap,a3=new WeakMap,pY=function(n){if(this.$props.disabled()||d$(n)&&(n.button!==0||b(this,Ta).activeMenu)||Ng(n)&&b(this,Ta).activeMenu||Lv(n)||!k(this,qn,uY).call(this,n))return;n.MEDIA_GESTURE=!0,n.preventDefault();const a=Re(this.$props.event);if(!(a==null?void 0:a.startsWith("dbl")))b(this,_l)===0&&setTimeout(()=>{b(this,_l)===1&&k(this,qn,JS).call(this,n)},250);else if(b(this,_l)===1){queueMicrotask(()=>k(this,qn,JS).call(this,n)),clearTimeout(b(this,a3)),N(this,_l,0);return}b(this,_l)===0&&N(this,a3,window.setTimeout(()=>{N(this,_l,0)},275)),eU(this,_l)._++},JS=function(n){this.el.setAttribute("data-triggered",""),requestAnimationFrame(()=>{k(this,qn,hY).call(this)&&k(this,qn,fY).call(this,Re(this.$props.action),n),requestAnimationFrame(()=>{this.el.removeAttribute("data-triggered")})})},uY=function(n){if(!this.el)return!1;if(d$(n)||ECe(n)||Ng(n)){const a=Ng(n)?n.changedTouches[0]??n.touches[0]:void 0,l=(a==null?void 0:a.clientX)??n.clientX,s=(a==null?void 0:a.clientY)??n.clientY,d=this.el.getBoundingClientRect(),p=s>=d.top&&s<=d.bottom&&l>=d.left&&l<=d.right;return n.type.includes("leave")?!p:p}return!0},hY=function(){const n=b(this,Ta).player.el.querySelectorAll("[data-media-gesture][data-triggered]");return Array.from(n).sort((a,l)=>+getComputedStyle(l).zIndex-+getComputedStyle(a).zIndex)[0]===this.el},fY=function(n,a){if(!n)return;const l=new Ot("will-trigger",{detail:n,cancelable:!0,trigger:a});if(this.dispatchEvent(l),l.defaultPrevented)return;const[s,d]=n.replace(/:([a-z])/,"-$1").split(":");n.includes(":fullscreen")?b(this,Ta).remote.toggleFullscreen("prefer-media",a):n.includes("seek:")?b(this,Ta).remote.seek(Re(b(this,Ta).$state.currentTime)+(+d||0),a):b(this,Ta).remote[$Ce(s)](a),this.dispatch("trigger",{detail:n,trigger:a})},V(SM,"props",{disabled:!1,event:void 0,action:void 0});class rSe{constructor(o){P(this,r3);V(this,"priority",10);P(this,c1,null);P(this,Vs);P(this,zs);N(this,Vs,o)}attach(){}canRender(){return!0}detach(){var o;(o=b(this,zs))==null||o.abort(),N(this,zs,void 0),b(this,Vs).reset(),N(this,c1,null)}changeTrack(o){var n;!o||b(this,c1)===o||((n=b(this,zs))==null||n.abort(),N(this,zs,new go(o)),o.readyState<2?(b(this,Vs).reset(),b(this,zs).add("load",()=>k(this,r3,eI).call(this,o),{once:!0})):k(this,r3,eI).call(this,o),b(this,zs).add("add-cue",a=>{b(this,Vs).addCue(a.detail)}).add("remove-cue",a=>{b(this,Vs).removeCue(a.detail)}),N(this,c1,o))}}c1=new WeakMap,Vs=new WeakMap,zs=new WeakMap,r3=new WeakSet,eI=function(o){b(this,Vs).changeTrack({cues:[...o.cues],regions:[...o.regions]})};const Dl=class Dl extends dt{constructor(){super(...arguments);P(this,_t);P(this,la);P(this,Us,-1)}onSetup(){N(this,la,Rt()),this.setAttributes({"aria-hidden":sn(k(this,_t,ty).bind(this))})}onAttach(n){n.style.setProperty("pointer-events","none")}onConnect(n){Dl.lib()||Promise.resolve().then(()=>Z4).then(a=>Dl.lib.set(a)),fe(k(this,_t,mY).bind(this))}};la=new WeakMap,_t=new WeakSet,ty=function(){const{textTrack:n,remotePlaybackState:a,iOSControls:l}=b(this,la).$state,s=n();return l()||a()==="connected"||!s||!xn(s)},mY=function(){if(!Dl.lib())return;const{viewType:n}=b(this,la).$state;return n()==="audio"?k(this,_t,bY).call(this):k(this,_t,wY).call(this)},bY=function(){return fe(k(this,_t,gY).bind(this)),k(this,_t,oI).call(this,null),()=>{this.el.textContent=""}},gY=function(){if(k(this,_t,ty).call(this))return;k(this,_t,tI).call(this);const{textTrack:n}=b(this,la).$state;po(n(),"cue-change",k(this,_t,tI).bind(this)),fe(k(this,_t,yY).bind(this))},tI=function(){this.el.textContent="",b(this,Us)>=0&&k(this,_t,oy).call(this);const{realCurrentTime:n,textTrack:a}=b(this,la).$state,{renderVTTCueString:l}=Dl.lib(),s=Re(n),d=Re(a).activeCues;for(const p of d){const h=k(this,_t,nI).call(this),f=k(this,_t,aI).call(this);f.innerHTML=l(p,s),h.append(f),this.el.append(f)}},yY=function(){const{realCurrentTime:n}=b(this,la).$state,{updateTimedVTTCueNodes:a}=Dl.lib();a(this.el,n())},wY=function(){const{CaptionsRenderer:n}=Dl.lib(),a=new n(this.el),l=new rSe(a);return b(this,la).textRenderers.add(l),fe(k(this,_t,vY).bind(this,a)),fe(k(this,_t,CY).bind(this,a)),k(this,_t,oI).call(this,a),()=>{this.el.textContent="",b(this,la).textRenderers.remove(l),a.destroy()}},vY=function(n){n.dir=this.$props.textDir()},CY=function(n){var s;if(k(this,_t,ty).call(this))return;const{realCurrentTime:a,textTrack:l}=b(this,la).$state;n.currentTime=a(),b(this,Us)>=0&&((s=l())!=null&&s.activeCues[0])&&k(this,_t,oy).call(this)},oI=function(n){const a=b(this,la).player;if(!a)return;const l=k(this,_t,kY).bind(this,n);po(a,"vds-font-change",l)},kY=function(n){var l;if(b(this,Us)>=0){k(this,_t,iI).call(this);return}const{textTrack:a}=b(this,la).$state;(l=a())!=null&&l.activeCues[0]?n==null||n.update(!0):k(this,_t,xY).call(this)},xY=function(){var l,s;const n=k(this,_t,nI).call(this);We(n,"data-example","");const a=k(this,_t,aI).call(this);We(a,"data-example",""),a.textContent=this.$props.exampleText(),n==null||n.append(a),(l=this.el)==null||l.append(n),(s=this.el)==null||s.setAttribute("data-example",""),k(this,_t,iI).call(this)},Us=new WeakMap,iI=function(){window.clearTimeout(b(this,Us)),N(this,Us,window.setTimeout(k(this,_t,oy).bind(this),2500))},oy=function(){var n,a;(n=this.el)==null||n.removeAttribute("data-example"),(a=this.el)!=null&&a.querySelector("[data-example]")&&(this.el.textContent=""),N(this,Us,-1)},nI=function(){const n=document.createElement("div");return We(n,"data-part","cue-display"),n},aI=function(){const n=document.createElement("div");return We(n,"data-part","cue"),n},V(Dl,"props",{textDir:"ltr",exampleText:"Captions look like this."}),V(Dl,"lib",ct(null));let xC=Dl;/**
3155
3155
  * @license
@@ -7901,18 +7901,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7901
7901
  `,PUe={...oV.sizes,colorScheme:oV.colorScheme,css:({dt:i})=>`
7902
7902
  ${mV({slot:"start",dt:i})}
7903
7903
  ${mV({slot:"end",dt:i})}
7904
- `},$Ue={...eV.sizes,colorScheme:eV.colorScheme},MUe={...lV.sizes,colorScheme:lV.colorScheme,css:({dt:i})=>`
7905
- .wt-textarea__textarea {
7906
- min-height: ${i("textarea.minHeight")};
7907
- }
7908
- `},NUe={...uV.sizes,colorScheme:uV.colorScheme,css:({dt:i})=>`
7904
+ `},$Ue={...eV.sizes,colorScheme:eV.colorScheme},MUe={...uV.sizes,colorScheme:uV.colorScheme,css:({dt:i})=>`
7909
7905
  .p-radiobutton {
7910
7906
  width: ${i("radiobutton.root.wrapperWidth")};
7911
7907
  height: ${i("radiobutton.root.wrapperHeight")};
7912
7908
  align-items: center;
7913
7909
  justify-content: center;
7914
7910
  }
7915
- `},jUe={...dV.sizes,colorScheme:dV.colorScheme},FUe={...sV.sizes,colorScheme:sV.colorScheme,css:({dt:i})=>`
7911
+ `},NUe={...dV.sizes,colorScheme:dV.colorScheme},jUe={...sV.sizes,colorScheme:sV.colorScheme,css:({dt:i})=>`
7916
7912
  .p-toggleswitch {
7917
7913
  flex-shrink: 0;
7918
7914
  }
@@ -7929,7 +7925,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7929
7925
  .p-datatable-tbody > tr.row-${i}:has(+ .p-datatable-row-expansion:hover) > td {
7930
7926
  background: ${o(`datatable.row.${i}HoverBackground`)};
7931
7927
  }
7932
- `,qUe={...rV.sizes,colorScheme:rV.colorScheme,css:({dt:i})=>`
7928
+ `,FUe={...rV.sizes,colorScheme:rV.colorScheme,css:({dt:i})=>`
7933
7929
  .p-datatable-table-container {
7934
7930
  width: 100%;
7935
7931
  }
@@ -8006,7 +8002,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8006
8002
  .p-datatable-header-cell:not(:has(.wt-table__th__sort-arrow)) {
8007
8003
  background: ${i("datatable.headerCell.background")};
8008
8004
  }
8009
- `},VUe={...iV.sizes,colorScheme:iV.colorScheme},zUe={...tV.sizes,colorScheme:tV.colorScheme,css:({dt:i})=>`
8005
+ `},qUe={...lV.sizes,colorScheme:lV.colorScheme,css:({dt:i})=>`
8006
+ .wt-textarea__textarea {
8007
+ min-height: ${i("textarea.minHeight")};
8008
+ }
8009
+ `},VUe={...iV.sizes,colorScheme:iV.colorScheme},zUe={...tV.sizes,colorScheme:tV.colorScheme,css:({dt:i})=>`
8010
8010
  .p-tooltip-text {
8011
8011
  white-space: pre-line;
8012
8012
  word-break: normal;
@@ -8016,7 +8016,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8016
8016
  box-shadow: ${i("tooltip.shadow")};
8017
8017
  border-radius: ${i("tooltip.border.radius")};
8018
8018
  }
8019
- `},UUe={autocomplete:SUe,avatar:IUe,breadcrumb:EUe,button:_Ue,chip:OUe,checkbox:DUe,textarea:MUe,toggleswitch:FUe,divider:RUe,image:LUe,menubar:PUe,popover:$Ue,radiobutton:NUe,slider:jUe,tooltip:zUe,datatable:qUe,toolbar:VUe,galleria:BUe},Dk=({size:i,dt:o})=>`
8019
+ `},UUe={autocomplete:SUe,avatar:IUe,breadcrumb:EUe,button:_Ue,chip:OUe,checkbox:DUe,textarea:qUe,toggleswitch:jUe,divider:RUe,image:LUe,menubar:PUe,popover:$Ue,radiobutton:MUe,slider:NUe,tooltip:zUe,datatable:FUe,toolbar:VUe,galleria:BUe},Dk=({size:i,dt:o})=>`
8020
8020
  .screen-sharing-control-panel--${i}, .media-control-panel--${i} {
8021
8021
  padding: ${o(`player-control-bar-position-padding-${i}`)};
8022
8022
  }