PageSourceSearch

https://101-app.com/assets/PresentationLiveKitRuntimeHost-Dxsvr5Pu.js

js 101-app.com collected 2026-09-24 10:22:29 UTC 507,010 bytes, 187 lines download raw bytes

1import{i as Rg,h as $g,S as Fg}from"./access-BXd_9QSi.js";import{A as Vu,C as Dg}from"./AppModal-_gpJhA01.js";import{d as Te,b as A,j as B,i as x,g as F,f as P,k as ct,B as le,y as gi,l as re,h as R,c as g,_ as at,w as Ie,G as Oa,o as Lt,r as D,e as $,I as Rr,u as b,P as xg,X as Bg,ax as dr,J as zu,a0 as Qs,x as or,F as an,p as ji,n as Ku,W as he,an as Ai,aw as Zs,q as a2,m as Og,aP as bs,aN as r2,D as Ug,E as Ng,aS as ic,V as Vi,a as Rn,aj as Gg,ao as Vg}from"./state-Bf4GxglA.js";import{ScreenSharePresets as tr,VideoPresets as zi,getLogger as zg,supportsAudioOutputSelection as Kg,DisconnectReason as ac,Track as Mt,RoomEvent as be,Room as qg,VideoQuality as o2}from"./livekit-client.esm-J0cj41Fh.js";import{M as qu,p as jg}from"./playIncomingMessageSound-D2JVvEqK.js";import{O as Wg,S as n0,e as Hg}from"./loginNavigation-C4K-gJz_.js";import{i as nr}from"./index-VVJ-IlTB.js";import{n as mi,m as rc}from"./uiNotifications-DWoj9DrK.js";import{c as Xg,j as wo,V as i0,A as Yg,z as Wa,bf as Jg,bg as s2,bh as Qg}from"./app-cB5V4-9m.js";import{M as a0,D as Zg,P as ev,C as ju,L as tv}from"./more-CSfVgy-B.js";import{C as ta}from"./ContextMenu-if3xGOkI.js";import{M as Kc,R as r0,a as o0}from"./record-P-38PnKa.js";import{f as el}from"./formatters-DP_whHc-.js";import{C as qc}from"./camera-CDafnajz.js";import{C as s0}from"./copy-Bo83vbGg.js";import{E as l0}from"./edit-slider-Ty0S9z1w.js";import{P as c0}from"./phone-BItNA7a7.js";import{P as u0}from"./photo-D1k-2Vd4.js";import{b as Wu,V as nv,a as iv}from"./volume0-DesyqBeu.js";import{r as av,u as rv}from"./sendDirectTextMessage-BVC0Pm-e.js";import{T as Ut}from"./Tooltip-UlFd0FDH.js";import{S as d0}from"./screen-share-desktop-on-DZMbkDNq.js";import{W as ov}from"./ToastStack-P9mxotRU.js";import sv from"./MobileVoiceSessionBar-Czeax3Mm.js";import{u as h0}from"./runtimeLinks-PJDHs5pG.js";import{g as lv}from"./appQrCode-YrlPdshG.js";import{L as cv}from"./link-Ci_EqkqP.js";import{C as uv}from"./collapse-D7nyjday.js";import{E as dv}from"./expand-DUfd_P-h.js";import{u as na}from"./useMutation-nzCaNP2E.js";import{a as Pi}from"./apiClient-BWe3_tUG.js";import"./authenticated-capabilities-DzTuL0zT.js";import{u as m0}from"./ProjectExpenseSectionView.vue_vue_type_style_index_0_scoped_88ad6904_lang-CnvVNYEa.js";import{u as hv}from"./useQuery-CW5T5Kpo.js";import{u as mv}from"./usePresentationLiveKitRoute-uU-QCL2X.js";import"./SubscriptionTariffCard-C3UvCqCH.js";import"./site-prose-tables-LYjPkEqr.js";import"./checkmark--ZtKPZj_.js";import"./sub-pro-CMvGPmYk.js";import"./useAppLocale-DSzVRhv6.js";import"./features-CpgW7gMG.js";import"./utils-BdzSUDVd.js";import"./clear-70e119C3.js";import"./index-CECM-pZb.js";import"./tokens-DERl5KQ3.js";import"./standalone-CD02vMDA.js";import"./UserMenu-ML_6wUhn.js";import"./SegmentedControl-BP1NeJDN.js";import"./telegram-fill-CeQYJPz1.js";import"./useQueryClient-B_BD89vW.js";import"./instance-BCdBOrNX.js";import"./accountSessions-CYc_MUx3.js";import"./config-B6ZtljKq.js";import"./chart-gantt-CW6yTwDD.js";import"./email-CC4Ea1JT.js";import"./useQueryGetCurrentUserProfileV2-Wn70hE-X.js";import"./settings-C0evd4Vc.js";import"./categoryRailWidth-ClUTvyiz.js";import"./pricelist-BQlUrT1G.js";import"./FunnelWorkspace.vue_vue_type_style_index_1_lang-twrG3DRm.js";import"./calendar-Cdf_HnFD.js";import"./main-jWU6doY2.js";import"./publicGanttRoute-BT0dFshY.js";import"./publicWikiRoute-DMRVm09F.js";import"./filter-off-DgDqN5ie.js";import"./index-D-Y7_pJH.js";import"./error-DXjYLH3L.js";const fv="Все участники будут отключены, презентация будет отмечена как проведенная.",pv="Все участники будут отключены, встреча будет отмечена как не состоявшаяся, так как пользователь не явился на встречу.",gv="00:00:00",vv=Te({__name:"PresentationLiveKitEndMeetingConfirmationModal",props:{canClose:{type:Boolean},isInstantMeeting:{type:Boolean},isEndingMeeting:{type:Boolean},meetingDurationLabel:{},open:{type:Boolean},waitingDurationLabel:{}},emits:["close","confirm","reschedule","update:open"],setup(e,{emit:t}){const n=e,i=t,a=g(()=>n.meetingDurationLabel===gv),r=g(()=>a.value&&n.isInstantMeeting!==!0),o=g(()=>a.value?pv:fv),s=l=>{i("update:open",l)};return(l,u)=>(A(),B(Vu,{"close-on-backdrop":e.canClose,"close-on-escape":e.canClose,open:e.open,width:420,title:"Завершить встречу",onClose:u[3]||(u[3]=c=>i("close")),"onUpdate:open":s},{default:x(()=>[F("div",{class:P(l.$style.endConfirmation)},[F("p",{class:P(["text-subhead-regular",l.$style.endConfirmationText]),"data-test":"presentation-livekit-end-message"},ct(o.value),3),F("p",{class:P(["text-subhead-regular",l.$style.endConfirmationDuration]),"data-test":"presentation-livekit-end-waiting-duration"}," Ожидание: "+ct(e.waitingDurationLabel),3),F("p",{class:P(["text-subhead-regular",l.$style.endConfirmationDuration]),"data-test":"presentation-livekit-end-meeting-duration"}," Длительность: "+ct(e.meetingDurationLabel),3),F("div",{class:P([l.$style.endConfirmationActions,"ds-modal-sticky-actions"])},[r.value?(A(),B(le,{key:0,"data-test":"presentation-livekit-reschedule-meeting",variant:"primary",disabled:e.isEndingMeeting,onClick:u[0]||(u[0]=c=>i("reschedule"))},{default:x(()=>[...u[4]||(u[4]=[gi(" Перенести встречу ",-1)])]),_:1},8,["disabled"])):re("",!0),F("span",{class:P(l.$style.endConfirmationActionsSpacer)},null,2),R(le,{variant:"secondary",disabled:e.isEndingMeeting,onClick:u[1]||(u[1]=c=>i("close"))},{default:x(()=>
1[...u[5]||(u[5]=[gi(" Отмена ",-1)])]),_:1},8,["disabled"]),R(le,{"data-test":"presentation-livekit-end-confirm",variant:"primary",tone:"danger",loading:e.isEndingMeeting,onClick:u[2]||(u[2]=c=>i("confirm"))},{default:x(()=>[...u[6]||(u[6]=[gi(" Завершить ",-1)])]),_:1},8,["loading"])],2)],2)]),_:1},8,["close-on-backdrop","close-on-escape","open"]))}}),bv="_endConfirmation_18ttm_1",yv="_endConfirmationText_18ttm_6",Sv="_endConfirmationDuration_18ttm_11",kv="_endConfirmationActions_18ttm_17",wv="_endConfirmationActionsSpacer_18ttm_23",Tv={endConfirmation:bv,endConfirmationText:yv,endConfirmationDuration:Sv,endConfirmationActions:kv,endConfirmationActionsSpacer:wv},Ev={$style:Tv},Mv=at(vv,[["__cssModules",Ev]]),l2=["h720","h1080"],En="__presentation_livekit_default__",c2=[15,30],Ua=24,tl="user",To=[15,Ua,30],ia=e=>typeof e=="number"&&To.some(t=>t===e)?e:Ua,Av={facingMode:tl,resolution:{...zi.h720.resolution,frameRate:Ua}},Pv={videoEncoding:{...zi.h720.encoding,maxFramerate:Ua}},f0={resolution:zi.h180.resolution},_v={videoEncoding:zi.h180.encoding};tr.h1080fps30.resolution;tr.h1080fps30.encoding;const p0="maximum",g0={economy:tr.h720fps15,balanced:tr.h720fps30,maximum:tr.h1080fps30,presentation:tr.h1080fps15},Cv={economy:{frameRate:15,resolution:"h720"},balanced:{frameRate:30,resolution:"h720"},presentation:{frameRate:15,resolution:"h1080"},maximum:{frameRate:30,resolution:"h1080"}},nl=e=>e==="economy"||e==="balanced"||e==="presentation"||e==="maximum"?e:p0,Iv=e=>Cv[e],Lv=(e,t)=>e==="h720"?t===30?"balanced":"economy":t===30?"maximum":"presentation",Rv=e=>({audio:e.screenShare.includeSystemAudio,resolution:g0[nl(e.screenShare.quality)].resolution,systemAudio:e.screenShare.includeSystemAudio?"include":"exclude"}),$v=e=>({screenShareEncoding:g0[nl(e.screenShare.quality)].encoding}),v0={h360:zi.h360,h540:zi.h540,h720:zi.h720,h1080:zi.h1080},Fv="h720",u2=["h1080","h720","h540","h360"],d2=[30,Ua,15],Hu=e=>e.backgroundMode!=="disabled",b0=e=>{const t=e.camera.resolution??"h720";return Hu(e)&&t==="h1080"?Fv:t},h2=e=>{const t=e.camera.advancedConstraints?.resizeMode;return t==="crop-and-scale"||t==="none"?t:void 0},Dv=e=>e==="environment"?"environment":tl,oc=(e,t,n)=>{if(t)return f0;const i=v0[b0(e)],a=ia(e.camera.frameRate),r={...i.resolution,frameRate:a};return{...e.camera.deviceId?{deviceId:e.camera.deviceId}:{},facingMode:Dv(e.camera.facingMode),...h2(e)?{resizeMode:h2(e)}:{},...n?{processor:n}:{},resolution:r}},xv=(e,t)=>{const n=v0[b0(e)];return{...Hu(e)?{degradationPreference:"maintain-framerate"}:{},videoEncoding:{...n.encoding,maxFramerate:ia(e.camera.frameRate)}}},Bv=e=>{const t=u2.indexOf(e);return u2[t+1]??null},Ov=e=>{const t=d2.findIndex(i=>i===e);return d2[t+1]??null},Uv=e=>{if(!Hu(e))return null;const t=e.camera.resolution??"h720",n=ia(e.camera.frameRate),i=Ov(n);if(t==="h540"&&i)return{...e.camera,frameRate:i,resolution:t};const a=Bv(t);return a?{...e.camera,frameRate:n===30?Ua:n,resolution:a}:i?{...e.camera,frameRate:i,resolution:t}:null},Nv=e=>e instanceof HTMLVideoElement,mo=(e,t)=>(e.autoplay=!0,e.controls=!1,e.muted=t.isMuted,Nv(e)&&(e.playsInline=!0),e),m2=e=>e.name?.trim()||e.identity||null,sc=(e,t)=>`${e.identity}:${t}`,Gv="presentation-livekit-media-settings:v1",Cs="settings",Si="backgrounds",y0="current",Is="current",jc="background:",Vv=e=>e==="environment"?"environment":tl,sr=e=>typeof e=="string"&&e.length>0?e:void 0,Lo=()=>({audio:{},backgroundImageUrl:null,backgroundMode:"disabled",camera:{facingMode:tl,frameRate:Ua,resolution:"h720"},microphone:{},screenShare:{includeSystemAudio:!0,quality:p0}}),zv=()=>typeof window<"u"&&typeof window.indexedDB<"u",il=()=>new Promise(e=>{if(!zv()){e(null);return}const t=window.indexedDB.open(Gv,1);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Cs)||n.createObjectStore(Cs),n.objectStoreNames.contains(Si)||n.createObjectStore(Si)},t.onerror=()=>e(null),t.onsuccess=()=>e(t.result)}),Wc=async(e,t)=>{const n=await il();return n?new Promise(i=>{const a=n.transaction(e,"readonly"),r=a.objectStore(e).get(t);r.onerror=()=>i(null),r.onsuccess=()=>i(r.result??null),a.oncomplete=()=>n.close(),a.onerror=()=>n.close()}):null},S0=async(e,t,n)=>{const i=await il();i&&await new Promise(a=>{const r=i.transaction(e,"readwrite");r.objectStore(e).put(n,t),r.oncomplete=()=>{i.close(),a()},r.onerror=()=>{i.close(),a()}})},f2=async(e,t)=>{const n=await il();n&&await new Promise(i=>{const a=n.transaction(e,"readwrite");a.objectStore(e).delete(t),a.oncomplete=()=>{n.close(),i()},a.onerror=()=>{n.close(),i()}})},Kv=async()=>{const e=Lo(),t=await Wc(Cs,y0);return t?{...e,...t,audio:{...e.audio,...t.audio,outputDeviceId:sr(t.audio.outputDeviceId)},camera:{...e.camera,...t.camera,deviceId:sr(t.camera.deviceId),facingMode:Vv(t.camera.facingMode),frameRate:ia(t.camera.frameRate)},microphone:{...e.microphone,...t.microphone,deviceId:sr(t.microphone.deviceId)},screenShare:{...e.screenShare,...t.screenShare,includeSystemAudio:t.screenShare?.includeSystemAudio!==!1,qual
1ity:nl(t.screenShare?.quality)}}:e},qv=e=>({audio:{...e.audio,outputDeviceId:sr(e.audio.outputDeviceId)},backgroundImageId:e.backgroundImageId,backgroundImageUrl:null,backgroundMode:e.backgroundMode,camera:{...e.camera,advancedConstraints:e.camera.advancedConstraints?{...e.camera.advancedConstraints}:void 0,frameRate:ia(e.camera.frameRate),deviceId:sr(e.camera.deviceId)},microphone:{...e.microphone,deviceId:sr(e.microphone.deviceId)},screenShare:{includeSystemAudio:e.screenShare.includeSystemAudio!==!1,quality:nl(e.screenShare?.quality)}}),jv=async e=>{await S0(Cs,y0,qv(e))},Wv=async()=>{const e=await il();return e?new Promise(t=>{const n=e.transaction(Si,"readonly"),i=n.objectStore(Si).getAllKeys();i.onerror=()=>t([]),i.onsuccess=()=>{t(i.result.filter(a=>typeof a=="string"))},n.oncomplete=()=>e.close(),n.onerror=()=>e.close()}):[]},k0=e=>`${jc}${e}`,Hv=e=>e.startsWith(jc)?e.slice(jc.length):null,Xv=async()=>{const e=await Wv();return(await Promise.all(e.map(async n=>{if(n===Is){const r=await Wc(Si,n);return r?{blob:r,createdAt:0,id:Is}:null}const i=Hv(n);if(!i)return null;const a=await Wc(Si,n);return a instanceof Blob?{blob:a,createdAt:0,id:i}:a}))).filter(n=>!!n).sort((n,i)=>n.createdAt-i.createdAt)},Yv=async e=>{await S0(Si,k0(e.id),e)},Jv=async e=>{await f2(Si,k0(e)),e===Is&&await f2(Si,Is)},Qv=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;var hr=typeof self<"u"?self:{};function w0(e,t){e:{for(var n=["CLOSURE_FLAGS"],i=hr,a=0;a<n.length;a++)if((i=i[n[a]])==null){n=null;break e}n=i}return(e=n&&n[e])!=null?e:t}function fa(){throw Error("Invalid UTF8")}function p2(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Yo,lc;const Zv=typeof TextDecoder<"u";let e5;const t5=typeof TextEncoder<"u";function T0(e){if(t5)e=(e5||=new TextEncoder).encode(e);else{let n=0;const i=new Uint8Array(3*e.length);for(let a=0;a<e.length;a++){var t=e.charCodeAt(a);if(t<128)i[n++]=t;
1else{if(t<2048)i[n++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&a<e.length){const r=e.charCodeAt(++a);if(r>=56320&&r<=57343){t=1024*(t-55296)+r-56320+65536,i[n++]=t>>18|240,i[n++]=t>>12&63|128,i[n++]=t>>6&63|128,i[n++]=63&t|128;continue}a--}t=65533}i[n++]=t>>12|224,i[n++]=t>>6&63|128}i[n++]=63&t|128}}e=n===i.length?i:i.subarray(0,n)}return e}function E0(e){hr.setTimeout((()=>{throw e}),0)}var Hc,n5=w0(610401301,!1),g2=w0(748402147,!0);function v2(){var e=hr.navigator;return e&&(e=e.userAgent)?e:""}const b2=hr.navigator;function al(e){return al[" "](e),e}Hc=b2&&b2.userAgentData||null,al[" "]=function(){};const M0={};let so=null;function i5(e){const t=e.length;let n=3*t/4;n%3?n=Math.floor(n):"=.".indexOf(e[t-1])!=-1&&(n="=.".indexOf(e[t-2])!=-1?n-2:n-1);const i=new Uint8Array(n);let a=0;return(function(r,o){function s(u){for(;l<r.length;){const c=r.charAt(l++),m=so[c];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c)}return u}A0();let l=0;for(;;){const u=s(-1),c=s(0),m=s(64),f=s(64);if(f===64&&u===-1)break;o(u<<2|c>>4),m!=64&&(o(c<<4&240|m>>2),f!=64&&o(m<<6&192|f))}})(e,(function(r){i[a++]=r})),a!==n?i.subarray(0,a):i}function A0(){if(!so){so={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const i=e.concat(t[n].split(""));M0[n]=i;for(let a=0;a<i.length;a++){const r=i[a];so[r]===void 0&&(so[r]=a)}}}}var a5=typeof Uint8Array<"u",P0=!(!(n5&&Hc&&Hc.brands.length>0)&&(v2().indexOf("Trident")!=-1||v2().indexOf("MSIE")!=-1))&&typeof btoa=="function";const y2=/[-_.]/g,r5={"-":"+",_:"/",".":"="};function o5(e){return r5[e]||""}function _0(e){if(!P0)return i5(e);e=y2.test(e)?e.replace(y2,o5):e,e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Xu(e){return a5&&e!=null&&e instanceof Uint8Array}var mr={};function $a(){return s5||=new Jn(null,mr)}function Yu(e){C0(mr);var t=e.g;return(t=t==null||Xu(t)?t:typeof t=="string"?_0(t):null)==null?t:e.g=t}var Jn=class{h(){return new Uint8Array(Yu(this)||0)}constructor(t,n){if(C0(n),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let s5,l5;function C0(e){if(e!==mr)throw Error("illegal external caller")}function I0(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Xc(e){return I0(e=Error(e),"warning"),e}function fr(e,t){if(e!=null){var n=l5??={},i=n[e]||0;i>=t||(n[e]=i+1,I0(e=Error(),"incident"),E0(e))}}function $r(){return typeof BigInt=="function"}var Fr=typeof Symbol=="function"&&typeof Symbol()=="symbol";function ii(e,t,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var c5=ii("jas",void 0,!0),S2=ii(void 0,"0di"),io=ii(void 0,"1oa"),tn=ii(void 0,Symbol()),u5=ii(void 0,"0ub"),d5=ii(void 0,"0ubs"),Yc=ii(void 0,"0ubsb"),h5=ii(void 0,"0actk"),pr=ii("m_m","Pa",!0),k2=ii();const L0={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},R0=Object.defineProperties,j=Fr?c5:"Ga";var Na;const w2=[];function Ro(e,t){Fr||j in e||R0(e,L0),e[j]|=t}function pt(e,t){Fr||j in e||R0(e,L0),e[j]=t}function $o(e){return Ro(e,34),e}function Eo(e){return Ro(e,8192),e}pt(w2,7),Na=Object.freeze(w2);var gr={};function rn(e,t){return t===void 0?e.h!==Fa&&!!(2&(0|e.v[j])):!!(2&t)&&e.h!==Fa}const Fa={};function Ju(e,t){if(e!=null){if(typeof e=="string")e=e?new Jn(e,mr):$a();else if(e.constructor!==Jn)if(Xu(e))e=e.length?new Jn(new Uint8Array(e),mr):$a();else{if(!t)throw Error();e=void 0}}return e}let T2=class{constructor(t,n,i){this.g=t,this.h=n,this.l=i}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}};var m5=Object.freeze({});function $0(e,t,n){const i=128&t?0:-1,a=e.length;var r;(r=!!a)&&(r=(r=e[a-1])!=null&&typeof r=="object"&&r.constructor===Object);const o=a+(r?-1:0);for(t=128&t?1:0;t<o;t++)n(t-i,e[t]);if(r){e=e[a-1];for(const s in e)!isNaN(s)&&n(+s,e[s])}}var F0={};function Dr(e){return 128&e?F0:void 0}function rl(e){return e.Na=!0,e}var f5=rl((e=>typeof e=="number")),E2=rl((e=>typeof e=="string")),p5=rl((e=>typeof e=="boolean")),ol=typeof hr.BigInt=="function"&&typeof hr.BigInt(0)=="bigint";function nn(e){var t=e;if(E2(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(f5(t)&&!Number.isSafeInteger(t))throw Error(String(t));return ol?BigInt(e):e=p5(e)?e?"1":"0":E2(e)?e.trim()||"0":String(e)}var Jc=rl((e=>ol?e>=v5&&e<=y5:e[0]==="-"?M2(e,g5):M2(e,b5)));const g5=Number.MIN_SAFE_INTEGER.toString(),v5=ol?BigInt(Number.MIN_SAFE_INTEGER):void 0,b5=Number.MAX_SAFE_INTEGER.toString(),y5=ol?BigInt(Number.MAX_SAFE_INTEGER):void 0;function M2(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i>a)return!1;if(i<a)return!0}}const S5=typeof Uint8Array.prototype.slice=="function";let k5,Ve=0,ot=0;function A2(e){const t=e>>>0;Ve=t,ot=(e-t)/4294967296>>>0}function vr(e){if(e<0){A2(-e);const[t,n]=ed(Ve,ot);Ve=t>>>0,ot=n>>>0}else A2(e)}function Qu(e){const t=k5||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),ot=0,Ve=t.getUint32(0,!0)}function D0(e,t){const n=4294967296*t+(e>>>0);return Number.isSafeInteger(n)?n:Mo(e,t)}
1function w5(e,t){return nn($r()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Mo(e,t))}function x0(e,t){return $r()?nn(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):nn(Zu(e,t))}function Mo(e,t){if(e>>>=0,(t>>>=0)<=2097151)var n=""+(4294967296*t+e);else $r()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,e>=1e7&&(n+=e/1e7>>>0,e%=1e7),n>=1e7&&(t+=n/1e7>>>0,n%=1e7),n=t+P2(n)+P2(e));return n}function P2(e){return e=String(e),"0000000".slice(e.length)+e}function Zu(e,t){if(2147483648&t)if($r())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[n,i]=ed(e,t);e="-"+Mo(n,i)}else e=Mo(e,t);return e}function sl(e){if(e.length<16)vr(Number(e));else if($r())e=BigInt(e),Ve=Number(e&BigInt(4294967295))>>>0,ot=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ot=Ve=0;const n=e.length;for(let i=t,a=(n-t)%6+t;a<=n;i=a,a+=6){const r=Number(e.slice(i,a));ot*=1e6,Ve=1e6*Ve+r,Ve>=4294967296&&(ot+=Math.trunc(Ve/4294967296),ot>>>=0,Ve>>>=0)}if(t){const[i,a]=ed(Ve,ot);Ve=i,ot=a}}}function ed(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Fn(e){return Array.prototype.slice.call(e)}const Fo=typeof BigInt=="function"?BigInt.asIntN:void 0,T5=typeof BigInt=="function"?BigInt.asUintN:void 0,Da=Number.isSafeInteger,ll=Number.isFinite,br=Math.trunc,E5=nn(0);function lo(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function Yn(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Ao(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function B0(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const M5=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Do(e){switch(typeof e){case"bigint":return!0;case"number":return ll(e);case"string":return M5.test(e);default:return!1}}function xr(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return ll(e)?0|e:void 0}function O0(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return ll(e)?e>>>0:void 0}function U0(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(sl(e),Zu(Ve,ot))}function td(e){if(e=br(e),!Da(e)){vr(e);var t=Ve,n=ot;(e=2147483648&n)&&(n=~n>>>0,(t=1+~t>>>0)==0&&(n=n+1>>>0)),e=typeof(t=D0(t,n))=="number"?e?-t:t:e?"-"+t:t}return e}function N0(e){var t=br(Number(e));return Da(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),U0(e))}function G0(e){var t=br(Number(e));return Da(t)?nn(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),$r()?nn(Fo(64,BigInt(e))):nn(U0(e)))}function V0(e){return Da(e)?e=nn(td(e)):(e=br(e),Da(e)?e=String(e):(vr(e),e=Zu(Ve,ot)),e=nn(e)),e}function Ls(e){const t=typeof e;return e==null?e:t==="bigint"?nn(Fo(64,e)):Do(e)?t==="string"?G0(e):V0(e):void 0}function z0(e){if(typeof e!="string")throw Error();return e}function xo(e){if(e!=null&&typeof e!="string")throw Error();return e}function Tt(e){return e==null||typeof e=="string"?e:void 0}function nd(e,t,n,i){return e!=null&&e[pr]===gr?e:Array.isArray(e)?((i=(n=0|e[j])|32&i|2&i)!==n&&pt(e,i),new t(e)):(n?2&i?((e=t[S2])||($o((e=new t).v),e=t[S2]=e),t=e):t=new t:t=void 0,t)}function A5(e,t,n){if(t)e:{if(!Do(t=e))throw Xc("int64");switch(typeof t){case"string":t=G0(t);break e;case"bigint":t=nn(Fo(64,t));break e;default:t=V0(t)}}else t=Ls(e);return(e=t)==null?n?E5:void 0:e}const P5={};let _5=(function(){try{return al(new class extends Map{constructor(){super()}}),!1}catch{return!0}})(),cc=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,n){return this.g.set(t,n),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,n){return this.g.forEach(t,n)}[Symbol.iterator](){return this.entries()}};const C5=_5?(Object.setPrototypeOf(cc.prototype,Map.prototype),Object.defineProperties(cc.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),cc):class extends Map{constructor(){super()}};function _2(e){return e}function uc(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var ki=class extends C5{constructor(t,n,i=_2,a=_2){super(),this.J=0|t[j],this.K=n,this.S=i,this.fa=this.K?I5:a;for(let r=0;r<t.length;r++){const o=t[r],s=i(o[0],!1,!0);let l=o[1];n?l===void 0&&(l=null):l=a(o[1],!1,!0,void 0,void 0,this.J),super.set(s,l)}}V(t){return Eo(Array.from(super.entries(),t))}clear(){uc(this),super.clear()}delete(t){return uc(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new T2(t,L5,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new T2(t,ki.prototype.get,this)}else t=super.values();return t}forEach(t,n){this.K?super.forEach(((i,a,r)=>{t.call(n,r.get(a),a,r)})):super.forEach(t,n)}set(t,n){return uc(this),(t=this.S(t,!0,!1))==null?this:n==null?(super.delete(t),this):super.set(t,this.fa(n,!0,!0,this.K,!1,this.J))}Ma(t){const n=this.S(t[0],!1,!0);t=t[1],t=this.K?t===void 0?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(n,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const n=super.get(t);if(n!==void 0){var i=this.K;return i?((i=this.fa(n,!1,!0,i,this.ra,this.J))!==n&&super.set(t,i),i):n}}[Symbol.iterator](){return this.entries()}};function I5(e,t,n,i,a,r){return e=nd(e,i,n,r),a&&(e=ad(e)),e}function L5(e){return[e,this.get(e)]}let R5;function C2(){return R5||=new ki($o([]),void 0,void 0,void 0,P5)}function cl(e){return tn?e[tn]:void 0}function Rs(e,t){for(const n in e)!isNaN(n)&&t(e,+n,e[n])}ki.prototype.toJSON=void 0;var Qc=class{};const $5={Ka:!0};function F5(e,t){t<100||fr(d5,1)}function ul(e,t,n,i){const a=i!==void 0;i=!!i;var r,o=tn;!a&&Fr&&o&&(r=e[o])&&Rs(r,F5),o=[];var s=e.length;let l;r=4294967295;let u=!1;const c=!!(64&t),m=c?128&t?0:-1:void 0;1&t||(l=s&&e[s-1],l!=null&&typeof l=="object"&&l.constructor===Object?r=--s:l=void 0,!c||128&t||a||(u=!0,r=r-m+m)),t=void 0;for(var f=0;f<s;f++){let h=e[f];
1if(h!=null&&(h=n(h,i))!=null)if(c&&f>=r){const d=f-m;(t??={})[d]=h}else o[f]=h}if(l)for(let h in l){if((s=l[h])==null||(s=n(s,i))==null)continue;let d;f=+h,c&&!Number.isNaN(f)&&(d=f+m)<r?o[d]=s:(t??={})[h]=s}return t&&(u?o.push(t):o[r]=t),a&&tn&&(e=cl(e))&&e instanceof Qc&&(o[tn]=(function(h){const d=new Qc;return Rs(h,((y,S,p)=>{d[S]=Fn(p)})),d.da=h.da,d})(e)),o}function D5(e){return e[0]=Po(e[0]),e[1]=Po(e[1]),e}function Po(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Jc(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[j];return e.length===0&&1&t?void 0:ul(e,t,Po)}if(e!=null&&e[pr]===gr)return K0(e);if(e instanceof Jn){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(P0){for(var n="",i=0,a=t.length-10240;i<a;)n+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));n+=String.fromCharCode.apply(null,i?t.subarray(i):t),t=btoa(n)}else{n===void 0&&(n=0),A0(),n=M0[n],i=Array(Math.floor(t.length/3)),a=n[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var r=t[u],o=t[u+1],s=t[u+2],l=n[r>>2];r=n[(3&r)<<4|o>>4],o=n[(15&o)<<2|s>>6],s=n[63&s],i[c++]=l+r+o+s}switch(l=0,s=a,t.length-u){case 2:s=n[(15&(l=t[u+1]))<<2]||a;case 1:t=t[u],i[c]=n[t>>2]+n[(3&t)<<4|l>>4]+s+a}t=i.join("")}e=e.g=t}return e}return e instanceof ki?e=e.size!==0?e.V(D5):void 0:void 0}return e}let x5,B5;function K0(e){return ul(e=e.v,0|e[j],Po)}function Ea(e,t){return q0(e,t[0],t[1])}function q0(e,t,n,i=0){if(e==null){var a=32;n?(e=[n],a|=128):e=[],t&&(a=-16760833&a|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(a=0|e[j],g2&&1&a)throw Error("rfarr");if(2048&a&&!(2&a)&&(function(){if(g2)throw Error("carr");fr(h5,5)})(),256&a)throw Error("farr");if(64&a)return(a|i)!==a&&pt(e,a|i),e;if(n&&(a|=128,n!==e[0]))throw Error("mid");e:{a|=64;var r=(n=e).length;if(r){var o=r-1;const l=n[o];if(l!=null&&typeof l=="object"&&l.constructor===Object){if((o-=t=128&a?0:-1)>=1024)throw Error("pvtlmt");for(var s in l)(r=+s)<o&&(n[r+t]=l[s],delete l[s]);a=-16760833&a|(1023&o)<<14;break e}}if(t){if((s=Math.max(t,r-(128&a?0:-1)))>1024)throw Error("spvt");a=-16760833&a|(1023&s)<<14}}}return pt(e,64|a|i),e}function O5(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var n=0|e[j];return e.length===0&&1&n?void 0:I2(e,n,t)}if(e!=null&&e[pr]===gr)return L2(e);if(e instanceof ki){if(2&(t=e.J))return e;if(!e.size)return;if(n=$o(e.V()),e.K)for(e=0;e<n.length;e++){const i=n[e];let a=i[1];a=a==null||typeof a!="object"?void 0:a!=null&&a[pr]===gr?L2(a):Array.isArray(a)?I2(a,0|a[j],!!(32&t)):void 0,i[1]=a}return n}return e instanceof Jn?e:void 0}function I2(e,t,n){return 2&t||(!n||4096&t||16&t?e=Br(e,t,!1,n&&!(16&t)):(Ro(e,34),4&t&&Object.freeze(e))),e}function id(e,t,n){return e=new e.constructor(t),n&&(e.h=Fa),e.m=Fa,e}function L2(e){const t=e.v,n=0|t[j];return rn(e,n)?e:rd(e,t,n)?id(e,t):Br(t,n)}function Br(e,t,n,i){return i??=!!(34&t),e=ul(e,t,O5,i),i=32,n&&(i|=2),pt(e,t=16769217&t|i),e}function ad(e){const t=e.v,n=0|t[j];return rn(e,n)?rd(e,t,n)?id(e,t,!0):new e.constructor(Br(t,n,!1)):e}function Or(e){if(e.h!==Fa)return!1;var t=e.v;return Ro(t=Br(t,0|t[j]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function Ur(e){if(!Or(e)&&rn(e,0|e.v[j]))throw Error()}function Ga(e,t){t===void 0&&(t=0|e[j]),32&t&&!(4096&t)&&pt(e,4096|t)}function rd(e,t,n){return!!(2&n)||!(!(32&n)||4096&n)&&(pt(t,2|n),e.h=Fa,!0)}const j0=nn(0),xi={};function ze(e,t,n,i,a){if((t=wi(e.v,t,n,a))!==null||i&&e.m!==Fa)return t}function wi(e,t,n,i){if(t===-1)return null;const a=t+(n?0:-1),r=e.length-1;let o,s;if(!(r<1+(n?0:-1))){if(a>=r)if(o=e[r],o!=null&&typeof o=="object"&&o.constructor===Object)n=o[t],s=!0;else{if(a!==r)return;n=o}else n=e[a];if(i&&n!=null){if((i=i(n))==null)return i;if(!Object.is(i,n))return s?o[t]=i:e[a]=i,i}return n}}function Ae(e,t,n,i){Ur(e),mt(e=e.v,0|e[j],t,n,i)}function mt(e,t,n,i,a){const r=n+(a?0:-1);var o=e.length-1;if(o>=1+(a?0:-1)&&r>=o){const s=e[o];if(s!=null&&typeof s=="object"&&s.constructor===Object)return s[n]=i,t}return r<=o?(e[r]=i,t):(i!==void 0&&(n>=(o=(t??=0|e[j])>>14&1023||536870912)?i!=null&&(e[o+(a?0:-1)]={[n]:i}):e[r]=i),t)}function wa(){return m5===void 0?2:4}function Ta(e,t,n,i,a){let r=e.v,o=0|r[j];i=rn(e,o)?1:i,a=!!a||i===3,i===2&&Or(e)&&(r=e.v,o=0|r[j]);let s=(e=od(r,t))===Na?7:0|e[j],l=sd(s,o);var u=!(4&l);if(u){4&l&&(e=Fn(e),s=0,l=Aa(l,o),o=mt(r,o,t,e));let c=0,m=0;for(;c<e.length;c++){const f=n(e[c]);f!=null&&(e[m++]=f)}m<c&&(e.length=m),n=-513&(4|l),l=n&=-1025,l&=-4097}return l!==s&&(pt(e,l),2&l&&Object.freeze(e)),W0(e,l,r,o,t,i,u,a)}function W0(e,t,n,i,a,r,o,s){let l=t;return r===1||r===4&&(2&t||!(16&t)&&32&i)?Ma(t)||((t|=!e.length||o&&!(4096&t)||32&i&&
1!(4096&t||16&t)?2:256)!==l&&pt(e,t),Object.freeze(e)):(r===2&&Ma(t)&&(e=Fn(e),l=0,t=Aa(t,i),i=mt(n,i,a,e)),Ma(t)||(s||(t|=16),t!==l&&pt(e,t))),2&t||!(4096&t||16&t)||Ga(n,i),e}function od(e,t,n){return e=wi(e,t,n),Array.isArray(e)?e:Na}function sd(e,t){return 2&t&&(e|=2),1|e}function Ma(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function H0(e){return Ju(e,!0)}function X0(e){e=Fn(e);for(let t=0;t<e.length;t++){const n=e[t]=Fn(e[t]);Array.isArray(n[1])&&(n[1]=$o(n[1]))}return Eo(e)}function Ui(e,t,n,i){Ur(e),mt(e=e.v,0|e[j],t,(i==="0"?Number(n)===0:n===i)?void 0:n)}function Nr(e,t,n){if(2&t)throw Error();const i=Dr(t);let a=od(e,n,i),r=a===Na?7:0|a[j],o=sd(r,t);return(2&o||Ma(o)||16&o)&&(o===r||Ma(o)||pt(a,o),a=Fn(a),r=0,o=Aa(o,t),mt(e,t,n,a,i)),o&=-13,o!==r&&pt(a,o),a}function dc(e,t){var n=Nm;return cd(ld(e=e.v),e,void 0,n)===t?t:-1}function ld(e){if(Fr)return e[io]??(e[io]=new Map);if(io in e)return e[io];const t=new Map;return Object.defineProperty(e,io,{value:t}),t}function Y0(e,t,n,i,a){const r=ld(e),o=cd(r,e,t,n,a);return o!==i&&(o&&(t=mt(e,t,o,void 0,a)),r.set(n,i)),t}function cd(e,t,n,i,a){let r=e.get(i);if(r!=null)return r;r=0;for(let o=0;o<i.length;o++){const s=i[o];wi(t,s,a)!=null&&(r!==0&&(n=mt(t,n,r,void 0,a)),r=s)}return e.set(i,r),r}function ud(e,t,n){let i=0|e[j];const a=Dr(i),r=wi(e,n,a);let o;if(r!=null&&r[pr]===gr){if(!rn(r))return Or(r),r.v;o=r.v}else Array.isArray(r)&&(o=r);if(o){const s=0|o[j];2&s&&(o=Br(o,s))}return o=Ea(o,t),o!==r&&mt(e,i,n,o,a),o}function J0(e,t,n,i,a){let r=!1;if((i=wi(e,i,a,(o=>{const s=nd(o,n,!1,t);return r=s!==o&&s!=null,s})))!=null)return r&&!rn(i)&&Ga(e,t),i}function Se(e,t,n,i){let a=e.v,r=0|a[j];if((t=J0(a,r,t,n,i))==null)return t;if(r=0|a[j],!rn(e,r)){const o=ad(t);o!==t&&(Or(e)&&(a=e.v,r=0|a[j]),r=mt(a,r,n,t=o,i),Ga(a,r))}return t}function Q0(e,t,n,i,a,r,o,s){var l=rn(e,n);r=l?1:r,o=!!o||r===3,l=s&&!l,(r===2||l)&&Or(e)&&(n=0|(t=e.v)[j]);var u=(e=od(t,a))===Na?7:0|e[j],c=sd(u,n);if(s=!(4&c)){var m=e,f=n;const h=!!(2&c);h&&(f|=2);let d=!h,y=!0,S=0,p=0;for(;S<m.length;S++){const v=nd(m[S],i,!1,f);
1if(v instanceof i){if(!h){const _=rn(v);d&&=!_,y&&=_}m[p++]=v}}p<S&&(m.length=p),c|=4,c=y?-4097&c:4096|c,c=d?8|c:-9&c}if(c!==u&&(pt(e,c),2&c&&Object.freeze(e)),l&&!(8&c||!e.length&&(r===1||r===4&&(2&c||!(16&c)&&32&n)))){for(Ma(c)&&(e=Fn(e),c=Aa(c,n),n=mt(t,n,a,e)),i=e,l=c,u=0;u<i.length;u++)(m=i[u])!==(c=ad(m))&&(i[u]=c);l|=8,pt(e,c=l=i.length?4096|l:-4097&l)}return W0(e,c,t,n,a,r,s,o)}function Ti(e,t,n){const i=e.v;return Q0(e,i,0|i[j],t,n,wa(),!1,!0)}function Z0(e){return e==null&&(e=void 0),e}function ee(e,t,n,i,a){return Ae(e,n,i=Z0(i),a),i&&!rn(i)&&Ga(e.v),e}function fo(e,t,n,i){e:{var a=i=Z0(i);Ur(e);const r=e.v;let o=0|r[j];if(a==null){const s=ld(r);if(cd(s,r,o,n)!==t)break e;s.set(n,0)}else o=Y0(r,o,n,t);mt(r,o,t,a)}i&&!rn(i)&&Ga(e.v)}function Aa(e,t){return-273&(2&t?2|e:-3&e)}function dd(e,t,n,i){var a=i;Ur(e),e=Q0(e,i=e.v,0|i[j],n,t,2,!0),a=a??new n,e.push(a),t=n=e===Na?7:0|e[j],(a=rn(a))?(n&=-9,e.length===1&&(n&=-4097)):n|=4096,n!==t&&pt(e,n),a||Ga(i)}function wn(e,t,n){return xr(ze(e,t,void 0,n))}function tt(e,t){return ze(e,t,void 0,void 0,Yn)??0}function Ei(e,t,n){if(n!=null){if(typeof n!="number"||!ll(n))throw Xc("int32");n|=0}Ae(e,t,n)}function J(e,t,n){Ae(e,t,lo(n))}function on(e,t,n){Ui(e,t,xo(n),"")}function $s(e,t,n){{Ur(e);const o=e.v;let s=0|o[j];if(n==null)mt(o,s,t);else{var i=e=n===Na?7:0|n[j],a=Ma(e),r=a||Object.isFrozen(n);for(a||(e=0),r||(n=Fn(n),i=0,e=Aa(e,s),r=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??1024,a=0;a<n.length;a++){const l=n[a],u=z0(l);Object.is(l,u)||(r&&(n=Fn(n),i=0,e=Aa(e,s),r=!1),n[a]=u)}e!==i&&(r&&(n=Fn(n),e=Aa(e,s)),pt(n,e)),mt(o,s,t,n)}}}function dl(e,t,n){Ur(e),Ta(e,t,Tt,2,!0).push(z0(n))}var Ha=class{constructor(t,n,i){if(this.buffer=t,i&&!n)throw Error();this.g=n}};function hd(e,t){if(typeof e=="string")return new Ha(_0(e),t);if(Array.isArray(e))return new Ha(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new Ha(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new Ha(e,!1);if(e.constructor===Jn)return t=Yu(e)||new Uint8Array(0),new Ha(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Ha(e,!1);throw Error()}function md(e,t){let n,i=0,a=0,r=0;const o=e.h;let s=e.g;do n=o[s++],i|=(127&n)<<r,r+=7;while(r<32&&128&n);if(r>32)for(a|=(127&n)>>4,r=3;r<32&&128&n;r+=7)n=o[s++],a|=(127&n)<<r;if(Pa(e,s),!(128&n))return t(i>>>0,a>>>0);throw Error()}function fd(e){let t=0,n=e.g;const i=n+10,a=e.h;for(;n<i;){const r=a[n++];if(t|=r,(128&r)==0)return Pa(e,n),!!(127&t)}throw Error()}function Wi(e){const t=e.h;let n=e.g,i=t[n++],a=127&i;if(128&i&&(i=t[n++],a|=(127&i)<<7,128&i&&(i=t[n++],a|=(127&i)<<14,128&i&&(i=t[n++],a|=(127&i)<<21,128&i&&(i=t[n++],a|=i<<28,128&i&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw Error();return Pa(e,n),a}function Qn(e){return Wi(e)>>>0}function Fs(e){var t=e.h;const n=e.g;var i=t[n],a=t[n+1];const r=t[n+2];return t=t[n+3],Pa(e,e.g+4),e=2*((a=(i<<0|a<<8|r<<16|t<<24)>>>0)>>31)+1,i=a>>>23&255,a&=8388607,i==255?a?NaN:e*(1/0):i==0?1401298464324817e-60*e*a:e*Math.pow(2,i-150)*(a+8388608)}function U5(e){return Wi(e)}function Pa(e,t){if(e.g=t,t>e.l)throw Error()}function em(e,t){if(t<0)throw Error();const n=e.g;if((t=n+t)>e.l)throw Error();return e.g=t,n}function tm(e,t){if(t==0)return $a();var n=em(e,t);return e.Y&&e.j?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?new Uint8Array(0):S5?e.slice(n,t):new Uint8Array(e.subarray(n,t))),n.length==0?$a():new Jn(n,mr)}var R2=[];function nm(e,t,n,i){if(Ds.length){const a=Ds.pop();return a.o(i),a.g.init(e,t,n,i),a}return new N5(e,t,n,i)}function im(e){e.g.clear(),e.l=-1,e.h=-1,Ds.length<100&&Ds.push(e)}function am(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var n=Qn(e.g);if(t=n>>>3,!((n&=7)>=0&&n<=5)||t<1)throw Error();return e.l=t,e.h=n,!0}function ys(e){switch(e.h){case 0:e.h!=0?ys(e):fd(e.g);break;case 1:Pa(e=e.g,e.g+8);break;case 2:if(e.h!=2)ys(e);else{var t=Qn(e.g);Pa(e=e.g,e.g+t)}break;case 5:Pa(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!am(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}ys(e)}break;default:throw Error()}}
1function Bo(e,t,n){const i=e.g.l;var a=Qn(e.g);let r=(a=e.g.g+a)-i;if(r<=0&&(e.g.l=a,n(t,e,void 0,void 0,void 0),r=a-e.g.g),r)throw Error();return e.g.g=a,e.g.l=i,t}function pd(e){var t=Qn(e.g),n=em(e=e.g,t);if(e=e.h,Zv){var i,a=e;(i=lc)||(i=lc=new TextDecoder("utf-8",{fatal:!0})),t=n+t,a=n===0&&t===a.length?a:a.subarray(n,t);try{var r=i.decode(a)}catch(s){if(Yo===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),Yo=!0}catch{Yo=!1}}throw!Yo&&(lc=void 0),s}}else{t=(r=n)+t,n=[];let s,l=null;for(;r<t;){var o=e[r++];o<128?n.push(o):o<224?r>=t?fa():(s=e[r++],o<194||(192&s)!=128?(r--,fa()):n.push((31&o)<<6|63&s)):o<240?r>=t-1?fa():(s=e[r++],(192&s)!=128||o===224&&s<160||o===237&&s>=160||(192&(i=e[r++]))!=128?(r--,fa()):n.push((15&o)<<12|(63&s)<<6|63&i)):o<=244?r>=t-2?fa():(s=e[r++],(192&s)!=128||s-144+(o<<28)>>30!=0||(192&(i=e[r++]))!=128||(192&(a=e[r++]))!=128?(r--,fa()):(o=(7&o)<<18|(63&s)<<12|(63&i)<<6|63&a,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):fa(),n.length>=8192&&(l=p2(l,n),n.length=0)}r=p2(l,n)}return r}function rm(e){const t=Qn(e.g);return tm(e.g,t)}function hl(e,t,n){var i=Qn(e.g);for(i=e.g.g+i;e.g.g<i;)n.push(t(e.g))}var N5=class{constructor(t,n,i,a){if(R2.length){const r=R2.pop();r.init(t,n,i,a),t=r}else t=new class{constructor(r,o,s,l){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(r,o,s,l)}init(r,o,s,{Y:l=!1,ea:u=!1}={}){this.Y=l,this.ea=u,r&&(r=hd(r,this.ea),this.h=r.buffer,this.j=r.g,this.m=o||0,this.l=s!==void 0?this.m+s:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(t,n,i,a);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.o(a)}o({ha:t=!1}={}){this.ha=t}},Ds=[];function $2(e){return e?/^\d+$/.test(e)?(sl(e),new Zc(Ve,ot)):null:G5||=new Zc(0,0)}var Zc=class{constructor(t,n){this.h=t>>>0,this.g=n>>>0}};let G5;function F2(e){return e?/^-?\d+$/.test(e)?(sl(e),new eu(Ve,ot)):null:V5||=new eu(0,0)}var eu=class{constructor(t,n){this.h=t>>>0,this.g=n>>>0}};let V5;function lr(e,t,n){for(;n>0||t>127;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function Gr(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ml(e,t){if(t>=0)Gr(e,t);else{for(let n=0;n<9;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function gd(e){var t=Ve;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function yr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function An(e,t,n){Gr(e.g,8*t+n)}function vd(e,t){return An(e,t,2),t=e.g.end(),yr(e,t),t.push(e.h),t}function bd(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;n>127;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function fl(e,t,n){An(e,t,2),Gr(e.g,n.length),yr(e,e.g.end()),yr(e,n)}function xs(e,t,n,i){n!=null&&(t=vd(e,t),i(n,e),bd(e,t))}function ai(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}
1var yd=ai(),om=ai(),Sd=ai(),kd=ai(),wd=ai(),sm=ai(),z5=ai(),pl=ai(),lm=ai(),cm=ai();function ri(e,t,n){var i=e.v;tn&&tn in i&&(i=i[tn])&&delete i[t.g],t.h?t.j(e,t.h,t.g,n,t.l):t.j(e,t.g,n,t.l)}var W=class{constructor(t,n){this.v=q0(t,n,void 0,2048)}toJSON(){return K0(this)}j(){var t=E6,n=this.v,i=t.g,a=tn;if(Fr&&a&&n[a]?.[i]!=null&&fr(u5,3),n=t.g,k2&&tn&&k2===void 0&&(a=(i=this.v)[tn])&&(a=a.da))try{a(i,n,$5)}catch(r){E0(r)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){const t=this.v,n=0|t[j];return rd(this,t,n)?id(this,t,!0):new this.constructor(Br(t,n,!1))}};W.prototype[pr]=gr,W.prototype.toString=function(){return this.v.toString()};var Vr=class{constructor(t,n,i){this.g=t,this.h=n,t=yd,this.l=!!t&&i===t||!1}};function gl(e,t){return new Vr(e,t,yd)}function um(e,t,n,i,a){xs(e,n,fm(t,i),a)}const K5=gl((function(e,t,n,i,a){return e.h===2&&(Bo(e,ud(t,i,n),a),!0)}),um),q5=gl((function(e,t,n,i,a){return e.h===2&&(Bo(e,ud(t,i,n),a),!0)}),um);var vl=Symbol(),bl=Symbol(),tu=Symbol(),D2=Symbol(),x2=Symbol();let dm,hm;function Va(e,t,n,i){var a=i[e];if(a)return a;(a={}).qa=i,a.T=(function(m){switch(typeof m){case"boolean":return x5||=[0,void 0,!0];case"number":return m>0?void 0:m===0?B5||=[0,void 0]:[-m,void 0];case"string":return[0,m];case"object":return m}})(i[0]);var r=i[1];let o=1;r&&r.constructor===Object&&(a.ba=r,typeof(r=i[++o])=="function"&&(a.ma=!0,dm??=r,hm??=i[o+1],r=i[o+=2]));const s={};for(;r&&Array.isArray(r)&&r.length&&typeof r[0]=="number"&&r[0]>0;){for(var l=0;l<r.length;l++)s[r[l]]=r;r=i[++o]}for(l=1;r!==void 0;){let m;typeof r=="number"&&(l+=r,r=i[++o]);var u=void 0;if(r instanceof Vr?m=r:(m=K5,o--),m?.l){r=i[++o],u=i;var c=o;typeof r=="function"&&(r=r(),u[c]=r),u=r}for(c=l+1,typeof(r=i[++o])=="number"&&r<0&&(c-=r,r=i[++o]);l<c;l++){const f=s[l];u?n(a,l,m,u,f):t(a,l,m,f)}}return i[e]=a}function mm(e){return Array.isArray(e)?e[0]instanceof Vr?e:[q5,e]:[e,void 0]}function fm(e,t){return e instanceof W?e.v:Array.isArray(e)?Ea(e,t):void 0}function Td(e,t,n,i){const a=n.g;e[t]=i?(r,o,s)=>a(r,o,s,i):a}function Ed(e,t,n,i,a){const r=n.g;let o,s;e[t]=(l,u,c)=>r(l,u,c,s||=Va(bl,Td,Ed,i).T,o||=Md(i),a)}function Md(e){let t=e[tu];if(t!=null)return t;const n=Va(bl,Td,Ed,e);return t=n.ma?(i,a)=>dm(i,a,n):(i,a)=>{for(;am(a)&&a.h!=4;){var r=a.l,o=n[r];if(o==null){var s=n.ba;s&&(s=s[r])&&(s=W5(s))!=null&&(o=n[r]=s)}if(o==null||!o(a,i,r)){if(o=(s=a).m,ys(s),s.ha)var l=void 0;else l=s.g.g-o,s.g.g=o,l=tm(s.g,l);o=void 0,s=i,l&&((o=s[tn]??(s[tn]=new Qc))[r]??(o[r]=[])).push(l)}}return(i=cl(i))&&(i.da=n.qa[x2]),!0},e[tu]=t,e[x2]=j5.bind(e),t}function j5(e,t,n,i){var a=this[bl];const r=this[tu],o=Ea(void 0,a.T),s=cl(e);if(s){var l=!1,u=a.ba;if(u){if(a=(c,m,f)=>{if(f.length!==0)if(u[m])for(const h of f){c=nm(h);try{l=!0,r(o,c)}finally{im(c)}}else i?.(e,m,f)},t==null)Rs(s,a);else if(s!=null){const c=s[t];c&&a(s,t,c)}if(l){let c=0|e[j];if(2&c&&2048&c&&!n?.Ka)throw Error();const m=Dr(c),f=(h,d)=>{if(wi(e,h,m)!=null){if(n?.Qa===1)return;throw Error()}d!=null&&(c=mt(e,c,h,d,m)),delete s[h]};t==null?$0(o,0|o[j],((h,d)=>{f(h,d)})):f(t,wi(o,t,m))}}}}function W5(e){const t=(e=mm(e))[0].g;if(e=e[1]){const n=Md(e),i=Va(bl,Td,Ed,e).T;return(a,r,o)=>t(a,r,o,i,n)}return t}function yl(e,t,n){e[t]=n.h}function Sl(e,t,n,i){let a,r;const o=n.h;e[t]=(s,l,u)=>o(s,l,u,r||=Va(vl,yl,Sl,i).T,a||=pm(i))}function pm(e){let t=e[D2];if(!t){const n=Va(vl,yl,Sl,e);t=(i,a)=>gm(i,a,n),e[D2]=t}return t}function gm(e,t,n){$0(e,0|e[j],((i,a)=>{if(a!=null){var r=(function(o,s){var l=o[s];if(l)return l;if((l=o.ba)&&(l=l[s])){var u=(l=mm(l))[0].h;if(l=l[1]){const c=pm(l),m=Va(vl,yl,Sl,l).T;l=o.ma?hm(m,c):(f,h,d)=>u(f,h,d,m,c)}else l=u;return o[s]=l}})(n,i);r?r(t,a,i):i<500||fr(Yc,3)}})),(e=cl(e))&&Rs(e,((i,a,r)=>{for(yr(t,t.g.end()),i=0;i<r.length;i++)yr(t,Yu(r[i])||new Uint8Array(0))}))}const H5=nn(0);function zr(e,t){if(Array.isArray(t)){var n=0|t[j];if(4&n)return t;for(var i=0,a=0;i<t.length;i++){const r=e(t[i]);r!=null&&(t[a++]=r)}return a<i&&(t.length=a),(e=-1537&(5|n))!==n&&pt(t,e),2&e&&Object.freeze(t),t}}function Rt(e,t,n){return new Vr(e,t,n)}function Kr(e,t,n){return new Vr(e,t,n)}function $t(e,t,n){mt(e,0|e[j],t,n,Dr(0|e[j]))}var X5=gl((function(e,t,n,i,a){if(e.h!==2)return!1;if(e=Fn(e=Bo(e,Ea([void 0,void 0],i),a)),a=Dr(i=0|t[j]),2&i)throw Error();let r=wi(t,n,a);if(r instanceof ki)(2&r.J)!=0?(r=r.V(),r.push(e),mt(t,i,n,r,a)):r.Ma(e);else if(Array.isArray(r)){var o=0|r[j];8192&o||pt(r,o|=8192),2&o&&(r=X0(r),mt(t,i,n,r,a)),r.push(e)}else mt(t,i,n,Eo([e]),a);return!0}),(function(e,t,n,i,a){if(t instanceof ki)t.forEach(((r,o)=>{xs(e,n,Ea([o,r],i),a)}));else if(Array.isArray(t)){for(let r=0;r<t.length;r++){const o=t[r];Array.isArray(o)&&xs(e,n,Ea(o,i),a)}Eo(t)}}));function vm(e,t,n){(t=Yn(t))!=null&&(An(e,n,5),e=e.g,Qu(t),gd(e))}function bm(e,t,n){if(t=(function(i){if(i==null)return i;const a=typeof i;if(a==="bigint")return String(Fo(64,i));
1if(Do(i)){if(a==="string")return N0(i);if(a==="number")return td(i)}})(t),t!=null&&(typeof t=="string"&&F2(t),t!=null))switch(An(e,n,0),typeof t){case"number":e=e.g,vr(t),lr(e,Ve,ot);break;case"bigint":n=BigInt.asUintN(64,t),n=new eu(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),lr(e.g,n.h,n.g);break;default:n=F2(t),lr(e.g,n.h,n.g)}}function ym(e,t,n){(t=xr(t))!=null&&t!=null&&(An(e,n,0),ml(e.g,t))}function Sm(e,t,n){(t=B0(t))!=null&&(An(e,n,0),e.g.g.push(t?1:0))}function km(e,t,n){(t=Tt(t))!=null&&fl(e,n,T0(t))}function wm(e,t,n,i,a){xs(e,n,fm(t,i),a)}function Tm(e,t,n){(t=t==null||typeof t=="string"||t instanceof Jn?t:void 0)!=null&&fl(e,n,hd(t,!0).buffer)}function Em(e,t,n){(t=O0(t))!=null&&t!=null&&(An(e,n,0),Gr(e.g,t))}function Mm(e,t,n){return(e.h===5||e.h===2)&&(t=Nr(t,0|t[j],n),e.h==2?hl(e,Fs,t):t.push(Fs(e.g)),!0)}var ut=Rt((function(e,t,n){return e.h===5&&($t(t,n,Fs(e.g)),!0)}),vm,pl),Y5=Kr(Mm,(function(e,t,n){if((t=zr(Yn,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&(An(i,a,5),i=i.g,Qu(r),gd(i))}}),pl),Ad=Kr(Mm,(function(e,t,n){if((t=zr(Yn,t))!=null&&t.length){An(e,n,2),Gr(e.g,4*t.length);for(let i=0;i<t.length;i++)n=e.g,Qu(t[i]),gd(n)}}),pl),J5=Rt((function(e,t,n){return e.h===5&&($t(t,n,(e=Fs(e.g))===0?void 0:e),!0)}),vm,pl),Hi=Rt((function(e,t,n){return e.h!==0?e=!1:($t(t,n,md(e.g,x0)),e=!0),e}),bm,sm),hc=Rt((function(e,t,n){return e.h!==0?t=!1:($t(t,n,(e=md(e.g,x0))===H5?void 0:e),t=!0),t}),bm,sm),Q5=Rt((function(e,t,n){return e.h!==0?e=!1:($t(t,n,md(e.g,w5)),e=!0),e}),(function(e,t,n){if(t=(function(i){if(i==null)return i;var a=typeof i;if(a==="bigint")return String(T5(64,i));if(Do(i)){if(a==="string")return a=br(Number(i)),Da(a)&&a>=0?i=String(a):((a=i.indexOf("."))!==-1&&(i=i.substring(0,a)),(a=i[0]!=="-"&&((a=i.length)<20||a===20&&i<="18446744073709551615"))||(sl(i),i=Mo(Ve,ot))),i;if(a==="number")return(i=br(i))>=0&&Da(i)||(vr(i),i=D0(Ve,ot)),i}})(t),t!=null&&(typeof t=="string"&&$2(t),t!=null))switch(An(e,n,0),typeof t){case"number":e=e.g,vr(t),lr(e,Ve,ot);break;case"bigint":n=BigInt.asUintN(64,t),n=new Zc(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),lr(e.g,n.h,n.g);break;default:n=$2(t),lr(e.g,n.h,n.g)}}),z5),ht=Rt((function(e,t,n){return e.h===0&&($t(t,n,Wi(e.g)),!0)}),ym,kd),Oo=Kr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Nr(t,0|t[j],n),e.h==2?hl(e,Wi,t):t.push(Wi(e.g)),!0)}),(function(e,t,n){if((t=zr(xr,t))!=null&&t.length){n=vd(e,n);for(let i=0;i<t.length;i++)ml(e.g,t[i]);bd(e,n)}}),kd),ir=Rt((function(e,t,n){return e.h===0&&($t(t,n,(e=Wi(e.g))===0?void 0:e),!0)}),ym,kd),Ke=Rt((function(e,t,n){return e.h===0&&($t(t,n,fd(e.g)),!0)}),Sm,om),_a=Rt((function(e,t,n){return e.h===0&&($t(t,n,(e=fd(e.g))===!1?void 0:e),!0)}),Sm,om),At=Kr((function(e,t,n){return e.h===2&&(e=pd(e),Nr(t,0|t[j],n).push(e),!0)}),(function(e,t,n){if((t=zr(Tt,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&fl(i,a,T0(r))}}),Sd),Ni=Rt((function(e,t,n){return e.h===2&&($t(t,n,(e=pd(e))===""?void 0:e),!0)}),km,Sd),Ce=Rt((function(e,t,n){return e.h===2&&($t(t,n,pd(e)),!0)}),km,Sd),kt=(function(e,t,n=yd){return new Vr(e,t,n)})((function(e,t,n,i,a){return e.h===2&&(i=Ea(void 0,i),Nr(t,0|t[j],n).push(i),Bo(e,i,a),!0)}),(function(e,t,n,i,a){if(Array.isArray(t)){for(let r=0;r<t.length;r++)wm(e,t[r],n,i,a);1&(e=0|t[j])||pt(t,1|e)}})),Oe=gl((function(e,t,n,i,a,r){if(e.h!==2)return!1;let o=0|t[j];return Y0(t,o,r,n,Dr(o)),Bo(e,t=ud(t,i,n),a),!0}),wm),Am=Rt((function(e,t,n){return e.h===2&&($t(t,n,rm(e)),!0)}),Tm,lm),Z5=Kr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Nr(t,0|t[j],n),e.h==2?hl(e,Qn,t):t.push(Qn(e.g)),!0)}),(function(e,t,n){if((t=zr(O0,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&(An(i,a,0),Gr(i.g,r))}}),wd),e6=Rt((function(e,t,n){return e.h===0&&($t(t,n,(e=Qn(e.g))===0?void 0:e),!0)}),Em,wd),_t=Rt((function(e,t,n){return e.h===0&&($t(t,n,Wi(e.g)),!0)}),(function(e,t,n){(t=xr(t))!=null&&(t=parseInt(t,10),An(e,n,0),ml(e.g,t))}),cm);let t6=class{constructor(t,n){var i=un;this.g=t,this.h=n,this.m=Se,this.j=ee,this.defaultValue=void 0,this.l=i.Oa!=null?F0:void 0}register(){al(this)}};function oi(e,t){return new t6(e,t)}function aa(e,t){return(n,i)=>{{const r={ea:!0}
1;i&&Object.assign(r,i),n=nm(n,void 0,void 0,r);try{const o=new e,s=o.v;Md(t)(s,n);var a=o}finally{im(n)}}return a}}function kl(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};gm(this.v,t,Va(vl,yl,Sl,e)),yr(t,t.g.end());const n=new Uint8Array(t.h),i=t.l,a=i.length;let r=0;for(let o=0;o<a;o++){const s=i[o];n.set(s,r),r+=s.length}return t.l=[n],n}}var B2=class extends W{constructor(t){super(t)}},O2=[0,Ni,Rt((function(e,t,n){return e.h===2&&($t(t,n,(e=rm(e))===$a()?void 0:e),!0)}),(function(e,t,n){if(t!=null){if(t instanceof W){const i=t.Ra;return void(i?(t=i(t),t!=null&&fl(e,n,hd(t,!0).buffer)):fr(Yc,3))}if(Array.isArray(t))return void fr(Yc,3)}Tm(e,t,n)}),lm)];let mc,U2=globalThis.trustedTypes;function N2(e){var t;return mc===void 0&&(mc=(function(){let n=null;if(!U2)return n;try{const i=a=>a;n=U2.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return n})()),e=(t=mc)?t.createScriptURL(e):e,new class{constructor(n){this.g=n}toString(){return this.g+""}}(e)}function Jo(e,...t){if(t.length===0)return N2(e[0]);let n=e[0];for(let i=0;i<t.length;i++)n+=encodeURIComponent(t[i])+e[i+1];return N2(n)}var Pm=[0,ht,_t,Ke,-1,Oo,_t,-1,Ke],n6=class extends W{constructor(t){super(t)}},_m=[0,Ke,Ce,Ke,_t,-1,Kr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Nr(t,0|t[j],n),e.h==2?hl(e,U5,t):t.push(Wi(e.g)),!0)}),(function(e,t,n){if((t=zr(xr,t))!=null&&t.length){n=vd(e,n);for(let i=0;i<t.length;i++)ml(e.g,t[i]);bd(e,n)}}),cm),Ce,-1,[0,Ke,-1],_t,Ke,-1],Cm=[0,3,Ke,-1,2,[0,[2],ht,Oe,[0,Rt((function(e,t,n){return e.h===0&&($t(t,n,Qn(e.g)),!0)}),Em,wd)]],[0,_t,Ke,_t,Ke,_t,Ke,Ce,-1],[0,[3,4],Ce,-1,Oe,[0,ht],Oe,[0,_t]],[0]],Im=[0,Ce,-2],G2=class extends W{constructor(t){super(t)}},Lm=[0],Rm=[0,ht,Ke,1,Ke,-4],un=class extends W{constructor(t){super(t,2)}},ft={};ft[336783863]=[0,Ce,Ke,-1,ht,[0,[1,2,3,4,5,6,7,8,9],Oe,Lm,Oe,_m,Oe,Im,Oe,Rm,Oe,Pm,Oe,[0,Ce,-2],Oe,[0,Ce,_t],Oe,Cm,Oe,[0,_t,-1,Ke]],[0,Ce],Ke,[0,[1,3],[2,4],Oe,[0,Oo],-1,Oe,[0,At],-1,kt,[0,Ce,-1]],Ce];var V2=[0,hc,-1,_a,-3,hc,Oo,Ni,ir,hc,-1,_a,ir,_a,-2,Ni];function Ue(e,t){dl(e,3,t)}function pe(e,t){dl(e,4,t)}var Gt=class extends W{constructor(t){super(t,500)}o(t){return ee(this,0,7,t)}},po=[-1,{}],z2=[0,Ce,1,po],K2=[0,Ce,At,po];function Pn(e,t){dd(e,1,Gt,t)}function qe(e,t){dl(e,10,t)}function ke(e,t){dl(e,15,t)}var dn=class extends W{constructor(t){super(t,500)}o(t){return ee(this,0,1001,t)}},$m=[-500,kt,[-500,Ni,-1,At,-3,[-2,ft,Ke],kt,O2,ir,-1,z2,K2,kt,[0,Ni,_a],Ni,V2,ir,At,987,At],4,kt,[-500,Ce,-1,[-1,{}],998,Ce],kt,[-500,Ce,At,-1,[-2,{},Ke],997,At,-1],ir,kt,[-500,Ce,At,po,998,At],At,ir,z2,K2,kt,[0,Ni,-1,po],At,-2,V2,Ni,-1,_a,[0,_a,e6],978,po,kt,O2];dn.prototype.g=kl($m);var i6=aa(dn,$m),a6=class extends W{constructor(t){super(t)}},Fm=class extends W{constructor(t){super(t)}g(){return Ti(this,a6,1)}},Dm=[0,kt,[0,ht,ut,Ce,-1]],wl=aa(Fm,Dm),r6=class extends W{constructor(t){super(t)}},o6=class extends W{constructor(t){super(t)}},fc=class extends W{constructor(t){super(t)}l(){return Se(this,r6,2)}g(){return Ti(this,o6,5)}},xm=aa(class extends W{constructor(e){super(e)}},[0,At,Oo,Ad,[0,_t,[0,ht,-3],[0,ut,-3],[0,ht,-1,[0,kt,[0,ht,-2]]],kt,[0,ut,-1,Ce,ut]],Ce,-1,Hi,kt,[0,ht,ut],At,Hi]),Bm=class extends W{constructor(t){super(t)}},cr=aa(class extends W{constructor(e){super(e)}},[0,kt,[0,ut,-4]]),Om=class extends W{constructor(t){super(t)}},Uo=aa(class extends W{constructor(e){super(e)}},[0,kt,[0,ut,-4]]),s6=class extends W{constructor(t){super(t)}},l6=[0,ht,-1,Ad,_t],Um=class extends W{constructor(t){super(t)}};Um.prototype.g=kl([0,ut,-4,Hi]);var c6=class extends W{constructor(t){super(t)}},u6=aa(class extends W{constructor(e){super(e)}},[0,kt,[0,1,ht,Ce,Dm],Hi]),q2=class extends W{constructor(t){super(t)}},d6=class extends W{constructor(t){super(t)}na(){const t=ze(this,1,void 0,void 0,H0);return t??$a()}},h6=class extends W{constructor(t){super(t)}},Nm=[1,2],m6=aa(class extends W{constructor(e){super(e)}},[0,kt,[0,Nm,Oe,[0,Ad],Oe,[0,Am],ht,Ce],Hi]),Pd=class extends W{constructor(t){super(t)}},Gm=[0,Ce,ht,ut,At,-1],j2=class extends W{constructor(t){super(t)}},f6=[0,Ke,-1],W2=class extends W{constructor(t){super(t)}},Ss=[1,2,3,4,5,6],Bs=class extends W{constructor(t){super(t)}g(){return ze(this,1,void 0,void 0,H0)!=null}l(){return Tt(ze(this,2))!=null}},Ye=class extends W{constructor(t){super(t)}g(){return B0(ze(this,2))??!1}},Vm=[0,Am,Ce,[0,ht,Hi,-1],[0,Q5,Hi]],dt=[0,Vm,Ke,[0,Ss,Oe,Rm,Oe,_m,Oe,Pm,Oe,Lm,Oe,Im,Oe,Cm],_t],Tl=class extends W{constructor(t){super(t)}},_d=[0,dt,ut,-1,ht],p6=oi(502141897,Tl);ft[502141897]=_d;var g6=aa(class extends W{constructor(e){super(e)}},[0,[0,_t,-1,Y5,Z5],l6]),zm=class extends W{constructor(t){super(t)}},Km=class extends W{constructor(t){super(t)}},nu=[0,dt,ut,[0,dt],Ke],v6=oi(508968150,Km);ft[508968150]=[0,dt,_d,nu,ut,[0,[0,Vm]]],ft[508968149]=nu;var Xa=class extends W{constructor(t){super(t)}l(){return Se(this,Pd,2)}g(){Ae(this,2)}},qm=[0,dt,Gm];ft[478825465]=qm;var b6=class extends W{constructor(t){super(t)}},jm=class extends W{constructor(t){super(t)}},Cd=class extends W{constructor(t){super(t)}},Id=class extends W{constructor(t){super(t)}},Wm=class extends W{constructor(t){super(t)}},H2=[0,dt,[0,dt],qm,-1],Hm=[0,dt,ut,ht],Ld=[0,dt,ut],Xm=[0,dt,Hm,Ld,ut],y6=oi(479097054,Wm);ft[479097054]=[0,dt,Xm,H2],ft[463370452]=H2,ft[464864288]=Hm;var S6=oi(462713202,Id);ft[462713202]=Xm,ft[474472470]=Ld;var k6=class extends W{constructor(t){super(t)}},Ym=class extends W{constructor(t){super(t)}},Jm=class extends W{constructor(t){super(t)}},Qm=class extends W{constructor(t){super(t)}},Rd=[0,dt,ut,-1,ht],iu=[0,dt,ut,Ke];Qm.prototype.g=kl([0,dt,Ld,[0,dt],_d,nu,Rd,iu]);var Zm=class extends W{constructor(t){super(t)}},w6=oi(456383383,Zm);ft[456383383]=[0,dt,Gm];var ef=class extends W{constructor(t){super(t)}},T6=oi(476348187,ef);ft[476348187]=[0,dt,f6];var tf=class extends W{constructor(t){super(t)}},X2=class extends W{constructor(t){super(t)}},nf=[0,_t,-1],E6=oi(458105876,class extends W{constructor(e){super(e)}g(){let e;var t=this.v;const n=0|t[j];return e=rn(this,n),t=(function(i,a,r,o){var s=X2;!o&&Or(i)&&(r=0|(a=i.v)[j]);var l=wi(a,2);if(i=!1,l==null){if(o)return C2();l=[]}else if(l.constructor===ki){if(!(2&l.J)||o)return l;l=l.V()}else Array.isArray(l)?i=!!(2&(0|l[j])):l=[];if(o){if(!l.length)return C2();
1i||(i=!0,$o(l))}else i&&(i=!1,Eo(l),l=X0(l));return!i&&32&r&&Ro(l,32),r=mt(a,r,2,o=new ki(l,s,A5,void 0)),i||Ga(a,r),o})(this,t,n,e),!e&&X2&&(t.ra=!0),t}});ft[458105876]=[0,nf,X5,[!0,Hi,[0,Ce,-1,At]],[0,Oo,Ke,_t]];var $d=class extends W{constructor(t){super(t)}},af=oi(458105758,$d);ft[458105758]=[0,dt,Ce,nf];var pc=class extends W{constructor(t){super(t)}},Y2=[0,J5,-1,_a],M6=class extends W{constructor(t){super(t)}},rf=class extends W{constructor(t){super(t)}},au=[1,2];rf.prototype.g=kl([0,au,Oe,Y2,Oe,[0,kt,Y2]]);var of=class extends W{constructor(t){super(t)}},A6=oi(443442058,of);ft[443442058]=[0,dt,Ce,ht,ut,At,-1,Ke,ut],ft[514774813]=Rd;var sf=class extends W{constructor(t){super(t)}},P6=oi(516587230,sf);function ru(e,t){return t=t?t.clone():new Pd,e.displayNamesLocale!==void 0?Ae(t,1,xo(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Ae(t,1),e.maxResults!==void 0?Ei(t,2,e.maxResults):"maxResults"in e&&Ae(t,2),e.scoreThreshold!==void 0?J(t,3,e.scoreThreshold):"scoreThreshold"in e&&Ae(t,3),e.categoryAllowlist!==void 0?$s(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Ae(t,4),e.categoryDenylist!==void 0?$s(t,5,e.categoryDenylist):"categoryDenylist"in e&&Ae(t,5),t}function lf(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Fd(e,t=-1,n=""){return{categories:e.map((i=>({index:wn(i,1)??0??-1,score:tt(i,2)??0,categoryName:Tt(ze(i,3))??""??"",displayName:Tt(ze(i,4))??""??""}))),headIndex:t,headName:n}}function _6(e){const t={classifications:Ti(e,c6,1).map((n=>Fd(Se(n,Fm,4)?.g()??[],wn(n,2)??0,Tt(ze(n,3))??"")))};return(function(n){return n==null?n:typeof n=="bigint"?(Jc(n)?n=Number(n):(n=Fo(64,n),n=Jc(n)?Number(n):String(n)),n):Do(n)?typeof n=="number"?td(n):N0(n):void 0})(ze(e,2,void 0,void 0,Ls))!=null&&(t.timestampMs=lf(ze(e,2,void 0,void 0,Ls)??j0)),t}function cf(e){var t=Ta(e,3,Yn,wa()),n=Ta(e,2,xr,wa()),i=Ta(e,1,Tt,wa()),a=Ta(e,9,Tt,wa());const r={categories:[],keypoints:[]};for(let o=0;o<t.length;o++)r.categories.push({score:t[o],index:n[o]??-1,categoryName:i[o]??"",displayName:a[o]??""});if((t=Se(e,fc,4)?.l())&&(r.boundingBox={originX:wn(t,1,xi)??0,originY:wn(t,2,xi)??0,width:wn(t,3,xi)??0,height:wn(t,4,xi)??0,angle:0}),Se(e,fc,4)?.g().length)for(const o of Se(e,fc,4).g())r.keypoints.push({x:ze(o,1,void 0,xi,Yn)??0,y:ze(o,2,void 0,xi,Yn)??0,score:ze(o,4,void 0,xi,Yn)??0,label:Tt(ze(o,3,void 0,xi))??""});return r}function El(e){const t=[];for(const n of Ti(e,Om,1))t.push({x:tt(n,1)??0,y:tt(n,2)??0,z:tt(n,3)??0,visibility:tt(n,4)??0});return t}function go(e){const t=[];for(const n of Ti(e,Bm,1))t.push({x:tt(n,1)??0,y:tt(n,2)??0,z:tt(n,3)??0,visibility:tt(n,4)??0});return t}function J2(e){return Array.from(e,(t=>t>127?t-256:t))}function Q2(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let n=0,i=0,a=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r],i+=e[r]*e[r],a+=t[r]*t[r];if(i<=0||a<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(i*a)}let Qo;ft[516587230]=[0,dt,Rd,iu,ut],ft[518928384]=iu;const C6=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function uf(e){if(e)return!0;if(Qo===void 0)try{await WebAssembly.instantiate(C6),Qo=!0}catch{Qo=!1}return Qo}async function Zo(e,t,n){return{wasmLoaderPath:`${t}/${e}_${n=`wasm${n?"_module":""}${await uf(n)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}}var Za=class{};function df(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Z2(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((n,i)=>{t.addEventListener("load",(()=>{n()}),!1),t.addEventListener("error",(a=>{i(a)}),!1),document.body.appendChild(t)}))}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;{const n=self.import;n?await n(e.toString()):await import(e.toString())}}}function hf(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWi
1dth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function H(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function eh(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[i,a]=hf(t);return!e.l||i===e.i.canvas.width&&a===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=a),[i,a]}function th(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let a=0;a<t.length;a++)i[a]=e.i.stringToNewUTF8(t[a]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),n(t);for(const a of i)e.i._free(a);e.i._free(t)}function Kn(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function Bi(e,t,n){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(a,r,o)=>{r?(n(i,o),i=[]):i.push(a)}}Za.forVisionTasks=function(e,t=!1){return Zo("vision",e??Jo``,t)},Za.forTextTasks=function(e,t=!1){return Zo("text",e??Jo``,t)},Za.forGenAiTasks=function(e,t=!1){return Zo("genai",e??Jo``,t)},Za.forAudioTasks=function(e,t=!1){return Zo("audio",e??Jo``,t)},Za.isSimdSupported=function(e=!1){return uf(e)};async function I6(e,t,n,i){return e=await(async(a,r,o,s,l)=>{if(r&&await Z2(r),!self.ModuleFactory||o&&(await Z2(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&l&&((r=self.Module).locateFile=l.locateFile,l.mainScriptUrlOrBlob&&(r.mainScriptUrlOrBlob=l.mainScriptUrlOrBlob)),l=await self.ModuleFactory(self.Module||l),self.ModuleFactory=self.Module=void 0,new a(l,s)})(e,n.wasmLoaderPath,n.assetLoaderPath,t,{locateFile:a=>a.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&a.endsWith(".data")?n.assetBinaryPath.toString():a}),await e.o(i),e}function gc(e,t){const n=Se(e.baseOptions,Bs,1)||new Bs;typeof t=="string"?(Ae(n,2,xo(t)),Ae(n,1)):t instanceof Uint8Array&&(Ae(n,1,Ju(t,!1)),Ae(n,2)),ee(e.baseOptions,0,1,n)}function nh(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map((n=>n.message)).join(", "))}finally{e.H=[]}}function G(e,t){e.C=Math.max(e.C,t)}function Ml(e,t){e.B=new Gt,on(e.B,2,"PassThroughCalculator"),Ue(e.B,"free_memory"),pe(e.B,"free_memory_unused_out"),qe(t,"free_memory"),Pn(t,e.B)}function Sr(e,t){Ue(e.B,t),pe(e.B,t+"_unused_out")}function Al(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var ou=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,n=!0){if(n){const i=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Se(this.baseOptions,Bs,1)?.g()||Se(this.baseOptions,Bs,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(a,r){let o=Se(a.baseOptions,W2,3);if(!o){var s=o=new W2,l=new G2;fo(s,4,Ss,l)}"delegate"in r&&(r.delegate==="GPU"?(r=o,s=new n6,fo(r,2,Ss,s)):(r=o,s=new G2,fo(r,4,Ss,s))),ee(a.baseOptions,0,3,o)})(this,i),i.modelAssetPath)return fetch(i.modelAssetPath.toString()).then((a=>{if(a.ok)return a.arrayBuffer();throw Error(`Failed to fetch model: ${i.modelAssetPath} (${a.status})`)})).then((a=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(a),!0,!1,
1!1),gc(this,"/model.dat"),this.m(),this.L()}));if(i.modelAssetBuffer instanceof Uint8Array)gc(this,i.modelAssetBuffer);else if(i.modelAssetBuffer)return(async function(a){const r=[];for(var o=0;;){const{done:s,value:l}=await a.read();if(s)break;r.push(l),o+=l.length}if(r.length===0)return new Uint8Array(0);if(r.length===1)return r[0];a=new Uint8Array(o),o=0;for(const s of r)a.set(s,o),o+=s.length;return a})(i.modelAssetBuffer).then((a=>{gc(this,a),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let t;if(this.g.ca((n=>{t=i6(n)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,n){this.g.attachErrorListener(((i,a)=>{this.H.push(Error(a))})),this.g.Ja(),this.g.setGraph(t,n),this.B=void 0,nh(this)}finishProcessing(){this.g.finishProcessing(),nh(this)}close(){this.B=void 0,this.g.closeGraph()}};function Ki(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}ou.prototype.close=ou.prototype.close;class L6{constructor(t,n,i,a){this.g=t,this.h=n,this.m=i,this.l=a}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ih(e,t,n){const i=e.g;if(n=Ki(i.createShader(n),"Failed to create WebGL shader"),i.shaderSource(n,t),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(n)}`);return i.attachShader(e.h,n),n}function ah(e,t){const n=e.g,i=Ki(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(i);const a=Ki(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(e.O),n.vertexAttribPointer(e.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const r=Ki(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,r),n.enableVertexAttribArray(e.L),n.vertexAttribPointer(e.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new L6(n,i,a,r)}function Dd(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function R6(e,t,n,i){return Dd(e,t),e.h||(e.m(),e.D()),n?(e.u||(e.u=ah(e,!0)),n=e.u):(e.A||(e.A=ah(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=i(),n.g.bindVertexArray(null),e}function mf(e,t,n){return Dd(e,t),e=Ki(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function ff(e,t,n){Dd(e,t),e.B||(e.B=Ki(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function $6(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var pf=class{H(){return`
2  precision mediump float;
3  varying vec2 vTex;
4  uniform sampler2D inputTexture;
5  void main() {
6    gl_FragColor = texture2D(inputTexture, vTex);
7  }
8 `}m(){const t=this.g;if(this.h=Ki(t.createProgram(),"Failed to create WebGL program"),this.X=ih(this,`
9  attribute vec2 aVertex;
10  attribute vec2 aTex;
11  varying vec2 vTex;
12  void main(void) {
13    gl_Position = vec4(aVertex, 0.0, 1.0);
14    vTex = aTex;
15  }`,t.VERTEX_SHADER),this.W=ih(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.O=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function fi(e,t){switch(t){case 0:return e.g.find((n=>n instanceof Uint8Array));case 1:return e.g.find((n=>n instanceof Float32Array));case 2:return e.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function su(e){var t=fi(e,1);if(!t){if(t=fi(e,0))t=new Float32Array(t).map((i=>i/255));else{t=new Float32Array(e.width*e.height);const i=kr(e);var n=xd(e);if(ff(n,i,gf(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,n);for(let a=0,r=0;a<t.length;++a,r+=4)t[a]=n[r]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function gf(e){let t=fi(e,2);if(!t){const n=kr(e);t=bf(e);const i=su(e),a=vf(e);n.texImage2D(n.TEXTURE_2D,0,a,e.width,e.height,0,n.RED,n.FLOAT,i),lu(e)}return t}function kr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Ki(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function vf(e){if(e=kr(e),!es)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))es=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");es=e.R16F}return es}function xd(e){return e.l||(e.l=new pf),e.l}function bf(e){const t=kr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=fi(e,2);return n||(n=mf(xd(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function lu(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}
15var es,bt=class{constructor(e,t,n,i,a,r,o){this.g=e,this.m=t,this.j=n,this.canvas=i,this.l=a,this.width=r,this.height=o,this.j&&--rh===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!fi(this,0)}ka(){return!!fi(this,1)}R(){return!!fi(this,2)}ja(){return(t=fi(e=this,0))||(t=su(e),t=new Uint8Array(t.map((n=>Math.round(255*n)))),e.g.push(t)),t;var e,t}ia(){return su(this)}N(){return gf(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof Uint8Array)n=new Uint8Array(t);else if(t instanceof Float32Array)n=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=kr(this),a=xd(this);i.activeTexture(i.TEXTURE1),n=mf(a,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,n);const r=vf(this);i.texImage2D(i.TEXTURE_2D,0,r,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),ff(a,i,n),R6(a,i,!1,(()=>{bf(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),lu(this)})),$6(a),lu(this)}}e.push(n)}return new bt(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&kr(this).deleteTexture(fi(this,2)),rh=-1}};bt.prototype.close=bt.prototype.close,bt.prototype.clone=bt.prototype.clone,bt.prototype.getAsWebGLTexture=bt.prototype.N,bt.prototype.getAsFloat32Array=bt.prototype.ia,bt.prototype.getAsUint8Array=bt.prototype.ja,bt.prototype.hasWebGLTexture=bt.prototype.R,bt.prototype.hasFloat32Array=bt.prototype.ka,bt.prototype.hasUint8Array=bt.prototype.Fa;var rh=250;function xn(...e){return e.map((([t,n])=>({start:t,end:n})))}const F6=(function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}})((oh=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:df()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const n=e.length,i=this.i._malloc(n);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(n,i):this.i._changeTextGraph(n,i),this.i._free(i)}configureAudio(e,t,n,i,a){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),H(this,i||"input_audio",(r=>{H(this,a=a||"audio_header",(o=>{this.i._configureAudio(r,o,e,t??0,n)}))}))}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){Kn(this,"__graph_config__",(t=>{e(t)})),H(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)}addAudioToStreamWithShape(e,t,n,i,a){const r=4*e.length;this.h!==r&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(r),this.h=r),this.i.HEAPF32.set(e,this.g/4),H(this,i,(o=>{this.i._addAudioToInputStream(this.g,t,n,o,a)}))}addGpuBufferToStream(e,t,n){H(this,t,(i=>{const[a,r]=eh(this,e,i);this.i._addBoundTextureToStream(i,a,r,n)}))}addBoolToStream(e,t,n){H(this,t,(i=>{this.i._addBoolToInputStream(e,i,n)}))}addDoubleToStream(e,t,n){H(this,t,(i=>{this.i._addDoubleToInputStream(e,i,n)}))}addFloatToStream(e,t,n){H(this,t,(i=>{this.i._addFloatToInputStream(e,i,n)}))}addIntToStream(e,t,n){H(this,t,(i=>{this.i._addIntToInputStream(e,i,n)}))}addUintToStream(e,t,n){H(this,t,(i=>{this.i._addUintToInputStream(e,i,n)}))}addStringToStream(e,t,n){H(this,t,(i=>{H(this,e,(a=>{this.i._addStringToInputStream(a,i,n)}))}))}addStringRecordToStream(e,t,n){H(this,t,(i=>{th(this,Object.keys(e),(a=>{th(this,Object.values(e),(r=>{this.i._addFlatHashMapToInputStream(a,r,Object.keys(e).length,i,n)}))}))}))}addProtoToStream(e,t,n,i){H(this,n,(a=>{H(this,t,(r=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,r,a,i),this.i._free(o)}))}))}addEmptyPacketToStream(e,t){H(this,e,(n=>{this.i._addEmptyPacketToInputStream(n,t)}))}addBoolVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateBoolVector(e.length);if(!a)throw Error("Unable to allocate new bool vector on heap.");for(const r of e)this.i._addBoolVectorEntry(a,r);this.i._addBoolVectorToInputStream(a,i,n)}))}addDoubleVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateDoubleVector(e.length);if(!a)throw Error("Unable to allocate new double vector on heap.");for(const r of e)this.i._addDoubleVectorEntry(a,r);this.i._addDoubleVectorToInputStream(a,i,n)}))}addFloatVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateFloatVector(e.length);if(!a)throw Error("Unable to allocate new float vector on heap.");for(const r of e)this.i._addFloatVectorEntry(a,r);this.i._addFloatVectorToInputStream(a,i,n)}))}addIntVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateIntVector(e.length);if(!a)throw Error("Unable to allocate new int vector on heap.");for(const r of e)this.i._addIntVectorEntry(a,r);this.i._addIntVectorToInputStream(a,i,n)}))}addUintVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateUintVector(e.length);if(!a)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of e)this.i._addUintVectorEntry(a,r);this.i._addUintVectorToInputStream(a,i,n)}))}addStringVectorToStream(e,t,n){H(this,t,(i=>{const a=this.i._allocateStringVector(e.length);if(!a)throw Error("Unable to allocate new string vector on heap.");for(const r of e)H(this,r,(o=>{this.i._addStringVectorEntry(a,o)}));this.i._addStringVectorToInputStream(a,i,n)}))}addBoolToInputSidePacket(e,t){H(this,t,(n=>{this.i._addBoolToInputSidePacket(e,n)}))}addDoubleToInputSidePacket(e,t){H(this,t,(n=>{this.i._addDoubleToInputSidePacket(e,n)}))}addFloatToInputSidePacket(e,t){H(this,t,(n=>{this.i._addFloatToInputSidePacket(e,n)}))}addIntToInputSidePacket(e,t){H(this,t,(n=>{this.i._addIntToInputSidePacket(e,n)}))}addUintToInputSidePacket(e,t){H(this,t,(n=>{this.i._addUintToInputSidePacket(e,n)}))}addStringToInputSidePacket(e,t){H(this,t,(n=>{H(this,e,(i=>{this.i._addStringToInputSidePacket(i,n)}))}))}addProtoToInputSidePacket(e,t,n){H(this,n,(i=>{H(this,t,(a=>{const r=this.i._malloc(e.length);this.i.HEAPU8.set(e,r),this.i._addProtoToInputSidePacket(r,e.length,a,i),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const a of e)this.i._addBoolVectorEntry(i,a);this.i._addBoolVectorToInputSidePacket(i,n)}))}addDoubleVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const a of e)this.i._addDoubleVectorEntry(i,a);this.i._addDoubleVectorToInputSidePacket(i,n)}))}addFloatVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const a of e)this.i._addFloatVectorEntry(i,a);this.i._addFloatVectorToInputSidePacket(i,n)}))}addIntVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const a of e)this.i._addIntVectorEntry(i,a);this.i._addIntVectorToInputSidePacket(i,n)}))}addUintVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const a of e)this.i._addUintVectorEntry(i,a);this.i._addUintVectorToInputSidePacket(i,n)}))}addStringVectorToInputSidePacket(e,t){H(this,t,(n=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const a of e)H(this,a,(r=>{this.i._addStringVectorEntry(i,r)}));this.i._addStringVectorToInputSidePacket(i,n)}))}attachBoolListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachBoolListener(n)}))}attachBoolVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachBoolVectorListener(n)}))}attachIntListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachIntListener(n)}))}attachIntVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachIntVectorListener(n)}))}attachUintListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachUintListener(n)}))}attachUintVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachUintVectorListener(n)}))}attachDoubleListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachDoubleListener(n)}))}attachDoubleVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachDoubleVectorListener(n)}))}attachFloatListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachFloatListener(n)}))}attachFloatVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachFloatVectorListener(n)}))}attachStringListener(e,t){Kn(this,e,t),H(this,e,(n=>{this.i._attachStringListener(n)}))}attachStringVectorListener(e,t){Bi(this,e,t),H(this,e,(n=>{this.i._attachStringVectorListener(n)}))}attachProtoListener(e,t,n){Kn(this,e,t),H(this,e,(i=>{this.i._attachProtoListener(i,n||!1)}))}attachProtoVectorListener(e,t,n){Bi(this,e,t),H(this,e,(i=>{this.i._attachProtoVectorListener(i,n||!1)}))}attachAudioListener(e,t,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Kn(this,e,((i,a)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,a)})),H(this,e,(i=>{this.i._attachAudioListener(i,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends oh{get ga(){return this.i}pa(e,t,n){H(this,t,(i=>{const[a,r]=eh(this,e,i);this.ga._addBoundTextureAsImageToStream(i,a,r,n)}))}Z(e,t){Kn(this,e,t),H(this,e,(n=>{this.ga._attachImageListener(n)}))}aa(e,t){Bi(this,e,t),H(this,e,(n=>{this.ga._attachImageVectorListener(n)}))}}));var oh,Bn=class extends F6{};async function ve(e,t,n){return(async function(i,a,r,o){return I6(i,a,r,o)})(e,n.canvas??(df()?void 0:document.createElement("canvas")),t,n)}
15function yf(e,t,n,i){if(e.U){const r=new Um;if(n?.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var a=n.regionOfInterest;if(a.left>=a.right||a.top>=a.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(a.left<0||a.top<0||a.right>1||a.bottom>1)throw Error("Expected RectF values to be in [0,1].");J(r,1,(a.left+a.right)/2),J(r,2,(a.top+a.bottom)/2),J(r,4,a.right-a.left),J(r,3,a.bottom-a.top)}else J(r,1,.5),J(r,2,.5),J(r,4,1),J(r,3,1);if(n?.rotationDegrees){if(n?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(J(r,5,-Math.PI*n.rotationDegrees/180),n?.rotationDegrees%180!=0){const[o,s]=hf(t);n=tt(r,3)*s/o,a=tt(r,4)*o/s,J(r,4,n),J(r,3,a)}}e.g.addProtoToStream(r.g(),"mediapipe.NormalizedRect",e.U,i)}e.g.pa(t,e.X,i??performance.now()),e.finishProcessing()}function On(e,t,n){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");yf(e,t,n,e.C+1)}function si(e,t,n,i){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");yf(e,t,n,i)}function wr(e,t,n,i){var a=t.data;const r=t.width,o=r*(t=t.height);if((a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return e=new bt([a],n,!1,e.g.i.canvas,e.P,r,t),i?e.clone():e}var sn=class extends ou{constructor(e,t,n,i){super(e),this.g=e,this.X=t,this.U=n,this.oa=i,this.P=new pf}l(e,t=!0){if("runningMode"in e&&Ae(this.baseOptions,2,Ao(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};sn.prototype.close=sn.prototype.close;var fn=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},ee(e=this.h=new Tl,0,1,t=new Ye),J(this.h,2,.5),J(this.h,3,.3)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&J(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&J(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},On(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},si(this,e,n,t),this.j}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect_in"),ke(e,"detections");const t=new un;ri(t,p6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect_in"),pe(n,"DETECTIONS:detections"),n.o(t),Pn(e,n),this.g.attachProtoVectorListener("detections",((i,a)=>{for(const r of i)i=xm(r),this.j.detections.push(cf(i));G(this,a)})),this.g.attachEmptyPacketListener("detections",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};fn.prototype.detectForVideo=fn.prototype.G,fn.prototype.detect=fn.prototype.F,fn.prototype.setOptions=fn.prototype.o,fn.createFromModelPath=async function(e,t){return ve(fn,e,{baseOptions:{modelAssetPath:t}})},fn.createFromModelBuffer=function(e,t){return ve(fn,e,{baseOptions:{modelAssetBuffer:t}})},fn.createFromOptions=function(e,t){return ve(fn,e,t)};var Bd=xn([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Od=xn([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),Ud=xn([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Sf=xn([474,475],[475,476],[476,477],[477,474]),Nd=xn([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Gd=xn([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),kf=xn([469,470],[470,471],[471,472],[472,469]),Vd=xn([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,3
1561],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),wf=[...Bd,...Od,...Ud,...Nd,...Gd,...Vd],Tf=xn(
vendor: 24,341 bytes, line 15
15[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
15);function sh(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var We=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,ee(e=this.h=new Km,0,1,t=new Ye),this.A=new zm,ee(this.h,0,3,this.A),this.u=new Tl,ee(this.h,0,2,this.u),Ei(this.u,4,1),J(this.u,2,.5),J(this.A,2,.5),J(this.h,4,.5)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return"numFaces"in e&&Ei(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&J(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&J(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&J(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return sh(this),On(this,e,t),this.j}G(e,t,n){return sh(this),si(this,e,n,t),this.j}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect"),ke(e,"face_landmarks");const t=new un;ri(t,v6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"NORM_LANDMARKS:face_landmarks"),n.o(t),Pn(e,n),this.g.attachProtoVectorListener("face_landmarks",((i,a)=>{for(const r of i)i=Uo(r),this.j.faceLandmarks.push(El(i));G(this,a)})),this.g.attachEmptyPacketListener("face_landmarks",(i=>{G(this,i)})),this.outputFaceBlendshapes&&(ke(e,"blendshapes"),pe(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((i,a)=>{if(this.outputFaceBlendshapes)for(const r of i)i=wl(r),this.j.faceBlendshapes.push(Fd(i.g()??[]));G(this,a)})),this.g.attachEmptyPacketListener("blendshapes",(i=>{G(this,i)}))),this.outputFacialTransformationMatrixes&&(ke(e,"face_geometry"),pe(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((i,a)=>{if(this.outputFacialTransformationMatrixes)for(const r of i)(i=Se(i=g6(r),s6,2))&&this.j.facialTransformationMatrixes.push({rows:wn(i,1)??0??0,columns:wn(i,2)??0??0,data:Ta(i,3,Yn,wa()).slice()??[]});G(this,a)})),this.g.attachEmptyPacketListener("face_geometry",(i=>{G(this,i)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};We.prototype.detectForVideo=We.prototype.G,We.prototype.detect=We.prototype.F,We.prototype.setOptions=We.prototype.o,We.createFromModelPath=function(e,t){return ve(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return ve(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return ve(We,e,t)},We.FACE_LANDMARKS_LIPS=Bd,We.FACE_LANDMARKS_LEFT_EYE=Od,We.FACE_LANDMARKS_LEFT_EYEBROW=Ud,We.FACE_LANDMARKS_LEFT_IRIS=Sf,We.FACE_LANDMARKS_RIGHT_EYE=Nd,We.FACE_LANDMARKS_RIGHT_EYEBROW=Gd,We.FACE_LANDMARKS_RIGHT_IRIS=kf,We.FACE_LANDMARKS_FACE_OVAL=Vd,We.FACE_LANDMARKS_CONTOURS=wf,We.FACE_LANDMARKS_TESSELATION=Tf;var zd=xn([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function lh(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function ch(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function uh(e,t=!0){const n=[];for(const a of e){var i=wl(a);e=[];for(const r of i.g())i=t&&wn(r,1)!=null?wn(r,1)??0:-1,e.push({score:tt(r,2)??0,index:i,categoryName:Tt(ze(r,3))??""??"",displayName:Tt(ze(r,4))??""??""});n.push(e)}return n}var Wt=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ee(e=this.j=new Wm,0,1,t=new Ye),this.u=new Id,ee(this.j,0,2,this.u),this.D=new Cd,ee(this.u,0,3,this.D),this.A=new jm,ee(this.u,0,2,this.A),this.h=new b6,ee(this.j,0,3,this.h),J(this.A,2,.5),J(this.u,4,.5),J(this.D,2,.5)}get baseOptions(){return Se(this.j,Ye,1)}set baseOptions(e){ee(this.j,0,1,e)}o(e){if(Ei(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&J(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&J(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&J(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new Xa,n=t,i=ru(e.cannedGesturesClassifierOptions,Se(this.h,Xa,3)?.l());ee(n,0,2,i),ee(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&Se(this.h,Xa,3)?.g();return e.customGesturesClassifierOptions?(ee(n=t=new Xa,0,2,i=ru(e.customGesturesClassifierOptions,Se(this.h,Xa,4)?.l())),ee(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&Se(this.h,Xa,4)?.g(),this.l(e)}Ha(e,t){return lh(this),On(this,e,t),ch(this)}Ia(e,t,n){return lh(this),si(this,e,n,t),ch(this)}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect"),ke(e,"hand_gestures"),ke(e,"hand_landmarks"),ke(e,"
15world_hand_landmarks"),ke(e,"handedness");const t=new un;ri(t,y6,this.j);const n=new Gt;on(n,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"HAND_GESTURES:hand_gestures"),pe(n,"LANDMARKS:hand_landmarks"),pe(n,"WORLD_LANDMARKS:world_hand_landmarks"),pe(n,"HANDEDNESS:handedness"),n.o(t),Pn(e,n),this.g.attachProtoVectorListener("hand_landmarks",((i,a)=>{for(const r of i){i=Uo(r);const o=[];for(const s of Ti(i,Om,1))o.push({x:tt(s,1)??0,y:tt(s,2)??0,z:tt(s,3)??0,visibility:tt(s,4)??0});this.landmarks.push(o)}G(this,a)})),this.g.attachEmptyPacketListener("hand_landmarks",(i=>{G(this,i)})),this.g.attachProtoVectorListener("world_hand_landmarks",((i,a)=>{for(const r of i){i=cr(r);const o=[];for(const s of Ti(i,Bm,1))o.push({x:tt(s,1)??0,y:tt(s,2)??0,z:tt(s,3)??0,visibility:tt(s,4)??0});this.worldLandmarks.push(o)}G(this,a)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(i=>{G(this,i)})),this.g.attachProtoVectorListener("hand_gestures",((i,a)=>{this.gestures.push(...uh(i,!1)),G(this,a)})),this.g.attachEmptyPacketListener("hand_gestures",(i=>{G(this,i)})),this.g.attachProtoVectorListener("handedness",((i,a)=>{this.handedness.push(...uh(i)),G(this,a)})),this.g.attachEmptyPacketListener("handedness",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function dh(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Wt.prototype.recognizeForVideo=Wt.prototype.Ia,Wt.prototype.recognize=Wt.prototype.Ha,Wt.prototype.setOptions=Wt.prototype.o,Wt.createFromModelPath=function(e,t){return ve(Wt,e,{baseOptions:{modelAssetPath:t}})},Wt.createFromModelBuffer=function(e,t){return ve(Wt,e,{baseOptions:{modelAssetBuffer:t}})},Wt.createFromOptions=function(e,t){return ve(Wt,e,t)},Wt.HAND_CONNECTIONS=zd;var Ht=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ee(e=this.h=new Id,0,1,t=new Ye),this.u=new Cd,ee(this.h,0,3,this.u),this.j=new jm,ee(this.h,0,2,this.j),Ei(this.j,3,1),J(this.j,2,.5),J(this.u,2,.5),J(this.h,4,.5)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return"numHands"in e&&Ei(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&J(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&J(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&J(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],On(this,e,t),dh(this)}G(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],si(this,e,n,t),dh(this)}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect"),ke(e,"hand_landmarks"),ke(e,"
15world_hand_landmarks"),ke(e,"handedness");const t=new un;ri(t,S6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"LANDMARKS:hand_landmarks"),pe(n,"WORLD_LANDMARKS:world_hand_landmarks"),pe(n,"HANDEDNESS:handedness"),n.o(t),Pn(e,n),this.g.attachProtoVectorListener("hand_landmarks",((i,a)=>{for(const r of i)i=Uo(r),this.landmarks.push(El(i));G(this,a)})),this.g.attachEmptyPacketListener("hand_landmarks",(i=>{G(this,i)})),this.g.attachProtoVectorListener("world_hand_landmarks",((i,a)=>{for(const r of i)i=cr(r),this.worldLandmarks.push(go(i));G(this,a)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(i=>{G(this,i)})),this.g.attachProtoVectorListener("handedness",((i,a)=>{var r=this.handedness,o=r.push;const s=[];for(const l of i){i=wl(l);const u=[];for(const c of i.g())u.push({score:tt(c,2)??0,index:wn(c,1)??0??-1,categoryName:Tt(ze(c,3))??""??"",displayName:Tt(ze(c,4))??""??""});s.push(u)}o.call(r,...s),G(this,a)})),this.g.attachEmptyPacketListener("handedness",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ht.prototype.detectForVideo=Ht.prototype.G,Ht.prototype.detect=Ht.prototype.F,Ht.prototype.setOptions=Ht.prototype.o,Ht.createFromModelPath=function(e,t){return ve(Ht,e,{baseOptions:{modelAssetPath:t}})},Ht.createFromModelBuffer=function(e,t){return ve(Ht,e,{baseOptions:{modelAssetBuffer:t}})},Ht.createFromOptions=function(e,t){return ve(Ht,e,t)},Ht.HAND_CONNECTIONS=zd;var Ef=xn([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function hh(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function mh(e){try{if(!e.D)return e.h;e.D(e.h)}finally{Al(e)}}function ts(e,t){e=Uo(e),t.push(El(e))}var xe=class extends sn{constructor(e,t){super(new Bn(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,ee(e=this.j=new Qm,0,1,t=new Ye),this.I=new Cd,ee(this.j,0,2,this.I),this.W=new k6,ee(this.j,0,3,this.W),this.u=new Tl,ee(this.j,0,4,this.u),this.O=new zm,ee(this.j,0,5,this.O),this.A=new Ym,ee(this.j,0,6,this.A),this.M=new Jm,ee(this.j,0,7,this.M),J(this.u,2,.5),J(this.u,3,.3),J(this.O,2,.5),J(this.A,2,.5),J(this.A,3,.3),J(this.M,2,.5),J(this.I,2,.5)}get baseOptions(){return Se(this.j,Ye,1)}set baseOptions(e){ee(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&J(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&J(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&J(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&J(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&J(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&J(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&J(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,n){const i=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:n,hh(this),On(this,e,i),mh(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.D=typeof n=="function"?n:i,hh(this),si(this,e,a,t),mh(this)}m(){var e=new dn;qe(e,"input_frames_image"),ke(e,"pose_landmarks"),ke(e,"pose_world_landmarks"),ke(e,"face_landmarks"),ke(e,"left_hand_landmarks"),ke(e,"left_hand_world_landmarks"),ke(e,"right_hand_landmarks"),ke(e,"right_hand_world_landmarks");const t=new un,n=new B2;on(n,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),(function(a,r){if(r!=null)if(Array.isArray(r))Ae(a,2,ul(r,0,Po));else{if(!(typeof r=="string"||r instanceof Jn||Xu(r)))throw Error("invalid value in Any.value field: "+r+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Ui(a,2,Ju(r,!1),$a())}})(n,this.j.g());const i=new Gt;on(i,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),dd(i,8,B2,n),Ue(i,"IMAGE:input_frames_image"),pe(i,"POSE_LANDMARKS:pose_landmarks"),pe(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),pe(i,"FACE_LANDMARKS:face_landmarks"),pe(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),pe(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),pe(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),pe(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),Pn(e,i),Ml(this,e),this.g.attachProtoListener("pose_landmarks",((a,r)=>{ts(a,this.h.poseLandmarks),G(this,r)})),this.g.attachEmptyPacketListener("pose_landmarks",(a=>{G(this,a)})),this.g.attachProtoListener("pose_world_landmarks",((a,r)=>{var o=this.h.poseWorldLandmarks;a=cr(a),o.push(go(a)),G(this,r)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(a=>{G(this,a)})),this.outputPoseSegmentationMasks&&(pe(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Sr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",((a,r)=>
15{this.h.poseSegmentationMasks=[wr(this,a,!0,!this.D)],G(this,r)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(a=>{this.h.poseSegmentationMasks=[],G(this,a)}))),this.g.attachProtoListener("face_landmarks",((a,r)=>{ts(a,this.h.faceLandmarks),G(this,r)})),this.g.attachEmptyPacketListener("face_landmarks",(a=>{G(this,a)})),this.outputFaceBlendshapes&&(ke(e,"extra_blendshapes"),pe(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((a,r)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(a=wl(a),o.push(Fd(a.g()??[]))),G(this,r)})),this.g.attachEmptyPacketListener("extra_blendshapes",(a=>{G(this,a)}))),this.g.attachProtoListener("left_hand_landmarks",((a,r)=>{ts(a,this.h.leftHandLandmarks),G(this,r)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(a=>{G(this,a)})),this.g.attachProtoListener("left_hand_world_landmarks",((a,r)=>{var o=this.h.leftHandWorldLandmarks;a=cr(a),o.push(go(a)),G(this,r)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(a=>{G(this,a)})),this.g.attachProtoListener("right_hand_landmarks",((a,r)=>{ts(a,this.h.rightHandLandmarks),G(this,r)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(a=>{G(this,a)})),this.g.attachProtoListener("right_hand_world_landmarks",((a,r)=>{var o=this.h.rightHandWorldLandmarks;a=cr(a),o.push(go(a)),G(this,r)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(a=>{G(this,a)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xe.prototype.detectForVideo=xe.prototype.G,xe.prototype.detect=xe.prototype.F,xe.prototype.setOptions=xe.prototype.o,xe.createFromModelPath=function(e,t){return ve(xe,e,{baseOptions:{modelAssetPath:t}})},xe.createFromModelBuffer=function(e,t){return ve(xe,e,{baseOptions:{modelAssetBuffer:t}})},xe.createFromOptions=function(e,t){return ve(xe,e,t)},xe.HAND_CONNECTIONS=zd,xe.POSE_CONNECTIONS=Ef,xe.FACE_LANDMARKS_LIPS=Bd,xe.FACE_LANDMARKS_LEFT_EYE=Od,xe.FACE_LANDMARKS_LEFT_EYEBROW=Ud,xe.FACE_LANDMARKS_LEFT_IRIS=Sf,xe.FACE_LANDMARKS_RIGHT_EYE=Nd,xe.FACE_LANDMARKS_RIGHT_EYEBROW=Gd,xe.FACE_LANDMARKS_RIGHT_IRIS=kf,xe.FACE_LANDMARKS_FACE_OVAL=Vd,xe.FACE_LANDMARKS_CONTOURS=wf,xe.FACE_LANDMARKS_TESSELATION=Tf;var pn=class extends sn{constructor(e,t){super(new Bn(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},ee(e=this.h=new Zm,0,1,t=new Ye)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return ee(this.h,0,2,ru(e,Se(this.h,Pd,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},On(this,e,t),this.j}ta(e,t,n){return this.j={classifications:[]},si(this,e,n,t),this.j}m(){var e=new dn;qe(e,"input_image"),qe(e,"norm_rect"),ke(e,"classifications");const t=new un;ri(t,w6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Ue(n,"IMAGE:input_image"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"CLASSIFICATIONS:classifications"),n.o(t),Pn(e,n),this.g.attachProtoListener("classifications",((i,a)=>{this.j=_6(u6(i)),G(this,a)})),this.g.attachEmptyPacketListener("classifications",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};pn.prototype.classifyForVideo=pn.prototype.ta,pn.prototype.classify=pn.prototype.sa,pn.prototype.setOptions=pn.prototype.o,pn.createFromModelPath=function(e,t){return ve(pn,e,{baseOptions:{modelAssetPath:t}})},pn.createFromModelBuffer=function(e,t){return ve(pn,e,{baseOptions:{modelAssetBuffer:t}})},pn.createFromOptions=function(e,t){return ve(pn,e,t)};var Xt=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!0),this.h=new ef,this.embeddings={embeddings:[]},ee(e=this.h,0,1,t=new Ye)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){var t=this.h,n=Se(this.h,j2,2);return n=n?n.clone():new j2,e.l2Normalize!==void 0?Ae(n,1,Ao(e.l2Normalize)):"l2Normalize"in e&&Ae(n,1),e.quantize!==void 0?Ae(n,2,Ao(e.quantize)):"quantize"in e&&Ae(n,2),ee(t,0,2,n),this.l(e)}za(e,t){return On(this,e,t),this.embeddings}Aa(e,t,n){return si(this,e,n,t),this.embeddings}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect"),ke(e,"embeddings_out");const t=new un;ri(t,T6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"EMBEDDINGS:embeddings_out"),n.o(t),Pn(e,n),this.g.attachProtoListener("embeddings_out",((i,a)=>{i=m6(i),this.embeddings=(function(r){return{embeddings:Ti(r,h6,1).map((o=>{const s={headIndex:wn(o,3)??0??-1,headName:Tt(ze(o,4))??""??""};var l=o.v;return J0(l,0|l[j],q2,dc(o,1))!==void 0?(o=Ta(o=Se(o,q2,dc(o,1),void 0),1,Yn,wa()),s.floatEmbedding=o.slice()):(l=new Uint8Array(0),s.quantizedEmbedding=Se(o,d6,dc(o,2),void 0)?.na()?.h()??l),s})),timestampMs:lf(ze(r,2,void 0,void 0,Ls)??j0)}})(i),G(this,a)})),this.g.attachEmptyPacketListener("embeddings_out",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Xt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Q2(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Q2(J2(e.quantizedEmbedding),J2(t.quantizedEmbedding))}return e}
15,Xt.prototype.embedForVideo=Xt.prototype.Aa,Xt.prototype.embed=Xt.prototype.za,Xt.prototype.setOptions=Xt.prototype.o,Xt.createFromModelPath=function(e,t){return ve(Xt,e,{baseOptions:{modelAssetPath:t}})},Xt.createFromModelBuffer=function(e,t){return ve(Xt,e,{baseOptions:{modelAssetBuffer:t}})},Xt.createFromOptions=function(e,t){return ve(Xt,e,t)};var cu=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};function D6(e){const t=(function(n){return Ti(n,Gt,1)})(e.ca()).filter((n=>(Tt(ze(n,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(Se(t[0],un,7)?.j()?.g()??new Map).forEach(((n,i)=>{e.u[Number(i)]=Tt(ze(n,1))??""}))}function fh(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function ph(e){try{const t=new cu(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Al(e)}}cu.prototype.close=cu.prototype.close;var Dt=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new $d,this.A=new tf,ee(this.h,0,3,this.A),ee(e=this.h,0,1,t=new Ye)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Ae(this.h,2,xo(e.displayNamesLocale)):"displayNamesLocale"in e&&Ae(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){D6(this)}segment(e,t,n){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,fh(this),On(this,e,i),ph(this)}La(e,t,n,i){const a=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:i,fh(this),si(this,e,a,t),ph(this)}Da(){return this.u}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect");const t=new un;ri(t,af,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),n.o(t),Pn(e,n),Ml(this,e),this.outputConfidenceMasks&&(ke(e,"confidence_masks"),pe(n,"CONFIDENCE_MASKS:confidence_masks"),Sr(this,"confidence_masks"),this.g.aa("confidence_masks",((i,a)=>{this.confidenceMasks=i.map((r=>wr(this,r,!0,!this.j))),G(this,a)})),this.g.attachEmptyPacketListener("confidence_masks",(i=>{this.confidenceMasks=[],G(this,i)}))),this.outputCategoryMask&&(ke(e,"category_mask"),pe(n,"CATEGORY_MASK:category_mask"),Sr(this,"category_mask"),this.g.Z("category_mask",((i,a)=>{this.categoryMask=wr(this,i,!1,!this.j),G(this,a)})),this.g.attachEmptyPacketListener("category_mask",(i=>{this.categoryMask=void 0,G(this,i)}))),ke(e,"quality_scores"),pe(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((i,a)=>{this.qualityScores=i,G(this,a)})),this.g.attachEmptyPacketListener("quality_scores",(i=>{this.categoryMask=void 0,G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Dt.prototype.getLabels=Dt.prototype.Da,Dt.prototype.segmentForVideo=Dt.prototype.La,Dt.prototype.segment=Dt.prototype.segment,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(e,t){return ve(Dt,e,{baseOptions:{modelAssetPath:t}})},Dt.createFromModelBuffer=function(e,t){return ve(Dt,e,{baseOptions:{modelAssetBuffer:t}})},Dt.createFromOptions=function(e,t){return ve(Dt,e,t)};var uu=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};uu.prototype.close=uu.prototype.close;var qn=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new $d,this.u=new tf,ee(this.h,0,3,this.u),ee(e=this.h,0,1,t=new Ye)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,n,i){const a=typeof n!="function"?n:{};
15if(this.j=typeof n=="function"?n:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.C+1,i=new rf,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var r=new pc;Ui(r,3,Ao(!0),!1),Ui(r,1,lo(t.keypoint.x),0),Ui(r,2,lo(t.keypoint.y),0),fo(i,1,au,r)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const s=new M6;for(r of t.scribble)Ui(t=new pc,3,Ao(!0),!1),Ui(t,1,lo(r.x),0),Ui(t,2,lo(r.y),0),dd(s,1,pc,t);fo(i,2,au,s)}}this.g.addProtoToStream(i.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",n),On(this,e,a);e:{try{const s=new uu(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=s;break e}this.j(s)}finally{Al(this)}o=void 0}return o}m(){var e=new dn;qe(e,"image_in"),qe(e,"roi_in"),qe(e,"norm_rect_in");const t=new un;ri(t,af,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),Ue(n,"IMAGE:image_in"),Ue(n,"ROI:roi_in"),Ue(n,"NORM_RECT:norm_rect_in"),n.o(t),Pn(e,n),Ml(this,e),this.outputConfidenceMasks&&(ke(e,"confidence_masks"),pe(n,"CONFIDENCE_MASKS:confidence_masks"),Sr(this,"confidence_masks"),this.g.aa("confidence_masks",((i,a)=>{this.confidenceMasks=i.map((r=>wr(this,r,!0,!this.j))),G(this,a)})),this.g.attachEmptyPacketListener("confidence_masks",(i=>{this.confidenceMasks=[],G(this,i)}))),this.outputCategoryMask&&(ke(e,"category_mask"),pe(n,"CATEGORY_MASK:category_mask"),Sr(this,"category_mask"),this.g.Z("category_mask",((i,a)=>{this.categoryMask=wr(this,i,!1,!this.j),G(this,a)})),this.g.attachEmptyPacketListener("category_mask",(i=>{this.categoryMask=void 0,G(this,i)}))),ke(e,"quality_scores"),pe(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((i,a)=>{this.qualityScores=i,G(this,a)})),this.g.attachEmptyPacketListener("quality_scores",(i=>{this.categoryMask=void 0,G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};qn.prototype.segment=qn.prototype.segment,qn.prototype.setOptions=qn.prototype.o,qn.createFromModelPath=function(e,t){return ve(qn,e,{baseOptions:{modelAssetPath:t}})},qn.createFromModelBuffer=function(e,t){return ve(qn,e,{baseOptions:{modelAssetBuffer:t}})},qn.createFromOptions=function(e,t){return ve(qn,e,t)};var gn=class extends sn{constructor(e,t){super(new Bn(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},ee(e=this.h=new of,0,1,t=new Ye)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Ae(this.h,2,xo(e.displayNamesLocale)):"displayNamesLocale"in e&&Ae(this.h,2),e.maxResults!==void 0?Ei(this.h,3,e.maxResults):"maxResults"in e&&Ae(this.h,3),e.scoreThreshold!==void 0?J(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Ae(this.h,4),e.categoryAllowlist!==void 0?$s(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Ae(this.h,5),e.categoryDenylist!==void 0?$s(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Ae(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},On(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},si(this,e,n,t),this.j}m(){var e=new dn;qe(e,"input_frame_gpu"),qe(e,"norm_rect"),ke(e,"detections");const t=new un;ri(t,A6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),Ue(n,"IMAGE:input_frame_gpu"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"DETECTIONS:detections"),n.o(t),Pn(e,n),this.g.attachProtoVectorListener("detections",((i,a)=>{for(const r of i)i=xm(r),this.j.detections.push(cf(i));G(this,a)})),this.g.attachEmptyPacketListener("detections",(i=>{G(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};gn.prototype.detectForVideo=gn.prototype.G,gn.prototype.detect=gn.prototype.F,gn.prototype.setOptions=gn.prototype.o,gn.createFromModelPath=async function(e,t){return ve(gn,e,{baseOptions:{modelAssetPath:t}})},gn.createFromModelBuffer=function(e,t){return ve(gn,e,{baseOptions:{modelAssetBuffer:t}})},gn.createFromOptions=function(e,t){return ve(gn,e,t)};var du=class{constructor(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}close(){this.segmentationMasks?.forEach((e=>{e.close()}))}};function gh(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function vh(e){try{const t=new du(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{Al(e)}}du.prototype.close=du.prototype.close;var Yt=class extends sn{constructor(e,t){super(new Bn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,ee(e=this.h=new sf,0,1,t=new Ye),this.A=new Jm,ee(this.h,0,3,this.A),this.j=new Ym,ee(this.h,0,2,this.j),Ei(this.j,4,1),J(this.j,2,.5),J(this.A,2,.5),J(this.h,4,.5)}get baseOptions(){return Se(this.h,Ye,1)}set baseOptions(e){ee(this.h,0,1,e)}o(e){return"numPoses"in e&&Ei(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&J(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&J(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&J(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}
15F(e,t,n){const i=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:n,gh(this),On(this,e,i),vh(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.u=typeof n=="function"?n:i,gh(this),si(this,e,a,t),vh(this)}m(){var e=new dn;qe(e,"image_in"),qe(e,"norm_rect"),ke(e,"normalized_landmarks"),ke(e,"world_landmarks"),ke(e,"segmentation_masks");const t=new un;ri(t,P6,this.h);const n=new Gt;on(n,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Ue(n,"IMAGE:image_in"),Ue(n,"NORM_RECT:norm_rect"),pe(n,"NORM_LANDMARKS:normalized_landmarks"),pe(n,"WORLD_LANDMARKS:world_landmarks"),n.o(t),Pn(e,n),Ml(this,e),this.g.attachProtoVectorListener("normalized_landmarks",((i,a)=>{this.landmarks=[];for(const r of i)i=Uo(r),this.landmarks.push(El(i));G(this,a)})),this.g.attachEmptyPacketListener("normalized_landmarks",(i=>{this.landmarks=[],G(this,i)})),this.g.attachProtoVectorListener("world_landmarks",((i,a)=>{this.worldLandmarks=[];for(const r of i)i=cr(r),this.worldLandmarks.push(go(i));G(this,a)})),this.g.attachEmptyPacketListener("world_landmarks",(i=>{this.worldLandmarks=[],G(this,i)})),this.outputSegmentationMasks&&(pe(n,"SEGMENTATION_MASK:segmentation_masks"),Sr(this,"segmentation_masks"),this.g.aa("segmentation_masks",((i,a)=>{this.segmentationMasks=i.map((r=>wr(this,r,!0,!this.u))),G(this,a)})),this.g.attachEmptyPacketListener("segmentation_masks",(i=>{this.segmentationMasks=[],G(this,i)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Yt.prototype.detectForVideo=Yt.prototype.G,Yt.prototype.detect=Yt.prototype.F,Yt.prototype.setOptions=Yt.prototype.o,Yt.createFromModelPath=function(e,t){return ve(Yt,e,{baseOptions:{modelAssetPath:t}})},Yt.createFromModelBuffer=function(e,t){return ve(Yt,e,{baseOptions:{modelAssetBuffer:t}})},Yt.createFromOptions=function(e,t){return ve(Yt,e,t)},Yt.POSE_CONNECTIONS=Ef;const x6="0.10.14",B6=`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${x6}/wasm`,O6="https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite",Mf=async e=>{const t=await Za.forVisionTasks(e.tasksVisionFileSet??B6),n=await Dt.createFromOptions(t,{baseOptions:{delegate:e.delegate,modelAssetPath:e.modelAssetPath??O6},canvas:e.canvas,outputCategoryMask:!0,outputConfidenceMasks:!1,runningMode:"VIDEO"});return{close:()=>{n.close()},segmentFrame:(i,a,r)=>{n.segmentForVideo(i,a,o=>{r({mask:o.categoryMask??null})})}}},bh=new Float32Array([-1,-1,1,-1,-1,1,1,1]),yh=0,Sh=1,kh=2,U6=1,N6=0,Af={offsetX:0,offsetY:0,scaleX:1,scaleY:1},G6=({height:e,width:t})=>({x:t>0?1/t:0,y:e>0?1/e:0}),V6=({backgroundHeight:e,backgroundWidth:t,targetHeight:n,targetWidth:i})=>{if(e<=0||t<=0||n<=0||i<=0)return Af;const a=t/e,r=i/n;if(a>r){const s=r/a;return{offsetX:(1-s)/2,offsetY:0,scaleX:s,scaleY:1}}const o=a/r;return{offsetX:0,offsetY:(1-o)/2,scaleX:1,scaleY:o}},z6=e=>{if(!e||e.hasWebGLTexture())return null;if(e.hasUint8Array()&&e.getAsUint8Array)return{data:e.getAsUint8Array(),height:e.height,width:e.width};if(!e.hasFloat32Array()||!e.getAsFloat32Array)return null;const t=e.getAsFloat32Array(),n=new Uint8Array(t.length);return t.forEach((i,a)=>{n[a]=Math.round(Math.min(1,Math.max(0,i))*255)}),{data:n,height:e.height,width:e.width}},K6=`#version 300 es
16in vec2 a_position;
17out vec2 v_uv;
18
19void main() {
20  v_uv = vec2((a_position.x + 1.0) * 0.5, 1.0 - ((a_position.y + 1.0) * 0.5));
21  gl_Position = vec4(a_position, 0.0, 1.0);
22}`,q6=`#version 300 es
23precision mediump float;
24
25uniform sampler2D u_source;
26uniform sampler2D u_background;
27uniform sampler2D u_mask;
28uniform vec2 u_backgroundOffset;
29uniform vec2 u_backgroundScale;
30uniform vec2 u_blurStep;
31uniform float u_maskMix;
32uniform int u_useImageBackground;
33in vec2 v_uv;
34out vec4 outColor;
35
36vec4 sampleBlurredSource(vec2 uv) {
37  vec2 stepSize = u_blurStep;
38  vec4 color = texture(u_source, uv) * 0.28;
39  color += texture(u_source, uv + vec2(stepSize.x, 0.0)) * 0.12;
40  color += texture(u_source, uv - vec2(stepSize.x, 0.0)) * 0.12;
41  color += texture(u_source, uv + vec2(0.0, stepSize.y)) * 0.12;
42  color += texture(u_source, uv - vec2(0.0, stepSize.y)) * 0.12;
43  color += texture(u_source, uv + stepSize) * 0.06;
44  color += texture(u_source, uv - stepSize) * 0.06;
45  color += texture(u_source, uv + vec2(stepSize.x, -stepSize.y)) * 0.06;
46  color += texture(u_source, uv + vec2(-stepSize.x, stepSize.y)) * 0.06;
47  return color;
48}
49
50void main() {
51  vec4 sourceColor = texture(u_source, v_uv);
52  vec2 backgroundUv = u_backgroundOffset + (v_uv * u_backgroundScale);
53  vec4 backgroundColor = u_useImageBackground == 1
54    ? texture(u_background, backgroundUv)
55    : sampleBlurredSource(v_uv);
56  float foreground = smoothstep(0.35, 0.65, texture(u_mask, v_uv).r);
57  float maskValue = mix(1.0, foreground, u_maskMix);
58  outColor = mix(backgroundColor, sourceColor, maskValue);
59}`,wh=(e,t,n)=>{const i=e.createShader(t);if(!i)throw new Error("Failed to create WebGL shader");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const a=e.getShaderInfoLog(i)??"Unknown shader error";throw e.deleteShader(i),new Error(a)}return i},j6=e=>{const t=wh(e,e.VERTEX_SHADER,K6),n=wh(e,e.FRAGMENT_SHADER,q6),i=e.createProgram();if(!i)throw new Error("Failed to create WebGL program");if(e.attachShader(i,t),e.attachShader(i,n),e.linkProgram(i),e.deleteShader(t),e.deleteShader(n),!e.getProgramParameter(i,e.LINK_STATUS)){const a=e.getProgramInfoLog(i)??"Unknown program error";throw e.deleteProgram(i),new Error(a)}return i},vc=e=>{const t=e.createTexture();if(!t)throw new Error("Failed to create WebGL texture");return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t},Th=(e,t,n)=>{e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)},W6=e=>{const t=e.getContext("webgl2",{alpha:!1,antialias:!1,depth:!1,preserveDrawingBuffer:!1,stencil:!1});if(!t)throw new Error("WebGL2 is unavailable");const n=j6(t),i=vc(t),a=vc(t),r=vc(t),o=t.createBuffer();if(!o)throw new Error("Failed to create WebGL buffer");t.bindBuffer(t.ARRAY_BUFFER,o),t.bufferData(t.ARRAY_BUFFER,bh,t.STATIC_DRAW);const s=t.getAttribLocation(n,"a_position"),l=t.getUniformLocation(n,"u_source"),u=t.getUniformLocation(n,"u_background"),c=t.getUniformLocation(n,"u_mask"),m=t.getUniformLocation(n,"u_backgroundOffset"),f=t.getUniformLocation(n,"u_backgroundScale"),h=t.getUniformLocation(n,"u_blurStep"),d=t.getUniformLocation(n,"u_maskMix"),y=t.getUniformLocation(n,"u_useImageBackground");let S=null,p=null;const v=T=>{p!==T&&(p=T,fetch(T).then(w=>w.blob()).then(w=>createImageBitmap(w)).then(w=>{S?.close(),S=w,Th(t,a,w)}).catch(()=>{p=null}))},_=T=>{if(!T)return t.bindTexture(t.TEXTURE_2D,r),!1;if(T.hasWebGLTexture())return t.bindTexture(t.TEXTURE_2D,T.getAsWebGLTexture()),!0;const w=z6(T);return w?(t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.R8,w.width,w.height,0,t.RED,t.UNSIGNED_BYTE,w.data),!0):(t.bindTexture(t.TEXTURE_2D,r),!1)};return{compose:T=>{Th(t,i,T.source),T.mode==="image"&&T.backgroundImagePath&&v(T.backgroundImagePath),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),t.useProgram(n),t.bindBuffer(t.ARRAY_BUFFER,o),t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0+yh),t.bindTexture(t.TEXTURE_2D,i),t.uniform1i(l,yh),t.activeTexture(t.TEXTURE0+Sh),t.bindTexture(t.TEXTURE_2D,a),t.uniform1i(u,Sh),t.activeTexture(t.TEXTURE0+kh);const w=_(T.mask);t.uniform1i(c,kh);const E=G6({height:t.drawingBufferHeight,width:t.drawingBufferWidth});t.uniform2f(h,E.x,E.y);const M=S?V6({backgroundHeight:S.height,backgroundWidth:S.width,targetHeight:t.drawingBufferHeight,targetWidth:t.drawingBufferWidth}):Af;t.uniform2f(m,M.offsetX,M.offsetY),t.uniform2f(f,M.scaleX,M.scaleY),t.uniform1f(d,T.mode==="disabled"||!w?N6:U6),t.uniform1i(y,T.mode==="image"&&S?1:0),t.drawArrays(t.TRIANGLE_STRIP,0,bh.length/2)},destroy:()=>{S?.close(),t.deleteBuffer(o),t.deleteTexture(i),t.deleteTexture(a),t.deleteTexture(r),t.deleteProgram(n)}}},H6=24,X6=1e3,Eh=1e3,hu=1280,mu=720,Y6=1e3;let Mh=null;const Ah=e=>{const n=globalThis[e];return typeof n=="function"?n:null},J6=()=>{if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(hu,mu);const e=document.createElement("canvas");return e.width=hu,e.height=mu,e},Q6=()=>{const e=document.createElement("canvas");return e.width=hu,e.height=mu,e},Z6=(e,t)=>new VideoFrame(e,{timestamp:t}),e7=(e,t)=>{const n=e.captureStream(t),[i]=n.getVideoTracks();if(!i)throw new Error("Failed to create processed video track");return i},t7=async e=>{const t=document.createElement("video");
59return t.autoplay=!0,t.muted=!0,t.playsInline=!0,t.srcObject=new MediaStream([e]),await Promise.race([t.play(),new Promise(n=>{window.setTimeout(n,Y6)})]),t},bc=e=>{e.close()};class n7{name="presentation-livekit-custom-background-processor";processedTrack;backgroundImagePath;frameRate;onFrameProcessed;preferredDelegate;mode;outputCanvas=null;captureCanvas=null;compositor=null;segmenter=null;reader=null;writer=null;hiddenVideo=null;animationFrameId=null;isDestroyed=!1;lastProcessedAt=0;constructor(t){this.backgroundImagePath=t.imagePath??null,this.frameRate=t.maxFps??H6,this.mode=t.mode,this.onFrameProcessed=t.onFrameProcessed,this.preferredDelegate=t.preferredDelegate??"GPU"}async init(t){await this.start(t.track)}async restart(t){await this.stopFrameLoop(),this.segmenter?.close(),this.segmenter=null,this.compositor?.destroy(),this.compositor=null,this.processedTrack?.stop(),this.processedTrack=void 0,await this.start(t.track)}async destroy(){this.isDestroyed=!0,await this.stopFrameLoop(),this.segmenter?.close(),this.segmenter=null,this.compositor?.destroy(),this.compositor=null,this.processedTrack?.stop(),this.processedTrack=void 0}async switchMode(t){this.backgroundImagePath=t.imagePath??this.backgroundImagePath,this.mode=t.mode}async start(t){this.isDestroyed=!1;const n=Ah("MediaStreamTrackProcessor"),i=Ah("MediaStreamTrackGenerator"),a=!!(n&&i);if(this.outputCanvas=a?J6():Q6(),this.compositor=W6(this.outputCanvas),this.segmenter=await Mf({canvas:this.outputCanvas,delegate:this.preferredDelegate}),n&&i){const r=new n({track:t}),o=new i({kind:"video"});this.processedTrack=o.track,this.reader=r.readable.getReader(),this.writer=o.writable.getWriter(),this.runStreamLoop();return}this.captureCanvas=this.outputCanvas,this.processedTrack=e7(this.captureCanvas,this.frameRate),this.hiddenVideo=await t7(t),this.runVideoElementLoop()}shouldProcessFrame(t){const n=X6/this.frameRate;return t-this.lastProcessedAt<n?!1:(this.lastProcessedAt=t,!0)}async runStreamLoop(){if(!(!this.reader||!this.writer))for(;!this.isDestroyed;){const t=await this.reader.read();if(t.done||!t.value)break;const n=t.value,i=n.timestamp,a=performance.now();if(!this.shouldProcessFrame(a)){bc(n);continue}if(this.composeFrame(n,i),bc(n),!this.outputCanvas||!this.writer)continue;const r=Z6(this.outputCanvas,i);await this.writer.write(r),bc(r)}}runVideoElementLoop(){const t=n=>{if(this.isDestroyed||!this.hiddenVideo)return;this.shouldProcessFrame(n)&&this.composeFrame(this.hiddenVideo,n*Eh);const i=this.hiddenVideo.requestVideoFrameCallback?.bind(this.hiddenVideo);if(i){i(a=>{t(a)});return}this.animationFrameId=window.requestAnimationFrame(t)};this.animationFrameId=window.requestAnimationFrame(t)}composeFrame(t,n){if(!this.compositor||!this.segmenter)return;const i=performance.now();let a=0;const r=i;this.segmenter.segmentFrame(t,n/Eh,({mask:o})=>{a=performance.now()-i,this.compositor?.compose({backgroundImagePath:this.backgroundImagePath??void 0,mask:o,mode:this.mode,source:t})}),this.onFrameProcessed?.({filterTimeMs:Math.max(0,performance.now()-r),processingTimeMs:Math.max(0,performance.now()-r),segmentationTimeMs:a})}async stopFrameLoop(){this.animationFrameId!==null&&(window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.hiddenVideo?.pause(),this.hiddenVideo=null,await this.reader?.cancel(),await this.writer?.close(),this.reader=null,this.writer=null}}const i7=e=>new n7(e),a7=()=>(Mh??=(async()=>{if(typeof document>"u")return!1;const e=document.createElement("canvas");if(!e.getContext("webgl2"))return!1;try{return(await Mf({canvas:e,delegate:"GPU"})).close(),!0}catch{return!1}})(),Mh),r7=({blurRadius:e,canUseBackgroundProcessors:t,canUseModernBackgroundProcessors:n,createLiveKitProcessor:i,createProcessor:a,settings:r})=>{if(!(r.backgroundMode==="disabled"||!t()))return n()?r.backgroundMode==="image"?!r.backgroundImageUrl||!n()?void 0:a({imagePath:r.backgroundImageUrl,mode:"image"}):a({blurRadius:e,mode:"blur"}):r.backgroundMode==="image"?r.backgroundImageUrl?i({imagePath:r.backgroundImageUrl,mode:"image"}):void 0:i({blurRadius:e,mode:"blur"})};var No=typeof self<"u"?self:{};function Pf(e){e:{for(var t=["CLOSURE_FLAGS"],n=No,i=0;i<t.length;i++)if((n=n[t[i]])==null){t=null;break e}t=n}return(e=t&&t[e])!=null&&e}function pa(){throw Error("Invalid UTF8")}function Ph(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let ns,yc;const o7=typeof TextDecoder<"u";let s7;const l7=typeof TextEncoder<"u";function _f(e){if(l7)e=(s7||=new TextEncoder).encode(e);else{let n=0;const i=new Uint8Array(3*e.length);for(let a=0;a<e.length;a++){var t=e.charCodeAt(a);if(128>t)i[n++]=t;else{if(2048>t)i[n++]=t>>6|192;else{if(55296<=t&&57343>=t){if(56319>=t&&a<e.length){const r=e.charCodeAt(++a);if(56320<=r&&57343>=r){t=1024*(t-55296)+r-56320+65536,i[n++]=t>>18|240,i[n++]=t>>12&63|128,i[n++]=t>>6&63|128,i[n++]=63&t|128;continue}a--}t=65533}i[n++]=t>>12|224,i[n++]=t>>6&63|128}i[n++]=63&t|128}}e=n===i.length?i:i.subarray(0,n)}return e}var _o,Cf=Pf(610401301),c7=Pf(188588736);const _h=No.navigator;function fu(e){return!!Cf&&!!_o&&_o.brands.some((({brand:t})=>t&&t.indexOf(e)!=-1))}function kn(e){var t;return(t=No.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Gi(){return!!Cf&&!!_o&&0<_o.brands.length}function Sc(){return Gi()?fu("Chromium"):(kn("Chrome")||kn("CriOS"))&&!(!Gi()&&kn("Edge"))||kn("Silk")}function Kd(e){return Kd[" "](e),e}_o=_h&&_h.userAgentData||null,Kd[" "]=function(){};var u7=!Gi()&&(kn("Trident")||kn("MSIE"));!kn("Android")||Sc(),Sc(),kn("Safari")&&(Sc()||!Gi()&&kn("Coast")||!Gi()&&kn("Opera")||!Gi()&&kn("Edge")||(Gi()?fu("Microsoft Edge"):kn("Edg/"))||Gi()&&fu("Opera"));var If={},co=null;function d7(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):"=.".indexOf(e[t-1])!=-1&&(n="=.".indexOf(e[t-2])!=-1?n-2:n-1);var i=new Uint8Array(n),a=0;return(function(r,o){function s(h){for(;l<r.length;){var d=r.charAt(l++),y=co[d];if(y!=null)return y;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return h}Lf();for(var l=0;;){var u=s(-1),c=s(0),m=s(64),f=s(64);if(f===64&&u===-1)break;o(u<<2|c>>4),m!=64&&(o(c<<4&240|m>>2),f!=64&&o(m<<6&192|f))}})(e,(function(r){i[a++]=r})),a!==n?i.subarray(0,a):i}function Lf(){if(!co){co={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var i=e.concat(t[n].split(""));If[n]=i;for(var a=0;a<i.length;a++){var r=i[a];co[r]===void 0&&(co[r]=a)}}}}var Rf=typeof Uint8Array<"u",$f=!u7&&typeof btoa=="function";function Ch(e){if(!$f){var t;t===void 0&&(t=0),Lf(),t=If[t];var n=Array(Math.floor(e.length/3)),i=t[64]||"";let l=0,u=0;for(;l<e.length-2;l+=3){var a=e[l],r=e[l+1],o=e[l+2],s=t[a>>2];a=t[(3&a)<<4|r>>4],r=t[(15&r)<<2|o>>6],o=t[63&o],n[u++]=s+a+r+o}switch(s=0,o=i,e.length-l){case 2:o=t[(15&(s=e[l+1]))<<2]||i;case 1:e=e[l],n[u]=t[e>>2]+t[(3&e)<<4|s>>4]+o+i}return n.join("")}for(t="",n=0,i=e.length-10240;n<i;)t+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));return t+=String.fromCharCode.apply(null,n?e.subarray(n):e),btoa(t)}const Ih=/[-_.]/g,h7={"-":"+",_:"/",".":"="};function m7(e){return h7[e]||""}function Ff(e){if(!$f)return d7(e);Ih.test(e)&&(e=e.replace(Ih,m7)),e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Go(e){return Rf&&e!=null&&e instanceof Uint8Array}let f7;function Pl(){return f7||=new Uint8Array(0)}var Tr={};let p7;
59function Df(e){if(e!==Tr)throw Error("illegal external caller")}function xa(){return p7||=new vi(null,Tr)}function qd(e){Df(Tr);var t=e.g;return(t=t==null||Go(t)?t:typeof t=="string"?Ff(t):null)==null?t:e.g=t}var vi=class{constructor(e,t){if(Df(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}h(){const e=qd(this);return e?new Uint8Array(e):Pl()}};function xf(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function jd(){return Error("Failed to read varint, encoding is invalid.")}function Bf(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function Wd(e){if(typeof e=="string")return{buffer:Ff(e),P:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),P:!1};if(e.constructor===Uint8Array)return{buffer:e,P:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),P:!1};if(e.constructor===vi)return{buffer:qd(e)||Pl(),P:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),P:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Hd(){return typeof BigInt=="function"}const g7=typeof Uint8Array.prototype.slice=="function";let Of,$e=0,st=0;function Ca(e){const t=0>e;let n=(e=Math.abs(e))>>>0;if(e=Math.floor((e-n)/4294967296),t){const[i,a]=Jd(n,e);e=a,n=i}$e=n>>>0,st=e>>>0}function Xd(e){const t=Of||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),st=0,$e=t.getUint32(0,!0)}function pu(e,t){return 4294967296*t+(e>>>0)}function Yd(e,t){const n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=pu(e,t),n?-e:e}function Os(e,t){if(e>>>=0,2097151>=(t>>>=0))var n=""+(4294967296*t+e);else Hd()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),n=t+Lh(n)+Lh(e));return n}function Lh(e){return e=String(e),"0000000".slice(e.length)+e}function Uf(){var e=$e,t=st;if(2147483648&t)if(Hd())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[n,i]=Jd(e,t);e="-"+Os(n,i)}else e=Os(e,t);return e}function _l(e){if(16>e.length)Ca(Number(e));else if(Hd())e=BigInt(e),$e=Number(e&BigInt(4294967295))>>>0,st=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");st=$e=0;const n=e.length;for(let i=t,a=(n-t)%6+t;a<=n;i=a,a+=6){const r=Number(e.slice(i,a));st*=1e6,$e=1e6*$e+r,4294967296<=$e&&(st+=Math.trunc($e/4294967296),st>>>=0,$e>>>=0)}if(t){const[i,a]=Jd($e,st);$e=i,st=a}}}function Jd(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Qd(e,t){let n,i=0,a=0,r=0;const o=e.h;let s=e.g;do n=o[s++],i|=(127&n)<<r,r+=7;while(32>r&&128&n);for(32<r&&(a|=(127&n)>>4),r=3;32>r&&128&n;r+=7)n=o[s++],a|=(127&n)<<r;if(Ia(e,s),128>n)return t(i>>>0,a>>>0);throw jd()}function Zd(e){let t=0,n=e.g;const i=n+10,a=e.h;for(;n<i;){const r=a[n++];if(t|=r,(128&r)==0)return Ia(e,n),!!(127&t)}throw jd()}function Xi(e){const t=e.h;let n=e.g,i=t[n++],a=127&i;if(128&i&&(i=t[n++],a|=(127&i)<<7,128&i&&(i=t[n++],a|=(127&i)<<14,128&i&&(i=t[n++],a|=(127&i)<<21,128&i&&(i=t[n++],a|=i<<28,128&i&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw jd();return Ia(e,n),a}function Yi(e){return Xi(e)>>>0}function gu(e){var t=e.h;const n=e.g,i=t[n],a=t[n+1],r=t[n+2];return t=t[n+3],Ia(e,e.g+4),(i<<0|a<<8|r<<16|t<<24)>>>0}function vu(e){var t=gu(e);e=2*(t>>31)+1;const n=t>>>23&255;return t&=8388607,n==255?t?NaN:1/0*e:n==0?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}function v7(e){return Xi(e)}function kc(e,t,{ca:n=!1}={}){e.ca=n,t&&(t=Wd(t),e.h=t.buffer,e.m=t.P,e.j=0,e.l=e.h.length,e.g=e.j)}function Ia(e,t){if(e.g=t,t>e.l)throw Bf(e.l,t)}function Nf(e,t){if(0>t)throw Error(`Tried to read a negative byte length: ${t}`);const n=e.g,i=n+t;if(i>e.l)throw Bf(t,e.l-n);return e.g=i,n}function Gf(e,t){if(t==0)return xa();var n=Nf(e,t);return e.ca&&e.m?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?Pl():g7?e.slice(n,t):new Uint8Array(e.subarray(n,t))),n.length==0?xa():new vi(n,Tr)}var Rh=[];function Vf(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var n=Yi(e.g);if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw xf(n,e.l);if(1>t)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=n,!0}function ks(e){switch(e.h){case 0:e.h!=0?ks(e):Zd(e.g);break;case 1:Ia(e=e.g,e.g+8);break;case 2:if(e.h!=2)ks(e);else{var t=Yi(e.g);Ia(e=e.g,e.g+t)}break;case 5:Ia(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Vf(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}ks(e)}break;default:throw xf(e.h,e.l)}}function Vo(e,t,n){const i=e.g.l,a=Yi(e.g),r=e.g.g+a;let o=r-i;if(0>=o&&(e.g.l=r,n(t,e,void 0,void 0,void 0),o=r-e.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${a} bytes, instead read ${a-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=r,e.g.l=i,t}function e1(e){var t=Yi(e.g),n=Nf(e=e.g,t);if(e=e.h,o7){var i,a=e;(i=yc)||(i=yc=new TextDecoder("utf-8",{fatal:!0})),t=n+t,a=n===0&&t===a.length?a:a.subarray(n,t);try{var r=i.decode(a)}catch(s){if(ns===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),ns=!0}catch{ns=!1}}throw!ns&&(yc=void 0),s}}else{t=(r=n)+t,n=[];let s,l=null;for(;r<t;){var o=e[r++];128>o?n.push(o):224>o?r>=t?pa():(s=e[r++],194>o||(192&s)!=128?(r--,pa()):n.push((31&o)<<6|63&s)):240>o?r>=t-1?pa():(s=e[r++],(192&s)!=128||o===224&&160>s||o===237&&160<=s||(192&(i=e[r++]))!=128?(r--,pa()):n.push((15&o)<<12|(63&s)<<6|63&i)):244>=o?r>=t-2?pa():(s=e[r++],(192&s)!=128||s-144+(o<<28)>>30!=0||(192&(i=e[r++]))!=128||(192&(a=e[r++]))!=128?(r--,pa()):(o=(7&o)<<18|(63&s)<<12|(63&i)<<6|63&a,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):pa(),8192<=n.length&&(l=Ph(l,n),n.length=0)}r=Ph(l,n)}return r}function zf(e){const t=Yi(e.g);return Gf(e.g,t)}function Cl(e,t,n){var i=Yi(e.g);for(i=e.g.g+i;e.g.g<i;)n.push(t(e.g))}var is=[];function $h(e){return e?/^\d+$/.test(e)?(_l(e),new Fh($e,st)):null:b7||=new Fh(0,0)}var Fh=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let b7;function Dh(e){return e?/^-?\d+$/.test(e)?(_l(e),new xh($e,st)):null:y7||=new xh(0,0)}var xh=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let y7;function Us(e,t,n){for(;0<n||127<t;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function zo(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Il(e,t){if(0<=t)zo(e,t);else{for(let n=0;9>n;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Co(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Er(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}
59function _n(e,t,n){zo(e.g,8*t+n)}function t1(e,t){return _n(e,t,2),t=e.g.end(),Er(e,t),t.push(e.h),t}function n1(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;127<n;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function Ll(e,t,n){_n(e,t,2),zo(e.g,n.length),Er(e,e.g.end()),Er(e,n)}function bu(e,t,n,i){n!=null&&(t=t1(e,t),i(n,e),n1(e,t))}class qr{constructor(t,n,i,a){this.g=t,this.h=n,this.l=i,this.pa=a}}function ln(e){return Array.prototype.slice.call(e)}function i1(e){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():e}var Zn=i1(),Bh=i1("0di"),wc=i1("2ex"),a1=Zn?(e,t)=>{e[Zn]|=t}:(e,t)=>{e.g!==void 0?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}})},Ns=Zn?(e,t)=>{e[Zn]&=~t}:(e,t)=>{e.g!==void 0&&(e.g&=~t)};function Pt(e,t,n){return n?e|t:e&~t}var Je=Zn?e=>0|e[Zn]:e=>0|e.g,we=Zn?e=>e[Zn]:e=>e.g,Xe=Zn?(e,t)=>(e[Zn]=t,e):(e,t)=>(e.g!==void 0?e.g=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}),e);function jr(e){return a1(e,34),e}function S7(e,t){Xe(t,-14591&(0|e))}function yu(e,t){Xe(t,-14557&(34|e))}function Kf(e){return(e=e>>14&1023)===0?536870912:e}var r1,Ko={},qf={};function Oh(e){return!(!e||typeof e!="object"||e.Ja!==qf)}function o1(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function s1(e,t,n){if(e!=null){if(typeof e=="string")e=e?new vi(e,Tr):xa();else if(e.constructor!==vi)if(Go(e))e=e.length?new vi(n?e:new Uint8Array(e),Tr):xa();else{if(!t)throw Error();e=void 0}}return e}function Gs(e,t,n){if(!Array.isArray(e)||e.length)return!1;const i=Je(e);return!!(1&i)||!(!t||!(Array.isArray(t)?t.includes(n):t.has(n)))&&(Xe(e,1|i),!0)}const Uh=[];function li(e){if(2&e)throw Error()}Xe(Uh,55),r1=Object.freeze(Uh);class Vs{constructor(t,n,i){this.l=0,this.g=t,this.h=n,this.m=i}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new Vs(this.g,this.h,this.m)}}let qi,k7,w7;function jf(e,t){(t=qi?t[qi]:void 0)&&(e[qi]=ln(t))}function Wf(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function T7(){const e=Error();Wf(e,"incident"),(function(t){No.setTimeout((()=>{throw t}),0)})(e)}function Su(e){return Wf(e=Error(e),"warning"),e}function ra(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Hf(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}Object.freeze(new class{}),Object.freeze(new class{});const E7=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Rl(e){const t=typeof e;return t==="number"?Number.isFinite(e):t==="string"&&E7.test(e)}function Wr(e){if(e==null)return e;if(typeof e=="string"){if(!e)return;e=+e}return typeof e=="number"&&Number.isFinite(e)?0|e:void 0}function M7(e){if(e==null)return e;if(typeof e=="string"){if(!e)return;e=+e}return typeof e=="number"&&Number.isFinite(e)?e>>>0:void 0}function Nh(e){return e[0]!=="-"&&(20>e.length||e.length===20&&184467>Number(e.substring(0,6)))}function Xf(e){return e[0]==="-"?20>e.length||e.length===20&&-922337<Number(e.substring(0,7)):19>e.length||e.length===19&&922337>Number(e.substring(0,6))}function l1(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(Ca(e),e=Yd($e,st)),e}function c1(e){var t=Math.trunc(Number(e));return Number.isSafeInteger(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Xf(e)||(_l(e),e=Uf()),e)}function zs(e){return e==null?e:Rl(e)?typeof e=="number"?l1(e):c1(e):void 0}function qo(e){if(typeof e!="string")throw Error();return e}function Hr(e){if(e!=null&&typeof e!="string")throw Error();return e}function La(e){return e==null||typeof e=="string"?e:void 0}function u1(e,t,n,i){if(e!=null&&typeof e=="object"&&e.X===Ko)return e;if(!Array.isArray(e))return n?2&i?(e=t[Bh])?t=e:(jr((e=new t).s),t=t[Bh]=e):t=new t:t=void 0,t;let a=n=Je(e);return a===0&&(a|=32&i),a|=2&i,a!==n&&Xe(e,a),new t(e)}function A7(e,t,n){if(t){var i=!!i;if(!Rl(t=e))throw Su("int64");typeof t=="string"?i=c1(t):i?(i=Math.trunc(t),Number.isSafeInteger(i)?i=String(i):Xf(t=String(i))?i=t:(Ca(i),i=Uf())):i=l1(t)}else i=zs(e);return typeof(n=(e=i)==null?n?0:void 0:e)=="string"&&(i=+n,Number.isSafeInteger(i))?i:n}let Ks,d1,P7;function qs(e){switch(typeof e){case"boolean":return d1||=[0,void 0,!0];case"number":return 0<e?void 0:e===0?P7||=[0,void 0]:[-e,void 0];case"string":return[0,e];case"object":return e}}function Ra(e,t){return Yf(e,t[0],t[1])}function Yf(e,t,n){if(e==null&&(e=Ks),Ks=void 0,e==null){var i=96;n?(e=[n],i|=512):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(i=Je(e)))throw Error("farr");if(64&i)return e;if(i|=64,n&&(i|=512,n!==e[0]))throw Error("mid");e:{const a=(n=e).length;if(a){const r=a-1;
59if(o1(n[r])){if(1024<=(t=r-(+!!(512&(i|=256))-1)))throw Error("pvtlmt");i=-16760833&i|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,a-(+!!(512&i)-1))))throw Error("spvt");i=-16760833&i|(1023&t)<<14}}}return Xe(e,i),e}const _7={};let C7=(function(){try{return Kd(new class extends Map{constructor(){super()}}),!1}catch{return!0}})();class Tc{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,n){return this.g.set(t,n),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,n){return this.g.forEach(t,n)}[Symbol.iterator](){return this.entries()}}const I7=C7?(Object.setPrototypeOf(Tc.prototype,Map.prototype),Object.defineProperties(Tc.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Tc):class extends Map{constructor(){super()}};function Gh(e){return e}function Ec(e){if(2&e.N)throw Error("Cannot mutate an immutable Map")}var Mn=class extends I7{constructor(e,t,n=Gh,i=Gh){super();let a=Je(e);a|=64,Xe(e,a),this.N=a,this.U=t,this.S=n,this.Z=this.U?L7:i;for(let r=0;r<e.length;r++){const o=e[r],s=n(o[0],!1,!0);let l=o[1];t?l===void 0&&(l=null):l=i(o[1],!1,!0,void 0,void 0,a),super.set(s,l)}}oa(e=Vh){if(this.size!==0)return this.Y(e)}Y(e=Vh){const t=[],n=super.entries();for(var i;!(i=n.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){Ec(this),super.clear()}delete(e){return Ec(this),super.delete(this.S(e,!0,!1))}entries(){var e=this.na();return new Vs(e,R7,this)}keys(){return this.Ia()}values(){var e=this.na();return new Vs(e,Mn.prototype.get,this)}forEach(e,t){super.forEach(((n,i)=>{e.call(t,this.get(i),i,this)}))}set(e,t){return Ec(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.Z(t,!0,!0,this.U,!1,this.N))}Oa(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.U?e===void 0?null:e:this.Z(e,!1,!0,void 0,!1,this.N),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var n=this.U;return n?((n=this.Z(t,!1,!0,n,this.ta,this.N))!==t&&super.set(e,n),n):t}}na(){return Array.from(super.keys())}Ia(){return super.keys()}[Symbol.iterator](){return this.entries()}};function L7(e,t,n,i,a,r){return e=u1(e,i,n,r),a&&(e=Fl(e)),e}function Vh(e){return e}function R7(e){return[e,this.get(e)]}let $7;function zh(){return $7||=new Mn(jr([]),void 0,void 0,void 0,_7)}function h1(e,t,n,i,a){if(e!=null){if(Array.isArray(e))e=Gs(e,void 0,0)?void 0:a&&2&Je(e)?e:$l(e,t,n,i!==void 0,a);else if(o1(e)){const r={};for(let o in e)r[o]=h1(e[o],t,n,i,a);e=r}else e=t(e,i);return e}}function $l(e,t,n,i,a){const r=i||n?Je(e):0;i=i?!!(32&r):void 0;const o=ln(e);for(let s=0;s<o.length;s++)o[s]=h1(o[s],t,n,i,a);return n&&(jf(o,e),n(r,o)),o}function F7(e){return h1(e,m1,void 0,void 0,!1)}function m1(e){return e.X===Ko?e.toJSON():e instanceof Mn?e.oa(F7):(function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(Gs(t,void 0,0))return}else{if(Go(t))return Ch(t);if(t instanceof vi){const n=t.g;return n==null?"":typeof n=="string"?n:t.g=Ch(n)}if(t instanceof Mn)return t.oa()}}return t})(e)}function ku(e,t,n=yu){if(e!=null){if(Rf&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=Je(e);return 2&i||(t&&=i===0||!!(32&i)&&!(64&i||!(16&i)),e=t?Xe(e,-12293&(34|i)):$l(e,ku,4&i?yu:n,!0,!0)),e}return e.X===Ko?(n=e.s,e=2&(i=we(n))?e:f1(e,n,i,!0)):e instanceof Mn&&!(2&e.N)&&(n=jr(e.Y(ku)),e=new Mn(n,e.U,e.S,e.Z)),e}}function f1(e,t,n,i){return e=e.constructor,Ks=t=Jf(t,n,i),t=new e(t),Ks=void 0,t}function Jf(e,t,n){const i=n||2&t?yu:S7,a=!!(32&t);return e=(function(r,o,s){const l=ln(r);var u=l.length;const c=256&o?l[u-1]:void 0;for(u+=c?-1:0,o=512&o?1:0;o<u;o++)l[o]=s(l[o]);if(c){o=l[o]={};for(const m in c)o[m]=s(c[m])}return jf(l,r),l})(e,t,(r=>ku(r,a,i))),a1(e,32|(n?2:0)),e}function Fl(e){const t=e.s,n=we(t);return 2&n?f1(e,t,n,!1):e}function Qf(e,t,n,i){return!(4&t)||n!=null}function Ji(e,t){return ci(e=e.s,we(e),t)}function Kh(e,t,n,i){if(!(0>(t=i+(+!!(512&t)-1))||t>=e.length||t>=n))return e[t]}function ci(e,t,n,i){if(n===-1)return null;const a=Kf(t);if(!(n>=a)){var r=e.length;return i&&256&t&&(i=e[r-1][n])!=null?(Kh(e,t,a,n)&&wc!=null&&(4<=(t=(e=w7??={})[wc]||0)||(e[wc]=t+1,T7())),i):Kh(e,t,a,n)}return 256&t?e[e.length-1][n]:void 0}function Le(e,t,n,i){const a=e.s;let r=we(a);return li(r),Fe(a,r,t,n,i),e}function Fe(e,t,n,i,a){const r=Kf(t);if(n>=r||a){let o=t;if(256&t)a=e[e.length-1];else{if(i==null)return o;a=e[r+(+!!(512&t)-1)]={},o|=256}return a[n]=i,n<r&&(e[n+(+!!(512&t)-1)]=void 0),o!==t&&Xe(e,o),o}return e[n+(+!!(512&t)-1)]=i,256&t&&n in(e=e[e.length-1])&&delete e[n],t}function Xr(e,t,n,i,a){var r=2&t;let o=ci(e,t,n,a);Array.isArray(o)||(o=r1);const s=!(2&i);i=!(1&i);const l=!!(32&t);let u=Je(o);return u!==0||!l||r||s?1&u||(u|=1,Xe(o,u)):(u|=33,Xe(o,u)),r?(e=!1,2&u||(jr(o),e=!!(4&u)),(i||e)&&Object.freeze(o)):(r=!!(2&u)||!!(2048&u),i&&r?(o=ln(o),i=1,l&&!s&&(i|=32),Xe(o,i),Fe(e,t,n,o,a)):s&&32&u&&!r&&Ns(o,32)),o}function ws(e,t){e=e.s;let n=we(e);const i=ci(e,n,t),a=ra(i);return a!=null&&a!==i&&Fe(e,n,t,a),a}function Zf(e){e=e.s;let t=we(e);const n=ci(e,t,1),i=s1(n,!0,!!(34&t));return i!=null&&i!==n&&Fe(e,t,1,i),i}function ar(e,t,n){const i=e.s;let a=we(i);const r=2&a?1:2;let o=ep(i,a,t);var s=Je(o);if(Qf(e,s,void 0)){(4&s||Object.isFrozen(o))&&(o=ln(o),s=Ba(s,a),a=Fe(i,a,t,o));let l=e=0;for(;e<o.length;e++){const u=n(o[e]);u!=null&&(o[l++]=u)}l<e&&(o.length=l),s=Pt(s=tp(s,a),20,!0),s=Pt(s,4096,!1),s=Pt(s,8192,!1),Xe(o,s),2&s&&Object.freeze(o)}return vo(s)||(n=s,(s=(e=r===1||r===4&&!!(32&s))?Pt(s,2,!0):Mr(s,a,!1))!==n&&Xe(o,s),e&&Object.freeze(o)),r===2&&vo(s)&&(o=ln(o),s=Mr(s=Ba(s,a),a,!1),Xe(o,s),Fe(i,a,t,o)),o}function ep(e,t,n){return e=ci(e,t,n),Array.isArray(e)?e:r1}function tp(e,t){return e===0&&(e=Ba(e,t)),Pt(e,1,!0)}function vo(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function np(e){e=ln(e);for(let t=0;t<e.length;t++){const n=e[t]=ln(e[t]);Array.isArray(n[1])&&(n[1]=jr(n[1]))}return e}function js(e,t,n){{const s=e.s;let l=we(s);if(li(l),n==null)Fe(s,l,t);else{var i,a=Je(n),r=a,o=!!(2&a)||Object.isFrozen(n);if((i=!o)&&(i=!1),Qf(e,a))for(a=21,o&&(n=ln(n),r=0,a=Mr(a=Ba(a,l),l,!0)),e=0;e<n.length;e++)n[e]=qo(n[e]);i&&(n=ln(n),r=0,a=Mr(a=Ba(a,l),l,!0)),a!==r&&Xe(n,a),Fe(s,l,t,n)}}}function wu(e,t,n,i){e=e.s;let a=we(e);li(a),Fe(e,a,t,(i==="0"?Number(n)===0:n===i)?void 0:n)}function jo(e,t,n,i){const a=we(e);li(a),e=Xr(e,a,t,2),i=n(i,!!(4&(t=Je(e)))&&!!(4096&t)),e.push(i)}function D7(e){return e}function Mc(e,t){return p1(e=e.s,we(e),Np)===t?t:-1}function p1(e,t,n){let i=0;for(let a=0;a<n.length;a++){const r=n[a];ci(e,t,r)!=null&&(i!==0&&(t=Fe(e,t,i)),i=r)}return i}function g1(e,t,n,i){let a=we(e);li(a);const r=ci(e,a,n,i);let o;if(r!=null&&r.X===Ko)return(t=Fl(r))!==r&&Fe(e,a,n,t,i),t.s;if(Array.isArray(r)){const s=Je(r);o=2&s?Jf(r,s,!1):r,o=Ra(o,t)}else o=Ra(void 0,t);return o!==r&&Fe(e,a,n,o,i),o}function ip(e,t,n,i){e=e.s;let a=we(e);const r=ci(e,a,n,i);return(t=u1(r,t,!1,a))!==r&&t!=null&&Fe(e,a,n,t,i),t}function ge(e,t,n,i=!1){if((t=ip(e,t,n,i))==null)return t;e=e.s;let a=we(e);if(!(2&a)){const r=Fl(t);r!==t&&Fe(e,a,n,t=r,i)}return t}function ap(e,t,n,i,a,r){var o=2,s=!!(2&t);o=s?1:o,a=!!a,r&&=!s,s=ep(e,t,i);var l=Je(s);const u=!!(4&l);if(!u){var c=s,m=t;const f=!!(2&(l=tp(l,t)));f&&(m=Pt(m,2,!0));let h=!f,d=!0,y=0,S=0;for(;y<c.length;y++){const p=u1(c[y],n,!1,m);if(p instanceof n){if(!f){const v=!!(2&Je(p.s));h&&=!v,d&&=v}c[S++]=p}}S<y&&(c.length=S),l=Pt(l,4,!0),l=Pt(l,16,d),l=Pt(l,8,h),Xe(c,l),f&&Ob
59ject.freeze(c)}if(r&&!(8&l||!s.length&&(o===1||o===4&&32&l))){for(vo(l)&&(s=ln(s),l=Ba(l,t),t=Fe(e,t,i,s)),n=s,r=l,c=0;c<n.length;c++)(l=n[c])!==(m=Fl(l))&&(n[c]=m);r=Pt(r,8,!0),r=Pt(r,16,!n.length),Xe(n,r),l=r}return vo(l)||(n=l,(l=(r=o===1||o===4&&!!(32&l))?Pt(l,!s.length||16&l&&(!u||32&l)?2:2048,!0):Mr(l,t,a))!==n&&Xe(s,l),r&&Object.freeze(s)),o===2&&vo(l)&&(s=ln(s),l=Mr(l=Ba(l,t),t,a),Xe(s,l),Fe(e,t,i,s)),s}function Mi(e,t,n){e=e.s;const i=we(e);return ap(e,i,t,n,!1,!(2&i))}function Q(e,t,n,i,a){return i==null&&(i=void 0),Le(e,n,i,a)}function bo(e,t,n,i){i==null&&(i=void 0),e=e.s;let a=we(e);li(a),(n=p1(e,a,n))&&n!==t&&i!=null&&(a=Fe(e,a,n)),Fe(e,a,t,i)}function Ba(e,t){return e=Pt(e,2,!!(2&t)),e=Pt(e,32,!0),Pt(e,2048,!1)}function Mr(e,t,n){return 32&t&&n||(e=Pt(e,32,!1)),e}function Ws(e,t,n,i){e=e.s;const a=we(e);li(a),t=ap(e,a,n,t,!0),n=i??new n,t.push(n),2&Je(n.s)?Ns(t,8):Ns(t,16)}function Tn(e,t){return Wr(Ji(e,t))}function Dn(e,t){return e??t}function nt(e,t){return Dn(ws(e,t),0)}function ei(e,t){return Dn(La(Ji(e,t)),"")}function Io(e,t,n){if(n!=null&&typeof n!="boolean")throw e=typeof n,Error(`Expected boolean but got ${e!="object"?e:n?Array.isArray(n)?"array":e:"null"}: ${n}`);Le(e,t,n)}function ti(e,t,n){if(n!=null){if(typeof n!="number"||!Number.isFinite(n))throw Su("int32");n|=0}Le(e,t,n)}function K(e,t,n){if(n!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Le(e,t,n)}function Un(e,t,n){t.g?t.m(e,t.g,t.h,n,!0):t.m(e,t.h,n,!0)}Mn.prototype.toJSON=void 0,Mn.prototype.Ja=qf;var z=class{constructor(e,t){this.s=Yf(e,t)}toJSON(){return rp(this,$l(this.s,m1,void 0,void 0,!1),!0)}l(){var e=G8;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)}clone(){const e=this.s;return f1(this,e,we(e),!1)}P(){return!!(2&Je(this.s))}};function rp(e,t,n){var i=c7?void 0:e.constructor.B;const a=we(n?e.s:t);if(!(e=t.length))return t;let r,o;if(o1(n=t[e-1])){e:{var s=n;let c={},m=!1;for(var l in s){let f=s[l];if(Array.isArray(f)){let h=f;(Gs(f,i,+l)||Oh(f)&&f.size===0)&&(f=null),f!=h&&(m=!0)}f!=null?c[l]=f:m=!0}if(m){for(var u in c){s=c;break e}s=null}}s!=n&&(r=!0),e--}for(l=+!!(512&a)-1;0<e&&(n=t[u=e-1],u-=l,n==null||Gs(n,i,u)||Oh(n)&&n.size===0);e--)o=!0;return(r||o)&&(t=Array.prototype.slice.call(t,0,e),s&&t.push(s)),t}function op(e){return Array.isArray(e)?e[0]instanceof qr?e:[j7,e]:[e,void 0]}function Yr(e,t){if(Array.isArray(t)){var n=Je(t);if(4&n)return t;for(var i=0,a=0;i<t.length;i++){const r=e(t[i]);r!=null&&(t[a++]=r)}return a<i&&(t.length=a),Xe(t,-12289&(5|n)),2&n&&Object.freeze(t),t}}z.prototype.X=Ko,z.prototype.toString=function(){return rp(this,this.s,!1).toString()};const qh=Symbol();function v1(e){let t=e[qh];if(!t){const n=lp(e),i=y1(e),a=i.l;t=a?(r,o)=>a(r,o,i):(r,o)=>{for(;Vf(o)&&o.h!=4;){var s=o.m,l=i[s];if(!l){var u=i.ea;u&&(u=u[s])&&(l=i[s]=x7(u))}l&&l(o,r,s)||(s=(l=o).l,ks(l),l.ia?l=void 0:(u=l.g.g-s,l.g.g=s,l=Gf(l.g,u)),s=r,l&&(qi||=Symbol(),(u=s[qi])?u.push(l):s[qi]=[l]))}n===sp||n===Ts||n.j||(r[k7||=Symbol()]=n)},e[qh]=t}return t}function x7(e){const t=(e=op(e))[0].g;if(e=e[1]){const n=v1(e),i=y1(e).T;return(a,r,o)=>t(a,r,o,i,n)}return t}class Ac{}let sp,Ts;const yo=Symbol();function B7(e,t,n){const i=n[1];let a;if(i){const r=i[yo];a=r?r.T:qs(i[0]),e[t]=r??i}a&&a===d1?(e.g||(e.g=new Set)).add(t):n[0]&&(e.h||(e.h=new Set)).add(t)}function jh(e,t){return[e.l,!t||0<t[0]?void 0:t]}function lp(e){var t=e[yo];if(t)return t;if(!(t=b1(e,e[yo]=new Ac,jh,jh,B7)).ea&&!t.h&&!t.g){let n=!0;for(let i in t)isNaN(i)||(n=!1);n?(qs(e[0])===d1?Ts?t=Ts:((t=new Ac).T=qs(!0),t=Ts=t):t=sp||=new Ac,t=e[yo]=t):t.j=!0}return t}function O7(e,t,n){e[t]=n}function b1(e,t,n,i,a=O7){t.T=qs(e[0]);let r=0;var o=e[++r];o&&o.constructor===Object&&(t.ea=o,typeof(o=e[++r])=="function"&&(t.l=o,t.m=e[++r],o=e[++r]));const s={};for(;Array.isArray(o)&&typeof o[0]=="number"&&0<o[0];){for(var l=0;l<o.length;l++)s[o[l]]=o;o=e[++r]}for(l=1;o!==void 0;){let m;typeof o=="number"&&(l+=o,o=e[++r]);var u=void 0;if(o instanceof qr?m=o:(m=W7,r--),m.pa){o=e[++r],u=e;var c=r;typeof o=="function"&&(o=o(),u[c]=o),u=o}for(c=l+1,typeof(o=e[++r])=="number"&&0>o&&(c-=o,o=e[++r]);l<c;l++){const f=s[l];a(t,l,u?i(m,u,f):n(m,f))}}return t}const Wh=Symbol();function cp(e){let t=e[Wh];if(!t){const n=Dl(e);t=(i,a)=>dp(i,a,n),e[Wh]=t}return t}const Tu=Symbol();function U7(e){return e.h}function N7(e,t){let n,i;const a=e.h;return(r,o,s)=>a(r,o,s,i||=Dl(t).T,n||=cp(t))}function Dl(e){let t=e[Tu];return t||(t=b1(e,e[Tu]={},U7,N7),up(e),t)}const Eu=Symbol();function G7(e,t){const n=e.g;return t?(i,a,r)=>n(i,a,r,t):n}
59function V7(e,t,n){const i=e.g;let a,r;return(o,s,l)=>i(o,s,l,r||=y1(t).T,a||=v1(t),n)}function y1(e){let t=e[Eu];return t||(lp(e),t=b1(e,e[Eu]={},G7,V7),up(e),t)}function up(e){Eu in e&&yo in e&&Tu in e&&(e.length=0)}function Hh(e,t){var n=e[t];if(n)return n;if((n=e.ea)&&(n=n[t])){var i=(n=op(n))[0].h;if(n=n[1]){const a=cp(n),r=Dl(n).T;n=(n=e.m)?n(r,a):(o,s,l)=>i(o,s,l,r,a)}else n=i;return e[t]=n}}function dp(e,t,n){for(var i=we(e),a=+!!(512&i)-1,r=e.length,o=512&i?1:0,s=r+(256&i?-1:0);o<s;o++){const l=e[o];if(l==null)continue;const u=o-a,c=Hh(n,u);c&&c(t,l,u)}if(256&i){i=e[r-1];for(let l in i)a=+l,Number.isNaN(a)||(r=i[l])!=null&&(s=Hh(n,a))&&s(t,r,a)}if(e=qi?e[qi]:void 0)for(Er(t,t.g.end()),n=0;n<e.length;n++)Er(t,qd(e[n])||Pl())}function Vt(e,t){return new qr(e,t,!1,!1)}function Jr(e,t){return new qr(e,t,!0,!1)}function xl(e,t){return new qr(e,t,!1,!0)}function zt(e,t,n){Fe(e,we(e),t,n)}var z7=xl((function(e,t,n,i,a){return e.h===2&&(e=Vo(e,Ra([void 0,void 0],i),a),li(i=we(t)),(a=ci(t,i,n))instanceof Mn?(2&a.N)!=0?((a=a.Y()).push(e),Fe(t,i,n,a)):a.Oa(e):Array.isArray(a)?(2&Je(a)&&Fe(t,i,n,a=np(a)),a.push(e)):Fe(t,i,n,[e]),!0)}),(function(e,t,n,i,a){if(t instanceof Mn)t.forEach(((r,o)=>{bu(e,n,Ra([o,r],i),a)}));else if(Array.isArray(t))for(let r=0;r<t.length;r++){const o=t[r];Array.isArray(o)&&bu(e,n,Ra(o,i),a)}}));function hp(e,t,n){e:if(t!=null){if(Rl(t)){if(typeof t=="string"){t=c1(t);break e}if(typeof t=="number"){t=l1(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&Dh(t),t!=null&&(_n(e,n,0),typeof t=="number"?(e=e.g,Ca(t),Us(e,$e,st)):(n=Dh(t),Us(e.g,n.h,n.g))))}function mp(e,t,n){(t=Wr(t))!=null&&t!=null&&(_n(e,n,0),Il(e.g,t))}function fp(e,t,n){(t=Hf(t))!=null&&(_n(e,n,0),e.g.g.push(t?1:0))}function pp(e,t,n){(t=La(t))!=null&&Ll(e,n,_f(t))}function Bl(e,t,n,i,a){bu(e,n,t instanceof z?t.s:Array.isArray(t)?Ra(t,i):void 0,a)}function gp(e,t,n){(t=t==null||typeof t=="string"||Go(t)||t instanceof vi?t:void 0)!=null&&Ll(e,n,Wd(t).buffer)}function vp(e,t,n){return(e.h===5||e.h===2)&&(t=Xr(t,we(t),n,2,!1),e.h==2?Cl(e,vu,t):t.push(vu(e.g)),!0)}var lt,bi=Vt((function(e,t,n){if(e.h!==1)return!1;var i=e.g;e=gu(i);const a=gu(i);i=2*(a>>31)+1;const r=a>>>20&2047;return e=4294967296*(1048575&a)+e,zt(t,n,r==2047?e?NaN:1/0*i:r==0?i*Math.pow(2,-1074)*e:i*Math.pow(2,r-1075)*(e+4503599627370496)),!0}),(function(e,t,n){(t=ra(t))!=null&&(_n(e,n,1),e=e.g,(n=Of||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),$e=n.getUint32(0,!0),st=n.getUint32(4,!0),Co(e,$e),Co(e,st))})),gt=Vt((function(e,t,n){return e.h===5&&(zt(t,n,vu(e.g)),!0)}),(function(e,t,n){(t=ra(t))!=null&&(_n(e,n,5),e=e.g,Xd(t),Co(e,$e))})),K7=Jr(vp,(function(e,t,n){if((t=Yr(ra,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&(_n(i,a,5),i=i.g,Xd(r),Co(i,$e))}})),S1=Jr(vp,(function(e,t,n){if((t=Yr(ra,t))!=null&&t.length){_n(e,n,2),zo(e.g,4*t.length);for(let i=0;i<t.length;i++)n=e.g,Xd(t[i]),Co(n,$e)}})),Qi=Vt((function(e,t,n){return e.h===0&&(zt(t,n,Qd(e.g,Yd)),!0)}),hp),Pc=Vt((function(e,t,n){return e.h===0&&(zt(t,n,(e=Qd(e.g,Yd))===0?void 0:e),!0)}),hp),q7=Vt((function(e,t,n){return e.h===0&&(zt(t,n,Qd(e.g,pu)),!0)}),(function(e,t,n){e:if(t!=null){if(Rl(t)){if(typeof t=="string"){var i=Math.trunc(Number(t));Number.isSafeInteger(i)&&0<=i?t=String(i):((i=t.indexOf("."))!==-1&&(t=t.substring(0,i)),Nh(t)||(_l(t),t=Os($e,st)));break e}if(typeof t=="number"){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:(function(a){if(0>a){Ca(a);const r=Os($e,st);return a=Number(r),Number.isSafeInteger(a)?a:r}return Nh(String(a))?a:(Ca(a),pu($e,st))})(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&$h(t),t!=null&&(_n(e,n,0),typeof t=="number"?(e=e.g,Ca(t),Us(e,$e,st)):(n=$h(t),Us(e.g,n.h,n.g))))})),Qe=Vt((function(e,t,n){return e.h===0&&(zt(t,n,Xi(e.g)),!0)}),mp),Ol=Jr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Xr(t,we(t),n,2,!1),e.h==2?Cl(e,Xi,t):t.push(Xi(e.g)),!0)}),(function(e,t,n){if((t=Yr(Wr,t))!=null&&t.length){n=t1(e,n);for(let i=0;i<t.length;i++)Il(e.g,t[i]);n1(e,n)}})),Ar=Vt((function(e,t,n){return e.h===0&&(zt(t,n,(e=Xi(e.g))===0?void 0:e),!0)}),mp),it=Vt((function(e,t,n){return e.h===0&&(zt(t,n,Zd(e.g)),!0)}),fp),So=Vt((function(e,t,n){return e.h===0&&(zt(t,n,(e=Zd(e.g))===!1?void 0:e),!0)}),fp),Ct=Jr((function(e,t,n){return e.h===2&&(jo(t,n,D7,e=e1(e)),!0)}),(function(e,t,n){if((t=Yr(La,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&Ll(i,a,_f(r))}})),Zi=Vt((function(e,t,n){return e.h===2&&(zt(t,n,(e=e1(e))===""?void 0:e),!0)}),pp),Pe=Vt((function(e,t,n){return e.h===2&&(zt(t,n,e1(e)),!0)}),pp),j7=xl((function(e,t,n,i,a){return e.h===2&&(Vo(e,g1(t,i,n,!0),a),!0)}),Bl),W7=xl((function(e,t,n,i,a){return e.h===2&&(Vo(e,g1(t,i,n),a),!0)}),Bl);lt=new qr((function(e,t,n,i,a){if(e.h!==2)return!1;i=Ra(void 0,i);let r=we(t);li(r);let o=Xr(t,r,n,3);
59return r=we(t),4&Je(o)&&(o=ln(o),Xe(o,-2079&(1|Je(o))),Fe(t,r,n,o)),o.push(i),Vo(e,i,a),!0}),(function(e,t,n,i,a){if(Array.isArray(t))for(let r=0;r<t.length;r++)Bl(e,t[r],n,i,a)}),!0,!0);var _e=xl((function(e,t,n,i,a,r){if(e.h!==2)return!1;let o=we(t);return li(o),(r=p1(t,o,r))&&n!==r&&Fe(t,o,r),Vo(e,t=g1(t,i,n),a),!0}),Bl),bp=Vt((function(e,t,n){return e.h===2&&(zt(t,n,zf(e)),!0)}),gp),H7=Jr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Xr(t,we(t),n,2,!1),e.h==2?Cl(e,Yi,t):t.push(Yi(e.g)),!0)}),(function(e,t,n){if((t=Yr(M7,t))!=null)for(let o=0;o<t.length;o++){var i=e,a=n,r=t[o];r!=null&&(_n(i,a,0),zo(i.g,r))}})),ni=Vt((function(e,t,n){return e.h===0&&(zt(t,n,Xi(e.g)),!0)}),(function(e,t,n){(t=Wr(t))!=null&&(t=parseInt(t,10),_n(e,n,0),Il(e.g,t))})),X7=Jr((function(e,t,n){return(e.h===0||e.h===2)&&(t=Xr(t,we(t),n,2,!1),e.h==2?Cl(e,v7,t):t.push(Xi(e.g)),!0)}),(function(e,t,n){if((t=Yr(Wr,t))!=null&&t.length){n=t1(e,n);for(let i=0;i<t.length;i++)Il(e.g,t[i]);n1(e,n)}}));class Y7{constructor(t,n){this.h=t,this.g=n,this.l=ge,this.m=Q,this.defaultValue=void 0}}function Nn(e,t){return new Y7(e,t)}function oa(e,t){return(n,i)=>{if(is.length){const r=is.pop();r.o(i),kc(r.g,n,i),n=r}else n=new class{constructor(r,o){if(Rh.length){const s=Rh.pop();kc(s,r,o),r=s}else r=new class{constructor(s,l){this.h=null,this.m=!1,this.g=this.l=this.j=0,kc(this,s,l)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1}}(r,o);this.g=r,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({ia:r=!1}={}){this.ia=r}}(n,i);try{const r=new e,o=r.s;v1(t)(o,n);var a=r}finally{n.g.clear(),n.m=-1,n.h=-1,100>is.length&&is.push(n)}return a}}function Ul(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};dp(this.s,t,Dl(e)),Er(t,t.g.end());const n=new Uint8Array(t.h),i=t.l,a=i.length;let r=0;for(let o=0;o<a;o++){const s=i[o];n.set(s,r),r+=s.length}return t.l=[n],n}}var Xh=class extends z{constructor(e){super(e)}},yp=[0,Zi,Vt((function(e,t,n){return e.h===2&&(zt(t,n,(e=zf(e))===xa()?void 0:e),!0)}),(function(e,t,n){if(t!=null){if(t instanceof z){const i=t.Qa;return void(i&&(t=i(t),t!=null&&Ll(e,n,Wd(t).buffer)))}if(Array.isArray(t))return}gp(e,t,n)}))],J7=[0,Pe],Sp=[0,Qe,ni,it,-1,Ol,ni,-1],Q7=[0,it,-1],kp=class extends z{constructor(){super()}};kp.B=[6];var wp=[0,it,Pe,it,ni,-1,X7,Pe,-1,Q7,ni],Tp=[0,Pe,-2],Yh=class extends z{constructor(){super()}},Ep=[0],Mp=[0,Qe,it,-4],cn=class extends z{constructor(e){super(e,2)}},Ne={},Z7=[-2,Ne,it];Ne[336783863]=[0,Pe,it,-1,Qe,[0,[1,2,3,4,5,6],_e,Ep,_e,wp,_e,Tp,_e,Mp,_e,Sp,_e,[0,Pe]],J7,it,[0,[1,3],[2,4],_e,[0,Ol],-1,_e,[0,Ct],-1,lt,[0,Pe,-1]],Pe];var e8=[0,Zi,So],Ap=[0,Pc,-1,So,-3,Pc,Ol,Zi,Ar,Pc,-1,So,Ar,So,-2,Zi],Wo=[-1,{}],Pp=[0,Pe,1,Wo],_p=[0,Pe,Ct,Wo];function hn(e,t){wu(e,2,Hr(t),"")}function Re(e,t){jo(e.s,3,qo,t)}function fe(e,t){jo(e.s,4,qo,t)}var It=class extends z{constructor(e){super(e,500)}o(e){return Q(this,0,7,e)}};It.B=[3,4,5,6,8,13,17,1005];var t8=[-500,Zi,-1,Ct,-3,Z7,lt,yp,Ar,-1,Pp,_p,lt,e8,Zi,Ap,Ar,Ct,987,Ct],n8=[0,Zi,-1,Wo],i8=[-500,Pe,-1,[-1,{}],998,Pe],a8=[-500,Pe,Ct,-1,[-2,{},it],997,Ct,-1],r8=[-500,Pe,Ct,Wo,998,Ct];function mn(e,t){Ws(e,1,It,t)}function De(e,t){jo(e.s,10,qo,t)}function ye(e,t){jo(e.s,15,qo,t)}var Bt=class extends z{constructor(e){super(e,500)}o(e){return Q(this,0,1001,e)}};Bt.B=[1,6,7,9,10,15,16,17,14,1002];var Cp=[-500,lt,t8,4,lt,i8,lt,a8,Ar,lt,r8,Ct,Ar,Pp,_p,lt,n8,Ct,-2,Ap,Zi,-1,So,979,Wo,lt,yp],o8=oa(Bt,Cp);Bt.prototype.g=Ul(Cp);var s8=[0,lt,[0,Qe,-2]],l8=class extends z{constructor(e){super(e)}},c8=[0,Qe,gt,Pe,-1],k1=class extends z{constructor(e){super(e)}g(){return Mi(this,l8,1)}};k1.B=[1];var Ip=[0,lt,c8],Nl=oa(k1,Ip),u8=[0,Qe,gt],d8=[0,Qe,-1,s8],h8=class extends z{constructor(e){super(e)}},m8=[0,Qe,-3],f8=[0,gt,-3],p8=class extends z{constructor(e){super(e)}},g8=[0,gt,-1,Pe,gt],Es=class extends z{constructor(e){super(e)}h(){return ge(this,h8,2)}g(){return Mi(this,p8,5)}};Es.B=[5];var v8=[0,ni,m8,f8,d8,lt,g8],Lp=class extends z{constructor(e){super(e)}};Lp.B=[1,2,3,8,9];var Rp=oa(Lp,[0,Ct,Ol,S1,v8,Pe,-1,Qi,lt,u8,Ct,Qi]),$p=class extends z{constructor(e){super(e)}},b8=[0,gt,-4],Fp=class extends z{constructor(e){super(e)}};Fp.B=[1];var ur=oa(Fp,[0,lt,b8]),Dp=class extends z{constructor(e){super(e)}},y8=[0,gt,-4],xp=class extends z{constructor(e){super(e)}};xp.B=[1];var Ho=oa(xp,[0,lt,y8]),Bp=class extends z{constructor(e){super(e)}};Bp.B=[3];var S8=[0,Qe,-1,S1,ni],Op=class extends z{constructor(){super()}};Op.prototype.g=Ul([0,gt,-4,Qi]);var k8=class extends z{constructor(e){super(e)}},w8=[0,1,Qe,Pe,Ip],Up=class extends z{constructor(e){super(e)}};Up.B=[1];
59var T8=oa(Up,[0,lt,w8,Qi]),Mu=class extends z{constructor(e){super(e)}};Mu.B=[1];var E8=class extends z{constructor(e){super(e)}qa(){const e=Zf(this);return e??xa()}},M8=class extends z{constructor(e){super(e)}},Np=[1,2],A8=[0,Np,_e,[0,S1],_e,[0,bp],Qe,Pe],Gp=class extends z{constructor(e){super(e)}};Gp.B=[1];var P8=oa(Gp,[0,lt,A8,Qi]),Gl=class extends z{constructor(e){super(e)}};Gl.B=[4,5];var Vp=[0,Pe,Qe,gt,Ct,-1],Jh=class extends z{constructor(e){super(e)}},_8=[0,it,-1],Qh=class extends z{constructor(e){super(e)}},Ms=[1,2,3,4,5],Hs=class extends z{constructor(e){super(e)}g(){return Zf(this)!=null}h(){return La(Ji(this,2))!=null}},zp=[0,bp,Pe,[0,Qe,Qi,-1],[0,q7,Qi]],Ge=class extends z{constructor(e){super(e)}g(){return Hf(Ji(this,2))??!1}},rt=[0,zp,it,[0,Ms,_e,Mp,_e,wp,_e,Sp,_e,Ep,_e,Tp],ni],Vl=class extends z{constructor(e){super(e)}},w1=[0,rt,gt,-1,Qe],C8=Nn(502141897,Vl);Ne[502141897]=w1;var Kp=[0,zp];Ne[512499200]=Kp;var qp=[0,Kp];Ne[515723506]=qp;var I8=oa(class extends z{constructor(e){super(e)}},[0,[0,ni,-1,K7,H7],S8]),jp=[0,rt];Ne[508981768]=jp;var Wp=class extends z{constructor(e){super(e)}},T1=[0,rt,gt,jp,it],Hp=class extends z{constructor(e){super(e)}},Xp=[0,rt,w1,T1,gt,qp];Ne[508968149]=T1;var L8=Nn(508968150,Hp);Ne[508968150]=Xp;var Yp=class extends z{constructor(e){super(e)}},R8=Nn(513916220,Yp);Ne[513916220]=[0,rt,Xp,Qe];var Ya=class extends z{constructor(e){super(e)}h(){return ge(this,Gl,2)}g(){Le(this,2)}},Jp=[0,rt,Vp];Ne[478825465]=Jp;var Qp=[0,rt];Ne[478825422]=Qp;var $8=class extends z{constructor(e){super(e)}},Zp=[0,rt,Qp,Jp,-1],e4=class extends z{constructor(e){super(e)}},t4=[0,rt,gt,Qe],E1=class extends z{constructor(e){super(e)}},M1=[0,rt,gt],A1=class extends z{constructor(e){super(e)}},n4=[0,rt,t4,M1,gt],i4=class extends z{constructor(e){super(e)}},F8=[0,rt,n4,Zp];Ne[463370452]=Zp,Ne[464864288]=t4,Ne[474472470]=M1;var D8=Nn(462713202,A1);Ne[462713202]=n4;var x8=Nn(479097054,i4);Ne[479097054]=F8;var B8=class extends z{constructor(e){super(e)}},O8=[0,rt],a4=class extends z{constructor(e){super(e)}},P1=[0,rt,gt,-1,Qe];Ne[514774813]=P1;var r4=class extends z{constructor(e){super(e)}},_1=[0,rt,gt,it];Ne[518928384]=_1;var o4=class extends z{constructor(){super()}};o4.prototype.g=Ul([0,rt,M1,O8,w1,T1,P1,_1]);var s4=class extends z{constructor(e){super(e)}},U8=Nn(456383383,s4);Ne[456383383]=[0,rt,Vp];var l4=class extends z{constructor(e){super(e)}},N8=Nn(476348187,l4);Ne[476348187]=[0,rt,_8];var c4=class extends z{constructor(e){super(e)}},u4=[0,ni,-1],Au=class extends z{constructor(e){super(e)}};Au.B=[3];var G8=Nn(458105876,class extends z{constructor(e){super(e)}g(){var e=this.s;const t=we(e);var n=2&t;return e=(function(i,a,r){var o=Au;const s=2&a;let l=!1;if(r==null){if(s)return zh();r=[]}else if(r.constructor===Mn){if((2&r.N)==0||s)return r;r=r.Y()}else Array.isArray(r)?l=!!(2&Je(r)):r=[];if(s){if(!r.length)return zh();l||(l=!0,jr(r))}else l&&(l=!1,r=np(r));return l||(64&Je(r)?Ns(r,32):32&a&&a1(r,32)),Fe(i,a,2,o=new Mn(r,o,A7,void 0),!1),o})(e,t,ci(e,t,2)),e==null||!n&&Au&&(e.ta=!0),n=e}});Ne[458105876]=[0,u4,z7,[!0,Qi,[0,Pe,-1,Ct]]];var C1=class extends z{constructor(e){super(e)}},d4=Nn(458105758,C1);Ne[458105758]=[0,rt,Pe,u4];var I1=class extends z{constructor(e){super(e)}};I1.B=[5,6];var V8=Nn(443442058,I1);Ne[443442058]=[0,rt,Pe,Qe,gt,Ct,-1];var h4=class extends z{constructor(e){super(e)}},z8=Nn(516587230,h4);function Pu(e,t){return t=t?t.clone():new Gl,e.displayNamesLocale!==void 0?Le(t,1,Hr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Le(t,1),e.maxResults!==void 0?ti(t,2,e.maxResults):"maxResults"in e&&Le(t,2),e.scoreThreshold!==void 0?K(t,3,e.scoreThreshold):"scoreThreshold"in e&&Le(t,3),e.categoryAllowlist!==void 0?js(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Le(t,4),e.categoryDenylist!==void 0?js(t,5,e.categoryDenylist):"categoryDenylist"in e&&Le(t,5),t}function L1(e,t=-1,n=""){return{categories:e.map((i=>({index:Dn(Tn(i,1),0)??-1,score:nt(i,2)??0,categoryName:ei(i,3)??"",displayName:ei(i,4)??""}))),headIndex:t,headName:n}}function m4(e){var t=ar(e,3,ra),n=ar(e,2,Wr),i=ar(e,1,La),a=ar(e,9,La);const r={categories:[],keypoints:[]};for(let o=0;o<t.length;o++)r.categories.push({score:t[o],index:n[o]??-1,categoryName:i[o]??"",dis
59playName:a[o]??""});if((t=ge(e,Es,4)?.h())&&(r.boundingBox={originX:Tn(t,1)??0,originY:Tn(t,2)??0,width:Tn(t,3)??0,height:Tn(t,4)??0,angle:0}),ge(e,Es,4)?.g().length)for(const o of ge(e,Es,4).g())r.keypoints.push({x:ws(o,1)??0,y:ws(o,2)??0,score:ws(o,4)??0,label:La(Ji(o,3))??""});return r}function zl(e){const t=[];for(const n of Mi(e,Dp,1))t.push({x:nt(n,1)??0,y:nt(n,2)??0,z:nt(n,3)??0,visibility:nt(n,4)??0});return t}function ko(e){const t=[];for(const n of Mi(e,$p,1))t.push({x:nt(n,1)??0,y:nt(n,2)??0,z:nt(n,3)??0,visibility:nt(n,4)??0});return t}function Zh(e){return Array.from(e,(t=>127<t?t-256:t))}function e3(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let n=0,i=0,a=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r],i+=e[r]*e[r],a+=t[r]*t[r];if(0>=i||0>=a)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(i*a)}let as;Ne[516587230]=[0,rt,P1,_1,gt];const K8=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function f4(){if(as===void 0)try{await WebAssembly.instantiate(K8),as=!0}catch{as=!1}return as}async function ao(e,t=""){const n=await f4()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}}var ba=class{};function p4(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&1<=e.length&&17<=Number(e[1])))}async function t3(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((n,i)=>{t.addEventListener("load",(()=>{n()}),!1),t.addEventListener("error",(a=>{i(a)}),!1),document.body.appendChild(t)}))}importScripts(e.toString())}function g4(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function X(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function n3(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[i,a]=g4(t);return!e.l||i===e.i.canvas.width&&a===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=a),[i,a]}function i3(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let a=0;a<t.length;a++)i[a]=e.i.stringToNewUTF8(t[a]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),n(t);for(const a of i)e.i._free(a);e.i._free(t)}function jn(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function Oi(e,t,n){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(a,r,o)=>{r?(n(i,o),i=[]):i.push(a)}}ba.forVisionTasks=function(e){return ao("vision",e)},ba.forTextTasks=function(e){return ao("text",e)},ba.forGenAiExperimentalTasks=function(e){return ao("genai_experimental",e)},ba.forGenAiTasks=function(e){return ao("genai",e)},ba.forAudioTasks=function(e){return ao("audio",e)},ba.isSimdSupported=function(){return f4()};async function q8(e,t,n,i){return e=await(async(a,r,o,s,l)=>{if(r&&await t3(r),!self.ModuleFactory||o&&(await t3(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&l&&((r=self.Module).locateFile=l.locateFile,l.mainScriptUrlOrBlob&&(r.mainScriptUrlOrBlob=l.mainScriptUrlOrBlob)),l=await self.ModuleFactory(self.Module||l),self.ModuleFactory=self.Module=void 0,new a(l,s)}
59)(e,n.wasmLoaderPath,n.assetLoaderPath,t,{locateFile:a=>a.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&a.endsWith(".data")?n.assetBinaryPath.toString():a}),await e.o(i),e}function _c(e,t){const n=ge(e.baseOptions,Hs,1)||new Hs;typeof t=="string"?(Le(n,2,Hr(t)),Le(n,1)):t instanceof Uint8Array&&(Le(n,1,s1(t,!1,!1)),Le(n,2)),Q(e.baseOptions,0,1,n)}function a3(e){try{const t=e.K.length;if(t===1)throw Error(e.K[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.K.map((n=>n.message)).join(", "))}finally{e.K=[]}}function U(e,t){e.J=Math.max(e.J,t)}function Kl(e,t){e.C=new It,hn(e.C,"PassThroughCalculator"),Re(e.C,"free_memory"),fe(e.C,"free_memory_unused_out"),De(t,"free_memory"),mn(t,e.C)}function Pr(e,t){Re(e.C,t),fe(e.C,t+"_unused_out")}function ql(e){e.g.addBoolToStream(!0,"free_memory",e.J)}var As=class{constructor(e){this.g=e,this.K=[],this.J=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){if(t){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(ge(this.baseOptions,Hs,1)?.g()||ge(this.baseOptions,Hs,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(i,a){let r=ge(i.baseOptions,Qh,3);if(!r){var o=r=new Qh,s=new Yh;bo(o,4,Ms,s)}"delegate"in a&&(a.delegate==="GPU"?(a=r,o=new kp,bo(a,2,Ms,o)):(a=r,o=new Yh,bo(a,4,Ms,o))),Q(i.baseOptions,0,3,r)})(this,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((i=>{if(i.ok)return i.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${i.status})`)})).then((i=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(i),!0,!1,!1),_c(this,"/model.dat"),this.m(),this.L()}));if(n.modelAssetBuffer instanceof Uint8Array)_c(this,n.modelAssetBuffer);else if(n.modelAssetBuffer)return(async function(i){const a=[];for(var r=0;;){const{done:o,value:s}=await i.read();if(o)break;a.push(s),r+=s.length}if(a.length===0)return new Uint8Array(0);if(a.length===1)return a[0];i=new Uint8Array(r),r=0;for(const o of a)i.set(o,r),r+=o.length;return i})(n.modelAssetBuffer).then((i=>{_c(this,i),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}fa(){let e;if(this.g.fa((t=>{e=o8(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener(((n,i)=>{this.K.push(Error(i))})),this.g.Ma(),this.g.setGraph(e,t),this.C=void 0,a3(this)}finishProcessing(){this.g.finishProcessing(),a3(this)}close(){this.C=void 0,this.g.closeGraph()}};function yi(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}As.prototype.close=As.prototype.close,(function(e,t){e=e.split(".");var n,i=No;for((e[0]in i)||i.execScript===void 0||i.execScript("var "+e[0]);e.length&&(n=e.shift());)e.length||t===void 0?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t})("TaskRunner",As);class j8{constructor(t,n,i,a){this.g=t,this.h=n,this.m=i,this.l=a}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function r3(e,t,n){const i=e.g;if(n=yi(i.createShader(n),"Failed to create WebGL shader"),i.shaderSource(n,t),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(n)}`);return i.attachShader(e.h,n),n}function o3(e,t){const n=e.g,i=yi(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(i);const a=yi(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(e.K),n.vertexAttribPointer(e.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const r=yi(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,r),n.enableVertexAttribArray(e.J),n.vertexAttribPointer(e.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new j8(n,i,a,r)}function R1(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function $1(e,t,n,i){return R1(e,t),e.h||(e.m(),e.D()),n?(e.v||(e.v=o3(e,!0)),n=e.v):(e.A||(e.A=o3(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=i(),n.g.bindVertexArray(null),e}function jl(e,t,n){return R1(e,t),e=yi(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Wl(e,t,n){R1(e,t),e.u||(e.u=yi(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.u),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function F1(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var D1=class{H(){return`
60  precision mediump float;
61  varying vec2 vTex;
62  uniform sampler2D inputTexture;
63  void main() {
64    gl_FragColor = texture2D(inputTexture, vTex);
65  }
66 `}m(){const e=this.g;if(this.h=yi(e.createProgram(),"Failed to create WebGL program"),this.ba=r3(this,`
67  attribute vec2 aVertex;
68  attribute vec2 aTex;
69  varying vec2 vTex;
70  void main(void) {
71    gl_Position = vec4(aVertex, 0.0, 1.0);
72    vTex = aTex;
73  }`,e.VERTEX_SHADER),this.aa=r3(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.K=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.ba),e.deleteShader(this.aa)}this.u&&this.g.deleteFramebuffer(this.u),this.A&&this.A.close(),this.v&&this.v.close()}};function pi(e,t){switch(t){case 0:return e.g.find((n=>n instanceof Uint8Array));case 1:return e.g.find((n=>n instanceof Float32Array));case 2:return e.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function _u(e){var t=pi(e,1);if(!t){if(t=pi(e,0))t=new Float32Array(t).map((i=>i/255));else{t=new Float32Array(e.width*e.height);const i=_r(e);var n=x1(e);if(Wl(n,i,v4(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){n=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,n);for(let a=0,r=0;a<t.length;++a,r+=4)t[a]=n[r]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function v4(e){let t=pi(e,2);if(!t){const n=_r(e);t=y4(e);const i=_u(e),a=b4(e);n.texImage2D(n.TEXTURE_2D,0,a,e.width,e.height,0,n.RED,n.FLOAT,i),Cu(e)}return t}function _r(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yi(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function b4(e){if(e=_r(e),!rs)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))rs=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");rs=e.R16F}return rs}function x1(e){return e.l||(e.l=new D1),e.l}function y4(e){const t=_r(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=pi(e,2);return n||(n=jl(x1(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function Cu(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var rs,yt=class{constructor(e,t,n,i,a,r,o){this.g=e,this.m=t,this.j=n,this.canvas=i,this.l=a,this.width=r,this.height=o,this.j&&--s3===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Ha(){return!!pi(this,0)}la(){return!!pi(this,1)}R(){return!!pi(this,2)}ka(){return(t=pi(e=this,0))||(t=_u(e),t=new Uint8Array(t.map((n=>255*n))),e.g.push(t)),t;var e,t}ja(){return _u(this)}O(){return v4(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof Uint8Array)n=new Uint8Array(t);else if(t instanceof Float32Array)n=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=_r(this),a=x1(this);i.activeTexture(i.TEXTURE1),n=jl(a,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,n);const r=b4(this);i.texImage2D(i.TEXTURE_2D,0,r,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),Wl(a,i,n),$1(a,i,!1,(()=>{y4(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Cu(this)})),F1(a),Cu(this)}}
73e.push(n)}return new yt(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&_r(this).deleteTexture(pi(this,2)),s3=-1}};yt.prototype.close=yt.prototype.close,yt.prototype.clone=yt.prototype.clone,yt.prototype.getAsWebGLTexture=yt.prototype.O,yt.prototype.getAsFloat32Array=yt.prototype.ja,yt.prototype.getAsUint8Array=yt.prototype.ka,yt.prototype.hasWebGLTexture=yt.prototype.R,yt.prototype.hasFloat32Array=yt.prototype.la,yt.prototype.hasUint8Array=yt.prototype.Ha;var s3=250;function Xn(e,t){switch(t){case 0:return e.g.find((n=>n instanceof ImageData));case 1:return e.g.find((n=>typeof ImageBitmap<"u"&&n instanceof ImageBitmap));case 2:return e.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function S4(e){var t=Xn(e,0);if(!t){t=Cr(e);const n=Hl(e),i=new Uint8Array(e.width*e.height*4);Wl(n,t,Ps(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),F1(n),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function Ps(e){let t=Xn(e,2);if(!t){const n=Cr(e);t=_s(e);const i=Xn(e,1)||S4(e);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),uo(e)}return t}function Cr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return e.h||(e.h=yi(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Hl(e){return e.l||(e.l=new D1),e.l}function _s(e){const t=Cr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=Xn(e,2);return n||(n=jl(Hl(e),t),e.g.push(n),e.m=!0),t.bindTexture(t.TEXTURE_2D,n),n}function uo(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function l3(e){const t=Cr(e);return $1(Hl(e),t,!0,(()=>(function(n,i){const a=n.canvas;if(a.width===n.width&&a.height===n.height)return i();const r=a.width,o=a.height;return a.width=n.width,a.height=n.height,n=i(),a.width=r,a.height=o,n})(e,(()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))))}var St=class{constructor(e,t,n,i,a,r,o){this.g=e,this.j=t,this.m=n,this.canvas=i,this.l=a,this.width=r,this.height=o,(this.j||this.m)&&--c3===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ga(){return!!Xn(this,0)}ma(){return!!Xn(this,1)}R(){return!!Xn(this,2)}Ea(){return S4(this)}Da(){var e=Xn(this,1);return e||(Ps(this),_s(this),e=l3(this),uo(this),this.g.push(e),this.j=!0),e}O(){return Ps(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof ImageData)n=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const i=Cr(this),a=Hl(this);i.activeTexture(i.TEXTURE1),n=jl(a,i),i.bindTexture(i.TEXTURE_2D,n),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),Wl(a,i,n),$1(a,i,!1,(()=>{_s(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),uo(this)})),F1(a),uo(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Ps(this),_s(this),n=l3(this),uo(this)}e.push(n)}return new St(e,this.ma(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Xn(this,1).close(),this.m&&Cr(this).deleteTexture(Xn(this,2)),c3=-1}};St.prototype.close=St.prototype.close,St.prototype.clone=St.prototype.clone,St.prototype.getAsWebGLTexture=St.prototype.O,St.prototype.getAsImageBitmap=St.prototype.Da,St.prototype.getAsImageData=St.prototype.Ea,St.prototype.hasWebGLTexture=St.prototype.R,St.prototype.hasImageBitmap=St.prototype.ma,St.prototype.hasImageData=St.prototype.Ga;var c3=250;function Gn(...e){return e.map((([t,n])=>({start:t,end:n})))}const W8=(function(e){return class extends e{Ma(){this.i._registerModelResourcesGraphService()}}})((u3=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:p4()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. 
73Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const n=e.length,i=this.i._malloc(n);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(n,i):this.i._changeTextGraph(n,i),this.i._free(i)}configureAudio(e,t,n,i,a){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),X(this,i||"input_audio",(r=>{X(this,a=a||"audio_header",(o=>{this.i._configureAudio(r,o,e,t,n)}))}))}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}fa(e){jn(this,"__graph_config__",(t=>{e(t)})),X(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)}addAudioToStreamWithShape(e,t,n,i,a){const r=4*e.length;this.h!==r&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(r),this.h=r),this.i.HEAPF32.set(e,this.g/4),X(this,i,(o=>{this.i._addAudioToInputStream(this.g,t,n,o,a)}))}addGpuBufferToStream(e,t,n){X(this,t,(i=>{const[a,r]=n3(this,e,i);this.i._addBoundTextureToStream(i,a,r,n)}))}addBoolToStream(e,t,n){X(this,t,(i=>{this.i._addBoolToInputStream(e,i,n)}))}addDoubleToStream(e,t,n){X(this,t,(i=>{this.i._addDoubleToInputStream(e,i,n)}))}addFloatToStream(e,t,n){X(this,t,(i=>{this.i._addFloatToInputStream(e,i,n)}))}addIntToStream(e,t,n){X(this,t,(i=>{this.i._addIntToInputStream(e,i,n)}))}addUintToStream(e,t,n){X(this,t,(i=>{this.i._addUintToInputStream(e,i,n)}))}addStringToStream(e,t,n){X(this,t,(i=>{X(this,e,(a=>{this.i._addStringToInputStream(a,i,n)}))}))}addStringRecordToStream(e,t,n){X(this,t,(i=>{i3(this,Object.keys(e),(a=>{i3(this,Object.values(e),(r=>{this.i._addFlatHashMapToInputStream(a,r,Object.keys(e).length,i,n)}))}))}))}addProtoToStream(e,t,n,i){X(this,n,(a=>{X(this,t,(r=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,r,a,i),this.i._free(o)}))}))}addEmptyPacketToStream(e,t){X(this,e,(n=>{this.i._addEmptyPacketToInputStream(n,t)}))}addBoolVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateBoolVector(e.length);if(!a)throw Error("Unable to allocate new bool vector on heap.");for(const r of e)this.i._addBoolVectorEntry(a,r);this.i._addBoolVectorToInputStream(a,i,n)}))}addDoubleVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateDoubleVector(e.length);if(!a)throw Error("Unable to allocate new double vector on heap.");for(const r of e)this.i._addDoubleVectorEntry(a,r);this.i._addDoubleVectorToInputStream(a,i,n)}))}addFloatVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateFloatVector(e.length);if(!a)throw Error("Unable to allocate new float vector on heap.");for(const r of e)this.i._addFloatVectorEntry(a,r);this.i._addFloatVectorToInputStream(a,i,n)}))}addIntVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateIntVector(e.length);if(!a)throw Error("Unable to allocate new int vector on heap.");for(const r of e)this.i._addIntVectorEntry(a,r);this.i._addIntVectorToInputStream(a,i,n)}))}addUintVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateUintVector(e.length);if(!a)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of e)this.i._addUintVectorEntry(a,r);this.i._addUintVectorToInputStream(a,i,n)}))}addStringVectorToStream(e,t,n){X(this,t,(i=>{const a=this.i._allocateStringVector(e.length);if(!a)throw Error("Unable to allocate new string vector on heap.");for(const r of e)X(this,r,(o=>{this.i._addStringVectorEntry(a,o)}));this.i._addStringVectorToInputStream(a,i,n)}))}addBoolToInputSidePacket(e,t){X(this,t,(n=>{this.i._addBoolToInputSidePacket(e,n)}))}addDoubleToInputSidePacket(e,t){X(this,t,(n=>{this.i._addDoubleToInputSidePacket(e,n)}))}addFloatToInputSidePacket(e,t){X(this,t,(n=>{this.i._addFloatToInputSidePacket(e,n)}))}addIntToInputSidePacket(e,t){X(this,t,(n=>{this.i._addIntToInputSidePacket(e,n)}))}addUintToInputSidePacket(e,t){X(this,t,(n=>{this.i._addUintToInputSidePacket(e,n)}))}addStringToInputSidePacket(e,t){X(this,t,(n=>{X(this,e,(i=>{this.i._addStringToInputSidePacket(i,n)}))}))}addProtoToInputSidePacket(e,t,n){X(this,n,(i=>{X(this,t,(a=>{const r=this.i._malloc(e.length);this.i.HEAPU8.set(e,r),this.i._addProtoToInputSidePacket(r,e.length,a,i),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const a of e)this.i._addBoolVectorEntry(i,a);this.i._addBoolVectorToInputSidePacket(i,n)}))}addDoubleVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const a of e)this.i._addDoubleVectorEntry(i,a);this.i._addDoubleVectorToInputSidePacket(i,n)}))}addFloatVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const a of e)this.i._addFloatVectorEntry(i,a);this.i._addFloatVectorToInputSidePacket(i,n)}))}addIntVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const a of e)this.i._addIntVectorEntry(i,a);this.i._addIntVectorToInputSidePacket(i,n)}))}addUintVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const a of e)this.i._addUintVectorEntry(i,a);this.i._addUintVectorToInputSidePacket(i,n)}))}addStringVectorToInputSidePacket(e,t){X(this,t,(n=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const a of e)X(this,a,(r=>{this.i._addStringVectorEntry(i,r)}));this.i._addStringVectorToInputSidePacket(i,n)}))}attachBoolListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachBoolListener(n)}))}attachBoolVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachBoolVectorListener(n)}))}attachIntListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachIntListener(n)}))}attachIntVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachIntVectorListener(n)}))}attachUintListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachUintListener(n)}))}attachUintVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachUintVectorListener(n)}))}attachDoubleListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachDoubleListener(n)}))}attachDoubleVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachDoubleVectorListener(n)}))}attachFloatListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachFloatListener(n)}))}attachFloatVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachFloatVectorListener(n)}))}attachStringListener(e,t){jn(this,e,t),X(this,e,(n=>{this.i._attachStringListener(n)}))}attachStringVectorListener(e,t){Oi(this,e,t),X(this,e,(n=>{this.i._attachStringVectorListener(n)}))}attachProtoListener(e,t,n){jn(this,e,t),X(this,e,(i=>{this.i._attachProtoListener(i,n||!1)}))}attachProtoVectorListener(e,t,n){Oi(this,e,t),X(this,e,(i=>{this.i._attachProtoVectorListener(i,n||!1)}))}attachAudioListener(e,t,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),jn(this,e,((i,a)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,a)})),X(this,e,(i=>{this.i._attachAudioListener(i,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends u3{get ha(){return this.i}
73sa(e,t,n){X(this,t,(i=>{const[a,r]=n3(this,e,i);this.ha._addBoundTextureAsImageToStream(i,a,r,n)}))}W(e,t){jn(this,e,t),X(this,e,(n=>{this.ha._attachImageListener(n)}))}da(e,t){Oi(this,e,t),X(this,e,(n=>{this.ha._attachImageVectorListener(n)}))}}));var u3,Cn=class extends W8{};async function me(e,t,n){return(async function(i,a,r,o){return q8(i,a,r,o)})(e,n.canvas??(p4()?void 0:document.createElement("canvas")),t,n)}function k4(e,t,n,i){if(e.V){const r=new Op;if(n?.regionOfInterest){if(!e.ra)throw Error("This task doesn't support region-of-interest.");var a=n.regionOfInterest;if(a.left>=a.right||a.top>=a.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>a.left||0>a.top||1<a.right||1<a.bottom)throw Error("Expected RectF values to be in [0,1].");K(r,1,(a.left+a.right)/2),K(r,2,(a.top+a.bottom)/2),K(r,4,a.right-a.left),K(r,3,a.bottom-a.top)}else K(r,1,.5),K(r,2,.5),K(r,4,1),K(r,3,1);if(n?.rotationDegrees){if(n?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(K(r,5,-Math.PI*n.rotationDegrees/180),n?.rotationDegrees%180!=0){const[o,s]=g4(t);n=nt(r,3)*s/o,a=nt(r,4)*o/s,K(r,4,n),K(r,3,a)}}e.g.addProtoToStream(r.g(),"mediapipe.NormalizedRect",e.V,i)}e.g.sa(t,e.ba,i??performance.now()),e.finishProcessing()}function In(e,t,n){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");k4(e,t,n,e.J+1)}function ui(e,t,n,i){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");k4(e,t,n,i)}function Ir(e,t,n,i){var a=t.data;const r=t.width,o=r*(t=t.height);if((a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return e=new yt([a],n,!1,e.g.i.canvas,e.M,r,t),i?e.clone():e}var Nt=class extends As{constructor(e,t,n,i){super(e),this.g=e,this.ba=t,this.V=n,this.ra=i,this.M=new D1}l(e,t=!0){if("runningMode"in e&&Io(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.M.close(),super.close()}};Nt.prototype.close=Nt.prototype.close;var vn=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},Q(e=this.h=new Vl,0,1,t=new Ge),K(this.h,2,.5),K(this.h,3,.3)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&K(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&K(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},In(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},ui(this,e,n,t),this.j}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect_in"),ye(e,"detections");const t=new cn;Un(t,C8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect_in"),fe(n,"DETECTIONS:detections"),n.o(t),mn(e,n),this.g.attachProtoVectorListener("detections",((i,a)=>{for(const r of i)i=Rp(r),this.j.detections.push(m4(i));U(this,a)})),this.g.attachEmptyPacketListener("detections",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};vn.prototype.detectForVideo=vn.prototype.G,vn.prototype.detect=vn.prototype.F,vn.prototype.setOptions=vn.prototype.o,vn.createFromModelPath=async function(e,t){return me(vn,e,{baseOptions:{modelAssetPath:t}})},vn.createFromModelBuffer=function(e,t){return me(vn,e,{baseOptions:{modelAssetBuffer:t}})},vn.createFromOptions=function(e,t){return me(vn,e,t)};var B1=Gn([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),O1=Gn([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),U1=Gn([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),w4=Gn([474,475],[475,476],[476,477],[477,474]),N1=Gn([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),G1=Gn([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),T4=Gn([469,470],[470,471],[471,472],[472,469]),V1=Gn([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,3
7361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),E4=[...B1,...O1,...U1,...N1,...G1,...V1],M4=Gn(
vendor: 24,341 bytes, line 73
73[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
73);function d3(e){e.u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var He=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!1),this.u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Q(e=this.h=new Hp,0,1,t=new Ge),this.H=new Wp,Q(this.h,0,3,this.H),this.j=new Vl,Q(this.h,0,2,this.j),ti(this.j,4,1),K(this.j,2,.5),K(this.H,2,.5),K(this.h,4,.5)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return"numFaces"in e&&ti(this.j,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&K(this.j,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&K(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&K(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return d3(this),In(this,e,t),this.u}G(e,t,n){return d3(this),ui(this,e,n,t),this.u}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"face_landmarks");const t=new cn;Un(t,L8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"NORM_LANDMARKS:face_landmarks"),n.o(t),mn(e,n),this.g.attachProtoVectorListener("face_landmarks",((i,a)=>{for(const r of i)i=Ho(r),this.u.faceLandmarks.push(zl(i));U(this,a)})),this.g.attachEmptyPacketListener("face_landmarks",(i=>{U(this,i)})),this.outputFaceBlendshapes&&(ye(e,"blendshapes"),fe(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((i,a)=>{if(this.outputFaceBlendshapes)for(const r of i)i=Nl(r),this.u.faceBlendshapes.push(L1(i.g()??[]));U(this,a)})),this.g.attachEmptyPacketListener("blendshapes",(i=>{U(this,i)}))),this.outputFacialTransformationMatrixes&&(ye(e,"face_geometry"),fe(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((i,a)=>{if(this.outputFacialTransformationMatrixes)for(const r of i)(i=ge(I8(r),Bp,2))&&this.u.facialTransformationMatrixes.push({rows:Dn(Tn(i,1),0)??0,columns:Dn(Tn(i,2),0)??0,data:ar(i,3,ra).slice()??[]});U(this,a)})),this.g.attachEmptyPacketListener("face_geometry",(i=>{U(this,i)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};He.prototype.detectForVideo=He.prototype.G,He.prototype.detect=He.prototype.F,He.prototype.setOptions=He.prototype.o,He.createFromModelPath=function(e,t){return me(He,e,{baseOptions:{modelAssetPath:t}})},He.createFromModelBuffer=function(e,t){return me(He,e,{baseOptions:{modelAssetBuffer:t}})},He.createFromOptions=function(e,t){return me(He,e,t)},He.FACE_LANDMARKS_LIPS=B1,He.FACE_LANDMARKS_LEFT_EYE=O1,He.FACE_LANDMARKS_LEFT_EYEBROW=U1,He.FACE_LANDMARKS_LEFT_IRIS=w4,He.FACE_LANDMARKS_RIGHT_EYE=N1,He.FACE_LANDMARKS_RIGHT_EYEBROW=G1,He.FACE_LANDMARKS_RIGHT_IRIS=T4,He.FACE_LANDMARKS_FACE_OVAL=V1,He.FACE_LANDMARKS_CONTOURS=E4,He.FACE_LANDMARKS_TESSELATION=M4;var Wn=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!0),Q(e=this.j=new Yp,0,1,t=new Ge)}get baseOptions(){return ge(this.j,Ge,1)}set baseOptions(e){Q(this.j,0,1,e)}o(e){return super.l(e)}Pa(e,t,n){const i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:n,In(this,e,i??{}),!this.h)return this.u}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"stylized_image");const t=new cn;Un(t,R8,this.j);const n=new It;hn(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"STYLIZED_IMAGE:stylized_image"),n.o(t),mn(e,n),this.g.W("stylized_image",((i,a)=>{var r=!this.h,o=i.data,s=i.width;const l=s*(i=i.height);if(o instanceof Uint8Array)if(o.length===3*l){const u=new Uint8ClampedArray(4*l);for(let c=0;c<l;++c)u[4*c]=o[3*c],u[4*c+1]=o[3*c+1],u[4*c+2]=o[3*c+2],u[4*c+3]=255;o=new ImageData(u,s,i)}else{if(o.length!==4*l)throw Error("Unsupported channel count: "+o.length/l);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),s,i)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);s=new St([o],!1,!1,this.g.i.canvas,this.M,s,i),this.u=r=r?s.clone():s,this.h&&this.h(r),U(this,a)})),this.g.attachEmptyPacketListener("stylized_image",(i=>{this.u=null,this.h&&this.h(null),U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Wn.prototype.stylize=Wn.prototype.Pa,Wn.prototype.setOptions=Wn.prototype.o,Wn.createFromModelPath=function(e,t){return me(Wn,e,{baseOptions:{modelAssetPath:t}})},Wn.createFromModelBuffer=function(e,t){return me(Wn,e,{baseOptions:{modelAssetBuffer:t}})},Wn.createFromOptions=function(e,t){return me(Wn,e,t)};var z1=Gn([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function h3(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function m3(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}
73function f3(e,t=!0){const n=[];for(const a of e){var i=Nl(a);e=[];for(const r of i.g())i=t&&Tn(r,1)!=null?Dn(Tn(r,1),0):-1,e.push({score:nt(r,2)??0,index:i,categoryName:ei(r,3)??"",displayName:ei(r,4)??""});n.push(e)}return n}var Jt=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Q(e=this.v=new i4,0,1,t=new Ge),this.A=new A1,Q(this.v,0,2,this.A),this.u=new E1,Q(this.A,0,3,this.u),this.h=new e4,Q(this.A,0,2,this.h),this.j=new $8,Q(this.v,0,3,this.j),K(this.h,2,.5),K(this.A,4,.5),K(this.u,2,.5)}get baseOptions(){return ge(this.v,Ge,1)}set baseOptions(e){Q(this.v,0,1,e)}o(e){if(ti(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&K(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&K(this.A,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&K(this.u,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new Ya,n=t,i=Pu(e.cannedGesturesClassifierOptions,ge(this.j,Ya,3)?.h());Q(n,0,2,i),Q(this.j,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&ge(this.j,Ya,3)?.g();return e.customGesturesClassifierOptions?(Q(n=t=new Ya,0,2,i=Pu(e.customGesturesClassifierOptions,ge(this.j,Ya,4)?.h())),Q(this.j,0,4,t)):e.customGesturesClassifierOptions===void 0&&ge(this.j,Ya,4)?.g(),this.l(e)}Ka(e,t){return h3(this),In(this,e,t),m3(this)}La(e,t,n){return h3(this),ui(this,e,n,t),m3(this)}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"hand_gestures"),ye(e,"hand_landmarks"),ye(e,"world_hand_landmarks"),ye(e,"handedness");const t=new cn;Un(t,x8,this.v);const n=new It;hn(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"HAND_GESTURES:hand_gestures"),fe(n,"LANDMARKS:hand_landmarks"),fe(n,"WORLD_LANDMARKS:world_hand_landmarks"),fe(n,"HANDEDNESS:handedness"),n.o(t),mn(e,n),this.g.attachProtoVectorListener("hand_landmarks",((i,a)=>{for(const r of i){i=Ho(r);const o=[];for(const s of Mi(i,Dp,1))o.push({x:nt(s,1)??0,y:nt(s,2)??0,z:nt(s,3)??0,visibility:nt(s,4)??0});this.landmarks.push(o)}U(this,a)})),this.g.attachEmptyPacketListener("hand_landmarks",(i=>{U(this,i)})),this.g.attachProtoVectorListener("world_hand_landmarks",((i,a)=>{for(const r of i){i=ur(r);const o=[];for(const s of Mi(i,$p,1))o.push({x:nt(s,1)??0,y:nt(s,2)??0,z:nt(s,3)??0,visibility:nt(s,4)??0});this.worldLandmarks.push(o)}U(this,a)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(i=>{U(this,i)})),this.g.attachProtoVectorListener("hand_gestures",((i,a)=>{this.gestures.push(...f3(i,!1)),U(this,a)})),this.g.attachEmptyPacketListener("hand_gestures",(i=>{U(this,i)})),this.g.attachProtoVectorListener("handedness",((i,a)=>{this.handedness.push(...f3(i)),U(this,a)})),this.g.attachEmptyPacketListener("handedness",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function p3(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Jt.prototype.recognizeForVideo=Jt.prototype.La,Jt.prototype.recognize=Jt.prototype.Ka,Jt.prototype.setOptions=Jt.prototype.o,Jt.createFromModelPath=function(e,t){return me(Jt,e,{baseOptions:{modelAssetPath:t}})},Jt.createFromModelBuffer=function(e,t){return me(Jt,e,{baseOptions:{modelAssetBuffer:t}})},Jt.createFromOptions=function(e,t){return me(Jt,e,t)},Jt.HAND_CONNECTIONS=z1;var Qt=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Q(e=this.j=new A1,0,1,t=new Ge),this.u=new E1,Q(this.j,0,3,this.u),this.h=new e4,Q(this.j,0,2,this.h),ti(this.h,3,1),K(this.h,2,.5),K(this.u,2,.5),K(this.j,4,.5)}get baseOptions(){return ge(this.j,Ge,1)}set baseOptions(e){Q(this.j,0,1,e)}o(e){return"numHands"in e&&ti(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&K(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&K(this.j,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&K(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],In(this,e,t),p3(this)}G(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ui(this,e,n,t),p3(this)}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"hand_landmarks"),ye(e,"world_hand_landmarks"),ye(e,"handedness");const t=new cn;Un(t,D8,this.j);const n=new It;hn(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"LANDMARKS:hand_landmarks"),fe(n,"WORLD_LANDMARKS:world_hand_landmarks"),fe(n,"HANDEDNESS:handedness"),n.o(t),mn(e,n),this.g.attachProtoVectorListener("hand_landmarks",((i,a)=>{for(const r of i)i=Ho(r),this.landmarks.push(zl(i));U(this,a)})),this.g.attachEmptyPacketListener("hand_landmarks",(i=>{U(this,i)})),this.g.attachProtoVectorListener("world_hand_landmarks",((i,a)=>{for(const r of i)i=ur(r),this.worldLandmarks.push(ko(i));U(this,a)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(i=>{U(this,i)})),this.g.attachProtoVectorListener("handedness",((i,a)=>{var r=this.handedness,o=r.push;const s=[];for(const l of i){i=Nl(l);const u=[];for(const c of i.g())u.push({score:nt(c,2)??0,index:Dn(Tn(c,1),0)??-1,categoryName:ei(c,3)??"",dis
73playName:ei(c,4)??""});s.push(u)}o.call(r,...s),U(this,a)})),this.g.attachEmptyPacketListener("handedness",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Qt.prototype.detectForVideo=Qt.prototype.G,Qt.prototype.detect=Qt.prototype.F,Qt.prototype.setOptions=Qt.prototype.o,Qt.createFromModelPath=function(e,t){return me(Qt,e,{baseOptions:{modelAssetPath:t}})},Qt.createFromModelBuffer=function(e,t){return me(Qt,e,{baseOptions:{modelAssetBuffer:t}})},Qt.createFromOptions=function(e,t){return me(Qt,e,t)},Qt.HAND_CONNECTIONS=z1;var A4=Gn([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function g3(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function v3(e){try{if(!e.I)return e.h;e.I(e.h)}finally{ql(e)}}function os(e,t){e=Ho(e),t.push(zl(e))}var Be=class extends Nt{constructor(e,t){super(new Cn(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,Q(e=this.A=new o4,0,1,t=new Ge),this.u=new E1,Q(this.A,0,2,this.u),this.aa=new B8,Q(this.A,0,3,this.aa),this.j=new Vl,Q(this.A,0,4,this.j),this.H=new Wp,Q(this.A,0,5,this.H),this.v=new a4,Q(this.A,0,6,this.v),this.D=new r4,Q(this.A,0,7,this.D),K(this.j,2,.5),K(this.j,3,.3),K(this.H,2,.5),K(this.v,2,.5),K(this.v,3,.3),K(this.D,2,.5),K(this.u,2,.5)}get baseOptions(){return ge(this.A,Ge,1)}set baseOptions(e){Q(this.A,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&K(this.j,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&K(this.j,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&K(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&K(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&K(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&K(this.D,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&K(this.u,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,n){const i=typeof t!="function"?t:{};return this.I=typeof t=="function"?t:n,g3(this),In(this,e,i),v3(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.I=typeof n=="function"?n:i,g3(this),ui(this,e,a,t),v3(this)}m(){var e=new Bt;De(e,"input_frames_image"),ye(e,"pose_landmarks"),ye(e,"pose_world_landmarks"),ye(e,"face_landmarks"),ye(e,"left_hand_landmarks"),ye(e,"left_hand_world_landmarks"),ye(e,"right_hand_landmarks"),ye(e,"right_hand_world_landmarks");const t=new cn,n=new Xh;wu(n,1,Hr("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),(function(a,r){if(r!=null)if(Array.isArray(r))Le(a,2,$l(r,m1,void 0,void 0,!1));else{if(!(typeof r=="string"||r instanceof vi||Go(r)))throw Error("invalid value in Any.value field: "+r+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");wu(a,2,s1(r,!1,!1),xa())}})(n,this.A.g());const i=new It;hn(i,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Ws(i,8,Xh,n),Re(i,"IMAGE:input_frames_image"),fe(i,"POSE_LANDMARKS:pose_landmarks"),fe(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),fe(i,"FACE_LANDMARKS:face_landmarks"),fe(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),fe(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),fe(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),fe(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),mn(e,i),Kl(this,e),this.g.attachProtoListener("pose_landmarks",((a,r)=>{os(a,this.h.poseLandmarks),U(this,r)})),this.g.attachEmptyPacketListener("pose_landmarks",(a=>{U(this,a)})),this.g.attachProtoListener("pose_world_landmarks",((a,r)=>{var o=this.h.poseWorldLandmarks;a=ur(a),o.push(ko(a)),U(this,r)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(a=>{U(this,a)})),this.outputPoseSegmentationMasks&&(fe(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Pr(this,"pose_segmentation_mask"),this.g.W("pose_segmentation_mask",((a,r)=>
73{this.h.poseSegmentationMasks=[Ir(this,a,!0,!this.I)],U(this,r)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(a=>{this.h.poseSegmentationMasks=[],U(this,a)}))),this.g.attachProtoListener("face_landmarks",((a,r)=>{os(a,this.h.faceLandmarks),U(this,r)})),this.g.attachEmptyPacketListener("face_landmarks",(a=>{U(this,a)})),this.outputFaceBlendshapes&&(ye(e,"extra_blendshapes"),fe(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((a,r)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(a=Nl(a),o.push(L1(a.g()??[]))),U(this,r)})),this.g.attachEmptyPacketListener("extra_blendshapes",(a=>{U(this,a)}))),this.g.attachProtoListener("left_hand_landmarks",((a,r)=>{os(a,this.h.leftHandLandmarks),U(this,r)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(a=>{U(this,a)})),this.g.attachProtoListener("left_hand_world_landmarks",((a,r)=>{var o=this.h.leftHandWorldLandmarks;a=ur(a),o.push(ko(a)),U(this,r)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(a=>{U(this,a)})),this.g.attachProtoListener("right_hand_landmarks",((a,r)=>{os(a,this.h.rightHandLandmarks),U(this,r)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(a=>{U(this,a)})),this.g.attachProtoListener("right_hand_world_landmarks",((a,r)=>{var o=this.h.rightHandWorldLandmarks;a=ur(a),o.push(ko(a)),U(this,r)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(a=>{U(this,a)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Be.prototype.detectForVideo=Be.prototype.G,Be.prototype.detect=Be.prototype.F,Be.prototype.setOptions=Be.prototype.o,Be.createFromModelPath=function(e,t){return me(Be,e,{baseOptions:{modelAssetPath:t}})},Be.createFromModelBuffer=function(e,t){return me(Be,e,{baseOptions:{modelAssetBuffer:t}})},Be.createFromOptions=function(e,t){return me(Be,e,t)},Be.HAND_CONNECTIONS=z1,Be.POSE_CONNECTIONS=A4,Be.FACE_LANDMARKS_LIPS=B1,Be.FACE_LANDMARKS_LEFT_EYE=O1,Be.FACE_LANDMARKS_LEFT_EYEBROW=U1,Be.FACE_LANDMARKS_LEFT_IRIS=w4,Be.FACE_LANDMARKS_RIGHT_EYE=N1,Be.FACE_LANDMARKS_RIGHT_EYEBROW=G1,Be.FACE_LANDMARKS_RIGHT_IRIS=T4,Be.FACE_LANDMARKS_FACE_OVAL=V1,Be.FACE_LANDMARKS_CONTOURS=E4,Be.FACE_LANDMARKS_TESSELATION=M4;var bn=class extends Nt{constructor(e,t){super(new Cn(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},Q(e=this.h=new s4,0,1,t=new Ge)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return Q(this.h,0,2,Pu(e,ge(this.h,Gl,2))),this.l(e)}ua(e,t){return this.j={classifications:[]},In(this,e,t),this.j}va(e,t,n){return this.j={classifications:[]},ui(this,e,n,t),this.j}m(){var e=new Bt;De(e,"input_image"),De(e,"norm_rect"),ye(e,"classifications");const t=new cn;Un(t,U8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Re(n,"IMAGE:input_image"),Re(n,"NORM_RECT:norm_rect"),fe(n,"CLASSIFICATIONS:classifications"),n.o(t),mn(e,n),this.g.attachProtoListener("classifications",((i,a)=>{this.j=(function(r){const o={classifications:Mi(r,k8,1).map((s=>L1(ge(s,k1,4)?.g()??[],Dn(Tn(s,2),0),ei(s,3))))};return zs(Ji(r,2))!=null&&(o.timestampMs=Dn(zs(Ji(r,2)),0)),o})(T8(i)),U(this,a)})),this.g.attachEmptyPacketListener("classifications",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};bn.prototype.classifyForVideo=bn.prototype.va,bn.prototype.classify=bn.prototype.ua,bn.prototype.setOptions=bn.prototype.o,bn.createFromModelPath=function(e,t){return me(bn,e,{baseOptions:{modelAssetPath:t}})},bn.createFromModelBuffer=function(e,t){return me(bn,e,{baseOptions:{modelAssetBuffer:t}})},bn.createFromOptions=function(e,t){return me(bn,e,t)};var Zt=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!0),this.h=new l4,this.embeddings={embeddings:[]},Q(e=this.h,0,1,t=new Ge)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){var t=this.h,n=ge(this.h,Jh,2);return n=n?n.clone():new Jh,e.l2Normalize!==void 0?Io(n,1,e.l2Normalize):"l2Normalize"in e&&Le(n,1),e.quantize!==void 0?Io(n,2,e.quantize):"quantize"in e&&Le(n,2),Q(t,0,2,n),this.l(e)}Ba(e,t){return In(this,e,t),this.embeddings}
73Ca(e,t,n){return ui(this,e,n,t),this.embeddings}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"embeddings_out");const t=new cn;Un(t,N8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"EMBEDDINGS:embeddings_out"),n.o(t),mn(e,n),this.g.attachProtoListener("embeddings_out",((i,a)=>{i=P8(i),this.embeddings=(function(r){return{embeddings:Mi(r,M8,1).map((o=>{const s={headIndex:Dn(Tn(o,3),0)??-1,headName:ei(o,4)??""};if(ip(o,Mu,Mc(o,1))!==void 0)o=ar(o=ge(o,Mu,Mc(o,1)),1,ra),s.floatEmbedding=o.slice();else{const l=new Uint8Array(0);s.quantizedEmbedding=ge(o,E8,Mc(o,2))?.qa()?.h()??l}return s})),timestampMs:Dn(zs(Ji(r,2)),0)}})(i),U(this,a)})),this.g.attachEmptyPacketListener("embeddings_out",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Zt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=e3(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=e3(Zh(e.quantizedEmbedding),Zh(t.quantizedEmbedding))}return e},Zt.prototype.embedForVideo=Zt.prototype.Ca,Zt.prototype.embed=Zt.prototype.Ba,Zt.prototype.setOptions=Zt.prototype.o,Zt.createFromModelPath=function(e,t){return me(Zt,e,{baseOptions:{modelAssetPath:t}})},Zt.createFromModelBuffer=function(e,t){return me(Zt,e,{baseOptions:{modelAssetBuffer:t}})},Zt.createFromOptions=function(e,t){return me(Zt,e,t)};var Iu=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};function b3(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function y3(e){try{const t=new Iu(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{ql(e)}}Iu.prototype.close=Iu.prototype.close;var xt=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new C1,this.v=new c4,Q(this.h,0,3,this.v),Q(e=this.h,0,1,t=new Ge)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Le(this.h,2,Hr(e.displayNamesLocale)):"displayNamesLocale"in e&&Le(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){(function(e){const t=Mi(e.fa(),It,1).filter((n=>ei(n,1).includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(e.u=[],1<t.length)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(ge(t[0],cn,7)?.l()?.g()??new Map).forEach(((n,i)=>{e.u[Number(i)]=ei(n,1)}))})(this)}ga(e,t,n){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,b3(this),In(this,e,i),y3(this)}Na(e,t,n,i){const a=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:i,b3(this),ui(this,e,a,t),y3(this)}Fa(){return this.u}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect");const t=new cn;Un(t,d4,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),n.o(t),mn(e,n),Kl(this,e),this.outputConfidenceMasks&&(ye(e,"confidence_masks"),fe(n,"CONFIDENCE_MASKS:confidence_masks"),Pr(this,"confidence_masks"),this.g.da("confidence_masks",((i,a)=>{this.confidenceMasks=i.map((r=>Ir(this,r,!0,!this.j))),U(this,a)})),this.g.attachEmptyPacketListener("confidence_masks",(i=>{this.confidenceMasks=[],U(this,i)}))),this.outputCategoryMask&&(ye(e,"category_mask"),fe(n,"CATEGORY_MASK:category_mask"),Pr(this,"category_mask"),this.g.W("category_mask",((i,a)=>{this.categoryMask=Ir(this,i,!1,!this.j),U(this,a)})),this.g.attachEmptyPacketListener("category_mask",(i=>{this.categoryMask=void 0,U(this,i)}))),ye(e,"quality_scores"),fe(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((i,a)=>
73{this.qualityScores=i,U(this,a)})),this.g.attachEmptyPacketListener("quality_scores",(i=>{this.categoryMask=void 0,U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.getLabels=xt.prototype.Fa,xt.prototype.segmentForVideo=xt.prototype.Na,xt.prototype.segment=xt.prototype.ga,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=function(e,t){return me(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return me(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return me(xt,e,t)};var Lu=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};Lu.prototype.close=Lu.prototype.close;var H8=class extends z{constructor(e){super(e)}},Lr=[0,Qe,-2],X8=[0,bi,-3,it],Xl=[0,bi,-3,it,bi,-1],P4=[0,Xl],Y8=[0,P4,Lr],J8=[0,Xl,Lr],_4=[0,Xl,Qe,-1],Q8=[0,_4,Lr],Z8=[0,bi,-3,it,Lr,-1],eb=[0,bi,-3,it,ni],Cc=class extends z{constructor(e){super(e)}},S3=[0,bi,-1,it],C4=class extends z{constructor(){super()}};C4.B=[1];var k3=class extends z{constructor(e){super(e)}},Ru=[1,2,3,4,5,6,7,8,9,10,14,15],tb=[0,Ru,_e,Xl,_e,J8,_e,P4,_e,Y8,_e,S3,_e,eb,_e,X8,_e,[0,Pe,bi,-2,it,Qe,it,-1,2,bi,Lr],_e,_4,_e,Q8,bi,Lr,Pe,_e,Z8,_e,[0,lt,S3]],nb=[0,Pe,Qe,-1,it],$u=class extends z{constructor(){super()}};$u.B=[1],$u.prototype.g=Ul([0,lt,tb,Pe,nb]);var Hn=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new C1,this.v=new c4,Q(this.h,0,3,this.v),Q(e=this.h,0,1,t=new Ge)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}ga(e,t,n,i){const a=typeof n!="function"?n:{};this.j=typeof n=="function"?n:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.J+1,i=new $u;const r=new k3;var o=new H8;if(ti(o,1,255),Q(r,0,12,o),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var s=new Cc;Io(s,3,!0),K(s,1,t.keypoint.x),K(s,2,t.keypoint.y),bo(r,5,Ru,s)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(s of(o=new C4,t.scribble))Io(t=new Cc,3,!0),K(t,1,s.x),K(t,2,s.y),Ws(o,1,Cc,t);bo(r,15,Ru,o)}Ws(i,1,k3,r),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",n),In(this,e,a);e:{try{const u=new Lu(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var l=u;break e}this.j(u)}finally{ql(this)}l=void 0}return l}m(){var e=new Bt;De(e,"image_in"),De(e,"roi_in"),De(e,"norm_rect_in");const t=new cn;Un(t,d4,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Re(n,"IMAGE:image_in"),Re(n,"ROI:roi_in"),Re(n,"NORM_RECT:norm_rect_in"),n.o(t),mn(e,n),Kl(this,e),this.outputConfidenceMasks&&(ye(e,"confidence_masks"),fe(n,"CONFIDENCE_MASKS:confidence_masks"),Pr(this,"confidence_masks"),this.g.da("confidence_masks",((i,a)=>{this.confidenceMasks=i.map((r=>Ir(this,r,!0,!this.j))),U(this,a)})),this.g.attachEmptyPacketListener("confidence_masks",(i=>{this.confidenceMasks=[],U(this,i)}))),this.outputCategoryMask&&(ye(e,"category_mask"),fe(n,"CATEGORY_MASK:category_mask"),Pr(this,"category_mask"),this.g.W("category_mask",((i,a)=>{this.categoryMask=Ir(this,i,!1,!this.j),U(this,a)})),this.g.attachEmptyPacketListener("category_mask",(i=>{this.categoryMask=void 0,U(this,i)}))),ye(e,"quality_scores"),fe(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((i,a)=>{this.qualityScores=i,U(this,a)})),this.g.attachEmptyPacketListener("quality_scores",(i=>{this.categoryMask=void 0,U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Hn.prototype.segment=Hn.prototype.ga,Hn.prototype.setOptions=Hn.prototype.o,Hn.createFromModelPath=function(e,t){return me(Hn,e,{baseOptions:{modelAssetPath:t}})},Hn.createFromModelBuffer=function(e,t){return me(Hn,e,{baseOptions:{modelAssetBuffer:t}})},Hn.createFromOptions=function(e,t){return me(Hn,e,t)};var yn=class extends Nt{constructor(e,t){super(new Cn(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Q(e=this.h=new I1,0,1,t=new Ge)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Le(this.h,2,Hr(e.displayNamesLocale)):"displayNamesLocale"in e&&Le(this.h,2),e.maxResults!==void 0?ti(this.h,3,e.maxResults):"maxResults"in e&&Le(this.h,3),e.scoreThreshold!==void 0?K(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Le(this.h,4),e.categoryAllowlist!==void 0?js(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Le(this.h,5),e.categoryDenylist!==void 0?js(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Le(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},In(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},ui(this,e,n,t),this.j}m(){var e=new Bt;De(e,"input_frame_gpu"),De(e,"norm_rect"),ye(e,"detections");const t=new cn;Un(t,V8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),Re(n,"IMAGE:input_frame_gpu"),Re(n,"NORM_RECT:norm_rect"),fe(n,"DETECTIONS:detections"),n.o(t),mn(e,n),this.g.attachProtoVectorListener("detections",((i,a)=>{for(const r of i)i=Rp(r),this.j.detections.push(m4(i));U(this,a)})),this.g.attachEmptyPacketListener("detections",(i=>{U(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};yn.prototype.detectForVideo=yn.prototype.G,yn.prototype.detect=yn.prototype.F,yn.prototype.setOptions=yn.prototype.o,yn.createFromModelPath=async function(e,t){return me(yn,e,{baseOptions:{modelAssetPath:t}})},yn.createFromModelBuffer=function(e,t){return me(yn,e,{baseOptions:{modelAssetBuffer:t}})},yn.createFromOptions=function(e,t){return me(yn,e,t)};var Fu=class{constructor(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}close(){this.segmentationMasks?.forEach((e=>{e.close()}))}};function w3(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function T3(e){try{const t=new Fu(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.j)return t;e.j(t)}finally{ql(e)}}Fu.prototype.close=Fu.prototype.close;var en=class extends Nt{constructor(e,t){super(new Cn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Q(e=this.h=new h4,0,1,t=new Ge),this.D=new r4,Q(this.h,0,3,this.D),this.v=new a4,Q(this.h,0,2,this.v),ti(this.v,4,1),K(this.v,2,.5),K(this.D,2,.5),K(this.h,4,.5)}get baseOptions(){return ge(this.h,Ge,1)}set baseOptions(e){Q(this.h,0,1,e)}o(e){return"numPoses"in e&&ti(this.v,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&K(this.v,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&K(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&K(this.D,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}
73F(e,t,n){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,w3(this),In(this,e,i),T3(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:i,w3(this),ui(this,e,a,t),T3(this)}m(){var e=new Bt;De(e,"image_in"),De(e,"norm_rect"),ye(e,"normalized_landmarks"),ye(e,"world_landmarks"),ye(e,"segmentation_masks");const t=new cn;Un(t,z8,this.h);const n=new It;hn(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Re(n,"IMAGE:image_in"),Re(n,"NORM_RECT:norm_rect"),fe(n,"NORM_LANDMARKS:normalized_landmarks"),fe(n,"WORLD_LANDMARKS:world_landmarks"),n.o(t),mn(e,n),Kl(this,e),this.g.attachProtoVectorListener("normalized_landmarks",((i,a)=>{this.landmarks=[];for(const r of i)i=Ho(r),this.landmarks.push(zl(i));U(this,a)})),this.g.attachEmptyPacketListener("normalized_landmarks",(i=>{this.landmarks=[],U(this,i)})),this.g.attachProtoVectorListener("world_landmarks",((i,a)=>{this.worldLandmarks=[];for(const r of i)i=ur(r),this.worldLandmarks.push(ko(i));U(this,a)})),this.g.attachEmptyPacketListener("world_landmarks",(i=>{this.worldLandmarks=[],U(this,i)})),this.outputSegmentationMasks&&(fe(n,"SEGMENTATION_MASK:segmentation_masks"),Pr(this,"segmentation_masks"),this.g.da("segmentation_masks",((i,a)=>{this.segmentationMasks=i.map((r=>Ir(this,r,!0,!this.j))),U(this,a)})),this.g.attachEmptyPacketListener("segmentation_masks",(i=>{this.segmentationMasks=[],U(this,i)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};en.prototype.detectForVideo=en.prototype.G,en.prototype.detect=en.prototype.F,en.prototype.setOptions=en.prototype.o,en.createFromModelPath=function(e,t){return me(en,e,{baseOptions:{modelAssetPath:t}})},en.createFromModelBuffer=function(e,t){return me(en,e,{baseOptions:{modelAssetBuffer:t}})},en.createFromOptions=function(e,t){return me(en,e,t)},en.POSE_CONNECTIONS=A4;var ib=()=>typeof OffscreenCanvas<"u";async function E3(e){return new Promise(t=>setTimeout(t,e))}async function ab(e){await E3(10);const n=Date.now();for(;Date.now()-n<500;){const{width:i,height:a}=e.getSettings();if(i&&a)return{width:i,height:a};await E3(50)}return{width:void 0,height:void 0}}function Xs(e,t){if(ib())return new OffscreenCanvas(e,t);const n=document.createElement("canvas");return n.width=e,n.height=t,n}var I4=(e=>(e.ProcessorWrapper="livekit-processor-wrapper",e.BackgroundProcessor="livekit-background-processor",e.WebGl="livekit-track-processor-web-gl",e))(I4||{}),rb=Qr("livekit");Object.values(I4).map(e=>Qr(e));rb.setDefaultLevel(2);function Qr(e){return zg(e)}var Yl=class L4{constructor(t,n,i={}){this.useStreamFallback=!1,this.processingEnabled=!1,this.log=Qr("livekit-processor-wrapper"),this.lifecycleState="idle";var a;this.name=n,this.transformer=t,this.maxFps=(a=i.maxFps)!=null?a:30}static get isSupported(){const t=typeof MediaStreamTrackGenerator<"u"&&typeof MediaStreamTrackProcessor<"u",n=typeof HTMLCanvasElement<"u"&&typeof VideoFrame<"u"&&"captureStream"in HTMLCanvasElement.prototype;return t||n}static get hasModernApiSupport(){return typeof MediaStreamTrackGenerator<"u"&&typeof MediaStreamTrackProcessor<"u"}async setup(t){this.source=t.track;const{width:n,height:i}=await ab(this.source);if(this.sourceDummy=t.element,!(this.sourceDummy instanceof HTMLVideoElement))throw TypeError("Currently only video transformers are supported");if(this.sourceDummy instanceof HTMLVideoElement&&(this.sourceDummy.height=i??300,this.sourceDummy.width=n??300),this.useStreamFallback=!L4.hasModernApiSupport,this.useStreamFallback){const a=document.querySelector('canvas[data-livekit-processor="'+this.name+'"]');a?(this.displayCanvas=a,this.displayCanvas.width=n??300,this.displayCanvas.height=i??300):(this.displayCanvas=document.createElement("canvas"),this.displayCanvas.width=n??300,this.displayCanvas.height=i??300,this.displayCanvas.style.display="none",this.displayCanvas.dataset.livekitProcessor=this.name,document.body.appendChild(this.displayCanvas)),this.renderContext=this.displayCanvas.getContext("2d"),this.capturedStream=this.displayCanvas.captureStream(),this.canvas=Xs(n??300,i??300)}else this.processor=new MediaStreamTrackProcessor({track:this.source}),this.trackGenerator=new MediaStreamTrackGenerator({kind:"video",signalTarget:this.source}),this.canvas=Xs(n??300,i??300)}async init(t){if(this.log.debug("Init called"),this.lifecycleState="initializing",await this.setup(t),!this.canvas)throw new TypeError("Expected canvas to be defined after setup");await this.transformer.init({outputCanvas:this.canvas,inputElement:this.sourceDummy}),this.useStreamFallback?this.initFallbackPath():this.initStreamProcessorPath(),this.lifecycleState="running"}initStreamProcessorPath(){if(!this.processor||!this.trackGenerator)throw new TypeError("Expected processor and trackGenerator to be defined for stream processor path");this.processor.readable.pipeThrough(this.transformer.transformer).pipeTo(this.trackGenerator.writable).then(()=>this.handleMediaExhausted()).catch(i=>{i instanceof DOMException&&i.name==="AbortError"?this.log.log("stream processor path aborted"):i instanceof DOMException&&i.name==="InvalidStateError"&&i.message==="Stream closed"?(this.log.log("stream processor underlying stream closed"),this.handleMediaExhausted()):(this.log.error("error when trying to pipe",i),this.destroy())}),this.processedTrack=this.trackGenerator}initFallbackPath(){if(!this.capturedStream||!this.source||!this.canvas||!this.renderContext)throw new TypeError("Missing required components for fallback implementation");this.processedTrack=this.capturedStream.getVideoTracks()[0],this.processingEnabled=!0,this.frameCallback=t=>{if(!this.processingEnabled||!t){t.close();return}const n={enqueue:i=>{this.renderContext&&this.displayCanvas&&(this.renderContext.drawImage(i,0,0,this.displayCanvas.width,this.displayCanvas.height),i.close())}};try{this.transformer.transform(t,n)}catch(i){this.log.error("Error in transform:",i),t.close()}},this.startRenderLoop()}startRenderLoop(){if(!this.sourceDummy||!(this.sourceDummy instanceof HTMLVideoElement)){this.handleMediaExhausted();return}let t=-1,n=0;const i=this.sourceDummy,a=1e3/this.maxFps;let r=this.maxFps,o=[],s=0,l=0,u=0;const c=()=>
73{if(!this.processingEnabled||!this.sourceDummy||!(this.sourceDummy instanceof HTMLVideoElement)){this.handleMediaExhausted();return}if(this.sourceDummy.paused){this.log.warn("Video is paused, trying to play"),this.sourceDummy.play().then(()=>{this.animationFrameId=requestAnimationFrame(c)});return}const m=i.currentTime,f=performance.now(),h=f-n,d=m!==t;if(d){if(s>0){const S=f-s;o.push(S),o.length>10&&o.shift(),o.length>2&&(r=1e3/(o.reduce((_,T)=>_+T,0)/o.length),(typeof window<"u"&&window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")&&f-u>5e3&&(this.log.debug(`[${this.name}] Estimated video FPS: ${r.toFixed(1)}, Processing at: ${(l/5).toFixed(1)} FPS`),l=0,u=f))}s=f}const y=h>=a;if(d&&y){t=m,n=f,l++;try{if(i.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA){const S=new VideoFrame(i);this.frameCallback?this.frameCallback(S):S.close()}}catch(S){this.log.error("Error in render loop:",S)}}this.animationFrameId=requestAnimationFrame(c)};this.animationFrameId=requestAnimationFrame(c)}async restart(t){this.log.debug("Restart called"),await this.destroy({willProcessorRestart:!0}),await this.init(t)}async restartTransformer(...t){await this.transformer.restart(t[0])}async updateTransformerOptions(...t){await this.transformer.update(t[0])}async handleMediaExhausted(){this.log.debug("Media was exhausted from source"),this.lifecycleState==="running"&&(this.lifecycleState="media-exhausted",await this.cleanup())}async cleanup(){var t,n,i,a;this.useStreamFallback?(this.processingEnabled=!1,this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0),this.displayCanvas&&this.displayCanvas.parentNode&&this.displayCanvas.parentNode.removeChild(this.displayCanvas),(t=this.capturedStream)==null||t.getTracks().forEach(r=>r.stop())):(await((i=(n=this.processor)==null?void 0:n.writableControl)==null?void 0:i.close()),(a=this.trackGenerator)==null||a.stop())}async destroy(t={willProcessorRestart:!1}){switch(this.log.debug(`Destroy called - lifecycleState=${this.lifecycleState}, transformerDestroyOptions=${JSON.stringify(t)}`),this.lifecycleState){case"running":case"media-exhausted":this.lifecycleState="destroying",await this.cleanup(),await this.transformer.destroy(t),this.lifecycleState="destroyed";break}}},ob={"@mediapipe/tasks-vision":"0.10.14"},R4=Qr("livekit-track-processor-web-gl");function ga(e,t){const n=e.TEXTURE0+t;e.activeTexture(n);const i=e.createTexture();return e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.bindTexture(e.TEXTURE_2D,i),i}function ea(e,t,n){const i=e.createShader(t);if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw R4.error("Shader compile failed:",e.getShaderInfoLog(i)),e.deleteShader(i),new Error("Shader compile failed");return i}function Jl(e,t,n){const i=e.createProgram();if(e.attachShader(i,t),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw R4.error("Program link failed:",e.getProgramInfoLog(i)),new Error("Program link failed");return i}function ro(e,t,n,i){const a=e.createFramebuffer();if(e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,i,0,e.RGBA,e.UNSIGNED_BYTE,null),e.checkFramebufferStatus(e.FRAMEBUFFER)!==e.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer not complete");return e.bindFramebuffer(e.FRAMEBUFFER,null),a}function sb(e){const t=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,-1,-1,1,1,1,-1]),e.STATIC_DRAW),t}async function lb(e,t,n){const i=e.width/e.height,a=t/n;let r=0,o=0,s=e.width,l=e.height;return i>a?(s=Math.round(e.height*a),r=Math.round((e.width-s)/2)):i<a&&(l=Math.round(e.width/a),o=Math.round((e.height-l)/2)),createImageBitmap(e,r,o,s,l,{resizeWidth:t,resizeHeight:n,resizeQuality:"medium"})}var va;function cb(){return va||(va=new ImageData(2,2),va.data[0]=0,va.data[1]=0,va.data[2]=0,va.data[3]=0),va}var K1=e=>e,q1=(e=!0)=>`#version 300 es
74  in vec2 position;
75  out vec2 texCoords;
76
77  void main() {
78    texCoords = (position + 1.0) / 2.0;
79    texCoords.y = ${e?"1.0 - texCoords.y":"texCoords.y"};
80    gl_Position = vec4(position, 0, 1.0);
81  }
82`,ub=K1`#version 300 es
83  precision mediump float;
84  in vec2 texCoords;
85  uniform sampler2D u_texture;
86  uniform vec2 u_texelSize;
87  uniform vec2 u_direction;
88  uniform float u_radius;
89  out vec4 fragColor;
90
91  void main() {
92    float sigma = u_radius;
93    float twoSigmaSq = 2.0 * sigma * sigma;
94    float totalWeight = 0.0;
95    vec3 result = vec3(0.0);
96    const int MAX_SAMPLES = 16;
97    int radius = int(min(float(MAX_SAMPLES), ceil(u_radius)));
98
99    for (int i = -MAX_SAMPLES; i <= MAX_SAMPLES; ++i) {
100      float offset = float(i);
101      if (abs(offset) > float(radius)) continue;
102      float weight = exp(-(offset * offset) / twoSigmaSq);
103      vec2 sampleCoord = texCoords + u_direction * u_texelSize * offset;
104      result += texture(u_texture, sampleCoord).rgb * weight;
105      totalWeight += weight;
106    }
107
108    fragColor = vec4(result / totalWeight, 1.0);
109  }
110`;function db(e){const t=ea(e,e.VERTEX_SHADER,q1()),n=ea(e,e.FRAGMENT_SHADER,ub),i=Jl(e,t,n),a={position:e.getAttribLocation(i,"position"),texture:e.getUniformLocation(i,"u_texture"),texelSize:e.getUniformLocation(i,"u_texelSize"),direction:e.getUniformLocation(i,"u_direction"),radius:e.getUniformLocation(i,"u_radius")};return{program:i,shader:n,vertexShader:t,uniforms:a}}function M3(e,t,n,i,a,r,o,s,l,u){e.useProgram(r),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position);const c=1/n,m=1/i;return e.bindFramebuffer(e.FRAMEBUFFER,l[0]),e.viewport(0,0,n,i),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(o.texture,0),e.uniform2f(o.texelSize,c,m),e.uniform2f(o.direction,1,0),e.uniform1f(o.radius,a),e.drawArrays(e.TRIANGLES,0,6),e.bindFramebuffer(e.FRAMEBUFFER,l[1]),e.viewport(0,0,n,i),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,u[0]),e.uniform1i(o.texture,0),e.uniform2f(o.direction,0,1),e.drawArrays(e.TRIANGLES,0,6),e.bindFramebuffer(e.FRAMEBUFFER,null),u[1]}var hb=K1`#version 300 es
111precision mediump float;
112
113in vec2 texCoords;
114
115uniform sampler2D u_texture;
116uniform vec2 u_texelSize;    // 1.0 / texture size
117uniform vec2 u_direction;    // (1.0, 0.0) for horizontal, (0.0, 1.0) for vertical
118uniform float u_radius;      // blur radius in texels
119
120out vec4 fragColor;
121
122void main() {
123    vec3 sum = vec3(0.0);
124    float count = 0.0;
125
126    // Limit radius to avoid excessive loop cost
127    const int MAX_RADIUS = 16;
128    int radius = int(min(float(MAX_RADIUS), u_radius));
129
130    for (int i = -MAX_RADIUS; i <= MAX_RADIUS; ++i) {
131        if (abs(i) > radius) continue;
132
133        vec2 offset = u_direction * u_texelSize * float(i);
134        sum += texture(u_texture, texCoords + offset).rgb;
135        count += 1.0;
136  }
137
138  fragColor = vec4(sum / count, 1.0);
139}
140`;function mb(e){const t=ea(e,e.VERTEX_SHADER,q1()),n=ea(e,e.FRAGMENT_SHADER,hb),i=Jl(e,t,n),a={position:e.getAttribLocation(i,"position"),texture:e.getUniformLocation(i,"u_texture"),texelSize:e.getUniformLocation(i,"u_texelSize"),direction:e.getUniformLocation(i,"u_direction"),radius:e.getUniformLocation(i,"u_radius")};return{program:i,vertexShader:t,fragmentShader:n,uniforms:a}}var fb=K1`#version 300 es
141  precision mediump float;
142  in vec2 texCoords;
143  uniform sampler2D background;
144  uniform bool disableBackground;
145  uniform sampler2D frame;
146  uniform sampler2D mask;
147  out vec4 fragColor;
148  
149  void main() {
150    vec4 frameTex = texture(frame, texCoords);
151
152    if (disableBackground) {
153      fragColor = frameTex;
154    } else {
155      vec4 bgTex = texture(background, texCoords);
156
157      float maskVal = texture(mask, texCoords).r;
158
159      // Compute screen-space gradient to detect edge sharpness
160      float grad = length(vec2(dFdx(maskVal), dFdy(maskVal)));
161
162      float edgeSoftness = 2.0; // higher = softer
163
164      // Create a smooth edge around binary transition
165      float smoothAlpha = smoothstep(0.5 - grad * edgeSoftness, 0.5 + grad * edgeSoftness, maskVal);
166
167      // Optional: preserve frame alpha, or override as fully opaque
168      vec4 blended = mix(bgTex, vec4(frameTex.rgb, 1.0), 1.0 - smoothAlpha);
169      fragColor = blended;
170    }
171  
172  }
173`;function pb(e){const t=ea(e,e.VERTEX_SHADER,q1()),n=ea(e,e.FRAGMENT_SHADER,fb),i=Jl(e,t,n),a={position:e.getAttribLocation(i,"position")},r={mask:e.getUniformLocation(i,"mask"),frame:e.getUniformLocation(i,"frame"),background:e.getUniformLocation(i,"background"),disableBackground:e.getUniformLocation(i,"disableBackground"),stepWidth:e.getUniformLocation(i,"u_stepWidth")};return{program:i,vertexShader:t,fragmentShader:n,attribLocations:a,uniformLocations:r}}function gb(e,t,n){const i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0);const r=`
174      attribute vec2 position;
175      varying vec2 v_uv;
176      void main() {
177        v_uv = (position + 1.0) * 0.5;
178        gl_Position = vec4(position, 0.0, 1.0);
179      }
180    `,o=`
181      precision mediump float;
182      varying vec2 v_uv;
183      uniform sampler2D u_texture;
184      void main() {
185        gl_FragColor = texture2D(u_texture, v_uv);
186      }
187    `,s=ea(e,e.VERTEX_SHADER,r),l=ea(e,e.FRAGMENT_SHADER,o),u=Jl(e,s,l),c={texture:e.getUniformLocation(u,"u_texture"),position:e.getAttribLocation(u,"position")};return{framebuffer:a,texture:i,program:u,uniforms:c}}function vb(e,t,n,i,a,r){return e.useProgram(n.program),e.bindFramebuffer(e.FRAMEBUFFER,n.framebuffer),e.viewport(0,0,a,r),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(n.uniforms.position),e.vertexAttribPointer(n.uniforms.position,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(n.uniforms.texture,0),e.drawArrays(e.TRIANGLES,0,6),e.bindFramebuffer(e.FRAMEBUFFER,null),n.texture}var A3=Qr("livekit-track-processor-web-gl"),P3=e=>{const t=e.getContext("webgl2",{antialias:!0,premultipliedAlpha:!0});let n=null,i=8;const a=4;if(!t){A3.error("Failed to create WebGL context");return}t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA);const r=pb(t),o=r.program,s=r.attribLocations.position,{mask:l,frame:u,background:c,disableBackground:m}=r.uniformLocations,f=db(t),h=f.program,d=f.uniforms,y=mb(t),S=y.program,p=y.uniforms,v=ga(t,0),_=ga(t,1),T=sb(t);if(!T)throw new Error("Failed to create vertex buffer");let w=[],E=[],M=[],k=0,C=1;w.push(ga(t,3)),w.push(ga(t,4));const O=Math.floor(e.width/a),L=Math.floor(e.height/a),oe=gb(t,O,L);E.push(ro(t,w[0],O,L)),E.push(ro(t,w[1],O,L));const ce=ga(t,5),ue=ro(t,ce,e.width,e.height);M.push(ga(t,6)),M.push(ga(t,7));const je=[ro(t,M[0],e.width,e.height),ro(t,M[1],e.width,e.height)];let V=!1;t.useProgram(o),t.uniform1i(m,V?1:0),t.uniform1i(c,0),t.uniform1i(u,1),t.uniform1i(l,2);let N=null;function se(q){if(q.codedWidth===0||M.length===0)return;const Me=q.displayWidth,wt=q.displayHeight;t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,q);let qt=v;if(n){const Et=vb(t,_,oe,T,O,L);qt=M3(t,Et,O,L,n,h,d,T,E,w)}else N&&(t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,v),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,N),qt=v);t.viewport(0,0,Me,wt),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,T),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,qt),t.uniform1i(c,0),t.uniform1i(m,V?1:0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.uniform1i(u,1),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,M[k]),t.uniform1i(l,2),t.drawArrays(t.TRIANGLES,0,6)}async function te(q){if(N=null,q){N=cb();try{N=await lb(q,e.width,e.height)}catch(Me){A3.error("Error processing background image, falling back to black background:",Me)}t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,v),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,N)}}function Ze(q){n=q?Math.max(1,Math.floor(q/a)):null,te(null)}function et(q){V=q}function Kt(q){const Me=[ue,je[C]],wt=[ce,M[C]];M3(t,q,e.width,e.height,i,S,p,T,Me,wt),k=C,C=1-C}function vt(){t.deleteProgram(o),t.deleteProgram(h),t.deleteProgram(S),t.deleteTexture(v),t.deleteTexture(_),t.deleteTexture(ce),t.deleteFramebuffer(ue);for(const q of w)t.deleteTexture(q);for(const q of E)t.deleteFramebuffer(q);for(const q of M)t.deleteTexture(q);for(const q of je)t.deleteFramebuffer(q);t.deleteBuffer(T),oe&&(t.deleteTexture(oe.texture),t.deleteFramebuffer(oe.framebuffer),t.deleteProgram(oe.program)),N&&(N instanceof ImageBitmap&&N.close(),N=null),w=[],E=[],M=[]}
187return{renderFrame:se,updateMask:Kt,setBackgroundImage:te,setBlurRadius:Ze,setBackgroundDisabled:et,cleanup:vt}},bb=class{constructor(){this.isDisabled=!1}async init({outputCanvas:e,inputElement:t}){if(!(t instanceof HTMLVideoElement))throw TypeError("Video transformer needs a HTMLVideoElement as input");this.transformer=new TransformStream({transform:(n,i)=>this.transform(n,i)}),this.canvas=e||null,e&&(this.gl=P3(this.canvas||Xs(t.videoWidth,t.videoHeight))),this.inputVideo=t,this.isDisabled=!1}async restart({outputCanvas:e,inputElement:t}){var n;this.canvas=e||null,(n=this.gl)==null||n.cleanup(),this.gl=P3(this.canvas||Xs(t.videoWidth,t.videoHeight)),this.inputVideo=t,this.isDisabled=!1}async destroy(){var e;this.isDisabled=!0,this.canvas=void 0,(e=this.gl)==null||e.cleanup(),this.gl=void 0}},Sa=class extends bb{constructor(e){super(),this.backgroundImageAndPath=null,this.segmentationTimeMs=0,this.isFirstFrame=!0,this.log=Qr("livekit-processor-wrapper"),this.options=e,this.update(e)}static get isSupported(){return typeof OffscreenCanvas<"u"&&typeof VideoFrame<"u"&&typeof createImageBitmap<"u"&&!!document.createElement("canvas").getContext("webgl2")}async init({outputCanvas:e,inputElement:t}){var n,i,a,r,o,s,l,u;await super.init({outputCanvas:e,inputElement:t});const c=await ba.forVisionTasks((i=(n=this.options.assetPaths)==null?void 0:n.tasksVisionFileSet)!=null?i:`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${ob["@mediapipe/tasks-vision"]}/wasm`);this.imageSegmenter=await xt.createFromOptions(c,{baseOptions:{modelAssetPath:(r=(a=this.options.assetPaths)==null?void 0:a.modelAssetPath)!=null?r:"https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite",delegate:"GPU",...this.options.segmenterOptions},canvas:this.canvas,runningMode:"VIDEO",outputCategoryMask:!0,outputConfidenceMasks:!1}),(o=this.options)!=null&&o.imagePath&&await this.loadAndSetBackground(this.options.imagePath).catch(m=>this.log.error("Error while loading processor background image: ",m)),typeof this.options.blurRadius=="number"&&((s=this.gl)==null||s.setBlurRadius(this.options.blurRadius)),(u=this.gl)==null||u.setBackgroundDisabled((l=this.options.backgroundDisabled)!=null?l:!1)}async destroy(e){var t;await super.destroy(),await((t=this.imageSegmenter)==null?void 0:t.close()),this.backgroundImageAndPath=null,e?.willProcessorRestart||(this.isFirstFrame=!0)}async loadAndSetBackground(e){var t,n;if(!this.backgroundImageAndPath||((t=this.backgroundImageAndPath)==null?void 0:t.path)!==e){const i=new Image;await new Promise((r,o)=>{i.crossOrigin="Anonymous",i.onload=()=>r(i),i.onerror=s=>o(s),i.src=e});const a=await createImageBitmap(i);this.backgroundImageAndPath={imageData:a,path:e}}(n=this.gl)==null||n.setBackgroundImage(this.backgroundImageAndPath.imageData)}async transform(e,t){var n,i,a,r;let o=!1;try{if(!(e instanceof VideoFrame)||e.codedWidth===0||e.codedHeight===0){this.log.debug("empty frame detected, ignoring");return}let s=(i=(n=this.isDisabled)!=null?n:this.options.backgroundDisabled)!=null?i:!1;if(typeof this.options.blurRadius!="number"&&typeof this.options.imagePath!="string"&&(s=!0),s){t.enqueue(e),o=!0;return}const l=Date.now();if(!this.canvas)throw TypeError("Canvas needs to be initialized first");this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight,this.isFirstFrame&&(t.enqueue(e.clone()),this.inputVideo&&await new Promise(m=>{this.inputVideo.requestVideoFrameCallback((f,h)=>{const d=h.expectedDisplayTime-h.presentationTime;setTimeout(m,d)})})),this.isFirstFrame=!1;const u=performance.now(),c=new Promise((m,f)=>{var h;try{let d=performance.now();(h=this.imageSegmenter)==null||h.segmentForVideo(e,d,y=>{this.segmentationTimeMs=performance.now()-d,this.segmentationResults=y,this.updateMask(y.categoryMask),y.close(),m()})}catch(d){f(d)}});if(this.drawFrame(e),this.canvas&&this.canvas.width>0&&this.canvas.height>0){const m=new VideoFrame(this.canvas,{timestamp:e.timestamp||l});t.enqueue(m);const f=performance.now()-u,h={processingTimeMs:this.segmentationTimeMs+f,
187segmentationTimeMs:this.segmentationTimeMs,filterTimeMs:f};(r=(a=this.options).onFrameProcessed)==null||r.call(a,h)}else t.enqueue(e);await c}catch(s){this.log.error("Error while processing frame: ",s)}finally{o||e.close()}}async update(e){var t,n,i,a,r;this.options={...this.options,...e},(n=this.gl)==null||n.setBlurRadius((t=e.blurRadius)!=null?t:null),e.imagePath?await this.loadAndSetBackground(e.imagePath):(i=this.gl)==null||i.setBackgroundImage(null),(r=this.gl)==null||r.setBackgroundDisabled((a=e.backgroundDisabled)!=null?a:!1)}async drawFrame(e){var t;this.gl&&((t=this.gl)==null||t.renderFrame(e))}async updateMask(e){var t;e&&((t=this.gl)==null||t.updateMask(e.getAsWebGLTexture()))}},$4=10,yb=()=>Sa.isSupported&&Yl.isSupported,Sb=()=>Sa.isSupported&&Yl.hasModernApiSupport,kb=class extends Yl{get mode(){const e=this.transformer.options;return e.backgroundDisabled?"disabled":typeof e.imagePath=="string"&&typeof e.blurRadius>"u"?"virtual-background":typeof e.imagePath>"u"?"background-blur":"legacy"}async switchTo(e){var t;switch(e.mode){case"background-blur":await this.updateTransformerOptions({imagePath:void 0,blurRadius:(t=e.blurRadius)!=null?t:$4,backgroundDisabled:!1});break;case"virtual-background":await this.updateTransformerOptions({imagePath:e.imagePath,blurRadius:void 0,backgroundDisabled:!1});break;case"disabled":await this.updateTransformerOptions({imagePath:void 0,backgroundDisabled:!0});break}}},wb=(e,t="background-processor")=>{const n=Sa.isSupported,i=Yl.isSupported;if(!n)throw new Error("Background transformer is not supported in this browser");if(!i)throw new Error("Neither MediaStreamTrackProcessor nor canvas.captureStream() fallback is supported in this browser");let a,r;switch(e.mode){case"background-blur":{const{mode:s,blurRadius:l=$4,segmenterOptions:u,assetPaths:c,onFrameProcessed:m,...f}=e;r=f,a=new Sa({blurRadius:l,segmenterOptions:u,assetPaths:c,onFrameProcessed:m});break}case"virtual-background":{const{mode:s,imagePath:l,segmenterOptions:u,assetPaths:c,onFrameProcessed:m,...f}=e;r=f,a=new Sa({imagePath:l,segmenterOptions:u,assetPaths:c,onFrameProcessed:m});break}case"disabled":{const{segmenterOptions:s,assetPaths:l,onFrameProcessed:u,...c}=e;r=c,a=new Sa({segmenterOptions:s,assetPaths:l,onFrameProcessed:u});break}default:{const{blurRadius:s,imagePath:l,segmenterOptions:u,assetPaths:c,onFrameProcessed:m,...f}=e;r=f,a=new Sa({blurRadius:s,imagePath:l,segmenterOptions:u,assetPaths:c,onFrameProcessed:m});break}}return new kb(a,t,r)};const _3=e=>e.mode==="blur"?{blurRadius:e.blurRadius,mode:"background-blur"}:e.mode==="image"&&e.imagePath?{imagePath:e.imagePath,mode:"virtual-background"}:{mode:"disabled"},Tb=e=>{const t=wb({..._3(e),maxFps:e.maxFps,onFrameProcessed:e.onFrameProcessed});return{get name(){return t.name},get processedTrack(){return t.processedTrack},destroy:()=>t.destroy(),init:n=>t.init(n),restart:n=>t.restart(n),switchMode:n=>t.switchTo(_3(n))}},Eb=({blurRadius:e,canUseBackgroundProcessors:t,canUseModernBackgroundProcessors:n,maxFps:i,onFrameProcessed:a})=>{let r=null,o=null,s=null;const l=p=>i7({maxFps:i,onFrameProcessed:a,...p}),u=p=>Tb({maxFps:i,onFrameProcessed:a,...p}),c=async(p,v,_={mode:"disabled"})=>(r&&s!==v&&(await r.destroy(),r=null,o=null,s=null),r||(r=v==="livekit-background"?u(_):l(_),s=v),o!==p&&(await p.setProcessor(r,!0),o=p),r);return{buildInitialProcessor:p=>{const v=r7({blurRadius:e,canUseBackgroundProcessors:t,canUseModernBackgroundProcessors:n,createLiveKitProcessor:u,createProcessor:l,settings:p});return r=v??null,s=v?n()?"custom-webgl2":"livekit-background":null,v},destroy:async()=>{r&&(await r.destroy(),r=null),o=null,s=null},ensureProcessor:c,getAttachedTrack:()=>o,hasAttachedProcessor:(p,v)=>r!==null&&s===v&&o===p,markInitialProcessorAttached:p=>{r&&(o=p)},switchProcessorToBlur:async()=>{if(!o)return;await(await c(o,s??"custom-webgl2")).switchMode({blurRadius:e,mode:"blur"})},switchProcessorToDisabled:async()=>{await r?.switchMode({mode:"disabled"})}}},j1="AI-обработка фона недоступна на этом устройстве",C3="Не удалось применить фон",F4="Используется упрощенный режим обработки видео",Mb=e=>e.effectiveMode!=="disabled",Ab=(e,t)=>t||(e.effectiveMode==="disabled"&&e.requestedMode!=="disabled"?j1:e.fallbackReason==="performance"||e.fallbackReason==="webgl2-gpu-unavailable"?F4:null),Du=(e,t={})=>{const n=t.errorText??null;return{capabilitySnapshot:t.capabilitySnapshot,capabilityTier:e.capabilityTier,effectiveMode:e.effectiveMode,errorText:n,fallbackReason:e.fallbackReason,isAdaptiveFallbackActive:t.isAdaptiveFallbackActive??!1,isSupported:Mb(e)||e.requestedMode==="disabled",mode:e.effectiveMode,pipeline:{backend:e.processorPath,capture:"livekit-camera",compositing:e.processorPath==="custom-webgl2"?"custom-webgl2":e.processorPath==="livekit-background"?"livekit-background":"none",encoding:"webrtc",segmentation:e.processorPath==="custom-webgl2"?e.capabilityTier:e.processorPath==="livekit-background"?"livekit-background":e.processorPath,sending:"livekit"}
187,requestedMode:e.requestedMode,userMessage:Ab(e,n),...t.lastStats?{processingTimeMs:t.lastStats.processingTimeMs,segmentationTimeMs:t.lastStats.segmentationTimeMs}:{}}},ya=(e,t,n="disabled")=>({capabilityTier:n,effectiveMode:"disabled",fallbackReason:t,processorPath:"disabled",requestedMode:e}),Ys=()=>Du(ya("disabled",null)),I3=(e,t,n)=>({capabilityTier:t==="native-blur"?"native-blur":t==="livekit-background"?"livekit-background":"webgl2-gpu-replace",effectiveMode:"blur",fallbackReason:n,processorPath:t,requestedMode:e}),Pb=e=>e==="webgl2-gpu-unavailable"?j1:e==="performance"?F4:null,_b=.75,Cb=({currentDecision:e,currentSettings:t,lastState:n,onSlowSampleLimit:i,slowSampleCount:a,slowSampleLimit:r,snapshot:o})=>{if(!o?.video||e.effectiveMode==="disabled"||!t)return{nextSlowSampleCount:0,state:null};const l=ia(t.camera.frameRate)*_b,u=o.video.framesPerSecond,c=o.video.qualityLimitationReason==="cpu";if(typeof u!="number"||u>=l&&!c)return{nextSlowSampleCount:0,state:null};const m=a+1;return m<r?{nextSlowSampleCount:m,state:null}:(i(),{nextSlowSampleCount:0,state:{...n,fallbackReason:"performance",isAdaptiveFallbackActive:!0}})},hi=(e,t)=>({requestedMode:e.requestedMode,...t}),L3=e=>e.hasWebGl2BackgroundProcessorSupport&&e.runtime.hasWebGl2&&e.runtime.hasVideoFrame&&(e.runtime.hasMediaStreamTrackProcessor||e.runtime.hasRequestVideoFrameCallback),Ib=e=>e.requestedMode==="disabled"?hi(e,{capabilityTier:"disabled",effectiveMode:"disabled",fallbackReason:null,processorPath:"disabled"}):e.requestedMode==="blur"?e.hasNativeBackgroundBlurControl?hi(e,{capabilityTier:"native-blur",effectiveMode:"blur",fallbackReason:null,processorPath:"native-blur"}):L3(e)?hi(e,{capabilityTier:"webgl2-gpu-replace",effectiveMode:"blur",fallbackReason:"native-blur-unavailable",processorPath:"custom-webgl2"}):e.hasLiveKitBackgroundProcessorSupport?hi(e,{capabilityTier:"livekit-background",effectiveMode:"blur",fallbackReason:"webgl2-gpu-unavailable",processorPath:"livekit-background"}):hi(e,{capabilityTier:"disabled",effectiveMode:"disabled",fallbackReason:"webgl2-gpu-unavailable",processorPath:"disabled"}):e.hasBackgroundImage?L3(e)?hi(e,{capabilityTier:"webgl2-gpu-replace",effectiveMode:"image",fallbackReason:null,processorPath:"custom-webgl2"}):e.hasLiveKitBackgroundProcessorSupport?hi(e,{capabilityTier:"livekit-background",effectiveMode:"image",fallbackReason:"webgl2-gpu-unavailable",processorPath:"livekit-background"}):hi(e,{capabilityTier:"disabled",effectiveMode:"disabled",fallbackReason:"webgl2-gpu-unavailable",processorPath:"disabled"}):hi(e,{capabilityTier:"disabled",effectiveMode:"disabled",fallbackReason:"missing-image",processorPath:"disabled"}),Ja=e=>typeof globalThis<"u"&&e in globalThis,Lb=()=>globalThis.navigator?!!globalThis.navigator.gpu:!1,Rb=async e=>{const n=await(e.validateWasmSimd??(()=>!1))(),i=e.hasModernBackgroundProcessorSupport;return{browser:{userAgent:e.userAgent??globalThis.navigator?.userAgent??""},hasLiveKitBackgroundProcessorSupport:e.hasBackgroundProcessorSupport,hasModernLiveKitBackgroundProcessorSupport:e.hasModernBackgroundProcessorSupport,hasNativeBackgroundBlurControl:e.hasNativeBackgroundBlurControl,runtime:{hasMediaStreamTrackGenerator:e.hasMediaStreamTrackGenerator??(i||Ja("MediaStreamTrackGenerator")),hasMediaStreamTrackProcessor:e.hasMediaStreamTrackProcessor??(i||Ja("MediaStreamTrackProcessor")),hasOffscreenCanvas:e.hasOffscreenCanvas??(i||Ja("OffscreenCanvas")),hasRequestVideoFrameCallback:e.hasRequestVideoFrameCallback??(typeof HTMLVideoElement<"u"&&"requestVideoFrameCallback"in HTMLVideoElement.prototype),hasVideoFrame:e.hasVideoFrame??(i||Ja("VideoFrame")),hasWasmSimd:n,hasWasmThreads:!!(e.crossOriginIsolated??globalThis.crossOriginIsolated)&&Ja("SharedArrayBuffer"),hasWebCodecs:e.hasWebCodecs??Ja("VideoEncoder"),hasWebGl2:e.createCanvasContext?!!e.createCanvasContext():i||e.hasBackgroundProcessorSupport,hasWebGl2BackgroundProcessor:e.hasWebGl2BackgroundProcessorSupport??(e.hasModernBackgroundProcessorSupport&&(e.createCanvasContext?!!e.createCanvasContext():i||e.hasBackgroundProcessorSupport)),hasWebGpu:e.hasWebGpu??Lb(),hasWasmBackgroun
187dBlur:e.hasWasmBackgroundBlurSupport??n}}},$b=e=>{if(!e?.getCapabilities||!e.applyConstraints)return!1;const t=e.getCapabilities().backgroundBlur;return Array.isArray(t)?t.includes(!0)&&t.includes(!1):t===!0},R3=async(e,t)=>{e.applyConstraints&&await e.applyConstraints({advanced:[{backgroundBlur:t}]})},Fb=()=>{try{return yb()}catch{return!1}},Db=()=>{try{return Sb()}catch{return!1}},xb=async({cameraTrack:e,hasLiveKitBackgroundProcessorSupport:t,hasModernLiveKitBackgroundProcessorSupport:n,settings:i})=>{const a=n&&await a7(),r=$b(e.mediaStreamTrack),o=await Rb({hasBackgroundProcessorSupport:t,hasWebGl2BackgroundProcessorSupport:a,hasWasmBackgroundBlurSupport:t,hasModernBackgroundProcessorSupport:n,hasNativeBackgroundBlurControl:r});return{capabilities:o,decision:Ib({hasBackgroundImage:!!i.backgroundImageUrl,hasLiveKitBackgroundProcessorSupport:t,hasNativeBackgroundBlurControl:r,hasWebGl2BackgroundProcessorSupport:o.runtime.hasWebGl2BackgroundProcessor,hasWasmBackgroundBlurSupport:o.runtime.hasWasmBackgroundBlur,requestedMode:i.backgroundMode,runtime:o.runtime})}},ss=10,Bb=24,Ob=15,$3=3,Ub=(e={})=>{let t=null,n=null,i=ya("disabled",null),a,r=Du(i),o=null,s=0,l=0,u=!1,c=null,m=null;const f=V=>(r=V,e.onStateChange?.(V),V),h=()=>(c??=Fb(),c),d=()=>(m??=Db(),m),y=(V,N={})=>(i=V,f(Du(V,{capabilitySnapshot:a,...N}))),p=Eb({blurRadius:ss,canUseBackgroundProcessors:h,canUseModernBackgroundProcessors:d,maxFps:Bb,onFrameProcessed:V=>{if(o=V,i.effectiveMode==="disabled"){s=0;return}if(V.segmentationTimeMs<=Ob){s=0;return}s+=1,!(s<$3)&&(s=0,C())}}),v=async()=>{if(!t)return;const V=t;t=null,await R3(V,!1)},_=async(V,N,se)=>{await v();const te=await p.ensureProcessor(V,N.processorPath);return N.effectiveMode==="blur"?await te.switchMode({blurRadius:ss,mode:"blur"}):N.effectiveMode==="image"&&se.backgroundImageUrl?await te.switchMode({imagePath:se.backgroundImageUrl,mode:"image"}):await te.switchMode({mode:"disabled"}),y(N,{lastStats:o})},T=async(V,N,se)=>{await v();const te=N.effectiveMode==="image"&&se.backgroundImageUrl?{imagePath:se.backgroundImageUrl,mode:"image"}:{blurRadius:ss,mode:N.effectiveMode==="blur"?"blur":"disabled"},Ze=p.hasAttachedProcessor(V,"livekit-background"),et=await p.ensureProcessor(V,"livekit-background",te);return Ze&&(N.effectiveMode==="blur"?await et.switchMode({blurRadius:ss,mode:"blur"}):N.effectiveMode==="image"&&se.backgroundImageUrl?await et.switchMode({imagePath:se.backgroundImageUrl,mode:"image"}):await et.switchMode({mode:"disabled"})),y(N,{lastStats:o})},w=async(V,N)=>{if(!V.mediaStreamTrack)throw new Error(j1);return await p.switchProcessorToDisabled(),await R3(V.mediaStreamTrack,!0),t=V.mediaStreamTrack,y(N,{lastStats:o})},E=async V=>(await v(),await p.switchProcessorToDisabled(),y(V,{errorText:Pb(V.fallbackReason),lastStats:o})),M=async(V,N)=>{const se=await xb({cameraTrack:V,hasLiveKitBackgroundProcessorSupport:h(),hasModernLiveKitBackgroundProcessorSupport:d(),settings:N});return a=se.capabilities,se.decision},k=async(V,N,se)=>{if(N.processorPath==="native-blur")try{return await w(V,N)}catch(te){return!d()||!h()?y(ya(se.backgroundMode,"native-blur-error"),{errorText:te instanceof Error?te.message:C3,lastStats:o}):_(V,I3(se.backgroundMode,"custom-webgl2","native-blur-error"),se)}if(N.processorPath==="custom-webgl2")try{return await _(V,N,se)}catch(te){if(!h())throw te;return T(V,{capabilityTier:"livekit-background",effectiveMode:N.effectiveMode,fallbackReason:"processor-error",processorPath:"livekit-background",requestedMode:N.requestedMode},se)}return N.processorPath==="livekit-background"?T(V,N,se):E(N)};async function C(){if(!(u||!n)&&i.effectiveMode!=="disabled"&&!(i.effectiveMode==="image"&&!p.getAttachedTrack())){u=!0;try{if(e.onRequestCameraQualityDowngrade&&await e.onRequestCameraQualityDowngrade()){y({...i,fallbackReason:"performance"},{isAdaptiveFallbackActive:!0,lastStats:o});return}if(i.effectiveMode==="image"){await p.switchProcessorToBlur(),y(I3(i.requestedMode,i.processorPath==="livekit-background"?"livekit-background":"custom-webgl2","performance"),{isAdaptiveFallbackActive:!0,lastStats:o});return}await v(),await p.switchProcessorToDisabled(),y(ya(i.requestedMode,"performance"),{isAdaptiveFallbackActive:!0,lastStats:o})}finally{u=!1}}}
187return{applyBackgroundSettings:async(V,N)=>{if(n=N,!V)return y(ya(N.backgroundMode,null),{lastStats:o});try{return await k(V,await M(V,N),N)}catch(se){return y(ya(N.backgroundMode,"processor-error"),{errorText:se instanceof Error?se.message:C3,lastStats:o})}},buildInitialProcessor:V=>p.buildInitialProcessor(V),destroy:async()=>{await v(),await p.destroy(),i=ya("disabled",null),a=void 0,n=null,f({capabilityTier:"disabled",effectiveMode:"disabled",errorText:null,fallbackReason:null,isAdaptiveFallbackActive:!1,isSupported:!0,mode:"disabled",requestedMode:"disabled"})},getState:()=>r,handleSenderStatsSnapshot:V=>{const N=Cb({currentDecision:i,currentSettings:n,lastState:r,onSlowSampleLimit:()=>{C()},slowSampleCount:l,slowSampleLimit:$3,snapshot:V});return l=N.nextSlowSampleCount,N.state},markInitialProcessorAttached:V=>p.markInitialProcessorAttached(V)}},Nb="[data-presentation-livekit-preview-boundary]",Gb="[data-presentation-livekit-preview-fallback-boundary]",Vb=({boundaryLeft:e,controlsRight:t,viewportWidth:n})=>{const i=Math.min(Math.max(t,0),n),a=Math.min(Math.max(e,0),n);return{left:i,width:Math.max(a-i,0)}},zb=({globalControlsRef:e})=>{const t=D({left:0,width:0});let n=null,i=null,a=null,r=null;const o=()=>document.querySelector(Nb)??document.querySelector(Gb),s=()=>{const f=e.value,h=o();i&&f!==a&&(a&&i.unobserve(a),f&&i.observe(f),a=f),i&&h!==r&&(r&&i.unobserve(r),h&&i.observe(h),r=h)},l=()=>{s();const f=e.value,h=r??o();if(!f||!h){t.value={left:0,width:0};return}t.value=Vb({boundaryLeft:h.getBoundingClientRect().left,controlsRight:f.getBoundingClientRect().right,viewportWidth:window.innerWidth})},u=()=>{n!==null&&window.cancelAnimationFrame(n),n=window.requestAnimationFrame(()=>{n=null,l()})};Ie(e,u),Oa(()=>{typeof ResizeObserver=="function"&&(i=new ResizeObserver(u)),window.addEventListener("resize",u),u()}),Lt(()=>{window.removeEventListener("resize",u),i?.disconnect(),i=null,a=null,r=null,n!==null&&(window.cancelAnimationFrame(n),n=null)});const c=g(()=>`${t.value.left}px`),m=g(()=>`${t.value.width}px`);return{collapsedPreviewLeft:c,collapsedPreviewWidth:m}},Kb={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function qb(e,t){return A(),$("svg",Kb,[...t[0]||(t[0]=[F("path",{d:"M5.683 11.276V9.633q0-.324.233-.548a.76.76 0 0 1 .547-.224q.333 0 .565.224.232.225.232.548v1.585q0 1.412.59 2.474a4.16 4.16 0 0 0 1.668 1.635q1.07.58 2.482.581.647 0 1.229-.133a5 5 0 0 0 1.079-.373l1.12 1.12q-.573.34-1.245.548t-1.42.274v1.702h3.047q.324 0 .556.224.233.232.233.556 0 .315-.233.54a.76.76 0 0 1-.556.232H8.19a.76.76 0 0 1-.556-.232.72.72 0 0 1-.233-.54.76.76 0 0 1 .233-.556.77.77 0 0 1 .556-.224h3.046v-1.702q-1.635-.157-2.888-.946a5.54 5.54 0 0 1-1.96-2.1q-.705-1.312-.705-3.022m10.808 1.495a4.7 4.7 0 0 0 .249-1.553V9.633q0-.324.232-.548a.77.77 0 0 1 .556-.224q.324 0 .548.224.233.225.233.548v1.643q0 1.503-.573 2.74zM12 14.19a2.9 2.9 0 0 1-1.502-.39 2.87 2.87 0 0 1-1.038-1.096q-.382-.697-.382-1.619v-.913l3.852 3.844a2.5 2.5 0 0 1-.93.174m0-11.754q-.789 0-1.403.349-.614.34-.996.954-.381.615-.448 1.428v.274l5.736 5.736a.3.3 0 0 0 .016-.092 1 1 0 0 0 .009-.1V5.533q0-.921-.382-1.618a2.73 2.73 0 0 0-1.038-1.088A2.87 2.87 0 0 0 12 2.436M18.383 18 5.103 4.735a.63.63 0 0 1-.184-.464.63.63 0 0 1 .183-.465.66.66 0 0 1 .473-.191.66.66 0 0 1 .473.19l13.273 13.257a.6.6 0 0 1 .183.465q0 .273-.183.473a.62.62 0 0 1-.473.183.65.65 0 0 1-.465-.183"},null,-1)])])}const Ql={render:qb},jb=["data-speaking","data-test"],Wb=Te({__name:"PresentationLiveKitCameraLabel",props:{appearance:{default:"overlay"},displayName:{},iconSize:{default:"small"},isMicrophoneEnabled:{type:Boolean},isSpeaking:{type:Boolean},selfViewTestId:{}},setup(e){const t=e,n=Rr(),i=g(()=>{if(t.appearance==="inline")return n.labelInline;if(t.appearance==="top-overlay")return n.labelTopOverlay});return(a,r)=>(A(),$("span",{class:P([a.$style.label,i.value,e.isSpeaking&&a.$style.speaking]),"data-speaking":e.isSpeaking?"true":"false","data-test":e.selfViewTestId},[e.isMicrophoneEnabled?(A(),B(b(qu),{key:0,class:P([a.$style.icon,t.iconSize==="default"&&a.$style.iconDefault,a.$style.iconEnabled,e.isSpeaking&&a.$style.iconSpeaking]),"aria-hidden":"true","data-speaking":e.isSpeaking?"true":"false","data-test":"presentation-livekit-camera-microphone-on"},null,8,["class","data-speaking"])):(A(),B(b(Ql),{key:1,class:P([a.$style.icon,t.iconSize==="default"&&a.$style.iconDefault,a.$style.iconDisabled]),"aria-hidden":"true","data-test":"presentation-livekit-camera-microphone-off"},null,8,["class"])),F("span",{class:P(a.$style.name)},ct(e.displayName),3)],10,jb))}}),Hb="_label_1loj5_1",Xb="_speaking_1loj5_12",Yb="_labelInline_1loj5_16",Jb="_labelTopOverlay_1loj5_20",Qb="_icon_1loj5_24",Zb="_iconDefault_1loj5_30",e9="_iconEnabled_1loj5_35",t9="_iconDisabled_1loj5_39",n9="_iconSpeaking_1loj5_43",i9="_name_1loj5_47",a9={label:Hb,speaking:Xb,labelInline:Yb,labelTopOverlay:Jb,icon:Qb,iconDefault:Zb,iconEnabled:e9,iconDisabled:t9,iconSpeaking:n9,name:i9},r9={$style:a9},Js=at(Wb,[["__cssModules",r9]]),o9={xmlns:"http://www.w3.org/2000/svg",fill:"
187currentColor",viewBox:"0 0 24 24"};function s9(e,t){return A(),$("svg",o9,[...t[0]||(t[0]=[F("path",{d:"M7.122 15.272a.62.62 0 0 1-.403-.132.66.66 0 0 1-.22-.36l-.285-1.186a11 11 0 0 0-.286-.11 5 5 0 0 1-.27-.124l-1.04.644a.7.7 0 0 1-.411.103.62.62 0 0 1-.38-.19l-.697-.704a.68.68 0 0 1-.19-.38.67.67 0 0 1 .102-.425l.645-1.026a3 3 0 0 1-.227-.542l-1.194-.285a.7.7 0 0 1-.359-.213.62.62 0 0 1-.132-.403v-.981q0-.498.491-.615l1.18-.3.11-.279q.057-.139.116-.264l-.63-1.047a.8.8 0 0 1-.11-.417.5.5 0 0 1 .184-.367l.71-.703a.7.7 0 0 1 .374-.183.57.57 0 0 1 .403.08l1.047.653a5 5 0 0 1 .564-.235l.286-1.2a.66.66 0 0 1 .22-.352.6.6 0 0 1 .402-.14h.996q.234 0 .396.14a.6.6 0 0 1 .22.351l.292 1.216a2.6 2.6 0 0 1 .55.227l1.062-.66a.6.6 0 0 1 .395-.08.66.66 0 0 1 .374.183l.717.703q.169.162.176.367a.75.75 0 0 1-.102.417l-.63 1.047q.059.125.11.264.058.131.11.278l1.179.3q.49.118.49.616v.981a.62.62 0 0 1-.131.403.65.65 0 0 1-.36.213l-1.193.285a2 2 0 0 1-.095.279q-.059.131-.125.263l.637 1.026a.636.636 0 0 1-.08.806l-.703.702a.6.6 0 0 1-.374.19.7.7 0 0 1-.41-.102l-1.047-.644q-.124.066-.264.124-.14.052-.286.11l-.293 1.187a.61.61 0 0 1-.615.49zm.498-4.065q.49 0 .894-.235.41-.242.652-.644.24-.411.241-.909 0-.483-.241-.893a1.76 1.76 0 0 0-.652-.645 1.7 1.7 0 0 0-.894-.241q-.498 0-.9.241a1.8 1.8 0 0 0-.645.645 1.73 1.73 0 0 0-.242.893q0 .498.242.909.241.402.644.644.404.235.901.235m9.155 8.635a.56.56 0 0 1-.358-.117.56.56 0 0 1-.19-.308l-.25-1.025-.242-.103a2 2 0 0 1-.227-.103l-.9.557a.53.53 0 0 1-.36.088.53.53 0 0 1-.33-.154l-.585-.6a.56.56 0 0 1-.168-.345.48.48 0 0 1 .095-.351l.55-.894-.104-.227a5 5 0 0 1-.08-.234l-1.04-.242a.56.56 0 0 1-.315-.183.58.58 0 0 1-.11-.359v-.827a.55.55 0 0 1 .11-.352.57.57 0 0 1 .315-.198l1.025-.242a5 5 0 0 1 .088-.256l.095-.212-.534-.908a.54.54 0 0 1-.103-.352.53.53 0 0 1 .169-.337l.593-.586a.57.57 0 0 1 .33-.161.54.54 0 0 1 .344.073l.908.557a2 2 0 0 1 .234-.103q.125-.043.242-.095l.25-1.04a.6.6 0 0 1 .19-.307.56.56 0 0 1 .358-.118h.835q.213 0 .352.118.146.117.198.307l.234 1.055q.132.036.256.095l.227.095.909-.564a.5.5 0 0 1 .344-.073.57.57 0 0 1 .33.161l.607.586a.5.5 0 0 1 .154.337.57.57 0 0 1-.095.352l-.542.908q.103.183.19.469l1.026.241q.417.103.417.55v.827q0 .447-.417.542l-1.033.242a5 5 0 0 1-.095.234q-.044.117-.095.227l.549.894a.53.53 0 0 1 .088.359.57.57 0 0 1-.161.337l-.594.6a.53.53 0 0 1-.33.154.52.52 0 0 1-.35-.088l-.902-.556q-.109.059-.234.102a7 7 0 0 1-.249.103l-.234 1.025a.54.54 0 0 1-.198.308.53.53 0 0 1-.352.117zm.418-3.618q.586 0 .996-.418.417-.418.417-1.003 0-.579-.417-.996a1.34 1.34 0 0 0-.996-.418q-.585 0-1.004.418-.41.417-.41.996 0 .585.41 1.003.418.418 1.004.418"},null,-1)])])}const D4={render:s9},x4=Symbol("presentation-livekit-participant-moderation"),F3=4,D3=(e,t)=>{if(nr(e)&&e.response?.data){const n=e.response.data;if(typeof n=="object"&&n!==null&&"message"in n&&typeof n.message=="string"&&n.message.trim())return n.message}return t},l9=({isOrganizer:e,localParticipantIdentity:t,muteParticipant:n,onlineParticipants:i,presentationGuid:a,setParticipantModerator:r})=>{const o=D(new Map),s=D(new Set),l=D(!1),u=g(()=>i.value.some(v=>v.identity===t.value&&v.isModerator)),c=g(()=>e.value||u.value),m=g(()=>e.value),f=g(()=>i.value.filter(v=>v.identity!==t.value&&!(o.value.get(v.identity)??v.isModerator))),h=g(()=>c.value&&f.value.length>0),d=(v,_)=>{const T=new Set(s.value);_?T.add(v):T.delete(v),s.value=T};return{canManageModerators:m,canMuteNonModerators:h,canMuteParticipants:c,canShowParticipantActions:v=>v!==t.value&&c.value,isMutingNonModerators:l,isParticipantActionPending:v=>s.value.has(v),isParticipantModerator:(v,_)=>o.value.get(v)??_,mute:async v=>{const _=a.value;if(!(!_||!c.value||v===t.value)){d(v,!0);try{await n({identity:v,presentationGuid:_}),mi.success("Микрофон участника выключен")}catch(T){mi.error(D3(T,"Не удалось выключить микрофон участника"))}finally{d(v,!1)}}},muteNonModerators:async()=>{const v=a.value,_=f.value;if(!(!v||!c.value||l.value||_.length===0)){l.value=!0,_.forEach(({identity:T})=>d(T,!0));try{const T=[];for(let E=0;E<_.length;E+=F3){const M=_.slice(E,E+F3);T.push(...await Promise.allSettled(M.map(({identity:k})=>n({identity:k,presentationGuid:v}))))}const w=T.filter(({status:E})=>E==="rejected").length;w===0?mi.success("Микрофоны участников выключены"):mi.error(`Не удалось выключить микрофон у ${w} участников`)}finally{_.forEach(({identity:T})=>d(T,!1)),l.value=!1}}},setModerator:async(v,_)=>{const T=a.value;if(!(!T||!m.value||v===t.value)){d(v,!0);try{await r({identity:v,isModerator:_,presentationGuid:T}),o.value=new Map([...o.value,[v,_]]),mi.success(_?"Участник назначен администратором":"Права администратора сняты")}catch(w){mi.error(D3(w,_?"Не удалось назначить администратора":"Не удалось снять права администратора"))}finally{d(v,!1)}}}}},c9=e=>{Bg(x4,e)},W1=()=>xg(x4,null),u9=Te({__name:"PresentationLiveKitMediaElement",props:{clone:{type:Boolean,default:!1},element:{},fit:{default:"contain"},volume:{default:1}},emits:["aspect-ratio-change"],setup(e,{emit:t}){const n=e,i=t,a=Rr(),r=dr("mediaRootRef"),o=dr("mediaContainerRef"),s=D(0),l=D(0),u=D(null);let c=null,m=null,f;const h={},d=g(()=>[a.root,n.fit==="cover"&&a.rootCover]),y=k=>k instanceof HTMLVideoElement,S=k=>{k instanceof HTMLAudioElement&&(k.volume=Math.min(1,Math.max(0,n.volume)))},p=()=>{const k=r.value;if(!k){s.value=0,l.value=0;return}const C=k.getBoundingClientRect();s.value=C.width,l.value=C.height},v=k=>{let C=null;y(k)&&k.videoWidth>0&&k.videoHeight>0&&(C=k.videoWidth/k.videoHeight),u.value=C,f!==C&&(f=C,i("aspect-ratio-change",C))},_=g(()=>{if(n.fit==="cover")return h;const k=u.value,C=s.value,O=l.value;return!k||C<=0||O<=0?h:C/O>k?{height:`${O}px`,width:`${O*k}px`}:{height:`${C/k}px`,width:`${C}px`}}
187),T=k=>{if(!n.clone)return k;const C=k.cloneNode(!0);if(C.srcObject=k.srcObject,y(k)&&y(C))try{C.currentTime=k.currentTime}catch{}return C},w=k=>{const C=o.value;if(!C)return;const O=T(k);if(m=O,O.classList.add(a.mediaElement),O instanceof HTMLAudioElement&&(O.classList.add(a.audioElement),S(O)),y(O)&&(O.autoplay=!0,O.muted=!0,O.playsInline=!0,O.addEventListener("loadedmetadata",E)),v(O),C.replaceChildren(O),y(O)){const L=O.play();L&&typeof L.catch=="function"&&L.catch(()=>{})}},E=()=>{m&&v(m)},M=()=>{const k=m;k&&(y(k)&&k.removeEventListener("loadedmetadata",E),k.remove(),m=null)};return Ie(()=>[n.clone,n.element],([,k])=>{M(),f=void 0,w(k)}),Ie(()=>n.volume,()=>{m&&S(m)}),Oa(()=>{w(n.element),p(),typeof ResizeObserver=="function"&&r.value&&(c=new ResizeObserver(p),c.observe(r.value))}),Lt(()=>{c?.disconnect(),c=null,M()}),(k,C)=>(A(),$("div",{ref_key:"mediaRootRef",ref:r,class:P(d.value)},[F("div",{class:P(k.$style.frame),style:zu(_.value),"data-test":"presentation-livekit-media-frame"},[F("div",{ref_key:"mediaContainerRef",ref:o,class:P(k.$style.mediaMount)},null,2),Qs(k.$slots,"default")],6)],2))}}),d9="_root_9818t_1",h9="_frame_9818t_10",m9="_mediaMount_9818t_20",f9="_mediaElement_9818t_26",p9="_rootCover_9818t_33",g9="_audioElement_9818t_37",v9={root:d9,frame:h9,mediaMount:m9,mediaElement:f9,rootCover:p9,audioElement:g9},b9={$style:v9},H1=at(u9,[["__cssModules",b9]]),y9=["data-speaking"],S9=Te({__name:"PresentationLiveKitCameraTileContent",props:{avatarSize:{},cloneMediaElement:{type:Boolean},compact:{type:Boolean,default:!1},mediaTestId:{},mediaFit:{default:"contain"},tile:{}},setup(e){const t=e,n=W1(),i=g(()=>n?.isParticipantModerator(t.tile.participantIdentity,t.tile.isModerator)??t.tile.isModerator);return(a,r)=>(A(),$("div",{ref:"tileContentRef",class:P([a.$style.tileContent,t.compact&&a.$style.tileContentCompact]),"data-test":"presentation-livekit-camera-tile-content"},[t.tile.element&&t.tile.isCameraEnabled?(A(),B(H1,{key:0,class:P(a.$style.cameraFrame),"data-speaking":t.tile.isSpeaking?"true":"false",clone:t.cloneMediaElement,"data-test":t.mediaTestId,element:t.tile.element,fit:t.mediaFit},null,8,["class","data-speaking","clone","data-test","element","fit"])):(A(),$("div",{key:1,class:P(a.$style.cameraOffState),"data-speaking":t.tile.isSpeaking?"true":"false","data-test":"presentation-livekit-camera-off-state"},[R(Wg,{"fallback-tone":"secondary",size:t.avatarSize,url:t.tile.avatarUrl},null,8,["size","url"])],10,y9)),i.value?(A(),$("span",{key:2,class:P(a.$style.adminIndicator),"aria-label":"Администратор","data-test":"presentation-livekit-admin-indicator",role:"img"},[R(b(D4),{class:P(a.$style.adminIcon)},null,8,["class"])],2)):re("",!0),Qs(a.$slots,"default")],2))}}),k9="_tileContent_abwhj_1",w9="_adminIndicator_abwhj_13",T9="_adminIcon_abwhj_27",E9="_tileContentCompact_abwhj_32",M9="_cameraFrame_abwhj_44",A9="_cameraOffState_abwhj_54",P9={tileContent:k9,adminIndicator:w9,adminIcon:T9,tileContentCompact:E9,cameraFrame:M9,cameraOffState:A9},_9={$style:P9},Zl=at(S9,[["__cssModules",_9]]),C9=Te({__name:"PresentationLiveKitParticipantActions",props:{includeChat:{type:Boolean,default:!1},tile:{},withoutBackground:{type:Boolean,default:!1}},setup(e){const t=e,n=W1(),i=D(!1),a=g(()=>!!(t.includeChat&&t.tile.chatPeerGuid)||n?.canShowParticipantActions(t.tile.participantIdentity)===!0),r=g(()=>n?.isParticipantActionPending(t.tile.participantIdentity)===!0),o=g(()=>n?.isParticipantModerator(t.tile.participantIdentity,t.tile.isModerator)??t.tile.isModerator),s=g(()=>{const u=[];return n?.canShowParticipantActions(t.tile.participantIdentity)?(u.push({id:"mute",label:"Выключить микрофон",icon:Ql,disabled:r.value}),t.includeChat&&t.tile.chatPeerGuid&&u.push({id:"chat",label:"Открыть чат",icon:wo}),n.canManageModerators.value&&u.push({id:"toggle-moderator",label:o.value?"Снять права администратора":"Назначить администратором",icon:D4,disabled:r.value}),u):(t.includeChat&&t.tile.chatPeerGuid&&u.push({id:"chat",label:"Открыть чат",icon:wo}),u)}),l=u=>{if(u==="chat"&&t.tile.chatPeerGuid){Xg({peerGuid:t.tile.chatPeerGuid});return}if(!(!n||r.value)){if(u==="mute"){n.mute(t.tile.participantIdentity);return}u==="toggle-moderator"&&n.setModerator(t.tile.participantIdentity,!o.value)}};return(u,c)=>
187a.value?(A(),$("div",{key:0,class:P([u.$style.actions,t.withoutBackground&&u.$style.actionsWithoutBackground]),"data-test":"presentation-livekit-participant-actions",onClick:c[1]||(c[1]=or(()=>{},["stop"])),onPointerdown:c[2]||(c[2]=or(()=>{},["stop"]))},[R(ta,{open:i.value,"onUpdate:open":c[0]||(c[0]=m=>i.value=m),items:s.value,placement:"bottom-end",width:"max-content",onSelect:l},{trigger:x(({toggleMenu:m})=>[R(le,{type:"button",variant:"ghost",size:"small","icon-only":"","aria-label":`Действия с участником: ${t.tile.displayName}`,disabled:r.value,"data-test":"presentation-livekit-participant-actions-trigger",onClick:or(m,["stop"])},{default:x(()=>[R(b(a0))]),_:1},8,["aria-label","disabled","onClick"])]),_:1},8,["open","items"])],34)):re("",!0)}}),I9="_actions_g2pvc_1",L9="_actionsWithoutBackground_g2pvc_22",R9={actions:I9,actionsWithoutBackground:L9},$9={$style:R9},ec=at(C9,[["__cssModules",$9]]),F9=["data-can-scroll-toward-tokens"],D9=["aria-label"],x9=Te({__name:"PresentationLiveKitCollapsedCameraPreviewStrip",props:{tiles:{}},emits:["restore"],setup(e,{emit:t}){const n=e,i=t,a=D(null),r=D(!1);let o=null;const s=()=>{const l=a.value;if(!l){r.value=!1;return}r.value=l.scrollLeft+l.clientWidth<l.scrollWidth-1};return Oa(()=>{s(),typeof ResizeObserver=="function"&&a.value&&(o=new ResizeObserver(s),o.observe(a.value))}),Ie(()=>n.tiles,async()=>{await Ku(),s()}),Lt(()=>{o?.disconnect(),o=null}),(l,u)=>(A(),$("div",{ref_key:"previewStripRef",ref:a,class:P([l.$style.previewStrip,r.value&&l.$style.previewStripTokenFade]),"data-can-scroll-toward-tokens":r.value?"true":"false","data-test":"presentation-livekit-collapsed-camera-preview-strip",onScroll:s},[(A(!0),$(an,null,ji(e.tiles,c=>(A(),$("article",{key:c.participantIdentity,class:P(l.$style.previewItem)},[F("button",{class:P(l.$style.previewButton),type:"button","aria-label":`Развернуть видео: ${c.displayName}`,"data-test":"presentation-livekit-collapsed-camera-preview",onClick:u[0]||(u[0]=m=>i("restore"))},[R(Zl,{"avatar-size":"small",tile:c},{default:x(()=>[R(Js,{class:P(["text-footnote-medium",l.$style.previewLabel]),"display-name":c.displayName,"is-microphone-enabled":c.isMicrophoneEnabled,"is-speaking":c.isSpeaking,"self-view-test-id":c.selfViewTestId},null,8,["class","display-name","is-microphone-enabled","is-speaking","self-view-test-id"])]),_:2},1032,["tile"])],10,D9),R(ec,{tile:c},null,8,["tile"])],2))),128))],42,F9))}}),B9="_previewStrip_154en_1",O9="_previewStripTokenFade_154en_17",U9="_previewItem_154en_21",N9="_previewButton_154en_30",G9="_previewLabel_154en_43",V9={previewStrip:B9,previewStripTokenFade:O9,previewItem:U9,previewButton:N9,previewLabel:G9},z9={$style:V9},K9=at(x9,[["__cssModules",z9]]),B4=100,O4="presentation-livekit-sound-settings:v1",Ic=()=>({meetingAudioVolume:B4}),Xo=e=>Math.min(100,Math.max(0,Math.round(e))),U4=()=>{if(typeof window>"u")return null;try{return window.localStorage}catch{return null}},q9=()=>{const e=U4();if(!e)return Ic();try{const t=JSON.parse(e.getItem(O4)??"null");return typeof t!="object"||t===null?Ic():{meetingAudioVolume:"meetingAudioVolume"in t&&typeof t.meetingAudioVolume=="number"&&Number.isFinite(t.meetingAudioVolume)?Xo(t.meetingAudioVolume):B4}}catch{return Ic()}},j9=e=>{const t=U4();if(t)try{t.setItem(O4,JSON.stringify({meetingAudioVolume:Xo(e.meetingAudioVolume)}))}catch{}},W9={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function H9(e,t){return A(),$("svg",W9,[...t[0]||(t[0]=[F("path",{d:"M6.463 21.08q-.697 0-1.095-.316-.39-.308-.39-.855 0-.805.49-1.693.489-.88 1.402-1.644.921-.771 2.208-1.253 1.295-.482 2.914-.482 1.61 0 2.905.482 1.295.481 2.216 1.253.921.764 1.403 1.644.49.888.49 1.693 0 .547-.399.855-.39.316-1.087.316zm5.529-7.72q-.906 0-1.669-.482a3.6 3.6 0 0 1-1.212-1.328 3.84 3.84 0 0 1-.456-1.867 3.6 3.6 0 0 1 .448-1.827q.465-.814 1.229-1.294a3.05 3.05 0 0 1 1.66-.482q.904 0 1.66.473.763.474 1.228 1.287t.465 1.826q0 1.045-.465 1.884a3.6 3.6 0 0 1-1.22 1.32q-.755.49-1.668.49m-9.828-1.096q-.183-.2-.067-.39.125-.19.324-.125.15.06.249.059.415 0 .697-.623.29-.623.29-1.502 0-.872-.29-1.495-.282-.622-.697-.622-.1 0-.25.058-.198.066-.323-.124-.116-.192.067-.39.132-.15.323-.25a.95.95 0 0 1 .432-.1q.705 0 1.17.814.473.806.473 2.109 0 1.312-.473 2.116-.465.806-1.17.806-.233 0-.432-.092a1.1 1.1 0 0 1-.323-.249m1.012 1.362q-.067-.192.075-.324.14-.141.307-.083.124.041.216.066.1.025.274.025.49 0 .871-.498.382
187-.498.598-1.32.224-.821.224-1.81 0-.971-.224-1.792-.216-.83-.598-1.328-.381-.507-.871-.507a.9.9 0 0 0-.274.033q-.091.026-.216.067-.165.067-.307-.075-.141-.15-.075-.332.134-.29.432-.473.299-.19.664-.191.797 0 1.37.598.58.59.888 1.627.315 1.037.315 2.374 0 1.336-.315 2.382-.308 1.038-.888 1.635-.573.59-1.37.59-.366 0-.664-.183a1.1 1.1 0 0 1-.432-.481m18.644-1.362a1 1 0 0 1-.324.25q-.2.09-.423.09-.706 0-1.179-.805-.465-.805-.465-2.116 0-1.312.465-2.117.473-.805 1.179-.805.224 0 .423.1.199.09.324.24.183.2.066.399-.108.19-.315.116a.8.8 0 0 0-.25-.05q-.414 0-.705.622-.282.615-.282 1.495t.282 1.502q.291.623.706.623.1 0 .249-.059.207-.075.315.125.117.19-.066.39m-1.013 1.353a1.06 1.06 0 0 1-.423.49q-.299.183-.664.183a1.87 1.87 0 0 1-1.378-.59q-.573-.597-.888-1.635-.316-1.045-.316-2.382t.316-2.374q.315-1.047.888-1.636.581-.597 1.378-.597.365 0 .664.19.299.183.423.482.075.183-.066.332-.142.142-.307.075a1.1 1.1 0 0 0-.49-.1q-.498 0-.88.507-.374.498-.59 1.328a7 7 0 0 0-.215 1.793q0 .98.216 1.81.215.82.589 1.319.382.498.88.498a1.1 1.1 0 0 0 .49-.1q.166-.057.307.083a.28.28 0 0 1 .066.324"},null,-1)])])}const N4={render:H9},X9={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Y9(e,t){return A(),$("svg",X9,[...t[0]||(t[0]=[F("path",{d:"M15.9 13.778v-7.83q0-.452-.267-.702-.257-.257-.733-.257H9.132q-.459 0-.717.225t-.274.653l-.008.137-1.346-1.346.065-.137q.226-.564.757-.862.532-.298 1.249-.298h6.34q1.032 0 1.66.612.63.613.629 1.612v9.772zM8.857 20.99q-1.04 0-1.684-.612-.636-.604-.636-1.612V9.09l1.587 1.588v7.726q0 .459.258.709.266.25.749.25H14.9q.427 0 .677-.21.258-.21.298-.604v-.073q0-.032.008-.064l1.322 1.345-.033.065a1 1 0 0 1-.04.08q-.249.524-.75.806-.49.282-1.184.282zm9.58-1.434L4.66 5.795a.6.6 0 0 1-.185-.452q0-.274.185-.46a.6.6 0 0 1 .452-.193.6.6 0 0 1 .459.194l13.777 13.76a.6.6 0 0 1 .185.46.6.6 0 0 1-.185.45.6.6 0 0 1-.451.194.63.63 0 0 1-.46-.193"},null,-1)])])}const G4={render:Y9},J9={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Q9(e,t){return A(),$("svg",J9,[...t[0]||(t[0]=[F("path",{d:"M15.183 3.361q1.031 0 1.651.613.629.612.629 1.611v13.18q0 1-.629 1.612-.62.612-1.651.612H8.842q-1.04 0-1.684-.612-.636-.604-.637-1.611V5.585q0-.999.637-1.611.644-.613 1.684-.613zM9.116 4.988q-.484 0-.75.25-.258.25-.258.71v12.455q0 .46.258.71.266.248.75.248h5.769q.474 0 .732-.249.266-.25.267-.709V5.947q0-.45-.267-.7-.258-.26-.732-.259z"},null,-1),F("path",{"fill-opacity":".5",d:"M8 5h8v15H8z"},null,-1)])])}const V4={render:Q9},Z9={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function ey(e,t){return A(),$("svg",Z9,[...t[0]||(t[0]=[F("path",{d:"M2.612 13.26q0-1.536.473-2.938A9.6 9.6 0 0 1 4.43 7.74a9.7 9.7 0 0 1 2.042-2.042 9.3 9.3 0 0 1 2.581-1.344A9 9 0 0 1 12 3.872q1.545 0 2.947.482a9.2 9.2 0 0 1 2.573 1.344 9.4 9.4 0 0 1 2.042 2.042 9.3 9.3 0 0 1 1.345 2.582q.48 1.403.481 2.938 0 1.81-.656 3.429a9.7 9.7 0 0 1-1.8 2.872 1.15 1.15 0 0 1-1.138.357 1.25 1.25 0 0 1-.573-.333l-1.403-1.41a.74.74 0 0 1-.224-.54q0-.315.224-.54a.72.72 0 0 1 .54-.232q.324 0 .54.232l.979.971a7.4 7.4 0 0 0 1.262-2.208 7.4 7.4 0 0 0 .456-2.598 7.4 7.4 0 0 0-.59-2.955 7.4 7.4 0 0 0-1.626-2.424 7.6 7.6 0 0 0-2.416-1.635A7.5 7.5 0 0 0 12 5.656a7.5 7.5 0 0 0-5.379 2.225 7.6 7.6 0 0 0-1.627 2.424 7.4 7.4 0 0 0-.59 2.955q0 1.37.457 2.598a7.6 7.6 0 0 0 1.262 2.208l.98-.97a.7.7 0 0 1 .53-.225.7.7 0 0 1 .549.224q.232.225.232.54t-.232.54l-1.403 1.41a1.2 1.2 0 0 1-.573.332q-.315.075-.614-.016-.3-.091-.515-.34a9.6 9.6 0 0 1-1.81-2.872 9 9 0 0 1-.655-3.429m3.22-.772q.315 0 .54.233.224.232.224.54 0 .315-.224.547a.74.74 0 0 1-.54.224H3.775v-1.544zm5.404-5.387V5.042h1.536v2.06a.74.74 0 0 1-.232.539.74.74 0 0 1-1.08 0 .75.75 0 0 1-.224-.54m4.607 1.245 1.453-1.46 1.087 1.087-1.452 1.46a.75.75 0 0 1-.54.233.73.73 0 0 1-.548-.232.73.73 0 0 1-.232-.548.75.75 0 0 1 .232-.54m2.35 4.142h2.058v1.544h-2.059a.75.75 0 0 1-.54-.224.75.75 0 0 1 0-1.087.74.74 0 0 1 .54-.233m-7.256 2.01a2 2 0 0 1-.199-.242 8 8 0 0 1-.215-.307L7.65 9.75q-.132-.2-.116-.365a.6.6 0 0 1 .141-.307.52.52 0 0 1 .3-.125.53.53 0 0 1 .364.1l4.2 2.88q.15.1.308.224.158.116.24.191a1.493 1.493 0 0 1 0 2.15 1.494 1.494 0 0 1-2.15 0"},null,-1)])])}const X1={render:ey}
187,ty={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function ny(e,t){return A(),$("svg",ty,[...t[0]||(t[0]=[F("path",{d:"M5.235 19.76q-2.125 0-2.125-1.428 0-.847.506-1.776.514-.93 1.47-1.735.962-.805 2.307-1.303 1.345-.507 3.013-.507 1.67 0 3.013.507 1.354.498 2.308 1.303.963.805 1.47 1.735.506.93.506 1.776 0 1.428-2.117 1.428zm-.274-1.436H15.86q.14 0 .2-.05.065-.05.066-.166 0-.481-.382-1.096-.374-.623-1.104-1.203-.73-.59-1.793-.972-1.063-.39-2.44-.39-1.37 0-2.441.39-1.063.383-1.793.972-.73.58-1.112 1.203-.374.615-.374 1.096 0 .116.058.166.066.05.216.05m5.445-6.284q-.996 0-1.818-.531a4 4 0 0 1-1.32-1.42 4.05 4.05 0 0 1-.49-1.975q0-1.063.49-1.934a3.8 3.8 0 0 1 1.32-1.403 3.34 3.34 0 0 1 1.818-.523q1.013 0 1.835.515.822.514 1.311 1.386.49.87.49 1.942a4.1 4.1 0 0 1-.49 1.984 3.86 3.86 0 0 1-1.32 1.428 3.3 3.3 0 0 1-1.826.531m0-1.444q.582 0 1.063-.332.49-.332.772-.897.29-.573.29-1.27a2.6 2.6 0 0 0-.29-1.228 2.23 2.23 0 0 0-.764-.864 1.9 1.9 0 0 0-1.07-.315 1.85 1.85 0 0 0-1.055.324q-.48.315-.78.871-.29.548-.29 1.229 0 .697.29 1.261.3.566.78.897a1.85 1.85 0 0 0 1.054.324m6.176.888a.7.7 0 0 1-.282-.498.84.84 0 0 1 .182-.565 3.7 3.7 0 0 0 .523-1.104 4.6 4.6 0 0 0 .191-1.311 4.6 4.6 0 0 0-.19-1.32 3.7 3.7 0 0 0-.524-1.104.86.86 0 0 1-.182-.564.7.7 0 0 1 .282-.498.63.63 0 0 1 .515-.142q.298.034.514.3.482.621.747 1.502.266.871.266 1.826 0 .954-.266 1.826a4.5 4.5 0 0 1-.747 1.486.78.78 0 0 1-.514.315.65.65 0 0 1-.515-.15m3.038 2.208a.62.62 0 0 1-.249-.473.8.8 0 0 1 .183-.548 7.4 7.4 0 0 0 1.046-2.142q.381-1.212.381-2.523t-.373-2.524a6.8 6.8 0 0 0-1.054-2.141.85.85 0 0 1-.183-.556.64.64 0 0 1 .25-.473.74.74 0 0 1 .547-.158q.299.033.515.315.82 1.063 1.27 2.524.456 1.46.456 3.013t-.448 3.005q-.449 1.444-1.278 2.523a.8.8 0 0 1-.523.316.73.73 0 0 1-.54-.158"},null,-1)])])}const z4={render:ny},iy={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function ay(e,t){return A(),$("svg",iy,[...t[0]||(t[0]=[F("path",{d:"M4.836 13.16q-.298 0-.514-.215a.73.73 0 0 1-.208-.523v-.814q0-.315.208-.53a.7.7 0 0 1 .514-.217q.316 0 .532.216a.72.72 0 0 1 .215.531v.814a.7.7 0 0 1-.215.523.72.72 0 0 1-.532.216m2.864.988a.7.7 0 0 1-.523-.215.72.72 0 0 1-.207-.515v-2.806q0-.298.207-.514a.7.7 0 0 1 .523-.216q.316 0 .523.216a.7.7 0 0 1 .216.514v2.806q0 .299-.216.515a.7.7 0 0 1-.523.215m2.856 1.744a.727.727 0 0 1-.722-.739V8.869q0-.299.207-.515a.67.67 0 0 1 .515-.224q.315 0 .53.224a.7.7 0 0 1 .217.515v6.284q0 .307-.216.523a.72.72 0 0 1-.531.216m2.863-2.4a.73.73 0 0 1-.523-.207.73.73 0 0 1-.207-.523v-1.494q0-.316.207-.523a.7.7 0 0 1 .523-.216q.308 0 .523.216a.7.7 0 0 1 .216.523v1.494q0 .308-.216.523a.73.73 0 0 1-.523.208m2.864 1.395a.72.72 0 0 1-.739-.739V9.882a.727.727 0 0 1 .74-.739q.306 0 .514.216a.7.7 0 0 1 .216.523v4.266a.73.73 0 0 1-.216.523.7.7 0 0 1-.515.216m2.856-1.344a.7.7 0 0 1-.523-.216.72.72 0 0 1-.208-.515v-1.594q0-.306.208-.523a.7.7 0 0 1 .523-.216q.306 0 .523.216a.7.7 0 0 1 .215.523v1.594q0 .299-.215.515a.7.7 0 0 1-.523.216"},null,-1)])])}const K4={render:ay};function Y1(e,t){const{pendingDirectTextMessageIntent:n}=rv(),i=g(()=>he(e)?.trim()??"");return{isInviteLinkPendingInChat:g(()=>{const o=n.value;return!!(i.value&&o?.presentation&&o.text===i.value)}),sendInviteUrlToChat:()=>i.value?av({peerGuids:he(t)??[],presentation:!0,text:i.value}):null}}const ry=1e3;function J1(e){const t=D(!1);let n=null;const i=g(()=>he(e)?.trim()??""),a=async()=>{const r=i.value;return!r||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.writeText!="function"?!1:(await navigator.clipboard.writeText(r),t.value=!0,n&&clearTimeout(n),n=setTimeout(()=>{t.value=!1,n=null},ry),!0)};return Lt(()=>{n&&clearTimeout(n)}),{copyInviteUrl:a,isInviteCopied:t,resolvedInviteUrl:i}}const Sn={audioOutput:"audio-output:",cameraCapabilitySelect:"camera-capability-select:",cameraDevice:"camera-device:",cameraFacingMode:"camera-facing-mode:",cameraFrameRate:"camera-frame-rate:",cameraResolution:"camera-resolution:",microphoneDevice:"microphone-device:",voiceProcessing:"voice-processing:"},q4="camera-background",xu={h360:"360p",h540:"540p",h720:"720p",h1080:"1080p"},Bu={disabled:"Без обработки","noise-suppression":"Шумоподавление","voice-isolation":"Изоляция Ð
187³Ð¾Ð»Ð¾ÑÐ°"},Qa=(e,t)=>e.label||`${t} ${e.deviceId.slice(0,6)}`,oy=(e,t)=>{const{copyInviteUrl:n,resolvedInviteUrl:i}=J1(()=>e.inviteUrl),{isInviteLinkPendingInChat:a,sendInviteUrlToChat:r}=Y1(()=>e.inviteUrl,()=>e.inviteRecipientPeerGuids),o=g(()=>{const w=e.audioOutputDevices.find(E=>E.deviceId===e.mediaSettings.audio.outputDeviceId);return w?Qa(w,"Динамик"):"По умолчанию"}),s=g(()=>[{id:"audio-output",label:"Динамик",description:o.value,disabled:!e.canSelectAudioOutput,showIcon:!1,children:[{id:`${Sn.audioOutput}${En}`,label:"По умолчанию",showIcon:!1},...e.audioOutputDevices.map(w=>({id:`${Sn.audioOutput}${w.deviceId}`,label:Qa(w,"Динамик"),showIcon:!1}))]},{id:"volume",kind:"range",label:"Громкость",description:`${el(e.meetingAudioVolume,{maximumFractionDigits:0})}%`,range:{min:0,max:100,step:1,value:e.meetingAudioVolume},showIcon:!1}]),l=g(()=>e.mediaSettings.microphone.voiceIsolation===!0?"voice-isolation":e.mediaSettings.microphone.noiseSuppression===!0?"noise-suppression":"disabled"),u=g(()=>{const w=e.microphoneDevices.find(E=>E.deviceId===e.mediaSettings.microphone.deviceId);return w?Qa(w,"Микрофон"):"По умолчанию"}),c=g(()=>[{id:"microphone-device",label:"Микрофон",description:u.value,icon:Kc,children:[{id:`${Sn.microphoneDevice}${En}`,label:"По умолчанию",selected:!e.mediaSettings.microphone.deviceId,showIcon:!1},...e.microphoneDevices.map(w=>({id:`${Sn.microphoneDevice}${w.deviceId}`,label:Qa(w,"Микрофон"),selected:w.deviceId===e.mediaSettings.microphone.deviceId,showIcon:!1}))]},{id:"voice-processing",label:"Обработка голоса",description:Bu[l.value],icon:z4,children:Object.entries(Bu).map(([w,E])=>({id:`${Sn.voiceProcessing}${w}`,label:E,selected:w===l.value,showIcon:!1}))},{id:"echo-cancellation",label:"Подавление эха",kind:"switch",icon:N4,checked:!!e.mediaSettings.microphone.echoCancellation},{id:"auto-gain-control",label:"Выравнивание громкости голоса",kind:"switch",icon:K4,checked:!!e.mediaSettings.microphone.autoGainControl}]),m={environment:"Задняя",user:"Фронтальная"},f=g(()=>{const w=e.cameraDevices.find(E=>E.deviceId===e.mediaSettings.camera.deviceId);return w?Qa(w,"Камера"):"По умолчанию"}),h=g(()=>e.mediaSettings.camera.resolution??"h720"),d=g(()=>ia(e.mediaSettings.camera.frameRate)),y=g(()=>e.mediaSettings.camera.facingMode==="environment"?"environment":"user"),S=g(()=>e.mediaSettings.backgroundMode==="blur"?"Размытие":e.mediaSettings.backgroundMode==="image"?"Загруженный фон":"Без фона"),p={range:0,select:1,boolean:2},v=g(()=>[...e.cameraCapabilityControls].sort((w,E)=>p[w.kind]-p[E.kind]).map(w=>w.kind==="boolean"?{id:w.key,kind:"switch",label:w.label,checked:w.value,showIcon:!1}:w.kind==="range"?{id:w.key,kind:"range",label:w.label,range:{max:w.max,min:w.min,step:w.step,value:w.value},showIcon:!1}:{id:w.key,label:w.label,description:w.value,showIcon:!1,children:w.options.map(E=>({id:`${Sn.cameraCapabilitySelect}${w.key}:${encodeURIComponent(E)}`,label:E,selected:E===w.value,showIcon:!1}))})),_=g(()=>[{id:"camera-device",label:"Камера",description:f.value,icon:qc,children:[{id:`${Sn.cameraDevice}${En}`,label:"По умолчанию",selected:!e.mediaSettings.camera.deviceId,showIcon:!1},...e.cameraDevices.map(w=>({id:`${Sn.cameraDevice}${w.deviceId}`,label:Qa(w,"Камера"),selected:e.mediaSettings.camera.deviceId===w.deviceId,showIcon:!1}))]},{id:"camera-facing-mode",label:"Расположение камеры",description:m[y.value],icon:c0,children:Object.entries(m).map(([w,E])=>({id:`${Sn.cameraFacingMode}${w}`,label:E,selected:y.value===w,showIcon:!1}))},{id:"camera-resolution",label:"Качество",description:xu[h.value],icon:i0,children:Object.entries(xu).map(([w,E])=>({id:`${Sn.cameraResolution}${w}`,label:E,selected:h.value===w,showIcon:!1}))},{id:"camera-frame-rate",label:"FPS",description:String(d.value),icon:X1,children:To.map(w=>({id:`${Sn.cameraFrameRate}${w}`,label:String(w),selected:d.value===w,showIcon:!1}))},{id:q4,label:"Фон",description:S.value,icon:u0,customSubmenu:!0},...v.value.length?[{id:"camera-capabilities",label:"Дополнительные настройки",icon:l0,children:v.value}]:[]]),T=g(()=>
187{const w=[{id:"microphone-settings",label:"Микрофон",icon:Kc,children:c.value},{id:"camera-settings",label:"Камера",icon:qc,children:_.value}],E=[{id:"toggle-recording",label:t.recordingTooltipTitle.value,icon:r0,disabled:e.isRecordingLoading},{id:"toggle-mobile-screen-share",label:t.mobileScreenShareTooltipTitle.value,icon:e.isMobileScreenShareActive?V4:G4,disabled:!e.canPublishScreenShare},{id:"sound-settings",label:"Настройки звука",icon:Wu,children:s.value},...w],M=i.value?[{id:"share",label:"Поделиться",icon:n0,children:[{id:"copy-link",label:"Скопировать ссылку",icon:s0},{id:"send-to-chat",label:"Отправить ссылку в чат",icon:wo,disabled:a.value}]}]:E.splice(-w.length);return E.push(...t.participantMenuItems.value),E.push(...M),E});return{copyInviteUrl:n,mobileMoreMenuItems:T,sendInviteUrlToChat:r}},sy={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function ly(e,t){return A(),$("svg",sy,[...t[0]||(t[0]=[F("path",{d:"M11.162 19.51q-1.021 0-1.428-.306-.407-.3-.407-.872 0-.805.482-1.685.49-.88 1.402-1.652.923-.771 2.217-1.253t2.905-.482q1.619 0 2.914.482 1.294.48 2.208 1.253.921.772 1.41 1.652.49.88.49 1.685 0 .573-.415.872-.406.306-1.427.307zm5.18-7.727a3.04 3.04 0 0 1-1.677-.49 3.6 3.6 0 0 1-1.212-1.32 3.8 3.8 0 0 1-.457-1.86q0-1.011.457-1.825.465-.822 1.228-1.304a3.05 3.05 0 0 1 1.66-.481q.906 0 1.66.473.765.473 1.22 1.295.465.813.465 1.826 0 1.038-.464 1.876a3.6 3.6 0 0 1-1.22 1.32 3 3 0 0 1-1.66.49M2.171 19.51q-.839 0-1.187-.34-.35-.333-.349-.947 0-.846.432-1.718a5.5 5.5 0 0 1 1.228-1.619 6.4 6.4 0 0 1 1.926-1.195q1.13-.457 2.524-.457 1.128 0 2.017.3a7 7 0 0 1 1.585.73 6.4 6.4 0 0 0-1.22 1.261 6 6 0 0 0-.797 1.436 4 4 0 0 0-.274 1.395q0 .672.332 1.154zm4.574-7.537a2.65 2.65 0 0 1-1.453-.424 3.2 3.2 0 0 1-1.063-1.154 3.3 3.3 0 0 1-.398-1.618q0-.889.398-1.594A3.1 3.1 0 0 1 5.3 6.054a2.64 2.64 0 0 1 1.445-.423q.78 0 1.444.415.672.407 1.07 1.12.4.705.4 1.594 0 .905-.4 1.636-.397.72-1.062 1.153a2.65 2.65 0 0 1-1.452.424"},null,-1)])])}const Ou={render:ly},cy=Te({__name:"PresentationLiveKitInviteControl",props:{buttonSize:{},buttonIconSize:{},buttonVariant:{},inviteRecipientPeerGuids:{default:()=>[]},inviteUrl:{default:null},placement:{}},setup(e){const t=e,n=D(!1),{copyInviteUrl:i,resolvedInviteUrl:a}=J1(()=>t.inviteUrl),{isInviteLinkPendingInChat:r,sendInviteUrlToChat:o}=Y1(()=>t.inviteUrl,()=>t.inviteRecipientPeerGuids),s=g(()=>[{id:"copy-link",label:"Скопировать ссылку",icon:s0},{id:"send-to-chat",label:"Отправить ссылку в чат",icon:wo,disabled:r.value}]),l=u=>{if(u==="copy-link"){i();return}u==="send-to-chat"&&o()};return(u,c)=>b(a)?(A(),B(ta,{key:0,open:n.value,"onUpdate:open":c[0]||(c[0]=m=>n.value=m),"aria-label":"Поделиться ссылкой на встречу",items:s.value,placement:e.placement,onSelect:l},{trigger:x(({toggleMenu:m})=>[R(Ut,{title:"Поделиться"},{default:x(()=>[R(le,{"data-test":"presentation-livekit-invite-control","aria-label":"Поделиться","aria-haspopup":"menu","aria-expanded":n.value,variant:e.buttonVariant??"ghost",size:e.buttonSize,"icon-size":e.buttonIconSize,"icon-only":"",onClick:m},{default:x(()=>[R(b(n0),{class:"ds-state-transition-target","data-test":"presentation-livekit-share-icon"})]),_:1},8,["aria-expanded","variant","size","icon-size","onClick"])]),_:2},1024)]),_:1},8,["open","items","placement"])):re("",!0)}}),ls="audio-output:",Lc="ds-state-transition-target",uy=Te({__name:"PresentationLiveKitNotificationSoundControl",props:{audioOutputDevices:{default:()=>[]},buttonSize:{},buttonIconSize:{},buttonVariant:{},canSelectAudioOutput:{type:Boolean,default:!1},outputDeviceId:{default:void 0},placement:{},volume:{}},emits:["update:audio-output-device","update:volume"],setup(e,{emit:t}){const n=e,i=t,a=Ai(),r=D(!1),o=g(()=>n.placement??(a.value?"top-end":"bottom-end")),s=g(()=>el(n.volume,{maximumFractionDigits:0})),l=h=>h.label||`Динамик ${h.deviceId.slice(0,6)}`,u=g(()=>{const h=n.audioOutputDevices.find(d=>d.deviceId===n.outputDeviceId);return h?l(h):"По умолчанию"}),c=g(()=>[{id:"audio-output",label:"Динамик",description:u.value,disabled:!n.canSelectAudioOutput,showIcon:!1,children:[{id:`${ls}${En}`,label:"По умолчанию",showIcon:!1},...n.audioOutputDevices.map(h=>({id:`${ls}${h.deviceId}`,label:l(h),showIcon:!1}))]},{id:"volume",kind:"range",label:"Громкость",description:`${s.value}%`,range:{min:0,max:100,step:1,value:n.volume},showIcon:!1}]),m=(h,d)=>{h==="volume"&&i("update:volume",Xo(d))},f=h=>
187{if(!h.startsWith(ls))return;const d=h.slice(ls.length);i("update:audio-output-device",d===En?"":d)};return(h,d)=>(A(),B(ta,{open:r.value,"onUpdate:open":d[0]||(d[0]=y=>r.value=y),"aria-label":"Настройки звуков уведомлений","close-on-select":!1,items:c.value,placement:o.value,"submenu-width":"content",onRangeChange:m,onSelect:f},{trigger:x(({toggleMenu:y})=>[R(Ut,{title:"Настройки звуков уведомлений"},{default:x(()=>[R(le,{"data-test":"presentation-livekit-notification-sound-control","aria-label":"Настройки звуков уведомлений","aria-haspopup":"menu","aria-expanded":r.value,variant:e.buttonVariant??"ghost",size:e.buttonSize,"icon-size":e.buttonIconSize,"icon-only":"",onClick:y},{default:x(()=>[e.volume===0?(A(),B(b(nv),{key:0,class:P(Lc),"data-test":"presentation-livekit-notification-sound-muted-icon"})):e.volume<=50?(A(),B(b(iv),{key:1,class:P(Lc),"data-test":"presentation-livekit-notification-sound-medium-icon"})):(A(),B(b(Wu),{key:2,class:P(Lc),"data-test":"presentation-livekit-notification-sound-loud-icon"}))]),_:1},8,["aria-expanded","variant","size","icon-size","onClick"])]),_:2},1024)]),_:1},8,["open","items","placement"]))}}),dy=["data-tone"],hy=["data-tone"],my=["aria-label"],x3=Te({__name:"PresentationLiveKitDesktopControls",props:{audioOutputDevices:{},canEndMeeting:{type:Boolean},canMuteParticipants:{type:Boolean},canSelectAudioOutput:{type:Boolean},classes:{},controlButtonSize:{},controlButtonVariant:{},controlIconSize:{},durationClasses:{},inviteRecipientPeerGuids:{},inviteUrl:{},isCompactDesktop:{type:Boolean},isEndingMeeting:{type:Boolean},isParticipantMenuOpen:{type:Boolean},isRecordingActive:{type:Boolean},isRecordingLoading:{type:Boolean},leaveControlLabel:{},mediaSettings:{},meetingAudioVolume:{},meetingDurationLabel:{},meetingDurationTone:{},meetingDurationTooltipTitle:{},neutralThemeTransitionClass:{},participantCountAriaLabel:{},participantCountClasses:{},participantCountLabel:{},participantMenuItems:{},recordingTooltipTitle:{},section:{},settingsButtonSize:{},shouldRenderMeetingActions:{type:Boolean},shouldRenderMediaControls:{type:Boolean}},emits:["end","leave","participant-menu-select","toggle-recording","update:audio-output-device","update:meeting-audio-volume","update:participant-menu-open"],setup(e,{emit:t}){const n=t;return(i,a)=>(A(),$(an,null,[e.section==="context"&&(e.shouldRenderMediaControls||e.shouldRenderMeetingActions)?(A(),$("div",{key:0,class:P(e.classes.meetingContext),"data-test":"presentation-livekit-meeting-context"},[e.shouldRenderMediaControls&&(!e.isCompactDesktop||e.isRecordingActive)?(A(),$("div",{key:0,class:P(e.classes.recordingControl)},[R(Ut,{title:e.recordingTooltipTitle},{default:x(()=>[R(le,{"data-test":"presentation-livekit-recording-control","aria-label":e.recordingTooltipTitle,title:e.recordingTooltipTitle,variant:e.controlButtonVariant,size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",disabled:e.isRecordingLoading,loading:e.isRecordingLoading,onClick:a[0]||(a[0]=r=>n("toggle-recording"))},{default:x(()=>[e.isRecordingActive?(A(),$("span",{key:0,"data-test":"presentation-livekit-recording-icon",class:P([e.neutralThemeTransitionClass,e.classes.recordingIconActive]),"aria-hidden":"true"},[F("span",{class:P(e.classes.recordingPulseDot),"data-test":"presentation-livekit-recording-pulse-dot"},null,2)],2)):(A(),B(b(r0),{key:1,"data-test":"presentation-livekit-recording-icon",class:P(e.neutralThemeTransitionClass)},null,8,["class"]))]),_:1},8,["aria-label","title","variant","size","icon-size","disabled","loading"])]),_:1},8,["title"])],2)):re("",!0),e.shouldRenderMeetingActions?(A(),$("div",{key:1,class:P(e.classes.meetingMeta),"data-test":"presentation-livekit-meeting-meta"},[!e.isCompactDesktop&&e.meetingDurationLabel&&e.meetingDurationTooltipTitle?(A(),B(Ut,{key:0,title:e.meetingDurationTooltipTitle},{default:x(()=>[F("span",{class:P(e.durationClasses),"data-test":"presentation-livekit-meeting-duration","data-tone":e.meetingDurationTone},ct(e.meetingDurationLabel),11,dy)]),_:1},8,["title"])):!e.isCompactDesktop&&e.meetingDurationLabel?(A(),$("span",{key:1,class:P(e.durationClasses),"data-test":"presentation-livekit-meeting-duration","data-tone":e.meetingDurationTone},ct(e.meetingDurationLabel),11,hy)):re("",!0),e.canMuteParticipants?(A(),B(ta,{key:2,open:e.isParticipantMenuOpen,items:e.participantMenuItems,placement:"bottom-end",width:"max-content","onUpdate:open":a[1]||(a[1]=r=>n("update:participant-menu-open",r)),onSelect:a[2]||(a[2]=r=>n("participant-menu-select",r))},{trigger:x(({toggleMenu:r})=>[R(le,{"data-test":"presentation-livekit-participant-count","aria-label":e.participantCountAriaLabel,variant:e.controlButtonVariant,size:e.settingsButtonSize,onClick:r},{default:x(()=>[R(b(Ou),{class:P(e.classes.participantCountIcon)}
187,null,8,["class"]),F("span",null,ct(e.participantCountLabel),1)]),_:1},8,["aria-label","variant","size","onClick"])]),_:1},8,["open","items"])):(A(),B(Ut,{key:3,title:"Участников в презентации"},{default:x(()=>[F("span",{class:P(e.participantCountClasses),"data-test":"presentation-livekit-participant-count","aria-label":e.participantCountAriaLabel},[R(b(Ou),{class:P(e.classes.participantCountIcon)},null,8,["class"]),F("span",null,ct(e.participantCountLabel),1)],10,my)]),_:1}))],2)):re("",!0)],2)):re("",!0),e.section==="actions"&&e.shouldRenderMeetingActions?(A(),$("div",{key:1,class:P(e.classes.meetingActions),"data-test":"presentation-livekit-meeting-actions"},[F("div",{class:P(e.classes.meetingCommands),"data-test":"presentation-livekit-meeting-commands"},[e.isCompactDesktop?re("",!0):(A(),B(uy,{key:0,"audio-output-devices":e.audioOutputDevices,"button-variant":e.controlButtonVariant,"can-select-audio-output":e.canSelectAudioOutput,"output-device-id":e.mediaSettings.audio.outputDeviceId,volume:e.meetingAudioVolume,"onUpdate:audioOutputDevice":a[3]||(a[3]=r=>n("update:audio-output-device",r)),"onUpdate:volume":a[4]||(a[4]=r=>n("update:meeting-audio-volume",r))},null,8,["audio-output-devices","button-variant","can-select-audio-output","output-device-id","volume"])),e.isCompactDesktop?re("",!0):(A(),B(cy,{key:1,"invite-recipient-peer-guids":e.inviteRecipientPeerGuids,"invite-url":e.inviteUrl,"button-variant":e.controlButtonVariant,placement:"bottom-end"},null,8,["invite-recipient-peer-guids","invite-url","button-variant"])),R(le,{"data-test":"presentation-livekit-leave-control",variant:"secondary",size:e.controlButtonSize,onClick:a[5]||(a[5]=r=>n("leave"))},{default:x(()=>[gi(ct(e.leaveControlLabel),1)]),_:1},8,["size"]),e.canEndMeeting?(A(),B(Ut,{key:2,title:"Завершить встречу"},{default:x(()=>[R(le,{"data-test":"presentation-livekit-end-control","aria-label":"Завершить встречу",variant:e.controlButtonVariant,tone:"danger",size:e.controlButtonSize,"icon-only":"",loading:e.isEndingMeeting,onClick:a[6]||(a[6]=r=>n("end"))},{default:x(()=>[R(b(Zs))]),_:1},8,["variant","size","loading"])]),_:1})):re("",!0)],2)],2)):re("",!0)],64))}}),fy=Te({__name:"PresentationLiveKitLeaveMeetingModal",props:{canEndMeeting:{type:Boolean},isPending:{type:Boolean},open:{type:Boolean}},emits:["close","end","leave"],setup(e,{emit:t}){const n=e,i=t,a=g(()=>n.canEndMeeting?"Вы можете выйти, оставив встречу активной, или завершить её для всех участников.":"Вы действительно хотите выйти из встречи?"),r=o=>{o||i("close")};return(o,s)=>(A(),B(Vu,{"action-footer":"","action-footer-surface":"solid","close-on-backdrop":!e.isPending,"close-on-escape":!e.isPending,open:e.open,width:420,title:"Выйти из встречи?",onClose:s[4]||(s[4]=l=>i("close")),"onUpdate:open":r},{actions:x(()=>[e.canEndMeeting?(A(),B(le,{key:0,"data-test":"presentation-livekit-leave-meeting",variant:"secondary",disabled:e.isPending,onClick:s[0]||(s[0]=l=>i("leave"))},{default:x(()=>[...s[5]||(s[5]=[gi(" Выйти ",-1)])]),_:1},8,["disabled"])):(A(),B(le,{key:1,"data-test":"presentation-livekit-cancel-leave",variant:"secondary",disabled:e.isPending,onClick:s[1]||(s[1]=l=>i("close"))},{default:x(()=>[...s[6]||(s[6]=[gi(" Отмена ",-1)])]),_:1},8,["disabled"])),e.canEndMeeting?(A(),B(le,{key:2,"data-test":"presentation-livekit-confirm-end-meeting",variant:"primary",tone:"danger",loading:e.isPending,onClick:s[2]||(s[2]=l=>i("end"))},{default:x(()=>[...s[7]||(s[7]=[gi(" Завершить ",-1)])]),_:1},8,["loading"])):(A(),B(le,{key:3,"data-test":"presentation-livekit-confirm-leave",variant:"primary",tone:"danger",disabled:e.isPending,onClick:s[3]||(s[3]=l=>i("leave"))},{default:x(()=>[...s[8]||(s[8]=[gi(" Выйти ",-1)])]),_:1},8,["disabled"]))]),default:x(()=>[F("p",{class:P(["text-subhead-regular",o.$style.description])},ct(a.value),3)]),_:1},8,["close-on-backdrop","close-on-escape","open"]))}}),py="_description_4nphx_1",gy={description:py},vy={$style:gy},by=at(fy,[["__cssModules",vy]]),yy={xmlns:"http://www.w3.org/2000/svg",fill:"
187currentColor",viewBox:"0 0 24 24"};function Sy(e,t){return A(),$("svg",yy,[...t[0]||(t[0]=[F("path",{d:"m14.296 16.872 2.055 2.063H1.156a.97.97 0 0 1-.725-.307 1 1 0 0 1-.298-.725q0-.426.298-.725a.97.97 0 0 1 .725-.306h1.708V7.373q0-.942.556-1.394l1.289 1.306q-.267.12-.266.507v9.08zm6.744 2.063-2.08-2.087h.59V7.792q0-.387-.194-.572-.186-.185-.556-.185H9.14l-1.58-1.58h11.635q.942 0 1.434.492.5.492.5 1.426v9.5h1.707q.428 0 .725.305.298.298.298.725 0 .42-.298.725a.97.97 0 0 1-.725.307zm-1.75 1.505L3.726 4.868a.6.6 0 0 1-.185-.452q0-.273.185-.459a.64.64 0 0 1 .46-.185q.265 0 .458.185l15.558 15.574a.6.6 0 0 1 .185.459.6.6 0 0 1-.185.451.6.6 0 0 1-.452.186.6.6 0 0 1-.459-.186"},null,-1)])])}const ky={render:Sy},wy={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Ty(e,t){return A(),$("svg",wy,[...t[0]||(t[0]=[F("path",{d:"M5.559 18.946q-1.594 0-2.482-.846-.88-.84-.88-2.408V7.981a20 20 0 0 1 .033-1.162L3.782 8.37v7.04q0 1.02.531 1.535.54.514 1.511.514h7.097l1.478 1.486zM14.19 5.067q1.594 0 2.474.872.88.862.88 2.424v7.37q0 .699-.224 1.28L15.9 15.6a1 1 0 0 0 .042-.2 1.4 1.4 0 0 0 .017-.223V8.604q0-1.021-.532-1.536-.532-.523-1.51-.523H6.854L5.376 5.067zm3.072 4.582 3.278-2.78q.291-.24.582-.39.298-.15.597-.15.574 0 .922.374.357.374.357.987v8.666q0 .615-.357.996-.35.374-.922.374-.298 0-.597-.15a3 3 0 0 1-.582-.398l-3.278-2.772v-1.768l3.901 3.196a1 1 0 0 1 .1.066.2.2 0 0 0 .091.025q.133 0 .133-.183V8.313q0-.19-.133-.19a.14.14 0 0 0-.091.032q-.042.025-.1.067l-3.901 3.196zm.34 10.999L1.283 4.345a.63.63 0 0 1-.19-.465q0-.282.19-.473a.62.62 0 0 1 .474-.19.66.66 0 0 1 .473.19L18.541 19.71a.6.6 0 0 1 .19.465.66.66 0 0 1-.19.473.6.6 0 0 1-.465.19.66.66 0 0 1-.473-.19"},null,-1)])])}const Ey={render:Ty},My={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Ay(e,t){return A(),$("svg",My,[...t[0]||(t[0]=[F("path",{d:"M5.11 18.838q-1.335 0-2.075-.697-.73-.69-.73-2.009v-8.21q0-1.31.755-2.025.765-.722 2.05-.722h8.816q1.336 0 2.034.722.705.714.705 2.026v8.168q0 1.312-.739 2.025-.73.723-2.067.722zm12.767-4.183V9.384l2.855-2.449q.258-.225.515-.349.266-.132.523-.132.506 0 .822.332.315.323.315.871v8.733q0 .547-.315.88-.315.331-.822.332-.257 0-.523-.133a2.5 2.5 0 0 1-.515-.349z"},null,-1)])])}const Py={render:Ay},_y=["src"],Cy=Te({__name:"PresentationLiveKitBackgroundSettings",props:{backgroundImages:{},backgroundProcessorState:{},settings:{}},emits:["delete-background-image","select-background-image","select-background-mode","upload-background-file"],setup(e,{emit:t}){const n=e,i=t,a=D(null),r=g(()=>n.backgroundProcessorState.errorText?n.backgroundProcessorState.errorText:n.backgroundProcessorState.userMessage?n.backgroundProcessorState.userMessage:n.backgroundProcessorState.isSupported?null:"AI-обработка фона недоступна на этом устройстве"),o=c=>n.settings.backgroundMode===c,s=c=>n.settings.backgroundMode==="image"&&n.settings.backgroundImageId===c,l=()=>{a.value?.click()},u=c=>{const m=c.target;if(!(m instanceof HTMLInputElement))return;const f=m.files?.[0];f&&(i("upload-background-file",f),m.value="")};return(c,m)=>(A(),$("section",{class:P(c.$style.section)},[r.value?(A(),$("p",{key:0,class:P([c.$style.warning,"text-subhead-regular"]),"data-test":"presentation-livekit-background-warning"},[R(b(ov),{class:P(c.$style.warningIcon),"aria-hidden":"true"},null,8,["class"]),F("span",null,ct(r.value),1)],2)):re("",!0),F("div",{class:P(c.$style.backgroundGrid),"data-test":"presentation-livekit-background-grid"},[F("div",{class:P(c.$style.backgroundTileFrame)},[R(le,{type:"button",block:"","data-background-tile":"disabled","data-selected":o("disabled")?"true":"false",onClick:m[0]||(m[0]=f=>i("select-background-mode","disabled"))},{default:x(()=>[F("span",{class:P(c.$style.backgroundTileContent)},[F("span",{class:P([c.$style.backgroundTileLabel,"text-subhead-regular"])}," Без фона ",2)],2)]),_:1},8,["data-selected"])],2),F("div",{class:P(c.$style.backgroundTileFrame)},[R(le,{type:"button",block:"","data-background-tile":"blur","data-selected":o("blur")?"true":"false",onClick:m[1]||(m[1]=f=>i("select-background-mode","blur"))},{default:x(()=>[F("span",{class:P(c.$style.backgroundTileContent)},[F("span",{class:P(c.$style.backgroundTileBlur),"aria-hidden":"true"},null,2),F("span",{class:P([c.$style.backgroundTileLabel,"text-subhead-regular"])}," Размытие ",2)],2)]),_:1}
187,8,["data-selected"])],2),(A(!0),$(an,null,ji(e.backgroundImages,f=>(A(),$("div",{key:f.id,class:P(c.$style.backgroundTileFrame)},[R(le,{type:"button",block:"","data-background-tile":f.id,"data-selected":s(f.id)?"true":"false",onClick:h=>i("select-background-image",f.id)},{default:x(()=>[F("span",{class:P(c.$style.backgroundTileContent)},[F("img",{class:P(c.$style.backgroundTileImage),src:f.objectUrl,alt:"Загруженный фон"},null,10,_y)],2)]),_:2},1032,["data-background-tile","data-selected","onClick"]),R(le,{"aria-label":"Удалить фон","data-test":"presentation-livekit-background-delete","icon-only":"",placement:"absolute-bottom-end",size:"small",variant:"ghost",onClick:or(h=>i("delete-background-image",f.id),["stop"])},{default:x(()=>[R(b(Zg),{"aria-hidden":"true"})]),_:1},8,["onClick"])],2))),128)),R(le,{type:"button",block:"","data-background-tile":"upload","data-test":"presentation-livekit-background-upload",onClick:l},{default:x(()=>[F("span",{class:P(c.$style.backgroundTileContent)},[R(b(ev),{class:P(c.$style.backgroundTileIcon),"aria-hidden":"true"},null,8,["class"]),F("span",{class:P([c.$style.backgroundTileLabel,"text-subhead-regular"])}," Загрузить ",2)],2)]),_:1}),F("input",{ref_key:"backgroundInputRef",ref:a,accept:"image/png,image/jpeg,image/webp",class:P(c.$style.fileInput),type:"file","data-test":"presentation-livekit-background-file-input",onChange:u},null,34)],2)],2))}}),Iy="_section_tzhrc_1",Ly="_warning_tzhrc_7",Ry="_warningIcon_tzhrc_19",$y="_backgroundGrid_tzhrc_26",Fy="_backgroundTileFrame_tzhrc_32",Dy="_backgroundTileContent_tzhrc_50",xy="_backgroundTileBlur_tzhrc_61",By="_backgroundTileImage_tzhrc_76",Oy="_backgroundTileLabel_tzhrc_85",Uy="_backgroundTileIcon_tzhrc_86",Ny="_fileInput_tzhrc_97",Gy={section:Iy,warning:Ly,warningIcon:Ry,backgroundGrid:$y,backgroundTileFrame:Fy,backgroundTileContent:Dy,backgroundTileBlur:xy,backgroundTileImage:By,backgroundTileLabel:Oy,backgroundTileIcon:Uy,fileInput:Ny},Vy={$style:Gy},j4=at(Cy,[["__cssModules",Vy]]),cs="camera-device:",Rc="camera-resolution:",$c="camera-frame-rate:",Fc="camera-facing-mode:",Dc="camera-capability-select:",B3="camera-background",zy="camera-capabilities",Ky=Te({__name:"PresentationLiveKitCameraSettingsControl",props:{backgroundImages:{},backgroundProcessorState:{},buttonSize:{},buttonIconSize:{},buttonVariant:{},cameraCapabilityControls:{},cameraDevices:{},settings:{}},emits:["delete-background-image","select-background-image","select-background-mode","upload-background-file","update-camera-settings"],setup(e,{emit:t}){const n={range:0,select:1,boolean:2},i={h360:"360p",h540:"540p",h720:"720p",h1080:"1080p"},a={environment:"Задняя",user:"Фронтальная"},r=e,o=t,s=Ai(),l=D(!1),u=g(()=>s.value?"top-start":"bottom-start"),c=k=>k.label||`Камера ${k.deviceId.slice(0,6)}`,m=g(()=>{const k=r.cameraDevices.find(C=>C.deviceId===r.settings.camera.deviceId);return k?c(k):"По умолчанию"}),f=g(()=>r.settings.camera.resolution??"h720"),h=g(()=>ia(r.settings.camera.frameRate)),d=g(()=>r.settings.camera.facingMode==="environment"?"environment":"user"),y=g(()=>r.settings.backgroundMode==="blur"?"Размытие":r.settings.backgroundMode==="image"?"Загруженный фон":"Без фона"),S=g(()=>{const k=r.cameraCapabilityControls.length,C=k%100,O=k%10,L=C>=11&&C<=14?"параметров":O===1?"параметр":O>=2&&O<=4?"параметра":"параметров";return`${k} ${L}`}),p=g(()=>[...r.cameraCapabilityControls].sort((k,C)=>n[k.kind]-n[C.kind]).map(k=>k.kind==="boolean"?{id:k.key,kind:"switch",label:k.label,checked:k.value,showIcon:!1}:k.kind==="range"?{id:k.key,kind:"range",label:k.label,range:{max:k.max,min:k.min,step:k.step,value:k.value},showIcon:!1}:{id:k.key,label:k.label,description:k.value,showIcon:!1,children:k.options.map(C=>({id:`${Dc}${k.key}:${encodeURIComponent(C)}`,label:C,selected:C===k.value,showIcon:!1}))})),v=g(()=>[{id:"camera-device",label:"Камера",description:m.value,icon:qc,children:[{id:`${cs}${En}`,label:"По умолчанию",selected:!r.settings.camera.deviceId,showIcon:!1},...r.cameraDevices.map(k=>({id:`${cs}${k.deviceId}`,label:c(k),selected:r.settings.camera.deviceId===k.deviceId,showIcon:!1}))]},{id:"camera-facing-mode",label:"Расположение камеры",description:a[d.value],icon:c0,children:Object.entries(a).map(([k,C])=>({id:`${Fc}${k}`,label:C,selected:d.value===k,showIcon:!1}))},{id:"camera-resolution",label:"Качество",description:i[f.value],icon:i0,children:Object.entries(i).map(([k,C])=>({id:`${Rc}${k}`,label:C,selected:f.value===k,showIcon:!1}))},{id:"camera-frame-rate",label:"FPS",description:String(h.value),icon:X1,children:To.map(k=>({id:`${$c}${k}`,label:String(k),selected:h.value===k,showIcon:!1}))},{id:B3,label:"Фон",description:y.value,icon:u0,customSubmenu:!0}
187,...r.cameraCapabilityControls.length>0?[{id:zy,label:"Дополнительные настройки",description:S.value,icon:l0,children:p.value}]:[]]),_=(k,C)=>{o("update-camera-settings",{advancedConstraints:{...r.settings.camera.advancedConstraints,[k]:C}})},T=k=>r.cameraCapabilityControls.some(C=>C.key===k),w=(k,C)=>{T(k)&&_(k,C)},E=(k,C)=>{T(k)&&_(k,C)},M=k=>{if(k.startsWith(Dc)){const C=k.slice(Dc.length),O=C.indexOf(":"),L=C.slice(0,O),oe=C.slice(O+1);O>0&&T(L)&&_(L,decodeURIComponent(oe));return}if(k.startsWith(cs)){const C=k.slice(cs.length);o("update-camera-settings",{deviceId:C===En?void 0:C});return}if(k.startsWith(Rc)){const C=k.slice(Rc.length);C in i&&o("update-camera-settings",{resolution:C});return}if(k.startsWith($c)){const C=Number(k.slice($c.length));To.some(O=>O===C)&&o("update-camera-settings",{frameRate:C});return}if(k.startsWith(Fc)){const C=k.slice(Fc.length);(C==="environment"||C==="user")&&o("update-camera-settings",{facingMode:C})}};return(k,C)=>(A(),B(ta,{open:l.value,"onUpdate:open":C[4]||(C[4]=O=>l.value=O),"aria-label":"Настройки камеры","close-on-select":!1,items:v.value,placement:u.value,"submenu-width":"content",onCheckChange:w,onRangeChange:E,onSelect:M},{trigger:x(({toggleMenu:O})=>[R(Ut,{title:"Настройки камеры",disabled:l.value},{default:x(()=>[R(le,{"data-test":"presentation-livekit-camera-settings-control","aria-label":"Настройки камеры","aria-haspopup":"menu","aria-expanded":l.value,variant:e.buttonVariant??"ghost",size:e.buttonSize??"small","icon-size":e.buttonIconSize,"icon-only":"",onClick:O},{default:x(()=>[R(b(ju),{class:"ds-state-transition-target"})]),_:1},8,["aria-expanded","variant","size","icon-size","onClick"])]),_:2},1032,["disabled"])]),submenu:x(({item:O})=>[O.id===B3?(A(),B(j4,{key:0,"background-images":e.backgroundImages,"background-processor-state":e.backgroundProcessorState,settings:e.settings,onDeleteBackgroundImage:C[0]||(C[0]=L=>o("delete-background-image",L)),onSelectBackgroundImage:C[1]||(C[1]=L=>o("select-background-image",L)),onSelectBackgroundMode:C[2]||(C[2]=L=>o("select-background-mode",L)),onUploadBackgroundFile:C[3]||(C[3]=L=>o("upload-background-file",L))},null,8,["background-images","background-processor-state","settings"])):re("",!0)]),_:1},8,["open","items","placement"]))}}),us="microphone-device:",xc="voice-processing:",qy=Te({__name:"PresentationLiveKitMicrophoneSettingsControl",props:{buttonSize:{},buttonIconSize:{},buttonVariant:{},microphoneDevices:{},settings:{}},emits:["update-microphone-settings"],setup(e,{emit:t}){const n=e,i=t,a=Ai(),r=D(!1),o=g(()=>a.value?"top-start":"bottom-start"),s=g(()=>n.settings.microphone.voiceIsolation===!0?"voice-isolation":n.settings.microphone.noiseSuppression===!0?"noise-suppression":"disabled"),l={disabled:"Без обработки","noise-suppression":"Шумоподавление","voice-isolation":"Изоляция голоса"},u=d=>d.label||`Микрофон ${d.deviceId.slice(0,6)}`,c=g(()=>{const d=n.microphoneDevices.find(y=>y.deviceId===n.settings.microphone.deviceId);return d?u(d):"По умолчанию"}),m=g(()=>[{id:"microphone",label:"Микрофон",description:c.value,icon:Kc,children:[{id:`${us}${En}`,label:"По умолчанию",selected:!n.settings.microphone.deviceId,showIcon:!1},...n.microphoneDevices.map(d=>({id:`${us}${d.deviceId}
187`,label:u(d),selected:d.deviceId===n.settings.microphone.deviceId,showIcon:!1}))]},{id:"voice-processing",label:"Обработка голоса",description:l[s.value],icon:z4,children:Object.entries(l).map(([d,y])=>({id:`${xc}${d}`,label:y,selected:d===s.value,showIcon:!1}))},{id:"echo-cancellation",label:"Подавление эха",kind:"switch",icon:N4,checked:!!n.settings.microphone.echoCancellation},{id:"auto-gain-control",label:"Выравнивание громкости голоса",kind:"switch",icon:K4,checked:!!n.settings.microphone.autoGainControl}]),f=(d,y)=>{d==="echo-cancellation"&&i("update-microphone-settings",{echoCancellation:y}),d==="auto-gain-control"&&i("update-microphone-settings",{autoGainControl:y})},h=d=>{if(d.startsWith(us)){const S=d.slice(us.length);i("update-microphone-settings",{deviceId:S===En?void 0:S});return}if(!d.startsWith(xc))return;const y=d.slice(xc.length);y in l&&i("update-microphone-settings",{noiseSuppression:y==="noise-suppression",voiceIsolation:y==="voice-isolation"})};return(d,y)=>(A(),B(ta,{open:r.value,"onUpdate:open":y[0]||(y[0]=S=>r.value=S),"aria-label":"Настройки микрофона","close-on-select":!1,items:m.value,placement:o.value,"submenu-width":"content",onCheckChange:f,onSelect:h},{trigger:x(({toggleMenu:S})=>[R(Ut,{title:"Настройки микрофона",disabled:r.value},{default:x(()=>[R(le,{"data-test":"presentation-livekit-microphone-settings-control","aria-label":"Настройки микрофона","aria-haspopup":"menu","aria-expanded":r.value,variant:e.buttonVariant??"ghost",size:e.buttonSize??"small","icon-size":e.buttonIconSize,"icon-only":"",onClick:S},{default:x(()=>[R(b(ju),{class:"ds-state-transition-target"})]),_:1},8,["aria-expanded","variant","size","icon-size","onClick"])]),_:2},1032,["disabled"])]),_:1},8,["open","items","placement"]))}}),Bc="screen-share-quality:",Oc="screen-share-frame-rate:",jy=Te({__name:"PresentationLiveKitScreenShareSettingsControl",props:{isScreenShareEnabled:{type:Boolean,default:!1},settings:{}},emits:["update-settings"],setup(e,{emit:t}){const n=e,i=t,a=D(!1),r={h720:"720p",h1080:"1080p"},o=g(()=>Iv(n.settings.quality)),s=g(()=>[{id:"screen-share-resolution",label:"Качество демонстрации",description:r[o.value.resolution],icon:d0,disabled:n.isScreenShareEnabled,children:l2.map(c=>({id:`${Bc}${c}`,label:r[c],selected:c===o.value.resolution,showIcon:!1}))},{id:"screen-share-frame-rate",label:"FPS",description:String(o.value.frameRate),icon:X1,disabled:n.isScreenShareEnabled,children:c2.map(c=>({id:`${Oc}${c}`,label:String(c),selected:c===o.value.frameRate,showIcon:!1}))},{id:"screen-share-system-audio",label:"Передавать звук системы",kind:"switch",icon:Wu,checked:n.settings.includeSystemAudio,disabled:n.isScreenShareEnabled}]),l=c=>{if(n.isScreenShareEnabled)return;const{frameRate:m,resolution:f}=o.value,h=c.startsWith(Bc)?c.slice(Bc.length):f,d=c.startsWith(Oc)?Number(c.slice(Oc.length)):m;!l2.includes(h)||!c2.includes(d)||i("update-settings",{...n.settings,quality:Lv(h,d)})},u=(c,m)=>{c!=="screen-share-system-audio"||n.isScreenShareEnabled||i("update-settings",{...n.settings,includeSystemAudio:m})};return(c,m)=>(A(),B(ta,{open:a.value,"onUpdate:open":m[0]||(m[0]=f=>a.value=f),"aria-label":"Настройки демонстрации экрана","close-on-select":!1,items:s.value,placement:"bottom-start","submenu-width":"content",onCheckChange:u,onSelect:l},{beforeItems:x(()=>[e.isScreenShareEnabled?(A(),$("p",{key:0,class:P([c.$style.hint,"text-footnote-regular"]),"data-test":"presentation-livekit-screen-share-settings-hint"}," Чтобы изменить настройки, остановите демонстрацию экрана ",2)):re("",!0)]),trigger:x(({toggleMenu:f})=>[R(Ut,{title:"Настройки демонстрации экрана",disabled:a.value},{default:x(()=>[R(le,{"data-test":"presentation-livekit-screen-share-settings-control","aria-label":"Настройки демонстрации экрана","aria-haspopup":"menu","aria-expanded":a.value,variant:"ghost",size:"small","icon-only":"",onClick:f},{default:x(()=>[R(b(ju),{class:"ds-state-transition-target"})]),_:1},8,["aria-expanded","onClick"])]),_:2},1032,["disabled"])]),_:1},8,["open","items"]))}}),Wy="_hint_14tm1_1",Hy={hint:Wy},Xy={$style:Hy},Yy=at(jy,[["__cssModules",Xy]]),Jy=Te({__name:"PresentationLiveKitMediaControl
187s",props:{backgroundImages:{},backgroundProcessorState:{},canPublishCamera:{type:Boolean},canPublishMicrophone:{type:Boolean},canPublishScreenShare:{type:Boolean},cameraCapabilityControls:{},cameraDevices:{},classes:{},controlButtonSize:{},controlButtonVariant:{},controlIconSize:{},isCameraEnabled:{type:Boolean},isCompactDesktop:{type:Boolean},isEndingMeeting:{type:Boolean},isMicrophoneEnabled:{type:Boolean},isMobileScreenShareActive:{type:Boolean},isMobileViewport:{type:Boolean},isScreenShareEnabled:{type:Boolean},mediaSettings:{},microphoneDevices:{},mobileScreenShareTooltipTitle:{},neutralThemeTransitionClass:{},settingsButtonSize:{},shouldRenderMeetingActions:{type:Boolean},cameraTooltipTitle:{},microphoneTooltipTitle:{},screenShareTooltipTitle:{}},emits:["delete-background-image","mobile-screen-share-click","open-mobile-leave","select-background-image","select-background-mode","toggle-camera","toggle-microphone","toggle-screen-share","update-camera-settings","update-microphone-settings","update-screen-share-settings","upload-background-file"],setup(e,{emit:t}){const n=t;return(i,a)=>(A(),$("div",{class:P(e.classes.mediaControls),"data-test":"presentation-livekit-media-controls"},[e.isMobileViewport&&e.shouldRenderMeetingActions?(A(),$("div",{key:0,class:P(e.classes.mobileMoreControl)},[Qs(i.$slots,"mobile-leading-action")],2)):re("",!0),F("div",{class:P([e.classes.mediaControlGroup,e.classes.microphoneControlGroup]),role:"group","aria-label":"Управление микрофоном"},[R(Ut,{title:e.microphoneTooltipTitle},{default:x(()=>[R(le,{"data-test":"presentation-livekit-microphone-control","data-mobile-meeting-control":e.isMobileViewport?"":void 0,background:e.isMobileViewport?"surface":"default","aria-label":e.microphoneTooltipTitle,variant:e.isMobileViewport&&e.isMicrophoneEnabled?"primary":e.controlButtonVariant,tone:e.isMobileViewport&&e.isMicrophoneEnabled?"success":"default",size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",shape:e.isMobileViewport?"circle":"default",disabled:!e.canPublishMicrophone,onClick:a[0]||(a[0]=r=>n("toggle-microphone"))},{default:x(()=>[e.isMicrophoneEnabled?(A(),B(b(qu),{key:0,class:P([e.neutralThemeTransitionClass,e.isMobileViewport?null:e.classes.mediaIconActive])},null,8,["class"])):(A(),B(b(o0),{key:1,class:P(e.neutralThemeTransitionClass)},null,8,["class"]))]),_:1},8,["data-mobile-meeting-control","background","aria-label","variant","tone","size","icon-size","shape","disabled"])]),_:1},8,["title"]),!e.isMobileViewport&&!e.isCompactDesktop?(A(),B(qy,{key:0,"button-size":e.settingsButtonSize,"button-icon-size":e.controlIconSize,"button-variant":e.controlButtonVariant,"microphone-devices":e.microphoneDevices,settings:e.mediaSettings,onUpdateMicrophoneSettings:a[1]||(a[1]=r=>n("update-microphone-settings",r))},null,8,["button-size","button-icon-size","button-variant","microphone-devices","settings"])):re("",!0)],2),!e.isCompactDesktop||e.isCameraEnabled?(A(),$("div",{key:1,class:P([e.classes.mediaControlGroup,e.classes.cameraControlGroup]),role:"group","aria-label":"Управление камерой"},[R(Ut,{title:e.cameraTooltipTitle},{default:x(()=>[R(le,{"data-test":"presentation-livekit-camera-control","data-mobile-meeting-control":e.isMobileViewport?"":void 0,background:e.isMobileViewport?"surface":"default","aria-label":e.cameraTooltipTitle,variant:e.isMobileViewport&&e.isCameraEnabled?"primary":e.controlButtonVariant,tone:e.isMobileViewport&&e.isCameraEnabled?"success":"default",size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",shape:e.isMobileViewport?"circle":"default",disabled:!e.canPublishCamera,onClick:a[2]||(a[2]=r=>n("toggle-camera"))},{default:x(()=>[e.isCameraEnabled?(A(),B(b(Py),{key:0,class:P([e.neutralThemeTransitionClass,e.isMobileViewport?null:e.classes.mediaIconActive])},null,8,["class"])):(A(),B(b(Ey),{key:1,class:P(e.neutralThemeTransitionClass)},null,8,["class"]))]),_:1},8,["data-mobile-meeting-control","background","aria-label","variant","tone","size","icon-size","shape","disabled"])]),_:1},8,["title"]),!e.isMobileViewport&&!e.isCompactDesktop?(A(),B(Ky,{key:0,"background-images":e.backgroundImages,"background-processor-state":e.backgroundProcessorState,"button-size":e.settingsButtonSize,"button-icon-size":e.controlIconSize,"button-variant":e.controlButtonVariant,"camera-capability-controls":e.cameraCapabilityControl
187s,"camera-devices":e.cameraDevices,settings:e.mediaSettings,onDeleteBackgroundImage:a[3]||(a[3]=r=>n("delete-background-image",r)),onSelectBackgroundImage:a[4]||(a[4]=r=>n("select-background-image",r)),onSelectBackgroundMode:a[5]||(a[5]=r=>n("select-background-mode",r)),onUploadBackgroundFile:a[6]||(a[6]=r=>n("upload-background-file",r)),onUpdateCameraSettings:a[7]||(a[7]=r=>n("update-camera-settings",r))},null,8,["background-images","background-processor-state","button-size","button-icon-size","button-variant","camera-capability-controls","camera-devices","settings"])):re("",!0)],2)):re("",!0),!e.isMobileViewport&&(!e.isCompactDesktop||e.isScreenShareEnabled)?(A(),$("div",{key:2,class:P(e.classes.mediaControlGroup),role:"group","aria-label":"Управление демонстрацией экрана"},[R(Ut,{title:e.screenShareTooltipTitle},{default:x(()=>[R(le,{"data-test":"presentation-livekit-screen-share-control","aria-label":e.screenShareTooltipTitle,variant:e.controlButtonVariant,"icon-only":"",disabled:!e.canPublishScreenShare,onClick:a[8]||(a[8]=r=>n("toggle-screen-share"))},{default:x(()=>[e.isScreenShareEnabled?(A(),B(b(d0),{key:0,class:P([e.neutralThemeTransitionClass,e.classes.mediaIconActive]),"data-test":"presentation-livekit-screen-share-desktop-on-icon"},null,8,["class"])):(A(),B(b(ky),{key:1,class:P(e.neutralThemeTransitionClass),"data-test":"presentation-livekit-screen-share-desktop-off-icon"},null,8,["class"]))]),_:1},8,["aria-label","variant","disabled"])]),_:1},8,["title"]),e.isCompactDesktop?re("",!0):(A(),B(Yy,{key:0,"is-screen-share-enabled":e.isScreenShareEnabled,settings:e.mediaSettings.screenShare,onUpdateSettings:a[9]||(a[9]=r=>n("update-screen-share-settings",r))},null,8,["is-screen-share-enabled","settings"]))],2)):re("",!0),!e.isMobileViewport&&(!e.isCompactDesktop||e.isMobileScreenShareActive)?(A(),B(Ut,{key:3,title:e.mobileScreenShareTooltipTitle},{default:x(()=>[R(le,{"data-test":"presentation-livekit-mobile-screen-share-control","aria-label":e.mobileScreenShareTooltipTitle,variant:e.controlButtonVariant,size:e.controlButtonSize,"icon-only":"",disabled:!e.canPublishScreenShare,onClick:a[10]||(a[10]=r=>n("mobile-screen-share-click"))},{default:x(()=>[e.isMobileScreenShareActive?(A(),B(b(V4),{key:0,class:P([e.neutralThemeTransitionClass,e.classes.mediaIconActive]),"data-test":"presentation-livekit-screen-share-mobile-on-icon"},null,8,["class"])):(A(),B(b(G4),{key:1,class:P(e.neutralThemeTransitionClass),"data-test":"presentation-livekit-screen-share-mobile-off-icon"},null,8,["class"]))]),_:1},8,["aria-label","variant","size","disabled"])]),_:1},8,["title"])):re("",!0),e.isMobileViewport&&e.shouldRenderMeetingActions?(A(),$("div",{key:4,class:P(e.classes.mobileLeaveControl)},[R(Ut,{title:"Выйти"},{default:x(()=>[R(le,{"data-test":"presentation-livekit-mobile-leave-control","data-mobile-meeting-control":"","aria-label":"Выйти из встречи",background:"surface",variant:"ghost",tone:"danger",size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",shape:"circle",disabled:e.isEndingMeeting,onClick:a[11]||(a[11]=r=>n("open-mobile-leave"))},{default:x(()=>[R(b(Zs),{"aria-hidden":"true"})]),_:1},8,["size","icon-size","disabled"])]),_:1})],2)):re("",!0)],2))}}),Qy=Te({__name:"PresentationLiveKitMobileMoreControl",props:{backgroundImages:{},backgroundItemId:{},backgroundProcessorState:{},controlButtonSize:{},controlIconSize:{},isMenuOpen:{type:Boolean},mediaSettings:{},menuItems:{}},emits:["check-change","delete-background-image","range-change","select","select-background-image","select-background-mode","update:menu-open","upload-background-file"],setup(e,{emit:t}){const n=t,i=(r,o)=>{n("check-change",r,o)},a=(r,o)=>{n("range-change",r,o)};return(r,o)=>(A(),B(ta,{open:e.isMenuOpen,"aria-label":"Действия встречи",items:e.menuItems,placement:"top-start","submenu-width":"parent","onUpdate:open":o[4]||(o[4]=s=>n("update:menu-open",s)),onCheckChange:i,onRangeChange:a,onSelect:o[5]||(o[5]=s=>n("select",s))},{trigger:x(({toggleMenu:s})=>[R(le,{"data-test":"presentation-livekit-mobile-more-control","data-mobile-meeting-control":"","aria-label":"Ещё действия","aria-haspopup":"menu","aria-expanded":e.isMenuOpen,background:"surface",variant:"ghost",size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",shape:"circle",onClick:s},{default:x(()=>[R(b(a0),{"aria-hidden":"true"})]),_:1},8,["aria-expanded","size","icon-size","onClick"])]),submenu:x(({item:s})=>[s.id===e.backgroundItemId?(A(),B(j4,{key:0,"background-images":e.backgroundImages,"background-processor-state":e.backgroundProcessorState,settings:e.mediaSettings,onDeleteBackgroun
187dImage:o[0]||(o[0]=l=>n("delete-background-image",l)),onSelectBackgroundImage:o[1]||(o[1]=l=>n("select-background-image",l)),onSelectBackgroundMode:o[2]||(o[2]=l=>n("select-background-mode",l)),onUploadBackgroundFile:o[3]||(o[3]=l=>n("upload-background-file",l))},null,8,["background-images","background-processor-state","settings"])):re("",!0)]),_:1},8,["open","items"]))}}),Zy=["data-tone"],eS=Te({__name:"PresentationLiveKitMobileTopBar",props:{classes:{},controlButtonSize:{},controlIconSize:{},durationClasses:{},meetingDurationLabel:{},meetingDurationTone:{}},emits:["minimize"],setup(e,{emit:t}){const n=t;return(i,a)=>(A(),$("div",{class:P(e.classes.mobileTopBar),"data-test":"presentation-livekit-mobile-top-bar"},[F("div",{class:P(e.classes.mobileTopBack)},[R(le,{"data-test":"presentation-livekit-mobile-minimize-control","aria-label":"Свернуть конференцию",background:"blur",variant:"ghost",size:e.controlButtonSize,"icon-size":e.controlIconSize,"icon-only":"",onClick:a[0]||(a[0]=r=>n("minimize"))},{default:x(()=>[R(b(Dg),{"aria-hidden":"true"})]),_:1},8,["size","icon-size"])],2),e.meetingDurationLabel?(A(),$("span",{key:0,class:P(e.durationClasses),"data-test":"presentation-livekit-meeting-duration","data-tone":e.meetingDurationTone},ct(e.meetingDurationLabel),11,Zy)):re("",!0)],2))}}),tS=["data-compact"],ds="ds-state-transition-target",nS=Te({__name:"PresentationLiveKitControls",props:{audioOutputDevices:{default:()=>[]},backgroundImages:{default:()=>[]},backgroundProcessorState:{default:()=>Ys()},canEndMeeting:{type:Boolean},canPublishCamera:{type:Boolean},canPublishMicrophone:{type:Boolean},canPublishScreenShare:{type:Boolean},canSelectAudioOutput:{type:Boolean,default:!1},cameraCapabilityControls:{default:()=>[]},cameraDevices:{default:()=>[]},compact:{type:Boolean,default:!1},inviteRecipientPeerGuids:{default:()=>[]},inviteUrl:{default:null},isCameraEnabled:{type:Boolean},isEndingMeeting:{type:Boolean},isMicrophoneEnabled:{type:Boolean},isMobileScreenShareActive:{type:Boolean},isRecordingActive:{type:Boolean,default:!1},isRecordingLoading:{type:Boolean,default:!1},isScreenShareEnabled:{type:Boolean},leaveControlLabel:{default:"Выйти"},mediaSettings:{default:()=>Lo()},meetingAudioVolume:{default:100},meetingDurationLabel:{default:null},meetingDurationTone:{default:"default"},meetingDurationTooltipTitle:{default:null},microphoneDevices:{default:()=>[]},participantCount:{default:1},participantNames:{default:()=>[]},section:{}},emits:["delete-background-image","disconnect-phone","end","leave","minimize","connect-phone","confirm-end","select-background-image","select-background-mode","toggle-camera","toggle-microphone","toggle-recording","toggle-screen-share","upload-background-file","update-audio-output-device","update-microphone-settings","update-camera-settings","update-screen-share-settings","update:meeting-audio-volume"],setup(e,{emit:t}){const{audioOutput:n,cameraCapabilitySelect:i,cameraDevice:a,cameraFacingMode:r,cameraFrameRate:o,cameraResolution:s,microphoneDevice:l,voiceProcessing:u}=Sn,c=e,m=Rr(),f=W1(),h=D(!1),d=D(!1),y=D(!1),S=Ai(),p=g(()=>c.compact&&!S.value),v=g(()=>S.value?"mobile":"default"),_=g(()=>"ghost"),T=g(()=>S.value?"default":void 0),w=g(()=>S.value?"mobile":"small"),E=t,M=g(()=>c.isMicrophoneEnabled?"Выключить микрофон":"Включить микрофон"),k=g(()=>c.isCameraEnabled?"Выключить камеру":"Включить камеру"),C=g(()=>c.isScreenShareEnabled?"Остановить демонстрацию экрана":"Запустить демонстрацию экрана"),O=g(()=>c.isMobileScreenShareActive?"Выключить трансляцию экрана телефона":"Запустить трансляцию экрана телефона"),L=g(()=>c.isRecordingActive?"Остановить запись встречи":"Запустить запись встречи"),oe=g(()=>c.section??"all"),ce=g(()=>oe.value==="all"||oe.value==="media"),ue=g(()=>oe.value==="all"||oe.value==="actions"),je=[ds,"text-subhead-regular",m.meetingDuration],V=g(()=>Math.max(0,c.participantCount)),N=g(()=>el(V.value,{maximumFractionDigits:0})),se=g(()=>`Участников в презентации: ${N.value}`),te=g(()=>[ds,"text-subhead-regular",m.participantCount]),Ze=g(()=>[{id:"mute-non-moderators",label:"Выключить микрофон у всех кроме админов",icon:o0,disabled:!f?.canMuteNonModerators.value||f.isMutingNonModerators.value}]),et=g(()=>({audioOutputDevices:c.audioOutputDevices,canEndMeeting:c.canEndMeeting,canMuteParticipants:!!f?.canMuteParticipants.value,canSelectAudioOutput:c.canSelectAudioOutput,classes:m,controlButtonSize:v.value,controlButtonVariant:_.value,controlIconSize:T.value,durationClasses:je,inviteRecipientPeerGuids:c.inviteRecipientPeerGuids,inviteUrl:c.inviteUrl,isCompactDesktop:p.value,isEndingMeeting:c.isEndingMeeting,isParticipantMenuOpen:h.value,isRecordingActive:c.isRecordingActive,isRecordingLoading:c.isRecordingLoading,leaveC
187ontrolLabel:c.leaveControlLabel,mediaSettings:c.mediaSettings,meetingAudioVolume:c.meetingAudioVolume,meetingDurationLabel:c.meetingDurationLabel,meetingDurationTone:c.meetingDurationTone,meetingDurationTooltipTitle:c.meetingDurationTooltipTitle,neutralThemeTransitionClass:ds,participantCountAriaLabel:se.value,participantCountClasses:te.value,participantCountLabel:N.value,participantMenuItems:Ze.value,recordingTooltipTitle:L.value,settingsButtonSize:w.value,shouldRenderMeetingActions:ue.value,shouldRenderMediaControls:ce.value})),Kt=ie=>{ie==="mute-non-moderators"&&f?.muteNonModerators()},{copyInviteUrl:vt,mobileMoreMenuItems:q,sendInviteUrlToChat:Me}=oy(c,{mobileScreenShareTooltipTitle:O,participantMenuItems:g(()=>f?.canMuteParticipants.value?Ze.value:[]),recordingTooltipTitle:L}),wt=ie=>c.cameraCapabilityControls.some(I=>I.key===ie),qt=(ie,I)=>{E("update-camera-settings",{advancedConstraints:{...c.mediaSettings.camera.advancedConstraints,[ie]:I}})},Et=ie=>{if(ie==="toggle-recording"){E("toggle-recording");return}if(ie==="mute-non-moderators"){Kt(ie);return}if(ie==="toggle-mobile-screen-share"){Ii();return}if(ie==="copy-link"){vt();return}if(ie==="send-to-chat"){Me();return}if(ie.startsWith(n)){const I=ie.slice(n.length);E("update-audio-output-device",I===En?"":I);return}if(ie.startsWith(l)){const I=ie.slice(l.length);E("update-microphone-settings",{deviceId:I===En?void 0:I});return}if(ie.startsWith(u)){const I=ie.slice(u.length);I in Bu&&E("update-microphone-settings",{noiseSuppression:I==="noise-suppression",voiceIsolation:I==="voice-isolation"});return}if(ie.startsWith(i)){const I=ie.slice(i.length),Z=I.indexOf(":"),Li=I.slice(0,Z),Ri=I.slice(Z+1);Z>0&&wt(Li)&&qt(Li,decodeURIComponent(Ri));return}if(ie.startsWith(a)){const I=ie.slice(a.length);E("update-camera-settings",{deviceId:I===En?void 0:I});return}if(ie.startsWith(s)){const I=ie.slice(s.length);I in xu&&E("update-camera-settings",{resolution:I});return}if(ie.startsWith(o)){const I=Number(ie.slice(o.length));To.some(Z=>Z===I)&&E("update-camera-settings",{frameRate:I});return}if(ie.startsWith(r)){const I=ie.slice(r.length);(I==="environment"||I==="user")&&E("update-camera-settings",{facingMode:I})}},Ot=()=>{y.value=!1,E("leave")},la=()=>{y.value=!1,E("confirm-end")},_i=(ie,I)=>{if(ie==="echo-cancellation"){E("update-microphone-settings",{echoCancellation:I});return}if(ie==="auto-gain-control"){E("update-microphone-settings",{autoGainControl:I});return}wt(ie)&&qt(ie,I)},Ci=(ie,I)=>{if(ie==="volume"){E("update:meeting-audio-volume",Xo(I));return}wt(ie)&&qt(ie,I)},Ii=()=>{if(c.isMobileScreenShareActive){E("disconnect-phone");return}E("connect-phone")};return(ie,I)=>(A(),$("div",{class:P(ie.$style.controls),"data-compact":p.value?"true":"false"},[b(S)&&ue.value?(A(),B(eS,{key:0,classes:ie.$style,"control-button-size":v.value,"control-icon-size":T.value,"duration-classes":je,"meeting-duration-label":e.meetingDurationLabel,"meeting-duration-tone":e.meetingDurationTone,onMinimize:I[0]||(I[0]=Z=>E("minimize"))},null,8,["classes","control-button-size","control-icon-size","meeting-duration-label","meeting-duration-tone"])):re("",!0),b(S)?re("",!0):(A(),B(x3,a2({key:1},et.value,{section:"context",onParticipantMenuSelect:Kt,onToggleRecording:I[1]||(I[1]=Z=>E("toggle-recording")),"onUpdate:participantMenuOpen":I[2]||(I[2]=Z=>h.value=Z)}),null,16)),ce.value?(A(),B(Jy,{key:2,"background-images":e.backgroundImages,"background-processor-state":e.backgroundProcessorState,"can-publish-camera":e.canPublishCamera,"can-publish-microphone":e.canPublishMicrophone,"can-publish-screen-share":e.canPublishScreenShare,"camera-capability-controls":e.cameraCapabilityControls,"camera-devices":e.cameraDevices,"camera-tooltip-title":k.value,classes:ie.$style,"control-button-size":v.value,"control-button-variant":_.value,"control-icon-size":T.value,"is-camera-enabled":e.isCameraEnabled,"is-compact-desktop":p.value,"is-ending-meeting":e.isEndingMeeting,"is-microphone-enabled":e.isMicrophoneEnabled,"is-mobile-screen-share-active":e.isMobileScreenShareActive,"is-mobile-viewport":b(S),"is-screen-share-enabled":e.isScreenShareEnabled,"media-settings":e.mediaSettings,"microphone-devices":e.microphoneDevices,"microphone-tooltip-title":M.value,"mobile-screen-share-tooltip-title":O.value,"neutral-theme-transition-class":ds,"screen-share-tooltip-title":C.value,"settings-button-size":w.value,"should-render-meeting-actions":ue.value,onDeleteBackgroun
187dImage:I[8]||(I[8]=Z=>E("delete-background-image",Z)),onMobileScreenShareClick:Ii,onOpenMobileLeave:I[9]||(I[9]=Z=>y.value=!0),onSelectBackgroundImage:I[10]||(I[10]=Z=>E("select-background-image",Z)),onSelectBackgroundMode:I[11]||(I[11]=Z=>E("select-background-mode",Z)),onToggleCamera:I[12]||(I[12]=Z=>E("toggle-camera")),onToggleMicrophone:I[13]||(I[13]=Z=>E("toggle-microphone")),onToggleScreenShare:I[14]||(I[14]=Z=>E("toggle-screen-share")),onUpdateCameraSettings:I[15]||(I[15]=Z=>E("update-camera-settings",Z)),onUpdateMicrophoneSettings:I[16]||(I[16]=Z=>E("update-microphone-settings",Z)),onUpdateScreenShareSettings:I[17]||(I[17]=Z=>E("update-screen-share-settings",Z)),onUploadBackgroundFile:I[18]||(I[18]=Z=>E("upload-background-file",Z))},{"mobile-leading-action":x(()=>[R(Qy,{"is-menu-open":d.value,"background-images":e.backgroundImages,"background-item-id":b(q4),"background-processor-state":e.backgroundProcessorState,"control-button-size":v.value,"control-icon-size":T.value,"media-settings":e.mediaSettings,"menu-items":b(q),"onUpdate:menuOpen":I[3]||(I[3]=Z=>d.value=Z),onCheckChange:_i,onDeleteBackgroundImage:I[4]||(I[4]=Z=>E("delete-background-image",Z)),onRangeChange:Ci,onSelect:Et,onSelectBackgroundImage:I[5]||(I[5]=Z=>E("select-background-image",Z)),onSelectBackgroundMode:I[6]||(I[6]=Z=>E("select-background-mode",Z)),onUploadBackgroundFile:I[7]||(I[7]=Z=>E("upload-background-file",Z))},null,8,["is-menu-open","background-images","background-item-id","background-processor-state","control-button-size","control-icon-size","media-settings","menu-items"])]),_:1},8,["background-images","background-processor-state","can-publish-camera","can-publish-microphone","can-publish-screen-share","camera-capability-controls","camera-devices","camera-tooltip-title","classes","control-button-size","control-button-variant","control-icon-size","is-camera-enabled","is-compact-desktop","is-ending-meeting","is-microphone-enabled","is-mobile-screen-share-active","is-mobile-viewport","is-screen-share-enabled","media-settings","microphone-devices","microphone-tooltip-title","mobile-screen-share-tooltip-title","screen-share-tooltip-title","settings-button-size","should-render-meeting-actions"])):re("",!0),b(S)?re("",!0):(A(),B(x3,a2({key:3},et.value,{section:"actions",onEnd:I[19]||(I[19]=Z=>E("end")),onLeave:I[20]||(I[20]=Z=>E("leave")),"onUpdate:audioOutputDevice":I[21]||(I[21]=Z=>E("update-audio-output-device",Z)),"onUpdate:meetingAudioVolume":I[22]||(I[22]=Z=>E("update:meeting-audio-volume",Z))}),null,16)),b(S)?(A(),B(by,{key:4,"can-end-meeting":e.canEndMeeting,"is-pending":e.isEndingMeeting,open:y.value,onClose:I[23]||(I[23]=Z=>y.value=!1),onEnd:la,onLeave:Ot},null,8,["can-end-meeting","is-pending","open"])):re("",!0)],10,tS))}}),iS="_controls_ycqab_1",aS="_mediaControls_ycqab_5",rS="_mediaControlGroup_ycqab_13",oS="_recordingControl_ycqab_20",sS="_mediaIconActive_ycqab_30",lS="_recordingIconActive_ycqab_34",cS="_recordingPulseDot_ycqab_42",uS="_meetingContext_ycqab_65",dS="_meetingActions_ycqab_72",hS="_meetingDuration_ycqab_79",mS="_participantCount_ycqab_86",fS="_participantCountIcon_ycqab_96",pS="_meetingMeta_ycqab_102",gS="_meetingCommands_ycqab_103",vS="_mobileMoreControl_ycqab_137",bS="_cameraControlGroup_ycqab_140",yS="_microphoneControlGroup_ycqab_143",SS="_mobileLeaveControl_ycqab_146",kS="_mobileTopBar_ycqab_149",wS="_mobileTopBack_ycqab_164",TS={controls:iS,mediaControls:aS,mediaControlGroup:rS,recordingControl:oS,mediaIconActive:sS,recordingIconActive:lS,recordingPulseDot:cS,"presentation-livekit-recording-pulse":"_presentation-livekit-recording-pulse_ycqab_1",meetingContext:uS,meetingActions:dS,meetingDuration:hS,participantCount:mS,participantCountIcon:fS,meetingMeta:pS,meetingCommands:gS,mobileMoreControl:vS,cameraControlGroup:bS,microphoneControlGroup:yS,mobileLeaveControl:SS,mobileTopBar:kS,mobileTopBack:wS},ES={$style:TS},MS=at(nS,[["__cssModules",ES]]),AS="_surface_i58dp_1",PS={surface:AS},_S={};function CS(e,t){return A(),$("div",{class:P([e.$style.surface,"ds-state-transition-target"])},[Qs(e.$slots,"default")],2)}const IS={$style:PS},LS=at(_S,[["render",CS],["__cssModules",IS]]),RS={class:"text-subhead-medium"},$S=Te({__name:"PresentationLiveKitMobileMinimizedBar",props:{canToggleMicrophone:{type:Boolean},isMicrophoneEnabled:{type:Boolean},participantCount:{}},emits:["restore","toggle-microphone"],setup(e,{emit:t}){const n=e,i=t,a=g(()=>el(Math.max(0,n.participantCount),{maximumFractionDigits:0})),r=g(()=>`Вернуться в трансляцию. Участников: ${a.value}`),o=g(()=>n.isMicrophoneEnabled?"Выключить микрофон":"Включить микрофон");return(s,l)=>(A(),B(sv,{ariaLabel:r.value,"is-microphone-enabled":n.isMicrophoneEnabled,"is-microphone-toggle-disabled":!n.canToggleMicrophone,"microphone-aria-label":o.value,"data-test":"presentation-livekit-mobile-minimized-bar",onActivate:l[0]||(l[0]=u=>i("restore")),onToggleMicrophone:l[1]||(l[1]=u=>i("toggle-microphone"))},{default:x(()=>[R(b(Ou),{"aria-hidden":"true"}),F("span",RS,ct(a.value),1)]),_:1},8,["ariaLabel","is-microphone-enabled","is-microphone-toggle-disabled","microphone-aria-label"]))}}
187),FS=["data-layout"],O3="#presentation-livekit-global-controls-outlet",DS=Te({__name:"PresentationLiveKitGlobalControls",props:{audioOutputDevices:{default:()=>[]},backgroundImages:{default:()=>[]},backgroundProcessorState:{default:()=>Ys()},canEndMeeting:{type:Boolean},canPublishCamera:{type:Boolean},canPublishMicrophone:{type:Boolean},canPublishScreenShare:{type:Boolean},canSelectAudioOutput:{type:Boolean,default:!1},cameraCapabilityControls:{default:()=>[]},cameraDevices:{default:()=>[]},isCameraEnabled:{type:Boolean},isEndingMeeting:{type:Boolean},isMicrophoneEnabled:{type:Boolean},isMobileScreenShareActive:{type:Boolean},isRecordingActive:{type:Boolean},isRecordingLoading:{type:Boolean},isScreenShareEnabled:{type:Boolean},isLiveMeetingRoute:{type:Boolean,default:!0},inviteRecipientPeerGuids:{default:()=>[]},inviteUrl:{},leaveControlLabel:{},meetingAudioVolume:{},mediaSettings:{default:()=>Lo()},meetingDurationLabel:{},meetingDurationTone:{},meetingDurationTooltipTitle:{},open:{type:Boolean},participantCount:{},participantNames:{default:()=>[]},microphoneDevices:{default:()=>[]},shouldRenderCollapsedCameraPreviews:{type:Boolean},floatingCameraTiles:{}},emits:["connect-phone","confirm-end","delete-background-image","disconnect-phone","end","leave","minimize","select-background-image","select-background-mode","restore-camera-stack","toggle-recording","toggle-camera","toggle-microphone","toggle-screen-share","upload-background-file","update-audio-output-device","update-microphone-settings","update-camera-settings","update-screen-share-settings","update:meeting-audio-volume"],setup(e,{emit:t}){Og(f=>({v030f90b0:b(c),v5da8eb76:b(m)}));const n=e,i=t,a=D(null),r=Ai(),o=D(!1),s=()=>{o.value=typeof document<"u"&&document.querySelector(O3)!==null},l=g(()=>n.isLiveMeetingRoute&&!r.value&&o.value),u=g(()=>l.value?O3:"body");Oa(s),Ie([()=>n.isLiveMeetingRoute,r],()=>{Ku(s)});const{collapsedPreviewLeft:c,collapsedPreviewWidth:m}=zb({globalControlsRef:a});return(f,h)=>(A(),$(an,null,[e.open&&b(r)&&!e.isLiveMeetingRoute?(A(),B(bs,{key:0,to:"#mobile-active-session-bar-outlet"},[R($S,{"can-toggle-microphone":e.canPublishMicrophone,"is-microphone-enabled":e.isMicrophoneEnabled,"participant-count":e.participantCount,onRestore:h[0]||(h[0]=d=>i("leave")),onToggleMicrophone:h[1]||(h[1]=d=>i("toggle-microphone"))},null,8,["can-toggle-microphone","is-microphone-enabled","participant-count"])])):re("",!0),e.open?(A(),B(bs,{key:1,to:u.value},[!b(r)||e.isLiveMeetingRoute?(A(),$("div",{key:0,ref_key:"globalControlsRef",ref:a,class:P([f.$style.globalControls,e.isLiveMeetingRoute?f.$style.globalControlsInMeetingPage:void 0,l.value?f.$style.globalControlsInPageHeader:void 0]),"data-layout":e.isLiveMeetingRoute?"meeting-page":"app-header","data-toast-offset-anchor":"top","data-test":"presentation-livekit-global-controls"},[R(LS,null,{default:x(()=>[R(MS,{"audio-output-devices":e.audioOutputDevices,"background-images":e.backgroundImages,"background-processor-state":e.backgroundProcessorState,"can-end-meeting":e.canEndMeeting,"can-publish-camera":e.canPublishCamera,"can-publish-microphone":e.canPublishMicrophone,"can-publish-screen-share":e.canPublishScreenShare,"can-select-audio-output":e.canSelectAudioOutput,"camera-capability-controls":e.cameraCapabilityControls,"camera-devices":e.cameraDevices,compact:!e.isLiveMeetingRoute,"is-camera-enabled":e.isCameraEnabled,"is-ending-meeting":e.isEndingMeeting,"is-microphone-enabled":e.isMicrophoneEnabled,"is-mobile-screen-share-active":e.isMobileScreenShareActive,"is-recording-active":e.isRecordingActive,"is-recording-loading":e.isRecordingLoading,"is-screen-share-enabled":e.isScreenShareEnabled,"invite-recipient-peer-guids":e.inviteRecipientPeerGuids,"invite-url":e.inviteUrl,"leave-control-label":e.leaveControlLabel,"meeting-duration-label":e.meetingDurationLabel,"meeting-duration-tone":e.meetingDurationTone,"meeting-duration-tooltip-title":e.meetingDurationTooltipTitle,"meeting-audio-volume":e.meetingAudioVolume,"media-settings":e.mediaSettings,"microphone-devices":e.microphoneDevices,"participant-count":e.participantCount,"participant-names":e.participantNames,section:"all",onConnectPhone:h[2]||(h[2]=d=>i("connect-phone")),onConfirmEnd:h[3]||(h[3]=d=>
187i("confirm-end")),onDeleteBackgroundImage:h[4]||(h[4]=d=>i("delete-background-image",d)),onDisconnectPhone:h[5]||(h[5]=d=>i("disconnect-phone")),onEnd:h[6]||(h[6]=d=>i("end")),onLeave:h[7]||(h[7]=d=>i("leave")),onMinimize:h[8]||(h[8]=d=>i("minimize")),onSelectBackgroundImage:h[9]||(h[9]=d=>i("select-background-image",d)),onSelectBackgroundMode:h[10]||(h[10]=d=>i("select-background-mode",d)),onToggleRecording:h[11]||(h[11]=d=>i("toggle-recording")),onToggleCamera:h[12]||(h[12]=d=>i("toggle-camera")),onToggleMicrophone:h[13]||(h[13]=d=>i("toggle-microphone")),onToggleScreenShare:h[14]||(h[14]=d=>i("toggle-screen-share")),onUploadBackgroundFile:h[15]||(h[15]=d=>i("upload-background-file",d)),onUpdateAudioOutputDevice:h[16]||(h[16]=d=>i("update-audio-output-device",d)),onUpdateMicrophoneSettings:h[17]||(h[17]=d=>i("update-microphone-settings",d)),onUpdateCameraSettings:h[18]||(h[18]=d=>i("update-camera-settings",d)),onUpdateScreenShareSettings:h[19]||(h[19]=d=>i("update-screen-share-settings",d)),"onUpdate:meetingAudioVolume":h[20]||(h[20]=d=>i("update:meeting-audio-volume",d))},null,8,["audio-output-devices","background-images","background-processor-state","can-end-meeting","can-publish-camera","can-publish-microphone","can-publish-screen-share","can-select-audio-output","camera-capability-controls","camera-devices","compact","is-camera-enabled","is-ending-meeting","is-microphone-enabled","is-mobile-screen-share-active","is-recording-active","is-recording-loading","is-screen-share-enabled","invite-recipient-peer-guids","invite-url","leave-control-label","meeting-duration-label","meeting-duration-tone","meeting-duration-tooltip-title","meeting-audio-volume","media-settings","microphone-devices","participant-count","participant-names"])]),_:1})],10,FS)):re("",!0)],8,["to"])):re("",!0),e.open?(A(),B(bs,{key:2,to:"body"},[e.shouldRenderCollapsedCameraPreviews?(A(),B(K9,{key:0,class:P(f.$style.collapsedCameraPreviewStrip),tiles:e.floatingCameraTiles,onRestore:h[21]||(h[21]=d=>i("restore-camera-stack"))},null,8,["class","tiles"])):re("",!0)])):re("",!0)],64))}}),xS="_globalControls_1xont_1",BS="_globalControlsInMeetingPage_1xont_9",OS="_globalControlsInPageHeader_1xont_13",US="_collapsedCameraPreviewStrip_1xont_23",NS={globalControls:xS,globalControlsInMeetingPage:BS,globalControlsInPageHeader:OS,collapsedCameraPreviewStrip:US},GS={$style:NS},VS=at(DS,[["__cssModules",GS]]),zS=["src"],KS=1e3,U3=60,N3=3600,qS=Te({__name:"PresentationLiveKitMobilePairingModal",props:{currentTimeMs:{},errorText:{},isConnected:{type:Boolean},isCreating:{type:Boolean},isRevoking:{type:Boolean},open:{type:Boolean},pairing:{}},emits:["close","refresh"],setup(e,{emit:t}){const n=e,i=t,{isDark:a}=h0(),r=T=>{const w=T%U3,E=Math.floor(T%N3/U3),M=Math.floor(T/N3);return[M>0?String(M):null,String(E).padStart(2,"0"),String(w).padStart(2,"0")].filter(C=>C!==null).join(":")},o=D(Date.now());let s=null;const l=g(()=>n.currentTimeMs??o.value),u=g(()=>{if(!n.pairing)return null;const T=Date.parse(n.pairing.expiresAt);return Number.isNaN(T)?null:T}),c=g(()=>u.value!==null&&l.value>=u.value),m=g(()=>u.value===null?0:Math.max(0,Math.ceil((u.value-l.value)/1e3))),f=g(()=>r(m.value)),h=g(()=>n.isConnected?"Телефон подключён":"Отсканируйте QR на мобильном устройстве, чтобы начать трансляцию"),d=g(()=>n.isConnected?"Экран телефона появится в комнате после запуска трансляции на мобильном устройстве.":f.value),y=D(null),S=D(null),p=g(()=>a.value?"dark":"light"),v=async()=>{const T=n.pairing;if(!T){y.value=null;return}const w=T.deepLink,E=p.value,M=await lv(w,E);n.pairing?.deepLink===w&&p.value===E&&(y.value=M)},_=()=>{s&&(clearInterval(s),s=null)};return Ie(()=>[n.open,n.currentTimeMs],([T,w])=>{_(),T&&w===void 0&&(o.value=Date.now(),s=setInterval(()=>{o.value=Date.now()},KS))},{immediate:!0}),Ie(()=>[n.pairing?.deepLink??null,p.value],()=>{v()},{immediate:!0}),Ie(()=>[n.open,n.pairing?.pairingId??null,c.value,n.isConnected,n.isCreating,n.isRevoking],([T,w,E,M,k,C])=>{(!w||S.value!==w)&&(S.value=null),!(!T||!w||!E||M||k||C||S.value===w)&&(S.value=w,i("refresh"))},{immediate:!0}),Lt(_),(T,w)=>(A(),B(Vu,{open:e.open,width:420,onClose:w[0]||(w[0]=E=>i("close")),"onUpdate:open":w[1]||(w[1]=E=>!E&&i("close"))},{default:x(()=>[F("div",{class:P(T.$style.content)},[e.isCreating?(A(),$("div",{key:0,class:P(T.$style.skeleton),"aria-busy":"true","data-test":"presentation-livekit-mobile-creating"},[F("div",{class:P(T.$style.skeletonQrFrame)},[F("span",{class:P(["ds-skeleton-block",T.$style.skeletonQr]),"data-test":"presentation-livekit-mobile-qr-skeleton"},null,2)],2),F("div",{class:P(T.$style.skeletonCopy)},[F("span",{class:P(["ds-skeleton-block",T.$style.skeletonTitle])},null,2),F("span",{class:P(["ds-skeleton-block",T.$style.skeletonTitleShort])},null,2),F("span",{class:P(["ds-skeleton-block",T.$style.skeletonTimer])},null,2)],2)],2)):e.errorText?(A(),$("div",{key:1,class:P(T.$style.state),"data-test":"presentation-livekit-mobile-error"},[F("p",{class:P(["text-body-medium",T.$style.title])}," Не удалось подготовить QR ",2),F("p",{class:P(["text-body-regular",T.$style.text])},ct(e.errorText),3)],2)):e.pairing?(A(),$(an,{key:2},[F("div",{class:P(T.$style.qrFrame)},[y.value&&!c.value?(A(),$("img",{key:0,class:P(T.$style.qrImage),src:y.value,alt:"QR для подключения телефона","data-test":"presentation-livekit-mobile-qr"},null,10,zS)):(A(),$("div",{key:1,class:P(T.$style.expiredState),"data-test":"presentation-livekit-mobile-expired"},[R(tv)],2))],2),F("div",{class:P(T.$style.copy)},[F("p",{class:P(["text-body-medium",T.$style.title])},ct(h.value),3),F("p",{class:P(["text-body-regular",T.$style.text])},ct(d.value),3),e.isConnected?re("",!0):(A(),$("p",{key:0,class:P(["text-body-regular",T.$style.note])}," На мобильном устройстве должно быть установлено приложение 101 ",2))],2)],64)):re("",!0)],2)]),_:1},8,["open"]))}}),jS="_content_1nf75_1",WS="_state_1nf75_6",HS="_copy_1nf75_7",XS="_skeleton_1nf75_14",YS="_qrFrame_1nf75_20",JS="_skeletonQrFrame_1nf75_29",QS="_skeletonQr_1nf75_29",ZS="_skeletonCopy_1nf75_45",ek="_skeletonTitle_1nf75_52",tk="_skeletonTitleShort_1nf75_53",nk="_skeletonTimer_1nf75_66",ik="_qrImage_1nf75_72",ak="_expiredState_1nf75_78",rk="_title_1nf75_86",ok="_text_1nf75_87",sk="_note_1nf75_88",lk={content:jS,state:WS,copy:HS,skeleton:XS,qrFrame:YS,skeletonQrFrame:JS,skeletonQr:QS,skeletonCopy:ZS,skeletonTitle:ek,skeletonTitleShort:tk,skeletonTimer:nk,qrImage:ik,expiredState:ak,title:rk,text:ok,note:sk}
187,ck={$style:lk},uk=at(qS,[["__cssModules",ck]]),W4=e=>{const t=g(()=>e.localParticipantIdentity??e.localCamera?.participantIdentity??null),n=g(()=>new Map(e.screenShareSources.map(S=>[S.participantIdentity,S]))),i=g(()=>{const S=new Map(e.remoteCameras.map(M=>[M.participantIdentity,M])),p=(e.onlineParticipants??[]).filter(M=>M.identity!==t.value),v=new Set(p.map(M=>M.identity)),_=p.map(M=>{const k=S.get(M.identity),C=n.value.get(M.identity);return{avatarUrl:M.avatarUrl??k?.avatarUrl??C?.avatarUrl??null,chatPeerGuid:M.identity,displayName:M.name||k?.participantName||C?.participantName||"Участник",element:C?.element??k?.element??null,isCameraEnabled:!!C||k?.isCameraEnabled!==!1&&!!k,isLocal:!1,isMicrophoneEnabled:M.isMicrophoneEnabled??k?.isMicrophoneEnabled??!1,isModerator:M.isModerator,isSpeaking:e.activeSpeakerIdentities?.has(M.identity)??!1,participantIdentity:M.identity}}),T=new Set(e.remoteCameras.map(M=>M.participantIdentity)),w=e.remoteCameras.filter(M=>!v.has(M.participantIdentity)).map(M=>{const k=n.value.get(M.participantIdentity);return{avatarUrl:M.avatarUrl??k?.avatarUrl??null,chatPeerGuid:M.participantIdentity,displayName:M.participantName||k?.participantName||"Участник",element:k?.element??M.element,isCameraEnabled:!!k||M.isCameraEnabled!==!1,isLocal:!1,isMicrophoneEnabled:M.isMicrophoneEnabled,isModerator:!1,isSpeaking:e.activeSpeakerIdentities?.has(M.participantIdentity)??!1,participantIdentity:M.participantIdentity}}),E=e.screenShareSources.filter(M=>M.source!=="local_screen_share"&&M.participantIdentity!==t.value&&!v.has(M.participantIdentity)&&!T.has(M.participantIdentity)).map(M=>({avatarUrl:M.avatarUrl??null,chatPeerGuid:null,displayName:M.participantName||M.label,element:M.element,isCameraEnabled:!0,isLocal:!1,isMicrophoneEnabled:!1,isModerator:!1,isSpeaking:!1,participantIdentity:M.participantIdentity}));return[..._,...w,...E]}),a=g(()=>e.screenShareSources.find(S=>S.source==="local_screen_share"||S.participantIdentity===t.value)??null),r=g(()=>{const S=t.value,p=e.onlineParticipants?.find(v=>v.identity===S);return!S||!e.localCamera&&i.value.length===0&&e.screenShareSources.length===0?null:{avatarUrl:p?.avatarUrl??e.localCamera?.avatarUrl??null,chatPeerGuid:null,displayName:"Вы",element:a.value?.element??e.localCamera?.element??null,isCameraEnabled:!!(a.value??e.localCamera),isLocal:!0,isMicrophoneEnabled:e.isLocalMicrophoneEnabled??!1,isModerator:p?.isModerator??!1,isSpeaking:!1,participantIdentity:S,selfViewTestId:"presentation-livekit-self-view"}}),o=g(()=>new Set(e.screenShareSources.map(S=>S.participantIdentity))),s=S=>o.value.has(S.participantIdentity)||S.isLocal&&a.value?0:S.isCameraEnabled?1:2,l=S=>S.map((p,v)=>({index:v,tile:p})).sort((p,v)=>s(p.tile)-s(v.tile)||p.index-v.index).map(({tile:p})=>p),u=g(()=>{const S=[...i.value];return r.value&&S.push(r.value),l(S)}),c=g(()=>e.screenShareSources.length>0),m=g(()=>c.value||u.value.some(S=>S.isCameraEnabled)),f=g(()=>{if(c.value)return[];const S=u.value.filter(p=>!p.isLocal);return S.length>0?S:r.value?[r.value]:[]}),h=g(()=>c.value?u.value:i.value.length>0&&e.localCamera&&r.value?[r.value]:[]),d=g(()=>f.value.length>0),y=g(()=>h.value.length>0);return{cameraTiles:u,floatingCameraTiles:h,hasFloatingTiles:y,hasMainCameraTiles:d,hasScreenShareSources:c,hasVideoSources:m,mainCameraTiles:f}},dk=e=>{const t=D("presentation"),n=D(new Set),i=D(new Set);let a=new Set;const r=g(()=>t.value==="gallery"),o=g(()=>e.cameraTiles.value.filter(h=>n.value.has(h.participantIdentity))),s=g(()=>e.hasScreenShareSources.value||o.value.length>0?e.cameraTiles.value:e.floatingCameraTiles.value),l=g(()=>e.screenShareSources.value.filter(h=>i.value.has(h.participantIdentity))),u=g(()=>{if(r.value)return new Set;const h=new Set(i.value);return n.value.forEach(d=>h.add(d)),h}),c=()=>{n.value=new Set,i.value=new Set,t.value="gallery"},m=(h,d)=>{t.value=h.size===0&&d.size===0?"gallery":"presentation"},f=h=>{if(e.screenShareSources.value.some(y=>y.participantIdentity===h)){const y=new Set(i.value);y.has(h)?y.delete(h):y.add(h),i.value=y,m(y,n.value);return}if(!e.cameraTiles.value.some(y=>y.participantIdentity===h))return;const d=new Set(n.value);d.has(h)?d.delete(h):d.add(h),n.value=d,m(i.value,d)};return Ie(e.cameraTiles,h=>{const d=new Set(h.map(y=>y.participantIdentity));n.value=new Set([...n.value].filter(y=>d.has(y)))}),Ie(e.hasScreenShareSources,()=>{t.value="presentation"}),Ie(e.screenShareSources,h=>
187{const d=new Set(h.map(p=>p.participantIdentity)),y=new Set([...i.value].filter(p=>d.has(p)));let S=!1;d.forEach(p=>{a.has(p)||(y.add(p),S=!0)}),i.value=y,a=d,S&&(t.value="presentation")},{immediate:!0}),{isGalleryView:r,participantPanelTiles:s,selectedCameraTiles:o,selectedParticipantIdentities:u,selectParticipantTile:f,showGalleryView:c,visibleScreenShareSources:l}},tc=16/9,nc=9/16,Uu=1e-6,H4=(e,t,n)=>{const i=e.landscapeCount+e.portraitCount;return t*(e.landscapeCount*tc+e.portraitCount*nc)+Math.max(0,i-1)*n},hk=(e,t,n,i)=>{const a=n+i,r=e-Math.max(0,a-1)*t,o=n*tc+i*nc;return a<=0||r<=0||o<=0?0:r/o},mk=(e,t,n,i,a)=>{const r=e+t,o=n*tc+t,s=n*nc+t,l=r-i*o;return l<-Uu||s<=0?-1:Math.min(Math.max(0,a-i),Math.max(0,Math.floor((l+Uu)/s)))},hs=(e,t,n)=>e*(n+1)+t,Uc=(e,t,n,i,a,r,o,s=Number.POSITIVE_INFINITY)=>{const l=Array.from({length:a+1},(S,p)=>mk(e,t,n,p,s));let u=new Map([[hs(0,0,i),0]]),c=o?new Map([[hs(0,0,i),{portraitCapacity:0,previous:null,rowLandscapeCount:0}]]):null;for(let S=0;S<i;S+=1){const p=new Map,v=o?new Map:null;for(const[_,T]of u){const w=Math.floor(_/(i+1)),E=_%(i+1),M=c?.get(_)??null,k=a-w;for(let C=0;C<=Math.min(k,s);C+=1){const O=l[C]??-1,L=E+(C===0?1:0);if(O<(C===0?1:0)||L>r)continue;const oe=w+C,ce=T+O,ue=hs(oe,L,i),je=p.get(ue);je!==void 0&&je>=ce||(p.set(ue,ce),v?.set(ue,{portraitCapacity:ce,previous:M,rowLandscapeCount:C}))}}u=p,c=v}let m=null;for(let S=0;S<=Math.min(i,r);S+=1){const p=hs(a,S,i),v=u.get(p);if(v!==void 0&&v>=r){m=p;break}}if(m===null)return o?null:!1;if(!o)return!0;const f=[];let h=c?.get(m)??null;for(;h?.previous;)f.push(h.rowLandscapeCount),h=h.previous;f.sort((S,p)=>S-p);const d=f.map(S=>({landscapeCount:S,portraitCount:S===0?1:0}));let y=r-d.reduce((S,p)=>S+p.portraitCount,0);for(;y>0;){let S=-1,p=Number.POSITIVE_INFINITY;for(let v=0;v<d.length;v+=1){const _=d[v];if(!_)continue;const T=l[_.landscapeCount]??-1;if(_.portraitCount>=T)continue;const w=H4(_,n,t);w<p-Uu&&(S=v,p=w)}if(S<0||!d[S])return null;d[S].portraitCount+=1,y-=1}return d},fk=(e,t,n,i,a=Number.POSITIVE_INFINITY)=>{const r=new Set;for(let o=0;o<=n;o+=1)for(let s=0;s<=i;s+=1){const l=o+s;if(l===0||l>a)continue;const u=hk(e,t,o,s);u>0&&r.add(u)}return[...r].sort((o,s)=>o-s)},pk=1e-6,Nu=.01,ms=e=>Number.isFinite(e)?Math.max(0,e):0,gk=e=>e==="portrait"?nc:tc,vk=(e,t,n,i,a,r,o,s,l)=>{const u=(t-Math.max(0,a-1)*i)/a;if(u<=0)return null;let c=0;if(Uc(e,n,u,a,r,o,!1,l))c=u;else{let d=0,y=s.length-1;for(;d<=y;){const S=Math.floor((d+y)/2),p=s[S]??0;if(p>u+pk){y=S-1;continue}Uc(e,n,p,a,r,o,!1,l)?(c=p,d=S+1):y=S-1}}if(c<=0)return null;const m=Uc(e,n,c,a,r,o,!0,l);if(!Array.isArray(m))return null;const f=m.map(d=>H4(d,c,n)),h=f.length>0?Math.max(...f)-Math.min(...f):0;return{rowHeight:c,rowWidthSpread:h,rows:m}},bk=(e,t)=>{if(!t)return!0;if(Math.abs(e.rowHeight-t.rowHeight)>Nu)return e.rowHeight>t.rowHeight;if(e.rows.length!==t.rows.length)return e.rows.length<t.rows.length;if(Math.abs(e.rowWidthSpread-t.rowWidthSpread)>Nu)return e.rowWidthSpread<t.rowWidthSpread;const n=e.rows.map(a=>`${a.landscapeCount}:${a.portraitCount}`).join("|"),i=t.rows.map(a=>`${a.landscapeCount}:${a.portraitCount}`).join("|");return n<i},yk=e=>{const t=ms(e.containerWidth),n=ms(e.containerHeight),i=ms(e.columnGap),a=ms(e.rowGap),r=Math.max(1,Math.floor(e.maxItemsPerRow));if(e.items.length===0||t<=0||n<=0)return{rowHeight:0,rows:[]};const o=e.items.map((p,v)=>({...p,index:v})),s=o.filter(p=>p.orientation==="landscape"),l=o.filter(p=>p.orientation==="portrait"),u=fk(t,i,s.length,l.length,r);let c=null;for(let p=1;p<=e.items.length;p+=1){const v=(n-Math.max(0,p-1)*a)/p;if(c&&v<c.rowHeight-Nu)break;const _=vk(t,n,i,a,p,s.length,l.length,u,r);_&&bk(_,c)&&(c=_)}if(!c)return{rowHeight:0,rows:[]};let m=0,f=0;const h=s.length===0||l.length===0,d=Math.ceil(e.items.length/c.rows.length),S=(h?Array.from({length:c.rows.length},(p,v)=>{const _=Math.min(d,e.items.length-v*d);return{landscapeCount:s.length>0?_:0,portraitCount:l.length>0?_:0}}):[...c.rows].sort((p,v)=>v.landscapeCount+v.portraitCount-(p.landscapeCount+p.portraitCount))).map(p=>{const v=[...s.slice(m,m+p.landscapeCount),...l.slice(f,f+p.portraitCount)].sort((T,w)=>T.index-w.index);m+=p.landscapeCount,f+=p.portraitCount;const _=v.map(T=>{const w=gk(T.orientation);return{aspectRatio:w,id:T.id,width:c.rowHeight*w}});return{items:_,width:_.reduce((T,w)=>T+w.width,0)+Math.max(0,_.length-1)*i}});return{rowHeight:c.rowHeight,rows:S}},G3=Object.freeze({}),Sk=6,V3={columnGap:0,height:0,rowGap:0,width:0},rr=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?Math.max(0,t):0},kk=(e,t)=>{const n=e.getBoundingClientRect(),i=e.clientWidth||n.width,a=e.clientHeight||n.height,r=rr(t.paddingLeft)+rr(t.paddingRight),o=rr(t.paddingTop)+rr(t.paddingBottom);return{height:Math.max(0,a-o),width:Math.max(0,i-r)}},wk=(e,t,n)=>{const i=Math.max(0,...e.map(a=>a.width));return e.map(a=>{const r=a.items.flatMap(o=>{const s=n.get(o.id);return s?[{style:{width:`${o.width}px`},tile:s}]:[]});return{items:r,key:r.map(o=>o.tile.participantIdentity).join("|"),style:{height:`${t}px`,width:`${i}px`}}})},Tk=e=>{const t=D(V3);let n=null,i=null;const a=()=>{const l=e.gridElement.value;if(!l){t.value=V3;return}const u=window.getComputedStyle(l),c=kk(l,u);
187t.value={columnGap:rr(u.columnGap),height:c.height,rowGap:rr(u.rowGap),width:c.width}},r=()=>{n===null&&(n=window.requestAnimationFrame(()=>{n=null,a()}))};Ie(e.gridElement,(l,u)=>{i&&u&&i.unobserve(u),i&&l&&i.observe(l),r()}),Oa(()=>{typeof ResizeObserver=="function"&&(i=new ResizeObserver(r),e.gridElement.value&&i.observe(e.gridElement.value)),r()}),Lt(()=>{i?.disconnect(),i=null,n!==null&&(window.cancelAnimationFrame(n),n=null)});const o=g(()=>t.value.width>0&&t.value.height>0),s=g(()=>{if(!o.value)return e.tiles.value.length>0?[{items:e.tiles.value.map(c=>({style:G3,tile:c})),key:e.tiles.value.map(c=>c.participantIdentity).join("|"),style:G3}]:[];const l=new Map(e.tiles.value.map(c=>[c.participantIdentity,c])),u=yk({columnGap:t.value.columnGap,containerHeight:t.value.height,containerWidth:t.value.width,items:e.tiles.value.map(c=>({id:c.participantIdentity,orientation:"landscape"})),maxItemsPerRow:Sk,rowGap:t.value.rowGap});return wk(u.rows,u.rowHeight,l)});return{hasMeasuredGrid:o,renderRows:s}},Ek=["data-selected"],Mk=["aria-label","aria-pressed"],Ak=Te({__name:"PresentationLiveKitCameraTile",props:{avatarSize:{},selected:{type:Boolean,default:!1},showActions:{type:Boolean,default:!0},showSpeakingIndicator:{type:Boolean,default:!0},tile:{}},emits:["select"],setup(e,{emit:t}){const n=e,i=t;return(a,r)=>(A(),$("article",{class:P(n.selected&&a.$style.selectedTile),"data-selected":n.selected?"true":"false"},[F("button",{type:"button",class:P(a.$style.focusControl),"aria-label":`Показать крупно: ${n.tile.displayName}`,"aria-pressed":n.selected,"data-test":"presentation-livekit-camera-focus-control",onClick:r[0]||(r[0]=o=>i("select",n.tile.participantIdentity))},[R(Zl,{"avatar-size":n.avatarSize,tile:n.tile},{default:x(()=>[R(Js,{class:P(["text-footnote-regular",a.$style.cameraLabel]),"display-name":n.tile.displayName,"is-microphone-enabled":n.tile.isMicrophoneEnabled,"is-speaking":!!(n.showSpeakingIndicator&&n.tile.isSpeaking),"self-view-test-id":n.tile.selfViewTestId},null,8,["class","display-name","is-microphone-enabled","is-speaking","self-view-test-id"])]),_:1},8,["avatar-size","tile"])],10,Mk),n.showActions?(A(),B(ec,{key:0,"include-chat":"",tile:n.tile},null,8,["tile"])):re("",!0)],10,Ek))}}),Pk="_selectedTile_8z0uk_1",_k="_focusControl_8z0uk_15",Ck="_cameraLabel_8z0uk_36",Ik={selectedTile:Pk,focusControl:_k,cameraLabel:Ck},Lk={$style:Ik},X4=at(Ak,[["__cssModules",Lk]]),Rk=Te({__name:"PresentationLiveKitCameraGrid",props:{selectedParticipantIdentities:{},tiles:{}},emits:["select-tile"],setup(e,{emit:t}){const n=e,i=t,a=(u,c)=>{u.style.height=c.value.height??"",u.style.width=c.value.width??""},r={beforeMount:a,updated:a},o=dr("videoGridRef"),{hasMeasuredGrid:s,renderRows:l}=Tk({gridElement:o,tiles:Ug(n,"tiles")});return(u,c)=>(A(),$("div",{ref_key:"videoGridRef",ref:o,class:P([u.$style.videoGrid,!b(s)&&u.$style.videoGridFallback]),"data-test":"presentation-livekit-video-grid"},[(A(!0),$(an,null,ji(b(l),m=>r2((A(),$("div",{key:m.key,class:P([u.$style.videoRow,!b(s)&&u.$style.videoRowFallback]),"data-test":"presentation-livekit-video-row"},[(A(!0),$(an,null,ji(m.items,f=>r2((A(),B(X4,{key:f.tile.participantIdentity,class:P(u.$style.videoTile),"avatar-size":"large",selected:n.selectedParticipantIdentities?.has(f.tile.participantIdentity),tile:f.tile,"data-test":"presentation-livekit-video-tile",onSelect:c[0]||(c[0]=h=>i("select-tile",h))},null,8,["class","selected","tile"])),[[r,f.style]])),128))],2)),[[r,m.style]])),128))],2))}}),$k="_videoGrid_1e8g5_1",Fk="_videoGridFallback_1e8g5_11",Dk="_videoRow_1e8g5_19",xk="_videoRowFallback_1e8g5_28",Bk="_videoTile_1e8g5_32",Ok={videoGrid:$k,videoGridFallback:Fk,videoRow:Dk,videoRowFallback:xk,videoTile:Bk},Uk={$style:Ok},z3=at(Rk,[["__cssModules",Uk]]),K3=(e,t,n)=>Math.min(Math.max(e,t),n),Nk=({floatingStackRef:e,stageRef:t})=>{const n=D(null),i=D(null),a=g(()=>n.value?{"--floating-x":`${n.value.x}px`,"--floating-y":`${n.value.y}px`}:{}),r=(u,c)=>{const m=t.value,f=e.value,h=i.value;if(!m||!f||!h)return;const d=m.getBoundingClientRect(),y=f.getBoundingClientRect(),S=Math.max(d.width-y.width,0),p=Math.max(d.height-y.height,0);n.value={x:K3(u-d.left-h.x,0,S),y:K3(c-d.top-h.y,0,p)}},o=u=>{r(u.clientX,u.clientY)},s=()=>{i.value=null,window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",s)},l=u=>{const c=t.value,m=e.value;if(!c||!m)return;const f=c.getBoundingClientRect(),h=m.getBoundingClientRect();i.value={x:u.clientX-h.left,y:u.clientY-h.top}
187,n.value={x:h.left-f.left,y:h.top-f.top},u.currentTarget instanceof HTMLElement&&typeof u.currentTarget.setPointerCapture=="function"&&u.currentTarget.setPointerCapture(u.pointerId),window.addEventListener("pointermove",o),window.addEventListener("pointerup",s)};return Lt(()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",s)}),{floatingStackStyle:a,handleFloatingStackPointerDown:l,isFloatingStackMoved:g(()=>n.value!==null)}},Gk=["data-speaking","data-selected"],Vk=["aria-label","aria-pressed","onClick"],zk=["aria-label"],Kk=Te({__name:"PresentationLiveKitMobileParticipantList",props:{reserveBottomSpace:{type:Boolean,default:!0},selectedParticipantIdentities:{},tiles:{}},emits:["select-tile"],setup(e,{emit:t}){const n=e,i=t;return(a,r)=>(A(),$("ul",{class:P([a.$style.participantList,!n.reserveBottomSpace&&a.$style.participantListWithoutBottomReserve]),"aria-label":"Участники встречи","data-test":"presentation-livekit-mobile-participant-list"},[(A(!0),$(an,null,ji(n.tiles,o=>(A(),$("li",{key:o.participantIdentity,class:P([a.$style.participantRow,o.isSpeaking&&a.$style.participantRowSpeaking,n.selectedParticipantIdentities?.has(o.participantIdentity)&&a.$style.participantRowSelected]),"data-test":"presentation-livekit-mobile-participant-row","data-speaking":o.isSpeaking?"true":"false","data-selected":n.selectedParticipantIdentities?.has(o.participantIdentity)?"true":"false"},[F("button",{type:"button",class:P(a.$style.participantControl),"aria-label":`Показать крупно: ${o.displayName}`,"aria-pressed":n.selectedParticipantIdentities?.has(o.participantIdentity)??!1,onClick:s=>i("select-tile",o.participantIdentity)},[F("span",{class:P(a.$style.thumbnail)},[R(Zl,{"avatar-size":"small",compact:"","media-fit":"cover",tile:o},null,8,["tile"])],2),F("span",{class:P(["text-subhead-regular",a.$style.participantName])},ct(o.displayName),3),F("span",{class:P([a.$style.microphoneStatus,o.isMicrophoneEnabled?a.$style.microphoneStatusEnabled:a.$style.microphoneStatusDisabled,o.isSpeaking&&a.$style.microphoneStatusSpeaking]),"aria-label":o.isMicrophoneEnabled?"Микрофон включён":"Микрофон выключен",role:"img"},[o.isMicrophoneEnabled?(A(),B(b(qu),{key:0,class:P(a.$style.microphoneIcon),"aria-hidden":"true"},null,8,["class"])):(A(),B(b(Ql),{key:1,class:P(a.$style.microphoneIcon),"aria-hidden":"true"},null,8,["class"]))],10,zk)],10,Vk),R(ec,{"include-chat":"",tile:o,"without-background":""},null,8,["tile"])],10,Gk))),128))],2))}}),qk="_participantList_1u2vp_1",jk="_participantListWithoutBottomReserve_1u2vp_15",Wk="_participantRow_1u2vp_19",Hk="_participantRowSpeaking_1u2vp_29",Xk="_participantRowSelected_1u2vp_38",Yk="_participantControl_1u2vp_42",Jk="_thumbnail_1u2vp_66",Qk="_participantName_1u2vp_75",Zk="_microphoneStatus_1u2vp_82",ew="_microphoneIcon_1u2vp_89",tw="_microphoneStatusEnabled_1u2vp_94",nw="_microphoneStatusDisabled_1u2vp_98",iw="_microphoneStatusSpeaking_1u2vp_102",aw={participantList:qk,participantListWithoutBottomReserve:jk,participantRow:Wk,participantRowSpeaking:Hk,participantRowSelected:Xk,participantControl:Yk,thumbnail:Jk,participantName:Qk,microphoneStatus:Zk,microphoneIcon:ew,microphoneStatusEnabled:tw,microphoneStatusDisabled:nw,microphoneStatusSpeaking:iw},rw={$style:aw},Gu=at(Kk,[["__cssModules",rw]]),ow=["data-collapsed"],sw=Te({__name:"PresentationLiveKitFloatingStack",props:{collapsed:{type:Boolean},selectedParticipantIdentities:{},stageElement:{},tiles:{}},emits:["select-tile","show-gallery","update:collapsed"],setup(e,{emit:t}){const n=e,i=t,a=Rr(),r=Ai(),o=`presentation-livekit-participant-tiles-${Ng()}`,s=dr("floatingStackRef"),l=g(()=>n.stageElement??s.value?.closest('[data-test="presentation-livekit-stage"]')??null),{floatingStackStyle:u,handleFloatingStackPointerDown:c,isFloatingStackMoved:m}=Nk({floatingStackRef:s,stageRef:l}),f=g(()=>n.collapsed?n.tiles.map((w,E)=>({index:E,tile:w})).sort((w,E)=>Number(E.tile.isSpeaking)-Number(w.tile.isSpeaking)||w.index-E.index).map(({tile:w})=>w):n.tiles),h=g(()=>n.collapsed?r.value?[]:f.value.slice(0,1):f.value),d=g(()=>r.value?n.collapsed?"Показать список участников":"Скрыть список участников":n.collapsed?"Развернуть видео участников":"Свернуть видео участников"),y=g(()=>
187[a.floatingStack,n.collapsed?a.floatingStackCollapsed:a.floatingStackDocked,n.collapsed&&m.value&&a.floatingStackMoved]),S=g(()=>[a.floatingHeader,!n.collapsed&&a.floatingHeaderDocked]),p=g(()=>[a.floatingTiles,n.collapsed?a.floatingTilesCollapsed:a.floatingTilesDocked]),v=g(()=>[a.floatingTile,n.collapsed?a.floatingTileCollapsed:a.floatingTileDocked]),_=w=>{r.value||!n.collapsed||w.target instanceof Element&&w.target.closest('[data-test="presentation-livekit-floating-header-actions"]')||c(w)},T=()=>{i("update:collapsed",!n.collapsed)};return(w,E)=>(A(),$("div",{ref_key:"floatingStackRef",ref:s,class:P(y.value),style:zu(b(u)),"data-collapsed":n.collapsed,"data-test":"presentation-livekit-floating-stack"},[b(r)?re("",!0):(A(),$("div",{key:0,class:P(S.value),"data-test":"presentation-livekit-floating-header",onPointerdown:_},[F("div",{class:P(w.$style.floatingHeaderActions),"data-test":"presentation-livekit-floating-header-actions"},[R(le,{type:"button",variant:"ghost",size:b(r)?"mobile":"small","icon-only":"","aria-label":"Показать участников плиткой","data-test":"presentation-livekit-participant-gallery-control",onClick:E[0]||(E[0]=M=>i("show-gallery"))},{default:x(()=>[R(b(Zs),{"aria-hidden":"true"})]),_:1},8,["size"]),R(le,{type:"button",variant:"ghost",size:b(r)?"mobile":"small","icon-only":"","aria-controls":o,"aria-expanded":!n.collapsed,"aria-label":d.value,"data-test":"presentation-livekit-participant-collapse-control",onClick:T},{default:x(()=>[n.collapsed?(A(),B(b(dv),{key:0,"aria-hidden":"true"})):(A(),B(b(uv),{key:1,"aria-hidden":"true"}))]),_:1},8,["size","aria-expanded","aria-label"])],2)],34)),b(r)?(A(),$("div",{key:1,id:o,class:P(p.value),"data-test":"presentation-livekit-floating-tiles"},[n.collapsed?re("",!0):(A(),B(Gu,{key:0,"reserve-bottom-space":!0,"selected-participant-identities":n.selectedParticipantIdentities,tiles:f.value,onSelectTile:E[1]||(E[1]=M=>i("select-tile",M))},null,8,["selected-participant-identities","tiles"]))],2)):(A(),$("div",{key:2,id:o,class:P(p.value),"data-test":"presentation-livekit-floating-tiles"},[(A(!0),$(an,null,ji(h.value,M=>(A(),B(X4,{key:M.participantIdentity,class:P(v.value),"avatar-size":"medium",selected:n.selectedParticipantIdentities?.has(M.participantIdentity),"show-actions":!n.collapsed,"show-speaking-indicator":!n.collapsed,tile:M,"data-test":"presentation-livekit-floating-tile",onSelect:E[2]||(E[2]=k=>i("select-tile",k))},null,8,["class","selected","show-actions","show-speaking-indicator","tile"]))),128))],2))],14,ow))}}),lw="_floatingStack_cigax_1",cw="_floatingStackDocked_cigax_9",uw="_floatingStackCollapsed_cigax_16",dw="_floatingStackMoved_cigax_24",hw="_floatingHeader_cigax_31",mw="_floatingHeaderDocked_cigax_58",fw="_floatingHeaderActions_cigax_77",pw="_floatingTiles_cigax_99",gw="_floatingTilesDocked_cigax_106",vw="_floatingTilesCollapsed_cigax_116",bw="_floatingTile_cigax_99",yw="_floatingTileDocked_cigax_131",Sw="_floatingTileCollapsed_cigax_137",kw={floatingStack:lw,floatingStackDocked:cw,floatingStackCollapsed:uw,floatingStackMoved:dw,floatingHeader:hw,floatingHeaderDocked:mw,floatingHeaderActions:fw,floatingTiles:pw,floatingTilesDocked:gw,floatingTilesCollapsed:vw,floatingTile:bw,floatingTileDocked:yw,floatingTileCollapsed:Sw},ww={$style:kw},Tw=at(sw,[["__cssModules",ww]]),Ew=Te({__name:"PresentationLiveKitFocusedCamera",props:{mediaTestId:{},tile:{}},emits:["deselect"],setup(e,{emit:t}){const n=e,i=t,a=Ai();return(r,o)=>(A(),$("article",{class:P([r.$style.focusedCamera,b(a)&&r.$style.focusedCameraMobile]),"data-test":"presentation-livekit-focused-camera"},[R(Zl,{"avatar-size":"large","clone-media-element":"","media-test-id":n.mediaTestId,tile:n.tile},{default:x(()=>[b(a)?re("",!0):(A(),B(Js,{key:0,class:P(["text-footnote-medium",r.$style.cameraLabel]),appearance:"top-overlay","display-name":n.tile.displayName,"is-microphone-enabled":n.tile.isMicrophoneEnabled,"is-speaking":!1,"self-view-test-id":n.tile.selfViewTestId},null,8,["class","display-name","is-microphone-enabled","self-view-test-id"]))]),_:1},8,["media-test-id","tile"]),b(a)?(A(),$("div",{key:0,class:P(r.$style.mobileMeta),"data-test":"presentation-livekit-focused-camera-mobile-meta"},[R(Js,{class:P(["text-footnote-medium",r.$style.mobileCameraLabel]),appearance:"inline","display-name":n.tile.displayName,"icon-size":"default","is-microphone-enabled":n.tile.isMicrophoneEnabled,"is-speaking":!1,"self-view-test-id":n.tile.selfViewTestId},null,8,["class","display-name","is-microphone-enabled","self-view-test-id"]),F("span",{class:P(r.$style.mobileDeselectControl)},[R(le,{type:"button",variant:"ghost",size:"small","aria-label":`Открепить участника: ${n.tile.displayName}`,"data-test":"presentation-livekit-focused-camera-mobile-deselect",onClick:o[0]||(o[0]=or(s=>i("deselect",n.tile.participantIdentity),["stop"]))},{default:x(()=>[...o[2]||(o[2]=[F("span",{class:"text-footnote-medium"},"Открепить",-1)])]),_:1},8,["aria-label"])],2)],2)):re("",!0),R(ec,{class:P(r.$style.participantActions),"include-chat":"",tile:n.tile},null,8,["class","tile"]),F("div",{class:P(r.$style.closeControl)},[R(le,{type:"button",variant:"ghost",size:"small","icon-only":"","aria-label":`Снять выбор: ${n.tile.displayName}`,"data-test":"presentation-livekit-focused-camera-close",onClick:o[1]||(o[1]=or(s=>i("deselect",n.tile.participantIdentity),["stop"]))},{default:x(()=>[R(b(Zs))]),_:1},8,["aria-label"])],2)],2))}}
187),Mw="_focusedCamera_os392_1",Aw="_cameraLabel_os392_13",Pw="_focusedCameraMobile_os392_22",_w="_mobileMeta_os392_26",Cw="_mobileCameraLabel_os392_49",Iw="_mobileDeselectControl_os392_54",Lw="_participantActions_os392_60",Rw="_closeControl_os392_66",$w={focusedCamera:Mw,cameraLabel:Aw,focusedCameraMobile:Pw,mobileMeta:_w,mobileCameraLabel:Cw,mobileDeselectControl:Iw,participantActions:Lw,closeControl:Rw},Fw={$style:$w},q3=at(Ew,[["__cssModules",Fw]]),Dw=["onPointerdown"],xw=160,Bw=Te({__name:"PresentationLiveKitScreenShareGrid",props:{cameraTiles:{},screenShareTiles:{},screenShareSources:{}},emits:["deselect-camera"],setup(e,{emit:t}){const n={},i=(p,v,_)=>Math.min(Math.max(p,v),_),a=e,r=t,o=Rr(),s=dr("screenShareGridRef"),l=D([]),u=D(null),c=g(()=>[...a.screenShareSources.map(p=>({key:`screen-share:${p.participantIdentity}`,kind:"screen-share",source:p,tile:a.screenShareTiles?.find(v=>v.participantIdentity===p.participantIdentity)})),...(a.cameraTiles??[]).map(p=>({key:`camera:${p.participantIdentity}`,kind:"camera",tile:p}))]),m=g(()=>[o.screenShareGrid,c.value.length===1&&o.screenShareGridSingle]),f=()=>{const p=c.value.length;return Array.from({length:p},(v,_)=>l.value[_]??1)},h=g(()=>c.value.length<=1?n:{gridTemplateColumns:f().flatMap((v,_)=>{const T=`minmax(0, ${v}fr)`;return _===c.value.length-1?[T]:[T,"var(--spacing-8)"]}).join(" ")}),d=p=>{const v=u.value;if(!v)return;const _=[...v.weights],T=v.separatorIndex,w=T+1,E=v.weights[T]??1,M=v.weights[w]??1,k=E+M,C=Math.min(xw,k/2),O=i(E+p.clientX-v.startX,C,k-C);_[T]=O,_[w]=k-O,l.value=_},y=()=>{u.value=null,window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",y)},S=(p,v)=>{const _=s.value;if(!_)return;const T=_.getBoundingClientRect(),w=f(),E=w.reduce((k,C)=>k+C,0),M=w.map(k=>E>0?k/E*T.width:1);u.value={separatorIndex:v,startX:p.clientX,weights:M},l.value=M,p.currentTarget instanceof HTMLElement&&typeof p.currentTarget.setPointerCapture=="function"&&p.currentTarget.setPointerCapture(p.pointerId),window.addEventListener("pointermove",d),window.addEventListener("pointerup",y)};return Lt(()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",y)}),(p,v)=>(A(),$("div",{ref_key:"screenShareGridRef",ref:s,class:P(m.value),style:zu(h.value),"data-test":"presentation-livekit-screen-share-grid"},[(A(!0),$(an,null,ji(c.value,(_,T)=>(A(),$(an,{key:_.key},[_.kind==="screen-share"&&_.source.source!=="local_screen_share"&&_.tile?(A(),B(q3,{key:0,class:P(p.$style.screenShareTile),"data-test":"presentation-livekit-screen-share-tile","media-test-id":"presentation-livekit-screen-share",tile:_.tile,onDeselect:v[0]||(v[0]=w=>r("deselect-camera",w))},null,8,["class","tile"])):_.kind==="screen-share"?(A(),$("article",{key:1,class:P(p.$style.screenShareTile),"data-test":"presentation-livekit-screen-share-tile"},[_.source.source==="local_screen_share"?(A(),$("div",{key:0,class:P(p.$style.localScreenSharePlaceholder),"data-test":"presentation-livekit-local-screen-share-placeholder"},[F("p",{class:P(["text-title-medium",p.$style.localScreenShareTitle])}," Демонстрация экрана активна ",2),F("p",{class:P(["text-body-regular",p.$style.localScreenShareDescription])}," Перейдите в нужный раздел или окно — участники продолжат видеть ваш экран ",2)],2)):(A(),B(H1,{key:1,clone:"","data-test":"presentation-livekit-screen-share",element:_.source.element},{default:x(()=>[F("span",{class:P(["text-footnote-medium",p.$style.screenShareLabel])},ct(_.source.label),3)]),_:2},1032,["element"]))],2)):(A(),B(q3,{key:2,class:P(p.$style.screenShareTile),tile:_.tile,onDeselect:v[1]||(v[1]=w=>r("deselect-camera",w))},null,8,["class","tile"])),T<c.value.length-1?(A(),$("button",{key:3,type:"button",class:P(p.$style.screenShareSeparator),"aria-label":"Изменить размер демонстраций экранов","data-test":"presentation-livekit-screen-share-separator",onPointerdown:w=>S(w,T)},null,42,Dw)):re("",!0)],64))),128))],6))}}),Ow="_screenShareGrid_h3ewg_1",Uw="_screenShareGridSingle_h3ewg_10",Nw="_screenShareSeparator_h3ewg_15",Gw="_screenShareTile_h3ewg_41",Vw="_localScreenSharePlaceholder_h3ewg_57",zw="_localScreenShareTitle_h3ewg_69",Kw="_localScreenShareDescription_h3ewg_70",qw="_screenShareLabel_h3ewg_83",jw={screenShareGrid:Ow,screenShareGridSingle:Uw,screenShareSeparator:Nw,screenShareTile:Gw,localScreenSharePlaceholder:Vw,localScreenShareTitle:zw,localScreenShareDescription:Kw,screenShareLabel:qw},Ww={$style:jw},Hw=at(Bw,[["__cssModules",Ww]]),Xw=1200,Yw=Te({__name:"PresentationLiveKitStage",props:{activeSpeakerIdentities:{default:()=>new Set},hasViewerParticipant:{type:Boolean},inviteUrl:{default:null},inviteRecipientPeerGuids:{default:()=>[]},isMicrophoneEnabled:{type:Boolean},localCamera:{},localParticipantIdentity:{},onlineParticipants:{},onlineParticipantCount:{},remoteCameras:{},screenShareSources:{},shouldRenderFloatingCameraPreviews:{type:Boolean,default:!0},showMicrophonePrompt:{type:Boolean}},emits:["minimize","toggle-microphone"],setup(e,{emit:t}
187){const n=e,i=t,a=dr("stageRef"),r=Rr(),o=Ai(),s=D(!1),l=D(!0),u=D(!1);let c=null;const m=g(()=>!n.hasViewerParticipant),{copyInviteUrl:f,resolvedInviteUrl:h}=J1(()=>n.inviteUrl),{isInviteLinkPendingInChat:d,sendInviteUrlToChat:y}=Y1(()=>n.inviteUrl,()=>n.inviteRecipientPeerGuids),S=g(()=>m.value&&l.value),p=g(()=>m.value&&!l.value&&!u.value&&!!h.value),v=g(()=>m.value&&!l.value&&(u.value||!h.value)),_=g(()=>v.value&&n.showMicrophonePrompt&&!n.isMicrophoneEnabled),T=()=>{c&&(clearTimeout(c),c=null)},w=()=>{l.value=!0,u.value=!1,T(),n.showMicrophonePrompt&&(c=setTimeout(()=>{l.value=!1,c=null},Xw))},E=async()=>{await f()&&(u.value=!0)},M=()=>{y()&&i("minimize")};Ie(()=>[n.hasViewerParticipant,n.showMicrophonePrompt,h.value],()=>{if(n.hasViewerParticipant){T();return}w()},{immediate:!0}),Lt(()=>{T()});const{cameraTiles:k,floatingCameraTiles:C,hasMainCameraTiles:O,hasScreenShareSources:L,hasVideoSources:oe,mainCameraTiles:ce}=W4({get activeSpeakerIdentities(){return n.activeSpeakerIdentities},get isLocalMicrophoneEnabled(){return n.isMicrophoneEnabled},get localCamera(){return n.localCamera},get localParticipantIdentity(){return n.localParticipantIdentity},get onlineParticipants(){return n.onlineParticipants},get remoteCameras(){return n.remoteCameras},get screenShareSources(){return n.screenShareSources}}),{isGalleryView:ue,participantPanelTiles:je,selectedCameraTiles:V,selectedParticipantIdentities:N,selectParticipantTile:se,showGalleryView:te,visibleScreenShareSources:Ze}=dk({cameraTiles:k,floatingCameraTiles:C,hasScreenShareSources:L,screenShareSources:g(()=>n.screenShareSources)}),et=g(()=>n.shouldRenderFloatingCameraPreviews&&je.value.length>0&&(oe.value||V.value.length>0)&&!ue.value),Kt=g(()=>Ze.value.length+V.value.length>0),vt=g(()=>
187[r.screenArea,Kt.value&&!ue.value&&r.screenAreaFocused,et.value&&!s.value&&r.screenAreaWithParticipantPanel]);return(q,Me)=>(A(),$("section",{ref_key:"stageRef",ref:a,class:P(q.$style.stage),"data-test":"presentation-livekit-stage"},[F("div",{class:P(vt.value)},[Kt.value&&!b(ue)?(A(),B(Hw,{key:0,"camera-tiles":b(V),"screen-share-tiles":b(k),"screen-share-sources":b(Ze),onDeselectCamera:b(se)},null,8,["camera-tiles","screen-share-tiles","screen-share-sources","onDeselectCamera"])):b(ue)&&b(o)?(A(),B(Gu,{key:1,"selected-participant-identities":b(N),tiles:b(k),onSelectTile:b(se)},null,8,["selected-participant-identities","tiles","onSelectTile"])):b(ue)?(A(),B(z3,{key:2,"selected-participant-identities":b(N),tiles:b(k),onSelectTile:b(se)},null,8,["selected-participant-identities","tiles","onSelectTile"])):b(O)?b(o)?(A(),B(Gu,{key:4,"selected-participant-identities":b(N),tiles:b(ce),onSelectTile:b(se)},null,8,["selected-participant-identities","tiles","onSelectTile"])):(A(),B(z3,{key:5,"selected-participant-identities":b(N),tiles:b(ce),onSelectTile:b(se)},null,8,["selected-participant-identities","tiles","onSelectTile"])):(A(),$("div",{key:3,class:P(q.$style.emptyState),"data-test":"presentation-livekit-waiting-state"},[m.value?(A(),$("div",{key:0,class:P(q.$style.waitingFlow)},[F("div",{class:P(q.$style.waitingTitleSlot)},[R(ic,{mode:"out-in","enter-active-class":q.$style.waitingTitleTransitionActive,"enter-from-class":q.$style.waitingStepTransitionHidden,"leave-active-class":q.$style.waitingTitleTransitionActive,"leave-to-class":q.$style.waitingStepTransitionHidden},{default:x(()=>[S.value?(A(),$("p",{key:"preparing",class:P(["text-title-medium",q.$style.emptyTitle]),"data-test":"presentation-livekit-preparing-step"}," Подготовка к видеовстрече... ",2)):p.value?(A(),$("p",{key:"invite",class:P(["text-title-medium",q.$style.emptyTitle]),"data-test":"presentation-livekit-invite-step"}," Пригласите участников ",2)):v.value?(A(),$("p",{key:"waiting",class:P(["text-title-medium",q.$style.emptyTitle]),"data-test":"presentation-livekit-waiting-step"}," Ожидаем участников встречи... ",2)):re("",!0)]),_:1},8,["enter-active-class","enter-from-class","leave-active-class","leave-to-class"])],2),F("div",{class:P(q.$style.waitingActionSlot)},[R(ic,{mode:"out-in","enter-active-class":q.$style.waitingTitleTransitionActive,"enter-from-class":q.$style.waitingStepTransitionHidden,"leave-active-class":q.$style.waitingTitleTransitionActive,"leave-to-class":q.$style.waitingStepTransitionHidden},{default:x(()=>[p.value?(A(),$("div",{key:"invite",class:P(q.$style.waitingInviteActions)},[R(le,{"data-test":"presentation-livekit-waiting-invite-control",variant:"secondary",onClick:Me[0]||(Me[0]=wt=>{E()})},{default:x(()=>[R(b(cv),{class:P(q.$style.waitingInviteIcon),"data-test":"presentation-livekit-waiting-invite-link-icon"},null,8,["class"]),Me[3]||(Me[3]=F("span",null,"Скопировать пригласительную ссылку",-1))]),_:1}),R(le,{"data-test":"presentation-livekit-waiting-chat-invite-control",disabled:b(d),variant:"secondary",onClick:M},{default:x(()=>[R(b(wo),{class:P(q.$style.waitingInviteIcon),"data-test":"presentation-livekit-waiting-invite-chat-icon"},null,8,["class"]),Me[4]||(Me[4]=F("span",null,"Отправить ссылку в чат",-1))]),_:1},8,["disabled"])],2)):v.value?(A(),$("div",{key:"waiting",class:P(q.$style.microphonePromptSlot),"data-test":"presentation-livekit-microphone-prompt-slot"},[R(ic,{"enter-active-class":q.$style.microphonePromptTransitionActive,"enter-from-class":q.$style.microphonePromptTransitionHidden,"leave-active-class":q.$style.microphonePromptTransitionActive,"leave-to-class":q.$style.microphonePromptTransitionHidden},{default:x(()=>[_.value?(A(),B(le,{key:0,"data-test":"presentation-livekit-microphone-prompt",variant:"secondary",onClick:Me[1]||(Me[1]=wt=>i("toggle-microphone"))},{default:x(()=>[R(b(Ql),{class:P(q.$style.microphonePromptIcon)},null,8,["class"]),Me[5]||(Me[5]=F("span",null,"Включить микрофон",-1))]),_:1})):re("",!0)]),_:1},8,["enter-active-class","enter-from-class","leave-active-class","leave-to-class"])],2)):(A(),$("span",{key:"empty",class:P(q.$style.waitingActionPlaceholder)},null,2))]),_:1},8,["enter-active-class","enter-from-class","leave-active-class","leave-to-class"])],2)],2)):re("",!0)],2)),et.value?(A(),B(Tw,{key:6,collapsed:s.value,"onUpdate:collapsed":Me[2]||(Me[2]=wt=>s.value=wt),"selected-participant-identities":b(N),"stage-element":a.value,tiles:b(je),onSelectTile:b(se),onShowGallery:b(te)},null,8,["collapsed","selected-participant-identities","stage-element","tiles","onSelectTile","onShowGallery"])):re("",!0)],2)],2))}}),Jw="_stage_q8lva_1",Qw="_screenArea_q8lva_8",Zw="_screenAreaWithParticipantPanel_q8lva_17",eT="_screenArea
187Focused_q8lva_22",tT="_emptyState_q8lva_31",nT="_emptyTitle_q8lva_40",iT="_waitingFlow_q8lva_45",aT="_waitingTitleSlot_q8lva_53",rT="_waitingActionSlot_q8lva_61",oT="_waitingInviteActions_q8lva_69",sT="_waitingTitleTransitionActive_q8lva_75",lT="_waitingStepTransitionActive_q8lva_79",cT="_waitingStepTransitionHidden_q8lva_83",uT="_waitingActionPlaceholder_q8lva_87",dT="_waitingInviteIcon_q8lva_92",hT="_microphonePromptSlot_q8lva_98",mT="_microphonePromptTransitionActive_q8lva_103",fT="_microphonePromptTransitionHidden_q8lva_107",pT="_microphonePromptIcon_q8lva_111",gT={stage:Jw,screenArea:Qw,screenAreaWithParticipantPanel:Zw,screenAreaFocused:eT,emptyState:tT,emptyTitle:nT,waitingFlow:iT,waitingTitleSlot:aT,waitingActionSlot:rT,waitingInviteActions:oT,waitingTitleTransitionActive:sT,waitingStepTransitionActive:lT,waitingStepTransitionHidden:cT,waitingActionPlaceholder:uT,waitingInviteIcon:dT,microphonePromptSlot:hT,microphonePromptTransitionActive:mT,microphonePromptTransitionHidden:fT,microphonePromptIcon:pT},vT={$style:gT},bT=at(Yw,[["__cssModules",vT]]),yT=Te({__name:"PresentationLiveKitRuntimeStage",props:{activeSpeakerIdentities:{default:()=>new Set},blockingErrorText:{},hasViewerParticipant:{type:Boolean},inviteRecipientPeerGuids:{},inviteUrl:{},isMicrophoneEnabled:{type:Boolean},isStartingNewMeeting:{type:Boolean},localCamera:{},localParticipantIdentity:{},meetingStatusText:{},onlineParticipantCount:{},onlineParticipants:{},remoteCameras:{},screenShareSources:{},shouldRenderFloatingCameraPreviews:{type:Boolean},shouldRenderStage:{type:Boolean},showMicrophonePrompt:{type:Boolean}},emits:["minimize","start-new-meeting","toggle-microphone"],setup(e,{emit:t}){const n=e,i=t;return(a,r)=>n.shouldRenderStage?(A(),B(bs,{key:0,to:"#presentation-livekit-stage-outlet"},[F("section",{class:P(a.$style.meeting),"data-test":"presentation-livekit-view"},[n.meetingStatusText?(A(),$("section",{key:0,class:P(a.$style.connectionState),"data-test":"presentation-livekit-meeting-status-state"},[F("p",{class:P(["text-title-medium",a.$style.statusTitle])},ct(n.meetingStatusText),3)],2)):n.blockingErrorText?(A(),$("section",{key:1,class:P(a.$style.connectionState),"data-test":"presentation-livekit-error-state"},[F("div",{class:P(a.$style.connectionMessage)},[F("p",{class:P(["text-title-3-medium",a.$style.connectionTitle])}," Онлайн-встреча недоступна ",2),F("p",{class:P(["text-body-regular",a.$style.connectionText])},ct(n.blockingErrorText),3)],2),R(le,{variant:"primary",loading:n.isStartingNewMeeting,onClick:r[0]||(r[0]=o=>i("start-new-meeting"))},{default:x(()=>[...r[3]||(r[3]=[gi(" Запустить новую встречу ",-1)])]),_:1},8,["loading"])],2)):(A(),B(bT,{key:2,"active-speaker-identities":n.activeSpeakerIdentities,"has-viewer-participant":n.hasViewerParticipant,"invite-recipient-peer-guids":n.inviteRecipientPeerGuids,"invite-url":n.inviteUrl,"is-microphone-enabled":n.isMicrophoneEnabled,"local-camera":n.localCamera,"local-participant-identity":n.localParticipantIdentity,"online-participant-count":n.onlineParticipantCount,"online-participants":n.onlineParticipants,"remote-cameras":n.remoteCameras,"screen-share-sources":n.screenShareSources,"should-render-floating-camera-previews":n.shouldRenderFloatingCameraPreviews,"show-microphone-prompt":n.showMicrophonePrompt,onMinimize:r[1]||(r[1]=o=>i("minimize")),onToggleMicrophone:r[2]||(r[2]=o=>i("toggle-microphone"))},null,8,["active-speaker-identities","has-viewer-participant","invite-recipient-peer-guids","invite-url","is-microphone-enabled","local-camera","local-participant-identity","online-participant-count","online-participants","remote-cameras","screen-share-sources","should-render-floating-camera-previews","show-microphone-prompt"]))],2)])):re("",!0)}}),ST="_meeting_1vdhi_1",kT="_connectionState_1vdhi_8",wT="_connectionMessage_1vdhi_21",TT="_connectionTitle_1vdhi_27",ET="_statusTitle_1vdhi_32",MT="_connectionText_1vdhi_37",AT={meeting:ST,connectionState:kT,connectionMessage:wT,connectionTitle:TT,statusTitle:ET,connectionText:MT},PT={$style:AT}
187,_T=at(yT,[["__cssModules",PT]]),CT=2400,IT=3600,sa=e=>typeof e=="object"&&e!==null?e:null,$n=(e,t)=>{const n=e[t];if(typeof n=="string"&&n.trim())return n;throw new Error(`Invalid LiveKit join session field: ${t}`)},ka=(e,t)=>{const n=e[t];if(typeof n=="boolean")return n;throw new Error(`Invalid LiveKit join session field: ${t}`)},Nc=(e,t)=>{const n=e[t];if(typeof n=="number"&&Number.isFinite(n))return n;throw new Error(`Invalid LiveKit response field: ${t}`)},LT=(e,t)=>{const n=e[t];if(Array.isArray(n)&&n.every(i=>typeof i=="string"))return n;throw new Error(`Invalid LiveKit response field: ${t}`)},j3=(e,t)=>{const n=sa(e[t]);if(n)return n;throw new Error(`Invalid LiveKit join session field: ${t}`)},er=(e,t)=>{const n=e[t];if(typeof n=="string"&&n.trim())return n},fs=(e,t)=>{const n=e[t];if(typeof n=="string"&&n.trim())return n;throw new Error(`Invalid LiveKit mobile pairing field: ${t}`)},W3=(e,t)=>{const n=e[t];if(typeof n=="string"&&n.trim())return n;throw new Error(`Invalid LiveKit recording field: ${t}`)},oo=(e,t)=>{const n=e[t];if(n==null)return null;if(typeof n=="string")return n;throw new Error(`Invalid LiveKit recording field: ${t}`)},H3=(e,t)=>{const n=e[t];if(n==null)return null;if(typeof n=="number"&&Number.isFinite(n))return n;throw new Error(`Invalid LiveKit recording field: ${t}`)},RT=e=>{if(e==="starting"||e==="recording"||e==="stopping"||e==="ready"||e==="failed")return e;throw new Error("Invalid LiveKit recording field: status")},$T=e=>{if(e==="presenter"||e==="viewer")return e;throw new Error("Invalid LiveKit participant role")},FT=e=>{const t=er(e,"avatarUrl");return{identity:$n(e,"identity"),name:$n(e,"name"),...t?{avatarUrl:t}:{}}},DT=e=>({role:$T(e.role),canSubscribe:ka(e,"canSubscribe"),canPublishCamera:ka(e,"canPublishCamera"),canPublishMicrophone:ka(e,"canPublishMicrophone"),canPublishScreenShare:ka(e,"canPublishScreenShare"),canPublishData:ka(e,"canPublishData")}),xT=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit join session response");return{expiresAt:$n(t,"expiresAt"),livekitUrl:$n(t,"livekitUrl"),participant:FT(j3(t,"participant")),participantToken:$n(t,"participantToken"),permission:DT(j3(t,"permission")),presentationGuid:$n(t,"presentationGuid"),roomName:$n(t,"roomName")}},BT=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit mobile pairing response");return{pairingId:fs(t,"pairingId"),expiresAt:fs(t,"expiresAt"),deepLink:fs(t,"deepLink"),webFallbackUrl:fs(t,"webFallbackUrl")}},Q1=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit recording response");const n=t.presentationGuid;
187return{recordingId:W3(t,"recordingId"),status:RT(t.status),...n===void 0?{}:{presentationGuid:W3(t,"presentationGuid")}}},OT=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit recording response");const n=Q1(t),i=n.presentationGuid;if(!i)throw new Error("Invalid LiveKit recording field: presentationGuid");return{...n,presentationGuid:i,fileName:oo(t,"fileName"),fileSize:H3(t,"fileSize"),durationSeconds:H3(t,"durationSeconds"),downloadUrl:oo(t,"downloadUrl"),startedAt:oo(t,"startedAt"),finishedAt:oo(t,"finishedAt"),errorMessage:oo(t,"errorMessage")}},ho=e=>{if(typeof e!="string"||!e.trim())return null;try{const t=sa(JSON.parse(e));if(!t)return null;const n=er(t,"kind");return n?{kind:n,avatarUrl:er(t,"avatarUrl"),isModerator:t.isModerator===!0,ownerIdentity:er(t,"ownerIdentity"),pairingId:er(t,"pairingId"),presentationGuid:er(t,"presentationGuid")}:null}catch{return null}},UT=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit participant mute response");return{failed:Nc(t,"failed"),mutedCount:Nc(t,"mutedCount"),mutedIdentities:LT(t,"mutedIdentities"),presentationGuid:$n(t,"presentationGuid"),roomName:$n(t,"roomName"),skipped:Nc(t,"skipped")}},NT=e=>{const t=sa(e);if(!t)throw new Error("Invalid LiveKit participant moderator response");return{identity:$n(t,"identity"),isModerator:ka(t,"isModerator"),liveUpdated:ka(t,"liveUpdated"),presentationGuid:$n(t,"presentationGuid")}},ps=e=>e instanceof Error&&e.message?e.message:"Не удалось подключиться к онлайн-встрече",Gc=e=>String(e).padStart(2,"0"),gs=e=>{const t=Number.isFinite(e)&&e>0?Math.floor(e):0,n=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60;return[Gc(n),Gc(i),Gc(a)].join(":")},GT=e=>e>=IT?"danger":e>=CT?"warning":"success",VT=()=>na({mutationFn:async({identity:e,presentationGuid:t})=>{const n=await Pi.mutePresentationLiveKitParticipant(t,e);return UT(n.data)}}),zT=()=>na({mutationFn:async({identity:e,isModerator:t,presentationGuid:n})=>{const i=await Pi.setPresentationLiveKitParticipantModerator(n,e,t);return NT(i.data)}}),KT=()=>na({mutationFn:async({inviteToken:e,presentationGuid:t})=>{const n=await Pi.createPresentationLiveKitMobileScreenSharePairing(t,{inviteToken:e});return BT(n.data)}}),qT=()=>na({mutationFn:async e=>{await Pi.endPresentationLiveKitSession(e)}}),jT=()=>na({mutationFn:async({inviteToken:e,presentationGuid:t})=>{const n=await Pi.joinPresentationLiveKitSession(t,{inviteToken:e});return xT(n.data)}}),WT=()=>na({mutationFn:async({pairingId:e,presentationGuid:t})=>{await Pi.revokePresentationLiveKitMobileScreenSharePairing(t,e)}}),Y4=()=>Kg(),HT=async(e,t)=>{!e||!Y4()||await e.switchActiveDevice("audiooutput",t)},XT="Встреча уже завершена. Ссылка больше недействительна.",YT=new Set([403,404,409,410]),JT=e=>nr(e)&&YT.has(e.response?.status??0),QT=e=>
187nr(e)&&e.response?.status===410?XT:nr(e)&&e.response?.status===403?"Ссылка на встречу недействительна или была отозвана.":nr(e)&&e.response?.status===404?"Встреча не найдена.":nr(e)&&e.response?.status===409?"К этой встрече больше нельзя присоединиться.":e instanceof Error&&e.message?e.message:null,ZT=(e,t)=>{const n=t?.guid===e.participant.identity?t.avatarUrl:null;return n?{...e,participant:{...e.participant,avatarUrl:n}}:e},eE=({joinErrorText:e,roomErrorText:t})=>{const n=D(null),i=g(()=>e.value||t.value);Ie(i,a=>{if(!a){n.value=null;return}a!==n.value&&(mi.error({content:a,persistent:!0}),n.value=a)},{immediate:!0})},tE=({inviteToken:e,joinError:t,returnToMyProfile:n})=>{Ie([e,t],([i,a])=>{!i.trim()||!JT(a)||n()})},nE=({activePresentationGuid:e,canEndMeeting:t,disconnectFromSession:n,endMeeting:i,isEndingMeeting:a,releaseLocalTracksForDisconnect:r,requestedPresentationGuid:o,resetRuntimeState:s,returnToPresentationReschedule:l})=>{const u=D(!1),c=()=>{he(t)&&(u.value=!0)},m=()=>{u.value=!1},f=()=>{he(a)||m()};return{closeEndMeetingConfirmation:f,confirmEndMeeting:async()=>{const S=he(e);if(!(!S||!he(t)))try{await r(),await i(S),await n(),s()}catch{mi.error({content:"Не удалось завершить встречу"})}},handleEndMeetingConfirmationOpenUpdate:S=>{S||f()},handleRescheduleMeeting:async()=>{m(),await l(he(o))},isEndMeetingConfirmationOpen:u,openEndMeetingConfirmation:c,resetEndMeetingConfirmation:m}},X3="app-theme-transition",iE=1e3,aE=720,rE=1e3,oE=({blockingErrorText:e,isConnecting:t,shouldUseMeetingTheme:n=!0})=>{const{mode:i,preference:a,setTheme:r,setThemePreference:o}=h0(),s=D(!1),l=D(null);let u=null,c=null,m=null;const f=()=>{typeof window>"u"||(c!==null&&window.clearTimeout(c),document.documentElement.classList.add(X3),c=window.setTimeout(()=>{document.documentElement.classList.remove(X3),c=null},aE))},h=()=>{m!==null&&(window.clearTimeout(m),m=null)},d=()=>{if(typeof window>"u"){s.value=!0;return}h(),m=window.setTimeout(()=>{m=null,s.value=!0},rE)},y=()=>{if(i.value!=="light"){s.value=!0;return}l.value=a.value,f(),r("dark"),d()},S=()=>{if(i.value!=="light"||l.value){s.value=!0;return}typeof window>"u"||u!==null||(u=window.setTimeout(()=>{u=null,y()},iE))},p=()=>{u!==null&&(window.clearTimeout(u),u=null)},v=()=>{const _=l.value;_&&(f(),o(_),l.value=null)};return Ie(()=>[he(t),he(e),he(n)],([_,T,w])=>{if(_||T||!w){p(),h(),v(),s.value=!1;return}S()},{immediate:!0}),Lt(()=>{p(),h(),v()}),{isMicrophonePromptReady:s}},sE="presentation-livekit:viewer-meeting-duration:v1",J4=()=>typeof window<"u"&&typeof window.localStorage<"u",lE=(e,t)=>[sE,e.trim(),t.trim()].join(":"),cE=e=>{const t=e.trim();if(!t||!J4())return 0;try{const n=window.localStorage.getItem(t),i=n===null?Number.NaN:Number(n);return Number.isFinite(i)&&i>=0?Math.floor(i):0}catch{return 0}},uE=(e,t)=>{const n=e.trim();if(!n||!J4())return;const i=Number.isFinite(t)&&t>0?Math.floor(t):0;try{window.localStorage.setItem(n,String(i))}catch{}},Y3=1e3,dE=({blockingErrorText:e,hasViewerParticipant:t,isOrganizer:n,isJoinPending:i,meetingDurationStorageKey:a=null,status:r})=>{const o=D(0),s=D(0),l=D(null),u=D(0),c=D(null),m=D(0);let f=null,h=null;const d=g(()=>he(r)==="connected"&&!he(i)&&!he(e)),y=g(()=>d.value&&he(n)&&!he(t)),S=g(()=>d.value&&(!he(n)||he(t))),p=g(()=>{const te=he(a);return typeof te=="string"&&te.trim()?te.trim():null}),v=g(()=>gs(u.value)),_=g(()=>gs(m.value)),T=g(()=>gs(u.value)),w=g(()=>gs(m.value)),E=g(()=>GT(m.value)),M=()=>{const te=p.value;te&&uE(te,m.value)},k=()=>{const te=p.value;if(!te)return;const Ze=cE(te);s.value=Ze,m.value=Ze,c.value!==null&&(c.value=Date.now())},C=()=>{const te=c.value;if(te===null){m.value=s.value,M();return}m.value=s.value+Math.floor((Date.now()-te)/1e3),M()},O=()=>{const te=l.value;if(te===null){u.value=o.value;return}u.value=o.value+Math.floor((Date.now()-te)/1e3)},L=()=>{f!==null&&typeof window<"u"&&window.clearInterval(f),f=null},oe=()=>{h!==null&&typeof window<"u"&&window.clearInterval(h),h=null},ce=()=>{l.value!==null&&(O(),o.value=u.value,l.value=null,L())},ue=()=>{c.value!==null&&(C(),s.value=m.value,c.value=null,oe())},je=()=>{L(),o.value=0,l.value=null,u.value=0},V=()=>{oe(),s.value=0,c.value=null,m.value=0},N=()=>{l.value===null&&(l.value=Date.now(),O(),!(typeof window>"u")&&(f=window.setInterval(O,Y3)))},se=()=>{c.value===null&&(k(),c.value=Date.now(),C(),!(typeof window>"u")&&(h=window.setInterval(C,Y3)))};return Ie(p,()=>{k()},{immediate:!0}),Ie(d,te=>{te||(je(),V())},{immediate:!0}),Ie(y,te=>
187{if(te){N();return}ce()},{immediate:!0}),Ie(S,te=>{if(te){se();return}ue()},{immediate:!0}),Lt(()=>{L(),oe()}),{endMeetingDurationLabel:w,endMeetingWaitingDurationLabel:T,meetingDurationLabel:_,meetingDurationTone:E,waitingDurationLabel:v}},hE="Организатор завершил онлайн-встречу",mE="Соединение с онлайн-встречей потеряно",fE=new Set([ac.PARTICIPANT_REMOVED,ac.ROOM_CLOSED,ac.ROOM_DELETED]),pE=({activePresentationGuid:e,disconnectReason:t,status:n})=>n!=="ended"||!e?null:t!==null&&fE.has(t)?hE:mE,gE={brightness:"Яркость",colorTemperature:"Температура цвета",contrast:"Контраст",exposureCompensation:"Компенсация экспозиции",exposureMode:"Экспозиция",exposureTime:"Время экспозиции",focusDistance:"Дистанция фокуса",focusMode:"Фокус",pan:"Поворот",resizeMode:"Масштабирование",saturation:"Насыщенность",sharpness:"Резкость",tilt:"Наклон",torch:"Фонарик",whiteBalanceMode:"Баланс белого",zoom:"Зум"},vE=["zoom","torch","focusMode","focusDistance","exposureMode","exposureCompensation","exposureTime","whiteBalanceMode","colorTemperature","brightness","contrast","saturation","sharpness","pan","tilt","resizeMode"],Vc=(e,t)=>{const n=e[t];if(typeof n!="function")return{};try{return n.call(e)}catch{return{}}},zc=(e,t)=>typeof e[t]=="function",J3=e=>e?{enabled:e.enabled,hasGetCapabilities:zc(e,"getCapabilities"),hasGetConstraints:zc(e,"getConstraints"),hasGetSettings:zc(e,"getSettings"),id:e.id,isAvailable:!0,kind:e.kind,label:e.label,muted:e.muted,readyState:e.readyState}:{hasGetCapabilities:!1,hasGetConstraints:!1,hasGetSettings:!1,isAvailable:!1},bE=e=>{if(!e||typeof e!="object")return!1;const t=e;return typeof t.min=="number"&&typeof t.max=="number"},yE=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],Q4=e=>e?{capabilities:Vc(e,"getCapabilities"),constraints:Vc(e,"getConstraints"),settings:Vc(e,"getSettings"),track:J3(e)}:{capabilities:{},constraints:{},settings:{},track:J3(null)},SE=e=>{const{capabilities:t,settings:n}=Q4(e);return vE.flatMap(i=>{const a=t[i],r=n[i],o=gE[i];if(bE(a))return[{key:i,kind:"range",label:o,max:a.max,min:a.min,step:a.step??1,value:typeof r=="number"?r:a.min}];const s=yE(a);return s.length>0?[{key:i,kind:"select",label:o,options:s,value:typeof r=="string"?r:s[0]??""}]:typeof a=="boolean"?[{key:i,kind:"boolean",label:o,value:typeof r=="boolean"?r:!1}]:[]})},kE=e=>e.kind==="audioinput"||e.kind==="audiooutput"||e.kind==="videoinput",Q3=e=>!e||typeof URL>"u"||typeof URL.createObjectURL!="function"?null:URL.createObjectURL(e),wE=e=>{const t=D(Lo()),n=D([]),i=D(!0),a=D(null),r=D([]),o=g(()=>n.value.filter(L=>L.kind==="videoinput")),s=g(()=>n.value.filter(L=>L.kind==="audioinput")),l=g(()=>n.value.filter(L=>L.kind==="audiooutput")),u=g(()=>e.getCameraMediaTrack()),c=g(()=>SE(u.value)),m=g(()=>Q4(u.value)),f=()=>{typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&r.value.forEach(L=>{URL.revokeObjectURL(L.objectUrl)}),r.value=[]},h=L=>r.value.find(oe=>oe.id===L)?.objectUrl??null,d=()=>{t.value={...t.value,backgroundImageUrl:t.value.backgroundMode==="image"?h(t.value.backgroundImageId):null}},y=async()=>{if(typeof navigator>"u"||!navigator.mediaDevices||typeof navigator.mediaDevices.enumerateDevices!="function"){n.value=[];return}n.value=(await navigator.mediaDevices.enumerateDevices()).filter(kE)},S=async()=>{await jv(t.value)},p=async L=>{t.value={...t.value,...L,audio:{...t.value.audio,...L.audio},camera:{...t.value.camera,...L.camera},microphone:{...t.value.microphone,...L.microphone},screenShare:{...t.value.screenShare,...L.screenShare}},await S()},v=async L=>{await p({camera:L}),await e.applyCameraSettings(t.value)},_=async L=>{await p({microphone:L}),await e.applyMicrophoneSettings(t.value)},T=async L=>{await p({screenShare:L})},w=async L=>{await p({audio:{outputDeviceId:L}}),await e.applyAudioOutputDevice(L)},E=async L=>{await p({backgroundImageId:L==="image"?t.value.backgroundImageId:void 0,backgroundImageUrl:L==="image"?t.value.backgroundImageUrl:null,backgroundMode:L}
187),d(),await e.applyBackgroundSettings(t.value)},M=async L=>{const oe=Qv(),ce=Date.now();await Yv({blob:L,createdAt:ce,id:oe});const ue=Q3(L);ue&&(r.value=[...r.value,{createdAt:ce,id:oe,objectUrl:ue}]),await p({backgroundImageId:oe,backgroundImageUrl:ue,backgroundMode:"image"}),await e.applyBackgroundSettings(t.value)},k=async L=>{await p({backgroundImageId:L,backgroundImageUrl:h(L),backgroundMode:"image"}),await e.applyBackgroundSettings(t.value)},C=async L=>{const oe=r.value.find(ue=>ue.id===L);oe&&typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&URL.revokeObjectURL(oe.objectUrl),r.value=r.value.filter(ue=>ue.id!==L),await Jv(L);const ce=t.value.backgroundMode==="image"&&t.value.backgroundImageId===L;await p({backgroundImageId:ce?void 0:t.value.backgroundImageId,backgroundImageUrl:ce?null:t.value.backgroundImageUrl,backgroundMode:ce?"disabled":t.value.backgroundMode}),await e.applyBackgroundSettings(t.value)},O=async()=>{i.value=!0,a.value=null;try{t.value=await Kv();const L=await Xv();r.value=L.flatMap(oe=>{const ce=Q3(oe.blob);return ce?[{createdAt:oe.createdAt,id:oe.id,objectUrl:ce}]:[]}),t.value.backgroundMode==="image"&&!t.value.backgroundImageId&&r.value[0]&&(t.value={...t.value,backgroundImageId:r.value[0].id},await S()),d(),await y()}catch(L){a.value=L instanceof Error?L.message:"Не удалось загрузить настройки"}finally{i.value=!1}};return Oa(()=>{O(),navigator.mediaDevices?.addEventListener?.("devicechange",y)}),Lt(()=>{f(),navigator.mediaDevices?.removeEventListener?.("devicechange",y)}),Ie(()=>t.value.backgroundImageUrl,()=>{e.applyBackgroundSettings(t.value)}),{audioOutputDevices:l,backgroundImages:r,cameraCapabilityControls:c,cameraDevices:o,cameraSettingsSnapshot:m,deleteBackgroundImage:C,errorText:a,isLoading:i,loadSettings:O,microphoneDevices:s,refreshDevices:y,selectBackgroundImage:k,settings:t,updateAudioOutputDevice:w,updateBackgroun
187dFile:M,updateBackgroundMode:E,updateCameraSettings:v,updateMicrophoneSettings:_,updateScreenShareSettings:T}},TE=({canPublishScreenShare:e,connectedMobilePairingIds:t,createMobilePairingMutation:n,inviteToken:i,presentationGuid:a,revokeMobilePairingMutation:r,screenShareSources:o})=>{const s=D(!1),l=D(null),u=g(()=>n.isError.value?n.error.value?.message||"Не удалось создать QR для телефона":r.isError.value?r.error.value?.message||"Не удалось отключить телефон":null),c=g(()=>{const _=l.value?.pairingId;return!!(_&&he(t).includes(_))}),m=g(()=>he(o).find(_=>_.kind==="mobile")??null),f=g(()=>m.value!==null),h=async()=>{const _=he(a);if(!(!_||!he(e)))try{const T=he(i)?.trim();l.value=await n.mutateAsync({presentationGuid:_,...T?{inviteToken:T}:{}})}catch{}},d=async()=>{const _=he(a),T=l.value;if(!_||!T){l.value=null;return}await r.mutateAsync({pairingId:T.pairingId,presentationGuid:_}),l.value=null},y=async()=>{const _=he(a),T=l.value?.pairingId??m.value?.pairingId;if(!_||!T){l.value=null,s.value=!1;return}try{await r.mutateAsync({pairingId:T,presentationGuid:_}),l.value=null,s.value=!1}catch{}},S=async()=>{f.value||(s.value=!0,l.value||await h())},p=()=>{s.value=!1},v=async()=>{try{await d()}catch{return}await h()};return Ie(f,_=>{_&&(s.value=!1)}),Lt(()=>{const _=he(a);l.value&&_&&r.mutateAsync({pairingId:l.value.pairingId,presentationGuid:_})}),{isMobilePairingConnected:c,isMobilePairingModalOpen:s,isMobileScreenShareActive:f,mobilePairing:l,mobilePairingErrorText:u,closeMobilePairingModal:p,openMobilePairingModal:S,refreshMobilePairing:v,stopMobileScreenShare:y}},EE=(e,t)=>{const n=new Set,i=r=>{n.add(r.identity)};return{handleParticipantConnected:r=>{const o=n.has(r.identity);i(r),t()&&!o&&r.identity!==e()&&jg()},handleParticipantDisconnected:r=>{n.delete(r.identity)},rememberParticipant:i,reset:()=>{n.clear()}}},ME=e=>Array.from(e.localParticipant.trackPublications.values()).map(t=>t.track).filter(t=>t!==void 0),AE=async e=>{const t=ME(e);return t.length?(await e.localParticipant.unpublishTracks(t),!0):!1},PE=(e,t)=>{const n=()=>e.value?.localParticipant.getTrackPublication(Mt.Source.Microphone)?.audioTrack??null,i=()=>e.value?.localParticipant.getTrackPublication(Mt.Source.Camera)?.videoTrack??null;return{getActiveCameraMediaTrack:()=>(t.value,i()?.mediaStreamTrack??null),getActiveCameraTrack:i,getActiveMicrophoneTrack:()=>n(),getPublishedLocalMicrophoneTrack:n}},Z3=e=>!e.isLocal,e0=e=>!e.isLocal,_E=({handleTrackSubscribed:e,handleTrackUnsubscribed:t,onDisconnected:n,onActiveSpeakersChanged:i,onLocalParticipantMetadataChanged:a,onLocalTrackStateChanged:r,onParticipantConnected:o,onParticipantDisconnected:s,removeParticipantTracks:l,room:u,syncRemoteParticipantMicrophoneStatus:c,trackMobileParticipant:m,trackOnlineParticipant:f,trackViewerParticipant:h,untrackMobileParticipant:d,untrackOnlineParticipant:y,untrackViewerParticipant:S})=>{const p=M=>{o(M),m(M),f(M),h(M)},v=(M,k)=>{if(!Z3(k)){a(k);return}m(k),f(k),h(k)},_=(M,k)=>{Z3(k)&&(f(k),h(k))},T=M=>{s(M),d(M),y(M),S(M),l(M)},w=(M,k)=>{if(e0(k)){c(k),f(k);return}r()},E=(M,k)=>{if(e0(k)){c(k),f(k);return}r()};return u.on(be.ActiveSpeakersChanged,i).on(be.TrackSubscribed,e).on(be.TrackUnsubscribed,t).on(be.ParticipantConnected,p).on(be.ParticipantMetadataChanged,v).on(be.ParticipantPermissionsChanged,_).on(be.ParticipantDisconnected,T).on(be.LocalTrackPublished,r).on(be.LocalTrackUnpublished,r).on(be.TrackMuted,w).on(be.TrackUnmuted,E).on(be.Disconnected,n),u.localParticipant.on(be.LocalTrackPublished,r).on(be.LocalTrackUnpublished,r).on(be.TrackMuted,r).on(be.TrackUnmuted,r),()=>{u.off(be.ActiveSpeakersChanged,i).off(be.TrackSubscribed,e).off(be.TrackUnsubscribed,t).off(be.ParticipantConnected,p).off(be.ParticipantMetadataChanged,v).off(be.ParticipantPermissionsChanged,_).off(be.ParticipantDisconnected,T).off(be.LocalTrackPublished,r).off(be.LocalTrackUnpublished,r).off(be.TrackMuted,w).off(be.TrackUnmuted,E).off(be.Disconnected,n),u.localParticipant.off(be.LocalTrackPublished,r).off(be.LocalTrackUnpublished,r).off(be.TrackMuted,r).off(be.TrackUnmuted,r)}},CE=()=>new qg({adaptiveStream:!0,dynacast:!0,videoCaptureDefaults:Av,publishDefaults:Pv}),IE=({localParticipant:e,roomRef:t})=>{const n=Vi(null),i=Vi(null),a=Vi(null),r=Vi(null),o=()=>
187{i.value?.detach().forEach(h=>{h.remove()}),i.value=null,n.value=null},s=()=>{r.value?.detach().forEach(h=>{h.remove()}),r.value=null,a.value=null},l=()=>t.value?.localParticipant.getTrackPublication(Mt.Source.Camera)?.videoTrack??null,u=()=>t.value?.localParticipant.getTrackPublication(Mt.Source.ScreenShare)?.videoTrack??null;return{detachLocalCamera:o,detachLocalScreenShare:s,localCamera:n,localScreenShare:a,setPublishedLocalCameraQuality:h=>{const d=l();d&&d.setPublishingQuality(h)},syncLocalCamera:()=>{const h=e.value,d=l();if(!h||!d||!t.value?.localParticipant.isCameraEnabled){o();return}i.value===d&&n.value||(o(),i.value=d,n.value={element:mo(d.attach(),{isMuted:!0}),participantIdentity:`local:${h.identity}`,participantName:h.name,source:"local_camera"})},syncLocalScreenShare:()=>{const h=e.value,d=u();if(!h||!d||!t.value?.localParticipant.isScreenShareEnabled){s();return}r.value===d&&a.value||(s(),r.value=d,a.value={element:mo(d.attach(),{isMuted:!0}),kind:"desktop",label:"Ваш экран",participantIdentity:`local-screen:${h.identity}`,participantName:h.name,source:"local_screen_share"})}}},LE=({currentPresentationGuid:e,isLocalParticipantOnline:t,localParticipant:n,permissionRole:i})=>{const a=D(new Map),r=D(new Map),o=D(new Set),s=g(()=>[...new Set(a.value.values())]),l=g(()=>i.value==="viewer"||o.value.size>0),u=g(()=>[...r.value.values()]),c=g(()=>{const E=[...t.value&&n.value&&i.value?[{...n.value,isModerator:n.value.isModerator===!0,role:i.value}]:[],...u.value];return[...E.filter(M=>M.role==="presenter"),...E.filter(M=>M.role==="viewer")]}),m=g(()=>c.value.length),f=E=>{const M=ho(E.metadata);return M?.kind!=="mobile_screen"||M.presentationGuid!==e.value||!M.pairingId?null:M.pairingId},h=E=>ho(E.metadata)?.kind==="mobile_screen",d=E=>{const M=ho(E.metadata);return M?M.kind!=="viewer"?!1:!M.presentationGuid||M.presentationGuid===e.value:E.permissions?.canSubscribe===!0&&E.permissions.canPublishData===!1};return{connectedMobilePairingIds:s,hasViewerParticipant:l,onlineParticipantCount:m,onlineParticipants:c,resetConnectedParticipants:()=>{a.value=new Map,r.value=new Map,o.value=new Set},resolveMobilePairingId:f,trackMobileParticipant:E=>{const M=f(E);M&&(a.value=new Map([...a.value,[E.identity,M]]))},trackOnlineParticipant:E=>{const M=new Map(r.value),k=ho(E.metadata);h(E)?M.delete(E.identity):M.set(E.identity,{...k?.avatarUrl?{avatarUrl:k.avatarUrl}:{},identity:E.identity,isMicrophoneEnabled:E.isMicrophoneEnabled===!0,isModerator:k?.isModerator??!1,name:E.name?.trim()||E.identity,role:d(E)?"viewer":"presenter"}),r.value=M},trackViewerParticipant:E=>{const M=new Set(o.value);d(E)?M.add(E.identity):M.delete(E.identity),o.value=M},untrackMobileParticipant:E=>{if(!a.value.has(E.identity))return;const M=new Map(a.value);M.delete(E.identity),a.value=M},untrackOnlineParticipant:E=>{if(!r.value.has(E.identity))return;const M=new Map(r.value);M.delete(E.identity),r.value=M},untrackViewerParticipant:E=>{if(!o.value.has(E.identity))return;const M=new Set(o.value);M.delete(E.identity),o.value=M}}},RE=({resolveMobilePairingId:e,trackMobileParticipant:t})=>{const n=Vi([]),i=Vi([]),a=Vi([]),r=()=>{n.value=[],i.value=[],a.value=[]},o=d=>d.isMicrophoneEnabled===!0,s=d=>d.isCameraEnabled!==!1,l=d=>{const y=o(d);i.value=i.value.map(p=>p.participantIdentity===d.identity?{...p,isCameraEnabled:s(d),isMicrophoneEnabled:y}:p);const S=sc(d,Mt.Source.Microphone);a.value.forEach(p=>{p.participantIdentity===S&&(p.element.muted=!y)})},u=d=>{n.value=n.value.filter(y=>y.participantIdentity!==d.identity),i.value=i.value.filter(y=>y.participantIdentity!==d.identity),a.value=a.value.filter(y=>!y.participantIdentity.startsWith(`${d.identity}:`))},c=(d,y,S)=>{if(d.detach().forEach(v=>{v.remove()}),e(S)&&(y===Mt.Source.Camera||y===Mt.Source.ScreenShare)){n.value=n.value.filter(v=>v.participantIdentity!==S.identity),i.value=i.value.filter(v=>v.participantIdentity!==S.identity);return}if(y===Mt.Source.ScreenShare){n.value=n.value.filter(v=>v.participantIdentity!==S.identity);return}if(y===Mt.Source.Camera){i.value=i.value.filter(v=>v.participantIdentity!==S.identity);return}if(y===Mt.Source.Microphone||y===Mt.Source.ScreenShareAudio){const v=sc(S,y);a.value=a.value.filter(_=>_.participantIdentity!==v)}},m=(d,y,S)=>{const p=y.identity,v=m2(y),_={element:mo(d.attach(),{isMuted:!0}),kind:S?"mobile":"desktop",label:S?"Экран телефона":"Экран ПК",pairingId:S??void 0,participantIdentity:p,participantName:v,source:"screen_share"};n.value=[...n.value.filter(T=>T.participantIdentity!==p),_],S&&(i.value=i.value.filter(T=>T.participantIdentity!==p),t(y))};return{handleTrackSubscribed:(d,y,S)=>{const p=S.identity,v=m2(S),_=e(S);if(y.source===Mt.Source.ScreenShare){m(d,S,_);return}
187if(y.source===Mt.Source.Camera){if(_){m(d,S,_);return}const T={element:mo(d.attach(),{isMuted:!0}),isCameraEnabled:s(S),isMicrophoneEnabled:o(S),participantIdentity:p,participantName:v,source:"camera"};i.value=[...i.value.filter(w=>w.participantIdentity!==p),T];return}if(y.source===Mt.Source.Microphone||y.source===Mt.Source.ScreenShareAudio){const T=sc(S,y.source),w={element:mo(d.attach(),{isMuted:y.isMuted===!0||y.source===Mt.Source.Microphone&&!o(S)}),participantIdentity:T,participantName:v};a.value=[...a.value.filter(E=>E.participantIdentity!==T),w],l(S)}},handleTrackUnsubscribed:(d,y,S)=>{c(d,y.source,S),l(S)},remoteAudioElements:a,remoteCameras:i,remoteScreenShareSources:n,removeParticipantTracks:u,resetRemoteTracks:r,syncRemoteParticipantMicrophoneStatus:l}},$E=({localParticipant:e,permissionRole:t})=>{const n=q9(),i=D(n.meetingAudioVolume),a=D(!1),r=()=>{j9({meetingAudioVolume:i.value})},o=l=>{i.value=Xo(l),r()},s=()=>{a.value=t.value==="presenter"||e.value?.isModerator===!0};return{meetingAudioVolume:Rn(i),participantJoinSoundEnabled:Rn(a),setMeetingAudioVolume:o,syncParticipantJoinSoundDefault:s}},t0=(e,t)=>({...e,isModerator:ho(t)?.isModerator??!1}),FE=()=>{const e=Vi(null),t=D(null),n=D(null),i=D("idle"),a=D(null),r=D(null),o=D(null),s=D(Lo()),l=D(Ys()),u=D(0),c=D(!1),m=D(!1),f=D(!1),h=D(new Set),d=PE(e,u);let y=null;const{detachLocalCamera:S,detachLocalScreenShare:p,localCamera:v,localScreenShare:_,setPublishedLocalCameraQuality:T,syncLocalCamera:w,syncLocalScreenShare:E}=IE({localParticipant:n,roomRef:e}),M=Ub({onRequestCameraQualityDowngrade:()=>za(),onStateChange:Y=>{l.value=Y}}),k=g(()=>t.value?.role??null),{meetingAudioVolume:C,participantJoinSoundEnabled:O,setMeetingAudioVolume:L,syncParticipantJoinSoundDefault:oe}=$E({localParticipant:n,permissionRole:k}),ce=g(()=>t.value?.canPublishCamera===!0),ue=g(()=>t.value?.canPublishMicrophone===!0),je=g(()=>t.value?.canPublishScreenShare===!0),V=g(()=>e.value!==null&&i.value!=="ended"&&i.value!=="error"),{connectedMobilePairingIds:N,hasViewerParticipant:se,onlineParticipantCount:te,onlineParticipants:Ze,resetConnectedParticipants:et,resolveMobilePairingId:Kt,trackMobileParticipant:vt,trackOnlineParticipant:q,trackViewerParticipant:Me,untrackMobileParticipant:wt,untrackOnlineParticipant:qt,untrackViewerParticipant:Et}=LE({currentPresentationGuid:o,isLocalParticipantOnline:V,localParticipant:n,permissionRole:k}),Ot=EE(()=>n.value?.identity??"",()=>i.value==="connected"&&O.value&&te.value<10),la=g(()=>_.value?[...I.value,_.value]:I.value),{handleTrackSubscribed:_i,handleTrackUnsubscribed:Ci,remoteAudioElements:Ii,remoteCameras:ie,remoteScreenShareSources:I,removeParticipantTracks:Z,resetRemoteTracks:Li,syncRemoteParticipantMicrophoneStatus:Ri}=RE({resolveMobilePairingId:Kt,trackMobileParticipant:vt}
187),ca=()=>{u.value+=1},Vn=()=>{const Y=e.value;if(!Y){c.value=!1,m.value=!1,f.value=!1,ca();return}c.value=Y.localParticipant.isCameraEnabled,m.value=Y.localParticipant.isMicrophoneEnabled,f.value=Y.localParticipant.isScreenShareEnabled,ca()},jt=()=>{Vn(),w(),E()},ua=Y=>{h.value=new Set(Y.filter(ne=>!ne.isLocal&&ne.isMicrophoneEnabled===!0).map(ne=>ne.identity))},Ft=async()=>{const Y=d.getActiveCameraMediaTrack(),{advancedConstraints:ne}=s.value.camera;!Y||!ne||await Y.applyConstraints(ne)},$i=async Y=>{s.value.backgroundMode!=="disabled"&&await Y.setDegradationPreference("maintain-framerate")},za=async()=>{if(f.value)return!1;const Y=d.getActiveCameraTrack();if(!Y)return!1;const ne=Uv(s.value);return ne?(s.value={...s.value,camera:ne},await Y.restartTrack(oc(s.value,!1)),await Ft(),await $i(Y),w(),!0):(await Y.prioritizePerformance(),w(),!0)},Fi=async(Y=s.value)=>{s.value=Y;const ne=d.getActiveCameraTrack();l.value=await M.applyBackgroundSettings(ne,s.value),ne&&(ca(),S(),w())},da=async(Y=s.value)=>{if(s.value=Y,!e.value||!c.value||!ce.value)return;const ne=d.getActiveCameraTrack();if(!ne)return;const Ee=f.value;await ne.restartTrack(oc(s.value,Ee)),await Ft(),await $i(ne),await Fi(s.value),w()},di=async(Y=s.value)=>{if(s.value=Y,!e.value||!m.value||!ue.value)return;const Ee=d.getPublishedLocalMicrophoneTrack();Ee&&(await Ee.restartTrack(s.value.microphone),Vn())},Ka=async Y=>HT(e.value,Y),zn=async()=>{const Y=e.value;!Y||!await AE(Y)||(Vn(),S(),p())},Di=async()=>{const Y=e.value;y?.(),y=null,Ot.reset(),await zn(),e.value=null,i.value="ended",t.value=null,n.value=null,oe(),o.value=null,S(),p(),M.destroy(),l.value=Ys(),Li(),et(),h.value=new Set,Vn(),Y&&await Y.disconnect()},Zr=async Y=>{await Di(),i.value="connecting",a.value=null,r.value=null,t.value=Y.permission,n.value=Y.participant,oe(),o.value=Y.presentationGuid;const ne=CE();e.value=ne,y=_E({handleTrackSubscribed:_i,handleTrackUnsubscribed:Ci,onDisconnected:Ee=>{y?.(),y=null,Ot.reset(),r.value=Ee??null,i.value="ended",h.value=new Set,et(),jt()},onActiveSpeakersChanged:ua,onLocalParticipantMetadataChanged:Ee=>{n.value=t0(n.value??Y.participant,Ee.metadata),oe()},onLocalTrackStateChanged:jt,onParticipantConnected:Ot.handleParticipantConnected,onParticipantDisconnected:Ot.handleParticipantDisconnected,removeParticipantTracks:Z,room:ne,syncRemoteParticipantMicrophoneStatus:Ri,trackMobileParticipant:vt,trackOnlineParticipant:q,trackViewerParticipant:Me,untrackMobileParticipant:wt,untrackOnlineParticipant:qt,untrackViewerParticipant:Et});try{await ne.connect(Y.livekitUrl,Y.participantToken),n.value=t0(Y.participant,ne.localParticipant.metadata),oe(),ne.remoteParticipants.forEac
187h(Ee=>{Ot.rememberParticipant(Ee),vt(Ee),q(Ee),Me(Ee)}),i.value="connected",jt()}catch(Ee){a.value=ps(Ee),i.value="error",r.value=null,y?.(),y=null,Ot.reset(),await ne.disconnect(),e.value=null,o.value=null,Vn()}},qa=async()=>{const Y=e.value;if(!(!Y||!ce.value))try{const ne=!c.value,Ee=ne&&!f.value?M.buildInitialProcessor(s.value):void 0,to=f.value?f0:oc(s.value,!1,Ee),no=f.value?_v:xv(s.value,!1);if(await Y.localParticipant.setCameraEnabled(ne,ne?to:void 0,ne?no:void 0),ne){await Ft();const ma=d.getActiveCameraTrack();ma&&(Ee&&M.markInitialProcessorAttached(ma),await $i(ma)),await Fi(s.value)}jt()}catch(ne){a.value=ps(ne)}},eo=async()=>{const Y=e.value;if(!(!Y||!ue.value))try{const ne=!m.value;await Y.localParticipant.setMicrophoneEnabled(ne),Vn(),ne&&await di(s.value),E()}catch(ne){a.value=ps(ne)}},ha=async(Y=s.value)=>{const ne=e.value;if(!(!ne||!je.value))try{s.value=Y;const Ee=!f.value;await ne.localParticipant.setScreenShareEnabled(Ee,Ee?Rv(Y):void 0,Ee?$v(Y):void 0),c.value&&T(Ee?o2.LOW:o2.HIGH),jt()}catch(Ee){a.value=ps(Ee)}},ja=Y=>{const ne=M.handleSenderStatsSnapshot(Y);ne&&(l.value=ne)};return Gg()&&Lt(Di),{activeSpeakerIdentities:Rn(h),canPublishCamera:ce,canPublishMicrophone:ue,canPublishScreenShare:je,connectedMobilePairingIds:N,applyAudioOutputDevice:Ka,applyBackgroundSettings:Fi,applyCameraSettings:da,applyMicrophoneSettings:di,backgroundProcessorState:Rn(l),connectToSession:Zr,disconnectFromSession:Di,disconnectReason:Rn(r),errorText:Rn(a),getActiveCameraMediaTrack:d.getActiveCameraMediaTrack,getActiveCameraTrack:d.getActiveCameraTrack,getActiveMicrophoneTrack:d.getActiveMicrophoneTrack,hasViewerParticipant:se,isCameraEnabled:Rn(c),isMicrophoneEnabled:Rn(m),isScreenShareEnabled:Rn(f),localCamera:v,localParticipantIdentity:g(()=>n.value?.identity??null),localScreenShare:_,meetingAudioVolume:Rn(C),onlineParticipantCount:te,onlineParticipants:Ze,permissionRole:k,releaseLocalTracksForDisconnect:zn,remoteAudioElements:Ii,remoteCameras:ie,screenShareSources:la,setMeetingAudioVolume:L,status:Rn(i),syncBackgroundSenderStatsSnapshot:ja,toggleCamera:qa,toggleMicrophone:eo,toggleScreenShare:ha}},DE=()=>na({mutationFn:async e=>{const t=await Pi.startPresentationLiveKitRecording(e);return Q1(t.data)}}),xE=()=>na({mutationFn:async e=>{const t=await Pi.stopPresentationLiveKitRecording(e);return Q1(t.data)}}),BE=2e3,OE=e=>{if(typeof e!="object"||e===null||!("response"in e))return null;const t=e.response;return typeof t!="object"||t===null||!("status"in t)||typeof t.status!="number"?null:t.status},Z4=e=>e==="starting"||e==="recording"||e==="stopping",UE=(e,t=null,n=!0)=>{const i=g(()=>he(e)?.trim()??"");return hv({queryKey:g(()=>["presentation-livekit-recording",i.value]),queryFn:async()=>{try{const a=await Pi.fetchPresentationLiveKitRecording(i.value);return OT(a.data)}catch(a){const r=OE(a);if(r===403||r===404)return null;throw a}},enabled:g(()=>!!i.value&&he(n)),refetchInterval:a=>Z4(he(t)??a.state.data?.status)?BE:!1,refetchOnWindowFocus:!1,retry:!1})},NE="Не удалось запустить запись встречи",GE="Не удалось остановить запись встречи",VE="Не удалось выполнить операцию записи",zE="Включите камеру, микрофон или демонстрацию экрана перед запуском записи",KE=(e,t=!0,n=!0)=>{const i=D(!1),a=D(!1),r=D(null),o=D(null),s=g(()=>r.value?.status??null),l=UE(e,s,i),u=DE(),c=xE(),m=g(()=>he(e)?.trim()??""),f=g(()=>s.value??l.data.value?.status??null),h=g(()=>Z4(f.value)),d=g(()=>u.isPending.value||c.isPending.value);Ie(l.data,T=>{T&&(T.status==="failed"?o.value!==T.recordingId&&(rc.error(T.errorMessage||VE),o.value=T.recordingId):o.value=null,r.value?.recordingId===T.recordingId&&(r.value=T.status==="ready"||T.status==="failed"?null:{recordingId:T.recordingId,presentationGuid:T.presentationGuid,status:T.status}))},{immediate:!0});const y=(T,w)=>{rc.error(Hg(T)??w)},S=async()=>{if(!(!m.value||d.value)){if(!he(n)){a.value=!0;return}if(!he(t)){rc.error(zE);return}try{r.value=await u.mutateAsync(m.value),i.value=!0,l.refetch()}catch(T){if(Rg(T)){a.value=!0;return}y(T,NE)}}},p=async()=>
187{if(!(!m.value||d.value))try{r.value=await c.mutateAsync(m.value),l.refetch()}catch(T){y(T,GE)}};return{closeRecordingSubscriptionGate:()=>{a.value=!1},isRecordingActive:h,isRecordingLoading:d,isRecordingSubscriptionGateOpen:a,toggleRecording:async()=>{if(h.value){await p();return}await S()}}},qE=({activePresentationGuid:e,connectToSession:t,disconnectFromSession:n,joinAttemptRevision:i,joinPresentation:a,joinedParticipantIdentity:r,requestedInviteToken:o,requestedPresentationGuid:s,status:l,updateParticipantRole:u})=>{const c=D(null);return{joinMeeting:async f=>{if(!f||c.value===f||e.value===f&&l.value!=="ended"&&l.value!=="error")return;const h=i.value+1;i.value=h,c.value=f;try{r.value=null;const d=o.value.trim(),y=await a({presentationGuid:f,...d?{inviteToken:d}:{}});if(h!==i.value||s.value!==f||(r.value=y.participant.identity,u(y.permission.role),await t(y),h!==i.value||s.value!==f))return;e.value=f}catch{r.value=null,h===i.value&&s.value===f&&await n()}finally{c.value===f&&(c.value=null)}}}},jE=({isStartingNewMeeting:e,requestedParticipantLabel:t,returnToLiveMeeting:n,startMeeting:i})=>({handleStartNewMeeting:async()=>{if(!e.value)try{const r=await i(),o=r.presenter?.displayName?.trim()||t.value.trim()||"Организатор";await n(r.guid,{participantLabel:o}),Yg({inviteToken:r.inviteToken??"",inviteUrl:r.inviteUrl??"",isInstantMeeting:!0,participantLabel:o,presentationGuid:r.guid})}catch{mi.error({content:"Не удалось запустить новую встречу"})}}}),WE=e=>{const{hasFloatingTiles:t,isLiveMeetingRoute:n,shouldRenderControls:i}=e,a=e.isMobileViewport??Ai(),r=g(()=>!a.value);return{shouldRenderCollapsedCameraPreviews:()=>r.value&&i.value&&!n.value&&t.value,shouldRenderFloatingCameraPreviews:r}},HE=({inviteToken:e,inviteUrl:t,participantLabel:n,presentationGuid:i})=>{const a=t.trim();if(a)return a;const r=i.trim();if(!r)return"";const o=`/presentations/${encodeURIComponent(r)}/live`,s=typeof window>"u"?new URL(o,"https://101-app.local"):new URL(o,window.location.origin),l=n.trim(),u=e.trim();return u?s.searchParams.set("inviteToken",u):l&&s.searchParams.set("participants",l),typeof window>"u"?`${s.pathname}${s.search}`:s.toString()},XE=()=>{const e=g(()=>Wa.value?.presentationGuid??""),t=g(()=>Wa.value?.participantLabel??""),n=g(()=>Wa.value?.inviteRecipientPeerGuids??[]),i=g(()=>Wa.value?.inviteToken??""),a=g(()=>Wa.value?.inviteUrl??""),r=g(()=>Wa.value?.isInstantMeeting===!0);return{inviteUrl:g(()=>HE({inviteToken:i.value,inviteUrl:a.value,participantLabel:t.value,presentationGuid:e.value})),isInstantMeeting:r,requestedInviteRecipientPeerGuids:n,requestedInviteToken:i,requestedInviteUrl:a,requestedParticipantLabel:t,requestedPresentationGuid:e}},eg=(e,t)=>typeof e.bytesSent!="number"||!t||typeof t.bytesSent!="number"||e.timestamp<=t.timestamp?0:Math.round((e.bytesSent-t.bytesSent)*8*1e3/(e.timestamp-t.timestamp)),YE=(e,t,n)=>e?{bitrate:eg(e,n),bytesSent:e.bytesSent,frameHeight:e.frameHeight,frameWidth:e.frameWidth,framesDropped:t?.framesDropped,framesEncoded:t?.framesEncoded,framesPerSecond:e.framesPerSecond,packetsLost:e.packetsLost,packetsSent:e.packetsSent,qualityLimitationReason:e.qualityLimitationReason,qualityLimitationResolutionChanges:t?.qualityLimitationResolutionChanges,roundTripTime:e.roundTripTime,targetBitrate:e.targetBitrate,timestamp:e.timestamp,totalEncodeTime:t?.totalEncodeTime}:null,JE=(e,t)=>e?{bitrate:eg(e,t),bytesSent:e.bytesSent,packetsLost:e.packetsLost,packetsSent:e.packetsSent,roundTripTime:e.roundTripTime,timestamp:e.timestamp}:null,QE=e=>typeof e=="object"&&e!==null,vs=(e,t)=>typeof e[t]=="number"?e[t]:void 0,ZE=e=>QE(e)?e.type==="outbound-rtp"&&(e.kind==="video"||e.mediaType==="video"):!1,eM=e=>{if(!e)return null;const t=[];e.forEach(i=>{t.push(i)});const n=t.find(ZE);return n?{framesDropped:vs(n,"framesDropped"),framesEncoded:vs(n,"framesEncoded"),qualityLimitationResolutionChanges:vs(n,"qualityLimitationResolutionChanges"),totalEncodeTime:vs(n,"totalEncodeTime")}:null},tM=async({cameraTrack:e,microphoneTrack:t,previousSnapshot:n=null})=>{const[i,a,r]=await Promise.all([e?.getSenderStats()??Promise.resolve([]),t?.getSenderStats()??Promise.resolve(void 0),e?.getRTCStatsReport?.()??Promise.resolve(void 0)]),o=i[0],s=eM(r);
187return{audio:JE(a,n?.audio??null),collectedAt:Date.now(),video:YE(o,s,n?.video??null)}},nM=e=>{const t=D(null);let n=null;const i=async()=>{t.value=await tM({cameraTrack:he(e.cameraTrack),microphoneTrack:he(e.microphoneTrack),previousSnapshot:t.value})},a=()=>{n&&(clearInterval(n),n=null)};return Ie(g(()=>he(e.isActive)),r=>{a(),r&&(i(),n=setInterval(()=>{i()},2e3))},{immediate:!0}),Lt(a),{collect:i,snapshot:t,stop:a}},iM=e=>W4({get activeSpeakerIdentities(){return e.activeSpeakerIdentities.value},get isLocalMicrophoneEnabled(){return e.isLocalMicrophoneEnabled.value},get localCamera(){return e.localCamera.value},get localParticipantIdentity(){return e.localParticipantIdentity.value},get onlineParticipants(){return e.onlineParticipants.value},get remoteCameras(){return e.remoteCameras.value},get screenShareSources(){return e.screenShareSources.value}}),aM="presentation-livekit-stage-outlet",rM=e=>{const t=D(!1);let n=null;const i=()=>{n?.disconnect(),n=null},a=()=>(t.value=typeof document<"u"&&document.getElementById(aM)!==null,t.value&&i(),t.value),r=()=>{i(),!(!e.value||typeof document>"u"||typeof MutationObserver>"u")&&(n=new MutationObserver(a),n.observe(document.body,{childList:!0,subtree:!0}))},o=async()=>{await Ku(),a()||r()};return Ie(e,()=>{o()},{immediate:!0}),Oa(()=>{o()}),Vg(()=>{e.value&&!t.value&&o()}),Lt(i),{shouldRenderStage:()=>e.value&&t.value}},oM=()=>{const{profile:e}=m0();return{hasProPlusSubscription:g(()=>$g(e.value,"pro_plus"))}},sM=()=>{const{profile:e}=m0(),{hasProPlusSubscription:t}=oM(),n=jT(),i=Jg(),a=qT(),r=KT(),o=WT(),{activeSpeakerIdentities:s,applyAudioOutputDevice:l,applyBackgroundSettings:u,applyCameraSettings:c,applyMicrophoneSettings:m,backgroundProcessorState:f,canPublishCamera:h,canPublishMicrophone:d,canPublishScreenShare:y,connectedMobilePairingIds:S,connectToSession:p,disconnectReason:v,disconnectFromSession:_,errorText:T,getActiveCameraMediaTrack:w,getActiveCameraTrack:E,getActiveMicrophoneTrack:M,hasViewerParticipant:k,isCameraEnabled:C,isMicrophoneEnabled:O,isScreenShareEnabled:L,localCamera:oe,localParticipantIdentity:ce,meetingAudioVolume:ue,onlineParticipantCount:je,onlineParticipants:V,permissionRole:N,releaseLocalTracksForDisconnect:se,remoteAudioElements:te,remoteCameras:Ze,screenShareSources:et,setMeetingAudioVolume:Kt,status:vt,syncBackgroundSenderStatsSnapshot:q,toggleCamera:Me,toggleMicrophone:wt,toggleScreenShare:qt}=FE(),{isLiveMeetingRoute:Et,returnToLiveMeeting:Ot,returnToMyProfile:la,returnToPreviousScreen:_i,returnToPresentationDetails:Ci,returnToPresentationReschedule:Ii}=mv(),{shouldRenderStage:ie}=rM(Et),I=D(null),Z=D(null),Li=D(0),{inviteUrl:Ri,isInstantMeeting:ca,requestedInviteRecipientPeerGuids:Vn,requestedInviteToken:jt,requestedParticipantLabel:ua,requestedPresentationGuid:Ft}=XE(),$i=g(()=>n.isPending.value||vt.value==="connecting"),za=g(()=>a.isPending.value),Fi=g(()=>i.isPending.value),da=g(()=>n.isError.value?QT(n.error.value)||"Не удалось получить доступ к встрече":Ft.value?null:"Не найдена встреча для подключения"),di=g(()=>da.value?da.value:vt.value==="error"&&T.value?T.value:null),Ka=g(()=>pE({activePresentationGuid:I.value,disconnectReason:v.value,status:vt.value}));eE({joinErrorText:da,roomErrorText:T}),tE({inviteToken:jt,joinError:n.error,returnToMyProfile:la});const zn=g(()=>N.value==="presenter"),Di=g(()=>zn.value),Zr=()=>{Et.value&&_i(zn.value?"organizer-presentations":"presentation-details")},qa=g(()=>I.value!==null&&!$i.value&&!di.value&&!Ka.value),eo=()=>Et.value?"Выйти":"Вернуться",ha=g(()=>zn.value&&!k.value),ja=g(()=>{if(N.value!=="viewer")return null;const Ln=Ft.value.trim(),i2=Z.value?.trim()??"";return!Ln||!i2?null:lE(Ln,i2)}),{endMeetingDurationLabel:Y,endMeetingWaitingDurationLabel:ne,meetingDurationLabel:Ee,meetingDurationTone:to,waitingDurationLabel:no}=dE({blockingErrorText:di,hasViewerParticipant:k,isOrganizer:zn,isJoinPending:n.isPending,meetingDurationStorageKey:ja,status:vt}),ma=g(()=>ha.value?no.value:Ee.value),Z1=g(()=>ha.value?"default":to.value),ae=g(()=>zn.value?ha.value?"Ожидание участника":"Длительность встречи":null),{isMicrophonePromptReady:de}=oE({blockingErrorText:di,isConnecting:$i,shouldUseMeetingTheme:Et}
187),tg=wE({applyAudioOutputDevice:l,applyBackgroundSettings:u,applyCameraSettings:c,applyMicrophoneSettings:m,getCameraMediaTrack:w}),ng=g(()=>f.value.effectiveMode!=="disabled"),ig=nM({cameraTrack:E,isActive:ng,microphoneTrack:M});Ie(()=>ig.snapshot.value,Ln=>{q(Ln)});const ag=g(()=>Y4()),{isMobilePairingConnected:rg,isMobilePairingModalOpen:og,isMobileScreenShareActive:e2,mobilePairing:sg,mobilePairingErrorText:lg,closeMobilePairingModal:cg,openMobilePairingModal:ug,refreshMobilePairing:dg,stopMobileScreenShare:hg}=TE({canPublishScreenShare:y,connectedMobilePairingIds:S,createMobilePairingMutation:r,inviteToken:jt,presentationGuid:Ft,revokeMobilePairingMutation:o,screenShareSources:et}),mg=g(()=>C.value||O.value||L.value||e2.value||te.value.length>0||Ze.value.length>0||et.value.length>0),fg=g(()=>V.value.map(Ln=>Ln.name)),t2=KE(Ft,mg,t),{floatingCameraTiles:pg,hasFloatingTiles:gg}=iM({activeSpeakerIdentities:s,isLocalMicrophoneEnabled:O,localCamera:oe,localParticipantIdentity:ce,onlineParticipants:V,remoteCameras:Ze,screenShareSources:et}),vg=WE({hasFloatingTiles:gg,isLiveMeetingRoute:Et,shouldRenderControls:qa}),{shouldRenderCollapsedCameraPreviews:bg,shouldRenderFloatingCameraPreviews:yg}=vg;function n2(){Ag(),t2.closeRecordingSubscriptionGate(),I.value=null,Z.value=null,s2()}const{closeEndMeetingConfirmation:Sg,confirmEndMeeting:kg,handleEndMeetingConfirmationOpenUpdate:wg,handleRescheduleMeeting:Tg,isEndMeetingConfirmationOpen:Eg,openEndMeetingConfirmation:Mg,resetEndMeetingConfirmation:Ag}=nE({activePresentationGuid:I,canEndMeeting:Di,disconnectFromSession:_,endMeeting:a.mutateAsync,isEndingMeeting:za,releaseLocalTracksForDisconnect:se,requestedPresentationGuid:Ft,resetRuntimeState:n2,returnToPresentationReschedule:Ii}),{joinMeeting:Pg}=qE({activePresentationGuid:I,connectToSession:Ln=>p(ZT(Ln,e.value)),disconnectFromSession:async()=>{await _(),s2()},joinAttemptRevision:Li,joinPresentation:n.mutateAsync,joinedParticipantIdentity:Z,requestedInviteToken:jt,requestedPresentationGuid:Ft,status:vt,updateParticipantRole:Qg}),_g=async()=>{await _(),n2()},Cg=()=>{if(Et.value){_g();return}Ot(Ft.value,{inviteToken:jt.value,participantLabel:ua.value})},{handleStartNewMeeting:Ig}=jE({isStartingNewMeeting:Fi,requestedParticipantLabel:ua,returnToLiveMeeting:Ot,startMeeting:i.mutateAsync}),Lg=async()=>{Et.value||await Ot(Ft.value,{inviteToken:jt.value,participantLabel:ua.value})};return Ie(Ft,Ln=>{Ln&&Pg(Ln)},{immediate:!0}),{activePresentationGuid:I,activeSpeakerIdentities:s,blockingErrorText:di,backgroundProcessorState:f,canEndMeeting:Di,canPublishCamera:h,canPublishMicrophone:d,canPublishScreenShare:y,closeEndMeetingConfirmation:Sg,canSelectAudioOutput:ag,closeMobilePairingModal:cg,confirmEndMeeting:kg,controlsDurationLabel:ma,controlsDurationTone:Z1,controlsDurationTooltipTitle:ae,mediaSettings:tg,createMobilePairingMutation:r,endMeetingDurationLabel:Y,endMeetingWaitingDurationLabel:ne,floatingCameraTiles:pg,getLeaveControlLabel:eo,handleEndMeetingConfirmationOpenUpdate:wg,handleLeaveControlClick:Cg,handleStartNewMeeting:Ig,handleRescheduleMeeting:Tg,hasViewerParticipant:k,inviteRecipientPeerGuids:Vn,inviteUrl:Ri,isInstantMeeting:ca,isLiveMeetingRoute:Et,isCameraEnabled:C,isEndMeetingConfirmationOpen:Eg,isEndingMeeting:za,isMicrophoneEnabled:O,isMicrophonePromptReady:de,isStartingNewMeeting:Fi,isMobilePairingConnected:rg,isMobilePairingModalOpen:og,isMobileScreenShareActive:e2,isScreenShareEnabled:L,localCamera:oe,localParticipantIdentity:ce,meetingAudioVolume:ue,meetingStatusText:Ka,minimizeMeeting:Zr,mobilePairing:sg,mobilePairingErrorText:lg,onlineParticipantCount:je,onlineParticipants:V,openEndMeetingConfirmation:Mg,openMobilePairingModal:ug,presentationParticipantCount:je,presentationParticipantNames:fg,refreshMobilePairing:dg,remoteAudioElements:te,remoteCameras:Ze,restoreCameraPreviews:Lg,returnToPresentationDetails:Ci,revokeMobilePairingMutation:o,screenShareSources:et,setMeetingAudioVolume:Kt,shouldRenderCollapsedCameraPreviews:bg,shouldRenderControls:qa,shouldRenderFloatingCameraPreviews:yg,shouldRenderStage:ie,status:vt,stopMobileScreenShare:hg,toggleCamera:Me,toggleMicrophone:wt,...t2,toggleScreenShare:qt}},IP=Te({__name:"PresentationLiveKitRuntimeHost",emits:["return-to-live-meeting"],setup(e,{emit:t}){const{activePresentationGuid:n,activeSpeakerIdentities:i,backgroundProcessorState:a,blockingErrorText:r,canEndMeeting:o,canPublishCamera:s,canPublishMicrophone:l,canPublishScreenShare:u,canSelectAudioOutput:c,closeEndMeetingConfirmation:m,closeRecordingSubscriptionGate:f,closeMobilePairingModal:h,confirmEndMeeting:d,controlsDurationLabel:y,controlsDurationTone:S,controlsDurationTooltipTitle:p,mediaSettings:v,createMobilePairingMutation:_,endMeetingDurationLabel:T,endMeetingWaitingDurationLabel:w,floatingCameraTiles:E,getLeaveControl
187Label:M,handleEndMeetingConfirmationOpenUpdate:k,handleLeaveControlClick:C,handleStartNewMeeting:O,handleRescheduleMeeting:L,hasViewerParticipant:oe,inviteRecipientPeerGuids:ce,inviteUrl:ue,isInstantMeeting:je,isLiveMeetingRoute:V,isCameraEnabled:N,isEndMeetingConfirmationOpen:se,isEndingMeeting:te,isMicrophoneEnabled:Ze,isRecordingActive:et,isRecordingLoading:Kt,isRecordingSubscriptionGateOpen:vt,isMicrophonePromptReady:q,isStartingNewMeeting:Me,isMobilePairingConnected:wt,isMobilePairingModalOpen:qt,isMobileScreenShareActive:Et,isScreenShareEnabled:Ot,localCamera:la,localParticipantIdentity:_i,meetingAudioVolume:Ci,meetingStatusText:Ii,minimizeMeeting:ie,mobilePairing:I,mobilePairingErrorText:Z,onlineParticipantCount:Li,onlineParticipants:Ri,openEndMeetingConfirmation:ca,openMobilePairingModal:Vn,presentationParticipantCount:jt,presentationParticipantNames:ua,refreshMobilePairing:Ft,remoteAudioElements:$i,remoteCameras:za,restoreCameraPreviews:Fi,revokeMobilePairingMutation:da,screenShareSources:di,setMeetingAudioVolume:Ka,shouldRenderCollapsedCameraPreviews:zn,shouldRenderControls:Di,shouldRenderFloatingCameraPreviews:Zr,shouldRenderStage:qa,stopMobileScreenShare:eo,toggleCamera:ha,toggleMicrophone:ja,toggleRecording:Y,toggleScreenShare:ne}=sM(),Ee=t,to=()=>{V.value||Ee("return-to-live-meeting"),C()},no=VT(),ma=zT();return c9(l9({isOrganizer:o,localParticipantIdentity:_i,muteParticipant:no.mutateAsync,onlineParticipants:Ri,presentationGuid:n,setParticipantModerator:ma.mutateAsync})),(Z1,ae)=>(A(),$(an,null,[R(VS,{"audio-output-devices":b(v).audioOutputDevices.value,"background-images":b(v).backgroundImages.value,"background-processor-state":b(a),"can-end-meeting":b(o),"can-publish-camera":b(s),"can-publish-microphone":b(l),"can-publish-screen-share":b(u),"can-select-audio-output":b(c),"camera-capability-controls":b(v).cameraCapabilityControls.value,"camera-devices":b(v).cameraDevices.value,"is-camera-enabled":b(N),"is-ending-meeting":b(te),"is-microphone-enabled":b(Ze),"is-mobile-screen-share-active":b(Et),"is-recording-active":b(et),"is-recording-loading":b(Kt),"is-screen-share-enabled":b(Ot),"is-live-meeting-route":b(V),"invite-recipient-peer-guids":b(ce),"invite-url":b(ue),"leave-control-label":b(M)(),"meeting-duration-label":b(y),"meeting-duration-tone":b(S),"meeting-duration-tooltip-title":b(p),"meeting-audio-volume":b(Ci),"media-settings":b(v).settings.value,"microphone-devices":b(v).microphoneDevices.value,open:b(Di),"participant-count":b(jt),"participant-names":b(ua),"should-render-collapsed-camera-previews":b(zn)(),"floating-camera-tiles":b(E),onConnectPhone:ae[0]||(ae[0]=de=>{b(Vn)()}),onConfirmEnd:ae[1]||(ae[1]=de=>{b(d)()}),onDeleteBackgroundImage:ae[2]||(ae[2]=de=>{b(v).deleteBackgroundImage(de)}),onDisconnectPhone:ae[3]||(ae[3]=de=>{b(eo)()}),onEnd:b(ca),onLeave:to,onMinimize:b(ie),onSelectBackgroundImage:ae[4]||(ae[4]=de=>{b(v).selectBackgroundImage(de)}),onSelectBackgroundMode:ae[5]||(ae[5]=de=>
187{b(v).updateBackgroundMode(de)}),onRestoreCameraStack:ae[6]||(ae[6]=de=>{b(Fi)()}),onToggleRecording:ae[7]||(ae[7]=de=>{b(Y)()}),onToggleCamera:ae[8]||(ae[8]=de=>{b(ha)()}),onToggleMicrophone:ae[9]||(ae[9]=de=>{b(ja)()}),onToggleScreenShare:ae[10]||(ae[10]=de=>{b(ne)(b(v).settings.value)}),onUploadBackgroundFile:ae[11]||(ae[11]=de=>{b(v).updateBackgroundFile(de)}),onUpdateAudioOutputDevice:ae[12]||(ae[12]=de=>{b(v).updateAudioOutputDevice(de)}),onUpdateMicrophoneSettings:ae[13]||(ae[13]=de=>{b(v).updateMicrophoneSettings(de)}),onUpdateCameraSettings:ae[14]||(ae[14]=de=>{b(v).updateCameraSettings(de)}),onUpdateScreenShareSettings:ae[15]||(ae[15]=de=>{b(v).updateScreenShareSettings(de)}),"onUpdate:meetingAudioVolume":b(Ka)},null,8,["audio-output-devices","background-images","background-processor-state","can-end-meeting","can-publish-camera","can-publish-microphone","can-publish-screen-share","can-select-audio-output","camera-capability-controls","camera-devices","is-camera-enabled","is-ending-meeting","is-microphone-enabled","is-mobile-screen-share-active","is-recording-active","is-recording-loading","is-screen-share-enabled","is-live-meeting-route","invite-recipient-peer-guids","invite-url","leave-control-label","meeting-duration-label","meeting-duration-tone","meeting-duration-tooltip-title","meeting-audio-volume","media-settings","microphone-devices","open","participant-count","participant-names","should-render-collapsed-camera-previews","floating-camera-tiles","onEnd","onMinimize","onUpdate:meetingAudioVolume"]),R(_T,{"active-speaker-identities":b(i),"blocking-error-text":b(r),"has-viewer-participant":b(oe),"invite-recipient-peer-guids":b(ce),"invite-url":b(ue),"is-microphone-enabled":b(Ze),"is-starting-new-meeting":b(Me),"local-camera":b(la),"local-participant-identity":b(_i),"meeting-status-text":b(Ii),"online-participant-count":b(Li),"online-participants":b(Ri),"remote-cameras":b(za),"screen-share-sources":b(di),"should-render-floating-camera-previews":b(Zr),"should-render-stage":b(qa)(),"show-microphone-prompt":b(q),onMinimize:b(ie),onStartNewMeeting:ae[16]||(ae[16]=de=>{b(O)()}),onToggleMicrophone:ae[17]||(ae[17]=de=>{b(ja)()})},null,8,["active-speaker-identities","blocking-error-text","has-viewer-participant","invite-recipient-peer-guids","invite-url","is-microphone-enabled","is-starting-new-meeting","local-camera","local-participant-identity","meeting-status-text","online-participant-count","online-participants","remote-cameras","screen-share-sources","should-render-floating-camera-previews","should-render-stage","show-microphone-prompt","onMinimize"]),(A(!0),$(an,null,ji(b($i),de=>(A(),B(H1,{key:de.participantIdentity,element:de.element,volume:b(Ci)/100},null,8,["element","volume"]))),128)),R(Fg,{open:b(vt),title:"Запись встречи доступна в Pro Plus",description:"Сохраняйте видеовстречи, возвращайтесь к важным обсуждениям и делитесь записью с участниками. Подключите Pro Plus, чтобы начать запись.",onClose:b(f),"onUpdate:open":ae[18]||(ae[18]=de=>!de&&b(f)())},null,8,["open","onClose"]),R(uk,{"error-text":b(Z),"is-connected":b(wt),"is-creating":b(_).isPending.value,"is-revoking":b(da).isPending.value,open:b(qt),pairing:b(I),onClose:ae[19]||(ae[19]=de=>{b(h)()}),onRefresh:ae[20]||(ae[20]=de=>{b(Ft)()})},null,8,["error-text","is-connected","is-creating","is-revoking","open","pairing"]),R(Mv,{"can-close":!b(te),"is-instant-meeting":b(je),"meeting-duration-label":b(T),"is-ending-meeting":b(te),open:b(se),"waiting-duration-label":b(w),onClose:b(m),onConfirm:ae[21]||(ae[21]=de=>{b(d)()}),onReschedule:ae[22]||(ae[22]=de=>{b(L)()}),"onUpdate:open":b(k)},null,8,["can-close","is-instant-meeting","meeting-duration-label","is-ending-meeting","open","waiting-duration-label","onClose","onUpdate:open"])],64))}});export{IP as default};

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.