PageSourceSearch

https://app.thehoopsgeek.com/dashboard/assets/MessagesPage-DG-wnBOn.js

js thehoopsgeek.com collected 2026-10-02 11:01:50 UTC 516,848 bytes, 84 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prod-DbD_yNsS.js","assets/editor-BBDzBLhk.js","assets/ui-NzJGZCOf.js","assets/vidstack-CHcsWfRV-DrSeEYWp.js","assets/index--83fOlxX.js","assets/media-CfhA99EZ.js","assets/auth-Vr3hANQi.js","assets/index-ClF5tXoU.css","assets/Page-sZlrZlHc.js","assets/useSafeAreaInset-DQpKGBcu.js","assets/useSetSelectedTeam-Bk-rgGKk.js","assets/reduxUser-D13SzlnZ.js","assets/redux-toolkit.modern-CcvBsmOD.js","assets/typingStore-DyjmVyto.js","assets/useInfiniteQuery-CAKNllCh.js","assets/Label-CJGVkcgn.js","assets/conversationDraft-DgKEN4qF.js","assets/PlayerProfileDialog-hy9LfKnr.js","assets/Avatar-DA_rmJdn.js","assets/index-vdnyNLeo.js","assets/useTeamMembers-DMFj-t-R.js","assets/arrayQueryData-CO4m_tzW.js","assets/createAvatar-CSWNX66E.js","assets/ConfirmationDialog-Bd7fAo1n.js","assets/index-CJRF5krZ.js","assets/PhaseThumbnail-Bm8mtNBJ.js","assets/ScrollRootContext-CkNS2d25.js","assets/PlaySkeleton-CYn3pFkp.js","assets/Phase-BERg-Qcd.js","assets/useDimensions-D6HVXcWw.js","assets/ResizeObserver.es-BS4_j6we.js","assets/phases-DBoIT5RY.js","assets/_baseIteratee-DLZas4sG.js","assets/ImageTable-CPrhyybS.js","assets/uppy_dashboard-BbsLRL0g.js","assets/debounce-BCBYI5hr.js","assets/uppy_dashboard-C4Zm-HY9.css","assets/style.min-CYdoUNPS.js","assets/style-C20dm5Mn.css","assets/MediaDragPreview-C_XaTkr-.js","assets/folderAwarePlaceholders-BgAwPeE6.js","assets/VirtualizedTable-TiHmejIB.js","assets/StatusLabel-RlBPQiFe.js","assets/NestedMenuItem-E0f3SJiK.js","assets/useTags-D071mfMh.js","assets/MyAvatar-BPuWNWEE.js","assets/TeamAvatar-BoWFWCdD.js","assets/TableRowActionCheckbox-BYpoypk2.js","assets/FormProvider-hbZ5gvCG.js","assets/formatTime-DtD0MVK8.js","assets/utils-lktSqjmV.js","assets/MenuPopover-B2dYuTBk.js","assets/useFilteredFileUploads-EBTS1-t-.js","assets/useTable-BBkMR8E8.js","assets/Thumbnail-BjdHIaoK.js","assets/ImageTable-DEtIa655.css","assets/useTabs-mh-sJZ2W.js","assets/ClipsFilter-CRKYVLGo.js","assets/TagsFilterList-DLiDp0z6.js","assets/PlayOutput-Bq7yKtjM.js","assets/StyledSimpleBar-DZm0fqYC.js","assets/simplebar-react.esm-DfTctRp7.js","assets/index-BX-Rff7I.js","assets/settings-CNz742L5.js","assets/createFullPlayAnimation-BbOJijn7.js","assets/createLucideIcon-BBljSknj.js","assets/index-Dx0tT0hY.js","assets/utils-u20hAFju.js","assets/PlatejsContextProvider-D0tJraC9.js","assets/useFilteredRotations-BO9BzrUO.js","assets/MobileItemDate-DwYDdfMy.js","assets/MobileItemTitle-BqBX31fM.js","assets/RotationActionsDropdown-CoPj3y1m.js","assets/ShareRotationDialog-D1MGh_y6.js","assets/SavingTeamPicker-CUHNeVh-.js","assets/PlaygroundSelect-Bb1fwXWd.js","assets/FolderPickerDialog-CHxQVfnG.js","assets/Helper-72nS2ijv.js","assets/MobileItemInfo-CkEtkpwH.js","assets/usePlay-Yk1XosLQ.js","assets/DashboardItems-COmV_k6-.js","assets/fetchPlaybook-DFP6hNfH.js","assets/fetchRotation-D6xQLId-.js","assets/fetchPracticePlan-C9YGQsC9.js","assets/dashboard-constants-DB_P6l51.js","assets/eventUtils-DvRnCY1O.js","assets/CalendarDateBox-jM2bDWOH.js","assets/EventDetailsDialog-XlSx7ibz.js","assets/EventDetailsContent-CHegXm4j.js","assets/PracticeEventActionsDropdown-CjL7jvaj.js","assets/useTeamEvents-B4DsIle6.js","assets/PracticePlanOutput-b3wWdHUw.js","assets/PlayDialog-C_iLALd_.js","assets/is-empty-content-C2hYDKRA.js","assets/useFilteredPlays-BCTCFQ_b.js","assets/PlayActionsDropdown-Ded-V40N.js","assets/fetch-DBwU5uzv.js","assets/useIsPayingUserV2-X-KbnFht.js","assets/PlaysTableSelectedActions-DF0qkYN0.js","assets/usePickerFolderNav-C_XOa0mC.js","assets/PlaysFilter-Bv5JPYiK.js","assets/tslib.es6-DNoqNiN7.js","assets/index-3IwWtNql.js","assets/FilterChips-C89w19FZ.js","assets/FolderBreadcrumbs-BFE1tMEA.js","assets/InlineNumberInput-BcNYMZoE.js","assets/NumberInput-Cb-SSA2Y.js","assets/DragIndicator-ZeUm3_x5.js","assets/index-C78RJQGl.js","assets/practicePlan-D1LP02Si.js","assets/v4-Bg-q7VAD.js","assets/RsvpControl-BZApLiln.js","assets/CloseRounded-DGFibPZw.js","assets/AttendancePills-DovKgjBL.js","assets/SectionLabel-CPzEC4lj.js","assets/AddContentMenu-C1EljiAp.js","assets/AddPracticePlanDialog-BlSrb2tM.js","assets/useFilteredPlaybooks-CFfhDjPy.js","assets/PlaybookActionsDropdown-C9cEPnMG.js","assets/SavePlaybookDialog-DsNyIkZC.js","assets/useFilteredPracticePlans-DNepJkjR.js","assets/index-LQ7OZl1E.js","assets/RateLimitedQueue-DF6JuYH4.js","assets/AddVideoDialog-bEHJEmur.js","assets/useFilteredBunnyUploads-DQMDQeTK.js","assets/AddAudioDialog-CRTsKG8a.js","assets/AudioTable-DSH_GGpq.js","assets/AudioTable-C6hKYVHN.css","assets/ArrowBackIos-D0jsvfFg.js","assets/GlassIconButton-CG6pwfic.js","assets/glassLayout-BHeHozmU.js","assets/vidstack-DiaLSJYx-Dveucb-4.js","assets/vidstack-GkTzay8D-DLLW-7ZC.js","assets/vidstack-CQuJTPFJ-L8SiElry.js","assets/vidstack-C0fPJIzs-hKzX70as.js","assets/vidstack-BmcqUMKx-BY58mQ28.js","assets/vidstack-Dy74GavT-BJvsXdFw.js","assets/vidstack-Di0HObvT-BY3s8C5g.js","assets/emoji-picker-react.esm-CYiWzIVX.js"])))=>i.map(i=>d[i]);
2var rS=Object.defineProperty;var A3=i=>{throw TypeError(i)};var aS=(i,e,t)=>e in i?rS(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var O=(i,e,t)=>aS(i,typeof e!="symbol"?e+"":e,t),sp=(i,e,t)=>e.has(i)||A3("Cannot "+t);var r=(i,e,t)=>(sp(i,e,"read from private field"),t?t.call(i):e.get(i)),g=(i,e,t)=>e.has(i)?A3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),b=(i,e,t,s)=>(sp(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),o=(i,e,t)=>(sp(i,e,"access private method"),t);var I3=(i,e,t,s)=>({set _(n){b(i,e,n,t)},get _(){return r(i,e,s)}});import{dR as Sm,eo as xh,dd as B,dc as m,F as We,aT as oS,a9 as ct,cy as lS,aA as R6,cE as cS,cg as uS,c7 as A6,c as fi,aD as dS,bI as Eh,e as es,c4 as I6,bi as hS,cB as pS,at as fS,aH as mS,j as gS,el as wm,b4 as yS,bX as _6,cG as Wd,c2 as _3,c6 as bS,c0 as D6,dV as vS,bt as wc,cl as CS,aL as L6,c1 as SS,bn as N6,bU as O6,ck as wS,cj as xS,b0 as ES,a$ as TS,aV as V6,b3 as kS,ce as $S,be as PS,cv as MS,dW as RS,en as AS,ef as IS,e5 as _S,e8 as DS,er as LS,ek as NS,bT as OS,S as VS}from"./index--83fOlxX.js";import{b1 as c,D as fo,u as Au,aE as te,s as Ul,e as U,m as Gn,U as Th,X as xm,d as 
2js,aH as Ai,ay as Wr,r as kh,g as oi,a8 as k,aj as Be,aD as Vl,N as Nt,v as gd,k as BS,W as B6,Z as q6,V as qS,a0 as Hr,an as F6,$ as W6,b0 as Em,h as Iu,ag as FS,T as xc,bf as mo,x as np,a5 as yc,l as H6,z as WS,p as D3,K as HS,C as jS}from"./ui-NzJGZCOf.js";import{P as Yu}from"./Page-sZlrZlHc.js";import{u as j6}from"./useSafeAreaInset-DQpKGBcu.js";import{u as GS}from"./useSetSelectedTeam-Bk-rgGKk.js";import{z as G6,t as Tm,a as zS,e as US,C as z6,p as KS,w as QS,y as ZS,v as YS,g as U6,b as K6,R as L3,m as Hd,s as N3,j as XS,k as JS,h as ew,x as tw,o as iw,l as sw,r as nw,A as rw,D as aw,f as ow,B as lw,d as cw,c as uw,u as dw,i as hw}from"./typingStore-DyjmVyto.js";import{L as no}from"./Label-CJGVkcgn.js";import{b as pw,a as fw,i as mw,D as O3,r as gw}from"./conversationDraft-DgKEN4qF.js";import{P as yw}from"./PlayerProfileDialog-hy9LfKnr.js";import{C as V3}from"./ConfirmationDialog-Bd7fAo1n.js";import{x as Q6}from"./index-CJRF5krZ.js";import{P as bw}from"./PhaseThumbnail-Bm8mtNBJ.js";import{Y as mi}from"./editor-BBDzBLhk.js";import{t as vw,u as Cw,z as Sw,V as ww}from"./PlayOutput-Bq7yKtjM.js";import{a as xw}from"./useFilteredRotations-BO9BzrUO.js";import{u as Ew}from"./usePlay-Yk1XosLQ.js";import{u as Tw}from"./DashboardItems-COmV_k6-.js";import{e as kw,C as $w}from"./dashboard-constants-DB_P6l51.js";import{L as Pw,n as Mw,s as Z6,i as Y6,y as Rw,z as Aw}from"./eventUtils-DvRnCY1O.js";import{C as X6}from"./CalendarDateBox-jM2bDWOH.js";import{E as Iw}from"./EventDetailsDialog-XlSx7ibz.js";import{p as _w,q as Dw}from"./useTeamEvents-B4DsIle6.js";import{ContentTypeMenu as Lw}from"./AddContentMenu-C1EljiAp.js";import{a as Nw,D as Ow}from"./uppy_dashboard-BbsLRL0g.js";import{I as Vw,C as Bw}from"./index-LQ7OZl1E.js";import"./style.min-CYdoUNPS.js";import{A as qw}from"./is-empty-content-C2hYDKRA.js";import{A as Fw,b as Ww,a as Hw}from"./AddPracticePlanDialog-BlSrb2tM.js";import{A as jw}from"./AddVideoDialog-bEHJEmur.js";import{A as Gw}from"./Phase-BERg-Qcd.js";import{A as zw}from"./AddAudioDialog-CRTsKG8a.js";import{A as Uw}from"./ArrowBackIos-D0jsvfFg.js";import{G as Kw}from"./GlassIconButton-CG6pwfic.js";import{j as Qw,G as Zw}from"./glassLayout-BHeHozmU.js";import{Z as Yw,L as Xw}from"./ImageTable-CPrhyybS.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="4236165b-5ae2-4dc6-b3bf-1b8780f4ec7d",i._sentryDebugIdIdentifier="sentry-dbid-4236165b-5ae2-4dc6-b3bf-1b8780f4ec7d")}catch{}})();J6.propTypes={open:k.bool.isRequired,onClose:k.func.isRequired,teamId:k.number,onDraft:k.func.isRequired};function J6({open:i,onClose:e,teamId:t,onDraft:s}){const{user:n}=Sm(),a=n==null?void 0:n.db_user_id,{enqueueSnackbar:l}=xh(),{data:u=[],isPending:d}=G6(i?t:null),[h,p]=c.useState([]),[f,y]=c.useState(""),v=c.useMemo(()=>u.filter(x=>x.user_id!==a),[u,a]),C=h.length>=2,S=()=>{p([]),y("")},w=()=>{S(),e()},T=x=>p(P=>P.includes(x)?P.filter(R=>R!==x):[...P,x]),E=()=>
2{if(C&&!f.trim()){l("Give the group a name",{variant:"warning"});return}s(pw({teamId:t,selectedIds:h,candidates:v,title:f})),S()},M=C?`Group · ${h.length} people`:"Pick a teammate, or select several to start a group.";return B(fo,{open:i,onClose:w,fullWidth:!0,maxWidth:"xs",children:[m(Au,{sx:{pb:.25},children:"New message"}),m(te,{variant:"body2",sx:{px:3,pb:1.5,color:"text.secondary"},children:M}),m(Ul,{dividers:!0,sx:{p:0},children:d?m(U,{sx:{textAlign:"center",py:5},children:m(Gn,{size:24})}):v.length===0?m(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:5},children:"No teammates found."}):m(Th,{sx:{maxHeight:360,overflowY:"auto",py:1},disablePadding:!0,children:v.map((x,P)=>{const R=h.includes(x.user_id),_=P>0&&h.includes(v[P-1].user_id),$=P<v.length-1&&h.includes(v[P+1].user_id),G=R&&_?0:10,q=R&&$?0:10;return B(xm,{onClick:()=>T(x.user_id),sx:{mx:2,px:1.25,py:.75,columnGap:1.25,borderRadius:`${G}px ${G}px ${q}px ${q}px`,bgcolor:F=>R?Ai(F.palette.primary.main,.08):"transparent"},children:[m(js,{src:x.picture||void 0,alt:x.name,sx:{width:34,height:34,fontSize:14},children:(x.name||"?").charAt(0).toUpperCase()}),B(U,{sx:{flexGrow:1,minWidth:0,display:"flex",alignItems:"center",gap:.75},children:[m(te,{noWrap:!0,sx:{fontSize:14,fontWeight:500,minWidth:0},children:x.name||"Teammate"}),m(no,{variant:"ghost",color:x.is_coach?"info":"default",sx:{flexShrink:0,height:18,fontSize:10},children:x.is_coach?"Coach":"Player"})]}),m(U,{"aria-hidden":!0,sx:{width:18,height:18,flexShrink:0,borderRadius:"50%",display:"grid",placeItems:"center",color:"common.white",transition:"all .15s ease",border:F=>R?"none":`1.5px solid ${F.palette.divider}`,bgcolor:F=>R?F.palette.primary.main:"transparent"},children:R&&m(We,{icon:oS,style:{fontSize:9}})})]},x.user_id)})})}),C&&m(U,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider"},children:m(Wr,{fullWidth:!0,size:"small",label:"Group name",placeholder:"e.g. Guards, Team captains",value:f,onChange:x=>y(x.target.value),slotProps:{htmlInput:{maxLength:255}}})}),B(kh,{sx:{px:3,py:2},children:[m(oi,{color:"inherit",onClick:w,children:"Cancel"}),m(oi,{variant:"contained",disabled:h.length===0,onClick:E,children:C?"Create group":"Message"})]})]})}function eg(i,{subject:e="content"}={}){var s;const t=(s=i==null?void 0:i.response)==null?void 0:s.status;return t===403||t===404?{kind:"access",retryable:!1,title:t===404?"This conversation is gone":"You no longer have access",detail:t===404?"It may have been deleted. Head back to your other chats.":"You may have been removed, or messaging was turned off for this team."}:i!=null&&i.response?{kind:"generic",retryable:!0,title:`Couldn't load ${e}`,detail:"Something went wrong on our end. Please try again."}:{kind:"offline",retryable:!0,title:"You're offline",detail:"Check your internet connection, then try again."}}const Jw={offline:cS,access:R6,generic:lS};function $h(i){const e=ct.c(27),{error:t,subject:s,onRetry:n,compact:a}=i;let l;e[0]!==t||e[1]!==s?(l=eg(t,{subject:s}),e[0]=t,e[1]=s,e[2]=l):l=e[2];const u=l,d=a?5:8;let h;e[3]!==d?(h={textAlign:"center",px:3,py:d,m:"auto",maxWidth:320},e[3]=d,e[4]=h):h=e[4];const p=u.kind==="generic"?"warning.main":"text.disabled";let f;e[5]!==p?(f={color:p},e[5]=p,e[6]=f):f=e[6];const y=Jw[u.kind];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v={fontSize:28},e[7]=v):v=e[7];let C;e[8]!==y?(C=m(We,{icon:y,style:v}),e[8]=y,e[9]=C):C=e[9];let S;e[10]!==f||e[11]!==C?(S=m(U,{sx:f,children:C}),e[10]=f,e[11]=C,e[12]=S):S=e[12];let w;e[13]!==u.title?(w=m(te,{variant:"subtitle2",children:u.title}),e[13]=u.title,e[14]=w):w=e[14];let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T={color:"text.secondary"},e[15]=T):T=e[15];let E;e[16]!==u.detail?(E=m(te,{variant:"body2",sx:T,children:u.detail}),e[16]=u.detail,e[17]=E):E=e[17];let M;e[18]!==u.retryable||e[19]!==n?(M=u.retryable&&n&&m(oi,{size:"small",variant:"outlined",onClick:n,startIcon:m(We,{icon:uS}),sx:{mt:.5},children:"Try again"}),e[18]=u.retryable,e[19]=n,e[20]=M):M=e[20];let x;return e[21]!==w||e[22]!==E||e[23]!==M||e[24]!==h||e[25]!==S?(x=B(Be,{alignItems:"center",spacing:1.5,sx:h,children:[S,w,E,M]}),e[21]=w,e[22]=E,e[23]=M,e[24]=h,e[25]=S,e[26]=x):x=e[26],x}$h.propTypes={error:k.object,subject:k.string,onRetry:k.func,compact:k.bool};Kp.propTypes={conversations:k.array.isRequired,isPending:k.bool,isError:k.bool,error:k.object,onRetry:k.func,selectedId:k.number,onSelect:k.func.isRequired,onDraft:k.func.isRequired,teamId:k.number,canCompose:k.bool};const B3={display:"block",px:2,pt:1.5,pb:.5,typography:"caption",fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"text.secondary"};function Kp({conversations:i,isPending:e=!1,isError:t=!1,error:s=null,onRetry:n=null,selectedId:a=null,onSelect:l,onDraft:u,teamId:d=null,canCompose:h=!0}){const[p,f]=c.useState(!1),[,y]=c.useState(0);c.useEffect(()=>{const w=setInterval(()=>y(T=>T+1),6e4);return()=>clearInterval(w)},[]);const v=i.filter(w=>w.type==="team"),C=i.filter(w=>w.type!=="team"),S=w=>{const T=w.last_message,E=w.unread_count>0,M=w.type==="team",x=w.title;return B(xm,{selected:w.conversation_id===a,onClick:()=>l(w.conversation_id),disableRipple:!0,sx:P=>({py:1.5,px:2,alignItems:"flex-start",position:"relative","&.Mui-selected":{bgcolor:Ai(P.palette.primary.main,.18)},"&.Mui-selected:hover":{bgcolor:Ai(P.palette.primary.main,.24)},...M?{}:{[P.breakpoints.down("md")]:{"&::after":{content:'""',position:"absolute",left:68,right:0,bottom:0,borderBottom:"1px solid",borderColor:"divider"},"&:last-of-type::after":{display:"none"}}}}),children:[m(js,{src:w.picture||void 0,sx:{width:40,height:40,mr:1.5,flexShrink:0},children:(x||"?").charAt(0)}),B(U,{sx:{flexGrow:1,minWidth:0},children:[B(Be,{direction:"row",alignItems:"center",spacing:.75,children:[m(te,{variant:"subtitle2",noWrap:!0,sx:{flexGrow:1,fontWeight:M||E?700:600},children:x}),w.muted&&m(U,{component:We,icon:dS,sx:{fontSize:12,color:"text.disabled"}}),T&&m(te,{variant:"caption",sx:{color:"text.disabled",flexShrink:0},children:Tm(T.created_at)})]}),B(Be,{direction:"row",alignItems:"center",spacing:1,children:[m(te,{variant:"body2",noWrap:!0,sx:{flexGrow:1,color:E?"text.primary":"text.secondary",fontWeight:E?600:400},children:zS(w)}),E&&m(U,{sx:{minWidth:18,height:18,px:.5,borderRadius:9,bgcolor:"error.main",color:"error.contrastText",typography:"caption",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:Math.min(w.unread_count,99)})]})]})]},w.conversation_id)};return B(U,{sx:{width:{xs:"100%",md:320},flexShrink:0,borderRight:{md:"1px solid"},borderColor:{md:"divider"},display:"flex",flexDirection:"column",overflow:"hidden"},children:[B(Be,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:2,height:61,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[m(te,{variant:"subtitle1",children:"Chats"}),h&&m(Vl,{title:"New chat",children:m("span",{children:m(Nt,{size:"small",onClick:()=>f(!0),disabled:!d,"aria-label":"New chat",sx:{bgcolor:"primary.main",color:"common.white","&:hover":{bgcolor:"primary.dark"}
2,"&.Mui-disabled":{bgcolor:"action.disabledBackground",color:"action.disabled"}},children:m(We,{icon:A6,style:{fontSize:15,width:15,height:15}})})})})]}),m(J6,{open:p,onClose:()=>f(!1),teamId:d,onDraft:w=>{f(!1),u(w)}}),e?m(U,{sx:{textAlign:"center",py:5},children:m(Gn,{size:24})}):t?m($h,{error:s,subject:"conversations",onRetry:n,compact:!0}):i.length===0?m(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:5,px:2},children:"No conversations yet."}):B(Th,{disablePadding:!0,sx:{overflowY:"auto",flexGrow:1,pb:1},children:[v.length>0&&B(fi,{children:[m(te,{component:"div",sx:B3,children:"Everyone"}),v.map(S),m(gd,{sx:{mx:2,my:1}})]}),C.length>0&&B(fi,{children:[v.length>0&&m(te,{component:"div",sx:B3,children:"Groups & DMs"}),C.map(S)]})]})]})}function yd(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`m-${Date.now()}-${Math.random().toString(36).slice(2,12)}`}const Ro=5,ex={draft:"",replyTo:null,pendingLinks:[],failedSends:[]},q3=(i,e)=>i.type===e.type&&i.entity_id===e.entity_id;function tx(i,e){switch(e.type){case"draft":return{...i,draft:e.value};case"reply":return e.message?{...i,replyTo:e.message}:i;case"cancel_reply":return{...i,replyTo:null};case"add_links":{const t=[...i.pendingLinks];for(const s of e.links){if(t.length>=Ro)break;s&&!t.some(n=>q3(n,s))&&t.push(s)}return t.length===i.pendingLinks.length?i:{...i,pendingLinks:t}}case"remove_link":return{...i,pendingLinks:i.pendingLinks.filter(t=>!q3(t,e.link))};case"clear_for_send":return{...i,draft:"",pendingLinks:[],replyTo:null};case"attempt_in_flight":return{...i,failedSends:i.failedSends.filter(t=>t.clientMessageId!==e.clientMessageId)};case"attempt_failed":return{...i,failedSends:[...i.failedSends,e.attempt]};case"attempt_discarded":return{...i,failedSends:i.failedSends.filter(t=>t.clientMessageId!==e.clientMessageId)};default:return i}}const ix={play:"play_id",drill:"play_id",playbook:"playbook_id",rotation:"rotation_id",practice_plan:"practice_plan_id"};function sx(i,e){const t=ix[i];return e.map(s=>({type:i==="play"||i==="drill"?s.type??i:i,entity_id:s[t],title:s.title??""}))}function nx(i,e){return e.map(t=>i==="video"?t.guid&&{type:"video",entity_id:t.upload_id,title:t.title??"",guid:t.guid,library_id:t.library_id,cdn:t.cdn}:t.file_path&&{type:i,entity_id:t.file_upload_id,title:t.file_name??"",file_path:t.file_path}).filter(Boolean)}function tg(i){const t=Array.from(i??[]).filter(n=>{var a,l;return((a=n.type)==null?void 0:a.startsWith("image/"))||((l=n.type)==null?void 0:l.startsWith("video/"))});if(t.length===0)return null;const s=t[0].type.startsWith("video/")?"video":"image";return{kind:s,files:t.filter(n=>n.type.startsWith(`${s}/`))}}function Qp(i){return{type:"media",entity_id:i.media_id,...i}}function ig(i,e){return{media_id:`local:${yd()}`,kind:e,status:"staged",title:(i==null?void 0:i.name)||`${e} attachment`,local_file:i}}function rx(i){const e=ct.c(39),{sendMessage:t,sender:s,onWillSend:n,onSendError:a}=i,[l,u]=c.useReducer(tx,ex),d=c.useRef(null),[h,p]=c.useState(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];const y=c.useRef(f);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=Q=>{const j=y.current[Q];j&&(URL.revokeObjectURL(j),delete y.current[Q])},e[1]=v):v=e[1];const C=v;let S,w;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=()=>()=>{Object.values(y.current).forEach(ax)},w=[],e[2]=S,e[3]=w):(S=e[2],w=e[3]),c.useEffect(S,w);let T;e[4]!==a||e[5]!==n||e[6]!==t?(T=async Q=>{u({type:"attempt_in_flight",clientMessageId:Q.clientMessageId}),n==null||n();try{await t(Q),Q.linkedContent.forEach(j=>{j.type==="media"&&C(j.entity_id)})}catch(j){const X=j;u({type:"attempt_failed",attempt:Q}),a==null||a(X)}},e[4]=a,e[5]=n,e[6]=t,e[7]=T):T=e[7];const E=T;let M;e[8]!==E||e[9]!==s||e[10]!==l?(M=()=>{const Q=l.draft.trim(),j=l.pendingLinks,X=l.replyTo;!Q&&j.length===0||(u({type:"clear_for_send"}),E({clientMessageId:yd(),body:Q,linkedContent:j,replyToMessageId:(X==null?void 0:X.message_id)??null,replyPreview:X?{message_id:X.message_id,sender_user_id:X.sender_user_id,sender_name:X.sender_name,body:X.deleted?null:X.body,deleted:!!X.deleted}
2:null,sender:s}))},e[8]=E,e[9]=s,e[10]=l,e[11]=M):M=e[11];const x=M;let P;e[12]!==E||e[13]!==s?(P=Q=>{E({clientMessageId:yd(),body:"",linkedContent:[],replyToMessageId:null,replyPreview:null,poll:Q,sender:s})},e[12]=E,e[13]=s,e[14]=P):P=e[14];const R=P;let _;e[15]!==E||e[16]!==s?(_=(Q,j)=>{const X=Qp(Q);j&&(y.current[X.entity_id]=j),E({clientMessageId:yd(),body:"",linkedContent:[X],replyToMessageId:null,replyPreview:null,sender:s})},e[15]=E,e[16]=s,e[17]=_):_=e[17];const $=_;let G;e[18]===Symbol.for("react.memo_cache_sentinel")?(G=Q=>{u({type:"attempt_discarded",clientMessageId:Q.clientMessageId}),Q.linkedContent.forEach(j=>{j.type==="media"&&C(j.entity_id)})},e[18]=G):G=e[18];const q=G;let F;e[19]===Symbol.for("react.memo_cache_sentinel")?(F=Q=>{Q&&(u({type:"reply",message:Q}),requestAnimationFrame(()=>{var j;return(j=d.current)==null?void 0:j.focus()}))},e[19]=F):F=e[19];const H=F;let N;e[20]!==l?(N=Q=>{const j=d.current,X=(j==null?void 0:j.selectionStart)??l.draft.length,Te=(j==null?void 0:j.selectionEnd)??l.draft.length,Ce=l.draft.slice(0,X)+Q+l.draft.slice(Te);Ce.length>2e3||(u({type:"draft",value:Ce}),requestAnimationFrame(()=>{if(!j)return;j.focus();const Ie=X+Q.length;j.setSelectionRange(Ie,Ie)}))},e[20]=l,e[21]=N):N=e[21];const A=N;let W;e[22]!==l?(W=(Q,j)=>{!j||j.length===0||l.pendingLinks.length>=Ro||p({kind:Q,files:j})},e[22]=l,e[23]=W):W=e[23];let V,K;e[24]===Symbol.for("react.memo_cache_sentinel")?(V=()=>p(null),K=Q=>u({type:"draft",value:Q}),e[24]=V,e[25]=K):(V=e[24],K=e[25]);let re,oe,Z,fe;e[26]===Symbol.for("react.memo_cache_sentinel")?(re=()=>u({type:"cancel_reply"}),oe=Q=>u({type:"add_links",links:Q}),Z=(Q,j)=>{const X=Qp(Q);j&&(y.current[X.entity_id]=j),u({type:"add_links",links:[X]})},fe=Q=>{Q.type==="media"&&C(Q.entity_id),u({type:"remove_link",link:Q})},e[26]=re,e[27]=oe,e[28]=Z,e[29]=fe):(re=e[26],oe=e[27],Z=e[28],fe=e[29]);let me;return e[30]!==A||e[31]!==x||e[32]!==E||e[33]!==R||e[34]!==$||e[35]!==l||e[36]!==W||e[37]!==h?(me={...l,inputRef:d,pendingPreviewsRef:y,uploadRequest:h,requestUpload:W,clearUploadRequest:V,setDraft:K,reply:H,cancelReply:re,addLinks:oe,addUploadedAttachment:Z,removeLink:fe,insertEmoji:A,send:x,sendPoll:R,sendVoiceMessage:$,retrySend:E,discardFailedSend:q},e[30]=A,e[31]=x,e[32]=E,e[33]=R,e[34]=$,e[35]=l,e[36]=W,e[37]=h,e[38]=me):me=e[38],me}function ax(i){return URL.revokeObjectURL(i)}function ox({disabled:i=!1,onFiles:e}){const t=c.useRef(0),[s,n]=c.useState(!1),a=u=>{var d;return Array.from(((d=u.dataTransfer)==null?void 0:d.types)??[]).includes("Files")};return{dragActive:s,dropProps:{onDragEnter:u=>{i||!a(u)||(u.preventDefault(),t.current+=1,n(!0))},onDragOver:u=>{i||!a(u)||(u.preventDefault(),u.dataTransfer.dropEffect="copy")},onDragLeave:u=>{a(u)&&(t.current=Math.max(0,t.current-1),t.current===0&&n(!1))},onDrop:u=>{var h;if(!a(u)||(u.preventDefault(),t.current=0,n(!1),i))return;const d=tg((h=u.dataTransfer)==null?void 0:h.files);d&&e(d.kind,d.files)}}}}function sg(i){const e=ct.c(4),{active:t}=i;if(!t)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={position:"absolute",inset:0,zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",p:2,pointerEvents:"none",bgcolor:lx},e[0]=s):s=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={px:4,py:3,borderRadius:2,border:"2px dashed",borderColor:"primary.main",bgcolor:"background.paper",textAlign:"center",boxShadow:8},e[1]=n):n=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=m(We,{icon:Eh,style:{fontSize:28}}),e[2]=a):a=e[2];let l;return e[3]===Symbol.for("react.memo_cache_sentinel")?(l=m(U,{sx:s,children:B(U,{sx:n,children:[a,m(te,{variant:"subtitle2",sx:{mt:1},children:"Drop photos or videos to attach"})]})}),e[3]=l):l=e[3],l}function lx(i){return Ai(i.palette.background.default,.72)}sg.propTypes={active:k.bool};ng.propTypes={open:k.bool.isRequired,onClose:k.func.isRequired,teamId:k.number,conversationId:k.number.isRequired,existingMemberIds:k.arrayOf(k.number)};function ng({open:i,onClose:e,teamId:t,conversationId:s,existingMemberIds:n=[]}){const{enqueueSnackbar:a}=xh(),{data:l=[],isPending:u}=G6(i?t:null),d=US(s),[h,p]=c.useState([]),[f,y]=c.useState(""),v=c.useMemo(()=>new Set(n),[n]),C=c.useMemo(()=>{const E=f.trim().toLowerCase();return E?l.filter(M=>(M.name||"").toLowerCase().includes(E)):l},[l,f]),S=()=>{p([]),y(""),e()},w=E=>p(M=>M.includes(E)?M.filter(x=>x!==E):[...M,E]),T=async()=>{try{await d.mutateAsync(h),S()}catch(E){a(es.printError(E),{variant:"error"})}};return B(fo,{open:i,onClose:S,fullWidth:!0,maxWidth:"xs",children:[m(Au,{children:"Add members"}),B(Ul,{dividers:!0,sx:{p:0},children:[m(U,{sx:{p:2,pb:1},children:m(Wr,{fullWidth:!0,size:"small",placeholder:"Search teammates",value:f,onChange:E=>y(E.target.value),autoFocus:!0})}),u?m(U,{sx:{textAlign:"center",py:4},children:m(Gn,{size:24})}):C.length===0?m(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:4},children:"No teammates found."}):m(Th,{sx:{maxHeight:320,overflowY:"auto"},disablePadding:!0,children:C.map(E=>
2{const M=v.has(E.user_id);return B(xm,{onClick:()=>!M&&w(E.user_id),disabled:M,dense:!0,children:[m(BS,{edge:"start",tabIndex:-1,disableRipple:!0,checked:M||h.includes(E.user_id),disabled:M}),m(B6,{children:m(js,{src:E.picture||void 0,alt:E.name,sx:{width:32,height:32},children:(E.name||"?").charAt(0).toUpperCase()})}),m(q6,{primary:E.name||"Teammate",secondary:M?"In group":null})]},E.user_id)})})]}),B(kh,{children:[m(oi,{color:"inherit",onClick:S,children:"Cancel"}),m(oi,{variant:"contained",disabled:h.length===0||d.isPending,onClick:T,children:"Add"})]})]})}rg.propTypes={open:k.bool.isRequired,onClose:k.func.isRequired,conversation:k.object.isRequired};function rg(i){var Ku,Qu;const e=ct.c(117),{open:t,onClose:s,conversation:n}=i,{enqueueSnackbar:a}=xh(),l=n.conversation_id,u=n.type==="group",d=n.type==="dm",{user:h}=Sm(),p=h==null?void 0:h.db_user_id,f=z6(l),y=KS(l),v=QS(l),C=ZS(l),S=YS(l),w=t&&!d;let T;e[0]!==w?(T={enabled:w},e[0]=w,e[1]=T):T=e[1];const{data:E,isPending:M}=U6(l,T);let x;e[2]!==E?(x=E===void 0?[]:E,e[2]=E,e[3]=x):x=e[3];const P=x;let R;e[4]!==u||e[5]!==P||e[6]!==p?(R=u&&P.some(Ue=>Ue.user_id===p&&Ue.is_admin),e[4]=u,e[5]=P,e[6]=p,e[7]=R):R=e[7];const _=R,[$,G]=c.useState(!1),[q,F]=c.useState(null),[H,N]=c.useState(null),[A,W]=c.useState(!1),[V,K]=c.useState(null);let re;e[8]!==a||e[9]!==C?(re=(Ue,nn)=>{N(null),Ue&&C.mutate({teamMemberId:Ue.team_member_id,role:nn},{onError:ac=>a(es.printError(ac),{variant:"error"})})},e[8]=a,e[9]=C,e[10]=re):re=e[10];const oe=re;let Z;e[11]===Symbol.for("react.memo_cache_sentinel")?(Z=Ue=>{N(null),Ue&&K(Ue)},e[11]=Z):Z=e[11];const fe=Z;let me;e[12]!==V||e[13]!==a||e[14]!==S?(me=()=>{const Ue=V;Ue&&S.mutate(Ue.team_member_id,{onSuccess:()=>K(null),onError:nn=>a(es.printError(nn),{variant:"error"})})},e[12]=V,e[13]=a,e[14]=S,e[15]=me):me=e[15];const Q=me;let j;e[16]!==n.type?(j=K6(n.type)??"Direct message",e[16]=n.type,e[17]=j):j=e[17];const X=!d&&P.length>0?`${P.length} member${P.length===1?"":"s"}`:null;let Te;e[18]!==X||e[19]!==j?(Te=[j,X].filter(Boolean),e[18]=X,e[19]=j,e[20]=Te):Te=e[20];const Ce=Te.join(" · ");let Ie;e[21]!==a||e[22]!==v||e[23]!==q?(Ie=async()=>{const Ue=(q??"").trim();if(Ue)try{await v.mutateAsync(Ue),F(null)}catch(nn){const ac=nn;a(es.printError(ac),{variant:"error"})}},e[21]=a,e[22]=v,e[23]=q,e[24]=Ie):Ie=e[24];const ge=Ie;let Re;e[25]!==a||e[26]!==y||e[27]!==s?(Re=()=>{y.mutate(void 0,{onSuccess:()=>{W(!1),s()},onError:Ue=>{W(!1),a(es.printError(Ue),{variant:"error"})}})},e[25]=a,e[26]=y,e[27]=s,e[28]=Re):Re=e[28];const Se=Re;let Ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(Ve={pt:4},e[29]=Ve):Ve=e[29];const L=n.picture||void 0;let ye;e[30]===Symbol.for("react.memo_cache_sentinel")?(ye={width:72,height:72,fontSize:28},e[30]=ye):ye=e[30];const ne=n.title||"?";let Je;e[31]!==ne?(Je=ne.charAt(0),e[31]=ne,e[32]=Je):Je=e[32];let St;e[33]!==L||e[34]!==Je?(St=m(js,{src:L,sx:ye,children:Je}),e[33]=L,e[34]=Je,e[35]=St):St=e[35];let st;e[36]!==_||e[37]!==n.title||e[38]!==ge||e[39]!==v||e[40]!==q?(st=q==null?B(Be,{direction:"row",alignItems:"center",spacing:.5,children:[m(te,{variant:"h6",sx:{textAlign:"center"},children:n.title}),_&&m(Nt,{size:"small","aria-label":"Rename group",onClick:()=>F(n.title||""),children:m(We,{icon:I6,style:{fontSize:14}})})]}):B(Be,{direction:"row",spacing:1,alignItems:"center",sx:{width:"100%"},children:[m(Wr,{autoFocus:!0,fullWidth:!0,size:"small",label:"Group name",value:q,onChange:Ue=>F(Ue.target.value),onKeyDown:Ue=>{Ue.key==="Enter"&&ge(),Ue.key==="Escape"&&F(null)},slotProps:{htmlInput:{maxLength:255}}}),m(oi,{variant:"contained",onClick:ge,disabled:!(q??"").trim()||v.isPending,children:"Save"}),m(oi,{color:"inherit",onClick:()=>F(null),children:"Cancel"})]}),e[36]=_,e[37]=n.title,e[38]=ge,e[39]=v,e[40]=q,e[41]=st):st=e[41];let Dt;e[42]===Symbol.for("react.memo_cache_sentinel")?(Dt={color:"text.secondary"},e[42]=Dt):Dt=e[42];let qt;e[43]!==Ce?(qt=m(te,{variant:"body2",sx:Dt,children:Ce}),e[43]=Ce,e[44]=qt):qt=e[44];let Ft;e[45]!==St||e[46]!==st||e[47]!==qt?(Ft=B(Be,{alignItems:"center",spacing:1,children:[St,st,qt]}),e[45]=St,e[46]=st,e[47]=qt,e[48]=Ft):Ft=e[48];let Kt;e[49]===Symbol.for("react.memo_cache_sentinel")?(Kt=m(gd,{sx:{my:2}}),e[49]=Kt):Kt=e[49];let Lt;e[50]===Symbol.for("react.memo_cache_sentinel")?(Lt=m(te,{variant:"subtitle2",children:"Mute notifications"}),e[50]=Lt):Lt=e[50];let Pt;e[51]===Symbol.for("react.memo_cache_sentinel")?(Pt=B(U,{children:[Lt,m(te,{variant:"caption",sx:{color:"text.secondary"},children:"You'll still see new messages in the app"})]}),e[51]=Pt):Pt=e[51];const Qt=!!n.muted;let xi;e[52]!==n.muted||e[53]!==f?(xi=()=>f.mutate({muted:!n.muted}),e[52]=n.muted,e[53]=f,e[54]=xi):xi=e[54];let je;e[55]===Symbol.for("react.memo_cache_sentinel")?(je={"aria-label":"Mute notifications"}
2,e[55]=je):je=e[55];let Fe;e[56]!==Qt||e[57]!==xi?(Fe=B(Be,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,children:[Pt,m(F6,{checked:Qt,onChange:xi,inputProps:je})]}),e[56]=Qt,e[57]=xi,e[58]=Fe):Fe=e[58];let Zt;e[59]!==_||e[60]!==n.type||e[61]!==d||e[62]!==P||e[63]!==M||e[64]!==p?(Zt=!d&&B(fi,{children:[m(gd,{sx:{my:2}}),m(te,{variant:"subtitle2",sx:{mb:.5},children:"Members"}),n.type==="team"&&m(te,{variant:"caption",sx:{display:"block",color:"text.secondary",mb:1},children:"Everyone on the team is in this chat automatically."}),M?m(U,{sx:{textAlign:"center",py:2},children:m(Gn,{size:20})}):m(Th,{dense:!0,disablePadding:!0,sx:{maxHeight:264,overflowY:"auto"},children:P.map(Ue=>B(qS,{disableGutters:!0,children:[m(B6,{sx:{minWidth:44},children:m(js,{src:Ue.picture||void 0,sx:{width:32,height:32},children:(Ue.name||"?").charAt(0)})}),m(q6,{primary:Ue.name}),B(Be,{direction:"row",spacing:.5,alignItems:"center",children:[!Ue.user_id&&m(no,{variant:"ghost",color:"error",children:Ue.account_deleted?"Account deleted":"No account"}),Ue.is_admin&&m(no,{variant:"ghost",color:"primary",children:"Admin"}),Ue.is_coach&&m(no,{variant:"ghost",children:"Coach"}),_&&Ue.user_id!==p&&m(Nt,{size:"small","aria-label":`Manage ${Ue.name}`,onClick:nn=>N({anchor:nn.currentTarget,member:Ue}),children:m(We,{icon:hS,style:{fontSize:14,width:14,height:14}})})]})]},Ue.team_member_id))}),_&&m(oi,{fullWidth:!0,variant:"outlined",startIcon:m(We,{icon:pS}),onClick:()=>G(!0),sx:{mt:1},children:"Add members"})]}),e[59]=_,e[60]=n.type,e[61]=d,e[62]=P,e[63]=M,e[64]=p,e[65]=Zt):Zt=e[65];let ui;e[66]!==u||e[67]!==y.isPending?(ui=u&&B(fi,{children:[m(gd,{sx:{my:2}}),m(oi,{fullWidth:!0,color:"error",variant:"outlined",startIcon:m(We,{icon:fS}),onClick:()=>W(!0),disabled:y.isPending,children:"Leave group"})]}),e[66]=u,e[67]=y.isPending,e[68]=ui):ui=e[68];let Di;e[69]!==Ft||e[70]!==Fe||e[71]!==Zt||e[72]!==ui?(Di=B(Ul,{sx:Ve,children:[Ft,Kt,Fe,Zt,ui]}),e[69]=Ft,e[70]=Fe,e[71]=Zt,e[72]=ui,e[73]=Di):Di=e[73];let di;e[74]!==s?(di=m(kh,{children:m(oi,{color:"inherit",onClick:s,children:"Close"})}),e[74]=s,e[75]=di):di=e[75];let hi;e[76]!==s||e[77]!==t||e[78]!==Di||e[79]!==di?(hi=B(fo,{open:t,onClose:s,fullWidth:!0,maxWidth:"xs",children:[Di,di]}),e[76]=s,e[77]=t,e[78]=Di,e[79]=di,e[80]=hi):hi=e[80];const nc=H==null?void 0:H.anchor,rc=!!H;let So;e[81]===Symbol.for("react.memo_cache_sentinel")?(So=()=>N(null),e[81]=So):So=e[81];let os;e[82]!==oe||e[83]!==(H==null?void 0:H.member)?(os=(Ku=H==null?void 0:H.member)!=null&&Ku.is_admin?m(Hr,{onClick:()=>oe(H==null?void 0:H.member,"member"),children:"Remove as admin"}):(Qu=H==null?void 0:H.member)!=null&&Qu.user_id?m(Hr,{onClick:()=>oe(H==null?void 0:H.member,"admin"),children:"Make admin"}):null,e[82]=oe,e[83]=H==null?void 0:H.member,e[84]=os):os=e[84];let wo;e[85]===Symbol.for("react.memo_cache_sentinel")?(wo={color:"error.main"},e[85]=wo):wo=e[85];let Yn;e[86]!==(H==null?void 0:H.member)?(Yn=m(Hr,{sx:wo,onClick:()=>fe(H==null?void 0:H.member),children:"Remove from group"}),e[86]=H==null?void 0:H.member,e[87]=Yn):Yn=e[87];let xs;e[88]!==nc||e[89]!==rc||e[90]!==os||e[91]!==Yn?(xs=B(W6,{anchorEl:nc,open:rc,onClose:So,children:[os,Yn]}),e[88]=nc,e[89]=rc,e[90]=os,e[91]=Yn,e[92]=xs):xs=e[92];let Es;e[93]!==$||e[94]!==n.team_id||e[95]!==l||e[96]!==u||e[97]!==P?(Es=u&&m(ng,{open:$,onClose:()=>G(!1),teamId:n.team_id,conversationId:l,existingMemberIds:P.map(cx)}),e[93]=$,e[94]=n.team_id,e[95]=l,e[96]=u,e[97]=P,e[98]=Es):Es=e[98];let Xn;e[99]!==V||e[100]!==n.title||e[101]!==Q||e[102]!==u||e[103]!==S?(Xn=u&&m(V3,{open:!!V,close:()=>K(null),title:`Remove ${(V==null?void 0:V.name)||"this member"}?`,description:`They'll be removed from "${n.title}" and won't
3            be able to read or send messages here. Only a group admin can add
4            them back.`,actions:m(oi,{sx:{boxShadow:"none"},variant:"contained",color:"error",onClick:Q,loading:S.isPending,children:"Remove"})}),e[99]=V,e[100]=n.title,e[101]=Q,e[102]=u,e[103]=S,e[104]=Xn):Xn=e[104];let Ts;e[105]!==A||e[106]!==n.title||e[107]!==Se||e[108]!==u||e[109]!==y.isPending?(Ts=u&&m(V3,{open:A,close:()=>W(!1),title:`Leave "${n.title}
4"?`,description:`The group will disappear from your messages and you won't
5            be able to read or send anything in it. Only a group admin can add
6            you back.`,actions:m(oi,{sx:{boxShadow:"none"},variant:"contained",color:"error",onClick:Se,loading:y.isPending,children:"Leave group"})}),e[105]=A,e[106]=n.title,e[107]=Se,e[108]=u,e[109]=y.isPending,e[110]=Ts):Ts=e[110];let xo;return e[111]!==hi||e[112]!==xs||e[113]!==Es||e[114]!==Xn||e[115]!==Ts?(xo=B(fi,{children:[hi,xs,Es,Xn,Ts]}),e[111]=hi,e[112]=xs,e[113]=Es,e[114]=Xn,e[115]=Ts,e[116]=xo):xo=e[116],xo}function cx(i){return i.user_id}var F3=Object.defineProperty,km=(i,e)=>{let t={};for(var s in i)F3(t,s,{get:i[s],enumerable:!0});return F3(t,Symbol.toStringTag,{value:"Module"}),t};const Gs=Symbol(0);let jd=!1,Zp=!1,ys=null,Ao=null,Ji=null,Fi=0,To=[],$m={};const ux=()=>{},Kl=0,ag=1,Gd=2,Ph=3;function dx(){jd=!0,queueMicrotask(og)}function og(){if(!To.length){jd=!1;return}Zp=!0;for(let i=0;i<To.length;i++)To[i].$st!==Kl&&hx(To[i]);To=[],jd=!1,Zp=!1}function hx(i){let e=[i];for(;i=i[Gs];)i.$e&&i.$st!==Kl&&e.push(i);for(let t=e.length-1;t>=0;t--)Dm(e[t])}function px(i){const e=oo();return Du(e,i.length?i.bind(null,ql.bind(e)):i,null)}function Y(i){return Du(ys,i,null)}function Bl(i){return Du(null,i,null)}function bs(){Zp||og()}function _u(){return ys}function Wt(i,e){try{return Du(e,i,null)}catch(t){Mm(e,t);return}}function Pm(i,e=ys){return e==null?void 0:e.$cx[i]}function fx(i,e,t=ys){t&&(t.$cx={...t.$cx,[i]:e})}function _e(i){if(!i||!ys)return i||ux;const e=ys;return e.$d?Array.isArray(e.$d)?e.$d.push(i):e.$d=[e.$d,i]:e.$d=i,function(){e.$st!==Ph&&(i.call(null),Mh(e.$d)?e.$d=null:Array.isArray(e.$d)&&e.$d.splice(e.$d.indexOf(i),1))}}function ql(i=!0){if(this.$st!==Ph){if(this.$h)if(Array.isArray(this.$h))for(let e=this.$h.length-1;e>=0;e--)ql.call(this.$h[e]);else ql.call(this.$h);if(i){const e=this[Gs];e&&(Array.isArray(e.$h)?e.$h.splice(e.$h.indexOf(this),1):e.$h=null),mx(this)}}}function mx(i){i.$st=Ph,i.$d&&lg(i),i.$s&&Yp(i,0),i[Gs]=null,i.$s=null,i.$o=null,i.$h=null,i.$cx=$m,i.$eh=null}function lg(i){try{if(Array.isArray(i.$d))for(let e=i.$d.length-1;e>=0;e--){const t=i.$d[e];t.call(t)}else i.$d.call(i.$d);i.$d=null}catch(e){Mm(i,e)}}function Du(i,e,t){const s=ys,n=Ao;ys=i,Ao=t;try{return e.call(i)}finally{ys=s,Ao=n}}function Mm(i,e){if(!i||!i.$eh)throw e;let t=0,s=i.$eh.length,n=e;for(t=0;t<s;t++)try{i.$eh[t](n);break}catch(a){n=a}if(t===s)throw n}function Rm(){return this.$st===Ph?this.$v:(Ao&&!this.$e&&(!Ji&&Ao.$s&&Ao.$s[Fi]==this?Fi++:Ji?Ji.push(this):Ji=[this]),this.$c&&Dm(this),this.$v)}function cg(i){const e=Mh(i)?i(this.$v):i;if(this.$ch(this.$v,e)&&(this.$v=e,this.$o))for(let t=0;t<this.$o.length;t++)hg(this.$o[t],Gd);return this.$v}const Am=function(){this[Gs]=null,this.$h=null,ys&&ys.append(this)},go=Am.prototype;go.$cx=$m;go.$eh=null;go.$c=null;go.$d=null;go.append=function(i){i[Gs]=this,this.$h?Array.isArray(this.$h)?this.$h.push(i):this.$h=[this.$h,i]:this.$h=i,i.$cx=i.$cx===$m?this.$cx:{...this.$cx,...i.$cx},this.$eh&&(i.$eh=i.$eh?[...i.$eh,...this.$eh]:this.$eh)};go.dispose=function(){ql.call(this)};function oo(){return new Am}const ug=function(e,t,s){Am.call(this),this.$st=t?Gd:Kl,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=e,t&&(this.$c=t),s&&s.dirty&&(this.$ch=s.dirty)},Im=ug.prototype;Object.setPrototypeOf(Im,go);Im.$ch=gx;Im.call=Rm;function _m(i,e,t){return new ug(i,e,t)}function gx(i,e){return i!==e}function Mh(i){return typeof i=="function"}function Dm(i){if(i.$st===ag)for(let e=0;e<i.$s.length&&(Dm(i.$s[e]),i.$st!==Gd);e++);i.$st===Gd?dg(i):i.$st=Kl}function yx(i){i.$h&&ql.call(i,!1),i.$d&&lg(i),i.$eh=i[Gs]?i[Gs].$eh:null}function dg(i){let e=Ji,t=Fi;Ji=null,Fi=0;try{yx(i);const s=Du(i,i.$c,i);W3(i),!i.$e&&i.$i?cg.call(i,s):(i.$v=s,i.$i=!0)}catch(s){W3(i),Mm(i,s)}finally{Ji=e,Fi=t,i.$st=Kl}}function W3(i){if(Ji){if(i.$s&&Yp(i,Fi),i.$s&&Fi>0){i.$s.length=Fi+Ji.length;for(let t=0;t<Ji.length;t++)i.$s[Fi+t]=Ji[t]}else i.$s=Ji;let e;for(let t=Fi;t<i.$s.length;t++)e=i.$s[t],e.$o?e.$o.push(i):e.$o=[i]}else i.$s&&Fi<i.$s.length&&(Yp(i,Fi),i.$s.length=Fi)}function hg(i,e){if(!(i.$st>=e)&&(i.$e&&i.$st===Kl&&(To.push(i),jd||dx()),i.$st=e,i.$o))for(let t=0;t<i.$o.length;t++)hg(i.$o[t],ag)}function Yp(i,e){let t,s;for(let n=e;n<i.$s.length;n++)t=i.$s[n],t.$o&&(s=t.$o.indexOf(i),t.$o[s]=t.$o[t.$o.length-1],t.$o.pop())}
6function de(i,e){const t=_m(i,null,e),s=Rm.bind(t);return s[Gs]=!0,s.set=cg.bind(t),s}function bx(i){return Mh(i)&&Gs in i}function On(i,e){const t=_m(e==null?void 0:e.initial,i,e),s=Rm.bind(t);return s[Gs]=!0,s}function pg(i,e){const t=_m(null,function(){let n=i();return Mh(n)&&_e(n),null},void 0);return t.$e=!0,dg(t),ql.bind(t,!0)}function fg(i){return bx(i)&&"set"in i}function Ln(...i){}function vs(i){return i===null}function Ot(i){return typeof i>"u"}function mg(i){return vs(i)||Ot(i)}function gg(i){return(i==null?void 0:i.constructor)===Object}function Si(i){return typeof i=="number"&&!Number.isNaN(i)}function le(i){return typeof i=="string"}function Fl(i){return typeof i=="boolean"}function Hi(i){return typeof i=="function"}function wt(i){return Array.isArray(i)}const I=pg,vx=Event,yg=Symbol("DOM_EVENT");var Ke=class extends vx{get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){var i;return((i=this.triggers.origin)==null?void 0:i.isTrusted)??!1}constructor(i,...e){var s,n;super(i,e[0]),this[yg]=!0,this.triggers=new Cx,this.detail=(s=e[0])==null?void 0:s.detail;const t=(n=e[0])==null?void 0:n.trigger;t&&this.triggers.add(t)}},Cx=class{constructor(){this.chain=[]}get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(i){this.chain.push(i),Lm(i)&&this.chain.push(...i.triggers)}remove(i){return this.chain.splice(this.chain.indexOf(i),1)[0]}has(i){return this.chain.some(e=>e===i)}hasType(i){return!!this.findType(i)}findType(i){return this.chain.find(e=>e.type===i)}walk(i){for(const e of this.chain){const t=i(e);if(t)return[e,t]}}[Symbol.iterator](){return this.chain.values()}};function Lm(i){return!!(i!=null&&i[yg])}function Sx(i,e){if(Lm(i))return i.triggers.walk(e)}function bg(i,e){return Lm(i)?i.triggers.findType(e):void 0}function wx(i,e){return!!bg(i,e)}function xx(i,e){e&&i.triggers.add(e)}var Nm=class extends EventTarget{addEventListener(i,e,t){return super.addEventListener(i,e,t)}removeEventListener(i,e,t){return super.removeEventListener(i,e,t)}};function pt(i,e,t,s){return i.addEventListener(e,t,s),_e(()=>i.removeEventListener(e,t,s))}var _o,Do,M2,Xe=(M2=class{constructor(i){g(this,_o);g(this,Do);b(this,_o,i),b(this,Do,new AbortController),_e(this.abort.bind(this))}get signal(){return r(this,Do).signal}add(i,e,t){if(this.signal.aborted)throw Error("aborted");return r(this,_o).addEventListener(i,e,{...t,signal:t!=null&&t.signal?Ex(this.signal,t.signal):this.signal}),this}remove(i,e){return r(this,_o).removeEventListener(i,e),this}abort(i){r(this,Do).abort(i)}},_o=new WeakMap,Do=new WeakMap,M2);function Ex(...i){const e=new AbortController,t={signal:e.signal};function s(n){e.abort(n.target.reason)}for(const n of i){if(n.aborted){e.abort(n.reason);break}n.addEventListener("abort",s,t)}return e.signal}function Xp(i){return!!(i!=null&&i.type.startsWith("pointer"))}function Mo(i){return!!(i!=null&&i.type.startsWith("touch"))}function vg(i){return/^(click|mouse)/.test((i==null?void 0:i.type)??"")}function Lu(i){return!!(i!=null&&i.type.startsWith("key"))}function Cg(i){return Lu(i)&&i.key==="Enter"}function Rh(i){return Lu(i)&&(i.key==="Enter"||i.key===" ")}function Sg(i){return i instanceof Node}function we(i,e,t){if(i)if(!t&&t!==""&&t!==0)i.removeAttribute(e);else{const s=t===!0?"":t+"";i.getAttribute(e)!==s&&i.setAttribute(e,s)}else return}function Ii(i,e,t){if(i)!t&&t!==0?i.style.removeProperty(e):i.style.setProperty(e,t+"");else return}function wg(i,e,t){i.classList[t?"add":"remove"](e)}function zn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function xg(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function Tx(i){return kx(i).replace(/\s/g,"")}function kx(i){return Ql(i.replace(/-./g,e=>" "+e[1].toUpperCase()))}function Ql(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Ec(i){return i?"true":"false"}function $x(){const i=new Set;return{add(...e){for(const t of e)i.add(t)},empty(){for(const e of i)e();i.clear()}}}function Om(i){return Object.keys(i)}function zd(){let i,e;return{promise:new Promise((t,s)=>{i=t,e=s}),resolve:i,reject:e}}function Eg(i){return new Promise(e=>
6setTimeout(e,i))}function Xr(i){let e=-1,t;function s(...n){t=n,!(e>=0)&&(e=window.requestAnimationFrame(()=>{i.apply(this,t),e=-1,t=void 0}))}return s}const Px=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:i=>window.setTimeout(i,1):Ln;function Tg(i,e){return new Promise(t=>{Px(s=>{i==null||i(s),t()},e)})}var Li={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},H3=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],j3=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],G3=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Pi=typeof window<"u"&&typeof window.document<"u"?window.document:{},Ui="fullscreenEnabled"in Pi&&Object.keys(Li)||H3[0]in Pi&&H3||j3[0]in Pi&&j3||G3[0]in Pi&&G3||[],jr={requestFullscreen:function(i){return i[Ui[Li.requestFullscreen]]()},requestFullscreenFunction:function(i){return i[Ui[Li.requestFullscreen]]},get exitFullscreen(){return Pi[Ui[Li.exitFullscreen]].bind(Pi)},get fullscreenPseudoClass(){return":"+Ui[Li.fullscreen]},addEventListener:function(i,e,t){return Pi.addEventListener(Ui[Li[i]],e,t)},removeEventListener:function(i,e,t){return Pi.removeEventListener(Ui[Li[i]],e,t)},get fullscreenEnabled(){return!!Pi[Ui[Li.fullscreenEnabled]]},set fullscreenEnabled(i){},get fullscreenElement(){return Pi[Ui[Li.fullscreenElement]]},set fullscreenElement(i){},get onfullscreenchange(){return Pi[("on"+Ui[Li.fullscreenchange]).toLowerCase()]},set onfullscreenchange(i){return Pi[("on"+Ui[Li.fullscreenchange]).toLowerCase()]=i},get onfullscreenerror(){return Pi[("on"+Ui[Li.fullscreenerror]).toLowerCase()]},set onfullscreenerror(i){return Pi[("on"+Ui[Li.fullscreenerror]).toLowerCase()]=i}};function Un(i){return{id:Symbol(),provide:i}}function _i(i,e,t=_u()){var n;const s=!Ot(e);fx(i.id,s?e:(n=i.provide)==null?void 0:n.call(i),t)}function Tt(i){return Pm(i.id)}function Vn(i){return!Ot(Pm(i.id))}const rp=Symbol(0),ap=Symbol(0),Ah=Symbol(0),op={};var ua,da,nr,ha,zs,kg,$g,Pg,Mg,R2,Mx=(R2=class{constructor(i,e,t){g(this,zs);g(this,ua);g(this,da);g(this,nr);g(this,ha);var a;this[Ah]=null,this.$el=de(null),this.el=null,this.scope=null,this.attachScope=null,this.connectScope=null,this.component=null,this.destroyed=!1,this.props=op,this.attrs=null,this.styles=null,b(this,ua,[]),b(this,da,[]),b(this,nr,[]),b(this,ha,[]),this.scope=e,t!=null&&t.scope&&t.scope.append(e);let s=i.state,n=i.props;if(s&&(this.$state=s.create(),this.state=new Proxy(this.$state,{get:(l,u)=>this.$state[u]()}),_i(s,this.$state)),n&&(this.props=Rx(n),t!=null&&t.props))for(const l of Object.keys(t.props))(a=this.props[l])==null||a.set(t.props[l]);_e(this.destroy.bind(this))}setup(){Wt(()=>{for(const i of r(this,ua))i()},this.scope)}attach(i){this.el||(this.el=i,this.$el.set(i),Wt(()=>{this.attachScope=oo(),Wt(()=>{for(const e of r(this,da))e(this.el);o(this,zs,kg).call(this),o(this,zs,$g).call(this)},this.attachScope)},this.scope),i.dispatchEvent(new Event("attached")))}detach(){var i;(i=this.attachScope)==null||i.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!r(this,nr).length||Wt(()=>{this.connectScope=oo(),Wt(()=>{for(const i of r(this,nr))i(this.el)},this.connectScope)},this.attachScope)}disconnect(){var i;(i=this.connectScope)==null||i.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,Wt(()=>{for(const e of r(this,ha))e(this.el)},this.scope);const i=this.el;this.detach(),this.scope.dispose(),r(this,ua).length=0,r(this,da).length=0,r(this,nr).length=0,r(this,ha).length=0,this.component=null,this.attrs=null,this.styles=null,this.props=op,this.scope=null,this.state=op,this.$state=null,i&&delete i.$}addHooks(i){i.onSetup&&r(this,ua).push(i.onSetup.bind(i)),i.onAttach&&r(this,da).push(i.onAttach.bind(i)),i.onConnect&&r(this,nr).push(i.onConnect.bind(i)),i.onDestroy&&r(this,ha).push(i.onDestroy.bind(i))}},ua=new WeakMap,da=new WeakMap,nr=new WeakMap,ha=new WeakMap,zs=new WeakSet,kg=function(){if(this.attrs)for(const i of Object.keys(this.attrs))Hi(this.attrs[i])?I(o(this,zs,Pg).bind(this,i)):we(this.el,i,this.attrs[i])},$g=function(){if(this.styles)for(const i of Object.keys(this.styles))Hi(this.styles[i])?I(o(this,zs,Mg).bind(this,i)):Ii(this.el,i,this.styles[i])},Pg=function(i){we(this.el,i,this.attrs[i].call(this.component))},Mg=function(i){Ii(this.el,i,this.styles[i].call(this.component))},R2);function Rx(i){const e={};for(const t of Object.keys(i)){const s=i[t];e[t]=de(s,s)}return e}let bc={$$:null};function Ax(i,e){return px(()=>{bc.$$=new Mx(i,_u(),e);const t=new i;return bc.$$.component=t,bc.$$=null,t})}
6var zi=class extends EventTarget{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}constructor(){super(),bc.$$&&this.attach(bc)}attach({$$:i}){return this.$$=i,i.addHooks(this),this}addEventListener(i,e,t){this.listen(i,e,t)}removeEventListener(i,e,t){var s;(s=this.el)==null||s.removeEventListener(i,e,t)}setAttributes(i){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,i)}setStyles(i){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,i)}setCSSVars(i){this.setStyles(i)}createEvent(i,...e){return new Ke(i,e[0])}dispatch(i,...e){if(!this.el)return!1;const t=i instanceof Event?i:new Ke(i,e[0]);return Object.defineProperty(t,"target",{get:()=>this.$$.component}),Bl(()=>{var s,n;return(n=(s=this.$$)[Ah])==null||n.call(s,t),this.el.dispatchEvent(t)})}dispatchEvent(i){return this.dispatch(i)}listen(i,e,t){return this.el?pt(this.el,i,e,t):Ln}},Ne=class extends zi{subscribe(i){return Wt(()=>I(()=>i(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}};function at(i,e,t){i[rp]||(i[rp]=new Set),i[rp].add(e)}function Ut(i,e,t){i[ap]||(i[ap]=new Set),i[ap].add(e)}var Lo,A2,Kn=(A2=class{constructor(i){g(this,Lo);this.id=Symbol(0),this.record=i,b(this,Lo,Object.getOwnPropertyDescriptors(i))}create(){const i={},e=new Proxy(i,{get:(t,s)=>i[s]()});for(const t of Object.keys(this.record)){const s=r(this,Lo)[t].get;i[t]=s?On(s.bind(e)):de(this.record[t])}return i}reset(i,e){for(const t of Object.keys(i))!r(this,Lo)[t].get&&(!e||e(t))&&i[t].set(this.record[t])}},Lo=new WeakMap,A2);function Zl(i){return Tt(i)}var Jr=Ix;function Ix(i,e,t){var s=null,n=null,a=t&&t.leading,l=t&&t.trailing;a==null&&(a=!0),l==null&&(l=!a),a==!0&&(l=!1);var u=function(){s&&(clearTimeout(s),s=null)},d=function(){var p=n;u(),p&&p()},h=function(){var p=a&&!s,f=this,y=arguments;if(n=function(){return i.apply(f,y)},s||(s=setTimeout(function(){if(s=null,l)return n()},e)),p)return p=!1,n()};return h.cancel=u,h.flush=d,h}var Ih=_x;function _x(i,e,t){var s=null,n=null,a=function(){s&&(clearTimeout(s),n=null,s=null)},l=function(){var d=n;a(),d&&d()},u=function(){if(!e)return i.apply(this,arguments);var d=this,h=arguments,p=t&&!s;if(a(),n=function(){i.apply(d,h)},s=setTimeout(function(){if(s=null,!p){var f=n;return n=null,f()}},e),p)return n()};return u.cancel=a,u.flush=l,u}const z3=i=>typeof i=="object"&&i!=null&&i.nodeType===1,U3=(i,e)=>(!e||i!=="hidden")&&i!=="visible"&&i!=="clip",Xu=(i,e)=>{if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){const t=getComputedStyle(i,null);return U3(t.overflowY,e)||U3(t.overflowX,e)||(s=>{const n=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(s);return!!n&&(n.clientHeight<s.scrollHeight||n.clientWidth<s.scrollWidth)})(i)}return!1},Ju=(i,e,t,s,n,a,l,u)=>a<i&&l>e||a>i&&l<e?0:a<=i&&u<=t||l>=e&&u>=t?a-i-s:l>e&&u<t||a<i&&u>t?l-e+n:0,Dx=i=>{const e=i.parentElement;return e??(i.getRootNode().host||null)},Rg=(i,e)=>{var t,s,n,a;if(typeof document>"u")return[];const{scrollMode:l,block:u,inline:d,boundary:h,skipOverflowHiddenElements:p}=e,f=typeof h=="function"?h:V=>V!==h;if(!z3(i))throw new TypeError("Invalid target");const y=document.scrollingElement||document.documentElement,v=[];let C=i;for(;z3(C)&&f(C);){if(C=Dx(C),C===y){v.push(C);break}C!=null&&C===document.body&&Xu(C)&&!Xu(document.documentElement)||C!=null&&Xu(C,p)&&v.push(C)}const S=(s=(t=window.visualViewport)==null?void 0:t.width)!=null?s:innerWidth,w=(a=(n=window.visualViewport)==null?void 0:n.height)!=null?a:innerHeight,{scrollX:T,scrollY:E}=window,{height:M,width:x,top:P,right:R,bottom:_,left:$}=i.getBoundingClientRect(),{top:G,right:q,bottom:F,left:H}=(V=>{const K=window.getComputedStyle(V);return{top:parseFloat(K.scrollMarginTop)||0,right:parseFloat(K.scrollMarginRight)||0,bottom:parseFloat(K.scrollMarginBottom)||0,left
6:parseFloat(K.scrollMarginLeft)||0}})(i);let N=u==="start"||u==="nearest"?P-G:u==="end"?_+F:P+M/2-G+F,A=d==="center"?$+x/2-H+q:d==="end"?R+q:$-H;const W=[];for(let V=0;V<v.length;V++){const K=v[V],{height:re,width:oe,top:Z,right:fe,bottom:me,left:Q}=K.getBoundingClientRect();if(l==="if-needed"&&P>=0&&$>=0&&_<=w&&R<=S&&(K===y&&!Xu(K)||P>=Z&&_<=me&&$>=Q&&R<=fe))return W;const j=getComputedStyle(K),X=parseInt(j.borderLeftWidth,10),Te=parseInt(j.borderTopWidth,10),Ce=parseInt(j.borderRightWidth,10),Ie=parseInt(j.borderBottomWidth,10);let ge=0,Re=0;const Se="offsetWidth"in K?K.offsetWidth-K.clientWidth-X-Ce:0,Ve="offsetHeight"in K?K.offsetHeight-K.clientHeight-Te-Ie:0,L="offsetWidth"in K?K.offsetWidth===0?0:oe/K.offsetWidth:0,ye="offsetHeight"in K?K.offsetHeight===0?0:re/K.offsetHeight:0;if(y===K)ge=u==="start"?N:u==="end"?N-w:u==="nearest"?Ju(E,E+w,w,Te,Ie,E+N,E+N+M,M):N-w/2,Re=d==="start"?A:d==="center"?A-S/2:d==="end"?A-S:Ju(T,T+S,S,X,Ce,T+A,T+A+x,x),ge=Math.max(0,ge+E),Re=Math.max(0,Re+T);else{ge=u==="start"?N-Z-Te:u==="end"?N-me+Ie+Ve:u==="nearest"?Ju(Z,me,re,Te,Ie+Ve,N,N+M,M):N-(Z+re/2)+Ve/2,Re=d==="start"?A-Q-X:d==="center"?A-(Q+oe/2)+Se/2:d==="end"?A-fe+Ce+Se:Ju(Q,fe,oe,X,Ce+Se,A,A+x,x);const{scrollLeft:ne,scrollTop:Je}=K;ge=ye===0?0:Math.max(0,Math.min(Je+ge/ye,K.scrollHeight-re/ye+Ve)),Re=L===0?0:Math.max(0,Math.min(ne+Re/L,K.scrollWidth-oe/L+Se)),N+=Je-ge,A+=ne-Re}W.push({el:K,top:ge,left:Re})}return W},Nu=c.createContext({current:null});Nu.displayName="Scope";function Ag(i,...e){return c.createElement(Nu.Provider,{value:i},...e)}function Yl(){return c.useContext(Nu).current}function Vm(i){const e=Yl();return c.useMemo(()=>Pm(i.id,e),[e])}var rr,Pc,rh,on;rr=class extends c.Component{constructor(t,s){var a;super(t);g(this,on);b(this,on,{current:oo()}),s&&s.append(r(this,on).current);const n=this.constructor;r(n,Pc)&&_i(r(n,Pc),(a=r(n,rh))==null?void 0:a.call(n),r(this,on).current)}componentWillUnmount(){var t;(t=r(this,on).current)==null||t.dispose(),r(this,on).current=null}render(){var t;return Ag(r(this,on),(t=this.props)==null?void 0:t.children)}},Pc=new WeakMap,rh=new WeakMap,on=new WeakMap,rr.contextType=Nu,g(rr,Pc),g(rr,rh);function Ig(i,e){typeof i=="function"?i(e):i&&(i.current=e)}function nt(...i){return e=>i.forEach(t=>Ig(t,e))}function Lx(i,e){const t=c.forwardRef((s,n)=>{var w,T,E,M,x,P,R,_;let a=c.useContext(Nu),l=c.useRef(null),u=c.useRef();if(!u.current){const $=Ox(),G=Z3(i,$,s,a.current);$.component=G,u.current=$,l.current=G.scope}function d(){let $=u.current,G=a.current;if(clearTimeout($.destroyId),$.destroyId=-1,$.component.$$.destroyed){const q=Z3(i,$,s,G);$.component=q,$.attached=!1,$.forwardRef=!1,l.current=q.scope}return $.el&&Q3($,$.el),$.forwardRef||(Ig(n,$.component),$.forwardRef=!0),()=>bd($)}function h($){const G=u.current;if(!G.forwardRef){G.el=$;return}clearTimeout(G.refChangeId),G.refChangeId=window.setTimeout(()=>{const q=u.current;q.refChangeId=-1,q.el!==$&&(bd(q),$&&Q3(q,$),q.el=$)})}c.useEffect(()=>{const $=u.current;return clearTimeout($.destroyId),$.destroyId=-1,function(){Hi(s.children)&&(clearTimeout($.refChangeId),$.refChangeId=-1,clearTimeout($.connectId),$.connectId=-1,clearTimeout($.destroyId),$.destroyId=window.setTimeout(()=>{$.destroyId=-1,bd($),$.component.$$.destroy(),$.component.$$[Ah]=null,$.callbacks={},$.domCallbacks={},l.current=null}))}},[]),c.useEffect(bs);let p=u.current,{children:f,...y}=s,v={},C=p.prevProps,S=Object.keys(y);p.callbacks={};for(const $ of[...C,...S])if(e.props.has($))p.component.$props[$].set(Ot(y[$])?(w=i.props)==null?void 0:w[$]:y[$]);else if((T=e.events)!=null&&T.has($)||(E=e.eventsRE)!=null&&E.test($))p.callbacks[$]=y[$];else if((M=e.domEvents)!=null&&M.has($)||(x=e.domEventsRE)!=null&&x.test($)){let G=zn($.slice(2));p.domCallbacks[G]=y[$],S.includes($)?p.el&&!((_=p.listening)!=null&&_.has(G))&&(p.listening||(p.listening=new Set),p.listening.add(G),p.el.addEventListener(G,p.onDOMEvent)):((P=p.el)==null||P.removeEventListener(G,p.onDOMEvent),(R=p.listening)==null||R.delete(G))}else v[$]=y[$];return p.prevProps=S,Ag(l,c.createElement(Nx,{effect:d}),Hi(f)?f==null?void 0:f({...v,suppressHydrationWarning:!0,ref:h},p.component):f)});return t.displayName=i.name+"Bridge",t}function Nx({effect:i}){return c.useEffect(i,[]),null}const K3=new Map;function Ox(){const i={el:null,prevProps:[],callbacks:{},domCallbacks:{},refChangeId:-1,connectId:-1,destroyId:-1,attached:!1,forwardRef:!1,listening:null,onDOMEvent(e){var s,n;const t=Ot(e.detail)?[e]:[e.detail,e];(n=(s=i.domCallbacks)[e.type])==null||n.call(s,...t)}};return i}function Q3(i,e){if(!(i.el===e&&i.attached)){if(i.attached&&bd(i),i.domCallbacks){i.listening||(i.listening=new Set);for(const t of Object.keys(i.domCallbacks))i.listening.has(t)||(e.addEventListener(t,i.onDOMEvent),i.listening.add(t))}i.component.$$.attach(e),i.connectId=window.setTimeout(()=>{i.component.$$.connect(),i.connectId=-1}),i.attached=!0}}function bd(i){if(i.attached&&(clearTimeout(i.connectId),i.connectId=-1,i.component.$$.detach(),i.attached=!1,i.el&&i.listening)){for(const e of i.listening)i.el.removeEventListener(e,i.onDOMEvent);i.listening.clear()}}function Vx(i){var s,n;let e=K3.get(i.type),t=Ot(i.detail)?[i]:[i.detail,i];e||K3.set(i.type,e=`on${Tx(i.type)}`),(n=(s=this.callbacks)[e])==null||n.call(s,...t)}function Z3(i,e,t,s){const n=Ax(i,{props:t,scope:s});return n.$$[Ah]=Vx.bind(e),n.$$.setup(),n}function Xl(i){return Vm(i)}function $e(i,e){const[,t]=c.useState();return c.useEffect(()=>pg(()=>{i(),t({})}),[e??i]),i()}function Bx(i){const[,e]=c.useState(),t=c.useRef(null);return t.current==null&&(t.current={state:{},$update:de({}),props:new Set}),c.useEffect(()=>{let{state:s,$update:n,props:a}=t.current;return I(()=>{for(const l of a){const u=i[l]();s[l]=wt(u)?[...u]:u}n(),e({})})},[i]),c.useMemo(()=>{let{state:s,$update:n,props:a}=t.current,l=!1;return a.clear(),new Proxy(s,{get(u,d){if(!a.has(d)&&d in i){a.add(d);const h=i[d]();s[d]=wt(h)?[...h]:h,l||(n.set({}),l=!0,queueMicrotask(()=>l=!1))}return s[d]},set(u,d,h){return d in i||(s[d]=h),!0}})},[i])}function Oe(i,e){return Lx(i,{props:new Set(Object.keys(i.props||{})),events:new Set(e==null?void 0:e.events),eventsRE:e==null?void 0:e.eventsRegex,domEvents:e==null?void 0:e.domEvents,domEventsRE:e==null?void 0:e.domEventsRegex})}var _g='<path fill-rule="evenodd" clip-rule="evenodd" d="M15.0007 28.7923C15.0007 29.0152 14.9774 29.096 14.9339 29.1775C14.8903 29.259 14.8263 29.323 14.7449 29.3665C14.6634 29.4101 14.5826 29.4333 14.3597 29.4333H12.575C12.3521 29.4333 12.2713 29.4101 12.1898 29.3665C12.1083 29.323 12.0443 29.259 12.0008 29.1775C11.9572 29.096 11.934 29.0152 11.934 28.7923V12.2993L5.97496 12.3C5.75208 12.3 5.67125 12.2768 5.58977 12.2332C5.50829 12.1896 5.44434 12.1257 5.40077 12.0442C5.35719 11.9627 5.33398 11.8819 5.33398 11.659V9.87429C5.33398 9.65141 5.35719 9.57059 5.40077 9.48911C5.44434 9.40762 5.50829 9.34368 5.58977 9.3001C5.67125 9.25652 5.75208 9.23332 5.97496 9.23332H26.0263C26.2492 9.23332 26.33 9.25652 26.4115 9.3001C26.493 9.34368 26.557 9.40762 26.6005 9.48911C26.6441 9.57059 26.6673 9.65141 26.6673 9.87429V11.659C26.6673 11.8819 26.6441 11.9627 26.6005 12.0442C26.557 12.1257 26.493 12.1896 26.4115 12.2332C26.33 12.2768 26.2492 12.3 26.0263 12.3L20.067 12.2993L20.0673 28.7923C20.0673 29.0152 20.0441 29.096 20.0005 29.1775C19.957 29.259 19.893 29.323 19.8115 29.3665C19.73 29.4101 19.6492 29.4333 19.4263 29.4333H17.6416C17.4187 29.4333 17.3379 29.4101 17.2564 29.3665C17.175 29.323 17.111 29.259 17.0674 29.1775C17.0239 29.096 17.0007 29.0152 17.0007 28.7923L17 22.7663H15L15.0007 28.7923Z" fill="currentColor"/> <path d="M16.0007 7.89998C17.4734 7.89998 18.6673 6.70608 18.6673 5.23332C18.6673 3.76056 17.4734 2.56665 16.0007 2.56665C14.5279 2.56665 13.334 3.76056 13.334 5.23332C13.334 6.70608 14.5279 7.89998 16.0007 7.89998Z" fill="currentColor"/>',Dg='<path d="M5.33334 6.00001C5.33334 5.63182 5.63181 5.33334 6 5.33334H26C26.3682 5.33334 26.6667 5.63182 26.6667 6.00001V20.6667C26.6667 21.0349 26.3682 21.3333 26 21.3333H23.7072C23.4956 21.3333 23.2966 21.233 23.171 21.0628L22.1859 19.7295C21.8607 19.2894 22.1749 18.6667 22.7221 18.6667H23.3333C23.7015 18.6667 24 18.3682 24 18V8.66668C24 8.29849 23.7015 8.00001 23.3333 8.00001H8.66667C8.29848 8.00001 8 8.29849 8 8.66668V18C8 18.3682 8.29848 18.6667 8.66667 18.6667H9.29357C9.84072 18.6667 10.
61549 19.2894 9.82976 19.7295L8.84467 21.0628C8.71898 21.233 8.52 21.3333 8.30848 21.3333H6C5.63181 21.3333 5.33334 21.0349 5.33334 20.6667V6.00001Z" fill="currentColor"/> <path d="M8.78528 25.6038C8.46013 26.0439 8.77431 26.6667 9.32147 26.6667L22.6785 26.6667C23.2256 26.6667 23.5398 26.0439 23.2146 25.6038L16.5358 16.5653C16.2693 16.2046 15.73 16.2047 15.4635 16.5653L8.78528 25.6038Z" fill="currentColor"/>',Lg='<path d="M17.4853 18.9093C17.4853 19.0281 17.6289 19.0875 17.7129 19.0035L22.4185 14.2979C22.6788 14.0376 23.1009 14.0376 23.3613 14.2979L24.7755 15.7122C25.0359 15.9725 25.0359 16.3946 24.7755 16.655L16.2902 25.1403C16.0299 25.4006 15.6078 25.4006 15.3474 25.1403L13.9332 23.726L13.9319 23.7247L6.86189 16.6547C6.60154 16.3944 6.60154 15.9723 6.86189 15.7119L8.2761 14.2977C8.53645 14.0373 8.95856 14.0373 9.21891 14.2977L13.9243 19.0031C14.0083 19.0871 14.1519 19.0276 14.1519 18.9088L14.1519 6.00004C14.1519 5.63185 14.4504 5.33337 14.8186 5.33337L16.8186 5.33337C17.1868 5.33337 17.4853 5.63185 17.4853 6.00004L17.4853 18.9093Z" fill="currentColor"/>',Ng='<path d="M13.0908 14.3334C12.972 14.3334 12.9125 14.1898 12.9965 14.1058L17.7021 9.40022C17.9625 9.13987 17.9625 8.71776 17.7021 8.45741L16.2879 7.04319C16.0275 6.78284 15.6054 6.78284 15.3451 7.04319L6.8598 15.5285C6.59945 15.7888 6.59945 16.2109 6.8598 16.4713L8.27401 17.8855L8.27536 17.8868L15.3453 24.9568C15.6057 25.2172 16.0278 25.2172 16.2881 24.9568L17.7024 23.5426C17.9627 23.2822 17.9627 22.8601 17.7024 22.5998L12.9969 17.8944C12.9129 17.8104 12.9724 17.6668 13.0912 17.6668L26 17.6668C26.3682 17.6668 26.6667 17.3683 26.6667 17.0001V15.0001C26.6667 14.6319 26.3682 14.3334 26 14.3334L13.0908 14.3334Z" fill="currentColor"/>',Og='<path d="M14.1521 13.0929C14.1521 12.9741 14.0085 12.9147 13.9245 12.9987L9.21891 17.7043C8.95856 17.9646 8.53645 17.9646 8.2761 17.7043L6.86189 16.29C6.60154 16.0297 6.60154 15.6076 6.86189 15.3472L15.3472 6.86195C15.6075 6.6016 16.0296 6.6016 16.29 6.86195L17.7042 8.27616L17.7055 8.27751L24.7755 15.3475C25.0359 15.6078 25.0359 16.0299 24.7755 16.2903L23.3613 17.7045C23.1009 17.9649 22.6788 17.9649 22.4185 17.7045L17.7131 12.9991C17.6291 12.9151 17.4855 12.9746 17.4855 13.0934V26.0022C17.4855 26.3704 17.187 26.6688 16.8188 26.6688H14.8188C14.4506 26.6688 14.1521 26.3704 14.1521 26.0022L14.1521 13.0929Z" fill="currentColor"/>',Vg='<path d="M16.6927 25.3346C16.3245 25.3346 16.026 25.0361 16.026 24.6679L16.026 7.3346C16.026 6.96641 16.3245 6.66794 16.6927 6.66794L18.6927 6.66794C19.0609 6.66794 19.3594 6.96642 19.3594 7.3346L19.3594 24.6679C19.3594 25.0361 19.0609 25.3346 18.6927 25.3346H16.6927Z" fill="currentColor"/> <path d="M24.026 25.3346C23.6578 25.3346 23.3594 25.0361 23.3594 24.6679L23.3594 7.3346C23.3594 6.96641 23.6578 6.66794 24.026 6.66794L26.026 6.66794C26.3942 6.66794 26.6927 6.96642 26.6927 7.3346V24.6679C26.6927 25.0361 26.3942 25.3346 26.026 25.3346H24.026Z" fill="currentColor"/> <path d="M5.48113 23.9407C5.38584 24.2963 5.59689 24.6619 5.95254 24.7572L7.88439 25.2748C8.24003 25.3701 8.60559 25.159 8.70089 24.8034L13.1871 8.06067C13.2824 7.70503 13.0713 7.33947 12.7157 7.24417L10.7838 6.72654C10.4282 6.63124 10.0626 6.8423 9.96733 7.19794L5.48113 23.9407Z" fill="currentColor"/>',Bg='<path fill-rule="evenodd" clip-rule="evenodd" d="M24.9266 7.57992C25.015 7.60672 25.0886 7.64746 25.2462 7.80506L26.956 9.51488C27.1136 9.67248 27.1543 9.74604 27.1811 9.83447C27.2079 9.9229 27.2079 10.0133 27.1811 10.1018C27.1543 10.1902 27.1136 10.2638 26.956 10.4214L13.1822 24.1951C13.0246 24.3527 12.951 24.3935 12.8626 24.4203C12.797 24.4402 12.7304 24.4453 12.6642 24.4357L12.7319 24.4203C12.6435 24.4471 12.553 24.4471 12.4646 24.4203C12.3762 24.3935 12.3026 24.3527 12.145 24.1951L5.04407 17.0942C4.88647 16.9366 4.84573 16.863 4.81893 16.7746C4.79213 16.6862 4.79213 16.5957 4.81893 16.5073C4.84573 16.4189 4.88647 16.3453 5.04407 16.1877L6.7539 14.4779C6.9115 14.3203 6.98506 14.2796 7.07349 14.2528C7.16191 14.226 7.25235 14.226 7.34078 14.2528C7.42921 14.2796 7.50277 14.3203 7.66037 14.4779L12.6628 19.4808L24.3397 7.80506C24.4973 7.64746 24.5709 7.60672 24.6593 7.57992C24.7477 7.55311 24.8382 7.55311 24.9266 7.57992Z" fill="currentColor"/>',qg='<path d="M17.947 16.095C17.999 16.043 17.999 15.9585 17.947 15.9065L11.6295 9.58899C11.3691 9.32864 11.3691 8.90653 11.6295 8.64618L13.2323 7.04341C13.4926 6.78306 13.9147 6.78306 14.1751 7.04341L21.0289 13.8973C21.0392 13.9064 21.0493 13.9158 21.0591 13.9257L22.6619 15.5285C22.9223 15.7888 22.9223 16.2109 22.6619 16.4713L14.1766 24.9565C13.9163 25.2169 13.4942 25.2169 13.2338 24.9565L11.631 23.3538C11.3707 23.0934 11.3707 22.6713 11.631 22.411L17.947 16.095Z" fill="currentColor"/>',qx=km({default:()=>Bm}),Bm='<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"/>',Jp='<path d="M8 28.0003C8 27.6321 8.29848 27.3336 8.66667 27.3336H23.3333C23.7015 27.3336 24 27.
66321 24 28.0003V29.3336C24 29.7018 23.7015 30.0003 23.3333 30.0003H8.66667C8.29848 30.0003 8 29.7018 8 29.3336V28.0003Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M4.66602 6.66699C4.29783 6.66699 3.99935 6.96547 3.99935 7.33366V24.667C3.99935 25.0352 4.29783 25.3337 4.66602 25.3337H27.3327C27.7009 25.3337 27.9994 25.0352 27.9994 24.667V7.33366C27.9994 6.96547 27.7009 6.66699 27.3327 6.66699H4.66602ZM8.66659 21.3333C8.2984 21.3333 7.99992 21.0349 7.99992 20.6667V11.3333C7.99992 10.9651 8.2984 10.6667 8.66659 10.6667H13.9999C14.3681 10.6667 14.6666 10.9651 14.6666 11.3333V12.6667C14.6666 13.0349 14.3681 13.3333 13.9999 13.3333H10.7999C10.7263 13.3333 10.6666 13.393 10.6666 13.4667V18.5333C10.6666 18.607 10.7263 18.6667 10.7999 18.6667H13.9999C14.3681 18.6667 14.6666 18.9651 14.6666 19.3333V20.6667C14.6666 21.0349 14.3681 21.3333 13.9999 21.3333H8.66659ZM17.9999 21.3333C17.6317 21.3333 17.3333 21.0349 17.3333 20.6667V11.3333C17.3333 10.9651 17.6317 10.6667 17.9999 10.6667H23.3333C23.7014 10.6667 23.9999 10.9651 23.9999 11.3333V12.6667C23.9999 13.0349 23.7014 13.3333 23.3333 13.3333H20.1333C20.0596 13.3333 19.9999 13.393 19.9999 13.4667V18.5333C19.9999 18.607 20.0596 18.6667 20.1333 18.6667H23.3333C23.7014 18.6667 23.9999 18.9651 23.9999 19.3333V20.6667C23.9999 21.0349 23.7014 21.3333 23.3333 21.3333H17.9999Z" fill="currentColor"/>',vd='<path fill-rule="evenodd" clip-rule="evenodd" d="M4.6661 6.66699C4.29791 6.66699 3.99943 6.96547 3.99943 7.33366V24.667C3.99943 25.0352 4.29791 25.3337 4.6661 25.3337H27.3328C27.701 25.3337 27.9994 25.0352 27.9994 24.667V7.33366C27.9994 6.96547 27.701 6.66699 27.3328 6.66699H4.6661ZM8.66667 21.3333C8.29848 21.3333 8 21.0349 8 20.6667V11.3333C8 10.9651 8.29848 10.6667 8.66667 10.6667H14C14.3682 10.6667 14.6667 10.9651 14.6667 11.3333V12.6667C14.6667 13.0349 14.3682 13.3333 14 13.3333H10.8C10.7264 13.3333 10.6667 13.393 10.6667 13.4667V18.5333C10.6667 18.607 10.7264 18.6667 10.8 18.6667H14C14.3682 18.6667 14.6667 18.9651 14.6667 19.3333V20.6667C14.6667 21.0349 14.3682 21.3333 14 21.3333H8.66667ZM18 21.3333C17.6318 21.3333 17.3333 21.0349 17.3333 20.6667V11.3333C17.3333 10.9651 17.6318 10.6667 18 10.6667H23.3333C23.7015 10.6667 24 10.9651 24 11.3333V12.6667C24 13.0349 23.7015 13.3333 23.3333 13.3333H20.1333C20.0597 13.3333 20 13.393 20 13.4667V18.5333C20 18.607 20.0597 18.6667 20.1333 18.6667H23.3333C23.7015 18.6667 24 18.9651 24 19.3333V20.6667C24 21.0349 23.7015 21.3333 23.3333 21.3333H18Z" fill="currentColor"/>',Fg='<path d="M14.2225 13.7867C14.3065 13.8706 14.4501 13.8112 14.4501 13.6924V5.99955C14.4501 5.63136 14.7486 5.33289 15.1167 5.33289H16.8501C17.2183 5.33289 17.5167 5.63136 17.5167 5.99955V13.6916C17.5167 13.8104 17.6604 13.8699 17.7444 13.7859L19.9433 11.5869C20.2037 11.3266 20.6258 11.3266 20.8861 11.5869L22.1118 12.8126C22.3722 13.0729 22.3722 13.4951 22.1118 13.7554L16.4549 19.4123C16.1946 19.6726 15.772 19.6731 15.5116 19.4128L9.85479 13.7559C9.59444 13.4956 9.59444 13.0734 9.85479 12.8131L11.0804 11.5874C11.3408 11.3271 11.7629 11.3271 12.0233 11.5874L14.2225 13.7867Z" fill="currentColor"/> <path d="M5.99998 20.267C5.63179 20.267 5.33331 20.5654 5.33331 20.9336V25.9997C5.33331 26.3678 5.63179 26.6663 5.99998 26.6663H26C26.3682 26.6663 26.6666 26.3678 26.6666 25.9997V20.9336C26.6666 20.5654 26.3682 20.267 26 20.267H24.2666C23.8985 20.267 23.6 20.5654 23.6 20.9336V22.9333C23.6 23.3014 23.3015 23.5999 22.9333 23.5999H9.06638C8.69819 23.5999 8.39972 23.3014 8.39972 22.9333V20.9336C8.39972 20.5654 8.10124 20.267 7.73305 20.267H5.99998Z" fill="currentColor"/>',Wg='<path d="M16 20C18.2091 20 20 18.2092 20 16C20 13.7909 18.2091 12 16 12C13.7909 12 12 13.7909 12 16C12 18.2092 13.7909 20 16 20Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M28 16.0058C28 18.671 23.5 25.3334 16 25.3334C8.5 25.3334 4 18.6762 4 16.0058C4 13.3354 8.50447 6.66669 16 6.66669C23.4955 6.66669 28 13.3406 28 16.0058ZM25.3318 15.9934C25.3328 16.0017 25.3328 16.0099 25.3318 16.0182C25.3274 16.0571 25.3108 16.1728 25.2485 16.3708C25.1691 16.6229 25.0352 16.9462 24.8327 17.3216C24.4264 18.0749 23.7969 18.9398 22.9567 19.754C21.2791 21.3798 18.9148 22.6667 16 22.6667C13.0845 22.6667 10.7202 21.3805 9.04298 19.7557C8.20295 18.9419 7.57362 18.0773 7.16745 17.3241C6.96499 16.9486 6.83114 16.6252 6.75172 16.3729C6.67942 16.1431 6.66856 16.0243 6.66695 16.0066L6.66695 16.005C6.66859 15.9871 6.67951 15.8682 6.75188 15.6383C6.83145 15.3854 6.96554 15.0614 7.16831 14.6853C7.57507 13.9306 8.20514 13.0644 9.04577 12.249C10.7245 10.6208 13.0886 9.33335 16 9.33335C18.9108 9.33335 21.2748 10.6215 22.9539 12.2507C23.7947 13.0664 24.4249 13.933 24.8318 14.6877C25.0346 15.0639 25.1688 15.3878 25.2483 15.6404C25.3107 15.8386 25.3274 15.9545 25.3318 15.9934Z" fill="currentColor"/>',Hg='<path d="M15.8747 8.11857C16.3148 7.79342 16.9375 8.10759 16.9375 8.65476V14.2575C16.9375 14.3669 17.0621 14.4297 17.1501 14.3647L25.6038 8.11857C26.0439 7.79342 26.6667 8.10759 26.6667 8.65476V23.3451C26.6667 23.8923 26.0439 24.2064 25.6038 23.8813L17.1501 17.6346C17.0621 17.5695 16.9375 17.6324 16.9375 17.74
618L16.9375 23.3451C16.9375 23.8923 16.3147 24.2064 15.8747 23.8813L5.93387 16.5358C5.57322 16.2693 5.57323 15.7299 5.93389 15.4634L15.8747 8.11857Z" fill="currentColor"/>',jg='<path d="M16.1253 8.11866C15.6852 7.7935 15.0625 8.10768 15.0625 8.65484V14.2576C15.0625 14.367 14.9379 14.4298 14.8499 14.3648L6.39615 8.11866C5.95607 7.7935 5.33331 8.10768 5.33331 8.65484V23.3452C5.33331 23.8923 5.9561 24.2065 6.39617 23.8813L14.8499 17.6347C14.9379 17.5696 15.0625 17.6325 15.0625 17.7419L15.0625 23.3452C15.0625 23.8923 15.6853 24.2065 16.1253 23.8813L26.0661 16.5358C26.4268 16.2694 26.4268 15.73 26.0661 15.4635L16.1253 8.11866Z" fill="currentColor"/>',ef='<path d="M19.3334 13.3333C18.9652 13.3333 18.6667 13.0349 18.6667 12.6667L18.6667 7.33333C18.6667 6.96514 18.9652 6.66666 19.3334 6.66666H21.3334C21.7015 6.66666 22 6.96514 22 7.33333V9.86666C22 9.9403 22.0597 10 22.1334 10L24.6667 10C25.0349 10 25.3334 10.2985 25.3334 10.6667V12.6667C25.3334 13.0349 25.0349 13.3333 24.6667 13.3333L19.3334 13.3333Z" fill="currentColor"/> <path d="M13.3334 19.3333C13.3334 18.9651 13.0349 18.6667 12.6667 18.6667H7.33335C6.96516 18.6667 6.66669 18.9651 6.66669 19.3333V21.3333C6.66669 21.7015 6.96516 22 7.33335 22H9.86669C9.94032 22 10 22.0597 10 22.1333L10 24.6667C10 25.0349 10.2985 25.3333 10.6667 25.3333H12.6667C13.0349 25.3333 13.3334 25.0349 13.3334 24.6667L13.3334 19.3333Z" fill="currentColor"/> <path d="M18.6667 24.6667C18.6667 25.0349 18.9652 25.3333 19.3334 25.3333H21.3334C21.7015 25.3333 22 25.0349 22 24.6667V22.1333C22 22.0597 22.0597 22 22.1334 22H24.6667C25.0349 22 25.3334 21.7015 25.3334 21.3333V19.3333C25.3334 18.9651 25.0349 18.6667 24.6667 18.6667L19.3334 18.6667C18.9652 18.6667 18.6667 18.9651 18.6667 19.3333L18.6667 24.6667Z" fill="currentColor"/> <path d="M10.6667 13.3333H12.6667C13.0349 13.3333 13.3334 13.0349 13.3334 12.6667L13.3334 10.6667V7.33333C13.3334 6.96514 13.0349 6.66666 12.6667 6.66666H10.6667C10.2985 6.66666 10 6.96514 10 7.33333L10 9.86666C10 9.9403 9.94033 10 9.86669 10L7.33335 10C6.96516 10 6.66669 10.2985 6.66669 10.6667V12.6667C6.66669 13.0349 6.96516 13.3333 7.33335 13.3333L10.6667 13.3333Z" fill="currentColor"/>',tf='<path d="M25.3299 7.26517C25.2958 6.929 25.0119 6.66666 24.6667 6.66666H19.3334C18.9652 6.66666 18.6667 6.96514 18.6667 7.33333V9.33333C18.6667 9.70152 18.9652 10 19.3334 10L21.8667 10C21.9403 10 22 10.0597 22 10.1333V12.6667C22 13.0349 22.2985 13.3333 22.6667 13.3333H24.6667C25.0349 13.3333 25.3334 13.0349 25.3334 12.6667V7.33333C25.3334 7.31032 25.3322 7.28758 25.3299 7.26517Z" fill="currentColor"/> <path d="M22 21.8667C22 21.9403 21.9403 22 21.8667 22L19.3334 22C18.9652 22 18.6667 22.2985 18.6667 22.6667V24.6667C18.6667 25.0349 18.9652 25.3333 19.3334 25.3333L24.6667 25.3333C25.0349 25.3333 25.3334 25.0349 25.3334 24.6667V19.3333C25.3334 18.9651 25.0349 18.6667 24.6667 18.6667H22.6667C22.2985 18.6667 22 18.9651 22 19.3333V21.8667Z" fill="currentColor"/> <path d="M12.6667 22H10.1334C10.0597 22 10 21.9403 10 21.8667V19.3333C10 18.9651 9.70154 18.6667 9.33335 18.6667H7.33335C6.96516 18.6667 6.66669 18.9651 6.66669 19.3333V24.6667C6.66669 25.0349 6.96516 25.3333 7.33335 25.3333H12.6667C13.0349 25.3333 13.3334 25.0349 13.3334 24.6667V22.6667C13.3334 22.2985 13.0349 22 12.6667 22Z" fill="currentColor"/> <path d="M10 12.6667V10.1333C10 10.0597 10.0597 10 10.1334 10L12.6667 10C13.0349 10 13.3334 9.70152 13.3334 9.33333V7.33333C13.3334 6.96514 13.0349 6.66666 12.6667 6.66666H7.33335C6.96516 6.66666 6.66669 6.96514 6.66669 7.33333V12.6667C6.66669 13.0349 6.96516 13.3333 7.33335 13.3333H9.33335C9.70154 13.3333 10 13.0349 10 12.6667Z" fill="currentColor"/>',Gg='<path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 5.99998C26.6667 5.63179 26.3682 5.33331 26 5.33331H11.3333C10.9651 5.33331 10.6667 5.63179 10.6667 5.99998V17.5714C10.6667 17.6694 10.5644 17.7342 10.4741 17.6962C9.91823 17.4625 9.30754 17.3333 8.66667 17.3333C6.08934 17.3333 4 19.4226 4 22C4 24.5773 6.08934 26.6666 8.66667 26.6666C11.244 26.6666 13.3333 24.5773 13.3333 22V8.66665C13.3333 8.29846 13.6318 7.99998 14 7.99998L23.3333 7.99998C23.7015 7.99998 24 8.29846 24 8.66665V14.9048C24 15.0027 23.8978 15.0675 23.8075 15.0296C23.2516 14.7958 22.6409 14.6666 22 14.6666C19.4227 14.6666 17.3333 16.756 17.3333 19.3333C17.3333 21.9106 19.4227 24 22 24C24.5773 24 26.6667 21.9106 26.6667 19.3333V5.99998ZM22 21.3333C23.1046 21.3333 24 20.4379 24 19.3333C24 18.2287 23.1046 17.3333 22 17.3333C20.8954 17.3333 20 18.2287 20 19.3333C20 20.4379 20.8954 21.3333 22 21.3333ZM8.66667 24C9.77124 24 10.6667 23.1045 10.6667 22C10.6667 20.8954 9.77124 20 8.66667 20C7.5621 20 6.66667 20.8954 6.66667 22C6.66667 23.1045 7.5621 24 8.66667 24Z" fill="currentColor"/>',sf='<path d="M17.5091 24.6594C17.5091 25.2066 16.8864 25.5208 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9991 9.36923 19.9991H4.66667C4.29848 19.9991 4 19.7006 4 19.3325V12.6658C4 12.2976 4.29848 11.9991 4.66667 11.9991H9.37115C9.39967 11.9991 9.42745 11.99 9.45039 11.973L16.4463 6.8036C16.8863 6.47842 17.5091 6.79259 17.5091 7.33977L17.5091 24.6594Z" fill="currentColor"/> <path d="M28.8621 13.6422C29.1225 13.3818 29.1225 12.9597 28.8621 12.6994L27.9193 11.7566C27.659 11.4962 27.2368 11.4962 26.9765 11.7566L24.7134 14.0197C24.6613 14.0717 24.5769 14.0717 24.5248 14.0197L22.262 11.7568C22.0016 11.4964 21.5795 11.4964 21.3191 11.7568L20.3763 12.6996C20.116 12.9599 20.116 13.382 20.3763 13.6424L22.6392 15.9053C22.6913 15.9573 22.6913 16.0418 22.6392 16.0938L20.3768 18.3562C20.1165 18.6166 20.1165 19.0387 20.3768 19.299L21.3196 20.2419C21.58 20.5022 22.0021 20.5022 22.2624 20.2418L24.5248 17.9795C24.5769 17.9274 24.6613 17.9274 24.7134 17.9795L26.976 20.2421C27.2363 20.5024 27.6585 20.5024 27.9188 20.2421L28.8616 19.2992C29.122 19.0389 29.122 18.6168 28.8616 18.3564L26.599 16.0938C26.547 16.0418 26.547 15.9573 26.599 15.9053L28.8621 13.6422Z" fill="currentColor"/>',zg='<path d="M26.6009 16.0725C26.6009 16.424 26.4302 17.1125 25.9409 18.0213C25.4676 18.8976 24.7542 19.8715 23.8182 20.7783C21.9489 22.5905 19.2662 24.0667 15.9342 24.0667C12.6009 24.0667 9.91958 22.5915 8.04891 20.78C7.11424 19.8736 6.40091 18.9 5.92758 18.0236C5.43824 17.1149 5.26758 16.4257 5.26758 16.0725C5.26758 15.7193 5.43824 15.0293 5.92891 14.1193C6.40224 13.2416 7.11558 12.2665 8.05158 11.3587C9.92224 9.54398 12.6049 8.06665 15.9342 8.06665C19.2636 8.06665 21.9449 9.54505 23.8169 11.3604C24.7529 12.2687 25.4662 13.2441 25.9396 14.1216C26.4302 15.0317 26.6009 15.7209 26.6009 16.0725Z" stroke="currentColor" stroke-width="3"/> <path d="M15.9336 20.0667C18.1427 20.0667 19.9336 18.2758 19.9336 16.0667C19.9336 13.8575 18.1427 12.0667 15.9336 12.0667C13.7245 12.0667 11.9336 13.8575 11.9336 16.0667C11.9336 18.2758 13.7245 20.0667 15.9336 20.0667Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M27.2323 25.0624L6.93878 4.76886C6.78118 4.61126 6.70762 4.57052 6.61919 4.54372C6.53077 4.51692 6.44033 4.51691 6.3519 4.54372C6.26347 4.57052 6.18991 4.61126 6.03231 4.76886L4.77032 6.03085C4.61272 6.18845 4.57198 6.26201 4.54518 6.35044C4.51838 6.43887 4.51838 6.5293 4.54518 6.61773C4.57198 6.70616 4.61272 6.77972 4.77032 6.93732L25.0639 27.2308C25.2215 27.3884 25.295 27.4292 25.3834 27.456C25.4719 27.4828 25.5623 27.4828 25.6507 27.456C25.7392 27.4292 25.8127 27.3885 25.9703 27.2309L27.2323 25.9689C27.3899 25.8113 27.4307 25.7377 27.4575 25.6493C27.4843 25.5608 27.4843 25.4704 27.4575 25.382C27.4307 25.2935 27.3899 25.22 27.2323 25.0624Z" fill="currentColor"/>',nf='<path d="M25.14 25.1089C25.0171 25.2532 24.8356 25.3333 24.646 25.3333H22.8124C22.1084 25.3333 21.7734 24.1872 22.2745 23.6927C23.9161 22.0729 24.9336 19.822 24.9336 17.3333C24.9336 12.3997 20.9336 8.39973 16 8.39973C11.0664 8.39973 7.06641 12.3997 7.06641 17.3333C7.06641 19.822 8.08389 22.0729 9.72555 23.6927C10.2266 24.1872 9.89155 25.3333 9.18762 25.3333H7.35398C7.16436 25.3333 6.98294 25.2532 6.86001 25.1089C5.07703 23.015 4 20.2991 4 17.3333C4 10.7057 9.3724 5.33333 16 5.33333C22.6276 5.33333 28 10.7057 28 17.3333C28 20.2991 26.923 23.015 25.14 25.1089Z" fill="currentColor"/> <path d="M21.1992 14.3399C21.4595 14.0796 21.4595 13.6575 21.1992 13.3971L20.2564 12.4543C19.996 12.194 19.5739 12.194 19.3136 12.4543L16.4492 15.3187C16.4185 15.3493 16.3749 15.3629 16.332 15.3568C16.2236 15.3414 16.1127 15.3334 16 15.3334C14.7113 15.3334 13.6667 16.378 13.6667 17.6667C13.6667 18.9554 14.7113 20 16 20C17.2887 20 18.3333 18.9554 18.3333 17.6667C18.3333 17.5464 18.3242 17.4283 18.3067 17.313C18.3001 17.2696 18.3136 17.2255 18.3446 17.1945L21.1992 14.3399Z" fill="currentColor"/>',rf='<path d="M8.66667 6.66667C8.29848 6.66667 8 6.96514 8 7.33333V24.6667C8 25.0349 8.29848 25.3333 8.66667 25.3333H12.6667C13.0349 25.3333 13.3333 25.0349 13.3333 24.6667V7.33333C13.3333 6.96514 13.0349 6.66667 12.6667 6.66667H8.66667Z" fill="currentColor"/> <path d="M19.3333 6.66667C18.9651 6.66667 18.6667 6.96514 18.6667 7.33333V24.6667C18.6667 25.0349 18.9651 25.3333 19.3333 25.3333H23.3333C23.7015 25.3333 24 25.0349 24 24.6667V7.33333C24 6.96514 23.7015 6.66667 23.3333 6.66667H19.3333Z" fill="currentColor"/>',af='<path d="M5.33334 26V19.4667C5.33334 19.393 5.39304 19.3333 5.46668 19.3333H7.86668C7.94031 19.3333 8.00001 19.393 8.00001 19.4667V23.3333C8.00001 23.7015 8.29849 24 8.66668 24H23.3333C23.7015 24 24 23.7015 24 23.3333V8.66666C24 8.29847 23.7015 7.99999 23.3333 7.99999H19.4667C19.393 7.99999 19.3333 7.9403 19.3333 7.86666V5.46666C19.3333 5.39302 19.393 5.33333 19.4667 5.33333H26C26.3682 5.33333 26.6667 5.63181 26.6667 5.99999V26C26.6667 26.3682 26.3682 26.6667 26 26.6667H6.00001C5.63182 26.6667 5.33334 26.3682 5.33334 26Z" fill="currentColor"/> <path d="M14.0098 8.42359H10.806C10.6872 8.42359 10.6277 8.56721 10.7117 8.6512L16.5491 14.4886C16.8094 14.7489 16.8094 15.171 16.5491 15.4314L15.3234 16.657C15.0631 16.9174 14.641 16.9174 14.3806 16.657L8.63739 10.9138C8.55339 10.8298 8.40978 10.8893 8.40978 11.0081V14.0236C8.40978 14.3918 8.1113 14.6903 7.74311 14.6903H6.00978C5.64159 14.6903 5.34311 14.3918 5.34311 14.0236L5.34311 6.02359C5.34311 5.6554 5.64159 5.35692 6.00978 5.35692L14.0098 5.35692C14.378 5.35692 14.6764 5.6554 14.6764 6.02359V7.75692C14.6764 8.12511 14.378 8.42359 14.0098 8.42359Z" fill="currentColor"/>',of='<path d="M16 15.3333C15.6318 15.3333 15.3333 15.6318 15.3333 16V20C15.3333 20.3682 15.6318 20.6667 16 20.6667H21.3333C21.7015 20.6667 22 20.3682 22 20V16C22 
615.6318 21.7015 15.3333 21.3333 15.3333H16Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M5.33333 7.33334C5.33333 6.96515 5.63181 6.66667 5.99999 6.66667H26C26.3682 6.66667 26.6667 6.96515 26.6667 7.33334V24.6667C26.6667 25.0349 26.3682 25.3333 26 25.3333H5.99999C5.63181 25.3333 5.33333 25.0349 5.33333 24.6667V7.33334ZM7.99999 10C7.99999 9.63182 8.29847 9.33334 8.66666 9.33334H23.3333C23.7015 9.33334 24 9.63182 24 10V22C24 22.3682 23.7015 22.6667 23.3333 22.6667H8.66666C8.29847 22.6667 7.99999 22.3682 7.99999 22V10Z" fill="currentColor"/>',lf='<path d="M10.6667 6.6548C10.6667 6.10764 11.2894 5.79346 11.7295 6.11862L24.377 15.4634C24.7377 15.7298 24.7377 16.2692 24.3771 16.5357L11.7295 25.8813C11.2895 26.2065 10.6667 25.8923 10.6667 25.3451L10.6667 6.6548Z" fill="currentColor"/>',Ug='<path d="M13.9213 5.53573C14.3146 5.45804 14.6666 5.76987 14.6666 6.17079V7.57215C14.6666 7.89777 14.4305 8.17277 14.114 8.24925C12.5981 8.61559 11.2506 9.41368 10.2091 10.506C9.98474 10.7414 9.62903 10.8079 9.34742 10.6453L8.14112 9.94885C7.79394 9.7484 7.69985 9.28777 7.96359 8.98585C9.48505 7.24409 11.5636 6.00143 13.9213 5.53573Z" fill="currentColor"/> <path d="M5.88974 12.5908C6.01805 12.2101 6.46491 12.0603 6.81279 12.2611L8.01201 12.9535C8.29379 13.1162 8.41396 13.4577 8.32238 13.7699C8.11252 14.4854 7.99998 15.2424 7.99998 16.0257C7.99998 16.809 8.11252 17.566 8.32238 18.2814C8.41396 18.5936 8.29378 18.9352 8.01201 19.0979L6.82742 19.7818C6.48051 19.9821 6.03488 19.8337 5.90521 19.4547C5.5345 18.3712 5.33331 17.2091 5.33331 16C5.33331 14.8078 5.5289 13.6613 5.88974 12.5908Z" fill="currentColor"/> <path d="M8.17106 22.0852C7.82291 22.2862 7.72949 22.7486 7.99532 23.0502C9.51387 24.773 11.5799 26.0017 13.9213 26.4642C14.3146 26.5419 14.6666 26.2301 14.6666 25.8291V24.4792C14.6666 24.1536 14.4305 23.8786 14.114 23.8021C12.5981 23.4358 11.2506 22.6377 10.2091 21.5453C9.98474 21.31 9.62903 21.2435 9.34742 21.4061L8.17106 22.0852Z" fill="currentColor"/> <path d="M17.3333 25.8291C17.3333 26.2301 17.6857 26.5418 18.079 26.4641C22.9748 25.4969 26.6666 21.1796 26.6666 16C26.6666 10.8204 22.9748 6.50302 18.079 5.5358C17.6857 5.4581 17.3333 5.76987 17.3333 6.17079V7.57215C17.3333 7.89777 17.5697 8.17282 17.8862 8.24932C21.3942 9.09721 24 12.2572 24 16.0257C24 19.7942 21.3942 22.9542 17.8862 23.802C17.5697 23.8785 17.3333 24.1536 17.3333 24.4792V25.8291Z" fill="currentColor"/> <path d="M14.3961 10.4163C13.9561 10.0911 13.3333 10.4053 13.3333 10.9525L13.3333 21.0474C13.3333 21.5946 13.9561 21.9087 14.3962 21.5836L21.2273 16.5359C21.5879 16.2694 21.5879 15.73 21.2273 15.4635L14.3961 10.4163Z" fill="currentColor"/>',Kg='<path d="M15.6038 12.2147C16.0439 12.5399 16.6667 12.2257 16.6667 11.6786V10.1789C16.6667 10.1001 16.7351 10.0384 16.8134 10.0479C20.1116 10.4494 22.6667 13.2593 22.6667 16.6659C22.6667 20.3481 19.6817 23.3332 15.9995 23.3332C12.542 23.3332 9.69927 20.7014 9.36509 17.332C9.32875 16.9655 9.03371 16.6662 8.66548 16.6662L6.66655 16.6666C6.29841 16.6666 5.99769 16.966 6.02187 17.3334C6.36494 22.5454 10.7012 26.6667 16 26.6667C21.5228 26.6667 26 22.1895 26 16.6667C26 11.4103 21.9444 7.10112 16.7916 6.69757C16.7216 6.69209 16.6667 6.63396 16.6667 6.56372V4.98824C16.6667 4.44106 16.0439 4.12689 15.6038 4.45206L11.0765 7.79738C10.7159 8.06387 10.7159 8.60326 11.0766 8.86973L15.6038 12.2147Z" fill="currentColor"/>',Qg='<path d="M16.6667 10.3452C16.6667 10.8924 16.0439 11.2066 15.6038 10.8814L11.0766 7.5364C10.7159 7.26993 10.7159 6.73054 11.0766 6.46405L15.6038 3.11873C16.0439 2.79356 16.6667 3.10773 16.6667 3.6549V5.22682C16.6667 5.29746 16.7223 5.35579 16.7927 5.36066C22.6821 5.76757 27.3333 10.674 27.3333 16.6667C27.3333 22.9259 22.2592 28 16 28C9.96483 28 5.03145 23.2827 4.68601 17.3341C4.66466 16.9665 4.96518 16.6673 5.33339 16.6673H7.3334C7.70157 16.6673 7.99714 16.9668 8.02743 17.3337C8.36638 21.4399 11.8064 24.6667 16 24.6667C20.4183 24.6667 24 21.085 24 16.6667C24 12.5225 20.8483 9.11428 16.8113 8.70739C16.7337 8.69957 16.6667 8.76096 16.6667 8.83893V10.3452Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0879 19.679C17.4553 19.9195 17.8928 20.0398 18.4004 20.0398C18.9099 20.0398 19.3474 19.9205 19.7129 19.6818C20.0803 19.4413 20.3635 19.0938 20.5623 18.6392C20.7612 18.1847 20.8606 17.6373 20.8606 16.9972C20.8625 16.3608 20.764 15.8192 20.5652 15.3722C20.3663 14.9252 20.0822 14.5853 19.7129 14.3523C19.3455 14.1175 18.908 14 18.4004 14C17.8928 14 17.4553 14.1175 17.0879 14.3523C16.7224 14.5853 16.4402 14.9252 16.2413 15.3722C16.0443 15.8173 15.9449 16.3589 15.943 16.9972C15.9411 17.6354 16.0396 18.1818 16.2385 18.6364C16.4373 19.089 16.7205 19.4366 17.0879 19.679ZM19.1362 18.4262C18.9487 18.7349 18.7034 18.8892 18.4004 18.8892C18.1996 18.8892 18.0226 18.8211 17.8691 18.6847C17.7157 18.5464 17.5964 18.3372 17.5112 18.0568C17.4279 17.7765 17.3871 17.4233 17.389 16.9972C17.3909 16.3684 17.4847 15.9025 17.6703 15.5995C17.8559 15.2945 18.0993 15.1421 18.4004 15.1421C18.603 15.1421 18.7801 15.2093 18.9316 15.3438C19.0832 15.4782 19.2015 15.6828 19.2868 15.9574C19.372 16.2301 19.4146 16.5767 19.4146 16.9972C19.4165 17.6392 19.3237 18.1156 19.1362 18.4262Z" fill="currentColor"/> <path d="M13.7746 19.8978C13.8482 19.8978 13.9079 19.8381 13.9079 19.7644V14.2129C13.9079 14.1393 13.8482 14.0796 13.7746 14.0796H12.642C12.6171 14.0796 12.5927 14.0865 12.5716 14.0997L11.2322 14.9325C11.1931 14.9568 11.1693 14.9996 11.1693 15.0457V15.9497C11.1693 16.0539 11.2833 16.1178 11.3722 16.0635L12.464 15.396C12.4682 15.3934 12.473 15.3921 12.4779 15.3921C12.4926 15.3921 12.5045 15.404 12.5045 15.4187V19.7644C12.5045 19.8381 12.5642 19.8978 12.6378 19.8978H13.7746Z" fill="currentColor"/>',Zg='<path d="M15.3333 10.3452C15.3333 10.8924 15.9561 11.2066 16.3962 10.8814L20.9234 7.5364C21.2841 7.26993 21.2841 6.73054 20.9235 6.46405L16.3962 3.11873C15.9561 2.79356 15.3333 3.10773 15.3333 3.6549V5.22682C15.3333 5.29746 15.2778 5.35579 15.2073 5.36066C9.31791 5.76757 4.66667 10.674 4.66667 16.6667C4.66667 22.9259 9.74078 28 16 28C22.0352 28 26.9686 23.2827 27.314 17.3341C27.3354 16.9665 27.0348 16.6673 26.6666 16.6673H24.6666C24.2984 16.6673 24.0029 16.9668 23.9726 17.3337C23.6336 21.4399 20.1937 24.6667 16 24.6667C11.5817 24.6667 8 21.085 8 16.6667C8 12.5225 11.1517 9.11428 15.1887 8.70739C15.2663 8.69957 15.3333 8.76096 15.3333 8.83893V10.3452Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0879 19.679C17.4553 19.9195 17.8928 20.0398 18.4004 20.0398C18.9099 20.0398 19.3474 19.9205 19.7129 19.6818C20.0803 19.4413 20.3635 19.0938 20.5623 18.6392C20.7612 18.1847 20.8606 17.6373 20.8606 16.9972C20.8625 16.3608 20.764 15.8192 20.5652 15.3722C20.3663 14.9252 20.0822 14.5853 19.7129 14.3523C19.3455 14.1175 18.908 14 18.4004 14C17.8928 14 17.4553 14.1175 17.0879 14.3523C16.7224 14.5853 16.4402 14.9252 16.2413 15.3722C16.0443 15.8173 15.9449 16.3589 15.943 16.9972C15.9411 17.6354 16.0396 18.1818 16.2385 18.6364C16.4373 19.089 16.7205 19.4366 17.0879 19.679ZM19.1362 18.4262C18.9487 18.7349 18.7034 18.8892 18.4004 18.8892C18.1996 18.8892 18.0225 18.8211 17.8691 18.6847C17.7157 18.5464 17.5964 18.3372 17.5112 18.0568C17.4278 17.7765 17.3871 17.4233 17.389 16.9972C17.3909 16.3684 17.4847 15.9025 17.6703 15.5995C17.8559 15.2945 18.0992 15.1421 18.4004 15.1421C18.603 15.1421 18.7801 15.2093 18.9316 15.3438C19.0831 15.4782 19.2015 15.6828 19.2867 15.9574C19.372 16.2301 19.4146 16.5767 19.4146 16.9972C19.4165 17.6392 19.3237 18.1156 19.1362 18.4262Z" fill="currentColor"/> <path d="M13.7746 19.8978C13.8482 19.8978 13.9079 19.8381 13.9079 19.7644V14.2129C13.9079 14.1393 13.8482 14.0796 13.7746 14.0796H12.642C12.6171 14.0796 12.5927 14.0865 12.5716 14.0997L11.2322 14.9325C11.1931 14.9568 11.1693 14.9996 11.1693 15.0457V15.9497C11.1693 16.0539 11.2833 16.1178 11.3722 16.0635L12.464 15.396C12.4682 15.3934 12.473 15.3921 12.4779 15.3921C12.4926 15.3921 12.5045 15.404 12.5045 15.4187V19.7644C12.5045 19.8381 12.5642 19.8978 12.6378 19.8978H13.7746Z" fill="currentColor"/>',cf='<path d="M18.6669 10.4001C18.6669 10.7683 18.3684 11.0667 18.0002 11.0667H16.2668C15.8987 11.0667 15.6002 10.7683 15.6002 10.4001V9.86674C15.6002 9.7931 15.54
605 9.73341 15.4669 9.73341H5.99998C5.63179 9.73341 5.33331 9.43493 5.33331 9.06674V7.33341C5.33331 6.96522 5.63179 6.66674 5.99998 6.66674H15.4669C15.5405 6.66674 15.6002 6.60704 15.6002 6.53341V6.00007C15.6002 5.63188 15.8987 5.3334 16.2668 5.3334H18.0002C18.3684 5.3334 18.6669 5.63188 18.6669 6.00007V10.4001Z" fill="currentColor"/> <path d="M11.3334 18.8668C11.7016 18.8668 12.0001 18.5683 12.0001 18.2001V13.8001C12.0001 13.4319 11.7016 13.1335 11.3334 13.1335H9.60006C9.23187 13.1335 8.93339 13.4319 8.93339 13.8001V14.3335C8.93339 14.4071 8.8737 14.4668 8.80006 14.4668H6.00006C5.63187 14.4668 5.33339 14.7653 5.33339 15.1335V16.8668C5.33339 17.235 5.63187 17.5335 6.00006 17.5335H8.80006C8.8737 17.5335 8.93339 17.5932 8.93339 17.6668V18.2001C8.93339 18.5683 9.23187 18.8668 9.60006 18.8668H11.3334Z" fill="currentColor"/> <path d="M18.6667 26.0001C18.6667 26.3683 18.3682 26.6668 18 26.6668H16.2667C15.8985 26.6668 15.6 26.3683 15.6 26.0001V25.4668C15.6 25.3931 15.5403 25.3334 15.4667 25.3334H6.00014C5.63195 25.3334 5.33348 25.0349 5.33348 24.6668V22.9334C5.33348 22.5652 5.63195 22.2668 6.00014 22.2668H15.4667C15.5403 22.2668 15.6 22.2071 15.6 22.1334V21.6001C15.6 21.2319 15.8985 20.9334 16.2667 20.9334H18C18.3682 20.9334 18.6667 21.2319 18.6667 21.6001V26.0001Z" fill="currentColor"/> <path d="M22 24.6668C22 25.0349 22.2985 25.3334 22.6667 25.3334H26.0001C26.3683 25.3334 26.6668 25.0349 26.6668 24.6668V22.9334C26.6668 22.5652 26.3683 22.2668 26.0001 22.2668H22.6667C22.2985 22.2668 22 22.5652 22 22.9334V24.6668Z" fill="currentColor"/> <path d="M16.0001 17.5335C15.6319 17.5335 15.3334 17.235 15.3334 16.8668V15.1335C15.3334 14.7653 15.6319 14.4668 16.0001 14.4668H26.0001C26.3683 14.4668 26.6667 14.7653 26.6667 15.1335V16.8668C26.6667 17.235 26.3683 17.5335 26.0001 17.5335H16.0001Z" fill="currentColor"/> <path d="M22.0002 9.06674C22.0002 9.43493 22.2987 9.73341 22.6669 9.73341H26C26.3682 9.73341 26.6666 9.43493 26.6666 9.06674V7.3334C26.6666 6.96521 26.3682 6.66674 26 6.66674H22.6669C22.2987 6.66674 22.0002 6.96522 22.0002 7.33341V9.06674Z" fill="currentColor"/>',Yg='<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5722 5.33333C13.2429 5.33333 12.9629 5.57382 12.9132 5.89938L12.4063 9.21916C12.4 9.26058 12.3746 9.29655 12.3378 9.31672C12.2387 9.37118 12.1409 9.42779 12.0444 9.48648C12.0086 9.5083 11.9646 9.51242 11.9255 9.49718L8.79572 8.27692C8.48896 8.15732 8.14083 8.27958 7.9762 8.56472L5.5491 12.7686C5.38444 13.0538 5.45271 13.4165 5.70981 13.6223L8.33308 15.7225C8.3658 15.7487 8.38422 15.7887 8.38331 15.8306C8.38209 15.8867 8.38148 15.9429 8.38148 15.9993C8.38148 16.0558 8.3821 16.1121 8.38332 16.1684C8.38423 16.2102 8.36582 16.2503 8.33313 16.2765L5.7103 18.3778C5.45334 18.5836 5.38515 18.9462 5.54978 19.2314L7.97688 23.4352C8.14155 23.7205 8.48981 23.8427 8.79661 23.723L11.926 22.5016C11.9651 22.4864 12.009 22.4905 12.0449 22.5123C12.1412 22.5709 12.2388 22.6274 12.3378 22.6818C12.3745 22.7019 12.4 22.7379 12.4063 22.7793L12.9132 26.0993C12.9629 26.4249 13.2429 26.6654 13.5722 26.6654H18.4264C18.7556 26.6654 19.0356 26.425 19.0854 26.0995L19.5933 22.7801C19.5997 22.7386 19.6252 22.7027 19.6619 22.6825C19.7614 22.6279 19.8596 22.5711 19.9564 22.5121C19.9923 22.4903 20.0362 22.4862 20.0754 22.5015L23.2035 23.7223C23.5103 23.842 23.8585 23.7198 24.0232 23.4346L26.4503 19.2307C26.6149 18.9456 26.5467 18.583 26.2898 18.3771L23.6679 16.2766C23.6352 16.2504 23.6168 16.2104 23.6177 16.1685C23.619 16.1122 23.6196 16.0558 23.6196 15.9993C23.6196 15.9429 23.619 15.8866 23.6177 15.8305C23.6168 15.7886 23.6353 15.7486 23.668 15.7224L26.2903 13.623C26.5474 13.4172 26.6156 13.0544 26.451 12.7692L24.0239 8.56537C23.8592 8.28023 23.5111 8.15797 23.2043 8.27757L20.0758 9.49734C20.0367 9.51258 19.9927 9.50846 19.9569 9.48664C19.8599 9.42762 19.7616 9.37071 19.6618 9.31596C19.6251 9.2958 19.5997 9.25984 19.5933 9.21843L19.0854 5.89915C19.0356 5.57369 18.7556 5.33333 18.4264 5.33333H13.5722ZM16.0001 20.2854C18.3672 20.2854 20.2862 18.3664 20.2862 15.9993C20.2862 13.6322 18.3672 11.7132 16.0001 11.7132C13.6329 11.7132 11.714 13.6322 11.714 15.9993C11.714 18.3664 13.6329 20.2854 16.0001 20.2854Z" fill="currentColor"/>',Cd='<path d="M17.5091 24.6595C17.5091 25.2066 16.8864 25.5208 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9992 9.36923 19.9992H4.66667C4.29848 19.9992 4 19.7007 4 19.3325V12.6658C4 12.2976 4.29848 11.9992 4.66667 11.9992H9.37115C9.39967 11.9992 9.42745 11.99 9.45039 11.9731L16.4463 6.80363C16.8863 6.47845 17.5091 6.79262 17.5091 7.3398L17.5091 24.6595Z" fill="currentColor"/> <path d="M27.5091 9.33336C27.8773 9.33336 28.1758 9.63184 28.1758 10V22C28.1758 22.3682 27.8773 22.6667 27.5091 22.6667H26.1758C25.8076 22.6667 25.5091 22.3682 25.5091 22V10C25.5091 9.63184 25.8076 9.33336 26.1758 9.33336L27.5091 9.33336Z" fill="currentColor"/> <path d="M22.1758 12C22.544 12 22.8424 12.2985 22.8424 12.6667V19.3334C22.8424 19.7016 22.544 20 22.1758 20H20.8424C20.4743 20 20.1758 19.7016 20.1758 19.3334V12.6667C20.1758 12.2985 20.4743 12 20.8424 12H22.1758Z" fill="currentColor"/>',Sd='<path d="M17.5091 24.6594C17.5091 25.2066 16.8864 25.5207 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9991 9.36923 19.9991H4.66667C4.29848 19.9991 4 19.7006 4 19.3324V12.6658C4 12.2976 4.29848 11.9991 4.66667 11.9991H9.37115C9.39967 11.9991 9.42745 11.99 9.45039 11.973L16.4463 6.80358C16.8863 6.4784 17.5091 6.79258 17.5091 7.33975L17.5091 24.6594Z" fill="currentColor"/> <path d="M22.8424 12.6667C22.8424 12.2985 22.544 12 22.1758 12H20.8424C20.4743 12 20.1758 12.2985 20.1758 12.6667V19.3333C20.1758 19.7015 20.4743 20 20.8424 20H22.1758C22.544 20 22.8424 19.7015 22.8424 19.3333V12.6667Z" fill="currentColor"/>';const Fx=Object.freeze(Object.defineProperty({__proto__:null,Component:Ne,DOMEvent:Ke,EventsController:Xe,EventsTarget:Nm,Icon$0:_g,Icon$104:Cd,Icon$105:Sd,Icon$11:Ng,Icon$13:Og,Icon$16:Vg,Icon$19:Bg,Icon$22:qg,Icon$24:Bm,Icon$26:Jp,Icon$27:vd,Icon$31:Fg,Icon$33:Wg,Icon$34:Hg,Icon$35:jg,Icon$39:ef,Icon$40:tf,Icon$5:Dg,Icon$53:Gg,Icon$54:sf,Icon$56:zg,Icon$58:nf,Icon$59:rf,Icon$60:af,Icon$61:of,Icon$62:lf,Icon$63:Ug,Icon$74:Kg,Icon$77:Qg,Icon$8:Lg,Icon$81:Zg,Icon$86:cf,Icon$88:Yg,State:Kn,ViewController:zi,animationFrameThrottle:Xr,appendTriggerEvent:xx,ariaBool:Ec,camelToKebabCase:zn,chromecast_exports:qx,composeRefs:nt,computed:On,createContext:Un,createDisposalBin:$x,createReactComponent:Oe,createScope:oo,deferredPromise:zd,effect:I,findTriggerEvent:bg,fscreen:jr,functionDebounce:Ih,functionThrottle:Jr,getScope:_u,hasProvidedContext:Vn,hasTriggerEvent:wx,isArray:wt,isBoolean:Fl,isDOMNode:Sg,isFunction:Hi,isKeyboardClick:Rh,isKeyboardEvent:Lu,isMouseEvent:vg,isNil
6:mg,isNull:vs,isNumber:Si,isObject:gg,isPointerEvent:Xp,isString:le,isTouchEvent:Mo,isUndefined:Ot,isWriteSignal:fg,kebabToCamelCase:xg,keysOf:Om,listenEvent:pt,method:Ut,noop:Ln,onDispose:_e,peek:Y,prop:at,provideContext:_i,r:Rg,scoped:Wt,setAttribute:we,setStyle:Ii,signal:de,tick:bs,toggleClass:wg,untrack:Bl,uppercaseFirstChar:Ql,useContext:Tt,useReactContext:Vm,useReactScope:Yl,useSignal:$e,useSignalRecord:Bx,useState:Zl,useStateContext:Xl,waitIdlePeriod:Tg,waitTimeout:Eg,walkTriggerEventChain:Sx,wasEnterKeyPressed:Cg},Symbol.toStringTag,{value:"Module"})),se=typeof document>"u",Wx=se?"":(navigator==null?void 0:navigator.userAgent.toLowerCase())||"",_h=!se&&/iphone|ipad|ipod|ios|crios|fxios/i.test(Wx),qm=!se&&/(iphone|ipod)/gi.test((navigator==null?void 0:navigator.platform)||""),Fm=!se&&!!window.chrome,Ud=!se&&(!!window.safari||_h);function Wm(){return Xg()&&Hi(screen.orientation.unlock)}function Xg(){return!se&&!Ot(window.screen.orientation)&&!Ot(window.screen.orientation.lock)}function Hm(i,e){return se?!1:(i||(i=document.createElement("audio")),i.canPlayType(e).length>0)}function jm(i,e){return se?!1:(i||(i=document.createElement("video")),i.canPlayType(e).length>0)}function Gm(i){return se?!1:(i||(i=document.createElement("video")),i.canPlayType("application/vnd.apple.mpegurl").length>0)}function zm(i){return se?!1:!!document.pictureInPictureEnabled&&!(i!=null&&i.disablePictureInPicture)}function Um(i){return se?!1:Hi(i==null?void 0:i.webkitSupportsPresentationMode)&&Hi(i==null?void 0:i.webkitSetPresentationMode)}async function Jg(){const i=document.createElement("video");return i.volume=.5,await Eg(0),i.volume===.5}function Hx(){return se?void 0:(window==null?void 0:window.ManagedMediaSource)??(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function jx(){return se?void 0:(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function Dh(){if(se)return!1;const i=Hx();if(Ot(i))return!1;const e=i&&Hi(i.isTypeSupported)&&i.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),t=jx(),s=Ot(t)||!Ot(t.prototype)&&Hi(t.prototype.appendBuffer)&&Hi(t.prototype.remove);return!!e&&!!s}function Km(){return Dh()}var ln,I2,vc=(I2=class{constructor(i,e){g(this,ln);wt(i)?b(this,ln,i):!Ot(i)&&!Ot(e)?b(this,ln,[[i,e]]):b(this,ln,[])}get length(){return r(this,ln).length}start(i){return r(this,ln)[i][0]??1/0}end(i){return r(this,ln)[i][1]??1/0}},ln=new WeakMap,I2);function uf(i){if(!i.length)return null;let e=i.start(0);for(let t=1;t<i.length;t++){const s=i.start(t);s<e&&(e=s)}return e}function sr(i){if(!i.length)return null;let e=i.end(0);for(let t=1;t<i.length;t++){const s=i.end(t);s>e&&(e=s)}return e}function e0(i){if(i.length<=1)return i;i.sort((s,n)=>s[0]-n[0]);let e=[],t=i[0];for(let s=1;s<i.length;s++){const n=i[s];t[1]>=n[0]-1?t=[t[0],Math.max(t[1],n[1])]:(e.push(t),t=n)}return e.push(t),e}function t0(i,e,t){let s=e[0],n=e[1];return t<s?[t,-1]:t===s?e:s===-1?(e[0]=t,e):(t>s&&(e[1]=t,n===-1&&i.push(e)),e0(i),e)}const i0=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,s0=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),n0=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,r0=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),a0=/\.(m3u8)($|\?)/i,o0=/\.(mpd)($|\?)/i,l0=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),c0=new Set(["application/dash+xml"]);function Lh({src:i,type:e}){return le(i)?i0.test(i)||s0.has(e)||i.startsWith("blob:")&&e==="audio/object":e==="audio/object"}function Nh(i){return le(i.src)?n0.test(i.src)||r0.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||yo(i)&&(se||Gm()):i.type==="video/object"}function yo({src:i,type:e}){return le(i)&&a0.test(i)||l0.has(e)}function Ou({src:i,type:e}){return le(i)&&o0.test(i)||c0.has(e)}function u0(i){return le(i.src)&&(Lh(i)||Nh(i)||yo(i)||Ou(i))}function d0(i){return!se&&typeof window.MediaStream<"u"&&i instanceof window.MediaStream}function Gx(i,e){const t=new URL(i);for(const s of Object.keys(e))t.searchParams.set(s,e[s]+"");return t.toString()}
6function bo(i,e="preconnect"){if(se)return!1;if(!vs(document.querySelector(`link[href="${i}"]`)))return!0;const t=document.createElement("link");return t.rel=e,t.href=i,t.crossOrigin="true",document.head.append(t),!0}const oc={};function h0(i){if(oc[i])return oc[i].promise;const e=zd();if(!vs(document.querySelector(`script[src="${i}"]`)))return e.resolve(),e.promise;oc[i]=e;const t=document.createElement("script");return t.src=i,t.onload=()=>{e.resolve(),delete oc[i]},t.onerror=()=>{e.reject(),delete oc[i]},setTimeout(()=>document.head.append(t),0),e.promise}function Io(i){return i==="use-credentials"?"include":le(i)?"same-origin":void 0}function p0({title:i,src:e,download:t}){const s=Fl(t)||t===""?e.src:le(t)?t:t==null?void 0:t.url;return zx({url:s,src:e,download:t})?{url:s,name:!Fl(t)&&!le(t)&&(t==null?void 0:t.filename)||i.toLowerCase()||"media"}:null}function zx({url:i,src:e,download:t}){return le(i)&&(t&&t!==!0||Lh(e)||Nh(e))}const ke={crossOrigin:Symbol(0),readyState:Symbol(0),updateActiveCues:Symbol(0),canLoad:Symbol(0),onModeChange:Symbol(0),native:Symbol(0),nativeHLS:Symbol(0)};function Ux(i,e){for(let t=0,s=i.length;t<s;t++)if(Kd(i[t],e))return i[t];return null}function Kd(i,e){return e>=i.startTime&&e<i.endTime}function Vu(i,e,t){let s=null,n=_u();function a(){const l=le(e)?[e]:e,u=i.toArray().find(d=>l.includes(d.kind)&&d.mode==="showing");if(u!==s){if(!u){t(null),s=null;return}u.readyState==2?t(u):(t(null),Wt(()=>{const d=pt(u,"load",()=>{t(u),d()},{once:!0})},n)),s=u}}return a(),pt(i,"mode-change",a)}function Kx(i,e,t){Vu(i,e,s=>{if(!s){t("");return}const n=()=>{const a=s==null?void 0:s.activeCues[0];t((a==null?void 0:a.text)||"")};n(),pt(s,"cue-change",n)})}var _2,D2,L2,N2,Mc,cn,pa,Rc,fa,si,un,No,At,f0,df,uc,hf,pf,ff,O2,lo=(O2=class extends Nm{constructor(e){super();g(this,At);O(this,"src");O(this,"content");O(this,"type");O(this,"encoding");O(this,"id","");O(this,"label","");O(this,"language","");O(this,"kind");O(this,"default",!1);g(this,Mc,!1);g(this,cn,0);g(this,pa,"disabled");g(this,Rc,{});g(this,fa,[]);g(this,si,[]);g(this,un,[]);g(this,No,new Set);O(this,N2,0);O(this,L2);O(this,D2,null);O(this,_2,null);for(const t of Object.keys(e))this[t]=e[t];
6this.type||(this.type="vtt"),!se&&e.content?o(this,At,f0).call(this,e):e.src||(this[ke.readyState]=2)}static createId(e){return`vds-${e.type}-${e.kind}-${e.src??e.label??"?"}`}get metadata(){return r(this,Rc)}get regions(){return r(this,fa)}get cues(){return r(this,si)}get activeCues(){return r(this,un)}get readyState(){return this[ke.readyState]}get mode(){return r(this,pa)}set mode(e){this.setMode(e)}addCue(e,t){var a;if(e.id){if(r(this,No).has(e.id))return;r(this,No).add(e.id)}let s=0,n=r(this,si).length;for(s=0;s<n&&!(e.endTime<=r(this,si)[s].startTime);s++);s===n?r(this,si).push(e):r(this,si).splice(s,0,e),e instanceof TextTrackCue||(a=this[ke.native])==null||a.track.addCue(e),this.dispatchEvent(new Ke("add-cue",{detail:e,trigger:t})),Kd(e,r(this,cn))&&this[ke.updateActiveCues](r(this,cn),t)}removeCue(e,t){var n;const s=r(this,si).indexOf(e);if(s>=0){const a=r(this,un).includes(e);e.id&&r(this,No).delete(e.id),r(this,si).splice(s,1),(n=this[ke.native])==null||n.track.removeCue(e),this.dispatchEvent(new Ke("remove-cue",{detail:e,trigger:t})),a&&this[ke.updateActiveCues](r(this,cn),t)}}setMode(e,t){var s;r(this,pa)!==e&&(b(this,pa,e),e==="disabled"?(b(this,un,[]),o(this,At,ff).call(this)):this.readyState===2?this[ke.updateActiveCues](r(this,cn),t):o(this,At,df).call(this),this.dispatchEvent(new Ke("mode-change",{detail:this,trigger:t})),(s=this[ke.onModeChange])==null||s.call(this))}[(N2=ke.readyState,L2=ke.crossOrigin,D2=ke.onModeChange,_2=ke.native,ke.updateActiveCues)](e,t){if(b(this,cn,e),this.mode==="disabled"||!r(this,si).length)return;const s=[];for(let a=0,l=r(this,si).length;a<l;a++){const u=r(this,si)[a];Kd(u,e)&&s.push(u)}let n=s.length!==r(this,un).length;if(!n){for(let a=0;a<s.length;a++)if(!r(this,un).includes(s[a])){n=!0;break}}b(this,un,s),n&&o(this,At,ff).call(this,t)}[ke.canLoad](){b(this,Mc,!0),r(this,pa)!=="disabled"&&o(this,At,df).call(this)}},Mc=new WeakMap,cn=new WeakMap,pa=new WeakMap,Rc=new WeakMap,fa=new WeakMap,si=new WeakMap,un=new WeakMap,No=new WeakMap,At=new WeakSet,f0=function(e){mi(async()=>{const{parseText:t,VTTCue:s,VTTRegion:n}=await import("./prod-DbD_yNsS.js").then(a=>a.d);return{parseText:t,VTTCue:s,VTTRegion:n}},__vite__mapDeps([0,1,2])).then(({parseText:t,VTTCue:s,VTTRegion:n})=>{!le(e.content)||e.type==="json"?(o(this,At,pf).call(this,e.content,s,n),this.readyState!==3&&o(this,At,uc).call(this)):t(e.content.split(`
7`).map(a=>a.trim()).join(`
8`).trim(),{type:e.type}).then(({cues:a,regions:l})=>{b(this,si,a),b(this,fa,l),o(this,At,uc).call(this)})})},df=async function(){var e,t;if(!(!r(this,Mc)||this[ke.readyState]>0)){if(this[ke.readyState]=1,this.dispatchEvent(new Ke("load-start")),!this.src){o(this,At,uc).call(this);return}try{const{parseResponse:s,VTTCue:n,VTTRegion:a}=await mi(async()=>{const{parseResponse:d,VTTCue:h,VTTRegion:p}=await import("./prod-DbD_yNsS.js").then(f=>f.d);return{parseResponse:d,VTTCue:h,VTTRegion:p}},__vite__mapDeps([0,1,2])),l=(e=this[ke.crossOrigin])==null?void 0:e.call(this),u=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Io(l)});if(this.type==="json")o(this,At,pf).call(this,await(await u).text(),n,a);else{const{errors:d,metadata:h,regions:p,cues:f}
8=await s(u,{type:this.type,encoding:this.encoding});if(((t=d[0])==null?void 0:t.code)===0)throw d[0];b(this,Rc,h),b(this,fa,p),b(this,si,f)}o(this,At,uc).call(this)}catch(s){o(this,At,hf).call(this,s)}}},uc=function(){if(this[ke.readyState]=2,!this.src||this.type!=="vtt"){const t=this[ke.native];if(t&&!t.managed)for(const s of r(this,si))t.track.addCue(s)}const e=new Ke("load");this[ke.updateActiveCues](r(this,cn),e),this.dispatchEvent(e)},hf=function(e){this[ke.readyState]=3,this.dispatchEvent(new Ke("error",{detail:e}))},pf=function(e,t,s){try{const{regions:n,cues:a}=m0(e,t,s);b(this,fa,n),b(this,si,a)}catch(n){o(this,At,hf).call(this,n)}},ff=function(e){this.dispatchEvent(new Ke("cue-change",{trigger:e}))},O2);const Qx=/captions|subtitles/;function pi(i){return Qx.test(i.kind)}function m0(i,e,t){const s=le(i)?JSON.parse(i):i;let n=[],a=[];return s.regions&&t&&(n=s.regions.map(l=>Object.assign(new t,l))),(s.cues||wt(s))&&(a=(wt(s)?s:s.cues).filter(l=>Si(l.startTime)&&Si(l.endTime)).map(l=>Object.assign(new e(0,0,""),l))),{regions:n,cues:a}}const Le={add:Symbol(0),remove:Symbol(0),reset:Symbol(0),select:Symbol(0),readonly:Symbol(0),setReadonly:Symbol(0),onReset:Symbol(0),onRemove:Symbol(0),onUserSelect:Symbol(0)};function ei(i,e=2){return Number(i.toFixed(e))}function Qd(i){var e;return((e=String(i).split(".")[1])==null?void 0:e.length)??0}function Oh(i,e,t){return Math.max(i,Math.min(t,e))}const Mi={setAuto:Symbol(0),enableAuto:Symbol(0)};let wd=null,Zd=[],Yd=[];function Qm(){return wd??(wd=new AudioContext)}function Zx(){const i=Qm(),e=i.createGain();return e.connect(i.destination),Zd.push(e),e}function Yx(i,e){const t=Qm().createMediaElementSource(i);return e&&t.connect(e),Yd.push(t),t}function Xx(i){const e=Zd.indexOf(i);e!==-1&&(Zd.splice(e,1),i.disconnect(),g0())}function Jx(i){const e=Yd.indexOf(i);e!==-1&&(Yd.splice(e,1),i.disconnect(),g0())}function g0(){wd&&Zd.length===0&&Yd.length===0&&wd.close().then(()=>{wd=null})}var Ac,Oo,Oi,Ki,co,y0,mf,V2,eE=(V2=class{constructor(i,e){g(this,co);g(this,Ac);g(this,Oo);g(this,Oi,null);g(this,Ki,null);b(this,Ac,i),b(this,Oo,e)}get currentGain(){var i,e;return((e=(i=r(this,Oi))==null?void 0:i.gain)==null?void 0:e.value)??null}get supported(){return!0}setGain(i){const e=this.currentGain;if(i!==this.currentGain){if(i===1&&e!==1){this.removeGain();return}r(this,Oi)||(b(this,Oi,Zx()),r(this,Ki)&&r(this,Ki).connect(r(this,Oi))),r(this,Ki)||b(this,Ki,Yx(r(this,Ac),r(this,Oi))),r(this,Oi).gain.value=i,r(this,Oo).call(this,i)}}removeGain(){r(this,Oi)&&(r(this,Ki)&&r(this,Ki).connect(Qm().destination),o(this,co,mf).call(this),r(this,Oo).call(this,null))}destroy(){o(this,co,y0).call(this),o(this,co,mf).call(this)}},Ac=new WeakMap,Oo=new WeakMap,Oi=new WeakMap,Ki=new WeakMap,co=new WeakSet,y0=function(){if(r(this,Ki))try{Jx(r(this,Ki))}catch{}finally{b(this,Ki,null)}},mf=function(){if(r(this,Oi))try{Xx(r(this,Oi))}catch{}finally{b(this,Oi,null)}},V2);const tE=["focus","blur","visibilitychange","pageshow","pagehide"];var ma,Vo,Ic,ah,b0,B2,iE=(B2=class{constructor(){g(this,ah);g(this,ma,de(Y3()));g(this,Vo,de(se?"visible":document.visibilityState));g(this,Ic)}connect(){const i=new Xe(window),e=o(this,ah,b0).bind(this);for(const t of tE)i.add(t,e);Ud&&i.add("beforeunload",t=>{b(this,Ic,setTimeout(()=>{t.defaultPrevented||t.returnValue.length>0||(r(this,ma).set("hidden"),r(this,Vo).set("hidden"))},0))})}get pageState(){return r(this,ma).call(this)}get visibility(){return r(this,Vo).call(this)}},ma=new WeakMap,Vo=new WeakMap,Ic=new WeakMap,ah=new WeakSet,b0=function(i){Ud&&window.clearTimeout(r(this,Ic)),(i.type!=="blur"||r(this,ma).call(this)==="active")&&(r(this,ma).set(Y3(i)),r(this,Vo).set(document.visibilityState=="hidden"?"hidden":"visible"))},B2);function Y3(i){return se||(i==null?void 0:i.type)==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}var dn,_c,Dc,gf,q2,Zm=(q2=class{constructor(i){g(this,Dc);g(this,dn);g(this,_c);b(this,_c,i)}start(){Ot(r(this,dn))&&o(this,Dc,gf).call(this)}stop(){Si(r(this,dn))&&window.cancelAnimationFrame(r(this,dn)),b(this,dn,void 0)}},dn=new WeakMap,_c=new WeakMap,Dc=new WeakSet,gf=function(){b(this,dn,window.requestAnimationFrame(()=>{Ot(r(this,dn))||(r(this,_c).call(this),o(this,Dc,gf).call(this))}))},q2),Lc,Ge,ar,Bo,qo,ga,Nc,Fo,D,et,v0,Wo,Ho,C0,S0,w0,x0,oh,vm,kt,nE,ia,E0,yf,T0,k0,$0,xd,P0,M0,R0,A0,I0,_0,D0,L0,N0,O0,V0,B0,q0,F0,W0,H0,j0,G0,F2,
8sE=(F2=class{constructor(i,e){g(this,D);g(this,Lc);g(this,Ge);g(this,ar,!1);g(this,Bo,!1);g(this,qo,!1);g(this,ga,new Zm(o(this,D,C0).bind(this)));g(this,Nc,new iE);g(this,Fo);g(this,Wo,0);g(this,Ho,-1);g(this,oh);g(this,vm);b(this,Lc,i),b(this,Ge,e),b(this,Fo,new Xe(i.media)),o(this,D,S0).call(this),r(this,Nc).connect(),I(o(this,D,N0).bind(this)),_e(o(this,D,v0).bind(this))}},Lc=new WeakMap,Ge=new WeakMap,ar=new WeakMap,Bo=new WeakMap,qo=new WeakMap,ga=new WeakMap,Nc=new WeakMap,Fo=new WeakMap,D=new WeakSet,et=function(){return r(this,Lc).media},v0=function(){var i;b(this,Bo,!1),b(this,qo,!1),r(this,ga).stop(),r(this,Fo).abort(),(i=r(this,oh))==null||i.clear()},Wo=new WeakMap,Ho=new WeakMap,C0=function(){const i=r(this,D,et).currentTime;!(Ud&&i-r(this,Ho)<.35)&&r(this,Wo)!==i&&(o(this,D,ia).call(this,i),b(this,Wo,i))},S0=function(){o(this,D,kt).call(this,"loadstart",o(this,D,E0)),o(this,D,kt).call(this,"abort",o(this,D,yf)),o(this,D,kt).call(this,"emptied",o(this,D,T0)),o(this,D,kt).call(this,"error",o(this,D,G0)),o(this,D,kt).call(this,"volumechange",o(this,D,B0))},w0=function(){r(this,Bo)||(o(this,D,kt).call(this,"loadeddata",o(this,D,k0)),o(this,D,kt).call(this,"loadedmetadata",o(this,D,$0)),o(this,D,kt).call(this,"canplay",o(this,D,R0)),o(this,D,kt).call(this,"canplaythrough",o(this,D,A0)),o(this,D,kt).call(this,"durationchange",o(this,D,V0)),o(this,D,kt).call(this,"play",o(this,D,P0)),o(this,D,kt).call(this,"progress",o(this,D,W0)),o(this,D,kt).call(this,"stalled",o(this,D,_0)),o(this,D,kt).call(this,"suspend",o(this,D,H0)),o(this,D,kt).call(this,"ratechange",o(this,D,j0)),b(this,Bo,!0))},x0=function(){r(this,qo)||(o(this,D,kt).call(this,"pause",o(this,D,M0)),o(this,D,kt).call(this,"playing",o(this,D,I0)),o(this,D,kt).call(this,"seeked",o(this,D,q0)),o(this,D,kt).call(this,"seeking",o(this,D,F0)),o(this,D,kt).call(this,"ended",o(this,D,L0)),o(this,D,kt).call(this,"waiting",o(this,D,D0)),b(this,qo,!0))},oh=new WeakMap,vm=new WeakMap,kt=function(i,e){r(this,Fo).add(i,e.bind(this))},nE=function(i){},ia=function(i,e){const t=Math.min(i,r(this,Ge).$state.seekableEnd());r(this,Ge).notify("time-change",t,e)},E0=function(i){if(r(this,D,et).networkState===3){o(this,D,yf).call(this,i);return}o(this,D,w0).call(this),r(this,Ge).notify("load-start",void 0,i)},yf=function(i){r(this,Ge).notify("abort",void 0,i)},T0=function(i){r(this,Ge).notify("emptied",void 0,i)},k0=function(i){r(this,Ge).notify("loaded-data",void 0,i)},$0=function(i){b(this,Wo,0),b(this,Ho,-1),o(this,D,x0).call(this),r(this,Ge).notify("loaded-metadata",void 0,i),(_h||Ud&&yo(r(this,Ge).$state.source()))&&r(this,Ge).delegate.ready(o(this,D,xd).call(this),i)},xd=function(){return{provider:Y(r(this,Ge).$provider),duration:r(this,D,et).duration,buffered:r(this,D,et).buffered,seekable:r(this,D,et).seekable}},P0=function(i){r(this,Ge).$state.canPlay()&&r(this,Ge).notify("play",void 0,i)},M0=function(i){r(this,D,et).readyState===1&&!r(this,ar)||(b(this,ar,!1),r(this,ga).stop(),r(this,Ge).notify("pause",void 0,i))},R0=function(i){r(this,Ge).delegate.ready(o(this,D,xd).call(this),i)},A0=function(i){r(this,Ge).$state.started()||r(this,Ge).notify("can-play-through",o(this,D,xd).call(this),i)},I0=function(i){r(this,D,et).paused||(b(this,ar,!1),r(this,Ge).notify("playing",void 0,i),r(this,ga).start())},_0=function(i){r(this,Ge).notify("stalled",void 0,i),r(this,D,et).readyState<3&&(b(this,ar,!0),r(this,Ge).notify("waiting",void 0,i))},D0=function(i){r(this,D,et).readyState<3&&(b(this,ar,!0),r(this,Ge).notify("waiting",void 0,i))},L0=function(i){r(this,ga).stop(),o(this,D,ia).call(this,r(this,D,et).duration,i),r(this,Ge).notify("end",void 0,i),r(this,Ge).$state.loop()&&mg(r(this,D,et).controls)&&(r(this,D,et).controls=!1)},N0=function(){const i=r(this,Ge).$state.paused(),e=r(this,Nc).visibility==="hidden";(i||e)&&pt(r(this,D,et),"timeupdate",o(this,D,O0).bind(this))},O0=function(i){o(this,D,ia).call(this,r(this,D,et).currentTime,i)},V0=function(i){r(this,Ge).$state.ended()&&o(this,D,ia).call(this,r(this,D,et).duration,i),r(this,Ge).notify("duration-change",r(this,D,et).duration,i)},B0=function(i){const e={volume:r(this,D,et).volume,muted:r(this,D,et).muted};r(this,Ge).notify("volume-change",e,i)},q0=function(i){b(this,Ho,r(this,D,et).currentTime),o(this,D,ia).call(this,r(this,D,et).currentTime,i),r(this,Ge).notify("seeked",r(this,D,et).currentTime,i),Math.trunc(r(this,D,et).currentTime)===Math.trunc(r(this,D,et).duration)&&Qd(r(this,D,et).duration)>Qd(r(this,D,et).currentTime)&&(o(this,D,ia).call(this,r(this,D,et).duration,i),r(this,D,et).ended||r(this,Ge).player.dis
8patch(new Ke("media-play-request",{trigger:i})))},F0=function(i){r(this,Ge).notify("seeking",r(this,D,et).currentTime,i)},W0=function(i){const e={buffered:r(this,D,et).buffered,seekable:r(this,D,et).seekable};r(this,Ge).notify("progress",e,i)},H0=function(i){r(this,Ge).notify("suspend",void 0,i)},j0=function(i){r(this,Ge).notify("rate-change",r(this,D,et).playbackRate,i)},G0=function(i){const e=r(this,D,et).error;if(!e)return;const t={message:e.message,code:e.code,mediaError:e};r(this,Ge).notify("error",t,i)},F2),Oc,ls,Ht,ko,z0,U0,K0,bf,Q0,W2,rE=(W2=class{constructor(i,e){g(this,Ht);g(this,Oc);g(this,ls);b(this,Oc,i),b(this,ls,e),r(this,Ht,ko).onaddtrack=o(this,Ht,z0).bind(this),r(this,Ht,ko).onremovetrack=o(this,Ht,U0).bind(this),r(this,Ht,ko).onchange=o(this,Ht,K0).bind(this),pt(r(this,ls).audioTracks,"change",o(this,Ht,Q0).bind(this))}},Oc=new WeakMap,ls=new WeakMap,Ht=new WeakSet,ko=function(){return r(this,Oc).media.audioTracks},z0=function(i){const e=i.track;if(e.label==="")return;const t={id:e.id.toString()||`native-audio-${r(this,ls).audioTracks.length}`,label:e.label,language:e.language,kind:e.kind,selected:!1};r(this,ls).audioTracks[Le.add](t,i),e.enabled&&(t.selected=!0)},U0=function(i){const e=r(this,ls).audioTracks.getById(i.track.id);e&&r(this,ls).audioTracks[Le.remove](e,i)},K0=function(i){let e=o(this,Ht,bf).call(this);if(!e)return;const t=r(this,ls).audioTracks.getById(e.id);t&&r(this,ls).audioTracks[Le.select](t,!0,i)},bf=function(){return Array.from(r(this,Ht,ko)).find(i=>i.enabled)},Q0=function(i){const{current:e}=i.detail;if(!e)return;const t=r(this,Ht,ko).getTrackById(e.id);if(t){const s=o(this,Ht,bf).call(this);s&&(s.enabled=!1),t.enabled=!0}},W2),Vc,vf,H2,Z0=(H2=class{constructor(i,e){g(this,Vc);O(this,"media");O(this,"ctx");O(this,"scope",oo());O(this,"currentSrc",null);O(this,"audioGain");this.media=i,this.ctx=e,this.audioGain=new eE(i,t=>{this.ctx.notify("audio-gain-change",t)})}setup(){new sE(this,this.ctx),"audioTracks"in this.media&&new rE(this,this.ctx),_e(()=>{this.audioGain.destroy(),this.media.srcObject=null,this.media.removeAttribute("src");for(const i of this.media.querySelectorAll("source"))i.remove();this.media.load()})}get type(){return""}setPlaybackRate(i){this.media.playbackRate=i}async play(){return this.media.play()}async pause(){return this.media.pause()}setMuted(i){this.media.muted=i}setVolume(i){this.media.volume=i}setCurrentTime(i){this.media.currentTime=i}setPlaysInline(i){we(this.media,"playsinline",i)}async loadSource({src:i,type:e},t){this.media.preload=t||"",d0(i)?(this.removeSource(),this.media.srcObject=i):(this.media.srcObject=null,le(i)?e!=="?"?this.appendSource({src:i,type:e}):(this.removeSource(),this.media.src=o(this,Vc,vf).call(this,i)):(this.removeSource(),this.media.src=window.URL.createObjectURL(i))),this.media.load(),this.currentSrc={src:i,type:e}}appendSource(i,e){const t=this.media.querySelector("source[data-vds]"),s=t??document.createElement("source");we(s,"src",o(this,Vc,vf).call(this,i.src)),we(s,"type",i.type!=="?"?i.type:e),we(s,"data-vds",""),t||this.media.append(s)}removeSource(){var i;(i=this.media.querySelector("source[data-vds]"))==null||i.remove()}},Vc=new WeakSet,vf=function(i){const{clipStartTime:e,clipEndTime:t}=this.ctx.$state,s=e(),n=t();return s>0&&n>0?`${i}#t=${s},${n}`:s>0?`${i}#t=${s}`:n>0?`${i}#t=0,${n}`:i},H2),Qi,Bc,qc,ya,Ur,Y0,X0,J0,j2,aE=(j2=class{constructor(i,e){g(this,Ur);g(this,Qi);g(this,Bc);g(this,qc);g(this,ya,de(!1));b(this,Qi,i),b(this,Bc,e),o(this,Ur,Y0).call(this)}get supported(){return r(this,ya).call(this)}async prompt(){if(!this.supported)throw Error("Not supported on this platform.");return this.type==="airplay"&&r(this,Qi).webkitShowPlaybackTargetPicker?r(this,Qi).webkitShowPlaybackTargetPicker():r(this,Qi).remote.prompt()}},Qi=new WeakMap,Bc=new WeakMap,qc=new WeakMap,ya=new WeakMap,Ur=new WeakSet,Y0=function(){var i;se||!((i=r(this,Qi))!=null&&i.remote)||!this.canPrompt||(r(this,Qi).remote.watchAvailability(e=>{r(this,ya).set(e)}).catch(()=>{r(this,ya).set(!1)}),I(o(this,Ur,X0).bind(this)))},X0=function(){if(!r(this,ya).call(this))return;const i=["connecting","connect","disconnect"],e=o(this,Ur,J0).bind(this);e(),pt(r(this,Qi),"playing",e);const t=new Xe(r(this,Qi).remote);for(const s of i)t.add(s,e)},J0=function(i){const e=r(this,Qi).remote.state;if(e===r(this,qc))return;
8const t={type:this.type,state:e};r(this,Bc).notify("remote-playback-change",t,i),b(this,qc,e)},j2),ey=class extends aE{constructor(){super(...arguments);O(this,"type","airplay")}get canPrompt(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},jo,Go,Gl,ty,iy,G2,oE=(G2=class{constructor(i,e){g(this,Gl);g(this,jo);g(this,Go);b(this,jo,i),b(this,Go,e),i.textTracks.onaddtrack=o(this,Gl,ty).bind(this),_e(o(this,Gl,iy).bind(this))}},jo=new WeakMap,Go=new WeakMap,Gl=new WeakSet,ty=function(i){const e=i.track;if(!e||lE(r(this,jo),e))return;const t=new lo({id:e.id,kind:e.kind,label:e.label??"",language:e.language,type:"vtt"});t[ke.native]={track:e},t[ke.readyState]=2,t[ke.nativeHLS]=!0;let s=0;const n=a=>{if(e.cues)for(let l=s;l<e.cues.length;l++)t.addCue(e.cues[l],a),s++};n(i),e.oncuechange=n,r(this,Go).textTracks.add(t,i),t.setMode(e.mode,i)},iy=function(){var i;r(this,jo).textTracks.onaddtrack=null;for(const e of r(this,Go).textTracks){const t=(i=e[ke.native])==null?void 0:i.track;t!=null&&t.oncuechange&&(t.oncuechange=null)}},G2);function lE(i,e){return Array.from(i.children).find(t=>t.track===e)}var ba,Fc,zl,sy,ny,Wc,z2,cE=(z2=class{constructor(i,e){g(this,zl);g(this,ba);g(this,Fc);g(this,Wc,(i,e)=>{r(this,Fc).notify("picture-in-picture-change",i,e)});b(this,ba,i),b(this,Fc,e),new Xe(i).add("enterpictureinpicture",o(this,zl,sy).bind(this)).add("leavepictureinpicture",o(this,zl,ny).bind(this))}get active(){return document.pictureInPictureElement===r(this,ba)}get supported(){return zm(r(this,ba))}async enter(){return r(this,ba).requestPictureInPicture()}exit(){return document.exitPictureInPicture()}},ba=new WeakMap,Fc=new WeakMap,zl=new WeakSet,sy=function(i){r(this,Wc).call(this,!0,i)},ny=function(i){r(this,Wc).call(this,!1,i)},Wc=new WeakMap,z2),va,zo,$s,lh,ry,U2,uE=(U2=class{constructor(i,e){g(this,lh);g(this,va);g(this,zo);g(this,$s,"inline");b(this,va,i),b(this,zo,e),pt(i,"webkitpresentationmodechanged",o(this,lh,ry).bind(this))}get mode(){return r(this,$s)}get supported(){return Um(r(this,va))}async setPresentationMode(i){r(this,$s)!==i&&r(this,va).webkitSetPresentationMode(i)}},va=new WeakMap,zo=new WeakMap,$s=new WeakMap,lh=new WeakSet,ry=function(i){var t;const e=r(this,$s);b(this,$s,r(this,va).webkitPresentationMode),(t=r(this,zo).player)==null||t.dispatch(new Ke("video-presentation-change",{detail:r(this,$s),trigger:i})),["fullscreen","picture-in-picture"].forEach(s=>{(r(this,$s)===s||e===s)&&r(this,zo).notify(`${s}-change`,r(this,$s)===s,i)})},U2),or,K2,dE=(K2=class{constructor(i){g(this,or);b(this,or,i)}get active(){return r(this,or).mode==="fullscreen"}get supported(){return r(this,or).supported}async enter(){r(this,or).setPresentationMode("fullscreen")}async exit(){r(this,or).setPresentationMode("inline")}},or=new WeakMap,K2),lr,Q2,hE=(Q2=class{constructor(i){g(this,lr);b(this,lr,i)}get active(){return r(this,lr).mode==="picture-in-picture"}get supported(){return r(this,lr).supported}async enter(){r(this,lr).setPresentationMode("picture-in-picture")}async exit(){r(this,lr).setPresentationMode("inline")}},lr=new WeakMap,Q2),pE=km({VideoProvider:()=>Ym}),Ym=class extends Z0{constructor(t,s){super(t,s);O(this,"$$PROVIDER_TYPE","VIDEO");O(this,"airPlay");O(this,"fullscreen");O(this,"pictureInPicture");Wt(()=>{if(this.airPlay=new ey(t,s),Um(t)){const n=new uE(t,s);this.fullscreen=new dE(n),this.pictureInPicture=new hE(n)}else zm(t)&&(this.pictureInPicture=new cE(t,s))},this.scope)}get type(){return"video"}setup(){super.setup(),Gm(this.video)&&new oE(this.video,this.ctx),this.ctx.textRenderers.attachVideo(this.video),_e(()=>{this.ctx.textRenderers.attachVideo(null)}),this.type==="video"&&this.ctx.notify("provider-setup",this)}get video(){return this.media}};function X3(i){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(i)??null}catch{return null}}const fE=i=>`dash-${zn(i)}`;var cr,dt,qe,Uo,Ko,he,sa,ay,oy,ly,hn,Qo,cy,uy,dy,hy,py,fy,my,gy,ur,yy,Ed,Cf,by,Sf,vy,Cy,wf,Z2,mE=(Z2=class{constructor(i,e){g(this,he);g(this,cr);g(this,dt);g(this,qe,null);g(this,Uo,new Set);g(this,Ko,null);O(this,"config",{});g(this,hn,null);g(this,Qo,{});g(this,ur,-1);b(this,cr,i),b(this,dt,e)}get instance(){return r(this,qe)}setup(i){b(this,qe,i().create());const e=o(this,he,ly).bind(this);for(const t of Object.values(i.events))r(this,qe).on(t,e);r(this,qe).on(i.events.ERROR,o(this,he,fy).bind(this));for(const t of r(this,Uo))t(r(this,qe));
8r(this,dt).player.dispatch("dash-instance",{detail:r(this,qe)}),r(this,qe).initialize(r(this,cr),void 0,!1),r(this,qe).updateSettings({streaming:{text:{defaultEnabled:!1,dispatchForManualRendering:!0},buffer:{fastSwitchEnabled:!0}},...this.config}),r(this,qe).on(i.events.FRAGMENT_LOADING_STARTED,o(this,he,my).bind(this)),r(this,qe).on(i.events.FRAGMENT_LOADING_COMPLETED,o(this,he,gy).bind(this)),r(this,qe).on(i.events.MANIFEST_LOADED,o(this,he,py).bind(this)),r(this,qe).on(i.events.QUALITY_CHANGE_RENDERED,o(this,he,hy).bind(this)),r(this,qe).on(i.events.TEXT_TRACKS_ADDED,o(this,he,uy).bind(this)),r(this,qe).on(i.events.TRACK_CHANGE_RENDERED,o(this,he,dy).bind(this)),r(this,dt).qualities[Mi.enableAuto]=o(this,he,by).bind(this),pt(r(this,dt).qualities,"change",o(this,he,vy).bind(this)),pt(r(this,dt).audioTracks,"change",o(this,he,Cy).bind(this)),b(this,Ko,I(o(this,he,ay).bind(this)))}onInstance(i){return r(this,Uo).add(i),()=>r(this,Uo).delete(i)}loadSource(i){var e;o(this,he,wf).call(this),le(i.src)&&((e=r(this,qe))==null||e.attachSource(i.src))}destroy(){var i,e;o(this,he,wf).call(this),(i=r(this,qe))==null||i.destroy(),b(this,qe,null),(e=r(this,Ko))==null||e.call(this),b(this,Ko,null)}},cr=new WeakMap,dt=new WeakMap,qe=new WeakMap,Uo=new WeakMap,Ko=new WeakMap,he=new WeakSet,sa=function(i){return new Ke(fE(i.type),{detail:i})},ay=function(){if(!r(this,dt).$state.live())return;const i=new Zm(o(this,he,oy).bind(this));return i.start(),i.stop.bind(i)},oy=function(){if(!r(this,qe))return;const i=r(this,qe).duration()-r(this,qe).time();r(this,dt).$state.liveSyncPosition.set(isNaN(i)?1/0:i)},ly=function(i){var e;(e=r(this,dt).player)==null||e.dispatch(o(this,he,sa).call(this,i))},hn=new WeakMap,Qo=new WeakMap,cy=function(i){var l;const e=(l=r(this,hn))==null?void 0:l[ke.native],t=(e==null?void 0:e.track).cues;if(!e||!t)return;const s=r(this,hn).id,n=r(this,Qo)[s]??0,a=o(this,he,sa).call(this,i);for(let u=n;u<t.length;u++){const d=t[u];d.positionAlign||(d.positionAlign="auto"),r(this,hn).addCue(d,a)}r(this,Qo)[s]=t.length},uy=function(i){var n;if(!r(this,qe))return;const e=i.tracks,t=[...r(this,cr).textTracks].filter(a=>"manualMode"in a),s=o(this,he,sa).call(this,i);for(let a=0;a<t.length;a++){const l=e[a],u=t[a],d=new lo({id:`dash-${l.kind}-${a}`,label:(l==null?void 0:l.label)??((n=l.labels.find(h=>h.text))==null?void 0:n.text)??((l==null?void 0:l.lang)&&X3(l.lang))??(l==null?void 0:l.lang)??void 0,language:l.lang??void 0,kind:l.kind,default:l.defaultTrack});d[ke.native]={managed:!0,track:u},d[ke.readyState]=2,d[ke.onModeChange]=()=>{r(this,qe)&&(d.mode==="showing"?(r(this,qe).setTextTrack(a),b(this,hn,d)):(r(this,qe).setTextTrack(-1),b(this,hn,null)))},r(this,dt).textTracks.add(d,s)}},dy=function(i){const{mediaType:e,newMediaInfo:t}=i;if(e==="audio"){const s=r(this,dt).audioTracks.getById(`dash-audio-${t.index}`);if(s){const n=o(this,he,sa).call(this,i);r(this,dt).audioTracks[Le.select](s,!0,n)}}},hy=function(i){if(i.mediaType!=="video")return;const e=r(this,dt).qualities[i.newQuality];if(e){const t=o(this,he,sa).call(this,i);r(this,dt).qualities[Le.select](e,!0,t)}},py=function(i){if(r(this,dt).$state.canPlay()||!r(this,qe))return;const{type:e,mediaPresentationDuration:t}=i.data,s=o(this,he,sa).call(this,i);r(this,dt).notify("stream-type-change",e!=="static"?"live":"on-demand",s),r(this,dt).notify("duration-change",t,s),r(this,dt).qualities[Mi.setAuto](!0,s);const n=r(this,qe).getVideoElement(),a=r(this,qe).getTracksForTypeFromManifest("video",i.data),l=[...new Set(a.map(p=>p.mimeType))].find(p=>p&&jm(n,p)),u=a.find(p=>l===p.mimeType);let d=r(this,qe).getTracksForTypeFromManifest("audio",i.data);const h=[...new Set(d.map(p=>p.mimeType))].find(p=>p&&Hm(n,p));if(d=d.filter(p=>h===p.mimeType),u&&(u.bitrateList.forEach((p,f)=>{var v;const y={id:((v=p.id)==null?void 0:v.toString())??`dash-bitrate-${f}`,width:p.width??0,height:p.height??0,bitrate:p.bandwidth??0,codec:u.codec,index:f};r(this,dt).qualities[Le.add](y,s)}),Si(u.index))){const p=r(this,dt).qualities[u.index];p&&r(this,dt).qualities[Le.select](p,!0,s)}d.forEach((p,f)=>{const y=p.labels.find(C=>navigator.languages.some(S=>C.lang&&S.toLowerCase().startsWith(C.lang.toLowerCase())))||p.labels[0],v={id:`dash-audio-${p==null?void 0:p.index}`,label:(y==null?void 0:y.text)??(p.lang&&X3(p.lang))??p.lang??"",language:p.lang??"",kind:"main",mimeType:p.mimeType,codec:p.codec,index:f};r(this,dt).audioTracks[Le.add](v,s)}),n.dispatchEvent(new Ke("canplay",{trigger:s}))},fy=function(i){const{type:e,error:t}=i;switch(t.code){case 27:o(this,he,yy).call(this,t);break;default:o(this,he,Cf).call(this,t);break}},my=function(){r(this,ur)>=0&&o(this,he,Ed).call(this)},gy=function(i){i.mediaType==="text"&&requestAnimationFrame(o(this,he,cy).bind(this,i))},ur=new WeakMap,yy=function(i){var e;o(this,he,Ed).call(this),(e=r(this,qe))==null||e.play(),b(this,ur,window.setTimeout(()=>{b(this,ur,-1),o(this,he,Cf).call(this,i)},5e3))},Ed=function(){clearTimeout(r(this,ur)),b(this,ur,-1)},Cf=function(i){r(this,dt).notify("error",{message:i.message??"",code:1,error:i})},by=function(){var e;o(this,he,Sf).call(this,"video",!0);const{qualities:i}=r(this,dt);(e=r(this,qe))==null||e.setQualityFor("video",i.selectedIndex,!0)},Sf=function(i,e){var t;(t=r(this,qe))==null||t.updateSettings({streaming:{abr:{autoSwitchBitrate:{[i]:e}}}})},vy=function(){const{qualities:i}=r(this,dt);!r(this,qe)||i.auto||!i.selected||(o(this,he,Sf).call(this,"video",!1),r(this,qe).setQualityFor("video",i.selectedIndex,i.switch==="current"),Fm&&(r(this,cr).currentTime=r(this,cr).currentTime))},Cy=function(){if(!r(this,qe))return;const{audioTracks:i}=r(this,dt),e=r(this,qe).getTracksFor("audio").find(t=>i.selected&&i.selected.id===`dash-audio-${t.index}`);e&&r(this,qe).setCurrentTrack(e)},wf=function(){o(this,he,Ed).call(this),b(this,hn,null),b(this,Qo,{})},Z2);function Cc(i){return i instanceof Error?i:Error(typeof i=="string"?i:JSON.stringify(i))}function ks(i,e){if(!i)throw Error(e||"Assertion failed.")}var Ca,Ps,Hc,Us,Sy,wy,xy,Ey,Y2,gE=(Y2=class{constructor(i,e,t){g(this,Us);g(this,Ca);g(this,Ps);g(this,Hc);b(this,Ca,i),b(this,Ps,e),b(this,Hc,t),o(this,Us,Sy).call(this)}},Ca=new WeakMap,Ps=new WeakMap,Hc=new WeakMap,Us=new WeakSet,Sy=async function(){const i={onLoadStart:o(this,Us,wy).bind(this),onLoaded:o(this,Us,xy).bind(this),onLoadError:o(this,Us,Ey).bind(this)};let e=await bE(r(this,Ca),i);if(Ot(e)&&!le(r(this,Ca))&&(e=await yE(r(this,Ca),i)),!e)return null;if(!window.dashjs.supportsMediaSource()){const t="[vidstack] `dash.js` is not supported in this environment";
8return r(this,Ps).player.dispatch(new Ke("dash-unsupported")),r(this,Ps).notify("error",{message:t,code:4}),null}return e},wy=function(){r(this,Ps).player.dispatch(new Ke("dash-lib-load-start"))},xy=function(i){r(this,Ps).player.dispatch(new Ke("dash-lib-loaded",{detail:i})),r(this,Hc).call(this,i)},Ey=function(i){const e=Cc(i);r(this,Ps).player.dispatch(new Ke("dash-lib-load-error",{detail:e})),r(this,Ps).notify("error",{message:e.message,code:4,error:e})},Y2);async function yE(i,e={}){var t,s,n,a,l,u,d;if(!Ot(i)){if((t=e.onLoadStart)==null||t.call(e),vE(i))return(s=e.onLoaded)==null||s.call(e,i),i;if(J3(i)){const h=i.MediaPlayer;return(n=e.onLoaded)==null||n.call(e,h),h}try{const h=(a=await i())==null?void 0:a.default;if(J3(h))return(l=e.onLoaded)==null||l.call(e,h.MediaPlayer),h.MediaPlayer;if(h)(u=e.onLoaded)==null||u.call(e,h);else throw Error("");return h}catch(h){(d=e.onLoadError)==null||d.call(e,h)}}}async function bE(i,e={}){var t,s,n;if(le(i)){(t=e.onLoadStart)==null||t.call(e);try{if(await h0(i),!Hi(window.dashjs.MediaPlayer))throw Error("");const a=window.dashjs.MediaPlayer;return(s=e.onLoaded)==null||s.call(e,a),a}catch(a){(n=e.onLoadError)==null||n.call(e,a)}}}function vE(i){return i&&i.prototype&&i.prototype!==Function}function J3(i){return i&&"MediaPlayer"in i}var CE=km({DASHProvider:()=>wE});const SE="https://cdn.jsdelivr.net";var jc,cs,wp,dr,wE=(wp=class extends Ym{constructor(){super(...arguments);O(this,"$$PROVIDER_TYPE","DASH");g(this,jc,null);g(this,cs,new mE(this.video,this.ctx));g(this,dr,`${SE}/npm/[email protected]/dist/dash.all.min.js`)}get ctor(){return r(this,jc)}get instance(){return r(this,cs).instance}get type(){return"dash"}get canLiveSync(){return!0}get config(){return r(this,cs).config}set config(e){r(this,cs).config=e}get library(){return r(this,dr)}set library(e){b(this,dr,e)}preconnect(){le(r(this,dr))&&bo(r(this,dr))}setup(){super.setup(),new gE(r(this,dr),this.ctx,e=>{b(this,jc,e),r(this,cs).setup(e),this.ctx.notify("provider-setup",this);const t=Y(this.ctx.$state.source);t&&this.loadSource(t)})}async loadSource(e,t){if(!le(e.src)){this.removeSource();return}this.media.preload=t||"",this.appendSource(e,"application/x-mpegurl"),r(this,cs).loadSource(e),this.currentSrc=e}onInstance(e){const t=r(this,cs).instance;return t&&e(t),r(this,cs).onInstance(e)}destroy(){r(this,cs).destroy()}},jc=new WeakMap,cs=new WeakMap,dr=new WeakMap,O(wp,"supported",Km()),wp);function Ty(i){return(i==null?void 0:i.$$PROVIDER_TYPE)==="REMOTION"}function Xm(i){return(i==null?void 0:i.type)==="video/remotion"}const ky=Object.freeze(Object.defineProperty({__proto__:null,AUDIO_EXTENSIONS:i0,AUDIO_TYPES:s0,DASH_VIDEO_EXTENSIONS:o0,DASH_VIDEO_TYPES:c0,HLS_VIDEO_EXTENSIONS:a0,HLS_VIDEO_TYPES:l0,HTMLAirPlayAdapter:ey,HTMLMediaProvider:Z0,IS_CHROME:Fm,IS_IOS:_h,IS_IPHONE:qm,IS_SERVER:se,ListSymbol:Le,QualitySymbol:Mi,RAFLoop:Zm,TextTrack:lo,TextTrackSymbol:ke,TimeRange:vc,VIDEO_EXTENSIONS:n0,VIDEO_TYPES:r0,VideoProvider:Ym,appendParamsToURL:Gx,assert:ks,canChangeVolume:Jg,canGoogleCastSrc:u0,canOrientScreen:Wm,canPlayAudioType:Hm,canPlayHLSNatively:Gm,canPlayVideoType:jm,canRotateScreen:Xg,canUsePictureInPicture:zm,canUseVideoPresentation:Um,clampNumber:Oh,coerceToError:Cc,findActiveCue:Ux,getDownloadFile:p0,getNumberOfDecimalPlaces:Qd,getRequestCredentials:Io,getTimeRangesEnd:sr,getTimeRangesStart:uf,isAudioSrc:Lh,isCueActive:Kd,isDASHSrc:Ou,isDASHSupported:Km,isHLSSrc:yo,isHLSSupported:Dh,isMediaStream:d0,isRemotionProvider:Ty,isRemotionSrc:Xm,isTrackCaptionKind:pi,isVideoSrc:Nh,loadScript:h0,normalizeTimeIntervals:e0,parseJSONCaptionsFile:m0,preconnect:bo,provider_exports:CE,provider_exports$1:pE,round:ei,updateTimeIntervals:t0,watchActiveTextTrack:Vu,watchCueTextChange:Kx},Symbol.toStringTag,{value:"Module"}));function xf(i){return!le(i)&&"width"in i&&"height"in i&&Si(i.width)&&Si(i.height)}const Bu=new Kn({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new vc,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:Wm(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControl
8s(){return qm&&this.mediaType==="video"&&(!this.playsInline||!jr.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 vc,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 vc,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(pi).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=uf(this.buffered)??0;return Math.max(i,this.clipStartTime)},get bufferedEnd(){const i=sr(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,i-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)}
8,get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const i=uf(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?sr(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}),$y=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),xE=new Set([...$y,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function e2(i,e=!1){const t=e?$y:xE;Bu.reset(i,s=>t.has(s)),bs()}function Py(i,e){const t=i+e.clipStartTime(),s=t<=e.seekableStart(),n=t>=e.seekableEnd();return s?e.seekableStart():n?e.seekableEnd():e.isLiveDVR()&&e.liveDVRWindow()>0&&t<e.seekableEnd()-e.liveDVRWindow()?e.bufferedStart():Math.min(Math.max(e.seekableStart()+.1,t),e.seekableEnd()-.1)}const qu=Un();function ut(){return Tt(qu)}var Sa,Vi,Zo,ch,tt,ot,TE,X2,EE=(X2=class{constructor(i=void 0){g(this,tt);g(this,Sa,null);g(this,Vi,null);g(this,Zo,-1);g(this,ch);b(this,ch,i)}setTarget(i){b(this,Sa,i)}getPlayer(i){var e;return r(this,Vi)?r(this,Vi):((e=i??r(this,Sa))==null||e.dispatchEvent(new Ke("find-media-player",{detail:t=>void b(this,Vi,t),bubbles:!0,composed:!0})),r(this,Vi))}setPlayer(i){b(this,Vi,i)}startLoading(i){o(this,tt,ot).call(this,"media-start-loading",i)}startLoadingPoster(i){o(this,tt,ot).call(this,"media-poster-start-loading",i)}requestAirPlay(i){o(this,tt,ot).call(this,"media-airplay-request",i)}requestGoogleCast(i){o(this,tt,ot).call(this,"media-google-cast-request",i)}play(i){o(this,tt,ot).call(this,"media-play-request",i)}pause(i){o(this,tt,ot).call(this,"media-pause-request",i)}mute(i){o(this,tt,ot).call(this,"media-mute-request",i)}unmute(i){o(this,tt,ot).call(this,"media-unmute-request",i)}enterFullscreen(i,e){o(this,tt,ot).call(this,"media-enter-fullscreen-request",e,i)}exitFullscreen(i,e){o(this,tt,ot).call(this,"media-exit-fullscreen-request",e,i)}lockScreenOrientation(i,e){o(this,tt,ot).call(this,"media-orientation-lock-request",e,i)}unlockScreenOrientation(i){o(this,tt,ot).call(this,"media-orientation-unlock-request",i)}enterPictureInPicture(i){o(this,tt,ot).call(this,"media-enter-pip-request",i)}exitPictureInPicture(i){o(this,tt,ot).call(this,"media-exit-pip-request",i)}seeking(i,e){o(this,tt,ot).call(this,"media-seeking-request",e,i)}seek(i,e){o(this,tt,ot).call(this,"media-seek-request",e,i)}seekToLiveEdge(i){o(this,tt,ot).call(this,"media-live-edge-request",i)}changeDuration(i,e){o(this,tt,ot).call(this,"media-duration-change-request",e,i)}changeClipStart(i,e){o(this,tt,ot).call(this,"media-clip-start-change-request",e,i)}changeClipEnd(i,e){o(this,tt,ot).call(this,"media-clip-end-change-request",e,i)}changeVolume(i,e){o(this,tt,ot).call(this,"media-volume-change-request",e,Math.max(0,Math.min(1,i)))}changeAudioTrack(i,e){o(this,tt,ot).call(this,"media-audio-track-change-request",e,i)}changeQuality(i,e){o(this,tt,ot).call(this,"media-quality-change-request",e,i)}requestAutoQuality(i){this.changeQuality(-1,i)}changeTextTrackMode(i,e,t){o(this,tt,ot).call(this,"media-text-track-change-request",t,{index:i,mode:e})}changePlaybackRate(i,e){o(this,tt,ot).call(this,"media-rate-change-request",e,i)}changeAudioGain(i,e){o(this,tt,ot).call(this,"media-audio-gain-change-request",e,i)}
8resumeControls(i){o(this,tt,ot).call(this,"media-resume-controls-request",i)}pauseControls(i){o(this,tt,ot).call(this,"media-pause-controls-request",i)}togglePaused(i){const e=this.getPlayer(i==null?void 0:i.target);e&&(e.state.paused?this.play(i):this.pause(i))}toggleControls(i){const e=this.getPlayer(i==null?void 0:i.target);e&&(e.controls.showing?e.controls.hide(0,i):e.controls.show(0,i))}toggleMuted(i){const e=this.getPlayer(i==null?void 0:i.target);e&&(e.state.muted?this.unmute(i):this.mute(i))}toggleFullscreen(i,e){const t=this.getPlayer(e==null?void 0:e.target);t&&(t.state.fullscreen?this.exitFullscreen(i,e):this.enterFullscreen(i,e))}togglePictureInPicture(i){const e=this.getPlayer(i==null?void 0:i.target);e&&(e.state.pictureInPicture?this.exitPictureInPicture(i):this.enterPictureInPicture(i))}showCaptions(i){const e=this.getPlayer(i==null?void 0:i.target);if(!e)return;let t=e.state.textTracks,s=r(this,Zo);(!t[s]||!pi(t[s]))&&(s=-1),s===-1&&(s=t.findIndex(n=>pi(n)&&n.default)),s===-1&&(s=t.findIndex(n=>pi(n))),s>=0&&this.changeTextTrackMode(s,"showing",i),b(this,Zo,-1)}disableCaptions(i){const e=this.getPlayer(i==null?void 0:i.target);if(!e)return;const t=e.state.textTracks,s=e.state.textTrack;if(s){const n=t.indexOf(s);this.changeTextTrackMode(n,"disabled",i),b(this,Zo,n)}}toggleCaptions(i){const e=this.getPlayer(i==null?void 0:i.target);e&&(e.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(i,e){o(this,tt,ot).call(this,"media-user-loop-change-request",e,i)}},Sa=new WeakMap,Vi=new WeakMap,Zo=new WeakMap,ch=new WeakMap,tt=new WeakSet,ot=function(i,e,t){var a,l;const s=new Ke(i,{bubbles:!0,composed:!0,cancelable:!0,detail:t,trigger:e});let n=(e==null?void 0:e.target)||null;n&&n instanceof Ne&&(n=n.el),n=!n||n===document||n===window||n===document.body||(a=r(this,Vi))!=null&&a.el&&n instanceof Node&&!r(this,Vi).el.contains(n)?r(this,Sa)??((l=this.getPlayer())==null?void 0:l.el):n??r(this,Sa),r(this,Vi)?i==="media-play-request"&&!r(this,Vi).state.canLoad?n==null||n.dispatchEvent(s):r(this,Vi).canPlayQueue.enqueue(i,()=>n==null?void 0:n.dispatchEvent(s)):n==null||n.dispatchEvent(s)},TE=function(i){},X2),$t,J2,kE=(J2=class{constructor(){O(this,"playerId","vds-player");O(this,"mediaId",null);g(this,$t,{volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null});O(this,"saveTimeThrottled",Jr(this.saveTime.bind(this),1e3))}async getVolume(){return r(this,$t).volume}async setVolume(i){r(this,$t).volume=i,this.save()}async getMuted(){return r(this,$t).muted}async setMuted(i){r(this,$t).muted=i,this.save()}async getTime(){return r(this,$t).time}async setTime(i,e){const t=i<0;r(this,$t).time=t?null:i,t||e?this.saveTime():this.saveTimeThrottled()}async getLang(){return r(this,$t).lang}async setLang(i){r(this,$t).lang=i,this.save()}async getCaptions(){return r(this,$t).captions}async setCaptions(i){r(this,$t).captions=i,this.save()}async getPlaybackRate(){return r(this,$t).rate}async setPlaybackRate(i){r(this,$t).rate=i,this.save()}async getAudioGain(){return r(this,$t).audioGain}async setAudioGain(i){r(this,$t).audioGain=i,this.save()}async getVideoQuality(){return r(this,$t).quality}async setVideoQuality(i){r(this,$t).quality=i,this.save()}onChange(i,e,t="vds-player"){const s=t?localStorage.getItem(t):null,n=e?localStorage.getItem(e):null;this.playerId=t,this.mediaId=e,b(this,$t,{volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...s?JSON.parse(s):{},time:n?+n:null})}save(){if(se||!this.playerId)return;const i=JSON.stringify({...r(this,$t),time:void 0});localStorage.setItem(this.playerId,i)}saveTime(){if(se||!this.mediaId)return;const i=(r(this,$t).time??0).toString();localStorage.setItem(this.mediaId,i)}},$t=new WeakMap,J2),e6,My=class extends Nm{constructor(){super(...arguments);O(this,"items",[]);O(this,e6,!1)}get length(){return this.items.length}get readonly(){return this[Le.readonly]}indexOf(e){return this.items.indexOf(e)}getById(e){return e===""?null:this.items.find(t=>t.id===e)??null}toArray(){return[...this.items]}[(e6=Le.readonly,Symbol.iterator)](){return this.items.values()}[Le.add](e,t){const s=this.items.length;""+s in this||Object.defineProperty(this,s,{get(){return this.items[s]}}),!this.items.includes(e)&&(this.items.push(e),this.dispatchEvent(new Ke("add",{detail:e,trigger:t})))}[Le.remove](e,t){var n;const s=this.items.indexOf(e);s>=0&&((n=this[Le.onRemove])==null||n.call(this,e,t),this.items.splice(s,1),this.dispatchEvent(new Ke("remove",{detail:e,trigger:t})))}[Le.reset](e){var t;for(const s of[...this.items])this[Le.remove](s,e);this.items=[],this[Le.setReadonly](!1,e),(t=this[Le.onReset])==null||t.call(this)}[Le.setReadonly](e,t){this[Le.readonly]!==e&&(this[Le.readonly]=e,this.dispatchEvent(new Ke("readonly-change",{detail:e,trigger:t})))}};const lc=Symbol(0);var Ry=class extends My{get selected(){return this.items.find(i=>i.selected)??null}get selectedIndex(){return this.items.findIndex(i=>i.selected)}[Le.onRemove](i,e){this[Le.select](i,!1,e)}[Le.add](i,e){i[lc]=!1,Object.defineProperty(i,"selected",{get(){return this[lc]},set:t=>{var s;
8this.readonly||((s=this[Le.onUserSelect])==null||s.call(this),this[Le.select](i,t))}}),super[Le.add](i,e)}[Le.select](i,e,t){if(e===(i==null?void 0:i[lc]))return;const s=this.selected;i&&(i[lc]=e),(e?s!==i:s===i)&&(s&&(s[lc]=!1),this.dispatchEvent(new Ke("change",{detail:{prev:s,current:this.selected},trigger:t})))}},$E=class extends Ry{};function t2(i,e){const t=e.composedPath()[0];return Sg(t)&&i.contains(t)}const Ef=new Set;if(!se){let i=function(){for(const e of Ef)try{e()}catch{}window.requestAnimationFrame(i)};i()}function PE(i){return Ef.add(i),()=>Ef.delete(i)}function rt(i,e,t){i.hasAttribute(e)||i.setAttribute(e,t)}function ea(i,e){if(i.hasAttribute("aria-label")||i.hasAttribute("data-no-label"))return;if(!Hi(e)){we(i,"aria-label",e);return}function t(){we(i,"aria-label",e())}se?t():I(t)}function Ay(i){const e=getComputedStyle(i);return e.display!=="none"&&parseInt(e.opacity)>0}function ME(i){return!!i&&("checkVisibility"in i?i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):Ay(i))}function Iy(i,e){return PE(()=>e(ME(i)))}function _y(i,e,t){for(;e;){if(e===i)return!0;if(t!=null&&t(e))break;e=e.parentElement}return!1}function zr(i,e){return new Xe(i).add("pointerup",t=>{t.button===0&&!t.defaultPrevented&&e(t)}).add("keydown",t=>{Rh(t)&&e(t)})}function Xd(i){return Mo(i)&&(i.touches.length>1||i.changedTouches.length>1)}function Dy(i){if(se)return i();let e=_u(),t=window.requestAnimationFrame(()=>{Wt(i,e),t=-1});return()=>void window.cancelAnimationFrame(t)}function Ly(i,e,t,{offsetVarName:s,xOffset:n,yOffset:a,...l}){if(!i)return;const u=t.replace(" ","-").replace("-center","");if(Ii(i,"visibility",e?null:"hidden"),!e)return;let d=t.includes("top");const h=f=>t.includes("left")?`calc(-1 * ${f})`:f,p=f=>d?`calc(-1 * ${f})`:f;return vw(e,i,()=>{Cw(e,i,{placement:u,middleware:[...l.middleware??[],Sw({fallbackAxisSideDirection:"start",crossAxis:!1}),ww()],...l}).then(({x:f,y,middlewareData:v})=>{var S;const C=!!((S=v.flip)!=null&&S.index);d=t.includes(C?"bottom":"top"),i.setAttribute("data-placement",C?t.startsWith("top")?t.replace("top","bottom"):t.replace("bottom","top"):t),Object.assign(i.style,{top:`calc(${y+"px"} + ${p(a?a+"px":`var(--${s}-y-offset, 0px)`)})`,left:`calc(${f+"px"} + ${h(n?n+"px":`var(--${s}-x-offset, 0px)`)})`})})})}function RE(i){return getComputedStyle(i).animationName!=="none"}function Jd(i){return i instanceof HTMLElement}var Gc,pn,zc,hr,is,Ny,Oy,Tf,kf,t6,AE=(t6=class{constructor(){g(this,is);O(this,"priority",0);g(this,Gc,!0);g(this,pn,null);g(this,zc,null);g(this,hr,new Set)}canRender(i,e){return!!e}attach(i){b(this,pn,i),i&&(i.textTracks.onchange=o(this,is,kf).bind(this))}addTrack(i){r(this,hr).add(i),o(this,is,Ny).call(this,i)}removeTrack(i){var e,t;(t=(e=i[ke.native])==null?void 0:e.remove)==null||t.call(e),i[ke.native]=null,r(this,hr).delete(i)}changeTrack(i){const e=i==null?void 0:i[ke.native];e&&e.track.mode!=="showing"&&(e.track.mode="showing"),b(this,zc,i)}setDisplay(i){b(this,Gc,i),o(this,is,kf).call(this)}detach(){r(this,pn)&&(r(this,pn).textTracks.onchange=null);for(const i of r(this,hr))this.removeTrack(i);r(this,hr).clear(),b(this,pn,null),b(this,zc,null)}},Gc=new WeakMap,pn=new WeakMap,zc=new WeakMap,hr=new WeakMap,is=new WeakSet,Ny=function(i){var t;if(!r(this,pn))return;const e=i[t=ke.native]??(i[t]=o(this,is,Oy).call(this,i));Jd(e)&&(r(this,pn).append(e),e.track.mode=e.default?"showing":"disabled")},Oy=function(i){const e=document.createElement("track"),t=i.default||i.mode==="showing",s=i.src&&i.type==="vtt";return e.id=i.id,e.src=s?i.src:"",e.label=i.label,e.kind=i.kind,e.default=t,i.language&&(e.srclang=i.language),t&&!s&&o(this,is,Tf).call(this,i,e.track),e},Tf=function(i,e){var t;if(!(i.src&&i.type==="vtt"||(t=e.cues)!=null&&t.length))for(const s of i.cues)e.addCue(s)},kf=function(i){for(const e of r(this,hr)){const t=e[ke.native];if(!t)continue;if(!r(this,Gc)){t.track.mode=t.managed?"hidden":"disabled";continue}const s=t.track.mode==="showing";s&&o(this,is,Tf).call(this,e,t.track),e.setMode(s?"showing":"disabled",i)}},t6),wa,Yo,xa,Uc,Kc,Bi,Ms,Rt,Vy,$f,By,qy,Fy,$o,Wy,i6,IE=(i6=class{constructor(i){g(this,Rt);g(this,wa,null);g(this,Yo);g(this,xa,[]);g(this,Uc);g(this,Kc,!1);g(this,Bi,null);g(this,Ms,null);b(this,Uc,i);const e=i.textTracks;b(this,Yo,e),I(o(this,Rt,Vy).bind(this)),_e(o(this,Rt,Wy).bind(this)),new Xe(e).add("add",o(this,Rt,qy).bind(this)).add("remove",o(this,Rt,Fy).bind(this)).add("mode-change",o(this,Rt,$o).bind(this))}add(i){r(this,xa).push(i),Bl(o(this,Rt,$o).bind(this))}remove(i){i.detach(),r(this,xa).splice(r(this,xa).indexOf(i),1),Bl(o(this,Rt,$o).bind(this))}attachVideo(i){requestAnimationFrame(()=>{if(b(this,wa,i),i){b(this,Bi,new AE),r(this,Bi).attach(i);for(const e of r(this,Yo))o(this,Rt,$f).call(this,e)}o(this,Rt,$o).call(this)})}},wa=new WeakMap,Yo=new WeakMap,xa=new WeakMap,Uc=new WeakMap,Kc=new WeakMap,Bi=new WeakMap,Ms=new WeakMap,Rt=new WeakSet,Vy=function(){const{nativeControls:i}=r(this,Uc).$state;b(this,Kc,i()),o(this,Rt,$o).call(this)},$f=function(i){var e;pi(i)&&((e=r(this,Bi))==null||e.addTrack(i))},By=function(i){var e;pi(i)&&((e=r(this,Bi))==null||e.removeTrack(i))},qy=function(i){o(this,Rt,$f).call(this,i.detail)},Fy=function(i){o(this,Rt,By).call(this,i.detail)},$o=function(){var t,s,n,a,l,u,d;const i=r(this,Yo).selected;if(r(this,wa)&&(r(this,Kc)||i!=null&&i[ke.nativeHLS])){(t=r(this,Ms))==null||t.changeTrack(null),(s=r
8(this,Bi))==null||s.setDisplay(!0),(n=r(this,Bi))==null||n.changeTrack(i);return}if((a=r(this,Bi))==null||a.setDisplay(!1),(l=r(this,Bi))==null||l.changeTrack(null),!i){(u=r(this,Ms))==null||u.changeTrack(null);return}const e=r(this,xa).sort((h,p)=>h.priority-p.priority).find(h=>h.canRender(i,r(this,wa)));r(this,Ms)!==e&&((d=r(this,Ms))==null||d.detach(),e==null||e.attach(r(this,wa)),b(this,Ms,e??null)),e==null||e.changeTrack(i)},Wy=function(){var i,e;(i=r(this,Bi))==null||i.detach(),b(this,Bi,null),(e=r(this,Ms))==null||e.detach(),b(this,Ms,null)},i6),s6,Ea,Rs,As,Is,Qc,Xo,Zc,Ks,Hy,Pf,Mf,n6,_E=(n6=class extends My{constructor(){super();g(this,Ks);g(this,Ea,!1);g(this,Rs,{});g(this,As,null);g(this,Is,null);O(this,s6);g(this,Qc,Ih(async()=>{var t;if(!r(this,Ea))return;!r(this,Is)&&r(this,As)&&b(this,Is,await r(this,As).getLang());const e=await((t=r(this,As))==null?void 0:t.getCaptions());for(const s of[["captions","subtitles"],"chapters","descriptions","metadata"]){const n=this.getByKind(s);if(n.find(h=>h.mode==="showing"))continue;const a=r(this,Is)?n.find(h=>h.language===r(this,Is)):null,l=wt(s)?r(this,Rs)[s.find(h=>r(this,Rs)[h])||""]:r(this,Rs)[s],u=a??l,d=u&&pi(u);u&&(!d||e!==!1)&&(u.mode="showing",d&&o(this,Ks,Pf).call(this,u))}},300));g(this,Xo,null);g(this,Zc,o(this,Ks,Hy).bind(this))}get selected(){return this.items.find(e=>e.mode==="showing"&&pi(e))??null}get selectedIndex(){const e=this.selected;return e?this.indexOf(e):-1}get preferredLang(){return r(this,Is)}set preferredLang(e){b(this,Is,e),o(this,Ks,Mf).call(this,e)}add(e,t){const s=e instanceof lo?e:new lo(e),n=e.kind==="captions"||e.kind==="subtitles"?"captions":e.kind;return r(this,Rs)[n]&&e.default&&delete e.default,s.addEventListener("mode-change",r(this,Zc)),this[Le.add](s,t),s[ke.crossOrigin]=this[ke.crossOrigin],r(this,Ea)&&s[ke.canLoad](),e.default&&(r(this,Rs)[n]=s),r(this,Qc).call(this),this}remove(e,t){if(b(this,Xo,e),!!this.items.includes(e))return e===r(this,Rs)[e.kind]&&delete r(this,Rs)[e.kind],e.mode="disabled",e[ke.onModeChange]=null,e.removeEventListener("mode-change",r(this,Zc)),this[Le.remove](e,t),b(this,Xo,null),this}clear(e){for(const t of[...this.items])this.remove(t,e);return this}getByKind(e){const t=Array.isArray(e)?e:[e];return this.items.filter(s=>t.includes(s.kind))}[(s6=ke.crossOrigin,ke.canLoad)](){if(!r(this,Ea)){for(const e of this.items)e[ke.canLoad]();b(this,Ea,!0),r(this,Qc).call(this)}}setStorage(e){b(this,As,e)}},Ea=new WeakMap,Rs=new WeakMap,As=new WeakMap,Is=new WeakMap,Qc=new WeakMap,Xo=new WeakMap,Zc=new WeakMap,Ks=new WeakSet,Hy=function(e){const t=e.detail;if(r(this,As)&&pi(t)&&t!==r(this,Xo)&&o(this,Ks,Pf).call(this,t),t.mode==="showing"){const s=pi(t)?["captions","subtitles"]:[t.kind];for(const n of this.items)n.mode==="showing"&&n!=t&&s.includes(n.kind)&&(n.mode="disabled")}this.dispatchEvent(new Ke("mode-change",{detail:e.detail,trigger:e}))},Pf=function(e){var t,s;e.mode!=="disabled"&&o(this,Ks,Mf).call(this,e.language),(s=(t=r(this,As))==null?void 0:t.setCaptions)==null||s.call(t,e.mode==="showing")},Mf=function(e){var t,s;(s=(t=r(this,As))==null?void 0:t.setLang)==null||s.call(t,b(this,Is,e))},n6),r6,Ta,a6,DE=(a6=class extends Ry{constructor(){super(...arguments);g(this,Ta,!1);O(this,"switch","current");O(this,r6)}get auto(){return r(this,Ta)||this.readonly}[(r6=Mi.enableAuto,Le.onUserSelect)](){this[Mi.setAuto](!1)}[Le.onReset](e){this[Mi.enableAuto]=void 0,this[Mi.setAuto](!1,e)}autoSelect(e){var t;this.readonly||r(this,Ta)||!this[Mi.enableAuto]||((t=this[Mi.enableAuto])==null||t.call(this,e),this[Mi.setAuto](!0,e))}getBySrc(e){return this.items.find(t=>t.src===e)}[Mi.setAuto](e,t){r(this,Ta)!==e&&(b(this,Ta,e),this.dispatchEvent(new Ke("auto-change",{detail:e,trigger:t})))}},Ta=new WeakMap,a6);function jy(i,e){return[...i].sort(e?NE:LE)}function LE(i,e){return i.height===e.height?(i.bitrate??0)-(e.bitrate??0):i.height-e.height}function NE(i,e){return e.height===i.height?(e.bitrate??0)-(i.bitrate??0):e.height-i.height}function OE(i){return(i==null?void 0:i.$$PROVIDER_TYPE)==="HLS"}function VE(i){return!se&&i instanceof HTMLAudioElement}function BE(i){return!se&&i instanceof HTMLVideoElement}function qE(i){return VE(i)||BE(i)}var vo=class extends zi{};const FE={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:"<"},dc=new Set(["Shift","Alt","Meta","Ctrl"]),WE='button, [role="button"]',i2='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';var Xt,It,Gy,zy,Uy,Ky,Td,ka,Qy,fn,Rf,Zy,o6,HE=(o6=class extends vo{constructor(e){super();g(this,It);g(this,Xt);g(this,ka);g(this,fn,null);b(this,Xt,e)}onConnect(){I(o(this,It,Gy).bind(this))}},Xt=new WeakMap,It=new WeakSet,Gy=function(){const{keyDisabled:e,keyTarget:t}=this.$props;if(e())return;const s=t()==="player"?this.el:document,n=de(!1);s===this.el?new Xe(this.el).add("focusin",()=>n.set(!0)).add("focusout",a=>{this.el.contains(a.target)||n.set(!1)}):(Y(n)||n.set(document.querySelector("[data-media-player]")===this.el),pt(document,"focusin",a=>{const l=a.composedPath().find(u=>u instanceof Element&&u.localName==="media-player");l!==void 0&&n.set(this.el===l)})),I(()=>{n()&&new Xe(s).add("keyup",o(this,It,zy).bind(this)).add("keydown",o(this,It,Uy).bind(this)).add("keydown",o(this,It,Ky).bind(this),{capture:!0})})},zy=function(e){var a,l,u;const t=document.activeElement;
8if(!e.key||!this.$state.canSeek()||t!=null&&t.matches(i2))return;let{method:s,value:n}=o(this,It,Td).call(this,e);if(!le(n)&&!wt(n)){(a=n==null?void 0:n.onKeyUp)==null||a.call(n,{event:e,player:r(this,Xt).player,remote:r(this,Xt).remote}),(l=n==null?void 0:n.callback)==null||l.call(n,e,r(this,Xt).remote);return}s!=null&&s.startsWith("seek")&&(e.preventDefault(),e.stopPropagation(),r(this,fn)?(o(this,It,Rf).call(this,e,s==="seekForward"),b(this,fn,null)):(r(this,Xt).remote.seek(r(this,ka),e),b(this,ka,void 0))),s!=null&&s.startsWith("volume")&&((u=this.el.querySelector("[data-media-volume-slider]"))==null||u.dispatchEvent(new KeyboardEvent("keyup",{key:s==="volumeUp"?"Up":"Down",shiftKey:e.shiftKey,trigger:e})))},Uy=function(e){var l,u,d,h;if(!e.key||dc.has(e.key))return;const t=document.activeElement;if(t!=null&&t.matches(i2)||Rh(e)&&(t!=null&&t.matches(WE)))return;let{method:s,value:n}=o(this,It,Td).call(this,e),a=!e.metaKey&&/^[0-9]$/.test(e.key);if(!le(n)&&!wt(n)&&!a){(l=n==null?void 0:n.onKeyDown)==null||l.call(n,{event:e,player:r(this,Xt).player,remote:r(this,Xt).remote}),(u=n==null?void 0:n.callback)==null||u.call(n,e,r(this,Xt).remote);return}if(!s&&a&&!zE(e)){e.preventDefault(),e.stopPropagation(),r(this,Xt).remote.seek(this.$state.duration()/10*Number(e.key),e);return}if(s){switch(e.preventDefault(),e.stopPropagation(),s){case"seekForward":case"seekBackward":o(this,It,Zy).call(this,e,s,s==="seekForward");break;case"volumeUp":case"volumeDown":const p=this.el.querySelector("[data-media-volume-slider]");if(p)p.dispatchEvent(new KeyboardEvent("keydown",{key:s==="volumeUp"?"Up":"Down",shiftKey:e.shiftKey,trigger:e}));else{const y=e.shiftKey?.1:.05;r(this,Xt).remote.changeVolume(this.$state.volume()+(s==="volumeUp"?+y:-y),e)}break;case"toggleFullscreen":r(this,Xt).remote.toggleFullscreen("prefer-media",e);break;case"speedUp":case"slowDown":const f=this.$state.playbackRate();r(this,Xt).remote.changePlaybackRate(Math.max(.25,Math.min(2,f+(s==="speedUp"?.25:-.25))),e);break;default:(h=(d=r(this,Xt).remote)[s])==null||h.call(d,e)}this.$state.lastKeyboardAction.set({action:s,event:e})}},Ky=function(e){qE(e.target)&&o(this,It,Td).call(this,e).method&&e.preventDefault()},Td=function(e){const t={...this.$props.keyShortcuts(),...r(this,Xt).ariaKeys},s=Object.keys(t).find(n=>{var u,d;const a=t[n],l=wt(a)?a.join(" "):le(a)?a:a==null?void 0:a.keys;return(d=(u=wt(l)?l:l==null?void 0:l.split(" "))==null?void 0:u.map(h=>GE(h).replace(/Control/g,"Ctrl").split("+")))==null?void 0:d.some(h=>{const p=new Set(h.filter(f=>dc.has(f)));"<>".includes(e.key)&&p.add("Shift");for(const f of dc){const y=f.toLowerCase()+"Key";if(!p.has(f)&&e[y])return!1}return h.every(f=>dc.has(f)?e[f.toLowerCase()+"Key"]:e.key===f.replace("Space"," "))})});return{method:s,value:s?t[s]:null}},ka=new WeakMap,Qy=function(e,t){const s=e.shiftKey?10:5;return b(this,ka,Math.max(0,Math.min((r(this,ka)??this.$state.currentTime())+(t==="seekForward"?+s:-s),this.$state.duration())))},fn=new WeakMap,Rf=function(e,t){var s;(s=r(this,fn))==null||s.dispatchEvent(new KeyboardEvent(e.type,{key:t?"Right":"Left",shiftKey:e.shiftKey,trigger:e}))},Zy=function(e,t,s){this.$state.canSeek()&&(r(this,fn)||b(this,fn,this.el.querySelector("[data-media-time-slider]")),r(this,fn)?o(this,It,Rf).call(this,e,s):r(this,Xt).remote.seeking(o(this,It,Qy).call(this,e,t),e))},o6);const jE=["!","@","#","$","%","^","&","*","(",")"];function GE(i){return i.replace(/Shift\+(\d)/g,(e,t)=>jE[t-1])}function zE(i){for(const e of dc)if(i[e.toLowerCase()+"Key"])return!0;return!1}var $a,l6,UE=(l6=class extends zi{constructor(e){super();g(this,$a);b(this,$a,e)}onAttach(e){const{$props:t,ariaKeys:s}=ut(),n=e.getAttribute("aria-keyshortcuts");if(n){s[r(this,$a)]=n,se||_e(()=>{delete s[r(this,$a)]});return}const a=t.keyShortcuts()[r(this,$a)];if(a){const l=wt(a)?a.join(" "):le(a)?a:a==null?void 0:a.keys;e.setAttribute("aria-keyshortcuts",wt(l)?l.join(" "):l)}}},$a=new WeakMap,l6),Jo,mn,Yc,el,pr,tl,it,Yy,Xy,Jy,eb,tb,ib,sb,nb,kd,Af,hc,If,c6,KE=(c6=class extends vo{constructor(){super(...arguments);g(this,it);g(this,Jo,-2);g(this,mn,!1);g(this,Yc,de(!1));g(this,el,de(!1));g(this,pr,null);g(this,tl,de(!0));O(this,"defaultDelay",2e3)}get canIdle(){return r(this,tl).call(this)}set canIdle(e){r(this,tl).set(e)}get hideOnMouseLeave(){const{hideControlsOnMouseLeave:e}=this.$props;return r(this,Yc).call(this)||e()}set hideOnMouseLeave(e){r(this,Yc).set(e)}get showing(){return this.$state.controlsVisible()}show(e=0,t){o(this,it,kd).call(this),r(this,mn)||o(this,it,hc).call(this,!0,e,t)}hide(e=this.defaultDelay,t){o(this,it,kd).call(this),r(this,mn)||o(this,it,hc).call(this,!1,e,t)}pause(e){b(this,mn,!0),o(this,it,kd).call(this),o(this,it,hc).call(this,!0,0,e)}resume(e){b(this,mn,!1),!this.$state.paused()&&o(this,it,hc).call(this,!1,this.defaultDelay,e)}onConnect(){I(o(this,it,Yy).bind(this))}},Jo=new WeakMap,mn=new WeakMap,Yc=new WeakMap,el=new WeakMap,pr=ne
8w WeakMap,tl=new WeakMap,it=new WeakSet,Yy=function(){const{viewType:e}=this.$state;if(!this.el||!r(this,tl).call(this))return;if(e()==="audio"){this.show();return}I(o(this,it,Xy).bind(this)),I(o(this,it,Jy).bind(this));const t=o(this,it,eb).bind(this),s=o(this,it,tb).bind(this),n=o(this,it,ib).bind(this);new Xe(this.el).add("can-play",a=>this.show(0,a)).add("play",t).add("pause",s).add("end",n).add("auto-play-fail",s)},Xy=function(){if(!this.el)return;const{started:e,pointer:t,paused:s}=this.$state;if(!e()||t()!=="fine")return;const n=new Xe(this.el),a=this.hideOnMouseLeave;(!a||!r(this,el).call(this))&&I(()=>{s()||n.add("pointermove",o(this,it,Af).bind(this))}),a&&n.add("mouseenter",o(this,it,sb).bind(this)).add("mouseleave",o(this,it,nb).bind(this))},Jy=function(){const{paused:e,started:t,autoPlayError:s}=this.$state;if(e()||s()&&!t())return;const n=o(this,it,Af).bind(this);I(()=>{if(!this.el)return;const a=this.$state.pointer()==="coarse",l=new Xe(this.el),u=[a?"touchend":"pointerup","keydown"];for(const d of u)l.add(d,n,{passive:!1})})},eb=function(e){e.triggers.hasType("ended")||(this.show(0,e),this.hide(void 0,e))},tb=function(e){this.show(0,e)},ib=function(e){const{loop:t}=this.$state;t()&&this.hide(0,e)},sb=function(e){r(this,el).set(!1),this.show(0,e),this.hide(void 0,e)},nb=function(e){r(this,el).set(!0),this.hide(0,e)},kd=function(){window.clearTimeout(r(this,Jo)),b(this,Jo,-1)},Af=function(e){var t;e.MEDIA_GESTURE||r(this,mn)||Xd(e)||(Lu(e)&&(e.key==="Escape"?((t=this.el)==null||t.focus(),b(this,pr,null)):r(this,pr)&&(e.preventDefault(),requestAnimationFrame(()=>{var s;(s=r(this,pr))==null||s.focus(),b(this,pr,null)}))),this.show(0,e),this.hide(this.defaultDelay,e))},hc=function(e,t,s){if(t===0){o(this,it,If).call(this,e,s);return}b(this,Jo,window.setTimeout(()=>{this.scope&&o(this,it,If).call(this,e&&!r(this,mn),s)},t))},If=function(e,t){var s;this.$state.controlsVisible()!==e&&(this.$state.controlsVisible.set(e),!e&&document.activeElement&&((s=this.el)!=null&&s.contains(document.activeElement))&&(b(this,pr,document.activeElement),requestAnimationFrame(()=>{var n;(n=this.el)==null||n.focus({preventScroll:!0})}
8)),this.dispatch("controls-change",{detail:e,trigger:t}))},c6);const _f=jr.fullscreenEnabled;var fr,il,Kr,rb,ab,ob,u6,QE=(u6=class extends zi{constructor(){super(...arguments);g(this,Kr);g(this,fr,!1);g(this,il,!1)}get active(){return r(this,il)}get supported(){return _f}onConnect(){new Xe(jr).add("fullscreenchange",o(this,Kr,ab).bind(this)).add("fullscreenerror",o(this,Kr,ob).bind(this)),_e(o(this,Kr,rb).bind(this))}async enter(){try{return b(this,fr,!0),!this.el||lp(this.el)?void 0:(s2(),jr.requestFullscreen(this.el))}catch(e){throw b(this,fr,!1),e}}async exit(){if(!(!this.el||!lp(this.el)))return s2(),jr.exitFullscreen()}},fr=new WeakMap,il=new WeakMap,Kr=new WeakSet,rb=function(){_f&&this.exit().catch(Ln)},ab=function(e){const t=lp(this.el);t!==r(this,il)&&(t||b(this,fr,!1),b(this,il,t),this.dispatch("fullscreen-change",{detail:t,trigger:e}))},ob=function(e){r(this,fr)&&(this.dispatch("fullscreen-error",{detail:null,trigger:e}),b(this,fr,!1))},u6);function lp(i){if(jr.fullscreenElement===i)return!0;try{return i.matches(jr.fullscreenPseudoClass)}catch{return!1}}function s2(){if(!_f)throw Error("[vidstack] no fullscreen API")}var mr,gn,Pa,Ma,ji,cb,Df,Lf,Nf,lb=(Ma=class extends zi{constructor(){super(...arguments);g(this,ji);g(this,mr,de(o(this,ji,Nf).call(this)));g(this,gn,de(!1));g(this,Pa)}get type(){return r(this,mr).call(this)}get locked(){return r(this,gn).call(this)}get portrait(){return r(this,mr).call(this).startsWith("portrait")}get landscape(){return r(this,mr).call(this).startsWith("landscape")}get supported(){return Ma.supported}onConnect(){if(this.supported)pt(screen.orientation,"change",o(this,ji,Df).bind(this));else{const t=window.matchMedia("(orientation: landscape)");t.onchange=o(this,ji,Df).bind(this),_e(()=>t.onchange=null)}_e(o(this,ji,cb).bind(this))}async lock(t){Y(r(this,gn))||r(this,Pa)===t||(o(this,ji,Lf).call(this),await screen.orientation.lock(t),r(this,gn).set(!0),b(this,Pa,t))}async unlock(){Y(r(this,gn))&&(o(this,ji,Lf).call(this),b(this,Pa,void 0),await screen.orientation.unlock(),r(this,gn).set(!1))}},mr=new WeakMap,gn=new WeakMap,Pa=new WeakMap,ji=new WeakSet,cb=async function(){this.supported&&r(this,gn).call(this)&&await this.unlock()},Df=function(t){r(this,mr).set(o(this,ji,Nf).call(this)),this.dispatch("orientation-change",{detail:{orientation:Y(r(this,mr)),lock:r(this,Pa)},trigger:t})},Lf=function(){if(!this.supported)throw Error("[vidstack] no orientation API")},Nf=function(){return se?"portrait-primary":this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"},O(Ma,"supported",Wm()),Ma),ZE=class{constructor(){O(this,"name","audio");O(this,"target")}canPlay(i){return Lh(i)?se||!le(i.src)||i.type==="?"||Hm(this.target,i.type):!1}mediaType(){return"audio"}async load(i){if(se)throw Error("[vidstack] can not load audio provider server-side");return new(await mi(()=>import("./vidstack-CHcsWfRV-DrSeEYWp.js"),__vite__mapDeps([3,4,2,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]))).AudioProvider(this.target,i)}},Jm=class{constructor(){O(this,"name","video");O(this,"target")}canPlay(i){return Nh(i)?se||!le(i.src)||i.type==="?"||jm(this.target,i.type):!1}mediaType(){return"video"}async load(i){if(se)throw Error("[vidstack] can not load video provider server-side");return new(await mi(()=>Promise.resolve().then(()=>ky),void 0).then(e=>e.provider_exports$1)).VideoProvider(this.target,i)}},Ra,YE=(Ra=class extends Jm{constructor(){super(...arguments);O(this,"name","hls")}canPlay(t){return Ra.supported&&yo(t)}async load(t){if(se)throw Error("[vidstack] can not load hls provider server-side");return new(await mi(()=>import("./vidstack-DiaLSJYx-Dveucb-4.js"),__vite__mapDeps([131,4,2,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]))).HLSProvider(this.target,t)}},O(Ra,"supported",Dh()),Ra),Aa,XE=(Aa=class extends Jm{constructor(){super(...arguments);O(this,"name","dash")}canPlay(t){return Aa.supported&&Ou(t)}async load(t){if(se)throw Error("[vidstack] can not load dash provider server-side");return new(await mi(()=>Promise.resolve().then(()=>ky),void 0).then(s=>
8s.provider_exports)).DASHProvider(this.target,t)}},O(Aa,"supported",Km()),Aa),JE=class{constructor(){O(this,"name","vimeo");O(this,"target")}preconnect(){for(const i of["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"])bo(i)}canPlay(i){return le(i.src)&&i.type==="video/vimeo"}mediaType(){return"video"}async load(i){if(se)throw Error("[vidstack] can not load vimeo provider server-side");return new(await mi(()=>import("./vidstack-GkTzay8D-DLLW-7ZC.js"),__vite__mapDeps([132,133,134,4,2,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]))).VimeoProvider(this.target,i)}async loadPoster(i,e,t){const{resolveVimeoVideoId:s,getVimeoVideoInfo:n}=await mi(async()=>{const{resolveVimeoVideoId:u,getVimeoVideoInfo:d}=await import("./vidstack-C0fPJIzs-hKzX70as.js");return{resolveVimeoVideoId:u,getVimeoVideoInfo:d}},[]);if(!le(i.src))return null;const{videoId:a,hash:l}=s(i.src);return a?n(a,t,l).then(u=>u?u.poster:null):null}},eT=class{constructor(){O(this,"name","youtube");O(this,"target")}preconnect(){for(const i of["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"])bo(i)}canPlay(i){return le(i.src)&&i.type==="video/youtube"}mediaType(){return"video"}async load(i){if(se)throw Error("[vidstack] can not load youtube provider server-side");return new(await mi(()=>import("./vidstack-BmcqUMKx-BY58mQ28.js"),__vite__mapDeps([135,133,136,4,2,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130]))).YouTubeProvider(this.target,i)}async loadPoster(i,e,t){const{findYouTubePoster:s,resolveYouTubeVideoId:n}=await mi(async()=>{const{findYouTubePoster:l,resolveYouTubeVideoId:u}=await import("./vidstack-Dy74GavT-BJvsXdFw.js");return{findYouTubePoster:l,resolveYouTubeVideoId:u}},[]),a=le(i.src)&&n(i.src);return a?s(a,t):null}};function cp(i,e){const t=String(i),s=t.length;if(s<e){const n=e-s;return`${"0".repeat(n)}${i}`}return t}function ub(i){return{hours:Math.trunc(i/3600),minutes:Math.trunc(i%3600/60),seconds:Math.trunc(i%60),fraction:Number((i-Math.trunc(i)).toPrecision(3))}}function Vh(i,{padHrs:e=null,padMins:t=null,showHrs:s=!1,showMs:n=!1}={}){const{hours:a,minutes:l,seconds:u,fraction:d}=ub(i),h=e?cp(a,2):a,p=`${t||vs(t)&&i>=3600?cp(l,2):l}:${cp(u,2)}${n&&d>0?`.${String(d).replace(/^0?\./,"")}`:""}`;return a>0||s?`${h}:${p}`:p}function eh(i){const e=[],{hours:t,minutes:s,seconds:n}=ub(i);return t>0&&e.push(`${t} hour`),s>0&&e.push(`${s} min`),(n>0||e.length===0)&&e.push(`${n} sec`),e.join(" ")}const up=Symbol(0),tT=["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"],iT={artist:"",artwork:null,ariaLabel:"",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:FE,storage:null};var Xc,Ia,d6,n2=(d6=class extends vo{constructor(e,t){super();g(this,Xc);g(this,Ia);b(this,Xc,e),b(this,Ia,t)}async onAttach(e){if(se)return;const t=this.$props[r(this,Xc)]();if(t==="eager")requestAnimationFrame(r(this,Ia));else if(t==="idle")Tg(r(this,Ia));else if(t==="visible"){let s,n=new IntersectionObserver(a=>{this.scope&&a[0].isIntersecting&&(s==null||s(),s=void 0,r(this,Ia).call(this))});n.observe(e),s=_e(()=>n.disconnect())}}},Xc=new WeakMap,Ia=new WeakMap,d6),Jc,us,uh,db,h6,sT=(h6=class{constructor(i,e){g(this,uh);g(this,Jc);g(this,us);b(this,Jc,i),b(this,us,e)}notify(i,...e){se||r(this,Jc).call(this,new Ke(i,{detail:e==null?void 0:e[0],trigger:e==null?void 0:e[1]}))}async ready(i,e){if(!se)return Bl(async()=>{var F,H,N,A,W,V,K;const{logger:t}=r(this,us),{autoPlay:s,canPlay:n,started:a,duration:l,seekable:u,buffered:d,remotePlaybackInfo:h,playsInl
8ine:p,savedState:f,source:y}=r(this,us).$state;if(n())return;const v={duration:(i==null?void 0:i.duration)??l(),seekable:(i==null?void 0:i.seekable)??u(),buffered:(i==null?void 0:i.buffered)??d(),provider:r(this,us).$provider()};this.notify("can-play",v,e),bs();let C=r(this,us).$provider(),{storage:S,qualities:w}=r(this,us),{muted:T,volume:E,clipStartTime:M,playbackRate:x}=r(this,us).$props;await((F=S==null?void 0:S.onLoad)==null?void 0:F.call(S,y()));const P=(H=f())==null?void 0:H.currentTime,R=(N=f())==null?void 0:N.paused,_=await(S==null?void 0:S.getTime()),$=P??_??M(),G=R===!1||R!==!0&&!a()&&s();if(C){C.setVolume(await(S==null?void 0:S.getVolume())??E()),C.setMuted(T()||!!await(S==null?void 0:S.getMuted()));const re=await(S==null?void 0:S.getAudioGain())??1;re>1&&((W=(A=C.audioGain)==null?void 0:A.setGain)==null||W.call(A,re)),(V=C.setPlaybackRate)==null||V.call(C,await(S==null?void 0:S.getPlaybackRate())??x()),(K=C.setPlaysInline)==null||K.call(C,p()),$>0&&C.setCurrentTime($)}const q=await(S==null?void 0:S.getVideoQuality());if(q&&w.length){let re=null,oe=1/0;for(const Z of w){const fe=Math.abs(q.width-Z.width)+Math.abs(q.height-Z.height)+(q.bitrate?Math.abs(q.bitrate-(Z.bitrate??0)):0);fe<oe&&(re=Z,oe=fe)}re&&(re.selected=!0)}n()&&G?await o(this,uh,db).call(this,e):_&&_>0&&this.notify("started",void 0,e),h.set(null)})}},Jc=new WeakMap,us=new WeakMap,uh=new WeakSet,db=async function(i){const{player:e,$state:{autoPlaying:t,muted:s}}=r(this,us);t.set(!0);const n=new Ke("auto-play-attempt",{trigger:i});try{await e.play(n)}catch{}},h6),gr,p6,nT=(p6=class{constructor(){g(this,gr,new Map)}enqueue(i,e){r(this,gr).set(i,e)}serve(i){const e=this.peek(i);return r(this,gr).delete(i),e}peek(i){return r(this,gr).get(i)}delete(i){r(this,gr).delete(i)}clear(){r(this,gr).clear()}},gr=new WeakMap,p6),yr,sl,ds,Qr,Of,Vf,f6,hb=(f6=class{constructor(){g(this,Qr);g(this,yr,!1);g(this,sl,zd());g(this,ds,new Map)}get size(){return r(this,ds).size}get isServing(){return r(this,yr)}async waitForFlush(){r(this,yr)||await r(this,sl).promise}enqueue(i,e){if(r(this,yr)){e();return}r(this,ds).delete(i),r(this,ds).set(i,e)}serve(i){var e;(e=r(this,ds).get(i))==null||e(),r(this,ds).delete(i)}start(){o(this,Qr,Of).call(this),b(this,yr,!0),r(this,ds).size>0&&o(this,Qr,Of).call(this)}stop(){b(this,yr,!1)}reset(){this.stop(),r(this,ds).clear(),o(this,Qr,Vf).call(this)}},yr=new WeakMap,sl=new WeakMap,ds=new WeakMap,Qr=new WeakSet,Of=function(){for(const i of r(this,ds).keys())this.serve(i);o(this,Qr,Vf).call(this)},Vf=function(){r(this,sl).resolve(),b(this,sl,zd())},f6);function rT(i){return i?"true":"false"}function li(i){return()=>rT(i())}function aT(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}var yn,Ae,bn,_a,vn,bt,br,He,pb,fb,mb,Bf,nl,qf,Ff,gb,yb,bb,vb,Cb,Sb,Da,wb,Wf,Hf,lT,m6,oT=(m6=class extends vo{constructor(e,t,s){super();g(this,He);g(this,yn);g(this,Ae);g(this,bn);O(this,"controls");g(this,_a);g(this,vn);g(this,bt);g(this,br,new hb);g(this,nl,!1);g(this,Da);b(this,yn,e),b(this,Ae,t),b(this,bn,s),b(this,bt,s.$provider),this.controls=new KE,b(this,_a,new QE),b(this,vn,new lb)}onAttach(){this.listen("fullscreen-change",o(this,He,wb).bind(this))}onConnect(e){const t=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),s=new Xe(e),n=o(this,He,mb).bind(this);for(const a of t)a.startsWith("media-")&&s.add(a,n);o(this,He,pb).call(this),I(o(this,He,fb).bind(this)),I(o(this,He,gb).bind(this)),I(o(this,He,yb).bind(this)),I(o(this,He,bb).bind(this)),I(o(this,He,vb).bind(this)),I(o(this,He,Cb).bind(this)),I(o(this,He,Sb).bind(this))}onDestroy(){try{const e=this.createEvent("destroy"),{pictureInPicture:t,fullscreen:s}=this.$state;s()&&this.exitFullscreen("prefer-media",e),t()&&this.exitPictureInPicture(e)}catch{}r(this,br).reset()}async play(e){if(se)return;const{canPlay:t,paused:s,autoPlaying:n}=this.$state;if(o(this,He,Bf).call(this,e)||!Y(s))return;e&&r(this,Ae).queue.enqueue("media-play-request",e);const a=Y(n);try{const l=Y(r(this,bt));return dp(l,Y(t)),cT(a),await l.play()}catch(l){const u=this.createEvent("play-fail",{detail:Cc(l),trigger:e});throw u.autoPlay=a,r(this,yn).handle(u),l}}async pause(e){if(se)return;const{canPlay:t,paused:s}=this.$state;if(!Y(s)){e&&r(this,Ae).queue.enqueue("media-pause-request",e);try{const n=Y(r(this,bt));return dp(n,Y(t)),await n.pause()}catch(n){throw r(this,Ae).queue.delete("media-pause-request"),n}}}setAudioGain(e,t){const{audioGain:s,canSetAudioGain:n}=this.$state;if(s()===e)return;const a=r(this,bt).call(this);if(!(a!=null&&a.audioGain)||!n())throw Error("[vidstack] audio gain api not available");t&&r(this,Ae).queue.enqueue("media-audio-gain-change-request",t),a.audioGain.setGain(e)}seekToLiveEdge(e){if(se)return;const{canPlay:t,live:s,liveEdge:n,canSeek:a,liveSyncPosition:l,seekableEnd:u,userBehindLiveEdge:d}=this.$state;if(d.set(!1),Y(()=>!s()||a()&&n()))return;const h=Y(r(this,bt));
8dp(h,Y(t));const p=u()-2,f=Math.min(p,l()??p);Number.isFinite(f)&&(e&&r(this,Ae).queue.enqueue("media-seek-request",e),h.setCurrentTime(f))}async enterFullscreen(e="prefer-media",t){if(se)return;const s=o(this,He,qf).call(this,e);if(r2(e,s),!s.active)return Y(this.$state.pictureInPicture)&&(b(this,nl,!0),await this.exitPictureInPicture(t)),t&&r(this,Ae).queue.enqueue("media-enter-fullscreen-request",t),s.enter()}async exitFullscreen(e="prefer-media",t){if(se)return;const s=o(this,He,qf).call(this,e);if(r2(e,s),!!s.active){t&&r(this,Ae).queue.enqueue("media-exit-fullscreen-request",t);try{const n=await s.exit();return r(this,nl)&&Y(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),n}finally{b(this,nl,!1)}}}async enterPictureInPicture(e){if(!se&&(o(this,He,Ff).call(this),!this.$state.pictureInPicture()))return e&&r(this,Ae).queue.enqueue("media-enter-pip-request",e),await r(this,bt).call(this).pictureInPicture.enter()}async exitPictureInPicture(e){var t;if(!se&&(o(this,He,Ff).call(this),!!this.$state.pictureInPicture())){e&&r(this,Ae).queue.enqueue("media-exit-pip-request",e);try{if(document!=null&&document.pictureInPictureElement&&document.exitPictureInPicture){await document.exitPictureInPicture();return}const s=r(this,bt).call(this);if(s!=null&&s.pictureInPicture){await s.pictureInPicture.exit();return}const n=((t=document==null?void 0:document.querySelectorAll)==null?void 0:t.call(document,"video"))||[];for(const a of n){if(a===document.pictureInPictureElement&&document.exitPictureInPicture){await document.exitPictureInPicture();return}if(a.webkitPresentationMode==="picture-in-picture"){a.webkitSetPresentationMode("inline");return}}}catch{}}}async"media-airplay-request"(e){try{await this.requestAirPlay(e)}catch{}}async requestAirPlay(e){var t;try{const s=(t=r(this,bt).call(this))==null?void 0:t.airPlay;if(!(s!=null&&s.supported))throw Error("No AirPlay adapter.");return e&&r(this,Ae).queue.enqueue("media-airplay-request",e),await s.prompt()}catch(s){throw r(this,Ae).queue.delete("media-airplay-request"),s}}async"media-google-cast-request"(e){try{await this.requestGoogleCast(e)}catch{}}async requestGoogleCast(e){try{const{canGoogleCast:t}=this.$state;if(!Y(t)){const n=Error("Cast not available.");throw n.code="CAST_NOT_AVAILABLE",n}if(bo("https://www.gstatic.com"),!r(this,Da)){const n=await mi(()=>import("./vidstack-Di0HObvT-BY3s8C5g.js").then(a=>a.v),__vite__mapDeps([137,1,2]));b(this,Da,new n.GoogleCastLoader)}await r(this,Da).prompt(r(this,bn)),e&&r(this,Ae).queue.enqueue("media-google-cast-request",e);const s=Y(this.$state.remotePlaybackState)!=="disconnected";s&&this.$state.savedState.set({paused:Y(this.$state.paused),currentTime:Y(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(s?r(this,Da):null)}catch(t){throw r(this,Ae).queue.delete("media-google-cast-request"),t}}"media-clip-start-change-request"(e){const{clipStartTime:t}=this.$state;t.set(e.detail)}"media-clip-end-change-request"(e){const{clipEndTime:t}=this.$state;t.set(e.detail),this.dispatch("duration-change",{detail:e.detail,trigger:e})}"media-duration-change-request"(e){const{providedDuration:t,clipEndTime:s}=this.$state;t.set(e.detail),s()<=0&&this.dispatch("duration-change",{detail:e.detail,trigger:e})}"media-audio-track-change-request"(e){const{logger:t,audioTracks:s}=r(this,bn);if(s.readonly)return;const n=s[e.detail];if(n){const a=e.type;r(this,Ae).queue.enqueue(a,e),n.selected=!0}}async"media-enter-fullscreen-request"(e){try{await this.enterFullscreen(e.detail,e)}catch(t){o(this,He,Wf).call(this,t,e)}}async"media-exit-fullscreen-request"(e){try{await this.exitFullscreen(e.detail,e)}catch(t){o(this,He,Wf).call(this,t,e)}}async"media-orientation-lock-request"(e){const t=e.type;try{r(this,Ae).queue.enqueue(t,e),await r(this,vn).lock(e.detail)}catch{r(this,Ae).queue.delete(t)}}async"media-orientation-unlock-request"(e){const t=e.type;try{r(this,Ae).queue.enqueue(t,e),await r(this,vn).unlock()}catch{r(this,Ae).queue.delete(t)}}async"media-enter-pip-request"(e){try{await this.enterPictureInPicture(e)}catch(t){o(this,He,Hf).call(this,t,e)}}async"media-exit-pip-request"(e){try{await this.exitPictureInPicture(e)}catch(t){o(this,He,Hf).call(this,t,e)}}
8"media-live-edge-request"(e){const{live:t,liveEdge:s,canSeek:n}=this.$state;if(!(!t()||n()&&s()))try{this.seekToLiveEdge(e)}catch{r(this,Ae).queue.delete("media-seek-request")}}async"media-loop-request"(e){try{r(this,Ae).looping=!0,r(this,Ae).replaying=!0,await this.play(e)}catch{r(this,Ae).looping=!1}}"media-user-loop-change-request"(e){this.$state.userPrefersLoop.set(e.detail)}async"media-pause-request"(e){if(!this.$state.paused())try{await this.pause(e)}catch{}}async"media-play-request"(e){if(this.$state.paused())try{await this.play(e)}catch{}}"media-rate-change-request"(e){const{playbackRate:t,canSetPlaybackRate:s}=this.$state;if(t()===e.detail||!s())return;const n=r(this,bt).call(this);n!=null&&n.setPlaybackRate&&(r(this,Ae).queue.enqueue("media-rate-change-request",e),n.setPlaybackRate(e.detail))}"media-audio-gain-change-request"(e){try{this.setAudioGain(e.detail,e)}catch{}}"media-quality-change-request"(e){var l,u;const{qualities:t,storage:s,logger:n}=r(this,bn);if(t.readonly)return;r(this,Ae).queue.enqueue("media-quality-change-request",e);const a=e.detail;if(a<0)t.autoSelect(e),e.isOriginTrusted&&((l=s==null?void 0:s.setVideoQuality)==null||l.call(s,null));else{const d=t[a];d&&(d.selected=!0,e.isOriginTrusted&&((u=s==null?void 0:s.setVideoQuality)==null||u.call(s,{id:d.id,width:d.width,height:d.height,bitrate:d.bitrate})))}}"media-pause-controls-request"(e){const t=e.type;r(this,Ae).queue.enqueue(t,e),this.controls.pause(e)}"media-resume-controls-request"(e){const t=e.type;r(this,Ae).queue.enqueue(t,e),this.controls.resume(e)}"media-seek-request"(e){const{canSeek:t,ended:s,live:n,seekableEnd:a,userBehindLiveEdge:l}=this.$state,u=e.detail;s()&&(r(this,Ae).replaying=!0);const d=e.type;r(this,Ae).seeking=!1,r(this,Ae).queue.delete(d);const h=Py(u,this.$state);!Number.isFinite(h)||!t()||(r(this,Ae).queue.enqueue(d,e),r(this,bt).call(this).setCurrentTime(h),n()&&e.isOriginTrusted&&Math.abs(a()-h)>=2&&l.set(!0))}"media-seeking-request"(e){const t=e.type;r(this,Ae).queue.enqueue(t,e),this.$state.seeking.set(!0),r(this,Ae).seeking=!0}"media-start-loading"(e){if(this.$state.canLoad())return;const t=e.type;r(this,Ae).queue.enqueue(t,e),r(this,yn).handle(this.createEvent("can-load"))}"media-poster-start-loading"(e){if(this.$state.canLoadPoster())return;const t=e.type;r(this,Ae).queue.enqueue(t,e),r(this,yn).handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(e){const{index:t,mode:s}=e.detail,n=r(this,bn).textTracks[t];if(n){const a=e.type;r(this,Ae).queue.enqueue(a,e),n.setMode(s,e)}}"media-mute-request"(e){if(this.$state.muted())return;const t=e.type;r(this,Ae).queue.enqueue(t,e),r(this,bt).call(this).setMuted(!0)}"media-unmute-request"(e){const{muted:t,volume:s}=this.$state;if(!t())return;const n=e.type;r(this,Ae).queue.enqueue(n,e),r(this,bn).$provider().setMuted(!1),s()===0&&(r(this,Ae).queue.enqueue(n,e),r(this,bt).call(this).setVolume(.25))}"media-volume-change-request"(e){const{muted:t,volume:s}=this.$state,n=e.detail;if(s()===n)return;const a=e.type;r(this,Ae).queue.enqueue(a,e),r(this,bt).call(this).setVolume(n),n>0&&t()&&(r(this,Ae).queue.enqueue(a,e),r(this,bt).call(this).setMuted(!1))}},yn=new WeakMap,Ae=new WeakMap,bn=new WeakMap,_a=new WeakMap,vn=new WeakMap,bt=new WeakMap,br=new WeakMap,He=new WeakSet,pb=function(){const{load:e}=this.$props,{canLoad:t}=this.$state;if(e()!=="play"||t())return;const s=this.listen("media-play-request",n=>{o(this,He,Bf).call(this,n),s()})},fb=function(){const e=r(this,bt).call(this),t=this.$state.canPlay();return e&&t&&r(this,br).start(),()=>{r(this,br).stop()}},mb=function(e){e.stopPropagation(),!e.defaultPrevented&&this[e.type]&&(Y(r(this,bt))?this[e.type](e):r(this,br).enqueue(e.type,()=>{Y(r(this,bt))&&this[e.type](e)}))},Bf=function(e){const{load:t}=this.$props,{canLoad:s}=this.$state;if(t()==="play"&&!s()){const n=this.createEvent("media-start-loading",{trigger:e});return this.dispatchEvent(n),r(this,br).enqueue("media-play-request",async()=>{try{await this.play(n)}catch{}}),!0}return!1},nl=new WeakMap,qf=function(e){const t=Y(r(this,bt));return e==="prefer-media"&&r(this,_a).supported||e==="media"?r(this,_a):t==null?void 0:t.fullscreen},Ff=function(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")},gb=function(){this.controls.defaultDelay=this.$props.controlsDelay()},yb=function(){var s,n;const{canSetAudioGain:e}=this.$state,t=!!((n=(s=r(this,bt).call(this))==null?void 0:s.audioGain)!=null&&n.supported);e.set(t)},bb=function(){var s,n;const{canAirPlay:e}=this.$state,t=!!((n=(s=r(this,bt).call(this))==null?void 0:s.airPlay)!=null&&n.supported);e.set(t)},vb=function(){const{canGoogleCast:e,source:t}=this.$state,s=Fm&&!_h&&u0(t());e.set(s)},Cb=function(){var s,n;const{canFullscreen:e}=this.$state,t=r(this,_a).supported||!!((n=(s=r(this,bt).call(this))==null?void 0:s.fullscreen)!=null&&n.supported);e.set(t)},Sb=function(){var s,n;const{canPictureInPicture:e}=this.$state,t=!!((n=(s=r(this,bt).call(this))==null?void 0:s.pictureInPicture)!=null&&n.supported);e.set(t)},Da=new WeakMap,wb=async function(e){const t=Y(this.$props.fullscreenOrientation),s=e.detail;if(!(Ot(t)||t==="none"||!r(this,vn).supported))if(s){if(r(this,vn).locked)return;this.dispatch("media-orientation-lock-request",{detail:t,trigger:e})}else r(this,vn).locked&&this.dispatch("media-orientation-unlock-request",{trigger:e})},Wf=function(e,t){r(this,yn).handle(this.createEvent("fullscreen-error",{detail:Cc(e)}))},Hf=function(e,t){r(this,yn).handle(this.createEvent("picture-in-picture-error",{detail:Cc(e)}))},lT=function(e,t,s){},m6);function dp(i,e){if(!(i&&e))throw Error("[vidstack] media not ready")}function r2(i,e){if(!(e!=null&&e.supported))throw Error("[vidstack] no fullscreen support")}function cT(i){if(!(!aT()||!i))throw Error("[vidstack] autoplay blocked")}var uT=class{constructor(){O(this,"seeking",!1);O(this,"looping",!1);O(this,"replaying",!1);O(this,"queue",new nT)}};const dT=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"]);var gi,Ze,ht,La,rl,Na,Oa,Cn,vr,z,xb,Eb,er,Et,Tb,kb,$b,$d,jf,Gf,Pb,zf,Mb,Rb,al,Uf,Pd,Ab,Ib,_b,Kf,Qf,Zf,Db,Yf,Lb,ol,Nb,Xf,g6,hT=(g6=class extends vo{constructor(e,t){super();g(this,z);g(this,gi);g(this,Ze);g(this,ht,new Map);g(this,La,!1);g(this,rl,[]);g(this,Na,[-1,-1]);g(this,Oa,!1);g(this,Cn);g(this,vr,!1);g(this,al,null);O(this,"seeking",Jr(e=>{const{seeking:t,realCurrentTime:s,paused:n}=this.$state;t.set(!0),s.set(e.detail),o(this,z,Et).call(this,"media-seeking-request",e),n()&&(b(this,Cn,e),r(this,ol).call(this)),b(this,Na,[-1,-1])},150,{leading:!0}));g(this,ol,Ih(()=>
8{if(!r(this,Cn))return;b(this,Oa,!0);const{waiting:e,playing:t}=this.$state;e.set(!0),t.set(!1);const s=this.createEvent("waiting",{trigger:r(this,Cn)});r(this,ht).set("waiting",s),this.dispatch(s),b(this,Cn,void 0),b(this,Oa,!1)},300));b(this,gi,e),b(this,Ze,t)}onAttach(e){e.setAttribute("aria-busy","true"),new Xe(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(e){I(o(this,z,Ib).bind(this)),o(this,z,Tb).call(this),o(this,z,kb).call(this),o(this,z,$b).call(this),o(this,z,xb).call(this),_e(o(this,z,Eb).bind(this))}onDestroy(){const{audioTracks:e,qualities:t,textTracks:s}=r(this,Ze);e[Le.reset](),t[Le.reset](),s[Le.reset](),o(this,z,Pd).call(this)}handle(e){if(!this.scope)return;const t=e.type;Bl(()=>{var s;return(s=this[e.type])==null?void 0:s.call(this,e)}),se||(dT.has(t)&&r(this,ht).set(t,e),this.dispatch(e))}"provider-change"(e){var n,a;const t=r(this,Ze).$provider(),s=e.detail;(t==null?void 0:t.type)!==(s==null?void 0:s.type)&&((n=t==null?void 0:t.destroy)==null||n.call(t),(a=t==null?void 0:t.scope)==null||a.dispose(),r(this,Ze).$provider.set(e.detail),t&&e.detail===null&&o(this,z,Kf).call(this,e))}"provider-loader-change"(e){}"auto-play"(e){this.$state.autoPlayError.set(null)}"auto-play-fail"(e){this.$state.autoPlayError.set(e.detail),o(this,z,er).call(this)}"can-load"(e){this.$state.canLoad.set(!0),r(this,ht).set("can-load",e),r(this,Ze).textTracks[ke.canLoad](),o(this,z,Et).call(this,"media-start-loading",e)}"can-load-poster"(e){this.$state.canLoadPoster.set(!0),r(this,ht).set("can-load-poster",e),o(this,z,Et).call(this,"media-poster-start-loading",e)}"media-type-change"(e){const t=r(this,ht).get("source-change");t&&e.triggers.add(t);const s=this.$state.viewType();this.$state.mediaType.set(e.detail);const n=this.$state.providedViewType(),a=n==="unknown"?e.detail:n;s!==a&&(se?this.$state.inferredViewType.set(a):setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(e.detail),this.dispatch("view-type-change",{detail:a,trigger:e}))})},0))}"stream-type-change"(e){const t=r(this,ht).get("source-change");t&&e.triggers.add(t);const{streamType:s,inferredStreamType:n}=this.$state;n.set(e.detail),e.detail=s()}"rate-change"(e){var n;const{storage:t}=r(this,Ze),{canPlay:s}=this.$state;this.$state.playbackRate.set(e.detail),o(this,z,Et).call(this,"media-rate-change-request",e),s()&&((n=t==null?void 0:t.setPlaybackRate)==null||n.call(t,e.detail))}"remote-playback-change"(e){const{remotePlaybackState:t,remotePlaybackType:s}=this.$state,{type:n,state:a}=e.detail,l=a==="connected";s.set(n),t.set(a);const u=n==="airplay"?"media-airplay-request":"media-google-cast-request";if(l)o(this,z,Et).call(this,u,e);else{const d=r(this,gi).queue.peek(u);d&&(e.request=d,e.triggers.add(d))}}"sources-change"(e){const t=this.$state.sources(),s=e.detail;this.$state.sources.set(s),o(this,z,_b).call(this,t,s,e)}"source-change"(e){var s,n;e.isQualityChange=((s=e.originEvent)==null?void 0:s.type)==="quality-change";const t=e.detail;o(this,z,Kf).call(this,e,e.isQualityChange),r(this,ht).set(e.type,e),this.$state.source.set(t),(n=this.el)==null||n.setAttribute("aria-busy","true")}abort(e){const t=r(this,ht).get("source-change");t&&e.triggers.add(t);const s=r(this,ht).get("can-load");s&&!e.triggers.hasType("can-load")&&e.triggers.add(s)}"load-start"(e){const t=r(this,ht).get("source-change");t&&e.triggers.add(t)}error(e){this.$state.error.set(e.detail);const t=r(this,ht).get("abort");t&&e.triggers.add(t)}"loaded-metadata"(e){const t=r(this,ht).get("load-start");t&&e.triggers.add(t)}"loaded-data"(e){const t=r(this,ht).get("load-start");t&&e.triggers.add(t)}"can-play"(e){var s;const t=r(this,ht).get("loaded-metadata");t&&e.triggers.add(t),o(this,z,Qf).call(this,e.detail),(s=this.el)==null||s.setAttribute("aria-busy","false")}"can-play-through"(e){o(this,z,Qf).call(this,e.detail);const t=r(this,ht).get("can-play");t&&e.triggers.add(t)}"duration-change"(e){const{live:t,intrinsicDuration:s,providedDuration:n,clipEndTime:a,ended:l}=this.$state,u=e.detail;if(!t()){const d=Number.isNaN(u)?0:u;s.set(d),l()&&o(this,z,Yf).call(this,e)}(n()>0||a()>0)&&e.stopImmediatePropagation()}progress(e){const{buffered:t,seekable:s}=this.$state,{buffered:n,seekable:a}=e.detail,l=sr(n),u=n.length!==t().length,d=l!==sr(t()),h=sr(a),p=a.length!==s().length,f=h!==sr(s());(u||d)&&t.set(n),(p||f)&&s.set(a)}play(e){const{paused:t,autoPlayError:s,ended:n,autoPlaying:a,playsInl
8ine:l,pointer:u,muted:d,viewType:h,live:p,userBehindLiveEdge:f}=this.$state;if(o(this,z,Zf).call(this),!t()){e.stopImmediatePropagation();return}e.autoPlay=a();const y=r(this,ht).get("waiting");y&&e.triggers.add(y),o(this,z,Et).call(this,"media-play-request",e),r(this,ht).set("play",e),t.set(!1),s.set(null),e.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:d()},trigger:e})),a.set(!1)),(n()||r(this,gi).replaying)&&(r(this,gi).replaying=!1,n.set(!1),this.handle(this.createEvent("replay",{trigger:e}))),!l()&&h()==="video"&&u()==="coarse"&&r(this,Ze).remote.enterFullscreen("prefer-media",e),p()&&!f()&&r(this,Ze).remote.seekToLiveEdge(e)}"play-fail"(e){const{muted:t,autoPlaying:s}=this.$state,n=r(this,ht).get("play");n&&e.triggers.add(n),o(this,z,Et).call(this,"media-play-request",e);const{paused:a,playing:l}=this.$state;a.set(!0),l.set(!1),o(this,z,er).call(this),r(this,ht).set("play-fail",e),e.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:t(),error:e.detail},trigger:e})),s.set(!1))}playing(e){const t=r(this,ht).get("play"),s=r(this,ht).get("seeked");t?e.triggers.add(t):s&&e.triggers.add(s),setTimeout(()=>o(this,z,er).call(this),0);const{paused:n,playing:a,live:l,liveSyncPosition:u,seekableEnd:d,started:h,currentTime:p,seeking:f,ended:y}=this.$state;if(n.set(!1),a.set(!0),f.set(!1),y.set(!1),r(this,gi).looping){r(this,gi).looping=!1;return}if(l()&&!h()&&p()===0){const v=u()??d()-2;Number.isFinite(v)&&r(this,Ze).$provider().setCurrentTime(v)}this.started(e)}started(e){const{started:t}=this.$state;t()||(t.set(!0),this.handle(this.createEvent("started",{trigger:e})))}pause(e){var a;(a=this.el)!=null&&a.isConnected||b(this,vr,!0),o(this,z,Et).call(this,"media-pause-request",e);const t=r(this,ht).get("seeked");t&&e.triggers.add(t);const{paused:s,playing:n}=this.$state;s.set(!0),n.set(!1),r(this,La)&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:e})),b(this,La,!1)},0),o(this,z,er).call(this)}"time-change"(e){if(r(this,gi).looping){e.stopImmediatePropagation();return}let{waiting:t,played:s,clipEndTime:n,realCurrentTime:a,currentTime:l}=this.$state,u=e.detail,d=n();a.set(u),o(this,z,Db).call(this),t.set(!1);for(const h of r(this,Ze).textTracks)h[ke.updateActiveCues](u,e);d>0&&u>=d&&(b(this,La,!0),this.dispatch("media-pause-request",{trigger:e})),o(this,z,Lb).call(this),this.dispatch("time-update",{detail:{currentTime:l(),played:s()},trigger:e})}"audio-gain-change"(e){var a;const{storage:t}=r(this,Ze),{canPlay:s,audioGain:n}=this.$state;n.set(e.detail),o(this,z,Et).call(this,"media-audio-gain-change-request",e),s()&&((a=t==null?void 0:t.setAudioGain)==null||a.call(t,n()))}"volume-change"(e){var u,d;const{storage:t}=r(this,Ze),{volume:s,muted:n,canPlay:a}=this.$state,l=e.detail;s.set(l.volume),n.set(l.muted||l.volume===0),o(this,z,Et).call(this,"media-volume-change-request",e),o(this,z,Et).call(this,l.muted?"media-mute-request":"media-unmute-request",e),a()&&((u=t==null?void 0:t.setVolume)==null||u.call(t,s()),(d=t==null?void 0:t.setMuted)==null||d.call(t,n()))}seeked(e){const{seeking:t,currentTime:s,realCurrentTime:n,paused:a,seekableEnd:l,ended:u,live:d}=this.$state;if(r(this,gi).seeking)t.set(!0),e.stopImmediatePropagation();else if(t()){const h=r(this,ht).get("waiting");h&&e.triggers.add(h);const p=r(this,ht).get("seeking");p&&!e.triggers.has(p)&&e.triggers.add(p),a()&&o(this,z,Xf).call(this),t.set(!1),n.set(e.detail),o(this,z,Et).call(this,"media-seek-request",e);const f=e==null?void 0:e.originEvent;f!=null&&f.isTrusted&&!(f instanceof MessageEvent)&&!/seek/.test(f.type)&&this.started(e)}d()||(Math.floor(s())!==Math.floor(l())?u.set(!1):this.end(e))}waiting(e){r(this,Oa)||r(this,gi).seeking||(e.stopImmediatePropagation(),b(this,Cn,e),r(this,ol).call(this))}end(e){const{loop:t,ended:s}=this.$state;if(!(!t()&&s())){if(t()){setTimeout(()=>{requestAnimationFrame(()=>{o(this,z,Zf).call(this,e),this.dispatch("media-loop-request",{trigger:e})})},10);return}setTimeout(()=>o(this,z,Nb).call(this,e),0)}}"fullscreen-change"(e){const t=e.detail;this.$state.fullscreen.set(t),o(this,z,Et).call(this,t?"media-enter-fullscreen-request":"media-exit-fullscreen-request",e)}"fullscreen-error"(e){o(this,z,Et).call(this,"media-enter-fullscreen-request",e),o(this,z,Et).call(this,"media-exit-fullscreen-request",e)}"orientation-change"(e){const t=e.detail.lock;o(this,z,Et).call(this,t?"media-orientation-lock-request":"media-orientation-unlock-request",e)}"picture-in-picture-change"(e){const t=e.detail;this.$state.pictureInPicture.set(t),o(this,z,Et).call(this,t?"media-enter-pip-request":"media-exit-pip-request",e)}"picture-in-picture-error"(e){o(this,z,Et).call(this,"media-enter-pip-request",e),o(this,z,Et).call(this,"media-exit-pip-request",e)}"title-change"(e){e.trigger&&(e.stopImmediatePropagation(),this.$state.inferredTitle.set(e.detail))}"poster-change"(e){e.trigger&&(e.stopImmediatePropagation(),this.$state.inferredPoster.set(e.detail))}}
8,gi=new WeakMap,Ze=new WeakMap,ht=new WeakMap,La=new WeakMap,rl=new WeakMap,Na=new WeakMap,Oa=new WeakMap,Cn=new WeakMap,vr=new WeakMap,z=new WeakSet,xb=function(){r(this,vr)&&(requestAnimationFrame(()=>{this.scope&&r(this,Ze).remote.play(new Ke("dom-connect"))}),b(this,vr,!1))},Eb=function(){var e;r(this,vr)||(b(this,vr,!this.$state.paused()),(e=r(this,Ze).$provider())==null||e.pause())},er=function(){o(this,z,Xf).call(this),b(this,La,!1),r(this,gi).replaying=!1,r(this,gi).looping=!1,b(this,Oa,!1),b(this,Cn,void 0),r(this,ht).clear()},Et=function(e,t){const s=r(this,gi).queue.serve(e);s&&(t.request=s,t.triggers.add(s))},Tb=function(){o(this,z,$d).call(this),o(this,z,jf).call(this);const e=r(this,Ze).textTracks;new Xe(e).add("add",o(this,z,$d).bind(this)).add("remove",o(this,z,$d).bind(this)).add("mode-change",o(this,z,jf).bind(this))},kb=function(){const e=r(this,Ze).qualities;new Xe(e).add("add",o(this,z,zf).bind(this)).add("remove",o(this,z,zf).bind(this)).add("change",o(this,z,Mb).bind(this)).add("auto-change",o(this,z,Rb).bind(this)).add("readonly-change",o(this,z,Ab).bind(this))},$b=function(){const e=r(this,Ze).audioTracks;new Xe(e).add("add",o(this,z,Gf).bind(this)).add("remove",o(this,z,Gf).bind(this)).add("change",o(this,z,Pb).bind(this))},$d=function(e){const{textTracks:t}=this.$state;t.set(r(this,Ze).textTracks.toArray()),this.dispatch("text-tracks-change",{detail:t(),trigger:e})},jf=function(e){e&&o(this,z,Et).call(this,"media-text-track-change-request",e);const t=r(this,Ze).textTracks.selected,{textTrack:s}=this.$state;s()!==t&&(s.set(t),this.dispatch("text-track-change",{detail:t,trigger:e}))},Gf=function(e){const{audioTracks:t}=this.$state;t.set(r(this,Ze).audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:t(),trigger:e})},Pb=function(e){const{audioTrack:t}=this.$state;t.set(r(this,Ze).audioTracks.selected),e&&o(this,z,Et).call(this,"media-audio-track-change-request",e),this.dispatch("audio-track-change",{detail:t(),trigger:e})},zf=function(e){const{qualities:t}=this.$state;t.set(r(this,Ze).qualities.toArray()),this.dispatch("qualities-change",{detail:t(),trigger:e})},Mb=function(e){const{quality:t}=this.$state;t.set(r(this,Ze).qualities.selected),e&&o(this,z,Et).call(this,"media-quality-change-request",e),this.dispatch("quality-change",{detail:t(),trigger:e})},Rb=function(){const{qualities:e}=r(this,Ze),t=e.auto;this.$state.autoQuality.set(t),t||o(this,z,Pd).call(this)},al=new WeakMap,Uf=function(){o(this,z,Pd).call(this),b(this,al,I(()=>{const{qualities:e}=r(this,Ze),{mediaWidth:t,mediaHeight:s}=this.$state,n=t(),a=s();if(n===0||a===0)return;let l=null,u=1/0;for(const d of e){const h=Math.abs(d.width-n)+Math.abs(d.height-a);h<u&&(u=h,l=d)}l&&e[Le.select](l,!0,new Ke("resize",{detail:{width:n,height:a}}))}))},Pd=function(){var e;(e=r(this,al))==null||e.call(this),b(this,al,null)},Ab=function(){this.$state.canSetQuality.set(!r(this,Ze).qualities.readonly)},Ib=function(){const{canSetVolume:e,isGoogleCastConnected:t}=this.$state;if(t()){e.set(!1);return}Jg().then(e.set)},_b=function(e,t,s){let{qualities:n}=r(this,Ze),a=!1,l=!1;for(const u of e)if(xf(u)&&!t.some(d=>d.src===u.src)){const d=n.getBySrc(u.src);d&&(n[Le.remove](d,s),l=!0)}l&&!n.length&&(this.$state.savedState.set(null),n[Le.reset](s));for(const u of t){if(!xf(u)||n.getBySrc(u.src))continue;const d={id:u.id??u.height+"p",bitrate:null,codec:null,...u,selected:!1};n[Le.add](d,s),a=!0}a&&!n[Mi.enableAuto]&&(o(this,z,Uf).call(this),n[Mi.enableAuto]=o(this,z,Uf).bind(this),n[Mi.setAuto](!0,s))},Kf=function(e,t=!1){const{audioTracks:s,qualities:n}=r(this,Ze);if(!t){b(this,rl,[]),b(this,Na,[-1,-1]),s[Le.reset](e),n[Le.reset](e),e2(this.$state,t),o(this,z,er).call(this);return}e2(this.$state,t),o(this,z,er).call(this)},Qf=function(e){const{seekable:t,buffered:s,intrinsicDuration:n,canPlay:a}=this.$state;a.set(!0),s.set(e.buffered),t.set(e.seekable);const l=sr(e.seekable)??1/0;n.set(l)},Zf=function(e){if(!Y(r(this,Ze).$provider))return;const{ended:t,seekableStart:s,clipEndTime:n,currentTime:a,realCurrentTime:l,duration:u}=this.$state,d=t()||l()<s()||n()>0&&l()>=n()||Math.abs(a()-u())<.1;return d&&this.dispatch("media-seek-request",{detail:s(),trigger:e}),d},Db=function(){const{currentTime:e,played:t,paused:s}=this.$state;s()||(b(this,Na,t0(r(this,rl),r(this,Na),e())),t.set(new vc(r(this,rl))))},Yf=function(e){const{clipStartTime:t,clipEndTime:s,duration:n}=this.$state;t()>0||s()>0||this.handle(this.createEvent("time-change",{detail:n(),trigger:e}))},Lb=function(){var n;const{storage:e}=r(this,Ze),{canPlay:t,realCurrentTime:s}=this.$state;
8t()&&((n=e==null?void 0:e.setTime)==null||n.call(e,s()))},ol=new WeakMap,Nb=function(e){var u;const{storage:t}=r(this,Ze),{paused:s,seeking:n,ended:a,duration:l}=this.$state;o(this,z,Yf).call(this,e),s()||this.dispatch("pause",{trigger:e}),n()&&this.dispatch("seeked",{detail:l(),trigger:e}),a.set(!0),o(this,z,er).call(this),(u=t==null?void 0:t.setTime)==null||u.call(t,l(),!0),this.dispatch("ended",{trigger:e})},Xf=function(){r(this,ol).cancel(),this.$state.waiting.set(!1)},g6),Qe,Ob,Vb,fT,Bb,qb,Fb,Wb,Hb,jb,Gb,zb,Ub,Kb,Qb,Zb,Yb,Xb,y6,pT=(y6=class extends vo{constructor(){super(...arguments);g(this,Qe)}onSetup(){if(o(this,Qe,Ob).call(this),se)return;const e=[o(this,Qe,Bb),o(this,Qe,Fb),o(this,Qe,Kb),o(this,Qe,Qb),o(this,Qe,Hb),o(this,Qe,Gb),o(this,Qe,zb),o(this,Qe,Zb),o(this,Qe,Xb),o(this,Qe,Yb),o(this,Qe,Wb),o(this,Qe,Ub),o(this,Qe,jb),o(this,Qe,Vb),o(this,Qe,qb)];for(const t of e)I(t.bind(this))}},Qe=new WeakSet,Ob=function(){var s;const e={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},t=new Set(["currentTime","paused","playbackRate","volume"]);for(const n of Object.keys(this.$props))t.has(n)||(s=this.$state[e[n]??n])==null||s.set(this.$props[n]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)},Vb=function(){const{viewType:e,streamType:t,title:s,poster:n,loop:a}=this.$props,l=this.$state;l.providedPoster.set(n()),l.providedStreamType.set(t()),l.providedViewType.set(e()),l.providedTitle.set(s()),l.providedLoop.set(a())},fT=function(){},Bb=function(){const{artist:e,artwork:t}=this.$props;this.$state.artist.set(e()),this.$state.artwork.set(t())},qb=function(){const{title:e}=this.$state;this.dispatch("title-change",{detail:e()})},Fb=function(){const e=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(e),this.dispatch("auto-play-change",{detail:e})},Wb=function(){const e=this.$state.loop();this.dispatch("loop-change",{detail:e})},Hb=function(){const e=this.$props.controls();this.$state.controls.set(e)},jb=function(){const{poster:e}=this.$state;this.dispatch("poster-change",{detail:e()})},Gb=function(){const e=this.$props.crossOrigin()??this.$props.crossorigin(),t=e===!0?"":e;this.$state.crossOrigin.set(t)},zb=function(){const{duration:e}=this.$props;this.dispatch("media-duration-change-request",{detail:e()})},Ub=function(){const e=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(e),this.dispatch("plays-inline-change",{detail:e})},Kb=function(){const{clipStartTime:e}=this.$props;this.dispatch("media-clip-start-change-request",{detail:e()})},Qb=function(){const{clipEndTime:e}=this.$props;this.dispatch("media-clip-end-change-request",{detail:e()})},Zb=function(){this.dispatch("live-change",{detail:this.$state.live()})},Yb=function(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())},Xb=function(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})},y6);const a2=["play","pause","seekforward","seekbackward","seekto"];var Qs,Jb,e9,t9,i9,b6,mT=(b6=class extends vo{constructor(){super(...arguments);g(this,Qs)}onConnect(){I(o(this,Qs,e9).bind(this)),I(o(this,Qs,t9).bind(this));const e=o(this,Qs,i9).bind(this);for(const t of a2)navigator.mediaSession.setActionHandler(t,e);_e(o(this,Qs,Jb).bind(this))}},Qs=new WeakSet,Jb=function(){for(const e of a2)navigator.mediaSession.setActionHandler(e,null)},e9=function(){const{title:e,artist:t,artwork:s,poster:n}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:e(),artist:t(),artwork:s()??[{src:n()}]})},t9=function(){const{canPlay:e,paused:t}=this.$state;navigator.mediaSession.playbackState=e()?t()?"paused":"playing":"none"},i9=function(e){const t=new Ke("media-session-action",{detail:e});switch(e.action){case"play":this.dispatch("media-play-request",{trigger:t});break;case"pause":this.dispatch("media-pause-request",{trigger:t});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Si(e.seekTime)?e.seekTime:this.$state.currentTime()+(e.seekOffset??(e.action==="seekforward"?10:-10)),trigger:t});break}},b6);let th=de(!1);se||(pt(document,"pointerdown",()=>{th.set(!1)}),pt(document,"keydown",i=>{i.metaKey||i.altKey||i.ctrlKey||th.set(!0)}));var Cr,Zs,s9,n9,r9,a9,v6,Cs=(v6=class extends zi{constructor(){super(...arguments);g(this,Zs);g(this,Cr,de(!1))}onConnect(e){I(()=>{const t=new Xe(e);if(!th()){r(this,Cr).set(!1),ed(e,!1),t.add("pointerenter",o(this,Zs,r9).bind(this)).add("pointerleave",o(this,Zs,a9).bind(this));return}const s=document.activeElement===e;r(this,Cr).set(s),ed(e,s),t.add("focus",o(this,Zs,s9).bind(this)).add("blur",o(this,Zs,n9).bind(this))})}focused(){return r(this,Cr).call(this)}},Cr=new WeakMap,Zs=new WeakSet,s9=function(){r(this,Cr).set(!0),ed(this.el,!0)},n9=function(){r(this,Cr).set(!1),ed(this.el,!1)},r9=function(){o2(this.el,!0)},a9=function(){o2(this.el,!1)},v6);function ed(i,e){we(i,"data-focus",e),we(i,"data-hocus",e)}function o2(i,e){we(i,"data-hocus",e),we(i,"data-hover",e)}var Fs,ni,Va,ri,ee,Ni,Md,ll,Jf,e1,l9,c9,u9,pc,t1,d9,i1,h9,s1,p9,n1,f9,r1,m9,a1,g9,y9,b9,v9,o9=(Fs=class extends Ne{constructor(){super();g(this,ee);g(this,ni);g(this,Va);g(this,ri);O(this,"canPlayQueue",new hb);O(this,"remoteControl");g(this,ll,!1);O(this,"orientation");new pT;const t={player:this,qualities:new DE,audioTracks:new $E,storage:null,$provider:de(null),$providerSetup:de(!1),$props:this.$props,$state:this.$state};t.remote=this.remoteControl=new EE(void 0),t.remote.setPlayer(this),t.textTracks=new _E,t.textTracks[ke.crossOrigin]=this.$state.crossOrigin,t.textRenderers=new IE(t),t.ariaKeys={},b(this,ni,t),_i(qu,t),this.orientation=new lb,new Cs,new HE(t);const s=new uT;b(this,Va,new hT(s,t)),b(this,ri,new oT(r(this,Va),s,t)),t.delegate=new sT(r(this,Va).handle.bind(r(this,Va)),t),t.notify=t.delegate.notify.bind(t.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new mT,new n2("load",this.startLoading.bind(this)),new n2("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){o(this,ee,c9).call(this),I(o(this,ee,l9).bind(this)),I(o(this,ee,h9).bind(this)),I(o(this,ee,d9).bind(this)),I(o(this,ee,f9).bind(this)),I(o(this,ee,p9).bind(this)),I(o(this,ee,g9).bind(this)),I(o(this,ee,m9).bind(this))}onAttach(t){t.setAttribute("data-media-player",""),rt(t,"tabindex","0"),rt(t,"role","regi
8on"),I(o(this,ee,b9).bind(this)),se?o(this,ee,Jf).call(this):I(o(this,ee,Jf).bind(this)),se?o(this,ee,e1).call(this):I(o(this,ee,e1).bind(this)),pt(t,"find-media-player",o(this,ee,u9).bind(this))}onConnect(t){qm&&we(t,"data-iphone","");const s=window.matchMedia("(pointer: coarse)");o(this,ee,t1).call(this,s),s.onchange=o(this,ee,t1).bind(this);const n=new ResizeObserver(Xr(o(this,ee,pc).bind(this)));n.observe(t),I(o(this,ee,pc).bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),_e(()=>{n.disconnect(),s.onchange=null})}onDestroy(){r(this,ni).player=null,this.canPlayQueue.reset()}get provider(){return r(this,ee,Ni)}get controls(){return r(this,ri).controls}set controls(t){r(this,ee,Md).controls.set(t)}get title(){return Y(this.$state.title)}set title(t){if(r(this,ll)){b(this,ll,!1);return}r(this,ee,Md).title.set(t)}get qualities(){return r(this,ni).qualities}get audioTracks(){return r(this,ni).audioTracks}get textTracks(){return r(this,ni).textTracks}get textRenderers(){return r(this,ni).textRenderers}get duration(){return this.$state.duration()}set duration(t){r(this,ee,Md).duration.set(t)}get paused(){return Y(this.$state.paused)}set paused(t){o(this,ee,i1).call(this,t)}get muted(){return Y(this.$state.muted)}set muted(t){o(this,ee,s1).call(this,t)}get currentTime(){return Y(this.$state.currentTime)}set currentTime(t){o(this,ee,n1).call(this,t)}get volume(){return Y(this.$state.volume)}set volume(t){o(this,ee,r1).call(this,t)}get playbackRate(){return Y(this.$state.playbackRate)}set playbackRate(t){o(this,ee,a1).call(this,t)}async play(t){return r(this,ri).play(t)}async pause(t){return r(this,ri).pause(t)}async enterFullscreen(t,s){return r(this,ri).enterFullscreen(t,s)}async exitFullscreen(t,s){return r(this,ri).exitFullscreen(t,s)}enterPictureInPicture(t){return r(this,ri).enterPictureInPicture(t)}exitPictureInPicture(t){return r(this,ri).exitPictureInPicture(t)}seekToLiveEdge(t){r(this,ri).seekToLiveEdge(t)}startLoading(t){r(this,ni).notify("can-load",void 0,t)}startLoadingPoster(t){r(this,ni).notify("can-load-poster",void 0,t)}requestAirPlay(t){return r(this,ri).requestAirPlay(t)}requestGoogleCast(t){return r(this,ri).requestGoogleCast(t)}setAudioGain(t,s){return r(this,ri).setAudioGain(t,s)}destroy(){super.destroy(),r(this,ni).remote.setPlayer(null),this.dispatch("destroy")}},ni=new WeakMap,Va=new WeakMap,ri=new WeakMap,ee=new WeakSet,Ni=function(){return r(this,ni).$provider()},Md=function(){return this.$props},ll=new WeakMap,Jf=function(){const t=this.$el,{ariaLabel:s}=this.$props,{title:n,live:a,viewType:l,providedTitle:u}=this.$state,d=a(),h=Ql(l()),p=h!=="Unknown"?`${d?"Live ":""}${h}`:d?"Live":"Media",f=n(),y=s()||`${p} Player`+(f?` - ${f}`:"");we(this.el,"aria-label",y),!se&&(t!=null&&t.hasAttribute("title"))&&(b(this,ll,!0),t==null||t.removeAttribute("title"))},e1=function(){const t=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(t),we(this.el,"data-orientation",t),o(this,ee,pc).call(this)},l9=function(){this.$state.canPlay()&&r(this,ee,Ni)?this.canPlayQueue.start():this.canPlayQueue.stop()},c9=function(){if(Fs[up]){this.setAttributes(Fs[up]);return}const t={"data-load":function(){return this.$props.load()},"data-captions":function(){const n=this.$state.textTrack();return!!n&&pi(n)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){const{canLoad:n,canPlay:a,waiting:l}=this.$state;return n()&&(!a()||l())},"data-error":function(){const{error:n}=this.$state;return!!n()},"data-autoplay-error":function(){const{autoPlayError:n}=this.$state;return!!n()}},s={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 n of tT){const a="data-"+(s[n]??zn(n));t[a]=function(){return this.$state[n]()}}delete t.title,Fs[up]=t,this.setAttributes(t)},u9=function(t){t.detail(this)},pc=function(){if(se||!this.el)return;const t=this.el.clientWidth,s=this.el.clientHeight;this.$state.width.set(t),this.$state.height.set(s),Ii(this.el,"--player-width",t+"px"),Ii(this.el,"--player-height",s+"px")},t1=function(t){if(se)return;const s=t.matches?"coarse":"fine";
8we(this.el,"data-pointer",s),this.$state.pointer.set(s),o(this,ee,pc).call(this)},d9=function(){o(this,ee,i1).call(this,this.$props.paused())},i1=function(t){t?this.canPlayQueue.enqueue("paused",()=>r(this,ri).pause()):this.canPlayQueue.enqueue("paused",()=>r(this,ri).play())},h9=function(){o(this,ee,s1).call(this,this.$props.muted())},s1=function(t){this.canPlayQueue.enqueue("muted",()=>{Y(()=>{r(this,ee,Ni)&&r(this,ee,Ni).setMuted(t)})})},p9=function(){o(this,ee,n1).call(this,this.$props.currentTime())},n1=function(t){this.canPlayQueue.enqueue("currentTime",()=>{const{currentTime:s}=this.$state;t!==Y(s)&&Y(()=>{if(!r(this,ee,Ni))return;const n=Py(t,this.$state);Number.isFinite(n)&&r(this,ee,Ni).setCurrentTime(n)})})},f9=function(){o(this,ee,r1).call(this,this.$props.volume())},r1=function(t){const s=Oh(0,t,1);this.canPlayQueue.enqueue("volume",()=>{r(this,ee,Ni)&&r(this,ee,Ni).setVolume(s)})},m9=function(){o(this,ee,a1).call(this,this.$props.playbackRate())},a1=function(t){this.canPlayQueue.enqueue("rate",()=>{var s,n;r(this,ee,Ni)&&((n=(s=r(this,ee,Ni)).setPlaybackRate)==null||n.call(s,t))})},g9=function(){o(this,ee,y9).call(this,this.$props.playsInline())},y9=function(t){this.canPlayQueue.enqueue("playsinline",()=>{var s,n;r(this,ee,Ni)&&((n=(s=r(this,ee,Ni)).setPlaysInline)==null||n.call(s,t))})},b9=function(){var n;let t=this.$props.storage(),s=le(t)?new kE:t;if(s!=null&&s.onChange){const{source:a}=this.$state,l=le(t)?t:(n=this.el)==null?void 0:n.id,u=On(o(this,ee,v9).bind(this));I(()=>s.onChange(a(),u(),l||void 0))}r(this,ni).storage=s,r(this,ni).textTracks.setStorage(s),_e(()=>{var a;(a=s==null?void 0:s.onDestroy)==null||a.call(s),r(this,ni).storage=null,r(this,ni).textTracks.setStorage(null)})},v9=function(){const{clipStartTime:t,clipEndTime:s}=this.$props,{source:n}=this.$state,a=n();return a.src?`${a.src}:${t()}:${s()}`:null},O(Fs,"props",iT),O(Fs,"state",Bu),Fs);
8const ft=o9.prototype;at(ft,"canPlayQueue");at(ft,"remoteControl");at(ft,"provider");at(ft,"controls");at(ft,"orientation");at(ft,"title");at(ft,"qualities");at(ft,"audioTracks");at(ft,"textTracks");at(ft,"textRenderers");at(ft,"duration");at(ft,"paused");at(ft,"muted");at(ft,"currentTime");at(ft,"volume");at(ft,"playbackRate");Ut(ft,"play");Ut(ft,"pause");Ut(ft,"enterFullscreen");Ut(ft,"exitFullscreen");Ut(ft,"enterPictureInPicture");Ut(ft,"exitPictureInPicture");Ut(ft,"seekToLiveEdge");Ut(ft,"startLoading");Ut(ft,"startLoadingPoster");Ut(ft,"requestAirPlay");Ut(ft,"requestGoogleCast");Ut(ft,"setAudioGain");function gT(i,e){return fetch(i,e).then(t=>t.text()).then(t=>/type="static"/.test(t)?"on-demand":"live")}function C9(i,e){return fetch(i,e).then(t=>t.text()).then(t=>{const s=yT(t);if(s)return C9(/^https?:/.test(s)?s:new URL(s,i).href,e);const n=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(t)?"on-demand":"live";return n==="live"&&bT(t)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(t)||t.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":n})}function yT(i){const e=i.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return e?e[0].split(`
9`)[1].trim():null}function bT(i){const e=i.split(`
10`);for(const t of e)if(t.startsWith("#EXT-X-TARGETDURATION")){const s=parseFloat(t.split(":")[1]);if(!isNaN(s))return s}return-1}const o1=new Map;var cl,ul,eu,Ye,Sn,_t,S9,w9,l1,c1,u1,x9,E9,T9,C6,vT=(C6=class{constructor(i,e,t,s=[]){g(this,_t);g(this,cl,!1);g(this,ul);g(this,eu);g(this,Ye);g(this,Sn);b(this,eu,i),b(this,Ye,e),b(this,Sn,t);const n=new XE,a=new YE,l=new Jm,u=new ZE,d=[new eT,new JE];b(this,ul,On(()=>{const p=e.$state.remotePlaybackLoader(),f=e.$props.preferNativeHLS()?[l,u,n,a,...d,...s]:[a,l,u,n,...d,...s];return p?[p,...f]:f}));const{$state:h}=e;h.sources.set(l2(e.$props.src()));for(const p of h.sources()){const f=r(this,ul).call(this).find(v=>v.canPlay(p));if(!f)continue;const y=f.mediaType(p);e.$state.source.set(p),e.$state.mediaType.set(y),e.$state.inferredViewType.set(y),r(this,Sn).set(f),b(this,cl,!0);break}}connect(){const i=r(this,Sn).call(this);r(this,cl)&&(o(this,_t,c1).call(this,r(this,Ye).$state.source(),i),o(this,_t,u1).call(this,i),b(this,cl,!1)),I(o(this,_t,S9).bind(this)),I(o(this,_t,w9).bind(this)),I(o(this,_t,x9).bind(this)),I(o(this,_t,E9).bind(this)),I(o(this,_t,T9).bind(this))}},cl=new WeakMap,ul=new WeakMap,eu=new WeakMap,Ye=new WeakMap,Sn=new WeakMap,_t=new WeakSet,S9=function(){r(this,Ye).notify("sources-change",[...l2(r(this,Ye).$props.src()),...r(this,eu).call(this)])},w9=function(){var n;const{$state:i}=r(this,Ye),e=i.sources(),t=Y(i.source),s=o(this,_t,l1).call(this,t,e);if((n=e[0])!=null&&n.src&&!s.src&&!s.type){const{crossOrigin:a}=i,l=Io(a()),u=new AbortController;return Promise.all(e.map(d=>le(d.src)&&d.type==="?"?fetch(d.src,{method:"HEAD",credentials:l,signal:u.signal}).then(h=>(d.type=h.headers.get("content-type")||"??",o1.set(d.src,d.type),d)).catch(()=>d):d)).then(d=>{if(u.signal.aborted)return;const h=o(this,_t,l1).call(this,Y(i.source),d);bs(),h.src||r(this,Ye).notify("error",{message:"Failed to load resource.",code:4})}),()=>u.abort()}bs()},l1=function(i,e){let t={src:"",type:""},s=null,n=new Ke("sources-change",{detail:{sources:e}}),a=r(this,ul).call(this),{started:l,paused:u,currentTime:d,quality:h,savedState:p}=r(this,Ye).$state;for(const f of e){const y=a.find(v=>v.canPlay(f));if(y){t=f,s=y;break}}if(xf(t)){const f=h(),y=e.find(v=>v.src===(f==null?void 0:f.src));Y(l)?p.set({paused:Y(u),currentTime:Y(d)}):p.set(null),y&&(t=y,n=new Ke("quality-change",{detail:{quality:f}}))}return u2(i,t)||o(this,_t,c1).call(this,t,s,n),s!==Y(r(this,Sn))&&o(this,_t,u1).call(this,s,n),t},c1=function(i,e,t){r(this,Ye).notify("source-change",i,t),r(this,Ye).notify("media-type-change",(e==null?void 0:e.mediaType(i))||"unknown",t)},u1=function(i,e){r(this,Ye).$providerSetup.set(!1),r(this,Ye).notify("provider-change",null,e),i&&Y(()=>{var t;return(t=i.preconnect)==null?void 0:t.call(i,r(this,Ye))}),r(this,Sn).set(i),r(this,Ye).notify("provider-loader-change",i,e)},x9=function(){const i=r(this,Ye).$provider();if(!(!i||Y(r(this,Ye).$providerSetup))){if(r(this,Ye).$state.canLoad()){Wt(()=>i.setup(),i.scope),r(this,Ye).$providerSetup.set(!0);return}Y(()=>{var e;return(e=i.preconnect)==null?void 0:e.call(i)})}},E9=function(){if(!r(this,Ye).$providerSetup())return;const i=r(this,Ye).$provider(),e=r(this,Ye).$state.source(),t=Y(r(this,Ye).$state.crossOrigin),s=Y(r(this,Ye).$props.preferNativeHLS);if(!u2(i==null?void 0:i.currentSrc,e)){if(r(this,Ye).$state.canLoad()){const n=new AbortController;return yo(e)?(s||!Dh())&&C9(e.src,{credentials:Io(t),signal:n.signal}).then(a=>{r(this,Ye).notify("stream-type-change",a)}).catch(Ln):Ou(e)?gT(e.src,{credentials:Io(t),signal:n.signal}).then(a=>{r(this,Ye).notify("stream-type-change",a)}).catch(Ln):r(this,Ye).notify("stream-type-change","on-demand"),Y(()=>{const a=Y(r(this,Ye).$state.preload);return i==null?void 0:i.loadSource(e,a).catch(l=>{})}),()=>n.abort()}try{le(e.src)&&bo(new URL(e.src).origin)}catch{}}},T9=function(){const i=r(this,Sn).call(this),{providedPoster:e,source:t,canLoadPoster:s}=r(this,Ye).$state;if(!i||!i.loadPoster||!t()||!s()||e())return;const n=new AbortController,a=new Ke("source-change",{detail:t});
10return i.loadPoster(t(),r(this,Ye),n).then(l=>{r(this,Ye).notify("poster-change",l||"",a)}).catch(()=>{r(this,Ye).notify("poster-change","",a)}),()=>{n.abort()}},C6);function l2(i){return(wt(i)?i:[i]).map(e=>le(e)?{src:e,type:c2(e)}:{...e,type:c2(e.src,e.type)})}function c2(i,e){return le(e)&&e.length?e:le(i)&&o1.has(i)?o1.get(i):!e&&yo({src:i,type:""})?"application/x-mpegurl":!e&&Ou({src:i,type:""})?"application/dash+xml":!le(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 u2(i,e){return(i==null?void 0:i.src)===(e==null?void 0:e.src)&&(i==null?void 0:i.type)===(e==null?void 0:e.type)}var tu,Sr,iu,dh,k9,S6,CT=(S6=class{constructor(i,e){g(this,dh);g(this,tu);g(this,Sr);g(this,iu,[]);b(this,tu,i),b(this,Sr,e),I(o(this,dh,k9).bind(this))}},tu=new WeakMap,Sr=new WeakMap,iu=new WeakMap,dh=new WeakSet,k9=function(){const i=r(this,tu).call(this);for(const e of r(this,iu))if(!i.some(t=>t.id===e.id)){const t=e.id&&r(this,Sr).textTracks.getById(e.id);t&&r(this,Sr).textTracks.remove(t)}for(const e of i){const t=e.id||lo.createId(e);r(this,Sr).textTracks.getById(t)||(e.id=t,r(this,Sr).textTracks.add(e))}b(this,iu,i)},S6),nd,hs,su,nu,ru,dl,hl,pl,fl,Gi,P9,d1,h1,p1,$9=(nd=class extends Ne{constructor(){super(...arguments);g(this,Gi);g(this,hs);g(this,su);g(this,nu,de([]));g(this,ru,de([]));g(this,dl,null);g(this,hl,null);g(this,pl,!1);g(this,fl,-1)}onSetup(){b(this,hs,ut()),b(this,su,new vT(r(this,nu),r(this,hs),this.$state.loader,this.$props.loaders()))}onAttach(t){t.setAttribute("data-media-provider","")}onConnect(t){b(this,pl,!0),r(this,su).connect(),new CT(r(this,ru),r(this,hs));const s=new ResizeObserver(Xr(o(this,Gi,h1).bind(this)));s.observe(t);const n=new MutationObserver(o(this,Gi,p1).bind(this));n.observe(t,{attributes:!0,childList:!0}),o(this,Gi,h1).call(this),o(this,Gi,p1).call(this),r(this,hl)&&this.load(r(this,hl)),_e(()=>{b(this,pl,!1),s.disconnect(),n.disconnect()})}load(t){b(this,hl,t||null),t==null||t.setAttribute("aria-hidden","true"),r(this,pl)&&(window.cancelAnimationFrame(r(this,fl)),b(this,fl,requestAnimationFrame(()=>o(this,Gi,P9).call(this,t))),_e(()=>{window.cancelAnimationFrame(r(this,fl))}))}onDestroy(){b(this,dl,null),o(this,Gi,d1).call(this)}},hs=new WeakMap,su=new WeakMap,nu=new WeakMap,ru=new WeakMap,dl=new WeakMap,hl=new WeakMap,pl=new WeakMap,fl=new WeakMap,Gi=new WeakSet,P9=function(t){if(!this.scope)return;const s=this.$state.loader(),{$provider:n}=r(this,hs);r(this,dl)===s&&(s==null?void 0:s.target)===t&&Y(n)||(o(this,Gi,d1).call(this),b(this,dl,s),s&&(s.target=t||null),!(!s||!t)&&s.load(r(this,hs)).then(a=>{this.scope&&Y(this.$state.loader)===s&&r(this,hs).notify("provider-change",a)}))},d1=function(){var t;(t=r(this,hs))==null||t.notify("provider-change",null)},h1=function(){if(!this.el)return;const{player:t,$state:s}=r(this,hs),n=this.el.offsetWidth,a=this.el.offsetHeight;t&&(s.mediaWidth.set(n),s.mediaHeight.set(a),t.el&&(Ii(t.el,"--media-width",n+"px"),Ii(t.el,"--media-height",a+"px")))},p1=function(){const t=[],s=[],n=this.el.children;for(const a of n)if(!a.hasAttribute("data-vds")){if(a instanceof HTMLSourceElement){const l={id:a.id,src:a.src,type:a.type};for(const u of["id","src","width","height","bitrate","codec"]){const d=a.getAttribute(`data-${u}`);le(d)&&(l[u]=/id|src|codec/.test(u)?d:Number(d))}t.push(l)}else if(a instanceof HTMLTrackElement){const l={src:a.src,kind:a.track.kind,language:a.srclang,label:a.label,default:a.default,type:a.getAttribute("data-type")};s.push({id:a.id||lo.createId(l),...l})}}r(this,nu).set(t),r(this,ru).set(s),bs()},O(nd,"props",{loaders:[]}),O(nd,"state",new Kn({loader:null})),nd);const ST=$9.prototype;Ut(ST,"load");var rd,_s,ml,mt,M9,R9,A9,I9,_9,wr,gl,D9,Rd,L9,na,wT=(rd=class extends Ne{constructor(){super(...arguments);g(this,mt);g(this,_s);g(this,ml,!1);g(this,wr,-1);g(this,gl,-1)}onSetup(){b(this,_s,ut())}onAttach(t){t.style.display="contents"}onConnect(t){t.setAttribute("data-media-announcer",""),rt(t,"role","status"),rt(t,"aria-live","polite");const{busy:s}=this.$state;this.setAttributes({"aria-busy":()=>s()?"true":null}),b(this,ml,!0),I(o(this,mt,M9).bind(this)),I(o(this,mt,_9).bind(this)),I(o(this,mt,I9).bind(this)),I(o(this,mt,R9).bind(this)),I(o(this,mt,A9).bind(this)),I(o(this,mt,D9).bind(this)),I(o(this,mt,L9).bind(this)),bs(),b(this,ml,!1)}},_s=new WeakMap,ml=new WeakMap,mt=new WeakSet,M9=function(){const{paused:t}=r(this,_s).$state;o(this,mt,na).call(this,t()?"Pause":"Play")},R9=function(){const{fullscreen:t}=r(this,_s).$state;o(this,mt,na).call(this,t()?"Enter Fullscreen":"Exit Fullscreen")},A9=function(){const{pictureInPicture:t}=r(this,_s).$state;o(this,mt,na).call(this,t()?"Enter PiP":"Exit PiP")},I9=function(){const{textTrack:t}=r(this,_s).$state;o(this,mt,na).call(this,t()?"Closed-Captions On":"Closed-Captions Off")},_9=function(){const{muted:t,volume:s,audioGain:n}=r(this,_s).$state;o(this,mt,na).call(this,t()||s()===0?"Mute":`${Math.round(s()*(n()??1)*100)}% ${o(this,mt,Rd).call(this,"Volume")}`)},wr=new WeakMap,gl=new WeakMap,D9=function(){const{seeking:t,currentTime:s}=r(this,_s).$state,n=t();r(this,wr)>0?(window.clearTimeout(r(this,gl)),b(this,gl,window.setTimeout(()=>{if(!this.scope)return;const a=Y(s),l=Math.abs(a-r(this,wr));if(l>=1){const u=a>=r(this,wr),d=eh(l);o(this,mt,na).call(this,`${o(this,mt,Rd).call(this,u?"Seek Forward":"Seek Backward")} ${d}`)}b(this,wr,-1),b(this,gl,-1)},300))):n&&b(this,wr,Y(s))},Rd=function(t){var n;const{translations:s}=this.$props;return((n=s==null?void 0:s())==null?void 0:n[t||""])??t},L9=function(){const{label:t,busy:s}=this.$state,n=o(this,mt,Rd).call(this,t());if(r(this,ml))return;s.set(!0);const a=window.setTimeout(()=>void s.set(!1),150);return this.el&&we(this.el,"aria-label",n),le(n)&&this.dispatch("change",{detail:n}),()=>window.clearTimeout(a)},na=function(t){const{label:s}=this.$state;s.set(t)},O(rd,"props",{translations:null}),O(rd,"state",new Kn({label:null,busy:!1})),rd),xp,wn,qn,N9,O9,f1,xT=(xp=class extends Ne{constructor(){super(...arguments);g(this,qn);g(this,wn)}onSetup(){b(this,wn,ut()),I(o(this,qn,O9).bind(this))}onAttach(e){const{pictureInPicture:t,fullscreen:s}=r(this,wn).$state;Ii(e,"pointer-events","none"),rt(e,"role","group"),this.setAttributes({"data-visible":o(this,qn,f1).bind(this),"data-fullscreen":s,"data-pip":t}),I(()=>{this.dispatch("change",{detail:o(this,qn,f1).call(this)})}),I(o(this,qn,N9).bind(this)),I(()=>{const n=s();for(const a of["top","right","bottom","left"])Ii(e,`padding-${a}`,n&&`env(safe-area-inset-${a})`)})}},wn=new WeakMap,qn=new WeakSet,N9=function(){if(!this.el)return;const{nativeControls:e}=r(this,wn).$state,t=e();we(this.el,"aria-hidden",t?"true":null),Ii(this.el,"display",t?"none":null)},O9=function(){const{controls:e}=r(this,wn).player,{hideDelay:t,hideOnMouseLeave:s}=this.$props;e.defaultDelay=t()===2e3?r(this,wn).$props.controlsDelay():t(),e.hideOnMouseLeave=s()},f1=function(){const{controlsVisible:e}=r(this,wn).$state;return e()},O(xp,"props",{hideDelay:2e3,hideOnMouseLeave:!1}),xp),ET=class extends Ne{onAttach(i){i.style.pointerEvents||Ii(i,"pointer-events","auto")}},ps,Gr,B9,Ba,qa,Ds,Ad,w6,V9=(w6=class extends zi{constructor(e){super();g(this,Gr);g(this,ps);g(this,Ba,-1);g(this,qa,-1);g(this,Ds,null);b(this,ps,e),I(o(this,Gr,B9).bind(this))}onDestroy(){var e;(e=r(this,Ds))==null||e.call(this),b(this,Ds,null)}show(e){var t,s,n;o(this,Gr,Ad).call(this),window.cancelAnimationFrame(r(this,qa)),b(this,qa,-1),(t=r(this,Ds))==null||t.call(this),b(this,Ds,null),b(this,Ba,window.setTimeout(()=>{b(this,Ba,-1);const a=r(this,ps).content();a&&a.style.removeProperty("display"),Y(()=>r(this,ps).onChange(!0,e))},((n=(s=r(this,ps)).showDelay)==null?void 0:n.call(s))??0))}hide(e){o(this,Gr,Ad).call(this),Y(()=>r(this,ps).onChange(!1,e)),b(this,qa,requestAnimationFrame(()=>{var s;o(this,Gr,Ad).call(this),b(this,qa,-1);const t=r(this,ps).content();if(t){const n=()=>{t.style.display="none",b(this,Ds,null)};if(RE(t)){(s=r(this,Ds))==null||s.call(this);const a=pt(t,"animationend",n,{once:!0});b(this,Ds,a)}else n()}}))}},ps=new WeakMap,Gr=new WeakSet,B9=function(){const e=r(this,ps).trigger();if(!e){this.hide();return}const t=this.show.bind(this),s=this.hide.bind(this);r(this,ps).listen(e,t,s)},Ba=new WeakMap,qa=new WeakMap,Ds=new WeakMap,Ad=function(){window.clearTimeout(r(this,Ba)),b(this,Ba,-1)},w6);const ca=Un();let TT=0;var Ep,yl,xr,Er,au,ss,q9,F9,W9,H9,j9,kT=(Ep=class extends Ne{constructor(){super();g(this,ss);g(this,yl,`media-tooltip-${++TT}`);g(this,xr,de(null));g(this,Er,de(null));g(this,au,de(!1));new Cs;const{showDelay:e}=this.$props;new V9({trigger:r(this,xr),content:r(this,Er),showDelay:e,listen(t,s,n){I(()=>{th()&&pt(t,"focus",s),pt(t,"blur",n)}),new Xe(t).add("touchstart",a=>a.preventDefault(),{passive:!1}).add("mouseenter",s).add("mouseleave",n)},onChange:o(this,ss,j9).bind(this)})}onAttach(e){e.style.setProperty("display","contents")}onSetup(){_i(ca,{trigger:r(this,xr),content:r(this,Er),showing:r(this,au),attachTrigger:o(this,ss,q9).bind(this),detachTrigger:o(this,ss,F9).bind(this),attachContent:o(this,ss,W9).bind(this),detachContent:o(this,ss,H9).bind(this)})}},yl=new WeakMap,xr=new WeakMap,Er=new WeakMap,au=new WeakMap,ss=new WeakSet,q9=function(e){var s;r(this,xr).set(e);let t=e.getAttribute("data-media-tooltip");t&&((s=this.el)==null||s.setAttribute(`data-media-${t}-tooltip`,"")),we(e,"data-describedby",r(this,yl))},F9=function(e){e.removeAttribute("data-describedby"),e.removeAttribute("aria-describedby"),r(this,xr).set(null)},W9=function(e){e.setAttribute("id",r(this,yl)),e.style.display="none",rt(e,"role","tooltip"),r(this,Er).set(e)},H9=function(e){e.removeAttribute("id"),e.removeAttribute("role"),r(this,Er).set(null)},j9=function(e){const t=r(this,xr).call(this),s=r(this,Er).call(this);t&&we(t,"aria-describedby",e?r(this,yl):null);for(const n of[this.el,t,s])n&&we(n,"data-visible",e);r(this,au).set(e)},O(Ep,"props",{showDelay:700}),Ep),uo,G9,m1,x6,$T=(x6=class extends Ne{constructor(){super();g(this,uo);new Cs}onConnect(e){_e(Dy(()=>
10{if(!this.connectScope)return;o(this,uo,G9).call(this);const t=Tt(ca);_e(()=>{const s=o(this,uo,m1).call(this);s&&t.detachTrigger(s)})}))}},uo=new WeakSet,G9=function(){const e=o(this,uo,m1).call(this),t=Tt(ca);e&&t.attachTrigger(e)},m1=function(){const e=this.el.firstElementChild;return(e==null?void 0:e.localName)==="button"||(e==null?void 0:e.getAttribute("role"))==="button"?e:this.el},x6),Tp,Fn,g1,z9,U9,PT=(Tp=class extends Ne{constructor(){super();g(this,Fn);new Cs;const{placement:e}=this.$props;this.setAttributes({"data-placement":e})}onAttach(e){o(this,Fn,g1).call(this,e),Object.assign(e.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(e){o(this,Fn,g1).call(this,e);const t=Tt(ca);_e(()=>t.detachContent(e)),_e(Dy(()=>{this.connectScope&&I(o(this,Fn,z9).bind(this))}))}},Fn=new WeakSet,g1=function(e){Tt(ca).attachContent(e)},z9=function(){const{showing:e}=Tt(ca);if(!e())return;const{placement:t,offset:s,alignOffset:n}=this.$props;return Ly(this.el,o(this,Fn,U9).call(this),t(),{offsetVarName:"media-tooltip",xOffset:n(),yOffset:s()})},U9=function(){return Tt(ca).trigger()},O(Tp,"props",{placement:"top center",offset:0,alignOffset:0}),Tp),kp,xn,Ys,K9,Q9,Z9,Y9,wi=(kp=class extends zi{constructor(e){super();g(this,Ys);g(this,xn);b(this,xn,e),new Cs,e.keyShortcut&&new UE(e.keyShortcut)}onSetup(){const{disabled:e}=this.$props;this.setAttributes({"data-pressed":r(this,xn).isPresssed,"aria-pressed":o(this,Ys,K9).bind(this),"aria-disabled":()=>e()?"true":null})}onAttach(e){rt(e,"tabindex","0"),rt(e,"role","button"),rt(e,"type","button")}onConnect(e){const t=zr(e,o(this,Ys,Z9).bind(this));for(const s of["click","touchstart"])t.add(s,o(this,Ys,Y9).bind(this),{passive:!0})}},xn=new WeakMap,Ys=new WeakSet,K9=function(){return Ec(r(this,xn).isPresssed())},Q9=function(e){fg(r(this,xn).isPresssed)&&r(this,xn).isPresssed.set(t=>!t)},Z9=function(e){if(this.$props.disabled()||this.el.hasAttribute("data-disabled")){e.preventDefault(),e.stopImmediatePropagation();return}e.preventDefault(),(r(this,xn).onPress??o(this,Ys,Q9)).call(this,e)},Y9=function(e){this.$props.disabled()&&(e.preventDefault(),e.stopImmediatePropagation())},O(kp,"props",{disabled:!1}),kp),$p,ou,X9=($p=class extends Ne{constructor(){super();g(this,ou,de(!1));new wi({isPresssed:r(this,ou)})}get pressed(){return r(this,ou).call(this)}},ou=new WeakMap,O($p,"props",{disabled:!1,defaultPressed:!1}),$p);const MT=X9.prototype;at(MT,"pressed");var Pp,En,Xs,J9,ev,tv,iv,RT=(Pp=class extends Ne{constructor(){super();g(this,Xs);g(this,En);new wi({isPresssed:o(this,Xs,ev).bind(this),onPress:o(this,Xs,J9).bind(this)})}onSetup(){b(this,En,ut());const{canAirPlay:t,isAirPlayConnected:s}=r(this,En).$state;this.setAttributes({"data-active":s,"data-supported":t,"data-state":o(this,Xs,tv).bind(this),"aria-hidden":li(()=>!t())})}onAttach(t){t.setAttribute("data-media-tooltip","airplay"),ea(t,o(this,Xs,iv).bind(this))}},En=new WeakMap,Xs=new WeakSet,J9=function(t){r(this,En).remote.requestAirPlay(t)},ev=function(){const{remotePlaybackType:t,remotePlaybackState:s}=r(this,En).$state;return t()==="airplay"&&s()!=="disconnected"},tv=function(){const{remotePlaybackType:t,remotePlaybackState:s}=r(this,En).$state;return t()==="airplay"&&s()},iv=function(){const{remotePlaybackState:t}=r(this,En).$state;return`AirPlay ${t()}`},O(Pp,"props",wi.props),Pp),Mp,Tn,Js,sv,nv,rv,av,AT=(Mp=class extends Ne{constructor(){super();g(this,Js);g(this,Tn);new wi({isPresssed:o(this,Js,nv).bind(this),onPress:o(this,Js,sv).bind(this)})}onSetup(){b(this,Tn,ut());const{canGoogleCast:t,isGoogleCastConnected:s}=r(this,Tn).$state;this.setAttributes({"data-active":s,"data-supported":t,"data-state":o(this,Js,rv).bind(this),"aria-hidden":li(()=>!t())})}onAttach(t){t.setAttribute("data-media-tooltip","google-cast"),ea(t,o(this,Js,av).bind(this))}},Tn=new WeakMap,Js=new WeakSet,sv=function(t){r(this,Tn).remote.requestGoogleCast(t)},nv=function(){const{remotePlaybackType:t,remotePlaybackState:s}=r(this,Tn).$state;return t()==="google-cast"&&s()!=="disconnected"},rv=function(){const{remotePlaybackType:t,remotePlaybackState:s}=r(this,Tn).$state;return t()==="google-cast"&&s()},av=function(){const{remotePlaybackState:t}=r(this,Tn).$state;return`Google Cast ${t()}`},O(Mp,"props",wi.props),Mp),Rp,Fa,ho,ov,y1,IT=(Rp=class extends Ne{constructor(){super();g(this,ho);g(this,Fa);new wi({isPresssed:o(this,ho,y1).bind(this),keyShortcut:"togglePaused",onPress:o(this,ho,ov).bind(this)})}onSetup(){b(this,Fa,ut());const{paused:t,ended:s}=r(this,Fa).$state;this.setAttributes({"data-paused":t,"data-ended":s})}onAttach(t){t.setAttribute("data-media-tooltip","play"),ea(t,"Play")}},Fa=new WeakMap,ho=new WeakSet,ov=function(t){const s=r(this,Fa).remote;o(this,ho,y1).call(this)?s.pause(t):s.play(t)},y1=function(){const{paused:t}=r(this,Fa).$state;return!t()},O(Rp,"props",wi.props),Rp),Ap,Wa,en,lv,b1,v1,_T=(Ap=class extends Ne{constructor(){super();g(this,en);g(this,Wa);new wi({isPresssed:o(this,en,b1).bind(this),keyShortcut:"toggleCaptions",onPress:o(this,en,lv).bind(this)})}onSetup(){b(this,Wa,ut()),this.setAttributes({"data-active":o(this,en,b1).bind(this),"data-supported":()=>!o(this,en,v1).call(this),"aria-hidden":li(o(this,en,v1).bind(this))})}onAttach(t){t.setAttribute("data-media-tooltip","caption"),ea(t,"Captions")}},Wa=new WeakMap,en=new WeakSet,lv=function(t){r(this,Wa).remote.toggleCaptions(t)},b1=function(){const{textTrack:t}=r(this,Wa).$state,s=t();return!!s&&pi(s)},v1=function(){const{hasCaptions:t}=r(this,Wa).$state;return!t()},O(Ap,"props",wi.props),Ap),Ip,Tr,Wn,cv,C1,uv,DT=(Ip=class extends Ne{constructor(){super();g(this,Wn);g(this,Tr);new wi({isPresssed:o(this,Wn,C1).bind(this),keyShortcut:"toggleFullscreen",onPress:o(this,Wn,cv).bind(this)})}onSetup(){b(this,Tr,ut());const{fullscreen:t}=r(this,Tr).$state,s=o(this,Wn,uv).bind(this);this.setAttributes({"data-active":t,"data-supported":s,"aria-hidden":li(()=>!s())})}onAttach(t){t.setAttribute("data-media-tooltip","fullscreen"),ea(t,"Fullscreen")}},Tr=new WeakMap,Wn=new WeakSet,cv=function(t){const s=r(this,Tr).remote,n=this.$props.target();o(this,Wn,C1).call(this)?s.exitFullscreen(n,t):s.enterFullscreen(n,t)},C1=function(){const{fullscreen:t}=r(this,Tr).$state;return t()},uv=function(){const{canFullscreen:t}=r(this,Tr).$state;return t()},O(Ip,"props",{...wi.props,target:"prefer-media"}),Ip),_p,Ha,Hs,dv,Id,hv,LT=(_p=class extends Ne{constructor(){super();g(this,Hs);g(this,Ha);new wi({isPresssed:o(this,Hs,Id).bind(this),keyShortcut:"toggleMuted",onPress:o(this,Hs,dv).bind(this)})}onSetup(){b(this,Ha,ut()),this.setAttributes({"data-muted":o(this,Hs,Id).bind(this),"data-state":o(this,Hs,hv).bind(this)})}onAttach(t){t.setAttribute("data-media-mute-button",""),t.setAttribute("data-media-tooltip","mute"),ea(t,"Mute")}},Ha=new WeakMap,Hs=new WeakSet,dv=function(t){const s=r(this,Ha).remote;o(this,Hs,Id).call(this)?s.unmute(t):s.mute(t)},Id=function(){const{muted:t,volume:s}=r(this,Ha).$state;return t()||s()===0},hv=function(){const{muted:t,volume:s}=r(this,Ha).$state,n=s();if(t()||n===0)return"muted";if(n>=.5)return"high";if(n<.5)return"low"},O(_p,"props",wi.props),_p),Dp,kr,Hn,pv,S1,fv,NT=(Dp=class extends Ne{constructor(){super();g(this,Hn);g(this,kr);new wi({isPresssed:o(this,Hn,S1).bind(this),keyShortcut:"togglePictureInPicture",onPress:o(this,Hn,pv).bind(this)})}onSetup(){b(this,kr,ut());const{pictureInPicture:t}=r(this,kr).$state,s=o(this,Hn,fv).bind(this);this.setAttributes({"data-active":t,"data-supported":s,"aria-hidden":li(()=>!s())})}onAttach(t){t.setAttribute("data-media-tooltip","pip"),ea(t,"PiP")}},kr=new WeakMap,Hn=new WeakSet,pv=function(t){const s=r(this,kr).remote;o(this,Hn,S1).call(this)?s.exitPictureInPicture(t):s.enterPictureInPicture(t)},S1=function(){const{pictureInPicture:t}=r(this,kr).$state;return t()},fv=function(){const{canPictureInPicture:t}=r(this,kr).$state;return t()},O(Dp,"props",wi.props),Dp),Lp,$r,Zr,mv,gv,yv,OT=(Lp=class extends Ne{constructor(){super();g(this,Zr);g(this,$r);new Cs}onSetup(){b(this,$r,ut());const{seeking:t}=r(this,$r).$state,{seconds:s}=this.$props,n=o(this,Zr,mv).bind(this);this.setAttributes({seconds:s,"data-seeking":t,"data-supported":n,"aria-hidden":li(()=>!n())})}onAttach(t){rt(t,"tabindex","0"),rt(t,"role","button"),rt(t,"type","button"),t.setAttribute("data-media-tooltip","seek"),ea(t,o(this,Zr,gv).bind(this))}onConnect(t){zr(t,o(this,Zr,yv).bind(this))}}
10,$r=new WeakMap,Zr=new WeakSet,mv=function(){const{canSeek:t}=r(this,$r).$state;return t()},gv=function(){const{seconds:t}=this.$props;return`Seek ${t()>0?"forward":"backward"} ${t()} seconds`},yv=function(t){const{seconds:s,disabled:n}=this.$props;if(n())return;const{currentTime:a}=r(this,$r).$state,l=a()+s();r(this,$r).remote.seek(l,t)},O(Lp,"props",{disabled:!1,seconds:30}),Lp),Np,ja,hh,bv,VT=(Np=class extends Ne{constructor(){super();g(this,hh);g(this,ja);new Cs}onSetup(){b(this,ja,ut());const{disabled:t}=this.$props,{live:s,liveEdge:n}=r(this,ja).$state,a=()=>!s();this.setAttributes({"data-edge":n,"data-hidden":a,"aria-disabled":li(()=>t()||n()),"aria-hidden":li(a)})}onAttach(t){rt(t,"tabindex","0"),rt(t,"role","button"),rt(t,"type","button"),t.setAttribute("data-media-tooltip","live")}onConnect(t){zr(t,o(this,hh,bv).bind(this))}},ja=new WeakMap,hh=new WeakSet,bv=function(t){const{disabled:s}=this.$props,{liveEdge:n}=r(this,ja).$state;s()||n()||r(this,ja).remote.seekToLiveEdge(t)},O(Np,"props",{disabled:!1}),Np);const Co=new Kn({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 d2(this.min,this.max,this.value)},get fillPercent(){return this.fillRate*100},get pointerRate(){return d2(this.min,this.max,this.pointerValue)},get pointerPercent(){return this.pointerRate*100}});function d2(i,e,t){const s=e-i,n=t-i;return s>0?n/s:0}var bl,Pr,ph,Cv,E6,vv=(E6=class extends zi{constructor(e){super();g(this,ph);g(this,bl);g(this,Pr);b(this,bl,e)}onConnect(e){b(this,Pr,new IntersectionObserver(t=>{var s,n;(n=(s=r(this,bl)).callback)==null||n.call(s,t,r(this,Pr))},r(this,bl))),r(this,Pr).observe(e),_e(o(this,ph,Cv).bind(this))}},bl=new WeakMap,Pr=new WeakMap,ph=new WeakSet,Cv=function(){var e;(e=r(this,Pr))==null||e.disconnect(),b(this,Pr,void 0)},E6);const e3=Un(),Sc=Un();function BT(i,e,t,s){return Oh(i,ei(t,Qd(s)),e)}function qT(i,e,t,s){const n=Oh(0,t,1),a=(e-i)*n/s;return i+s*Math.round(a)}const hp={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1};var ai,Mr,vl,ae,Sv,kn,Zi,Ls,fc,wv,xv,Ev,Tv,kv,_d,tr,mc,$v,Pv,Mv,Rv,Dd,w1,Cl,$n,Av,Iv,x1,E1,_v,Dv,fh,T6,FT=(T6=class extends zi{constructor(e,t){super();g(this,ae);g(this,ai);g(this,Mr);g(this,vl);g(this,kn,null);g(this,Zi,null);g(this,Ls,null);g(this,Cl);g(this,$n,!1);g(this,fh,Jr(e=>{o(this,ae,tr).call(this,o(this,ae,mc).call(this,e),e)},20,{leading:!0}));b(this,ai,e),b(this,Mr,t)}onSetup(){Vn(Sc)&&b(this,vl,Tt(Sc))}onConnect(e){I(o(this,ae,Ev).bind(this,e)),I(o(this,ae,Tv).bind(this,e)),r(this,ai).swipeGesture&&I(o(this,ae,Sv).bind(this))}},ai=new WeakMap,Mr=new WeakMap,vl=new WeakMap,ae=new WeakSet,Sv=function(){var t;const{pointer:e}=r(this,Mr).$state;if(e()!=="coarse"||!r(this,ai).swipeGesture()){b(this,kn,null),o(this,ae,fc).call(this);return}if(b(this,kn,(t=r(this,Mr).player.el)==null?void 0:t.querySelector("media-provider,[data-media-provider]")),!r(this,kn)){o(this,ae,fc).call(this);return}new Xe(r(this,kn)).add("touchstart",o(this,ae,wv).bind(this),{passive:!0}).add("touchmove",o(this,ae,xv).bind(this),{passive:!1})},kn=new WeakMap,Zi=new WeakMap,Ls=new WeakMap,fc=function(){b(this,Zi,null),b(this,Ls,null)},wv=function(e){b(this,Zi,e.touches[0])},xv=function(e){if(vs(r(this,Zi))||Xd(e))return;const t=e.touches[0],s=t.clientX-r(this,Zi).clientX,n=t.clientY-r(this,Zi).clientY,a=this.$state.dragging();!a&&Math.abs(n)>5||a||(e.preventDefault(),Math.abs(s)>20&&(b(this,Zi,t),b(this,Ls,this.$state.value()),o(this,ae,Dd).call(this,r(this,Ls),e)))},Ev=function(e){const{hidden:t}=this.$props;pt(e,"focus",o(this,ae,kv).bind(this)),!(t()||r(this,ai).isDisabled())&&new Xe(e).add("keyup",o(this,ae,Iv).bind(this)).add("keydown",o(this,ae,Av).bind(this)).add("pointerenter",o(this,ae,$v).bind(this)).add("pointermove",o(this,ae,Pv).bind(this)).add("pointerleave",o(this,ae,Mv).bind(this)).add("pointerdown",o(this,ae,Rv).bind(this))},Tv=function(e){r(this,ai).isDisabled()||!this.$state.dragging()||new Xe(document).add("pointerup",o(this,ae,_v).bind(this),{capture:!0}).add("pointermove",r(this,fh).bind(this)).add("touchmove",o(this,ae,Dv).bind(this),{passive:!1})},kv=function(){o(this,ae,tr).call(this,this.$state.value())},_d=function(e,t){var h,p,f,y;const{value:s,min:n,max:a,dragging:l}=this.$state,u=Math.max(n(),Math.min(e,a()));s.set(u);const d=this.createEvent("value-change",{detail:u,trigger:t});if(this.dispatch(d),(p=(h=r(this,ai)).onValueChange)==null||p.call(h,d),l()){const v=this.createEvent("drag-value-change",{detail:u,trigger:t});this.dispatch(v),(y=(f=r(this,ai)).onDragValueChange)==null||y.call(f,v)}},tr=function(e,t){const{pointerValue:s,dragging:n}=this.$state;s.set(e),this.dispatch("pointer-value-change",{detail:e,trigger:t}),n()&&o(this,ae,_d).call(this,e,t)},mc=function(e){let t,s=this.el.getBoundingClientRect(),{min:n,max:a}=this.$state;if(this.$props.orientation()==="vertical"){const{bottom:l,height:u}=s;t=(l-e.clientY)/u}else if(r(this,Zi)&&Si(r(this,Ls))&&r(this,kn)){const{width:l}=r(this,kn).getBoundingClientRect(),u=(e.clientX-r(this,Zi).clientX)/l,d=a()-n(),h=d*Math.abs(u);t=(u<0?r(this,Ls)-h:r(this,Ls)+h)/d}else{r(this,Zi)&&Si(r(this,Ls))&&o(this,ae,fc).call(this);const{left:l,width:u}=s;t=(e.clientX-l)/u}return Math.max(n(),Math.min(a(),r(this,ai).roundValue(qT(n(),a(),t,r(this,ai).getStep()))))},$v=function(e){this.$state.pointing.set(!0)},Pv=function(e){const{dragging:t}=this.$state;
10t()||o(this,ae,tr).call(this,o(this,ae,mc).call(this,e),e)},Mv=function(e){this.$state.pointing.set(!1)},Rv=function(e){if(e.button!==0)return;const t=o(this,ae,mc).call(this,e);o(this,ae,Dd).call(this,t,e),o(this,ae,tr).call(this,t,e)},Dd=function(e,t){var a,l,u,d;const{dragging:s}=this.$state;if(s())return;s.set(!0),r(this,Mr).remote.pauseControls(t);const n=this.createEvent("drag-start",{detail:e,trigger:t});this.dispatch(n),(l=(a=r(this,ai)).onDragStart)==null||l.call(a,n),(d=(u=r(this,vl))==null?void 0:u.onDragStart)==null||d.call(u)},w1=function(e,t){var a,l,u,d;const{dragging:s}=this.$state;if(!s())return;s.set(!1),r(this,Mr).remote.resumeControls(t);const n=this.createEvent("drag-end",{detail:e,trigger:t});this.dispatch(n),(l=(a=r(this,ai)).onDragEnd)==null||l.call(a,n),o(this,ae,fc).call(this),(d=(u=r(this,vl))==null?void 0:u.onDragEnd)==null||d.call(u)},Cl=new WeakMap,$n=new WeakMap,Av=function(e){if(!Object.keys(hp).includes(e.key))return;const{key:t}=e,s=o(this,ae,x1).call(this,e);if(!vs(s)){o(this,ae,tr).call(this,s,e),o(this,ae,_d).call(this,s,e);return}const n=o(this,ae,E1).call(this,e);r(this,$n)||(b(this,$n,t===r(this,Cl)),!this.$state.dragging()&&r(this,$n)&&o(this,ae,Dd).call(this,n,e)),o(this,ae,tr).call(this,n,e),b(this,Cl,t)},Iv=function(e){if(!Object.keys(hp).includes(e.key)||!vs(o(this,ae,x1).call(this,e)))return;const t=r(this,$n)?this.$state.pointerValue():o(this,ae,E1).call(this,e);o(this,ae,_d).call(this,t,e),o(this,ae,w1).call(this,t,e),b(this,Cl,""),b(this,$n,!1)},x1=function(e){let t=e.key,{min:s,max:n}=this.$state;return t==="Home"||t==="PageUp"?s():t==="End"||t==="PageDown"?n():!e.metaKey&&/^[0-9]$/.test(t)?(n()-s())/10*Number(t):null},E1=function(e){var v,C;const{key:t,shiftKey:s}=e;e.preventDefault(),e.stopPropagation();const{shiftKeyMultiplier:n}=this.$props,{min:a,max:l,value:u,pointerValue:d}=this.$state,h=r(this,ai).getStep(),p=r(this,ai).getKeyStep(),f=(s?p*n():p)*Number(hp[t]),y=((r(this,$n)?d():((C=(v=r(this,ai)).getValue)==null?void 0:C.call(v))??u())+f)/h;return Math.max(a(),Math.min(l(),Number((h*y).toFixed(3))))},_v=function(e){if(e.button!==0)return;e.preventDefault(),e.stopImmediatePropagation();const t=o(this,ae,mc).call(this,e);o(this,ae,tr).call(this,t,e),o(this,ae,w1).call(this,t,e)},Dv=function(e){e.preventDefault()},fh=new WeakMap,T6);const Wl=Un(()=>({}));var Op,lu,Ei,cu,uu,jt,Lv,Nv,Ov,Vv,Bv,qv,Fv,T1,mh,ts=(Op=class extends zi{constructor(e){super();g(this,jt);g(this,lu);g(this,Ei);g(this,cu,de(!0));g(this,uu,de(!0));g(this,mh,Xr((e,t)=>{var s,n;(s=this.el)==null||s.style.setProperty("--slider-fill",e+"%"),(n=this.el)==null||n.style.setProperty("--slider-pointer",t+"%")}));b(this,Ei,e)}onSetup(){b(this,lu,ut());const e=new Cs;e.attach(this),this.$state.focused=e.focused.bind(e),Vn(Wl)||_i(Wl,{default:"value"}),_i(e3,{orientation:this.$props.orientation,disabled:r(this,Ei).isDisabled,preview:de(null)}),I(o(this,jt,Ov).bind(this)),I(o(this,jt,Vv).bind(this)),I(o(this,jt,Bv).bind(this)),o(this,jt,Fv).call(this),new FT(r(this,Ei),r(this,lu)).attach(this),new vv({callback:o(this,jt,Lv).bind(this)}).attach(this)}onAttach(e){rt(e,"role","slider"),rt(e,"tabindex","0"),rt(e,"autocomplete","off"),se?o(this,jt,T1).call(this):I(o(this,jt,T1).bind(this))}onConnect(e){_e(Iy(e,r(this,cu).set)),I(o(this,jt,Nv).bind(this))}},lu=new WeakMap,Ei=new WeakMap,cu=new WeakMap,uu=new WeakMap,jt=new WeakSet,Lv=function(e){r(this,uu).set(e[0].isIntersecting)},Nv=function(){const{hidden:e}=this.$props;this.$state.hidden.set(e()||!r(this,cu).call(this)||!r(this,uu).call(this))},Ov=function(){const{dragging:e,value:t,min:s,max:n}=this.$state;Y(e)||t.set(BT(s(),n(),t(),r(this,Ei).getStep()))},Vv=function(){this.$state.step.set(r(this,Ei).getStep())},Bv=function(){if(!r(this,Ei).isDisabled())return;const{dragging:e,pointing:t}=this.$state;e.set(!1),t.set(!1)},qv=function(){return Ec(r(this,Ei).isDisabled())},Fv=function(){const{orientation:e}=this.$props,{dragging:t,active:s,pointing:n}=this.$state;this.setAttributes({"data-dragging":t,"data-pointing":n,"data-active":s,"aria-disabled":o(this,jt,qv).bind(this),"aria-valuemin":r(this,Ei).aria.valueMin??this.$state.min,"aria-valuemax":r(this,Ei).aria.valueMax??this.$state.max,"aria-valuenow":r(this,Ei).aria.valueNow,"aria-valuetext":r(this,Ei).aria.valueText,"aria-orientation":e})},T1=function(){const{fillPercent:e,pointerPercent:t}=this.$state;r(this,mh).call(this,ei(e(),3),ei(t(),3))},mh=new WeakMap,O(Op,"props",{hidden:!1,disabled:!1,step:1,keyStep:1,orientation:"horizontal",shiftKeyMultiplier:5}),Op),ad,tn,Wv,Hv,jv,Gv,Fu=(ad=class extends Ne{constructor(){super();g(this,tn);new ts({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.$props.disabled,aria:{valueNow:o(this,tn,Wv).bind(this),valueText:o(this,tn,Hv).bind(this)}})}onSetup(){I(o(this,tn,jv).bind(this)),I(o(this,tn,Gv).bind(this))}},tn=new WeakSet,Wv=function(){const{value:e}=this.$state;return Math.round(e())},Hv=function(){const{value:e,max:t}=this.$state;return ei(e()/t()*100,2)+"%"},jv=function(){const{value:e}=this.$props;this.$state.value.set(e())},Gv=function(){const{min:e,max:t}=this.$props;this.$state.min.set(e()),this.$state.max.set(t())},O(ad,"props",{...ts.props,min:0,max:100,value:0}),O(ad,"state",Co),ad);const rn=new Map,td=new Map;var du,Sl,hu,xt,zv,Uv,k1,$1,P1,M1,Kv,Ld,wl,WT=(wl=class{constructor(e,t,s){g(this,xt);g(this,du);g(this,Sl);g(this,hu);O(this,"$images",de([]));b(this,Sl,e),b(this,hu,t),b(this,du,s),I(o(this,xt,zv).bind(this))}static create(e,t){return new wl(e,t,ut())}},du=new WeakMap,Sl=new WeakMap,hu=new WeakMap,xt=new WeakSet,zv=function(){var s;const{canLoad:e}=r(this,du).$state;if(!e())return;const t=r(this,Sl).call(this);if(t){if(le(t)&&rn.has(t)){const n=rn.get(t);if(rn.delete(t),rn.set(t,n),rn.size>99){const a=rn.keys().next().value;rn.delete(a)}this.$images.set(rn.get(t))}else if(le(t)){const n=r(this,hu).call(this),a=t+"::"+n;if(!td.has(a)){const l=new Promise(async(u,d)=>{try{const h=await fetch(t,{credentials:Io(n)});if(h.headers.get("content-type")==="application/json"){const p=await h.json();if(wt(p))if(p[0]&&"text"in p[0])u(o(this,xt,$1).call(this,p));else{for(let f=0;f<p.length;f++){const y=p[f];ks(gg(y),!1),ks("url"in y&&le(y.url),!1),ks("startTime"in y&&Si(y.startTime),!1)}u(p)}else u(o(this,xt,k1).call(this,p));return}mi(()=>import("./prod-DbD_yNsS.js").then(p=>p.d),__vite__mapDeps([0,1,2])).then(async({parseResponse:p})=>{try{const{cues:f}=await p(h);u(o(this,xt,$1).call(this,f))}catch(f){d(f)}})}catch(h){d(h)}}).then(u=>(rn.set(a,u),u)).catch(u=>{o(this,xt,Ld).call(this,t,u)}).finally(()=>{le(a)&&td.delete(a)});td.set(a,l)}(s=td.get(a))==null||s.then(l=>{this.$images.set(l||[])})}else if(wt(t))try{this.$images.set(o(this,xt,Uv).call(this,t))}catch(n){o(this,xt,Ld).call(this,t,n)}else try{this.$images.set(o(this,xt,k1).call(this,t))}catch(n){o(this,xt,Ld).call(this,t,n)}return()=>{this.$images.set([])}}},Uv=function(e){const t=o(this,xt,P1).call(this);return e.map((s,n)=>(ks(s.url&&le(s.url),!1),ks("startTime"in s&&Si(s.startTime),!1),{...s,url:le(s.url)?o(this,xt,M1).call(this,s.url,t):s.url}))},k1=function(e){var l;ks(le(e.url),!1),ks(wt(e.tiles)&&((l=e.tiles)==null?void 0:l.length),!1);const t=new URL(e.url),s=[],n="tile_width"in e?e.tile_width:e.tileWidth,a="tile_height"in e?e.tile_height:e.tileHeight;
10for(const u of e.tiles)s.push({url:t,startTime:"start"in u?u.start:u.startTime,width:n,height:a,coords:{x:u.x,y:u.y}});return s},$1=function(e){for(let n=0;n<e.length;n++){const a=e[n];ks("startTime"in a&&Si(a.startTime),!1),ks("text"in a&&le(a.text),!1)}const t=[],s=o(this,xt,P1).call(this);for(const n of e){const[a,l]=n.text.split("#"),u=o(this,xt,Kv).call(this,l);t.push({url:o(this,xt,M1).call(this,a,s),startTime:n.startTime,endTime:n.endTime,width:u==null?void 0:u.w,height:u==null?void 0:u.h,coords:u&&Si(u.x)&&Si(u.y)?{x:u.x,y:u.y}:void 0})}return t},P1=function(){let e=Y(r(this,Sl));return!le(e)||!/^https?:/.test(e)?location.href:e},M1=function(e,t){return/^https?:/.test(e)?new URL(e):new URL(e,t)},Kv=function(e){if(!e)return{};const[t,s]=e.split("="),n=s==null?void 0:s.split(","),a={};if(!t||!n)return null;for(let l=0;l<t.length;l++){const u=+n[l];isNaN(u)||(a[t[l]]=u)}return a},Ld=function(e,t){},wl);const HT=2,jT=32,Jn=new Map;var od,Ga,xl,ze,Zv,R1,Yv,Xv,Jv,e5,A1,t5,i5,s5,I1,ir,n5,Qv=(od=class extends Ne{constructor(){super(...arguments);g(this,ze);O(this,"media");g(this,Ga);g(this,xl,[])}onSetup(){this.media=ut(),b(this,Ga,WT.create(this.$props.src,this.$state.crossOrigin)),o(this,ze,R1).call(this),this.setAttributes({"data-loading":o(this,ze,e5).bind(this),"data-error":o(this,ze,A1).bind(this),"data-hidden":this.$state.hidden,"aria-hidden":li(this.$state.hidden)})}onConnect(t){I(o(this,ze,Zv).bind(this)),I(o(this,ze,t5).bind(this)),I(o(this,ze,R1).bind(this)),I(o(this,ze,Yv).bind(this)),I(o(this,ze,i5).bind(this)),I(o(this,ze,s5).bind(this)),I(o(this,ze,I1).bind(this))}getTime(){return this.$props.time()}},Ga=new WeakMap,xl=new WeakMap,ze=new WeakSet,Zv=function(){const t=this.$state.img();t&&new Xe(t).add("load",o(this,ze,Xv).bind(this)).add("error",o(this,ze,Jv).bind(this))},R1=function(){const{crossOrigin:t}=this.$props,{crossOrigin:s}=this.$state,{crossOrigin:n}=this.media.$state,a=t()!==null?t():n();s.set(a===!0?"anonymous":a)},Yv=function(){const{src:t,loading:s,error:n}=this.$state;return t()&&(s.set(!0),n.set(null)),()=>{o(this,ze,n5).call(this),s.set(!1),n.set(null)}},Xv=function(){const{loading:t,error:s}=this.$state;o(this,ze,I1).call(this),t.set(!1),s.set(null)},Jv=function(t){const{loading:s,error:n}=this.$state;s.set(!1),n.set(t)},e5=function(){const{loading:t,hidden:s}=this.$state;return!s()&&t()},A1=function(){const{error:t}=this.$state;return!vs(t())},t5=function(){const{hidden:t}=this.$state,{duration:s}=this.media.$state,n=r(this,Ga).$images();t.set(o(this,ze,A1).call(this)||!Number.isFinite(s())||n.length===0)},i5=function(){let t=r(this,Ga).$images();if(!t.length)return;let s=this.getTime(),{src:n,activeThumbnail:a}=this.$state,l=-1,u=null;for(let d=t.length-1;d>=0;d--){const h=t[d];if(s>=h.startTime&&(!h.endTime||s<h.endTime)){l=d;break}}t[l]&&(u=t[l]),n.set((u==null?void 0:u.url.href)||""),a.set(u)},s5=function(){if(se)return;const t=r(this,Ga).$images(),s=this.$state.activeThumbnail();if(!s)return;const n=t.indexOf(s);if(n<0)return;const a=s.url.href,l=this.$state.crossOrigin(),u=n+1,d=Math.min(u+HT,t.length);for(let h=u;h<d;h++){const p=t[h].url.href;p!==a&&GT(p,l)}},I1=function(){if(!this.scope||this.$state.hidden())return;const t=this.el,s=this.$state.img(),n=this.$state.activeThumbnail();if(!s||!n||!t)return;let a=n.width??s.naturalWidth,l=(n==null?void 0:n.height)??s.naturalHeight,{maxWidth:u,maxHeight:d,minWidth:h,minHeight:p,width:f,height:y}=getComputedStyle(this.el);h==="100%"&&(h=parseFloat(f)+""),p==="100%"&&(p=parseFloat(y)+"");let v=Math.max(parseInt(h)/a,parseInt(p)/l),C=Math.min(Math.max(parseInt(h),parseInt(u))/a,Math.max(parseInt(p),parseInt(d))/l),S=!isNaN(C)&&C<1?C:v>1?v:1;o(this,ze,ir).call(this,t,"--thumbnail-width",`${a*S}px`),o(this,ze,ir).call(this,t,"--thumbnail-height",`${l*S}px`),o(this,ze,ir).call(this,t,"--thumbnail-aspect-ratio",String(ei(a/l,5))),o(this,ze,ir).call(this,s,"width",`${s.naturalWidth*S}px`),o(this,ze,ir).call(this,s,"height",`${s.naturalHeight*S}px`),o(this,ze,ir).call(this,s,"transform",n.coords?`translate(-${n.coords.x*S}px, -${n.coords.y*S}px)`:""),o(this,ze,ir).call(this,s,"max-width","none")},ir=function(t,s,n){t.style.setProperty(s,n),r(this,xl).push(()=>t.style.removeProperty(s))},n5=function(){for(const t of r(this,xl))t();b(this,xl,[])},O(od,"props",{src:null,time:0,crossOrigin:null}),O(od,"state",new Kn({src:"",img:null,thumbnails:[],activeThumbn
10ail:null,crossOrigin:null,loading:!1,error:null,hidden:!1})),od);function GT(i,e){const t=`${i}::${e}`;if(Jn.has(t)){const n=Jn.get(t);Jn.delete(t),Jn.set(t,n);return}const s=new Image;if(s.decoding="async",s.crossOrigin=e,s.src=i,Jn.set(t,s),Jn.size>jT){const n=Jn.keys().next().value;Jn.delete(n)}}var pu,k6,zT=(k6=class extends Qv{constructor(){super(...arguments);g(this,pu)}onAttach(e){b(this,pu,Zl(Fu.state))}getTime(){const{duration:e,clipStartTime:t}=this.media.$state;return t()+r(this,pu).pointerRate()*e()}},pu=new WeakMap,k6),ld,Rr,fu,Ct,a5,o5,_1,l5,D1,c5,u5,L1,d5,h5,r5=(ld=class extends Ne{constructor(){super(...arguments);g(this,Ct);g(this,Rr);g(this,fu)}get video(){return this.$state.video()}onSetup(){b(this,Rr,ut()),b(this,fu,Zl(Fu.state)),o(this,Ct,_1).call(this),this.setAttributes({"data-loading":o(this,Ct,l5).bind(this),"data-hidden":this.$state.hidden,"data-error":o(this,Ct,D1).bind(this),"aria-hidden":li(this.$state.hidden)})}onAttach(e){I(o(this,Ct,a5).bind(this)),I(o(this,Ct,o5).bind(this)),I(o(this,Ct,_1).bind(this)),I(o(this,Ct,c5).bind(this)),I(o(this,Ct,u5).bind(this)),I(o(this,Ct,h5).bind(this))}},Rr=new WeakMap,fu=new WeakMap,Ct=new WeakSet,a5=function(){const e=this.$state.video();e&&(e.readyState>=2&&o(this,Ct,L1).call(this),new Xe(e).add("canplay",o(this,Ct,L1).bind(this)).add("error",o(this,Ct,d5).bind(this)))},o5=function(){const{src:e}=this.$state,{canLoad:t}=r(this,Rr).$state;e.set(t()?this.$props.src():null)},_1=function(){const{crossOrigin:e}=this.$props,{crossOrigin:t}=this.$state,{crossOrigin:s}=r(this,Rr).$state,n=e()!==null?e():s();t.set(n===!0?"anonymous":n)},l5=function(){const{canPlay:e,hidden:t}=this.$state;return!e()&&!t()},D1=function(){const{error:e}=this.$state;return!vs(e)},c5=function(){const{src:e,hidden:t}=this.$state,{canLoad:s,duration:n}=r(this,Rr).$state;t.set(s()&&(!e()||o(this,Ct,D1).call(this)||!Number.isFinite(n())))},u5=function(){const{src:e,canPlay:t,error:s}=this.$state;e(),t.set(!1),s.set(null)},L1=function(e){const{canPlay:t,error:s}=this.$state;t.set(!0),s.set(null),this.dispatch("can-play",{trigger:e})},d5=function(e){const{canPlay:t,error:s}=this.$state;t.set(!1),s.set(e),this.dispatch("error",{trigger:e})},h5=function(){const{video:e,canPlay:t}=this.$state,{duration:s}=r(this,Rr).$state,{pointerRate:n}=r(this,fu),a=e();t()&&a&&Number.isFinite(s())&&Number.isFinite(n())&&(a.currentTime=n()*s())},O(ld,"props",{src:null,crossOrigin:null}),O(ld,"state",new Kn({video:null,src:null,crossOrigin:null,canPlay:!1,error:null,hidden:!1})),ld);const UT=r5.prototype;at(UT,"video");var Vp,Ar,gh,mu,p5=(Vp=class extends Ne{constructor(){super(...arguments);g(this,Ar);g(this,gh);g(this,mu)}onSetup(){b(this,mu,Zl(Fu.state)),b(this,Ar,Tt(Wl)),b(this,gh,On(this.getValueText.bind(this)))}getValueText(){var C,S;const{type:e,format:t,decimalPlaces:s,padHours:n,padMinutes:a,showHours:l,showMs:u}=this.$props,{value:d,pointerValue:h,min:p,max:f}=r(this,mu),y=(t==null?void 0:t())??r(this,Ar).default,v=e()==="current"?d():h();if(y==="percent"){const w=v/(f()-p())*100;return(r(this,Ar).percent??ei)(w,s())+"%"}else return y==="time"?(r(this,Ar).time??Vh)(v,{padHrs:n(),padMins:a(),showHrs:l(),showMs:u()}):(((S=(C=r(this,Ar)).value)==null?void 0:S.call(C,v))??v.toFixed(2))+""}},Ar=new WeakMap,gh=new WeakMap,mu=new WeakMap,O(Vp,"props",{type:"pointer",format:null,showHours:!1,showMs:!1,padHours:null,padMinutes:null,decimalPlaces:2}),Vp);const KT=p5.prototype;Ut(KT,"getValueText");var Bp,El,gu,QT=(Bp=class extends Ne{constructor(){super(...arguments);g(this,El);g(this,gu,Xr(()=>{const{disabled:e,orientation:t}=r(this,El);if(e())return;const s=this.el,{offset:n,noClamp:a}=this.$props;s&&ZT(s,{clamp:!a(),offset:n(),orientation:t()})}))}onSetup(){b(this,El,Tt(e3));const{active:e}=Zl(Fu.state);this.setAttributes({"data-visible":e})}onAttach(e){Object.assign(e.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(e){const{preview:t}=r(this,El);t.set(e),_e(()=>t.set(null)),I(r(this,gu).bind(this));const s=new ResizeObserver(r(this,gu).bind(this));s.observe(e),_e(()=>s.disconnect())}},El=new WeakMap,gu=new WeakMap,O(Bp,"props",{offset:0,noClamp:!1}),Bp);function ZT(i,{clamp:e,offset:t,orientation:s}){const n=getComputedStyle(i),a=parseFloat(n.width),l=parseFloat(n.height),u={top:null,right:null,bottom:null,left:null};if(u[s==="horizontal"?"bottom":"left"]=`calc(100% + var(--media-slider-preview-offset, ${t}px))`,s==="horizontal"){const d=a/2;e?u.left=`min(${`max(0px, calc(var(--slider-pointer) - ${d}px))`}, ${`calc(100% - ${a}px)`})`:u.left=`calc(var(--slider-pointer) - ${d}px)`}else{const d=l/2;e?u.bottom=`min(${`max(${d}px, calc(var(--slider-pointer) - ${d}px))`}, ${`calc(100% - ${l}
10px)`})`:u.bottom=`calc(var(--slider-pointer) - ${d}px)`}Object.assign(i.style,u)}var cd,Yi,ti,f5,m5,g5,y5,b5,yu,v5,C5,S5,YT=(cd=class extends Ne{constructor(){super(...arguments);g(this,ti);g(this,Yi);g(this,yu,Jr(o(this,ti,v5).bind(this),25))}onSetup(){b(this,Yi,ut());const{audioGain:e}=r(this,Yi).$state;_i(Wl,{default:"percent",value(t){return(t*(e()??1)).toFixed(2)},percent(t){return Math.round(t*(e()??1))}}),new ts({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:o(this,ti,y5).bind(this),aria:{valueMax:o(this,ti,g5).bind(this),valueNow:o(this,ti,f5).bind(this),valueText:o(this,ti,m5).bind(this)},onDragValueChange:o(this,ti,S5).bind(this),onValueChange:o(this,ti,C5).bind(this)}).attach(this),I(o(this,ti,b5).bind(this))}onAttach(e){e.setAttribute("data-media-volume-slider",""),rt(e,"aria-label","Volume");const{canSetVolume:t}=r(this,Yi).$state;this.setAttributes({"data-supported":t,"aria-hidden":li(()=>!t())})}},Yi=new WeakMap,ti=new WeakSet,f5=function(){const{value:e}=this.$state,{audioGain:t}=r(this,Yi).$state;return Math.round(e()*(t()??1))},m5=function(){const{value:e,max:t}=this.$state,{audioGain:s}=r(this,Yi).$state;return ei(e()/t()*(s()??1)*100,2)+"%"},g5=function(){const{audioGain:e}=r(this,Yi).$state;return this.$state.max()*(e()??1)},y5=function(){const{disabled:e}=this.$props,{canSetVolume:t}=r(this,Yi).$state;return e()||!t()},b5=function(){const{muted:e,volume:t}=r(this,Yi).$state,s=e()?0:t()*100;this.$state.value.set(s),this.dispatch("value-change",{detail:s})},yu=new WeakMap,v5=function(e){if(!e.trigger)return;const t=ei(e.detail/100,3);r(this,Yi).remote.changeVolume(t,e)},C5=function(e){r(this,yu).call(this,e)},S5=function(e){r(this,yu).call(this,e)},O(cd,"props",{...ts.props,keyStep:5,shiftKeyMultiplier:2}),O(cd,"state",Co),cd),ud,Ir,Gt,w5,x5,E5,T5,k5,N1,$5,P5,XT=(ud=class extends Ne{constructor(){super(...arguments);g(this,Gt);g(this,Ir)}onSetup(){b(this,Ir,ut()),_i(Wl,{default:"percent",percent:(e,t)=>ei(this.$state.value(),t)+"%"}),new ts({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:o(this,Gt,k5).bind(this),aria:{valueNow:o(this,Gt,w5).bind(this),valueText:o(this,Gt,x5).bind(this)},onDragValueChange:o(this,Gt,P5).bind(this),onValueChange:o(this,Gt,$5).bind(this)}).attach(this),I(o(this,Gt,E5).bind(this)),I(o(this,Gt,T5).bind(this))}onAttach(e){e.setAttribute("data-media-audio-gain-slider",""),rt(e,"aria-label","Audio Boost");const{canSetAudioGain:t}=r(this,Ir).$state;this.setAttributes({"data-supported":t,"aria-hidden":li(()=>!t())})}},Ir=new WeakMap,Gt=new WeakSet,w5=function(){const{value:e}=this.$state;return Math.round(e())},x5=function(){const{value:e}=this.$state;return e()+"%"},E5=function(){const{min:e,max:t}=this.$props;this.$state.min.set(e()),this.$state.max.set(t())},T5=function(){const{audioGain:e}=r(this,Ir).$state,t=((e()??1)-1)*100;this.$state.value.set(t),this.dispatch("value-change",{detail:t})},k5=function(){const{disabled:e}=this.$props,{canSetAudioGain:t}=r(this,Ir).$state;return e()||!t()},N1=function(e){if(!e.trigger)return;const t=ei(1+e.detail/100,2);r(this,Ir).remote.changeAudioGain(t,e)},$5=function(e){o(this,Gt,N1).call(this,e)},P5=function(e){o(this,Gt,N1).call(this,e)},O(ud,"props",{...ts.props,step:25,keyStep:25,shiftKeyMultiplier:2,min:0,max:300}),O(ud,"state",Co),ud),dd,_r,Vt,M5,R5,A5,I5,_5,D5,bu,L5,N5,O5,JT=(dd=class extends Ne{constructor(){super(...arguments);g(this,Vt);g(this,_r);g(this,bu,Jr(o(this,Vt,L5).bind(this),25))}onSetup(){b(this,_r,ut()),new ts({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:o(this,Vt,_5),isDisabled:o(this,Vt,D5).bind(this),aria:{valueNow:o(this,Vt,M5).bind(this),valueText:o(this,Vt,R5).bind(this)},onDragValueChange:o(this,Vt,O5).bind(this),onValueChange:o(this,Vt,N5).bind(this)}).attach(this),I(o(this,Vt,A5).bind(this)),I(o(this,Vt,I5).bind(this))}onAttach(e){e.setAttribute("data-media-speed-slider",""),rt(e,"aria-label","Speed");const{canSetPlaybackRate:t}=r(this,_r).$state;this.setAttributes({"data-supported":t,"aria-hidden":li(()=>!t())})}},_r=new WeakMap,Vt=new WeakSet,M5=function(){const{value:e}=this.$state;return e()},R5=function(){const{value:e}=this.$state;return e()+"x"},A5=function(){const{min:e,max:t}=this.$props;this.$state.min.set(e()),this.$state.max.set(t())},I5=function(){const{playbackRate:e}=r(this,_r).$state,t=e();this.$state.value.set(t),this.dispatch("value-change",{detail:t})},_5=function(e){return ei(e,2)},D5=function(){const{disabled:e}=this.$props,{canSetPlaybackRate:t}=r(this,_r).$state;return e()||!t()},bu=new WeakMap,L5=function(e){if(!e.trigger)return;const t=e.detail;r(this,_r).remote.changePlaybackRate(t,e)},N5=function(e){r(this,bu).call(this,e)},O5=function(e){r(this,bu).call(this,e)},O(dd,"props",{...ts.props,step:.25,keyStep:.25,shiftKeyMultiplier:2,min:0,max:2}),O(dd,"state",Co),dd),hd,fs,Tl,ii,V5,B5,q5,F5,W5,vu,H5,j5,G5,ek=(hd=class extends Ne{constructor(){super(...arguments);g(this,ii);g(this,fs);g(this,Tl,On(()=>{const{qualities:e}=r(this,fs).$state;return jy(e())}));g(this,vu,Jr(o(this,ii,H5).bind(this),25))}onSetup(){b(this,fs,ut()),new ts({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:o(this,ii,W5).bind(this),aria:{valueNow:o(this,ii,V5).bind(this),valueText:o(this,ii,B
105).bind(this)},onDragValueChange:o(this,ii,G5).bind(this),onValueChange:o(this,ii,j5).bind(this)}).attach(this),I(o(this,ii,q5).bind(this)),I(o(this,ii,F5).bind(this))}onAttach(e){e.setAttribute("data-media-quality-slider",""),rt(e,"aria-label","Video Quality");const{qualities:t,canSetQuality:s}=r(this,fs).$state,n=On(()=>s()&&t().length>0);this.setAttributes({"data-supported":n,"aria-hidden":li(()=>!n())})}},fs=new WeakMap,Tl=new WeakMap,ii=new WeakSet,V5=function(){const{value:e}=this.$state;return e()},B5=function(){const{quality:e}=r(this,fs).$state;if(!e())return"";const{height:t,bitrate:s}=e(),n=s&&s>0?`${(s/1e6).toFixed(2)} Mbps`:null;return t?`${t}p${n?` (${n})`:""}`:"Auto"},q5=function(){const e=r(this,Tl).call(this);this.$state.max.set(Math.max(0,e.length-1))},F5=function(){let{quality:e}=r(this,fs).$state,t=r(this,Tl).call(this),s=Math.max(0,t.indexOf(e()));this.$state.value.set(s),this.dispatch("value-change",{detail:s})},W5=function(){const{disabled:e}=this.$props,{canSetQuality:t,qualities:s}=r(this,fs).$state;return e()||s().length<=1||!t()},vu=new WeakMap,H5=function(e){if(!e.trigger)return;const{qualities:t}=r(this,fs),s=Y(r(this,Tl))[e.detail];r(this,fs).remote.changeQuality(t.indexOf(s),e)},j5=function(e){r(this,vu).call(this,e)},G5=function(e){r(this,vu).call(this,e)},O(hd,"props",{...ts.props,step:1,keyStep:1,shiftKeyMultiplier:1}),O(hd,"state",Co),hd),pd,vt,kl,Cu,ce,U5,K5,Q5,Z5,Y5,O1,X5,$l,J5,e4,V1,t4,B1,i4,s4,n4,r4,a4,o4,ra,l4,c4,u4,z5=(pd=class extends Ne{constructor(){super();g(this,ce);g(this,vt);g(this,kl);g(this,Cu,de(null));g(this,$l,!1);const{noSwipeGesture:e}=this.$props;new ts({swipeGesture:()=>!e(),getValue:o(this,ce,B1).bind(this),getStep:o(this,ce,i4).bind(this),getKeyStep:o(this,ce,s4).bind(this),roundValue:o(this,ce,n4),isDisabled:o(this,ce,r4).bind(this),aria:{valueNow:o(this,ce,a4).bind(this),valueText:o(this,ce,o4).bind(this)},onDragStart:o(this,ce,J5).bind(this),onDragValueChange:o(this,ce,e4).bind(this),onDragEnd:o(this,ce,V1).bind(this),onValueChange:o(this,ce,t4).bind(this)})}onSetup(){b(this,vt,ut()),_i(Wl,{default:"time",value:o(this,ce,c4).bind(this),time:o(this,ce,u4).bind(this)}),this.setAttributes({"data-chapters":o(this,ce,K5).bind(this)}),this.setStyles({"--slider-progress":o(this,ce,U5).bind(this)}),I(o(this,ce,Z5).bind(this)),I(o(this,ce,Q5).bind(this))}onAttach(e){e.setAttribute("data-media-time-slider",""),rt(e,"aria-label","Seek")}onConnect(e){I(o(this,ce,Y5).bind(this)),Vu(r(this,vt).textTracks,"chapters",r(this,Cu).set)}},vt=new WeakMap,kl=new WeakMap,Cu=new WeakMap,ce=new WeakSet,U5=function(){const{bufferedEnd:e,duration:t}=r(this,vt).$state;return ei(Math.min(e()/Math.max(t(),1),1)*100,3)+"%"},K5=function(){var t;const{duration:e}=r(this,vt).$state;return((t=r(this,Cu).call(this))==null?void 0:t.cues.length)&&Number.isFinite(e())&&e()>0},Q5=function(){b(this,kl,Jr(o(this,ce,O1).bind(this),this.$props.seekingRequestThrottle()))},Z5=function(){if(this.$state.hidden())return;const{value:e,dragging:t}=this.$state,s=o(this,ce,B1).call(this);Y(t)||(e.set(s),this.dispatch("value-change",{detail:s}))},Y5=function(){const e=r(this,vt).player.el,{preview:t}=Tt(e3);e&&t()&&we(e,"data-preview",this.$state.active())},O1=function(e,t){r(this,vt).remote.seeking(e,t)},X5=function(e,t,s){r(this,kl).cancel();const{live:n}=r(this,vt).$state;if(n()&&t>=99){r(this,vt).remote.seekToLiveEdge(s);return}r(this,vt).remote.seek(e,s)},$l=new WeakMap,J5=function(e){const{pauseWhileDragging:t}=this.$props;if(t()){const{paused:s}=r(this,vt).$state;b(this,$l,!s()),r(this,vt).remote.pause(e)}},e4=function(e){r(this,kl).call(this,o(this,ce,ra).call(this,e.detail),e)},V1=function(e){const{seeking:t}=r(this,vt).$state;Y(t)||o(this,ce,O1).call(this,o(this,ce,ra).call(this,e.detail),e);const s=e.detail;o(this,ce,X5).call(this,o(this,ce,ra).call(this,s),s,e);const{pauseWhileDragging:n}=this.$props;n()&&r(this,$l)&&(r(this,vt).remote.play(e),b(this,$l,!1))},t4=function(e){const{dragging:t}=this.$state;t()||!e.trigger||o(this,ce,V1).call(this,e)},B1=function(){const{currentTime:e}=r(this,vt).$state;return o(this,ce,l4).call(this,e())},i4=function(){const e=this.$props.step()/r(this,vt).$state.duration()*100;return Number.isFinite(e)?e:1},s4=function(){const e=this.$props.keyStep()/r(this,vt).$state.duration()*100;return Number.isFinite(e)?e:1},n4=function(e){return ei(e,3)},r4=function(){const{disabled:e}=this.$props,{canSeek:t}=r(this,vt).$state;return e()||!t()},a4=function(){const{value:e}=this.$state;return Math.round(e())},o4=function(){const e=o(this,ce,ra).call(this,this.$state.value()),{duration:t}=r(this,vt).$state;return Number.isFinite(e)?`${eh(e)} out of ${eh(t())}`:"live"},ra=function(e){const{duration:t}=r(this,vt).$state;return ei(e/100*t(),5)},l4=function(e){const{liveEdge:t,duration:s}=r(this,vt).$state,n=Math.max(0,Math.min(1,t()?1:Math.min(e,s())/s()));return Number.isNaN(n)?0:Number.isFinite(n)?n*100:100},c4=function(e){const t=o(this,ce,ra).call(this,e),{live:s,duration:n}=r(this,vt).$state;return Number.isFinite(t)?(s()?t-n():t).toFixed(0):"LIVE"},u4=function(e,t){const s=o(this,ce,ra).call(this,e),{live:n,duration:a}=r(this,vt).$state,l=n()?s-a():s;return Number.isFinite(s)?`${l<0?"-":""}${Vh(Math.abs(l),t)}`:"LIVE"},O(pd,"props",{...ts.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100}),O(pd,"state",Co),pd),qp,Ti,za,Pl,Ns,yi,Ua,bi,Pn,Ka,Dr,ue,q1,F1,h4,p4,f4,m4,g4,Nd,W1,H1,y4,yh,bh,b4,Od,Vd,v4,C4,S4,w4,Su,x4,E4,T4,d4=(qp=class extends Ne{constructor(){super(...arguments);g(this,ue);g(this,Ti);g(this,za);g(this,Pl);g(this,Ns,null);g(this,yi,[]);g(this,Ua,de(null));g(this,bi,de([]));g(this,Pn,de(-1));g(this,Ka,de(-1));g(this,Dr,0);g(this,yh,Xr(e=>{var u;let t,s=r(this,bi).call(this),{seekableStart:n}=r(this,Ti).$state,a=n(),l=o(this,ue,Od).call(this,s);for(let d=r(this,Dr);d<r(this,yi).length;d++)if(t=o(this,ue,Vd).call(this,s[d],e,a,l),(u=r(this,yi)[d])==null||u.style.setProperty("--chapter-progress",t+"%"),t<100){b(this,Dr,d);break}}
10));g(this,bh,On(o(this,ue,b4).bind(this)));g(this,Su,Ih(()=>{const e=Y(r(this,Ua));!this.scope||!e||!e.cues.length||(r(this,bi).set(o(this,ue,v4).call(this,e.cues)),r(this,Pn).set(0),b(this,Dr,0))},150,!0))}get cues(){return r(this,bi).call(this)}get activeCue(){return r(this,bi).call(this)[r(this,Pn).call(this)]||null}get activePointerCue(){return r(this,bi).call(this)[r(this,Ka).call(this)]||null}onSetup(){b(this,Ti,ut()),b(this,za,Zl(z5.state))}onAttach(e){Vu(r(this,Ti).textTracks,"chapters",o(this,ue,q1).bind(this)),I(o(this,ue,C4).bind(this))}onConnect(){_e(()=>o(this,ue,F1).bind(this))}onDestroy(){o(this,ue,q1).call(this,null)}setRefs(e){var t;if(b(this,yi,e),(t=r(this,Pl))==null||t.dispose(),r(this,yi).length===1){const s=r(this,yi)[0];s.style.width="100%",s.style.setProperty("--chapter-fill","var(--slider-fill)"),s.style.setProperty("--chapter-progress","var(--slider-progress)")}else r(this,yi).length>0&&Wt(()=>o(this,ue,h4).call(this),b(this,Pl,oo()))}},Ti=new WeakMap,za=new WeakMap,Pl=new WeakMap,Ns=new WeakMap,yi=new WeakMap,Ua=new WeakMap,bi=new WeakMap,Pn=new WeakMap,Ka=new WeakMap,Dr=new WeakMap,ue=new WeakSet,q1=function(e){Y(r(this,Ua))!==e&&(o(this,ue,F1).call(this),r(this,Ua).set(e))},F1=function(){var e;b(this,yi,[]),r(this,bi).set([]),r(this,Pn).set(-1),r(this,Ka).set(-1),b(this,Dr,0),(e=r(this,Pl))==null||e.dispose()},h4=function(){r(this,yi).length&&I(o(this,ue,p4).bind(this))},p4=function(){const{hidden:e}=r(this,za);e()||(I(o(this,ue,f4).bind(this)),I(o(this,ue,m4).bind(this)),I(o(this,ue,g4).bind(this)),I(o(this,ue,y4).bind(this)))},f4=function(){const e=r(this,bi).call(this);if(!e.length)return;let t,{seekableStart:s,seekableEnd:n}=r(this,Ti).$state,a=s(),l=(n()||e[e.length-1].endTime)-a,u=100;for(let d=0;d<e.length;d++)if(t=e[d],r(this,yi)[d]){const h=d===e.length-1?u:ei((t.endTime-Math.max(a,t.startTime))/l*100,3);r(this,yi)[d].style.width=h+"%",u-=h}},m4=function(){let{liveEdge:e,seekableStart:t,seekableEnd:s}=r(this,Ti).$state,{fillPercent:n,value:a}=r(this,za),l=r(this,bi).call(this),u=e(),d=Y(r(this,Pn)),h=l[d],p=u?r(this,bi).length-1:o(this,ue,H1).call(this,h&&h.startTime/s()*100<=Y(a)?d:0,n());u||!h?o(this,ue,Nd).call(this,0,l.length,100):p>d?o(this,ue,Nd).call(this,d,p,100):p<d&&o(this,ue,Nd).call(this,p+1,d+1,0);const f=u?100:o(this,ue,Vd).call(this,l[p],n(),t(),o(this,ue,Od).call(this,l));o(this,ue,W1).call(this,r(this,yi)[p],f),r(this,Pn).set(p)},g4=function(){let{hidden:e,pointerPercent:t}=r(this,za);if(e()){r(this,Ka).set(-1);return}const s=o(this,ue,H1).call(this,0,t());r(this,Ka).set(s)},Nd=function(e,t,s){for(let n=e;n<t;n++)o(this,ue,W1).call(this,r(this,yi)[n],s)},W1=function(e,t){e&&(e.style.setProperty("--chapter-fill",t+"%"),we(e,"data-active",t>0&&t<100),we(e,"data-ended",t===100))},H1=function(e,t){let s=0,n=r(this,bi).call(this);if(t===0)return 0;if(t===100)return n.length-1;let{seekableStart:a}=r(this,Ti).$state,l=a(),u=o(this,ue,Od).call(this,n);for(let d=e;d<n.length;d++)if(s=o(this,ue,Vd).call(this,n[d],t,l,u),s>=0&&s<100)return d;return 0},y4=function(){r(this,yh).call(this,r(this,bh).call(this))},yh=new WeakMap,bh=new WeakMap,b4=function(){const{bufferedEnd:e,duration:t}=r(this,Ti).$state;return ei(Math.min(e()/Math.max(t(),1),1),3)*100},Od=function(e){var n;const{seekableEnd:t}=r(this,Ti).$state,s=t();return Number.isFinite(s)?s:((n=e[e.length-1])==null?void 0:n.endTime)||0},Vd=function(e,t,s,n){if(!e||r(this,bi).call(this).length===0)return 0;const a=n-s,l=Math.max(0,e.startTime-s),u=Math.min(n,e.endTime)-s,d=l/a,h=d*100,p=Math.min(1,d+(u-l)/a)*100;return Math.max(0,ei(t>=p?100:(t-h)/(p-h)*100,3))},v4=function(e){let t=[],{seekableStart:s,seekableEnd:n,duration:a}=r(this,Ti).$state,l=s(),u=n();e=e.filter(p=>p.startTime<=u&&p.endTime>=l);const d=e[0];d&&d.startTime>l&&t.push(new window.VTTCue(l,d.startTime,""));for(let p=0;p<e.length-1;p++){const f=e[p],y=e[p+1];if(t.push(f),y){const v=y.startTime-f.endTime;v>0&&t.push(new window.VTTCue(f.endTime,f.endTime+v,""))}}const h=e[e.length-1];if(h){t.push(h);const p=a();p>=0&&p-h.endTime>1&&t.push(new window.VTTCue(h.endTime,a(),""))}return t},C4=function(){const{source:e}
10=r(this,Ti).$state;e(),o(this,ue,S4).call(this)},S4=function(){if(!this.scope)return;const{disabled:e}=this.$props;if(e()){r(this,bi).set([]),r(this,Pn).set(0),b(this,Dr,0);return}const t=r(this,Ua).call(this);if(t){const s=r(this,Su).bind(this);s(),new Xe(t).add("add-cue",s).add("remove-cue",s),I(o(this,ue,w4).bind(this))}return b(this,Ns,o(this,ue,T4).call(this)),r(this,Ns)&&I(o(this,ue,x4).bind(this)),()=>{r(this,Ns)&&(r(this,Ns).textContent="",b(this,Ns,null))}},w4=function(){r(this,Ti).$state.duration(),r(this,Su).call(this)},Su=new WeakMap,x4=function(){const e=this.activePointerCue||this.activeCue;r(this,Ns)&&(r(this,Ns).textContent=(e==null?void 0:e.text)||"")},E4=function(){let e=this.el;for(;e&&e.getAttribute("role")!=="slider";)e=e.parentElement;return e},T4=function(){const e=o(this,ue,E4).call(this);return e?e.querySelector('[data-part="chapter-title"]'):null},O(qp,"props",{disabled:!1}),qp);const Bh=d4.prototype;at(Bh,"cues");at(Bh,"activeCue");at(Bh,"activePointerCue");Ut(Bh,"setRefs");const Nn=Un();function tk(i,e){const t=Rg(i,e);for(const{el:s,top:n,left:a}of t)s.scroll({top:n,left:a,behavior:e.behavior})}function ik(i,e={}){tk(i,{scrollMode:"if-needed",block:"center",inline:"center",...e})}const sk=["a[href]","[tabindex]","input","select","button"].map(i=>`${i}:not([aria-hidden='true'])`).join(","),nk=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]);var Lr,ms,ki,wu,gt,aa,j1,k4,G1,$4,P4,Bd,M4,$6,rk=($6=class{constructor(i){g(this,gt);g(this,Lr,-1);g(this,ms,null);g(this,ki,[]);g(this,wu);b(this,wu,i)}get items(){return r(this,ki)}attachMenu(i){pt(i,"focus",o(this,gt,k4).bind(this)),b(this,ms,i),_e(()=>{b(this,ms,null)})}listen(){r(this,ms)&&(this.update(),new Xe(r(this,ms)).add("keyup",o(this,gt,$4).bind(this)).add("keydown",o(this,gt,P4).bind(this)),_e(()=>{b(this,Lr,-1),b(this,ki,[])}))}update(){b(this,Lr,0),b(this,ki,o(this,gt,M4).call(this))}scroll(i=o(this,gt,j1).call(this)){const e=r(this,ki)[i];e&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{ik(e,{behavior:"smooth",boundary:t=>!t.hasAttribute("data-root")})})})}focusActive(i=!0){const e=o(this,gt,j1).call(this);o(this,gt,aa).call(this,e>=0?e:0,i)}},Lr=new WeakMap,ms=new WeakMap,ki=new WeakMap,wu=new WeakMap,gt=new WeakSet,aa=function(i,e=!0){var t;b(this,Lr,i),r(this,ki)[i]?(r(this,ki)[i].focus({preventScroll:!0}),e&&this.scroll(i)):(t=r(this,ms))==null||t.focus({preventScroll:!0})},j1=function(){return r(this,ki).findIndex(i=>document.activeElement===i||i.getAttribute("role")==="menuitemradio"&&i.getAttribute("aria-checked")==="true")},k4=function(){r(this,Lr)>=0||(this.update(),this.focusActive())},G1=function(i){const e=i.target;if(Cg(i)&&e instanceof Element){const t=e.getAttribute("role");return!/a|input|select|button/.test(e.localName)&&!t}return nk.has(i.key)},$4=function(i){o(this,gt,G1).call(this,i)&&(i.stopPropagation(),i.preventDefault())},P4=function(i){if(o(this,gt,G1).call(this,i))switch(i.stopPropagation(),i.preventDefault(),i.key){case"Escape":r(this,wu).closeMenu(i);break;case"Tab":o(this,gt,aa).call(this,o(this,gt,Bd).call(this,i.shiftKey?-1:1));break;case"ArrowUp":o(this,gt,aa).call(this,o(this,gt,Bd).call(this,-1));break;case"ArrowDown":o(this,gt,aa).call(this,o(this,gt,Bd).call(this,1));break;case"Home":case"PageUp":o(this,gt,aa).call(this,0);break;case"End":case"PageDown":o(this,gt,aa).call(this,r(this,ki).length-1);break}},Bd=function(i){var t;let e=r(this,Lr);do e=(e+i+r(this,ki).length)%r(this,ki).length;while(((t=r(this,ki)[e])==null?void 0:t.offsetParent)===null);return e},M4=function(){if(!r(this,ms))return[];const i=r(this,ms).querySelectorAll(sk),e=[],t=s=>s.getAttribute("role")==="menu";for(const s of i)Jd(s)&&s.offsetParent!==null&&_y(r(this,ms),s,t)&&e.push(s);return e},$6);function Wu(i,e,t,s){var n=arguments.length,a=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,s);else for(var u=i.length-1;u>=0;u--)(l=i[u])&&(a=(n<3?l(a):n>3?l(e,t,a):l(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}let ak=0;var Fp,gs,Ml,Rl,vi,xu,Os,Jt,Nr,Or,Qa,Za,Mn,Ya,Eu,Xa,ve,R4,A4,I4,_4,D4,z1,L4,Al,N4,U1,O4,gc,V4,B4,q4,F4,W4,H4,vh,j4,Il,Ch,G4,Sh,z4,_l,Dl,U4,Jl=(Fp=class extends Ne{constructor(){super();g(this,ve);g(this,gs);g(this,Ml);g(this,Rl);g(this,vi,de(!1));g(this,xu,de(!1));g(this,Os,de(null));g(this,Jt,de(null));g(this,Nr);g(this,Or,new Set);g(this,Qa,null);g(this,Za);g(this,Mn);g(this,Ya,!1);g(this,Eu,de(!1));g(this,Xa,new Set);g(this,Al,!1);g(this,vh,o(this,ve,j4).bind(this));g(this,Il,!1);g(this,Ch,o(this,ve,G4).bind(this));g(this,Sh,o(this,ve,z4).bind(this));g(this,_l,Xr(()=>{const e=Y(r(this,Jt));if(!e||se)return;let t=0,s=getComputedStyle(e),n=[...e.children];for(const a of["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"])t+=parseFloat(s[a])||0;for(const a of n)if(Jd(a)&&a.style.display==="contents")n.push(...a.children);else if(a.nodeType===3)t+=parseFloat(getComputedStyle(a).fontSize);else if(Jd(a)){if(!Ay(a))continue;const l=getComputedStyle(a);t+=a.offsetHeight+(parseFloat(l.marginTop)||0)+(parseFloat(l.marginBottom)||
100)}Ii(e,"--menu-height",t+"px")}));g(this,Dl,!1);const{showDelay:e}=this.$props;b(this,Za,new V9({trigger:r(this,Os),content:r(this,Jt),showDelay:e,listen:(t,s,n)=>{zr(t,l=>{r(this,vi).call(this)?n(l):s(l)});const a=o(this,ve,F4).call(this);a&&zr(a,l=>{l.stopPropagation(),n(l)})},onChange:o(this,ve,N4).bind(this)}))}get triggerElement(){return r(this,Os).call(this)}get contentElement(){return r(this,Jt).call(this)}get isSubmenu(){return!!r(this,Nr)}onSetup(){b(this,gs,ut());const e=++ak;b(this,Ml,`media-menu-${e}`),b(this,Rl,`media-menu-button-${e}`),b(this,Mn,new rk({closeMenu:this.close.bind(this)})),Vn(Nn)&&b(this,Nr,Tt(Nn)),o(this,ve,R4).call(this),this.setAttributes({"data-open":r(this,vi),"data-root":!this.isSubmenu,"data-submenu":this.isSubmenu,"data-disabled":o(this,ve,gc).bind(this)}),_i(Nn,{button:r(this,Os),content:r(this,Jt),expanded:r(this,vi),hint:de(""),submenu:!!r(this,Nr),disable:o(this,ve,V4).bind(this),attachMenuButton:o(this,ve,I4).bind(this),attachMenuItems:o(this,ve,_4).bind(this),attachObserver:o(this,ve,D4).bind(this),disableMenuButton:o(this,ve,L4).bind(this),addSubmenu:o(this,ve,H4).bind(this),onTransitionEvent:t=>{r(this,Xa).add(t),_e(()=>{r(this,Xa).delete(t)})}})}onAttach(e){e.style.setProperty("display","contents")}onConnect(e){var t;I(o(this,ve,A4).bind(this)),this.isSubmenu&&((t=r(this,Nr))==null||t.addSubmenu(this))}onDestroy(){r(this,Os).set(null),r(this,Jt).set(null),b(this,Qa,null),r(this,Xa).clear()}open(e){Y(r(this,vi))||(r(this,Za).show(e),bs())}close(e){Y(r(this,vi))&&(r(this,Za).hide(e),bs())}},gs=new WeakMap,Ml=new WeakMap,Rl=new WeakMap,vi=new WeakMap,xu=new WeakMap,Os=new WeakMap,Jt=new WeakMap,Nr=new WeakMap,Or=new WeakMap,Qa=new WeakMap,Za=new WeakMap,Mn=new WeakMap,Ya=new WeakMap,Eu=new WeakMap,Xa=new WeakMap,ve=new WeakSet,R4=function(){let e=-1,t=Vn(Sc)?Tt(Sc):null;_i(Sc,{onDragStart:()=>{var s;(s=t==null?void 0:t.onDragStart)==null||s.call(t),window.clearTimeout(e),e=-1,b(this,Ya,!0)},onDragEnd:()=>{var s;(s=t==null?void 0:t.onDragEnd)==null||s.call(t),e=window.setTimeout(()=>{b(this,Ya,!1),e=-1},300)}})},A4=function(){const e=o(this,ve,O4).call(this);this.isSubmenu||r(this,_l).call(this),o(this,ve,z1).call(this,e),e&&(I(()=>{const{height:t}=r(this,gs).$state,s=r(this,Jt).call(this);s&&Ii(s,"--player-height",t()+"px")}),r(this,Mn).listen(),this.listen("pointerup",o(this,ve,B4).bind(this)),pt(window,"pointerup",o(this,ve,q4).bind(this)))},I4=function(e){const t=e.el,s=this.isSubmenu,n=li(o(this,ve,gc).bind(this));rt(t,"tabindex",s?"-1":"0"),rt(t,"role",s?"menuitem":"button"),we(t,"id",r(this,Rl)),we(t,"aria-haspopup","menu"),we(t,"aria-expanded","false"),we(t,"data-root",!this.isSubmenu),we(t,"data-submenu",this.isSubmenu);const a=()=>{we(t,"data-open",r(this,vi).call(this)),we(t,"aria-disabled",n())};se?a():I(a),r(this,Os).set(t),_e(()=>{r(this,Os).set(null)})},_4=function(e){var a;const t=e.el;t.style.setProperty("display","none"),we(t,"id",r(this,Ml)),rt(t,"role","menu"),rt(t,"tabindex","-1"),we(t,"data-root",!this.isSubmenu),we(t,"data-submenu",this.isSubmenu),r(this,Jt).set(t),_e(()=>r(this,Jt).set(null));const s=()=>we(t,"data-open",r(this,vi).call(this));se?s():I(s),r(this,Mn).attachMenu(t),o(this,ve,z1).call(this,!1);const n=o(this,ve,U4).bind(this);this.isSubmenu?(a=r(this,Nr))==null||a.onTransitionEvent(n):(e.listen("transitionstart",n),e.listen("transitionend",n),e.listen("animationend",r(this,_l)),e.listen("vds-menu-resize",r(this,_l)))},D4=function(e){b(this,Qa,e)},z1=function(e){const t=Y(r(this,Jt));t&&we(t,"aria-hidden",Ec(!e))},L4=function(e){r(this,Eu).set(e)},Al=new WeakMap,N4=function(e,t){var a,l,u,d,h,p;if(b(this,Al,Lu(t)),t==null||t.stopPropagation(),r(this,vi).call(this)===e)return;if(o(this,ve,gc).call(this)){e&&r(this,Za).hide(t);return}(a=this.el)==null||a.dispatchEvent(new Event("vds-menu-resize",{bubbles:!0,composed:!0}));const s=r(this,Os).call(this),n=r(this,Jt).call(this);if(s&&(we(s,"aria-controls",e&&r(this,Ml)),we(s,"aria-expanded",Ec(e))),n&&we(n,"aria-labelledby",e&&r(this,Rl)),r(this,vi).set(e),o(this,ve,W4).call(this,t),bs(),r(this,Al)){e?n==null||n.focus():s==null||s.focus();for(const f of[this.el,n])f&&f.setAttribute("data-keyboard","")}else for(const f of[this.el,n])f&&f.removeAttribute("data-keyboard");if(this.dispatch(e?"open":"close",{trigger:t}),e)!this.isSubmenu&&r(this,gs).activeMenu!==this&&((l=r(this,gs).activeMenu)==null||l.close(t),r(this,gs).activeMenu=this),(d=(u=r(this,Qa))==null?void 0:u.onOpen)==null||d.call(u,t);else{if(this.isSubmenu)for(const f of r(this,Or))f.close(t);else r(this,gs).activeMenu=null;(p=(h=r(this,Qa))==null?void 0:h.onClose)==null||p.call(h,t)}e&&requestAnimationFrame(o(this,ve,U1).bind(this))},U1=function(){r(this,Dl)||r(this,Il)||(r(this,Mn).update(),requestAnimationFrame(()=>{r(this,Al)?r(this,Mn).focusActive():r(this,Mn).scroll()}))},O4=function(){return!o(this,ve,gc).call(this)&&r(this,vi).call(this)},gc=function(){return r(this,xu).call(this)||r(this,Eu).call(this)},V4=function(e){r(this,xu).set(e)},B4=function(e){const t=r(this,Jt).call(this);r(this,Ya)||t&&t2(t,e)||e.stopPropagation()},q4=function(e){const t=r(this,Jt).call(this);r(this,Ya)||t&&t2(t,e)||this.close(e)},F4=function(){var t;const e=(t=this.el)==null?void 0:t.querySelector('[data-part="close-target"]');return this.el&&e&&_y(this.el,e,s=>s.getAttribute("role")==="menu")?e:null},W4=function(e){this.isSubmenu||(r(this,vi).call(this)?r(this,gs).remote.pauseControls(e):r(this,gs).remote.resumeControls(e))},H4=function(e){r(this,Or).add(e),new Xe(e).add("open",r(this,Ch)).add("close",r(this,Sh)),_e(r(this,vh))},vh=new WeakMap,j4=function(e){r(this,Or).delete(e)},Il=new WeakMap,Ch=new WeakMap,G4=function(e){var s;b(this,Il,!0);const t=r(this,Jt).call(this);this.isSubmenu&&((s=this.triggerElement)==null||s.setAttribute("aria-hidden","true"));for(const n of r(this,Or))if(n!==e.target)for(const a of[n.el,n.triggerElement])a==null||a.setAttribute("aria-hidden","true");if(t){const n=e.target.el;for(const a of t.children)a.contains(n)?a.setAttribute("data-open",""):a!==n&&a.setAttribute("data-hidden","")}},Sh=new WeakMap,z4=function(e){var s;b(this,Il,!1);const t=r(this,Jt).call(this);this.isSubmenu&&((s=this.triggerElement)==null||s.setAttribute("aria-hidden","false"));for(const n of r(this,Or))for(const a of[n.el,n.triggerElement])a==null||a.setAttribute("aria-hidden","false");if(t)for(const n of t.children)n.removeAttribute("data-open"),n.removeAttribute("data-hidden")},_l=new WeakMap,Dl=new WeakMap,U4=function(e){const t=r(this,Jt).call(this);t&&e.propertyName==="height"&&(b(this,Dl,e.type==="transitionstart"),we(t,"data-transition",r(this,Dl)?"height":null),r(this,vi).call(this)&&o(this,ve,U1).call(this));for(const s of r(this,Xa))s(e)},O(Fp,"props",{showDelay:0}),Fp);Wu([at],Jl.prototype,"triggerElement",null);Wu([at],Jl.prototype,"contentElement",null);Wu([at],Jl.prototype,"isSubmenu",null);Wu([Ut],Jl.prototype,"open",null);Wu([Ut],Jl.prototype,"close",null);var Wp,Vr,Tu,jn,K4,Q4,K1,t3=(Wp=class extends Ne{constructor(){super();g(this,jn);g(this,Vr);g(this,Tu,de(null));new Cs}get expanded(){var e;return((e=r(this,Vr))==null?void 0:e.expanded())??!1}onSetup(){b(this,Vr,Tt(Nn))}onAttach(e){r(this,Vr).attachMenuButton(this),I(o(this,jn,K4).bind(this)),rt(e,"type","button")}onConnect(e){I(o(this,jn,Q4).bind(this)),o(this,jn,K1).call(this);const t=new MutationObserver(o(this,jn,K1).bind(this));t.observe(e,{attributeFilter:["data-part"],childList:!0,subtree:!0}),_e(()=>t.disconnect()),zr(e,s=>{this.dispatch("select",{trigger:s})})}},Vr=new WeakMap,Tu=new WeakMap,jn=new WeakSet,K4=function(){r(this,Vr).disableMenuButton(this.$props.disabled())},Q4=function(){const e=r(this,Tu).call(this);e&&I(()=>{const t=r(this,Vr).hint();t&&(e.textContent=t)})},K1=function(){var t;const e=(t=this.el)==null?void 0:t.querySelector('[data-part="hint"]');r(this,Tu).set(e??null)},O(Wp,"props",{disabled:!1}),Wp);const ok=t3.prototype;at(ok,"expanded");
10var lk=class extends t3{};const pp=Un();var Hp,Ja,Yr,Z4,Y4,X4,ck=(Hp=class extends Ne{constructor(){super();g(this,Yr);g(this,Ja);new Cs;const{placement:e}=this.$props;this.setAttributes({"data-placement":e})}onAttach(e){if(b(this,Ja,Tt(Nn)),r(this,Ja).attachMenuItems(this),Vn(pp)){const t=Tt(pp);t&&(_i(pp,null),t.attach(e),_e(()=>t.attach(null)))}}onConnect(e){I(o(this,Yr,Z4).bind(this))}},Ja=new WeakMap,Yr=new WeakSet,Z4=function(){const{expanded:e}=r(this,Ja);if(!this.el||!e())return;const t=this.$props.placement();if(!t)return;Object.assign(this.el.style,{position:"absolute",top:0,left:0,width:"max-content"});const{offset:s,alignOffset:n}=this.$props;_e(Ly(this.el,o(this,Yr,X4).call(this),t,{offsetVarName:"media-menu",xOffset:n(),yOffset:s()})),_e(o(this,Yr,Y4).bind(this))},Y4=function(){this.el&&(this.el.removeAttribute("style"),this.el.style.display="none")},X4=function(){return r(this,Ja).button()},O(Hp,"props",{placement:null,offset:0,alignOffset:0}),Hp);const Q1=Un();var Rn,Br,Cm,ns,e7,t7,wh,Z1,Y1,P6,J4=(P6=class extends zi{constructor(){super(...arguments);g(this,ns);g(this,Rn,new Set);g(this,Br,de(""));g(this,Cm,null);O(this,"onValueChange");g(this,wh,o(this,ns,Z1).bind(this))}get values(){return Array.from(r(this,Rn)).map(e=>e.value())}get value(){return r(this,Br).call(this)}set value(e){o(this,ns,Z1).call(this,e)}onSetup(){_i(Q1,{add:o(this,ns,e7).bind(this),remove:o(this,ns,t7).bind(this)})}onAttach(e){Vn(Nn)||rt(e,"role","radiogroup"),this.setAttributes({value:r(this,Br)})}onDestroy(){r(this,Rn).clear()}},Rn=new WeakMap,Br=new WeakMap,Cm=new WeakMap,ns=new WeakSet,e7=function(e){r(this,Rn).has(e)||(r(this,Rn).add(e),e.onCheck=r(this,wh),e.check(e.value()===r(this,Br).call(this)))},t7=function(e){e.onCheck=null,r(this,Rn).delete(e)},wh=new WeakMap,Z1=function(e,t){var l;const s=Y(r(this,Br));if(!e||e===s)return;const n=o(this,ns,Y1).call(this,s),a=o(this,ns,Y1).call(this,e);n==null||n.check(!1,t),a==null||a.check(!0,t),r(this,Br).set(e),(l=this.onValueChange)==null||l.call(this,e,t)},Y1=function(e){for(const t of r(this,Rn))if(e===Y(t.value))return t;return null},P6),jp,An,po,X1,s7,i7=(jp=class extends Ne{constructor(){super();g(this,po);g(this,An);b(this,An,new J4),r(this,An).onValueChange=o(this,po,s7).bind(this)}get values(){return r(this,An).values}get value(){return r(this,An).value}set value(e){r(this,An).value=e}onSetup(){se?o(this,po,X1).call(this):I(o(this,po,X1).bind(this))}},An=new WeakMap,po=new WeakSet,X1=function(){r(this,An).value=this.$props.value()},s7=function(e,t){const s=this.createEvent("change",{detail:e,trigger:t});this.dispatch(s)},O(jp,"props",{value:""}),jp);const n7=i7.prototype;at(n7,"values");at(n7,"value");var Gp,Vs,eo,ci,a7,o7,l7,c7,u7,J1,d7,r7=(Gp=class extends Ne{constructor(){super();g(this,ci);g(this,Vs,de(!1));g(this,eo,{value:this.$props.value,check:o(this,ci,u7).bind(this),onCheck:null});new Cs}get checked(){return r(this,Vs).call(this)}onSetup(){this.setAttributes({value:this.$props.value,"data-checked":r(this,Vs),"aria-checked":li(r(this,Vs))})}onAttach(e){const t=Vn(Nn);rt(e,"tabindex",t?"-1":"0"),rt(e,"role",t?"menuitemradio":"radio"),I(o(this,ci,l7).bind(this))}onConnect(e){o(this,ci,o7).call(this),zr(e,o(this,ci,c7).bind(this)),_e(o(this,ci,a7).bind(this))}},Vs=new WeakMap,eo=new WeakMap,ci=new WeakSet,a7=function(){Wt(()=>{Tt(Q1).remove(r(this,eo))},this.connectScope)},o7=function(){Tt(Q1).add(r(this,eo))},l7=function(){var s,n;const{value:e}=this.$props,t=e();Y(r(this,Vs))&&((n=(s=r(this,eo)).onCheck)==null||n.call(s,t))},c7=function(e){var t,s;Y(r(this,Vs))||(o(this,ci,J1).call(this,!0,e),o(this,ci,d7).call(this,e),(s=(t=r(this,eo)).onCheck)==null||s.call(t,Y(this.$props.value),e))},u7=function(e,t){Y(r(this,Vs))!==e&&o(this,ci,J1).call(this,e,t)},J1=function(e,t){r(this,Vs).set(e),this.dispatch("change",{detail:e,trigger:t})},d7=function(e){this.dispatch("select",{trigger:e})},O(Gp,"props",{value:""}),Gp);const uk=r7.prototype;at(uk,"checked");var zp,qi,to,io,zt,h7,Bs,ku,p7,f7,m7,em,g7,y7,b7,dk=(zp=class extends Ne{constructor(){super(...arguments);g(this,zt);g(this,qi);g(this,to,null);g(this,io,null);g(this,Bs,0);g(this,ku,-1)}onSetup(){b(this,qi,ut());const{event:t,action:s}=this.$props;this.setAttributes({event:t,action:s})}onAttach(t){t.setAttribute("data-media-gesture",""),t.style.setProperty("pointer-events","none")}onConnect(t){var s;b(this,to,(s=r(this,qi).player.el)==null?void 0:s.querySelector("[data-media-provider]")),I(o(this,zt,h7).bind(this))}},qi=new WeakMap,to=new WeakMap,io=new WeakMap,zt=new WeakSet,h7=function(){let t=this.$props.event(),s=this.$props.disabled();
10!r(this,to)||!t||s||(/^dbl/.test(t)&&(t=t.split(/^dbl/)[1]),(t==="pointerup"||t==="pointerdown")&&r(this,qi).$state.pointer()==="coarse"&&(t==="pointerup"&&pt(r(this,to),"touchstart",o(this,zt,f7).bind(this),{passive:!0}),t=t==="pointerup"?"touchend":"touchstart"),pt(r(this,to),t,o(this,zt,p7).bind(this),{passive:!1}))},Bs=new WeakMap,ku=new WeakMap,p7=function(t){var s;if(!(this.$props.disabled()||Xp(t)&&(t.button!==0||r(this,qi).activeMenu)||Mo(t)&&r(this,qi).activeMenu||o(this,zt,m7).call(this,t)||Xd(t)||!o(this,zt,g7).call(this,t))){if(t.MEDIA_GESTURE=!0,t.preventDefault(),!((s=Y(this.$props.event))!=null&&s.startsWith("dbl")))r(this,Bs)===0&&setTimeout(()=>{r(this,Bs)===1&&o(this,zt,em).call(this,t)},250);else if(r(this,Bs)===1){queueMicrotask(()=>o(this,zt,em).call(this,t)),clearTimeout(r(this,ku)),b(this,Bs,0);return}r(this,Bs)===0&&b(this,ku,window.setTimeout(()=>{b(this,Bs,0)},275)),I3(this,Bs)._++}},f7=function(t){if(Xd(t)){b(this,io,null);return}const s=t.changedTouches[0]??t.touches[0];b(this,io,s?{x:s.clientX,y:s.clientY}:null)},m7=function(t){if(!Mo(t)||t.type!=="touchend")return!1;const s=t.changedTouches[0]??t.touches[0],n=r(this,io);return b(this,io,null),!s||!n?!1:Math.abs(s.clientX-n.x)>10||Math.abs(s.clientY-n.y)>10},em=function(t){this.el.setAttribute("data-triggered",""),requestAnimationFrame(()=>{o(this,zt,y7).call(this)&&o(this,zt,b7).call(this,Y(this.$props.action),t),requestAnimationFrame(()=>{this.el.removeAttribute("data-triggered")})})},g7=function(t){if(!this.el)return!1;if(Xp(t)||vg(t)||Mo(t)){const s=Mo(t)?t.changedTouches[0]??t.touches[0]:void 0,n=(s==null?void 0:s.clientX)??t.clientX,a=(s==null?void 0:s.clientY)??t.clientY,l=this.el.getBoundingClientRect(),u=a>=l.top&&a<=l.bottom&&n>=l.left&&n<=l.right;return t.type.includes("leave")?!u:u}return!0},y7=function(){const t=r(this,qi).player.el.querySelectorAll("[data-media-gesture][data-triggered]");return Array.from(t).sort((s,n)=>+getComputedStyle(n).zIndex-+getComputedStyle(s).zIndex)[0]===this.el},b7=function(t,s){if(!t)return;const n=new Ke("will-trigger",{detail:t,cancelable:!0,trigger:s});if(this.dispatchEvent(n),n.defaultPrevented)return;const[a,l]=t.replace(/:([a-z])/,"-$1").split(":");t.includes(":fullscreen")?r(this,qi).remote.toggleFullscreen("prefer-media",s):t.includes("seek:")?r(this,qi).remote.seek(Y(r(this,qi).$state.currentTime)+(+l||0),s):r(this,qi).remote[xg(a)](s),this.dispatch("trigger",{detail:t,trigger:s})},O(zp,"props",{disabled:!1,event:void 0,action:void 0}),zp),Ll,In,_n,$u,tm,M6,hk=(M6=class{constructor(i){g(this,$u);O(this,"priority",10);g(this,Ll,null);g(this,In);g(this,_n);b(this,In,i)}attach(){}canRender(){return!0}detach(){var i;(i=r(this,_n))==null||i.abort(),b(this,_n,void 0),r(this,In).reset(),b(this,Ll,null)}changeTrack(i){var e;!i||r(this,Ll)===i||((e=r(this,_n))==null||e.abort(),b(this,_n,new Xe(i)),i.readyState<2?(r(this,In).reset(),r(this,_n).add("load",()=>o(this,$u,tm).call(this,i),{once:!0})):o(this,$u,tm).call(this,i),r(this,_n).add("add-cue",t=>{r(this,In).addCue(t.detail)}).add("remove-cue",t=>{r(this,In).removeCue(t.detail)}),b(this,Ll,i))}},Ll=new WeakMap,In=new WeakMap,_n=new WeakMap,$u=new WeakSet,tm=function(i){r(this,In).changeTrack({cues:[...i.cues],regions:[...i.regions]})},M6),Wi,$i,De,qd,v7,C7,S7,im,w7,x7,E7,T7,sm,k7,$7,Dn,nm,Fd,rm,am,pk=(Wi=class extends Ne{constructor(){super(...arguments);g(this,De);g(this,$i);g(this,Dn,-1)}onSetup(){b(this,$i,ut()),this.setAttributes({"aria-hidden":li(o(this,De,qd).bind(this))})}onAttach(t){t.style.setProperty("pointer-events","none")}onConnect(t){Wi.lib()||mi(()=>import("./prod-DbD_yNsS.js").then(s=>s.d),__vite__mapDeps([0,1,2])).then(s=>Wi.lib.set(s)),I(o(this,De,v7).bind(this))}},$i=new WeakMap,De=new WeakSet,qd=function(){const{textTrack:t,remotePlaybackState:s,iOSControl
10s:n}=r(this,$i).$state,a=t();return n()||s()==="connected"||!a||!pi(a)},v7=function(){if(!Wi.lib())return;const{viewType:t}=r(this,$i).$state;return t()==="audio"?o(this,De,C7).call(this):o(this,De,x7).call(this)},C7=function(){return I(o(this,De,S7).bind(this)),o(this,De,sm).call(this,null),()=>{this.el.textContent=""}},S7=function(){if(o(this,De,qd).call(this))return;o(this,De,im).call(this);const{textTrack:t}=r(this,$i).$state;pt(t(),"cue-change",o(this,De,im).bind(this)),I(o(this,De,w7).bind(this))},im=function(){this.el.textContent="",r(this,Dn)>=0&&o(this,De,Fd).call(this);const{realCurrentTime:t,textTrack:s}=r(this,$i).$state,{renderVTTCueString:n}=Wi.lib(),a=Y(t),l=Y(s).activeCues;for(const u of l){const d=o(this,De,rm).call(this),h=o(this,De,am).call(this);h.innerHTML=n(u,a),d.append(h),this.el.append(h)}},w7=function(){const{realCurrentTime:t}=r(this,$i).$state,{updateTimedVTTCueNodes:s}=Wi.lib();s(this.el,t())},x7=function(){const{CaptionsRenderer:t}=Wi.lib(),s=new t(this.el),n=new hk(s);return r(this,$i).textRenderers.add(n),I(o(this,De,E7).bind(this,s)),I(o(this,De,T7).bind(this,s)),o(this,De,sm).call(this,s),()=>{this.el.textContent="",r(this,$i).textRenderers.remove(n),s.destroy()}},E7=function(t){t.dir=this.$props.textDir()},T7=function(t){var a;if(o(this,De,qd).call(this))return;const{realCurrentTime:s,textTrack:n}=r(this,$i).$state;t.currentTime=s(),r(this,Dn)>=0&&((a=n())!=null&&a.activeCues[0])&&o(this,De,Fd).call(this)},sm=function(t){const s=r(this,$i).player;s&&pt(s,"vds-font-change",o(this,De,k7).bind(this,t))},k7=function(t){var n;if(r(this,Dn)>=0){o(this,De,nm).call(this);return}const{textTrack:s}=r(this,$i).$state;(n=s())!=null&&n.activeCues[0]?t==null||t.update(!0):o(this,De,$7).call(this)},$7=function(){var n,a;const t=o(this,De,rm).call(this);we(t,"data-example","");const s=o(this,De,am).call(this);we(s,"data-example",""),s.textContent=this.$props.exampleText(),t==null||t.append(s),(n=this.el)==null||n.append(t),(a=this.el)==null||a.setAttribute("data-example",""),o(this,De,nm).call(this)},Dn=new WeakMap,nm=function(){window.clearTimeout(r(this,Dn)),b(this,Dn,window.setTimeout(o(this,De,Fd).bind(this),2500))},Fd=function(){var t,s;(t=this.el)==null||t.removeAttribute("data-example"),(s=this.el)!=null&&s.querySelector("[data-example]")&&(this.el.textContent=""),b(this,Dn,-1)},rm=function(){const t=document.createElement("div");return we(t,"data-part","cue-display"),t},am=function(){const t=document.createElement("div");return we(t,"data-part","cue"),t},O(Wi,"props",{textDir:"ltr",exampleText:"Captions look like this."}),O(Wi,"lib",de(null)),Wi),fd,Xi,lt,om,P7,lm,M7,R7,Pu,cm,um,dm,A7,hm,I7,fk=(fd=class extends Ne{constructor(){super(...arguments);g(this,lt);g(this,Xi);g(this,Pu,"")}onSetup(){b(this,Xi,ut()),o(this,lt,cm).call(this),o(this,lt,um).call(this),o(this,lt,dm).call(this),o(this,lt,lm).call(this)}onAttach(t){t.style.setProperty("pointer-events","none"),I(o(this,lt,R7).bind(this)),I(o(this,lt,cm).bind(this)),I(o(this,lt,um).bind(this)),I(o(this,lt,dm).bind(this)),I(o(this,lt,lm).bind(this));const{started:s}=r(this,Xi).$state;this.setAttributes({"data-visible":()=>!s()&&!this.$state.hidden(),"data-loading":o(this,lt,M7).bind(this),"data-error":o(this,lt,om).bind(this),"data-hidden":this.$state.hidden})}onConnect(t){I(o(this,lt,P7).bind(this)),I(o(this,lt,A7).bind(this))}},Xi=new WeakMap,lt=new WeakSet,om=function(){const{error:t}=this.$state;return!vs(t())},P7=function(){const{canLoadPoster:t,poster:s}=r(this,Xi).$state;!t()&&s()&&bo(s(),"preconnect")},lm=function(){const{src:t}=this.$props,{poster:s,nativeControls:n}=r(this,Xi).$state;this.el&&we(this.el,"display",n()?"none":null),this.$state.hidden.set(o(this,lt,om).call(this)||!(t()||s())||n())},M7=function(){const{loading:t,hidden:s}=this.$state;return!s()&&t()},R7=function(){const t=this.$state.img();t&&(new Xe(t).add("load",o(this,lt,hm).bind(this)).add("error",o(this,lt,I7).bind(this)),t.complete&&o(this,lt,hm).call(this))},Pu=new WeakMap,cm=function(){const{poster:t}=r(this,Xi).$props,{canLoadPoster:s,providedPoster:n,inferredPoster:a}=r(this,Xi).$state,l=this.$props.src()||"",u=l||t()||a();r(this,Pu)===n()&&n.set(l),this.$state.src.set(s()&&u.length?u:null),b(this,Pu,l)},um=function(){const{src:t}=this.$props,{alt:s}=this.$state,{poster:n}=r(this,Xi).$state;s.set(t()||n()?this.$props.alt():null)},dm=function(){const{crossOrigin:t}=this.$props,{crossOrigin:s}=this.$state,{crossOrigin:n,poster:a}=r(this,Xi).$state,l=t()!==null?t():n();s.set(/ytimg\.com|vimeo/.test(a()||"")?null:l===!0?"anonymous":l)},A7=function(){const{loading:t,error:s}
10=this.$state,{canLoadPoster:n,poster:a}=r(this,Xi).$state;t.set(n()&&!!a()),s.set(null)},hm=function(){const{loading:t,error:s}=this.$state;t.set(!1),s.set(null)},I7=function(t){const{loading:s,error:n}=this.$state;s.set(!1),n.set(t)},O(fd,"props",{src:null,alt:null,crossOrigin:null}),O(fd,"state",new Kn({img:null,src:null,alt:null,crossOrigin:null,loading:!0,error:null,hidden:!1})),fd),md,Nl,qr,Mu,Ru,Bt,_7,D7,L7,pm,N7,O7,fm,V7,mk=(md=class extends Ne{constructor(){super(...arguments);g(this,Bt);g(this,Nl);g(this,qr,de(null));g(this,Mu,de(!0));g(this,Ru,de(!0))}onSetup(){b(this,Nl,ut()),o(this,Bt,pm).call(this);const{type:t}=this.$props;this.setAttributes({"data-type":t,"data-remainder":o(this,Bt,fm).bind(this)}),new vv({callback:o(this,Bt,_7).bind(this)}).attach(this)}onAttach(t){t.hasAttribute("role")||I(o(this,Bt,N7).bind(this)),I(o(this,Bt,pm).bind(this))}onConnect(t){_e(Iy(t,r(this,Mu).set)),I(o(this,Bt,D7).bind(this)),I(o(this,Bt,L7).bind(this))}},Nl=new WeakMap,qr=new WeakMap,Mu=new WeakMap,Ru=new WeakMap,Bt=new WeakSet,_7=function(t){r(this,Ru).set(t[0].isIntersecting)},D7=function(){const{hidden:t}=this.$props;this.$state.hidden.set(t()||!r(this,Mu).call(this)||!r(this,Ru).call(this))},L7=function(){if(!this.$props.toggle()){r(this,qr).set(null);return}this.el&&zr(this.el,o(this,Bt,V7).bind(this))},pm=function(){const{hidden:t,timeText:s}=this.$state,{duration:n}=r(this,Nl).$state;if(t())return;const{type:a,padHours:l,padMinutes:u,showHours:d}=this.$props,h=o(this,Bt,O7).call(this,a()),p=n(),f=o(this,Bt,fm).call(this);if(!Number.isFinite(h+p)){s.set("LIVE");return}const y=Vh(f?Math.max(0,p-h):h,{padHrs:l(),padMins:u(),showHrs:d()});s.set((f?"-":"")+y)},N7=function(){if(!this.el)return;const{toggle:t}=this.$props;we(this.el,"role",t()?"timer":null),we(this.el,"tabindex",t()?0:null)},O7=function(t){const{bufferedEnd:s,duration:n,currentTime:a}=r(this,Nl).$state;switch(t){case"buffered":return s();case"duration":return n();default:return a()}},fm=function(){return this.$props.remainder()&&r(this,qr).call(this)!==!1},V7=function(t){if(t.preventDefault(),r(this,qr).call(this)===null){r(this,qr).set(!this.$props.remainder());return}r(this,qr).set(s=>!s)},O(md,"props",{type:"current",showHours:!1,padHours:null,padMinutes:null,remainder:!1,toggle:!1,hidden:!1}),O(md,"state",new Kn({timeText:"",hidden:!1})),md),B7=class extends o9{},gk=class extends $9{},yk=class extends wT{},bk=class extends xT{},vk=class extends ET{},Ck=class extends X9{},Sk=class extends _T{},wk=class extends DT{},xk=class extends VT{},Ek=class extends LT{},Tk=class extends NT{},kk=class extends IT{},$k=class extends RT{},Pk=class extends AT{},Mk=class extends OT{},Rk=class extends kT{},Ak=class extends $T{},Ik=class extends PT{},q7=class extends Fu{},_k=class extends z5{},Dk=class extends YT{},Lk=class extends XT{},Nk=class extends JT{},Ok=class extends ek{},Vk=class extends zT{},Bk=class extends p5{},qk=class extends r5{},Fk=class extends QT{},Wk=class extends d4{},Hk=class extends Jl{},jk=class extends t3{},Gk=class extends ck{},zk=class extends lk{},Uk=class extends i7{},Kk=class extends r7{},Qk=class extends pk{},Zk=class extends dk{},Yk=class extends fk{},F7=class extends Qv{},Xk=class extends mk{};const W7=c.forwardRef((i,e)=>{const{children:t,...s}=i,n=c.Children.toArray(t),a=n.find(e$);if(a){const l=a.props.children,u=n.map(d=>d===a?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return c.createElement(mm,{...s,ref:e},c.isValidElement(l)?c.cloneElement(l,void 0,u):null)}return c.createElement(mm,{...s,ref:e},t)});W7.displayName="Slot";const mm=c.forwardRef((i,e)=>{const{children:t,...s}=i;if(c.isValidElement(t)){const n=i$(t),a=t$(s,t.props);return t.type!==c.Fragment&&(a.ref=e?nt(e,n):n),c.cloneElement(t,a)}return c.Children.count(t)>1?c.Children.only(null):null});mm.displayName="SlotClone";const Jk=({children:i})=>c.createElement(c.Fragment,null,i);function e$(i){return c.isValidElement(i)&&i.type===Jk}function t$(i,e){const t={...e};for(const s in e){const n=i[s],a=e[s];/^on[A-Z]/.test(s)?n&&a?t[s]=(...l)=>{a(...l),n(...l)}:n&&(t[s]=n):s==="style"?t[s]={...n,...a}
10:s==="className"&&(t[s]=[n,a].filter(Boolean).join(" "))}return{...i,...t}}function i$(i){var s,n;let e=(s=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(n=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}const pe=["button","div","span","img","video","audio"].reduce((i,e)=>{const t=c.forwardRef((s,n)=>{const{asChild:a,...l}=s,u=a?W7:e;return c.createElement(u,{...l,ref:n})});return t.displayName=`Primitive.${e}`,{...i,[e]:t}},{}),h2=B7.state.record,s$=Object.keys(h2).reduce((i,e)=>({...i,[e](){return h2[e]}}),{});function Pe(i,e){const t=Xl(Bu);return $e((t||s$)[i])}const p2=q7.state.record,n$=Object.keys(p2).reduce((i,e)=>({...i,[e](){return p2[e]}}),{});function fp(i,e){const t=Xl(Co);return $e((t||n$)[i])}function Qn(){return Vm(qu)}const r$=Oe($k,{domEventsRegex:/^onMedia/}),H7=c.forwardRef(({children:i,...e},t)=>c.createElement(r$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));H7.displayName="AirPlayButton";const a$=Oe(kk,{domEventsRegex:/^onMedia/}),j7=c.forwardRef(({children:i,...e},t)=>c.createElement(a$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));j7.displayName="PlayButton";const o$=Oe(Sk,{domEventsRegex:/^onMedia/}),G7=c.forwardRef(({children:i,...e},t)=>c.createElement(o$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));G7.displayName="CaptionButton";const l$=Oe(wk,{domEventsRegex:/^onMedia/}),z7=c.forwardRef(({children:i,...e},t)=>c.createElement(l$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));z7.displayName="FullscreenButton";const c$=Oe(Ek,{domEventsRegex:/^onMedia/}),U7=c.forwardRef(({children:i,...e},t)=>c.createElement(c$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));U7.displayName="MuteButton";const u$=Oe(Tk,{domEventsRegex:/^onMedia/}),K7=c.forwardRef(({children:i,...e},t)=>c.createElement(u$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));K7.displayName="PIPButton";const d$=Oe(Mk,{domEventsRegex:/^onMedia/}),Q7=c.forwardRef(({children:i,...e},t)=>c.createElement(d$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));Q7.displayName="SeekButton";const h$=Oe(xk,{domEventsRegex:/^onMedia/}),Z7=c.forwardRef(({children:i,...e},t)=>c.createElement(h$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));Z7.displayName="LiveButton";const ec=["onDragStart","onDragEnd","onDragValueChange","onValueChange","onPointerValueChange"],p$=Oe(Bk),f$=Oe(q7,{events:ec}),Y7=c.forwardRef(({children:i,...e},t)=>c.createElement(f$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));Y7.displayName="Slider";const qh=c.forwardRef((i,e)=>c.createElement(pe.div,{...i,ref:e}));qh.displayName="SliderThumb";const Fh=c.forwardRef((i,e)=>c.createElement(pe.div,{...i,ref:e}));Fh.displayName="SliderTrack";const Wh=c.forwardRef((i,e)=>c.createElement(pe.div,{...i,ref:e}));Wh.displayName="SliderTrackFill";const m$=Oe(Fk),i3=c.forwardRef(({children:i,...e},t)=>c.createElement(m$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));i3.displayName="SliderPreview";const s3=c.forwardRef(({children:i,...e},t)=>c.createElement(p$,e,(s,n)=>{const a=$e(()=>n.getValueText(),n);return c.createElement(pe.div,{...s,ref:t},a,i)}));s3.displayName="SliderValue";const X7=c.forwardRef(({children:i,...e},t)=>{const s=fp("min"),n=fp("max"),a=fp("step"),l=(n-s)/a;return c.createElement(pe.div,{...e,ref:t},Array.from({length:Math.floor(l)+1}).map((u,d)=>i(d)))});X7.displayName="SliderSteps";const g$=Oe(Dk,{events:ec,domEventsRegex:/^onMedia/}),J7=c.forwardRef(({children:i,...e},t)=>c.createElement(g$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));J7.displayName="VolumeSlider";function y$(i=0,e=0,t=""){return se?{startTime:i,endTime:e,text:t,addEventListener:Ln,removeEventListener:Ln,dispatchEvent:Ln}:new window.VTTCue(i,e,t)}function b$(i,e){const t=new URL(i);for(const s of Object.keys(e))t.searchParams.set(s,e[s]+"");return t.toString()}const v$=Oe(F7),e8=c.forwardRef(({children:i,...e},t)=>c.createElement(v$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)}
10,i)));e8.displayName="Thumbnail";const n3=c.forwardRef(({children:i,...e},t)=>{const{src:s,img:n,crossOrigin:a}=Xl(F7.state),l=$e(s),u=$e(a);return c.createElement(pe.img,{crossOrigin:u,...e,src:l||void 0,ref:nt(n.set,t)},i)});n3.displayName="ThumbnailImg";const Hh=c.createContext({$chapters:de(null)});Hh.displayName="TimeSliderContext";const C$=Oe(_k,{events:ec,domEventsRegex:/^onMedia/}),t8=c.forwardRef(({children:i,...e},t)=>{const s=c.useMemo(()=>de(null),[]);return c.createElement(Hh.Provider,{value:{$chapters:s}},c.createElement(C$,{...e,ref:t},n=>c.createElement(pe.div,n,i)))});t8.displayName="TimeSlider";const S$=Oe(Wk),i8=c.forwardRef(({children:i,...e},t)=>c.createElement(S$,e,(s,n)=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},c.createElement(s8,{instance:n},i))));i8.displayName="SliderChapters";function s8({instance:i,children:e}){const t=$e(()=>i.cues,i),s=c.useRef([]),n=c.useRef(null),{$chapters:a}=c.useContext(Hh);return n.current||(n.current=y$()),c.useEffect(()=>(a.set(i),()=>void a.set(null)),[i]),c.useEffect(()=>{i.setRefs(s.current)},[t]),e(t.length?t:[n.current],l=>{if(!l){s.current.length=0;return}s.current.push(l)})}s8.displayName="SliderChapterTracks";const n8=c.forwardRef(({children:i,...e},t)=>{const{$chapters:s}=c.useContext(Hh),[n,a]=c.useState();return c.useEffect(()=>I(()=>{var u;const l=s();a(((u=(l==null?void 0:l.activePointerCue)||(l==null?void 0:l.activeCue))==null?void 0:u.text)||"")}),[]),c.createElement(pe.div,{...e,ref:t},n,i)});n8.displayName="SliderChapterTitle";const r8=c.forwardRef((i,e)=>c.createElement(pe.div,{...i,ref:e}));r8.displayName="SliderProgress";const w$=Oe(Vk),a8=c.forwardRef(({children:i,...e},t)=>c.createElement(w$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));a8.displayName="SliderThumbnail";const f2={Root:a8,Img:n3},x$=Oe(qk,{events:["onCanPlay","onError"]}),E$=c.forwardRef(({children:i,...e},t)=>c.createElement(x$,e,(s,n)=>c.createElement(o8,{...s,instance:n,ref:nt(s.ref,t)},i)));E$.displayName="SliderVideo";const o8=c.forwardRef(({instance:i,children:e,...t},s)=>{const{canLoad:n}=Xl(Bu),{src:a,video:l,crossOrigin:u}=i.$state,d=$e(a),h=$e(n),p=$e(u);return c.createElement(pe.video,{style:{maxWidth:"unset"},...t,src:d||void 0,muted:!0,playsInline:!0,preload:h?"auto":"none",crossOrigin:p||void 0,ref:nt(l.set,s)},e)});o8.displayName="SliderVideoProvider";const T$=Oe(Uk,{events:["onChange"]}),tc=c.forwardRef(({children:i,...e},t)=>c.createElement(T$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));tc.displayName="RadioGroup";const k$=Oe(Kk,{events:["onChange","onSelect"]}),ic=c.forwardRef(({children:i,...e},t)=>c.createElement(k$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));ic.displayName="RadioItem";const $$=Oe(Hk,{events:["onOpen","onClose"],domEventsRegex:/^onMedia/}),Ss=c.forwardRef(({children:i,...e},t)=>c.createElement($$,{...e,ref:t},(s,n)=>c.createElement(pe.div,{...s,style:{display:n.isSubmenu?void 0:"contents",...s.style}},i)));Ss.displayName="Menu";const P$=Oe(jk,{events:["onSelect"]}),jh=c.forwardRef(({children:i,...e},t)=>c.createElement(P$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));jh.displayName="MenuButton";const r3=c.forwardRef(({container:i=null,disabled:e=!1,children:t,...s},n)=>{let a=Pe("fullscreen"),l=e==="fullscreen"?!a:!e;const u=c.useMemo(()=>se?null:(le(i)?document.querySelector(i):i)??document.body,[i]);return!u||!l?t:Em.createPortal(c.createElement(pe.div,{...s,style:{display:"contents",...s.style},ref:n},t),u)});r3.displayName="MenuPortal";const M$=Oe(Gk),ws=c.forwardRef(({children:i,...e},t)=>c.createElement(M$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));ws.displayName="MenuItems";const R$=Oe(zk),A$=c.forwardRef(({children:i,...e},t)=>c.createElement(R$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));A$.displayName="MenuItem";const I$=Oe(Zk,{events:["onWillTrigger","onTrigger"]}),Po=c.forwardRef(({children:i,...e},t)=>c.createElement(I$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));Po.displayName="Gesture";const _$=Oe(Xk),Tc=c.forwardRef(({children:i,...e},t)=>c.createElement(_$,e,(s,n)=>c.createElement(l8,{...s,instance:n,ref:nt(s.ref,t)}
10,i)));Tc.displayName="Time";const l8=c.forwardRef(({instance:i,children:e,...t},s)=>{const{timeText:n}=i.$state,a=$e(n);return c.createElement(pe.div,{...t,ref:s},a,e)});l8.displayName="TimeText";function c8(){var i;return((i=Qn())==null?void 0:i.player)||null}function D$(){const i=Qn(),{audioTracks:e,audioTrack:t}=i.$state,s=$e(e);return $e(t),c.useMemo(()=>{const n=s.map(a=>({track:a,label:a.label,value:m2(a),get selected(){return t()===a},select(l){const u=e().indexOf(a);u>=0&&i.remote.changeAudioTrack(u,l)}}));return Object.defineProperty(n,"disabled",{get(){return n.length<=1}}),Object.defineProperty(n,"selectedTrack",{get(){return t()}}),Object.defineProperty(n,"selectedValue",{get(){const a=t();return a?m2(a):void 0}}),n},[s])}function m2(i){return i.label.toLowerCase()}function L$({off:i=!0}={}){const e=Qn(),{textTracks:t,textTrack:s}=e.$state,n=$e(t);return $e(s),c.useMemo(()=>{const a=n.filter(pi),l=a.map(u=>({track:u,label:u.label,value:g2(u),get selected(){return s()===u},select(d){const h=t().indexOf(u);h>=0&&e.remote.changeTextTrackMode(h,"showing",d)}}));return i&&l.unshift({track:null,label:le(i)?i:"Off",value:"off",get selected(){return!s()},select(u){e.remote.toggleCaptions(u)}}),Object.defineProperty(l,"disabled",{get(){return!a.length}}),Object.defineProperty(l,"selectedTrack",{get(){return s()}}),Object.defineProperty(l,"selectedValue",{get(){const u=s();return u?g2(u):"off"}}),l},[n])}function g2(i){return i.id+":"+i.kind+"-"+i.label.toLowerCase()}function N$({auto:i=!0,sort:e="descending"}={}
10){const t=Qn(),{qualities:s,quality:n,autoQuality:a,canSetQuality:l}=t.$state,u=$e(s);return $e(n),$e(a),$e(l),c.useMemo(()=>{const d=jy(u,e==="descending").map(h=>({quality:h,label:h.height+"p",value:y2(h),bitrateText:h.bitrate&&h.bitrate>0?`${(h.bitrate/1e6).toFixed(2)} Mbps`:null,get selected(){return h===n()},get autoSelected(){return a()},select(p){const f=s().indexOf(h);f>=0&&t.remote.changeQuality(f,p)}}));return i&&d.unshift({quality:null,label:le(i)?i:"Auto",value:"auto",bitrateText:null,get selected(){return a()},get autoSelected(){return a()},select(h){t.remote.requestAutoQuality(h)}}),Object.defineProperty(d,"disabled",{get(){return!l()||u.length<=1}}),Object.defineProperty(d,"selectedQuality",{get(){return n()}}),Object.defineProperty(d,"selectedValue",{get(){const h=n();return!a()&&h?y2(h):"auto"}}),d},[u,e])}function y2(i){return i.height+"_"+i.bitrate}const O$=Oe(yk,{events:["onChange"]}),u8=c.forwardRef(({style:i,children:e,...t},s)=>c.createElement(O$,t,n=>c.createElement(pe.div,{...n,style:{display:"contents",...i},ref:nt(n.ref,s)},e)));u8.displayName="MediaAnnouncer";const V$=Oe(bk),Gh=c.forwardRef(({children:i,...e},t)=>c.createElement(V$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));Gh.displayName="Controls";const B$=Oe(vk),Ws=c.forwardRef(({children:i,...e},t)=>c.createElement(B$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));Ws.displayName="ControlsGroup";const q$=Oe(Rk);function d8({children:i,...e}){return c.createElement(q$,e,i)}d8.displayName="Tooltip";const F$=Oe(Ak),h8=c.forwardRef(({children:i,...e},t)=>c.createElement(F$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));h8.displayName="TooltipTrigger";const W$=Oe(Ik),p8=c.forwardRef(({children:i,...e},t)=>c.createElement(W$,e,s=>c.createElement(pe.div,{...s,ref:nt(s.ref,t)},i)));p8.displayName="TooltipContent";const H$=Oe(Pk,{domEventsRegex:/^onMedia/}),f8=c.forwardRef(({children:i,...e},t)=>c.createElement(H$,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));f8.displayName="GoogleCastButton";const j$=Oe(Lk,{events:ec,domEventsRegex:/^onMedia/}),m8=c.forwardRef(({children:i,...e},t)=>c.createElement(j$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));m8.displayName="AudioGainSlider";const G$=Oe(Nk,{events:ec,domEventsRegex:/^onMedia/}),g8=c.forwardRef(({children:i,...e},t)=>c.createElement(G$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));g8.displayName="SpeedSlider";const y8=c.forwardRef(({children:i,...e},t)=>{const s=Pe("title");return c.createElement(pe.span,{...e,ref:t},s,i)});y8.displayName="Title";function b8(i){const[e,t]=c.useState([]);return c.useEffect(()=>{if(!i){t([]);return}function s(){i&&t(i.activeCues)}return s(),pt(i,"cue-change",s)},[i]),e}function a3(i){const e=Qn(),[t,s]=c.useState(null);return c.useEffect(()=>Vu(e.textTracks,i,s),[e.textTracks,i]),t}function v8(){var i;return((i=b8(a3("chapters"))[0])==null?void 0:i.text)||""}const C8=c.forwardRef(({defaultText:i="",children:e,...t},s)=>{const n=v8();return c.createElement(pe.span,{...t,ref:s},n||i,e)});
10C8.displayName="ChapterTitle";const z$=Oe(Qk),S8=c.forwardRef(({children:i,...e},t)=>c.createElement(z$,{...e,ref:t},s=>c.createElement(pe.div,s,i)));S8.displayName="Captions";const U$=c.forwardRef(({size:i=96,children:e,...t},s)=>c.createElement("svg",{width:i,height:i,fill:"none",viewBox:"0 0 120 120","aria-hidden":"true","data-part":"root",...t,ref:s},e)),K$=c.forwardRef(({width:i=8,children:e,...t},s)=>c.createElement("circle",{cx:"60",cy:"60",r:"54",stroke:"currentColor",strokeWidth:i,"data-part":"track",...t,ref:s},e)),Q$=c.forwardRef(({width:i=8,fillPercent:e=50,children:t,...s},n)=>c.createElement("circle",{cx:"60",cy:"60",r:"54",stroke:"currentColor",pathLength:"100",strokeWidth:i,strokeDasharray:100,strokeDashoffset:100-e,"data-part":"track-fill",...s,ref:n},t));function mp(i,e=[]){const t=Yl();return c.useMemo(()=>Wt(()=>de(i),t),[t,...e])}function ih(i,e=[]){const t=Yl();return c.useMemo(()=>Wt(()=>On(i),t),[t,...e])}function Z$(i,e=[]){const t=Yl();c.useEffect(()=>Wt(()=>I(i),t),[t,...e])}function Y$(i){const e=Yl();return c.useMemo(()=>Wt(i,e),[e])}function X$(i){const[e,t]=c.useState([]);return c.useEffect(()=>{if(!i)return;function s(){i&&t([...i.cues])}const n=new Xe(i).add("add-cue",s).add("remove-cue",s);return s(),()=>{t([]),n.abort()}},[i]),e}function J$(){const i=Qn(),e=a3("chapters"),t=X$(e),s=$e(i.$state.seekableStart),n=$e(i.$state.seekableEnd);return b8(e),c.useMemo(()=>{const a=e?t.filter(l=>l.startTime<=n&&l.endTime>=s).map((l,u)=>{let d=null,h;return{cue:l,label:l.text,value:u.toString(),startTimeText:Vh(Math.max(0,l.startTime-s)),durationText:eh(Math.min(n,l.endTime)-Math.max(s,l.startTime)),get selected(){return l===e.activeCues[0]}
10,setProgressVar(p){if(!p||l!==e.activeCues[0]){h==null||h(),h=void 0,p==null||p.style.setProperty("--progress","0%"),d=null;return}d!==p&&(d=p,h==null||h(),h=I(()=>{const{realCurrentTime:f}=i.$state,y=f(),v=Math.max(s,l.startTime),C=Math.min(n,l.endTime)-v,S=Math.max(0,y-v)/C*100;p.style.setProperty("--progress",S.toFixed(3)+"%")}))},select(p){i.remote.seek(l.startTime-s,p)}}}):[];return Object.defineProperty(a,"selectedValue",{get(){const l=a.findIndex(u=>u.selected);return(l>=0?l:0).toString()}}),a},[t,s,n])}const o3=c.forwardRef((i,e)=>{const{width:t,height:s,size:n=null,paths:a,...l}=i;return c.createElement("svg",{viewBox:"0 0 32 32",...l,width:t??n,height:s??n,fill:"none","aria-hidden":"true",focusable:"false",xmlns:"http://www.w3.org/2000/svg",ref:e,dangerouslySetInnerHTML:{__html:a}})});o3.displayName="VidstackIcon";const eP=[1,1.25,1.5,1.75,2,2.5,3,4];var Up,Fr,Ol,so,rs,w8,x8,E8,T8,k8,tP=(Up=class extends Ne{constructor(){super();g(this,rs);g(this,Fr);g(this,Ol);g(this,so);b(this,so,new J4),r(this,so).onValueChange=o(this,rs,k8).bind(this)}get value(){return r(this,so).value}get disabled(){const{gains:e}=this.$props,{canSetAudioGain:t}=r(this,Fr).$state;return!t()||e().length===0}onSetup(){b(this,Fr,ut()),Vn(Nn)&&b(this,Ol,Tt(Nn))}onConnect(e){I(o(this,rs,w8).bind(this)),I(o(this,rs,x8).bind(this)),I(o(this,rs,E8).bind(this))}getOptions(){const{gains:e,normalLabel:t}=this.$props;return e().map(s=>({label:s===1||s===null?t:String(s*100)+"%",value:s.toString()}))}},Fr=new WeakMap,Ol=new WeakMap,so=new WeakMap,rs=new WeakSet,w8=function(){r(this,so).value=o(this,rs,T8).call(this)},x8=function(){var n;const{normalLabel:e}=this.$props,{audioGain:t}=r(this,Fr).$state,s=t();(n=r(this,Ol))==null||n.hint.set(s===1||s==null?e():String(s*100)+"%")},E8=function(){var e;(e=r(this,Ol))==null||e.disable(this.disabled)},T8=function(){var t;const{audioGain:e}=r(this,Fr).$state;return((t=e())==null?void 0:t.toString())??"1"},k8=function(e,t){if(this.disabled)return;const s=+e;r(this,Fr).remote.changeAudioGain(s,t),this.dispatch("change",{detail:s,trigger:t})},O(Up,"props",{normalLabel:"Disabled",gains:eP}),Up);const l3=tP.prototype;at(l3,"value");at(l3,"disabled");Ut(l3,"getOptions");const iP=Oe(B7,{events:["onAbort","onAudioTrackChange","onAudioTracksChange","onAutoPlay","onAutoPlayChange","onAutoPlayFail","onCanLoad","onCanPlay","onCanPlayThrough","onControlsChange","onDestroy","onDurationChange","onEmptied","onEnd","onEnded","onError","onFindMediaPlayer","onFullscreenChange","onFullscreenError","onLiveChange","onLiveEdgeChange","onLoadedData","onLoadedMetadata","onLoadStart","onLoopChange","onOrientationChange","onPause","onPictureInPictureChange","onPictureInPictureError","onPlay","onPlayFail","onPlaying","onPlaysInlineChange","onPosterChange","onProgress","onProviderChange","onProviderLoaderChange","onProviderSetup","onQualitiesChange","onQualityChange","onRateChange","onReplay","onSeeked","onSeeking","onSourceChange","onSourceChange","onStalled","onStarted","onStreamTypeChange","onSuspend","onTextTrackChange","onTextTracksChange","onTimeUpdate","onTitleChange","onVdsLog","onVideoPresentationChange","onVolumeChange","onWaiting"],eventsRegex:/^onHls/,domEventsRegex:/^onMedia/}),$8=c.forwardRef(({aspectRatio:i,children:e,...t},s)=>c.createElement(iP,{...t,src:t.src,ref:s,style:{aspectRatio:i,...t.style}},n=>c.createElement(pe.div,n,e)));$8.displayName="MediaPlayer";const sP=Oe(gk),P8=c.forwardRef(({loaders:i=[],children:e,iframeProps:t,mediaProps:s,...n},a)=>{const l=c.useMemo(()=>i.map(u=>new u),i);return c.createElement(sP,{...n,loaders:l,ref:a},(u,d)=>c.createElement("div",u,c.createElement(M8,{provider:d,mediaProps:s,iframeProps:t}),e))});P8.displayName="MediaProvider";function M8({provider:i,mediaProps:e,iframeProps:t}){const{sources:s,crossOrigin:n,poster:a,remotePlaybackInfo:l,nativeControls:u,viewType:d}=Xl(Bu),{loader:h}=i.$state,{$provider:p,$providerSetup:f}=Qn(),y=$e(s),v=$e(u),C=$e(n),S=$e(a),w=$e(h),T=$e(p),E=$e(f),M=$e(l),x=w==null?void 0:w.mediaType(),P=$e(d)==="audio",R=(w==null?void 0:w.name)==="youtube",_=(w==null?void 0:w.name)==="vimeo",$=
10R||_,G=(w==null?void 0:w.name)==="remotion",q=(w==null?void 0:w.name)==="google-cast",[F,H]=c.useState(""),[N,A]=c.useState(!1),W=c.useCallback(V=>{i.load(V)},[i]);return c.useEffect(()=>{!q||F||mi(()=>Promise.resolve().then(()=>Fx),void 0).then(V=>V.chromecast_exports).then(V=>{H(V.default)})},[q]),c.useLayoutEffect(()=>{A(!0)},[]),q?c.createElement("div",{className:"vds-google-cast",ref:W},c.createElement(o3,{paths:F}),M!=null&&M.deviceName?c.createElement("span",{className:"vds-google-cast-info"},"Google Cast on"," ",c.createElement("span",{className:"vds-google-cast-device-name"},M.deviceName)):null):G?c.createElement("div",{"data-remotion-canvas":!0},c.createElement("div",{"data-remotion-container":!0,ref:W},Ty(T)&&E?c.createElement(T.render):null)):$?c.createElement(c.Fragment,null,c.createElement("iframe",{...t,className:(t!=null&&t.className?`${t.className} `:"")+R?"vds-youtube":"vds-vimeo",suppressHydrationWarning:!0,tabIndex:v?void 0:-1,"aria-hidden":"true","data-no-controls":v?void 0:"",ref:W}),!v&&!P?c.createElement("div",{className:"vds-blocker"}):null):x?c.createElement(x==="audio"?"audio":"video",{...e,controls:v?!0:null,crossOrigin:typeof C=="boolean"?"":C,poster:x==="video"&&v&&S?S:null,suppressHydrationWarning:!0,children:N?null:y.map(({src:V,type:K})=>le(V)?c.createElement("source",{src:V,type:K!=="?"?K:void 0,key:V}):null),ref:W}):null}M8.displayName="MediaOutlet";const nP=Oe(Ck),rP=c.forwardRef(({children:i,...e},t)=>c.createElement(nP,e,s=>c.createElement(pe.button,{...s,ref:nt(s.ref,t)},i)));rP.displayName="ToggleButton";const aP=Oe(Ok,{events:ec,domEventsRegex:/^onMedia/}),oP=c.forwardRef(({children:i,...e},t)=>c.createElement(aP,{...e,ref:t},s=>c.createElement(pe.div,s,i)));oP.displayName="QualitySlider";const lP=Oe(Yk),R8=c.forwardRef(({children:i,...e},t)=>c.createElement(lP,{src:e.asChild&&c.isValidElement(i)?i.props.src:void 0,...e},(s,n)=>c.createElement(A8,{...s,instance:n,ref:nt(s.ref,t)},i)));R8.displayName="Poster";const A8=c.forwardRef(({instance:i,children:e,...t},s)=>{const{src:n,img:a,alt:l,crossOrigin:u,hidden:d}=i.$state,h=$e(n),p=$e(l),f=$e(u),y=$e(d);return c.createElement(pe.img,{...t,src:h||void 0,alt:p||void 0,crossOrigin:f||void 0,ref:nt(a.set,s),style:{display:y?"none":void 0}},e)});A8.displayName="PosterImg";const cP=c.forwardRef(({children:i,...e},t)=>c.createElement(pe.div,{translate:"yes","aria-live":"off","aria-atomic":"true",...e,ref:t},i));cP.displayName="Caption";const uP=c.forwardRef((i,e)=>{const t=Pe("textTrack"),[s,n]=c.useState();return c.useEffect(()=>{if(!t)return;function a(){n(t==null?void 0:t.activeCues[0])}return t.addEventListener("cue-change",a),()=>{t.removeEventListener("cue-change",a),n(void 0)}},[t]),c.createElement(pe.span,{...i,"data-part":"cue",dangerouslySetInnerHTML:{__html:(s==null?void 0:s.text)||""},ref:e})});uP.displayName="CaptionText";function be(i){function e(t){return c.createElement(o3,{paths:i,...t})}return e.displayName="DefaultLayoutIcon",e}const dP={AirPlayButton:{Default:be(Dg)},GoogleCastButton:{Default:be(Bm)},PlayButton:{Play:be(lf),Pause:be(rf),Replay:be(Kg)},MuteButton:{Mute:be(sf),VolumeLow:be(Sd),VolumeHigh:be(Cd)},CaptionButton:{On:be(Jp),Off:be(vd)},PIPButton:{Enter:be(of),Exit:be(af)},FullscreenButton:{Enter:be(tf),Exit:be(ef)},SeekButton:{Backward:be(Qg),Forward:be(Zg)},DownloadButton:{Default:be(Fg)},Menu:{Accessibility:be(_g),ArrowLeft:be(Ng),ArrowRight:be(qg),Audio:be(Gg),Chapters:be(Vg),Captions:be(vd),Playback:be(Ug),Settings:be(Yg),AudioBoostUp:be(Cd),AudioBoostDown:be(Sd),SpeedUp:be(nf),SpeedDown:be(nf),QualityUp:be(cf),QualityDown:be(cf),FontSizeUp:be(Og),FontSizeDown:be(Lg),OpacityUp:be(Wg),OpacityDown:be(zg),RadioCheck:be(Bg)},KeyboardDisplay:{Play:be(lf),Pause:be(rf),Mute:be(sf),VolumeUp:be(Cd),VolumeDown:be(Sd),EnterFullscreen:be(tf),ExitFullscreen:be(ef),EnterPiP:be(of),ExitPiP:be(af),CaptionsOn:be(Jp),CaptionsOff:be(vd),SeekForward:be(jg),SeekBackward:be(Hg)}},hP=de(null),pP=de(null);function I8(i,e){c.useEffect(()=>{if(!i)return;e();const t=new ResizeObserver(Xr(e));return t.observe(i),()=>t.disconnect()},[i,e])}function fP(i){const[e,t]=c.useState(!1);return c.useEffect(()=>{if(!i)return;const s=new Xe(i).add("transitionstart",()=>t(!0)).add("transitionend",()=>t(!1));return()=>s.abort()},[i]),e}function mP(i){const[e,t]=c.useState(!1);return c.useEffect(()=>{if(!i)return;const s=new Xe(i).add("mouseenter",()=>t(!0)).add("mouseleave",()=>t(!1));return()=>s.abort()},[i]),e}function gP(i){const[e,t]=c.useState(!1);return c.useEffect(()=>{if(!i)return;const s=new Xe(i).add("focusin",()=>t(!0)).add("focusout",()=>t(!1));return()=>s.abort()},[i]),e}function yP(i){const e=mP(i),t=gP(i),s=c.useRef(!1);return s.current&&!e&&!t?!1:(s.current=e,e||t)}function bP(){const[i,e]=c.useState("dark");return c.useEffect(()=>{const t=window.matchMedia("(prefers-color-scheme: light)");function s(){e(t.matches?"light":"dark")}return s(),pt(t,"change",s)},[]),i}function _8(i){const e=c8();c.useEffect(()=>{if(e)return I(()=>{const t=e.$el;return t==null||t.setAttribute("data-layout",i),()=>t==null?void 0:t.removeAttribute("data-layout")})},[e])}const sc=c.createContext({});sc.displayName="DefaultLayoutContext";function Me(){return c.useContext(sc)}function xe(i){const{translations:e}=Me();return c3(e,i)}function c3(i,e){return(i==null?void 0:i[e])??e}function u3(i){const e=bP();return i==="default"?null:i==="system"?e:i}function D8({type:i,smLayoutWhen:e,renderLayout:t}){const s=c.forwardRef(({children:n,className:a,disableTimeSlider:l=!1,hideQualityBitrate:u=!1,icons:d,colorScheme:h="system",download:p=null,menuContainer:f=null,menuGroup:y="bottom",noAudioGain:v=!1,audioGains:C={min:0,max:300,step:25}
10,noGestures:S=!1,noKeyboardAnimations:w=!1,noModal:T=!1,noScrubGesture:E,playbackRates:M={min:0,max:2,step:.25},seekStep:x=10,showMenuDelay:P,showTooltipDelay:R=700,sliderChaptersMinWidth:_=325,slots:$,smallLayoutWhen:G=e,thumbnails:q=null,translations:F,...H},N)=>{const A=Qn(),W=$e(A.$props.load),V=Pe("canLoad"),K=Pe("viewType"),re=Pe("streamType"),oe=ih(()=>Fl(G)?G:G(A.player.state),[G]),Z=mp(!0),fe=mp(!0),me=K===i,Q=oe(),j=Fl(G),X=W==="play"&&!V,Te=V||j||X,Ce=u3(h),Ie=mp(null);return $e(oe),c.createElement("div",{...H,className:`vds-${i}-layout`+(Ce?` ${Ce}`:"")+(a?` ${a}`:""),"data-match":me?"":null,"data-sm":Q?"":null,"data-lg":Q?null:"","data-size":Q?"sm":"lg","data-no-scrub-gesture":E?"":null,ref:nt(Ie.set,N)},Te&&me?c.createElement(sc.Provider,{value:{disableTimeSlider:l,hideQualityBitrate:u,icons:d,colorScheme:h,download:p,isSmallLayout:Q,menuContainer:f,menuGroup:y,noAudioGain:v,audioGains:C,layoutEl:Ie,noGestures:S,noKeyboardAnimations:w,noModal:T,noScrubGesture:E,showMenuDelay:P,showTooltipDelay:R,sliderChaptersMinWidth:_,slots:$,seekStep:x,playbackRates:M,thumbnails:q,translations:F,userPrefersAnnouncements:Z,userPrefersKeyboardAnimations:fe}},t({streamType:re,isSmallLayout:Q,isLoadLayout:X}),n):null)});return s.displayName="DefaultMediaLayout",s}function L8(){return c.useContext(sc).slots}function d3(){return c.useContext(sc).slots}function ie(i,e,t){const s=i==null?void 0:i[e],n=Ql(e);return c.createElement(c.Fragment,null,i==null?void 0:i[`before${n}`],Ot(s)?t:s,i==null?void 0:i[`after${n}`])}function zh(){const{userPrefersAnnouncements:i,translations:e}=Me();return $e(i)?c.createElement(u8,{translations:e}):null}zh.displayName="DefaultAnnouncer";function as({content:i,placement:e,children:t}){const{showTooltipDelay:s}=Me();return c.createElement(d8,{showDelay:s},c.createElement(h8,{asChild:!0},t),c.createElement(p8,{className:"vds-tooltip-content",placement:e},i))}as.displayName="DefaultTooltip";function Hu({tooltip:i}){const{icons:e}=Me(),t=xe("Play"),s=xe("Pause"),n=Pe("paused"),a=Pe("ended");return c.createElement(as,{content:n?t:s,placement:i},c.createElement(j7,{className:"vds-play-button vds-button","aria-label":t},a?c.createElement(e.PlayButton.Replay,{className:"vds-icon"}):n?c.createElement(e.PlayButton.Play,{className:"vds-icon"}):c.createElement(e.PlayButton.Pause,{className:"vds-icon"})))}Hu.displayName="DefaultPlayButton";const N8=c.forwardRef(({tooltip:i},e)=>{const{icons:t}=Me(),s=xe("Mute"),n=xe("Unmute"),a=Pe("muted"),l=Pe("volume");return c.createElement(as,{content:a?n:s,placement:i},c.createElement(U7,{className:"vds-mute-button vds-button","aria-label":s,ref:e},a||l==0?c.createElement(t.MuteButton.Mute,{className:"vds-icon"}):l<.5?c.createElement(t.MuteButton.VolumeLow,{className:"vds-icon"}):c.createElement(t.MuteButton.VolumeHigh,{className:"vds-icon"})))});N8.displayName="DefaultMuteButton";function Uh({tooltip:i}){const{icons:e}=Me(),t=xe("Captions"),s=xe("Closed-Captions On"),n=xe("Closed-Captions Off"),a=Pe("textTrack"),l=a&&pi(a);return c.createElement(as,{content:l?s:n,placement:i},c.createElement(G7,{className:"vds-caption-button vds-button","aria-label":t},l?c.createElement(e.CaptionButton.On,{className:"vds-icon"}):c.createElement(e.CaptionButton.Off,{className:"vds-icon"})))}Uh.displayName="DefaultCaptionButton";function O8({tooltip:i}){const{icons:e}=Me(),t=xe("PiP"),s=xe("Enter PiP"),n=xe("Exit PiP"),a=Pe("pictureInPicture");return c.createElement(as,{content:a?n:s,placement:i},c.createElement(K7,{className:"vds-pip-button vds-button","aria-label":t},a?c.createElement(e.PIPButton.Exit,{className:"vds-icon"}):c.createElement(e.PIPButton.Enter,{className:"vds-icon"})))}O8.displayName="DefaultPIPButton";function h3({tooltip:i}){const{icons:e}=Me(),t=xe("Fullscreen"),s=xe("Enter Fullscreen"),n=xe("Exit Fullscreen"),a=Pe("fullscreen");return c.createElement(as,{content:a?n:s,placement:i},c.createElement(z7,{className:"vds-fullscreen-button vds-button","aria-label":t},a?c.createElement(e.FullscreenButton.Exit,{className:"vds-icon"}):c.createElement(e.FullscreenButton.Enter,{className:"vds-icon"})))}h3.displayName="DefaultFullscreenButton";function gm({backward:i,tooltip:e}){const{icons:t,seekStep:s}=Me(),n=xe("Seek Forward"),a=xe("Seek Backward"),l=(i?-1:1)*s,u=l>=0?n:a;return c.createElement(as,{content:u,placement:e},c.createElement(Q7,{className:"vds-seek-button vds-button",seconds:l,"aria-label":u},l>=0?c.createElement(t.SeekButton.Forward,{className:"vds-icon"}):c.createElement(t.SeekButton.Backward,{className:"vds-icon"})))}gm.displayName="DefaultSeekButton";function p3({tooltip:i}){const{icons:e}=Me(),t=xe("AirPlay"),s=Pe("remotePlaybackState"),n=`${t} ${xe(Ql(s))}`,a=(s==="connecting"?e.AirPlayButton.Connecting:s==="connected"?e.AirPlayButton.Connected:null)??e.AirPlayButton.Default;return c.createElement(as,{content:t,placement:i},c.createElement(H7,{className:"vds-airplay-button vds-button","aria-label":n},c.createElement(a,{className:"vds-icon"})))}p3.displayName="DefaultAirPlayButton";function f3({tooltip:i}){const{icons:e}=Me(),t=xe("Google Cast"),s=Pe("remotePlaybackState"),n=`${t} ${xe(Ql(s))}`,a=(s==="connecting"?e.GoogleCastButton.Connecting:s==="connected"?e.GoogleCastButton.Connected:null)??e.GoogleCastButton.Default;return c.createElement(as,{content:t,placement:i},c.createElement(f8,{className:"vds-google-cast-button vds-button","aria-label":n},c.createElement(a,{className:"vds-icon"})))}f3.displayName="DefaultGoogleCastButton";function m3(){const i=Pe("live"),e=xe("Skip To Live"),t=xe("LIVE");return i?c.createElement(Z7,{className:"vds-live-button","aria-label":e},c.createElement("span",{className:"vds-live-button-text"},t)):null}m3.displayName="DefaultLiveButton";function Kh(){const{download:i,icons:e}=Me(),t=Pe("source"),s=p0({title:Pe("title"),src:t,download:i}),n=xe("Download");return le(s==null?void 0:s.url)?c.createElement(as,{content:n,placement:"top"},c.createElement("a",{role:"button",className:"vds-download-button vds-button","aria-label":n,href:b$(s.url,{download:s.name}),download:s.name,target:"_blank"},e.DownloadButton?c.createElement(e.DownloadButton.Default,{className:"vds-icon"}):null)):null}Kh.displayName="DefaultDownloadButton";function Qh(){const i=xe("Captions look like this");return c.createElement(S8,{className:"vds-captions",exampleText:i})}Qh.displayName="DefaultCaptions";function Ri(){return c.createElement("div",{className:"vds-controls-spacer"})}Ri.displayName="DefaultControlsSpacer";function V8(){const{layoutEl:i}
10=Me(),e=$e(i);return c.useMemo(()=>e==null?void 0:e.closest("dialog"),[e])}function g3({tooltip:i,placement:e,portalClass:t=""}){const{showMenuDelay:s,noModal:n,isSmallLayout:a,icons:l,menuGroup:u,menuContainer:d,colorScheme:h}=Me(),p=xe("Chapters"),f=J$(),y=!f.length,{thumbnails:v}=Me(),C=Pe("currentSrc"),S=Pe("viewType"),w=!a&&u==="bottom"&&S==="video"?26:0,T=$e(hP),E=u3(h),[M,x]=c.useState(!1),P=V8();if(y)return null;function R(){Em.flushSync(()=>{x(!0)})}function _(){x(!1)}const $=c.createElement(ws,{className:"vds-chapters-menu-items vds-menu-items",placement:e,offset:w},M?c.createElement(tc,{className:"vds-chapters-radio-group vds-radio-group",value:f.selectedValue,"data-thumbnails":v?"":null},f.map(({cue:G,label:q,value:F,startTimeText:H,durationText:N,select:A,setProgressVar:W})=>c.createElement(ic,{className:"vds-chapter-radio vds-radio",value:F,key:F,onSelect:A,ref:W},v?c.createElement(e8,{src:v,className:"vds-thumbnail",time:G.startTime},c.createElement(n3,null)):T&&Xm(C)?c.createElement(T,{className:"vds-thumbnail",frame:G.startTime*C.fps}):null,c.createElement("div",{className:"vds-chapter-radio-content"},c.createElement("span",{className:"vds-chapter-radio-label"},q),c.createElement("span",{className:"vds-chapter-radio-start-time"},H),c.createElement("span",{className:"vds-chapter-radio-duration"},N))))):null);return c.createElement(Ss,{className:"vds-chapters-menu vds-menu",showDelay:s,onOpen:R,onClose:_},c.createElement(as,{content:p,placement:i},c.createElement(jh,{className:"vds-menu-button vds-button",disabled:y,"aria-label":p},c.createElement(l.Menu.Chapters,{className:"vds-icon"}))),n||!a?$:c.createElement(r3,{container:d??P,className:t+(E?` ${E}`:""),disabled:"fullscreen","data-sm":a?"":null,"data-lg":a?null:"","data-size":a?"sm":"lg"},$))}g3.displayName="DefaultChaptersMenu";const y3={type:"color"},vP={type:"radio",values:{"Monospaced Serif":"mono-serif","Proportional Serif":"pro-serif","Monospaced Sans-Serif":"mono-sans","Proportional Sans-Serif":"pro-sans",Casual:"casual",Cursive:"cursive","Small Capitals":"capitals"}},CP={type:"slider",min:0,max:400,step:25,upIcon:null,downIcon:null},b3={type:"slider",min:0,max:100,step:5,upIcon:null,downIcon:null},SP={type:"radio",values:["None","Drop Shadow","Raised","Depressed","Outline"]},kc={fontFamily:"pro-sans",fontSize:"100%",textColor:"#ffffff",textOpacity:"100%",textShadow:"none",textBg:"#000000",textBgOpacity:"100%",displayBg:"#000000",displayBgOpacity:"0%"},Bn=Object.keys(kc).reduce((i,e)=>({...i,[e]:de(kc[e])}),{});if(!se)for(const i of Object.keys(Bn)){const e=localStorage.getItem(`vds-player:${zn(i)}`);le(e)&&Bn[i].set(e)}function wP(){for(const i of Object.keys(Bn)){const e=kc[i];Bn[i].set(e)}}function gp(i){const{style:e}=new Option;return e.color=i,e.color.match(/\((.*?)\)/)[1].replace(/,/g," ")}let b2=!1,yp=new Set;function xP(){if(se)return;const{player:i}=ut();yp.add(i),EP(i),_e(()=>yp.delete(i)),b2||(Wt(()=>{for(const e of Om(Bn)){const t=Bn[e],s=kc[e],n=`vds-player:${zn(e)}`;I(()=>{const a=t(),l=a===s;for(const u of yp)B8(u,e,a);l?localStorage.removeItem(n):localStorage.setItem(n,a)})}},null),b2=!0)}function EP(i){for(const e of Om(Bn))B8(i,e,Bn[e]())}function B8(i,e,t){var l,u;const s=kc[e],n=`--media-user-${zn(e)}`,a=t!==s?TP(e,t):null;if(e==="fontFamily"){const d=t==="capitals"?"small-caps":null;(l=i.el)==null||l.style.setProperty("--media-user-font-variant",d)}(u=i.el)==null||u.style.setProperty(n,a)}function TP(i,e){switch(i){case"fontFamily":return $P(e);case"fontSize":case"textOpacity":case"textBgOpacity":case"displayBgOpacity":return kP(e);case"textColor":return`rgb(${gp(e)} / var(--media-user-text-opacity, 1))`;case"textShadow":return PP(e);case"textBg":return`rgb(${gp(e)} / var(--media-user-text-bg-opacity, 1))`;case"displayBg":return`rgb(${gp(e)} / var(--media-user-display-bg-opacity, 1))`}}function kP(i){return(parseInt(i)/100).toString()}function $P(i){switch(i){case"mono-serif":return'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace';case"mono-sans":return'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace';
10case"pro-sans":return'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif';case"casual":return'"Comic Sans MS", Impact, Handlee, fantasy';case"cursive":return'"Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive';case"capitals":return'"Arial Unicode Ms", Arial, Helvetica, Verdana, "Marcellus SC", sans-serif + font-variant=small-caps';default:return'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'}}function PP(i){switch(i){case"drop shadow":return"rgb(34, 34, 34) 1.86389px 1.86389px 2.79583px, rgb(34, 34, 34) 1.86389px 1.86389px 3.72778px, rgb(34, 34, 34) 1.86389px 1.86389px 4.65972px";case"raised":return"rgb(34, 34, 34) 1px 1px, rgb(34, 34, 34) 2px 2px";case"depressed":return"rgb(204, 204, 204) 1px 1px, rgb(34, 34, 34) -1px -1px";case"outline":return"rgb(34, 34, 34) 0px 0px 1.86389px, rgb(34, 34, 34) 0px 0px 1.86389px, rgb(34, 34, 34) 0px 0px 1.86389px, rgb(34, 34, 34) 0px 0px 1.86389px, rgb(34, 34, 34) 0px 0px 1.86389px";default:return""}}function qs({label:i,value:e,children:t}){const s=c.useId();return i?c.createElement("section",{className:"vds-menu-section",role:"group","aria-labelledby":s},c.createElement("div",{className:"vds-menu-section-title"},c.createElement("header",{id:s},i),e?c.createElement("div",{className:"vds-menu-section-value"},e):null),c.createElement("div",{className:"vds-menu-section-body"},t)):c.createElement("div",{className:"vds-menu-section"},c.createElement("div",{className:"vds-menu-section-body"},t))}qs.displayName="DefaultMenuSection";function Zn({label:i,hint:e="",Icon:t,disabled:s=!1}){const{icons:n}=c.useContext(sc);return c.createElement(jh,{className:"vds-menu-item",disabled:s},c.createElement(n.Menu.ArrowLeft,{className:"vds-menu-close-icon vds-icon"}),t?c.createElement(t,{className:"vds-menu-item-icon vds-icon"}):null,c.createElement("span",{className:"vds-menu-item-label"},i),c.createElement("span",{className:"vds-menu-item-hint"},e),c.createElement(n.Menu.ArrowRight,{className:"vds-menu-open-icon vds-icon"}))}Zn.displayName="DefaultMenuButton";function Zh({label:i,children:e}){return c.createElement("div",{className:"vds-menu-item"},c.createElement("div",{className:"vds-menu-item-label"},i),e)}Zh.displayName="DefaultMenuItem";function q8({value:i,options:e,onChange:t}){const{icons:s}=Me();return c.createElement(tc,{className:"vds-radio-group",value:i,onChange:t},e.map(n=>c.createElement(ic,{className:"vds-radio",value:n.value,key:n.value},c.createElement(s.Menu.RadioCheck,{className:"vds-icon"}),c.createElement("span",{className:"vds-radio-label","data-part":"label"},n.label))))}q8.displayName="DefaultMenuRadioGroup";function MP(i){return c.useMemo(()=>wt(i)?i.map(e=>({label:e,value:e.toLowerCase()})):Object.keys(i).map(e=>({label:e,value:i[e]})),[i])}function Yh({label:i,value:e,UpIcon:t,DownIcon:s,children:n,isMin:a,isMax:l}){const u=i||e,d=c.createElement(c.Fragment,null,s?c.createElement(s,{className:"vds-icon down"}):null,n,t?c.createElement(t,{className:"vds-icon up"}):null);return c.createElement("div",{className:`vds-menu-item vds-menu-slider-item${u?" group":""}`,"data-min":a?"":null,"data-max":l?"":null},u?c.createElement(c.Fragment,null,c.createElement("div",{className:"vds-menu-slider-title"},i?c.createElement("div",null,i):null,e?c.createElement("div",null,e):null),c.createElement("div",{className:"vds-menu-slider-body"},d)):d)}Yh.displayName="DefaultMenuSliderItem";function Xh(){return c.createElement(c.Fragment,null,c.createElement(Fh,{className:"vds-slider-track"}),c.createElement(Wh,{className:"vds-slider-track-fill vds-slider-track"}),c.createElement(qh,{className:"vds-slider-thumb"}))}Xh.displayName="DefaultSliderParts";function Jh(){return c.createElement(X7,{className:"vds-slider-steps"},i=>c.createElement("div",{className:"vds-slider-step",key:String(i)}))}Jh.displayName="DefaultSliderSteps";function F8(){const i=xe("Caption Styles"),e=Pe("hasCaptions"),t=xe("Font"),s=xe("Text"),n=xe("Text Background"),a=xe("Display Background");return e?c.createElement(Ss,{className:"vds-font-menu vds-menu"},c.createElement(Zn,{label:i}),c.createElement(ws,{className:"vds-font-style-items vds-menu-items"},c.createElement(qs,{label:t},c.createElement(W8,null),c.createElement(H8,null)),c.createElement(qs,{label:s},c.createElement(j8,null),c.createElement(z8,null),c.createElement(G8,null)),c.createElement(qs,{label:n},c.createElement(U8,null),c.createElement(K8,null)),c.createElement(qs,{label:a},c.createElement(Q8,null),c.createElement(Z8,null)),c.createElement(qs,null,c.createElement(X8,null)))):null}F8.displayName="DefaultFontMenu";function W8(){return c.createElement(sn,{label:"Family",type:"fontFamily",option:vP})}W8.displayName="DefaultFontFamilyMenu";function H8(){const{icons:i}=Me(),e={...CP,upIcon:i.Menu.FontSizeUp,downIcon:i.Menu.FontSizeDown};return c.createElement(sn,{label:"Size",type:"fontSize",option:e})}
10H8.displayName="DefaultFontSizeSlider";function j8(){return c.createElement(sn,{label:"Color",type:"textColor",option:y3})}j8.displayName="DefaultTextColorInput";function G8(){const{icons:i}=Me(),e={...b3,upIcon:i.Menu.OpacityUp,downIcon:i.Menu.OpacityDown};return c.createElement(sn,{label:"Opacity",type:"textOpacity",option:e})}G8.displayName="DefaultTextOpacitySlider";function z8(){return c.createElement(sn,{label:"Shadow",type:"textShadow",option:SP})}z8.displayName="DefaultTextShadowMenu";function U8(){return c.createElement(sn,{label:"Color",type:"textBg",option:y3})}U8.displayName="DefaultTextBgInput";function K8(){const{icons:i}=Me(),e={...b3,upIcon:i.Menu.OpacityUp,downIcon:i.Menu.OpacityDown};return c.createElement(sn,{label:"Opacity",type:"textBgOpacity",option:e})}K8.displayName="DefaultTextBgOpacitySlider";function Q8(){return c.createElement(sn,{label:"Color",type:"displayBg",option:y3})}Q8.displayName="DefaultDisplayBgInput";function Z8(){const{icons:i}=Me(),e={...b3,upIcon:i.Menu.OpacityUp,downIcon:i.Menu.OpacityDown};return c.createElement(sn,{label:"Opacity",type:"displayBgOpacity",option:e})}Z8.displayName="DefaultDisplayBgOpacitySlider";function sn({label:i,option:e,type:t}){const s=c8(),n=Bn[t],a=$e(n),l=xe(i),u=c.useCallback(()=>{s==null||s.dispatchEvent(new Event("vds-font-change"))},[s]),d=c.useCallback(h=>{n.set(h),u()},[n,u]);if(e.type==="color"){let h=function(p){d(p.target.value)};return c.createElement(Zh,{label:l},c.createElement("input",{className:"vds-color-picker",type:"color",value:a,onChange:h}))}if(e.type==="slider"){let C=function(S){d(S+"%")};const{min:h,max:p,step:f,upIcon:y,downIcon:v}=e;return c.createElement(Yh,{label:l,value:a,UpIcon:y,DownIcon:v,isMin:a===h+"%",isMax:a===p+"%"},c.createElement(Y7,{className:"vds-slider",min:h,max:p,step:f,keyStep:f,value:parseInt(a),"aria-label":l,onValueChange:C,onDragValueChange:C},c.createElement(Xh,null),c.createElement(Jh,null)))}return e.type==="radio"?c.createElement(Y8,{id:zn(t),label:l,value:a,values:e.values,onChange:d}):null}sn.displayName="DefaultFontSetting";function Y8({id:i,label:e,value:t,values:s,onChange:n}){const a=MP(s),{translations:l}=Me(),u=c.useMemo(()=>{var d;return c3(l,((d=a.find(h=>h.value===t))==null?void 0:d.label)||"")},[t,a]);return c.createElement(Ss,{className:`vds-${i}-menu vds-menu`},c.createElement(Zn,{label:e,hint:u}),c.createElement(ws,{className:"vds-menu-items"},c.createElement(q8,{value:t,options:a,onChange:n})))}Y8.displayName="DefaultFontRadioGroup";function X8(){const i=xe("Reset");return c.createElement("button",{className:"vds-menu-item",role:"menuitem",onClick:wP},c.createElement("span",{className:"vds-menu-item-label"},i))}X8.displayName="DefaultResetMenuItem";function v3({label:i,checked:e,storageKey:t,defaultChecked:s=!1,onChange:n}){const[a,l]=c.useState(s),[u,d]=c.useState(!1);c.useEffect(()=>{const y=!!((t?localStorage.getItem(t):null)??s);l(y),n==null||n(y)},[]),c.useEffect(()=>{Fl(e)&&l(e)},[e]);function h(y){if(y&&"button"in y&&(y==null?void 0:y.button)===1)return;const v=!a;l(v),t&&localStorage.setItem(t,v?"1":""),n==null||n(v,y==null?void 0:y.nativeEvent),d(!1)}function p(y){y.button===0&&d(!0)}function f(y){Rh(y.nativeEvent)&&h()}return c.createElement("div",{className:"vds-menu-checkbox",role:"menuitemcheckbox",tabIndex:0,"aria-label":i,"aria-checked":a?"true":"false","data-active":u?"":null,onPointerUp:h,onPointerDown:p,onKeyDown:f})}v3.displayName="DefaultMenuCheckbox";function J8({slots:i}){const e=xe("Accessibility"),{icons:t}=Me();return c.createElement(Ss,{className:"vds-accessibility-menu vds-menu"},c.createElement(Zn,{label:e,Icon:t.Menu.Accessibility}),c.createElement(ws,{className:"vds-menu-items"},ie(i,"accessibilityMenuItemsStart",null),c.createElement(qs,null,c.createElement(eC,null),c.createElement(tC,null)),c.createElement(qs,null,c.createElement(F8,null)),ie(i,"accessibilityMenuItemsEnd",null)))}J8.displayName="DefaultAccessibilityMenu";function eC(){const{userPrefersAnnouncements:i}=Me(),e=xe("Announcements");function t(s){i.set(s)}return c.createElement(Zh,{label:e},c.createElement(v3,{label:e,defaultChecked:!0,storageKey:"vds-player::announcements",onChange:t}))}eC.displayName="DefaultAnnouncementsMenuCheckbox";
10function tC(){const i=Pe("viewType"),{userPrefersKeyboardAnimations:e,noKeyboardAnimations:t}=Me(),s=xe("Keyboard Animations");if(i!=="video"||t)return null;function n(a){e.set(a)}return c.createElement(Zh,{label:s},c.createElement(v3,{label:s,defaultChecked:!0,storageKey:"vds-player::keyboard-animations",onChange:n}))}tC.displayName="DefaultKeyboardAnimationsMenuCheckbox";function iC({slots:i}){const e=xe("Audio"),t=Pe("canSetAudioGain"),s=Pe("audioTrack"),n=Pe("audioTracks"),{noAudioGain:a,icons:l}=Me(),u=t&&!a;return!u&&n.length<=1?null:c.createElement(Ss,{className:"vds-audio-menu vds-menu"},c.createElement(Zn,{label:e,hint:s==null?void 0:s.label,Icon:l.Menu.Audio}),c.createElement(ws,{className:"vds-menu-items"},ie(i,"audioMenuItemsStart",null),c.createElement(oC,null),u?c.createElement(sC,null):null,ie(i,"audioMenuItemsEnd",null)))}iC.displayName="DefaultAudioMenu";function sC(){const i=Pe("audioGain"),e=xe("Boost"),t=Math.round(((i??1)-1)*100)+"%",s=Pe("canSetAudioGain"),{noAudioGain:n,icons:a}=Me(),l=!s||n,u=nC(),d=rC();return l?null:c.createElement(qs,{label:e,value:t},c.createElement(Yh,{UpIcon:a.Menu.AudioBoostUp,DownIcon:a.Menu.AudioBoostDown,isMin:((i??1)-1)*100<=u,isMax:((i??1)-1)*100===d},c.createElement(aC,null)))}sC.displayName="DefaultAudioBoostMenuSection";function nC(){const{audioGains:i}=Me();return(wt(i)?i[0]:i==null?void 0:i.min)??0}function rC(){const{audioGains:i}=Me();return(wt(i)?i[i.length-1]:i==null?void 0:i.max)??300}function RP(){const{audioGains:i}=Me();return(wt(i)?i[1]-i[0]:i==null?void 0:i.step)||25}function aC(){const i=xe("Audio Boost"),e=nC(),t=rC(),s=RP();return c.createElement(m8,{className:"vds-audio-gain-slider vds-slider","aria-label":i,min:e,max:t,step:s,keyStep:s},c.createElement(Xh,null),c.createElement(Jh,null))}aC.displayName="DefaultAudioGainSlider";function oC(){const{icons:i}=Me(),e=xe("Track"),t=xe("Default"),s=Pe("audioTrack"),n=D$();return n.disabled?null:c.createElement(Ss,{className:"vds-audio-track-menu vds-menu"},c.createElement(Zn,{label:e,hint:(s==null?void 0:s.label)??t,disabled:n.disabled,Icon:i.Menu.Audio}),c.createElement(ws,{className:"vds-menu-items"},c.createElement(tc,{className:"vds-audio-radio-group vds-radio-group",value:n.selectedValue},n.map(({label:a,value:l,select:u})=>c.createElement(ic,{className:"vds-audio-radio vds-radio",value:l,onSelect:u,key:l},c.createElement(i.Menu.RadioCheck,{className:"vds-icon"}),c.createElement("span",{className:"vds-radio-label"},a))))))}oC.displayName="DefaultAudioTracksMenu";function lC({slots:i}){var l;const{icons:e}=Me(),t=xe("Captions"),s=xe("Off"),n=L$({off:s}),a=((l=n.selectedTrack)==null?void 0:l.label)??s;return n.disabled?null:c.createElement(Ss,{className:"vds-captions-menu vds-menu"},c.createElement(Zn,{label:t,hint:a,disabled:n.disabled,Icon:e.Menu.Captions}),c.createElement(ws,{className:"vds-menu-items"},ie(i,"captionsMenuItemsStart",null),c.createElement(tc,{className:"vds-captions-radio-group vds-radio-group",value:n.selectedValue},n.map(({label:u,value:d,select:h})=>c.createElement(ic,{className:"vds-caption-radio vds-radio",value:d,onSelect:h,key:d},c.createElement(e.Menu.RadioCheck,{className:"vds-icon"}),c.createElement("span",{className:"vds-radio-label"},u)))),ie(i,"captionsMenuItemsEnd",null)))}lC.displayName="DefaultCaptionMenu";function cC({slots:i}){const{hideQualityBitrate:e,icons:t}=Me(),s=xe("Quality"),n=xe("Auto"),a=Pe("canSetQuality"),l=Pe("qualities"),u=N$({auto:n});return!a||l.length<=1||u.disabled?null:c.createElement(Ss,{className:"vds-quality-menu vds-menu"},c.createElement(Zn,{label:s,Icon:t.Menu.QualityUp}),c.createElement(ws,{className:"vds-menu-items"},ie(i,"qualityMenuItemsStart",null),c.createElement(tc,{className:"vds-quality-radio-group vds-radio-group",value:u.selectedValue},u.map(({label:d,value:h,bitrateText:p,select:f})=>c.createElement(ic,{className:"vds-quality-radio vds-radio",value:h,onSelect:f,key:h},c.createElement(t.Menu.RadioCheck,{className:"vds-icon"}),c.createElement("span",{className:"vds-radio-label"},d),!e&&p?c.createElement("span",{className:"vds-radio-hint"},p):null))),ie(i,"qualityMenuItemsEnd",null)))}cC.displayName="DefaultQualityMenu";function uC({slots:i}){const{icons:e}=Me(),t=Pe("playbackRate"),s=Pe("canSetPlaybackRate"),n=xe("Speed"),a=xe("Normal"),l=AP(),u=IP(),d=_P(),h=t===1?a:t+"x";return s?c.createElement(Ss,{className:"vds-speed-menu vds-menu"},c.createElement(Zn,{label:n,hint:h,Icon:e.Menu.SpeedUp}),c.createElement(ws,{className:"vds-menu-items"},ie(i,"speedMenuItemsStart",null),c.createElement(qs,{label:n,value:h},c.createElement(Yh,{UpIcon:e.Menu.FontSizeUp,DownIcon:e.Menu.FontSizeDown,isMin:t===l,isMax:t===u}
10,c.createElement(g8,{className:"vds-speed-slider vds-slider","aria-label":n,min:l,max:u,step:d,keyStep:d},c.createElement(Xh,null),c.createElement(Jh,null)))),ie(i,"speedMenuItemsEnd",null))):null}uC.displayName="DefaultSpeedMenu";function AP(){const{playbackRates:i}=Me(),e=i;return(wt(e)?e[0]:e==null?void 0:e.min)??0}function IP(){const{playbackRates:i}=Me(),e=i;return(wt(e)?e[e.length-1]:e==null?void 0:e.max)??2}function _P(){const{playbackRates:i}=Me(),e=i;return(wt(e)?e[1]-e[0]:e==null?void 0:e.step)||.25}function C3({tooltip:i,placement:e,portalClass:t="",slots:s}){const{showMenuDelay:n,icons:a,isSmallLayout:l,menuContainer:u,menuGroup:d,noModal:h,colorScheme:p}=Me(),f=xe("Settings"),y=Pe("viewType"),v=!l&&d==="bottom"&&y==="video"?26:0,C=u3(p),[S,w]=c.useState(!1),T=V8();Y$(xP);function E(){Em.flushSync(()=>{w(!0)})}function M(){w(!1)}const x=c.createElement(ws,{className:"vds-settings-menu-items vds-menu-items",placement:e,offset:v},S?c.createElement(c.Fragment,null,ie(s,"settingsMenuItemsStart",null),ie(s,"settingsMenuStartItems",null),c.createElement(uC,{slots:s}),c.createElement(cC,{slots:s}),c.createElement(J8,{slots:s}),c.createElement(iC,{slots:s}),c.createElement(lC,{slots:s}),ie(s,"settingsMenuEndItems",null),ie(s,"settingsMenuItemsEnd",null)):null);return c.createElement(Ss,{className:"vds-settings-menu vds-menu",showDelay:n,onOpen:E,onClose:M},c.createElement(as,{content:f,placement:i},c.createElement(jh,{className:"vds-menu-button vds-button","aria-label":f},c.createElement(a.Menu.Settings,{className:"vds-icon vds-rotate-icon"}))),h||!l?x:c.createElement(r3,{className:t+(C?` ${C}`:""),container:u??T,disabled:"fullscreen","data-sm":l?"":null,"data-lg":l?null:"","data-size":l?"sm":"lg","data-view-type":y},x))}C3.displayName="DefaultSettingsMenu";function ep({tooltip:i,orientation:e,slots:t}){const s=Pe("pointer"),n=Pe("muted"),a=Pe("canSetVolume"),[l,u]=c.useState(null),d=yP(l),h=ie(t,"muteButton",c.createElement(N8,{tooltip:i}));return a?s==="coarse"&&!n?null:c.createElement("div",{className:"vds-volume","data-active":d?"":null,ref:u},h,c.createElement("div",{className:"vds-volume-popup"},ie(t,"volumeSlider",c.createElement(dC,{orientation:e})))):h}ep.displayName="DefaultVolumePopup";function dC(i){const e=xe("Volume");return c.createElement(J7,{className:"vds-volume-slider vds-slider","aria-label":e,...i},c.createElement(Fh,{className:"vds-slider-track"}),c.createElement(Wh,{className:"vds-slider-track-fill vds-slider-track"}),c.createElement(qh,{className:"vds-slider-thumb"}),c.createElement(i3,{className:"vds-slider-preview",noClamp:!0},c.createElement(s3,{className:"vds-slider-value"})))}dC.displayName="DefaultVolumeSlider";function tp(){const[i,e]=c.useState(null),[t,s]=c.useState(0),n=Pe("currentSrc"),{thumbnails:a,sliderChaptersMinWidth:l,disableTimeSlider:u,seekStep:d,noScrubGesture:h}=Me(),p=xe("Seek"),f=$e(pP),y=c.useCallback(()=>{const v=i==null?void 0:i.el;v&&s(v.clientWidth)},[i]);return I8(i==null?void 0:i.el,y),c.createElement(t8,{className:"vds-time-slider vds-slider","aria-label":p,disabled:u,noSwipeGesture:h,keyStep:d,ref:e},c.createElement(i8,{className:"vds-slider-chapters",disabled:t<l},(v,C)=>v.map(S=>c.createElement("div",{className:"vds-slider-chapter",key:S.startTime,ref:C},c.createElement(Fh,{className:"vds-slider-track"}),c.createElement(Wh,{className:"vds-slider-track-fill vds-slider-track"}),c.createElement(r8,{className:"vds-slider-progress vds-slider-track"})))),c.createElement(qh,{className:"vds-slider-thumb"}),c.createElement(i3,{className:"vds-slider-preview"},a?c.createElement(f2.Root,{src:a,className:"vds-slider-thumbnail vds-thumbnail"},c.createElement(f2.Img,null)):f&&Xm(n)?c.createElement(f,{className:"vds-slider-thumbnail vds-thumbnail"}):null,c.createElement(n8,{className:"vds-slider-chapter-title"}),c.createElement(s3,{className:"vds-slider-value"})))}tp.displayName="DefaultTimeSlider";function hC({slots:i}){return Pe("duration")?c.createElement("div",{className:"vds-time-group"},ie(i,"currentTime",c.createElement(Tc,{className:"vds-time",type:"current"})),ie(i,"timeDivider",c.createElement("div",{className:"vds-time-divider"},"/")),ie(i,"endTime",c.createElement(Tc,{className:"vds-time",type:"duration"}))):null}hC.displayName="DefaultTimeGroup";function S3({slots:i}){return Pe("live")?ie(i,"liveButton",c.createElement(m3,null)):c.createElement(hC,{slots:i})}S3.displayName="DefaultTimeInfo";function pC({slots:i}){const e=Pe("live"),t=Pe("duration");return e?ie(i,"liveButton",c.createElement(m3,null)):ie(i,"endTime",t?c.createElement(Tc,{className:"vds-time",type:"current",toggle:!0,remainder:!0}):null)}pC.displayName="DefaultTimeInvert";D8({type:"audio",smLayoutWhen({width:i}){return i<576},renderLayout:()=>c.createElement(fC,null)});function fC(){const i=L8();return _8("audio"),c.createElement(c.Fragment,null,c.createElement(zh,null),
10c.createElement(Qh,null),c.createElement(Gh,{className:"vds-controls"},c.createElement(Ws,{className:"vds-controls-group"},ie(i,"seekBackwardButton",c.createElement(gm,{backward:!0,tooltip:"top start"})),ie(i,"playButton",c.createElement(Hu,{tooltip:"top center"})),ie(i,"seekForwardButton",c.createElement(gm,{tooltip:"top center"})),c.createElement(gC,null),ie(i,"timeSlider",c.createElement(tp,null)),c.createElement(pC,{slots:i}),c.createElement(ep,{orientation:"vertical",tooltip:"top",slots:i}),ie(i,"captionButton",c.createElement(Uh,{tooltip:"top center"})),ie(i,"downloadButton",c.createElement(Kh,null)),c.createElement(mC,{slots:i}))))}fC.displayName="AudioLayout";function mC({slots:i}){const{isSmallLayout:e,noModal:t}=Me(),s=t?"top end":e?null:"top end";return c.createElement(c.Fragment,null,ie(i,"chaptersMenu",c.createElement(g3,{tooltip:"top",placement:s,portalClass:"vds-audio-layout"})),ie(i,"settingsMenu",c.createElement(C3,{tooltip:"top end",placement:s,portalClass:"vds-audio-layout",slots:i})))}mC.displayName="DefaultAudioMenus";function gC(){const[i,e]=c.useState(null),t=Qn(),{translations:s}=Me(),[n,a]=c.useState(!1),l=ih(()=>{const{started:f,currentTime:y}=t.$state;return f()||y()>0}),u=$e(ih(()=>{const{title:f,ended:y}=t.$state;return f()?`${c3(s,y()?"Replay":l()?"Continue":"Play")}: ${f()}`:""})),d=v8(),h=$e(l)?d:"",p=fP(i);return c.useEffect(()=>{var f;p&&document.activeElement===document.body&&((f=t.player.el)==null||f.focus({preventScroll:!0}))},[]),I8(i,c.useCallback(()=>{const f=i,y=!!f&&!p&&f.clientWidth<f.children[0].clientWidth;f&&wg(f,"vds-marquee",y),a(y)},[i,p])),u?c.createElement("span",{className:"vds-title",title:u,ref:e},c.createElement(ym,{title:u,chapterTitle:h}),n&&!p?c.createElement(ym,{title:u,chapterTitle:h}):null):c.createElement(Ri,null)}gC.displayName="DefaultAudioTitle";function ym({title:i,chapterTitle:e}){const t=L8();return c.createElement("span",{className:"vds-title-text"},ie(t,"title",i),ie(t,"chapterTitle",c.createElement("span",{className:"vds-chapter-title"},e)))}ym.displayName="AudioTitle";const yC=c.forwardRef(({icons:i,...e},t)=>{const[s,n]=c.useState(!1),[a,l]=c.useState(null),[u,d]=c.useState(0),h=Pe("lastKeyboardAction");c.useEffect(()=>{d(v=>v+1)},[h]);const p=c.useMemo(()=>{const v=h==null?void 0:h.action;return v&&s?zn(v):null},[s,h]),f=c.useMemo(()=>`vds-kb-action${s?"":" hidden"}${e.className?` ${e.className}`:""}`,[s]),y=$e(ih(DP));return Z$(()=>{const v=LP(i);l(()=>v)},[i]),c.useEffect(()=>{n(!!h);const v=setTimeout(()=>n(!1),500);return()=>{n(!1),window.clearTimeout(v)}},[h]),a?c.createElement(pe.div,{...e,className:f,"data-action":p,ref:t},c.createElement("div",{className:"vds-kb-text-wrapper"},c.createElement("div",{className:"vds-kb-text"},y)),c.createElement("div",{className:"vds-kb-bezel",key:u},c.createElement("div",{className:"vds-kb-icon"},c.createElement(a,null)))):null});yC.displayName="DefaultKeyboardDisplay";function DP(){var s;const{$state:i}=Tt(qu),e=(s=i.lastKeyboardAction())==null?void 0:s.action,t=i.audioGain()??1;switch(e){case"toggleMuted":return i.muted()?"0%":v2(i.volume(),t);case"volumeUp":case"volumeDown":return v2(i.volume(),t);default:return""}}function v2(i,e){return`${Math.round(i*e*100)}%`}function LP(i){var t;const{$state:e}=Tt(qu);switch((t=e.lastKeyboardAction())==null?void 0:t.action){case"togglePaused":return e.paused()?i.Pause:i.Play;case"toggleMuted":return e.muted()||e.volume()===0?i.Mute:e.volume()>=.5?i.VolumeUp:i.VolumeDown;case"toggleFullscreen":return e.fullscreen()?i.EnterFullscreen:i.ExitFullscreen;case"togglePictureInPicture":return e.pictureInPicture()?i.EnterPiP:i.ExitPiP;case"toggleCaptions":return e.hasCaptions()?e.textTrack()?i.CaptionsOn:i.CaptionsOff:null;case"volumeUp":return i.VolumeUp;case"volumeDown":return i.VolumeDown;case"seekForward":return i.SeekForward;case"seekBackward":return i.SeekBackward;default:return null}}function w3(){const i=Pe("started"),e=Pe("title");return a3("chapters")&&(i||!e)?c.createElement(C8,{className:"vds-chapter-title"}):c.createElement(y8,{className:"vds-chapter-title"})}w3.displayName="DefaultTitle";const NP=D8({type:"video",smLayoutWhen({width:i,height:e}){return i<576||e<380},renderLayout(i){return c.createElement(vC,i)}});function bC(i){return c.createElement(NP,i)}bC.displayName="DefaultVideoLayout";function vC({streamType:i,isLoadLayout:e,isSmallLayout:t}){return _8("video"),e?c.createElement(xC,null):i==="unknown"?c.createElement(ju,null):t?c.createElement(SC,null):c.createElement(CC,null)}vC.displayName="VideoLayout";function CC(){const{menuGroup:i}=Me(),e=d3(),t={...e,...e==null?void 0:e.largeLayout};return c.createElement(c.Fragment,null,c.createElement(zh,null),
10c.createElement(x3,null),c.createElement(E3,null),ie(t,"bufferingIndicator",c.createElement(ju,null)),ie(t,"captions",c.createElement(Qh,null)),c.createElement(Gh,{className:"vds-controls"},c.createElement(Ws,{className:"vds-controls-group"},ie(t,"topControlsGroupStart",null),c.createElement(Ri,null),ie(t,"topControlsGroupCenter",null),c.createElement(Ri,null),ie(t,"topControlsGroupEnd",null),i==="top"&&c.createElement(sh,{slots:t})),c.createElement(Ri,null),c.createElement(Ws,{className:"vds-controls-group"},ie(t,"centerControlsGroupStart",null),c.createElement(Ri,null),ie(t,"centerControlsGroupCenter",null),c.createElement(Ri,null),ie(t,"centerControlsGroupEnd",null)),c.createElement(Ri,null),c.createElement(Ws,{className:"vds-controls-group"},ie(t,"timeSlider",c.createElement(tp,null))),c.createElement(Ws,{className:"vds-controls-group"},ie(t,"playButton",c.createElement(Hu,{tooltip:"top start"})),c.createElement(ep,{orientation:"horizontal",tooltip:"top",slots:t}),c.createElement(S3,{slots:t}),ie(t,"chapterTitle",c.createElement(w3,null)),ie(t,"captionButton",c.createElement(Uh,{tooltip:"top"})),i==="bottom"&&c.createElement(sh,{slots:t}),ie(t,"airPlayButton",c.createElement(p3,{tooltip:"top"})),ie(t,"googleCastButton",c.createElement(f3,{tooltip:"top"})),ie(t,"downloadButton",c.createElement(Kh,null)),ie(t,"pipButton",c.createElement(O8,{tooltip:"top"})),ie(t,"fullscreenButton",c.createElement(h3,{tooltip:"top end"})))))}CC.displayName="DefaultVideoLargeLayout";function SC(){const i=d3(),e={...i,...i==null?void 0:i.smallLayout};return c.createElement(c.Fragment,null,c.createElement(zh,null),c.createElement(x3,null),c.createElement(E3,null),ie(e,"bufferingIndicator",c.createElement(ju,null)),ie(e,"captions",c.createElement(Qh,null)),c.createElement(Gh,{className:"vds-controls"},c.createElement(Ws,{className:"vds-controls-group"},ie(e,"topControlsGroupStart",null),ie(e,"airPlayButton",c.createElement(p3,{tooltip:"top start"})),ie(e,"googleCastButton",c.createElement(f3,{tooltip:"top start"})),c.createElement(Ri,null),ie(e,"topControlsGroupCenter",null),c.createElement(Ri,null),ie(e,"captionButton",c.createElement(Uh,{tooltip:"bottom"})),ie(e,"downloadButton",c.createElement(Kh,null)),c.createElement(sh,{slots:e}),c.createElement(ep,{orientation:"vertical",tooltip:"bottom end",slots:e}),ie(e,"topControlsGroupEnd",null)),c.createElement(Ri,null),c.createElement(Ws,{className:"vds-controls-group",style:{pointerEvents:"none"}},ie(e,"centerControlsGroupStart",null),c.createElement(Ri,null),ie(e,"centerControlsGroupCenter",null),ie(e,"playButton",c.createElement(Hu,{tooltip:"top"})),c.createElement(Ri,null),ie(e,"centerControlsGroupEnd",null)),c.createElement(Ri,null),c.createElement(Ws,{className:"vds-controls-group"},c.createElement(S3,{slots:e}),ie(e,"chapterTitle",c.createElement(w3,null)),ie(e,"fullscreenButton",c.createElement(h3,{tooltip:"top end"}))),c.createElement(Ws,{className:"vds-controls-group"},ie(e,"timeSlider",c.createElement(tp,null)))),ie(e,"startDuration",c.createElement(wC,null)))}SC.displayName="DefaultVideoSmallLayout";function wC(){return Pe("duration")===0?null:c.createElement("div",{className:"vds-start-duration"},c.createElement(Tc,{className:"vds-time",type:"duration"}))}wC.displayName="DefaultVideoStartDuration";function x3(){const{noGestures:i}=Me();return i?null:c.createElement("div",{className:"vds-gestures"},c.createElement(Po,{className:"vds-gesture",event:"pointerup",action:"toggle:paused"}),c.createElement(Po,{className:"vds-gesture",event:"pointerup",action:"toggle:controls"}),c.createElement(Po,{className:"vds-gesture",event:"dblpointerup",action:"toggle:fullscreen"}),c.createElement(Po,{className:"vds-gesture",event:"dblpointerup",action:"seek:-10"}),c.createElement(Po,{className:"vds-gesture",event:"dblpointerup",action:"seek:10"}))}x3.displayName="DefaultVideoGestures";function ju(){return c.createElement("div",{className:"vds-buffering-indicator"},c.createElement(U$,{className:"vds-buffering-spinner"},c.createElement(K$,{className:"vds-buffering-track"}),c.createElement(Q$,{className:"vds-buffering-track-fill"})))}
10ju.displayName="DefaultBufferingIndicator";function sh({slots:i}){const{isSmallLayout:e,noModal:t,menuGroup:s}=Me(),n=s==="top"||e?"bottom":"top",a=`${n} end`,l=t?`${n} end`:e?null:`${n} end`;return c.createElement(c.Fragment,null,ie(i,"chaptersMenu",c.createElement(g3,{tooltip:a,placement:l,portalClass:"vds-video-layout"})),ie(i,"settingsMenu",c.createElement(C3,{tooltip:a,placement:l,portalClass:"vds-video-layout",slots:i})))}sh.displayName="DefaultVideoMenus";function xC(){const{isSmallLayout:i}=Me(),e=d3(),t={...e,...e==null?void 0:e[i?"smallLayout":"largeLayout"]};return c.createElement("div",{className:"vds-load-container"},ie(t,"bufferingIndicator",c.createElement(ju,null)),ie(t,"loadButton",c.createElement(Hu,{tooltip:"top"})))}xC.displayName="DefaultVideoLoadLayout";function E3(){const{noKeyboardAnimations:i,icons:e,userPrefersKeyboardAnimations:t}=Me(),s=$e(t);return i||!s||!e.KeyboardDisplay?null:c.createElement(yC,{icons:e.KeyboardDisplay})}E3.displayName="DefaultVideoKeyboardDisplay";function T3({src:i,poster:e,title:t,autoPlay:s=!1}){return B($8,{src:i,title:t,autoPlay:s,playsInline:!0,onProviderChange:a=>{OE(a)&&(a.library=()=>mi(()=>import("./hls-CnCSpB4X.js"),[]))},style:{width:"100%",height:"100%"},children:[m(P8,{children:e?m(R8,{className:"vds-poster",src:e,alt:""}):null}),m(bC,{icons:dP})]})}T3.propTypes={src:k.string.isRequired,poster:k.string,title:k.string,autoPlay:k.bool};const k3={...Pw,event:"Event",video:"Video",image:"Image",audio:"Audio"},Hl=72,jl=54,ro=320,C2=75,OP=4e3;function Gu(i){const e=ct.c(4),{type:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={width:Hl,height:jl,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",color:"grey.500"},e[0]=s):s=e[0];const n=kw[t]||mS;let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={fontSize:22},e[1]=a):a=e[1];let l;return e[2]!==n?(l=m(U,{sx:s,children:m(We,{icon:n,style:a})}),e[2]=n,e[3]=l):l=e[3],l}Gu.propTypes={type:k.string};function zu(i){const e=ct.c(25),{link:t,thumbnail:s,title:n,caption:a,onClick:l,isPending:u}=i,d=u===void 0?!1:u,h=l?Iu:gS;let p;e[0]!==t||e[1]!==l?(p=l?{onClick:l}:{to:Mw(t.type,t.entity_id)},e[0]=t,e[1]=l,e[2]=p):p=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={textAlign:"left",justifyContent:"flex-start",display:"flex",alignItems:"center",gap:1.25,p:.75,width:ro,maxWidth:"100%",borderRadius:1,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",color:"text.primary",textDecoration:"none","&:hover":{borderColor:"primary.main"}},e[3]=f):f=e[3];let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y={width:Hl,height:jl,borderRadius:.75,overflow:"hidden",flexShrink:0},e[4]=y):y=e[4];let v;e[5]!==d||e[6]!==s?(v=d?m(FS,{variant:"rectangular",width:Hl,height:jl}):s,e[5]=d,e[6]=s,e[7]=v):v=e[7];let C;e[8]!==v?(C=m(U,{sx:y,children:v}),e[8]=v,e[9]=C):C=e[9];let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S={minWidth:0},e[10]=S):S=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w={fontWeight:600},e[11]=w):w=e[11];const T=n||"Untitled";let E;e[12]!==T?(E=m(te,{variant:"body2",noWrap:!0,sx:w,children:T}),e[12]=T,e[13]=E):E=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M={color:"text.secondary"},e[14]=M):M=e[14];const x=a??k3[t.type]??t.type;let P;e[15]!==x?(P=m(te,{variant:"caption",sx:M,children:x}),e[15]=x,e[16]=P):P=e[16];let R;e[17]!==E||e[18]!==P?(R=B(U,{sx:S,children:[E,P]}),e[17]=E,e[18]=P,e[19]=R):R=e[19];let _;return e[20]!==R||e[21]!==h||e[22]!==p||e[23]!==C?(_=B(U,{component:h,...p,sx:f,children:[C,R]}),e[20]=R,e[21]=h,e[22]=p,e[23]=C,e[24]=_):_=e[24],_}zu.propTypes={link:k.object.isRequired,thumbnail:k.node,title:k.string,caption:k.string,onClick:k.func,isPending:k.bool};function EC(i){const e=ct.c(10),{link:t}=i;let s;e[0]!==t.entity_id?(s={id:t.entity_id},e[0]=t.entity_id,e[1]=s):s=e[1];const n=Ew(s),a=n.data,l=(a==null?void 0:a.title)??t.title;let u;e[2]!==t.type||e[3]!==a?(u=a?m(bw,{boxShadow:!1,play:a,width:Hl,height:jl,sidelines:5}):m(Gu,{type:t.type}),e[2]=t.type,e[3]=a,e[4]=u):u=e[4];let d;return e[5]!==t||e[6]!==n.isPending||e[7]!==l||e[8]!==u?(d=m(zu,{link:t,isPending:n.isPending,title:l,thumbnail:u}),e[5]=t,e[6]=n.isPending,e[7]=l,e[8]=u,e[9]=d):d=e[9],d}EC.propTypes={link:k.object.isRequired};function TC(i){const e=ct.c(8),{link:t}=i,s=Tw("rotation",t.entity_id),n=s.data,a=(n==null?void 0:n.title)??t.title;let l;e[0]!==t.type||e[1]!==n?(l=n!=null&&n.data?m(xw,{boxShadow:!1,width:Hl,height:jl,rotation:n}):m(Gu,{type:t.type}),e[0]=t.type,e[1]=n,e[2]=l):l=e[2];let u;return e[3]!==t||e[4]!==s.isPending||e[5]!==a||e[6]!==l?(u=m(zu,{link:t,isPending:s.isPending,title:a,thumbnail:l}),e[3]=t,e[4]=s.isPending,e[5]=a,e[6]=l,e[7]=u):u=e[7],u}TC.propTypes={link:k.object.isRequired};function ip(i){const e=ct.c(9),{link:t,icon:s}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={display:"flex",alignItems:"center",gap:1,px:1,py:.75,borderRadius:1,border:"1px dashed",borderColor:"divider",color:"text.disabled"},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={fontSize:16},e[1]=a):a=e[1];let l;e[2]!==s?(l=m(We,{icon:s,style:a}),e[2]=s,e[3]=l):l=e[3];const u=t.title||k3[t.type];let d;e[4]!==u?(d=B(te,{variant:"caption",noWrap:!0,children:[u," (unavailable)"]}),e[4]=u,e[5]=d):d=e[5];let h;return e[6]!==l||e[7]!==d?(h=B(U,{sx:n,children:[l,d]}),e[6]=l,e[7]=d,e[8]=h):h=e[8],h}ip.propTypes={link:k.object.isRequired,icon:k.object};function kC(i){const e=ct.c(15),{link:t,onImageOpen:s}=i,[n,a]=c.useState(!1);if(!t.file_path||n){let C;return e[0]!==t?(C=m(ip,{link:t,icon:Eh}),e[0]=t,e[1]=C):C=e[1],C}const l=`https://thg-images.b-cdn.net/${t.file_path}`;let u;
10e[2]!==s||e[3]!==l?(u=()=>s==null?void 0:s(l),e[2]=s,e[3]=l,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d={borderRadius:1,overflow:"hidden",display:"block",maxWidth:ro},e[5]=d):d=e[5];const h=`View image ${t.title}`;let p,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>a(!0),f={display:"block",maxWidth:ro,maxHeight:ro,width:"100%",objectFit:"cover"},e[6]=p,e[7]=f):(p=e[6],f=e[7]);let y;e[8]!==t.title||e[9]!==l?(y=m(U,{component:"img",src:l,alt:t.title,loading:"lazy",onError:p,sx:f}),e[8]=t.title,e[9]=l,e[10]=y):y=e[10];let v;return e[11]!==u||e[12]!==h||e[13]!==y?(v=m(Iu,{onClick:u,sx:d,"aria-label":h,children:y}),e[11]=u,e[12]=h,e[13]=y,e[14]=v):v=e[14],v}kC.propTypes={link:k.object.isRequired,onImageOpen:k.func};function $C(i){const e=ct.c(41),{link:t,onVideoOpen:s}=i,[n,a]=c.useState(!1),[l,u]=c.useState(!1),[d,h]=c.useState(0),p=c.useRef(null);let f,y;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>()=>clearTimeout(p.current),y=[],e[0]=f,e[1]=y):(f=e[0],y=e[1]),c.useEffect(f,y),t.type==="media"&&["failed","deleting","expired"].includes(t.status)||!t.guid||!t.library_id){let K;return e[2]!==t?(K=m(ip,{link:t,icon:yS}),e[2]=t,e[3]=K):K=e[3],K}const C=t.type==="media"&&t.status==="ready"&&t.cdn;let S;e[4]!==t.guid||e[5]!==s||e[6]!==C?(S=()=>{C&&s?s(t.guid):a(!0)},e[4]=t.guid,e[5]=s,e[6]=C,e[7]=S):S=e[7];const w=S,T=!l&&d>=C2,E=t.cdn&&!T,M=!l&&!T&&t.status==="processing";let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={borderRadius:1,overflow:"hidden",display:"block",position:"relative",maxWidth:ro},e[8]=x):x=e[8];const P=`Play video ${t.title}`;let R;e[9]===Symbol.for("react.memo_cache_sentinel")?(R=m(U,{sx:{width:ro,maxWidth:"100%",aspectRatio:"16 / 9",bgcolor:"grey.900"}}),e[9]=R):R=e[9];let _;e[10]!==d||e[11]!==E||e[12]!==t.cdn||e[13]!==t.guid||e[14]!==t.title||e[15]!==l?(_=E&&m(U,{component:"img",src:`https://${t.cdn}/${t.guid}/thumbnail.jpg${d?`?r=${d}`:""}`,alt:t.title,loading:"lazy",onLoad:()=>u(!0),onError:()=>{d<C2&&(p.current=setTimeout(()=>h(VP),OP))},sx:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 150ms"}}),e[10]=d,e[11]=E,e[12]=t.cdn,e[13]=t.guid,e[14]=t.title,e[15]=l,e[16]=_):_=e[16];let $;e[17]!==M?($=M&&m(te,{variant:"caption",sx:{position:"absolute",top:6,left:8,px:.75,borderRadius:.5,color:"common.white",bgcolor:"rgba(0,0,0,0.5)"},children:"Processing…"}),e[17]=M,e[18]=$):$=e[18];let G;e[19]===Symbol.for("react.memo_cache_sentinel")?(G={position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},e[19]=G):G=e[19];let q;e[20]===Symbol.for("react.memo_cache_sentinel")?(q={width:48,height:48,borderRadius:"50%",bgcolor:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",color:"common.white"},e[20]=q):q=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=m(U,{sx:G,children:m(U,{sx:q,children:m(We,{icon:Q6,style:{fontSize:20,marginLeft:3}})})}),e[21]=F):F=e[21];let H;e[22]!==w||e[23]!==P||e[24]!==_||e[25]!==$?(H=B(Iu,{onClick:w,sx:x,"aria-label":P,children:[R,_,$,F]}),e[22]=w,e[23]=P,e[24]=_,e[25]=$,e[26]=H):H=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a(!1),e[27]=N):N=e[27];let A;e[28]!==t.cdn||e[29]!==t.guid||e[30]!==t.library_id||e[31]!==t.title||e[32]!==n||e[33]!==C?(A=n&&m(U,{sx:{position:"relative",aspectRatio:"16 / 9",bgcolor:"common.black"},children:C?m(T3,{src:`https://${t.cdn}/${t.guid}/playlist.m3u8`,poster:`https://${t.cdn}/${t.guid}/thumbnail.jpg`,title:t.title,autoPlay:!0}):m(U,{component:"iframe",src:`https://iframe.mediadelivery.net/embed/${t.library_id}/${t.guid}?autoplay=true&preload=true`,title:t.title,allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture",allowFullScreen:!0,sx:{position:"absolute",inset:0,width:"100%",height:"100%",border:0}})}),e[28]=t.cdn,e[29]=t.guid,e[30]=t.library_id,e[31]=t.title,e[32]=n,e[33]=C,e[34]=A):A=e[34];let W;e[35]!==n||e[36]!==A?(W=m(fo,{open:n,onClose:N,maxWidth:"md",fullWidth:!0,children:A}
10),e[35]=n,e[36]=A,e[37]=W):W=e[37];let V;return e[38]!==H||e[39]!==W?(V=B(fi,{children:[H,W]}),e[38]=H,e[39]=W,e[40]=V):V=e[40],V}function VP(i){return i+1}$C.propTypes={link:k.object.isRequired,onVideoOpen:k.func};function PC(i){const e=ct.c(23),{link:t}=i,s=wm(),[n,a]=c.useState(!1),l=s==null?void 0:s.team_id;let u;e[0]!==t.entity_id||e[1]!==l?(u={teamId:l,eventId:t.entity_id},e[0]=t.entity_id,e[1]=l,e[2]=u):u=e[2];const h=_w(u).data;let p,f;e[3]!==h?(p=h?Z6(h.start_datetime):null,f=h?h.cancelled?"Event · Canceled":`${p.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})} · ${Y6(h.start_datetime)}`:"Event",e[3]=h,e[4]=p,e[5]=f):(p=e[4],f=e[5]);const y=f,v=(h==null?void 0:h.title)??t.title;let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C=()=>a(!0),e[6]=C):C=e[6];let S;e[7]!==(h==null?void 0:h.cancelled)||e[8]!==p?(S=p?m(X6,{date:p,dimmed:!!(h!=null&&h.cancelled),width:Hl,height:jl}):m(Gu,{type:"event"}),e[7]=h==null?void 0:h.cancelled,e[8]=p,e[9]=S):S=e[9];let w;e[10]!==y||e[11]!==t||e[12]!==v||e[13]!==S?(w=m(zu,{link:t,title:v,caption:y,onClick:C,thumbnail:S}),e[10]=y,e[11]=t,e[12]=v,e[13]=S,e[14]=w):w=e[14];let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T=()=>a(!1),e[15]=T):T=e[15];const E=s==null?void 0:s.team_id;let M;e[16]!==n||e[17]!==t.entity_id||e[18]!==E?(M=m(Iw,{open:n,onClose:T,teamId:E,eventId:t.entity_id}),e[16]=n,e[17]=t.entity_id,e[18]=E,e[19]=M):M=e[19];let x;return e[20]!==M||e[21]!==w?(x=B(fi,{children:[w,M]}),e[20]=M,e[21]=w,e[22]=x):x=e[22],x}PC.propTypes={link:k.object.isRequired};function MC(i){const e=ct.c(12),{link:t}=i;if(!t.file_path){let p;return e[0]!==t?(p=m(ip,{link:t,icon:_6}),e[0]=t,e[1]=p):p=e[1],p}const s=`https://thg-images.b-cdn.net/${t.file_path}`,n=t.type!=="media";let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={width:ro,maxWidth:"100%"},e[2]=a):a=e[2];let l;e[3]!==t.title||e[4]!==n?(l=n&&m(te,{variant:"caption",noWrap:!0,sx:{display:"block",mb:.25},children:t.title||"Audio"}),e[3]=t.title,e[4]=n,e[5]=l):l=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={width:"100%",height:36,mt:.75},e[6]=u):u=e[6];let d;e[7]!==s?(d=m(U,{component:"audio",controls:!0,src:s,sx:u}),e[7]=s,e[8]=d):d=e[8];let h;return e[9]!==l||e[10]!==d?(h=B(U,{sx:a,children:[l,d]}),e[9]=l,e[10]=d,e[11]=h):h=e[11],h}MC.propTypes={link:k.object.isRequired};function $3(i){const e=ct.c(19),{link:t,onImageOpen:s,onVideoOpen:n}=i;if(t.type==="play"||t.type==="drill"){let d;return e[0]!==t?(d=m(EC,{link:t}),e[0]=t,e[1]=d):d=e[1],d}if(t.type==="rotation"){let d;return e[2]!==t?(d=m(TC,{link:t}),e[2]=t,e[3]=d):d=e[3],d}if(t.type==="event"){let d;return e[4]!==t?(d=m(PC,{link:t}),e[4]=t,e[5]=d):d=e[5],d}const a=t.type==="media"?t.kind:t.type;if(a==="image"){let d;return e[6]!==t||e[7]!==s?(d=m(kC,{link:t,onImageOpen:s}),e[6]=t,e[7]=s,e[8]=d):d=e[8],d}if(a==="video"){let d;return e[9]!==t||e[10]!==n?(d=m($C,{link:t,onVideoOpen:n}),e[9]=t,e[10]=n,e[11]=d):d=e[11],d}if(a==="audio"){let d;return e[12]!==t?(d=m(MC,{link:t}),e[12]=t,e[13]=d):d=e[13],d}let l;e[14]!==t.type?(l=m(Gu,{type:t.type}),e[14]=t.type,e[15]=l):l=e[15];let u;return e[16]!==t||e[17]!==l?(u=m(zu,{link:t,title:t.title,thumbnail:l}),e[16]=t,e[17]=l,e[18]=u):u=e[18],u}$3.propTypes={link:k.object.isRequired,onImageOpen:k.func,onVideoOpen:k.func};const BP=15*60*1e3,S2=10*60*1e3;function oa(i){return new Date(`${String(i).replace(" ","T")}Z`).getTime()}const w2=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null;function qP(i){if(!w2||!i)return 0;const e=i.trim();if(!e)return 0;let t=0;for(const{segment:s}of w2.segment(e))if(!/^\s+$/u.test(s)&&(!new RegExp("\\p{Extended_Pictographic}","u").test(s)||(t+=1,t>3)))return 0;return t}const FP=/(?:https?:\/\/|www\.)[^\s]+/gi;function WP(i,e=!1){if(!i)return i;const t=[];let s=0;for(const n of i.matchAll(FP)){const a=n[0].replace(/[.,!?;:)\]}"']+$/,"");n.index>s&&t.push(i.slice(s,n.index)),t.push(m(xc,{href:a.startsWith("www.")?`https://${a}`:a,target:"_blank",rel:"noopener noreferrer",color:e?"inherit":"primary",underline:e?"always":"hover",children:a},n.index)),s=n.index+a.length}return t.length===0?i:(s<i.length&&t.push(i.slice(s)),t)}const x2=["#D81B60","#8E24AA","#3949AB","#0277BD","#00897B","#558B2F","#F4511E","#6D4C41"];function ao(i){return x2[Math.abs(Number(i)||0)%x2.length]}const HP={fontSize:14,gap:1.25},jP={fontSize:14,width:16},GP={fontSize:15,py:1.25,gap:1.5,borderBottom:"1px solid",borderColor:"divider","&:last-of-type":{borderBottom:0}},zP={fontSize:16,width:18};function RC(i){const e=ct.c(30),{reactions:t,mineEmoji:s,onRemove:n}=i,[a,l]=c.useState("all"),u=t.reduce(KP,0);let d;e[0]!==a||e[1]!==t?(d=a==="all"?t:t.filter(_=>_.emoji===a),e[0]=a,e[1]=t,e[2]=d):d=e[2];const h=d;let p;e[3]!==a?(p=(_,$)=>m(H6,{size:"small",label:$,variant:a===_?"filled":"outlined",color:a===_?"primary":"default",onClick:()=>l(_)},_),e[3]=a,e[4]=p):p=e[4];const f=p;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y={width:260,maxWidth:"90vw"},e[5]=y):y=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v={p:1,flexWrap:"wrap",gap:.5,borderBottom:"1px solid",borderColor:"divider"},e[6]=v):v=e[6];const C=`All ${u}`;let S;e[7]!==C||e[8]!==f?(S=f("all",C),e[7]=C,e[8]=f,e[9]=S):S=e[9];let w;if(e[10]!==t||e[11]!==f){let _;e[13]!==f?(_=$=>f($.emoji,`${$.emoji} ${$.count}`),e[13]=f,e[14]=_):_=e[14],w=t.map(_),e[10]=t,e[11]=f,e[12]=w}else w=e[12];let T;e[15]!==S||e[16]!==w?(T=B(Be,{direction:"row",spacing:.5,sx:v,children:[S,w]}),e[15]=S,e[16]=w,e[17]=T):T=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E={maxHeight:280,overflowY:"auto",py:.5},e[18]=E):E=e[18];let M;e[19]!==h?(M=h.flatMap(UP),e[19]=h,e[20]=M):M=e[20];let x;e[21]!==M?(x=m(U,{sx:E,children:M}),e[21]=M,e[22]=x):x=e[22];let P;e[23]!==s||e[24]!==n?(P=s&&B(Hr,{onClick:n,sx:{borderTop:"1px solid",borderColor:"divider",justifyContent:"center",color:"text.secondary",py:1},children:["Tap to remove your ",s," reaction"]}),e[23]=s,e[24]=n,e[25]=P):P=e[25];let R;return e[26]!==x||e[27]!==P||e[28]!==T?(R=B(U,{sx:y,children:[T,x,P]}),e[26]=x,e[27]=P,e[28]=T,e[29]=R):R=e[29],R}function UP(i){return(i.users??[]).length>0?i.users.map((e,t)=>B(Be,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.5,py:.75},children:[m(te,{variant:"body2",noWrap:!0,sx:{flexGrow:1,minWidth:0},children:e}),m(U,{component:"span",sx:{fontSize:18},children:i.emoji})]},`${i.emoji}-${t}`)):[B(Be,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.5,py:.75},children:[B(te,{variant:"body2",sx:{flexGrow:1,color:"text.secondary"},children:[i.count," ",i.count===1?"reaction":"reactions"]}),m(U,{component:"span",sx:{fontSize:18},children:i.emoji})]},i.emoji)]}function KP(i,e){return i+e.count}RC.propTypes={reactions:k.array.isRequired,mineEmoji:k.string,onRemove:k.func.isRequired};function AC(i){const e=ct.c(7),{readers:t}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={width:260,maxWidth:"90vw",py:.5},e[0]=s):s=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m(te,{variant:"overline",sx:{dis
10play:"block",px:1.5,pt:.5,color:"text.secondary"},children:"Seen by"}),e[1]=n):n=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={maxHeight:280,overflowY:"auto"},e[2]=a):a=e[2];let l;e[3]!==t?(l=t.map(QP),e[3]=t,e[4]=l):l=e[4];let u;return e[5]!==l?(u=B(U,{sx:s,children:[n,m(U,{sx:a,children:l})]}),e[5]=l,e[6]=u):u=e[6],u}function QP(i){return B(Be,{direction:"row",alignItems:"center",spacing:1.25,sx:{px:1.5,py:.75},children:[m(js,{src:i.picture||void 0,sx:{width:28,height:28,fontSize:13},children:(i.name||"?").charAt(0)}),m(te,{variant:"body2",noWrap:!0,sx:{flexGrow:1,minWidth:0},children:i.name||"Teammate"}),i.updated_at&&m(te,{variant:"caption",sx:{color:"text.disabled"},children:Tm(i.updated_at)})]},i.user_id)}AC.propTypes={readers:k.array.isRequired};function IC(i){var ye;const e=ct.c(63),{menu:t,menuMessage:s,onCloseMenu:n,reactionPicker:a,reactionPickerMessage:l,onCloseReactionPicker:u,reactionsView:d,reactionsViewMessage:h,onCloseReactionsView:p,seenByView:f,seenByReaders:y,onCloseSeenBy:v,contextMenu:C,contextMenuMessage:S,contextMenuOwn:w,onCloseContextMenu:T,actionsFor:E,onToggleReaction:M}=i,x=mo(),P=x.palette.primary.main,R=x.palette.background.paper,_=x.palette.primary.contrastText,$=!!(a&&l),G=a==null?void 0:a.anchor;let q,F,H;e[0]===Symbol.for("react.memo_cache_sentinel")?(q={vertical:"top",horizontal:"center"},F={vertical:"bottom",horizontal:"center"},H={paper:{sx:{borderRadius:999,px:.5}}},e[0]=q,e[1]=F,e[2]=H):(q=e[0],F=e[1],H=e[2]);let N;e[3]!==u||e[4]!==M||e[5]!==l?(N=L3.map(ne=>{var St;const Je=(St=l==null?void 0:l.reactions)==null?void 0:St.some(st=>st.mine&&st.emoji===ne);return m(Nt,{"aria-label":`React with ${ne}`,onClick:()=>{l&&M(l,ne),u()},sx:{fontSize:20,width:40,height:40,...Je&&{bgcolor:iM}},children:ne},ne)}),e[3]=u,e[4]=M,e[5]=l,e[6]=N):N=e[6];let A;e[7]!==N?(A=m(Be,{direction:"row",children:N}),e[7]=N,e[8]=A):A=e[8];let W;e[9]!==u||e[10]!==$||e[11]!==G||e[12]!==A?(W=m(yc,{open:$,anchorEl:G,onClose:u,anchorOrigin:q,transformOrigin:F,slotProps:H,children:A}),e[9]=u,e[10]=$,e[11]=G,e[12]=A,e[13]=W):W=e[13];const V=!!(d&&h),K=d==null?void 0:d.anchor;let re,oe;e[14]===Symbol.for("react.memo_cache_sentinel")?(re={vertical:"top",horizontal:"center"},oe={vertical:"bottom",horizontal:"center"},e[14]=re,e[15]=oe):(re=e[14],oe=e[15]);let Z;e[16]!==p||e[17]!==M||e[18]!==h?(Z=h&&m(RC,{reactions:h.reactions??[],mineEmoji:((ye=(h.reactions??[]).find(tM))==null?void 0:ye.emoji)??null,onRemove:()=>{const ne=(h.reactions??[]).find(eM);ne&&M(h,ne.emoji),p()}}),e[16]=p,e[17]=M,e[18]=h,e[19]=Z):Z=e[19];let fe;e[20]!==p||e[21]!==K||e[22]!==Z||e[23]!==V?(fe=m(yc,{open:V,anchorEl:K,onClose:p,anchorOrigin:re,transformOrigin:oe,children:Z}),e[20]=p,e[21]=K,e[22]=Z,e[23]=V,e[24]=fe):fe=e[24];const me=!!f,Q=f==null?void 0:f.anchor;let j,X;e[25]===Symbol.for("react.memo_cache_sentinel")?(j={vertical:"top",horizontal:"right"},X={vertical:"bottom",horizontal:"right"},e[25]=j,e[26]=X):(j=e[25],X=e[26]);let Te;e[27]!==y||e[28]!==f?(Te=f&&m(AC,{readers:y}),e[27]=y,e[28]=f,e[29]=Te):Te=e[29];let Ce;e[30]!==v||e[31]!==me||e[32]!==Q||e[33]!==Te?(Ce=m(yc,{open:me,anchorEl:Q,onClose:v,anchorOrigin:j,transformOrigin:X,children:Te}),e[30]=v,e[31]=me,e[32]=Q,e[33]=Te,e[34]=Ce):Ce=e[34];let Ie;e[35]!==E||e[36]!==R||e[37]!==P||e[38]!==_||e[39]!==C||e[40]!==S||e[41]!==w||e[42]!==x.palette.mode||e[43]!==T||e[44]!==M?(Ie=C&&S&&B(fi,{children:[m(U,{onClick:T,sx:{position:"fixed",inset:0,zIndex:JP,bgcolor:"rgba(0,0,0,0.08)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"}}),B(U,{sx:{position:"fixed",inset:0,zIndex:XP,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:w?"flex-end":"flex-start",gap:1,py:1,pointerEvents:"none",...w?{pr:`${Math.max(window.innerWidth-C.right,8)}px`}:{pl:`${Math.max(C.left,8)}px`}},children:[m(np,{in:!0,appear:!0,timeout:150,children:m(Be,{direction:"row",sx:{pointerEvents:"auto",maxWidth:"calc(100vw - 16px)",overflowX:"auto",px:.75,py:.25,borderRadius:999,bgcolor:"background.paper",boxShadow:12},children:L3.map(ne=>{var St;const Je=(St=S.reactions)==null?void 0:St.some(st=>st.mine&&st.emoji===ne);return m(Nt,{"aria-label":`React with ${ne}`,onClick:()=>{M(S,ne),T()},sx:{fontSize:24,width:44,height:44,...Je&&{bgcolor:YP}},children:ne},ne)})})}),m(np,{in:!0,appear:!0,timeout:150,children:B(U,{sx:{pointerEvents:"auto",width:C.r
10ight-C.left,maxWidth:"calc(100vw - 16px)",maxHeight:"45vh",overflow:"hidden",px:1.5,py:.75,borderRadius:1.5,bgcolor:w?P:R,boxShadow:8,whiteSpace:"pre-wrap",wordBreak:"break-word",typography:"body2",fontSize:"1rem",fontWeight:500,...w?{color:_}:x.palette.mode==="light"?{color:"#111B21"}:{}},children:[!w&&m(te,{variant:"caption",sx:{display:"block",fontWeight:700,fontSize:"1rem",color:ao(S.sender_user_id),mb:.25},children:S.sender_name??"Former member"}),S.body,Hd(S).length>0&&m(Be,{spacing:.5,sx:{mt:S.body?.75:0},children:Hd(S).map(ZP)})]})}),m(np,{in:!0,appear:!0,timeout:150,children:m(U,{sx:{pointerEvents:"auto",minWidth:220,maxWidth:"calc(100vw - 16px)",borderRadius:3,bgcolor:"background.paper",boxShadow:12,overflow:"hidden",py:.5},children:E(S).map(ne=>B(Hr,{sx:{...GP,...ne.destructive&&{color:"error.main"}},disabled:!!ne.disabled,onClick:()=>{T(),ne.run()},children:[m(We,{icon:ne.icon,style:zP}),ne.label]},ne.id))})})]})]}),e[35]=E,e[36]=R,e[37]=P,e[38]=_,e[39]=C,e[40]=S,e[41]=w,e[42]=x.palette.mode,e[43]=T,e[44]=M,e[45]=Ie):Ie=e[45];const ge=t==null?void 0:t.anchor,Re=!!(t&&s);let Se;if(e[46]!==E||e[47]!==s||e[48]!==n){let ne;e[50]!==n?(ne=Je=>B(Hr,{sx:{...HP,...Je.destructive&&{color:"error.main"}},disabled:!!Je.disabled,onClick:()=>{n(),Je.run()},children:[m(We,{icon:Je.icon,style:jP}),Je.label]},Je.id),e[50]=n,e[51]=ne):ne=e[51],Se=E(s).map(ne),e[46]=E,e[47]=s,e[48]=n,e[49]=Se}else Se=e[49];let Ve;e[52]!==n||e[53]!==ge||e[54]!==Re||e[55]!==Se?(Ve=m(W6,{anchorEl:ge,open:Re,onClose:n,children:Se}),e[52]=n,e[53]=ge,e[54]=Re,e[55]=Se,e[56]=Ve):Ve=e[56];let L;return e[57]!==fe||e[58]!==Ce||e[59]!==Ie||e[60]!==Ve||e[61]!==W?(L=B(fi,{children:[W,fe,Ce,Ie,Ve]}),e[57]=fe,e[58]=Ce,e[59]=Ie,e[60]=Ve,e[61]=W,e[62]=L):L=e[62],L}function ZP(i){return m($3,{link:i},`${i.type}:${i.entity_id}`)}function YP(i){return Ai(i.palette.primary.main,.12)}function XP(i){return i.zIndex.modal+1}function JP(i){return i.zIndex.modal}function eM(i){return i.mine}function tM(i){return i.mine}function iM(i){return Ai(i.palette.primary.main,.12)}IC.propTypes={menu:k.object,menuMessage:k.object,onCloseMenu:k.func.isRequired,reactionPicker:k.object,reactionPickerMessage:k.object,onCloseReactionPicker:k.func.isRequired,reactionsView:k.object,reactionsViewMessage:k.object,onCloseReactionsView:k.func.isRequired,seenByView:k.object,seenByReaders:k.array.isRequired,onCloseSeenBy:k.func.isRequired,contextMenu:k.object,contextMenuMessage:k.object,contextMenuOwn:k.bool,onCloseContextMenu:k.func.isRequired,actionsFor:k.func.isRequired,onToggleReaction:k.func.isRequired};const _C=60;function DC(i){const e=ct.c(31),{onSelect:t,onClose:s}=i,n=wm(),[a]=c.useState(nM),l=n==null?void 0:n.team_id;let u;e[0]!==a.from||e[1]!==a.to||e[2]!==l?(u={teamId:l,from:a.from,to:a.to},e[0]=a.from,e[1]=a.to,e[2]=l,e[3]=u):u=e[3];const d=Dw(u);let h,p,f,y,v,C,S,w,T;if(e[4]!==d.data||e[5]!==d.isPending||e[6]!==s||e[7]!==t){const x=(d.data??[]).filter(sM);p=fo,v=!0,C=!0,S="xs",w=s,e[17]===Symbol.for("react.memo_cache_sentinel")?(T=m(Au,{children:"Share an event"}),e[17]=T):T=e[17],h=Ul,e[18]===Symbol.for("react.memo_cache_sentinel")?(f={px:1,pb:2},e[18]=f):f=e[18],y=d.isPending?m(U,{sx:{textAlign:"center",py:4},children:m(Gn,{size:24})}):x.length===0?B(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:4},children:["No upcoming events in the next ",_C," days."]}):x.map(P=>{const R=Z6(P.start_datetime);return B(Hr,{onClick:()=>{t(P),s()},sx:{borderRadius:1.5,py:1,gap:1.5},children:[m(X6,{date:R,width:48,height:40}),B(U,{sx:{minWidth:0},children:[m(te,{variant:"body2",noWrap:!0,sx:{fontWeight:600},children:P.title}),B(te,{variant:"caption",sx:{color:"text.secondary"},children:[R.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})," · ",Y6(P.start_datetime)]})]})]},P.event_id)}),e[4]=d.data,e[5]=d.isPending,e[6]=s,e[7]=t,e[8]=h,e[9]=p,e[10]=f,e[11]=y,e[12]=v,e[13]=C,e[14]=S,e[15]=w,e[16]=T}else h=e[8],p=e[9],f=e[10],y=e[11],v=e[12],C=e[13],S=e[14],w=e[15],T=e[16];let E;e[19]!==h||e[20]!==f||e[21]!==y?(E=m(h,{sx:f,children:y}),e[19]=h,e[20]=f,e[21]=y,e[22]=E):E=e[22];let M;return e[23]!==p||e[24]!==E||e[25]!==v||e[26]!==C||e[27]!==S||e[28]!==w||e[29]!==T?(M=B(p,{open:v,fullWidth:C,maxWidth:S,onClose:w,children:[T,E]}),e[23]=p,e[24]=E,e[25]=v,e[26]=C,e[27]=S,e[28]=w,e[29]=T,e[30]=M):M=e[30],M}function sM(i){return!i.cancelled}function nM(){const i=new Date,e=new Date(i.getTime());return e.setDate(e.getDate()+_C),{from:Aw(i),to:Rw(e)}}DC.propTypes={onSelect:k.func.isRequired,onClose:k.func.isRequired};LC.propTypes={kind:k.oneOf(["image","video"]).isRequired,files:k.array,maxFiles:k.number,onUploaded:k.func.isRequired,onClose:k.func.isRequired};const rM=50*1024*1024,bp=60;function aM(i){return new Promise((e,t)=>
10{const s=URL.createObjectURL(i),n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=()=>{URL.revokeObjectURL(s),e(n.duration)},n.onerror=()=>{URL.revokeObjectURL(s),t(new Error("Could not read video metadata"))},n.src=s})}function LC({kind:i,files:e=[],maxFiles:t=5,onUploaded:s,onClose:n}){const a=mo(),l=c.useRef(s),u=c.useRef(n);c.useEffect(()=>{l.current=s,u.current=n});const[d]=c.useState(()=>{const h=new Nw({id:`chat-upload-${i}`,autoProceed:!1,restrictions:{maxFileSize:rM,maxNumberOfFiles:Math.max(1,t),allowedFileTypes:i==="video"?["video/*"]:["image/*"]}}).use(Vw,{id:"ImageEditor",cropperOptions:{viewMode:1,autoCropArea:1,responsive:!0}}).use(Bw,{maxWidth:1600,maxHeight:1600,quality:.8}).on("file-added",async p=>{if(i==="video"){const f=await aM(p.data).catch(()=>null);Number.isFinite(f)&&f>bp&&(d.removeFile(p.id),d.info(`Videos can be up to ${bp} seconds — please trim it and try again.`,"error",5e3))}}).on("upload-success",(p,f)=>{var v;const y=f==null?void 0:f.body;if(y&&y.media_id){let C=null;try{p!=null&&p.data&&(C=URL.createObjectURL(p.data))}catch{}(v=l.current)==null||v.call(l,y,C)}}).on("upload-error",(p,f,y)=>{const v=y==null?void 0:y.body;d.info((v==null?void 0:v.error)||(f==null?void 0:f.message)||"Upload failed. Please try again.","error",4e3)}).on("complete",p=>{var f,y;(f=p==null?void 0:p.failed)!=null&&f.length||(y=u.current)==null||y.call(u)});return h.addUploader(async p=>{h.emit("upload-start",p.map(f=>h.getFile(f))),p.forEach(f=>{const y=h.getFile(f);h.emit("upload-success",y,{status:200,body:ig(y.data,i)})})}),h});return c.useLayoutEffect(()=>{e.forEach(h=>{try{d.addFile({name:h.name,type:h.type,data:h})}catch{}})},[]),c.useEffect(()=>()=>d.destroy(),[d]),m(Ow,{uppy:d,open:!0,theme:a.palette.mode,target:document.body,proudlyDisplayPoweredByUppy:!1,plugins:["ImageEditor"],autoOpen:i==="image"?"imageEditor":null,note:i==="video"?`Attach a short video clip (up to ${bp}s)`:"Attach a photo",onRequestClose:n})}const oM=10,lM=500,cM=200;function NC(i){const e=ct.c(56),{onSend:t,onClose:s}=i,[n,a]=c.useState("");let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["",""],e[0]=l):l=e[0];const[u,d]=c.useState(l),[h,p]=c.useState(!1),[f,y]=c.useState("");let v;e[1]!==u?(v=u.map(dM).filter(Boolean),e[1]=u,e[2]=v):v=e[2];const C=v;let S;e[3]!==f?(S=!!f&&new Date(f).getTime()<=Date.now(),e[3]=f,e[4]=S):S=e[4];const w=S,T=n.trim().length>0&&C.length>=2&&!w;let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=(ge,Re)=>d(Se=>Se.map((Ve,L)=>L===ge?Re:Ve)),e[5]=E):E=e[5];const M=E;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=ge=>d(Re=>Re.filter((Se,Ve)=>Ve!==ge)),e[6]=x):x=e[6];const P=x;let R;e[7]!==f||e[8]!==h||e[9]!==s||e[10]!==t||e[11]!==n||e[12]!==C?(R=()=>{t({question:n.trim(),options:C,multi_choice:h,...f?{closes_at:new Date(f).toISOString()}:{}}),s()},e[7]=f,e[8]=h,e[9]=s,e[10]=t,e[11]=n,e[12]=C,e[13]=R):R=e[13];const _=R;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=m(Au,{children:"Create a poll"}),e[14]=$):$=e[14];let G;e[15]===Symbol.for("react.memo_cache_sentinel")?(G={mt:.5},e[15]=G):G=e[15];let q;e[16]===Symbol.for("react.memo_cache_sentinel")?(q=ge=>a(ge.target.value),e[16]=q):q=e[16];let F;e[17]===Symbol.for("react.memo_cache_sentinel")?(F={htmlInput:{maxLength:lM}}
10,e[17]=F):F=e[17];let H;e[18]!==n?(H=m(Wr,{label:"Question",value:n,onChange:q,fullWidth:!0,autoFocus:!0,multiline:!0,maxRows:3,slotProps:F}),e[18]=n,e[19]=H):H=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=m(te,{variant:"subtitle2",children:"Options"}),e[20]=N):N=e[20];let A;if(e[21]!==u){let ge;e[23]!==u.length?(ge=(Re,Se)=>B(Be,{direction:"row",spacing:.5,alignItems:"center",children:[m(Wr,{size:"small",fullWidth:!0,placeholder:`Option ${Se+1}`,value:Re,onChange:Ve=>M(Se,Ve.target.value),slotProps:{htmlInput:{maxLength:cM}}}),u.length>2&&m(Nt,{size:"small",onClick:()=>P(Se),"aria-label":`Remove option ${Se+1}`,children:m(We,{icon:Wd,style:{fontSize:14}})})]},Se),e[23]=u.length,e[24]=ge):ge=e[24],A=u.map(ge),e[21]=u,e[22]=A}else A=e[22];let W;e[25]!==u.length?(W=u.length<oM&&m(oi,{size:"small",color:"inherit",onClick:()=>d(uM),startIcon:m(We,{icon:A6,style:{fontSize:12}}),sx:{alignSelf:"flex-start"},children:"Add option"}),e[25]=u.length,e[26]=W):W=e[26];let V;e[27]!==A||e[28]!==W?(V=B(Be,{spacing:1,children:[N,A,W]}),e[27]=A,e[28]=W,e[29]=V):V=e[29];let K;e[30]===Symbol.for("react.memo_cache_sentinel")?(K=ge=>p(ge.target.checked),e[30]=K):K=e[30];let re;e[31]!==h?(re=m(WS,{control:m(F6,{checked:h,onChange:K}),label:"Allow multiple answers"}),e[31]=h,e[32]=re):re=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=ge=>y(ge.target.value),e[33]=oe):oe=e[33];const Z=w?"The deadline must be in the future":"The poll closes itself at this time";let fe;e[34]===Symbol.for("react.memo_cache_sentinel")?(fe={inputLabel:{shrink:!0}},e[34]=fe):fe=e[34];let me;e[35]!==f||e[36]!==w||e[37]!==Z?(me=m(Wr,{label:"Voting deadline (optional)",type:"datetime-local",value:f,onChange:oe,fullWidth:!0,size:"small",error:w,helperText:Z,slotProps:fe}),e[35]=f,e[36]=w,e[37]=Z,e[38]=me):me=e[38];let Q;e[39]!==H||e[40]!==V||e[41]!==re||e[42]!==me?(Q=m(Ul,{children:B(Be,{spacing:2,sx:G,children:[H,V,re,me]})}),e[39]=H,e[40]=V,e[41]=re,e[42]=me,e[43]=Q):Q=e[43];let j;e[44]!==s?(j=m(oi,{color:"inherit",onClick:s,children:"Cancel"}),e[44]=s,e[45]=j):j=e[45];const X=!T;let Te;e[46]!==_||e[47]!==X?(Te=m(oi,{variant:"contained",disabled:X,onClick:_,children:"Send poll"}),e[46]=_,e[47]=X,e[48]=Te):Te=e[48];let Ce;e[49]!==j||e[50]!==Te?(Ce=B(kh,{children:[j,Te]}),e[49]=j,e[50]=Te,e[51]=Ce):Ce=e[51];let Ie;return e[52]!==s||e[53]!==Q||e[54]!==Ce?(Ie=B(fo,{open:!0,fullWidth:!0,maxWidth:"xs",onClose:s,children:[$,Q,Ce]}),e[52]=s,e[53]=Q,e[54]=Ce,e[55]=Ie):Ie=e[55],Ie}function uM(i){return[...i,""]}function dM(i){return i.trim()}NC.propTypes={onSend:k.func.isRequired,onClose:k.func.isRequired};function Ci(i,e,t,s){return new(t||(t=Promise))(function(n,a){function l(h){try{d(s.next(h))}catch(p){a(p)}}function u(h){try{d(s.throw(h))}catch(p){a(p)}}function d(h){var p;h.done?n(h.value):(p=h.value,p instanceof t?p:new t(function(f){f(p)})).then(l,u)}d((s=s.apply(i,e||[])).next())})}let Uu=class{constructor(){this.listeners={}}on(e,t,s){if(this.listeners[e]||(this.listeners[e]=new Set),s==null?void 0:s.once){const n=(...a)=>{this.un(e,n),t(...a)};return this.listeners[e].add(n),()=>this.un(e,n)}return this.listeners[e].add(t),()=>this.un(e,t)}un(e,t){var s;(s=this.listeners[e])===null||s===void 0||s.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(s=>s(...t))}};const id={decode:function(i,e){return Ci(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});try{return yield t.decodeAudioData(i)}finally{t.close()}})},createBuffer:function(i,e){if(!i||i.length===0)throw new Error("channelData must be a non-empty array");if(e<=0)throw new Error("duration must be greater than 0");if(typeof i[0]=="number"&&(i=[i]),!i[0]||i[0].length===0)throw new Error("channelData must contain non-empty channel arrays");(function(s){const n=s[0];if(n.some(a=>a>1||a<-1)){const a=n.length;let l=0;for(let u=0;u<a;u++){const d=Math.abs(n[u]);d>l&&(l=d)}for(const u of s)for(let d=0;d<a;d++)u[d]/=l}})(i);const t=i.map(s=>s instanceof Float32Array?s:Float32Array.from(s));return{duration:e,length:t[0].length,sampleRate:t[0].length/e,numberOfChannels:t.length,getChannelData:s=>{const n=t[s];if(!n)throw new Error(`Channel ${s} not found`);return n},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function OC(i,e){const t=e.xmlns?document.createElementNS(e.xmlns,i):document.createElement(i);for(const[s,n]of Object.entries(e))if(s==="children"&&n)for(const[a,l]of Object.entries(n))l instanceof Node?t.appendChild(l):typeof l=="string"?t.appendChild(document.createTextNode(l)):t.appendChild(OC(a,l));else s==="style"?Object.assign(t.style,n):s==="textContent"?t.textContent=n:t.setAttribute(s,n.toString());return t}function E2(i,e,t){const s=OC(i,e||{});return t==null||t.appendChild(s),s}function VC(i){return i instanceof HTMLElement||typeof i=="object"&&i!==null&&i.nodeType===Node.ELEMENT_NODE&&typeof i.style=="object"}var hM=Object.freeze({__proto__:null,createElement:E2,default:E2,isHTMLElement:VC});const pM={fetchBlob:function(i,e,t){return Ci(this,void 0,void 0,function*(){var s;const n=yield fetch(i,t);if(n.status>=400)throw new Error(`Failed to fetch ${i}: ${n.status} (${n.statusText})`);return function(a,l,u){Ci(this,void 0,void 0,function*(){var d;if(!a.body||!a.headers)return;const h=a.body.getReader(),p=Number(a.headers.get("Content-Length"))||0;let f=0;const y=()=>{h.cancel()};if(u){if(u.aborted)return void h.cancel();u.addEventListener("abort",y,{once:!0})}try{for(;;){const v=yield h.read();if(v.done)break;if(f+=((d=v.value)===null||d===void 0?void 0:d.length)||0,p>0){const C=Math.round(f/p*100);l(C)}}}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return;console.warn("Progress tracking error:",v)}finally{u&&u.removeEventListener("abort",y)}})}(n.clone(),e,(s=t==null?void 0:t.signal)!==null&&s!==void 0?s:void 0),n.blob()})}};function Mt(i){let e=i;const t=new Set;return{get value(){return e},set(s){Object.is(e,s)||(e=s,t.forEach(n=>n(e)))},update(s){this.set(s(e))},subscribe:s=>(t.add(s),()=>t.delete(s))}}function la(i,e){const t=Mt(i());return e.forEach(s=>s.subscribe(()=>{const n=i();Object.is(t.value,n)||t.set(n)})),{get value(){return t.value},subscribe:s=>t.subscribe(s)}}function an(i,e){let t;const s=()=>{t&&(t(),t=void 0),t=i()},n=e.map(a=>a.subscribe(s));return s(),()=>
10{t&&(t(),t=void 0),n.forEach(a=>a())}}class fM extends Uu{get isPlayingSignal(){return this._isPlaying}get currentTimeSignal(){return this._currentTime}get durationSignal(){return this._duration}get volumeSignal(){return this._volume}get mutedSignal(){return this._muted}get playbackRateSignal(){return this._playbackRate}get seekingSignal(){return this._seeking}constructor(e){super(),this.isExternalMedia=!1,this._ownBlobUrl=null,this.reactiveMediaEventCleanups=[],e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),this._isPlaying=Mt(!1),this._currentTime=Mt(0),this._duration=Mt(0),this._volume=Mt(this.media.volume),this._muted=Mt(this.media.muted),this._playbackRate=Mt(this.media.playbackRate||1),this._seeking=Mt(!1),this.setupReactiveMediaEvents(),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}setupReactiveMediaEvents(){this.reactiveMediaEventCleanups.push(this.onMediaEvent("play",()=>{this._isPlaying.set(!0)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("pause",()=>{this._isPlaying.set(!1)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("ended",()=>{this._isPlaying.set(!1)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("timeupdate",()=>{this._currentTime.set(this.media.currentTime)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("durationchange",()=>{this._duration.set(this.media.duration||0)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("loadedmetadata",()=>{this._duration.set(this.media.duration||0)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeking",()=>{this._seeking.set(!0)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeked",()=>{this._seeking.set(!1)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("volumechange",()=>{this._volume.set(this.media.volume),this._muted.set(this.media.muted)})),this.reactiveMediaEventCleanups.push(this.onMediaEvent("ratechange",()=>{this._playbackRate.set(this.media.playbackRate)}))}onMediaEvent(e,t,s){return this.media.addEventListener(e,t,s),()=>this.media.removeEventListener(e,t,s)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){this._ownBlobUrl&&(URL.revokeObjectURL(this._ownBlobUrl),this._ownBlobUrl=null)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const s=this.getSrc();if(e&&s===e)return;this.revokeSrc();const n=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;if(n!==e&&(this._ownBlobUrl=n),s&&this.media.removeAttribute("src"),n||e)try{this.media.src=n}catch{this.media.src=e}}destroy(){this.reactiveMediaEventCleanups.forEach(e=>e()),this.reactiveMediaEventCleanups=[],this.revokeSrc(),this.unAll(),this.isExternalMedia||(this.media.pause(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(e){this.reactiveMediaEventCleanups.forEach(t=>t()),this.reactiveMediaEventCleanups=[],this.media=e,this.setupReactiveMediaEvents()}play(){return Ci(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(e){if(e instanceof DOMException&&e.name==="AbortError")return;throw e}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=Math.max(0,Math.min(e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}function mM({maxTop:i,maxBottom:e,halfHeight:t,vScale:s,barMinHeight:n=0,barAlign:a}){let l=Math.round(i*t*s),u=l+Math.round(e*t*s)||1;return u<n&&(u=n,a||(l=u/2)),{topHeight:l,totalHeight:u}}function gM({barAlign:i,halfHeight:e,topHeight:t,totalHeight:s,canvasHeight:n}){return i==="top"?0:i==="bottom"?n-s:e-t}function T2(i,e,t){const s=e-i.left,n=t-i.top;return[s/i.width,n/i.height]}function BC(i){return!!(i.barWidth||i.barGap||i.barAlign)}function k2(i,e){if(!BC(e))return i;const t=e.barWidth||.5,s=t+(e.barGap||t/2);return s===0?i:Math.floor(i/s)*s}
10function $2({scrollLeft:i,totalWidth:e,numCanvases:t}){if(e===0)return[0];const s=i/e,n=Math.floor(s*t);return[n-1,n,n+1]}function qC(i){const e=i._cleanup;typeof e=="function"&&e()}function yM(i){const e=Mt({scrollLeft:i.scrollLeft,scrollWidth:i.scrollWidth,clientWidth:i.clientWidth}),t=la(()=>function(a){const{scrollLeft:l,scrollWidth:u,clientWidth:d}=a;if(u===0)return{startX:0,endX:1};const h=l/u,p=(l+d)/u;return{startX:Math.max(0,Math.min(1,h)),endX:Math.max(0,Math.min(1,p))}}(e.value),[e]),s=la(()=>function(a){return{left:a.scrollLeft,right:a.scrollLeft+a.clientWidth}}(e.value),[e]),n=()=>{e.set({scrollLeft:i.scrollLeft,scrollWidth:i.scrollWidth,clientWidth:i.clientWidth})};return i.addEventListener("scroll",n,{passive:!0}),{scrollData:e,percentages:t,bounds:s,cleanup:()=>{i.removeEventListener("scroll",n),qC(e)}}}class bM extends Uu{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragStream=null,this.scrollStream=null,this.containerInlinePadding=0,this.onClickWrapper=l=>{const u=this.wrapper.getBoundingClientRect(),[d,h]=T2(u,l.clientX,l.clientY);this.emit("click",d,h)},this.onDblClickWrapper=l=>{const u=this.wrapper.getBoundingClientRect(),[d,h]=T2(u,l.clientX,l.clientY);this.emit("dblclick",d,h)},this.subscriptions=[],this.options=e;const s=this.parentFromOptionsContainer(e.container);this.parent=s;const[n,a]=this.initHtml();s.appendChild(n),this.container=n,this.scrollContainer=a.querySelector(".scroll"),this.wrapper=a.querySelector(".wrapper"),this.canvasWrapper=a.querySelector(".canvases"),this.progressWrapper=a.querySelector(".progress"),this.cursor=a.querySelector(".cursor"),this.calculateInlinePadding(),t&&a.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):VC(e)&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){this.wrapper.addEventListener("click",this.onClickWrapper),this.wrapper.addEventListener("dblclick",this.onDblClickWrapper),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollStream=yM(this.scrollContainer);const e=an(()=>{const{startX:t,endX:s}=this.scrollStream.percentages.value,{left:n,right:a}=this.scrollStream.bounds.value;this.emit("scroll",t,s,n,a)},[this.scrollStream.percentages,this.scrollStream.bounds]);if(this.subscriptions.push(e),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;this.calculateInlinePadding(),e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender(),this.emit("resize"))}initDrag(){if(this.dragStream)return;this.dragStream=function(t,s={}){const{threshold:n=3,mouseButton:a=0,touchDelay:l=100}=s,u=Mt(null),d=new Map,h=matchMedia("(pointer: coarse)").matches;let p=()=>{};const f=y=>{if(y.button!==a||d.has(y.pointerId)||(d.set(y.pointerId,y),d.size>1))return;const v=y.pointerId;let C=y.clientX,S=y.clientY,w=!1;const T=Date.now(),E=t.getBoundingClientRect(),{left:M,top:x}=E,P=q=>{if(q.pointerId!==v||q.defaultPrevented||d.size>1||h&&Date.now()-T<l)return;const F=q.clientX,H=q.clientY,N=F-C,A=H-S;(w||Math.abs(N)>n||Math.abs(A)>n)&&(q.preventDefault(),q.stopPropagation(),w||(u.set({type:"start",x:C-M,y:S-x}),w=!0),u.set({type:"move",x:F-M,y:H-x,deltaX:N,deltaY:A}),C=F,S=H)},R=q=>{if(d.delete(q.pointerId)){if(q.pointerId===v&&w){const F=q.clientX,H=q.clientY;u.set({type:"end",x:F-M,y:H-x})}d.size===0&&p()}},_=q=>{q.relatedTarget&&q.relatedTarget!==document.documentElement||R(q)},$=q=>{w&&(q.stopPropagation(),q.preventDefault())},G=q=>{q.defaultPrevented||d.size>1||w&&q.preventDefault()};document.addEventListener("pointermove",P),document.addEventListener("pointerup",R),document.addEventListener("pointerout",_),document.addEventListener("pointercancel",_),document.addEventListener("touchmove",G,{passive:!1}),document.addEventListener("click",$,{capture:!0}),p=()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",R),document.removeEventListener("pointerout",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",G),setTimeout(()=>{document.removeEventListener("click",$,{capture:!0})},10)}};return t.addEventListener("pointerdown",f),{signal:u,cleanup:()=>{p(),t.removeEventListener("pointerdown",f),d.clear(),qC(u)}}}(this.wrapper);const e=an(()=>{const t=this.dragStream.signal.value;if(!t)return;const s=this.wrapper.getBoundingClientRect().width,n=(a=t.x/s)<0?0:a>1?1:a;var a;
10t.type==="start"?(this.isDragging=!0,this.emit("dragstart",n)):t.type==="move"?this.emit("drag",n):t.type==="end"&&(this.isDragging=!1,this.emit("dragend",n))},[this.dragStream.signal]);this.subscriptions.push(e)}calculateInlinePadding(){const{paddingLeft:e,paddingRight:t}=getComputedStyle(this.scrollContainer),s=parseFloat(e)+parseFloat(t);this.containerInlinePadding=Number.isNaN(s)?0:s}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),s=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return t.innerHTML=`
11      <style${s?` nonce="${s}"`:""}>
12        :host {
13          user-select: none;
14          min-width: 1px;
15        }
16        :host audio {
17          display: block;
18          width: 100%;
19        }
20        :host .scroll {
21          overflow-x: auto;
22          overflow-y: hidden;
23          width: 100%;
24          position: relative;
25        }
26        :host .noScrollbar {
27          scrollbar-color: transparent;
28          scrollbar-width: none;
29        }
30        :host .noScrollbar::-webkit-scrollbar {
31          display: none;
32          -webkit-appearance: none;
33        }
34        :host .wrapper {
35          position: relative;
36          overflow: visible;
37          z-index: 2;
38        }
39        :host .canvases {
40          min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
41          pointer-events: none;
42        }
43        :host .canvases > div {
44          position: relative;
45        }
46        :host canvas {
47          display: block;
48          position: absolute;
49          top: 0;
50          image-rendering: pixelated;
51        }
52        :host .progress {
53          pointer-events: none;
54          position: absolute;
55          z-index: 2;
56          top: 0;
57          left: 0;
58          width: 0;
59          height: 100%;
60          overflow: hidden;
61        }
62        :host .progress > div {
63          position: relative;
64        }
65        :host .cursor {
66          pointer-events: none;
67          position: absolute;
68          z-index: 5;
69          top: 0;
70          left: 0;
71          height: 100%;
72          border-radius: 2px;
73        }
74      </style>
75
76      <div class="scroll" part="scroll">
77        <div class="wrapper" part="wrapper">
78          <div class="canvases" part="canvases"></div>
79          <div class="progress" part="progress"></div>
80          <div class="cursor" part="cursor"></div>
81        </div>
82      </div>
83    `,[e,t]}setOptions(e){var t;if(this.options.container!==e.container){const s=this.parentFromOptionsContainer(e.container);s.appendChild(this.container),this.parent=s}e.dragToSeek===!0||typeof this.options.dragToSeek=="object"?this.initDrag():((t=this.dragStream)===null||t===void 0||t.cleanup(),this.dragStream=null),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth-this.containerInlinePadding}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,s=t*e;this.setScroll(s)}destroy(){var e;this.wrapper.removeEventListener("click",this.onClickWrapper),this.wrapper.removeEventListener("dblclick",this.onDblClickWrapper),this.timeouts.forEach(t=>t()),this.timeouts=[],this.subscriptions.forEach(t=>t()),this.container.remove(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(t=>t()),this.unsubscribeOnScroll=[],this.dragStream&&(this.dragStream.cleanup(),this.dragStream=null),this.scrollStream&&(this.scrollStream.cleanup(),this.scrollStream=null)}createDelay(e=10){let t,s;const n=()=>{t&&(clearTimeout(t),t=void 0),s&&(s(),s=void 0)};return this.timeouts.push(n),()=>new Promise((a,l)=>{n(),s=l,t=setTimeout(()=>{t=void 0,s=void 0,a()},e)})}getHeight(e,t){var s;const n=((s=this.audioData)===null||s===void 0?void 0:s.numberOfChannels)||1;return function({optionsHeight:a,optionsSplitChannels:l,parentHeight:u,numberOfChannels:d,defaultHeight:h=128}){if(a==null)return h;const p=Number(a);if(!isNaN(p))return p;if(a==="auto"){const f=u||h;return l!=null&&l.every(y=>!y.overlay)?f/d:f}return h}({optionsHeight:e,optionsSplitChannels:t,parentHeight:this.parent.clientHeight,numberOfChannels:n,defaultHeight:128})}convertColorValues(e,t){return function(s,n,a){if(!Array.isArray(s))return s||"";if(s.length===0)return"#999";if(s.length<2)return s[0]||"";const l=document.createElement("canvas"),u=l.getContext("2d");if(!u)return s[0]||"";const d=a||l.height*n,h=u.createLinearGradient(0,0,0,d),p=1/(s.length-1);return s.forEach((f,y)=>{h.addColorStop(y*p,f)}),h}(e,this.getPixelRatio(),t==null?void 0:t.canvas.height)}getPixelRatio(){return e=window.devicePixelRatio,Math.max(1,e||1);var e}renderBarWaveform(e,t,s,n){const{width:a,height:l}=s.canvas,{halfHeight:u,barWidth:d,barRadius:h,barIndexScale:p,barSpacing:f,barMinHeight:y}=function({width:C,height:S,length:w,options:T,pixelRatio:E}){const M=S/2,x=T.barWidth?T.barWidth*E:1,P=T.barGap?T.barGap*E:T.barWidth?x/2:0,R=x+P||1;return{halfHeight:M,barWidth:x,barGap:P,barRadius:T.barRadius||0,barMinHeight:T.barMinHeight?T.barMinHeight*E:0,barIndexScale:w>0?C/R/w:0,barSpacing:R}}({width:a,height:l,length:(e[0]||[]).length,options:t,pixelRatio:this.getPixelRatio()}),v=function({channelData:C,barIndexScale:S,barSpacing:w,barWidth:T,halfHeight:E,vScale:M,canvasHeight:x,barAlign:P,barMinHeight:R}){const _=C[0]||[],$=C[1]||_,G=_.length,q=[];let F=0,H=0,N=0;for(let A=0;A<=G;A++){const W=Math.round(A*S);if(W>F){const{topHeight:re,totalHeight:oe}=mM({maxTop:H,maxBottom:N,halfHeight:E,vScale:M,barMinHeight:R,barAlign:P}),Z=gM({barAlign:P,halfHeight:E,topHeight:re,totalHeight:oe,canvasHeight:x});q.push({x:F*w,y:Z,width:T,height:oe}),F=W,H=0,N=0}const V=Math.abs(_[A]||0),K=Math.abs($[A]||0);V>H&&(H=V),K>N&&(N=K)}return q}({channelData:e,barIndexScale:p,barSpacing:f,barWidth:d,halfHeight:u,vScale:n,canvasHeight:l,barAlign:t.barAlign,barMinHeight:y});s.beginPath();for(const C of v)h&&"roundRect"in s?s.roundRect(C.x,C.y,C.width,C.height,h):s.rect(C.x,C.y,C.width,C.height);s.fill(),s.closePath()}renderLineWaveform(e,t,s,n){const{width:a,height:l}=s.canvas,u=function({channelData:d,width:h,height:p,vScale:f}){const y=p/2,v=d[0]||[];return[v,d[1]||v].map((C,S)=>{const w=C.length,T=w?h/w:0,E=y,M=S===0?-1:1,x=[{x:0,y:E}];let P=0,R=0;for(let _=0;_<=w;_++){const $=Math.round(_*T);if($>P){const q=E+(Math.round(R*y*f)||1)*M;x.push({x:P,y:q}),P=$,R=0}const G=Math.abs(C[_]||0);G>R&&(R=G)}return x.push({x:P,y:E}),x})}({channelData:e,width:a,height:l,vScale:n});s.beginPath();for(const d of u)if(d.length){s.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h++){const p=d[h];s.lineTo(p.x,p.y)}}s.fill(),s.closePath()}
83renderWaveform(e,t,s){if(s.fillStyle=this.convertColorValues(t.waveColor,s),t.renderFunction)return void t.renderFunction(e,s);const n=function({channelData:a,barHeight:l,normalize:u,maxPeak:d}){var h;const p=l||1;if(!u)return p;const f=a[0];if(!f||f.length===0)return p;let y=d??0;if(!d)for(let v=0;v<f.length;v++){const C=(h=f[v])!==null&&h!==void 0?h:0,S=Math.abs(C);S>y&&(y=S)}return y?p/y:p}({channelData:e,barHeight:t.barHeight,normalize:t.normalize,maxPeak:t.maxPeak});BC(t)?this.renderBarWaveform(e,t,s,n):this.renderLineWaveform(e,t,s,n)}renderSingleCanvas(e,t,s,n,a,l,u){const d=this.getPixelRatio(),h=document.createElement("canvas");h.width=Math.round(s*d),h.height=Math.round(n*d),h.style.width=`${s}px`,h.style.height=`${n}px`,h.style.left=`${Math.round(a)}px`,l.appendChild(h);const p=h.getContext("2d");if(t.renderFunction?(p.fillStyle=this.convertColorValues(t.waveColor,p),t.renderFunction(e,p)):this.renderWaveform(e,t,p),h.width>0&&h.height>0){const f=h.cloneNode(),y=f.getContext("2d");y.drawImage(h,0,0),y.globalCompositeOperation="source-in",y.fillStyle=this.convertColorValues(t.progressColor,y),y.fillRect(0,0,h.width,h.height),u.appendChild(f)}}renderMultiCanvas(e,t,s,n,a,l){const u=this.getPixelRatio(),{clientWidth:d}=this.scrollContainer,h=s/u,p=function({clientWidth:C,totalWidth:S,options:w}){return k2(Math.min(8e3,C,S),w)}({clientWidth:d,totalWidth:h,options:t});let f={};if(p===0)return;const y=C=>{if(C<0||C>=v||f[C])return;f[C]=!0;const S=C*p;let w=Math.min(h-S,p);if(w=k2(w,t),w<=0)return;const T=function({channelData:E,offset:M,clampedWidth:x,totalWidth:P}){return E.map(R=>{const _=Math.floor(M/P*R.length),$=Math.floor((M+x)/P*R.length);return R.slice(_,$)})}({channelData:e,offset:S,clampedWidth:w,totalWidth:h});this.renderSingleCanvas(T,t,w,n,S,a,l)},v=Math.ceil(h/p);if(!this.isScrollable){for(let C=0;C<v;C++)y(C);return}if($2({scrollLeft:this.scrollContainer.scrollLeft,totalWidth:h,numCanvases:v}).forEach(C=>y(C)),v>1){const C=this.on("scroll",()=>{const{scrollLeft:S}=this.scrollContainer;Object.keys(f).length>10&&(a.innerHTML="",l.innerHTML="",f={}),$2({scrollLeft:S,totalWidth:h,numCanvases:v}).forEach(w=>y(w))});this.unsubscribeOnScroll.push(C)}}renderChannel(e,t,s,n){var{overlay:a}=t,l=function(p,f){var y={};for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&f.indexOf(v)<0&&(y[v]=p[v]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function"){var C=0;for(v=Object.getOwnPropertySymbols(p);C<v.length;C++)f.indexOf(v[C])<0&&Object.prototype.propertyIsEnumerable.call(p,v[C])&&(y[v[C]]=p[v[C]])}return y}(t,["overlay"]);const u=document.createElement("div"),d=this.getHeight(l.height,l.splitChannels);u.style.height=`${d}px`,a&&n>0&&(u.style.marginTop=`-${d}px`),this.canvasWrapper.style.minHeight=`${d}px`,this.canvasWrapper.appendChild(u);const h=u.cloneNode();this.progressWrapper.appendChild(h),this.renderMultiCanvas(e,l,s,d,u,h)}render(e){return Ci(this,void 0,void 0,function*(){var t;this.timeouts.forEach(h=>h()),this.timeouts=[],this.unsubscribeOnScroll.forEach(h=>h()),this.unsubscribeOnScroll=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const s=this.getPixelRatio(),n=this.scrollContainer.clientWidth-this.containerInlinePadding,{scrollWidth:a,isScrollable:l,useParentWidth:u,width:d}=function({duration:h,minPxPerSec:p=0,parentWidth:f,fillParent:y,pixelRatio:v}){const C=Math.ceil(h*p),S=C>f,w=!!(y&&!S);return{scrollWidth:C,isScrollable:S,useParentWidth:w,width:(w?f:C)*v}}({duration:e.duration,minPxPerSec:this.options.minPxPerSec||0,parentWidth:n,fillParent:this.options.fillParent,pixelRatio:s});if(this.isScrollable=l,this.wrapper.style.width=u?"100%":`${a}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}
83px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let h=0;h<e.numberOfChannels;h++){const p=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[h]);this.renderChannel([e.getChannelData(h)],p,d,h)}else{const h=[e.getChannelData(0)];e.numberOfChannels>1&&h.push(e.getChannelData(1)),this.renderChannel(h,this.options,d,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(s=>s()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:e}=this.scrollContainer,{right:t}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),!this.isScrollable&&this.scrollContainer.scrollLeft)this.scrollContainer.scrollLeft=0;else if(this.isScrollable&&e!==this.scrollContainer.scrollWidth){const{right:s}=this.progressWrapper.getBoundingClientRect(),n=function(a){const l=2*a;return(l<0?Math.floor(l):Math.ceil(l))/2}(s-t);this.scrollContainer.scrollLeft+=n}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){var s;const{scrollLeft:n,scrollWidth:a,clientWidth:l}=this.scrollContainer,u=e*a,d=n,h=n+l,p=l/2;if(this.isDragging)u+30>h?this.scrollContainer.scrollLeft+=30:u-30<d&&(this.scrollContainer.scrollLeft-=30);else{(u<d||u>h)&&(this.scrollContainer.scrollLeft=u-(this.options.autoCenter?p:0));const f=u-n-p;if(t&&this.options.autoCenter&&f>0){const y=(s=this.audioData)===null||s===void 0?void 0:s.duration;if(y===void 0||y<=0)return void(this.scrollContainer.scrollLeft+=f);const v=a/y;this.scrollContainer.scrollLeft+=v<=600?Math.min(f,10):f}}}renderProgress(e,t){if(isNaN(e))return;const s=100*e;this.canvasWrapper.style.clipPath=`polygon(${s}% 0%, 100% 0%, 100% 100%, ${s}% 100%)`,this.progressWrapper.style.width=`${s}%`,this.cursor.style.left=`${s}%`,this.cursor.style.transform=this.options.cursorWidth?`translateX(-${e*this.options.cursorWidth}px)`:"",this.isScrollable&&this.options.autoScroll&&this.audioData&&this.audioData.duration>0&&this.scrollIntoView(e,t)}
83exportImage(e,t,s){return Ci(this,void 0,void 0,function*(){const n=this.canvasWrapper.querySelectorAll("canvas");if(!n.length)throw new Error("No waveform data");if(s==="dataURL"){const a=Array.from(n).map(l=>l.toDataURL(e,t));return Promise.resolve(a)}return Promise.all(Array.from(n).map(a=>new Promise((l,u)=>{a.toBlob(d=>{d?l(d):u(new Error("Could not export image"))},e,t)})))})}}class vM extends Uu{constructor(){super(...arguments),this.animationFrameId=null,this.isRunning=!1}start(){if(this.isRunning)return;this.isRunning=!0;const e=()=>{this.isRunning&&(this.emit("tick"),this.animationFrameId=requestAnimationFrame(e))};e()}stop(){this.isRunning=!1,this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stop(),this.unAll()}}class vp extends Uu{constructor(e){super(),this.bufferNode=null,this.playStartTime=0,this.playbackPosition=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this._destroyed=!1,function(){const t=globalThis.navigator;if(t!=null&&t.audioSession)try{t.audioSession.type="playback"}catch(s){console.warn("Setting navigator.audioSession.type failed:",s)}}(),this.audioContext=e||new AudioContext,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Ci(this,void 0,void 0,function*(){})}remove(){this.destroy()}destroy(){if(!this._destroyed){if(this._destroyed=!0,this.currentSrc="",this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch{}this.bufferNode.disconnect(),this.bufferNode=null}this.gainNode.disconnect(),typeof this.audioContext.close=="function"&&Promise.resolve(this.audioContext.close.call(this.audioContext)).catch(()=>{}),this.buffer=null,this.unAll()}}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then(t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()}).then(t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t)).then(t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())}).catch(t=>{console.error("WebAudioPlayer load error:",t)})}_play(){if(!this.paused)return;this.paused=!1,this.bufferNode&&(this.bufferNode.onended=null,this.bufferNode.disconnect()),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playbackPosition;(e>=this.duration||e<0)&&(e=0,this.playbackPosition=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{!this.paused&&this.duration-this.currentTime<.01&&(this.pause(),this.emit("ended"))}}_pause(){if(this.paused=!0,this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch{}}this.playbackPosition+=(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}play(){return Ci(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){const t=(e-this.currentTime)/this._playbackRate,s=this.bufferNode;s==null||s.stop(this.audioContext.currentTime+t),s==null||s.addEventListener("ended",()=>{s===this.bufferNode&&(this.bufferNode=null,this.pause(),this.playbackPosition=Math.min(e,this.duration),this.emit("timeupdate"))},{once:!0})}setSinkId(e){return Ci(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){return this._playbackRate}set playbackRate(e){const t=!this.paused;t&&this._pause(),this._playbackRate=e,t&&this._play(),this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return this.paused?this.playbackPosition:this.playbackPosition+(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playbackPosition=e,t&&this._play(),this.emit
83("seeking"),this.emit("timeupdate")}get duration(){var e,t;return(e=this._duration)!==null&&e!==void 0?e:((t=this.buffer)===null||t===void 0?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let s=0;s<t;s++)e.push(this.buffer.getChannelData(s));return e}removeAttribute(e){switch(e){case"src":this.src="";break;case"playbackRate":this.playbackRate=0;break;case"currentTime":this.currentTime=0;break;case"duration":this.duration=0;break;case"volume":this.volume=0;break;case"muted":this.muted=!1}}}const CM={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class $c extends fM{static create(e){return new $c(e)}getState(){return this.wavesurferState}getRenderer(){return this.renderer}constructor(e){const t=e.media||(e.backend==="WebAudio"?new vp:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this._isDestroyed=!1,this._loadVersion=0,this.reactiveCleanups=[],this.options=Object.assign({},CM,e);const{state:s,actions:n}=function(u){var d,h,p,f,y,v;const C=(d=u==null?void 0:u.currentTime)!==null&&d!==void 0?d:Mt(0),S=(h=u==null?void 0:u.duration)!==null&&h!==void 0?h:Mt(0),w=(p=u==null?void 0:u.isPlaying)!==null&&p!==void 0?p:Mt(!1),T=(f=u==null?void 0:u.isSeeking)!==null&&f!==void 0?f:Mt(!1),E=(y=u==null?void 0:u.volume)!==null&&y!==void 0?y:Mt(1),M=(v=u==null?void 0:u.playbackRate)!==null&&v!==void 0?v:Mt(1),x=Mt(null),P=Mt(null),R=Mt(""),_=Mt(0),$=Mt(0),G=la(()=>!w.value,[w]),q=la(()=>x.value!==null,[x]),F=la(()=>q.value&&S.value>0,[q,S]),H=la(()=>C.value,[C]),N=la(()=>S.value>0?C.value/S.value:0,[C,S]);return{state:{currentTime:C,duration:S,isPlaying:w,isPaused:G,isSeeking:T,volume:E,playbackRate:M,audioBuffer:x,peaks:P,url:R,zoom:_,scrollPosition:$,canPlay:q,isReady:F,progress:H,progressPercent:N},actions:{setCurrentTime:A=>{const W=Math.max(0,Math.min(S.value||1/0,A));C.set(W)},setDuration:A=>{S.set(Math.max(0,A))},setPlaying:A=>{w.set(A)},setSeeking:A=>{T.set(A)},setVolume:A=>{const W=Math.max(0,Math.min(1,A));E.set(W)},setPlaybackRate:A=>{const W=Math.max(.1,Math.min(16,A));M.set(W)},setAudioBuffer:A=>{x.set(A),A&&S.set(A.duration)},setPeaks:A=>{P.set(A)},setUrl:A=>{R.set(A)},setZoom:A=>{_.set(Math.max(0,A))},setScrollPosition:A=>{$.set(Math.max(0,A))}}}}({isPlaying:this.isPlayingSignal,currentTime:this.currentTimeSignal,duration:this.durationSignal,volume:this.volumeSignal,playbackRate:this.playbackRateSignal,isSeeking:this.seekingSignal});this.wavesurferState=s,this.wavesurferActions=n,this.timer=new vM;const a=t?void 0:this.getMediaElement();this.renderer=new bM(this.options,a),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initReactiveState(),this.initPlugins();const l=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:u,duration:d}=this.options;(l||u&&d)&&this.load(l,u,d).catch(()=>{})})}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const e=this.updateProgress();if(this.emit("timeupdate",e),this.emit("audioprocess",e),this.stopAtPosition!=null&&this.isPlaying()&&e>=this.stopAtPosition){const t=this.stopAtPosition;this.pause(),this.setTime(t)}}}))}initReactiveState(){this.reactiveCleanups.push(function(e,t){const s=[];
vendor: 2,108 bytes, line 83
83s.push(an(()=>{const l=e.isPlaying.value;t.emit(l?"play":"pause")},[e.isPlaying])),s.push(an(()=>{const l=e.currentTime.value;t.emit("timeupdate",l),e.isPlaying.value&&t.emit("audioprocess",l)},[e.currentTime,e.isPlaying])),s.push(an(()=>{e.isSeeking.value&&t.emit("seeking",e.currentTime.value)},[e.isSeeking,e.currentTime]));let n=!1;s.push(an(()=>{e.isReady.value&&!n&&(n=!0,t.emit("ready",e.duration.value))},[e.isReady,e.duration])),s.push(an(()=>{e.audioBuffer.value===null&&(n=!1)},[e.audioBuffer]));let a=!1;return s.push(an(()=>{const l=e.isPlaying.value,u=e.currentTime.value,d=e.duration.value,h=d>0&&u>=d;a&&!l&&h&&t.emit("finish"),a=l&&h},[e.isPlaying,e.currentTime,e.duration])),s.push(an(()=>{const l=e.zoom.value;l>0&&t.emit("zoom",l)},[e.zoom])),()=>{s.forEach(l=>l())}}(this.wavesurferState,{emit:this.emit.bind(this)}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.updateProgress();this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var e;this.emit("error",(e=this.getMediaElement().error)!==null&&e!==void 0?e:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t,s,n)=>{const a=this.getDuration();this.emit("scroll",e*a,t*a,s,n)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}
83),this.renderer.on("dragstart",e=>{this.emit("dragstart",e)}),this.renderer.on("dragend",e=>{this.emit("dragend",e)}),this.renderer.on("resize",()=>{this.emit("resize")}));{let e;const t=this.renderer.on("drag",s=>{var n;if(!this.options.interact)return;this.renderer.renderProgress(s),clearTimeout(e);let a=0;const l=this.options.dragToSeek;this.isPlaying()?a=0:l===!0?a=200:l&&typeof l=="object"&&(a=(n=l.debounceTime)!==null&&n!==void 0?n:200),e=setTimeout(()=>{this.seekTo(s)},a),this.emit("interaction",s*this.getDuration()),this.emit("drag",s)});this.subscriptions.push(()=>{clearTimeout(e),t()})}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),e.duration&&!e.peaks&&(this.decodedData=id.createBuffer(this.exportPeaks(),e.duration)),e.peaks&&e.duration&&(this.decodedData=id.createBuffer(e.peaks,e.duration)),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){if(this.plugins.includes(e))return e;e._init(this),this.plugins.push(e);const t=e.once("destroy",()=>{this.plugins=this.plugins.filter(s=>s!==e),this.subscriptions=this.subscriptions.filter(s=>s!==t)});return this.subscriptions.push(t),e}unregisterPlugin(e){this.plugins=this.plugins.filter(t=>t!==e),e.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,s,n){return Ci(this,void 0,void 0,function*(){var a;const l=++this._loadVersion;if(this._isDestroyed=!1,this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,(a=this.abortController)===null||a===void 0||a.abort(),this.abortController=null,!t&&!s){const d=this.options.fetchParams||{};window.AbortController&&!d.signal&&(this.abortController=new AbortController,d.signal=this.abortController.signal);const h=f=>this.emit("loading",f);if(t=yield pM.fetchBlob(e,h,d),this._isDestroyed||l!==this._loadVersion)return;const p=this.options.blobMimeType;p&&(t=new Blob([t],{type:p}))}if(this._isDestroyed||l!==this._loadVersion)return;this.setSrc(e,t);const u=yield new Promise(d=>{const h=n||this.getDuration();h?d(h):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>d(this.getDuration()),{once:!0}))});if(!this._isDestroyed&&l===this._loadVersion){if(!e&&!t){const d=this.getMediaElement();d instanceof vp&&(d.duration=u)}if(s)this.decodedData=id.createBuffer(s,u||0);else if(t){const d=yield t.arrayBuffer();if(this._isDestroyed||l!==this._loadVersion)return;this.decodedData=yield id.decode(d,this.options.sampleRate)}this._isDestroyed||l!==this._loadVersion||(this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration()))}})}load(e,t,s){return Ci(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,s)}catch(n){throw this.emit("error",n),n}})}loadBlob(e,t,s){return Ci(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,s)}catch(n){throw this.emit("error",n),n}})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:s=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const n=Math.min(e,this.decodedData.numberOfChannels),a=[];for(let l=0;l<n;l++){const u=this.decodedData.getChannelData(l),d=[],h=u.length/t;for(let p=0;p<t;p++){const f=u.slice(Math.floor(p*h),Math.ceil((p+1)*h));let y=0;for(let v=0;v<f.length;v++){const C=f[v];Math.abs(C)>Math.abs(y)&&(y=C)}d.push(Math.round(y*s)/s)}a.push(d)}return a}getDuration(){let e=super.getDuration()||0;return e!==0&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){this.stopAtPosition=null,super.setTime(e),this.updateProgress(e),this.emit
83("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}play(e,t){const s=Object.create(null,{play:{get:()=>super.play}});return Ci(this,void 0,void 0,function*(){e!=null&&this.setTime(e);const n=yield s.play.call(this);return t!=null&&(this.media instanceof vp?this.media.stopAt(t):this.stopAtPosition=t),n})}playPause(){return Ci(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Ci(this,arguments,void 0,function*(e="image/png",t=1,s="dataURL"){return this.renderer.exportImage(e,t,s)})}destroy(){var e;this._isDestroyed=!0,this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.reactiveCleanups.forEach(t=>t()),this.reactiveCleanups=[],this.timer.destroy(),this.renderer.destroy(),super.destroy()}}$c.BasePlugin=class extends Uu{constructor(i){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=i}onInit(){}
83_init(i){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=i,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(i=>i()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}},$c.dom=hM;function Cp(i,e,t,s){return new(t||(t=Promise))(function(n,a){function l(h){try{d(s.next(h))}catch(p){a(p)}}function u(h){try{d(s.throw(h))}catch(p){a(p)}}function d(h){var p;h.done?n(h.value):(p=h.value,p instanceof t?p:new t(function(f){f(p)})).then(l,u)}d((s=s.apply(i,[])).next())})}class FC{constructor(){this.listeners={}}on(e,t,s){if(this.listeners[e]||(this.listeners[e]=new Set),s==null?void 0:s.once){const n=(...a)=>{this.un(e,n),t(...a)};return this.listeners[e].add(n),()=>this.un(e,n)}return this.listeners[e].add(t),()=>this.un(e,t)}un(e,t){var s;(s=this.listeners[e])===null||s===void 0||s.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(s=>s(...t))}}class SM extends FC{constructor(e){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=e}onInit(){}_init(e){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(e=>e()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}class wM extends FC{constructor(){super(...arguments),this.animationFrameId=null,this.isRunning=!1}start(){if(this.isRunning)return;this.isRunning=!0;const e=()=>
83{this.isRunning&&(this.emit("tick"),this.animationFrameId=requestAnimationFrame(e))};e()}stop(){this.isRunning=!1,this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stop(),this.unAll()}}const Sp=100,xM=["audio/webm","audio/wav","audio/mpeg","audio/mp4","audio/mp3"];class P3 extends SM{constructor(e){var t,s,n,a,l,u;super(Object.assign(Object.assign({},e),{audioBitsPerSecond:(t=e.audioBitsPerSecond)!==null&&t!==void 0?t:128e3,scrollingWaveform:(s=e.scrollingWaveform)!==null&&s!==void 0&&s,scrollingWaveformWindow:(n=e.scrollingWaveformWindow)!==null&&n!==void 0?n:5,continuousWaveform:(a=e.continuousWaveform)!==null&&a!==void 0&&a,renderRecordedAudio:(l=e.renderRecordedAudio)===null||l===void 0||l,mediaRecorderTimeslice:(u=e.mediaRecorderTimeslice)!==null&&u!==void 0?u:void 0})),this.stream=null,this.mediaRecorder=null,this.dataWindow=null,this.isWaveformPaused=!1,this.lastStartTime=0,this.lastDuration=0,this.duration=0,this.micStream=null,this.recordedBlobUrl=null,this.timer=new wM,this.subscriptions.push(this.timer.on("tick",()=>{const d=performance.now()-this.lastStartTime;this.duration=this.isPaused()?this.duration:this.lastDuration+d,this.emit("record-progress",this.duration)}))}static create(e){return new P3(e||{})}renderMicStream(e){var t;const s=new AudioContext,n=s.createMediaStreamSource(e),a=s.createAnalyser();n.connect(a),(this.options.continuousWaveform||this.options.scrollingWaveform)&&(a.fftSize=32);const l=a.frequencyBinCount,u=new Float32Array(l);let d=0;this.wavesurfer&&((t=this.originalOptions)!==null&&t!==void 0||(this.originalOptions=Object.assign({},this.wavesurfer.options)),this.wavesurfer.options.interact=!1,this.options.scrollingWaveform&&(this.wavesurfer.options.cursorWidth=0,this.wavesurfer.options.normalize=!0,this.wavesurfer.options.maxPeak=1));const h=setInterval(()=>{var p,f,y,v;if(!this.isWaveformPaused){if(a.getFloatTimeDomainData(u),this.options.scrollingWaveform){const C=Math.floor((this.options.scrollingWaveformWindow||0)*Sp);let S=0;for(let T=0;T<l;T++){const E=Math.abs(u[T]);E>S&&(S=E)}this.dataWindow||(this.dataWindow=new Float32Array(C));const w=new Float32Array(C);if(this.dataWindow&&this.dataWindow.length>0){const T=C-1,E=this.dataWindow.slice(-T);w.set(E,0)}w[C-1]=S,this.dataWindow=w}else if(this.options.continuousWaveform){if(!this.dataWindow){const S=this.options.continuousWaveformDuration?Math.round(this.options.continuousWaveformDuration*Sp):((f=(p=this.wavesurfer)===null||p===void 0?void 0:p.getWidth())!==null&&f!==void 0?f:0)*window.devicePixelRatio;this.dataWindow=new Float32Array(S)}let C=0;for(let S=0;S<l;S++){const w=Math.abs(u[S]);w>C&&(C=w)}if(d+1>this.dataWindow.length){const S=new Float32Array(2*this.dataWindow.length);S.set(this.dataWindow,0),this.dataWindow=S}this.dataWindow[d]=C,d++}else this.dataWindow=u;if(this.wavesurfer){const C=((v=(y=this.dataWindow)===null||y===void 0?void 0:y.length)!==null&&v!==void 0?v:0)/Sp;this.wavesurfer.load("",[this.dataWindow],this.options.scrollingWaveform?this.options.scrollingWaveformWindow:C).then(()=>{this.wavesurfer&&this.options.continuousWaveform&&(this.wavesurfer.setTime(this.getDuration()/1e3),this.wavesurfer.options.minPxPerSec||this.wavesurfer.setOptions({minPxPerSec:this.wavesurfer.getWidth()/this.wavesurfer.getDuration()}))}).catch(S=>{console.error("Error rendering real-time recording data:",S)})}}},10);return{onDestroy:()=>{clearInterval(h),n==null||n.disconnect(),s==null||s.close()},onEnd:()=>{this.isWaveformPaused=!0,this.stopMic()}}}startMic(e){return Cp(this,void 0,void 0,function*(){let t;this.micStream&&this.stopMic();try{t=yield navigator.mediaDevices.getUserMedia({audio:e==null||e})}catch(n){throw new Error("Error accessing the microphone: "+n.message)}const s=this.renderMicStream(t);return this.micStream=s,this.unsubscribeDestroy=this.once("destroy",s.onDestroy),this.unsubscribeRecordEnd=this.once("record-end",s.onEnd),this.stream=t,t})}stopMic(){var e,t,s;(e=this.micStream)===null||e===void 0||e.onDestroy(),(t=this.unsubscribeDestroy)===null||t===void 0||t.call(this),(s=this.unsubscribeRecordEnd)===null||s===void 0||s.call(this),this.micStream
83=null,this.unsubscribeDestroy=void 0,this.unsubscribeRecordEnd=void 0,this.stream&&(this.stream.getTracks().forEach(n=>n.stop()),this.stream=null,this.mediaRecorder=null)}startRecording(e){return Cp(this,void 0,void 0,function*(){const t=this.stream||(yield this.startMic(e));this.dataWindow=null;const s=this.mediaRecorder||new MediaRecorder(t,{mimeType:this.options.mimeType||xM.find(l=>MediaRecorder.isTypeSupported(l)),audioBitsPerSecond:this.options.audioBitsPerSecond});this.mediaRecorder=s,this.stopRecording();const n=[];s.ondataavailable=l=>{l.data.size>0&&n.push(l.data),this.emit("record-data-available",l.data)};const a=l=>{var u;const d=new Blob(n,{type:s.mimeType});this.emit(l,d),this.options.renderRecordedAudio&&(this.applyOriginalOptionsIfNeeded(),this.recordedBlobUrl&&URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=URL.createObjectURL(d),(u=this.wavesurfer)===null||u===void 0||u.load(this.recordedBlobUrl))};s.onpause=()=>a("record-pause"),s.onstop=()=>a("record-end"),s.start(this.options.mediaRecorderTimeslice),this.lastStartTime=performance.now(),this.lastDuration=0,this.duration=0,this.isWaveformPaused=!1,this.timer.start(),this.emit("record-start")})}getDuration(){return this.duration}isRecording(){var e;return((e=this.mediaRecorder)===null||e===void 0?void 0:e.state)==="recording"}isPaused(){var e;return((e=this.mediaRecorder)===null||e===void 0?void 0:e.state)==="paused"}isActive(){var e;return((e=this.mediaRecorder)===null||e===void 0?void 0:e.state)!=="inactive"}stopRecording(){var e;this.isActive()&&((e=this.mediaRecorder)===null||e===void 0||e.stop(),this.timer.stop())}pauseRecording(){var e,t;this.isRecording()&&(this.isWaveformPaused=!0,(e=this.mediaRecorder)===null||e===void 0||e.requestData(),(t=this.mediaRecorder)===null||t===void 0||t.pause(),this.timer.stop(),this.lastDuration=this.duration)}resumeRecording(){var e;this.isPaused()&&(this.isWaveformPaused=!1,(e=this.mediaRecorder)===null||e===void 0||e.resume(),this.timer.start(),this.lastStartTime=performance.now(),this.emit("record-resume"))}static getAvailableAudioDevices(){return Cp(this,void 0,void 0,function*(){return navigator.mediaDevices.enumerateDevices().then(e=>e.filter(t=>t.kind==="audioinput"))})}destroy(){this.applyOriginalOptionsIfNeeded(),super.destroy(),this.stopRecording(),this.stopMic(),this.recordedBlobUrl&&(URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=null)}applyOriginalOptionsIfNeeded(){this.wavesurfer&&this.originalOptions&&(this.wavesurfer.setOptions(this.originalOptions),delete this.originalOptions)}}const EM=180,TM=["audio/mp4","audio/webm;codecs=opus","audio/webm"];function kM(i){return TM.find(e=>{try{return!!i(e)}catch{return!1}})??""}function $M(i){return i.startsWith("audio/mp4")?"m4a":"webm"}function PM(i,e=new Date){const t=n=>String(n).padStart(2,"0");return`voice-${`${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}${t(e.getSeconds())}`}.${$M(i)}`}function MM(i){const e=Math.max(0,Math.floor(i)),t=Math.floor(e/60),s=e%60;return`${t}:${String(s).padStart(2,"0")}`}function WC({onSend:i,onCancel:e,onRecordingPing:t,sending:s,mobile:n}){const a=mo(),l=n?24:18,u=c.useRef(null),d=c.useRef(null),h=c.useRef(null),p=c.useRef(null),f=c.useRef("discard"),[y,v]=c.useState("recording"),[C,S]=c.useState(!1),[w,T]=c.useState(0),[E,M]=c.useState(!1),[x,P]=c.useState(!1),R=c.useRef(i),_=c.useRef(e),$=c.useRef(t);c.useEffect(()=>{R.current=i,_.current=e,$.current=t}),c.useEffect(()=>{const N=$c.create({container:u.current,height:32,waveColor:a.palette.primary.main,progressColor:a.palette.primary.dark,barWidth:2,barGap:2,barRadius:2,cursorWidth:0,interact:!1});d.current=N;const A=kM(V=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(V)),W=N.registerPlugin(P3.create({scrollingWaveform:!0,renderRecordedAudio:!0,...A?{mimeType:A}:{}}));return h.current=W,W.on("record-progress",V=>{T(V/1e3),V>=EM*1e3&&W.isRecording()&&(f.current="preview",W.stopRecording())}),W.on("record-end",V=>{var re;P(!1);const K=f.current;f.current="discard",!(!V||V.size===0)&&(K==="send"?(re=R.current)==null||re.call(R,V):K==="preview"&&(p.current=V,v("preview")))}),N.on("play",()=>S(!0)),N.on("pause",()=>S(!1)),N.on("finish",()=>S(!1)),W.startRecording().then(()=>P(!0)).catch(()=>{M(!0)}),()=>{f.current="discard";try{W.isRecording()&&W.stopRecording()}catch{}N.destroy()}},[]),c.useEffect(()=>{var A;if(!x)return;(A=$.current)==null||A.call($);const N=setInterval(()=>{var W;return(W=$.current)==null?void 0:W.call($)},3e3);return()=>clearInterval(N)},[x]);const G=N=>{f.current=N;try{const A=h.current;A!=null&&A.isRecording()&&A.stopRecording()}catch{}},q=()=>{var N;G("discard"),(N=_.current)==null||N.call(_)},F=()=>{var N,A;if(y==="preview"){(N=d.current)==null||N.pause(),p.current&&((A=R.current)==null||A.call(R,p.current));return}G("send")};return B(Be,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0},children:[m(Nt,{onClick:q,"aria-label":"Discard recording",disabled:s,children:m(We,{icon:Wd,style:{fontSize:l}})}),E?m(te,{variant:"body2",sx:{flexGrow:1,color:"text.secondary"},children:"Microphone unavailable. Check the browser permission and try again."}):B(fi,{children:[y==="recording"?m(U,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"error.main",flexShrink:0,"@keyframes voicePulse":{"0%, 100%":{opacity:1},"50%":{opacity:.35}},animation:"voicePulse 1.4s infinite ease-in-out"}}):m(Nt,{onClick:()=>{const N=d.current;N&&(N.setOptions({interact:!0,dragToSeek:!0,cursorWidth:1}),N.playPause())},"aria-label":C?"Pause playback":"Play recording",disabled:s,children:m(We,{icon:C?_3:bS,style:{fontSize:l}})}),m(te,{variant:"body2",sx:{fontVariantNumeric:"tabular-nums",flexShrink:0},children:MM(w)}),m(U,{ref:u,sx:{flexGrow:1,minWidth:0}}),y==="recording"&&m(Nt,{onClick:()=>G("preview"),"aria-label":"Pause and review recording",children:m(We,{icon:_3,style:{fontSize:l}})})]}),m(Nt,{color:"primary",onClick:F,"aria-label":"Send voice message",disabled:s||E,children:s?m(Gn,{size:l}):m(We,{icon:D6,style:{fontSize:l}})})]})}WC.propTypes={onSend:k.func.isRequired,onCancel:k.func.isRequired,onRecordingPing:k.func,sending:k.bool,mobile:k.bool};const RM=c.lazy(()=>mi(()=>import("./emoji-picker-react.esm-CYiWzIVX.js"),__vite__mapDeps([138,2]))),HC=[{type:"video",label:"Videos",description:"Share video clips",icon:wc},{type:"image",label:"Images",description:"Share images",icon:Eh},{type:"audio",label:"Audio",description:"Share audio clips",icon:_6}],jC=[{type:"photo",label:"Photo",description:"Upload a photo from your device",icon:Eh},{type:"video_device",label:"Video",description:"Upload a video from your device",icon:wc},{type:"media_library",label:"Media Library",description:"Share a video, image or audio clip",icon:wc},{type:"create_poll",label:"Poll",description:"Ask the team to vote",icon:CS},{type:"share_event",label:"Event",description:"Share a calendar event",icon:L6},...$w.filter(i=>i.type!=="text")],nh=Object.fromEntries([...jC,...HC].map(i=>[i.type,i.icon]));nh.drill=nh.play;nh.event=L6;const AM={fontSize:16,width:18};function GC({conversationId:i,mobile:e,myId:t,composer:s}
83){const n=mo(),{draft:a,replyTo:l,pendingLinks:u,pendingPreviewsRef:d,inputRef:h,uploadRequest:p,requestUpload:f,clearUploadRequest:y,setDraft:v,cancelReply:C,addLinks:S,addUploadedAttachment:w,removeLink:T,insertEmoji:E,send:M}=s,x=vS(),P=x("player_plays"),R=x("player_drills"),_={playbook:"player_playbooks",rotation:"player_rotations",practice_plan:"player_practice_plans",media_library:"player_uploads",share_event:"player_calendar"},$=jC.flatMap(L=>{if(L.type==="play")return!P&&!R?[]:P?R?[L]:[{...L,description:"Add plays"}]:[{...L,type:"drill",label:"Drills",description:"Add drills"}];const ye=_[L.type];return ye==null||x(ye)?[L]:[]}),[G,q]=c.useState(null),[F,H]=c.useState(null),[N,A]=c.useState(null),[W,V]=c.useState(!1),[K,re]=c.useState(!1),[oe,Z]=c.useState(!1),[fe,me]=c.useState(!1),[Q,j]=c.useState(null),X=c.useRef(null),Te=c.useRef("image"),Ce=c.useRef(0),Ie=L=>{if(!i||!L.trim())return;const ye=Date.now();ye-Ce.current<3500||(Ce.current=ye,N3(i))},ge=()=>{i&&N3(i,"recording")},Re=L=>ye=>S(sx(L,ye)),Se=L=>ye=>S(nx(L,ye)),Ve=async L=>{me(!0),j(null);try{const ye=L.type||"audio/webm",ne=new File([L],PM(ye),{type:ye});s.sendVoiceMessage(ig(ne,"audio")),Z(!1)}catch{j("Couldn't send the voice message. Please try again."),Z(!1)}finally{me(!1)}};return B(fi,{children:[u.length>0&&m(Be,{direction:"row",spacing:.75,sx:{px:2.5,pt:1,flexWrap:"wrap",rowGap:.75,borderTop:"1px solid",borderColor:"divider"},children:u.map(L=>{if(L.type==="media"&&(L.kind==="image"||L.kind==="video")){const ne=d.current[L.entity_id];return B(U,{sx:{position:"relative",width:64,height:64,borderRadius:1,overflow:"hidden",bgcolor:"grey.900",flexShrink:0},children:[L.kind==="image"?m(U,{component:"img",src:ne??`https://thg-images.b-cdn.net/${L.file_path}`,alt:L.title,sx:{width:"100%",height:"100%",objectFit:"cover"}}):ne?m(U,{component:"video",src:`${ne}#t=0.1`,muted:!0,playsInline:!0,preload:"metadata",sx:{width:"100%",height:"100%",objectFit:"cover"}}):m(U,{sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"grey.500"},children:m(We,{icon:wc})}),L.kind==="video"&&m(U,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"common.white",pointerEvents:"none"},children:m(We,{icon:Q6,style:{fontSize:14}})}),m(Nt,{size:"small",onClick:()=>T(L),"aria-label":`Remove ${L.title||"attachment"}`,sx:{position:"absolute",top:2,right:2,p:.25,color:"common.white",bgcolor:"rgba(0,0,0,0.55)","&:hover":{bgcolor:"rgba(0,0,0,0.75)"}},children:m(We,{icon:Wd,style:{fontSize:12}})})]},`${L.type}:${L.entity_id}`)}return m(H6,{size:"small",icon:m(We,{icon:nh[L.type]||wc,style:{fontSize:12}}),label:L.title||k3[L.type]||"Attachment",onDelete:()=>T(L)},`${L.type}:${L.entity_id}`)})}),l&&B(Be,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,pt:1,...u.length===0&&{borderTop:"1px solid",borderColor:"divider"}},children:[B(U,{sx:{flexGrow:1,minWidth:0,borderLeft:3,borderColor:ao(l.sender_user_id),bgcolor:L=>
83Ai(L.palette.mode==="dark"?"#ffffff":"#000000",L.palette.mode==="dark"?.08:.04),borderRadius:1,px:1,py:.5},children:[m(te,{variant:"caption",noWrap:!0,sx:{display:"block",fontWeight:700,color:ao(l.sender_user_id)},children:l.sender_user_id===t?"You":l.sender_name??"Former member"}),m(te,{variant:"caption",noWrap:!0,sx:{display:"block",color:"text.secondary"},children:l.deleted?"Message deleted":l.body||"Shared content"})]}),m(Nt,{size:"small",onClick:C,"aria-label":"Cancel reply",children:m(We,{icon:Wd,style:{fontSize:16}})})]}),Q&&m(te,{variant:"caption",color:"error",sx:{px:2,pt:1,display:"block"},children:Q}),m(Be,{direction:"row",alignItems:"flex-end",spacing:1.5,sx:{py:1.5,px:2,...u.length===0&&!l&&{borderTop:"1px solid",borderColor:"divider"}},children:oe?m(WC,{onSend:Ve,onCancel:()=>Z(!1),onRecordingPing:ge,sending:fe,mobile:e}):B(fi,{children:[m(Vl,{title:"Share plays, playbooks & more",children:m(Nt,{"aria-label":"Attach content",color:F||N?"primary":"default",onClick:L=>H(L.currentTarget),onMouseDown:L=>L.preventDefault(),disabled:u.length>=Ro,children:m(We,{icon:SS,style:{fontSize:e?24:18}})})}),m(Lw,{anchorEl:F,onClose:()=>H(null),options:$,onSelect:L=>{if(H(null),L==="photo"||L==="video_device"){const ye=L==="video_device"?"video":"image";Te.current=ye;const ne=X.current;ne&&(ne.accept=ye==="video"?"video/*":"image/*",ne.value="",ne.click());return}if(L==="media_library"){V(!0);return}if(L==="create_poll"){re(!0);return}A(L)}}),B(fo,{open:W,onClose:()=>V(!1),fullWidth:!0,maxWidth:"xs",children:[m(Au,{children:"Media library"}),m(Ul,{sx:{px:1,pb:2},children:HC.map(L=>B(Hr,{onClick:()=>{V(!1),A(L.type)},sx:{borderRadius:1.5,py:1.25,gap:1.5},children:[m(We,{icon:L.icon,style:AM}),B(U,{sx:{minWidth:0},children:[m(te,{variant:"body2",sx:{fontWeight:600},children:L.label}),m(te,{variant:"caption",sx:{color:"text.secondary"},children:L.description})]})]},L.type))})]}),m("input",{ref:X,type:"file",multiple:!0,hidden:!0,onChange:L=>{const ye=Array.from(L.target.files??[]);L.target.value="",f(Te.current,ye)}}),K&&m(NC,{onSend:s.sendPoll,onClose:()=>re(!1)}),p&&m(LC,{kind:p.kind,files:p.files,maxFiles:Ro-u.length,onUploaded:w,onClose:y}),m(Wr,{inputRef:h,value:a,onChange:L=>{v(L.target.value),Ie(L.target.value)},onKeyDown:L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),M())},onPaste:L=>{var ne;const ye=tg((ne=L.clipboardData)==null?void 0:ne.files);ye&&u.length<Ro&&(L.preventDefault(),f(ye.kind,ye.files))},multiline:!0,maxRows:6,fullWidth:!0,size:"small",slotProps:{htmlInput:{maxLength:2e3}}}),m(Nt,{"aria-label":"Insert emoji",color:G?"primary":"default",onClick:L=>q(L.currentTarget),onMouseDown:L=>L.preventDefault(),sx:{ml:1,"@media (hover: none)":{display:"none"}},children:m(We,{icon:N6,style:{fontSize:e?24:18}})}),m(yc,{open:!!G,anchorEl:G,onClose:()=>q(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,children:m(c.Suspense,{fallback:m(U,{sx:{width:320,height:400,display:"flex",alignItems:"center",justifyContent:"center"},children:m(Gn,{size:24})}),children:m(RM,{onEmojiClick:L=>E(L.emoji),theme:n.palette.mode==="dark"?"dark":"light",emojiStyle:"native",width:320,height:400,lazyLoadEmojis:!0,previewConfig:{showPreview:!1},searchPlaceholder:"Search emoji"})})}),!a.trim()&&u.length===0?m(Vl,{title:"Record a voice message",children:m(Nt,{color:"primary",onClick:()=>{j(null),Z(!0)},onMouseDown:L=>L.preventDefault(),"aria-label":"Record a voice message",children:m(We,{icon:O6,style:{fontSize:e?24:18,width:e?24:18,height:e?24:18}})})}):m(Nt,{color:"primary",onClick:M,onMouseDown:L=>L.preventDefault(),"aria-label":"Send message",children:m(We,{icon:D6,style:{fontSize:e?24:18}})})]})}),(N==="play"||N==="drill")&&m(qw,{open:!0,close:()=>A(null),tab:N,addNewPlayWithData:Re(N)}),N==="playbook"&&m(Fw,{open:!0,close:()=>A(null),onSelectWithData:Re("playbook")}),N==="rotation"&&m(Ww,{open:!0,close:()=>A(null),onSelectWithData:Re("rotation")}),N==="practice_plan"&&m(Hw,{open:!0,close:()=>A(null),onSelectWithData:Re("practice_plan")}),N==="video"&&m(jw,{open:!0,close:()=>A(null),addNewVideo:Se("video")}),N==="image"&&m(Gw,{open:!0,close:()=>A(null),addNewImage:Se("image")}),N==="audio"&&m(zw,{open:!0,close:()=>A(null),addNewFile:Se("audio")}),N==="share_event"&&m(DC,{onSelect:L=>S([{type:"event",entity_id:L.event_id,title:L.title}]),onClose:()=>A(null)})]})}GC.propTypes={conversationId:k.number,mobile:k.bool,myId:k.number,composer:k.object.isRequired};function zC(i,e,t){return i?(e??[]).filter(s=>s.user_id!==t&&s.last_read_message_id>=i).sort((s,n)=>(n.updated_at??"").localeCompare(s.updated_at??"")):[]}function IM(i,e){const t=new Date(i),s=new Date(e);return t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function _M(i,e){const t=new Date(i),s=new Date(e),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),a=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime();return Math.round((a-n)/864e5)}function DM(i,e){const t=_M(i,e);if(t===0)return"Today";if(t===1)return"Yesterday";const s=new Date(i),n=s.getFullYear()===new Date(e).getFullYear();return s.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",...n?{}:{year:"numeric"}})}function UC(i){const e=ct.c(15),{poll:t,anchorEl:s,onClose:n}=i;let a,l,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={vertical:"top",horizontal:"center"},l={vertical:"bottom",horizontal:"center"},u={paper:{sx:{width:300,maxHeight:400,overflowY:"auto",p:2.5,borderRadius:2}}},e[0]=a,e[1]=l,e[2]=u):(a=e[0],l=e[1],u=e[2]);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={mb:2},e[3]=d):d=e[3];let h;e[4]!==t.question?(h=m(te,{variant:"subtitle1",sx:d,children:t.question}),e[4]=t.question,e[5]=h):h=e[5];let p;
83e[6]!==t.options?(p=t.options.map(LM),e[6]=t.options,e[7]=p):p=e[7];let f;e[8]!==p?(f=m(Be,{spacing:2.5,children:p}),e[8]=p,e[9]=f):f=e[9];let y;return e[10]!==s||e[11]!==n||e[12]!==h||e[13]!==f?(y=B(yc,{open:!0,anchorEl:s,onClose:n,anchorOrigin:a,transformOrigin:l,slotProps:u,children:[h,f]}),e[10]=s,e[11]=n,e[12]=h,e[13]=f,e[14]=y):y=e[14],y}function LM(i){return B(U,{children:[B(Be,{direction:"row",justifyContent:"space-between",alignItems:"baseline",spacing:1,sx:{mb:1},children:[m(te,{variant:"subtitle2",sx:{minWidth:0,overflowWrap:"anywhere"},children:i.label}),m(te,{variant:"caption",sx:{color:"text.secondary",flexShrink:0},children:i.votes===1?"1 vote":`${i.votes} votes`})]}),i.voters.length===0?m(te,{variant:"body2",sx:{color:"text.disabled"},children:"No votes yet"}):m(Be,{spacing:1.25,children:i.voters.map(NM)})]},i.option_id)}function NM(i,e){return B(Be,{direction:"row",spacing:1.25,alignItems:"center",children:[m(js,{src:i.picture||void 0,sx:{width:28,height:28},children:(i.name||"?").charAt(0)}),m(te,{variant:"body2",noWrap:!0,children:i.name})]},i.user_id??e)}UC.propTypes={poll:k.object.isRequired,anchorEl:k.object,onClose:k.func.isRequired};function KC(i){const e=ct.c(74),{poll:t,own:s,canClose:n,disabled:a,onVote:l,onClose:u}=i,d=a===void 0?!1:a,h=mo(),[p,f]=c.useState(null),y=d||t.closed;let v;e[0]!==h.palette.primary.contrastText||e[1]!==s?(v=s?Ai(h.palette.primary.contrastText,.7):"text.secondary",e[0]=h.palette.primary.contrastText,e[1]=s,e[2]=v):v=e[2];const C=v;let S;e[3]!==h.palette.primary.contrastText||e[4]!==h.palette.primary.main||e[5]!==s?(S=s?Ai(h.palette.primary.contrastText,.35):Ai(h.palette.primary.main,.3),e[3]=h.palette.primary.contrastText,e[4]=h.palette.primary.main,e[5]=s,e[6]=S):S=e[6];const w=S;let T;e[7]!==h.palette.divider||e[8]!==h.palette.primary.contrastText||e[9]!==s?(T=s?Ai(h.palette.primary.contrastText,.4):h.palette.divider,e[7]=h.palette.divider,e[8]=h.palette.primary.contrastText,e[9]=s,e[10]=T):T=e[10];const E=T;let M;e[11]!==y||e[12]!==l||e[13]!==t.multi_choice||e[14]!==t.options?(M=j=>{if(!y)if(t.multi_choice){const X=new Set(t.options.filter(BM).map(VM));X.has(j.option_id)?X.delete(j.option_id):X.add(j.option_id),l([...X])}else l(j.voted?[]:[j.option_id])},e[11]=y,e[12]=l,e[13]=t.multi_choice,e[14]=t.options,e[15]=M):M=e[15];const x=M,P=t.closes_at?new Date(`${t.closes_at.replace(" ","T")}Z`).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={minWidth:{xs:200,sm:260},maxWidth:360,pt:1},e[16]=R):R=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_={mb:.25,lineHeight:1.3},e[17]=_):_=e[17];let $;e[18]!==t.question?($=m(te,{variant:"subtitle1",sx:_,children:t.question}),e[18]=t.question,e[19]=$):$=e[19];let G;e[20]!==C?(G={color:C,display:"block",mb:1},e[20]=C,e[21]=G):G=e[21];const q=t.closed?"Final results":t.multi_choice?"Select one or more":"Select one";let F;e[22]!==q||e[23]!==G?(F=m(te,{variant:"caption",sx:G,children:q}),e[22]=q,e[23]=G,e[24]=F):F=e[24];let H;if(e[25]!==w||e[26]!==y||e[27]!==C||e[28]!==t.multi_choice||e[29]!==t.options||e[30]!==t.total_voters||e[31]!==E||e[32]!==x){let j;e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==t.multi_choice||e[38]!==t.total_voters||e[39]!==E||e[40]!==x?(j=X=>{const Te=t.total_voters>0?X.votes/t.total_voters:0,Ce=t.multi_choice?X.voted?wS:xS:X.voted?ES:TS;return B(Iu,{onClick:()=>x(X),disabled:y,"aria-pressed":X.voted,sx:{display:"block",textAlign:"left",borderRadius:1,border:"1px solid",borderColor:E,px:1.25,py:.75,position:"relative",overflow:"hidden",width:"100%",...y?{}:{cursor:"pointer"}},children:[m(U,{sx:{position:"absolute",inset:0,width:`${Math.round(Te*100)}%`,bgcolor:w,transition:"width 0.25s ease"}}),B(Be,{direction:"row",alignItems:"center",spacing:1,sx:{position:"relative"},children:[m(We,{icon:Ce,style:{fontSize:14,flexShrink:0}}),m(te,{variant:"body2",sx:{flexGrow:1,minWidth:0,overflowWrap:"anywhere"},children:X.label}),m(Vl,{title:X.voters.length>0?X.voters.map(OM).join(", "):"",placement:"top",children:m(te,{variant:"caption",sx:{color:C,flexShrink:0,fontWeight:600},children:X.votes})})]})]},X.option_id)},e[34]=w,e[35]=y,e[36]=C,e[37]=t.multi_choice,e[38]=t.total_voters,e[39]=E,e[40]=x,e[41]=j):j=e[41],H=t.options.map(j),e[25]=w,e[26]=y,e[27]=C,e[28]=t.multi_choice,e[29]=t.options,e[30]=t.total_voters,e[31]=E,e[32]=x,e[33]=H}else H=e[33];let N;e[42]!==H?(N=m(Be,{spacing:.75,children:H}),e[42]=H,e[43]=N):N=e[43];let A;e[44]===Symbol.for("react.memo_cache_sentinel")?(A={mt:1},e[44]=A):A=e[44];let W;e[45]!==C?(W={color:C},e[45]=C,e[46]=W):W=e[46];const V=t.total_voters===1?"1 vote":`${t.total_voters} votes`,K=!t.closed&&P?` · closes ${P}`:"";let re;e[47]!==W||e[48]!==V||e[49]!==K?(re=B(te,{variant:"caption",sx:W,children:[V,K]}),e[47]=W,e[48]=V,e[49]=K,e[50]=re):re=e[50];let oe;e[51]!==n||e[52]!==d||e[53]!==u||e[54]!==s||e[55]!==t.closed?(oe=n&&!t.closed&&!d&&m(xc,{component:"button",type:"button",variant:"body2",onClick:u,sx:{color:s?"inherit":void 0,fontWeight:600},children:"End poll"}),e[51]=n,e[52]=d,e[53]=u,e[54]=s,e[55]=t.closed,e[56]=oe):oe=e[56];let Z;e[57]!==re||e[58]!==oe?(Z=B(Be,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:A,children:[re,oe]}),e[57]=re,e[58]=oe,e[59]=Z):Z=e[59];let fe;e[60]!==s||e[61]!==t.total_voters||e[62]!==E?(fe=t.total_voters>0&&m(U,{sx:{mt:1,pt:1,borderTop:"1px solid",borderColor:E,textAlign:"center"},children:m(xc,{component:"button",type:"button",variant:"body2",onClick:j=>f(j.currentTarget),sx:{color:s?"inherit":void 0,fontWeight:600},children:"View votes"})}),e[60]=s,e[61]=t.total_voters,e[62]=E,e[63]=fe):fe=e[63];let me;e[64]!==t||e[65]!==p?(me=p&&m(UC,{poll:t,anchorEl:p,onClose:()=>f(null)}),e[64]=t,e[65]=p,e[66]=me):me=e[66];let Q;return e[67]!==F||e[68]!==N||e[69]!==Z||e[70]!==fe||e[71]!==me||e[72]!==$?(Q=B(U,{sx:R,children:[$,F,N,Z,fe,me]}),e[67]=F,e[68]=N,e[69]=Z,e[70]=fe,e[71]=me,e[72]=$,e[73]=Q):Q=e[73],Q}function OM(i){return i.name}
83function VM(i){return i.option_id}function BM(i){return i.voted}KC.propTypes={poll:k.object.isRequired,own:k.bool,canClose:k.bool,disabled:k.bool,onVote:k.func.isRequired,onClose:k.func.isRequired};const sd=new Set;let cc=null,QC=0;function qM(i){return sd.add(i),cc||(cc=setInterval(()=>{QC+=1,sd.forEach(e=>e())},6e4)),()=>{sd.delete(i),sd.size===0&&cc&&(clearInterval(cc),cc=null)}}const P2=()=>QC;function FM(){return c.useSyncExternalStore(qM,P2,P2)}function ZC(i){const e=ct.c(10);let t,s,n;e[0]!==i?({value:n,prefix:s,...t}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=n):(t=e[1],s=e[2],n=e[3]);const a=s===void 0?"":s;FM();let l;e[4]!==n?(l=Tm(n),e[4]=n,e[5]=l):l=e[5];let u;return e[6]!==a||e[7]!==t||e[8]!==l?(u=B(te,{...t,children:[a,l]}),e[6]=a,e[7]=t,e[8]=l,e[9]=u):u=e[9],u}ZC.propTypes={value:k.string.isRequired,prefix:k.string};function YC(i){var St;const e=ct.c(85),{message:t,prev:s,next:n,myId:a,conversationType:l,readers:u,isEditing:d,editingText:h,editSaving:p,onEditChange:f,onEditSave:y,onEditCancel:v,onOpenMenu:C,onOpenReactionPicker:S,onOpenReactionsView:w,onOpenSeenBy:T,onLongPressStart:E,onLongPressMove:M,onLongPressEnd:x,onLongPressCancel:P,onJumpToMessage:R,onImageOpen:_,onVideoOpen:$,onPollVote:G,onPollClose:q,onOpenProfile:F,canModerate:H}=i,N=H===void 0?!1:H,A=mo(),W=A.palette.primary.main,V=A.palette.background.paper,K=A.palette.primary.contrastText;let re;e[0]!==A.palette.primary.contrastText?(re=Ai(A.palette.primary.contrastText,.7),e[0]=A.palette.primary.contrastText,e[1]=re):re=e[1];const oe=re,Z=t.sender_user_id===a;let fe,me,Q,j,X,Te,Ce,Ie,ge,Re,Se;if(e[2]!==V||e[3]!==W||e[4]!==oe||e[5]!==K||e[6]!==N||e[7]!==p||e[8]!==h||e[9]!==d||e[10]!==t||e[11]!==A.palette.mode||e[12]!==a||e[13]!==n||e[14]!==v||e[15]!==f||e[16]!==y||e[17]!==_||e[18]!==R||e[19]!==P||e[20]!==x||e[21]!==M||e[22]!==E||e[23]!==C||e[24]!==F||e[25]!==S||e[26]!==q||e[27]!==G||e[28]!==$||e[29]!==Z||e[30]!==s){const st=oa(t.created_at),Dt=!s||!IM(st,oa(s.created_at)),qt=!s||s.sender_user_id!==t.sender_user_id||oa(t.created_at)-oa(s.created_at)>S2,Ft=!n||n.sender_user_id!==t.sender_user_id||oa(n.created_at)-oa(t.created_at)>S2,Kt=Hd(t);let Lt;e[42]!==t.sender_user_id||e[43]!==F?(Lt=F&&t.sender_user_id?()=>F(t.sender_user_id):void 0,e[42]=t.sender_user_id,e[43]=F,e[44]=Lt):Lt=e[44];const Pt=Lt,Qt=t.deleted||Kt.length>0?0:qP(t.body);Q=!t.deleted&&(((St=t.reactions)==null?void 0:St.length)??0)>0;const xi=Ft&&Qt===0;j=Dt&&m(U,{sx:{display:"flex",justifyContent:"center",my:2},children:m(U,{sx:{px:1.5,py:.4,borderRadius:999,typography:"caption",fontWeight:500,color:"text.secondary",bgcolor:A.palette.mode==="dark"?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:DM(st,Date.now())})}),me=Be,Ce=t.message_id?`message-${t.message_id}`:void 0,Ie="row",ge=Z?"flex-end":"flex-start";const je=qt?1.5:.5;e[45]!==je?(Re={mt:je},e[45]=je,e[46]=Re):Re=e[46],e[47]!==Q||e[48]!==Ft||e[49]!==t.sender_name||e[50]!==t.sender_picture||e[51]!==Pt||e[52]!==Z?(Se=!Z&&m(U,{sx:{width:28,mr:1,flexShrink:0,display:"flex",alignItems:"flex-end"},children:Ft&&m(js,{src:t.sender_picture||void 0,onClick:Pt,sx:{width:28,height:28,mb:Q?"26px":0,...Pt&&{cursor:"pointer"}},children:(t.sender_name||"?").charAt(0)})}),e[47]=Q,e[48]=Ft,e[49]=t.sender_name,e[50]=t.sender_picture,e[51]=Pt,e[52]=Z,e[53]=Se):Se=e[53],fe=U,e[54]===Symbol.for("react.memo_cache_sentinel")?(X={maxWidth:{xs:"85%",md:"75%"},minWidth:0},e[54]=X):X=e[54],Te=d?B(U,{children:[m(Wr,{value:h,onChange:Fe=>f(Fe.target.value),onKeyDown:Fe=>{Fe.key==="Enter"&&!Fe.shiftKey&&(Fe.preventDefault(),y()),Fe.key==="Escape"&&v()},multiline:!0,maxRows:6,fullWidth:!0,size:"small",autoFocus:!0,slotProps:{htmlInput:{maxLength:2e3}}}),B(Be,{direction:"row",spacing:1,sx:{mt:.5},children:[m(oi,{size:"small",variant:"contained",onClick:y,disabled:p,children:"Save"}),m(oi,{size:"small",color:"inherit",onClick:v,children:"Cancel"})]})]}):B(Be,{direction:Z?"row-reverse":"row",alignItems:"center",spacing:.5,sx:{"&:hover .message-actions":{opacity:1}},children:[B(U,{onTouchStart:!t.deleted&&!t.pending?E(t):void 0,onTouchMove:M,onTouchEnd:x,onTouchCancel:P,sx:{position:"relative",display:"flow-root",px:1.5,py:.75,borderRadius:1.5,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",typography:"body2",fontSize:"1rem",fontWeight:500,...Z?{color:K}
83:A.palette.mode==="light"?{color:"#111B21"}:{},bgcolor:Z?W:V,...xi&&{...Z?{borderBottomRightRadius:0}:{borderBottomLeftRadius:0},"&::after":{content:'""',position:"absolute",bottom:0,width:8,height:13,bgcolor:Z?W:V,...Z?{right:-7,clipPath:"polygon(0 0, 0 100%, 100% 100%)"}:{left:-7,clipPath:"polygon(100% 0, 100% 100%, 0 100%)"}}},...Qt>0&&{bgcolor:"transparent",px:.25,py:0,lineHeight:1.2,fontSize:Qt===1?"2.75rem":Qt===2?"2.25rem":"1.875rem"},...t.pending&&{opacity:.55}},children:[!t.deleted&&!t.pending&&m(Nt,{size:"small",className:"message-actions","aria-label":"Message actions",onClick:Fe=>C(Fe.currentTarget,t.message_id),sx:{position:"absolute",top:4,right:4,zIndex:1,width:22,height:22,p:0,borderRadius:1,border:"1px solid",borderColor:"divider",bgcolor:Z?W:V,color:Z?oe:"text.disabled",opacity:0,transition:"opacity 0.15s","&:hover":{bgcolor:Z?W:V,color:Z?K:"text.secondary"},"@media (hover: none)":{display:"none"}},children:m(We,{icon:V6,style:{fontSize:12,width:12,height:12}})}),!Z&&(qt||t.deleted)&&B(te,{variant:"caption",onClick:Pt,sx:{display:"block",fontWeight:700,fontSize:"1rem",color:ao(t.sender_user_id),mb:.25,...Pt&&{cursor:"pointer",width:"fit-content"}},children:[t.sender_name??"Former member",t.sender_account_deleted&&m(no,{variant:"ghost",color:"error",sx:{ml:.75,verticalAlign:"middle"},children:"Account deleted"})]}),t.reply_to&&!t.deleted&&B(U,{onClick:()=>R(t.reply_to.message_id),sx:{borderLeft:3,borderColor:ao(t.reply_to.sender_user_id),bgcolor:HM,borderRadius:1,px:1,py:.5,mb:.5,cursor:"pointer",maxWidth:"100%",overflow:"hidden"},children:[m(te,{variant:"caption",noWrap:!0,sx:{display:"block",fontWeight:700,color:Z?K:ao(t.reply_to.sender_user_id)},children:t.reply_to.sender_user_id===a?"You":t.reply_to.sender_name??"Former member"}),m(te,{variant:"caption",noWrap:!0,sx:{display:"block",color:Z?oe:"text.secondary"},children:t.reply_to.deleted?"Message deleted":t.reply_to.body||"Shared content"})]}),t.deleted?B(U,{component:"span",sx:{fontStyle:"italic",color:Z?oe:A.palette.mode==="light"?"#667781":"text.disabled"},children:[m(We,{icon:R6,style:{fontSize:13,marginRight:6}}),"Message deleted"]}):WP(t.body,Z),Kt.length>0&&m(Be,{spacing:.5,sx:{mt:t.body?.75:0},children:Kt.map(Fe=>m($3,{link:Fe,onImageOpen:_,onVideoOpen:$},`${Fe.type}:${Fe.entity_id}`))}),!t.deleted&&t.poll&&m(KC,{poll:t.poll,own:Z,canClose:Z||N,disabled:!!t.pending||!t.poll.poll_id,onVote:Fe=>G(t.poll.poll_id,Fe),onClose:()=>q(t.poll.poll_id)}),m(ZC,{component:"span",variant:"caption",value:t.created_at,prefix:t.edited_at&&!t.deleted?"edited · ":"",sx:{color:Z?oe:A.palette.mode==="light"?"#667781":"text.disabled",fontSize:11,lineHeight:1,...Qt>0?{display:"block",textAlign:"right",mt:.25}:{float:"right",ml:1.25,mt:"12px"}}})]}),!t.deleted&&!t.pending&&m(Be,{direction:Z?"row-reverse":"row",className:"message-actions",sx:{opacity:0,transition:"opacity 0.15s","@media (hover: none)":{display:"none"}},children:m(Nt,{size:"small","aria-label":"React",onClick:Fe=>S(Fe.currentTarget,t.message_id),children:m(We,{icon:N6,style:{fontSize:18,width:18,height:18}})})})]}),e[2]=V,e[3]=W,e[4]=oe,e[5]=K,e[6]=N,e[7]=p,e[8]=h,e[9]=d,e[10]=t,e[11]=A.palette.mode,e[12]=a,e[13]=n,e[14]=v,e[15]=f,e[16]=y,e[17]=_,e[18]=R,e[19]=P,e[20]=x,e[21]=M,e[22]=E,e[23]=C,e[24]=F,e[25]=S,e[26]=q,e[27]=G,e[28]=$,e[29]=Z,e[30]=s,e[31]=fe,e[32]=me,e[33]=Q,e[34]=j,e[35]=X,e[36]=Te,e[37]=Ce,e[38]=Ie,e[39]=ge,e[40]=Re,e[41]=Se}else fe=e[31],me=e[32],Q=e[33],j=e[34],X=e[35],Te=e[36],Ce=e[37],Ie=e[38],ge=e[39],Re=e[40],Se=e[41];let Ve;e[55]!==Q||e[56]!==d||e[57]!==t.message_id||e[58]!==t.reactions||e[59]!==w||e[60]!==Z?(Ve=!d&&Q&&m(Be,{direction:"row",spacing:.5,sx:{mt:.5,flexWrap:"wrap",justifyContent:Z?"flex-end":"flex-start"},children:t.reactions.map(st=>m(Vl,{title:(st.users??[]).join(", "),children:B(U,{component:"button",type:"button","aria-label":"See who reacted",onClick:Dt=>w(Dt.currentTarget,t.message_id),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.5,px:.75,py:.1,borderRadius:999,typography:"caption",border:"1px solid",borderColor:st.mine?"primary.main":"divider",bgcolor:st.mine?WM:"background.paper",color:"text.primary"},children:[m("span",{children:st.emoji}),st.count>1&&m("span",{children:st.count})]})},st.emoji))}),e[55]=Q,e[56]=d,e[57]=t.message_id,e[58]=t.reactions,e[59]=w,e[60]=Z,e[61]=Ve):Ve=e[61];let L;e[62]!==l||e[63]!==d||e[64]!==t.message_id||e[65]!==T||e[66]!==u?(L=!d&&u.length>0&&m(Be,{direction:"row",justifyContent:"flex-end",sx:{mt:.25},children:m(U,{component:"button",type:"button",onClick:st=>T(st.currentTarget,t.message_id),sx:{background:"none",border:0,p:0,cursor:"pointer",typography:"caption",fontSize:11,color:"text.secondary"},children:l==="dm"?"Seen":`Seen by ${u.length}`})}),e[62]=l,e[63]=d,e[64]=t.message_id,e[65]=T,e[66]=u,e[67]=L):L=e[67];let ye;e[68]!==fe||e[69]!==Ve||e[70]!==L||e[71]!==X||e[72]!==Te?(ye=B(fe,{s
83x:X,children:[Te,Ve,L]}),e[68]=fe,e[69]=Ve,e[70]=L,e[71]=X,e[72]=Te,e[73]=ye):ye=e[73];let ne;e[74]!==me||e[75]!==ye||e[76]!==Ce||e[77]!==Ie||e[78]!==ge||e[79]!==Re||e[80]!==Se?(ne=B(me,{id:Ce,direction:Ie,justifyContent:ge,sx:Re,children:[Se,ye]}),e[74]=me,e[75]=ye,e[76]=Ce,e[77]=Ie,e[78]=ge,e[79]=Re,e[80]=Se,e[81]=ne):ne=e[81];let Je;return e[82]!==j||e[83]!==ne?(Je=B(fi,{children:[j,ne]}),e[82]=j,e[83]=ne,e[84]=Je):Je=e[84],Je}function WM(i){return Ai(i.palette.primary.main,.08)}function HM(i){return Ai(i.palette.mode==="dark"?"#ffffff":"#000000",i.palette.mode==="dark"?.08:.05)}YC.propTypes={message:k.object.isRequired,prev:k.object,next:k.object,myId:k.number,conversationType:k.string,readers:k.array.isRequired,isEditing:k.bool,editingText:k.string,editSaving:k.bool,onEditChange:k.func.isRequired,onEditSave:k.func.isRequired,onEditCancel:k.func.isRequired,onOpenMenu:k.func.isRequired,onOpenReactionPicker:k.func.isRequired,onOpenReactionsView:k.func.isRequired,onOpenSeenBy:k.func.isRequired,onLongPressStart:k.func.isRequired,onLongPressMove:k.func.isRequired,onLongPressEnd:k.func.isRequired,onLongPressCancel:k.func.isRequired,onJumpToMessage:k.func.isRequired,onImageOpen:k.func,onVideoOpen:k.func,onOpenProfile:k.func};function XC(i){const e=ct.c(23),{messages:t,myId:s,conversationType:n,canModerate:a,unreadDividerId:l,unreadCount:u,receiptsEnabled:d,receiptList:h,lastOwnMessageId:p,hasNextPage:f,isFetchingNextPage:y,topSentinelRef:v,editing:C,editSaving:S,bubbleHandlers:w}=i,T=a===void 0?!1:a,E=l===void 0?null:l,M=u===void 0?0:u;let x;e[0]!==f||e[1]!==y||e[2]!==v?(x=f&&m(U,{ref:v,sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:4,py:y?1.5:0},children:y&&m(Gn,{size:20})}),e[0]=f,e[1]=y,e[2]=v,e[3]=x):x=e[3];let P;e[4]!==t.length?(P=t.length===0&&m(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:5},children:"No messages yet. Say hi to the team."}),e[4]=t.length,e[5]=P):P=e[5];let R;e[6]!==w||e[7]!==T||e[8]!==n||e[9]!==S||e[10]!==C||e[11]!==p||e[12]!==t||e[13]!==s||e[14]!==h||e[15]!==d||e[16]!==M||e[17]!==E?(R=t.map(($,G)=>{const q=G>0?t[G-1]:null,F=G<t.length-1?t[G+1]:null,H=d&&$.sender_user_id===s&&$.message_id===p?zC($.message_id,h,s):[];return B(c.Fragment,{children:[$.message_id===E&&m(U,{sx:{display:"flex",justifyContent:"center",my:2},children:m(U,{sx:{px:1.5,py:.4,borderRadius:999,typography:"caption",fontWeight:600,color:"text.secondary",bgcolor:jM,backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:M===1?"1 unread message":`${M} unread messages`})}),m(YC,{message:$,prev:q,next:F,myId:s,conversationType:n,canModerate:T,readers:H,isEditing:(C==null?void 0:C.messageId)===$.message_id,editingText:(C==null?void 0:C.messageId)===$.message_id?C.text:"",editSaving:S,...w})]},$.message_id??$.client_message_id)}),e[6]=w,e[7]=T,e[8]=n,e[9]=S,e[10]=C,e[11]=p,e[12]=t,e[13]=s,e[14]=h,e[15]=d,e[16]=M,e[17]=E,e[18]=R):R=e[18];let _;return e[19]!==x||e[20]!==P||e[21]!==R?(_=B(fi,{children:[x,P,R]}),e[19]=x,e[20]=P,e[21]=R,e[22]=_):_=e[22],_}function jM(i){return i.palette.mode==="dark"?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}XC.propTypes={messages:k.array.isRequired,myId:k.number,conversationType:k.string,canModerate:k.bool,unreadDividerId:k.number,unreadCount:k.number,receiptsEnabled:k.bool,receiptList:k.array.isRequired,lastOwnMessageId:k.number,hasNextPage:k.bool,isFetchingNextPage:k.bool,topSentinelRef:k.oneOfType([k.func,k.shape({current:k.any})]),editing:k.object,editSaving:k.bool,bubbleHandlers:k.object.isRequired};function JC(i){const e=ct.c(52),{conversation:t,onBack:s,onOpenInfo:n,typingText:a}=i,l=a===void 0?null:a,u=j6();if(s){let F;e[0]===Symbol.for("react.memo_cache_sentinel")?(F={flexShrink:0,pt:"var(--thg-safe-top, 0px)",bgcolor:"background.neutral",borderBottom:"1px solid",borderColor:"divider"},e[0]=F):F=e[0];let H;e[1]!==u?(H=Qw(u),e[1]=u,e[2]=H):H=e[2];let N;e[3]!==H?(N={display:"flex",alignItems:"center",gap:1,height:Zw+16,px:H},e[3]=H,e[4]=N):N=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=m(Uw,{sx:{ml:"5px",mr:"-5px"}}),e[5]=A):A=e[5];let W;e[6]!==s?(W=m(Kw,{label:"Back",onClick:s,children:A}),e[6]=s,e[7]=W):W=e[7];let V;e[8]!==t||e[9]!==n||e[10]!==l?(V=m(eS,{conversation:t,onOpenInfo:n,typingText:l}),e[8]=t,e[9]=n,e[10]=l,e[11]=V):V=e[11];let K;return e[12]!==N||e[13]!==W||e[14]!==V?(K=m(U,{component:"header",sx:F,children:B(U,{sx:N,children:[W,V]})}),e[12]=N,e[13]=W,e[14]=V,e[15]=K):K=e[15],K}const d=t.picture||void 0;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h={width:36,height:36},e[16]=h):h=e[16];const p=t.title||"?";let f;e[17]!==p?(f=p.charAt(0),e[17]=p,e[18]=f):f=e[18];let y;e[19]!==d||e[20]!==f?(y=m(js,{src:d,sx:h,children:f}),e[19]=d,e[20]=f,e[21]=y):y=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v={flexGrow:1,minWidth:0},e[22]=v):v=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C={minWidth:0,display:"flex",alignItems:"center",gap:1},e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S={minWidth:0},e[24]=S):S=e[24];let w;e[25]!==t.title?(w=m(te,{variant:"subtitle1",noWrap:!0,sx:S,children:t.title}),e[25]=t.title,e[26]=w):w=e[26];let T;e[27]!==t.counterpart_account_deleted||e[28]!==t.counterpart_has_account||e[29]!==t.type?(T=t.type==="dm"&&t.counterpart_has_account===!1&&m(no,{variant:"ghost",color:"error",sx:{flexShrink:0},children:t.counterpart_account_deleted?"Account deleted":"No account"}),e[27]=t.counterpart_account_deleted,e[28]=t.counterpart_has_account,e[29]=t.type,e[30]=T):T=e[30];let E;e[31]!==t.type?(E=t.type==="group"&&m(no,{variant:"ghost",sx:{flexShrink:0},children:K6(t.type)}),e[31]=t.type,e[32]=E):E=e[32];let M;e[33]!==w||e[34]!==T||e[35]!==E?(M=B(U,{sx:C,children:[w,T,E]}),e[33]=w,e[34]=T,e[35]=E,e[36]=M):M=e[36];let x;e[37]!==t.type||e[38]!==l?(x=l?m(te,{variant:"caption",noWrap:!0,sx:{display:"block",color:"primary.main",lineHeight:1.2},children:l}):t.type==="team"&&m(te,{variant:"caption",noWrap:!0,sx:{display:"block",color:"text.secondary",lineHeight:1.2},children:"Everyone on the team"}),e[37]=t.type,e[38]=l,e[39]=x):x=e[39];let P;e[40]!==M||e[41]!==x?(P=B(U,{sx:v,children:[M,x]}),e[40]=M,e[41]=x,e[42]=P):P=e[42];let R;e[43]!==n?(R=n&&m(Vl,{title:"Conversation details",children:m(Nt,{size:"small",onClick:n,"aria-label":"Conversation details",children:m(We,{icon:kS,style:{fontSize:22,width:22,height:22}})})}),e[43]=n,e[44]=R):R=e[44];let _;e[45]!==P||e[46]!==R||e[47]!==y?(_=B(fi,{children:[y,P,R]}),e[45]=P,e[46]=R,e[47]=y,e[48]=_):_=e[48];const $=_;let G;e[49]===Symbol.for("react.memo_cache_sentinel")?(G={display:"flex",alignItems:"center",gap:1.5,px:2,height:61,flexShrink:0,borderBottom:"1px solid",borderColor:"divider"},e[49]=G):G=e[49];let q;return e[50]!==$?(q=m(U,{sx:G,children:$}),e[50]=$,e[51]=q):q=e[51],q}function eS(i){const e=ct.c(30),{conversation:t,onOpenInfo:s,typingText:n}=i,a=t.type==="dm"&&t.counterpart_has_account===!1;let l;e[0]!==t.counterpart_account_deleted||e[1]!==t.type||e[2]!==a||e[3]!==n?(l=n?{text:n,color:"primary.main"}:a?{text:t.counterpart_account_deleted?"Account deleted":"No account",color:"error.main"}:t.type==="team"?{text:"Everyone on the team",color:"text.secondary"}:null,e[0]=t.counterpart_account_deleted,e[1]=t.type,e[2]=a,e[3]=n,e[4]=l):l=e[4];const u=l,d=!!s,h=d?Iu:"div";let p;e[5]!==t.title||e[6]!==d||e[7]!==s?(p=d&&{onClick:s,"aria-label":`Conversation details: ${t.title}`},e[5]=t.title,e[6]=d,e[7]=s,e[8]=p):p=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f={flexGrow:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"flex-start",ga
83p:1.25,py:.5,pr:1,borderRadius:1,color:"text.primary",fontFamily:"inherit",textAlign:"left"},e[9]=f):f=e[9];const y=t.picture||void 0;let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v={width:40,height:40,flexShrink:0},e[10]=v):v=e[10];const C=t.title||"?";let S;e[11]!==C?(S=C.charAt(0),e[11]=C,e[12]=S):S=e[12];let w;e[13]!==y||e[14]!==S?(w=m(js,{src:y,sx:v,children:S}),e[13]=y,e[14]=S,e[15]=w):w=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T={minWidth:0},e[16]=T):T=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E={lineHeight:1.25},e[17]=E):E=e[17];let M;e[18]!==t.title?(M=m(te,{variant:"subtitle1",noWrap:!0,sx:E,children:t.title}),e[18]=t.title,e[19]=M):M=e[19];let x;e[20]!==u?(x=u&&m(te,{variant:"caption",noWrap:!0,sx:{display:"block",lineHeight:1.2,color:u.color},children:u.text}),e[20]=u,e[21]=x):x=e[21];let P;e[22]!==M||e[23]!==x?(P=B(U,{sx:T,children:[M,x]}),e[22]=M,e[23]=x,e[24]=P):P=e[24];let R;return e[25]!==P||e[26]!==h||e[27]!==p||e[28]!==w?(R=B(U,{component:h,...p,sx:f,children:[w,P]}),e[25]=P,e[26]=h,e[27]=p,e[28]=w,e[29]=R):R=e[29],R}eS.propTypes={conversation:k.object.isRequired,onOpenInfo:k.func,typingText:k.string};JC.propTypes={conversation:k.object.isRequired,onBack:k.func,onOpenInfo:k.func,typingText:k.string};function GM(i){const e=ct.c(21);let t;if(e[0]!==i){t=[];for(const w of i)for(const T of Hd(w))if((T.type==="image"||T.type==="media"&&T.kind==="image")&&T.file_path){const M=`https://thg-images.b-cdn.net/${T.file_path}`;t.push({id:M,src:M})}else T.type==="media"&&T.kind==="video"&&T.guid&&T.cdn&&T.status==="ready"&&t.push({type:"hls",id:`video:${T.guid}`,src:`https://${T.cdn}/${T.guid}/playlist.m3u8`,poster:`https://${T.cdn}/${T.guid}/thumbnail.jpg`});e[0]=i,e[1]=t}else t=e[1];const s=t,[n,a]=c.useState(null);let l;e[2]!==n||e[3]!==s?(l=n==null?-1:s.findIndex(w=>w.id===n),e[2]=n,e[3]=s,e[4]=l):l=e[4];const u=l;let d,h;e[5]!==n||e[6]!==u?(d=()=>{n!=null&&u<0&&a(null)},h=[n,u],e[5]=n,e[6]=u,e[7]=d,e[8]=h):(d=e[7],h=e[8]),c.useEffect(d,h);let p;e[9]!==s?(p=w=>{var T;a(s.some(E=>E.id===w)?w:((T=s[0])==null?void 0:T.id)??null)},e[9]=s,e[10]=p):p=e[10];const f=p;let y,v;e[11]!==f?(y=w=>f(w),v=w=>f(`video:${w}`),e[11]=f,e[12]=y,e[13]=v):(y=e[12],v=e[13]);let C;e[14]!==s||e[15]!==u?(C={galleryMedia:s,index:u,setActiveMediaId:a},e[14]=s,e[15]=u,e[16]=C):C=e[16];let S;return e[17]!==y||e[18]!==v||e[19]!==C?(S={openImage:y,openVideo:v,viewerProps:C},e[17]=y,e[18]=v,e[19]=C,e[20]=S):S=e[20],S}function tS(i){const e=ct.c(14),{galleryMedia:t,index:s,setActiveMediaId:n}=i,a=s>=0,l=s>=0?s:0;let u;e[0]!==n?(u=()=>n(null),e[0]=n,e[1]=u):u=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=[Yw],e[2]=d):d=e[2];let h;e[3]!==t||e[4]!==n?(h={view:v=>{var w;const{index:C}=v,S=(w=t[C])==null?void 0:w.id;S!=null&&n(S)}},e[3]=t,e[4]=n,e[5]=h):h=e[5];let p,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={closeOnBackdropClick:!0},f={slide:zM},e[6]=p,e[7]=f):(p=e[6],f=e[7]);let y;return e[8]!==t||e[9]!==a||e[10]!==l||e[11]!==u||e[12]!==h?(y=m(Xw,{open:a,index:l,close:u,slides:t,plugins:d,on:h,controller:p,render:f}),e[8]=t,e[9]=a,e[10]=l,e[11]=u,e[12]=h,e[13]=y):y=e[13],y}function zM(i){const{slide:e,offset:t}=i;return e.type==="hls"?t===0?m(U,{sx:{position:"relative",width:"min(100%, 960px)",aspectRatio:"16 / 9"},children:m(T3,{src:e.src,poster:e.poster,autoPlay:!0})}):m(U,{component:"img",src:e.poster,alt:"",sx:{maxWidth:"100%",maxHeight:"100%"}}):void 0}tS.propTypes={galleryMedia:k.array.isRequired,index:k.number.isRequired,setActiveMediaId:k.func.isRequired};function iS(i){const e=ct.c(18),{users:t,showNames:s}=i,n=s===void 0?!1:s;if(!t||t.length===0)return null;let a;e[0]!==t?(a=t.map(KM).join(", "),e[0]=t,e[1]=a):a=e[1];const l=a;let u;e[2]!==t?(u=t.every(UM),e[2]=t,e[3]=u):u=e[3];const d=u;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h={mt:1.5},e[4]=h):h=e[4];let p;e[5]!==l||e[6]!==n||e[7]!==t[0]?(p=n&&m(te,{variant:"caption",sx:{ml:1,mb:.5,fontWeight:700,color:ao(t[0].userId)},children:l}),e[5]=l,e[6]=n,e[7]=t[0],e[8]=p):p=e[8];const f=`${l} ${d?"recording audio":"typing"}`;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y={px:1.5,py:1.25,borderRadius:1.5,bgcolor:"background.paper",display:"flex",alignItems:"center",gap:.5,"@keyframes typingDot":{"0%, 60%, 100%":{opacity:.35,transform:"translateY(0)"}
83,"30%":{opacity:1,transform:"translateY(-3px)"}},"& > span":{width:7,height:7,borderRadius:"50%",bgcolor:"text.secondary",animation:"typingDot 1.2s infinite ease-in-out"},"& > span:nth-of-type(2)":{animationDelay:"0.15s"},"& > span:nth-of-type(3)":{animationDelay:"0.3s"},"@keyframes recPulse":{"0%, 100%":{opacity:.45},"50%":{opacity:1}},"@media (prefers-reduced-motion: reduce)":{"& > span":{animation:"none",opacity:.6},"& > .thg-rec-mic":{animation:"none",opacity:.8}}},e[9]=y):y=e[9];let v;e[10]!==d?(v=d?m(U,{className:"thg-rec-mic",sx:{display:"inline-flex",color:"error.main",animation:"recPulse 1.2s infinite ease-in-out"},children:m(We,{icon:O6,style:{fontSize:15}})}):B(fi,{children:[m(U,{component:"span"}),m(U,{component:"span"}),m(U,{component:"span"})]}),e[10]=d,e[11]=v):v=e[11];let C;e[12]!==f||e[13]!==v?(C=m(U,{"aria-label":f,sx:y,children:v}),e[12]=f,e[13]=v,e[14]=C):C=e[14];let S;return e[15]!==p||e[16]!==C?(S=B(Be,{alignItems:"flex-start",sx:h,children:[p,C]}),e[15]=p,e[16]=C,e[17]=S):S=e[17],S}function UM(i){return i.activity==="recording"}function KM(i){return i.name||"Someone"}iS.propTypes={users:k.array.isRequired,showNames:k.bool};function QM({myId:i,canModerate:e,onReply:t,onCopy:s,onEditStart:n,onRemove:a}){const l=h=>!!h&&!h.deleted&&h.sender_user_id===i&&Date.now()-oa(h.created_at)<BP,u=h=>!!h&&!h.deleted&&(h.sender_user_id===i||e);return{actionsFor:h=>h?[{id:"reply",label:"Reply",icon:$S,disabled:!h.message_id,run:()=>t(h)},...h.body?[{id:"copy",label:"Copy",icon:PS,run:()=>s(h)}]:[],...l(h)?[{id:"edit",label:"Edit",icon:I6,run:()=>n(h)}]:[],...u(h)?[{id:"remove",label:"Delete",icon:MS,destructive:!0,run:()=>a(h)}]:[]]:[],canEditMessage:l,canRemoveMessage:u}}function ZM({itemCount:i,hasNextPage:e,isFetchingNextPage:t,fetchNextPage:s}){const n=c.useRef(null),a=c.useRef(null),l=c.useRef(!0),u=c.useRef(0),d=c.useRef(t);d.current=t;const[h,p]=c.useState(!1),f=c.useRef(null),y=c.useCallback(x=>{f.current=x},[]),v=c.useCallback((x="auto")=>{const P=n.current;P&&P.scrollTo({top:P.scrollHeight,behavior:x})},[]),C=()=>{var _;const x=n.current;if(!x)return;const P=x.scrollHeight-x.scrollTop-x.clientHeight,R=x.scrollTop<u.current-1;u.current=x.scrollTop,P<=80?l.current=!0:R&&(l.current=!1),p(P>240),(_=f.current)==null||_.call(f)},S=()=>{l.current=!0,v("smooth"),p(!1)},w=c.useCallback(()=>{l.current=!0},[]);c.useLayoutEffect(()=>{l.current&&v()},[i,v]),c.useEffect(()=>{const x=n.current;if(!x||typeof ResizeObserver>"u")return;const P=new ResizeObserver(()=>{l.current&&v()});return P.observe(x),a.current&&P.observe(a.current),()=>P.disconnect()},[v]);const T=c.useRef(null),E=c.useCallback(()=>{var x;T.current=((x=n.current)==null?void 0:x.scrollHeight)??0,s()},[s]);c.useLayoutEffect(()=>{const x=n.current;x&&T.current!=null&&!t&&(x.scrollTop+=x.scrollHeight-T.current,T.current=null)},[i,t]);const M=c.useRef(null);return c.useEffect(()=>{const x=n.current,P=M.current;if(!e||!x||!P||typeof IntersectionObserver>"u")return;const R=new IntersectionObserver(_=>{_[0].isIntersecting&&!d.current&&E()},{root:x,rootMargin:"300px 0px 0px 0px"});return R.observe(P),()=>R.disconnect()},[e,E]),{scrollRef:n,contentRef:a,pinnedRef:l,showJump:h,handleScroll:C,jumpToBottom:S,pinToBottom:w,handleLoadOlder:E,loadOlderRef:M,setOnScroll:y}}function YM({visible:i,atBottom:e,newestServerId:t,lastReadMessageId:s,lastMarkedId:n}){return!(!i||!e||!(t>0)||t<=(s??0)||t<=(n??0))}function XM({scrollRef:i,pinnedRef:e,newestServerId:t,lastReadMessageId:s,markRead:n}){const a=c.useRef(0),l=c.useRef(null);l.current=()=>{const d=typeof document>"u"||document.visibilityState==="visible",h=i.current,p=h?h.scrollHeight-h.scrollTop-h.clientHeight<=80:e.current;YM({visible:d,atBottom:p,newestServerId:t,lastReadMessageId:s,lastMarkedId:a.current})&&(a.current=t,n(t,{onError:()=>{a.current===t&&(a.current=0)}}))};const u=c.useCallback(()=>{var d;return(d=l.current)==null?void 0:d.call(l)},[]);return c.useEffect(()=>{u()},[u,t,s]),c.useEffect(()=>{const d=()=>u();return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[u]),u}bm.propTypes={conversation:k.object.isRequired,onBack:k.func,onConversationCreated:k.func};function bm({conversation:i,onBack:e=null,onConversationCreated:t=null}){var M3,R3;const s=mo(),{user:n}=Sm(),a=n==null?void 0:n.db_user_id,{checkPermissions:l}=RS(),u=!!l({teamId:i.team_id,permissions:["EDIT_TEAM"]}),{enqueueSnackbar:d}=xh(),h=i.conversation_id,p=!h,f=XS(i.team_id),y=JS(i.team_id),v=c.useRef(h),C=c.useRef(null),S=c.useRef(new Map),{data:w,isPending:T,isError:E,error:M,refetch:x,fetchNextPage:P,hasNextPage:R,isFetchingNextPage:_}=ew(h),$=E?eg(M,{subject:"messages"}):null,{data:G=[]}
83=U6(h,{enabled:i.type==="group"}),q=i.type==="team"?u:i.type==="group"?G.some(J=>J.user_id===a&&J.is_admin):!1,F=i.type==="dm"&&i.counterpart_has_account===!1,H=tw(h),N=z6(h),A=iw(h),W=sw(h),{data:V}=nw(h),K=(V==null?void 0:V.enabled)??!1,re=(V==null?void 0:V.receipts)??[],oe=rw(h),Z=aw(h),fe=ow(h),me=async()=>v.current?v.current:(C.current||(C.current=(i.type==="group"?y.mutateAsync({title:i.draft.title,userIds:i.draft.userIds}):f.mutateAsync(i.draft.userId)).then(J=>(v.current=J,J)).catch(J=>{throw C.current=null,J})),C.current),Q=async J=>{const Ee=await me(),yt=await Promise.all(J.linkedContent.map(async Yt=>{if(Yt.type!=="media"||!Yt.local_file)return Yt;let ta=S.current.get(Yt.entity_id);return ta||(ta=dw(Ee,Yt.local_file).then(Qp).catch(Zu=>{throw S.current.delete(Yt.entity_id),Zu}),S.current.set(Yt.entity_id,ta)),ta})),Eo=await H({...J,linkedContent:yt},Ee);return J.linkedContent.forEach(Yt=>{Yt.local_file&&S.current.delete(Yt.entity_id)}),p&&(t==null||t(Ee)),Eo},j=c.useMemo(()=>{const J=((w==null?void 0:w.pages)??[]).flatMap(yt=>yt.items),Ee=new Set(J.filter(yt=>!yt.pending).map(yt=>yt.client_message_id));return J.filter(yt=>!(yt.pending&&Ee.has(yt.client_message_id))).reverse()},[w]),X=c.useMemo(()=>{for(let J=j.length-1;J>=0;J-=1){const Ee=j[J];if(Ee.sender_user_id===a&&Ee.message_id&&!Ee.deleted&&!Ee.pending)return Ee.message_id}return null},[j,a]),Te=c.useMemo(()=>j.reduce((J,Ee)=>Ee.message_id&&Ee.message_id>J?Ee.message_id:J,0),[j]),Ce=c.useRef({lastRead:i.last_read_message_id??0,count:i.unread_count??0}),Ie=c.useMemo(()=>{const{lastRead:J,count:Ee}=Ce.current;if(Ee<=0)return null;for(const yt of j)if(yt.message_id&&yt.message_id>J&&yt.sender_user_id!==a)return yt.message_id;return null},[j,a]),ge=lw(h),Re=cw(ge),Se=j[j.length-1];c.useEffect(()=>{Se!=null&&Se.sender_user_id&&uw(h,Se.sender_user_id)},[h,Se]);const Ve=GM(j),L=ZM({itemCount:j.length,hasNextPage:R,isFetchingNextPage:_,fetchNextPage:P}),ye=XM({scrollRef:L.scrollRef,pinnedRef:L.pinnedRef,newestServerId:Te,lastReadMessageId:i.last_read_message_id,markRead:(J,Ee)=>N.mutate({last_read_message_id:J},Ee)});c.useEffect(()=>{L.setOnScroll(ye)},[L.setOnScroll,ye]);const ne=rx({sendMessage:Q,sender:{id:a,name:((M3=n==null?void 0:n.dbData)==null?void 0:M3.name)??(n==null?void 0:n.displayName)??"",picture:((R3=n==null?void 0:n.dbData)==null?void 0:R3.picture)??null},onWillSend:L.pinToBottom,onSendError:J=>d(es.printError(J),{variant:"error"})}),Je=ox({disabled:ne.pendingLinks.length>=Ro,onFiles:ne.requestUpload}),[St,st]=c.useState(null),[Dt,qt]=c.useState(null),[Ft,Kt]=c.useState(null),[Lt,Pt]=c.useState(null),[Qt,xi]=c.useState(null),[je,Fe]=c.useState(null),[Zt,ui]=c.useState(!1),[Di,di]=c.useState(null),hi=c.useMemo(()=>new Map(j.map(J=>[J.message_id,J])),[j]),nc=St?hi.get(St.messageId):null,rc=Ft?hi.get(Ft.messageId):null,So=Lt?hi.get(Lt.messageId):null,os=je?hi.get(je.messageId):null,wo=(os==null?void 0:os.sender_user_id)===a,Yn=Qt?zC(Qt.messageId,re,a):[],xs=c.useRef(null),Es=c.useRef(!1),Xn=J=>Ee=>{var Yt;if(!((Yt=Ee.touches)==null?void 0:Yt[0]))return;const Eo=Ee.currentTarget;Es.current=!1,clearTimeout(xs.current),xs.current=setTimeout(()=>{var Zu;Es.current=!0,(Zu=navigator.vibrate)==null||Zu.call(navigator,10);const ta=Eo.getBoundingClientRect();Fe({messageId:J.message_id,left:ta.left,right:ta.right})},450)},Ts=()=>clearTimeout(xs.current),xo=J=>{Ts(),Es.current&&J.cancelable&&J.preventDefault()},Ku=(J,Ee)=>{var Eo;const yt=(Eo=J.reactions)==null?void 0:Eo.some(Yt=>Yt.mine&&Yt.emoji===Ee);oe.mutate({messageId:J.message_id,emoji:Ee,remove:yt},{onError:Yt=>d(es.printError(Yt),{variant:"error"})})},Qu=async J=>{if(J)try{await navigator.clipboard.writeText(J.body??""),d("Message copied",{variant:"success"})}catch{d("Couldn't copy the message",{variant:"error"})}},Ue=J=>{J&&W.mutate({messageId:J.message_id},{onError:Ee=>d(es.printError(Ee),{variant:"error"})})},nn=()=>{const J=((Dt==null?void 0:Dt.text)??"").trim();if(!J||!Dt)return;const Ee=Dt.messageId;A.mutate({messageId:Ee,body:J},{onSuccess:()=>qt(yt=>(yt==null?void 0:yt.messageId)===Ee?null:yt),onError:yt=>d(es.printError(yt),{variant:"error"})})},ac=J=>{var Ee;(Ee=document.getElementById(`message-${J}`))==null||Ee.scrollIntoView({behavior:"smooth",block:"center"})},{actionsFor:sS}=QM({myId:a,canModerate:q,onReply:ne.reply,onCopy:Qu,onEditStart:J=>qt({messageId:J.message_id,text:J.body}),onRemove:Ue}),nS={onEditChange:J=>qt(Ee=>Ee&&{...Ee,text:J}),onEditSave:nn,onEditCancel:()=>qt(null),onOpenMenu:(J,Ee)=>st({anchor:J,messageId:Ee}),onOpenReactionPicker:(J,Ee)=>Kt({anchor:J,messageId:Ee}),onOpenReactionsView:(J,Ee)=>Pt({anchor:J,messageId:Ee}),onOpenSeenBy:(J,Ee)=>xi({anchor:J,messageId:Ee}),onLongPressStart:Xn,onLongPressMove:Ts,onLongPressEnd:xo,onLongPressCancel:Ts,onJumpToMessage:ac,onImageOpen:Ve.openImage,onVideoOpen:Ve.openVideo,onPollVote:(J,Ee)=>Z.mutate({pollId:J,optionIds:Ee}),onPollClose:J=>fe.mutate({pollId:J}),onOpenProfile:di};return B(U,{...Je.dropProps,sx:{flexGrow:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",position:"relative","@media (hover: none)":{WebkitTapHighlightColor:"transparent","&, & *":{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},"& textarea, & input":{WebkitUserSelect:"text !important",userSelect:"text !important"},"& img":{pointerEvents:"none",WebkitUserDrag:"none"}}},children:[m(JC,{conversation:i,onBack:e,onOpenInfo:p?null:()=>ui(!0),typingText:Re}),B(U,{sx:{position:"relative",flexGrow:1,minHeight:0,display:"flex"},children:[m(U,{ref:L.scrollRef,onScroll:L.handleScroll,sx:{flexGrow:1,minWidth:0,overflowY:"auto",display:"flex",flexDirection:"column",px:1,py:1.5,bgcolor:s.palette.mode==="dark"?"grey.900":"#F5F1EB","&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:3,transition:"background-color 0.2s ease"},scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{"&::-webkit-scrollbar-thumb":{backgroundColor:"rgba(145, 158, 171, 0.48)"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"rgba(145, 158, 171, 0.72)"},scrollbarColor:"rgba(145, 158, 171, 0.48) transparent"}},children:B(U,{ref:L.contentRef,sx:{mt:"auto"},children:[p?m(te,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:5},children:"Send a message to start the conversation."}):T?m(U,{sx:{textAlign:"center",py:5},children:m(Gn,{size:24})}):E?m($h,{error:M,subject:"messages",onRetry:x}):m(XC,{messages:j,myId:a,conversationType:i.type,canModerate:q,unreadDividerId:Ie,unreadCount:Ce.current.count,receiptsEnabled:K,receiptList:re,lastOwnMessageId:X,hasNextPage:R,isFetchingNextPage:_,topSentinelRef:L.loadOlderRef,editing:Dt,editSaving:A.isPending,bubbleHandlers:nS}),!p&&!T&&!E&&m(iS,{users:ge,showNames:i.type!=="dm"}),!E&&ne.failedSends.map(J=>B(Be,{alignItems:"flex-end",sx:{mt:1},children:[B(U,{sx:{maxWidth:"75%",px:1.5,py:1,borderRadius:2,border:"1px solid",borderColor:"error.main",bgcolor:"primary.main",color:"primary.contrastText"},children:[J.body&&m(te,{variant:"body2",sx:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:J.body}),J.poll&&B(te,{variant:"caption",sx:{opacity:.8},children:["📊 ",J.poll.question]}),J.linkedContent.length>0&&m(te,{variant:"caption",sx:{opacity:.8},children:J.linkedContent.length===1?"1 attachment":`${J.linkedContent.length} attachments`})]}),B(Be,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:.25},children:[m(te,{variant:"caption",color:"error",children:"Couldn't send"}),m(xc,{component:"button",type:"button",variant:"caption",onClick:()=>ne.retrySend(J),children:"Retry"}),m(xc,{component:"button",type:"button",variant:"caption",color:"text.secondary",onClick:()=>ne.discardFailedSend(J),children:"Discard"})]})]},J.clientMessageId))]})}),L.showJump&&m(Nt,{onClick:L.jumpToBottom,"aria-label":"Scroll to latest messages",sx:{position:"absolute",right:12,bottom:12,width:40,height:40,bgcolor:"background.paper",boxShadow:3,"&:hover":{bgcolor:"background.paper"}},children:m(We,{icon:V6,style:{fontSize:16,width:16,height:16}})})]}),m(IC,{menu:St,menuMessage:nc,onCloseMenu:()=>st(null),reactionPicker:Ft,reactionPickerMessage:rc,onCloseReactionPicker:()=>Kt(null),reactionsView:Lt,reactionsViewMessage:So,onCloseReactionsView:()=>Pt(null),seenByView:Qt,seenByReaders:Yn,onCloseSeenBy:()=>
83xi(null),contextMenu:je,contextMenuMessage:os,contextMenuOwn:wo,onCloseContextMenu:()=>Fe(null),actionsFor:sS,onToggleReaction:Ku}),$?m(U,{sx:{py:1.75,px:2,borderTop:"1px solid",borderColor:"divider",color:"text.secondary",textAlign:"center"},children:m(te,{variant:"caption",children:$.retryable?"Messages couldn't load — you can't send right now.":"You can't send messages in this conversation."})}):F?m(U,{sx:{py:1.75,px:2,borderTop:"1px solid",borderColor:"divider",color:"error.main",textAlign:"center"},children:m(te,{variant:"caption",children:i.counterpart_account_deleted?`${i.title} deleted their account and won't receive new messages.`:`${i.title} doesn't have an account right now and won't receive new messages.`})}):m(GC,{conversationId:h,mobile:!!e,myId:a,composer:ne}),!p&&m(rg,{open:Zt,onClose:()=>ui(!1),conversation:i}),m(yw,{open:!!Di,onClose:()=>di(null),teamId:i.team_id,userId:Di}),m(tS,{...Ve.viewerProps}),m(sg,{active:Je.dragActive})]})}function JM(){var xi;const i=ct.c(109),{themeStretch:e}=AS(),t=IS("up","md"),s=j6(),n=wm(),a=GS(),l=_S(),u=DS(),d=(n==null?void 0:n.team_id)??null,h=LS(d,"private_messaging"),[p,f]=NS(),y=((xi=l.state)==null?void 0:xi.conversationDraft)??null,[v,C]=c.useState(y);let S;i[0]!==p?(S=Number(p.get("conversation"))||null,i[0]=p,i[1]=S):S=i[1];const w=S;let T;i[2]!==p?(T=fw(p),i[2]=p,i[3]=T):T=i[3];const E=T,{data:M,isPending:x,isError:P,error:R,refetch:_}=hw(),$=M===void 0?[]:M;let G,q;i[4]!==y||i[5]!==l.pathname||i[6]!==u||i[7]!==a?(G=()=>{y&&(C(y),a(y.team_id),u({pathname:l.pathname,search:`?${O3}=1`},{replace:!0,state:null}))},q=[y,l.pathname,u,a],i[4]=y,i[5]=l.pathname,i[6]=u,i[7]=a,i[8]=G,i[9]=q):(G=i[8],q=i[9]),c.useEffect(G,q);const F=$.find(je=>je.conversation_id===w)??null;let H;i[10]!==w||i[11]!==v?(H=mw(v,w),i[10]=w,i[11]=v,i[12]=H):H=i[12];const N=H;c.useEffect(()=>{F&&a(F.team_id)},[F,a]);let A;i[13]!==d?(A=je=>je.team_id===d,i[13]=d,i[14]=A):A=i[14];const W=$.filter(A).sort(iR),V=(v==null?void 0:v.team_id)===d?v:F&&F.team_id===d?F:null;let K;i[15]!==f?(K=je=>{C(null),f({conversation:String(je)})},i[15]=f,i[16]=K):K=i[16];const re=K;let oe;i[17]!==f?(oe=je=>{f({[O3]:"1"},{replace:!0}),C(je)},i[17]=f,i[18]=oe):oe=i[18];const Z=oe;let fe;i[19]!==f?(fe=()=>{C(null),f({},{replace:!0})},i[19]=f,i[20]=fe):fe=i[20];const me=fe;let Q;i[21]!==f?(Q=je=>{C(Fe=>gw(Fe,je)),f({conversation:String(je)},{replace:!0})},i[21]=f,i[22]=Q):Q=i[22];const j=Q;let X;i[23]!==v||i[24]!==(F==null?void 0:F.conversation_id)?(X=()=>{v!=null&&v.conversation_id&&(F==null?void 0:F.conversation_id)===v.conversation_id&&C(null)},i[23]=v,i[24]=F==null?void 0:F.conversation_id,i[25]=X):X=i[25];let Te;i[26]!==v||i[27]!==F?(Te=[v,F],i[26]=v,i[27]=F,i[28]=Te):Te=i[28],c.useEffect(X,Te);let Ce,Ie;i[29]!==v||i[30]!==E||i[31]!==y||i[32]!==f?(Ce=()=>{E&&!v&&!y&&f({},{replace:!0})},Ie=[E,v,y,f],i[29]=v,i[30]=E,i[31]=y,i[32]=f,i[33]=Ce,i[34]=Ie):(Ce=i[33],Ie=i[34]),c.useEffect(Ce,Ie);let ge,Re;i[35]!==v||i[36]!==d?(ge=()=>{v&&v.team_id!==d&&C(null)},Re=[v,d],i[35]=v,i[36]=d,i[37]=ge,i[38]=Re):(ge=i[37],Re=i[38]),c.useEffect(ge,Re);let Se,Ve;i[39]!==W||i[40]!==v||i[41]!==t||i[42]!==F||i[43]!==f?(Se=()=>{v||F||W.length===0||t&&f({conversation:String(W[0].conversation_id)},{replace:!0})},Ve=[v,F,W,t,f],i[39]=W,i[40]=v,i[41]=t,i[42]=F,i[43]=f,i[44]=Se,i[45]=Ve):(Se=i[44],Ve=i[45]),c.useEffect(Se,Ve);let L,ye;i[46]!==w||i[47]!==N||i[48]!==x||i[49]!==F||i[50]!==f?(L=()=>{!x&&w&&!F&&!N&&f({},{replace:!0})},ye=[x,w,F,N,f],i[46]=w,i[47]=N,i[48]=x,i[49]=F,i[50]=f,i[51]=L,i[52]=ye):(L=i[51],ye=i[52]),c.useEffect(L,ye);const ne=(V==null?void 0:V.conversation_id)??null;let Je,St;if(i[53]!==ne?(Je=()=>{if(es.isExpo())return es.sendMessageToWebview({type:"ACTIVE_CONVERSATION",conversationId:ne}),tR},St=[ne],i[53]=ne,i[54]=Je,i[55]=St):(Je=i[54],St=i[55]),c.useEffect(Je,St),!d){const je=e?!1:"lg";let Fe;i[56]===Symbol.for("react.memo_cache_sentinel")?(Fe=m(VS,{icon:OS,title:"Select a team",description:"Each team has its own chats. Pick a team to see its messages.",sx:{py:{xs:8,md:12}}}),i[56]=Fe):Fe=i[56];let Zt;return i[57]!==je?(Zt=m(Yu,{title:"Messages",children:m(D3,{maxWidth:je,children:Fe})}),i[57]=je,i[58]=Zt):Zt=i[58],Zt}if(!t&&V){let je;i[59]===Symbol.for("react.memo_cache_sentinel")?(je=m(HS,{styles:{"@media (hover: none)":{"html, body":{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},"input, textarea, [contenteditable='true']":{WebkitUserSelect:"text !important",userSelect:"text !important"}}}}),i[59]=je):je=i[59];let Fe,Zt;i[60]===Symbol.for("react.memo_cache_sentinel")?(Fe={WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},Zt={WebkitUserSelect:"text",userSelect:"text"},i[60]=Fe,i[61]=Zt):(Fe=i[60],Zt=i[61]);let ui;i[62]!==s.bottom?(ui={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:eR,display:"flex",flexDirection:"column",overflow:"hidden",bgcolor:"background.paper",pb:s.bottom,"&, & *":Fe,"& textarea, & input":Zt},i[62]=s.bottom,i[63]=ui):ui=i[63];const Di=V.conversation_id??V.draft_key;let di;i[64]!==me||i[65]!==j||i[66]!==V||i[67]!==Di?(di=m(bm,{conversation:V,onBack:me,onConversationCreated:j},Di),i[64]=me,i[65]=j,i[66]=V,i[67]=Di,i[68]=di):di=i[68];let hi;return i[69]!==ui||i[70]!==di?(hi=B(Yu,{title:"Messages",children:[je,m(U,{className:"thg-collapse-pb-on-keyboard",sx:ui,children:di})]}),i[69]=ui,i[70]=di,i[71]=hi):hi=i[71],hi}if(!t){let je;return i[72]!==h||i[73]!==W||i[74]!==R||i[75]!==P||i[76]!==x||i[77]!==Z||i[78]!==_||i[79]!==re||i[80]!==d?(je=m(Yu,{title:"Messages",children:m(Kp,{conversations:W,isPending:x,isError:P,error:R,onRetry:_,selectedId:null,teamId:d,canCompose:h,onSelect:re,onDraft:Z})}),i[72]=h,i[73]=W,i[74]=R,i[75]=P,i[76]=x,i[77]=Z,i[78]=_,i[79]=re,i[80]=d,i[81]=je):je
83=i[81],je}const st=e?!1:"lg";let Dt;i[82]===Symbol.for("react.memo_cache_sentinel")?(Dt={mb:{md:"-72px",lg:"-60px"}},i[82]=Dt):Dt=i[82];let qt;i[83]===Symbol.for("react.memo_cache_sentinel")?(qt={display:"flex",mt:.5,height:{md:"calc(100vh - 100px - var(--thg-safe-top, 0px))",lg:"calc(100vh - 112px - var(--thg-safe-top, 0px))"},minHeight:420},i[83]=qt):qt=i[83];const Ft=(V==null?void 0:V.conversation_id)??null;let Kt;i[84]!==h||i[85]!==W||i[86]!==R||i[87]!==P||i[88]!==x||i[89]!==Z||i[90]!==_||i[91]!==re||i[92]!==d||i[93]!==Ft?(Kt=m(Kp,{conversations:W,isPending:x,isError:P,error:R,onRetry:_,selectedId:Ft,teamId:d,canCompose:h,onSelect:re,onDraft:Z}),i[84]=h,i[85]=W,i[86]=R,i[87]=P,i[88]=x,i[89]=Z,i[90]=_,i[91]=re,i[92]=d,i[93]=Ft,i[94]=Kt):Kt=i[94];let Lt;i[95]!==W||i[96]!==R||i[97]!==j||i[98]!==P||i[99]!==x||i[100]!==_||i[101]!==V?(Lt=V?m(bm,{conversation:V,onConversationCreated:j},V.conversation_id??V.draft_key):P?m($h,{error:R,subject:"conversations",onRetry:_}):m(te,{variant:"body2",sx:{m:"auto",color:"text.secondary",px:3,textAlign:"center"},children:x?"Loading conversations…":W.length===0?"No conversations yet.":"Pick a conversation to start chatting."}),i[95]=W,i[96]=R,i[97]=j,i[98]=P,i[99]=x,i[100]=_,i[101]=V,i[102]=Lt):Lt=i[102];let Pt;i[103]!==Kt||i[104]!==Lt?(Pt=B(jS,{sx:qt,children:[Kt,Lt]}),i[103]=Kt,i[104]=Lt,i[105]=Pt):Pt=i[105];let Qt;return i[106]!==st||i[107]!==Pt?(Qt=m(Yu,{title:"Messages",children:m(D3,{maxWidth:st,sx:Dt,children:Pt})}),i[106]=st,i[107]=Pt,i[108]=Qt):Qt=i[108],Qt}function eR(i){return i.zIndex.appBar}function tR(){es.sendMessageToWebview({type:"ACTIVE_CONVERSATION",conversationId:null})}function iR(i,e){return(i.type==="team"?0:1)-(e.type==="team"?0:1)}const sA=Object.freeze(Object.defineProperty({__proto__:null,default:JM},Symbol.toStringTag,{value:"Module"}));export{Wt as A,de as B,Bl as C,Ke as D,ey as H,Fm as I,Le as L,sA as M,Mi as Q,Zm as R,lo as T,Ym as V,Z0 as a,_h as b,se as c,ke as d,vc as e,Gx as f,zn as g,u0 as h,Cc as i,oo as j,zd as k,I as l,wt as m,Fl as n,Hi as o,Dh as p,Si as q,gg as r,le as s,Ot as t,Om as u,pt as v,h0 as w,_e as x,Y as y,bo as z};
84//# sourceMappingURL=MessagesPage-DG-wnBOn.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.