easyproctor 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/esm/index.js +41 -7
- package/index.js +41 -7
- package/new-flow/recorders/AlertRecorder.d.ts +1 -5
- package/package.json +1 -1
- package/unpkg/easyproctor.min.js +47 -10
package/unpkg/easyproctor.min.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";(()=>{var Um=Object.create;var ml=Object.defineProperty;var Nm=Object.getOwnPropertyDescriptor;var jm=Object.getOwnPropertyNames;var Vm=Object.getPrototypeOf,zm=Object.prototype.hasOwnProperty;var Gm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hm=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jm(t))!zm.call(e,o)&&o!==r&&ml(e,o,{get:()=>t[o],enumerable:!(i=Nm(t,o))||i.enumerable});return e};var Wm=(e,t,r)=>(r=e!=null?Um(Vm(e)):{},Hm(t||!e||!e.__esModule?ml(r,"default",{value:e,enumerable:!0}):r,e));var gp=Gm((ac,cc)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof ac<"u"?t():(t(),e.FileSaver={})})(ac,function(){"use strict";function e(a,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function t(a,c,l){var u=new XMLHttpRequest;u.open("GET",a),u.responseType="blob",u.onload=function(){s(u.response,c,l)},u.onerror=function(){console.error("could not download file")},u.send()}function r(a){var c=new XMLHttpRequest;c.open("HEAD",a,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function i(a){try{a.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,n=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!n?function(a,c,l){var u=o.URL||o.webkitURL,d=document.createElement("a");c=c||a.name||"download",d.download=c,d.rel="noopener",typeof a=="string"?(d.href=a,d.origin===location.origin?i(d):r(d.href)?t(a,c,l):i(d,d.target="_blank")):(d.href=u.createObjectURL(a),setTimeout(function(){u.revokeObjectURL(d.href)},4e4),setTimeout(function(){i(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,c,l){if(c=c||a.name||"download",typeof a!="string")navigator.msSaveOrOpenBlob(e(a,l),c);else if(r(a))t(a,c,l);else{var u=document.createElement("a");u.href=a,u.target="_blank",setTimeout(function(){i(u)})}}:function(a,c,l,u){if(u=u||open("","_blank"),u&&(u.document.title=u.document.body.innerText="downloading..."),typeof a=="string")return t(a,c,l);var d=a.type==="application/octet-stream",f=/constructor/i.test(o.HTMLElement)||o.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||d&&f||n)&&typeof FileReader<"u"){var h=new FileReader;h.onloadend=function(){var b=h.result;b=g?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),u?u.location.href=b:location=b,u=null},h.readAsDataURL(a)}else{var m=o.URL||o.webkitURL,y=m.createObjectURL(a);u?u.location=y:location.href=y,u=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});o.saveAs=s.saveAs=s,typeof cc<"u"&&(cc.exports=s)})});async function Ao(){try{let e={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(e)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function To(){return new Promise((e,t)=>{let r=window.screen.isExtended;if(r)e(r);else if(navigator.userAgent.indexOf("Firefox")>-1)e(!1);else{let o=[];window.getScreenDetails().then(function(n){o=n,e(o.screens.length>=2)})}})}async function Qe(){let e=["OBS","ManyCam","Snap Camera","Virtual"],r=(await navigator.mediaDevices.enumerateDevices()).filter(o=>!e.some(n=>o.deviceId.includes(n)||o.label.includes(n)));return{cameras:r.filter(o=>o.kind=="videoinput"&&o.deviceId).map(o=>({label:o.label||"Generic Device",id:o.deviceId})),microphones:r.filter(o=>o.kind=="audioinput"&&o.deviceId).map(o=>({label:o.label||"Generic Device",id:o.deviceId}))}}var xo=class{constructor(){this.sessionDuration=0;this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let t of this.recordings)if(!t.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setProctoringId(t){this.id=t}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(t){this.alerts.push(t)}addRecording(t){this.recordings.push(t)}};var Ro,gl=e=>(Ro=e,Ro),et={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video",BUFFER_SIZE:"buffer_size",ANOTHER_STREAM:"another_stream",BROWSER_NOT_SUPPORTED:"browser_not_supported"},tt=(e,t)=>Ro&&Ro.log(e,t),I={registerStart:(e,t,r)=>tt(et.START,{proctoringId:e,success:t,description:r}),registerFinish:(e,t,r)=>tt(et.FINISH,{proctoringId:e,success:t,description:r}),registerError:(e,t)=>tt(et.ERROR,{proctoringId:e,description:t}),registerBrowserNotSupported:(e,t)=>tt(et.BROWSER_NOT_SUPPORTED,{proctoringId:e,description:t}),registerUpload:(e,t,r,i,o)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,success:t,description:r,serviceType:i,uploadTime:o}),registerUploadFile:(e,t,r)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t,fileType:r}),registerChangeDevice:(e,t,r)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,inOrOut:t,devicesChanged:r}),registerStopSharingScreen:(e,t)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t}),registerErrorRecorderRTC:(e,t)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t}),registerOnBufferSizeError:(e,t)=>tt(et.BUFFER_SIZE,{proctoringId:e,description:t}),registerAnotherStream:(e,t)=>tt(et.ANOTHER_STREAM,{proctoringId:e,description:t})};function ar(e,t,r,i=!1,o,n=!1){let s,a=!1,c,l,u={mimeType:"video/webm",videoBitsPerSecond:128e3,audioBitsPerSecond:64*1e3};n&&(u={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let d=new MediaRecorder(e,u);d.ondataavailable=y=>{y.data.size>0&&t.push(y.data),a?(n&&d.state=="inactive"&&(t=[new Blob(t,{type:"audio/webm"})]),s&&s()):((l&&y.data.size===l.data.size||y.data.size===0)&&(o&&o(),r&&l&&y.data.size===l.data.size&&I.registerOnBufferSizeError(r,`onBufferSizeError: Recorder size freezed: ${y.data.size} Mb`),r&&y.data.size===0&&I.registerOnBufferSizeError(r,"onBufferSizeError: Recorder size equal 0 Mb")),l=y)};function f(){return new Promise(y=>{s=y,d.start(),a=!1,i&&(c=setInterval(async()=>{await d.requestData()},3e4))})}function g(){return new Promise(y=>{d.state=="recording"?(s=y,d.stop(),a=!0,clearInterval(c),e.getTracks().forEach(b=>{b.stop()})):y()})}function h(){return new Promise(y=>{d.state=="recording"&&d.pause(),y()})}function m(){return new Promise(y=>{d.state=="paused"&&d.resume(),y()})}return{startRecording:f,stopRecording:g,pauseRecording:h,resumeRecording:m}}function pi(e,t){return function(){return e.apply(t,arguments)}}var{toString:qm}=Object.prototype,{getPrototypeOf:As}=Object,Po=(e=>t=>{let r=qm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ut=e=>(e=e.toLowerCase(),t=>Po(t)===e),Io=e=>t=>typeof t===e,{isArray:_r}=Array,fi=Io("undefined");function $m(e){return e!==null&&!fi(e)&&e.constructor!==null&&!fi(e.constructor)&&Ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var bl=ut("ArrayBuffer");function Xm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bl(e.buffer),t}var Km=Io("string"),Ne=Io("function"),wl=Io("number"),Oo=e=>e!==null&&typeof e=="object",Jm=e=>e===!0||e===!1,Co=e=>{if(Po(e)!=="object")return!1;let t=As(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ym=ut("Date"),Zm=ut("File"),Qm=ut("Blob"),e1=ut("FileList"),t1=e=>Oo(e)&&Ne(e.pipe),r1=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ne(e.append)&&((t=Po(e))==="formdata"||t==="object"&&Ne(e.toString)&&e.toString()==="[object FormData]"))},i1=ut("URLSearchParams"),o1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mi(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,o;if(typeof e!="object"&&(e=[e]),_r(e))for(i=0,o=e.length;i<o;i++)t.call(null,e[i],i,e);else{let n=r?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length,a;for(i=0;i<s;i++)a=n[i],t.call(null,e[a],a,e)}}function Sl(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,o;for(;i-- >0;)if(o=r[i],t===o.toLowerCase())return o;return null}var El=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_l=e=>!fi(e)&&e!==El;function ks(){let{caseless:e}=_l(this)&&this||{},t={},r=(i,o)=>{let n=e&&Sl(t,o)||o;Co(t[n])&&Co(i)?t[n]=ks(t[n],i):Co(i)?t[n]=ks({},i):_r(i)?t[n]=i.slice():t[n]=i};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&mi(arguments[i],r);return t}var n1=(e,t,r,{allOwnKeys:i}={})=>(mi(t,(o,n)=>{r&&Ne(o)?e[n]=pi(o,r):e[n]=o},{allOwnKeys:i}),e),s1=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a1=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},c1=(e,t,r,i)=>{let o,n,s,a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),n=o.length;n-- >0;)s=o[n],(!i||i(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&As(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},l1=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},u1=e=>{if(!e)return null;if(_r(e))return e;let t=e.length;if(!wl(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},d1=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&As(Uint8Array)),h1=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),o;for(;(o=i.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},p1=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},f1=ut("HTMLFormElement"),m1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,o){return i.toUpperCase()+o}),yl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),g1=ut("RegExp"),kl=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};mi(r,(o,n)=>{let s;(s=t(o,n,e))!==!1&&(i[n]=s||o)}),Object.defineProperties(e,i)},y1=e=>{kl(e,(t,r)=>{if(Ne(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(!!Ne(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},v1=(e,t)=>{let r={},i=o=>{o.forEach(n=>{r[n]=!0})};return _r(e)?i(e):i(String(e).split(t)),r},b1=()=>{},w1=(e,t)=>(e=+e,Number.isFinite(e)?e:t),_s="abcdefghijklmnopqrstuvwxyz",vl="0123456789",Al={DIGIT:vl,ALPHA:_s,ALPHA_DIGIT:_s+_s.toUpperCase()+vl},S1=(e=16,t=Al.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function E1(e){return!!(e&&Ne(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var _1=e=>{let t=new Array(10),r=(i,o)=>{if(Oo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[o]=i;let n=_r(i)?[]:{};return mi(i,(s,a)=>{let c=r(s,o+1);!fi(c)&&(n[a]=c)}),t[o]=void 0,n}}return i};return r(e,0)},k1=ut("AsyncFunction"),A1=e=>e&&(Oo(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),p={isArray:_r,isArrayBuffer:bl,isBuffer:$m,isFormData:r1,isArrayBufferView:Xm,isString:Km,isNumber:wl,isBoolean:Jm,isObject:Oo,isPlainObject:Co,isUndefined:fi,isDate:Ym,isFile:Zm,isBlob:Qm,isRegExp:g1,isFunction:Ne,isStream:t1,isURLSearchParams:i1,isTypedArray:d1,isFileList:e1,forEach:mi,merge:ks,extend:n1,trim:o1,stripBOM:s1,inherits:a1,toFlatObject:c1,kindOf:Po,kindOfTest:ut,endsWith:l1,toArray:u1,forEachEntry:h1,matchAll:p1,isHTMLForm:f1,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:kl,freezeMethods:y1,toObjectSet:v1,toCamelCase:m1,noop:b1,toFiniteNumber:w1,findKey:Sl,global:El,isContextDefined:_l,ALPHABET:Al,generateString:S1,isSpecCompliantForm:E1,toJSONObject:_1,isAsyncFn:k1,isThenable:A1};function kr(e,t,r,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),o&&(this.response=o)}p.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Tl=kr.prototype,xl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{xl[e]={value:e}});Object.defineProperties(kr,xl);Object.defineProperty(Tl,"isAxiosError",{value:!0});kr.from=(e,t,r,i,o,n)=>{let s=Object.create(Tl);return p.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),kr.call(s,e.message,t,r,i,o),s.cause=e,s.name=e.name,n&&Object.assign(s,n),s};var T=kr;var Do=null;function Ts(e){return p.isPlainObject(e)||p.isArray(e)}function Cl(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function Rl(e,t,r){return e?e.concat(t).map(function(o,n){return o=Cl(o),!r&&n?"["+o+"]":o}).join(r?".":""):t}function T1(e){return p.isArray(e)&&!e.some(Ts)}var x1=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function R1(e,t,r){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new(Do||FormData),r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!p.isUndefined(y[m])});let i=r.metaTokens,o=r.visitor||u,n=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(t);if(!p.isFunction(o))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(!c&&p.isBlob(h))throw new T("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let b=h;if(h&&!y&&typeof h=="object"){if(p.endsWith(m,"{}"))m=i?m:m.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&T1(h)||(p.isFileList(h)||p.endsWith(m,"[]"))&&(b=p.toArray(h)))return m=Cl(m),b.forEach(function(P,ae){!(p.isUndefined(P)||P===null)&&t.append(s===!0?Rl([m],ae,n):s===null?m:m+"[]",l(P))}),!1}return Ts(h)?!0:(t.append(Rl(y,m,n),l(h)),!1)}let d=[],f=Object.assign(x1,{defaultVisitor:u,convertValue:l,isVisitable:Ts});function g(h,m){if(!p.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),p.forEach(h,function(b,k){(!(p.isUndefined(b)||b===null)&&o.call(t,b,p.isString(k)?k.trim():k,m,f))===!0&&g(b,m?m.concat(k):[k])}),d.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return g(e),t}var Ut=R1;function Pl(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Il(e,t){this._pairs=[],e&&Ut(e,this,t)}var Ol=Il.prototype;Ol.append=function(t,r){this._pairs.push([t,r])};Ol.toString=function(t){let r=t?function(i){return t.call(this,i,Pl)}:Pl;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Fo=Il;function C1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function gi(e,t,r){if(!t)return e;let i=r&&r.encode||C1,o=r&&r.serialize,n;if(o?n=o(t,r):n=p.isURLSearchParams(t)?t.toString():new Fo(t,r).toString(i),n){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}var xs=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){p.forEach(this.handlers,function(i){i!==null&&t(i)})}},Rs=xs;var Bo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Dl=typeof URLSearchParams<"u"?URLSearchParams:Fo;var Fl=typeof FormData<"u"?FormData:null;var Bl=typeof Blob<"u"?Blob:null;var P1=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),I1=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ue={isBrowser:!0,classes:{URLSearchParams:Dl,FormData:Fl,Blob:Bl},isStandardBrowserEnv:P1,isStandardBrowserWebWorkerEnv:I1,protocols:["http","https","file","blob","url","data"]};function Cs(e,t){return Ut(e,new ue.classes.URLSearchParams,Object.assign({visitor:function(r,i,o,n){return ue.isNode&&p.isBuffer(r)?(this.append(i,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}function O1(e){return p.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function D1(e){let t={},r=Object.keys(e),i,o=r.length,n;for(i=0;i<o;i++)n=r[i],t[n]=e[n];return t}function F1(e){function t(r,i,o,n){let s=r[n++],a=Number.isFinite(+s),c=n>=r.length;return s=!s&&p.isArray(o)?o.length:s,c?(p.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!a):((!o[s]||!p.isObject(o[s]))&&(o[s]=[]),t(r,i,o[s],n)&&p.isArray(o[s])&&(o[s]=D1(o[s])),!a)}if(p.isFormData(e)&&p.isFunction(e.entries)){let r={};return p.forEachEntry(e,(i,o)=>{t(O1(i),o,r,0)}),r}return null}var Mo=F1;function B1(e,t,r){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var Ps={transitional:Bo,adapter:ue.isNode?"http":"xhr",transformRequest:[function(t,r){let i=r.getContentType()||"",o=i.indexOf("application/json")>-1,n=p.isObject(t);if(n&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return o&&o?JSON.stringify(Mo(t)):t;if(p.isArrayBuffer(t)||p.isBuffer(t)||p.isStream(t)||p.isFile(t)||p.isBlob(t))return t;if(p.isArrayBufferView(t))return t.buffer;if(p.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(n){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Cs(t,this.formSerializer).toString();if((a=p.isFileList(t))||i.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Ut(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return n||o?(r.setContentType("application/json",!1),B1(t)):t}],transformResponse:[function(t){let r=this.transitional||Ps.transitional,i=r&&r.forcedJSONParsing,o=this.responseType==="json";if(t&&p.isString(t)&&(i&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?T.from(a,T.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],e=>{Ps.headers[e]={}});var Ar=Ps;var M1=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ml=e=>{let t={},r,i,o;return e&&e.split(`
|
|
2
|
-
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!r||t[r]&&M1[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var Ll=Symbol("internals");function yi(e){return e&&String(e).trim().toLowerCase()}function Lo(e){return e===!1||e==null?e:p.isArray(e)?e.map(Lo):String(e)}function L1(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}var U1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Is(e,t,r,i,o){if(p.isFunction(i))return i.call(this,t,r);if(o&&(t=r),!!p.isString(t)){if(p.isString(i))return t.indexOf(i)!==-1;if(p.isRegExp(i))return i.test(t)}}function N1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function j1(e,t){let r=p.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(o,n,s){return this[i].call(this,t,o,n,s)},configurable:!0})})}var
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(o=>i.set(o)),i}static accessor(t){let i=(this[Ll]=this[Ll]={accessors:{}}).accessors,o=this.prototype;function n(s){let a=yi(s);i[a]||(j1(o,s),i[a]=!0)}return p.isArray(t)?t.forEach(n):n(t),this}};Tr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(Tr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});p.freezeMethods(Tr);var ye=Tr;function vi(e,t){let r=this||Ar,i=t||r,o=ye.from(i.headers),n=i.data;return p.forEach(e,function(a){n=a.call(r,n,o.normalize(),t?t.status:void 0)}),o.normalize(),n}function bi(e){return!!(e&&e.__CANCEL__)}function Ul(e,t,r){T.call(this,e??"canceled",T.ERR_CANCELED,t,r),this.name="CanceledError"}p.inherits(Ul,T,{__CANCEL__:!0});var Nt=Ul;function Os(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new T("Request failed with status code "+r.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var Nl=ue.isStandardBrowserEnv?function(){return{write:function(r,i,o,n,s,a){let c=[];c.push(r+"="+encodeURIComponent(i)),p.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),p.isString(n)&&c.push("path="+n),p.isString(s)&&c.push("domain="+s),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){let i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ds(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function wi(e,t){return e&&!Ds(t)?Fs(e,t):t}var jl=ue.isStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function o(n){let s=n;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=o(window.location.href),function(s){let a=p.isString(s)?o(s):s;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}();function Bs(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function V1(e,t){e=e||10;let r=new Array(e),i=new Array(e),o=0,n=0,s;return t=t!==void 0?t:1e3,function(c){let l=Date.now(),u=i[n];s||(s=l),r[o]=c,i[o]=l;let d=n,f=0;for(;d!==o;)f+=r[d++],d=d%e;if(o=(o+1)%e,o===n&&(n=(n+1)%e),l-s<t)return;let g=u&&l-u;return g?Math.round(f*1e3/g):void 0}}var Vl=V1;function zl(e,t){let r=0,i=Vl(50,250);return o=>{let n=o.loaded,s=o.lengthComputable?o.total:void 0,a=n-r,c=i(a),l=n<=s;r=n;let u={loaded:n,total:s,progress:s?n/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-n)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}var z1=typeof XMLHttpRequest<"u",Gl=z1&&function(e){return new Promise(function(r,i){let o=e.data,n=ye.from(e.headers).normalize(),s=e.responseType,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}p.isFormData(o)&&(ue.isStandardBrowserEnv||ue.isStandardBrowserWebWorkerEnv?n.setContentType(!1):n.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){let g=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(g+":"+h))}let u=wi(e.baseURL,e.url);l.open(e.method.toUpperCase(),gi(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function d(){if(!l)return;let g=ye.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:g,config:e,request:l};Os(function(b){r(b),c()},function(b){i(b),c()},m),l=null}if("onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){!l||(i(new T("Request aborted",T.ECONNABORTED,e,l)),l=null)},l.onerror=function(){i(new T("Network Error",T.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",m=e.transitional||Bo;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),i(new T(h,m.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,e,l)),l=null},ue.isStandardBrowserEnv){let g=(e.withCredentials||jl(u))&&e.xsrfCookieName&&Nl.read(e.xsrfCookieName);g&&n.set(e.xsrfHeaderName,g)}o===void 0&&n.setContentType(null),"setRequestHeader"in l&&p.forEach(n.toJSON(),function(h,m){l.setRequestHeader(m,h)}),p.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&s!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",zl(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",zl(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=g=>{!l||(i(!g||g.type?new Nt(null,e,l):g),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));let f=Bs(u);if(f&&ue.protocols.indexOf(f)===-1){i(new T("Unsupported protocol "+f+":",T.ERR_BAD_REQUEST,e));return}l.send(o||null)})};var Uo={http:Do,xhr:Gl};p.forEach(Uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var No={getAdapter:e=>{e=p.isArray(e)?e:[e];let{length:t}=e,r,i;for(let o=0;o<t&&(r=e[o],!(i=p.isString(r)?Uo[r.toLowerCase()]:r));o++);if(!i)throw i===!1?new T(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(p.hasOwnProp(Uo,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!p.isFunction(i))throw new TypeError("adapter is not a function");return i},adapters:Uo};function Ms(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function jo(e){return Ms(e),e.headers=ye.from(e.headers),e.data=vi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),No.getAdapter(e.adapter||Ar.adapter)(e).then(function(i){return Ms(e),i.data=vi.call(e,e.transformResponse,i),i.headers=ye.from(i.headers),i},function(i){return bi(i)||(Ms(e),i&&i.response&&(i.response.data=vi.call(e,e.transformResponse,i.response),i.response.headers=ye.from(i.response.headers))),Promise.reject(i)})}var Hl=e=>e instanceof ye?e.toJSON():e;function xt(e,t){t=t||{};let r={};function i(l,u,d){return p.isPlainObject(l)&&p.isPlainObject(u)?p.merge.call({caseless:d},l,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function o(l,u,d){if(p.isUndefined(u)){if(!p.isUndefined(l))return i(void 0,l,d)}else return i(l,u,d)}function n(l,u){if(!p.isUndefined(u))return i(void 0,u)}function s(l,u){if(p.isUndefined(u)){if(!p.isUndefined(l))return i(void 0,l)}else return i(void 0,u)}function a(l,u,d){if(d in t)return i(l,u);if(d in e)return i(void 0,l)}let c={url:n,method:n,data:n,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>o(Hl(l),Hl(u),!0)};return p.forEach(Object.keys(Object.assign({},e,t)),function(u){let d=c[u]||o,f=d(e[u],t[u],u);p.isUndefined(f)&&d!==a||(r[u]=f)}),r}var Vo="1.5.0";var Ls={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ls[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});var Wl={};Ls.transitional=function(t,r,i){function o(n,s){return"[Axios v"+Vo+"] Transitional option '"+n+"'"+s+(i?". "+i:"")}return(n,s,a)=>{if(t===!1)throw new T(o(s," has been removed"+(r?" in "+r:"")),T.ERR_DEPRECATED);return r&&!Wl[s]&&(Wl[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(n,s,a):!0}};function G1(e,t,r){if(typeof e!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),o=i.length;for(;o-- >0;){let n=i[o],s=t[n];if(s){let a=e[n],c=a===void 0||s(a,n,e);if(c!==!0)throw new T("option "+n+" must be "+c,T.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new T("Unknown option "+n,T.ERR_BAD_OPTION)}}var zo={assertOptions:G1,validators:Ls};var jt=zo.validators,xr=class{constructor(t){this.defaults=t,this.interceptors={request:new Rs,response:new Rs}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=xt(this.defaults,r);let{transitional:i,paramsSerializer:o,headers:n}=r;i!==void 0&&zo.assertOptions(i,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:zo.assertOptions(o,{encode:jt.function,serialize:jt.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=n&&p.merge(n.common,n[r.method]);n&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete n[h]}),r.headers=ye.concat(s,n);let a=[],c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});let l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!c){let h=[jo.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),f=h.length,u=Promise.resolve(r);d<f;)u=u.then(h[d++],h[d++]);return u}f=a.length;let g=r;for(d=0;d<f;){let h=a[d++],m=a[d++];try{g=h(g)}catch(y){m.call(this,y);break}}try{u=jo.call(this,g)}catch(h){return Promise.reject(h)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=xt(this.defaults,t);let r=wi(t.baseURL,t.url);return gi(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){xr.prototype[t]=function(r,i){return this.request(xt(i||{},{method:t,url:r,data:(i||{}).data}))}});p.forEach(["post","put","patch"],function(t){function r(i){return function(n,s,a){return this.request(xt(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}xr.prototype[t]=r(),xr.prototype[t+"Form"]=r(!0)});var Si=xr;var Ei=class{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});let i=this;this.promise.then(o=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](o);i._listeners=null}),this.promise.then=o=>{let n,s=new Promise(a=>{i.subscribe(a),n=a}).then(o);return s.cancel=function(){i.unsubscribe(n)},s},t(function(n,s,a){i.reason||(i.reason=new Nt(n,s,a),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Ei(function(o){t=o}),cancel:t}}},ql=Ei;function Us(e){return function(r){return e.apply(null,r)}}function Ns(e){return p.isObject(e)&&e.isAxiosError===!0}var js={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(js).forEach(([e,t])=>{js[t]=e});var $l=js;function Xl(e){let t=new Si(e),r=pi(Si.prototype.request,t);return p.extend(r,Si.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xl(xt(e,o))},r}var Z=Xl(Ar);Z.Axios=Si;Z.CanceledError=Nt;Z.CancelToken=ql;Z.isCancel=bi;Z.VERSION=Vo;Z.toFormData=Ut;Z.AxiosError=T;Z.Cancel=Z.CanceledError;Z.all=function(t){return Promise.all(t)};Z.spread=Us;Z.isAxiosError=Ns;Z.mergeConfig=xt;Z.AxiosHeaders=ye;Z.formToJSON=e=>Mo(p.isHTMLForm(e)?new FormData(e):e);Z.getAdapter=No.getAdapter;Z.HttpStatusCode=$l;Z.default=Z;var Vt=Z;var{Axios:Iy,AxiosError:Oy,CanceledError:Dy,isCancel:Fy,CancelToken:By,VERSION:My,all:Ly,Cancel:Uy,isAxiosError:Ny,spread:jy,toFormData:Vy,AxiosHeaders:zy,HttpStatusCode:Gy,formToJSON:Hy,getAdapter:Wy,mergeConfig:qy}=Vt;var Rt=class{constructor(t,r){this.backend=r;this.imageUrlPackage=[];this.imageBatchNum=0;this.contImages=0;this.proctoringId=t}async uploadImages(t,r,i){let{file:o,onProgress:n}=t;try{let s=l=>{let u=l.loadedBytes/o.size*100;n&&n(Math.round(u))},a;if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+60;d++){let f=`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`;(d+1)%i==0&&(f=`${this.proctoringId}/${this.proctoringId}_${d+1}_realtime.jpg`),l.push({objectName:f,contentType:"image/jpeg"})}(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=60}let c=!1;return c=await Vt.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(l=>l.status==200||l.status==201?(this.contImages++,!0):!1).catch(()=>!1).finally(()=>{}),{storage:"upload",url:a,uploaded:c}}catch{throw I.registerError(this.proctoringId,`Failed to upload to AWS
|
|
1
|
+
"use strict";(()=>{var Um=Object.create;var ml=Object.defineProperty;var Nm=Object.getOwnPropertyDescriptor;var jm=Object.getOwnPropertyNames;var Vm=Object.getPrototypeOf,zm=Object.prototype.hasOwnProperty;var Gm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hm=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jm(t))!zm.call(e,o)&&o!==r&&ml(e,o,{get:()=>t[o],enumerable:!(i=Nm(t,o))||i.enumerable});return e};var Wm=(e,t,r)=>(r=e!=null?Um(Vm(e)):{},Hm(t||!e||!e.__esModule?ml(r,"default",{value:e,enumerable:!0}):r,e));var gp=Gm((ac,cc)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof ac<"u"?t():(t(),e.FileSaver={})})(ac,function(){"use strict";function e(a,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function t(a,c,l){var u=new XMLHttpRequest;u.open("GET",a),u.responseType="blob",u.onload=function(){s(u.response,c,l)},u.onerror=function(){console.error("could not download file")},u.send()}function r(a){var c=new XMLHttpRequest;c.open("HEAD",a,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function i(a){try{a.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,n=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!n?function(a,c,l){var u=o.URL||o.webkitURL,d=document.createElement("a");c=c||a.name||"download",d.download=c,d.rel="noopener",typeof a=="string"?(d.href=a,d.origin===location.origin?i(d):r(d.href)?t(a,c,l):i(d,d.target="_blank")):(d.href=u.createObjectURL(a),setTimeout(function(){u.revokeObjectURL(d.href)},4e4),setTimeout(function(){i(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,c,l){if(c=c||a.name||"download",typeof a!="string")navigator.msSaveOrOpenBlob(e(a,l),c);else if(r(a))t(a,c,l);else{var u=document.createElement("a");u.href=a,u.target="_blank",setTimeout(function(){i(u)})}}:function(a,c,l,u){if(u=u||open("","_blank"),u&&(u.document.title=u.document.body.innerText="downloading..."),typeof a=="string")return t(a,c,l);var d=a.type==="application/octet-stream",f=/constructor/i.test(o.HTMLElement)||o.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||d&&f||n)&&typeof FileReader<"u"){var h=new FileReader;h.onloadend=function(){var b=h.result;b=g?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),u?u.location.href=b:location=b,u=null},h.readAsDataURL(a)}else{var m=o.URL||o.webkitURL,y=m.createObjectURL(a);u?u.location=y:location.href=y,u=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});o.saveAs=s.saveAs=s,typeof cc<"u"&&(cc.exports=s)})});async function Ao(){try{let e={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(e)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function xo(){return new Promise((e,t)=>{let r=window.screen.isExtended;if(r)e(r);else if(navigator.userAgent.indexOf("Firefox")>-1)e(!1);else{let o=[];window.getScreenDetails().then(function(n){o=n,e(o.screens.length>=2)})}})}async function Qe(){let e=["OBS","ManyCam","Snap Camera","Virtual"],r=(await navigator.mediaDevices.enumerateDevices()).filter(o=>!e.some(n=>o.deviceId.includes(n)||o.label.includes(n)));return{cameras:r.filter(o=>o.kind=="videoinput"&&o.deviceId).map(o=>({label:o.label||"Generic Device",id:o.deviceId})),microphones:r.filter(o=>o.kind=="audioinput"&&o.deviceId).map(o=>({label:o.label||"Generic Device",id:o.deviceId}))}}var To=class{constructor(){this.sessionDuration=0;this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let t of this.recordings)if(!t.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setProctoringId(t){this.id=t}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(t){this.alerts.push(t)}addRecording(t){this.recordings.push(t)}};var Ro,gl=e=>(Ro=e,Ro),et={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video",BUFFER_SIZE:"buffer_size",ANOTHER_STREAM:"another_stream",BROWSER_NOT_SUPPORTED:"browser_not_supported"},tt=(e,t)=>Ro&&Ro.log(e,t),I={registerStart:(e,t,r)=>tt(et.START,{proctoringId:e,success:t,description:r}),registerFinish:(e,t,r)=>tt(et.FINISH,{proctoringId:e,success:t,description:r}),registerError:(e,t)=>tt(et.ERROR,{proctoringId:e,description:t}),registerBrowserNotSupported:(e,t)=>tt(et.BROWSER_NOT_SUPPORTED,{proctoringId:e,description:t}),registerUpload:(e,t,r,i,o)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,success:t,description:r,serviceType:i,uploadTime:o}),registerUploadFile:(e,t,r)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t,fileType:r}),registerChangeDevice:(e,t,r)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,inOrOut:t,devicesChanged:r}),registerStopSharingScreen:(e,t)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t}),registerErrorRecorderRTC:(e,t)=>tt(et.UPLOAD_VIDEO,{proctoringId:e,description:t}),registerOnBufferSizeError:(e,t)=>tt(et.BUFFER_SIZE,{proctoringId:e,description:t}),registerAnotherStream:(e,t)=>tt(et.ANOTHER_STREAM,{proctoringId:e,description:t})};function ar(e,t,r,i=!1,o,n=!1){let s,a=!1,c,l,u={mimeType:"video/webm",videoBitsPerSecond:128e3,audioBitsPerSecond:64*1e3};n&&(u={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let d=new MediaRecorder(e,u);d.ondataavailable=y=>{y.data.size>0&&t.push(y.data),a?(n&&d.state=="inactive"&&(t=[new Blob(t,{type:"audio/webm"})]),s&&s()):((l&&y.data.size===l.data.size||y.data.size===0)&&(o&&o(),r&&l&&y.data.size===l.data.size&&I.registerOnBufferSizeError(r,`onBufferSizeError: Recorder size freezed: ${y.data.size} Mb`),r&&y.data.size===0&&I.registerOnBufferSizeError(r,"onBufferSizeError: Recorder size equal 0 Mb")),l=y)};function f(){return new Promise(y=>{s=y,d.start(),a=!1,i&&(c=setInterval(async()=>{await d.requestData()},3e4))})}function g(){return new Promise(y=>{d.state=="recording"?(s=y,d.stop(),a=!0,clearInterval(c),e.getTracks().forEach(b=>{b.stop()})):y()})}function h(){return new Promise(y=>{d.state=="recording"&&d.pause(),y()})}function m(){return new Promise(y=>{d.state=="paused"&&d.resume(),y()})}return{startRecording:f,stopRecording:g,pauseRecording:h,resumeRecording:m}}function pi(e,t){return function(){return e.apply(t,arguments)}}var{toString:qm}=Object.prototype,{getPrototypeOf:As}=Object,Po=(e=>t=>{let r=qm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ut=e=>(e=e.toLowerCase(),t=>Po(t)===e),Io=e=>t=>typeof t===e,{isArray:_r}=Array,fi=Io("undefined");function $m(e){return e!==null&&!fi(e)&&e.constructor!==null&&!fi(e.constructor)&&Ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var bl=ut("ArrayBuffer");function Xm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bl(e.buffer),t}var Km=Io("string"),Ne=Io("function"),wl=Io("number"),Oo=e=>e!==null&&typeof e=="object",Jm=e=>e===!0||e===!1,Co=e=>{if(Po(e)!=="object")return!1;let t=As(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ym=ut("Date"),Zm=ut("File"),Qm=ut("Blob"),e1=ut("FileList"),t1=e=>Oo(e)&&Ne(e.pipe),r1=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ne(e.append)&&((t=Po(e))==="formdata"||t==="object"&&Ne(e.toString)&&e.toString()==="[object FormData]"))},i1=ut("URLSearchParams"),o1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mi(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,o;if(typeof e!="object"&&(e=[e]),_r(e))for(i=0,o=e.length;i<o;i++)t.call(null,e[i],i,e);else{let n=r?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length,a;for(i=0;i<s;i++)a=n[i],t.call(null,e[a],a,e)}}function Sl(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,o;for(;i-- >0;)if(o=r[i],t===o.toLowerCase())return o;return null}var El=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_l=e=>!fi(e)&&e!==El;function ks(){let{caseless:e}=_l(this)&&this||{},t={},r=(i,o)=>{let n=e&&Sl(t,o)||o;Co(t[n])&&Co(i)?t[n]=ks(t[n],i):Co(i)?t[n]=ks({},i):_r(i)?t[n]=i.slice():t[n]=i};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&mi(arguments[i],r);return t}var n1=(e,t,r,{allOwnKeys:i}={})=>(mi(t,(o,n)=>{r&&Ne(o)?e[n]=pi(o,r):e[n]=o},{allOwnKeys:i}),e),s1=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a1=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},c1=(e,t,r,i)=>{let o,n,s,a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),n=o.length;n-- >0;)s=o[n],(!i||i(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&As(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},l1=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},u1=e=>{if(!e)return null;if(_r(e))return e;let t=e.length;if(!wl(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},d1=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&As(Uint8Array)),h1=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),o;for(;(o=i.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},p1=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},f1=ut("HTMLFormElement"),m1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,o){return i.toUpperCase()+o}),yl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),g1=ut("RegExp"),kl=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};mi(r,(o,n)=>{let s;(s=t(o,n,e))!==!1&&(i[n]=s||o)}),Object.defineProperties(e,i)},y1=e=>{kl(e,(t,r)=>{if(Ne(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(!!Ne(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},v1=(e,t)=>{let r={},i=o=>{o.forEach(n=>{r[n]=!0})};return _r(e)?i(e):i(String(e).split(t)),r},b1=()=>{},w1=(e,t)=>(e=+e,Number.isFinite(e)?e:t),_s="abcdefghijklmnopqrstuvwxyz",vl="0123456789",Al={DIGIT:vl,ALPHA:_s,ALPHA_DIGIT:_s+_s.toUpperCase()+vl},S1=(e=16,t=Al.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function E1(e){return!!(e&&Ne(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var _1=e=>{let t=new Array(10),r=(i,o)=>{if(Oo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[o]=i;let n=_r(i)?[]:{};return mi(i,(s,a)=>{let c=r(s,o+1);!fi(c)&&(n[a]=c)}),t[o]=void 0,n}}return i};return r(e,0)},k1=ut("AsyncFunction"),A1=e=>e&&(Oo(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),p={isArray:_r,isArrayBuffer:bl,isBuffer:$m,isFormData:r1,isArrayBufferView:Xm,isString:Km,isNumber:wl,isBoolean:Jm,isObject:Oo,isPlainObject:Co,isUndefined:fi,isDate:Ym,isFile:Zm,isBlob:Qm,isRegExp:g1,isFunction:Ne,isStream:t1,isURLSearchParams:i1,isTypedArray:d1,isFileList:e1,forEach:mi,merge:ks,extend:n1,trim:o1,stripBOM:s1,inherits:a1,toFlatObject:c1,kindOf:Po,kindOfTest:ut,endsWith:l1,toArray:u1,forEachEntry:h1,matchAll:p1,isHTMLForm:f1,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:kl,freezeMethods:y1,toObjectSet:v1,toCamelCase:m1,noop:b1,toFiniteNumber:w1,findKey:Sl,global:El,isContextDefined:_l,ALPHABET:Al,generateString:S1,isSpecCompliantForm:E1,toJSONObject:_1,isAsyncFn:k1,isThenable:A1};function kr(e,t,r,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),o&&(this.response=o)}p.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var xl=kr.prototype,Tl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Tl[e]={value:e}});Object.defineProperties(kr,Tl);Object.defineProperty(xl,"isAxiosError",{value:!0});kr.from=(e,t,r,i,o,n)=>{let s=Object.create(xl);return p.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),kr.call(s,e.message,t,r,i,o),s.cause=e,s.name=e.name,n&&Object.assign(s,n),s};var x=kr;var Do=null;function xs(e){return p.isPlainObject(e)||p.isArray(e)}function Cl(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function Rl(e,t,r){return e?e.concat(t).map(function(o,n){return o=Cl(o),!r&&n?"["+o+"]":o}).join(r?".":""):t}function x1(e){return p.isArray(e)&&!e.some(xs)}var T1=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function R1(e,t,r){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new(Do||FormData),r=p.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!p.isUndefined(y[m])});let i=r.metaTokens,o=r.visitor||u,n=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(t);if(!p.isFunction(o))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(!c&&p.isBlob(h))throw new x("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let b=h;if(h&&!y&&typeof h=="object"){if(p.endsWith(m,"{}"))m=i?m:m.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&x1(h)||(p.isFileList(h)||p.endsWith(m,"[]"))&&(b=p.toArray(h)))return m=Cl(m),b.forEach(function(P,ae){!(p.isUndefined(P)||P===null)&&t.append(s===!0?Rl([m],ae,n):s===null?m:m+"[]",l(P))}),!1}return xs(h)?!0:(t.append(Rl(y,m,n),l(h)),!1)}let d=[],f=Object.assign(T1,{defaultVisitor:u,convertValue:l,isVisitable:xs});function g(h,m){if(!p.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),p.forEach(h,function(b,k){(!(p.isUndefined(b)||b===null)&&o.call(t,b,p.isString(k)?k.trim():k,m,f))===!0&&g(b,m?m.concat(k):[k])}),d.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return g(e),t}var Ut=R1;function Pl(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Il(e,t){this._pairs=[],e&&Ut(e,this,t)}var Ol=Il.prototype;Ol.append=function(t,r){this._pairs.push([t,r])};Ol.toString=function(t){let r=t?function(i){return t.call(this,i,Pl)}:Pl;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var Fo=Il;function C1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function gi(e,t,r){if(!t)return e;let i=r&&r.encode||C1,o=r&&r.serialize,n;if(o?n=o(t,r):n=p.isURLSearchParams(t)?t.toString():new Fo(t,r).toString(i),n){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}var Ts=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){p.forEach(this.handlers,function(i){i!==null&&t(i)})}},Rs=Ts;var Bo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Dl=typeof URLSearchParams<"u"?URLSearchParams:Fo;var Fl=typeof FormData<"u"?FormData:null;var Bl=typeof Blob<"u"?Blob:null;var P1=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),I1=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ue={isBrowser:!0,classes:{URLSearchParams:Dl,FormData:Fl,Blob:Bl},isStandardBrowserEnv:P1,isStandardBrowserWebWorkerEnv:I1,protocols:["http","https","file","blob","url","data"]};function Cs(e,t){return Ut(e,new ue.classes.URLSearchParams,Object.assign({visitor:function(r,i,o,n){return ue.isNode&&p.isBuffer(r)?(this.append(i,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}function O1(e){return p.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function D1(e){let t={},r=Object.keys(e),i,o=r.length,n;for(i=0;i<o;i++)n=r[i],t[n]=e[n];return t}function F1(e){function t(r,i,o,n){let s=r[n++],a=Number.isFinite(+s),c=n>=r.length;return s=!s&&p.isArray(o)?o.length:s,c?(p.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!a):((!o[s]||!p.isObject(o[s]))&&(o[s]=[]),t(r,i,o[s],n)&&p.isArray(o[s])&&(o[s]=D1(o[s])),!a)}if(p.isFormData(e)&&p.isFunction(e.entries)){let r={};return p.forEachEntry(e,(i,o)=>{t(O1(i),o,r,0)}),r}return null}var Mo=F1;function B1(e,t,r){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var Ps={transitional:Bo,adapter:ue.isNode?"http":"xhr",transformRequest:[function(t,r){let i=r.getContentType()||"",o=i.indexOf("application/json")>-1,n=p.isObject(t);if(n&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return o&&o?JSON.stringify(Mo(t)):t;if(p.isArrayBuffer(t)||p.isBuffer(t)||p.isStream(t)||p.isFile(t)||p.isBlob(t))return t;if(p.isArrayBufferView(t))return t.buffer;if(p.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(n){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Cs(t,this.formSerializer).toString();if((a=p.isFileList(t))||i.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Ut(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return n||o?(r.setContentType("application/json",!1),B1(t)):t}],transformResponse:[function(t){let r=this.transitional||Ps.transitional,i=r&&r.forcedJSONParsing,o=this.responseType==="json";if(t&&p.isString(t)&&(i&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?x.from(a,x.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],e=>{Ps.headers[e]={}});var Ar=Ps;var M1=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ml=e=>{let t={},r,i,o;return e&&e.split(`
|
|
2
|
+
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!r||t[r]&&M1[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var Ll=Symbol("internals");function yi(e){return e&&String(e).trim().toLowerCase()}function Lo(e){return e===!1||e==null?e:p.isArray(e)?e.map(Lo):String(e)}function L1(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}var U1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Is(e,t,r,i,o){if(p.isFunction(i))return i.call(this,t,r);if(o&&(t=r),!!p.isString(t)){if(p.isString(i))return t.indexOf(i)!==-1;if(p.isRegExp(i))return i.test(t)}}function N1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function j1(e,t){let r=p.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(o,n,s){return this[i].call(this,t,o,n,s)},configurable:!0})})}var xr=class{constructor(t){t&&this.set(t)}set(t,r,i){let o=this;function n(a,c,l){let u=yi(c);if(!u)throw new Error("header name must be a non-empty string");let d=p.findKey(o,u);(!d||o[d]===void 0||l===!0||l===void 0&&o[d]!==!1)&&(o[d||c]=Lo(a))}let s=(a,c)=>p.forEach(a,(l,u)=>n(l,u,c));return p.isPlainObject(t)||t instanceof this.constructor?s(t,r):p.isString(t)&&(t=t.trim())&&!U1(t)?s(Ml(t),r):t!=null&&n(r,t,i),this}get(t,r){if(t=yi(t),t){let i=p.findKey(this,t);if(i){let o=this[i];if(!r)return o;if(r===!0)return L1(o);if(p.isFunction(r))return r.call(this,o,i);if(p.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=yi(t),t){let i=p.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||Is(this,this[i],i,r)))}return!1}delete(t,r){let i=this,o=!1;function n(s){if(s=yi(s),s){let a=p.findKey(i,s);a&&(!r||Is(i,i[a],a,r))&&(delete i[a],o=!0)}}return p.isArray(t)?t.forEach(n):n(t),o}clear(t){let r=Object.keys(this),i=r.length,o=!1;for(;i--;){let n=r[i];(!t||Is(this,this[n],n,t,!0))&&(delete this[n],o=!0)}return o}normalize(t){let r=this,i={};return p.forEach(this,(o,n)=>{let s=p.findKey(i,n);if(s){r[s]=Lo(o),delete r[n];return}let a=t?N1(n):String(n).trim();a!==n&&delete r[n],r[a]=Lo(o),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return p.forEach(this,(i,o)=>{i!=null&&i!==!1&&(r[o]=t&&p.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(o=>i.set(o)),i}static accessor(t){let i=(this[Ll]=this[Ll]={accessors:{}}).accessors,o=this.prototype;function n(s){let a=yi(s);i[a]||(j1(o,s),i[a]=!0)}return p.isArray(t)?t.forEach(n):n(t),this}};xr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(xr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});p.freezeMethods(xr);var ye=xr;function vi(e,t){let r=this||Ar,i=t||r,o=ye.from(i.headers),n=i.data;return p.forEach(e,function(a){n=a.call(r,n,o.normalize(),t?t.status:void 0)}),o.normalize(),n}function bi(e){return!!(e&&e.__CANCEL__)}function Ul(e,t,r){x.call(this,e??"canceled",x.ERR_CANCELED,t,r),this.name="CanceledError"}p.inherits(Ul,x,{__CANCEL__:!0});var Nt=Ul;function Os(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new x("Request failed with status code "+r.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var Nl=ue.isStandardBrowserEnv?function(){return{write:function(r,i,o,n,s,a){let c=[];c.push(r+"="+encodeURIComponent(i)),p.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),p.isString(n)&&c.push("path="+n),p.isString(s)&&c.push("domain="+s),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){let i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ds(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function wi(e,t){return e&&!Ds(t)?Fs(e,t):t}var jl=ue.isStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function o(n){let s=n;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=o(window.location.href),function(s){let a=p.isString(s)?o(s):s;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}();function Bs(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function V1(e,t){e=e||10;let r=new Array(e),i=new Array(e),o=0,n=0,s;return t=t!==void 0?t:1e3,function(c){let l=Date.now(),u=i[n];s||(s=l),r[o]=c,i[o]=l;let d=n,f=0;for(;d!==o;)f+=r[d++],d=d%e;if(o=(o+1)%e,o===n&&(n=(n+1)%e),l-s<t)return;let g=u&&l-u;return g?Math.round(f*1e3/g):void 0}}var Vl=V1;function zl(e,t){let r=0,i=Vl(50,250);return o=>{let n=o.loaded,s=o.lengthComputable?o.total:void 0,a=n-r,c=i(a),l=n<=s;r=n;let u={loaded:n,total:s,progress:s?n/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-n)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}var z1=typeof XMLHttpRequest<"u",Gl=z1&&function(e){return new Promise(function(r,i){let o=e.data,n=ye.from(e.headers).normalize(),s=e.responseType,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}p.isFormData(o)&&(ue.isStandardBrowserEnv||ue.isStandardBrowserWebWorkerEnv?n.setContentType(!1):n.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){let g=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(g+":"+h))}let u=wi(e.baseURL,e.url);l.open(e.method.toUpperCase(),gi(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function d(){if(!l)return;let g=ye.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:g,config:e,request:l};Os(function(b){r(b),c()},function(b){i(b),c()},m),l=null}if("onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){!l||(i(new x("Request aborted",x.ECONNABORTED,e,l)),l=null)},l.onerror=function(){i(new x("Network Error",x.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",m=e.transitional||Bo;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),i(new x(h,m.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,e,l)),l=null},ue.isStandardBrowserEnv){let g=(e.withCredentials||jl(u))&&e.xsrfCookieName&&Nl.read(e.xsrfCookieName);g&&n.set(e.xsrfHeaderName,g)}o===void 0&&n.setContentType(null),"setRequestHeader"in l&&p.forEach(n.toJSON(),function(h,m){l.setRequestHeader(m,h)}),p.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&s!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",zl(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",zl(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=g=>{!l||(i(!g||g.type?new Nt(null,e,l):g),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));let f=Bs(u);if(f&&ue.protocols.indexOf(f)===-1){i(new x("Unsupported protocol "+f+":",x.ERR_BAD_REQUEST,e));return}l.send(o||null)})};var Uo={http:Do,xhr:Gl};p.forEach(Uo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var No={getAdapter:e=>{e=p.isArray(e)?e:[e];let{length:t}=e,r,i;for(let o=0;o<t&&(r=e[o],!(i=p.isString(r)?Uo[r.toLowerCase()]:r));o++);if(!i)throw i===!1?new x(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(p.hasOwnProp(Uo,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!p.isFunction(i))throw new TypeError("adapter is not a function");return i},adapters:Uo};function Ms(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function jo(e){return Ms(e),e.headers=ye.from(e.headers),e.data=vi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),No.getAdapter(e.adapter||Ar.adapter)(e).then(function(i){return Ms(e),i.data=vi.call(e,e.transformResponse,i),i.headers=ye.from(i.headers),i},function(i){return bi(i)||(Ms(e),i&&i.response&&(i.response.data=vi.call(e,e.transformResponse,i.response),i.response.headers=ye.from(i.response.headers))),Promise.reject(i)})}var Hl=e=>e instanceof ye?e.toJSON():e;function Tt(e,t){t=t||{};let r={};function i(l,u,d){return p.isPlainObject(l)&&p.isPlainObject(u)?p.merge.call({caseless:d},l,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function o(l,u,d){if(p.isUndefined(u)){if(!p.isUndefined(l))return i(void 0,l,d)}else return i(l,u,d)}function n(l,u){if(!p.isUndefined(u))return i(void 0,u)}function s(l,u){if(p.isUndefined(u)){if(!p.isUndefined(l))return i(void 0,l)}else return i(void 0,u)}function a(l,u,d){if(d in t)return i(l,u);if(d in e)return i(void 0,l)}let c={url:n,method:n,data:n,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>o(Hl(l),Hl(u),!0)};return p.forEach(Object.keys(Object.assign({},e,t)),function(u){let d=c[u]||o,f=d(e[u],t[u],u);p.isUndefined(f)&&d!==a||(r[u]=f)}),r}var Vo="1.5.0";var Ls={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ls[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});var Wl={};Ls.transitional=function(t,r,i){function o(n,s){return"[Axios v"+Vo+"] Transitional option '"+n+"'"+s+(i?". "+i:"")}return(n,s,a)=>{if(t===!1)throw new x(o(s," has been removed"+(r?" in "+r:"")),x.ERR_DEPRECATED);return r&&!Wl[s]&&(Wl[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(n,s,a):!0}};function G1(e,t,r){if(typeof e!="object")throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),o=i.length;for(;o-- >0;){let n=i[o],s=t[n];if(s){let a=e[n],c=a===void 0||s(a,n,e);if(c!==!0)throw new x("option "+n+" must be "+c,x.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new x("Unknown option "+n,x.ERR_BAD_OPTION)}}var zo={assertOptions:G1,validators:Ls};var jt=zo.validators,Tr=class{constructor(t){this.defaults=t,this.interceptors={request:new Rs,response:new Rs}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Tt(this.defaults,r);let{transitional:i,paramsSerializer:o,headers:n}=r;i!==void 0&&zo.assertOptions(i,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:zo.assertOptions(o,{encode:jt.function,serialize:jt.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=n&&p.merge(n.common,n[r.method]);n&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete n[h]}),r.headers=ye.concat(s,n);let a=[],c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});let l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!c){let h=[jo.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,l),f=h.length,u=Promise.resolve(r);d<f;)u=u.then(h[d++],h[d++]);return u}f=a.length;let g=r;for(d=0;d<f;){let h=a[d++],m=a[d++];try{g=h(g)}catch(y){m.call(this,y);break}}try{u=jo.call(this,g)}catch(h){return Promise.reject(h)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Tt(this.defaults,t);let r=wi(t.baseURL,t.url);return gi(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){Tr.prototype[t]=function(r,i){return this.request(Tt(i||{},{method:t,url:r,data:(i||{}).data}))}});p.forEach(["post","put","patch"],function(t){function r(i){return function(n,s,a){return this.request(Tt(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}Tr.prototype[t]=r(),Tr.prototype[t+"Form"]=r(!0)});var Si=Tr;var Ei=class{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});let i=this;this.promise.then(o=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](o);i._listeners=null}),this.promise.then=o=>{let n,s=new Promise(a=>{i.subscribe(a),n=a}).then(o);return s.cancel=function(){i.unsubscribe(n)},s},t(function(n,s,a){i.reason||(i.reason=new Nt(n,s,a),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Ei(function(o){t=o}),cancel:t}}},ql=Ei;function Us(e){return function(r){return e.apply(null,r)}}function Ns(e){return p.isObject(e)&&e.isAxiosError===!0}var js={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(js).forEach(([e,t])=>{js[t]=e});var $l=js;function Xl(e){let t=new Si(e),r=pi(Si.prototype.request,t);return p.extend(r,Si.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xl(Tt(e,o))},r}var Z=Xl(Ar);Z.Axios=Si;Z.CanceledError=Nt;Z.CancelToken=ql;Z.isCancel=bi;Z.VERSION=Vo;Z.toFormData=Ut;Z.AxiosError=x;Z.Cancel=Z.CanceledError;Z.all=function(t){return Promise.all(t)};Z.spread=Us;Z.isAxiosError=Ns;Z.mergeConfig=Tt;Z.AxiosHeaders=ye;Z.formToJSON=e=>Mo(p.isHTMLForm(e)?new FormData(e):e);Z.getAdapter=No.getAdapter;Z.HttpStatusCode=$l;Z.default=Z;var Vt=Z;var{Axios:Oy,AxiosError:Dy,CanceledError:Fy,isCancel:By,CancelToken:My,VERSION:Ly,all:Uy,Cancel:Ny,isAxiosError:jy,spread:Vy,toFormData:zy,AxiosHeaders:Gy,HttpStatusCode:Hy,formToJSON:Wy,getAdapter:qy,mergeConfig:$y}=Vt;var Rt=class{constructor(t,r){this.backend=r;this.imageUrlPackage=[];this.imageBatchNum=0;this.contImages=0;this.proctoringId=t}async uploadImages(t,r,i){let{file:o,onProgress:n}=t;try{let s=l=>{let u=l.loadedBytes/o.size*100;n&&n(Math.round(u))},a;if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+60;d++){let f=`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`;(d+1)%i==0&&(f=`${this.proctoringId}/${this.proctoringId}_${d+1}_realtime.jpg`),l.push({objectName:f,contentType:"image/jpeg"})}(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=60}let c=!1;return c=await Vt.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(l=>l.status==200||l.status==201?(this.contImages++,!0):!1).catch(()=>!1).finally(()=>{}),{storage:"upload",url:a,uploaded:c}}catch{throw I.registerError(this.proctoringId,`Failed to upload to AWS
|
|
4
4
|
File name: ${o.name}
|
|
5
5
|
File type: ${o.type}
|
|
6
6
|
File size: ${o.size}`),new Error("Failed to upload to AWS")}}async upload(t,r,i){let{file:o,onProgress:n}=t;try{let s=l=>{let u=l.loadedBytes/o.size*100;n&&n(Math.round(u))},a;if(i){if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+20;d++)l.push({objectName:`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`,contentType:"image/jpeg"});(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=20}}else a=await this.backend.getSignedUrl(r,o,this.proctoringId);let c=!1;return i?c=await Vt.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1).finally(()=>{this.contImages++}):c=await Vt.request({url:a,method:"PUT",headers:{"Content-Type":o.type,"x-ms-blob-type":"BlockBlob"},data:o,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1),{storage:"upload",url:a,uploaded:c}}catch{throw I.registerError(this.proctoringId,`Failed to upload to AWS
|
|
7
7
|
File name: ${o.name}
|
|
8
8
|
File type: ${o.type}
|
|
9
|
-
File size: ${o.size}`),new Error("Failed to upload to AWS")}}};var Kl="not_shared_first_screen",Jl="not_shared_screen",Go="multiple_monitors_detected",Yl="proctoring_already_started",Ho="proctoring_not_started";var Zl="another_stream_active",Ql="stream_under_minimum_permitted",eu="browser_not_supported",tu="token_missing",ru="credentials_missing";var ba=typeof self<"u"?self:{};function id(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=ba,o=0;o<r.length;o++)if((i=i[r[o]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function cr(){throw Error("Invalid UTF8")}function iu(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Wo,Vs,W1=typeof TextDecoder<"u",q1,$1=typeof TextEncoder<"u";function od(e){if($1)e=(q1||=new TextEncoder).encode(e);else{let r=0,i=new Uint8Array(3*e.length);for(let o=0;o<e.length;o++){var t=e.charCodeAt(o);if(128>t)i[r++]=t;else{if(2048>t)i[r++]=t>>6|192;else{if(55296<=t&&57343>=t){if(56319>=t&&o<e.length){let n=e.charCodeAt(++o);if(56320<=n&&57343>=n){t=1024*(t-55296)+n-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}o--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}var Ii,nd=id(610401301,!1),wa=id(572417392,!0),ou=ba.navigator;function Js(e){return!!nd&&!!Ii&&Ii.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Ve(e){var t;return(t=ba.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function zt(){return!!nd&&!!Ii&&0<Ii.brands.length}function zs(){return zt()?Js("Chromium"):(Ve("Chrome")||Ve("CriOS"))&&!(!zt()&&Ve("Edge"))||Ve("Silk")}Ii=ou&&ou.userAgentData||null;var X1=!zt()&&(Ve("Trident")||Ve("MSIE"));!Ve("Android")||zs(),zs(),Ve("Safari")&&(zs()||!zt()&&Ve("Coast")||!zt()&&Ve("Opera")||!zt()&&Ve("Edge")||(zt()?Js("Microsoft Edge"):Ve("Edg/"))||zt()&&Js("Opera"));var sd={},ki=null;function K1(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);var i=new Uint8Array(r),o=0;return function(n,s){function a(g){for(;c<n.length;){var h=n.charAt(c++),m=ki[h];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return g}ad();for(var c=0;;){var l=a(-1),u=a(0),d=a(64),f=a(64);if(f===64&&l===-1)break;s(l<<2|u>>4),d!=64&&(s(u<<4&240|d>>2),f!=64&&s(d<<6&192|f))}}(e,function(n){i[o++]=n}),o!==r?i.subarray(0,o):i}function ad(){if(!ki){ki={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));sd[r]=i;for(var o=0;o<i.length;o++){var n=i[o];ki[n]===void 0&&(ki[n]=o)}}}}var cd=typeof Uint8Array<"u",ld=!X1&&typeof btoa=="function";function nu(e){if(!ld){var t;t===void 0&&(t=0),ad(),t=sd[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var o=e[c],n=e[c+1],s=e[c+2],a=t[o>>2];o=t[(3&o)<<4|n>>4],n=t[(15&n)<<2|s>>6],s=t[63&s],r[l++]=a+o+n+s}switch(a=0,s=i,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||i;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var su=/[-_.]/g,J1={"-":"+",_:"/",".":"="};function Y1(e){return J1[e]||""}function ud(e){if(!ld)return K1(e);su.test(e)&&(e=e.replace(su,Y1)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function mn(e){return cd&&e!=null&&e instanceof Uint8Array}var Z1;function gn(){return Z1||=new Uint8Array(0)}var Ir={},Q1;function dd(e){if(e!==Ir)throw Error("illegal external caller")}function Or(){return Q1||=new Gt(null,Ir)}function Sa(e){dd(Ir);var t=e.Z;return(t=t==null||mn(t)?t:typeof t=="string"?ud(t):null)==null?t:e.Z=t}var Gt=class{constructor(e,t){if(dd(t),this.Z=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}wa(){let e=Sa(this);return e?new Uint8Array(e):gn()}};function hd(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Ea(){return Error("Failed to read varint, encoding is invalid.")}function pd(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function fd(e){return e.length==0?Or():new Gt(e,Ir)}function _a(e){if(typeof e=="string")return{buffer:ud(e),L:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),L:!1};if(e.constructor===Uint8Array)return{buffer:e,L:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),L:!1};if(e.constructor===Gt)return{buffer:Sa(e)||gn(),L:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),L:!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 ka(){return typeof BigInt=="function"}var Ys=!wa,au=!wa,e2=typeof Uint8Array.prototype.slice=="function",md,F=0,Q=0;function dr(e){let t=0>e,r=(e=Math.abs(e))>>>0;if(e=Math.floor((e-r)/4294967296),t){let[i,o]=xa(r,e);e=o,r=i}F=r>>>0,Q=e>>>0}function Aa(e){let t=md||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),Q=0,F=t.getUint32(0,!0)}function Zs(e,t){return 4294967296*t+(e>>>0)}function Ta(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=Zs(e,t),r?-e:e}function sn(e,t){if(e>>>=0,2097151>=(t>>>=0))var r=""+(4294967296*t+e);else ka()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),r=t+cu(r)+cu(e));return r}function cu(e){return e=String(e),"0000000".slice(e.length)+e}function gd(){var e=F,t=Q;if(2147483648&t)if(ka())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,i]=xa(e,t);e="-"+sn(r,i)}else e=sn(e,t);return e}function yn(e){if(16>e.length)dr(Number(e));else if(ka())e=BigInt(e),F=Number(e&BigInt(4294967295))>>>0,Q=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");Q=F=0;let r=e.length;for(let i=t,o=(r-t)%6+t;o<=r;i=o,o+=6){let n=Number(e.slice(i,o));Q*=1e6,F=1e6*F+n,4294967296<=F&&(Q+=Math.trunc(F/4294967296),Q>>>=0,F>>>=0)}if(t){let[i,o]=xa(F,Q);F=i,Q=o}}}function xa(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ra(e,t){let r,i=0,o=0,n=0,s=e.h,a=e.g;do r=s[a++],i|=(127&r)<<n,n+=7;while(32>n&&128&r);for(32<n&&(o|=(127&r)>>4),n=3;32>n&&128&r;n+=7)r=s[a++],o|=(127&r)<<n;if(hr(e,a),128>r)return t(i>>>0,o>>>0);throw Ea()}function Ca(e){let t=0,r=e.g,i=r+10,o=e.h;for(;r<i;){let n=o[r++];if(t|=n,(128&n)==0)return hr(e,r),!!(127&t)}throw Ea()}function Wt(e){let t=e.h,r=e.g,i=t[r++],o=127&i;if(128&i&&(i=t[r++],o|=(127&i)<<7,128&i&&(i=t[r++],o|=(127&i)<<14,128&i&&(i=t[r++],o|=(127&i)<<21,128&i&&(i=t[r++],o|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Ea();return hr(e,r),o}function qt(e){return Wt(e)>>>0}function Qs(e){var t=e.h;let r=e.g,i=t[r],o=t[r+1],n=t[r+2];return t=t[r+3],hr(e,e.g+4),(i<<0|o<<8|n<<16|t<<24)>>>0}function ea(e){var t=Qs(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:1/0*e:r==0?e*Math.pow(2,-149)*t:e*Math.pow(2,r-150)*(t+Math.pow(2,23))}function t2(e){return Wt(e)}function Gs(e,t,{aa:r=!1}={}){e.aa=r,t&&(t=_a(t),e.h=t.buffer,e.m=t.L,e.j=0,e.l=e.h.length,e.g=e.j)}function hr(e,t){if(e.g=t,t>e.l)throw pd(e.l,t)}function yd(e,t){if(0>t)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,i=r+t;if(i>e.l)throw pd(t,e.l-r);return e.g=i,r}function vd(e,t){if(t==0)return Or();var r=yd(e,t);return e.aa&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?gn():e2?e.slice(r,t):new Uint8Array(e.subarray(r,t))),fd(r)}var lu=[];function bd(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=qt(e.g);if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw hd(r,e.l);if(1>t)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function Jo(e){switch(e.h){case 0:e.h!=0?Jo(e):Ca(e.g);break;case 1:hr(e=e.g,e.g+8);break;case 2:if(e.h!=2)Jo(e);else{var t=qt(e.g);hr(e=e.g,e.g+t)}break;case 5:hr(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!bd(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Jo(e)}break;default:throw hd(e.h,e.l)}}function Ni(e,t,r){let i=e.g.l,o=qt(e.g),n=e.g.g+o,s=n-i;if(0>=s&&(e.g.l=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=n,e.g.l=i,t}function Pa(e){var t=qt(e.g),r=yd(e=e.g,t);if(e=e.h,W1){var i,o=e;(i=Vs)||(i=Vs=new TextDecoder("utf-8",{fatal:!0})),t=r+t,o=r===0&&t===o.length?o:o.subarray(r,t);try{var n=i.decode(o)}catch(a){if(Wo===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),Wo=!0}catch{Wo=!1}}throw!Wo&&(Vs=void 0),a}}else{t=(n=r)+t,r=[];let a,c=null;for(;n<t;){var s=e[n++];128>s?r.push(s):224>s?n>=t?cr():(a=e[n++],194>s||(192&a)!=128?(n--,cr()):r.push((31&s)<<6|63&a)):240>s?n>=t-1?cr():(a=e[n++],(192&a)!=128||s===224&&160>a||s===237&&160<=a||(192&(i=e[n++]))!=128?(n--,cr()):r.push((15&s)<<12|(63&a)<<6|63&i)):244>=s?n>=t-2?cr():(a=e[n++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(i=e[n++]))!=128||(192&(o=e[n++]))!=128?(n--,cr()):(s=(7&s)<<18|(63&a)<<12|(63&i)<<6|63&o,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):cr(),8192<=r.length&&(c=iu(c,r),r.length=0)}n=iu(c,r)}return n}function wd(e){let t=qt(e.g);return vd(e.g,t)}function vn(e,t,r){var i=qt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var qo=[];function uu(e){return e?/^\d+$/.test(e)?(yn(e),new du(F,Q)):null:r2||=new du(0,0)}var du=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},r2;function hu(e){return e?/^-?\d+$/.test(e)?(yn(e),new pu(F,Q)):null:i2||=new pu(0,0)}var pu=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},i2;function an(e,t,r){for(;0<r||127<t;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ji(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function bn(e,t){if(0<=t)ji(e,t);else{for(let r=0;9>r;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Oi(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 Dr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function qe(e,t,r){ji(e.g,8*t+r)}function Ia(e,t){return qe(e,t,2),t=e.g.end(),Dr(e,t),t.push(e.h),t}function Oa(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;127<r;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function wn(e,t,r){qe(e,t,2),ji(e.g,r.length),Dr(e,e.g.end()),Dr(e,r)}function ta(e,t,r,i){r!=null&&(t=Ia(e,t),i(r,e),Oa(e,t))}var $t=class{constructor(t,r,i,o){this.g=t,this.h=r,this.l=i,this.qa=o}};function we(e){return Array.prototype.slice.call(e)}function Sd(e){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():e}var ft=Sd(),fu=Sd("0di"),Sn=ft?(e,t)=>{e[ft]|=t}:(e,t)=>{e.D!==void 0?e.D|=t:Object.defineProperties(e,{D:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function mu(e){let t=G(e);(1&t)!=1&&(Object.isFrozen(e)&&(e=we(e)),q(e,1|t))}var cn=ft?(e,t)=>{e[ft]&=~t}:(e,t)=>{e.D!==void 0&&(e.D&=~t)};function de(e,t,r){return r?e|t:e&~t}var G=ft?e=>0|e[ft]:e=>0|e.D,C=ft?e=>e[ft]:e=>e.D,q=ft?(e,t)=>{e[ft]=t}:(e,t)=>{e.D!==void 0?e.D=t:Object.defineProperties(e,{D:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function gu(){var e=[];return Sn(e,1),e}function jr(e){return Sn(e,34),e}function o2(e,t){q(t,-14591&(0|e))}function ra(e,t){q(t,-14557&(34|e))}function ln(e){return(e=e>>14&1023)===0?536870912:e}var Vi={},Ed={};function yu(e){return!(!e||typeof e!="object"||e.Na!==Ed)}function Ti(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}var _d=!wa;function kd(e,t,r){if(e!=null){if(typeof e=="string")e=e?new Gt(e,Ir):Or();else if(e.constructor!==Gt)if(mn(e))e=r?fd(e):e.length?new Gt(new Uint8Array(e),Ir):Or();else{if(!t)throw Error();e=void 0}}return e}function ia(e,t,r){if(!Array.isArray(e)||e.length)return!1;let i=G(e);return!!(1&i)||!(!t||!(Array.isArray(t)?t.includes(r):t.has(r)))&&(q(e,1|i),!0)}var ur,vu=[];function vt(e){if(2&e)throw Error()}q(vu,55),ur=Object.freeze(vu);var Fr=class{constructor(t,r,i){this.l=0,this.g=t,this.h=r,this.m=i}next(){if(this.l<this.g.length){let 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 Fr(this.g,this.h,this.m)}},n2={},Ht,Di;function Ad(e,t){(t=Ht?t[Ht]:void 0)&&(e[Ht]=we(t))}function oa(e){return(e=Error(e)).__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity="warning",e}function Yt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Td(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}Object.freeze(new class{}),Object.freeze(new class{});var s2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function En(e){let t=typeof e;return t==="number"?Number.isFinite(e):t==="string"&&s2.test(e)}function Vr(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 a2(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 bu(e){return e[0]!=="-"&&(20>e.length||e.length===20&&184467>Number(e.substring(0,6)))}function xd(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 Da(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(dr(e),e=Ta(F,Q)),e}function Fa(e){var t=Math.trunc(Number(e));return Number.isSafeInteger(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),xd(e)||(yn(e),e=gd()),e)}function un(e){return e==null?e:En(e)?typeof e=="number"?Da(e):Fa(e):void 0}function zi(e){if(typeof e!="string")throw Error();return e}function Gi(e){if(e!=null&&typeof e!="string")throw Error();return e}function Fi(e){return e==null||typeof e=="string"?e:void 0}function Ba(e,t,r,i){if(e!=null&&typeof e=="object"&&e.W===Vi)return e;if(!Array.isArray(e))return r?2&i?(e=t[fu])?t=e:(jr((e=new t).s),t=t[fu]=e):t=new t:t=void 0,t;let o=r=G(e);return o===0&&(o|=32&i),o|=2&i,o!==r&&q(e,o),new t(e)}function c2(e,t,r){if(t){var i=!!i;if(!En(t=e))throw oa("int64");typeof t=="string"?i=Fa(t):i?(i=Math.trunc(t),Number.isSafeInteger(i)?i=String(i):xd(t=String(i))?i=t:(dr(i),i=gd())):i=Da(t)}else i=un(e);return typeof(r=(e=i)==null?r?0:void 0:e)=="string"&&(i=+r,Number.isSafeInteger(i))?i:r}var dn,Ma,l2;function hn(e){switch(typeof e){case"boolean":return Ma||=[0,void 0,!0];case"number":return 0<e?void 0:e===0?l2||=[0,void 0]:[-e,void 0];case"string":return[0,e];case"object":return e}}function pr(e,t){return Rd(e,t[0],t[1])}function Rd(e,t,r){if(e==null&&(e=dn),dn=void 0,e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error();if(64&(i=G(e)))return Di&&delete e[Di],e;if(i|=64,r&&(i|=512,r!==e[0]))throw Error();e:{let o=(r=e).length;if(o){let n=o-1;if(Ti(r[n])){if(1024<=(t=n-(+!!(512&(i|=256))-1)))throw Error();i=-16760833&i|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&i)-1))))throw Error();i=-16760833&i|(1023&t)<<14}}}return q(e,i),e}var u2=function(){try{return new class extends Map{constructor(){super()}},!1}catch{return!0}}(),xi=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}},d2=u2?(Object.setPrototypeOf(xi.prototype,Map.prototype),Object.defineProperties(xi.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),xi):class extends Map{constructor(){super()}};function $o(e){return e}function Hs(e){if(2&e.O)throw Error("Cannot mutate an immutable Map")}var Ge=class extends d2{constructor(e,t,r=$o,i=$o){super();let o=G(e);o|=64,q(e,o),this.O=o,this.V=t,this.R=r||$o,this.Y=this.V?h2:i||$o;for(let n=0;n<e.length;n++){let s=e[n],a=r(s[0],!1,!0),c=s[1];t?c===void 0&&(c=null):c=i(s[1],!1,!0,void 0,void 0,o),super.set(a,c)}}pa(e=wu){return this.X(e)}X(e=wu){let t=[],r=super.entries();for(var i;!(i=r.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){Hs(this),super.clear()}delete(e){return Hs(this),super.delete(this.R(e,!0,!1))}entries(){var e=this.ma();return new Fr(e,p2,this)}keys(){return this.Ma()}values(){var e=this.ma();return new Fr(e,Ge.prototype.get,this)}forEach(e,t){super.forEach((r,i)=>{e.call(t,this.get(i),i,this)})}set(e,t){return Hs(this),(e=this.R(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.Y(t,!0,!0,this.V,!1,this.O))}Ta(e){let t=this.R(e[0],!1,!0);e=e[1],e=this.V?e===void 0?null:e:this.Y(e,!1,!0,void 0,!1,this.O),super.set(t,e)}has(e){return super.has(this.R(e,!1,!1))}get(e){e=this.R(e,!1,!1);let t=super.get(e);if(t!==void 0){var r=this.V;return r?((r=this.Y(t,!1,!0,r,this.xa,this.O))!==t&&super.set(e,r),r):t}}ma(){return Array.from(super.keys())}Ma(){return super.keys()}[Symbol.iterator](){return this.entries()}};function h2(e,t,r,i,o,n){return e=Ba(e,i,r,n),o&&(e=_n(e)),e}function wu(e){return e}function p2(e){return[e,this.get(e)]}function La(e,t,r,i,o,n){if(e!=null){if(Array.isArray(e))e=o&&e.length==0&&1&G(e)?void 0:n&&2&G(e)?e:Ua(e,t,r,i!==void 0,o,n);else if(Ti(e)){let s={};for(let a in e)s[a]=La(e[a],t,r,i,o,n);e=s}else e=t(e,i);return e}}function Ua(e,t,r,i,o,n){let s=i||r?G(e):0;i=i?!!(32&s):void 0;let a=we(e);for(let c=0;c<a.length;c++)a[c]=La(a[c],t,r,i,o,n);return r&&(Ad(a,e),r(s,a)),a}function f2(e){return La(e,Cd,void 0,void 0,!1,!1)}function Cd(e){return e.W===Vi?e.toJSON():e instanceof Ge?e.pa(f2):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))return _d||!ia(t,void 0,9999)?t:void 0;if(mn(t))return nu(t);if(t instanceof Gt){let r=t.Z;return r==null?"":typeof r=="string"?r:t.Z=nu(r)}if(t instanceof Ge)return t=t.pa(),Ys||t.length!==0?t:void 0}}return t}(e)}function na(e,t,r=ra){if(e!=null){if(cd&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=G(e);return 2&i?e:(t&&=i===0||!!(32&i)&&!(64&i||!(16&i)),t?(q(e,-12293&(34|i)),e):Ua(e,na,4&i?ra:r,!0,!1,!0))}return e.W===Vi?(r=e.s,e=2&(i=C(r))?e:Na(e,r,i,!0)):e instanceof Ge&&(r=jr(e.X(na)),e=new Ge(r,e.V,e.R,e.Y)),e}}function Na(e,t,r,i){return e=e.constructor,dn=t=Pd(t,r,i),t=new e(t),dn=void 0,t}function Pd(e,t,r){let i=r||2&t?ra:o2,o=!!(32&t);return e=function(n,s,a){let c=we(n);var l=c.length;let u=256&s?c[l-1]:void 0;for(l+=u?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(u){s=c[s]={};for(let d in u)s[d]=a(u[d])}return Ad(c,n),c}(e,t,n=>na(n,o,i)),Sn(e,32|(r?2:0)),e}function _n(e){let t=e.s,r=C(t);return 2&r?Na(e,t,r,!1):e}function Br(e,t){return bt(e=e.s,C(e),t)}function bt(e,t,r,i){if(r===-1)return null;if(r>=ln(t)){if(256&t)return e[e.length-1][r]}else{var o=e.length;if(i&&256&t&&(i=e[o-1][r])!=null)return i;if((t=r+(+!!(512&t)-1))<o)return e[t]}}function B(e,t,r,i){let o=e.s,n=C(o);return vt(n),M(o,n,t,r,i),e}function M(e,t,r,i,o){var n=ln(t);if(r>=n||o){if(o=t,256&t)n=e[e.length-1];else{if(i==null)return o;n=e[n+(+!!(512&t)-1)]={},o|=256}return n[r]=i,o!==t&&q(e,o),o}return e[r+(+!!(512&t)-1)]=i,256&t&&r in(e=e[e.length-1])&&delete e[r],t}function zr(e,t,r,i,o){var n=2&t;let s=bt(e,t,r,o);Array.isArray(s)||(s=ur);let a=!(2&i);i=!(1&i);let c=!!(32&t),l=G(s);return l!==0||!c||n||a?1&l||(l|=1,q(s,l)):(l|=33,q(s,l)),n?(e=!1,2&l||(jr(s),e=!!(4&l)),(i||e)&&Object.freeze(s)):(n=!!(2&l)||!!(2048&l),i&&n?(s=we(s),i=1,c&&!a&&(i|=32),q(s,i),M(e,t,r,s,o)):a&&32&l&&!n&&cn(s,32)),s}function Yo(e,t){e=e.s;let r=C(e),i=bt(e,r,t),o=Yt(i);return o!=null&&o!==i&&M(e,r,t,o),o}function Id(e){e=e.s;let t=C(e),r=bt(e,t,1),i=kd(r,!0,!!(34&t));return i!=null&&i!==r&&M(e,t,1,i),i}function Cr(e,t,r){e=e.s;let i=C(e),o=2&i?1:2,n=Od(e,i,t);var s=G(n);if(!(4&s)){(4&s||Object.isFrozen(n))&&(n=we(n),s=fr(s,i,!1),i=M(e,i,t,n));var a=0;let c=0;for(;a<n.length;a++){let l=r(n[a]);l!=null&&(n[c++]=l)}c<a&&(n.length=c),s=de(s=Dd(s,i,!1),20,!0),s=de(s,4096,!1),s=de(s,8192,!1),q(n,s),2&s&&Object.freeze(n)}return Ri(s)||(r=s,(s=(a=o===1)?de(s,2,!0):de(s,32,!1))!==r&&q(n,s),a&&Object.freeze(n)),o===2&&Ri(s)&&(n=we(n),s=fr(s,i,!1),q(n,s),M(e,i,t,n)),n}function Od(e,t,r){return e=bt(e,t,r),Array.isArray(e)?e:ur}function Dd(e,t,r){return e===0&&(e=fr(e,t,r)),de(e,1,!0)}function Ri(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}var m2;function Su(){return m2??=new Ge(jr([]),void 0,void 0,void 0,n2)}function Fd(e){e=we(e);for(let t=0;t<e.length;t++){let r=e[t]=we(e[t]);Array.isArray(r[1])&&(r[1]=jr(r[1]))}return e}function pn(e,t,r){{let s=e.s,a=C(s);if(vt(a),r==null)M(s,a,t);else{var i,o=e=G(r),n=!!(2&e)||Object.isFrozen(r);if((i=!n)&&(i=!1),!(4&e))for(e=21,n&&(r=we(r),o=0,e=fr(e,a,!0)),n=0;n<r.length;n++)r[n]=zi(r[n]);i&&(r=we(r),o=0,e=fr(e,a,!0)),e!==o&&q(r,e),M(s,a,t,r)}}}function Hi(e,t,r,i){let o=C(e);vt(o),e=zr(e,o,t,2),i=r(i,!!(4&(t=G(e)))&&!!(4096&t)),e.push(i)}function g2(e){return e}function Ws(e,t){return ja(e=e.s,C(e),vh)===t?t:-1}function ja(e,t,r){let i=0;for(let o=0;o<r.length;o++){let n=r[o];bt(e,t,n)!=null&&(i!==0&&(t=M(e,t,i)),i=n)}return i}function Va(e,t,r,i){let o=C(e);vt(o);let n=bt(e,o,r,i),s;if(n!=null&&n.W===Vi)return(t=_n(n))!==n&&M(e,o,r,t,i),t.s;if(Array.isArray(n)){let a=G(n);s=2&a?Pd(n,a,!1):n,s=pr(s,t)}else s=pr(void 0,t);return s!==n&&M(e,o,r,s,i),s}function Bd(e,t,r,i){e=e.s;let o=C(e),n=bt(e,o,r,i);return(t=Ba(n,t,!1,o))!==n&&t!=null&&M(e,o,r,t,i),t}function R(e,t,r,i=!1){if((t=Bd(e,t,r,i))==null)return t;e=e.s;let o=C(e);if(!(2&o)){let n=_n(t);n!==t&&M(e,o,r,t=n,i)}return t}function Md(e,t,r,i,o,n){var s=!!(2&t),a=s?1:2;let c=a===1;a=a===2,o=!!o,n&&=!s,s=Od(e,t,i);var l=G(s);let u=!!(4&l);if(!u){var d=s,f=t;let g=!!(2&(l=Dd(l,t,o)));g&&(f=de(f,2,!0));let h=!g,m=!0,y=0,b=0;for(;y<d.length;y++){let k=Ba(d[y],r,!1,f);if(k instanceof r){if(!g){let P=!!(2&G(k.s));h&&=!P,m&&=P}d[b++]=k}}b<y&&(d.length=b),l=de(l,4,!0),l=de(l,16,m),l=de(l,8,h),q(d,l),g&&Object.freeze(d)}if(r=!!(8&l)||c&&!s.length,n&&!r){for(Ri(l)&&(s=we(s),l=fr(l,t,o),t=M(e,t,i,s)),n=s,r=l,d=0;d<n.length;d++)(l=n[d])!==(f=_n(l))&&(n[d]=f);r=de(r,8,!0),r=de(r,16,!n.length),q(n,r),l=r}return Ri(l)||(n=l,c?l=de(l,!s.length||16&l&&(!u||32&l)?2:2048,!0):o||(l=de(l,32,!1)),l!==n&&q(s,l),c&&Object.freeze(s)),a&&Ri(l)&&(s=we(s),l=fr(l,t,o),q(s,l),M(e,t,i,s)),s}function Dt(e,t,r){e=e.s;let i=C(e);return Md(e,i,t,r,!1,!(2&i))}function _(e,t,r,i,o){return i==null&&(i=void 0),B(e,r,i,o)}function Ci(e,t,r,i){i==null&&(i=void 0),e=e.s;let o=C(e);vt(o),(r=ja(e,o,r))&&r!==t&&i!=null&&(o=M(e,o,r)),M(e,o,t,i)}function fr(e,t,r){return e=de(e,2,!!(2&t)),e=de(e,32,!!(32&t)&&r),de(e,2048,!1)}function sa(e,t,r){e=e.s;let i=C(e);vt(i),e=Md(e,i,t,1,!0),t=r??new t,e.push(t),2&G(t.s)?cn(e,8):cn(e,16)}function ze(e,t){return Vr(Br(e,t))}function He(e,t){return Fi(Br(e,t))}function mt(e){return e??0}function he(e,t){return mt(Yo(e,t))}function Bi(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);B(e,t,r)}function gt(e,t,r){if(r!=null){if(typeof r!="number"||!Number.isFinite(r))throw oa("int32");r|=0}B(e,t,r)}function A(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);B(e,t,r)}function rt(e,t,r){t.g?t.m(e,t.g,t.h,r,!0):t.m(e,t.h,r,!0)}Ge.prototype.toJSON=void 0,Ge.prototype.Na=Ed;var v=class{constructor(e,t){this.s=Rd(e,t)}toJSON(){return Ld(this,Ua(this.s,Cd,void 0,void 0,!1,!1),!0)}l(){var e=w0;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)}clone(){let e=this.s;return Na(this,e,C(e),!1)}L(){return!!(2&G(this.s))}};function Ld(e,t,r){let i=e.constructor.A;var o=C(r?e.s:t),n=ln(o),s=!1;if(i&&_d){if(!r){var a;if((t=we(t)).length&&Ti(a=t[t.length-1])){for(s=0;s<i.length;s++)if(i[s]>=n){Object.assign(t[t.length-1]={},a);break}}s=!0}var c;n=t,r=!r,e=ln(a=C(e.s)),a=+!!(512&a)-1;for(let y=0;y<i.length;y++){var l=i[y];if(l<e){var u=n[l+=a];u==null?n[l]=r?ur:gu():r&&u!==ur&&mu(u)}else{if(!c){var d=void 0;n.length&&Ti(d=n[n.length-1])?c=d:n.push(c={})}u=c[l],c[l]==null?c[l]=r?ur:gu():r&&u!==ur&&mu(u)}}}if(!(c=t.length))return t;let f,g;if(Ti(d=t[c-1])){e:{var h=d;for(var m in n={},r=!1,h)e=h[m],Array.isArray(e)&&(a=e,(!au&&ia(e,i,+m)||!Ys&&yu(e)&&e.size===0)&&(e=null),e!=a&&(r=!0)),e!=null?n[m]=e:r=!0;if(r){for(let y in n){h=n;break e}h=null}}h!=d&&(f=!0),c--}for(o=+!!(512&o)-1;0<c&&((d=t[m=c-1])==null||!au&&ia(d,i,m-o)||!Ys&&yu(d)&&d.size===0);c--)g=!0;return(f||g)&&(t=s?t:Array.prototype.slice.call(t,0,c),s&&(t.length=c),h&&t.push(h)),t}function Ud(e){return Array.isArray(e)?e[0]instanceof $t?e:[x2,e]:[e,void 0]}function Gr(e,t){if(Array.isArray(t)){var r=G(t);if(4&r)return t;for(var i=0,o=0;i<t.length;i++){let n=e(t[i]);n!=null&&(t[o++]=n)}return o<i&&(t.length=o),q(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}v.prototype.W=Vi,v.prototype.toString=function(){return Ld(this,this.s,!1).toString()};var Eu=Symbol();function za(e){let t=e[Eu];if(!t){let r=Vd(e),i=Ha(e),o=i.g;t=o?(n,s)=>o(n,s,i):(n,s)=>{for(;bd(s)&&s.h!=4;){var a=s.m,c=i[a];if(!c){var l=i.ha;l&&(l=l[a])&&(c=i[a]=y2(l))}c&&c(s,n,a)||(a=(c=s).l,Jo(c),c.ga?c=void 0:(l=c.g.g-a,c.g.g=a,c=vd(c.g,l)),a=n,c&&(Ht||=Symbol(),(l=a[Ht])?l.push(c):a[Ht]=[c]))}r===Nd||r===jd||r.Oa||(n[Di||=Symbol()]=r)},e[Eu]=t}return t}function y2(e){let t=(e=Ud(e))[0].g;if(e=e[1]){let r=za(e),i=Ha(e).S;return(o,n,s)=>t(o,n,s,i,r)}return t}var Nd,jd,Zo=Symbol();function v2(e,t,r){let i=r[1],o;if(i){let n=i[Zo];o=n?n.S:hn(i[0]),e[t]=n??i}o&&o===Ma?(e.na||(e.na=[])).push(t):r[0]&&(e.oa||(e.oa=[])).push(t)}function _u(e,t){return[e.l,!t||0<t[0]?void 0:t]}function Vd(e){var t=e[Zo];if(t)return t;if(!(t=Ga(e,e[Zo]={},_u,_u,v2)).oa&&!t.na){let r=!0;for(let i in t){isNaN(i)||(r=!1);break}r?(t=hn(e[0])===Ma,t=e[Zo]=t?jd||={S:hn(!0)}:Nd||={}):t.Oa=!0}return t}function b2(e,t,r){e[t]=r}function Ga(e,t,r,i,o=b2){t.S=hn(e[0]);let n=0;var s=e[++n];s&&s.constructor===Object&&(t.ha=s,typeof(s=e[++n])=="function"&&(t.g=s,t.h=e[++n],s=e[++n]));let a={};for(;Array.isArray(s)&&typeof s[0]=="number"&&0<s[0];){for(var c=0;c<s.length;c++)a[s[c]]=s;s=e[++n]}for(c=1;s!==void 0;){let d;typeof s=="number"&&(c+=s,s=e[++n]);var l=void 0;if(s instanceof $t?d=s:(d=R2,n--),d.qa){s=e[++n],l=e;var u=n;typeof s=="function"&&(s=s(),l[u]=s),l=s}for(u=c+1,typeof(s=e[++n])=="number"&&0>s&&(u-=s,s=e[++n]);c<u;c++){let f=a[c];o(t,c,l?i(d,l,f):r(d,f))}}return t}var ku=Symbol();function zd(e){let t=e[ku];if(!t){let r=kn(e);t=(i,o)=>Gd(i,o,r),e[ku]=t}return t}var Qo=Symbol();function w2(e){return e.h}function S2(e,t){let r,i,o=e.h;return(n,s,a)=>o(n,s,a,i||=kn(t).S,r||=zd(t))}function kn(e){let t=e[Qo];return t||(t=Ga(e,e[Qo]={},w2,S2),en in e&&Qo in e&&(e.length=0),t)}var en=Symbol();function E2(e,t){let r=e.g;return t?(i,o,n)=>r(i,o,n,t):r}function _2(e,t,r){let i=e.g,o,n;return(s,a,c)=>i(s,a,c,n||=Ha(t).S,o||=za(t),r)}function Ha(e){let t=e[en];return t||(Vd(e),t=Ga(e,e[en]={},E2,_2),en in e&&Qo in e&&(e.length=0),t)}function Au(e,t){var r=e[t];if(r)return r;if((r=e.ha)&&(r=r[t])){var i=(r=Ud(r))[0].h;if(r=r[1]){let o=zd(r),n=kn(r).S;r=(r=e.h)?r(n,o):(s,a,c)=>i(s,a,c,n,o)}else r=i;return e[t]=r}}function Gd(e,t,r){for(var i=C(e),o=+!!(512&i)-1,n=e.length,s=512&i?1:0,a=n+(256&i?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-o,u=Au(r,l);u&&u(t,c,l)}if(256&i){i=e[n-1];for(let c in i)o=+c,Number.isNaN(o)||(n=i[c])!=null&&(a=Au(r,o))&&a(t,n,o)}if(e=Ht?e[Ht]:void 0)for(Dr(t,t.g.end()),r=0;r<e.length;r++)Dr(t,Sa(e[r])||gn())}function Te(e,t){return new $t(e,t,!1,!1)}function Hr(e,t){return new $t(e,t,!0,!1)}function An(e,t){return new $t(e,t,!1,!0)}function xe(e,t,r){M(e,C(e),t,r)}var k2=An(function(e,t,r,i,o){return e.h===2&&(e=Ni(e,pr([void 0,void 0],i),o),vt(i=C(t)),(o=bt(t,i,r))instanceof Ge?(2&o.O)!=0?((o=o.X()).push(e),M(t,i,r,o)):o.Ta(e):Array.isArray(o)?(2&G(o)&&M(t,i,r,o=Fd(o)),o.push(e)):M(t,i,r,[e]),!0)},function(e,t,r,i,o){if(t instanceof Ge)t.forEach((n,s)=>{ta(e,r,pr([s,n],i),o)});else if(Array.isArray(t))for(let n=0;n<t.length;n++){let s=t[n];Array.isArray(s)&&ta(e,r,pr(s,i),o)}});function Hd(e,t,r){e:if(t!=null){if(En(t)){if(typeof t=="string"){t=Fa(t);break e}if(typeof t=="number"){t=Da(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&hu(t),t!=null&&(qe(e,r,0),typeof t=="number"?(e=e.g,dr(t),an(e,F,Q)):(r=hu(t),an(e.g,r.h,r.g))))}function Wd(e,t,r){(t=Vr(t))!=null&&t!=null&&(qe(e,r,0),bn(e.g,t))}function qd(e,t,r){(t=Td(t))!=null&&(qe(e,r,0),e.g.g.push(t?1:0))}function $d(e,t,r){(t=Fi(t))!=null&&wn(e,r,od(t))}function Tn(e,t,r,i,o){ta(e,r,t instanceof v?t.s:Array.isArray(t)?pr(t,i):void 0,o)}function Xd(e,t,r){(t=t==null||typeof t=="string"||mn(t)||t instanceof Gt?t:void 0)!=null&&wn(e,r,_a(t).buffer)}function Kd(e,t,r){return(e.h===5||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,ea,t):t.push(ea(e.g)),!0)}var oe,Ot=Te(function(e,t,r){if(e.h!==1)return!1;var i=e.g;e=Qs(i);let o=Qs(i);i=2*(o>>31)+1;let n=o>>>20&2047;return e=4294967296*(1048575&o)+e,xe(t,r,n==2047?e?NaN:1/0*i:n==0?i*Math.pow(2,-1074)*e:i*Math.pow(2,n-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=Yt(t))!=null&&(qe(e,r,1),e=e.g,(r=md||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),F=r.getUint32(0,!0),Q=r.getUint32(4,!0),Oi(e,F),Oi(e,Q))}),ne=Te(function(e,t,r){return e.h===5&&(xe(t,r,ea(e.g)),!0)},function(e,t,r){(t=Yt(t))!=null&&(qe(e,r,5),e=e.g,Aa(t),Oi(e,F))}),A2=Hr(Kd,function(e,t,r){if((t=Gr(Yt,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&(qe(i,o,5),i=i.g,Aa(n),Oi(i,F))}}),Wa=Hr(Kd,function(e,t,r){if((t=Gr(Yt,t))!=null&&t.length){qe(e,r,2),ji(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,Aa(t[i]),Oi(r,F)}}),Xt=Te(function(e,t,r){return e.h===0&&(xe(t,r,Ra(e.g,Ta)),!0)},Hd),qs=Te(function(e,t,r){return e.h===0&&(xe(t,r,(e=Ra(e.g,Ta))===0?void 0:e),!0)},Hd),T2=Te(function(e,t,r){return e.h===0&&(xe(t,r,Ra(e.g,Zs)),!0)},function(e,t,r){e:if(t!=null){if(En(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)),bu(t)||(yn(t),t=sn(F,Q)));break e}if(typeof t=="number"){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(o){if(0>o){dr(o);let n=sn(F,Q);return o=Number(n),Number.isSafeInteger(o)?o:n}return bu(String(o))?o:(dr(o),Zs(F,Q))}(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&uu(t),t!=null&&(qe(e,r,0),typeof t=="number"?(e=e.g,dr(t),an(e,F,Q)):(r=uu(t),an(e.g,r.h,r.g))))}),K=Te(function(e,t,r){return e.h===0&&(xe(t,r,Wt(e.g)),!0)},Wd),qa=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,Wt,t):t.push(Wt(e.g)),!0)},function(e,t,r){if((t=Gr(Vr,t))!=null&&t.length){r=Ia(e,r);for(let i=0;i<t.length;i++)bn(e.g,t[i]);Oa(e,r)}}),Mr=Te(function(e,t,r){return e.h===0&&(xe(t,r,(e=Wt(e.g))===0?void 0:e),!0)},Wd),ee=Te(function(e,t,r){return e.h===0&&(xe(t,r,Ca(e.g)),!0)},qd),Pi=Te(function(e,t,r){return e.h===0&&(xe(t,r,(e=Ca(e.g))===!1?void 0:e),!0)},qd),ve=Hr(function(e,t,r){return e.h===2&&(Hi(t,r,g2,e=Pa(e)),!0)},function(e,t,r){if((t=Gr(Fi,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&wn(i,o,od(n))}}),Kt=Te(function(e,t,r){return e.h===2&&(xe(t,r,(e=Pa(e))===""?void 0:e),!0)},$d),U=Te(function(e,t,r){return e.h===2&&(xe(t,r,Pa(e)),!0)},$d),x2=An(function(e,t,r,i,o){return e.h===2&&(Ni(e,Va(t,i,r,!0),o),!0)},Tn),R2=An(function(e,t,r,i,o){return e.h===2&&(Ni(e,Va(t,i,r),o),!0)},Tn);oe=new $t(function(e,t,r,i,o){if(e.h!==2)return!1;i=pr(void 0,i);let n=C(t);vt(n);let s=zr(t,n,r,3);return n=C(t),4&G(s)&&(s=we(s),q(s,-2079&(1|G(s))),M(t,n,r,s)),s.push(i),Ni(e,i,o),!0},function(e,t,r,i,o){if(Array.isArray(t))for(let n=0;n<t.length;n++)Tn(e,t[n],r,i,o)},!0,!0);var N=An(function(e,t,r,i,o,n){if(e.h!==2)return!1;let s=C(t);return vt(s),(n=ja(t,s,n))&&r!==n&&M(t,s,n),Ni(e,t=Va(t,i,r),o),!0},Tn),Jd=Te(function(e,t,r){return e.h===2&&(xe(t,r,wd(e)),!0)},Xd),C2=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,qt,t):t.push(qt(e.g)),!0)},function(e,t,r){if((t=Gr(a2,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&(qe(i,o,0),ji(i.g,n))}}),yt=Te(function(e,t,r){return e.h===0&&(xe(t,r,Wt(e.g)),!0)},function(e,t,r){(t=Vr(t))!=null&&(t=parseInt(t,10),qe(e,r,0),bn(e.g,t))}),P2=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,t2,t):t.push(Wt(e.g)),!0)},function(e,t,r){if((t=Gr(Vr,t))!=null&&t.length){r=Ia(e,r);for(let i=0;i<t.length;i++)bn(e.g,t[i]);Oa(e,r)}}),aa=class{constructor(t,r){this.h=t,this.g=r,this.l=R,this.m=_,this.defaultValue=void 0}};function it(e,t){return new aa(e,t)}function Zt(e,t){return(r,i)=>{e:{if(qo.length){let n=qo.pop();n.o(i),Gs(n.g,r,i),r=n}else r=new class{constructor(n,s){if(lu.length){let a=lu.pop();Gs(a,n,s),n=a}else n=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,Gs(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(n,s);this.g=n,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({ga:n=!1}={}){this.ga=n}}(r,i);try{let n=new e,s=n.s;za(t)(s,r),Di&&delete s[Di];var o=n;break e}finally{r.g.clear(),r.m=-1,r.h=-1,100>qo.length&&qo.push(r)}o=void 0}return o}}function $a(e){return function(){let t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let s=this.g;return this.g=[],s}}}};Gd(this.s,t,kn(e)),Dr(t,t.g.end());let r=new Uint8Array(t.h),i=t.l,o=i.length,n=0;for(let s=0;s<o;s++){let a=i[s];r.set(a,n),n+=a.length}return t.l=[r],r}}var Yd=[0,Kt,Te(function(e,t,r){return e.h===2&&(xe(t,r,(e=wd(e))===Or()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){let i=t.Va;return void(i&&(t=i(t),t!=null&&wn(e,r,_a(t).buffer)))}if(Array.isArray(t))return}Xd(e,t,r)})],I2=[0,U],Zd=[0,K,yt,ee,-1,qa,yt,-1],O2=[0,ee,-1],Qd=class extends v{constructor(){super()}};Qd.A=[6];var eh=[0,ee,U,ee,yt,-1,P2,U,-1,O2,yt],th=[0,U,-2],Tu=class extends v{constructor(){super()}},rh=[0],ih=[0,K,ee,-2],We=class extends v{constructor(e){super(e,2)}},V={},D2=[-2,V,ee];V[336783863]=[0,U,ee,-1,K,[0,[1,2,3,4,5],N,rh,N,eh,N,th,N,ih,N,Zd],I2];var F2=[0,Kt,Pi],oh=[0,qs,-1,Pi,-3,qs,qa,Kt,Mr,qs,-1,Pi,Mr,Pi,-2,Kt],Wi=[-1,{}],nh=[0,U,1,Wi],sh=[0,U,ve,Wi];function $e(e,t){t=Gi(t),e=e.s;let r=C(e);vt(r),M(e,r,2,t===""?void 0:t)}function L(e,t){Hi(e.s,3,zi,t)}function D(e,t){Hi(e.s,4,zi,t)}var Se=class extends v{constructor(e){super(e,500)}o(e){return _(this,0,7,e)}};Se.A=[3,4,5,6,8,13,17,1005];var B2=[-500,Kt,-1,ve,-3,D2,oe,Yd,Mr,-1,nh,sh,oe,F2,Kt,oh,Mr,ve,987,ve],M2=[0,Kt,-1,Wi],L2=[-500,U,-1,[-1,{}],998,U],U2=[-500,U,ve,-1,[-2,{},ee],997,ve,-1],N2=[-500,U,ve,Wi,998,ve];function Xe(e,t){sa(e,Se,t)}function z(e,t){Hi(e.s,10,zi,t)}function j(e,t){Hi(e.s,15,zi,t)}var Re=class extends v{constructor(e){super(e,500)}o(e){return _(this,0,1001,e)}};Re.A=[1,6,7,9,10,15,16,17,14,1002];var ah=[-500,oe,B2,4,oe,L2,oe,U2,Mr,oe,N2,ve,Mr,nh,sh,oe,M2,ve,-2,oh,Kt,-1,Pi,979,Wi,oe,Yd],j2=Zt(Re,ah);Re.prototype.g=$a(ah);var V2=[0,oe,[0,K,-2]],z2=class extends v{constructor(e){super(e)}},G2=[0,K,ne,U,-1],Xa=class extends v{constructor(e){super(e)}g(){return Dt(this,z2,1)}};Xa.A=[1];var ch=[0,oe,G2],Ka=Zt(Xa,ch),H2=[0,K,ne],W2=[0,K,-1,V2],q2=class extends v{constructor(e){super(e)}},$2=[0,K,-3],X2=[0,ne,-3],K2=class extends v{constructor(e){super(e)}},J2=[0,ne,-1,U,ne],tn=class extends v{constructor(e){super(e)}h(){return R(this,q2,2)}g(){return Dt(this,K2,5)}};tn.A=[5];var Y2=[0,yt,$2,X2,W2,oe,J2],lh=class extends v{constructor(e){super(e)}};lh.A=[1,2,3,8,9];var uh=Zt(lh,[0,ve,qa,Wa,Y2,U,-1,Xt,oe,H2,ve,Xt]),dh=class extends v{constructor(e){super(e)}},Z2=[0,ne,-4],hh=class extends v{constructor(e){super(e)}};hh.A=[1];var Ja=Zt(hh,[0,oe,Z2]),ph=class extends v{constructor(e){super(e)}},Q2=[0,ne,-4],fh=class extends v{constructor(e){super(e)}};fh.A=[1];var xn=Zt(fh,[0,oe,Q2]),mh=class extends v{constructor(e){super(e)}};mh.A=[3];var e0=[0,K,-1,Wa,yt],gh=class extends v{constructor(){super()}};gh.prototype.g=$a([0,ne,-4,Xt]);var t0=class extends v{constructor(e){super(e)}},r0=[0,1,K,U,ch],yh=class extends v{constructor(e){super(e)}};yh.A=[1];var i0=Zt(yh,[0,oe,r0,Xt]),ca=class extends v{constructor(e){super(e)}};ca.A=[1];var o0=class extends v{constructor(e){super(e)}ua(){let e=Id(this);return e??Or()}},n0=class extends v{constructor(e){super(e)}},vh=[1,2],s0=[0,vh,N,[0,Wa],N,[0,Jd],K,U],bh=class extends v{constructor(e){super(e)}};bh.A=[1];var a0=Zt(bh,[0,oe,s0,Xt]),Rn=class extends v{constructor(e){super(e)}};Rn.A=[4,5];var wh=[0,U,K,ne,ve,-1],xu=class extends v{constructor(e){super(e)}},c0=[0,ee,-1],Ru=class extends v{constructor(e){super(e)}},rn=[1,2,3,4,5],fn=class extends v{constructor(e){super(e)}g(){return Id(this)!=null}h(){return He(this,2)!=null}},Sh=[0,Jd,U,[0,K,Xt,-1],[0,T2,Xt]],X=class extends v{constructor(e){super(e)}g(){return Td(Br(this,2))??!1}},se=[0,Sh,ee,[0,rn,N,ih,N,eh,N,Zd,N,rh,N,th],yt],Ya=class extends v{constructor(e){super(e)}},Eh=[0,se,ne,-1,K],l0=it(502141897,Ya);V[502141897]=Eh;var _h=[0,Sh];V[512499200]=_h;var kh=[0,_h];V[515723506]=kh;var u0=Zt(class extends v{constructor(e){super(e)}},[0,[0,yt,-1,A2,C2],e0]),Ah=[0,se];V[508981768]=Ah;var d0=class extends v{constructor(e){super(e)}},Th=[0,se,ne,Ah,ee],xh=class extends v{constructor(e){super(e)}},Rh=[0,se,Eh,Th,ne,kh];V[508968149]=Th;var h0=it(508968150,xh);V[508968150]=Rh;var Ch=class extends v{constructor(e){super(e)}},p0=it(513916220,Ch);V[513916220]=[0,se,Rh,K];var Rr=class extends v{constructor(e){super(e)}h(){return R(this,Rn,2)}g(){B(this,2)}},Ph=[0,se,wh];V[478825465]=Ph;var Ih=[0,se];V[478825422]=Ih;var f0=class extends v{constructor(e){super(e)}},Oh=[0,se,Ih,Ph,-1],Dh=class extends v{constructor(e){super(e)}},Fh=[0,se,ne,K],Bh=class extends v{constructor(e){super(e)}},Mh=[0,se,ne],Za=class extends v{constructor(e){super(e)}},Lh=[0,se,Fh,Mh,ne],Uh=class extends v{constructor(e){super(e)}},m0=[0,se,Lh,Oh];V[463370452]=Oh,V[464864288]=Fh,V[474472470]=Mh;var g0=it(462713202,Za);V[462713202]=Lh;var y0=it(479097054,Uh);V[479097054]=m0;var Nh=class extends v{constructor(e){super(e)}},v0=it(456383383,Nh);V[456383383]=[0,se,wh];var jh=class extends v{constructor(e){super(e)}},b0=it(476348187,jh);V[476348187]=[0,se,c0];var Vh=class extends v{constructor(e){super(e)}},zh=[0,yt,-1],la=class extends v{constructor(e){super(e)}};la.A=[3];var w0=it(458105876,class extends v{constructor(e){super(e)}g(){var e=this.s;let t=C(e);var r=2&t;return e=function(i,o,n){var s=la;let a=2&o,c=!1;if(n==null){if(a)return Su();n=[]}else if(n.constructor===Ge){if((2&n.O)==0||a)return n;n=n.X()}else Array.isArray(n)?c=!!(2&G(n)):n=[];if(a){if(!n.length)return Su();c||(c=!0,jr(n))}else c&&(c=!1,n=Fd(n));return c||(64&G(n)?cn(n,32):32&o&&Sn(n,32)),M(i,o,2,s=new Ge(n,s,c2,void 0),!1),s}(e,t,bt(e,t,2)),e==null||!r&&la&&(e.xa=!0),r=e}});V[458105876]=[0,zh,k2,[!0,Xt,[0,U,-1,ve]]];var Qa=class extends v{constructor(e){super(e)}},Gh=it(458105758,Qa);V[458105758]=[0,se,U,zh];var ec=class extends v{constructor(e){super(e)}};ec.A=[5,6];var S0=it(443442058,ec);V[443442058]=[0,se,U,K,ne,ve,-1];var E0=class extends v{constructor(e){super(e)}},Hh=[0,se,ne,-1,K];V[514774813]=Hh;var _0=class extends v{constructor(e){super(e)}},Wh=[0,se,ne,ee],qh=class extends v{constructor(e){super(e)}},k0=[0,se,Hh,Wh,ne];V[518928384]=Wh;var A0=it(516587230,qh);function ua(e,t){return t=t?t.clone():new Rn,e.displayNamesLocale!==void 0?B(t,1,Gi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&B(t,1),e.maxResults!==void 0?gt(t,2,e.maxResults):"maxResults"in e&&B(t,2),e.scoreThreshold!==void 0?A(t,3,e.scoreThreshold):"scoreThreshold"in e&&B(t,3),e.categoryAllowlist!==void 0?pn(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&B(t,4),e.categoryDenylist!==void 0?pn(t,5,e.categoryDenylist):"categoryDenylist"in e&&B(t,5),t}function $h(e,t=-1,r=""){return{categories:e.map(i=>({index:mt(ze(i,1))??-1,score:he(i,2)??0,categoryName:He(i,3)??""??"",displayName:He(i,4)??""??""})),headIndex:t,headName:r}}function Xh(e){var t=Cr(e,3,Yt),r=Cr(e,2,Vr),i=Cr(e,1,Fi),o=Cr(e,9,Fi);let n={categories:[],keypoints:[]};for(let s=0;s<t.length;s++)n.categories.push({score:t[s],index:r[s]??-1,categoryName:i[s]??"",displayName:o[s]??""});if((t=R(e,tn,4)?.h())&&(n.boundingBox={originX:ze(t,1)??0,originY:ze(t,2)??0,width:ze(t,3)??0,height:ze(t,4)??0,angle:0}),R(e,tn,4)?.g().length)for(let s of R(e,tn,4).g())n.keypoints.push({x:Yo(s,1)??0,y:Yo(s,2)??0,score:Yo(s,4)??0,label:He(s,3)??""});return n}function tc(e){let t=[];for(let r of Dt(e,ph,1))t.push({x:he(r,1)??0,y:he(r,2)??0,z:he(r,3)??0});return t}function Kh(e){let t=[];for(let r of Dt(e,dh,1))t.push({x:he(r,1)??0,y:he(r,2)??0,z:he(r,3)??0});return t}function Cu(e){return Array.from(e,t=>127<t?t-256:t)}function Pu(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,i=0,o=0;for(let n=0;n<e.length;n++)r+=e[n]*t[n],i+=e[n]*e[n],o+=t[n]*t[n];if(0>=i||0>=o)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(i*o)}var Xo;V[516587230]=k0;var T0=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 Jh(){if(Xo===void 0)try{await WebAssembly.instantiate(T0),Xo=!0}catch{Xo=!1}return Xo}async function $s(e,t=""){let r=await Jh()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Pr=class{};function Yh(){let e=navigator.userAgent;return e.includes("Safari")&&!e.includes("Chrome")}async function Iu(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",o=>{i(o)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function w(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Ou(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=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`.");return e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),t.videoWidth?(r=t.videoWidth,t=t.videoHeight):t.naturalWidth?(r=t.naturalWidth,t=t.naturalHeight):(r=t.width,t=t.height),!e.l||r===e.i.canvas.width&&t===e.i.canvas.height||(e.i.canvas.width=r,e.i.canvas.height=t),[r,t]}function Du(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let i=new Uint32Array(t.length);for(let o=0;o<t.length;o++)i[o]=e.i.stringToNewUTF8(t[o]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),r(t);for(let o of i)e.i._free(o);e.i._free(t)}function Ct(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function lr(e,t,r){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(o,n,s)=>{n?(r(i,s),i=[]):i.push(o)}}Pr.forVisionTasks=function(e){return $s("vision",e)},Pr.forTextTasks=function(e){return $s("text",e)},Pr.forAudioTasks=function(e){return $s("audio",e)},Pr.isSimdSupported=function(){return Jh()};async function x0(e,t,r,i){return e=await(async(o,n,s,a,c)=>{if(n&&await Iu(n),!self.ModuleFactory||s&&(await Iu(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((n=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(n.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new o(c,a)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:o=>o.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&o.endsWith(".data")?r.assetBinaryPath.toString():o}),await e.o(i),e}function Fu(e,t){let r=R(e.baseOptions,fn,1)||new fn;typeof t=="string"?(B(r,2,Gi(t)),B(r,1)):t instanceof Uint8Array&&(B(r,1,kd(t,!1,!1)),B(r,2)),_(e.baseOptions,0,1,r)}function Bu(e){try{let t=e.F.length;if(t===1)throw Error(e.F[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.F.map(r=>r.message).join(", "))}finally{e.F=[]}}function S(e,t){e.I=Math.max(e.I,t)}function rc(e,t){e.C=new Se,$e(e.C,"PassThroughCalculator"),L(e.C,"free_memory"),D(e.C,"free_memory_unused_out"),z(t,"free_memory"),Xe(t,e.C)}function Mi(e,t){L(e.C,t),D(e.C,t+"_unused_out")}function ic(e){e.g.addBoolToStream(!0,"free_memory",e.I)}var da=class{constructor(e){this.g=e,this.F=[],this.I=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){if(t){let r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(R(this.baseOptions,fn,1)?.g()||R(this.baseOptions,fn,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(i,o){let n=R(i.baseOptions,Ru,3);if(!n){var s=n=new Ru,a=new Tu;Ci(s,4,rn,a)}"delegate"in o&&(o.delegate==="GPU"?(o=n,s=new Qd,Ci(o,2,rn,s)):(o=n,s=new Tu,Ci(o,4,rn,s))),_(i.baseOptions,0,3,n)}(this,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(i=>{if(i.ok)return i.arrayBuffer();throw Error(`Failed to fetch model: ${r.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),Fu(this,"/model.dat"),this.m(),this.N()});Fu(this,r.modelAssetBuffer)}return this.m(),this.N(),Promise.resolve()}N(){}da(){let e;if(this.g.da(t=>{e=j2(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.F.push(Error(i))}),this.g.Ra(),this.g.setGraph(e,t),this.C=void 0,Bu(this)}finishProcessing(){this.g.finishProcessing(),Bu(this)}close(){this.C=void 0,this.g.closeGraph()}};function be(e,t){if(e===null)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}da.prototype.close=da.prototype.close;var ha=class{constructor(t,r,i,o){this.g=t,this.h=r,this.m=i,this.l=o}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}};function Mu(e,t,r){let i=e.g;if(r=be(i.createShader(r),"Failed to create WebGL shader"),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(r)}`);return i.attachShader(e.h,r),r}function Lu(e,t){let r=e.g,i=be(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);let o=be(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,o),r.enableVertexAttribArray(e.N),r.vertexAttribPointer(e.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);let n=be(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.M),r.vertexAttribPointer(e.M,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new ha(r,i,o,n)}function oc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function qi(e,t,r,i){return oc(e,t),e.h||(e.m(),e.F()),r?(e.u||(e.u=Lu(e,!0)),r=e.u):(e.v||(e.v=Lu(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function Jt(e,t,r){return oc(e,t),e=be(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,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Cn(e,t,r){oc(e,t),e.C||(e.C=be(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.C),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function nc(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Wr=class{I(){return`
|
|
9
|
+
File size: ${o.size}`),new Error("Failed to upload to AWS")}}};var Kl="not_shared_first_screen",Jl="not_shared_screen",Go="multiple_monitors_detected",Yl="proctoring_already_started",Ho="proctoring_not_started";var Zl="another_stream_active",Ql="stream_under_minimum_permitted",eu="browser_not_supported",tu="token_missing",ru="credentials_missing";var ba=typeof self<"u"?self:{};function id(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=ba,o=0;o<r.length;o++)if((i=i[r[o]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function cr(){throw Error("Invalid UTF8")}function iu(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Wo,Vs,W1=typeof TextDecoder<"u",q1,$1=typeof TextEncoder<"u";function od(e){if($1)e=(q1||=new TextEncoder).encode(e);else{let r=0,i=new Uint8Array(3*e.length);for(let o=0;o<e.length;o++){var t=e.charCodeAt(o);if(128>t)i[r++]=t;else{if(2048>t)i[r++]=t>>6|192;else{if(55296<=t&&57343>=t){if(56319>=t&&o<e.length){let n=e.charCodeAt(++o);if(56320<=n&&57343>=n){t=1024*(t-55296)+n-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}o--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}var Ii,nd=id(610401301,!1),wa=id(572417392,!0),ou=ba.navigator;function Js(e){return!!nd&&!!Ii&&Ii.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Ve(e){var t;return(t=ba.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function zt(){return!!nd&&!!Ii&&0<Ii.brands.length}function zs(){return zt()?Js("Chromium"):(Ve("Chrome")||Ve("CriOS"))&&!(!zt()&&Ve("Edge"))||Ve("Silk")}Ii=ou&&ou.userAgentData||null;var X1=!zt()&&(Ve("Trident")||Ve("MSIE"));!Ve("Android")||zs(),zs(),Ve("Safari")&&(zs()||!zt()&&Ve("Coast")||!zt()&&Ve("Opera")||!zt()&&Ve("Edge")||(zt()?Js("Microsoft Edge"):Ve("Edg/"))||zt()&&Js("Opera"));var sd={},ki=null;function K1(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);var i=new Uint8Array(r),o=0;return function(n,s){function a(g){for(;c<n.length;){var h=n.charAt(c++),m=ki[h];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return g}ad();for(var c=0;;){var l=a(-1),u=a(0),d=a(64),f=a(64);if(f===64&&l===-1)break;s(l<<2|u>>4),d!=64&&(s(u<<4&240|d>>2),f!=64&&s(d<<6&192|f))}}(e,function(n){i[o++]=n}),o!==r?i.subarray(0,o):i}function ad(){if(!ki){ki={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));sd[r]=i;for(var o=0;o<i.length;o++){var n=i[o];ki[n]===void 0&&(ki[n]=o)}}}}var cd=typeof Uint8Array<"u",ld=!X1&&typeof btoa=="function";function nu(e){if(!ld){var t;t===void 0&&(t=0),ad(),t=sd[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var o=e[c],n=e[c+1],s=e[c+2],a=t[o>>2];o=t[(3&o)<<4|n>>4],n=t[(15&n)<<2|s>>6],s=t[63&s],r[l++]=a+o+n+s}switch(a=0,s=i,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||i;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var su=/[-_.]/g,J1={"-":"+",_:"/",".":"="};function Y1(e){return J1[e]||""}function ud(e){if(!ld)return K1(e);su.test(e)&&(e=e.replace(su,Y1)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function mn(e){return cd&&e!=null&&e instanceof Uint8Array}var Z1;function gn(){return Z1||=new Uint8Array(0)}var Ir={},Q1;function dd(e){if(e!==Ir)throw Error("illegal external caller")}function Or(){return Q1||=new Gt(null,Ir)}function Sa(e){dd(Ir);var t=e.Z;return(t=t==null||mn(t)?t:typeof t=="string"?ud(t):null)==null?t:e.Z=t}var Gt=class{constructor(e,t){if(dd(t),this.Z=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}wa(){let e=Sa(this);return e?new Uint8Array(e):gn()}};function hd(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Ea(){return Error("Failed to read varint, encoding is invalid.")}function pd(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function fd(e){return e.length==0?Or():new Gt(e,Ir)}function _a(e){if(typeof e=="string")return{buffer:ud(e),L:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),L:!1};if(e.constructor===Uint8Array)return{buffer:e,L:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),L:!1};if(e.constructor===Gt)return{buffer:Sa(e)||gn(),L:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),L:!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 ka(){return typeof BigInt=="function"}var Ys=!wa,au=!wa,e2=typeof Uint8Array.prototype.slice=="function",md,F=0,Q=0;function dr(e){let t=0>e,r=(e=Math.abs(e))>>>0;if(e=Math.floor((e-r)/4294967296),t){let[i,o]=Ta(r,e);e=o,r=i}F=r>>>0,Q=e>>>0}function Aa(e){let t=md||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),Q=0,F=t.getUint32(0,!0)}function Zs(e,t){return 4294967296*t+(e>>>0)}function xa(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=Zs(e,t),r?-e:e}function sn(e,t){if(e>>>=0,2097151>=(t>>>=0))var r=""+(4294967296*t+e);else ka()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),r=t+cu(r)+cu(e));return r}function cu(e){return e=String(e),"0000000".slice(e.length)+e}function gd(){var e=F,t=Q;if(2147483648&t)if(ka())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,i]=Ta(e,t);e="-"+sn(r,i)}else e=sn(e,t);return e}function yn(e){if(16>e.length)dr(Number(e));else if(ka())e=BigInt(e),F=Number(e&BigInt(4294967295))>>>0,Q=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");Q=F=0;let r=e.length;for(let i=t,o=(r-t)%6+t;o<=r;i=o,o+=6){let n=Number(e.slice(i,o));Q*=1e6,F=1e6*F+n,4294967296<=F&&(Q+=Math.trunc(F/4294967296),Q>>>=0,F>>>=0)}if(t){let[i,o]=Ta(F,Q);F=i,Q=o}}}function Ta(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ra(e,t){let r,i=0,o=0,n=0,s=e.h,a=e.g;do r=s[a++],i|=(127&r)<<n,n+=7;while(32>n&&128&r);for(32<n&&(o|=(127&r)>>4),n=3;32>n&&128&r;n+=7)r=s[a++],o|=(127&r)<<n;if(hr(e,a),128>r)return t(i>>>0,o>>>0);throw Ea()}function Ca(e){let t=0,r=e.g,i=r+10,o=e.h;for(;r<i;){let n=o[r++];if(t|=n,(128&n)==0)return hr(e,r),!!(127&t)}throw Ea()}function Wt(e){let t=e.h,r=e.g,i=t[r++],o=127&i;if(128&i&&(i=t[r++],o|=(127&i)<<7,128&i&&(i=t[r++],o|=(127&i)<<14,128&i&&(i=t[r++],o|=(127&i)<<21,128&i&&(i=t[r++],o|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Ea();return hr(e,r),o}function qt(e){return Wt(e)>>>0}function Qs(e){var t=e.h;let r=e.g,i=t[r],o=t[r+1],n=t[r+2];return t=t[r+3],hr(e,e.g+4),(i<<0|o<<8|n<<16|t<<24)>>>0}function ea(e){var t=Qs(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:1/0*e:r==0?e*Math.pow(2,-149)*t:e*Math.pow(2,r-150)*(t+Math.pow(2,23))}function t2(e){return Wt(e)}function Gs(e,t,{aa:r=!1}={}){e.aa=r,t&&(t=_a(t),e.h=t.buffer,e.m=t.L,e.j=0,e.l=e.h.length,e.g=e.j)}function hr(e,t){if(e.g=t,t>e.l)throw pd(e.l,t)}function yd(e,t){if(0>t)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,i=r+t;if(i>e.l)throw pd(t,e.l-r);return e.g=i,r}function vd(e,t){if(t==0)return Or();var r=yd(e,t);return e.aa&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?gn():e2?e.slice(r,t):new Uint8Array(e.subarray(r,t))),fd(r)}var lu=[];function bd(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=qt(e.g);if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw hd(r,e.l);if(1>t)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function Jo(e){switch(e.h){case 0:e.h!=0?Jo(e):Ca(e.g);break;case 1:hr(e=e.g,e.g+8);break;case 2:if(e.h!=2)Jo(e);else{var t=qt(e.g);hr(e=e.g,e.g+t)}break;case 5:hr(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!bd(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Jo(e)}break;default:throw hd(e.h,e.l)}}function Ni(e,t,r){let i=e.g.l,o=qt(e.g),n=e.g.g+o,s=n-i;if(0>=s&&(e.g.l=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=n,e.g.l=i,t}function Pa(e){var t=qt(e.g),r=yd(e=e.g,t);if(e=e.h,W1){var i,o=e;(i=Vs)||(i=Vs=new TextDecoder("utf-8",{fatal:!0})),t=r+t,o=r===0&&t===o.length?o:o.subarray(r,t);try{var n=i.decode(o)}catch(a){if(Wo===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),Wo=!0}catch{Wo=!1}}throw!Wo&&(Vs=void 0),a}}else{t=(n=r)+t,r=[];let a,c=null;for(;n<t;){var s=e[n++];128>s?r.push(s):224>s?n>=t?cr():(a=e[n++],194>s||(192&a)!=128?(n--,cr()):r.push((31&s)<<6|63&a)):240>s?n>=t-1?cr():(a=e[n++],(192&a)!=128||s===224&&160>a||s===237&&160<=a||(192&(i=e[n++]))!=128?(n--,cr()):r.push((15&s)<<12|(63&a)<<6|63&i)):244>=s?n>=t-2?cr():(a=e[n++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(i=e[n++]))!=128||(192&(o=e[n++]))!=128?(n--,cr()):(s=(7&s)<<18|(63&a)<<12|(63&i)<<6|63&o,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):cr(),8192<=r.length&&(c=iu(c,r),r.length=0)}n=iu(c,r)}return n}function wd(e){let t=qt(e.g);return vd(e.g,t)}function vn(e,t,r){var i=qt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var qo=[];function uu(e){return e?/^\d+$/.test(e)?(yn(e),new du(F,Q)):null:r2||=new du(0,0)}var du=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},r2;function hu(e){return e?/^-?\d+$/.test(e)?(yn(e),new pu(F,Q)):null:i2||=new pu(0,0)}var pu=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},i2;function an(e,t,r){for(;0<r||127<t;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ji(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function bn(e,t){if(0<=t)ji(e,t);else{for(let r=0;9>r;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Oi(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 Dr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function qe(e,t,r){ji(e.g,8*t+r)}function Ia(e,t){return qe(e,t,2),t=e.g.end(),Dr(e,t),t.push(e.h),t}function Oa(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;127<r;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function wn(e,t,r){qe(e,t,2),ji(e.g,r.length),Dr(e,e.g.end()),Dr(e,r)}function ta(e,t,r,i){r!=null&&(t=Ia(e,t),i(r,e),Oa(e,t))}var $t=class{constructor(t,r,i,o){this.g=t,this.h=r,this.l=i,this.qa=o}};function we(e){return Array.prototype.slice.call(e)}function Sd(e){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():e}var ft=Sd(),fu=Sd("0di"),Sn=ft?(e,t)=>{e[ft]|=t}:(e,t)=>{e.D!==void 0?e.D|=t:Object.defineProperties(e,{D:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function mu(e){let t=G(e);(1&t)!=1&&(Object.isFrozen(e)&&(e=we(e)),q(e,1|t))}var cn=ft?(e,t)=>{e[ft]&=~t}:(e,t)=>{e.D!==void 0&&(e.D&=~t)};function de(e,t,r){return r?e|t:e&~t}var G=ft?e=>0|e[ft]:e=>0|e.D,C=ft?e=>e[ft]:e=>e.D,q=ft?(e,t)=>{e[ft]=t}:(e,t)=>{e.D!==void 0?e.D=t:Object.defineProperties(e,{D:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function gu(){var e=[];return Sn(e,1),e}function jr(e){return Sn(e,34),e}function o2(e,t){q(t,-14591&(0|e))}function ra(e,t){q(t,-14557&(34|e))}function ln(e){return(e=e>>14&1023)===0?536870912:e}var Vi={},Ed={};function yu(e){return!(!e||typeof e!="object"||e.Na!==Ed)}function xi(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}var _d=!wa;function kd(e,t,r){if(e!=null){if(typeof e=="string")e=e?new Gt(e,Ir):Or();else if(e.constructor!==Gt)if(mn(e))e=r?fd(e):e.length?new Gt(new Uint8Array(e),Ir):Or();else{if(!t)throw Error();e=void 0}}return e}function ia(e,t,r){if(!Array.isArray(e)||e.length)return!1;let i=G(e);return!!(1&i)||!(!t||!(Array.isArray(t)?t.includes(r):t.has(r)))&&(q(e,1|i),!0)}var ur,vu=[];function vt(e){if(2&e)throw Error()}q(vu,55),ur=Object.freeze(vu);var Fr=class{constructor(t,r,i){this.l=0,this.g=t,this.h=r,this.m=i}next(){if(this.l<this.g.length){let 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 Fr(this.g,this.h,this.m)}},n2={},Ht,Di;function Ad(e,t){(t=Ht?t[Ht]:void 0)&&(e[Ht]=we(t))}function oa(e){return(e=Error(e)).__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity="warning",e}function Yt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function xd(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}Object.freeze(new class{}),Object.freeze(new class{});var s2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function En(e){let t=typeof e;return t==="number"?Number.isFinite(e):t==="string"&&s2.test(e)}function Vr(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 a2(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 bu(e){return e[0]!=="-"&&(20>e.length||e.length===20&&184467>Number(e.substring(0,6)))}function Td(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 Da(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(dr(e),e=xa(F,Q)),e}function Fa(e){var t=Math.trunc(Number(e));return Number.isSafeInteger(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Td(e)||(yn(e),e=gd()),e)}function un(e){return e==null?e:En(e)?typeof e=="number"?Da(e):Fa(e):void 0}function zi(e){if(typeof e!="string")throw Error();return e}function Gi(e){if(e!=null&&typeof e!="string")throw Error();return e}function Fi(e){return e==null||typeof e=="string"?e:void 0}function Ba(e,t,r,i){if(e!=null&&typeof e=="object"&&e.W===Vi)return e;if(!Array.isArray(e))return r?2&i?(e=t[fu])?t=e:(jr((e=new t).s),t=t[fu]=e):t=new t:t=void 0,t;let o=r=G(e);return o===0&&(o|=32&i),o|=2&i,o!==r&&q(e,o),new t(e)}function c2(e,t,r){if(t){var i=!!i;if(!En(t=e))throw oa("int64");typeof t=="string"?i=Fa(t):i?(i=Math.trunc(t),Number.isSafeInteger(i)?i=String(i):Td(t=String(i))?i=t:(dr(i),i=gd())):i=Da(t)}else i=un(e);return typeof(r=(e=i)==null?r?0:void 0:e)=="string"&&(i=+r,Number.isSafeInteger(i))?i:r}var dn,Ma,l2;function hn(e){switch(typeof e){case"boolean":return Ma||=[0,void 0,!0];case"number":return 0<e?void 0:e===0?l2||=[0,void 0]:[-e,void 0];case"string":return[0,e];case"object":return e}}function pr(e,t){return Rd(e,t[0],t[1])}function Rd(e,t,r){if(e==null&&(e=dn),dn=void 0,e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error();if(64&(i=G(e)))return Di&&delete e[Di],e;if(i|=64,r&&(i|=512,r!==e[0]))throw Error();e:{let o=(r=e).length;if(o){let n=o-1;if(xi(r[n])){if(1024<=(t=n-(+!!(512&(i|=256))-1)))throw Error();i=-16760833&i|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&i)-1))))throw Error();i=-16760833&i|(1023&t)<<14}}}return q(e,i),e}var u2=function(){try{return new class extends Map{constructor(){super()}},!1}catch{return!0}}(),Ti=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}},d2=u2?(Object.setPrototypeOf(Ti.prototype,Map.prototype),Object.defineProperties(Ti.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Ti):class extends Map{constructor(){super()}};function $o(e){return e}function Hs(e){if(2&e.O)throw Error("Cannot mutate an immutable Map")}var Ge=class extends d2{constructor(e,t,r=$o,i=$o){super();let o=G(e);o|=64,q(e,o),this.O=o,this.V=t,this.R=r||$o,this.Y=this.V?h2:i||$o;for(let n=0;n<e.length;n++){let s=e[n],a=r(s[0],!1,!0),c=s[1];t?c===void 0&&(c=null):c=i(s[1],!1,!0,void 0,void 0,o),super.set(a,c)}}pa(e=wu){return this.X(e)}X(e=wu){let t=[],r=super.entries();for(var i;!(i=r.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){Hs(this),super.clear()}delete(e){return Hs(this),super.delete(this.R(e,!0,!1))}entries(){var e=this.ma();return new Fr(e,p2,this)}keys(){return this.Ma()}values(){var e=this.ma();return new Fr(e,Ge.prototype.get,this)}forEach(e,t){super.forEach((r,i)=>{e.call(t,this.get(i),i,this)})}set(e,t){return Hs(this),(e=this.R(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.Y(t,!0,!0,this.V,!1,this.O))}Ta(e){let t=this.R(e[0],!1,!0);e=e[1],e=this.V?e===void 0?null:e:this.Y(e,!1,!0,void 0,!1,this.O),super.set(t,e)}has(e){return super.has(this.R(e,!1,!1))}get(e){e=this.R(e,!1,!1);let t=super.get(e);if(t!==void 0){var r=this.V;return r?((r=this.Y(t,!1,!0,r,this.xa,this.O))!==t&&super.set(e,r),r):t}}ma(){return Array.from(super.keys())}Ma(){return super.keys()}[Symbol.iterator](){return this.entries()}};function h2(e,t,r,i,o,n){return e=Ba(e,i,r,n),o&&(e=_n(e)),e}function wu(e){return e}function p2(e){return[e,this.get(e)]}function La(e,t,r,i,o,n){if(e!=null){if(Array.isArray(e))e=o&&e.length==0&&1&G(e)?void 0:n&&2&G(e)?e:Ua(e,t,r,i!==void 0,o,n);else if(xi(e)){let s={};for(let a in e)s[a]=La(e[a],t,r,i,o,n);e=s}else e=t(e,i);return e}}function Ua(e,t,r,i,o,n){let s=i||r?G(e):0;i=i?!!(32&s):void 0;let a=we(e);for(let c=0;c<a.length;c++)a[c]=La(a[c],t,r,i,o,n);return r&&(Ad(a,e),r(s,a)),a}function f2(e){return La(e,Cd,void 0,void 0,!1,!1)}function Cd(e){return e.W===Vi?e.toJSON():e instanceof Ge?e.pa(f2):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))return _d||!ia(t,void 0,9999)?t:void 0;if(mn(t))return nu(t);if(t instanceof Gt){let r=t.Z;return r==null?"":typeof r=="string"?r:t.Z=nu(r)}if(t instanceof Ge)return t=t.pa(),Ys||t.length!==0?t:void 0}}return t}(e)}function na(e,t,r=ra){if(e!=null){if(cd&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=G(e);return 2&i?e:(t&&=i===0||!!(32&i)&&!(64&i||!(16&i)),t?(q(e,-12293&(34|i)),e):Ua(e,na,4&i?ra:r,!0,!1,!0))}return e.W===Vi?(r=e.s,e=2&(i=C(r))?e:Na(e,r,i,!0)):e instanceof Ge&&(r=jr(e.X(na)),e=new Ge(r,e.V,e.R,e.Y)),e}}function Na(e,t,r,i){return e=e.constructor,dn=t=Pd(t,r,i),t=new e(t),dn=void 0,t}function Pd(e,t,r){let i=r||2&t?ra:o2,o=!!(32&t);return e=function(n,s,a){let c=we(n);var l=c.length;let u=256&s?c[l-1]:void 0;for(l+=u?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(u){s=c[s]={};for(let d in u)s[d]=a(u[d])}return Ad(c,n),c}(e,t,n=>na(n,o,i)),Sn(e,32|(r?2:0)),e}function _n(e){let t=e.s,r=C(t);return 2&r?Na(e,t,r,!1):e}function Br(e,t){return bt(e=e.s,C(e),t)}function bt(e,t,r,i){if(r===-1)return null;if(r>=ln(t)){if(256&t)return e[e.length-1][r]}else{var o=e.length;if(i&&256&t&&(i=e[o-1][r])!=null)return i;if((t=r+(+!!(512&t)-1))<o)return e[t]}}function B(e,t,r,i){let o=e.s,n=C(o);return vt(n),M(o,n,t,r,i),e}function M(e,t,r,i,o){var n=ln(t);if(r>=n||o){if(o=t,256&t)n=e[e.length-1];else{if(i==null)return o;n=e[n+(+!!(512&t)-1)]={},o|=256}return n[r]=i,o!==t&&q(e,o),o}return e[r+(+!!(512&t)-1)]=i,256&t&&r in(e=e[e.length-1])&&delete e[r],t}function zr(e,t,r,i,o){var n=2&t;let s=bt(e,t,r,o);Array.isArray(s)||(s=ur);let a=!(2&i);i=!(1&i);let c=!!(32&t),l=G(s);return l!==0||!c||n||a?1&l||(l|=1,q(s,l)):(l|=33,q(s,l)),n?(e=!1,2&l||(jr(s),e=!!(4&l)),(i||e)&&Object.freeze(s)):(n=!!(2&l)||!!(2048&l),i&&n?(s=we(s),i=1,c&&!a&&(i|=32),q(s,i),M(e,t,r,s,o)):a&&32&l&&!n&&cn(s,32)),s}function Yo(e,t){e=e.s;let r=C(e),i=bt(e,r,t),o=Yt(i);return o!=null&&o!==i&&M(e,r,t,o),o}function Id(e){e=e.s;let t=C(e),r=bt(e,t,1),i=kd(r,!0,!!(34&t));return i!=null&&i!==r&&M(e,t,1,i),i}function Cr(e,t,r){e=e.s;let i=C(e),o=2&i?1:2,n=Od(e,i,t);var s=G(n);if(!(4&s)){(4&s||Object.isFrozen(n))&&(n=we(n),s=fr(s,i,!1),i=M(e,i,t,n));var a=0;let c=0;for(;a<n.length;a++){let l=r(n[a]);l!=null&&(n[c++]=l)}c<a&&(n.length=c),s=de(s=Dd(s,i,!1),20,!0),s=de(s,4096,!1),s=de(s,8192,!1),q(n,s),2&s&&Object.freeze(n)}return Ri(s)||(r=s,(s=(a=o===1)?de(s,2,!0):de(s,32,!1))!==r&&q(n,s),a&&Object.freeze(n)),o===2&&Ri(s)&&(n=we(n),s=fr(s,i,!1),q(n,s),M(e,i,t,n)),n}function Od(e,t,r){return e=bt(e,t,r),Array.isArray(e)?e:ur}function Dd(e,t,r){return e===0&&(e=fr(e,t,r)),de(e,1,!0)}function Ri(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}var m2;function Su(){return m2??=new Ge(jr([]),void 0,void 0,void 0,n2)}function Fd(e){e=we(e);for(let t=0;t<e.length;t++){let r=e[t]=we(e[t]);Array.isArray(r[1])&&(r[1]=jr(r[1]))}return e}function pn(e,t,r){{let s=e.s,a=C(s);if(vt(a),r==null)M(s,a,t);else{var i,o=e=G(r),n=!!(2&e)||Object.isFrozen(r);if((i=!n)&&(i=!1),!(4&e))for(e=21,n&&(r=we(r),o=0,e=fr(e,a,!0)),n=0;n<r.length;n++)r[n]=zi(r[n]);i&&(r=we(r),o=0,e=fr(e,a,!0)),e!==o&&q(r,e),M(s,a,t,r)}}}function Hi(e,t,r,i){let o=C(e);vt(o),e=zr(e,o,t,2),i=r(i,!!(4&(t=G(e)))&&!!(4096&t)),e.push(i)}function g2(e){return e}function Ws(e,t){return ja(e=e.s,C(e),vh)===t?t:-1}function ja(e,t,r){let i=0;for(let o=0;o<r.length;o++){let n=r[o];bt(e,t,n)!=null&&(i!==0&&(t=M(e,t,i)),i=n)}return i}function Va(e,t,r,i){let o=C(e);vt(o);let n=bt(e,o,r,i),s;if(n!=null&&n.W===Vi)return(t=_n(n))!==n&&M(e,o,r,t,i),t.s;if(Array.isArray(n)){let a=G(n);s=2&a?Pd(n,a,!1):n,s=pr(s,t)}else s=pr(void 0,t);return s!==n&&M(e,o,r,s,i),s}function Bd(e,t,r,i){e=e.s;let o=C(e),n=bt(e,o,r,i);return(t=Ba(n,t,!1,o))!==n&&t!=null&&M(e,o,r,t,i),t}function R(e,t,r,i=!1){if((t=Bd(e,t,r,i))==null)return t;e=e.s;let o=C(e);if(!(2&o)){let n=_n(t);n!==t&&M(e,o,r,t=n,i)}return t}function Md(e,t,r,i,o,n){var s=!!(2&t),a=s?1:2;let c=a===1;a=a===2,o=!!o,n&&=!s,s=Od(e,t,i);var l=G(s);let u=!!(4&l);if(!u){var d=s,f=t;let g=!!(2&(l=Dd(l,t,o)));g&&(f=de(f,2,!0));let h=!g,m=!0,y=0,b=0;for(;y<d.length;y++){let k=Ba(d[y],r,!1,f);if(k instanceof r){if(!g){let P=!!(2&G(k.s));h&&=!P,m&&=P}d[b++]=k}}b<y&&(d.length=b),l=de(l,4,!0),l=de(l,16,m),l=de(l,8,h),q(d,l),g&&Object.freeze(d)}if(r=!!(8&l)||c&&!s.length,n&&!r){for(Ri(l)&&(s=we(s),l=fr(l,t,o),t=M(e,t,i,s)),n=s,r=l,d=0;d<n.length;d++)(l=n[d])!==(f=_n(l))&&(n[d]=f);r=de(r,8,!0),r=de(r,16,!n.length),q(n,r),l=r}return Ri(l)||(n=l,c?l=de(l,!s.length||16&l&&(!u||32&l)?2:2048,!0):o||(l=de(l,32,!1)),l!==n&&q(s,l),c&&Object.freeze(s)),a&&Ri(l)&&(s=we(s),l=fr(l,t,o),q(s,l),M(e,t,i,s)),s}function Dt(e,t,r){e=e.s;let i=C(e);return Md(e,i,t,r,!1,!(2&i))}function _(e,t,r,i,o){return i==null&&(i=void 0),B(e,r,i,o)}function Ci(e,t,r,i){i==null&&(i=void 0),e=e.s;let o=C(e);vt(o),(r=ja(e,o,r))&&r!==t&&i!=null&&(o=M(e,o,r)),M(e,o,t,i)}function fr(e,t,r){return e=de(e,2,!!(2&t)),e=de(e,32,!!(32&t)&&r),de(e,2048,!1)}function sa(e,t,r){e=e.s;let i=C(e);vt(i),e=Md(e,i,t,1,!0),t=r??new t,e.push(t),2&G(t.s)?cn(e,8):cn(e,16)}function ze(e,t){return Vr(Br(e,t))}function He(e,t){return Fi(Br(e,t))}function mt(e){return e??0}function he(e,t){return mt(Yo(e,t))}function Bi(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);B(e,t,r)}function gt(e,t,r){if(r!=null){if(typeof r!="number"||!Number.isFinite(r))throw oa("int32");r|=0}B(e,t,r)}function A(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);B(e,t,r)}function rt(e,t,r){t.g?t.m(e,t.g,t.h,r,!0):t.m(e,t.h,r,!0)}Ge.prototype.toJSON=void 0,Ge.prototype.Na=Ed;var v=class{constructor(e,t){this.s=Rd(e,t)}toJSON(){return Ld(this,Ua(this.s,Cd,void 0,void 0,!1,!1),!0)}l(){var e=w0;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)}clone(){let e=this.s;return Na(this,e,C(e),!1)}L(){return!!(2&G(this.s))}};function Ld(e,t,r){let i=e.constructor.A;var o=C(r?e.s:t),n=ln(o),s=!1;if(i&&_d){if(!r){var a;if((t=we(t)).length&&xi(a=t[t.length-1])){for(s=0;s<i.length;s++)if(i[s]>=n){Object.assign(t[t.length-1]={},a);break}}s=!0}var c;n=t,r=!r,e=ln(a=C(e.s)),a=+!!(512&a)-1;for(let y=0;y<i.length;y++){var l=i[y];if(l<e){var u=n[l+=a];u==null?n[l]=r?ur:gu():r&&u!==ur&&mu(u)}else{if(!c){var d=void 0;n.length&&xi(d=n[n.length-1])?c=d:n.push(c={})}u=c[l],c[l]==null?c[l]=r?ur:gu():r&&u!==ur&&mu(u)}}}if(!(c=t.length))return t;let f,g;if(xi(d=t[c-1])){e:{var h=d;for(var m in n={},r=!1,h)e=h[m],Array.isArray(e)&&(a=e,(!au&&ia(e,i,+m)||!Ys&&yu(e)&&e.size===0)&&(e=null),e!=a&&(r=!0)),e!=null?n[m]=e:r=!0;if(r){for(let y in n){h=n;break e}h=null}}h!=d&&(f=!0),c--}for(o=+!!(512&o)-1;0<c&&((d=t[m=c-1])==null||!au&&ia(d,i,m-o)||!Ys&&yu(d)&&d.size===0);c--)g=!0;return(f||g)&&(t=s?t:Array.prototype.slice.call(t,0,c),s&&(t.length=c),h&&t.push(h)),t}function Ud(e){return Array.isArray(e)?e[0]instanceof $t?e:[T2,e]:[e,void 0]}function Gr(e,t){if(Array.isArray(t)){var r=G(t);if(4&r)return t;for(var i=0,o=0;i<t.length;i++){let n=e(t[i]);n!=null&&(t[o++]=n)}return o<i&&(t.length=o),q(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}v.prototype.W=Vi,v.prototype.toString=function(){return Ld(this,this.s,!1).toString()};var Eu=Symbol();function za(e){let t=e[Eu];if(!t){let r=Vd(e),i=Ha(e),o=i.g;t=o?(n,s)=>o(n,s,i):(n,s)=>{for(;bd(s)&&s.h!=4;){var a=s.m,c=i[a];if(!c){var l=i.ha;l&&(l=l[a])&&(c=i[a]=y2(l))}c&&c(s,n,a)||(a=(c=s).l,Jo(c),c.ga?c=void 0:(l=c.g.g-a,c.g.g=a,c=vd(c.g,l)),a=n,c&&(Ht||=Symbol(),(l=a[Ht])?l.push(c):a[Ht]=[c]))}r===Nd||r===jd||r.Oa||(n[Di||=Symbol()]=r)},e[Eu]=t}return t}function y2(e){let t=(e=Ud(e))[0].g;if(e=e[1]){let r=za(e),i=Ha(e).S;return(o,n,s)=>t(o,n,s,i,r)}return t}var Nd,jd,Zo=Symbol();function v2(e,t,r){let i=r[1],o;if(i){let n=i[Zo];o=n?n.S:hn(i[0]),e[t]=n??i}o&&o===Ma?(e.na||(e.na=[])).push(t):r[0]&&(e.oa||(e.oa=[])).push(t)}function _u(e,t){return[e.l,!t||0<t[0]?void 0:t]}function Vd(e){var t=e[Zo];if(t)return t;if(!(t=Ga(e,e[Zo]={},_u,_u,v2)).oa&&!t.na){let r=!0;for(let i in t){isNaN(i)||(r=!1);break}r?(t=hn(e[0])===Ma,t=e[Zo]=t?jd||={S:hn(!0)}:Nd||={}):t.Oa=!0}return t}function b2(e,t,r){e[t]=r}function Ga(e,t,r,i,o=b2){t.S=hn(e[0]);let n=0;var s=e[++n];s&&s.constructor===Object&&(t.ha=s,typeof(s=e[++n])=="function"&&(t.g=s,t.h=e[++n],s=e[++n]));let a={};for(;Array.isArray(s)&&typeof s[0]=="number"&&0<s[0];){for(var c=0;c<s.length;c++)a[s[c]]=s;s=e[++n]}for(c=1;s!==void 0;){let d;typeof s=="number"&&(c+=s,s=e[++n]);var l=void 0;if(s instanceof $t?d=s:(d=R2,n--),d.qa){s=e[++n],l=e;var u=n;typeof s=="function"&&(s=s(),l[u]=s),l=s}for(u=c+1,typeof(s=e[++n])=="number"&&0>s&&(u-=s,s=e[++n]);c<u;c++){let f=a[c];o(t,c,l?i(d,l,f):r(d,f))}}return t}var ku=Symbol();function zd(e){let t=e[ku];if(!t){let r=kn(e);t=(i,o)=>Gd(i,o,r),e[ku]=t}return t}var Qo=Symbol();function w2(e){return e.h}function S2(e,t){let r,i,o=e.h;return(n,s,a)=>o(n,s,a,i||=kn(t).S,r||=zd(t))}function kn(e){let t=e[Qo];return t||(t=Ga(e,e[Qo]={},w2,S2),en in e&&Qo in e&&(e.length=0),t)}var en=Symbol();function E2(e,t){let r=e.g;return t?(i,o,n)=>r(i,o,n,t):r}function _2(e,t,r){let i=e.g,o,n;return(s,a,c)=>i(s,a,c,n||=Ha(t).S,o||=za(t),r)}function Ha(e){let t=e[en];return t||(Vd(e),t=Ga(e,e[en]={},E2,_2),en in e&&Qo in e&&(e.length=0),t)}function Au(e,t){var r=e[t];if(r)return r;if((r=e.ha)&&(r=r[t])){var i=(r=Ud(r))[0].h;if(r=r[1]){let o=zd(r),n=kn(r).S;r=(r=e.h)?r(n,o):(s,a,c)=>i(s,a,c,n,o)}else r=i;return e[t]=r}}function Gd(e,t,r){for(var i=C(e),o=+!!(512&i)-1,n=e.length,s=512&i?1:0,a=n+(256&i?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-o,u=Au(r,l);u&&u(t,c,l)}if(256&i){i=e[n-1];for(let c in i)o=+c,Number.isNaN(o)||(n=i[c])!=null&&(a=Au(r,o))&&a(t,n,o)}if(e=Ht?e[Ht]:void 0)for(Dr(t,t.g.end()),r=0;r<e.length;r++)Dr(t,Sa(e[r])||gn())}function xe(e,t){return new $t(e,t,!1,!1)}function Hr(e,t){return new $t(e,t,!0,!1)}function An(e,t){return new $t(e,t,!1,!0)}function Te(e,t,r){M(e,C(e),t,r)}var k2=An(function(e,t,r,i,o){return e.h===2&&(e=Ni(e,pr([void 0,void 0],i),o),vt(i=C(t)),(o=bt(t,i,r))instanceof Ge?(2&o.O)!=0?((o=o.X()).push(e),M(t,i,r,o)):o.Ta(e):Array.isArray(o)?(2&G(o)&&M(t,i,r,o=Fd(o)),o.push(e)):M(t,i,r,[e]),!0)},function(e,t,r,i,o){if(t instanceof Ge)t.forEach((n,s)=>{ta(e,r,pr([s,n],i),o)});else if(Array.isArray(t))for(let n=0;n<t.length;n++){let s=t[n];Array.isArray(s)&&ta(e,r,pr(s,i),o)}});function Hd(e,t,r){e:if(t!=null){if(En(t)){if(typeof t=="string"){t=Fa(t);break e}if(typeof t=="number"){t=Da(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&hu(t),t!=null&&(qe(e,r,0),typeof t=="number"?(e=e.g,dr(t),an(e,F,Q)):(r=hu(t),an(e.g,r.h,r.g))))}function Wd(e,t,r){(t=Vr(t))!=null&&t!=null&&(qe(e,r,0),bn(e.g,t))}function qd(e,t,r){(t=xd(t))!=null&&(qe(e,r,0),e.g.g.push(t?1:0))}function $d(e,t,r){(t=Fi(t))!=null&&wn(e,r,od(t))}function xn(e,t,r,i,o){ta(e,r,t instanceof v?t.s:Array.isArray(t)?pr(t,i):void 0,o)}function Xd(e,t,r){(t=t==null||typeof t=="string"||mn(t)||t instanceof Gt?t:void 0)!=null&&wn(e,r,_a(t).buffer)}function Kd(e,t,r){return(e.h===5||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,ea,t):t.push(ea(e.g)),!0)}var oe,Ot=xe(function(e,t,r){if(e.h!==1)return!1;var i=e.g;e=Qs(i);let o=Qs(i);i=2*(o>>31)+1;let n=o>>>20&2047;return e=4294967296*(1048575&o)+e,Te(t,r,n==2047?e?NaN:1/0*i:n==0?i*Math.pow(2,-1074)*e:i*Math.pow(2,n-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=Yt(t))!=null&&(qe(e,r,1),e=e.g,(r=md||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),F=r.getUint32(0,!0),Q=r.getUint32(4,!0),Oi(e,F),Oi(e,Q))}),ne=xe(function(e,t,r){return e.h===5&&(Te(t,r,ea(e.g)),!0)},function(e,t,r){(t=Yt(t))!=null&&(qe(e,r,5),e=e.g,Aa(t),Oi(e,F))}),A2=Hr(Kd,function(e,t,r){if((t=Gr(Yt,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&(qe(i,o,5),i=i.g,Aa(n),Oi(i,F))}}),Wa=Hr(Kd,function(e,t,r){if((t=Gr(Yt,t))!=null&&t.length){qe(e,r,2),ji(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,Aa(t[i]),Oi(r,F)}}),Xt=xe(function(e,t,r){return e.h===0&&(Te(t,r,Ra(e.g,xa)),!0)},Hd),qs=xe(function(e,t,r){return e.h===0&&(Te(t,r,(e=Ra(e.g,xa))===0?void 0:e),!0)},Hd),x2=xe(function(e,t,r){return e.h===0&&(Te(t,r,Ra(e.g,Zs)),!0)},function(e,t,r){e:if(t!=null){if(En(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)),bu(t)||(yn(t),t=sn(F,Q)));break e}if(typeof t=="number"){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(o){if(0>o){dr(o);let n=sn(F,Q);return o=Number(n),Number.isSafeInteger(o)?o:n}return bu(String(o))?o:(dr(o),Zs(F,Q))}(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&uu(t),t!=null&&(qe(e,r,0),typeof t=="number"?(e=e.g,dr(t),an(e,F,Q)):(r=uu(t),an(e.g,r.h,r.g))))}),K=xe(function(e,t,r){return e.h===0&&(Te(t,r,Wt(e.g)),!0)},Wd),qa=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,Wt,t):t.push(Wt(e.g)),!0)},function(e,t,r){if((t=Gr(Vr,t))!=null&&t.length){r=Ia(e,r);for(let i=0;i<t.length;i++)bn(e.g,t[i]);Oa(e,r)}}),Mr=xe(function(e,t,r){return e.h===0&&(Te(t,r,(e=Wt(e.g))===0?void 0:e),!0)},Wd),ee=xe(function(e,t,r){return e.h===0&&(Te(t,r,Ca(e.g)),!0)},qd),Pi=xe(function(e,t,r){return e.h===0&&(Te(t,r,(e=Ca(e.g))===!1?void 0:e),!0)},qd),ve=Hr(function(e,t,r){return e.h===2&&(Hi(t,r,g2,e=Pa(e)),!0)},function(e,t,r){if((t=Gr(Fi,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&wn(i,o,od(n))}}),Kt=xe(function(e,t,r){return e.h===2&&(Te(t,r,(e=Pa(e))===""?void 0:e),!0)},$d),U=xe(function(e,t,r){return e.h===2&&(Te(t,r,Pa(e)),!0)},$d),T2=An(function(e,t,r,i,o){return e.h===2&&(Ni(e,Va(t,i,r,!0),o),!0)},xn),R2=An(function(e,t,r,i,o){return e.h===2&&(Ni(e,Va(t,i,r),o),!0)},xn);oe=new $t(function(e,t,r,i,o){if(e.h!==2)return!1;i=pr(void 0,i);let n=C(t);vt(n);let s=zr(t,n,r,3);return n=C(t),4&G(s)&&(s=we(s),q(s,-2079&(1|G(s))),M(t,n,r,s)),s.push(i),Ni(e,i,o),!0},function(e,t,r,i,o){if(Array.isArray(t))for(let n=0;n<t.length;n++)xn(e,t[n],r,i,o)},!0,!0);var N=An(function(e,t,r,i,o,n){if(e.h!==2)return!1;let s=C(t);return vt(s),(n=ja(t,s,n))&&r!==n&&M(t,s,n),Ni(e,t=Va(t,i,r),o),!0},xn),Jd=xe(function(e,t,r){return e.h===2&&(Te(t,r,wd(e)),!0)},Xd),C2=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,qt,t):t.push(qt(e.g)),!0)},function(e,t,r){if((t=Gr(a2,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&(qe(i,o,0),ji(i.g,n))}}),yt=xe(function(e,t,r){return e.h===0&&(Te(t,r,Wt(e.g)),!0)},function(e,t,r){(t=Vr(t))!=null&&(t=parseInt(t,10),qe(e,r,0),bn(e.g,t))}),P2=Hr(function(e,t,r){return(e.h===0||e.h===2)&&(t=zr(t,C(t),r,2,!1),e.h==2?vn(e,t2,t):t.push(Wt(e.g)),!0)},function(e,t,r){if((t=Gr(Vr,t))!=null&&t.length){r=Ia(e,r);for(let i=0;i<t.length;i++)bn(e.g,t[i]);Oa(e,r)}}),aa=class{constructor(t,r){this.h=t,this.g=r,this.l=R,this.m=_,this.defaultValue=void 0}};function it(e,t){return new aa(e,t)}function Zt(e,t){return(r,i)=>{e:{if(qo.length){let n=qo.pop();n.o(i),Gs(n.g,r,i),r=n}else r=new class{constructor(n,s){if(lu.length){let a=lu.pop();Gs(a,n,s),n=a}else n=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,Gs(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(n,s);this.g=n,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({ga:n=!1}={}){this.ga=n}}(r,i);try{let n=new e,s=n.s;za(t)(s,r),Di&&delete s[Di];var o=n;break e}finally{r.g.clear(),r.m=-1,r.h=-1,100>qo.length&&qo.push(r)}o=void 0}return o}}function $a(e){return function(){let t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let s=this.g;return this.g=[],s}}}};Gd(this.s,t,kn(e)),Dr(t,t.g.end());let r=new Uint8Array(t.h),i=t.l,o=i.length,n=0;for(let s=0;s<o;s++){let a=i[s];r.set(a,n),n+=a.length}return t.l=[r],r}}var Yd=[0,Kt,xe(function(e,t,r){return e.h===2&&(Te(t,r,(e=wd(e))===Or()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){let i=t.Va;return void(i&&(t=i(t),t!=null&&wn(e,r,_a(t).buffer)))}if(Array.isArray(t))return}Xd(e,t,r)})],I2=[0,U],Zd=[0,K,yt,ee,-1,qa,yt,-1],O2=[0,ee,-1],Qd=class extends v{constructor(){super()}};Qd.A=[6];var eh=[0,ee,U,ee,yt,-1,P2,U,-1,O2,yt],th=[0,U,-2],xu=class extends v{constructor(){super()}},rh=[0],ih=[0,K,ee,-2],We=class extends v{constructor(e){super(e,2)}},V={},D2=[-2,V,ee];V[336783863]=[0,U,ee,-1,K,[0,[1,2,3,4,5],N,rh,N,eh,N,th,N,ih,N,Zd],I2];var F2=[0,Kt,Pi],oh=[0,qs,-1,Pi,-3,qs,qa,Kt,Mr,qs,-1,Pi,Mr,Pi,-2,Kt],Wi=[-1,{}],nh=[0,U,1,Wi],sh=[0,U,ve,Wi];function $e(e,t){t=Gi(t),e=e.s;let r=C(e);vt(r),M(e,r,2,t===""?void 0:t)}function L(e,t){Hi(e.s,3,zi,t)}function D(e,t){Hi(e.s,4,zi,t)}var Se=class extends v{constructor(e){super(e,500)}o(e){return _(this,0,7,e)}};Se.A=[3,4,5,6,8,13,17,1005];var B2=[-500,Kt,-1,ve,-3,D2,oe,Yd,Mr,-1,nh,sh,oe,F2,Kt,oh,Mr,ve,987,ve],M2=[0,Kt,-1,Wi],L2=[-500,U,-1,[-1,{}],998,U],U2=[-500,U,ve,-1,[-2,{},ee],997,ve,-1],N2=[-500,U,ve,Wi,998,ve];function Xe(e,t){sa(e,Se,t)}function z(e,t){Hi(e.s,10,zi,t)}function j(e,t){Hi(e.s,15,zi,t)}var Re=class extends v{constructor(e){super(e,500)}o(e){return _(this,0,1001,e)}};Re.A=[1,6,7,9,10,15,16,17,14,1002];var ah=[-500,oe,B2,4,oe,L2,oe,U2,Mr,oe,N2,ve,Mr,nh,sh,oe,M2,ve,-2,oh,Kt,-1,Pi,979,Wi,oe,Yd],j2=Zt(Re,ah);Re.prototype.g=$a(ah);var V2=[0,oe,[0,K,-2]],z2=class extends v{constructor(e){super(e)}},G2=[0,K,ne,U,-1],Xa=class extends v{constructor(e){super(e)}g(){return Dt(this,z2,1)}};Xa.A=[1];var ch=[0,oe,G2],Ka=Zt(Xa,ch),H2=[0,K,ne],W2=[0,K,-1,V2],q2=class extends v{constructor(e){super(e)}},$2=[0,K,-3],X2=[0,ne,-3],K2=class extends v{constructor(e){super(e)}},J2=[0,ne,-1,U,ne],tn=class extends v{constructor(e){super(e)}h(){return R(this,q2,2)}g(){return Dt(this,K2,5)}};tn.A=[5];var Y2=[0,yt,$2,X2,W2,oe,J2],lh=class extends v{constructor(e){super(e)}};lh.A=[1,2,3,8,9];var uh=Zt(lh,[0,ve,qa,Wa,Y2,U,-1,Xt,oe,H2,ve,Xt]),dh=class extends v{constructor(e){super(e)}},Z2=[0,ne,-4],hh=class extends v{constructor(e){super(e)}};hh.A=[1];var Ja=Zt(hh,[0,oe,Z2]),ph=class extends v{constructor(e){super(e)}},Q2=[0,ne,-4],fh=class extends v{constructor(e){super(e)}};fh.A=[1];var Tn=Zt(fh,[0,oe,Q2]),mh=class extends v{constructor(e){super(e)}};mh.A=[3];var e0=[0,K,-1,Wa,yt],gh=class extends v{constructor(){super()}};gh.prototype.g=$a([0,ne,-4,Xt]);var t0=class extends v{constructor(e){super(e)}},r0=[0,1,K,U,ch],yh=class extends v{constructor(e){super(e)}};yh.A=[1];var i0=Zt(yh,[0,oe,r0,Xt]),ca=class extends v{constructor(e){super(e)}};ca.A=[1];var o0=class extends v{constructor(e){super(e)}ua(){let e=Id(this);return e??Or()}},n0=class extends v{constructor(e){super(e)}},vh=[1,2],s0=[0,vh,N,[0,Wa],N,[0,Jd],K,U],bh=class extends v{constructor(e){super(e)}};bh.A=[1];var a0=Zt(bh,[0,oe,s0,Xt]),Rn=class extends v{constructor(e){super(e)}};Rn.A=[4,5];var wh=[0,U,K,ne,ve,-1],Tu=class extends v{constructor(e){super(e)}},c0=[0,ee,-1],Ru=class extends v{constructor(e){super(e)}},rn=[1,2,3,4,5],fn=class extends v{constructor(e){super(e)}g(){return Id(this)!=null}h(){return He(this,2)!=null}},Sh=[0,Jd,U,[0,K,Xt,-1],[0,x2,Xt]],X=class extends v{constructor(e){super(e)}g(){return xd(Br(this,2))??!1}},se=[0,Sh,ee,[0,rn,N,ih,N,eh,N,Zd,N,rh,N,th],yt],Ya=class extends v{constructor(e){super(e)}},Eh=[0,se,ne,-1,K],l0=it(502141897,Ya);V[502141897]=Eh;var _h=[0,Sh];V[512499200]=_h;var kh=[0,_h];V[515723506]=kh;var u0=Zt(class extends v{constructor(e){super(e)}},[0,[0,yt,-1,A2,C2],e0]),Ah=[0,se];V[508981768]=Ah;var d0=class extends v{constructor(e){super(e)}},xh=[0,se,ne,Ah,ee],Th=class extends v{constructor(e){super(e)}},Rh=[0,se,Eh,xh,ne,kh];V[508968149]=xh;var h0=it(508968150,Th);V[508968150]=Rh;var Ch=class extends v{constructor(e){super(e)}},p0=it(513916220,Ch);V[513916220]=[0,se,Rh,K];var Rr=class extends v{constructor(e){super(e)}h(){return R(this,Rn,2)}g(){B(this,2)}},Ph=[0,se,wh];V[478825465]=Ph;var Ih=[0,se];V[478825422]=Ih;var f0=class extends v{constructor(e){super(e)}},Oh=[0,se,Ih,Ph,-1],Dh=class extends v{constructor(e){super(e)}},Fh=[0,se,ne,K],Bh=class extends v{constructor(e){super(e)}},Mh=[0,se,ne],Za=class extends v{constructor(e){super(e)}},Lh=[0,se,Fh,Mh,ne],Uh=class extends v{constructor(e){super(e)}},m0=[0,se,Lh,Oh];V[463370452]=Oh,V[464864288]=Fh,V[474472470]=Mh;var g0=it(462713202,Za);V[462713202]=Lh;var y0=it(479097054,Uh);V[479097054]=m0;var Nh=class extends v{constructor(e){super(e)}},v0=it(456383383,Nh);V[456383383]=[0,se,wh];var jh=class extends v{constructor(e){super(e)}},b0=it(476348187,jh);V[476348187]=[0,se,c0];var Vh=class extends v{constructor(e){super(e)}},zh=[0,yt,-1],la=class extends v{constructor(e){super(e)}};la.A=[3];var w0=it(458105876,class extends v{constructor(e){super(e)}g(){var e=this.s;let t=C(e);var r=2&t;return e=function(i,o,n){var s=la;let a=2&o,c=!1;if(n==null){if(a)return Su();n=[]}else if(n.constructor===Ge){if((2&n.O)==0||a)return n;n=n.X()}else Array.isArray(n)?c=!!(2&G(n)):n=[];if(a){if(!n.length)return Su();c||(c=!0,jr(n))}else c&&(c=!1,n=Fd(n));return c||(64&G(n)?cn(n,32):32&o&&Sn(n,32)),M(i,o,2,s=new Ge(n,s,c2,void 0),!1),s}(e,t,bt(e,t,2)),e==null||!r&&la&&(e.xa=!0),r=e}});V[458105876]=[0,zh,k2,[!0,Xt,[0,U,-1,ve]]];var Qa=class extends v{constructor(e){super(e)}},Gh=it(458105758,Qa);V[458105758]=[0,se,U,zh];var ec=class extends v{constructor(e){super(e)}};ec.A=[5,6];var S0=it(443442058,ec);V[443442058]=[0,se,U,K,ne,ve,-1];var E0=class extends v{constructor(e){super(e)}},Hh=[0,se,ne,-1,K];V[514774813]=Hh;var _0=class extends v{constructor(e){super(e)}},Wh=[0,se,ne,ee],qh=class extends v{constructor(e){super(e)}},k0=[0,se,Hh,Wh,ne];V[518928384]=Wh;var A0=it(516587230,qh);function ua(e,t){return t=t?t.clone():new Rn,e.displayNamesLocale!==void 0?B(t,1,Gi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&B(t,1),e.maxResults!==void 0?gt(t,2,e.maxResults):"maxResults"in e&&B(t,2),e.scoreThreshold!==void 0?A(t,3,e.scoreThreshold):"scoreThreshold"in e&&B(t,3),e.categoryAllowlist!==void 0?pn(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&B(t,4),e.categoryDenylist!==void 0?pn(t,5,e.categoryDenylist):"categoryDenylist"in e&&B(t,5),t}function $h(e,t=-1,r=""){return{categories:e.map(i=>({index:mt(ze(i,1))??-1,score:he(i,2)??0,categoryName:He(i,3)??""??"",displayName:He(i,4)??""??""})),headIndex:t,headName:r}}function Xh(e){var t=Cr(e,3,Yt),r=Cr(e,2,Vr),i=Cr(e,1,Fi),o=Cr(e,9,Fi);let n={categories:[],keypoints:[]};for(let s=0;s<t.length;s++)n.categories.push({score:t[s],index:r[s]??-1,categoryName:i[s]??"",displayName:o[s]??""});if((t=R(e,tn,4)?.h())&&(n.boundingBox={originX:ze(t,1)??0,originY:ze(t,2)??0,width:ze(t,3)??0,height:ze(t,4)??0,angle:0}),R(e,tn,4)?.g().length)for(let s of R(e,tn,4).g())n.keypoints.push({x:Yo(s,1)??0,y:Yo(s,2)??0,score:Yo(s,4)??0,label:He(s,3)??""});return n}function tc(e){let t=[];for(let r of Dt(e,ph,1))t.push({x:he(r,1)??0,y:he(r,2)??0,z:he(r,3)??0});return t}function Kh(e){let t=[];for(let r of Dt(e,dh,1))t.push({x:he(r,1)??0,y:he(r,2)??0,z:he(r,3)??0});return t}function Cu(e){return Array.from(e,t=>127<t?t-256:t)}function Pu(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,i=0,o=0;for(let n=0;n<e.length;n++)r+=e[n]*t[n],i+=e[n]*e[n],o+=t[n]*t[n];if(0>=i||0>=o)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(i*o)}var Xo;V[516587230]=k0;var x0=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 Jh(){if(Xo===void 0)try{await WebAssembly.instantiate(x0),Xo=!0}catch{Xo=!1}return Xo}async function $s(e,t=""){let r=await Jh()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Pr=class{};function Yh(){let e=navigator.userAgent;return e.includes("Safari")&&!e.includes("Chrome")}async function Iu(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",o=>{i(o)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function w(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Ou(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=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`.");return e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),t.videoWidth?(r=t.videoWidth,t=t.videoHeight):t.naturalWidth?(r=t.naturalWidth,t=t.naturalHeight):(r=t.width,t=t.height),!e.l||r===e.i.canvas.width&&t===e.i.canvas.height||(e.i.canvas.width=r,e.i.canvas.height=t),[r,t]}function Du(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let i=new Uint32Array(t.length);for(let o=0;o<t.length;o++)i[o]=e.i.stringToNewUTF8(t[o]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),r(t);for(let o of i)e.i._free(o);e.i._free(t)}function Ct(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function lr(e,t,r){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(o,n,s)=>{n?(r(i,s),i=[]):i.push(o)}}Pr.forVisionTasks=function(e){return $s("vision",e)},Pr.forTextTasks=function(e){return $s("text",e)},Pr.forAudioTasks=function(e){return $s("audio",e)},Pr.isSimdSupported=function(){return Jh()};async function T0(e,t,r,i){return e=await(async(o,n,s,a,c)=>{if(n&&await Iu(n),!self.ModuleFactory||s&&(await Iu(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((n=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(n.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new o(c,a)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:o=>o.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&o.endsWith(".data")?r.assetBinaryPath.toString():o}),await e.o(i),e}function Fu(e,t){let r=R(e.baseOptions,fn,1)||new fn;typeof t=="string"?(B(r,2,Gi(t)),B(r,1)):t instanceof Uint8Array&&(B(r,1,kd(t,!1,!1)),B(r,2)),_(e.baseOptions,0,1,r)}function Bu(e){try{let t=e.F.length;if(t===1)throw Error(e.F[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.F.map(r=>r.message).join(", "))}finally{e.F=[]}}function S(e,t){e.I=Math.max(e.I,t)}function rc(e,t){e.C=new Se,$e(e.C,"PassThroughCalculator"),L(e.C,"free_memory"),D(e.C,"free_memory_unused_out"),z(t,"free_memory"),Xe(t,e.C)}function Mi(e,t){L(e.C,t),D(e.C,t+"_unused_out")}function ic(e){e.g.addBoolToStream(!0,"free_memory",e.I)}var da=class{constructor(e){this.g=e,this.F=[],this.I=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){if(t){let r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(R(this.baseOptions,fn,1)?.g()||R(this.baseOptions,fn,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(i,o){let n=R(i.baseOptions,Ru,3);if(!n){var s=n=new Ru,a=new xu;Ci(s,4,rn,a)}"delegate"in o&&(o.delegate==="GPU"?(o=n,s=new Qd,Ci(o,2,rn,s)):(o=n,s=new xu,Ci(o,4,rn,s))),_(i.baseOptions,0,3,n)}(this,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(i=>{if(i.ok)return i.arrayBuffer();throw Error(`Failed to fetch model: ${r.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),Fu(this,"/model.dat"),this.m(),this.N()});Fu(this,r.modelAssetBuffer)}return this.m(),this.N(),Promise.resolve()}N(){}da(){let e;if(this.g.da(t=>{e=j2(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.F.push(Error(i))}),this.g.Ra(),this.g.setGraph(e,t),this.C=void 0,Bu(this)}finishProcessing(){this.g.finishProcessing(),Bu(this)}close(){this.C=void 0,this.g.closeGraph()}};function be(e,t){if(e===null)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}da.prototype.close=da.prototype.close;var ha=class{constructor(t,r,i,o){this.g=t,this.h=r,this.m=i,this.l=o}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}};function Mu(e,t,r){let i=e.g;if(r=be(i.createShader(r),"Failed to create WebGL shader"),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(r)}`);return i.attachShader(e.h,r),r}function Lu(e,t){let r=e.g,i=be(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);let o=be(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,o),r.enableVertexAttribArray(e.N),r.vertexAttribPointer(e.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);let n=be(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.M),r.vertexAttribPointer(e.M,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new ha(r,i,o,n)}function oc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function qi(e,t,r,i){return oc(e,t),e.h||(e.m(),e.F()),r?(e.u||(e.u=Lu(e,!0)),r=e.u):(e.v||(e.v=Lu(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function Jt(e,t,r){return oc(e,t),e=be(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,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Cn(e,t,r){oc(e,t),e.C||(e.C=be(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.C),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function nc(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Wr=class{I(){return`
|
|
10
10
|
precision mediump float;
|
|
11
11
|
varying vec2 vTex;
|
|
12
12
|
uniform sampler2D inputTexture;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
|
|
47
47
|
gl_FragColor = mix(defaultColor, overlayColor, confidence);
|
|
48
48
|
}
|
|
49
|
-
`}F(){let e=this.g;e.activeTexture(e.TEXTURE1),this.j=Jt(this,e),e.activeTexture(e.TEXTURE2),this.B=Jt(this,e)}m(){super.m();let e=this.g;this.T=be(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.U=be(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.J=be(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.J,0),e.uniform1i(this.T,1),e.uniform1i(this.U,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function It(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function pa(e){var t=It(e,1);if(!t){if(t=It(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);let i=Lr(e);var r=sc(e);if(Cn(r,i,Zh(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,r);for(let o=0,n=0;o<t.length;++o,n+=4)t[o]=r[n]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function Zh(e){let t=It(e,2);if(!t){let r=Lr(e);t=ep(e);let i=pa(e),o=Qh(e);r.texImage2D(r.TEXTURE_2D,0,o,e.width,e.height,0,r.RED,r.FLOAT,i),fa(e)}return t}function Lr(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=be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Qh(e){if(e=Lr(e),!Ko)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Ko=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Ko=e.R16F}return Ko}function sc(e){return e.l||(e.l=new Wr),e.l}function ep(e){let t=Lr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=It(e,2);return r||(r=Jt(sc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function fa(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Ko,ie=class{constructor(e,t,r,i,o,n,s){this.g=e,this.m=t,this.j=r,this.canvas=i,this.l=o,this.width=n,this.height=s,this.j&&--Uu===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}La(){return!!It(this,0)}ka(){return!!It(this,1)}P(){return!!It(this,2)}ja(){return(t=It(e=this,0))||(t=pa(e),t=new Uint8Array(t.map(r=>255*r)),e.g.push(t)),t;var e,t}ia(){return pa(this)}K(){return Zh(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{let i=Lr(this),o=sc(this);i.activeTexture(i.TEXTURE1),r=Jt(o,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);let n=Qh(this);i.texImage2D(i.TEXTURE_2D,0,n,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),Cn(o,i,r),qi(o,i,!1,()=>{ep(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),fa(this)}),nc(o),fa(this)}}e.push(r)}return new ie(e,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Lr(this).deleteTexture(It(this,2)),Uu=-1}};ie.prototype.close=ie.prototype.close,ie.prototype.clone=ie.prototype.clone,ie.prototype.getAsWebGLTexture=ie.prototype.K,ie.prototype.getAsFloat32Array=ie.prototype.ia,ie.prototype.getAsUint8Array=ie.prototype.ja,ie.prototype.hasWebGLTexture=ie.prototype.P,ie.prototype.hasFloat32Array=ie.prototype.ka,ie.prototype.hasUint8Array=ie.prototype.La;var Uu=250,P0={color:"white",lineWidth:4,radius:6};function Xs(e){return{...P0,fillColor:(e=e||{}).color,...e}}function Pt(e,t){return e instanceof Function?e(t):e}function Nu(e,t,r){return Math.max(Math.min(t,r),Math.min(Math.max(t,r),e))}function _i(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Li(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function ju(e,t,r){if(t.P())r(t.K());else{let i=t.ka()?t.ia():t.ja();e.m=e.m??new Wr;let o=Li(e);r((e=new ie([i],t.m,!1,o.canvas,e.m,t.width,t.height)).K()),e.close()}}function Vu(e,t,r,i){let o=function(a){return a.g||(a.g=new R0),a.g}(e),n=Li(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;qi(o,n,!0,()=>{(function(c,l,u,d){let f=c.g;if(f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,l),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,c.B),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,u),c.J&&function(g,h){if(g!==h)return!1;g=g.entries(),h=h.entries();for(let[y,b]of g){g=y;let k=b;var m=h.next();if(m.done)return!1;let[P,ae]=m.value;if(m=ae,g!==P||k[0]!==m[0]||k[1]!==m[1]||k[2]!==m[2]||k[3]!==m[3])return!1}return!!h.next().done}(c.J,d))f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j);else{c.J=d;let g=Array(1024).fill(0);d.forEach((h,m)=>{if(h.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);g[4*m]=h[0],g[4*m+1]=h[1],g[4*m+2]=h[2],g[4*m+3]=h[3]}),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,256,1,0,f.RGBA,f.UNSIGNED_BYTE,new Uint8Array(g))}})(o,t,s,i),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4);let a=o.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function zu(e,t,r,i){let o=Li(e),n=function(c){return c.h||(c.h=new C0),c.h}(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;qi(n,o,!0,()=>{var c=n.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,n.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,n.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4),o.bindTexture(o.TEXTURE_2D,null),(c=n.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var Ee=class{constructor(e,t){e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}Ea(e,t){if(e){var r=_i(this);t=Xs(t),r.save();var i=r.canvas,o=0;for(let n of e)r.fillStyle=Pt(t.fillColor,{index:o,from:n}),r.strokeStyle=Pt(t.color,{index:o,from:n}),r.lineWidth=Pt(t.lineWidth,{index:o,from:n}),(e=new Path2D).arc(n.x*i.width,n.y*i.height,Pt(t.radius,{index:o,from:n}),0,2*Math.PI),r.fill(e),r.stroke(e),++o;r.restore()}}Da(e,t,r){if(e&&t){var i=_i(this);r=Xs(r),i.save();var o=i.canvas,n=0;for(let s of t){i.beginPath(),t=e[s.start];let a=e[s.end];t&&a&&(i.strokeStyle=Pt(r.color,{index:n,from:t,to:a}),i.lineWidth=Pt(r.lineWidth,{index:n,from:t,to:a}),i.moveTo(t.x*o.width,t.y*o.height),i.lineTo(a.x*o.width,a.y*o.height)),++n,i.stroke()}i.restore()}}Aa(e,t){let r=_i(this);t=Xs(t),r.save(),r.beginPath(),r.lineWidth=Pt(t.lineWidth,{}),r.strokeStyle=Pt(t.color,{}),r.fillStyle=Pt(t.fillColor,{}),r.moveTo(e.originX,e.originY),r.lineTo(e.originX+e.width,e.originY),r.lineTo(e.originX+e.width,e.originY+e.height),r.lineTo(e.originX,e.originY+e.height),r.lineTo(e.originX,e.originY),r.stroke(),r.fill(),r.restore()}Ba(e,t,r=[0,0,0,255]){this.l?function(i,o,n,s){let a=Li(i);ju(i,o,c=>{Vu(i,c,n,s),(c=_i(i)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,r,t):Vu(this,e.K(),r,t)}Ca(e,t,r){this.l?function(i,o,n,s){let a=Li(i);ju(i,o,c=>{zu(i,c,n,s),(c=_i(i)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,r):zu(this,e.K(),t,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function pt(e,t){switch(t){case 0:return e.g.find(r=>r instanceof ImageData);case 1:return e.g.find(r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function tp(e){var t=pt(e,0);if(!t){t=Ur(e);let r=Pn(e),i=new Uint8Array(e.width*e.height*4);Cn(r,t,on(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),nc(r),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function on(e){let t=pt(e,2);if(!t){let r=Ur(e);t=nn(e);let i=pt(e,1)||tp(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i),Ai(e)}return t}function Ur(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=be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Pn(e){return e.l||(e.l=new Wr),e.l}function nn(e){let t=Ur(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=pt(e,2);return r||(r=Jt(Pn(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Ai(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function Gu(e){let t=Ur(e);return qi(Pn(e),t,!0,()=>function(r,i){let o=r.canvas;if(o.width===r.width&&o.height===r.height)return i();let n=o.width,s=o.height;return o.width=r.width,o.height=r.height,r=i(),o.width=n,o.height=s,r}(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()}))}Ee.prototype.close=Ee.prototype.close,Ee.prototype.drawConfidenceMask=Ee.prototype.Ca,Ee.prototype.drawCategoryMask=Ee.prototype.Ba,Ee.prototype.drawBoundingBox=Ee.prototype.Aa,Ee.prototype.drawConnectors=Ee.prototype.Da,Ee.prototype.drawLandmarks=Ee.prototype.Ea,Ee.lerp=function(e,t,r,i,o){return Nu(i*(1-(e-t)/(r-t))+o*(1-(r-e)/(r-t)),i,o)},Ee.clamp=Nu;var ce=class{constructor(e,t,r,i,o,n,s){this.g=e,this.j=t,this.m=r,this.canvas=i,this.l=o,this.width=n,this.height=s,(this.j||this.m)&&--Hu===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ka(){return!!pt(this,0)}la(){return!!pt(this,1)}P(){return!!pt(this,2)}Ia(){return tp(this)}Ha(){var e=pt(this,1);return e||(on(this),nn(this),e=Gu(this),Ai(this),this.g.push(e),this.j=!0),e}K(){return on(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){let i=Ur(this),o=Pn(this);i.activeTexture(i.TEXTURE1),r=Jt(o,i),i.bindTexture(i.TEXTURE_2D,r),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),Cn(o,i,r),qi(o,i,!1,()=>{nn(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Ai(this)}),nc(o),Ai(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);on(this),nn(this),r=Gu(this),Ai(this)}e.push(r)}return new ce(e,this.la(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pt(this,1).close(),this.m&&Ur(this).deleteTexture(pt(this,2)),Hu=-1}};ce.prototype.close=ce.prototype.close,ce.prototype.clone=ce.prototype.clone,ce.prototype.getAsWebGLTexture=ce.prototype.K,ce.prototype.getAsImageBitmap=ce.prototype.Ha,ce.prototype.getAsImageData=ce.prototype.Ia,ce.prototype.hasWebGLTexture=ce.prototype.P,ce.prototype.hasImageBitmap=ce.prototype.la,ce.prototype.hasImageData=ce.prototype.Ka;var Hu=250;function ot(...e){return e.map(([t,r])=>({start:t,end:r}))}var I0=function(e){return class extends e{Ra(){this.i._registerModelResourcesGraphService()}}}((Wu=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:typeof OffscreenCanvas>"u"||Yh()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(e){let 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){let r=e.length,i=this.i._malloc(r);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(r,i):this.i._changeTextGraph(r,i),this.i._free(i)}configureAudio(e,t,r,i,o){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),w(this,i||"input_audio",n=>{w(this,o=o||"audio_header",s=>{this.i._configureAudio(n,s,e,t,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}da(e){Ct(this,"__graph_config__",t=>{e(t)}),w(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,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,o){let n=4*e.length;this.h!==n&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(n),this.h=n),this.i.HEAPF32.set(e,this.g/4),w(this,i,s=>{this.i._addAudioToInputStream(this.g,t,r,s,o)})}addGpuBufferToStream(e,t,r){w(this,t,i=>{let[o,n]=Ou(this,e,i);this.i._addBoundTextureToStream(i,o,n,r)})}addBoolToStream(e,t,r){w(this,t,i=>{this.i._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){w(this,t,i=>{this.i._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){w(this,t,i=>{this.i._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){w(this,t,i=>{this.i._addIntToInputStream(e,i,r)})}addStringToStream(e,t,r){w(this,t,i=>{w(this,e,o=>{this.i._addStringToInputStream(o,i,r)})})}addStringRecordToStream(e,t,r){w(this,t,i=>{Du(this,Object.keys(e),o=>{Du(this,Object.values(e),n=>{this.i._addFlatHashMapToInputStream(o,n,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){w(this,r,o=>{w(this,t,n=>{let s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,n,o,i),this.i._free(s)})})}addEmptyPacketToStream(e,t){w(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(let n of e)this.i._addBoolVectorEntry(o,n);this.i._addBoolVectorToInputStream(o,i,r)})}addDoubleVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(let n of e)this.i._addDoubleVectorEntry(o,n);this.i._addDoubleVectorToInputStream(o,i,r)})}addFloatVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(let n of e)this.i._addFloatVectorEntry(o,n);this.i._addFloatVectorToInputStream(o,i,r)})}addIntVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(let n of e)this.i._addIntVectorEntry(o,n);this.i._addIntVectorToInputStream(o,i,r)})}addStringVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(let n of e)w(this,n,s=>{this.i._addStringVectorEntry(o,s)});this.i._addStringVectorToInputStream(o,i,r)})}addBoolToInputSidePacket(e,t){w(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){w(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){w(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){w(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){w(this,t,r=>{w(this,e,i=>{this.i._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){w(this,r,i=>{w(this,t,o=>{let n=this.i._malloc(e.length);this.i.HEAPU8.set(e,n),this.i._addProtoToInputSidePacket(n,e.length,o,i),this.i._free(n)})})}addBoolVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.i._addBoolVectorEntry(i,o);this.i._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.i._addDoubleVectorEntry(i,o);this.i._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.i._addFloatVectorEntry(i,o);this.i._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.i._addIntVectorEntry(i,o);this.i._addIntVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)w(this,o,n=>{this.i._addStringVectorEntry(i,n)});this.i._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachIntVectorListener(r)})}attachDoubleListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){Ct(this,e,t),w(this,e,i=>{this.i._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){lr(this,e,t),w(this,e,i=>{this.i._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ct(this,e,(i,o)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,o)}),w(this,e,i=>{this.i._attachAudioListener(i,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Wu{get fa(){return this.i}va(e,t,r){w(this,t,i=>{let[o,n]=Ou(this,e,i);this.fa._addBoundTextureAsImageToStream(i,o,n,r)})}ba(e,t){Ct(this,e,t),w(this,e,r=>{this.fa._attachImageListener(r)})}ca(e,t){lr(this,e,t),w(this,e,r=>{this.fa._attachImageVectorListener(r)})}})),Wu,nt=class extends I0{};async function x(e,t,r){return async function(i,o,n,s){return x0(i,o,n,s)}(e,r.canvas??(typeof OffscreenCanvas>"u"||Yh()?document.createElement("canvas"):void 0),t,r)}function rp(e,t,r,i){if(e.J){let n=new gh;if(r?.regionOfInterest){if(!e.U)throw Error("This task doesn't support region-of-interest.");var o=r.regionOfInterest;if(o.left>=o.right||o.top>=o.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>o.left||0>o.top||1<o.right||1<o.bottom)throw Error("Expected RectF values to be in [0,1].");A(n,1,(o.left+o.right)/2),A(n,2,(o.top+o.bottom)/2),A(n,4,o.right-o.left),A(n,3,o.bottom-o.top)}else A(n,1,.5),A(n,2,.5),A(n,4,1),A(n,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(A(n,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[s,a]=t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:[t.width,t.height];r=he(n,3)*a/s,o=he(n,4)*s/a,A(n,4,r),A(n,3,o)}}e.g.addProtoToStream(n.g(),"mediapipe.NormalizedRect",e.J,i)}e.g.va(t,e.T,i??performance.now()),e.finishProcessing()}function st(e,t,r){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");rp(e,t,r,e.I+1)}function Ft(e,t,r,i){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");rp(e,t,r,i)}function Ui(e,t,r,i){var o=t.data;let n=t.width,s=n*(t=t.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==s)throw Error("Unsupported channel count: "+o.length/s);return e=new ie([o],r,!1,e.g.i.canvas,e.M,n,t),i?e.clone():e}var Me=class extends da{constructor(e,t,r,i){super(e),this.g=e,this.T=t,this.J=r,this.U=i,this.M=new Wr}l(e,t=!0){if("runningMode"in e&&Bi(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()}};Me.prototype.close=Me.prototype.close;var ke=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},_(e=this.h=new Ya,0,1,t=new X),A(this.h,2,.5),A(this.h,3,.3)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&A(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&A(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}G(e,t){return this.j={detections:[]},st(this,e,t),this.j}H(e,t,r){return this.j={detections:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect_in"),j(e,"detections");let t=new We;rt(t,l0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect_in"),D(r,"DETECTIONS:detections"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("detections",(i,o)=>{for(let n of i)i=uh(n),this.j.detections.push(Xh(i));S(this,o)}),this.g.attachEmptyPacketListener("detections",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ke.prototype.detectForVideo=ke.prototype.H,ke.prototype.detect=ke.prototype.G,ke.prototype.setOptions=ke.prototype.o,ke.createFromModelPath=async function(e,t){return x(ke,e,{baseOptions:{modelAssetPath:t}})},ke.createFromModelBuffer=function(e,t){return x(ke,e,{baseOptions:{modelAssetBuffer:t}})},ke.createFromOptions=function(e,t){return x(ke,e,t)};var ip=ot([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]),op=ot([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]),np=ot([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),O0=ot([474,475],[475,476],[476,477],[477,474]),sp=ot([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]),ap=ot([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),D0=ot([469,470],[470,471],[471,472],[472,469]),cp=ot([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[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]),F0=[...ip,...op,...np,...sp,...ap,...cp],B0=ot([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]);function qu(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var $=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,_(e=this.h=new xh,0,1,t=new X),this.v=new d0,_(this.h,0,3,this.v),this.u=new Ya,_(this.h,0,2,this.u),gt(this.u,4,1),A(this.u,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"numFaces"in e&>(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&A(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&A(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}G(e,t){return qu(this),st(this,e,t),this.j}H(e,t,r){return qu(this),Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"face_landmarks");let t=new We;rt(t,h0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("face_landmarks",(i,o)=>{for(let n of i)i=xn(n),this.j.faceLandmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{S(this,i)}),this.outputFaceBlendshapes&&(j(e,"blendshapes"),D(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,o)=>{if(this.outputFaceBlendshapes)for(let n of i)i=Ka(n),this.j.faceBlendshapes.push($h(i.g()??[]));S(this,o)}),this.g.attachEmptyPacketListener("blendshapes",i=>{S(this,i)})),this.outputFacialTransformationMatrixes&&(j(e,"face_geometry"),D(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,o)=>{if(this.outputFacialTransformationMatrixes)for(let n of i)(i=R(u0(n),mh,2))&&this.j.facialTransformationMatrixes.push({rows:mt(ze(i,1))??0,columns:mt(ze(i,2))??0,data:Cr(i,3,Yt)??[]});S(this,o)}),this.g.attachEmptyPacketListener("face_geometry",i=>{S(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};$.prototype.detectForVideo=$.prototype.H,$.prototype.detect=$.prototype.G,$.prototype.setOptions=$.prototype.o,$.createFromModelPath=function(e,t){return x($,e,{baseOptions:{modelAssetPath:t}})},$.createFromModelBuffer=function(e,t){return x($,e,{baseOptions:{modelAssetBuffer:t}})},$.createFromOptions=function(e,t){return x($,e,t)},$.FACE_LANDMARKS_LIPS=ip,$.FACE_LANDMARKS_LEFT_EYE=op,$.FACE_LANDMARKS_LEFT_EYEBROW=np,$.FACE_LANDMARKS_LEFT_IRIS=O0,$.FACE_LANDMARKS_RIGHT_EYE=sp,$.FACE_LANDMARKS_RIGHT_EYEBROW=ap,$.FACE_LANDMARKS_RIGHT_IRIS=D0,$.FACE_LANDMARKS_FACE_OVAL=cp,$.FACE_LANDMARKS_CONTOURS=F0,$.FACE_LANDMARKS_TESSELATION=B0;var dt=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!0),_(e=this.j=new Ch,0,1,t=new X)}get baseOptions(){return R(this.j,X,1)}set baseOptions(e){_(this.j,0,1,e)}o(e){return super.l(e)}Ua(e,t,r){let i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,st(this,e,i??{}),!this.h)return this.u}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"stylized_image");let t=new We;rt(t,p0,this.j);let r=new Se;$e(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Xe(e,r),this.g.ba("stylized_image",(i,o)=>{var n=!this.h,s=i.data,a=i.width;let c=a*(i=i.height);if(s instanceof Uint8Array)if(s.length===3*c){let l=new Uint8ClampedArray(4*c);for(let u=0;u<c;++u)l[4*u]=s[3*u],l[4*u+1]=s[3*u+1],l[4*u+2]=s[3*u+2],l[4*u+3]=255;s=new ImageData(l,a,i)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,i)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new ce([s],!1,!1,this.g.i.canvas,this.M,a,i),this.u=n=n?a.clone():a,this.h&&this.h(n),S(this,o)}),this.g.attachEmptyPacketListener("stylized_image",i=>{this.u=null,this.h&&this.h(null),S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};dt.prototype.stylize=dt.prototype.Ua,dt.prototype.setOptions=dt.prototype.o,dt.createFromModelPath=function(e,t){return x(dt,e,{baseOptions:{modelAssetPath:t}})},dt.createFromModelBuffer=function(e,t){return x(dt,e,{baseOptions:{modelAssetBuffer:t}})},dt.createFromOptions=function(e,t){return x(dt,e,t)};var lp=ot([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 $u(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Xu(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 Ku(e,t=!0){let r=[];for(let o of e){var i=Ka(o);e=[];for(let n of i.g())i=t&&ze(n,1)!=null?mt(ze(n,1)):-1,e.push({score:he(n,2)??0,index:i,categoryName:He(n,3)??""??"",displayName:He(n,4)??""??""});r.push(e)}return r}var Oe=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_(e=this.v=new Uh,0,1,t=new X),this.B=new Za,_(this.v,0,2,this.B),this.u=new Bh,_(this.B,0,3,this.u),this.h=new Dh,_(this.B,0,2,this.h),this.j=new f0,_(this.v,0,3,this.j),A(this.h,2,.5),A(this.B,4,.5),A(this.u,2,.5)}get baseOptions(){return R(this.v,X,1)}set baseOptions(e){_(this.v,0,1,e)}o(e){if(gt(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&A(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.B,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&A(this.u,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new Rr,r=t,i=ua(e.cannedGesturesClassifierOptions,R(this.j,Rr,3)?.h());_(r,0,2,i),_(this.j,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&R(this.j,Rr,3)?.g();return e.customGesturesClassifierOptions?(_(r=t=new Rr,0,2,i=ua(e.customGesturesClassifierOptions,R(this.j,Rr,4)?.h())),_(this.j,0,4,t)):e.customGesturesClassifierOptions===void 0&&R(this.j,Rr,4)?.g(),this.l(e)}Pa(e,t){return $u(this),st(this,e,t),Xu(this)}Qa(e,t,r){return $u(this),Ft(this,e,r,t),Xu(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"hand_gestures"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(e,"handedness");let t=new We;rt(t,y0,this.v);let r=new Se;$e(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"HAND_GESTURES:hand_gestures"),D(r,"LANDMARKS:hand_landmarks"),D(r,"WORLD_LANDMARKS:world_hand_landmarks"),D(r,"HANDEDNESS:handedness"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,o)=>{for(let n of i){i=xn(n);let s=[];for(let a of Dt(i,ph,1))s.push({x:he(a,1)??0,y:he(a,2)??0,z:he(a,3)??0});this.landmarks.push(s)}S(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,o)=>{for(let n of i){i=Ja(n);let s=[];for(let a of Dt(i,dh,1))s.push({x:he(a,1)??0,y:he(a,2)??0,z:he(a,3)??0});this.worldLandmarks.push(s)}S(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,o)=>{this.gestures.push(...Ku(i,!1)),S(this,o)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{S(this,i)}),this.g.attachProtoVectorListener("handedness",(i,o)=>{this.handedness.push(...Ku(i)),S(this,o)}),this.g.attachEmptyPacketListener("handedness",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function Ju(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Oe.prototype.recognizeForVideo=Oe.prototype.Qa,Oe.prototype.recognize=Oe.prototype.Pa,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return x(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return x(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return x(Oe,e,t)},Oe.HAND_CONNECTIONS=lp;var De=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_(e=this.j=new Za,0,1,t=new X),this.u=new Bh,_(this.j,0,3,this.u),this.h=new Dh,_(this.j,0,2,this.h),gt(this.h,3,1),A(this.h,2,.5),A(this.u,2,.5),A(this.j,4,.5)}get baseOptions(){return R(this.j,X,1)}set baseOptions(e){_(this.j,0,1,e)}o(e){return"numHands"in e&>(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&A(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.j,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&A(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}G(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],st(this,e,t),Ju(this)}H(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ft(this,e,r,t),Ju(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(e,"handedness");let t=new We;rt(t,g0,this.j);let r=new Se;$e(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"LANDMARKS:hand_landmarks"),D(r,"WORLD_LANDMARKS:world_hand_landmarks"),D(r,"HANDEDNESS:handedness"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,o)=>{for(let n of i)i=xn(n),this.landmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,o)=>{for(let n of i)i=Ja(n),this.worldLandmarks.push(Kh(i));S(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("handedness",(i,o)=>{var n=this.handedness,s=n.push;let a=[];for(let c of i){i=Ka(c);let l=[];for(let u of i.g())l.push({score:he(u,2)??0,index:mt(ze(u,1))??-1,categoryName:He(u,3)??""??"",displayName:He(u,4)??""??""});a.push(l)}s.call(n,...a),S(this,o)}),this.g.attachEmptyPacketListener("handedness",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.detectForVideo=De.prototype.H,De.prototype.detect=De.prototype.G,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return x(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return x(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return x(De,e,t)},De.HAND_CONNECTIONS=lp;var je=class extends Me{constructor(e,t){super(new nt(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},_(e=this.h=new Nh,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return _(this.h,0,2,ua(e,R(this.h,Rn,2))),this.l(e)}ya(e,t){return this.j={classifications:[]},st(this,e,t),this.j}za(e,t,r){return this.j={classifications:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"input_image"),z(e,"norm_rect"),j(e,"classifications");let t=new We;rt(t,v0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),L(r,"IMAGE:input_image"),L(r,"NORM_RECT:norm_rect"),D(r,"CLASSIFICATIONS:classifications"),r.o(t),Xe(e,r),this.g.attachProtoListener("classifications",(i,o)=>{this.j=function(n){let s={classifications:Dt(n,t0,1).map(a=>$h(R(a,Xa,4)?.g()??[],mt(ze(a,2)),He(a,3)??""))};return un(Br(n,2))!=null&&(s.timestampMs=mt(un(Br(n,2)))),s}(i0(i)),S(this,o)}),this.g.attachEmptyPacketListener("classifications",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.classifyForVideo=je.prototype.za,je.prototype.classify=je.prototype.ya,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return x(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return x(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return x(je,e,t)};var Fe=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!0),this.h=new jh,this.embeddings={embeddings:[]},_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){var t=this.h,r=R(this.h,xu,2);return r=r?r.clone():new xu,e.l2Normalize!==void 0?Bi(r,1,e.l2Normalize):"l2Normalize"in e&&B(r,1),e.quantize!==void 0?Bi(r,2,e.quantize):"quantize"in e&&B(r,2),_(t,0,2,r),this.l(e)}Fa(e,t){return st(this,e,t),this.embeddings}Ga(e,t,r){return Ft(this,e,r,t),this.embeddings}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"embeddings_out");let t=new We;rt(t,b0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"EMBEDDINGS:embeddings_out"),r.o(t),Xe(e,r),this.g.attachProtoListener("embeddings_out",(i,o)=>{i=a0(i),this.embeddings=function(n){return{embeddings:Dt(n,n0,1).map(s=>{let a={headIndex:mt(ze(s,3))??-1,headName:He(s,4)??""??""};if(Bd(s,ca,Ws(s,1))!==void 0)s=Cr(s=R(s,ca,Ws(s,1)),1,Yt),a.floatEmbedding=s;else{let c=new Uint8Array(0);a.quantizedEmbedding=R(s,o0,Ws(s,2))?.ua()?.wa()??c}return a}),timestampMs:mt(un(Br(n,2)))}}(i),S(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Pu(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Pu(Cu(e.quantizedEmbedding),Cu(t.quantizedEmbedding))}return e},Fe.prototype.embedForVideo=Fe.prototype.Ga,Fe.prototype.embed=Fe.prototype.Fa,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return x(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return x(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return x(Fe,e,t)};var ma=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach(e=>{e.close()}),this.categoryMask?.close()}};function Yu(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function Zu(e){try{let t=new ma(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{ic(e)}}ma.prototype.close=ma.prototype.close;var _e=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Qa,this.v=new Vh,_(this.h,0,3,this.v),_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?B(this.h,2,Gi(e.displayNamesLocale)):"displayNamesLocale"in e&&B(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}N(){(function(e){let t=Dt(e.da(),Se,1).filter(r=>(He(r,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&&(R(t[0],We,7)?.l()?.g()??new Map).forEach((r,i)=>{e.u[Number(i)]=He(r,1)??""})})(this)}ea(e,t,r){let i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,Yu(this),st(this,e,i),Zu(this)}Sa(e,t,r,i){let o=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:i,Yu(this),Ft(this,e,o,t),Zu(this)}Ja(){return this.u}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect");let t=new We;rt(t,Gh,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),r.o(t),Xe(e,r),rc(this,e),this.outputConfidenceMasks&&(j(e,"confidence_masks"),D(r,"CONFIDENCE_MASKS:confidence_masks"),Mi(this,"confidence_masks"),this.g.ca("confidence_masks",(i,o)=>{this.confidenceMasks=i.map(n=>Ui(this,n,!0,!this.j)),S(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],S(this,i)})),this.outputCategoryMask&&(j(e,"category_mask"),D(r,"CATEGORY_MASK:category_mask"),Mi(this,"category_mask"),this.g.ba("category_mask",(i,o)=>{this.categoryMask=Ui(this,i,!1,!this.j),S(this,o)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,S(this,i)})),j(e,"quality_scores"),D(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,o)=>{this.qualityScores=i,S(this,o)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Ja,_e.prototype.segmentForVideo=_e.prototype.Sa,_e.prototype.segment=_e.prototype.ea,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return x(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return x(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return x(_e,e,t)};var ga=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach(e=>{e.close()}),this.categoryMask?.close()}};ga.prototype.close=ga.prototype.close;var M0=class extends v{constructor(e){super(e)}},Nr=[0,K,-2],L0=[0,Ot,-3,ee],In=[0,Ot,-3,ee,Ot,-1],up=[0,In],U0=[0,up,Nr],N0=[0,In,Nr],dp=[0,In,K,-1],j0=[0,dp,Nr],V0=[0,Ot,-3,ee,Nr,-1],z0=[0,Ot,-3,ee,yt],Ks=class extends v{constructor(e){super(e)}},Qu=[0,Ot,-1,ee],hp=class extends v{constructor(){super()}};hp.A=[1];var ed=class extends v{constructor(e){super(e)}},ya=[1,2,3,4,5,6,7,8,9,10,14,15],G0=[0,ya,N,In,N,N0,N,up,N,U0,N,Qu,N,z0,N,L0,N,[0,U,Ot,-2,ee,K,ee,-1,2,Ot,Nr],N,dp,N,j0,Ot,Nr,U,N,V0,N,[0,oe,Qu]],H0=[0,U,K,-1,ee],va=class extends v{constructor(){super()}};va.A=[1],va.prototype.g=$a([0,oe,G0,U,H0]);var ht=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Qa,this.v=new Vh,_(this.h,0,3,this.v),_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(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)}ea(e,t,r,i){let o=typeof r!="function"?r:{};this.j=typeof r=="function"?r:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.I+1,i=new va;let n=new ed;var s=new M0;if(gt(s,1,255),_(n,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Ks;Bi(a,3,!0),A(a,1,t.keypoint.x),A(a,2,t.keypoint.y),Ci(n,5,ya,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new hp,t.scribble))Bi(t=new Ks,3,!0),A(t,1,a.x),A(t,2,a.y),sa(s,Ks,t);Ci(n,15,ya,s)}sa(i,ed,n),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",r),st(this,e,o);e:{try{let l=new ga(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{ic(this)}c=void 0}return c}m(){var e=new Re;z(e,"image_in"),z(e,"roi_in"),z(e,"norm_rect_in");let t=new We;rt(t,Gh,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),L(r,"IMAGE:image_in"),L(r,"ROI:roi_in"),L(r,"NORM_RECT:norm_rect_in"),r.o(t),Xe(e,r),rc(this,e),this.outputConfidenceMasks&&(j(e,"confidence_masks"),D(r,"CONFIDENCE_MASKS:confidence_masks"),Mi(this,"confidence_masks"),this.g.ca("confidence_masks",(i,o)=>{this.confidenceMasks=i.map(n=>Ui(this,n,!0,!this.j)),S(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],S(this,i)})),this.outputCategoryMask&&(j(e,"category_mask"),D(r,"CATEGORY_MASK:category_mask"),Mi(this,"category_mask"),this.g.ba("category_mask",(i,o)=>{this.categoryMask=Ui(this,i,!1,!this.j),S(this,o)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,S(this,i)})),j(e,"quality_scores"),D(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,o)=>{this.qualityScores=i,S(this,o)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ht.prototype.segment=ht.prototype.ea,ht.prototype.setOptions=ht.prototype.o,ht.createFromModelPath=function(e,t){return x(ht,e,{baseOptions:{modelAssetPath:t}})},ht.createFromModelBuffer=function(e,t){return x(ht,e,{baseOptions:{modelAssetBuffer:t}})},ht.createFromOptions=function(e,t){return x(ht,e,t)};var Ae=class extends Me{constructor(e,t){super(new nt(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},_(e=this.h=new ec,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?B(this.h,2,Gi(e.displayNamesLocale)):"displayNamesLocale"in e&&B(this.h,2),e.maxResults!==void 0?gt(this.h,3,e.maxResults):"maxResults"in e&&B(this.h,3),e.scoreThreshold!==void 0?A(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&B(this.h,4),e.categoryAllowlist!==void 0?pn(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&B(this.h,5),e.categoryDenylist!==void 0?pn(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&B(this.h,6),this.l(e)}G(e,t){return this.j={detections:[]},st(this,e,t),this.j}H(e,t,r){return this.j={detections:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"input_frame_gpu"),z(e,"norm_rect"),j(e,"detections");let t=new We;rt(t,S0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),L(r,"IMAGE:input_frame_gpu"),L(r,"NORM_RECT:norm_rect"),D(r,"DETECTIONS:detections"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("detections",(i,o)=>{for(let n of i)i=uh(n),this.j.detections.push(Xh(i));S(this,o)}),this.g.attachEmptyPacketListener("detections",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ae.prototype.detectForVideo=Ae.prototype.H,Ae.prototype.detect=Ae.prototype.G,Ae.prototype.setOptions=Ae.prototype.o,Ae.createFromModelPath=async function(e,t){return x(Ae,e,{baseOptions:{modelAssetPath:t}})},Ae.createFromModelBuffer=function(e,t){return x(Ae,e,{baseOptions:{modelAssetBuffer:t}})},Ae.createFromOptions=function(e,t){return x(Ae,e,t)};function td(e){e.landmarks=[],e.worldLandmarks=[],e.v=void 0}function rd(e){try{let t=new class{constructor(r,i,o){this.landmarks=r,this.worldLandmarks=i,this.g=o}close(){this.g?.forEach(r=>{r.close()})}}(e.landmarks,e.worldLandmarks,e.v);if(!e.u)return t;e.u(t)}finally{ic(e)}}var Be=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,_(e=this.h=new qh,0,1,t=new X),this.B=new _0,_(this.h,0,3,this.B),this.j=new E0,_(this.h,0,2,this.j),gt(this.j,4,1),A(this.j,2,.5),A(this.B,2,.5),A(this.h,4,.5)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"numPoses"in e&>(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&A(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&A(this.B,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}G(e,t,r){let i=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,td(this),st(this,e,i),rd(this)}H(e,t,r,i){let o=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:i,td(this),Ft(this,e,o,t),rd(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"normalized_landmarks"),j(e,"world_landmarks"),j(e,"segmentation_masks");let t=new We;rt(t,A0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"NORM_LANDMARKS:normalized_landmarks"),D(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Xe(e,r),rc(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,o)=>{this.landmarks=[];for(let n of i)i=xn(n),this.landmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],S(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,o)=>{this.worldLandmarks=[];for(let n of i)i=Ja(n),this.worldLandmarks.push(Kh(i));S(this,o)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],S(this,i)}),this.outputSegmentationMasks&&(D(r,"SEGMENTATION_MASK:segmentation_masks"),Mi(this,"segmentation_masks"),this.g.ca("segmentation_masks",(i,o)=>{this.v=i.map(n=>Ui(this,n,!0,!this.u)),S(this,o)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.v=[],S(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Be.prototype.detectForVideo=Be.prototype.H,Be.prototype.detect=Be.prototype.G,Be.prototype.setOptions=Be.prototype.o,Be.createFromModelPath=function(e,t){return x(Be,e,{baseOptions:{modelAssetPath:t}})},Be.createFromModelBuffer=function(e,t){return x(Be,e,{baseOptions:{modelAssetBuffer:t}})},Be.createFromOptions=function(e,t){return x(Be,e,t)},Be.POSE_CONNECTIONS=ot([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]);var qr=class{constructor(t,r,i,o,n="videoPreviewFrameDetection",s="liveViewFrameDetection"){this.options={onRealtimeAlertsCallback:t=>{}};this.children=[];this.runningMode="VIDEO";this.detecting=!1;this.lastVideoTime=-1;this.lastExecutionDate=Date.now();this.detectorType=t,this.modelAssetPath=r,this.classVideo=n,this.classDiv=s,o&&(this.paramsConfig=o),i&&(this.options=i)}async initializeDetector(){let t=await Pr.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.2/wasm");this.detector=await(this.detectorType==="FaceDetector"?ke:Ae).createFromOptions(t,{baseOptions:{modelAssetPath:this.modelAssetPath,delegate:"CPU"},scoreThreshold:this.detectorType==="ObjectDetector"?.5:0,runningMode:this.runningMode})}stopDetection(){this.animationFrameId&&clearTimeout(this.animationFrameId),this.detecting=!1,this.liveView=document.getElementById(this.classDiv),this.liveView&&this.classDiv==="liveViewFrameDetection"&&document.body.removeChild(this.liveView)}enableCam(t){if(!this.detector){console.log("Wait! Detector not loaded yet.");return}this.detecting=!0,this.error=document.getElementById("errorFrameDetection"),this.video=document.getElementById(this.classVideo),this.liveView=document.getElementById(this.classDiv),t&&!this.video.srcObject&&(this.video.srcObject=t),this.video.play();let r=this;this.video?.addEventListener("loadeddata",()=>r.predictWebcam());let i=document.createElement("style");i.type="text/css",i.innerHTML=`
|
|
49
|
+
`}F(){let e=this.g;e.activeTexture(e.TEXTURE1),this.j=Jt(this,e),e.activeTexture(e.TEXTURE2),this.B=Jt(this,e)}m(){super.m();let e=this.g;this.T=be(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.U=be(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.J=be(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.J,0),e.uniform1i(this.T,1),e.uniform1i(this.U,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function It(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function pa(e){var t=It(e,1);if(!t){if(t=It(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);let i=Lr(e);var r=sc(e);if(Cn(r,i,Zh(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,r);for(let o=0,n=0;o<t.length;++o,n+=4)t[o]=r[n]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function Zh(e){let t=It(e,2);if(!t){let r=Lr(e);t=ep(e);let i=pa(e),o=Qh(e);r.texImage2D(r.TEXTURE_2D,0,o,e.width,e.height,0,r.RED,r.FLOAT,i),fa(e)}return t}function Lr(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=be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Qh(e){if(e=Lr(e),!Ko)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Ko=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Ko=e.R16F}return Ko}function sc(e){return e.l||(e.l=new Wr),e.l}function ep(e){let t=Lr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=It(e,2);return r||(r=Jt(sc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function fa(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Ko,ie=class{constructor(e,t,r,i,o,n,s){this.g=e,this.m=t,this.j=r,this.canvas=i,this.l=o,this.width=n,this.height=s,this.j&&--Uu===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}La(){return!!It(this,0)}ka(){return!!It(this,1)}P(){return!!It(this,2)}ja(){return(t=It(e=this,0))||(t=pa(e),t=new Uint8Array(t.map(r=>255*r)),e.g.push(t)),t;var e,t}ia(){return pa(this)}K(){return Zh(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{let i=Lr(this),o=sc(this);i.activeTexture(i.TEXTURE1),r=Jt(o,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);let n=Qh(this);i.texImage2D(i.TEXTURE_2D,0,n,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),Cn(o,i,r),qi(o,i,!1,()=>{ep(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),fa(this)}),nc(o),fa(this)}}e.push(r)}return new ie(e,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Lr(this).deleteTexture(It(this,2)),Uu=-1}};ie.prototype.close=ie.prototype.close,ie.prototype.clone=ie.prototype.clone,ie.prototype.getAsWebGLTexture=ie.prototype.K,ie.prototype.getAsFloat32Array=ie.prototype.ia,ie.prototype.getAsUint8Array=ie.prototype.ja,ie.prototype.hasWebGLTexture=ie.prototype.P,ie.prototype.hasFloat32Array=ie.prototype.ka,ie.prototype.hasUint8Array=ie.prototype.La;var Uu=250,P0={color:"white",lineWidth:4,radius:6};function Xs(e){return{...P0,fillColor:(e=e||{}).color,...e}}function Pt(e,t){return e instanceof Function?e(t):e}function Nu(e,t,r){return Math.max(Math.min(t,r),Math.min(Math.max(t,r),e))}function _i(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Li(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function ju(e,t,r){if(t.P())r(t.K());else{let i=t.ka()?t.ia():t.ja();e.m=e.m??new Wr;let o=Li(e);r((e=new ie([i],t.m,!1,o.canvas,e.m,t.width,t.height)).K()),e.close()}}function Vu(e,t,r,i){let o=function(a){return a.g||(a.g=new R0),a.g}(e),n=Li(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;qi(o,n,!0,()=>{(function(c,l,u,d){let f=c.g;if(f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,l),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,c.B),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,u),c.J&&function(g,h){if(g!==h)return!1;g=g.entries(),h=h.entries();for(let[y,b]of g){g=y;let k=b;var m=h.next();if(m.done)return!1;let[P,ae]=m.value;if(m=ae,g!==P||k[0]!==m[0]||k[1]!==m[1]||k[2]!==m[2]||k[3]!==m[3])return!1}return!!h.next().done}(c.J,d))f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j);else{c.J=d;let g=Array(1024).fill(0);d.forEach((h,m)=>{if(h.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);g[4*m]=h[0],g[4*m+1]=h[1],g[4*m+2]=h[2],g[4*m+3]=h[3]}),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,256,1,0,f.RGBA,f.UNSIGNED_BYTE,new Uint8Array(g))}})(o,t,s,i),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4);let a=o.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function zu(e,t,r,i){let o=Li(e),n=function(c){return c.h||(c.h=new C0),c.h}(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;qi(n,o,!0,()=>{var c=n.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,n.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,n.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4),o.bindTexture(o.TEXTURE_2D,null),(c=n.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var Ee=class{constructor(e,t){e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}Ea(e,t){if(e){var r=_i(this);t=Xs(t),r.save();var i=r.canvas,o=0;for(let n of e)r.fillStyle=Pt(t.fillColor,{index:o,from:n}),r.strokeStyle=Pt(t.color,{index:o,from:n}),r.lineWidth=Pt(t.lineWidth,{index:o,from:n}),(e=new Path2D).arc(n.x*i.width,n.y*i.height,Pt(t.radius,{index:o,from:n}),0,2*Math.PI),r.fill(e),r.stroke(e),++o;r.restore()}}Da(e,t,r){if(e&&t){var i=_i(this);r=Xs(r),i.save();var o=i.canvas,n=0;for(let s of t){i.beginPath(),t=e[s.start];let a=e[s.end];t&&a&&(i.strokeStyle=Pt(r.color,{index:n,from:t,to:a}),i.lineWidth=Pt(r.lineWidth,{index:n,from:t,to:a}),i.moveTo(t.x*o.width,t.y*o.height),i.lineTo(a.x*o.width,a.y*o.height)),++n,i.stroke()}i.restore()}}Aa(e,t){let r=_i(this);t=Xs(t),r.save(),r.beginPath(),r.lineWidth=Pt(t.lineWidth,{}),r.strokeStyle=Pt(t.color,{}),r.fillStyle=Pt(t.fillColor,{}),r.moveTo(e.originX,e.originY),r.lineTo(e.originX+e.width,e.originY),r.lineTo(e.originX+e.width,e.originY+e.height),r.lineTo(e.originX,e.originY+e.height),r.lineTo(e.originX,e.originY),r.stroke(),r.fill(),r.restore()}Ba(e,t,r=[0,0,0,255]){this.l?function(i,o,n,s){let a=Li(i);ju(i,o,c=>{Vu(i,c,n,s),(c=_i(i)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,r,t):Vu(this,e.K(),r,t)}Ca(e,t,r){this.l?function(i,o,n,s){let a=Li(i);ju(i,o,c=>{zu(i,c,n,s),(c=_i(i)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,r):zu(this,e.K(),t,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function pt(e,t){switch(t){case 0:return e.g.find(r=>r instanceof ImageData);case 1:return e.g.find(r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function tp(e){var t=pt(e,0);if(!t){t=Ur(e);let r=Pn(e),i=new Uint8Array(e.width*e.height*4);Cn(r,t,on(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),nc(r),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function on(e){let t=pt(e,2);if(!t){let r=Ur(e);t=nn(e);let i=pt(e,1)||tp(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i),Ai(e)}return t}function Ur(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=be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Pn(e){return e.l||(e.l=new Wr),e.l}function nn(e){let t=Ur(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=pt(e,2);return r||(r=Jt(Pn(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Ai(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function Gu(e){let t=Ur(e);return qi(Pn(e),t,!0,()=>function(r,i){let o=r.canvas;if(o.width===r.width&&o.height===r.height)return i();let n=o.width,s=o.height;return o.width=r.width,o.height=r.height,r=i(),o.width=n,o.height=s,r}(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()}))}Ee.prototype.close=Ee.prototype.close,Ee.prototype.drawConfidenceMask=Ee.prototype.Ca,Ee.prototype.drawCategoryMask=Ee.prototype.Ba,Ee.prototype.drawBoundingBox=Ee.prototype.Aa,Ee.prototype.drawConnectors=Ee.prototype.Da,Ee.prototype.drawLandmarks=Ee.prototype.Ea,Ee.lerp=function(e,t,r,i,o){return Nu(i*(1-(e-t)/(r-t))+o*(1-(r-e)/(r-t)),i,o)},Ee.clamp=Nu;var ce=class{constructor(e,t,r,i,o,n,s){this.g=e,this.j=t,this.m=r,this.canvas=i,this.l=o,this.width=n,this.height=s,(this.j||this.m)&&--Hu===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ka(){return!!pt(this,0)}la(){return!!pt(this,1)}P(){return!!pt(this,2)}Ia(){return tp(this)}Ha(){var e=pt(this,1);return e||(on(this),nn(this),e=Gu(this),Ai(this),this.g.push(e),this.j=!0),e}K(){return on(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){let i=Ur(this),o=Pn(this);i.activeTexture(i.TEXTURE1),r=Jt(o,i),i.bindTexture(i.TEXTURE_2D,r),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),Cn(o,i,r),qi(o,i,!1,()=>{nn(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Ai(this)}),nc(o),Ai(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);on(this),nn(this),r=Gu(this),Ai(this)}e.push(r)}return new ce(e,this.la(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pt(this,1).close(),this.m&&Ur(this).deleteTexture(pt(this,2)),Hu=-1}};ce.prototype.close=ce.prototype.close,ce.prototype.clone=ce.prototype.clone,ce.prototype.getAsWebGLTexture=ce.prototype.K,ce.prototype.getAsImageBitmap=ce.prototype.Ha,ce.prototype.getAsImageData=ce.prototype.Ia,ce.prototype.hasWebGLTexture=ce.prototype.P,ce.prototype.hasImageBitmap=ce.prototype.la,ce.prototype.hasImageData=ce.prototype.Ka;var Hu=250;function ot(...e){return e.map(([t,r])=>({start:t,end:r}))}var I0=function(e){return class extends e{Ra(){this.i._registerModelResourcesGraphService()}}}((Wu=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:typeof OffscreenCanvas>"u"||Yh()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(e){let 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){let r=e.length,i=this.i._malloc(r);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(r,i):this.i._changeTextGraph(r,i),this.i._free(i)}configureAudio(e,t,r,i,o){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),w(this,i||"input_audio",n=>{w(this,o=o||"audio_header",s=>{this.i._configureAudio(n,s,e,t,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}da(e){Ct(this,"__graph_config__",t=>{e(t)}),w(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,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,o){let n=4*e.length;this.h!==n&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(n),this.h=n),this.i.HEAPF32.set(e,this.g/4),w(this,i,s=>{this.i._addAudioToInputStream(this.g,t,r,s,o)})}addGpuBufferToStream(e,t,r){w(this,t,i=>{let[o,n]=Ou(this,e,i);this.i._addBoundTextureToStream(i,o,n,r)})}addBoolToStream(e,t,r){w(this,t,i=>{this.i._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){w(this,t,i=>{this.i._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){w(this,t,i=>{this.i._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){w(this,t,i=>{this.i._addIntToInputStream(e,i,r)})}addStringToStream(e,t,r){w(this,t,i=>{w(this,e,o=>{this.i._addStringToInputStream(o,i,r)})})}addStringRecordToStream(e,t,r){w(this,t,i=>{Du(this,Object.keys(e),o=>{Du(this,Object.values(e),n=>{this.i._addFlatHashMapToInputStream(o,n,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){w(this,r,o=>{w(this,t,n=>{let s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,n,o,i),this.i._free(s)})})}addEmptyPacketToStream(e,t){w(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(let n of e)this.i._addBoolVectorEntry(o,n);this.i._addBoolVectorToInputStream(o,i,r)})}addDoubleVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(let n of e)this.i._addDoubleVectorEntry(o,n);this.i._addDoubleVectorToInputStream(o,i,r)})}addFloatVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(let n of e)this.i._addFloatVectorEntry(o,n);this.i._addFloatVectorToInputStream(o,i,r)})}addIntVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(let n of e)this.i._addIntVectorEntry(o,n);this.i._addIntVectorToInputStream(o,i,r)})}addStringVectorToStream(e,t,r){w(this,t,i=>{let o=this.i._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(let n of e)w(this,n,s=>{this.i._addStringVectorEntry(o,s)});this.i._addStringVectorToInputStream(o,i,r)})}addBoolToInputSidePacket(e,t){w(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){w(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){w(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){w(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){w(this,t,r=>{w(this,e,i=>{this.i._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){w(this,r,i=>{w(this,t,o=>{let n=this.i._malloc(e.length);this.i.HEAPU8.set(e,n),this.i._addProtoToInputSidePacket(n,e.length,o,i),this.i._free(n)})})}addBoolVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.i._addBoolVectorEntry(i,o);this.i._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.i._addDoubleVectorEntry(i,o);this.i._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.i._addFloatVectorEntry(i,o);this.i._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.i._addIntVectorEntry(i,o);this.i._addIntVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){w(this,t,r=>{let i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)w(this,o,n=>{this.i._addStringVectorEntry(i,n)});this.i._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachIntVectorListener(r)})}attachDoubleListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){Ct(this,e,t),w(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){lr(this,e,t),w(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){Ct(this,e,t),w(this,e,i=>{this.i._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){lr(this,e,t),w(this,e,i=>{this.i._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ct(this,e,(i,o)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,o)}),w(this,e,i=>{this.i._attachAudioListener(i,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Wu{get fa(){return this.i}va(e,t,r){w(this,t,i=>{let[o,n]=Ou(this,e,i);this.fa._addBoundTextureAsImageToStream(i,o,n,r)})}ba(e,t){Ct(this,e,t),w(this,e,r=>{this.fa._attachImageListener(r)})}ca(e,t){lr(this,e,t),w(this,e,r=>{this.fa._attachImageVectorListener(r)})}})),Wu,nt=class extends I0{};async function T(e,t,r){return async function(i,o,n,s){return T0(i,o,n,s)}(e,r.canvas??(typeof OffscreenCanvas>"u"||Yh()?document.createElement("canvas"):void 0),t,r)}function rp(e,t,r,i){if(e.J){let n=new gh;if(r?.regionOfInterest){if(!e.U)throw Error("This task doesn't support region-of-interest.");var o=r.regionOfInterest;if(o.left>=o.right||o.top>=o.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>o.left||0>o.top||1<o.right||1<o.bottom)throw Error("Expected RectF values to be in [0,1].");A(n,1,(o.left+o.right)/2),A(n,2,(o.top+o.bottom)/2),A(n,4,o.right-o.left),A(n,3,o.bottom-o.top)}else A(n,1,.5),A(n,2,.5),A(n,4,1),A(n,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(A(n,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[s,a]=t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:[t.width,t.height];r=he(n,3)*a/s,o=he(n,4)*s/a,A(n,4,r),A(n,3,o)}}e.g.addProtoToStream(n.g(),"mediapipe.NormalizedRect",e.J,i)}e.g.va(t,e.T,i??performance.now()),e.finishProcessing()}function st(e,t,r){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");rp(e,t,r,e.I+1)}function Ft(e,t,r,i){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");rp(e,t,r,i)}function Ui(e,t,r,i){var o=t.data;let n=t.width,s=n*(t=t.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==s)throw Error("Unsupported channel count: "+o.length/s);return e=new ie([o],r,!1,e.g.i.canvas,e.M,n,t),i?e.clone():e}var Me=class extends da{constructor(e,t,r,i){super(e),this.g=e,this.T=t,this.J=r,this.U=i,this.M=new Wr}l(e,t=!0){if("runningMode"in e&&Bi(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()}};Me.prototype.close=Me.prototype.close;var ke=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},_(e=this.h=new Ya,0,1,t=new X),A(this.h,2,.5),A(this.h,3,.3)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&A(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&A(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}G(e,t){return this.j={detections:[]},st(this,e,t),this.j}H(e,t,r){return this.j={detections:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect_in"),j(e,"detections");let t=new We;rt(t,l0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect_in"),D(r,"DETECTIONS:detections"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("detections",(i,o)=>{for(let n of i)i=uh(n),this.j.detections.push(Xh(i));S(this,o)}),this.g.attachEmptyPacketListener("detections",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ke.prototype.detectForVideo=ke.prototype.H,ke.prototype.detect=ke.prototype.G,ke.prototype.setOptions=ke.prototype.o,ke.createFromModelPath=async function(e,t){return T(ke,e,{baseOptions:{modelAssetPath:t}})},ke.createFromModelBuffer=function(e,t){return T(ke,e,{baseOptions:{modelAssetBuffer:t}})},ke.createFromOptions=function(e,t){return T(ke,e,t)};var ip=ot([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]),op=ot([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]),np=ot([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),O0=ot([474,475],[475,476],[476,477],[477,474]),sp=ot([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]),ap=ot([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),D0=ot([469,470],[470,471],[471,472],[472,469]),cp=ot([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[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]),F0=[...ip,...op,...np,...sp,...ap,...cp],B0=ot([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]);function qu(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var $=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,_(e=this.h=new Th,0,1,t=new X),this.v=new d0,_(this.h,0,3,this.v),this.u=new Ya,_(this.h,0,2,this.u),gt(this.u,4,1),A(this.u,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"numFaces"in e&>(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&A(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&A(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}G(e,t){return qu(this),st(this,e,t),this.j}H(e,t,r){return qu(this),Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"face_landmarks");let t=new We;rt(t,h0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("face_landmarks",(i,o)=>{for(let n of i)i=Tn(n),this.j.faceLandmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{S(this,i)}),this.outputFaceBlendshapes&&(j(e,"blendshapes"),D(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,o)=>{if(this.outputFaceBlendshapes)for(let n of i)i=Ka(n),this.j.faceBlendshapes.push($h(i.g()??[]));S(this,o)}),this.g.attachEmptyPacketListener("blendshapes",i=>{S(this,i)})),this.outputFacialTransformationMatrixes&&(j(e,"face_geometry"),D(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,o)=>{if(this.outputFacialTransformationMatrixes)for(let n of i)(i=R(u0(n),mh,2))&&this.j.facialTransformationMatrixes.push({rows:mt(ze(i,1))??0,columns:mt(ze(i,2))??0,data:Cr(i,3,Yt)??[]});S(this,o)}),this.g.attachEmptyPacketListener("face_geometry",i=>{S(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};$.prototype.detectForVideo=$.prototype.H,$.prototype.detect=$.prototype.G,$.prototype.setOptions=$.prototype.o,$.createFromModelPath=function(e,t){return T($,e,{baseOptions:{modelAssetPath:t}})},$.createFromModelBuffer=function(e,t){return T($,e,{baseOptions:{modelAssetBuffer:t}})},$.createFromOptions=function(e,t){return T($,e,t)},$.FACE_LANDMARKS_LIPS=ip,$.FACE_LANDMARKS_LEFT_EYE=op,$.FACE_LANDMARKS_LEFT_EYEBROW=np,$.FACE_LANDMARKS_LEFT_IRIS=O0,$.FACE_LANDMARKS_RIGHT_EYE=sp,$.FACE_LANDMARKS_RIGHT_EYEBROW=ap,$.FACE_LANDMARKS_RIGHT_IRIS=D0,$.FACE_LANDMARKS_FACE_OVAL=cp,$.FACE_LANDMARKS_CONTOURS=F0,$.FACE_LANDMARKS_TESSELATION=B0;var dt=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!0),_(e=this.j=new Ch,0,1,t=new X)}get baseOptions(){return R(this.j,X,1)}set baseOptions(e){_(this.j,0,1,e)}o(e){return super.l(e)}Ua(e,t,r){let i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,st(this,e,i??{}),!this.h)return this.u}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"stylized_image");let t=new We;rt(t,p0,this.j);let r=new Se;$e(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Xe(e,r),this.g.ba("stylized_image",(i,o)=>{var n=!this.h,s=i.data,a=i.width;let c=a*(i=i.height);if(s instanceof Uint8Array)if(s.length===3*c){let l=new Uint8ClampedArray(4*c);for(let u=0;u<c;++u)l[4*u]=s[3*u],l[4*u+1]=s[3*u+1],l[4*u+2]=s[3*u+2],l[4*u+3]=255;s=new ImageData(l,a,i)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,i)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new ce([s],!1,!1,this.g.i.canvas,this.M,a,i),this.u=n=n?a.clone():a,this.h&&this.h(n),S(this,o)}),this.g.attachEmptyPacketListener("stylized_image",i=>{this.u=null,this.h&&this.h(null),S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};dt.prototype.stylize=dt.prototype.Ua,dt.prototype.setOptions=dt.prototype.o,dt.createFromModelPath=function(e,t){return T(dt,e,{baseOptions:{modelAssetPath:t}})},dt.createFromModelBuffer=function(e,t){return T(dt,e,{baseOptions:{modelAssetBuffer:t}})},dt.createFromOptions=function(e,t){return T(dt,e,t)};var lp=ot([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 $u(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Xu(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 Ku(e,t=!0){let r=[];for(let o of e){var i=Ka(o);e=[];for(let n of i.g())i=t&&ze(n,1)!=null?mt(ze(n,1)):-1,e.push({score:he(n,2)??0,index:i,categoryName:He(n,3)??""??"",displayName:He(n,4)??""??""});r.push(e)}return r}var Oe=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_(e=this.v=new Uh,0,1,t=new X),this.B=new Za,_(this.v,0,2,this.B),this.u=new Bh,_(this.B,0,3,this.u),this.h=new Dh,_(this.B,0,2,this.h),this.j=new f0,_(this.v,0,3,this.j),A(this.h,2,.5),A(this.B,4,.5),A(this.u,2,.5)}get baseOptions(){return R(this.v,X,1)}set baseOptions(e){_(this.v,0,1,e)}o(e){if(gt(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&A(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.B,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&A(this.u,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new Rr,r=t,i=ua(e.cannedGesturesClassifierOptions,R(this.j,Rr,3)?.h());_(r,0,2,i),_(this.j,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&R(this.j,Rr,3)?.g();return e.customGesturesClassifierOptions?(_(r=t=new Rr,0,2,i=ua(e.customGesturesClassifierOptions,R(this.j,Rr,4)?.h())),_(this.j,0,4,t)):e.customGesturesClassifierOptions===void 0&&R(this.j,Rr,4)?.g(),this.l(e)}Pa(e,t){return $u(this),st(this,e,t),Xu(this)}Qa(e,t,r){return $u(this),Ft(this,e,r,t),Xu(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"hand_gestures"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(e,"handedness");let t=new We;rt(t,y0,this.v);let r=new Se;$e(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"HAND_GESTURES:hand_gestures"),D(r,"LANDMARKS:hand_landmarks"),D(r,"WORLD_LANDMARKS:world_hand_landmarks"),D(r,"HANDEDNESS:handedness"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,o)=>{for(let n of i){i=Tn(n);let s=[];for(let a of Dt(i,ph,1))s.push({x:he(a,1)??0,y:he(a,2)??0,z:he(a,3)??0});this.landmarks.push(s)}S(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,o)=>{for(let n of i){i=Ja(n);let s=[];for(let a of Dt(i,dh,1))s.push({x:he(a,1)??0,y:he(a,2)??0,z:he(a,3)??0});this.worldLandmarks.push(s)}S(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,o)=>{this.gestures.push(...Ku(i,!1)),S(this,o)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{S(this,i)}),this.g.attachProtoVectorListener("handedness",(i,o)=>{this.handedness.push(...Ku(i)),S(this,o)}),this.g.attachEmptyPacketListener("handedness",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function Ju(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Oe.prototype.recognizeForVideo=Oe.prototype.Qa,Oe.prototype.recognize=Oe.prototype.Pa,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return T(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return T(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return T(Oe,e,t)},Oe.HAND_CONNECTIONS=lp;var De=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_(e=this.j=new Za,0,1,t=new X),this.u=new Bh,_(this.j,0,3,this.u),this.h=new Dh,_(this.j,0,2,this.h),gt(this.h,3,1),A(this.h,2,.5),A(this.u,2,.5),A(this.j,4,.5)}get baseOptions(){return R(this.j,X,1)}set baseOptions(e){_(this.j,0,1,e)}o(e){return"numHands"in e&>(this.h,3,e.numHands??1),"minHandDetectionConfidence"in e&&A(this.h,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.j,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&A(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}G(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],st(this,e,t),Ju(this)}H(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ft(this,e,r,t),Ju(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(e,"handedness");let t=new We;rt(t,g0,this.j);let r=new Se;$e(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"LANDMARKS:hand_landmarks"),D(r,"WORLD_LANDMARKS:world_hand_landmarks"),D(r,"HANDEDNESS:handedness"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,o)=>{for(let n of i)i=Tn(n),this.landmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,o)=>{for(let n of i)i=Ja(n),this.worldLandmarks.push(Kh(i));S(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{S(this,i)}),this.g.attachProtoVectorListener("handedness",(i,o)=>{var n=this.handedness,s=n.push;let a=[];for(let c of i){i=Ka(c);let l=[];for(let u of i.g())l.push({score:he(u,2)??0,index:mt(ze(u,1))??-1,categoryName:He(u,3)??""??"",displayName:He(u,4)??""??""});a.push(l)}s.call(n,...a),S(this,o)}),this.g.attachEmptyPacketListener("handedness",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.detectForVideo=De.prototype.H,De.prototype.detect=De.prototype.G,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return T(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return T(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return T(De,e,t)},De.HAND_CONNECTIONS=lp;var je=class extends Me{constructor(e,t){super(new nt(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},_(e=this.h=new Nh,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return _(this.h,0,2,ua(e,R(this.h,Rn,2))),this.l(e)}ya(e,t){return this.j={classifications:[]},st(this,e,t),this.j}za(e,t,r){return this.j={classifications:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"input_image"),z(e,"norm_rect"),j(e,"classifications");let t=new We;rt(t,v0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),L(r,"IMAGE:input_image"),L(r,"NORM_RECT:norm_rect"),D(r,"CLASSIFICATIONS:classifications"),r.o(t),Xe(e,r),this.g.attachProtoListener("classifications",(i,o)=>{this.j=function(n){let s={classifications:Dt(n,t0,1).map(a=>$h(R(a,Xa,4)?.g()??[],mt(ze(a,2)),He(a,3)??""))};return un(Br(n,2))!=null&&(s.timestampMs=mt(un(Br(n,2)))),s}(i0(i)),S(this,o)}),this.g.attachEmptyPacketListener("classifications",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.classifyForVideo=je.prototype.za,je.prototype.classify=je.prototype.ya,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return T(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return T(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return T(je,e,t)};var Fe=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!0),this.h=new jh,this.embeddings={embeddings:[]},_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){var t=this.h,r=R(this.h,Tu,2);return r=r?r.clone():new Tu,e.l2Normalize!==void 0?Bi(r,1,e.l2Normalize):"l2Normalize"in e&&B(r,1),e.quantize!==void 0?Bi(r,2,e.quantize):"quantize"in e&&B(r,2),_(t,0,2,r),this.l(e)}Fa(e,t){return st(this,e,t),this.embeddings}Ga(e,t,r){return Ft(this,e,r,t),this.embeddings}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"embeddings_out");let t=new We;rt(t,b0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"EMBEDDINGS:embeddings_out"),r.o(t),Xe(e,r),this.g.attachProtoListener("embeddings_out",(i,o)=>{i=a0(i),this.embeddings=function(n){return{embeddings:Dt(n,n0,1).map(s=>{let a={headIndex:mt(ze(s,3))??-1,headName:He(s,4)??""??""};if(Bd(s,ca,Ws(s,1))!==void 0)s=Cr(s=R(s,ca,Ws(s,1)),1,Yt),a.floatEmbedding=s;else{let c=new Uint8Array(0);a.quantizedEmbedding=R(s,o0,Ws(s,2))?.ua()?.wa()??c}return a}),timestampMs:mt(un(Br(n,2)))}}(i),S(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Pu(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Pu(Cu(e.quantizedEmbedding),Cu(t.quantizedEmbedding))}return e},Fe.prototype.embedForVideo=Fe.prototype.Ga,Fe.prototype.embed=Fe.prototype.Fa,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return T(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return T(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return T(Fe,e,t)};var ma=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach(e=>{e.close()}),this.categoryMask?.close()}};function Yu(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function Zu(e){try{let t=new ma(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{ic(e)}}ma.prototype.close=ma.prototype.close;var _e=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Qa,this.v=new Vh,_(this.h,0,3,this.v),_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?B(this.h,2,Gi(e.displayNamesLocale)):"displayNamesLocale"in e&&B(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}N(){(function(e){let t=Dt(e.da(),Se,1).filter(r=>(He(r,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&&(R(t[0],We,7)?.l()?.g()??new Map).forEach((r,i)=>{e.u[Number(i)]=He(r,1)??""})})(this)}ea(e,t,r){let i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,Yu(this),st(this,e,i),Zu(this)}Sa(e,t,r,i){let o=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:i,Yu(this),Ft(this,e,o,t),Zu(this)}Ja(){return this.u}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect");let t=new We;rt(t,Gh,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),r.o(t),Xe(e,r),rc(this,e),this.outputConfidenceMasks&&(j(e,"confidence_masks"),D(r,"CONFIDENCE_MASKS:confidence_masks"),Mi(this,"confidence_masks"),this.g.ca("confidence_masks",(i,o)=>{this.confidenceMasks=i.map(n=>Ui(this,n,!0,!this.j)),S(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],S(this,i)})),this.outputCategoryMask&&(j(e,"category_mask"),D(r,"CATEGORY_MASK:category_mask"),Mi(this,"category_mask"),this.g.ba("category_mask",(i,o)=>{this.categoryMask=Ui(this,i,!1,!this.j),S(this,o)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,S(this,i)})),j(e,"quality_scores"),D(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,o)=>{this.qualityScores=i,S(this,o)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Ja,_e.prototype.segmentForVideo=_e.prototype.Sa,_e.prototype.segment=_e.prototype.ea,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return T(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return T(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return T(_e,e,t)};var ga=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach(e=>{e.close()}),this.categoryMask?.close()}};ga.prototype.close=ga.prototype.close;var M0=class extends v{constructor(e){super(e)}},Nr=[0,K,-2],L0=[0,Ot,-3,ee],In=[0,Ot,-3,ee,Ot,-1],up=[0,In],U0=[0,up,Nr],N0=[0,In,Nr],dp=[0,In,K,-1],j0=[0,dp,Nr],V0=[0,Ot,-3,ee,Nr,-1],z0=[0,Ot,-3,ee,yt],Ks=class extends v{constructor(e){super(e)}},Qu=[0,Ot,-1,ee],hp=class extends v{constructor(){super()}};hp.A=[1];var ed=class extends v{constructor(e){super(e)}},ya=[1,2,3,4,5,6,7,8,9,10,14,15],G0=[0,ya,N,In,N,N0,N,up,N,U0,N,Qu,N,z0,N,L0,N,[0,U,Ot,-2,ee,K,ee,-1,2,Ot,Nr],N,dp,N,j0,Ot,Nr,U,N,V0,N,[0,oe,Qu]],H0=[0,U,K,-1,ee],va=class extends v{constructor(){super()}};va.A=[1],va.prototype.g=$a([0,oe,G0,U,H0]);var ht=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Qa,this.v=new Vh,_(this.h,0,3,this.v),_(e=this.h,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(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)}ea(e,t,r,i){let o=typeof r!="function"?r:{};this.j=typeof r=="function"?r:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.I+1,i=new va;let n=new ed;var s=new M0;if(gt(s,1,255),_(n,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Ks;Bi(a,3,!0),A(a,1,t.keypoint.x),A(a,2,t.keypoint.y),Ci(n,5,ya,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new hp,t.scribble))Bi(t=new Ks,3,!0),A(t,1,a.x),A(t,2,a.y),sa(s,Ks,t);Ci(n,15,ya,s)}sa(i,ed,n),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",r),st(this,e,o);e:{try{let l=new ga(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{ic(this)}c=void 0}return c}m(){var e=new Re;z(e,"image_in"),z(e,"roi_in"),z(e,"norm_rect_in");let t=new We;rt(t,Gh,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),L(r,"IMAGE:image_in"),L(r,"ROI:roi_in"),L(r,"NORM_RECT:norm_rect_in"),r.o(t),Xe(e,r),rc(this,e),this.outputConfidenceMasks&&(j(e,"confidence_masks"),D(r,"CONFIDENCE_MASKS:confidence_masks"),Mi(this,"confidence_masks"),this.g.ca("confidence_masks",(i,o)=>{this.confidenceMasks=i.map(n=>Ui(this,n,!0,!this.j)),S(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],S(this,i)})),this.outputCategoryMask&&(j(e,"category_mask"),D(r,"CATEGORY_MASK:category_mask"),Mi(this,"category_mask"),this.g.ba("category_mask",(i,o)=>{this.categoryMask=Ui(this,i,!1,!this.j),S(this,o)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,S(this,i)})),j(e,"quality_scores"),D(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,o)=>{this.qualityScores=i,S(this,o)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ht.prototype.segment=ht.prototype.ea,ht.prototype.setOptions=ht.prototype.o,ht.createFromModelPath=function(e,t){return T(ht,e,{baseOptions:{modelAssetPath:t}})},ht.createFromModelBuffer=function(e,t){return T(ht,e,{baseOptions:{modelAssetBuffer:t}})},ht.createFromOptions=function(e,t){return T(ht,e,t)};var Ae=class extends Me{constructor(e,t){super(new nt(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},_(e=this.h=new ec,0,1,t=new X)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?B(this.h,2,Gi(e.displayNamesLocale)):"displayNamesLocale"in e&&B(this.h,2),e.maxResults!==void 0?gt(this.h,3,e.maxResults):"maxResults"in e&&B(this.h,3),e.scoreThreshold!==void 0?A(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&B(this.h,4),e.categoryAllowlist!==void 0?pn(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&B(this.h,5),e.categoryDenylist!==void 0?pn(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&B(this.h,6),this.l(e)}G(e,t){return this.j={detections:[]},st(this,e,t),this.j}H(e,t,r){return this.j={detections:[]},Ft(this,e,r,t),this.j}m(){var e=new Re;z(e,"input_frame_gpu"),z(e,"norm_rect"),j(e,"detections");let t=new We;rt(t,S0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),L(r,"IMAGE:input_frame_gpu"),L(r,"NORM_RECT:norm_rect"),D(r,"DETECTIONS:detections"),r.o(t),Xe(e,r),this.g.attachProtoVectorListener("detections",(i,o)=>{for(let n of i)i=uh(n),this.j.detections.push(Xh(i));S(this,o)}),this.g.attachEmptyPacketListener("detections",i=>{S(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ae.prototype.detectForVideo=Ae.prototype.H,Ae.prototype.detect=Ae.prototype.G,Ae.prototype.setOptions=Ae.prototype.o,Ae.createFromModelPath=async function(e,t){return T(Ae,e,{baseOptions:{modelAssetPath:t}})},Ae.createFromModelBuffer=function(e,t){return T(Ae,e,{baseOptions:{modelAssetBuffer:t}})},Ae.createFromOptions=function(e,t){return T(Ae,e,t)};function td(e){e.landmarks=[],e.worldLandmarks=[],e.v=void 0}function rd(e){try{let t=new class{constructor(r,i,o){this.landmarks=r,this.worldLandmarks=i,this.g=o}close(){this.g?.forEach(r=>{r.close()})}}(e.landmarks,e.worldLandmarks,e.v);if(!e.u)return t;e.u(t)}finally{ic(e)}}var Be=class extends Me{constructor(e,t){super(new nt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,_(e=this.h=new qh,0,1,t=new X),this.B=new _0,_(this.h,0,3,this.B),this.j=new E0,_(this.h,0,2,this.j),gt(this.j,4,1),A(this.j,2,.5),A(this.B,2,.5),A(this.h,4,.5)}get baseOptions(){return R(this.h,X,1)}set baseOptions(e){_(this.h,0,1,e)}o(e){return"numPoses"in e&>(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&A(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&A(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&A(this.B,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}G(e,t,r){let i=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,td(this),st(this,e,i),rd(this)}H(e,t,r,i){let o=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:i,td(this),Ft(this,e,o,t),rd(this)}m(){var e=new Re;z(e,"image_in"),z(e,"norm_rect"),j(e,"normalized_landmarks"),j(e,"world_landmarks"),j(e,"segmentation_masks");let t=new We;rt(t,A0,this.h);let r=new Se;$e(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),L(r,"IMAGE:image_in"),L(r,"NORM_RECT:norm_rect"),D(r,"NORM_LANDMARKS:normalized_landmarks"),D(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Xe(e,r),rc(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,o)=>{this.landmarks=[];for(let n of i)i=Tn(n),this.landmarks.push(tc(i));S(this,o)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],S(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,o)=>{this.worldLandmarks=[];for(let n of i)i=Ja(n),this.worldLandmarks.push(Kh(i));S(this,o)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],S(this,i)}),this.outputSegmentationMasks&&(D(r,"SEGMENTATION_MASK:segmentation_masks"),Mi(this,"segmentation_masks"),this.g.ca("segmentation_masks",(i,o)=>{this.v=i.map(n=>Ui(this,n,!0,!this.u)),S(this,o)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.v=[],S(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Be.prototype.detectForVideo=Be.prototype.H,Be.prototype.detect=Be.prototype.G,Be.prototype.setOptions=Be.prototype.o,Be.createFromModelPath=function(e,t){return T(Be,e,{baseOptions:{modelAssetPath:t}})},Be.createFromModelBuffer=function(e,t){return T(Be,e,{baseOptions:{modelAssetBuffer:t}})},Be.createFromOptions=function(e,t){return T(Be,e,t)},Be.POSE_CONNECTIONS=ot([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]);var qr=class{constructor(t,r,i,o,n="videoPreviewFrameDetection",s="liveViewFrameDetection"){this.options={onRealtimeAlertsCallback:t=>{}};this.children=[];this.runningMode="VIDEO";this.detecting=!1;this.lastVideoTime=-1;this.lastExecutionDate=Date.now();this.detectorType=t,this.modelAssetPath=r,this.classVideo=n,this.classDiv=s,o&&(this.paramsConfig=o),i&&(this.options=i)}async initializeDetector(){let t=await Pr.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.2/wasm");this.detector=await(this.detectorType==="FaceDetector"?ke:Ae).createFromOptions(t,{baseOptions:{modelAssetPath:this.modelAssetPath,delegate:"CPU"},scoreThreshold:this.detectorType==="ObjectDetector"?.5:0,runningMode:this.runningMode})}stopDetection(){this.animationFrameId&&clearTimeout(this.animationFrameId),this.detecting=!1,this.liveView=document.getElementById(this.classDiv),this.liveView&&this.classDiv==="liveViewFrameDetection"&&document.body.removeChild(this.liveView)}enableCam(t){if(!this.detector){console.log("Wait! Detector not loaded yet.");return}this.detecting=!0,this.error=document.getElementById("errorFrameDetection"),this.video=document.getElementById(this.classVideo),this.liveView=document.getElementById(this.classDiv),t&&!this.video.srcObject&&(this.video.srcObject=t),this.video.play();let r=this;this.video?.addEventListener("loadeddata",()=>r.predictWebcam());let i=document.createElement("style");i.type="text/css",i.innerHTML=`
|
|
50
50
|
.key-point {
|
|
51
51
|
position: absolute;
|
|
52
52
|
z-index: 1;
|
|
@@ -215,10 +215,47 @@ Para iniciar um exame utilize uma outra c\xE2mera.`),n.setAttribute("class","che
|
|
|
215
215
|
left: 5px;
|
|
216
216
|
top: 2px;
|
|
217
217
|
}
|
|
218
|
-
`,document.getElementsByTagName("head")[0].appendChild(t),new Promise((r,i)=>{let o=document.createElement("div");o.setAttribute("id","checkDevices");let n={backgroundColor:"rgba(0,0,0,0.4)",zIndex:"1000",position:"fixed",top:"0",left:"0",height:"100vh",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"};this.applyStyles(o,n);let s=document.createElement("div"),a={backgroundColor:"#fff",zIndex:"1001",width:"600px",borderRadius:"10px",display:"flex",flexDirection:"column",alignItems:"center"};this.applyStyles(s,a);let c=document.createElement("h3");c.innerText="Para iniciar configure a c\xE2mera e o microfone";let l={color:"rgba(0, 0, 0, .7)",fontWeight:"bold",fontSize:"20px",marginBottom:"15px",padding:"20px 0px",borderBottom:"2px solid rgba(0, 0, 0, .1)",width:"100%",textAlign:"center"};this.applyStyles(c,l),s.appendChild(c);let u=document.createElement("div"),d=document.createElement("h3"),f=document.createElement("select");f.setAttribute("id","cameraSelect");let g={padding:"0 20px",width:"100%",display:"flex",justifyContent:"space-between",marginBottom:"15px"};this.applyStyles(u,g),d.innerText="C\xE2mera";let h={color:"rgba(0, 0, 0, .75)",fontWeight:"bold",fontSize:"16px"};this.applyStyles(d,h),f.style.maxWidth="400px",u.appendChild(d),u.appendChild(f),s.appendChild(u);let m=document.createElement("div");m.setAttribute("id","liveCheckDevices");let y=document.createElement("div"),b=document.createElement("video"),k=document.createElement("div");b.setAttribute("id","cameraStream"),b.muted=!0;let P={width:"calc(100% - 40px)",display:"flex",justifyContent:"space-between",borderBottom:"2px solid rgba(0, 0, 0, .1)",paddingBottom:"15px",transform:"rotateY(180deg)"};this.applyStyles(m,P);let ae={width:"20rem",backgroundColor:"#000",borderRadius:"10px",marginBottom:"15px"};this.applyStyles(b,ae),this.applyStyles(y,{position:"relative"});let le=document.createElement("div");le.setAttribute("class","alert-div"),le.setAttribute("id","alertDivResolution");let me=document.createElement("error");me.setAttribute("id","resolutionAlert"),me.innerText="Resolu\xE7\xE3o m\xEDnima",me.style.marginLeft="10px",me.style.marginRight="5px";let uo=document.createElement("span"),el=document.createElement("div"),tl=document.createElement("div");uo.setAttribute("id","checkmark_resolution"),el.setAttribute("id","checkmark_stem_resolution"),tl.setAttribute("id","checkmark_kick_resolution"),uo.appendChild(el),uo.appendChild(tl);let si=document.createElement("span"),rl=document.createElement("div"),il=document.createElement("div");si.setAttribute("class","info"),si.setAttribute("id","info_resolution"),rl.setAttribute("class","info_stem"),il.setAttribute("class","info_kick"),si.appendChild(rl),si.appendChild(il),le.appendChild(uo),le.appendChild(me),le.appendChild(si);let ai=document.createElement("div");ai.setAttribute("class","alert-div"),ai.setAttribute("id","alertDivFacePosition");let ho=document.createElement("error");ho.setAttribute("id","facePositionAlert"),ho.innerText="Posicionamento da face",ho.style.marginLeft="10px";let po=document.createElement("span"),ol=document.createElement("div"),nl=document.createElement("div");po.setAttribute("id","checkmark_FacePosition"),ol.setAttribute("id","checkmark_stem_FacePosition"),nl.setAttribute("id","checkmark_kick_FacePosition"),po.appendChild(ol),po.appendChild(nl),ai.appendChild(po),ai.appendChild(ho);let ci=document.createElement("div");ci.setAttribute("class","alert-div"),ci.setAttribute("id","alertDivAmbientVerify");let fo=document.createElement("error");fo.setAttribute("id","ambientVerifyAlert"),fo.innerText="Verifica\xE7\xE3o do ambiente",fo.style.marginLeft="10px";let mo=document.createElement("span"),sl=document.createElement("div"),al=document.createElement("div");mo.setAttribute("id","checkmark_AmbientVerify"),sl.setAttribute("id","checkmark_stem_AmbientVerify"),al.setAttribute("id","checkmark_kick_AmbientVerify"),mo.appendChild(sl),mo.appendChild(al),ci.appendChild(mo),ci.appendChild(fo),k.style.transform="rotateY(180deg)",k.appendChild(le),k.appendChild(ai),k.appendChild(ci),m.appendChild(k),y.appendChild(b),m.appendChild(y);let Tt=document.createElement("div");Tt.setAttribute("class","facial-biometry__mask"),Tt.style.width="100%",Tt.style.height="100%",Tt.style.position="absolute",Tt.style.top="0px",Tt.style.left="0px",Tt.style.backgroundColor="#fff",Tt.style.opacity="0.6";let Lt=document.createElement("div");Lt.setAttribute("class","biometry__frame"),Lt.style.width="100%",Lt.style.height="100%",Lt.style.position="absolute",Lt.style.top="0px",Lt.style.left="0px",Lt.style.zIndex="10",y.appendChild(Tt),y.appendChild(Lt),s.appendChild(m);let go=document.createElement("div"),Es=document.createElement("h3"),li=document.createElement("select");li.setAttribute("id","micSelect");let Am={padding:"0 20px",width:"100%",display:"flex",justifyContent:"space-between",margin:"15px 0"};this.applyStyles(go,Am),Es.innerText="Microfone";let Tm={color:"rgba(0, 0, 0, .7)",fontWeight:"bold",fontSize:"16px"};this.applyStyles(Es,Tm),li.style.maxWidth="400px",go.appendChild(Es),go.appendChild(li),s.appendChild(go);let yo=document.createElement("div"),xm={width:"100%",padding:"0px 40px",display:"flex"};this.applyStyles(yo,xm);let vo=document.createElement("div"),Rm={display:"flex",flexDirection:"column",justifyContent:"space-between",paddingBottom:"15px"};this.applyStyles(vo,Rm);let bo=document.createElement("div");bo.setAttribute("id","audioStream");let Cm={display:"flex",marginBottom:"15px"};this.applyStyles(bo,Cm);let Pm={height:"16px",width:"5px",marginRight:"5px",borderRadius:"10px",backgroundColor:"rgba(0, 0, 0, .3)"};for(let ko=0;ko<25;ko++){let fl=document.createElement("div");this.applyStyles(fl,Pm),bo.appendChild(fl)}let ui=document.createElement("div"),cl=document.createElement("p"),ll=document.createElement("p"),ul=document.createElement("p"),Im={width:"250px",display:"flex",justifyContent:"space-between"};this.applyStyles(ui,Im),cl.innerText="0",ll.innerText="50",ul.innerText="100",ui.appendChild(cl),ui.appendChild(ll),ui.appendChild(ul);let Er=document.createElement("div");Er.setAttribute("class","alert-div"),Er.setAttribute("id","alertDivMicrophone");let Om={alignItems:"start",justifyContent:"end",width:"inherit"};this.applyStyles(Er,Om);let wo=document.createElement("error");wo.setAttribute("id","microphoneAlert"),wo.innerText="Teste de funcionamento",wo.style.marginLeft="10px";let So=document.createElement("span"),dl=document.createElement("div"),hl=document.createElement("div");So.setAttribute("id","checkmark_microphone"),dl.setAttribute("id","checkmark_stem_microphone"),hl.setAttribute("id","checkmark_kick_microphone"),So.appendChild(dl),So.appendChild(hl),Er.appendChild(So),Er.appendChild(wo),vo.appendChild(bo),vo.appendChild(ui);let Eo=document.createElement("p");Eo.innerText='Pronuncie em voz alta: "um, dois, tr\xEAs, quatro".',Eo.style.textAlign="start";let Dm={width:"100%",marginLeft:"40px",marginBottom:"15px"};this.applyStyles(Eo,Dm),yo.appendChild(vo),yo.appendChild(Er),s.appendChild(Eo),s.appendChild(yo);let di=document.createElement("div"),Fm={width:"100%",display:"flex",alignItems:"center",justifyContent:"center",borderTop:"2px solid rgba(0, 0, 0, .1)"};this.applyStyles(di,Fm);let _o=document.createElement("button");_o.innerText="Cancelar";let Bm={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px"};this.applyStyles(_o,Bm),_o.addEventListener("click",()=>{this.closeCheckDevices(),r({cameraId:f?.value,microphoneId:li?.value,result:!1})});let pl=document.createElement("span"),Mm={width:"3px",height:"70px",margin:"0px 2px",background:"rgba(0, 0, 0, .1)"};this.applyStyles(pl,Mm);let hi=document.createElement("button");hi.innerText="Continuar",hi.setAttribute("id","confirmBtn");let Lm={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px",disabled:!0};this.applyStyles(hi,Lm),hi.addEventListener("click",()=>{this.closeCheckDevices(),r({cameraId:f?.value,microphoneId:li?.value,result:!0})}),di.appendChild(_o),di.appendChild(pl),di.appendChild(hi),s.appendChild(di),o.appendChild(s),document.body.appendChild(o),this.startCheckDevices(this.options,this.videoOptions).catch(ko=>i(ko))})}videoDeviceInterface(t){let r=document.querySelector("#cameraStream");r&&(r.srcObject=t,r.play(),this.isUnderResolution()),this.faceDetection.enableCam()}audioDeviceInterface(t){let i=document.querySelector("#audioStream")?.querySelectorAll("div"),o=document.querySelector("#audioText"),n=document.getElementById("microphoneAlert"),s=document.getElementById("alertDivMicrophone"),a=document.getElementById("checkmark_microphone"),c=document.getElementById("checkmark_stem_microphone"),l=document.getElementById("checkmark_kick_microphone"),u=document.getElementById("ambientVerifyAlert"),d=document.getElementById("alertDivAmbientVerify"),f=document.getElementById("checkmark_AmbientVerify"),g=document.getElementById("checkmark_stem_AmbientVerify"),h=document.getElementById("checkmark_kick_AmbientVerify");this.volumeMeter=new Qt(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:m=>{this.volumeCounter++,this.volumeSum+=m,!this.allowedMicrophone&&m>this.microphoneMinThreshold?(this.allowedMicrophone=!0,n&&(n.style.color="#16A34A"),s&&s.setAttribute("title",""),a&&a.setAttribute("class","checkmark"),c&&c.setAttribute("class","checkmark_stem"),l&&l.setAttribute("class","checkmark_kick")):this.allowedMicrophone||(n&&(n.style.color="#FF0000"),s&&s.setAttribute("title","Microfone n\xE3o est\xE1 funcionando corretamente!"),a&&a.setAttribute("class","checkmark_error"),c&&c.setAttribute("class","checkmark_stem_error"),l&&l.setAttribute("class","checkmark_kick_error"));let y=m/4;i?.forEach((b,k)=>{k<Math.ceil(y)?b.style.backgroundColor="rgb(22, 163, 74)":b.style.backgroundColor="rgba(0, 0, 0, .3)"}),o&&(o.innerText=m.toFixed(0).toString()),m>this.noiseLimit?(u&&(u.style.color="#FF0000"),d&&d.setAttribute("title","Ambiente apresentando muito ru\xEDdo!"),this.allowedAmbient=!1,f.setAttribute("class","checkmark_error"),g.setAttribute("class","checkmark_stem_error"),h.setAttribute("class","checkmark_kick_error")):(u&&(u.style.color="#16A34A"),d&&d.setAttribute("title",""),this.allowedAmbient=!0,f.setAttribute("class","checkmark"),g.setAttribute("class","checkmark_stem"),h.setAttribute("class","checkmark_kick"))}}).catch(m=>{console.log(m),this.volumeMeter=void 0,n&&(n.style.color="#FF0000"),a&&a.setAttribute("class","checkmark_error"),c&&c.setAttribute("class","checkmark_stem_error"),l&&l.setAttribute("class","checkmark_kick_error")})}async setSelectOption(t){let r=document.querySelector("#cameraSelect"),i=document.querySelector("#micSelect"),o=await Qe();r&&(r.value=t.cameraId||"default"),i&&(i.value=t.microphoneId||"default");let n=(s,a)=>{let c=document.createElement("option");return c.setAttribute("value",a),c.innerHTML=s,c};o.cameras.forEach(s=>{let a=n(s.label,s.id);r?.appendChild(a)}),o.microphones.forEach(s=>{let a=n(s.label,s.id);i?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let t=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");t?.addEventListener("change",async()=>{this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new wt({cameraId:t?.value,microphoneId:r?.value,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new wt({cameraId:t?.value,microphoneId:r?.value,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(t=er,r){this.setSelectOption(t),this.videoOptions=Dn(r),await Ao(),this.cameraRecorder=new wt({cameraId:t.cameraId,microphoneId:t.microphoneId,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream);let i=document.querySelector("#confirmBtn");return i.disabled=!1,{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){Xi.isModalOpen=!1,document.querySelector("#checkDevices")?.remove(),this.faceDetection.stopDetection(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording()}applyStyles(t,r){for(let[i,o]of Object.entries(r))t.style[i]=o}},$i=Xi;$i.isModalOpen=!1;var Fn=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let t;return new Promise((r,i)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),t=setInterval(()=>{this.tryes>10&&(clearInterval(t),i(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(t),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(t,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:t,token:r},"*")}verify(t){return t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,i)=>{t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",t=>this.verify(t))}};var Bn=class{constructor(t,r){this.repositoryDevices=t,this.proctoringId=r}startRecording(t){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(t)}}async onChangeDevices(t){let r=await Qe(),i=(d,f)=>d.label===f.label&&d.id===f.id,o=(d,f,g)=>d.filter(h=>!f.some(m=>g(h,m))),n=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},a={cameras:n?.cameras||[s],microphones:n?.microphones||[s]},c,l;r.cameras.length!=a?.cameras.length&&(c=r.cameras.length>a?.cameras.length?o(r.cameras,a?.cameras,i):o(a?.cameras,r.cameras,i),c=c.filter(d=>d.id!="default")),r.microphones.length!=a?.microphones.length&&(l=r.microphones.length>a?.microphones.length?o(r.microphones,a?.microphones,i):o(a?.microphones,r.microphones,i),l=l.filter(d=>d.id!="default"&&d.id!="communications"));let u={cameras:c||[],microphones:l||[],status:r.cameras.length>a?.cameras.length||r.microphones.length>a?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>a?.cameras.length||r.microphones.length>a?.microphones.length?"in":"out"}),t.status&&(u.cameras.length!=0||u.microphones.length!=0)&&(I.registerChangeDevice(this.proctoringId,u.status,u),t.status(u))}};var yp=Wm(gp()),Jr=class{constructor(t){this.loadingBoolean=!0;this.proctoringId=t}async upload(t,r){try{let{file:i,onProgress:o}=t;(0,yp.saveAs)(i),this.loadingBoolean=!1,clearInterval(this.loadingInterval),o&&o(Math.round(100))}catch{throw new Error("Error on machine download")}}};var Mn=class{constructor(t,r){this.session=t;this.recorders=r}async startAll(){this.session.start();for(let t of this.recorders)await t.startRecording()}async pauseAll(){this.session.pause();for(let t of this.recorders)await t.pauseRecording()}async resumeAll(){this.session.resume();for(let t of this.recorders)await t.resumeRecording()}async stopAll(){for(let t of this.recorders)await t.stopRecording();this.session.stop()}async saveAllOnSession(){for(let t of this.recorders)await t.saveOnSession(this.session)}};var Yr=class{constructor(t,r,i){this.session=t;this.proctoringId=r;this.uploadServices=i}async upload(t,r){await this.uploadRecordings(t,r)}async uploadRecordings(t,r){await this.uploadAllFiles(t,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(t,r){for(let i=0;i<this.session.recordings.length;i++){let o=this.session.recordings[i];if(o.upload)continue;let n=a=>{let c=(i*100+a)/this.session.recordings.length;r&&r(c)},s=await this.uploadFile(o,t,n).catch(()=>{});s&&(o.upload||(o.upload={storage:"upload",awsUrl:"",azureUrl:""}),s.uploaded&&(o.upload.storage=s.storage),s.storage==="upload"?s.url&&(o.upload.azureUrl=s.url):s.url&&(o.upload.awsUrl=s.url))}r&&r(100)}async uploadFile(t,r,i){for await(let o of this.uploadServices){let n=await o.upload({file:t.file,onProgress:s=>{i&&i(s)}},r);if(n){let s="";return t.file.name.search("camera")!==-1?s="Camera":t.file.name.search("screen")!==-1?s="Screen":t.file.name.search("audio")!==-1&&(s="Audio"),I.registerUploadFile(this.proctoringId,`Upload File
|
|
218
|
+
`,document.getElementsByTagName("head")[0].appendChild(t),new Promise((r,i)=>{let o=document.createElement("div");o.setAttribute("id","checkDevices");let n={backgroundColor:"rgba(0,0,0,0.4)",zIndex:"1000",position:"fixed",top:"0",left:"0",height:"100vh",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"};this.applyStyles(o,n);let s=document.createElement("div"),a={backgroundColor:"#fff",zIndex:"1001",width:"600px",borderRadius:"10px",display:"flex",flexDirection:"column",alignItems:"center"};this.applyStyles(s,a);let c=document.createElement("h3");c.innerText="Para iniciar configure a c\xE2mera e o microfone";let l={color:"rgba(0, 0, 0, .7)",fontWeight:"bold",fontSize:"20px",marginBottom:"15px",padding:"20px 0px",borderBottom:"2px solid rgba(0, 0, 0, .1)",width:"100%",textAlign:"center"};this.applyStyles(c,l),s.appendChild(c);let u=document.createElement("div"),d=document.createElement("h3"),f=document.createElement("select");f.setAttribute("id","cameraSelect");let g={padding:"0 20px",width:"100%",display:"flex",justifyContent:"space-between",marginBottom:"15px"};this.applyStyles(u,g),d.innerText="C\xE2mera";let h={color:"rgba(0, 0, 0, .75)",fontWeight:"bold",fontSize:"16px"};this.applyStyles(d,h),f.style.maxWidth="400px",u.appendChild(d),u.appendChild(f),s.appendChild(u);let m=document.createElement("div");m.setAttribute("id","liveCheckDevices");let y=document.createElement("div"),b=document.createElement("video"),k=document.createElement("div");b.setAttribute("id","cameraStream"),b.muted=!0;let P={width:"calc(100% - 40px)",display:"flex",justifyContent:"space-between",borderBottom:"2px solid rgba(0, 0, 0, .1)",paddingBottom:"15px",transform:"rotateY(180deg)"};this.applyStyles(m,P);let ae={width:"20rem",backgroundColor:"#000",borderRadius:"10px",marginBottom:"15px"};this.applyStyles(b,ae),this.applyStyles(y,{position:"relative"});let le=document.createElement("div");le.setAttribute("class","alert-div"),le.setAttribute("id","alertDivResolution");let me=document.createElement("error");me.setAttribute("id","resolutionAlert"),me.innerText="Resolu\xE7\xE3o m\xEDnima",me.style.marginLeft="10px",me.style.marginRight="5px";let uo=document.createElement("span"),el=document.createElement("div"),tl=document.createElement("div");uo.setAttribute("id","checkmark_resolution"),el.setAttribute("id","checkmark_stem_resolution"),tl.setAttribute("id","checkmark_kick_resolution"),uo.appendChild(el),uo.appendChild(tl);let si=document.createElement("span"),rl=document.createElement("div"),il=document.createElement("div");si.setAttribute("class","info"),si.setAttribute("id","info_resolution"),rl.setAttribute("class","info_stem"),il.setAttribute("class","info_kick"),si.appendChild(rl),si.appendChild(il),le.appendChild(uo),le.appendChild(me),le.appendChild(si);let ai=document.createElement("div");ai.setAttribute("class","alert-div"),ai.setAttribute("id","alertDivFacePosition");let ho=document.createElement("error");ho.setAttribute("id","facePositionAlert"),ho.innerText="Posicionamento da face",ho.style.marginLeft="10px";let po=document.createElement("span"),ol=document.createElement("div"),nl=document.createElement("div");po.setAttribute("id","checkmark_FacePosition"),ol.setAttribute("id","checkmark_stem_FacePosition"),nl.setAttribute("id","checkmark_kick_FacePosition"),po.appendChild(ol),po.appendChild(nl),ai.appendChild(po),ai.appendChild(ho);let ci=document.createElement("div");ci.setAttribute("class","alert-div"),ci.setAttribute("id","alertDivAmbientVerify");let fo=document.createElement("error");fo.setAttribute("id","ambientVerifyAlert"),fo.innerText="Verifica\xE7\xE3o do ambiente",fo.style.marginLeft="10px";let mo=document.createElement("span"),sl=document.createElement("div"),al=document.createElement("div");mo.setAttribute("id","checkmark_AmbientVerify"),sl.setAttribute("id","checkmark_stem_AmbientVerify"),al.setAttribute("id","checkmark_kick_AmbientVerify"),mo.appendChild(sl),mo.appendChild(al),ci.appendChild(mo),ci.appendChild(fo),k.style.transform="rotateY(180deg)",k.appendChild(le),k.appendChild(ai),k.appendChild(ci),m.appendChild(k),y.appendChild(b),m.appendChild(y);let xt=document.createElement("div");xt.setAttribute("class","facial-biometry__mask"),xt.style.width="100%",xt.style.height="100%",xt.style.position="absolute",xt.style.top="0px",xt.style.left="0px",xt.style.backgroundColor="#fff",xt.style.opacity="0.6";let Lt=document.createElement("div");Lt.setAttribute("class","biometry__frame"),Lt.style.width="100%",Lt.style.height="100%",Lt.style.position="absolute",Lt.style.top="0px",Lt.style.left="0px",Lt.style.zIndex="10",y.appendChild(xt),y.appendChild(Lt),s.appendChild(m);let go=document.createElement("div"),Es=document.createElement("h3"),li=document.createElement("select");li.setAttribute("id","micSelect");let Am={padding:"0 20px",width:"100%",display:"flex",justifyContent:"space-between",margin:"15px 0"};this.applyStyles(go,Am),Es.innerText="Microfone";let xm={color:"rgba(0, 0, 0, .7)",fontWeight:"bold",fontSize:"16px"};this.applyStyles(Es,xm),li.style.maxWidth="400px",go.appendChild(Es),go.appendChild(li),s.appendChild(go);let yo=document.createElement("div"),Tm={width:"100%",padding:"0px 40px",display:"flex"};this.applyStyles(yo,Tm);let vo=document.createElement("div"),Rm={display:"flex",flexDirection:"column",justifyContent:"space-between",paddingBottom:"15px"};this.applyStyles(vo,Rm);let bo=document.createElement("div");bo.setAttribute("id","audioStream");let Cm={display:"flex",marginBottom:"15px"};this.applyStyles(bo,Cm);let Pm={height:"16px",width:"5px",marginRight:"5px",borderRadius:"10px",backgroundColor:"rgba(0, 0, 0, .3)"};for(let ko=0;ko<25;ko++){let fl=document.createElement("div");this.applyStyles(fl,Pm),bo.appendChild(fl)}let ui=document.createElement("div"),cl=document.createElement("p"),ll=document.createElement("p"),ul=document.createElement("p"),Im={width:"250px",display:"flex",justifyContent:"space-between"};this.applyStyles(ui,Im),cl.innerText="0",ll.innerText="50",ul.innerText="100",ui.appendChild(cl),ui.appendChild(ll),ui.appendChild(ul);let Er=document.createElement("div");Er.setAttribute("class","alert-div"),Er.setAttribute("id","alertDivMicrophone");let Om={alignItems:"start",justifyContent:"end",width:"inherit"};this.applyStyles(Er,Om);let wo=document.createElement("error");wo.setAttribute("id","microphoneAlert"),wo.innerText="Teste de funcionamento",wo.style.marginLeft="10px";let So=document.createElement("span"),dl=document.createElement("div"),hl=document.createElement("div");So.setAttribute("id","checkmark_microphone"),dl.setAttribute("id","checkmark_stem_microphone"),hl.setAttribute("id","checkmark_kick_microphone"),So.appendChild(dl),So.appendChild(hl),Er.appendChild(So),Er.appendChild(wo),vo.appendChild(bo),vo.appendChild(ui);let Eo=document.createElement("p");Eo.innerText='Pronuncie em voz alta: "um, dois, tr\xEAs, quatro".',Eo.style.textAlign="start";let Dm={width:"100%",marginLeft:"40px",marginBottom:"15px"};this.applyStyles(Eo,Dm),yo.appendChild(vo),yo.appendChild(Er),s.appendChild(Eo),s.appendChild(yo);let di=document.createElement("div"),Fm={width:"100%",display:"flex",alignItems:"center",justifyContent:"center",borderTop:"2px solid rgba(0, 0, 0, .1)"};this.applyStyles(di,Fm);let _o=document.createElement("button");_o.innerText="Cancelar";let Bm={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px"};this.applyStyles(_o,Bm),_o.addEventListener("click",()=>{this.closeCheckDevices(),r({cameraId:f?.value,microphoneId:li?.value,result:!1})});let pl=document.createElement("span"),Mm={width:"3px",height:"70px",margin:"0px 2px",background:"rgba(0, 0, 0, .1)"};this.applyStyles(pl,Mm);let hi=document.createElement("button");hi.innerText="Continuar",hi.setAttribute("id","confirmBtn");let Lm={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px",disabled:!0};this.applyStyles(hi,Lm),hi.addEventListener("click",()=>{this.closeCheckDevices(),r({cameraId:f?.value,microphoneId:li?.value,result:!0})}),di.appendChild(_o),di.appendChild(pl),di.appendChild(hi),s.appendChild(di),o.appendChild(s),document.body.appendChild(o),this.startCheckDevices(this.options,this.videoOptions).catch(ko=>i(ko))})}videoDeviceInterface(t){let r=document.querySelector("#cameraStream");r&&(r.srcObject=t,r.play(),this.isUnderResolution()),this.faceDetection.enableCam()}audioDeviceInterface(t){let i=document.querySelector("#audioStream")?.querySelectorAll("div"),o=document.querySelector("#audioText"),n=document.getElementById("microphoneAlert"),s=document.getElementById("alertDivMicrophone"),a=document.getElementById("checkmark_microphone"),c=document.getElementById("checkmark_stem_microphone"),l=document.getElementById("checkmark_kick_microphone"),u=document.getElementById("ambientVerifyAlert"),d=document.getElementById("alertDivAmbientVerify"),f=document.getElementById("checkmark_AmbientVerify"),g=document.getElementById("checkmark_stem_AmbientVerify"),h=document.getElementById("checkmark_kick_AmbientVerify");this.volumeMeter=new Qt(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:m=>{this.volumeCounter++,this.volumeSum+=m,!this.allowedMicrophone&&m>this.microphoneMinThreshold?(this.allowedMicrophone=!0,n&&(n.style.color="#16A34A"),s&&s.setAttribute("title",""),a&&a.setAttribute("class","checkmark"),c&&c.setAttribute("class","checkmark_stem"),l&&l.setAttribute("class","checkmark_kick")):this.allowedMicrophone||(n&&(n.style.color="#FF0000"),s&&s.setAttribute("title","Microfone n\xE3o est\xE1 funcionando corretamente!"),a&&a.setAttribute("class","checkmark_error"),c&&c.setAttribute("class","checkmark_stem_error"),l&&l.setAttribute("class","checkmark_kick_error"));let y=m/4;i?.forEach((b,k)=>{k<Math.ceil(y)?b.style.backgroundColor="rgb(22, 163, 74)":b.style.backgroundColor="rgba(0, 0, 0, .3)"}),o&&(o.innerText=m.toFixed(0).toString()),m>this.noiseLimit?(u&&(u.style.color="#FF0000"),d&&d.setAttribute("title","Ambiente apresentando muito ru\xEDdo!"),this.allowedAmbient=!1,f.setAttribute("class","checkmark_error"),g.setAttribute("class","checkmark_stem_error"),h.setAttribute("class","checkmark_kick_error")):(u&&(u.style.color="#16A34A"),d&&d.setAttribute("title",""),this.allowedAmbient=!0,f.setAttribute("class","checkmark"),g.setAttribute("class","checkmark_stem"),h.setAttribute("class","checkmark_kick"))}}).catch(m=>{console.log(m),this.volumeMeter=void 0,n&&(n.style.color="#FF0000"),a&&a.setAttribute("class","checkmark_error"),c&&c.setAttribute("class","checkmark_stem_error"),l&&l.setAttribute("class","checkmark_kick_error")})}async setSelectOption(t){let r=document.querySelector("#cameraSelect"),i=document.querySelector("#micSelect"),o=await Qe();r&&(r.value=t.cameraId||"default"),i&&(i.value=t.microphoneId||"default");let n=(s,a)=>{let c=document.createElement("option");return c.setAttribute("value",a),c.innerHTML=s,c};o.cameras.forEach(s=>{let a=n(s.label,s.id);r?.appendChild(a)}),o.microphones.forEach(s=>{let a=n(s.label,s.id);i?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let t=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");t?.addEventListener("change",async()=>{this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new wt({cameraId:t?.value,microphoneId:r?.value,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new wt({cameraId:t?.value,microphoneId:r?.value,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(t=er,r){this.setSelectOption(t),this.videoOptions=Dn(r),await Ao(),this.cameraRecorder=new wt({cameraId:t.cameraId,microphoneId:t.microphoneId,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream);let i=document.querySelector("#confirmBtn");return i.disabled=!1,{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){Xi.isModalOpen=!1,document.querySelector("#checkDevices")?.remove(),this.faceDetection.stopDetection(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording()}applyStyles(t,r){for(let[i,o]of Object.entries(r))t.style[i]=o}},$i=Xi;$i.isModalOpen=!1;var Fn=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let t;return new Promise((r,i)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),t=setInterval(()=>{this.tryes>10&&(clearInterval(t),i(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(t),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(t,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:t,token:r},"*")}verify(t){return t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,i)=>{t.source==window&&t.data.sender&&t.data.sender==="easyproctor-extension"&&t.data.message_name&&t.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",t=>this.verify(t))}};var Bn=class{constructor(t,r){this.repositoryDevices=t,this.proctoringId=r}startRecording(t){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(t)}}async onChangeDevices(t){let r=await Qe(),i=(d,f)=>d.label===f.label&&d.id===f.id,o=(d,f,g)=>d.filter(h=>!f.some(m=>g(h,m))),n=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},a={cameras:n?.cameras||[s],microphones:n?.microphones||[s]},c,l;r.cameras.length!=a?.cameras.length&&(c=r.cameras.length>a?.cameras.length?o(r.cameras,a?.cameras,i):o(a?.cameras,r.cameras,i),c=c.filter(d=>d.id!="default")),r.microphones.length!=a?.microphones.length&&(l=r.microphones.length>a?.microphones.length?o(r.microphones,a?.microphones,i):o(a?.microphones,r.microphones,i),l=l.filter(d=>d.id!="default"&&d.id!="communications"));let u={cameras:c||[],microphones:l||[],status:r.cameras.length>a?.cameras.length||r.microphones.length>a?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>a?.cameras.length||r.microphones.length>a?.microphones.length?"in":"out"}),t.status&&(u.cameras.length!=0||u.microphones.length!=0)&&(I.registerChangeDevice(this.proctoringId,u.status,u),t.status(u))}};var yp=Wm(gp()),Jr=class{constructor(t){this.loadingBoolean=!0;this.proctoringId=t}async upload(t,r){try{let{file:i,onProgress:o}=t;(0,yp.saveAs)(i),this.loadingBoolean=!1,clearInterval(this.loadingInterval),o&&o(Math.round(100))}catch{throw new Error("Error on machine download")}}};var Mn=class{constructor(t,r){this.session=t;this.recorders=r}async startAll(){this.session.start();for(let t of this.recorders)await t.startRecording()}async pauseAll(){this.session.pause();for(let t of this.recorders)await t.pauseRecording()}async resumeAll(){this.session.resume();for(let t of this.recorders)await t.resumeRecording()}async stopAll(){for(let t of this.recorders)await t.stopRecording();this.session.stop()}async saveAllOnSession(){for(let t of this.recorders)await t.saveOnSession(this.session)}};var Yr=class{constructor(t,r,i){this.session=t;this.proctoringId=r;this.uploadServices=i}async upload(t,r){await this.uploadRecordings(t,r)}async uploadRecordings(t,r){await this.uploadAllFiles(t,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(t,r){for(let i=0;i<this.session.recordings.length;i++){let o=this.session.recordings[i];if(o.upload)continue;let n=a=>{let c=(i*100+a)/this.session.recordings.length;r&&r(c)},s=await this.uploadFile(o,t,n).catch(()=>{});s&&(o.upload||(o.upload={storage:"upload",awsUrl:"",azureUrl:""}),s.uploaded&&(o.upload.storage=s.storage),s.storage==="upload"?s.url&&(o.upload.azureUrl=s.url):s.url&&(o.upload.awsUrl=s.url))}r&&r(100)}async uploadFile(t,r,i){for await(let o of this.uploadServices){let n=await o.upload({file:t.file,onProgress:s=>{i&&i(s)}},r);if(n){let s="";return t.file.name.search("camera")!==-1?s="Camera":t.file.name.search("screen")!==-1?s="Screen":t.file.name.search("audio")!==-1&&(s="Audio"),I.registerUploadFile(this.proctoringId,`Upload File
|
|
219
219
|
Name: ${t.file.name}
|
|
220
220
|
Type: ${t.file.type}
|
|
221
|
-
Size: ${t.file.size}`,s),n}}throw new Error("Could not upload")}};var Ln=class{constructor(t,r,i){this.alerts=[];this.onLostFocusCallback=t.onLostFocusCallback,this.onFocusCallback=t.onFocusCallback,this.optionsProctoring=r,this.cameraRecorder=i}async startRecording(){this.startTime=new Date(Date.now()),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus())}async resumeRecording(){this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus())}async saveOnSession(t){this.alerts.forEach(r=>{t.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let t=this.alerts[this.alerts.length-1];t&&(this.onFocusCallback(),t.end=Date.now()-this.startTime.getTime())}};var Un=class{constructor(t,r){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.audioParams={recordingBitrate:128};r&&(this.audioParams=r),t&&(this.options=t)}async startRecording(){let t={audio:{deviceId:this.options.microphoneId||"default"}};this.audioStream=await navigator.mediaDevices.getUserMedia(t);let{startRecording:r,stopRecording:i,pauseRecording:o,resumeRecording:n}=ar(this.audioStream,this.blobs,void 0,void 0,void 0,!0);this.recordingStart=r,this.recordingStop=i,this.recordingPause=o,this.recordingResume=n,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t,r,i){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_audio_${r&&i&&`${r}_${i}`||"0"}.webm`,{type:"audio/webm"}),origin:"Mic"})}};var xc=typeof self<"u"?self:{};function Zp(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=xc,o=0;o<r.length;o++)if((i=i[r[o]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function mr(){throw Error("Invalid UTF8")}function vp(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Nn,lc,$0=typeof TextDecoder<"u",X0,K0=typeof TextEncoder<"u";function Qp(e){if(K0)e=(X0||=new TextEncoder).encode(e);else{let r=0,i=new Uint8Array(3*e.length);for(let o=0;o<e.length;o++){var t=e.charCodeAt(o);if(128>t)i[r++]=t;else{if(2048>t)i[r++]=t>>6|192;else{if(55296<=t&&57343>=t){if(56319>=t&&o<e.length){let n=e.charCodeAt(++o);if(56320<=n&&57343>=n){t=1024*(t-55296)+n-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}o--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}var eo,ef=Zp(610401301,!1),Rc=Zp(572417392,!0),bp=xc.navigator;function gc(e){return!!ef&&!!eo&&eo.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Je(e){var t;return(t=xc.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function tr(){return!!ef&&!!eo&&0<eo.brands.length}function uc(){return tr()?gc("Chromium"):(Je("Chrome")||Je("CriOS"))&&!(!tr()&&Je("Edge"))||Je("Silk")}eo=bp&&bp.userAgentData||null;var J0=!tr()&&(Je("Trident")||Je("MSIE"));!Je("Android")||uc(),uc(),Je("Safari")&&(uc()||!tr()&&Je("Coast")||!tr()&&Je("Opera")||!tr()&&Je("Edge")||(tr()?gc("Microsoft Edge"):Je("Edg/"))||tr()&&gc("Opera"));var tf={},Ki=null;function Y0(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);var i=new Uint8Array(r),o=0;return function(n,s){function a(g){for(;c<n.length;){var h=n.charAt(c++),m=Ki[h];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return g}rf();for(var c=0;;){var l=a(-1),u=a(0),d=a(64),f=a(64);if(f===64&&l===-1)break;s(l<<2|u>>4),d!=64&&(s(u<<4&240|d>>2),f!=64&&s(d<<6&192|f))}}(e,function(n){i[o++]=n}),o!==r?i.subarray(0,o):i}function rf(){if(!Ki){Ki={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));tf[r]=i;for(var o=0;o<i.length;o++){var n=i[o];Ki[n]===void 0&&(Ki[n]=o)}}}}var of=typeof Uint8Array<"u",nf=!J0&&typeof btoa=="function";function wp(e){if(!nf){var t;t===void 0&&(t=0),rf(),t=tf[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var o=e[c],n=e[c+1],s=e[c+2],a=t[o>>2];o=t[(3&o)<<4|n>>4],n=t[(15&n)<<2|s>>6],s=t[63&s],r[l++]=a+o+n+s}switch(a=0,s=i,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||i;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var Sp=/[-_.]/g,Z0={"-":"+",_:"/",".":"="};function Q0(e){return Z0[e]||""}function sf(e){if(!nf)return Y0(e);Sp.test(e)&&(e=e.replace(Sp,Q0)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function ns(e){return of&&e!=null&&e instanceof Uint8Array}var eg;function ss(){return eg||=new Uint8Array(0)}var ri={},tg;function af(e){if(e!==ri)throw Error("illegal external caller")}function ii(){return tg||=new rr(null,ri)}function Cc(e){af(ri);var t=e.D;return(t=t==null||ns(t)?t:typeof t=="string"?sf(t):null)==null?t:e.D=t}var rr=class{constructor(e,t){if(af(t),this.D=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}P(){let e=Cc(this);return e?new Uint8Array(e):ss()}};function cf(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Pc(){return Error("Failed to read varint, encoding is invalid.")}function lf(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function uf(e){return e.length==0?ii():new rr(e,ri)}function Ic(e){if(typeof e=="string")return{buffer:sf(e),A:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),A:!1};if(e.constructor===Uint8Array)return{buffer:e,A:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),A:!1};if(e.constructor===rr)return{buffer:Cc(e)||ss(),A:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),A:!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 Oc(){return typeof BigInt=="function"}var Ep=!Rc,_p=!Rc,rg=typeof Uint8Array.prototype.slice=="function",df,H=0,te=0;function ti(e){let t=0>e,r=(e=Math.abs(e))>>>0;if(e=Math.floor((e-r)/4294967296),t){let[i,o]=Fc(r,e);e=o,r=i}H=r>>>0,te=e>>>0}function hf(e){let t=df||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),te=0,H=t.getUint32(0,!0)}function yc(e,t){return 4294967296*t+(e>>>0)}function Dc(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=yc(e,t),r?-e:e}function qn(e,t){if(e>>>=0,2097151>=(t>>>=0))var r=""+(4294967296*t+e);else Oc()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),r=t+kp(r)+kp(e));return r}function kp(e){return e=String(e),"0000000".slice(e.length)+e}function as(e){if(16>e.length)ti(Number(e));else if(Oc())e=BigInt(e),H=Number(e&BigInt(4294967295))>>>0,te=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");te=H=0;let r=e.length;for(let i=t,o=(r-t)%6+t;o<=r;i=o,o+=6){let n=Number(e.slice(i,o));te*=1e6,H=1e6*H+n,4294967296<=H&&(te+=Math.trunc(H/4294967296),te>>>=0,H>>>=0)}if(t){let[i,o]=Fc(H,te);H=i,te=o}}}function Fc(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Bc(e,t){let r,i=0,o=0,n=0,s=e.i,a=e.g;do r=s[a++],i|=(127&r)<<n,n+=7;while(32>n&&128&r);for(32<n&&(o|=(127&r)>>4),n=3;32>n&&128&r;n+=7)r=s[a++],o|=(127&r)<<n;if(vr(e,a),128>r)return t(i>>>0,o>>>0);throw Pc()}function Mc(e){let t=0,r=e.g,i=r+10,o=e.i;for(;r<i;){let n=o[r++];if(t|=n,(128&n)==0)return vr(e,r),!!(127&t)}throw Pc()}function Le(e){let t=e.i,r=e.g,i=t[r++],o=127&i;if(128&i&&(i=t[r++],o|=(127&i)<<7,128&i&&(i=t[r++],o|=(127&i)<<14,128&i&&(i=t[r++],o|=(127&i)<<21,128&i&&(i=t[r++],o|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Pc();return vr(e,r),o}function vc(e){var t=e.i;let r=e.g,i=t[r],o=t[r+1],n=t[r+2];return t=t[r+3],vr(e,e.g+4),(i<<0|o<<8|n<<16|t<<24)>>>0}function bc(e){var t=vc(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:1/0*e:r==0?e*Math.pow(2,-149)*t:e*Math.pow(2,r-150)*(t+Math.pow(2,23))}function ig(e){return Le(e)}function dc(e,t,{F:r=!1}={}){e.F=r,t&&(t=Ic(t),e.i=t.buffer,e.m=t.A,e.u=0,e.j=e.i.length,e.g=e.u)}function vr(e,t){if(e.g=t,t>e.j)throw lf(e.j,t)}function pf(e,t){if(0>t)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,i=r+t;if(i>e.j)throw lf(t,e.j-r);return e.g=i,r}function ff(e,t){if(t==0)return ii();var r=pf(e,t);return e.F&&e.m?r=e.i.subarray(r,r+t):(e=e.i,r=r===(t=r+t)?ss():rg?e.slice(r,t):new Uint8Array(e.subarray(r,t))),uf(r)}var Ap=[];function mf(e){var t=e.g;if(t.g==t.j)return!1;e.j=e.g.g;var r=Le(e.g)>>>0;if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw cf(r,e.j);if(1>t)throw Error(`Invalid field number: ${t} (at position ${e.j})`);return e.m=t,e.i=r,!0}function zn(e){switch(e.i){case 0:e.i!=0?zn(e):Mc(e.g);break;case 1:vr(e=e.g,e.g+8);break;case 2:if(e.i!=2)zn(e);else{var t=Le(e.g)>>>0;vr(e=e.g,e.g+t)}break;case 5:vr(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!mf(e))throw Error("Unmatched start-group tag: stream EOF");if(e.i==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}zn(e)}break;default:throw cf(e.i,e.j)}}function cs(e,t,r){let i=e.g.j,o=Le(e.g)>>>0,n=e.g.g+o,s=n-i;if(0>=s&&(e.g.j=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);e.g.g=n,e.g.j=i}function Lc(e){var t=Le(e.g)>>>0,r=pf(e=e.g,t);if(e=e.i,$0){var i,o=e;(i=lc)||(i=lc=new TextDecoder("utf-8",{fatal:!0})),t=r+t,o=r===0&&t===o.length?o:o.subarray(r,t);try{var n=i.decode(o)}catch(a){if(Nn===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),Nn=!0}catch{Nn=!1}}throw!Nn&&(lc=void 0),a}}else{t=(n=r)+t,r=[];let a,c=null;for(;n<t;){var s=e[n++];128>s?r.push(s):224>s?n>=t?mr():(a=e[n++],194>s||(192&a)!=128?(n--,mr()):r.push((31&s)<<6|63&a)):240>s?n>=t-1?mr():(a=e[n++],(192&a)!=128||s===224&&160>a||s===237&&160<=a||(192&(i=e[n++]))!=128?(n--,mr()):r.push((15&s)<<12|(63&a)<<6|63&i)):244>=s?n>=t-2?mr():(a=e[n++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(i=e[n++]))!=128||(192&(o=e[n++]))!=128?(n--,mr()):(s=(7&s)<<18|(63&a)<<12|(63&i)<<6|63&o,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):mr(),8192<=r.length&&(c=vp(c,r),r.length=0)}n=vp(c,r)}return n}function gf(e){let t=Le(e.g)>>>0;return ff(e.g,t)}function Uc(e,t,r){var i=Le(e.g)>>>0;for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var jn=[];function Tp(e){return e?/^\d+$/.test(e)?(as(e),new xp(H,te)):null:og||=new xp(0,0)}var xp=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},og;function Rp(e){return e?/^-?\d+$/.test(e)?(as(e),new Cp(H,te)):null:ng||=new Cp(0,0)}var Cp=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},ng;function $n(e,t,r){for(;0<r||127<t;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ls(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function us(e,t){if(0<=t)ls(e,t);else{for(let r=0;9>r;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Xn(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 oi(e,t){t.length!==0&&(e.j.push(t),e.i+=t.length)}function At(e,t,r){ls(e.g,8*t+r)}function Nc(e,t){return At(e,t,2),t=e.g.end(),oi(e,t),t.push(e.i),t}function jc(e,t){var r=t.pop();for(r=e.i+e.g.length()-r;127<r;)t.push(127&r|128),r>>>=7,e.i++;t.push(r),e.i++}function ds(e,t,r){At(e,t,2),ls(e.g,r.length),oi(e,e.g.end()),oi(e,r)}var Et,_t=class{constructor(t,r,i,o){this.g=t,this.i=r,this.j=i,this.N=o}};function Ue(e){return Array.prototype.slice.call(e)}var Vc=(Et=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():void 0)?(e,t)=>{e[Et]|=t}:(e,t)=>{e.o!==void 0?e.o|=t:Object.defineProperties(e,{o:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function Pp(e){let t=re(e);(1&t)!=1&&(Object.isFrozen(e)&&(e=Ue(e)),J(e,1|t))}var wc=Et?(e,t)=>{e[Et]&=~t}:(e,t)=>{e.o!==void 0&&(e.o&=~t)};function pe(e,t,r){return r?e|t:e&~t}var re=Et?e=>0|e[Et]:e=>0|e.o,O=Et?e=>e[Et]:e=>e.o,J=Et?(e,t)=>{e[Et]=t}:(e,t)=>{e.o!==void 0?e.o=t:Object.defineProperties(e,{o:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function Ip(){var e=[];return Vc(e,1),e}function sg(e,t){J(t,-14591&(0|e))}function Sc(e,t){J(t,-14557&(34|e))}function Kn(e){return(e=e>>14&1023)===0?536870912:e}var oo={},ag={};function Op(e){return!(!e||typeof e!="object"||e.W!==ag)}function Ji(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}var yf=!Rc;function vf(e,t,r){if(e!=null){if(typeof e=="string")e=e?new rr(e,ri):ii();else if(e.constructor!==rr)if(ns(e))e=r?uf(e):e.length?new rr(new Uint8Array(e),ri):ii();else{if(!t)throw Error();e=void 0}}return e}function Ec(e,t,r){if(!Array.isArray(e)||e.length)return!1;let i=re(e);return!!(1&i)||!(!t||!(Array.isArray(t)?t.includes(r):t.has(r)))&&(J(e,1|i),!0)}var yr,Dp=[];function Mt(e){if(2&e)throw Error()}var ir,to;function bf(e,t){(t=ir?t[ir]:void 0)&&(e[ir]=Ue(t))}J(Dp,55),yr=Object.freeze(Dp);function Fp(){let e=Error("int32");return e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity="warning",e}function no(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Bp(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}Object.freeze(new class{}),Object.freeze(new class{});var cg=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zc(e){let t=typeof e;return t==="number"?Number.isFinite(e):t==="string"&&cg.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 Mp(e){return e[0]!=="-"&&(20>e.length||e.length===20&&184467>Number(e.substring(0,6)))}function wf(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(ti(e),e=Dc(H,te)),e}function Sf(e){var t=Math.trunc(Number(e));if(Number.isSafeInteger(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),!(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))))if(as(e),e=H,2147483648&(t=te))if(Oc())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,i]=Fc(e,t);e="-"+qn(r,i)}else e=qn(e,t);return e}function Ef(e){if(typeof e!="string")throw Error();return e}function Jn(e){if(e!=null&&typeof e!="string")throw Error();return e}function br(e){return e==null||typeof e=="string"?e:void 0}function _f(e,t,r){if(e!=null&&typeof e=="object"&&e.C===oo)return e;if(Array.isArray(e)){var i=re(e),o=i;return o===0&&(o|=32&r),(o|=2&r)!==i&&J(e,o),new t(e)}}var Yn,Gc,lg;function Zn(e){switch(typeof e){case"boolean":return Gc||=[0,void 0,!0];case"number":return 0<e?void 0:e===0?lg||=[0,void 0]:[-e,void 0];case"string":return[0,e];case"object":return e}}function ro(e,t,r){if(e==null&&(e=Yn),Yn=void 0,e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error();if(64&(i=re(e)))return to&&delete e[to],e;if(i|=64,r&&(i|=512,r!==e[0]))throw Error();e:{let o=(r=e).length;if(o){let n=o-1;if(Ji(r[n])){if(1024<=(t=n-(+!!(512&(i|=256))-1)))throw Error();i=-16760833&i|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&i)-1))))throw Error();i=-16760833&i|(1023&t)<<14}}}return J(e,i),e}function kf(e,t,r,i,o,n){if(e!=null){if(Array.isArray(e))e=o&&e.length==0&&1&re(e)?void 0:n&&2&re(e)?e:Hc(e,t,r,i!==void 0,o,n);else if(Ji(e)){let s={};for(let a in e)s[a]=kf(e[a],t,r,i,o,n);e=s}else e=t(e,i);return e}}function Hc(e,t,r,i,o,n){let s=i||r?re(e):0;i=i?!!(32&s):void 0;let a=Ue(e);for(let c=0;c<a.length;c++)a[c]=kf(a[c],t,r,i,o,n);return r&&(bf(a,e),r(s,a)),a}function ug(e){return e.C===oo?e.toJSON():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))return yf||!Ec(t,void 0,9999)?t:void 0;if(ns(t))return wp(t);if(t instanceof rr){let r=t.D;return r==null?"":typeof r=="string"?r:t.D=wp(r)}}}return t}(e)}function Af(e,t,r=Sc){if(e!=null){if(of&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=re(e);return 2&i?e:(t&&=i===0||!!(32&i)&&!(64&i||!(16&i)),t?(J(e,-12293&(34|i)),e):Hc(e,Af,4&i?Sc:r,!0,!1,!0))}return e.C===oo&&(r=e.l,e=2&(i=O(r))?e:Wc(e,r,i,!0)),e}}function Tf(e){let t=e.l;return Wc(e,t,O(t),!1)}function Wc(e,t,r,i){return e=e.constructor,Yn=t=xf(t,r,i),t=new e(t),Yn=void 0,t}function xf(e,t,r){let i=r||2&t?Sc:sg,o=!!(32&t);return e=function(n,s,a){let c=Ue(n);var l=c.length;let u=256&s?c[l-1]:void 0;for(l+=u?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(u){s=c[s]={};for(let d in u)s[d]=a(u[d])}return bf(c,n),c}(e,t,n=>Af(n,o,i)),Vc(e,32|(r?2:0)),e}function qc(e){let t=e.l,r=O(t);return 2&r?Wc(e,t,r,!1):e}function Bt(e,t){return nr(e=e.l,O(e),t)}function nr(e,t,r,i){if(r===-1)return null;if(r>=Kn(t)){if(256&t)return e[e.length-1][r]}else{var o=e.length;if(i&&256&t&&(i=e[o-1][r])!=null)return i;if((t=r+(+!!(512&t)-1))<o)return e[t]}}function fe(e,t,r,i){let o=e.l,n=O(o);return Mt(n),Y(o,n,t,r,i),e}function Y(e,t,r,i,o){var n=Kn(t);if(r>=n||o){if(o=t,256&t)n=e[e.length-1];else{if(i==null)return o;n=e[n+(+!!(512&t)-1)]={},o|=256}return n[r]=i,o!==t&&J(e,o),o}return e[r+(+!!(512&t)-1)]=i,256&t&&r in(e=e[e.length-1])&&delete e[r],t}function so(e,t,r,i,o){var n=2&t;let s=nr(e,t,r,o);Array.isArray(s)||(s=yr);let a=!(2&i);i=!(1&i);let c=!!(32&t),l=re(s);return l!==0||!c||n||a?1&l||(l|=1,J(s,l)):(l|=33,J(s,l)),n?(e=!1,2&l||(Vc(s,34),e=!!(4&l)),(i||e)&&Object.freeze(s)):(n=!!(2&l)||!!(2048&l),i&&n?(s=Ue(s),i=1,c&&!a&&(i|=32),J(s,i),Y(e,t,r,s,o)):a&&32&l&&!n&&wc(s,32)),s}function Rf(e){e=e.l;let t=O(e),r=nr(e,t,1),i=vf(r,!0,!!(34&t));return i!=null&&i!==r&&Y(e,t,1,i),i}function Cf(e,t){return e=nr(e,t,1),Array.isArray(e)?e:yr}function Pf(e,t,r){return e===0&&(e=Sr(e,t,r)),pe(e,1,!0)}function Yi(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function Lp(e,t,r){{let s=e.l,a=O(s);if(Mt(a),r==null)Y(s,a,t);else{var i,o=e=re(r),n=!!(2&e)||Object.isFrozen(r);if((i=!n)&&(i=!1),!(4&e))for(e=21,n&&(r=Ue(r),o=0,e=Sr(e,a,!0)),n=0;n<r.length;n++)r[n]=Ef(r[n]);i&&(r=Ue(r),o=0,e=Sr(e,a,!0)),e!==o&&J(r,e),Y(s,a,t,r)}}}function If(e,t){e=e.l;let r=O(e);Mt(r),Y(e,r,2,t===""?void 0:t)}function Of(e,t,r,i){let o=O(e);Mt(o),e=so(e,o,t,2),i=r(i,!!(4&(t=re(e)))&&!!(4096&t)),e.push(i)}function dg(e){return e}function hc(e,t){return $c(e=e.l,O(e),ym)===t?t:-1}function $c(e,t,r){let i=0;for(let o=0;o<r.length;o++){let n=r[o];nr(e,t,n)!=null&&(i!==0&&(t=Y(e,t,i)),i=n)}return i}function Xc(e,t,r,i){let o=O(e);Mt(o);let n=nr(e,o,r,i),s;if(n!=null&&n.C===oo)return(t=qc(n))!==n&&Y(e,o,r,t,i),t.l;if(Array.isArray(n)){let a=re(n);s=2&a?xf(n,a,!1):n,s=ro(s,t[0],t[1])}else s=ro(void 0,t[0],t[1]);return s!==n&&Y(e,o,r,s,i),s}function Df(e,t,r,i){e=e.l;let o=O(e),n=nr(e,o,r,i);return(t=_f(n,t,o))!==n&&t!=null&&Y(e,o,r,t,i),t}function at(e,t,r){if((t=Df(e,t,r,!1))==null)return t;e=e.l;let i=O(e);if(!(2&i)){let o=qc(t);o!==t&&Y(e,i,r,t=o,!1)}return t}function Ff(e,t,r,i,o){var n=!!(2&t),s=n?1:2;let a=s===1;s=s===2,i=!!i,o&&=!n,n=Cf(e,t);var c=re(n);let l=!!(4&c);if(!l){var u,d=n,f=t;(u=!!(2&(c=Pf(c,t,i))))&&(f=pe(f,2,!0));let g=!u,h=!0,m=0,y=0;for(;m<d.length;m++){let b=_f(d[m],r,f);if(b instanceof r){if(!u){let k=!!(2&re(b.l));g&&=!k,h&&=k}d[y++]=b}}y<m&&(d.length=y),c=pe(c,4,!0),c=pe(c,16,h),c=pe(c,8,g),J(d,c),u&&Object.freeze(d)}if(r=!!(8&c)||a&&!n.length,o&&!r){for(Yi(c)&&(n=Ue(n),c=Sr(c,t,i),t=Y(e,t,1,n)),o=n,r=c,d=0;d<o.length;d++)(c=o[d])!==(f=qc(c))&&(o[d]=f);r=pe(r,8,!0),r=pe(r,16,!o.length),J(o,r),c=r}return Yi(c)||(o=c,a?c=pe(c,!n.length||16&c&&(!l||32&c)?2:2048,!0):i||(c=pe(c,32,!1)),c!==o&&J(n,c),a&&Object.freeze(n)),s&&Yi(c)&&(n=Ue(n),c=Sr(c,t,i),J(n,c),Y(e,t,1,n)),n}function Kc(e,t){e=e.l;let r=O(e);return Ff(e,r,t,!1,!(2&r))}function ct(e,t,r,i,o){return i==null&&(i=void 0),fe(e,r,i,o)}function pc(e,t,r){var i=hm;r==null&&(r=void 0),e=e.l;let o=O(e);Mt(o),(i=$c(e,o,i))&&i!==t&&r!=null&&(o=Y(e,o,i)),Y(e,o,t,r)}function Sr(e,t,r){return e=pe(e,2,!!(2&t)),e=pe(e,32,!!(32&t)&&r),pe(e,2048,!1)}function Bf(e,t){var r=ys;e=e.l;let i=O(e);Mt(i),e=Ff(e,i,r,!0),t=t??new r,e.push(t),2&re(t.l)?wc(e,8):wc(e,16)}function _c(e){return(e=Bt(e,2))==null?e:zc(e)?typeof e=="number"?wf(e):Sf(e):void 0}function Mf(e){return e??0}function Ce(e,t,r){Of(e.l,t,Ef,r)}function Lf(e,t,r){t.g?t.j(e,t.g,t.i,r,!0):t.j(e,t.i,r,!0)}var W=class{constructor(e,t){this.l=ro(e,t)}toJSON(){return Uf(this,Hc(this.l,ug,void 0,void 0,!1,!1),!0)}A(){return!!(2&re(this.l))}};function Uf(e,t,r){let i=e.constructor.v;var o=O(r?e.l:t),n=Kn(o),s=!1;if(i&&yf){if(!r){var a;if((t=Ue(t)).length&&Ji(a=t[t.length-1])){for(s=0;s<i.length;s++)if(i[s]>=n){Object.assign(t[t.length-1]={},a);break}}s=!0}var c;n=t,r=!r,e=Kn(a=O(e.l)),a=+!!(512&a)-1;for(let y=0;y<i.length;y++){var l=i[y];if(l<e){var u=n[l+=a];u==null?n[l]=r?yr:Ip():r&&u!==yr&&Pp(u)}else{if(!c){var d=void 0;n.length&&Ji(d=n[n.length-1])?c=d:n.push(c={})}u=c[l],c[l]==null?c[l]=r?yr:Ip():r&&u!==yr&&Pp(u)}}}if(!(c=t.length))return t;let f,g;if(Ji(d=t[c-1])){e:{var h=d;for(var m in n={},r=!1,h)e=h[m],Array.isArray(e)&&(a=e,(!_p&&Ec(e,i,+m)||!Ep&&Op(e)&&e.size===0)&&(e=null),e!=a&&(r=!0)),e!=null?n[m]=e:r=!0;if(r){for(let y in n){h=n;break e}h=null}}h!=d&&(f=!0),c--}for(o=+!!(512&o)-1;0<c&&((d=t[m=c-1])==null||!_p&&Ec(d,i,m-o)||!Ep&&Op(d)&&d.size===0);c--)g=!0;return(f||g)&&(t=s?t:Array.prototype.slice.call(t,0,c),s&&(t.length=c),h&&t.push(h)),t}function Nf(e){return Array.isArray(e)?e[0]instanceof _t?e:[Eg,e]:[e,void 0]}function hs(e,t){if(Array.isArray(t)){var r=re(t);if(4&r)return t;for(var i=0,o=0;i<t.length;i++){let n=e(t[i]);n!=null&&(t[o++]=n)}return o<i&&(t.length=o),J(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}W.prototype.C=oo,W.prototype.toString=function(){return Uf(this,this.l,!1).toString()};var Up=Symbol();function Jc(e){let t=e[Up];if(!t){let r=zf(e),i=Zc(e),o=i.g;t=o?(n,s)=>o(n,s,i):(n,s)=>{for(;mf(s)&&s.i!=4;){var a=s.m,c=i[a];if(!c){var l=i.K;l&&(l=l[a])&&(c=i[a]=hg(l))}c&&c(s,n,a)||(a=(c=s).j,zn(c),c.J?c=void 0:(l=c.g.g-a,c.g.g=a,c=ff(c.g,l)),a=n,c&&(ir||=Symbol(),(l=a[ir])?l.push(c):a[ir]=[c]))}r===jf||r===Vf||r.T||(n[to||=Symbol()]=r)},e[Up]=t}return t}function hg(e){let t=(e=Nf(e))[0].g;if(e=e[1]){let r=Jc(e),i=Zc(e).B;return(o,n,s)=>t(o,n,s,i,r)}return t}var jf,Vf,Gn=Symbol();function pg(e,t,r){let i=r[1],o;if(i){let n=i[Gn];o=n?n.B:Zn(i[0]),e[t]=n??i}o&&o===Gc?(e.L||(e.L=[])).push(t):r[0]&&(e.M||(e.M=[])).push(t)}function Np(e,t){return[e.j,!t||0<t[0]?void 0:t]}function zf(e){var t=e[Gn];if(t)return t;if(!(t=Yc(e,e[Gn]={},Np,Np,pg)).M&&!t.L){let r=!0;for(let i in t){isNaN(i)||(r=!1);break}r?(t=Zn(e[0])===Gc,t=e[Gn]=t?Vf||={B:Zn(!0)}:jf||={}):t.T=!0}return t}function fg(e,t,r){e[t]=r}function Yc(e,t,r,i,o=fg){t.B=Zn(e[0]);let n=0;var s=e[++n];s&&s.constructor===Object&&(t.K=s,typeof(s=e[++n])=="function"&&(t.g=s,t.i=e[++n],s=e[++n]));let a={};for(;Array.isArray(s)&&typeof s[0]=="number"&&0<s[0];){for(var c=0;c<s.length;c++)a[s[c]]=s;s=e[++n]}for(c=1;s!==void 0;){let d;typeof s=="number"&&(c+=s,s=e[++n]);var l=void 0;if(s instanceof _t?d=s:(d=_g,n--),d.N){s=e[++n],l=e;var u=n;typeof s=="function"&&(s=s(),l[u]=s),l=s}for(u=c+1,typeof(s=e[++n])=="number"&&0>s&&(u-=s,s=e[++n]);c<u;c++){let f=a[c];o(t,c,l?i(d,l,f):r(d,f))}}return t}var jp=Symbol();function Gf(e){let t=e[jp];if(!t){let r=ps(e);t=(i,o)=>Hf(i,o,r),e[jp]=t}return t}var Hn=Symbol();function mg(e){return e.i}function gg(e,t){let r,i,o=e.i;return(n,s,a)=>o(n,s,a,i||=ps(t).B,r||=Gf(t))}function ps(e){let t=e[Hn];return t||(t=Yc(e,e[Hn]={},mg,gg),Wn in e&&Hn in e&&(e.length=0),t)}var Wn=Symbol();function yg(e,t){let r=e.g;return t?(i,o,n)=>r(i,o,n,t):r}function vg(e,t,r){let i=e.g,o,n;return(s,a,c)=>i(s,a,c,n||=Zc(t).B,o||=Jc(t),r)}function Zc(e){let t=e[Wn];return t||(zf(e),t=Yc(e,e[Wn]={},yg,vg),Wn in e&&Hn in e&&(e.length=0),t)}function Vp(e,t){var r=e[t];if(r)return r;if((r=e.K)&&(r=r[t])){var i=(r=Nf(r))[0].i;if(r=r[1]){let o=Gf(r),n=ps(r).B;r=(r=e.i)?r(n,o):(s,a,c)=>i(s,a,c,n,o)}else r=i;return e[t]=r}}function Hf(e,t,r){for(var i=O(e),o=+!!(512&i)-1,n=e.length,s=512&i?1:0,a=n+(256&i?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-o,u=Vp(r,l);u&&u(t,c,l)}if(256&i){i=e[n-1];for(let c in i)o=+c,Number.isNaN(o)||(n=i[c])!=null&&(a=Vp(r,o))&&a(t,n,o)}if(e=ir?e[ir]:void 0)for(oi(t,t.g.end()),r=0;r<e.length;r++)oi(t,Cc(e[r])||ss())}function Pe(e,t){return new _t(e,t,!1,!1)}function fs(e,t){return new _t(e,t,!0,!1)}function Ie(e,t,r){Y(e,O(e),t,r)}function Wf(e,t,r){e:if(t!=null){if(zc(t)){if(typeof t=="string"){t=Sf(t);break e}if(typeof t=="number"){t=wf(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&Rp(t),t!=null&&(At(e,r,0),typeof t=="number"?(e=e.g,ti(t),$n(e,H,te)):(r=Rp(t),$n(e.g,r.i,r.g))))}function qf(e,t,r){(t=wr(t))!=null&&t!=null&&(At(e,r,0),us(e.g,t))}function $f(e,t,r){(t=t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0)!=null&&(At(e,r,0),e.g.g.push(t?1:0))}function Xf(e,t,r){(t=br(t))!=null&&ds(e,r,Qp(t))}function ms(e,t,r,i,o){(t=t instanceof W?t.l:Array.isArray(t)?ro(t,i[0],i[1]):void 0)!=null&&(r=Nc(e,r),o(t,e),jc(e,r))}function Kf(e,t,r){(t=t==null||typeof t=="string"||ns(t)||t instanceof rr?t:void 0)!=null&&ds(e,r,Ic(t).buffer)}var Ye,bg=Pe(function(e,t,r){if(e.i!==1)return!1;var i=e.g;e=vc(i);let o=vc(i);i=2*(o>>31)+1;let n=o>>>20&2047;return e=4294967296*(1048575&o)+e,Ie(t,r,n==2047?e?NaN:1/0*i:n==0?i*Math.pow(2,-1074)*e:i*Math.pow(2,n-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=no(t))!=null&&(At(e,r,1),e=e.g,(r=df||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),H=r.getUint32(0,!0),te=r.getUint32(4,!0),Xn(e,H),Xn(e,te))}),Jf=Pe(function(e,t,r){return e.i===5&&(Ie(t,r,bc(e.g)),!0)},function(e,t,r){(t=no(t))!=null&&(At(e,r,5),e=e.g,hf(t),Xn(e,H))}),wg=fs(function(e,t,r){return(e.i===5||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,bc,t):t.push(bc(e.g)),!0)},function(e,t,r){if((t=hs(no,t))!=null&&t.length){At(e,r,2),ls(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,hf(t[i]),Xn(r,H)}}),Qn=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Bc(e.g,Dc)),!0)},Wf),fc=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Bc(e.g,Dc))===0?void 0:e),!0)},Wf),Sg=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Bc(e.g,yc)),!0)},function(e,t,r){e:if(t!=null){if(zc(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)),Mp(t)||(as(t),t=qn(H,te)));break e}if(typeof t=="number"){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(o){if(0>o){ti(o);let n=qn(H,te);return o=Number(n),Number.isSafeInteger(o)?o:n}return Mp(String(o))?o:(ti(o),yc(H,te))}(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&Tp(t),t!=null&&(At(e,r,0),typeof t=="number"?(e=e.g,ti(t),$n(e,H,te)):(r=Tp(t),$n(e.g,r.i,r.g))))}),sr=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Le(e.g)),!0)},qf),Yf=fs(function(e,t,r){return(e.i===0||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,Le,t):t.push(Le(e.g)),!0)},function(e,t,r){if((t=hs(wr,t))!=null&&t.length){r=Nc(e,r);for(let i=0;i<t.length;i++)us(e.g,t[i]);jc(e,r)}}),ni=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Le(e.g))===0?void 0:e),!0)},qf),kt=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Mc(e.g)),!0)},$f),Zi=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Mc(e.g))===!1?void 0:e),!0)},$f),lt=fs(function(e,t,r){return e.i===2&&(Of(t,r,dg,e=Lc(e)),!0)},function(e,t,r){if((t=hs(br,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&ds(i,o,Qp(n))}}),or=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,(e=Lc(e))===""?void 0:e),!0)},Xf),ge=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,Lc(e)),!0)},Xf),Eg=new _t(function(e,t,r,i,o){return e.i===2&&(cs(e,Xc(t,i,r,!0),o),!0)},ms,!1,!0),_g=new _t(function(e,t,r,i,o){return e.i===2&&(cs(e,Xc(t,i,r),o),!0)},ms,!1,!0);Ye=new _t(function(e,t,r,i,o){if(e.i!==2)return!1;i=ro(void 0,i[0],i[1]);let n=O(t);Mt(n);let s=so(t,n,r,3);return n=O(t),4&re(s)&&(s=Ue(s),J(s,-2079&(1|re(s))),Y(t,n,r,s)),s.push(i),cs(e,i,o),!0},function(e,t,r,i,o){if(Array.isArray(t))for(let n=0;n<t.length;n++)ms(e,t[n],r,i,o)},!0,!0);var Ze=new _t(function(e,t,r,i,o,n){if(e.i!==2)return!1;let s=O(t);return Mt(s),(n=$c(t,s,n))&&r!==n&&Y(t,s,n),cs(e,t=Xc(t,i,r),o),!0},ms,!1,!0),Zf=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,gf(e)),!0)},Kf),io=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Le(e.g)),!0)},function(e,t,r){(t=wr(t))!=null&&(t=parseInt(t,10),At(e,r,0),us(e.g,t))}),kg=fs(function(e,t,r){return(e.i===0||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,ig,t):t.push(Le(e.g)),!0)},function(e,t,r){if((t=hs(wr,t))!=null&&t.length){r=Nc(e,r);for(let i=0;i<t.length;i++)us(e.g,t[i]);jc(e,r)}}),es=class{constructor(t,r){this.i=t,this.g=r,this.j=ct,this.defaultValue=void 0}};function Qf(e,t){return(r,i)=>{e:{if(jn.length){let n=jn.pop();n.s(i),dc(n.g,r,i),r=n}else r=new class{constructor(n,s){if(Ap.length){let a=Ap.pop();dc(a,n,s),n=a}else n=new class{constructor(a,c){this.i=null,this.m=!1,this.g=this.j=this.u=0,dc(this,a,c)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.F=!1}}(n,s);this.g=n,this.j=this.g.g,this.i=this.m=-1,this.s(s)}s({J:n=!1}={}){this.J=n}}(r,i);try{let n=new e,s=n.l;Jc(t)(s,r),to&&delete s[to];var o=n;break e}finally{r.g.clear(),r.m=-1,r.i=-1,100>jn.length&&jn.push(r)}o=void 0}return o}}var em=[0,or,Pe(function(e,t,r){return e.i===2&&(Ie(t,r,(e=gf(e))===ii()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof W){let i=t.X;return void(i&&(t=i(t),t!=null&&ds(e,r,Ic(t).buffer)))}if(Array.isArray(t))return}Kf(e,t,r)})],Ag=[0,ge],tm=[0,sr,io,kt,-1,Yf,io,-1],Tg=[0,kt,-1],rm=class extends W{constructor(){super()}};rm.v=[6];var im=[0,kt,ge,kt,io,-1,kg,ge,-1,Tg,io],om=[0,ge,-2],zp=class extends W{constructor(){super()}},nm=[0],sm=[0,sr,kt,-2],am=class extends W{constructor(e){super(e,2)}},gs={},xg=[-2,gs,kt];gs[336783863]=[0,ge,kt,-1,sr,[0,[1,2,3,4,5],Ze,nm,Ze,im,Ze,om,Ze,sm,Ze,tm],Ag];var Rg=[0,or,Zi],cm=[0,fc,-1,Zi,-3,fc,Yf,or,ni,fc,-1,Zi,ni,Zi,-2,or],ao=[-1,{}],lm=[0,ge,1,ao],um=[0,ge,lt,ao],ys=class extends W{constructor(e){super(e,500)}s(e){return ct(this,0,7,e)}};ys.v=[3,4,5,6,8,13,17,1005];var Gp,Cg=[-500,or,-1,lt,-3,xg,Ye,em,ni,-1,lm,um,Ye,Rg,or,cm,ni,lt,987,lt],Pg=[0,or,-1,ao],Ig=[-500,ge,-1,[-1,{}],998,ge],Og=[-500,ge,lt,-1,[-2,{},kt],997,lt,-1],Dg=[-500,ge,lt,ao,998,lt],ts=class extends W{constructor(){super(void 0,500)}s(e){return ct(this,0,1001,e)}};ts.v=[1,6,7,9,10,15,16,17,14,1002],ts.prototype.g=(Gp=[-500,Ye,Cg,4,Ye,Ig,Ye,Og,ni,Ye,Dg,lt,ni,lm,um,Ye,Pg,lt,-2,cm,or,-1,Zi,979,ao,Ye,em],function(){let e=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let n=this.g;return this.g=[],n}}}};Hf(this.l,e,ps(Gp)),oi(e,e.g.end());let t=new Uint8Array(e.i),r=e.j,i=r.length,o=0;for(let n=0;n<i;n++){let s=r[n];t.set(s,o),o+=s.length}return e.j=[t],t});var Fg=class extends W{constructor(e){super(e)}},Bg=[0,sr,Jf,ge,-1],dm=class extends W{constructor(e){super(e)}g(){return Kc(this,Fg)}};dm.v=[1];var Mg=[0,Ye,Bg],kc=class extends W{constructor(e){super(e)}};kc.v=[4,5];var Hp=class extends W{constructor(e){super(e)}},hm=[1,2,3,4,5],rs=class extends W{constructor(e){super(e)}g(){return Rf(this)!=null}i(){return br(Bt(this,2))!=null}},is=class extends W{constructor(e){super(e)}},pm=[0,[0,Zf,ge,[0,sr,Qn,-1],[0,Sg,Qn]],kt,[0,hm,Ze,sm,Ze,im,Ze,tm,Ze,nm,Ze,om],io],fm=class extends W{constructor(e){super(e)}},Lg=new es(451755788,fm);gs[451755788]=[0,pm,[0,ge,sr,Jf,lt,-1],bg];var Wp=class extends W{constructor(e){super(e)}},mm=class extends W{constructor(e){super(e)}},Ug=new es(487277289,mm);gs[487277289]=[0,pm,[0,kt,-1]];var Ng=class extends W{constructor(e){super(e)}},jg=[0,1,sr,ge,Mg],gm=class extends W{constructor(e){super(e)}};gm.v=[1];var Vg=Qf(gm,[0,Ye,jg,Qn]),Ac=class extends W{constructor(e){super(e)}};Ac.v=[1];var zg=class extends W{constructor(e){super(e)}O(){let e=Rf(this);return e??ii()}},Gg=class extends W{constructor(e){super(e)}},ym=[1,2],Hg=[0,ym,Ze,[0,wg],Ze,[0,Zf],sr,ge],vm=class extends W{constructor(e){super(e)}};vm.v=[1];var qp=Qf(vm,[0,Ye,Hg,Qn]);async function $p(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",o=>{i(o)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function E(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.h.stringToNewUTF8(t)),e.h._free(t)}function Xp(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let i=new Uint32Array(t.length);for(let o=0;o<t.length;o++)i[o]=e.h.stringToNewUTF8(t[o]);t=e.h._malloc(4*i.length),e.h.HEAPU32.set(i,t>>2),r(t);for(let o of i)e.h._free(o);e.h._free(t)}function gr(e,t,r){e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=r}function Zr(e,t,r){let i=[];e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=(o,n,s)=>{n?(r(i,s),i=[]):i.push(o)}}var Wg=function(e){return class extends e{U(){this.h._registerModelResourcesGraphService()}}}(class{constructor(e,t){this.j=!0,this.h=e,this.g=null,this.i=0,this.m=typeof this.h._addIntToInputStream=="function",t!==void 0?this.h.canvas=t:((e=typeof OffscreenCanvas>"u")||(e=(e=navigator.userAgent).includes("Safari")&&!e.includes("Chrome")),e?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas")):this.h.canvas=new OffscreenCanvas(1,1))}async initializeGraph(e){let 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){let r=e.length,i=this.h._malloc(r);this.h.HEAPU8.set(e,i),t?this.h._changeBinaryGraph(r,i):this.h._changeTextGraph(r,i),this.h._free(i)}configureAudio(e,t,r,i,o){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),E(this,i||"input_audio",n=>{E(this,o=o||"audio_header",s=>{this.h._configureAudio(n,s,e,t,r)})})}setAutoResizeCanvas(e){this.j=e}setAutoRenderToScreen(e){this.h._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.h.gpuOriginForWebTexturesIsBottomLeft=e}attachErrorListener(e){this.h.errorListener=e}attachEmptyPacketListener(e,t){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,o){let n=4*e.length;this.i!==n&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(n),this.i=n),this.h.HEAPF32.set(e,this.g/4),E(this,i,s=>{this.h._addAudioToInputStream(this.g,t,r,s,o)})}addGpuBufferToStream(e,t,r){E(this,t,i=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");i?this.h._bindTextureToStream(i):this.h._bindTextureToCanvas();var o=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!o)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");let n;this.h.gpuOriginForWebTexturesIsBottomLeft&&o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,e),this.h.gpuOriginForWebTexturesIsBottomLeft&&o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(o=e.videoWidth,n=e.videoHeight):e.naturalWidth?(o=e.naturalWidth,n=e.naturalHeight):(o=e.width,n=e.height),!this.j||o===this.h.canvas.width&&n===this.h.canvas.height||(this.h.canvas.width=o,this.h.canvas.height=n);let[s,a]=[o,n];this.h._addBoundTextureToStream(i,s,a,r)})}addBoolToStream(e,t,r){E(this,t,i=>{this.h._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){E(this,t,i=>{this.h._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){E(this,t,i=>{this.h._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){E(this,t,i=>{this.h._addIntToInputStream(e,i,r)})}addStringToStream(e,t,r){E(this,t,i=>{E(this,e,o=>{this.h._addStringToInputStream(o,i,r)})})}addStringRecordToStream(e,t,r){E(this,t,i=>{Xp(this,Object.keys(e),o=>{Xp(this,Object.values(e),n=>{this.h._addFlatHashMapToInputStream(o,n,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){E(this,r,o=>{E(this,t,n=>{let s=this.h._malloc(e.length);this.h.HEAPU8.set(e,s),this.h._addProtoToInputStream(s,e.length,n,o,i),this.h._free(s)})})}addEmptyPacketToStream(e,t){E(this,e,r=>{this.h._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(let n of e)this.h._addBoolVectorEntry(o,n);this.h._addBoolVectorToInputStream(o,i,r)})}addDoubleVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(let n of e)this.h._addDoubleVectorEntry(o,n);this.h._addDoubleVectorToInputStream(o,i,r)})}addFloatVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(let n of e)this.h._addFloatVectorEntry(o,n);this.h._addFloatVectorToInputStream(o,i,r)})}addIntVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(let n of e)this.h._addIntVectorEntry(o,n);this.h._addIntVectorToInputStream(o,i,r)})}addStringVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(let n of e)E(this,n,s=>{this.h._addStringVectorEntry(o,s)});this.h._addStringVectorToInputStream(o,i,r)})}addBoolToInputSidePacket(e,t){E(this,t,r=>{this.h._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){E(this,t,r=>{this.h._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){E(this,t,r=>{this.h._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){E(this,t,r=>{this.h._addIntToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){E(this,t,r=>{E(this,e,i=>{this.h._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){E(this,r,i=>{E(this,t,o=>{let n=this.h._malloc(e.length);this.h.HEAPU8.set(e,n),this.h._addProtoToInputSidePacket(n,e.length,o,i),this.h._free(n)})})}addBoolVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.h._addBoolVectorEntry(i,o);this.h._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.h._addDoubleVectorEntry(i,o);this.h._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.h._addFloatVectorEntry(i,o);this.h._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.h._addIntVectorEntry(i,o);this.h._addIntVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)E(this,o,n=>{this.h._addStringVectorEntry(i,n)});this.h._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachBoolListener(r)})}attachBoolVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachBoolVectorListener(r)})}attachIntListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachIntListener(r)})}attachIntVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachIntVectorListener(r)})}attachDoubleListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachDoubleVectorListener(r)})}attachFloatListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachFloatListener(r)})}attachFloatVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachFloatVectorListener(r)})}attachStringListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachStringListener(r)})}attachStringVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachStringVectorListener(r)})}attachProtoListener(e,t,r){gr(this,e,t),E(this,e,i=>{this.h._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){Zr(this,e,t),E(this,e,i=>{this.h._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),gr(this,e,(i,o)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,o)}),E(this,e,i=>{this.h._attachAudioListener(i,r||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),bm=class extends Wg{};async function qg(e,t,r){return e=await(async(i,o,n,s)=>{if(o&&await $p(o),!self.ModuleFactory||n&&(await $p(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&s&&((o=self.Module).locateFile=s.locateFile,s.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=s.mainScriptUrlOrBlob)),s=await self.ModuleFactory(self.Module||s),self.ModuleFactory=self.Module=void 0,new i(s,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:i=>i.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&i.endsWith(".data")?t.assetBinaryPath.toString():i}),await e.s(r),e}async function wm(e,t,r){return qg(e,t,r)}function Kp(e,t){let r=at(e.baseOptions,rs,1)||new rs;typeof t=="string"?(fe(r,2,Jn(t)),fe(r,1)):t instanceof Uint8Array&&(fe(r,1,vf(t,!1,!1)),fe(r,2)),ct(e.baseOptions,0,1,r)}function Sm(e,t){let r=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(at(e.baseOptions,rs,1)?.g()||at(e.baseOptions,rs,1)?.i()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(i,o){let n=at(i.baseOptions,Hp,3);if(!n){var s=n=new Hp;pc(s,4,new zp)}"delegate"in o&&(o.delegate==="GPU"?pc(o=n,2,s=new rm):pc(o=n,4,s=new zp)),ct(i.baseOptions,0,3,n)}(e,r),r.modelAssetPath?fetch(r.modelAssetPath.toString()).then(i=>{if(i.ok)return i.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${i.status})`)}).then(i=>{try{e.g.h.FS_unlink("/model.dat")}catch{}e.g.h.FS_createDataFile("/","model.dat",new Uint8Array(i),!0,!1,!1),Kp(e,"/model.dat"),e.I()}):(Kp(e,r.modelAssetBuffer),e.I(),Promise.resolve())}function Jp(e){try{let t=e.j.length;if(t===1)throw Error(e.j[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.j.map(r=>r.message).join(", "))}finally{e.j=[]}}function Qr(e,t){e.u=Math.max(e.u,t)}var Tc=class{constructor(e){this.g=e,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.j.push(Error(i))}),this.g.U(),this.g.setGraph(e,t),Jp(this)}finishProcessing(){this.g.finishProcessing(),Jp(this)}close(){this.g.closeGraph()}};async function Qi(e,t,r){return wm(e,t,r)}Tc.prototype.close=Tc.prototype.close;var os=class extends Tc{constructor(){super(...arguments),this.H=48e3}V(e){this.H=e}};function $g(e){let t={classifications:Kc(e,Ng).map(r=>function(i,o=-1,n=""){return{categories:i.map(s=>{var a=wr(Bt(s,1))??0??-1;let c=s.l,l=O(c),u=nr(c,l,2),d=no(u);return d!=null&&d!==u&&Y(c,l,2,d),{index:a,score:d??0??0,categoryName:br(Bt(s,3))??""??"",displayName:br(Bt(s,4))??""??""}}),headIndex:o,headName:n}}(at(r,dm,4)?.g()??[],wr(Bt(r,2))??0,br(Bt(r,3))??""))};return _c(e)!=null&&(t.timestampMs=Mf(_c(e))),t}os.prototype.setDefaultSampleRate=os.prototype.V;var Ke=class extends os{constructor(e,t){super(new bm(e,t)),this.m=[],ct(e=this.i=new fm,0,1,t=new is)}get baseOptions(){return at(this.i,is,1)}set baseOptions(e){ct(this.i,0,1,e)}s(e){var t=this.i,r=at(this.i,kc,2);if(r=r?Tf(r):new kc,e.displayNamesLocale!==void 0?fe(r,1,Jn(e.displayNamesLocale)):e.displayNamesLocale===void 0&&fe(r,1),e.maxResults!==void 0){var i=e.maxResults;if(i!=null){if(typeof i!="number"||!Number.isFinite(i))throw Fp();i|=0}fe(r,2,i)}else"maxResults"in e&&fe(r,2);if(e.scoreThreshold!==void 0){if((i=e.scoreThreshold)!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);fe(r,3,i)}else"scoreThreshold"in e&&fe(r,3);return e.categoryAllowlist!==void 0?Lp(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&fe(r,4),e.categoryDenylist!==void 0?Lp(r,5,e.categoryDenylist):"categoryDenylist"in e&&fe(r,5),ct(t,0,2,r),Sm(this,e)}R(e,t){return this.G(e,t??this.H,this.u+1)}G(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),[...this.m]}I(){var e=new ts;Ce(e,10,"audio_in"),Ce(e,10,"sample_rate"),Ce(e,15,"timestamped_classifications");let t=new am;Lf(t,Lg,this.i);let r=new ys;If(r,Jn("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Ce(r,3,"AUDIO:audio_in"),Ce(r,3,"SAMPLE_RATE:sample_rate"),Ce(r,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),r.s(t),Bf(e,r),this.g.attachProtoVectorListener("timestamped_classifications",(i,o)=>{(function(n,s){s.forEach(a=>{a=Vg(a),n.m.push($g(a))})})(this,i),Qr(this,o)}),this.g.attachEmptyPacketListener("timestamped_classifications",i=>{Qr(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function Yp(e){return{embeddings:Kc(e,Gg).map(t=>{let r={headIndex:wr(Bt(t,3))??0??-1,headName:br(Bt(t,4))??""??""};if(Df(t,Ac,hc(t,1))!==void 0){var i=void 0;t=at(t,Ac,hc(t,1)).l;let a=O(t),c=2&a?1:2;i=!!i;let l=Cf(t,a);var o=re(l);if(!(4&o)){(4&o||Object.isFrozen(l))&&(l=Ue(l),o=Sr(o,a,i),a=Y(t,a,1,l));for(var n=0,s=0;n<l.length;n++){let u=no(l[n]);u!=null&&(l[s++]=u)}s<n&&(l.length=s),o=pe(o=Pf(o,a,i),20,!0),o=pe(o,4096,!1),o=pe(o,8192,!1),J(l,o),2&o&&Object.freeze(l)}Yi(o)||(n=o,(s=c===1)?o=pe(o,2,!0):i||(o=pe(o,32,!1)),o!==n&&J(l,o),s&&Object.freeze(l)),c===2&&Yi(o)&&(l=Ue(l),o=Sr(o,a,i),J(l,o),Y(t,a,1,l)),r.floatEmbedding=l}else i=new Uint8Array(0),r.quantizedEmbedding=at(t,zg,hc(t,2))?.O()?.P()??i;return r}),timestampMs:Mf(_c(e))}}Ke.prototype.classify=Ke.prototype.R,Ke.prototype.setOptions=Ke.prototype.s,Ke.createFromModelPath=function(e,t){return wm(Ke,e,{baseOptions:{modelAssetPath:t}})},Ke.createFromModelBuffer=function(e,t){return Qi(Ke,e,{baseOptions:{modelAssetBuffer:t}})},Ke.createFromOptions=function(e,t){return Qi(Ke,e,t)};var St=class extends os{constructor(e,t){super(new bm(e,t)),this.m=[],ct(e=this.i=new mm,0,1,t=new is)}get baseOptions(){return at(this.i,is,1)}set baseOptions(e){ct(this.i,0,1,e)}s(e){var t=this.i,r=at(this.i,Wp,2);return r=r?Tf(r):new Wp,e.l2Normalize!==void 0?fe(r,1,Bp(e.l2Normalize)):"l2Normalize"in e&&fe(r,1),e.quantize!==void 0?fe(r,2,Bp(e.quantize)):"quantize"in e&&fe(r,2),ct(t,0,2,r),Sm(this,e)}S(e,t){return this.G(e,t??this.H,this.u+1)}G(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),this.m}I(){var e=new ts;Ce(e,10,"audio_in"),Ce(e,10,"sample_rate"),Ce(e,15,"embeddings_out"),Ce(e,15,"timestamped_embeddings_out");let t=new am;Lf(t,Ug,this.i);let r=new ys;If(r,Jn("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Ce(r,3,"AUDIO:audio_in"),Ce(r,3,"SAMPLE_RATE:sample_rate"),Ce(r,4,"EMBEDDINGS:embeddings_out"),Ce(r,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),r.s(t),Bf(e,r),this.g.attachProtoListener("embeddings_out",(i,o)=>{i=qp(i),this.m.push(Yp(i)),Qr(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{Qr(this,i)}),this.g.attachProtoVectorListener("timestamped_embeddings_out",(i,o)=>{for(let n of i)i=qp(n),this.m.push(Yp(i));Qr(this,o)}),this.g.attachEmptyPacketListener("timestamped_embeddings_out",i=>{Qr(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}},Vn;St.prototype.embed=St.prototype.S,St.prototype.setOptions=St.prototype.s,St.createFromModelPath=function(e,t){return Qi(St,e,{baseOptions:{modelAssetPath:t}})},St.createFromModelBuffer=function(e,t){return Qi(St,e,{baseOptions:{modelAssetBuffer:t}})},St.createFromOptions=function(e,t){return Qi(St,e,t)};var Xg=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 Em(){if(Vn===void 0)try{await WebAssembly.instantiate(Xg),Vn=!0}catch{Vn=!1}return Vn}async function mc(e,t=""){let r=await Em()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var ei=class{};ei.forVisionTasks=function(e){return mc("vision",e)},ei.forTextTasks=function(e){return mc("text",e)},ei.forAudioTasks=function(e){return mc("audio",e)},ei.isSimdSupported=function(){return Em()};var vs=class{constructor(t,r,i,o,n,s,a){this.recordingInProgress=!1;this.recordIndex=1;this.countLoopTimes=0;this.examStartTime=0;this.recordingStartTime=0;this.recordingEndTime=0;this.isSpeech=!1;this.optionsProctoring=t,this.proctoringSession=r,this.paramsConfig=i,this.cameraRecorder=o,this.onRealtimeAlertsCallback=n,this.backend=s,this.backendToken=a}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Rt(this.proctoringId,this.backend))}async startRecording(){this.examStartTime=Date.now(),await this.createAudioClassifier(),this.audioRecorder=new Un(void 0,this.paramsConfig.audioBehaviourParameters),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetectedRecord(),200),this.streamingAudioClassification()}async stopRecording(){clearInterval(this.intervalNoiseDetection),await this.stopSoundRecord(),await this.volumeMeter.stop(),this.audioWorkletNode&&this.audioWorkletNode.disconnect()}async pauseRecording(){}async resumeRecording(){}async saveOnSession(t){}async onNoiseDetectedRecord(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Qt(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(i=>{console.log(i),this.volumeMeter=void 0}));let t=this.paramsConfig.audioBehaviourParameters?.noiseLimit||40,r=this.volumeMeter?.getVolume()||0;this.isSpeech=this.isSpeech||this.hasDesiredResult(this.audioClassificationResult),!this.isSpeech&&!this.recordingInProgress&&(t=t+t*.25),r>=t&&!this.recordingInProgress?(this.recordingInProgress=!0,this.audioRecorder.startRecording(),this.recordingStartTime=Date.now()-this.examStartTime):r<t&&this.recordingInProgress&&(Date.now()-this.recordingStartTime>=3e3&&this.countLoopTimes>4&&(await this.stopSoundRecord(),this.paramsConfig.videoBehaviourParameters?.detectNoise&&!this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.paramsConfig.videoBehaviourParameters?.detectSpeech&&this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Fala detectada",type:"audio_detection_on_stream"}),this.recordingInProgress=!1,this.recordIndex++,this.countLoopTimes=0,this.isSpeech=!1),this.countLoopTimes++)}async stopSoundRecord(){if(this.audioRecorder.stopRecording&&await this.audioRecorder.stopRecording(),this.recordingEndTime=Date.now()-this.examStartTime,this.optionsProctoring.proctoringType!=="REALTIME")return;let t=new File(this.audioRecorder.blobs,`EP_${this.proctoringSession.id}_${this.recordingStartTime}_${this.recordingEndTime}_${this.isSpeech?"speech":"noise"}.webm`,{type:"audio/webm"});this.uploadRecord(t),this.audioRecorder.blobs=[]}download(t){let r=URL.createObjectURL(t),i=document.createElement("a");document.body.appendChild(i),i.style.display="none",i.href=r,i.download=t.name,i.click(),window.URL.revokeObjectURL(r)}uploadRecord(t){t&&this.upload&&this.backendToken&&this.upload.upload({file:t},this.backendToken)}hasDesiredResult(t){if(t==null)return!1;for(let r of t){let i=r.name.toLowerCase().includes("speech");if(this.optionsProctoring.proctoringType!=="REALTIME")return i;i&&console.log(parseFloat(r.score));let o=parseFloat(r.score)>.22;if(i&&o)return!0}return!1}async createAudioClassifier(){let t=await ei.forAudioTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@0.10.0/wasm");this.audioClassifier=await Ke.createFromOptions(t,{scoreThreshold:.15,maxResults:1,baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/audio_classifier/yamnet/float32/1/yamnet.tflite"}})}async streamingAudioClassification(){this.context=new AudioContext({sampleRate:16e3});try{await this.context.audioWorklet.addModule("https://easyproctor-public.s3.us-east-2.amazonaws.com/utils/audio-processor.js")}catch{throw new Error("\u274C Error loading audio worklet module")}let t=this.context.createMediaStreamSource(this.cameraRecorder.cameraStream);this.audioWorkletNode=new AudioWorkletNode(this.context,"audio-processor"),this.audioWorkletNode.port.onmessage=r=>{let i=r.data,n=this.audioClassifier.classify(i)[0].classifications[0].categories;n.length>0&&(this.audioClassificationResult=[{name:n[0].categoryName,score:n[0].score.toFixed(3)}])},t.connect(this.audioWorkletNode),this.audioWorkletNode.connect(this.context.destination)}};var bs=class{constructor(t){this.blobs=[];this.blobsFinal=[];this.options=t}setProctoringId(t){this.proctoringId=t}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:t,allowMultipleMonitors:r,onStopSharingScreenCallback:i,onBufferSizeErrorCallback:o}=this.options,n={video:{cursor:"always",width:854,height:480,displaySurface:"monitor"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let s=this.screenStream.getVideoTracks();if(s[0].onended=i,navigator.userAgent.indexOf("Firefox")>-1){let g=s.find(h=>h.label=="");if(g&&t||g&&!r)throw Go}let c=s.find(g=>["screen:0:0","Primary Monitor"].includes(g.label))!=null,l=s.find(g=>["screen:0:0","Primary Monitor",""].includes(g.label)||["screen:"].some(h=>g.label.includes(h)))!=null,u=s.find(g=>["web-contents-media-stream","window"].some(h=>g.label.includes(h)))!=null;if(!c&&t)throw s.forEach(g=>{g.stop()}),Kl;if(!l||u)throw s.forEach(g=>{g.stop()}),Jl;let{startRecording:d,stopRecording:f}=ar(this.screenStream,this.blobs,this.proctoringId,this.options.onBufferSizeError,o);this.recordingStart=d,this.recordingStop=f,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var co=class{constructor(t,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=t,this.storeName=r}async save(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.put(t),r).then(()=>{})}async delete(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.delete(t),r)}async get(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.get(t),r).catch(()=>{})}async getDevices(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.get(t),r).catch(()=>{})}async list(){let{transaction:t,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),t)}async clear(){let{transaction:t,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),t)}async processRequest(t,r){return new Promise((i,o)=>{t.onerror=n=>{o(t.error?.message)},t.onsuccess=n=>{r.commit(),i(t.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(t){let o=(await this.connect()).result.transaction(this.storeName,t),n=o.objectStore(this.storeName);return{transaction:o,store:n}}async connect(){return this.connection?this.connection:new Promise((t,r)=>{let i=window.indexedDB.open(this.dbName,this.dbVersion);i.onerror=o=>{r("Can't connect to IndexedDB")},i.onupgradeneeded=o=>{let n=i.result;n.onerror=s=>{},n.createObjectStore(this.storeName,{keyPath:"id"})},i.onsuccess=o=>{this.connection=i,t(i)}})}};function _m(){let e=navigator.userAgent,t;return e.match(/chrome|chromium|crios/i)?t="chrome":e.match(/firefox|fxios/i)?t="firefox":e.match(/safari/i)?t="safari":e.match(/opr\//i)?t="opera":e.match(/edg/i)?t="edge":t="No browser detection",t}function km(){return new Promise((e,t)=>{window.navigator.geolocation.getCurrentPosition(e,t)})}function lo(){let e=window.navigator.userAgent.split("SEB/");return e.length>1?e[1]:"1.0.0.0"}var ws=class{constructor(t,r){this.cpf=t,this.backend=r,this.capturePhoto=new Xr}async login(){let t=await this.capturePhoto.takePicture("Login com biometria facial","Encaixe seu rosto no formato e clique no bot\xE3o abaixo",{width:1280,height:720});return this.loading(),new Promise((r,i)=>{this.backend.loginAuth(this.cpf,t.base64.substr(22,t.base64.length)).then(o=>{this.token=o.token,document.querySelector("#authLoader")?.remove(),this.backend.token=this.token,r(this.token)}).catch(o=>{console.log(o),document.querySelector("#authLoader")?.remove(),i(o)})})}loading(){let t=document.createElement("div");t.setAttribute("id","authLoader"),t.style.backgroundColor="rgba(0,0,0,0.4)",t.style.zIndex="1000",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100vh",t.style.width="100%",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center";let r=document.createElement("div");r.setAttribute("class","loader"),t.appendChild(r),document.body.appendChild(t);let i=`
|
|
221
|
+
Size: ${t.file.size}`,s),n}}throw new Error("Could not upload")}};var Ln=class{constructor(t,r){this.alerts=[];this.onLostFocusCallback=t.onLostFocusCallback,this.onFocusCallback=t.onFocusCallback,this.optionsProctoring=r}async startRecording(){this.startTime=new Date(Date.now()),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus())}async resumeRecording(){this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus())}async saveOnSession(t){this.alerts.forEach(r=>{t.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let t=this.alerts[this.alerts.length-1];t&&(this.onFocusCallback(),t.end=Date.now()-this.startTime.getTime())}};var Un=class{constructor(t,r){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.audioParams={recordingBitrate:128};r&&(this.audioParams=r),t&&(this.options=t)}async startRecording(){let t={audio:{deviceId:this.options.microphoneId||"default"}};this.audioStream=await navigator.mediaDevices.getUserMedia(t);let{startRecording:r,stopRecording:i,pauseRecording:o,resumeRecording:n}=ar(this.audioStream,this.blobs,void 0,void 0,void 0,!0);this.recordingStart=r,this.recordingStop=i,this.recordingPause=o,this.recordingResume=n,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t,r,i){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_audio_${r&&i&&`${r}_${i}`||"0"}.webm`,{type:"audio/webm"}),origin:"Mic"})}};var Tc=typeof self<"u"?self:{};function Zp(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=Tc,o=0;o<r.length;o++)if((i=i[r[o]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function mr(){throw Error("Invalid UTF8")}function vp(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Nn,lc,$0=typeof TextDecoder<"u",X0,K0=typeof TextEncoder<"u";function Qp(e){if(K0)e=(X0||=new TextEncoder).encode(e);else{let r=0,i=new Uint8Array(3*e.length);for(let o=0;o<e.length;o++){var t=e.charCodeAt(o);if(128>t)i[r++]=t;else{if(2048>t)i[r++]=t>>6|192;else{if(55296<=t&&57343>=t){if(56319>=t&&o<e.length){let n=e.charCodeAt(++o);if(56320<=n&&57343>=n){t=1024*(t-55296)+n-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}o--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}var eo,ef=Zp(610401301,!1),Rc=Zp(572417392,!0),bp=Tc.navigator;function gc(e){return!!ef&&!!eo&&eo.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Je(e){var t;return(t=Tc.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function tr(){return!!ef&&!!eo&&0<eo.brands.length}function uc(){return tr()?gc("Chromium"):(Je("Chrome")||Je("CriOS"))&&!(!tr()&&Je("Edge"))||Je("Silk")}eo=bp&&bp.userAgentData||null;var J0=!tr()&&(Je("Trident")||Je("MSIE"));!Je("Android")||uc(),uc(),Je("Safari")&&(uc()||!tr()&&Je("Coast")||!tr()&&Je("Opera")||!tr()&&Je("Edge")||(tr()?gc("Microsoft Edge"):Je("Edg/"))||tr()&&gc("Opera"));var tf={},Ki=null;function Y0(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);var i=new Uint8Array(r),o=0;return function(n,s){function a(g){for(;c<n.length;){var h=n.charAt(c++),m=Ki[h];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return g}rf();for(var c=0;;){var l=a(-1),u=a(0),d=a(64),f=a(64);if(f===64&&l===-1)break;s(l<<2|u>>4),d!=64&&(s(u<<4&240|d>>2),f!=64&&s(d<<6&192|f))}}(e,function(n){i[o++]=n}),o!==r?i.subarray(0,o):i}function rf(){if(!Ki){Ki={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));tf[r]=i;for(var o=0;o<i.length;o++){var n=i[o];Ki[n]===void 0&&(Ki[n]=o)}}}}var of=typeof Uint8Array<"u",nf=!J0&&typeof btoa=="function";function wp(e){if(!nf){var t;t===void 0&&(t=0),rf(),t=tf[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var o=e[c],n=e[c+1],s=e[c+2],a=t[o>>2];o=t[(3&o)<<4|n>>4],n=t[(15&n)<<2|s>>6],s=t[63&s],r[l++]=a+o+n+s}switch(a=0,s=i,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||i;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var Sp=/[-_.]/g,Z0={"-":"+",_:"/",".":"="};function Q0(e){return Z0[e]||""}function sf(e){if(!nf)return Y0(e);Sp.test(e)&&(e=e.replace(Sp,Q0)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function ns(e){return of&&e!=null&&e instanceof Uint8Array}var eg;function ss(){return eg||=new Uint8Array(0)}var ri={},tg;function af(e){if(e!==ri)throw Error("illegal external caller")}function ii(){return tg||=new rr(null,ri)}function Cc(e){af(ri);var t=e.D;return(t=t==null||ns(t)?t:typeof t=="string"?sf(t):null)==null?t:e.D=t}var rr=class{constructor(e,t){if(af(t),this.D=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}P(){let e=Cc(this);return e?new Uint8Array(e):ss()}};function cf(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Pc(){return Error("Failed to read varint, encoding is invalid.")}function lf(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function uf(e){return e.length==0?ii():new rr(e,ri)}function Ic(e){if(typeof e=="string")return{buffer:sf(e),A:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),A:!1};if(e.constructor===Uint8Array)return{buffer:e,A:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),A:!1};if(e.constructor===rr)return{buffer:Cc(e)||ss(),A:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),A:!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 Oc(){return typeof BigInt=="function"}var Ep=!Rc,_p=!Rc,rg=typeof Uint8Array.prototype.slice=="function",df,H=0,te=0;function ti(e){let t=0>e,r=(e=Math.abs(e))>>>0;if(e=Math.floor((e-r)/4294967296),t){let[i,o]=Fc(r,e);e=o,r=i}H=r>>>0,te=e>>>0}function hf(e){let t=df||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),te=0,H=t.getUint32(0,!0)}function yc(e,t){return 4294967296*t+(e>>>0)}function Dc(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=yc(e,t),r?-e:e}function qn(e,t){if(e>>>=0,2097151>=(t>>>=0))var r=""+(4294967296*t+e);else Oc()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),r=t+kp(r)+kp(e));return r}function kp(e){return e=String(e),"0000000".slice(e.length)+e}function as(e){if(16>e.length)ti(Number(e));else if(Oc())e=BigInt(e),H=Number(e&BigInt(4294967295))>>>0,te=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");te=H=0;let r=e.length;for(let i=t,o=(r-t)%6+t;o<=r;i=o,o+=6){let n=Number(e.slice(i,o));te*=1e6,H=1e6*H+n,4294967296<=H&&(te+=Math.trunc(H/4294967296),te>>>=0,H>>>=0)}if(t){let[i,o]=Fc(H,te);H=i,te=o}}}function Fc(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Bc(e,t){let r,i=0,o=0,n=0,s=e.i,a=e.g;do r=s[a++],i|=(127&r)<<n,n+=7;while(32>n&&128&r);for(32<n&&(o|=(127&r)>>4),n=3;32>n&&128&r;n+=7)r=s[a++],o|=(127&r)<<n;if(vr(e,a),128>r)return t(i>>>0,o>>>0);throw Pc()}function Mc(e){let t=0,r=e.g,i=r+10,o=e.i;for(;r<i;){let n=o[r++];if(t|=n,(128&n)==0)return vr(e,r),!!(127&t)}throw Pc()}function Le(e){let t=e.i,r=e.g,i=t[r++],o=127&i;if(128&i&&(i=t[r++],o|=(127&i)<<7,128&i&&(i=t[r++],o|=(127&i)<<14,128&i&&(i=t[r++],o|=(127&i)<<21,128&i&&(i=t[r++],o|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Pc();return vr(e,r),o}function vc(e){var t=e.i;let r=e.g,i=t[r],o=t[r+1],n=t[r+2];return t=t[r+3],vr(e,e.g+4),(i<<0|o<<8|n<<16|t<<24)>>>0}function bc(e){var t=vc(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:1/0*e:r==0?e*Math.pow(2,-149)*t:e*Math.pow(2,r-150)*(t+Math.pow(2,23))}function ig(e){return Le(e)}function dc(e,t,{F:r=!1}={}){e.F=r,t&&(t=Ic(t),e.i=t.buffer,e.m=t.A,e.u=0,e.j=e.i.length,e.g=e.u)}function vr(e,t){if(e.g=t,t>e.j)throw lf(e.j,t)}function pf(e,t){if(0>t)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,i=r+t;if(i>e.j)throw lf(t,e.j-r);return e.g=i,r}function ff(e,t){if(t==0)return ii();var r=pf(e,t);return e.F&&e.m?r=e.i.subarray(r,r+t):(e=e.i,r=r===(t=r+t)?ss():rg?e.slice(r,t):new Uint8Array(e.subarray(r,t))),uf(r)}var Ap=[];function mf(e){var t=e.g;if(t.g==t.j)return!1;e.j=e.g.g;var r=Le(e.g)>>>0;if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw cf(r,e.j);if(1>t)throw Error(`Invalid field number: ${t} (at position ${e.j})`);return e.m=t,e.i=r,!0}function zn(e){switch(e.i){case 0:e.i!=0?zn(e):Mc(e.g);break;case 1:vr(e=e.g,e.g+8);break;case 2:if(e.i!=2)zn(e);else{var t=Le(e.g)>>>0;vr(e=e.g,e.g+t)}break;case 5:vr(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!mf(e))throw Error("Unmatched start-group tag: stream EOF");if(e.i==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}zn(e)}break;default:throw cf(e.i,e.j)}}function cs(e,t,r){let i=e.g.j,o=Le(e.g)>>>0,n=e.g.g+o,s=n-i;if(0>=s&&(e.g.j=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);e.g.g=n,e.g.j=i}function Lc(e){var t=Le(e.g)>>>0,r=pf(e=e.g,t);if(e=e.i,$0){var i,o=e;(i=lc)||(i=lc=new TextDecoder("utf-8",{fatal:!0})),t=r+t,o=r===0&&t===o.length?o:o.subarray(r,t);try{var n=i.decode(o)}catch(a){if(Nn===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),Nn=!0}catch{Nn=!1}}throw!Nn&&(lc=void 0),a}}else{t=(n=r)+t,r=[];let a,c=null;for(;n<t;){var s=e[n++];128>s?r.push(s):224>s?n>=t?mr():(a=e[n++],194>s||(192&a)!=128?(n--,mr()):r.push((31&s)<<6|63&a)):240>s?n>=t-1?mr():(a=e[n++],(192&a)!=128||s===224&&160>a||s===237&&160<=a||(192&(i=e[n++]))!=128?(n--,mr()):r.push((15&s)<<12|(63&a)<<6|63&i)):244>=s?n>=t-2?mr():(a=e[n++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(i=e[n++]))!=128||(192&(o=e[n++]))!=128?(n--,mr()):(s=(7&s)<<18|(63&a)<<12|(63&i)<<6|63&o,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):mr(),8192<=r.length&&(c=vp(c,r),r.length=0)}n=vp(c,r)}return n}function gf(e){let t=Le(e.g)>>>0;return ff(e.g,t)}function Uc(e,t,r){var i=Le(e.g)>>>0;for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var jn=[];function xp(e){return e?/^\d+$/.test(e)?(as(e),new Tp(H,te)):null:og||=new Tp(0,0)}var Tp=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},og;function Rp(e){return e?/^-?\d+$/.test(e)?(as(e),new Cp(H,te)):null:ng||=new Cp(0,0)}var Cp=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},ng;function $n(e,t,r){for(;0<r||127<t;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ls(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function us(e,t){if(0<=t)ls(e,t);else{for(let r=0;9>r;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Xn(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 oi(e,t){t.length!==0&&(e.j.push(t),e.i+=t.length)}function At(e,t,r){ls(e.g,8*t+r)}function Nc(e,t){return At(e,t,2),t=e.g.end(),oi(e,t),t.push(e.i),t}function jc(e,t){var r=t.pop();for(r=e.i+e.g.length()-r;127<r;)t.push(127&r|128),r>>>=7,e.i++;t.push(r),e.i++}function ds(e,t,r){At(e,t,2),ls(e.g,r.length),oi(e,e.g.end()),oi(e,r)}var Et,_t=class{constructor(t,r,i,o){this.g=t,this.i=r,this.j=i,this.N=o}};function Ue(e){return Array.prototype.slice.call(e)}var Vc=(Et=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():void 0)?(e,t)=>{e[Et]|=t}:(e,t)=>{e.o!==void 0?e.o|=t:Object.defineProperties(e,{o:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function Pp(e){let t=re(e);(1&t)!=1&&(Object.isFrozen(e)&&(e=Ue(e)),J(e,1|t))}var wc=Et?(e,t)=>{e[Et]&=~t}:(e,t)=>{e.o!==void 0&&(e.o&=~t)};function pe(e,t,r){return r?e|t:e&~t}var re=Et?e=>0|e[Et]:e=>0|e.o,O=Et?e=>e[Et]:e=>e.o,J=Et?(e,t)=>{e[Et]=t}:(e,t)=>{e.o!==void 0?e.o=t:Object.defineProperties(e,{o:{value:t,configurable:!0,writable:!0,enumerable:!1}})};function Ip(){var e=[];return Vc(e,1),e}function sg(e,t){J(t,-14591&(0|e))}function Sc(e,t){J(t,-14557&(34|e))}function Kn(e){return(e=e>>14&1023)===0?536870912:e}var oo={},ag={};function Op(e){return!(!e||typeof e!="object"||e.W!==ag)}function Ji(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}var yf=!Rc;function vf(e,t,r){if(e!=null){if(typeof e=="string")e=e?new rr(e,ri):ii();else if(e.constructor!==rr)if(ns(e))e=r?uf(e):e.length?new rr(new Uint8Array(e),ri):ii();else{if(!t)throw Error();e=void 0}}return e}function Ec(e,t,r){if(!Array.isArray(e)||e.length)return!1;let i=re(e);return!!(1&i)||!(!t||!(Array.isArray(t)?t.includes(r):t.has(r)))&&(J(e,1|i),!0)}var yr,Dp=[];function Mt(e){if(2&e)throw Error()}var ir,to;function bf(e,t){(t=ir?t[ir]:void 0)&&(e[ir]=Ue(t))}J(Dp,55),yr=Object.freeze(Dp);function Fp(){let e=Error("int32");return e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity="warning",e}function no(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Bp(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}Object.freeze(new class{}),Object.freeze(new class{});var cg=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zc(e){let t=typeof e;return t==="number"?Number.isFinite(e):t==="string"&&cg.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 Mp(e){return e[0]!=="-"&&(20>e.length||e.length===20&&184467>Number(e.substring(0,6)))}function wf(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(ti(e),e=Dc(H,te)),e}function Sf(e){var t=Math.trunc(Number(e));if(Number.isSafeInteger(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),!(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))))if(as(e),e=H,2147483648&(t=te))if(Oc())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,i]=Fc(e,t);e="-"+qn(r,i)}else e=qn(e,t);return e}function Ef(e){if(typeof e!="string")throw Error();return e}function Jn(e){if(e!=null&&typeof e!="string")throw Error();return e}function br(e){return e==null||typeof e=="string"?e:void 0}function _f(e,t,r){if(e!=null&&typeof e=="object"&&e.C===oo)return e;if(Array.isArray(e)){var i=re(e),o=i;return o===0&&(o|=32&r),(o|=2&r)!==i&&J(e,o),new t(e)}}var Yn,Gc,lg;function Zn(e){switch(typeof e){case"boolean":return Gc||=[0,void 0,!0];case"number":return 0<e?void 0:e===0?lg||=[0,void 0]:[-e,void 0];case"string":return[0,e];case"object":return e}}function ro(e,t,r){if(e==null&&(e=Yn),Yn=void 0,e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error();if(64&(i=re(e)))return to&&delete e[to],e;if(i|=64,r&&(i|=512,r!==e[0]))throw Error();e:{let o=(r=e).length;if(o){let n=o-1;if(Ji(r[n])){if(1024<=(t=n-(+!!(512&(i|=256))-1)))throw Error();i=-16760833&i|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&i)-1))))throw Error();i=-16760833&i|(1023&t)<<14}}}return J(e,i),e}function kf(e,t,r,i,o,n){if(e!=null){if(Array.isArray(e))e=o&&e.length==0&&1&re(e)?void 0:n&&2&re(e)?e:Hc(e,t,r,i!==void 0,o,n);else if(Ji(e)){let s={};for(let a in e)s[a]=kf(e[a],t,r,i,o,n);e=s}else e=t(e,i);return e}}function Hc(e,t,r,i,o,n){let s=i||r?re(e):0;i=i?!!(32&s):void 0;let a=Ue(e);for(let c=0;c<a.length;c++)a[c]=kf(a[c],t,r,i,o,n);return r&&(bf(a,e),r(s,a)),a}function ug(e){return e.C===oo?e.toJSON():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))return yf||!Ec(t,void 0,9999)?t:void 0;if(ns(t))return wp(t);if(t instanceof rr){let r=t.D;return r==null?"":typeof r=="string"?r:t.D=wp(r)}}}return t}(e)}function Af(e,t,r=Sc){if(e!=null){if(of&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=re(e);return 2&i?e:(t&&=i===0||!!(32&i)&&!(64&i||!(16&i)),t?(J(e,-12293&(34|i)),e):Hc(e,Af,4&i?Sc:r,!0,!1,!0))}return e.C===oo&&(r=e.l,e=2&(i=O(r))?e:Wc(e,r,i,!0)),e}}function xf(e){let t=e.l;return Wc(e,t,O(t),!1)}function Wc(e,t,r,i){return e=e.constructor,Yn=t=Tf(t,r,i),t=new e(t),Yn=void 0,t}function Tf(e,t,r){let i=r||2&t?Sc:sg,o=!!(32&t);return e=function(n,s,a){let c=Ue(n);var l=c.length;let u=256&s?c[l-1]:void 0;for(l+=u?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(u){s=c[s]={};for(let d in u)s[d]=a(u[d])}return bf(c,n),c}(e,t,n=>Af(n,o,i)),Vc(e,32|(r?2:0)),e}function qc(e){let t=e.l,r=O(t);return 2&r?Wc(e,t,r,!1):e}function Bt(e,t){return nr(e=e.l,O(e),t)}function nr(e,t,r,i){if(r===-1)return null;if(r>=Kn(t)){if(256&t)return e[e.length-1][r]}else{var o=e.length;if(i&&256&t&&(i=e[o-1][r])!=null)return i;if((t=r+(+!!(512&t)-1))<o)return e[t]}}function fe(e,t,r,i){let o=e.l,n=O(o);return Mt(n),Y(o,n,t,r,i),e}function Y(e,t,r,i,o){var n=Kn(t);if(r>=n||o){if(o=t,256&t)n=e[e.length-1];else{if(i==null)return o;n=e[n+(+!!(512&t)-1)]={},o|=256}return n[r]=i,o!==t&&J(e,o),o}return e[r+(+!!(512&t)-1)]=i,256&t&&r in(e=e[e.length-1])&&delete e[r],t}function so(e,t,r,i,o){var n=2&t;let s=nr(e,t,r,o);Array.isArray(s)||(s=yr);let a=!(2&i);i=!(1&i);let c=!!(32&t),l=re(s);return l!==0||!c||n||a?1&l||(l|=1,J(s,l)):(l|=33,J(s,l)),n?(e=!1,2&l||(Vc(s,34),e=!!(4&l)),(i||e)&&Object.freeze(s)):(n=!!(2&l)||!!(2048&l),i&&n?(s=Ue(s),i=1,c&&!a&&(i|=32),J(s,i),Y(e,t,r,s,o)):a&&32&l&&!n&&wc(s,32)),s}function Rf(e){e=e.l;let t=O(e),r=nr(e,t,1),i=vf(r,!0,!!(34&t));return i!=null&&i!==r&&Y(e,t,1,i),i}function Cf(e,t){return e=nr(e,t,1),Array.isArray(e)?e:yr}function Pf(e,t,r){return e===0&&(e=Sr(e,t,r)),pe(e,1,!0)}function Yi(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function Lp(e,t,r){{let s=e.l,a=O(s);if(Mt(a),r==null)Y(s,a,t);else{var i,o=e=re(r),n=!!(2&e)||Object.isFrozen(r);if((i=!n)&&(i=!1),!(4&e))for(e=21,n&&(r=Ue(r),o=0,e=Sr(e,a,!0)),n=0;n<r.length;n++)r[n]=Ef(r[n]);i&&(r=Ue(r),o=0,e=Sr(e,a,!0)),e!==o&&J(r,e),Y(s,a,t,r)}}}function If(e,t){e=e.l;let r=O(e);Mt(r),Y(e,r,2,t===""?void 0:t)}function Of(e,t,r,i){let o=O(e);Mt(o),e=so(e,o,t,2),i=r(i,!!(4&(t=re(e)))&&!!(4096&t)),e.push(i)}function dg(e){return e}function hc(e,t){return $c(e=e.l,O(e),ym)===t?t:-1}function $c(e,t,r){let i=0;for(let o=0;o<r.length;o++){let n=r[o];nr(e,t,n)!=null&&(i!==0&&(t=Y(e,t,i)),i=n)}return i}function Xc(e,t,r,i){let o=O(e);Mt(o);let n=nr(e,o,r,i),s;if(n!=null&&n.C===oo)return(t=qc(n))!==n&&Y(e,o,r,t,i),t.l;if(Array.isArray(n)){let a=re(n);s=2&a?Tf(n,a,!1):n,s=ro(s,t[0],t[1])}else s=ro(void 0,t[0],t[1]);return s!==n&&Y(e,o,r,s,i),s}function Df(e,t,r,i){e=e.l;let o=O(e),n=nr(e,o,r,i);return(t=_f(n,t,o))!==n&&t!=null&&Y(e,o,r,t,i),t}function at(e,t,r){if((t=Df(e,t,r,!1))==null)return t;e=e.l;let i=O(e);if(!(2&i)){let o=qc(t);o!==t&&Y(e,i,r,t=o,!1)}return t}function Ff(e,t,r,i,o){var n=!!(2&t),s=n?1:2;let a=s===1;s=s===2,i=!!i,o&&=!n,n=Cf(e,t);var c=re(n);let l=!!(4&c);if(!l){var u,d=n,f=t;(u=!!(2&(c=Pf(c,t,i))))&&(f=pe(f,2,!0));let g=!u,h=!0,m=0,y=0;for(;m<d.length;m++){let b=_f(d[m],r,f);if(b instanceof r){if(!u){let k=!!(2&re(b.l));g&&=!k,h&&=k}d[y++]=b}}y<m&&(d.length=y),c=pe(c,4,!0),c=pe(c,16,h),c=pe(c,8,g),J(d,c),u&&Object.freeze(d)}if(r=!!(8&c)||a&&!n.length,o&&!r){for(Yi(c)&&(n=Ue(n),c=Sr(c,t,i),t=Y(e,t,1,n)),o=n,r=c,d=0;d<o.length;d++)(c=o[d])!==(f=qc(c))&&(o[d]=f);r=pe(r,8,!0),r=pe(r,16,!o.length),J(o,r),c=r}return Yi(c)||(o=c,a?c=pe(c,!n.length||16&c&&(!l||32&c)?2:2048,!0):i||(c=pe(c,32,!1)),c!==o&&J(n,c),a&&Object.freeze(n)),s&&Yi(c)&&(n=Ue(n),c=Sr(c,t,i),J(n,c),Y(e,t,1,n)),n}function Kc(e,t){e=e.l;let r=O(e);return Ff(e,r,t,!1,!(2&r))}function ct(e,t,r,i,o){return i==null&&(i=void 0),fe(e,r,i,o)}function pc(e,t,r){var i=hm;r==null&&(r=void 0),e=e.l;let o=O(e);Mt(o),(i=$c(e,o,i))&&i!==t&&r!=null&&(o=Y(e,o,i)),Y(e,o,t,r)}function Sr(e,t,r){return e=pe(e,2,!!(2&t)),e=pe(e,32,!!(32&t)&&r),pe(e,2048,!1)}function Bf(e,t){var r=ys;e=e.l;let i=O(e);Mt(i),e=Ff(e,i,r,!0),t=t??new r,e.push(t),2&re(t.l)?wc(e,8):wc(e,16)}function _c(e){return(e=Bt(e,2))==null?e:zc(e)?typeof e=="number"?wf(e):Sf(e):void 0}function Mf(e){return e??0}function Ce(e,t,r){Of(e.l,t,Ef,r)}function Lf(e,t,r){t.g?t.j(e,t.g,t.i,r,!0):t.j(e,t.i,r,!0)}var W=class{constructor(e,t){this.l=ro(e,t)}toJSON(){return Uf(this,Hc(this.l,ug,void 0,void 0,!1,!1),!0)}A(){return!!(2&re(this.l))}};function Uf(e,t,r){let i=e.constructor.v;var o=O(r?e.l:t),n=Kn(o),s=!1;if(i&&yf){if(!r){var a;if((t=Ue(t)).length&&Ji(a=t[t.length-1])){for(s=0;s<i.length;s++)if(i[s]>=n){Object.assign(t[t.length-1]={},a);break}}s=!0}var c;n=t,r=!r,e=Kn(a=O(e.l)),a=+!!(512&a)-1;for(let y=0;y<i.length;y++){var l=i[y];if(l<e){var u=n[l+=a];u==null?n[l]=r?yr:Ip():r&&u!==yr&&Pp(u)}else{if(!c){var d=void 0;n.length&&Ji(d=n[n.length-1])?c=d:n.push(c={})}u=c[l],c[l]==null?c[l]=r?yr:Ip():r&&u!==yr&&Pp(u)}}}if(!(c=t.length))return t;let f,g;if(Ji(d=t[c-1])){e:{var h=d;for(var m in n={},r=!1,h)e=h[m],Array.isArray(e)&&(a=e,(!_p&&Ec(e,i,+m)||!Ep&&Op(e)&&e.size===0)&&(e=null),e!=a&&(r=!0)),e!=null?n[m]=e:r=!0;if(r){for(let y in n){h=n;break e}h=null}}h!=d&&(f=!0),c--}for(o=+!!(512&o)-1;0<c&&((d=t[m=c-1])==null||!_p&&Ec(d,i,m-o)||!Ep&&Op(d)&&d.size===0);c--)g=!0;return(f||g)&&(t=s?t:Array.prototype.slice.call(t,0,c),s&&(t.length=c),h&&t.push(h)),t}function Nf(e){return Array.isArray(e)?e[0]instanceof _t?e:[Eg,e]:[e,void 0]}function hs(e,t){if(Array.isArray(t)){var r=re(t);if(4&r)return t;for(var i=0,o=0;i<t.length;i++){let n=e(t[i]);n!=null&&(t[o++]=n)}return o<i&&(t.length=o),J(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}W.prototype.C=oo,W.prototype.toString=function(){return Uf(this,this.l,!1).toString()};var Up=Symbol();function Jc(e){let t=e[Up];if(!t){let r=zf(e),i=Zc(e),o=i.g;t=o?(n,s)=>o(n,s,i):(n,s)=>{for(;mf(s)&&s.i!=4;){var a=s.m,c=i[a];if(!c){var l=i.K;l&&(l=l[a])&&(c=i[a]=hg(l))}c&&c(s,n,a)||(a=(c=s).j,zn(c),c.J?c=void 0:(l=c.g.g-a,c.g.g=a,c=ff(c.g,l)),a=n,c&&(ir||=Symbol(),(l=a[ir])?l.push(c):a[ir]=[c]))}r===jf||r===Vf||r.T||(n[to||=Symbol()]=r)},e[Up]=t}return t}function hg(e){let t=(e=Nf(e))[0].g;if(e=e[1]){let r=Jc(e),i=Zc(e).B;return(o,n,s)=>t(o,n,s,i,r)}return t}var jf,Vf,Gn=Symbol();function pg(e,t,r){let i=r[1],o;if(i){let n=i[Gn];o=n?n.B:Zn(i[0]),e[t]=n??i}o&&o===Gc?(e.L||(e.L=[])).push(t):r[0]&&(e.M||(e.M=[])).push(t)}function Np(e,t){return[e.j,!t||0<t[0]?void 0:t]}function zf(e){var t=e[Gn];if(t)return t;if(!(t=Yc(e,e[Gn]={},Np,Np,pg)).M&&!t.L){let r=!0;for(let i in t){isNaN(i)||(r=!1);break}r?(t=Zn(e[0])===Gc,t=e[Gn]=t?Vf||={B:Zn(!0)}:jf||={}):t.T=!0}return t}function fg(e,t,r){e[t]=r}function Yc(e,t,r,i,o=fg){t.B=Zn(e[0]);let n=0;var s=e[++n];s&&s.constructor===Object&&(t.K=s,typeof(s=e[++n])=="function"&&(t.g=s,t.i=e[++n],s=e[++n]));let a={};for(;Array.isArray(s)&&typeof s[0]=="number"&&0<s[0];){for(var c=0;c<s.length;c++)a[s[c]]=s;s=e[++n]}for(c=1;s!==void 0;){let d;typeof s=="number"&&(c+=s,s=e[++n]);var l=void 0;if(s instanceof _t?d=s:(d=_g,n--),d.N){s=e[++n],l=e;var u=n;typeof s=="function"&&(s=s(),l[u]=s),l=s}for(u=c+1,typeof(s=e[++n])=="number"&&0>s&&(u-=s,s=e[++n]);c<u;c++){let f=a[c];o(t,c,l?i(d,l,f):r(d,f))}}return t}var jp=Symbol();function Gf(e){let t=e[jp];if(!t){let r=ps(e);t=(i,o)=>Hf(i,o,r),e[jp]=t}return t}var Hn=Symbol();function mg(e){return e.i}function gg(e,t){let r,i,o=e.i;return(n,s,a)=>o(n,s,a,i||=ps(t).B,r||=Gf(t))}function ps(e){let t=e[Hn];return t||(t=Yc(e,e[Hn]={},mg,gg),Wn in e&&Hn in e&&(e.length=0),t)}var Wn=Symbol();function yg(e,t){let r=e.g;return t?(i,o,n)=>r(i,o,n,t):r}function vg(e,t,r){let i=e.g,o,n;return(s,a,c)=>i(s,a,c,n||=Zc(t).B,o||=Jc(t),r)}function Zc(e){let t=e[Wn];return t||(zf(e),t=Yc(e,e[Wn]={},yg,vg),Wn in e&&Hn in e&&(e.length=0),t)}function Vp(e,t){var r=e[t];if(r)return r;if((r=e.K)&&(r=r[t])){var i=(r=Nf(r))[0].i;if(r=r[1]){let o=Gf(r),n=ps(r).B;r=(r=e.i)?r(n,o):(s,a,c)=>i(s,a,c,n,o)}else r=i;return e[t]=r}}function Hf(e,t,r){for(var i=O(e),o=+!!(512&i)-1,n=e.length,s=512&i?1:0,a=n+(256&i?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-o,u=Vp(r,l);u&&u(t,c,l)}if(256&i){i=e[n-1];for(let c in i)o=+c,Number.isNaN(o)||(n=i[c])!=null&&(a=Vp(r,o))&&a(t,n,o)}if(e=ir?e[ir]:void 0)for(oi(t,t.g.end()),r=0;r<e.length;r++)oi(t,Cc(e[r])||ss())}function Pe(e,t){return new _t(e,t,!1,!1)}function fs(e,t){return new _t(e,t,!0,!1)}function Ie(e,t,r){Y(e,O(e),t,r)}function Wf(e,t,r){e:if(t!=null){if(zc(t)){if(typeof t=="string"){t=Sf(t);break e}if(typeof t=="number"){t=wf(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&Rp(t),t!=null&&(At(e,r,0),typeof t=="number"?(e=e.g,ti(t),$n(e,H,te)):(r=Rp(t),$n(e.g,r.i,r.g))))}function qf(e,t,r){(t=wr(t))!=null&&t!=null&&(At(e,r,0),us(e.g,t))}function $f(e,t,r){(t=t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0)!=null&&(At(e,r,0),e.g.g.push(t?1:0))}function Xf(e,t,r){(t=br(t))!=null&&ds(e,r,Qp(t))}function ms(e,t,r,i,o){(t=t instanceof W?t.l:Array.isArray(t)?ro(t,i[0],i[1]):void 0)!=null&&(r=Nc(e,r),o(t,e),jc(e,r))}function Kf(e,t,r){(t=t==null||typeof t=="string"||ns(t)||t instanceof rr?t:void 0)!=null&&ds(e,r,Ic(t).buffer)}var Ye,bg=Pe(function(e,t,r){if(e.i!==1)return!1;var i=e.g;e=vc(i);let o=vc(i);i=2*(o>>31)+1;let n=o>>>20&2047;return e=4294967296*(1048575&o)+e,Ie(t,r,n==2047?e?NaN:1/0*i:n==0?i*Math.pow(2,-1074)*e:i*Math.pow(2,n-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=no(t))!=null&&(At(e,r,1),e=e.g,(r=df||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),H=r.getUint32(0,!0),te=r.getUint32(4,!0),Xn(e,H),Xn(e,te))}),Jf=Pe(function(e,t,r){return e.i===5&&(Ie(t,r,bc(e.g)),!0)},function(e,t,r){(t=no(t))!=null&&(At(e,r,5),e=e.g,hf(t),Xn(e,H))}),wg=fs(function(e,t,r){return(e.i===5||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,bc,t):t.push(bc(e.g)),!0)},function(e,t,r){if((t=hs(no,t))!=null&&t.length){At(e,r,2),ls(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,hf(t[i]),Xn(r,H)}}),Qn=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Bc(e.g,Dc)),!0)},Wf),fc=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Bc(e.g,Dc))===0?void 0:e),!0)},Wf),Sg=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Bc(e.g,yc)),!0)},function(e,t,r){e:if(t!=null){if(zc(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)),Mp(t)||(as(t),t=qn(H,te)));break e}if(typeof t=="number"){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(o){if(0>o){ti(o);let n=qn(H,te);return o=Number(n),Number.isSafeInteger(o)?o:n}return Mp(String(o))?o:(ti(o),yc(H,te))}(t);break e}}t=void 0}t!=null&&(typeof t=="string"&&xp(t),t!=null&&(At(e,r,0),typeof t=="number"?(e=e.g,ti(t),$n(e,H,te)):(r=xp(t),$n(e.g,r.i,r.g))))}),sr=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Le(e.g)),!0)},qf),Yf=fs(function(e,t,r){return(e.i===0||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,Le,t):t.push(Le(e.g)),!0)},function(e,t,r){if((t=hs(wr,t))!=null&&t.length){r=Nc(e,r);for(let i=0;i<t.length;i++)us(e.g,t[i]);jc(e,r)}}),ni=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Le(e.g))===0?void 0:e),!0)},qf),kt=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Mc(e.g)),!0)},$f),Zi=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,(e=Mc(e.g))===!1?void 0:e),!0)},$f),lt=fs(function(e,t,r){return e.i===2&&(Of(t,r,dg,e=Lc(e)),!0)},function(e,t,r){if((t=hs(br,t))!=null)for(let s=0;s<t.length;s++){var i=e,o=r,n=t[s];n!=null&&ds(i,o,Qp(n))}}),or=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,(e=Lc(e))===""?void 0:e),!0)},Xf),ge=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,Lc(e)),!0)},Xf),Eg=new _t(function(e,t,r,i,o){return e.i===2&&(cs(e,Xc(t,i,r,!0),o),!0)},ms,!1,!0),_g=new _t(function(e,t,r,i,o){return e.i===2&&(cs(e,Xc(t,i,r),o),!0)},ms,!1,!0);Ye=new _t(function(e,t,r,i,o){if(e.i!==2)return!1;i=ro(void 0,i[0],i[1]);let n=O(t);Mt(n);let s=so(t,n,r,3);return n=O(t),4&re(s)&&(s=Ue(s),J(s,-2079&(1|re(s))),Y(t,n,r,s)),s.push(i),cs(e,i,o),!0},function(e,t,r,i,o){if(Array.isArray(t))for(let n=0;n<t.length;n++)ms(e,t[n],r,i,o)},!0,!0);var Ze=new _t(function(e,t,r,i,o,n){if(e.i!==2)return!1;let s=O(t);return Mt(s),(n=$c(t,s,n))&&r!==n&&Y(t,s,n),cs(e,t=Xc(t,i,r),o),!0},ms,!1,!0),Zf=Pe(function(e,t,r){return e.i===2&&(Ie(t,r,gf(e)),!0)},Kf),io=Pe(function(e,t,r){return e.i===0&&(Ie(t,r,Le(e.g)),!0)},function(e,t,r){(t=wr(t))!=null&&(t=parseInt(t,10),At(e,r,0),us(e.g,t))}),kg=fs(function(e,t,r){return(e.i===0||e.i===2)&&(t=so(t,O(t),r,2,!1),e.i==2?Uc(e,ig,t):t.push(Le(e.g)),!0)},function(e,t,r){if((t=hs(wr,t))!=null&&t.length){r=Nc(e,r);for(let i=0;i<t.length;i++)us(e.g,t[i]);jc(e,r)}}),es=class{constructor(t,r){this.i=t,this.g=r,this.j=ct,this.defaultValue=void 0}};function Qf(e,t){return(r,i)=>{e:{if(jn.length){let n=jn.pop();n.s(i),dc(n.g,r,i),r=n}else r=new class{constructor(n,s){if(Ap.length){let a=Ap.pop();dc(a,n,s),n=a}else n=new class{constructor(a,c){this.i=null,this.m=!1,this.g=this.j=this.u=0,dc(this,a,c)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.F=!1}}(n,s);this.g=n,this.j=this.g.g,this.i=this.m=-1,this.s(s)}s({J:n=!1}={}){this.J=n}}(r,i);try{let n=new e,s=n.l;Jc(t)(s,r),to&&delete s[to];var o=n;break e}finally{r.g.clear(),r.m=-1,r.i=-1,100>jn.length&&jn.push(r)}o=void 0}return o}}var em=[0,or,Pe(function(e,t,r){return e.i===2&&(Ie(t,r,(e=gf(e))===ii()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof W){let i=t.X;return void(i&&(t=i(t),t!=null&&ds(e,r,Ic(t).buffer)))}if(Array.isArray(t))return}Kf(e,t,r)})],Ag=[0,ge],tm=[0,sr,io,kt,-1,Yf,io,-1],xg=[0,kt,-1],rm=class extends W{constructor(){super()}};rm.v=[6];var im=[0,kt,ge,kt,io,-1,kg,ge,-1,xg,io],om=[0,ge,-2],zp=class extends W{constructor(){super()}},nm=[0],sm=[0,sr,kt,-2],am=class extends W{constructor(e){super(e,2)}},gs={},Tg=[-2,gs,kt];gs[336783863]=[0,ge,kt,-1,sr,[0,[1,2,3,4,5],Ze,nm,Ze,im,Ze,om,Ze,sm,Ze,tm],Ag];var Rg=[0,or,Zi],cm=[0,fc,-1,Zi,-3,fc,Yf,or,ni,fc,-1,Zi,ni,Zi,-2,or],ao=[-1,{}],lm=[0,ge,1,ao],um=[0,ge,lt,ao],ys=class extends W{constructor(e){super(e,500)}s(e){return ct(this,0,7,e)}};ys.v=[3,4,5,6,8,13,17,1005];var Gp,Cg=[-500,or,-1,lt,-3,Tg,Ye,em,ni,-1,lm,um,Ye,Rg,or,cm,ni,lt,987,lt],Pg=[0,or,-1,ao],Ig=[-500,ge,-1,[-1,{}],998,ge],Og=[-500,ge,lt,-1,[-2,{},kt],997,lt,-1],Dg=[-500,ge,lt,ao,998,lt],ts=class extends W{constructor(){super(void 0,500)}s(e){return ct(this,0,1001,e)}};ts.v=[1,6,7,9,10,15,16,17,14,1002],ts.prototype.g=(Gp=[-500,Ye,Cg,4,Ye,Ig,Ye,Og,ni,Ye,Dg,lt,ni,lm,um,Ye,Pg,lt,-2,cm,or,-1,Zi,979,ao,Ye,em],function(){let e=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let n=this.g;return this.g=[],n}}}};Hf(this.l,e,ps(Gp)),oi(e,e.g.end());let t=new Uint8Array(e.i),r=e.j,i=r.length,o=0;for(let n=0;n<i;n++){let s=r[n];t.set(s,o),o+=s.length}return e.j=[t],t});var Fg=class extends W{constructor(e){super(e)}},Bg=[0,sr,Jf,ge,-1],dm=class extends W{constructor(e){super(e)}g(){return Kc(this,Fg)}};dm.v=[1];var Mg=[0,Ye,Bg],kc=class extends W{constructor(e){super(e)}};kc.v=[4,5];var Hp=class extends W{constructor(e){super(e)}},hm=[1,2,3,4,5],rs=class extends W{constructor(e){super(e)}g(){return Rf(this)!=null}i(){return br(Bt(this,2))!=null}},is=class extends W{constructor(e){super(e)}},pm=[0,[0,Zf,ge,[0,sr,Qn,-1],[0,Sg,Qn]],kt,[0,hm,Ze,sm,Ze,im,Ze,tm,Ze,nm,Ze,om],io],fm=class extends W{constructor(e){super(e)}},Lg=new es(451755788,fm);gs[451755788]=[0,pm,[0,ge,sr,Jf,lt,-1],bg];var Wp=class extends W{constructor(e){super(e)}},mm=class extends W{constructor(e){super(e)}},Ug=new es(487277289,mm);gs[487277289]=[0,pm,[0,kt,-1]];var Ng=class extends W{constructor(e){super(e)}},jg=[0,1,sr,ge,Mg],gm=class extends W{constructor(e){super(e)}};gm.v=[1];var Vg=Qf(gm,[0,Ye,jg,Qn]),Ac=class extends W{constructor(e){super(e)}};Ac.v=[1];var zg=class extends W{constructor(e){super(e)}O(){let e=Rf(this);return e??ii()}},Gg=class extends W{constructor(e){super(e)}},ym=[1,2],Hg=[0,ym,Ze,[0,wg],Ze,[0,Zf],sr,ge],vm=class extends W{constructor(e){super(e)}};vm.v=[1];var qp=Qf(vm,[0,Ye,Hg,Qn]);async function $p(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",o=>{i(o)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function E(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.h.stringToNewUTF8(t)),e.h._free(t)}function Xp(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let i=new Uint32Array(t.length);for(let o=0;o<t.length;o++)i[o]=e.h.stringToNewUTF8(t[o]);t=e.h._malloc(4*i.length),e.h.HEAPU32.set(i,t>>2),r(t);for(let o of i)e.h._free(o);e.h._free(t)}function gr(e,t,r){e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=r}function Zr(e,t,r){let i=[];e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=(o,n,s)=>{n?(r(i,s),i=[]):i.push(o)}}var Wg=function(e){return class extends e{U(){this.h._registerModelResourcesGraphService()}}}(class{constructor(e,t){this.j=!0,this.h=e,this.g=null,this.i=0,this.m=typeof this.h._addIntToInputStream=="function",t!==void 0?this.h.canvas=t:((e=typeof OffscreenCanvas>"u")||(e=(e=navigator.userAgent).includes("Safari")&&!e.includes("Chrome")),e?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas")):this.h.canvas=new OffscreenCanvas(1,1))}async initializeGraph(e){let 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){let r=e.length,i=this.h._malloc(r);this.h.HEAPU8.set(e,i),t?this.h._changeBinaryGraph(r,i):this.h._changeTextGraph(r,i),this.h._free(i)}configureAudio(e,t,r,i,o){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),E(this,i||"input_audio",n=>{E(this,o=o||"audio_header",s=>{this.h._configureAudio(n,s,e,t,r)})})}setAutoResizeCanvas(e){this.j=e}setAutoRenderToScreen(e){this.h._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.h.gpuOriginForWebTexturesIsBottomLeft=e}attachErrorListener(e){this.h.errorListener=e}attachEmptyPacketListener(e,t){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,o){let n=4*e.length;this.i!==n&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(n),this.i=n),this.h.HEAPF32.set(e,this.g/4),E(this,i,s=>{this.h._addAudioToInputStream(this.g,t,r,s,o)})}addGpuBufferToStream(e,t,r){E(this,t,i=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");i?this.h._bindTextureToStream(i):this.h._bindTextureToCanvas();var o=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!o)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");let n;this.h.gpuOriginForWebTexturesIsBottomLeft&&o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,e),this.h.gpuOriginForWebTexturesIsBottomLeft&&o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(o=e.videoWidth,n=e.videoHeight):e.naturalWidth?(o=e.naturalWidth,n=e.naturalHeight):(o=e.width,n=e.height),!this.j||o===this.h.canvas.width&&n===this.h.canvas.height||(this.h.canvas.width=o,this.h.canvas.height=n);let[s,a]=[o,n];this.h._addBoundTextureToStream(i,s,a,r)})}addBoolToStream(e,t,r){E(this,t,i=>{this.h._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){E(this,t,i=>{this.h._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){E(this,t,i=>{this.h._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){E(this,t,i=>{this.h._addIntToInputStream(e,i,r)})}addStringToStream(e,t,r){E(this,t,i=>{E(this,e,o=>{this.h._addStringToInputStream(o,i,r)})})}addStringRecordToStream(e,t,r){E(this,t,i=>{Xp(this,Object.keys(e),o=>{Xp(this,Object.values(e),n=>{this.h._addFlatHashMapToInputStream(o,n,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){E(this,r,o=>{E(this,t,n=>{let s=this.h._malloc(e.length);this.h.HEAPU8.set(e,s),this.h._addProtoToInputStream(s,e.length,n,o,i),this.h._free(s)})})}addEmptyPacketToStream(e,t){E(this,e,r=>{this.h._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(let n of e)this.h._addBoolVectorEntry(o,n);this.h._addBoolVectorToInputStream(o,i,r)})}addDoubleVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(let n of e)this.h._addDoubleVectorEntry(o,n);this.h._addDoubleVectorToInputStream(o,i,r)})}addFloatVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(let n of e)this.h._addFloatVectorEntry(o,n);this.h._addFloatVectorToInputStream(o,i,r)})}addIntVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(let n of e)this.h._addIntVectorEntry(o,n);this.h._addIntVectorToInputStream(o,i,r)})}addStringVectorToStream(e,t,r){E(this,t,i=>{let o=this.h._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(let n of e)E(this,n,s=>{this.h._addStringVectorEntry(o,s)});this.h._addStringVectorToInputStream(o,i,r)})}addBoolToInputSidePacket(e,t){E(this,t,r=>{this.h._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){E(this,t,r=>{this.h._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){E(this,t,r=>{this.h._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){E(this,t,r=>{this.h._addIntToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){E(this,t,r=>{E(this,e,i=>{this.h._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){E(this,r,i=>{E(this,t,o=>{let n=this.h._malloc(e.length);this.h.HEAPU8.set(e,n),this.h._addProtoToInputSidePacket(n,e.length,o,i),this.h._free(n)})})}addBoolVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.h._addBoolVectorEntry(i,o);this.h._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.h._addDoubleVectorEntry(i,o);this.h._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.h._addFloatVectorEntry(i,o);this.h._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.h._addIntVectorEntry(i,o);this.h._addIntVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){E(this,t,r=>{let i=this.h._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)E(this,o,n=>{this.h._addStringVectorEntry(i,n)});this.h._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachBoolListener(r)})}attachBoolVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachBoolVectorListener(r)})}attachIntListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachIntListener(r)})}attachIntVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachIntVectorListener(r)})}attachDoubleListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachDoubleVectorListener(r)})}attachFloatListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachFloatListener(r)})}attachFloatVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachFloatVectorListener(r)})}attachStringListener(e,t){gr(this,e,t),E(this,e,r=>{this.h._attachStringListener(r)})}attachStringVectorListener(e,t){Zr(this,e,t),E(this,e,r=>{this.h._attachStringVectorListener(r)})}attachProtoListener(e,t,r){gr(this,e,t),E(this,e,i=>{this.h._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){Zr(this,e,t),E(this,e,i=>{this.h._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),gr(this,e,(i,o)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,o)}),E(this,e,i=>{this.h._attachAudioListener(i,r||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),bm=class extends Wg{};async function qg(e,t,r){return e=await(async(i,o,n,s)=>{if(o&&await $p(o),!self.ModuleFactory||n&&(await $p(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&s&&((o=self.Module).locateFile=s.locateFile,s.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=s.mainScriptUrlOrBlob)),s=await self.ModuleFactory(self.Module||s),self.ModuleFactory=self.Module=void 0,new i(s,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:i=>i.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&i.endsWith(".data")?t.assetBinaryPath.toString():i}),await e.s(r),e}async function wm(e,t,r){return qg(e,t,r)}function Kp(e,t){let r=at(e.baseOptions,rs,1)||new rs;typeof t=="string"?(fe(r,2,Jn(t)),fe(r,1)):t instanceof Uint8Array&&(fe(r,1,vf(t,!1,!1)),fe(r,2)),ct(e.baseOptions,0,1,r)}function Sm(e,t){let r=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(at(e.baseOptions,rs,1)?.g()||at(e.baseOptions,rs,1)?.i()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(i,o){let n=at(i.baseOptions,Hp,3);if(!n){var s=n=new Hp;pc(s,4,new zp)}"delegate"in o&&(o.delegate==="GPU"?pc(o=n,2,s=new rm):pc(o=n,4,s=new zp)),ct(i.baseOptions,0,3,n)}(e,r),r.modelAssetPath?fetch(r.modelAssetPath.toString()).then(i=>{if(i.ok)return i.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${i.status})`)}).then(i=>{try{e.g.h.FS_unlink("/model.dat")}catch{}e.g.h.FS_createDataFile("/","model.dat",new Uint8Array(i),!0,!1,!1),Kp(e,"/model.dat"),e.I()}):(Kp(e,r.modelAssetBuffer),e.I(),Promise.resolve())}function Jp(e){try{let t=e.j.length;if(t===1)throw Error(e.j[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.j.map(r=>r.message).join(", "))}finally{e.j=[]}}function Qr(e,t){e.u=Math.max(e.u,t)}var xc=class{constructor(e){this.g=e,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.j.push(Error(i))}),this.g.U(),this.g.setGraph(e,t),Jp(this)}finishProcessing(){this.g.finishProcessing(),Jp(this)}close(){this.g.closeGraph()}};async function Qi(e,t,r){return wm(e,t,r)}xc.prototype.close=xc.prototype.close;var os=class extends xc{constructor(){super(...arguments),this.H=48e3}V(e){this.H=e}};function $g(e){let t={classifications:Kc(e,Ng).map(r=>function(i,o=-1,n=""){return{categories:i.map(s=>{var a=wr(Bt(s,1))??0??-1;let c=s.l,l=O(c),u=nr(c,l,2),d=no(u);return d!=null&&d!==u&&Y(c,l,2,d),{index:a,score:d??0??0,categoryName:br(Bt(s,3))??""??"",displayName:br(Bt(s,4))??""??""}}),headIndex:o,headName:n}}(at(r,dm,4)?.g()??[],wr(Bt(r,2))??0,br(Bt(r,3))??""))};return _c(e)!=null&&(t.timestampMs=Mf(_c(e))),t}os.prototype.setDefaultSampleRate=os.prototype.V;var Ke=class extends os{constructor(e,t){super(new bm(e,t)),this.m=[],ct(e=this.i=new fm,0,1,t=new is)}get baseOptions(){return at(this.i,is,1)}set baseOptions(e){ct(this.i,0,1,e)}s(e){var t=this.i,r=at(this.i,kc,2);if(r=r?xf(r):new kc,e.displayNamesLocale!==void 0?fe(r,1,Jn(e.displayNamesLocale)):e.displayNamesLocale===void 0&&fe(r,1),e.maxResults!==void 0){var i=e.maxResults;if(i!=null){if(typeof i!="number"||!Number.isFinite(i))throw Fp();i|=0}fe(r,2,i)}else"maxResults"in e&&fe(r,2);if(e.scoreThreshold!==void 0){if((i=e.scoreThreshold)!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);fe(r,3,i)}else"scoreThreshold"in e&&fe(r,3);return e.categoryAllowlist!==void 0?Lp(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&fe(r,4),e.categoryDenylist!==void 0?Lp(r,5,e.categoryDenylist):"categoryDenylist"in e&&fe(r,5),ct(t,0,2,r),Sm(this,e)}R(e,t){return this.G(e,t??this.H,this.u+1)}G(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),[...this.m]}I(){var e=new ts;Ce(e,10,"audio_in"),Ce(e,10,"sample_rate"),Ce(e,15,"timestamped_classifications");let t=new am;Lf(t,Lg,this.i);let r=new ys;If(r,Jn("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Ce(r,3,"AUDIO:audio_in"),Ce(r,3,"SAMPLE_RATE:sample_rate"),Ce(r,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),r.s(t),Bf(e,r),this.g.attachProtoVectorListener("timestamped_classifications",(i,o)=>{(function(n,s){s.forEach(a=>{a=Vg(a),n.m.push($g(a))})})(this,i),Qr(this,o)}),this.g.attachEmptyPacketListener("timestamped_classifications",i=>{Qr(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function Yp(e){return{embeddings:Kc(e,Gg).map(t=>{let r={headIndex:wr(Bt(t,3))??0??-1,headName:br(Bt(t,4))??""??""};if(Df(t,Ac,hc(t,1))!==void 0){var i=void 0;t=at(t,Ac,hc(t,1)).l;let a=O(t),c=2&a?1:2;i=!!i;let l=Cf(t,a);var o=re(l);if(!(4&o)){(4&o||Object.isFrozen(l))&&(l=Ue(l),o=Sr(o,a,i),a=Y(t,a,1,l));for(var n=0,s=0;n<l.length;n++){let u=no(l[n]);u!=null&&(l[s++]=u)}s<n&&(l.length=s),o=pe(o=Pf(o,a,i),20,!0),o=pe(o,4096,!1),o=pe(o,8192,!1),J(l,o),2&o&&Object.freeze(l)}Yi(o)||(n=o,(s=c===1)?o=pe(o,2,!0):i||(o=pe(o,32,!1)),o!==n&&J(l,o),s&&Object.freeze(l)),c===2&&Yi(o)&&(l=Ue(l),o=Sr(o,a,i),J(l,o),Y(t,a,1,l)),r.floatEmbedding=l}else i=new Uint8Array(0),r.quantizedEmbedding=at(t,zg,hc(t,2))?.O()?.P()??i;return r}),timestampMs:Mf(_c(e))}}Ke.prototype.classify=Ke.prototype.R,Ke.prototype.setOptions=Ke.prototype.s,Ke.createFromModelPath=function(e,t){return wm(Ke,e,{baseOptions:{modelAssetPath:t}})},Ke.createFromModelBuffer=function(e,t){return Qi(Ke,e,{baseOptions:{modelAssetBuffer:t}})},Ke.createFromOptions=function(e,t){return Qi(Ke,e,t)};var St=class extends os{constructor(e,t){super(new bm(e,t)),this.m=[],ct(e=this.i=new mm,0,1,t=new is)}get baseOptions(){return at(this.i,is,1)}set baseOptions(e){ct(this.i,0,1,e)}s(e){var t=this.i,r=at(this.i,Wp,2);return r=r?xf(r):new Wp,e.l2Normalize!==void 0?fe(r,1,Bp(e.l2Normalize)):"l2Normalize"in e&&fe(r,1),e.quantize!==void 0?fe(r,2,Bp(e.quantize)):"quantize"in e&&fe(r,2),ct(t,0,2,r),Sm(this,e)}S(e,t){return this.G(e,t??this.H,this.u+1)}G(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),this.m}I(){var e=new ts;Ce(e,10,"audio_in"),Ce(e,10,"sample_rate"),Ce(e,15,"embeddings_out"),Ce(e,15,"timestamped_embeddings_out");let t=new am;Lf(t,Ug,this.i);let r=new ys;If(r,Jn("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Ce(r,3,"AUDIO:audio_in"),Ce(r,3,"SAMPLE_RATE:sample_rate"),Ce(r,4,"EMBEDDINGS:embeddings_out"),Ce(r,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),r.s(t),Bf(e,r),this.g.attachProtoListener("embeddings_out",(i,o)=>{i=qp(i),this.m.push(Yp(i)),Qr(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{Qr(this,i)}),this.g.attachProtoVectorListener("timestamped_embeddings_out",(i,o)=>{for(let n of i)i=qp(n),this.m.push(Yp(i));Qr(this,o)}),this.g.attachEmptyPacketListener("timestamped_embeddings_out",i=>{Qr(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}},Vn;St.prototype.embed=St.prototype.S,St.prototype.setOptions=St.prototype.s,St.createFromModelPath=function(e,t){return Qi(St,e,{baseOptions:{modelAssetPath:t}})},St.createFromModelBuffer=function(e,t){return Qi(St,e,{baseOptions:{modelAssetBuffer:t}})},St.createFromOptions=function(e,t){return Qi(St,e,t)};var Xg=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 Em(){if(Vn===void 0)try{await WebAssembly.instantiate(Xg),Vn=!0}catch{Vn=!1}return Vn}async function mc(e,t=""){let r=await Em()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var ei=class{};ei.forVisionTasks=function(e){return mc("vision",e)},ei.forTextTasks=function(e){return mc("text",e)},ei.forAudioTasks=function(e){return mc("audio",e)},ei.isSimdSupported=function(){return Em()};var vs=class{constructor(t,r,i,o,n,s,a){this.recordingInProgress=!1;this.recordIndex=1;this.countLoopTimes=0;this.examStartTime=0;this.recordingStartTime=0;this.recordingEndTime=0;this.isSpeech=!1;this.optionsProctoring=t,this.proctoringSession=r,this.paramsConfig=i,this.cameraRecorder=o,this.onRealtimeAlertsCallback=n,this.backend=s,this.backendToken=a}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Rt(this.proctoringId,this.backend))}async startRecording(){this.examStartTime=Date.now(),await this.createAudioClassifier(),this.audioRecorder=new Un(void 0,this.paramsConfig.audioBehaviourParameters),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetectedRecord(),200),this.streamingAudioClassification()}async stopRecording(){clearInterval(this.intervalNoiseDetection),await this.stopSoundRecord(),await this.volumeMeter.stop(),this.audioWorkletNode&&this.audioWorkletNode.disconnect()}async pauseRecording(){}async resumeRecording(){}async saveOnSession(t){}async onNoiseDetectedRecord(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Qt(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(i=>{console.log(i),this.volumeMeter=void 0}));let t=this.paramsConfig.audioBehaviourParameters?.noiseLimit||40,r=this.volumeMeter?.getVolume()||0;this.isSpeech=this.isSpeech||this.hasDesiredResult(this.audioClassificationResult),!this.isSpeech&&!this.recordingInProgress&&(t=t+t*.25),r>=t&&!this.recordingInProgress?(this.recordingInProgress=!0,this.audioRecorder.startRecording(),this.recordingStartTime=Date.now()-this.examStartTime):r<t&&this.recordingInProgress&&(Date.now()-this.recordingStartTime>=3e3&&this.countLoopTimes>4&&(await this.stopSoundRecord(),this.paramsConfig.videoBehaviourParameters?.detectNoise&&!this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.paramsConfig.videoBehaviourParameters?.detectSpeech&&this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Fala detectada",type:"audio_detection_on_stream"}),this.recordingInProgress=!1,this.recordIndex++,this.countLoopTimes=0,this.isSpeech=!1),this.countLoopTimes++)}async stopSoundRecord(){if(this.audioRecorder.stopRecording&&await this.audioRecorder.stopRecording(),this.recordingEndTime=Date.now()-this.examStartTime,this.optionsProctoring.proctoringType!=="REALTIME")return;let t=new File(this.audioRecorder.blobs,`EP_${this.proctoringSession.id}_${this.recordingStartTime}_${this.recordingEndTime}_${this.isSpeech?"speech":"noise"}.webm`,{type:"audio/webm"});this.uploadRecord(t),this.audioRecorder.blobs=[]}download(t){let r=URL.createObjectURL(t),i=document.createElement("a");document.body.appendChild(i),i.style.display="none",i.href=r,i.download=t.name,i.click(),window.URL.revokeObjectURL(r)}uploadRecord(t){t&&this.upload&&this.backendToken&&this.upload.upload({file:t},this.backendToken)}hasDesiredResult(t){if(t==null)return!1;for(let r of t){let i=r.name.toLowerCase().includes("speech");if(this.optionsProctoring.proctoringType!=="REALTIME")return i;let o=parseFloat(r.score)>.22;if(i&&o)return!0}return!1}async createAudioClassifier(){let t=await ei.forAudioTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@0.10.0/wasm");this.audioClassifier=await Ke.createFromOptions(t,{scoreThreshold:.15,maxResults:1,baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/audio_classifier/yamnet/float32/1/yamnet.tflite"}})}async streamingAudioClassification(){this.context=new AudioContext({sampleRate:16e3});try{await this.context.audioWorklet.addModule(URL.createObjectURL(new Blob([Kg],{type:"text/javascript"})))}catch{throw new Error("\u274C Error loading audio worklet module")}let t=this.context.createMediaStreamSource(this.cameraRecorder.cameraStream);this.audioWorkletNode=new AudioWorkletNode(this.context,"audio-processor"),this.audioWorkletNode.port.onmessage=r=>{let i=r.data,n=this.audioClassifier.classify(i)[0].classifications[0].categories;n.length>0&&(this.audioClassificationResult=[{name:n[0].categoryName,score:n[0].score.toFixed(3)}])},t.connect(this.audioWorkletNode),this.audioWorkletNode.connect(this.context.destination)}},Kg=`
|
|
222
|
+
class AudioProcessor extends AudioWorkletProcessor {
|
|
223
|
+
bufferSize;
|
|
224
|
+
inputBuffer;
|
|
225
|
+
bufferIndex;
|
|
226
|
+
|
|
227
|
+
constructor() {
|
|
228
|
+
super();
|
|
229
|
+
this.bufferSize = 16384;
|
|
230
|
+
this.inputBuffer = new Float32Array(this.bufferSize);
|
|
231
|
+
this.bufferIndex = 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
process(
|
|
235
|
+
inputs,
|
|
236
|
+
outputs,
|
|
237
|
+
parameters
|
|
238
|
+
) {
|
|
239
|
+
const input = inputs[0];
|
|
240
|
+
if (input.length > 0) {
|
|
241
|
+
const inputData = input[0];
|
|
242
|
+
|
|
243
|
+
for (let i = 0; i < inputData.length; i++) {
|
|
244
|
+
this.inputBuffer[this.bufferIndex++] = inputData[i];
|
|
245
|
+
|
|
246
|
+
if (this.bufferIndex === this.bufferSize) {
|
|
247
|
+
this.port.postMessage(this.inputBuffer);
|
|
248
|
+
this.bufferIndex = 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
registerProcessor("audio-processor", AudioProcessor);
|
|
258
|
+
`;var bs=class{constructor(t){this.blobs=[];this.blobsFinal=[];this.options=t}setProctoringId(t){this.proctoringId=t}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:t,allowMultipleMonitors:r,onStopSharingScreenCallback:i,onBufferSizeErrorCallback:o}=this.options,n={video:{cursor:"always",width:854,height:480,displaySurface:"monitor"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let s=this.screenStream.getVideoTracks();if(s[0].onended=i,navigator.userAgent.indexOf("Firefox")>-1){let g=s.find(h=>h.label=="");if(g&&t||g&&!r)throw Go}let c=s.find(g=>["screen:0:0","Primary Monitor"].includes(g.label))!=null,l=s.find(g=>["screen:0:0","Primary Monitor",""].includes(g.label)||["screen:"].some(h=>g.label.includes(h)))!=null,u=s.find(g=>["web-contents-media-stream","window"].some(h=>g.label.includes(h)))!=null;if(!c&&t)throw s.forEach(g=>{g.stop()}),Kl;if(!l||u)throw s.forEach(g=>{g.stop()}),Jl;let{startRecording:d,stopRecording:f}=ar(this.screenStream,this.blobs,this.proctoringId,this.options.onBufferSizeError,o);this.recordingStart=d,this.recordingStop=f,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var co=class{constructor(t,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=t,this.storeName=r}async save(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.put(t),r).then(()=>{})}async delete(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.delete(t),r)}async get(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.get(t),r).catch(()=>{})}async getDevices(t){let{transaction:r,store:i}=await this.connectToStore("readwrite");return this.processRequest(i.get(t),r).catch(()=>{})}async list(){let{transaction:t,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),t)}async clear(){let{transaction:t,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),t)}async processRequest(t,r){return new Promise((i,o)=>{t.onerror=n=>{o(t.error?.message)},t.onsuccess=n=>{r.commit(),i(t.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(t){let o=(await this.connect()).result.transaction(this.storeName,t),n=o.objectStore(this.storeName);return{transaction:o,store:n}}async connect(){return this.connection?this.connection:new Promise((t,r)=>{let i=window.indexedDB.open(this.dbName,this.dbVersion);i.onerror=o=>{r("Can't connect to IndexedDB")},i.onupgradeneeded=o=>{let n=i.result;n.onerror=s=>{},n.createObjectStore(this.storeName,{keyPath:"id"})},i.onsuccess=o=>{this.connection=i,t(i)}})}};function _m(){let e=navigator.userAgent,t;return e.match(/chrome|chromium|crios/i)?t="chrome":e.match(/firefox|fxios/i)?t="firefox":e.match(/safari/i)?t="safari":e.match(/opr\//i)?t="opera":e.match(/edg/i)?t="edge":t="No browser detection",t}function km(){return new Promise((e,t)=>{window.navigator.geolocation.getCurrentPosition(e,t)})}function lo(){let e=window.navigator.userAgent.split("SEB/");return e.length>1?e[1]:"1.0.0.0"}var ws=class{constructor(t,r){this.cpf=t,this.backend=r,this.capturePhoto=new Xr}async login(){let t=await this.capturePhoto.takePicture("Login com biometria facial","Encaixe seu rosto no formato e clique no bot\xE3o abaixo",{width:1280,height:720});return this.loading(),new Promise((r,i)=>{this.backend.loginAuth(this.cpf,t.base64.substr(22,t.base64.length)).then(o=>{this.token=o.token,document.querySelector("#authLoader")?.remove(),this.backend.token=this.token,r(this.token)}).catch(o=>{console.log(o),document.querySelector("#authLoader")?.remove(),i(o)})})}loading(){let t=document.createElement("div");t.setAttribute("id","authLoader"),t.style.backgroundColor="rgba(0,0,0,0.4)",t.style.zIndex="1000",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100vh",t.style.width="100%",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center";let r=document.createElement("div");r.setAttribute("class","loader"),t.appendChild(r),document.body.appendChild(t);let i=`
|
|
222
259
|
.loader {
|
|
223
260
|
border: 6px solid #f3f3f3;
|
|
224
261
|
border-radius: 50%;
|
|
@@ -239,7 +276,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`),n.setAttribute("class","che
|
|
|
239
276
|
0% { transform: rotate(0deg); }
|
|
240
277
|
100% { transform: rotate(360deg); }
|
|
241
278
|
}
|
|
242
|
-
`,o=document.createElement("style");o.innerHTML=i,document.head.appendChild(o)}};var Ss=class{constructor(t){this.context=t;this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{frames:40,useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectFace:!1,detectPerson:!1,detectCellPhone:!1,detectNoise:!1,detectSpeech:!1}};this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onChangeDevicesCallback=t=>{};this.onRealtimeAlertsCallback=t=>{};this.onBufferSizeErrorCallback=()=>{};this.backend=new Kr({type:t.type||"prod",token:t.token}),this.repository=new co("EasyProctorDb","exams2"),this.repositoryDevices=new co("EasyProctorDbDevices","devices"),this.context.credentials?.cpf&&(this.auth=new ws(this.context.credentials.cpf,this.backend))}setOnStopSharingScreenCallback(t){this.onStopSharingScreenCallback=()=>{I.registerStopSharingScreen(this.proctoringId,"Stop sharing screen"),t()}}setOnLostFocusCallback(t){this.onLostFocusCallback=()=>t()}setOnFocusCallback(t){this.onFocusCallback=()=>t()}async onChangeDevices(t={}){new Bn(this.repositoryDevices,this.proctoringId).startRecording(t),this.onChangeDevicesCallback=i=>t.status&&t.status(i)}async onRealtimeAlerts(t={}){this.onRealtimeAlertsCallback=r=>t.data&&t.data(r)}setOnBufferSizeErrorCallback(t){this.onBufferSizeErrorCallback=()=>t()}createRecorders(t=er){this.onChangeDevices();let r=new wt({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId,onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback(),proctoringType:this.sessionOptions.proctoringType,onChangeDevicesCallback:a=>this.onChangeDevicesCallback(a),onRealtimeAlertsCallback:a=>this.onRealtimeAlertsCallback(a)},{width:this.videoOptions.width,height:this.videoOptions.height,minWidth:this.videoOptions.minWidth,minHeight:this.videoOptions.minHeight},this.paramsConfig,this.backend,this.context.token),i=this.sessionOptions.captureScreen?new bs({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,allowMultipleMonitors:this.sessionOptions.allowMultipleMonitors??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback(),onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback()}):void 0,o=new Ln({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback()},t
|
|
279
|
+
`,o=document.createElement("style");o.innerHTML=i,document.head.appendChild(o)}};var Ss=class{constructor(t){this.context=t;this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{frames:40,useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectFace:!1,detectPerson:!1,detectCellPhone:!1,detectNoise:!1,detectSpeech:!1}};this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onChangeDevicesCallback=t=>{};this.onRealtimeAlertsCallback=t=>{};this.onBufferSizeErrorCallback=()=>{};this.backend=new Kr({type:t.type||"prod",token:t.token}),this.repository=new co("EasyProctorDb","exams2"),this.repositoryDevices=new co("EasyProctorDbDevices","devices"),this.context.credentials?.cpf&&(this.auth=new ws(this.context.credentials.cpf,this.backend))}setOnStopSharingScreenCallback(t){this.onStopSharingScreenCallback=()=>{I.registerStopSharingScreen(this.proctoringId,"Stop sharing screen"),t()}}setOnLostFocusCallback(t){this.onLostFocusCallback=()=>t()}setOnFocusCallback(t){this.onFocusCallback=()=>t()}async onChangeDevices(t={}){new Bn(this.repositoryDevices,this.proctoringId).startRecording(t),this.onChangeDevicesCallback=i=>t.status&&t.status(i)}async onRealtimeAlerts(t={}){this.onRealtimeAlertsCallback=r=>t.data&&t.data(r)}setOnBufferSizeErrorCallback(t){this.onBufferSizeErrorCallback=()=>t()}createRecorders(t=er){this.onChangeDevices();let r=new wt({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId,onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback(),proctoringType:this.sessionOptions.proctoringType,onChangeDevicesCallback:a=>this.onChangeDevicesCallback(a),onRealtimeAlertsCallback:a=>this.onRealtimeAlertsCallback(a)},{width:this.videoOptions.width,height:this.videoOptions.height,minWidth:this.videoOptions.minWidth,minHeight:this.videoOptions.minHeight},this.paramsConfig,this.backend,this.context.token),i=this.sessionOptions.captureScreen?new bs({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,allowMultipleMonitors:this.sessionOptions.allowMultipleMonitors??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback(),onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback()}):void 0,o=new Ln({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback()},t),n=new vs(t,this.proctoringSession,this.paramsConfig,r,a=>this.onRealtimeAlertsCallback(a),this.backend,this.context.token),s=[r,i,o].filter(Boolean);return s.push(n),this.recorder=new Mn(this.proctoringSession,s),{cameraRecorder:r,screenRecorder:i,alertRecorder:o,noiseRecorder:n}}async login(){if(!this.context.credentials?.cpf)throw ru;this.context.token=await this.auth.login()}async start(t=er,r={}){try{if(this.context.token===void 0)throw tu;this.extension=new Fn,this.extension.addEventListener();let i=this.backend.selectBaseUrl(this.context.type),o=await Qe();if(await this.repositoryDevices.save({...o,id:"devices"}),this.sessionOptions={...er,...t},this.videoOptions=Dn(r),await this.initConfig(t.useGeolocation),await this.verifyBrowser(),this.sessionOptions.captureScreen&&await this.verifyMultipleMonitors(this.sessionOptions),this.state!="Stop")throw Yl;this.state="Starting",await this.repository.hasSessions()&&await this.repository.clear(),this.proctoringSession=new To,this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll();let n=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType,this.geolocation?this.geolocation.coords.latitude:void 0,this.geolocation?this.geolocation.coords.longitude:void 0);this.proctoringId=n.id,this.allRecorders.cameraRecorder.setProctoringId(this.proctoringId),this.allRecorders.noiseRecorder.setProctoringId(this.proctoringId),this.proctoringSession.setProctoringId(this.proctoringId),await this.repository.save(this.proctoringSession);let s={};for(let a in navigator)s[a]=navigator[a];return I.registerStart(this.proctoringId,!0,`Version: ${lo()}
|
|
243
280
|
Navigator: ${JSON.stringify(s)}`),n.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(n.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",n}catch(i){throw await this.cancel(),this.proctoringId&&I.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
|
|
244
281
|
Version: ${lo()}
|
|
245
282
|
Navigator: ${navigator}
|
|
@@ -251,5 +288,5 @@ Upload Services: ${i}
|
|
|
251
288
|
Upload backup for Safe Browser`,this.serviceType)}))}),I.registerUpload(this.proctoringSession.id,!0,`upload success
|
|
252
289
|
|
|
253
290
|
Upload Services: ${i}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(n=>{I.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+n)}),await this.backend.finishAndSendUrls(this.context,this.proctoringSession).then(()=>{I.registerFinish(this.proctoringSession.id,!0,"")}).catch(n=>{I.registerFinish(this.proctoringSession.id,!1,"finish error: "+n)}),this.state="Stop"}catch(r){throw await this.cancel(),I.registerFinish(this.proctoringId,!1,`Token: ${this.context.token}
|
|
254
|
-
Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await
|
|
255
|
-
Tentativa utilizando o browser ${t}`),eu}async initConfig(t){try{let r=await this.backend.getParamsConfig(this.context);this.paramsConfig={...this.paramsConfig,...r,audioBehaviourParameters:{...this.paramsConfig.audioBehaviourParameters,...r.audioBehaviourParameters},imageBehaviourParameters:{...this.paramsConfig.imageBehaviourParameters,...r.imageBehaviourParameters},videoBehaviourParameters:{...this.paramsConfig.videoBehaviourParameters,...r.videoBehaviourParameters}},t&&(this.geolocation=await km().then(i=>i).catch(i=>{throw i.message})),gl(this.backend)}catch(r){throw this.proctoringId&&I.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),r}}async getServerDate(){let t=await this.backend.getServerHour(this.context.token).catch(i=>{I.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return t?new Date(t.toString()):new Date}async pause(){if(this.state!=="Recording")throw I.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),Ho;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw Ho;return await this.verifyBrowser(),await this.verifyMultipleMonitors(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function Qc(e,t="prod"){e.showConsole||(console.log=()=>{},console.warn=()=>{},console.error=()=>{});let r=new Ss({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials,showConsole:e.showConsole}),i=new $i({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials,showConsole:e.showConsole}),o=new Xr,n=r.login.bind(r),s=r.start.bind(r),a=r.finish.bind(r),c=r.pause.bind(r),l=r.resume.bind(r),u=r.setOnFocusCallback.bind(r),d=r.setOnLostFocusCallback.bind(r),f=r.onChangeDevices.bind(r),g=r.setOnBufferSizeErrorCallback.bind(r),h=r.setOnStopSharingScreenCallback.bind(r),m=r.onRealtimeAlerts.bind(r),y=i.checkDevices.bind(i),b=o.takePicture.bind(o);return{login:n,start:s,finish:a,onFocus:u,onLostFocus:d,onChangeDevices:f,onBufferSizeError:g,onRealtimeAlerts:m,checkDevices:y,capturePhoto:b,enumarateDevices:Qe,checkPermissions:Ao,checkIfhasMultipleMonitors:
|
|
291
|
+
Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await xo())throw I.registerError(this.proctoringId,"Multiplas telas detectadas!"),Go}async verifyBrowser(){let t=await _m();if(t!=="chrome"&&t!=="firefox")throw I.registerBrowserNotSupported(this.proctoringId,`Browser n\xE3o suportado:
|
|
292
|
+
Tentativa utilizando o browser ${t}`),eu}async initConfig(t){try{let r=await this.backend.getParamsConfig(this.context);this.paramsConfig={...this.paramsConfig,...r,audioBehaviourParameters:{...this.paramsConfig.audioBehaviourParameters,...r.audioBehaviourParameters},imageBehaviourParameters:{...this.paramsConfig.imageBehaviourParameters,...r.imageBehaviourParameters},videoBehaviourParameters:{...this.paramsConfig.videoBehaviourParameters,...r.videoBehaviourParameters}},t&&(this.geolocation=await km().then(i=>i).catch(i=>{throw i.message})),gl(this.backend)}catch(r){throw this.proctoringId&&I.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),r}}async getServerDate(){let t=await this.backend.getServerHour(this.context.token).catch(i=>{I.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return t?new Date(t.toString()):new Date}async pause(){if(this.state!=="Recording")throw I.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),Ho;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw Ho;return await this.verifyBrowser(),await this.verifyMultipleMonitors(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function Qc(e,t="prod"){e.showConsole||(console.log=()=>{},console.warn=()=>{},console.error=()=>{});let r=new Ss({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials,showConsole:e.showConsole}),i=new $i({type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials,showConsole:e.showConsole}),o=new Xr,n=r.login.bind(r),s=r.start.bind(r),a=r.finish.bind(r),c=r.pause.bind(r),l=r.resume.bind(r),u=r.setOnFocusCallback.bind(r),d=r.setOnLostFocusCallback.bind(r),f=r.onChangeDevices.bind(r),g=r.setOnBufferSizeErrorCallback.bind(r),h=r.setOnStopSharingScreenCallback.bind(r),m=r.onRealtimeAlerts.bind(r),y=i.checkDevices.bind(i),b=o.takePicture.bind(o);return{login:n,start:s,finish:a,onFocus:u,onLostFocus:d,onChangeDevices:f,onBufferSizeError:g,onRealtimeAlerts:m,checkDevices:y,capturePhoto:b,enumarateDevices:Qe,checkPermissions:Ao,checkIfhasMultipleMonitors:xo,onStopSharingScreen:h}}typeof window<"u"&&(window.useProctoring=Qc);})();
|